@coralai/sps-cli 0.58.28 → 0.58.29
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/dist/console-assets/assets/index-BIbr0M7C.css +10 -0
- package/dist/console-assets/assets/index-CBx2UTEQ.js +681 -0
- package/dist/console-assets/index.html +2 -2
- package/dist/main.js +26 -4
- package/dist/main.js.map +1 -1
- package/package.json +1 -1
- package/skills/sps-chat/SKILL.md +19 -4
- package/skills/sps-pipeline/SKILL.md +13 -3
- package/dist/console-assets/assets/index-BrFYuxGR.js +0 -671
- package/dist/console-assets/assets/index-Bvm7gLHu.css +0 -10
|
@@ -1,671 +0,0 @@
|
|
|
1
|
-
var HM=Object.defineProperty;var D1=e=>{throw TypeError(e)};var KM=(e,t,n)=>t in e?HM(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var O1=(e,t,n)=>KM(e,typeof t!="symbol"?t+"":t,n),kg=(e,t,n)=>t.has(e)||D1("Cannot "+n);var X=(e,t,n)=>(kg(e,t,"read from private field"),n?n.call(e):t.get(e)),Qe=(e,t,n)=>t.has(e)?D1("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),Ie=(e,t,n,r)=>(kg(e,t,"write to private field"),r?r.call(e,n):t.set(e,n),n),ut=(e,t,n)=>(kg(e,t,"access private method"),n);var xf=(e,t,n,r)=>({set _(a){Ie(e,t,a,n)},get _(){return X(e,t,r)}});(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))r(a);new MutationObserver(a=>{for(const o of a)if(o.type==="childList")for(const l of o.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&r(l)}).observe(document,{childList:!0,subtree:!0});function n(a){const o={};return a.integrity&&(o.integrity=a.integrity),a.referrerPolicy&&(o.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?o.credentials="include":a.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function r(a){if(a.ep)return;a.ep=!0;const o=n(a);fetch(a.href,o)}})();function qu(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var Eg={exports:{}},Xc={};/**
|
|
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 R1;function GM(){if(R1)return Xc;R1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.fragment");function n(r,a,o){var l=null;if(o!==void 0&&(l=""+o),a.key!==void 0&&(l=""+a.key),"key"in a){o={};for(var d in a)d!=="key"&&(o[d]=a[d])}else o=a;return a=o.ref,{$$typeof:e,type:r,key:l,ref:a!==void 0?a:null,props:o}}return Xc.Fragment=t,Xc.jsx=n,Xc.jsxs=n,Xc}var L1;function VM(){return L1||(L1=1,Eg.exports=GM()),Eg.exports}var c=VM(),Sg={exports:{}},at={};/**
|
|
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 I1;function YM(){if(I1)return at;I1=1;var e=Symbol.for("react.transitional.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),f=Symbol.for("react.suspense"),h=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),y=Symbol.iterator;function b(P){return P===null||typeof P!="object"?null:(P=y&&P[y]||P["@@iterator"],typeof P=="function"?P:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,N={};function E(P,G,B){this.props=P,this.context=G,this.refs=N,this.updater=B||k}E.prototype.isReactComponent={},E.prototype.setState=function(P,G){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,G,"setState")},E.prototype.forceUpdate=function(P){this.updater.enqueueForceUpdate(this,P,"forceUpdate")};function C(){}C.prototype=E.prototype;function S(P,G,B){this.props=P,this.context=G,this.refs=N,this.updater=B||k}var _=S.prototype=new C;_.constructor=S,v(_,E.prototype),_.isPureReactComponent=!0;var M=Array.isArray;function T(){}var L={H:null,A:null,T:null,S:null},R=Object.prototype.hasOwnProperty;function $(P,G,B){var oe=B.ref;return{$$typeof:e,type:P,key:G,ref:oe!==void 0?oe:null,props:B}}function z(P,G){return $(P.type,G,P.props)}function q(P){return typeof P=="object"&&P!==null&&P.$$typeof===e}function F(P){var G={"=":"=0",":":"=2"};return"$"+P.replace(/[=:]/g,function(B){return G[B]})}var Y=/\/+/g;function D(P,G){return typeof P=="object"&&P!==null&&P.key!=null?F(""+P.key):G.toString(36)}function H(P){switch(P.status){case"fulfilled":return P.value;case"rejected":throw P.reason;default:switch(typeof P.status=="string"?P.then(T,T):(P.status="pending",P.then(function(G){P.status==="pending"&&(P.status="fulfilled",P.value=G)},function(G){P.status==="pending"&&(P.status="rejected",P.reason=G)})),P.status){case"fulfilled":return P.value;case"rejected":throw P.reason}}throw P}function O(P,G,B,oe,ve){var ke=typeof P;(ke==="undefined"||ke==="boolean")&&(P=null);var Se=!1;if(P===null)Se=!0;else switch(ke){case"bigint":case"string":case"number":Se=!0;break;case"object":switch(P.$$typeof){case e:case t:Se=!0;break;case g:return Se=P._init,O(Se(P._payload),G,B,oe,ve)}}if(Se)return ve=ve(P),Se=oe===""?"."+D(P,0):oe,M(ve)?(B="",Se!=null&&(B=Se.replace(Y,"$&/")+"/"),O(ve,G,B,"",function(Te){return Te})):ve!=null&&(q(ve)&&(ve=z(ve,B+(ve.key==null||P&&P.key===ve.key?"":(""+ve.key).replace(Y,"$&/")+"/")+Se)),G.push(ve)),1;Se=0;var J=oe===""?".":oe+":";if(M(P))for(var ue=0;ue<P.length;ue++)oe=P[ue],ke=J+D(oe,ue),Se+=O(oe,G,B,ke,ve);else if(ue=b(P),typeof ue=="function")for(P=ue.call(P),ue=0;!(oe=P.next()).done;)oe=oe.value,ke=J+D(oe,ue++),Se+=O(oe,G,B,ke,ve);else if(ke==="object"){if(typeof P.then=="function")return O(H(P),G,B,oe,ve);throw G=String(P),Error("Objects are not valid as a React child (found: "+(G==="[object Object]"?"object with keys {"+Object.keys(P).join(", ")+"}":G)+"). If you meant to render a collection of children, use an array instead.")}return Se}function V(P,G,B){if(P==null)return P;var oe=[],ve=0;return O(P,oe,"","",function(ke){return G.call(B,ke,ve++)}),oe}function Q(P){if(P._status===-1){var G=P._result;G=G(),G.then(function(B){(P._status===0||P._status===-1)&&(P._status=1,P._result=B)},function(B){(P._status===0||P._status===-1)&&(P._status=2,P._result=B)}),P._status===-1&&(P._status=0,P._result=G)}if(P._status===1)return P._result.default;throw P._result}var K=typeof reportError=="function"?reportError:function(P){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var G=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(G))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",P);return}console.error(P)},I={map:V,forEach:function(P,G,B){V(P,function(){G.apply(this,arguments)},B)},count:function(P){var G=0;return V(P,function(){G++}),G},toArray:function(P){return V(P,function(G){return G})||[]},only:function(P){if(!q(P))throw Error("React.Children.only expected to receive a single React element child.");return P}};return at.Activity=m,at.Children=I,at.Component=E,at.Fragment=n,at.Profiler=a,at.PureComponent=S,at.StrictMode=r,at.Suspense=f,at.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=L,at.__COMPILER_RUNTIME={__proto__:null,c:function(P){return L.H.useMemoCache(P)}},at.cache=function(P){return function(){return P.apply(null,arguments)}},at.cacheSignal=function(){return null},at.cloneElement=function(P,G,B){if(P==null)throw Error("The argument must be a React element, but you passed "+P+".");var oe=v({},P.props),ve=P.key;if(G!=null)for(ke in G.key!==void 0&&(ve=""+G.key),G)!R.call(G,ke)||ke==="key"||ke==="__self"||ke==="__source"||ke==="ref"&&G.ref===void 0||(oe[ke]=G[ke]);var ke=arguments.length-2;if(ke===1)oe.children=B;else if(1<ke){for(var Se=Array(ke),J=0;J<ke;J++)Se[J]=arguments[J+2];oe.children=Se}return $(P.type,ve,oe)},at.createContext=function(P){return P={$$typeof:l,_currentValue:P,_currentValue2:P,_threadCount:0,Provider:null,Consumer:null},P.Provider=P,P.Consumer={$$typeof:o,_context:P},P},at.createElement=function(P,G,B){var oe,ve={},ke=null;if(G!=null)for(oe in G.key!==void 0&&(ke=""+G.key),G)R.call(G,oe)&&oe!=="key"&&oe!=="__self"&&oe!=="__source"&&(ve[oe]=G[oe]);var Se=arguments.length-2;if(Se===1)ve.children=B;else if(1<Se){for(var J=Array(Se),ue=0;ue<Se;ue++)J[ue]=arguments[ue+2];ve.children=J}if(P&&P.defaultProps)for(oe in Se=P.defaultProps,Se)ve[oe]===void 0&&(ve[oe]=Se[oe]);return $(P,ke,ve)},at.createRef=function(){return{current:null}},at.forwardRef=function(P){return{$$typeof:d,render:P}},at.isValidElement=q,at.lazy=function(P){return{$$typeof:g,_payload:{_status:-1,_result:P},_init:Q}},at.memo=function(P,G){return{$$typeof:h,type:P,compare:G===void 0?null:G}},at.startTransition=function(P){var G=L.T,B={};L.T=B;try{var oe=P(),ve=L.S;ve!==null&&ve(B,oe),typeof oe=="object"&&oe!==null&&typeof oe.then=="function"&&oe.then(T,K)}catch(ke){K(ke)}finally{G!==null&&B.types!==null&&(G.types=B.types),L.T=G}},at.unstable_useCacheRefresh=function(){return L.H.useCacheRefresh()},at.use=function(P){return L.H.use(P)},at.useActionState=function(P,G,B){return L.H.useActionState(P,G,B)},at.useCallback=function(P,G){return L.H.useCallback(P,G)},at.useContext=function(P){return L.H.useContext(P)},at.useDebugValue=function(){},at.useDeferredValue=function(P,G){return L.H.useDeferredValue(P,G)},at.useEffect=function(P,G){return L.H.useEffect(P,G)},at.useEffectEvent=function(P){return L.H.useEffectEvent(P)},at.useId=function(){return L.H.useId()},at.useImperativeHandle=function(P,G,B){return L.H.useImperativeHandle(P,G,B)},at.useInsertionEffect=function(P,G){return L.H.useInsertionEffect(P,G)},at.useLayoutEffect=function(P,G){return L.H.useLayoutEffect(P,G)},at.useMemo=function(P,G){return L.H.useMemo(P,G)},at.useOptimistic=function(P,G){return L.H.useOptimistic(P,G)},at.useReducer=function(P,G,B){return L.H.useReducer(P,G,B)},at.useRef=function(P){return L.H.useRef(P)},at.useState=function(P){return L.H.useState(P)},at.useSyncExternalStore=function(P,G,B){return L.H.useSyncExternalStore(P,G,B)},at.useTransition=function(){return L.H.useTransition()},at.version="19.2.5",at}var z1;function Hu(){return z1||(z1=1,Sg.exports=YM()),Sg.exports}var j=Hu();const QM=qu(j);var Ng={exports:{}},Zc={},_g={exports:{}},jg={};/**
|
|
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 P1;function WM(){return P1||(P1=1,(function(e){function t(O,V){var Q=O.length;O.push(V);e:for(;0<Q;){var K=Q-1>>>1,I=O[K];if(0<a(I,V))O[K]=V,O[Q]=I,Q=K;else break e}}function n(O){return O.length===0?null:O[0]}function r(O){if(O.length===0)return null;var V=O[0],Q=O.pop();if(Q!==V){O[0]=Q;e:for(var K=0,I=O.length,P=I>>>1;K<P;){var G=2*(K+1)-1,B=O[G],oe=G+1,ve=O[oe];if(0>a(B,Q))oe<I&&0>a(ve,B)?(O[K]=ve,O[oe]=Q,K=oe):(O[K]=B,O[G]=Q,K=G);else if(oe<I&&0>a(ve,Q))O[K]=ve,O[oe]=Q,K=oe;else break e}}return V}function a(O,V){var Q=O.sortIndex-V.sortIndex;return Q!==0?Q:O.id-V.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;e.unstable_now=function(){return o.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var f=[],h=[],g=1,m=null,y=3,b=!1,k=!1,v=!1,N=!1,E=typeof setTimeout=="function"?setTimeout:null,C=typeof clearTimeout=="function"?clearTimeout:null,S=typeof setImmediate<"u"?setImmediate:null;function _(O){for(var V=n(h);V!==null;){if(V.callback===null)r(h);else if(V.startTime<=O)r(h),V.sortIndex=V.expirationTime,t(f,V);else break;V=n(h)}}function M(O){if(v=!1,_(O),!k)if(n(f)!==null)k=!0,T||(T=!0,F());else{var V=n(h);V!==null&&H(M,V.startTime-O)}}var T=!1,L=-1,R=5,$=-1;function z(){return N?!0:!(e.unstable_now()-$<R)}function q(){if(N=!1,T){var O=e.unstable_now();$=O;var V=!0;try{e:{k=!1,v&&(v=!1,C(L),L=-1),b=!0;var Q=y;try{t:{for(_(O),m=n(f);m!==null&&!(m.expirationTime>O&&z());){var K=m.callback;if(typeof K=="function"){m.callback=null,y=m.priorityLevel;var I=K(m.expirationTime<=O);if(O=e.unstable_now(),typeof I=="function"){m.callback=I,_(O),V=!0;break t}m===n(f)&&r(f),_(O)}else r(f);m=n(f)}if(m!==null)V=!0;else{var P=n(h);P!==null&&H(M,P.startTime-O),V=!1}}break e}finally{m=null,y=Q,b=!1}V=void 0}}finally{V?F():T=!1}}}var F;if(typeof S=="function")F=function(){S(q)};else if(typeof MessageChannel<"u"){var Y=new MessageChannel,D=Y.port2;Y.port1.onmessage=q,F=function(){D.postMessage(null)}}else F=function(){E(q,0)};function H(O,V){L=E(function(){O(e.unstable_now())},V)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(O){O.callback=null},e.unstable_forceFrameRate=function(O){0>O||125<O?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):R=0<O?Math.floor(1e3/O):5},e.unstable_getCurrentPriorityLevel=function(){return y},e.unstable_next=function(O){switch(y){case 1:case 2:case 3:var V=3;break;default:V=y}var Q=y;y=V;try{return O()}finally{y=Q}},e.unstable_requestPaint=function(){N=!0},e.unstable_runWithPriority=function(O,V){switch(O){case 1:case 2:case 3:case 4:case 5:break;default:O=3}var Q=y;y=O;try{return V()}finally{y=Q}},e.unstable_scheduleCallback=function(O,V,Q){var K=e.unstable_now();switch(typeof Q=="object"&&Q!==null?(Q=Q.delay,Q=typeof Q=="number"&&0<Q?K+Q:K):Q=K,O){case 1:var I=-1;break;case 2:I=250;break;case 5:I=1073741823;break;case 4:I=1e4;break;default:I=5e3}return I=Q+I,O={id:g++,callback:V,priorityLevel:O,startTime:Q,expirationTime:I,sortIndex:-1},Q>K?(O.sortIndex=Q,t(h,O),n(f)===null&&O===n(h)&&(v?(C(L),L=-1):v=!0,H(M,Q-K))):(O.sortIndex=I,t(f,O),k||b||(k=!0,T||(T=!0,F()))),O},e.unstable_shouldYield=z,e.unstable_wrapCallback=function(O){var V=y;return function(){var Q=y;y=V;try{return O.apply(this,arguments)}finally{y=Q}}}})(jg)),jg}var B1;function XM(){return B1||(B1=1,_g.exports=WM()),_g.exports}var Cg={exports:{}},Hn={};/**
|
|
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 $1;function ZM(){if($1)return Hn;$1=1;var e=Hu();function t(f){var h="https://react.dev/errors/"+f;if(1<arguments.length){h+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)h+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+f+"; visit "+h+" 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(t(522))},D:n,C:n,L:n,m:n,X:n,S:n,M:n},p:0,findDOMNode:null},a=Symbol.for("react.portal");function o(f,h,g){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:m==null?null:""+m,children:f,containerInfo:h,implementation:g}}var l=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(f,h){if(f==="font")return"";if(typeof h=="string")return h==="use-credentials"?h:""}return Hn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Hn.createPortal=function(f,h){var g=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!h||h.nodeType!==1&&h.nodeType!==9&&h.nodeType!==11)throw Error(t(299));return o(f,h,null,g)},Hn.flushSync=function(f){var h=l.T,g=r.p;try{if(l.T=null,r.p=2,f)return f()}finally{l.T=h,r.p=g,r.d.f()}},Hn.preconnect=function(f,h){typeof f=="string"&&(h?(h=h.crossOrigin,h=typeof h=="string"?h==="use-credentials"?h:"":void 0):h=null,r.d.C(f,h))},Hn.prefetchDNS=function(f){typeof f=="string"&&r.d.D(f)},Hn.preinit=function(f,h){if(typeof f=="string"&&h&&typeof h.as=="string"){var g=h.as,m=d(g,h.crossOrigin),y=typeof h.integrity=="string"?h.integrity:void 0,b=typeof h.fetchPriority=="string"?h.fetchPriority:void 0;g==="style"?r.d.S(f,typeof h.precedence=="string"?h.precedence:void 0,{crossOrigin:m,integrity:y,fetchPriority:b}):g==="script"&&r.d.X(f,{crossOrigin:m,integrity:y,fetchPriority:b,nonce:typeof h.nonce=="string"?h.nonce:void 0})}},Hn.preinitModule=function(f,h){if(typeof f=="string")if(typeof h=="object"&&h!==null){if(h.as==null||h.as==="script"){var g=d(h.as,h.crossOrigin);r.d.M(f,{crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0})}}else h==null&&r.d.M(f)},Hn.preload=function(f,h){if(typeof f=="string"&&typeof h=="object"&&h!==null&&typeof h.as=="string"){var g=h.as,m=d(g,h.crossOrigin);r.d.L(f,g,{crossOrigin:m,integrity:typeof h.integrity=="string"?h.integrity:void 0,nonce:typeof h.nonce=="string"?h.nonce:void 0,type:typeof h.type=="string"?h.type:void 0,fetchPriority:typeof h.fetchPriority=="string"?h.fetchPriority:void 0,referrerPolicy:typeof h.referrerPolicy=="string"?h.referrerPolicy:void 0,imageSrcSet:typeof h.imageSrcSet=="string"?h.imageSrcSet:void 0,imageSizes:typeof h.imageSizes=="string"?h.imageSizes:void 0,media:typeof h.media=="string"?h.media:void 0})}},Hn.preloadModule=function(f,h){if(typeof f=="string")if(h){var g=d(h.as,h.crossOrigin);r.d.m(f,{as:typeof h.as=="string"&&h.as!=="script"?h.as:void 0,crossOrigin:g,integrity:typeof h.integrity=="string"?h.integrity:void 0})}else r.d.m(f)},Hn.requestFormReset=function(f){r.d.r(f)},Hn.unstable_batchedUpdates=function(f,h){return f(h)},Hn.useFormState=function(f,h,g){return l.H.useFormState(f,h,g)},Hn.useFormStatus=function(){return l.H.useHostTransitionStatus()},Hn.version="19.2.5",Hn}var U1;function oN(){if(U1)return Cg.exports;U1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Cg.exports=ZM(),Cg.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 F1;function JM(){if(F1)return Zc;F1=1;var e=XM(),t=Hu(),n=oN();function r(i){var s="https://react.dev/errors/"+i;if(1<arguments.length){s+="?args[]="+encodeURIComponent(arguments[1]);for(var u=2;u<arguments.length;u++)s+="&args[]="+encodeURIComponent(arguments[u])}return"Minified React error #"+i+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(i){return!(!i||i.nodeType!==1&&i.nodeType!==9&&i.nodeType!==11)}function o(i){var s=i,u=i;if(i.alternate)for(;s.return;)s=s.return;else{i=s;do s=i,(s.flags&4098)!==0&&(u=s.return),i=s.return;while(i)}return s.tag===3?u:null}function l(i){if(i.tag===13){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function d(i){if(i.tag===31){var s=i.memoizedState;if(s===null&&(i=i.alternate,i!==null&&(s=i.memoizedState)),s!==null)return s.dehydrated}return null}function f(i){if(o(i)!==i)throw Error(r(188))}function h(i){var s=i.alternate;if(!s){if(s=o(i),s===null)throw Error(r(188));return s!==i?null:i}for(var u=i,p=s;;){var x=u.return;if(x===null)break;var w=x.alternate;if(w===null){if(p=x.return,p!==null){u=p;continue}break}if(x.child===w.child){for(w=x.child;w;){if(w===u)return f(x),i;if(w===p)return f(x),s;w=w.sibling}throw Error(r(188))}if(u.return!==p.return)u=x,p=w;else{for(var A=!1,U=x.child;U;){if(U===u){A=!0,u=x,p=w;break}if(U===p){A=!0,p=x,u=w;break}U=U.sibling}if(!A){for(U=w.child;U;){if(U===u){A=!0,u=w,p=x;break}if(U===p){A=!0,p=w,u=x;break}U=U.sibling}if(!A)throw Error(r(189))}}if(u.alternate!==p)throw Error(r(190))}if(u.tag!==3)throw Error(r(188));return u.stateNode.current===u?i:s}function g(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i;for(i=i.child;i!==null;){if(s=g(i),s!==null)return s;i=i.sibling}return null}var m=Object.assign,y=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),N=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),C=Symbol.for("react.consumer"),S=Symbol.for("react.context"),_=Symbol.for("react.forward_ref"),M=Symbol.for("react.suspense"),T=Symbol.for("react.suspense_list"),L=Symbol.for("react.memo"),R=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),z=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function F(i){return i===null||typeof i!="object"?null:(i=q&&i[q]||i["@@iterator"],typeof i=="function"?i:null)}var Y=Symbol.for("react.client.reference");function D(i){if(i==null)return null;if(typeof i=="function")return i.$$typeof===Y?null:i.displayName||i.name||null;if(typeof i=="string")return i;switch(i){case v:return"Fragment";case E:return"Profiler";case N:return"StrictMode";case M:return"Suspense";case T:return"SuspenseList";case $:return"Activity"}if(typeof i=="object")switch(i.$$typeof){case k:return"Portal";case S:return i.displayName||"Context";case C:return(i._context.displayName||"Context")+".Consumer";case _:var s=i.render;return i=i.displayName,i||(i=s.displayName||s.name||"",i=i!==""?"ForwardRef("+i+")":"ForwardRef"),i;case L:return s=i.displayName||null,s!==null?s:D(i.type)||"Memo";case R:s=i._payload,i=i._init;try{return D(i(s))}catch{}}return null}var H=Array.isArray,O=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,V=n.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Q={pending:!1,data:null,method:null,action:null},K=[],I=-1;function P(i){return{current:i}}function G(i){0>I||(i.current=K[I],K[I]=null,I--)}function B(i,s){I++,K[I]=i.current,i.current=s}var oe=P(null),ve=P(null),ke=P(null),Se=P(null);function J(i,s){switch(B(ke,s),B(ve,i),B(oe,null),s.nodeType){case 9:case 11:i=(i=s.documentElement)&&(i=i.namespaceURI)?t1(i):0;break;default:if(i=s.tagName,s=s.namespaceURI)s=t1(s),i=n1(s,i);else switch(i){case"svg":i=1;break;case"math":i=2;break;default:i=0}}G(oe),B(oe,i)}function ue(){G(oe),G(ve),G(ke)}function Te(i){i.memoizedState!==null&&B(Se,i);var s=oe.current,u=n1(s,i.type);s!==u&&(B(ve,i),B(oe,u))}function Oe(i){ve.current===i&&(G(oe),G(ve)),Se.current===i&&(G(Se),Vc._currentValue=Q)}var De,ce;function Ce(i){if(De===void 0)try{throw Error()}catch(u){var s=u.stack.trim().match(/\n( *(at )?)/);De=s&&s[1]||"",ce=-1<u.stack.indexOf(`
|
|
42
|
-
at`)?" (<anonymous>)":-1<u.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
43
|
-
`+De+i+ce}var te=!1;function pe(i,s){if(!i||te)return"";te=!0;var u=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var p={DetermineComponentFrameRoot:function(){try{if(s){var we=function(){throw Error()};if(Object.defineProperty(we.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(we,[])}catch(fe){var le=fe}Reflect.construct(i,[],we)}else{try{we.call()}catch(fe){le=fe}i.call(we.prototype)}}else{try{throw Error()}catch(fe){le=fe}(we=i())&&typeof we.catch=="function"&&we.catch(function(){})}}catch(fe){if(fe&&le&&typeof fe.stack=="string")return[fe.stack,le.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var x=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");x&&x.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var w=p.DetermineComponentFrameRoot(),A=w[0],U=w[1];if(A&&U){var W=A.split(`
|
|
44
|
-
`),se=U.split(`
|
|
45
|
-
`);for(x=p=0;p<W.length&&!W[p].includes("DetermineComponentFrameRoot");)p++;for(;x<se.length&&!se[x].includes("DetermineComponentFrameRoot");)x++;if(p===W.length||x===se.length)for(p=W.length-1,x=se.length-1;1<=p&&0<=x&&W[p]!==se[x];)x--;for(;1<=p&&0<=x;p--,x--)if(W[p]!==se[x]){if(p!==1||x!==1)do if(p--,x--,0>x||W[p]!==se[x]){var me=`
|
|
46
|
-
`+W[p].replace(" at new "," at ");return i.displayName&&me.includes("<anonymous>")&&(me=me.replace("<anonymous>",i.displayName)),me}while(1<=p&&0<=x);break}}}finally{te=!1,Error.prepareStackTrace=u}return(u=i?i.displayName||i.name:"")?Ce(u):""}function Fe(i,s){switch(i.tag){case 26:case 27:case 5:return Ce(i.type);case 16:return Ce("Lazy");case 13:return i.child!==s&&s!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return pe(i.type,!1);case 11:return pe(i.type.render,!1);case 1:return pe(i.type,!0);case 31:return Ce("Activity");default:return""}}function ze(i){try{var s="",u=null;do s+=Fe(i,u),u=i,i=i.return;while(i);return s}catch(p){return`
|
|
47
|
-
Error generating stack: `+p.message+`
|
|
48
|
-
`+p.stack}}var ae=Object.prototype.hasOwnProperty,be=e.unstable_scheduleCallback,ye=e.unstable_cancelCallback,he=e.unstable_shouldYield,Ee=e.unstable_requestPaint,Ne=e.unstable_now,Ke=e.unstable_getCurrentPriorityLevel,ne=e.unstable_ImmediatePriority,de=e.unstable_UserBlockingPriority,Le=e.unstable_NormalPriority,Ze=e.unstable_LowPriority,it=e.unstable_IdlePriority,At=e.log,$n=e.unstable_setDisableYieldValue,dn=null,Mt=null;function Qt(i){if(typeof At=="function"&&$n(i),Mt&&typeof Mt.setStrictMode=="function")try{Mt.setStrictMode(dn,i)}catch{}}var yt=Math.clz32?Math.clz32:No,Tr=Math.log,Rn=Math.LN2;function No(i){return i>>>=0,i===0?32:31-(Tr(i)/Rn|0)|0}var Pi=256,wa=262144,Bi=4194304;function Un(i){var s=i&42;if(s!==0)return s;switch(i&-i){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 i&261888;case 262144:case 524288:case 1048576:case 2097152:return i&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return i&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return i}}function Z(i,s,u){var p=i.pendingLanes;if(p===0)return 0;var x=0,w=i.suspendedLanes,A=i.pingedLanes;i=i.warmLanes;var U=p&134217727;return U!==0?(p=U&~w,p!==0?x=Un(p):(A&=U,A!==0?x=Un(A):u||(u=U&~i,u!==0&&(x=Un(u))))):(U=p&~w,U!==0?x=Un(U):A!==0?x=Un(A):u||(u=p&~i,u!==0&&(x=Un(u)))),x===0?0:s!==0&&s!==x&&(s&w)===0&&(w=x&-x,u=s&-s,w>=u||w===32&&(u&4194048)!==0)?s:x}function ge(i,s){return(i.pendingLanes&~(i.suspendedLanes&~i.pingedLanes)&s)===0}function Me(i,s){switch(i){case 1:case 2:case 4:case 8:case 64:return s+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 s+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 rt(){var i=Bi;return Bi<<=1,(Bi&62914560)===0&&(Bi=4194304),i}function Ft(i){for(var s=[],u=0;31>u;u++)s.push(i);return s}function Ot(i,s){i.pendingLanes|=s,s!==268435456&&(i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0)}function Ue(i,s,u,p,x,w){var A=i.pendingLanes;i.pendingLanes=u,i.suspendedLanes=0,i.pingedLanes=0,i.warmLanes=0,i.expiredLanes&=u,i.entangledLanes&=u,i.errorRecoveryDisabledLanes&=u,i.shellSuspendCounter=0;var U=i.entanglements,W=i.expirationTimes,se=i.hiddenUpdates;for(u=A&~u;0<u;){var me=31-yt(u),we=1<<me;U[me]=0,W[me]=-1;var le=se[me];if(le!==null)for(se[me]=null,me=0;me<le.length;me++){var fe=le[me];fe!==null&&(fe.lane&=-536870913)}u&=~we}p!==0&&Pe(i,p,0),w!==0&&x===0&&i.tag!==0&&(i.suspendedLanes|=w&~(A&~s))}function Pe(i,s,u){i.pendingLanes|=s,i.suspendedLanes&=~s;var p=31-yt(s);i.entangledLanes|=s,i.entanglements[p]=i.entanglements[p]|1073741824|u&261930}function et(i,s){var u=i.entangledLanes|=s;for(i=i.entanglements;u;){var p=31-yt(u),x=1<<p;x&s|i[p]&s&&(i[p]|=s),u&=~x}}function rn(i,s){var u=s&-s;return u=(u&42)!==0?1:Vt(u),(u&(i.suspendedLanes|s))!==0?0:u}function Vt(i){switch(i){case 2:i=1;break;case 8:i=4;break;case 32:i=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:i=128;break;case 268435456:i=134217728;break;default:i=0}return i}function Qr(i){return i&=-i,2<i?8<i?(i&134217727)!==0?32:268435456:8:2}function ka(){var i=V.p;return i!==0?i:(i=window.event,i===void 0?32:N1(i.type))}function Ea(i,s){var u=V.p;try{return V.p=i,s()}finally{V.p=u}}var Mr=Math.random().toString(36).slice(2),an="__reactFiber$"+Mr,Tn="__reactProps$"+Mr,Wr="__reactContainer$"+Mr,Sa="__reactEvents$"+Mr,_s="__reactListeners$"+Mr,Na="__reactHandles$"+Mr,_o="__reactResources$"+Mr,$i="__reactMarker$"+Mr;function js(i){delete i[an],delete i[Tn],delete i[Sa],delete i[_s],delete i[Na]}function Ln(i){var s=i[an];if(s)return s;for(var u=i.parentNode;u;){if(s=u[Wr]||u[an]){if(u=s.alternate,s.child!==null||u!==null&&u.child!==null)for(i=c1(i);i!==null;){if(u=i[an])return u;i=c1(i)}return s}i=u,u=i.parentNode}return null}function Xr(i){if(i=i[an]||i[Wr]){var s=i.tag;if(s===5||s===6||s===13||s===31||s===26||s===27||s===3)return i}return null}function Zr(i){var s=i.tag;if(s===5||s===26||s===27||s===6)return i.stateNode;throw Error(r(33))}function yi(i){var s=i[_o];return s||(s=i[_o]={hoistableStyles:new Map,hoistableScripts:new Map}),s}function fn(i){i[$i]=!0}var jo=new Set,Ui={};function Jr(i,s){_e(i,s),_e(i+"Capture",s)}function _e(i,s){for(Ui[i]=s,i=0;i<s.length;i++)jo.add(s[i])}var Ve=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]*$"),ht={},Nt={};function sn(i){return ae.call(Nt,i)?!0:ae.call(ht,i)?!1:Ve.test(i)?Nt[i]=!0:(ht[i]=!0,!1)}function Mn(i,s,u){if(sn(s))if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":i.removeAttribute(s);return;case"boolean":var p=s.toLowerCase().slice(0,5);if(p!=="data-"&&p!=="aria-"){i.removeAttribute(s);return}}i.setAttribute(s,""+u)}}function Qn(i,s,u){if(u===null)i.removeAttribute(s);else{switch(typeof u){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(s);return}i.setAttribute(s,""+u)}}function Fn(i,s,u,p){if(p===null)i.removeAttribute(u);else{switch(typeof p){case"undefined":case"function":case"symbol":case"boolean":i.removeAttribute(u);return}i.setAttributeNS(s,u,""+p)}}function zt(i){switch(typeof i){case"bigint":case"boolean":case"number":case"string":case"undefined":return i;case"object":return i;default:return""}}function Wn(i){var s=i.type;return(i=i.nodeName)&&i.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Co(i,s,u){var p=Object.getOwnPropertyDescriptor(i.constructor.prototype,s);if(!i.hasOwnProperty(s)&&typeof p<"u"&&typeof p.get=="function"&&typeof p.set=="function"){var x=p.get,w=p.set;return Object.defineProperty(i,s,{configurable:!0,get:function(){return x.call(this)},set:function(A){u=""+A,w.call(this,A)}}),Object.defineProperty(i,s,{enumerable:p.enumerable}),{getValue:function(){return u},setValue:function(A){u=""+A},stopTracking:function(){i._valueTracker=null,delete i[s]}}}}function _a(i){if(!i._valueTracker){var s=Wn(i)?"checked":"value";i._valueTracker=Co(i,s,""+i[s])}}function bi(i){if(!i)return!1;var s=i._valueTracker;if(!s)return!0;var u=s.getValue(),p="";return i&&(p=Wn(i)?i.checked?"true":"false":i.value),i=p,i!==u?(s.setValue(i),!0):!1}function ja(i){if(i=i||(typeof document<"u"?document:void 0),typeof i>"u")return null;try{return i.activeElement||i.body}catch{return i.body}}var Ao=/[\n"\\]/g;function qn(i){return i.replace(Ao,function(s){return"\\"+s.charCodeAt(0).toString(16)+" "})}function Cs(i,s,u,p,x,w,A,U){i.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?i.type=A:i.removeAttribute("type"),s!=null?A==="number"?(s===0&&i.value===""||i.value!=s)&&(i.value=""+zt(s)):i.value!==""+zt(s)&&(i.value=""+zt(s)):A!=="submit"&&A!=="reset"||i.removeAttribute("value"),s!=null?Ca(i,A,zt(s)):u!=null?Ca(i,A,zt(u)):p!=null&&i.removeAttribute("value"),x==null&&w!=null&&(i.defaultChecked=!!w),x!=null&&(i.checked=x&&typeof x!="function"&&typeof x!="symbol"),U!=null&&typeof U!="function"&&typeof U!="symbol"&&typeof U!="boolean"?i.name=""+zt(U):i.removeAttribute("name")}function ei(i,s,u,p,x,w,A,U){if(w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(i.type=w),s!=null||u!=null){if(!(w!=="submit"&&w!=="reset"||s!=null)){_a(i);return}u=u!=null?""+zt(u):"",s=s!=null?""+zt(s):u,U||s===i.value||(i.value=s),i.defaultValue=s}p=p??x,p=typeof p!="function"&&typeof p!="symbol"&&!!p,i.checked=U?i.checked:!!p,i.defaultChecked=!!p,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(i.name=A),_a(i)}function Ca(i,s,u){s==="number"&&ja(i.ownerDocument)===i||i.defaultValue===""+u||(i.defaultValue=""+u)}function _n(i,s,u,p){if(i=i.options,s){s={};for(var x=0;x<u.length;x++)s["$"+u[x]]=!0;for(u=0;u<i.length;u++)x=s.hasOwnProperty("$"+i[u].value),i[u].selected!==x&&(i[u].selected=x),x&&p&&(i[u].defaultSelected=!0)}else{for(u=""+zt(u),s=null,x=0;x<i.length;x++){if(i[x].value===u){i[x].selected=!0,p&&(i[x].defaultSelected=!0);return}s!==null||i[x].disabled||(s=i[x])}s!==null&&(s.selected=!0)}}function As(i,s,u){if(s!=null&&(s=""+zt(s),s!==i.value&&(i.value=s),u==null)){i.defaultValue!==s&&(i.defaultValue=s);return}i.defaultValue=u!=null?""+zt(u):""}function To(i,s,u,p){if(s==null){if(p!=null){if(u!=null)throw Error(r(92));if(H(p)){if(1<p.length)throw Error(r(93));p=p[0]}u=p}u==null&&(u=""),s=u}u=zt(s),i.defaultValue=u,p=i.textContent,p===u&&p!==""&&p!==null&&(i.value=p),_a(i)}function nt(i,s){if(s){var u=i.firstChild;if(u&&u===i.lastChild&&u.nodeType===3){u.nodeValue=s;return}}i.textContent=s}var ld=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 bn(i,s,u){var p=s.indexOf("--")===0;u==null||typeof u=="boolean"||u===""?p?i.setProperty(s,""):s==="float"?i.cssFloat="":i[s]="":p?i.setProperty(s,u):typeof u!="number"||u===0||ld.has(s)?s==="float"?i.cssFloat=u:i[s]=(""+u).trim():i[s]=u+"px"}function Rt(i,s,u){if(s!=null&&typeof s!="object")throw Error(r(62));if(i=i.style,u!=null){for(var p in u)!u.hasOwnProperty(p)||s!=null&&s.hasOwnProperty(p)||(p.indexOf("--")===0?i.setProperty(p,""):p==="float"?i.cssFloat="":i[p]="");for(var x in s)p=s[x],s.hasOwnProperty(x)&&u[x]!==p&&bn(i,x,p)}else for(var w in s)s.hasOwnProperty(w)&&bn(i,w,s[w])}function Aa(i){if(i.indexOf("-")===-1)return!1;switch(i){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 Fi=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"]]),lc=/^[\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 Ta(i){return lc.test(""+i)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":i}function Ae(){}var qe=null;function ot(i){return i=i.target||i.srcElement||window,i.correspondingUseElement&&(i=i.correspondingUseElement),i.nodeType===3?i.parentNode:i}var bt=null,on=null;function Dr(i){var s=Xr(i);if(s&&(i=s.stateNode)){var u=i[Tn]||null;e:switch(i=s.stateNode,s.type){case"input":if(Cs(i,u.value,u.defaultValue,u.defaultValue,u.checked,u.defaultChecked,u.type,u.name),s=u.name,u.type==="radio"&&s!=null){for(u=i;u.parentNode;)u=u.parentNode;for(u=u.querySelectorAll('input[name="'+qn(""+s)+'"][type="radio"]'),s=0;s<u.length;s++){var p=u[s];if(p!==i&&p.form===i.form){var x=p[Tn]||null;if(!x)throw Error(r(90));Cs(p,x.value,x.defaultValue,x.defaultValue,x.checked,x.defaultChecked,x.type,x.name)}}for(s=0;s<u.length;s++)p=u[s],p.form===i.form&&bi(p)}break e;case"textarea":As(i,u.value,u.defaultValue);break e;case"select":s=u.value,s!=null&&_n(i,!!u.multiple,s,!1)}}}var cc=!1;function cd(i,s,u){if(cc)return i(s,u);cc=!0;try{var p=i(s);return p}finally{if(cc=!1,(bt!==null||on!==null)&&(Wd(),bt&&(s=bt,i=on,on=bt=null,Dr(s),i)))for(s=0;s<i.length;s++)Dr(i[s])}}function uc(i,s){var u=i.stateNode;if(u===null)return null;var p=u[Tn]||null;if(p===null)return null;u=p[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(p=!p.disabled)||(i=i.type,p=!(i==="button"||i==="input"||i==="select"||i==="textarea")),i=!p;break e;default:i=!1}if(i)return null;if(u&&typeof u!="function")throw Error(r(231,s,typeof u));return u}var qi=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),kp=!1;if(qi)try{var dc={};Object.defineProperty(dc,"passive",{get:function(){kp=!0}}),window.addEventListener("test",dc,dc),window.removeEventListener("test",dc,dc)}catch{kp=!1}var Ma=null,Ep=null,ud=null;function nv(){if(ud)return ud;var i,s=Ep,u=s.length,p,x="value"in Ma?Ma.value:Ma.textContent,w=x.length;for(i=0;i<u&&s[i]===x[i];i++);var A=u-i;for(p=1;p<=A&&s[u-p]===x[w-p];p++);return ud=x.slice(i,1<p?1-p:void 0)}function dd(i){var s=i.keyCode;return"charCode"in i?(i=i.charCode,i===0&&s===13&&(i=13)):i=s,i===10&&(i=13),32<=i||i===13?i:0}function fd(){return!0}function rv(){return!1}function rr(i){function s(u,p,x,w,A){this._reactName=u,this._targetInst=x,this.type=p,this.nativeEvent=w,this.target=A,this.currentTarget=null;for(var U in i)i.hasOwnProperty(U)&&(u=i[U],this[U]=u?u(w):w[U]);return this.isDefaultPrevented=(w.defaultPrevented!=null?w.defaultPrevented:w.returnValue===!1)?fd:rv,this.isPropagationStopped=rv,this}return m(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var u=this.nativeEvent;u&&(u.preventDefault?u.preventDefault():typeof u.returnValue!="unknown"&&(u.returnValue=!1),this.isDefaultPrevented=fd)},stopPropagation:function(){var u=this.nativeEvent;u&&(u.stopPropagation?u.stopPropagation():typeof u.cancelBubble!="unknown"&&(u.cancelBubble=!0),this.isPropagationStopped=fd)},persist:function(){},isPersistent:fd}),s}var Ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(i){return i.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hd=rr(Ts),fc=m({},Ts,{view:0,detail:0}),FA=rr(fc),Sp,Np,hc,pd=m({},fc,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:jp,button:0,buttons:0,relatedTarget:function(i){return i.relatedTarget===void 0?i.fromElement===i.srcElement?i.toElement:i.fromElement:i.relatedTarget},movementX:function(i){return"movementX"in i?i.movementX:(i!==hc&&(hc&&i.type==="mousemove"?(Sp=i.screenX-hc.screenX,Np=i.screenY-hc.screenY):Np=Sp=0,hc=i),Sp)},movementY:function(i){return"movementY"in i?i.movementY:Np}}),iv=rr(pd),qA=m({},pd,{dataTransfer:0}),HA=rr(qA),KA=m({},fc,{relatedTarget:0}),_p=rr(KA),GA=m({},Ts,{animationName:0,elapsedTime:0,pseudoElement:0}),VA=rr(GA),YA=m({},Ts,{clipboardData:function(i){return"clipboardData"in i?i.clipboardData:window.clipboardData}}),QA=rr(YA),WA=m({},Ts,{data:0}),av=rr(WA),XA={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ZA={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"},JA={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function eT(i){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(i):(i=JA[i])?!!s[i]:!1}function jp(){return eT}var tT=m({},fc,{key:function(i){if(i.key){var s=XA[i.key]||i.key;if(s!=="Unidentified")return s}return i.type==="keypress"?(i=dd(i),i===13?"Enter":String.fromCharCode(i)):i.type==="keydown"||i.type==="keyup"?ZA[i.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:jp,charCode:function(i){return i.type==="keypress"?dd(i):0},keyCode:function(i){return i.type==="keydown"||i.type==="keyup"?i.keyCode:0},which:function(i){return i.type==="keypress"?dd(i):i.type==="keydown"||i.type==="keyup"?i.keyCode:0}}),nT=rr(tT),rT=m({},pd,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),sv=rr(rT),iT=m({},fc,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:jp}),aT=rr(iT),sT=m({},Ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),oT=rr(sT),lT=m({},pd,{deltaX:function(i){return"deltaX"in i?i.deltaX:"wheelDeltaX"in i?-i.wheelDeltaX:0},deltaY:function(i){return"deltaY"in i?i.deltaY:"wheelDeltaY"in i?-i.wheelDeltaY:"wheelDelta"in i?-i.wheelDelta:0},deltaZ:0,deltaMode:0}),cT=rr(lT),uT=m({},Ts,{newState:0,oldState:0}),dT=rr(uT),fT=[9,13,27,32],Cp=qi&&"CompositionEvent"in window,pc=null;qi&&"documentMode"in document&&(pc=document.documentMode);var hT=qi&&"TextEvent"in window&&!pc,ov=qi&&(!Cp||pc&&8<pc&&11>=pc),lv=" ",cv=!1;function uv(i,s){switch(i){case"keyup":return fT.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function dv(i){return i=i.detail,typeof i=="object"&&"data"in i?i.data:null}var Mo=!1;function pT(i,s){switch(i){case"compositionend":return dv(s);case"keypress":return s.which!==32?null:(cv=!0,lv);case"textInput":return i=s.data,i===lv&&cv?null:i;default:return null}}function mT(i,s){if(Mo)return i==="compositionend"||!Cp&&uv(i,s)?(i=nv(),ud=Ep=Ma=null,Mo=!1,i):null;switch(i){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return ov&&s.locale!=="ko"?null:s.data;default:return null}}var gT={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 fv(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s==="input"?!!gT[i.type]:s==="textarea"}function hv(i,s,u,p){bt?on?on.push(p):on=[p]:bt=p,s=rf(s,"onChange"),0<s.length&&(u=new hd("onChange","change",null,u,p),i.push({event:u,listeners:s}))}var mc=null,gc=null;function yT(i){Qw(i,0)}function md(i){var s=Zr(i);if(bi(s))return i}function pv(i,s){if(i==="change")return s}var mv=!1;if(qi){var Ap;if(qi){var Tp="oninput"in document;if(!Tp){var gv=document.createElement("div");gv.setAttribute("oninput","return;"),Tp=typeof gv.oninput=="function"}Ap=Tp}else Ap=!1;mv=Ap&&(!document.documentMode||9<document.documentMode)}function yv(){mc&&(mc.detachEvent("onpropertychange",bv),gc=mc=null)}function bv(i){if(i.propertyName==="value"&&md(gc)){var s=[];hv(s,gc,i,ot(i)),cd(yT,s)}}function bT(i,s,u){i==="focusin"?(yv(),mc=s,gc=u,mc.attachEvent("onpropertychange",bv)):i==="focusout"&&yv()}function xT(i){if(i==="selectionchange"||i==="keyup"||i==="keydown")return md(gc)}function vT(i,s){if(i==="click")return md(s)}function wT(i,s){if(i==="input"||i==="change")return md(s)}function kT(i,s){return i===s&&(i!==0||1/i===1/s)||i!==i&&s!==s}var gr=typeof Object.is=="function"?Object.is:kT;function yc(i,s){if(gr(i,s))return!0;if(typeof i!="object"||i===null||typeof s!="object"||s===null)return!1;var u=Object.keys(i),p=Object.keys(s);if(u.length!==p.length)return!1;for(p=0;p<u.length;p++){var x=u[p];if(!ae.call(s,x)||!gr(i[x],s[x]))return!1}return!0}function xv(i){for(;i&&i.firstChild;)i=i.firstChild;return i}function vv(i,s){var u=xv(i);i=0;for(var p;u;){if(u.nodeType===3){if(p=i+u.textContent.length,i<=s&&p>=s)return{node:u,offset:s-i};i=p}e:{for(;u;){if(u.nextSibling){u=u.nextSibling;break e}u=u.parentNode}u=void 0}u=xv(u)}}function wv(i,s){return i&&s?i===s?!0:i&&i.nodeType===3?!1:s&&s.nodeType===3?wv(i,s.parentNode):"contains"in i?i.contains(s):i.compareDocumentPosition?!!(i.compareDocumentPosition(s)&16):!1:!1}function kv(i){i=i!=null&&i.ownerDocument!=null&&i.ownerDocument.defaultView!=null?i.ownerDocument.defaultView:window;for(var s=ja(i.document);s instanceof i.HTMLIFrameElement;){try{var u=typeof s.contentWindow.location.href=="string"}catch{u=!1}if(u)i=s.contentWindow;else break;s=ja(i.document)}return s}function Mp(i){var s=i&&i.nodeName&&i.nodeName.toLowerCase();return s&&(s==="input"&&(i.type==="text"||i.type==="search"||i.type==="tel"||i.type==="url"||i.type==="password")||s==="textarea"||i.contentEditable==="true")}var ET=qi&&"documentMode"in document&&11>=document.documentMode,Do=null,Dp=null,bc=null,Op=!1;function Ev(i,s,u){var p=u.window===u?u.document:u.nodeType===9?u:u.ownerDocument;Op||Do==null||Do!==ja(p)||(p=Do,"selectionStart"in p&&Mp(p)?p={start:p.selectionStart,end:p.selectionEnd}:(p=(p.ownerDocument&&p.ownerDocument.defaultView||window).getSelection(),p={anchorNode:p.anchorNode,anchorOffset:p.anchorOffset,focusNode:p.focusNode,focusOffset:p.focusOffset}),bc&&yc(bc,p)||(bc=p,p=rf(Dp,"onSelect"),0<p.length&&(s=new hd("onSelect","select",null,s,u),i.push({event:s,listeners:p}),s.target=Do)))}function Ms(i,s){var u={};return u[i.toLowerCase()]=s.toLowerCase(),u["Webkit"+i]="webkit"+s,u["Moz"+i]="moz"+s,u}var Oo={animationend:Ms("Animation","AnimationEnd"),animationiteration:Ms("Animation","AnimationIteration"),animationstart:Ms("Animation","AnimationStart"),transitionrun:Ms("Transition","TransitionRun"),transitionstart:Ms("Transition","TransitionStart"),transitioncancel:Ms("Transition","TransitionCancel"),transitionend:Ms("Transition","TransitionEnd")},Rp={},Sv={};qi&&(Sv=document.createElement("div").style,"AnimationEvent"in window||(delete Oo.animationend.animation,delete Oo.animationiteration.animation,delete Oo.animationstart.animation),"TransitionEvent"in window||delete Oo.transitionend.transition);function Ds(i){if(Rp[i])return Rp[i];if(!Oo[i])return i;var s=Oo[i],u;for(u in s)if(s.hasOwnProperty(u)&&u in Sv)return Rp[i]=s[u];return i}var Nv=Ds("animationend"),_v=Ds("animationiteration"),jv=Ds("animationstart"),ST=Ds("transitionrun"),NT=Ds("transitionstart"),_T=Ds("transitioncancel"),Cv=Ds("transitionend"),Av=new Map,Lp="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(" ");Lp.push("scrollEnd");function ti(i,s){Av.set(i,s),Jr(s,[i])}var gd=typeof reportError=="function"?reportError:function(i){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var s=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof i=="object"&&i!==null&&typeof i.message=="string"?String(i.message):String(i),error:i});if(!window.dispatchEvent(s))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",i);return}console.error(i)},Or=[],Ro=0,Ip=0;function yd(){for(var i=Ro,s=Ip=Ro=0;s<i;){var u=Or[s];Or[s++]=null;var p=Or[s];Or[s++]=null;var x=Or[s];Or[s++]=null;var w=Or[s];if(Or[s++]=null,p!==null&&x!==null){var A=p.pending;A===null?x.next=x:(x.next=A.next,A.next=x),p.pending=x}w!==0&&Tv(u,x,w)}}function bd(i,s,u,p){Or[Ro++]=i,Or[Ro++]=s,Or[Ro++]=u,Or[Ro++]=p,Ip|=p,i.lanes|=p,i=i.alternate,i!==null&&(i.lanes|=p)}function zp(i,s,u,p){return bd(i,s,u,p),xd(i)}function Os(i,s){return bd(i,null,null,s),xd(i)}function Tv(i,s,u){i.lanes|=u;var p=i.alternate;p!==null&&(p.lanes|=u);for(var x=!1,w=i.return;w!==null;)w.childLanes|=u,p=w.alternate,p!==null&&(p.childLanes|=u),w.tag===22&&(i=w.stateNode,i===null||i._visibility&1||(x=!0)),i=w,w=w.return;return i.tag===3?(w=i.stateNode,x&&s!==null&&(x=31-yt(u),i=w.hiddenUpdates,p=i[x],p===null?i[x]=[s]:p.push(s),s.lane=u|536870912),w):null}function xd(i){if(50<$c)throw $c=0,Gm=null,Error(r(185));for(var s=i.return;s!==null;)i=s,s=i.return;return i.tag===3?i.stateNode:null}var Lo={};function jT(i,s,u,p){this.tag=i,this.key=u,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=p,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function yr(i,s,u,p){return new jT(i,s,u,p)}function Pp(i){return i=i.prototype,!(!i||!i.isReactComponent)}function Hi(i,s){var u=i.alternate;return u===null?(u=yr(i.tag,s,i.key,i.mode),u.elementType=i.elementType,u.type=i.type,u.stateNode=i.stateNode,u.alternate=i,i.alternate=u):(u.pendingProps=s,u.type=i.type,u.flags=0,u.subtreeFlags=0,u.deletions=null),u.flags=i.flags&65011712,u.childLanes=i.childLanes,u.lanes=i.lanes,u.child=i.child,u.memoizedProps=i.memoizedProps,u.memoizedState=i.memoizedState,u.updateQueue=i.updateQueue,s=i.dependencies,u.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},u.sibling=i.sibling,u.index=i.index,u.ref=i.ref,u.refCleanup=i.refCleanup,u}function Mv(i,s){i.flags&=65011714;var u=i.alternate;return u===null?(i.childLanes=0,i.lanes=s,i.child=null,i.subtreeFlags=0,i.memoizedProps=null,i.memoizedState=null,i.updateQueue=null,i.dependencies=null,i.stateNode=null):(i.childLanes=u.childLanes,i.lanes=u.lanes,i.child=u.child,i.subtreeFlags=0,i.deletions=null,i.memoizedProps=u.memoizedProps,i.memoizedState=u.memoizedState,i.updateQueue=u.updateQueue,i.type=u.type,s=u.dependencies,i.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext}),i}function vd(i,s,u,p,x,w){var A=0;if(p=i,typeof i=="function")Pp(i)&&(A=1);else if(typeof i=="string")A=DM(i,u,oe.current)?26:i==="html"||i==="head"||i==="body"?27:5;else e:switch(i){case $:return i=yr(31,u,s,x),i.elementType=$,i.lanes=w,i;case v:return Rs(u.children,x,w,s);case N:A=8,x|=24;break;case E:return i=yr(12,u,s,x|2),i.elementType=E,i.lanes=w,i;case M:return i=yr(13,u,s,x),i.elementType=M,i.lanes=w,i;case T:return i=yr(19,u,s,x),i.elementType=T,i.lanes=w,i;default:if(typeof i=="object"&&i!==null)switch(i.$$typeof){case S:A=10;break e;case C:A=9;break e;case _:A=11;break e;case L:A=14;break e;case R:A=16,p=null;break e}A=29,u=Error(r(130,i===null?"null":typeof i,"")),p=null}return s=yr(A,u,s,x),s.elementType=i,s.type=p,s.lanes=w,s}function Rs(i,s,u,p){return i=yr(7,i,p,s),i.lanes=u,i}function Bp(i,s,u){return i=yr(6,i,null,s),i.lanes=u,i}function Dv(i){var s=yr(18,null,null,0);return s.stateNode=i,s}function $p(i,s,u){return s=yr(4,i.children!==null?i.children:[],i.key,s),s.lanes=u,s.stateNode={containerInfo:i.containerInfo,pendingChildren:null,implementation:i.implementation},s}var Ov=new WeakMap;function Rr(i,s){if(typeof i=="object"&&i!==null){var u=Ov.get(i);return u!==void 0?u:(s={value:i,source:s,stack:ze(s)},Ov.set(i,s),s)}return{value:i,source:s,stack:ze(s)}}var Io=[],zo=0,wd=null,xc=0,Lr=[],Ir=0,Da=null,xi=1,vi="";function Ki(i,s){Io[zo++]=xc,Io[zo++]=wd,wd=i,xc=s}function Rv(i,s,u){Lr[Ir++]=xi,Lr[Ir++]=vi,Lr[Ir++]=Da,Da=i;var p=xi;i=vi;var x=32-yt(p)-1;p&=~(1<<x),u+=1;var w=32-yt(s)+x;if(30<w){var A=x-x%5;w=(p&(1<<A)-1).toString(32),p>>=A,x-=A,xi=1<<32-yt(s)+x|u<<x|p,vi=w+i}else xi=1<<w|u<<x|p,vi=i}function Up(i){i.return!==null&&(Ki(i,1),Rv(i,1,0))}function Fp(i){for(;i===wd;)wd=Io[--zo],Io[zo]=null,xc=Io[--zo],Io[zo]=null;for(;i===Da;)Da=Lr[--Ir],Lr[Ir]=null,vi=Lr[--Ir],Lr[Ir]=null,xi=Lr[--Ir],Lr[Ir]=null}function Lv(i,s){Lr[Ir++]=xi,Lr[Ir++]=vi,Lr[Ir++]=Da,xi=s.id,vi=s.overflow,Da=i}var In=null,Wt=null,wt=!1,Oa=null,zr=!1,qp=Error(r(519));function Ra(i){var s=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw vc(Rr(s,i)),qp}function Iv(i){var s=i.stateNode,u=i.type,p=i.memoizedProps;switch(s[an]=i,s[Tn]=p,u){case"dialog":mt("cancel",s),mt("close",s);break;case"iframe":case"object":case"embed":mt("load",s);break;case"video":case"audio":for(u=0;u<Fc.length;u++)mt(Fc[u],s);break;case"source":mt("error",s);break;case"img":case"image":case"link":mt("error",s),mt("load",s);break;case"details":mt("toggle",s);break;case"input":mt("invalid",s),ei(s,p.value,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name,!0);break;case"select":mt("invalid",s);break;case"textarea":mt("invalid",s),To(s,p.value,p.defaultValue,p.children)}u=p.children,typeof u!="string"&&typeof u!="number"&&typeof u!="bigint"||s.textContent===""+u||p.suppressHydrationWarning===!0||Jw(s.textContent,u)?(p.popover!=null&&(mt("beforetoggle",s),mt("toggle",s)),p.onScroll!=null&&mt("scroll",s),p.onScrollEnd!=null&&mt("scrollend",s),p.onClick!=null&&(s.onclick=Ae),s=!0):s=!1,s||Ra(i,!0)}function zv(i){for(In=i.return;In;)switch(In.tag){case 5:case 31:case 13:zr=!1;return;case 27:case 3:zr=!0;return;default:In=In.return}}function Po(i){if(i!==In)return!1;if(!wt)return zv(i),wt=!0,!1;var s=i.tag,u;if((u=s!==3&&s!==27)&&((u=s===5)&&(u=i.type,u=!(u!=="form"&&u!=="button")||og(i.type,i.memoizedProps)),u=!u),u&&Wt&&Ra(i),zv(i),s===13){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Wt=l1(i)}else if(s===31){if(i=i.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));Wt=l1(i)}else s===27?(s=Wt,Ya(i.type)?(i=fg,fg=null,Wt=i):Wt=s):Wt=In?Br(i.stateNode.nextSibling):null;return!0}function Ls(){Wt=In=null,wt=!1}function Hp(){var i=Oa;return i!==null&&(or===null?or=i:or.push.apply(or,i),Oa=null),i}function vc(i){Oa===null?Oa=[i]:Oa.push(i)}var Kp=P(null),Is=null,Gi=null;function La(i,s,u){B(Kp,s._currentValue),s._currentValue=u}function Vi(i){i._currentValue=Kp.current,G(Kp)}function Gp(i,s,u){for(;i!==null;){var p=i.alternate;if((i.childLanes&s)!==s?(i.childLanes|=s,p!==null&&(p.childLanes|=s)):p!==null&&(p.childLanes&s)!==s&&(p.childLanes|=s),i===u)break;i=i.return}}function Vp(i,s,u,p){var x=i.child;for(x!==null&&(x.return=i);x!==null;){var w=x.dependencies;if(w!==null){var A=x.child;w=w.firstContext;e:for(;w!==null;){var U=w;w=x;for(var W=0;W<s.length;W++)if(U.context===s[W]){w.lanes|=u,U=w.alternate,U!==null&&(U.lanes|=u),Gp(w.return,u,i),p||(A=null);break e}w=U.next}}else if(x.tag===18){if(A=x.return,A===null)throw Error(r(341));A.lanes|=u,w=A.alternate,w!==null&&(w.lanes|=u),Gp(A,u,i),A=null}else A=x.child;if(A!==null)A.return=x;else for(A=x;A!==null;){if(A===i){A=null;break}if(x=A.sibling,x!==null){x.return=A.return,A=x;break}A=A.return}x=A}}function Bo(i,s,u,p){i=null;for(var x=s,w=!1;x!==null;){if(!w){if((x.flags&524288)!==0)w=!0;else if((x.flags&262144)!==0)break}if(x.tag===10){var A=x.alternate;if(A===null)throw Error(r(387));if(A=A.memoizedProps,A!==null){var U=x.type;gr(x.pendingProps.value,A.value)||(i!==null?i.push(U):i=[U])}}else if(x===Se.current){if(A=x.alternate,A===null)throw Error(r(387));A.memoizedState.memoizedState!==x.memoizedState.memoizedState&&(i!==null?i.push(Vc):i=[Vc])}x=x.return}i!==null&&Vp(s,i,u,p),s.flags|=262144}function kd(i){for(i=i.firstContext;i!==null;){if(!gr(i.context._currentValue,i.memoizedValue))return!0;i=i.next}return!1}function zs(i){Is=i,Gi=null,i=i.dependencies,i!==null&&(i.firstContext=null)}function zn(i){return Pv(Is,i)}function Ed(i,s){return Is===null&&zs(i),Pv(i,s)}function Pv(i,s){var u=s._currentValue;if(s={context:s,memoizedValue:u,next:null},Gi===null){if(i===null)throw Error(r(308));Gi=s,i.dependencies={lanes:0,firstContext:s},i.flags|=524288}else Gi=Gi.next=s;return u}var CT=typeof AbortController<"u"?AbortController:function(){var i=[],s=this.signal={aborted:!1,addEventListener:function(u,p){i.push(p)}};this.abort=function(){s.aborted=!0,i.forEach(function(u){return u()})}},AT=e.unstable_scheduleCallback,TT=e.unstable_NormalPriority,xn={$$typeof:S,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Yp(){return{controller:new CT,data:new Map,refCount:0}}function wc(i){i.refCount--,i.refCount===0&&AT(TT,function(){i.controller.abort()})}var kc=null,Qp=0,$o=0,Uo=null;function MT(i,s){if(kc===null){var u=kc=[];Qp=0,$o=Zm(),Uo={status:"pending",value:void 0,then:function(p){u.push(p)}}}return Qp++,s.then(Bv,Bv),s}function Bv(){if(--Qp===0&&kc!==null){Uo!==null&&(Uo.status="fulfilled");var i=kc;kc=null,$o=0,Uo=null;for(var s=0;s<i.length;s++)(0,i[s])()}}function DT(i,s){var u=[],p={status:"pending",value:null,reason:null,then:function(x){u.push(x)}};return i.then(function(){p.status="fulfilled",p.value=s;for(var x=0;x<u.length;x++)(0,u[x])(s)},function(x){for(p.status="rejected",p.reason=x,x=0;x<u.length;x++)(0,u[x])(void 0)}),p}var $v=O.S;O.S=function(i,s){Ew=Ne(),typeof s=="object"&&s!==null&&typeof s.then=="function"&&MT(i,s),$v!==null&&$v(i,s)};var Ps=P(null);function Wp(){var i=Ps.current;return i!==null?i:qt.pooledCache}function Sd(i,s){s===null?B(Ps,Ps.current):B(Ps,s.pool)}function Uv(){var i=Wp();return i===null?null:{parent:xn._currentValue,pool:i}}var Fo=Error(r(460)),Xp=Error(r(474)),Nd=Error(r(542)),_d={then:function(){}};function Fv(i){return i=i.status,i==="fulfilled"||i==="rejected"}function qv(i,s,u){switch(u=i[u],u===void 0?i.push(s):u!==s&&(s.then(Ae,Ae),s=u),s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Kv(i),i;default:if(typeof s.status=="string")s.then(Ae,Ae);else{if(i=qt,i!==null&&100<i.shellSuspendCounter)throw Error(r(482));i=s,i.status="pending",i.then(function(p){if(s.status==="pending"){var x=s;x.status="fulfilled",x.value=p}},function(p){if(s.status==="pending"){var x=s;x.status="rejected",x.reason=p}})}switch(s.status){case"fulfilled":return s.value;case"rejected":throw i=s.reason,Kv(i),i}throw $s=s,Fo}}function Bs(i){try{var s=i._init;return s(i._payload)}catch(u){throw u!==null&&typeof u=="object"&&typeof u.then=="function"?($s=u,Fo):u}}var $s=null;function Hv(){if($s===null)throw Error(r(459));var i=$s;return $s=null,i}function Kv(i){if(i===Fo||i===Nd)throw Error(r(483))}var qo=null,Ec=0;function jd(i){var s=Ec;return Ec+=1,qo===null&&(qo=[]),qv(qo,i,s)}function Sc(i,s){s=s.props.ref,i.ref=s!==void 0?s:null}function Cd(i,s){throw s.$$typeof===y?Error(r(525)):(i=Object.prototype.toString.call(s),Error(r(31,i==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":i)))}function Gv(i){function s(re,ee){if(i){var ie=re.deletions;ie===null?(re.deletions=[ee],re.flags|=16):ie.push(ee)}}function u(re,ee){if(!i)return null;for(;ee!==null;)s(re,ee),ee=ee.sibling;return null}function p(re){for(var ee=new Map;re!==null;)re.key!==null?ee.set(re.key,re):ee.set(re.index,re),re=re.sibling;return ee}function x(re,ee){return re=Hi(re,ee),re.index=0,re.sibling=null,re}function w(re,ee,ie){return re.index=ie,i?(ie=re.alternate,ie!==null?(ie=ie.index,ie<ee?(re.flags|=67108866,ee):ie):(re.flags|=67108866,ee)):(re.flags|=1048576,ee)}function A(re){return i&&re.alternate===null&&(re.flags|=67108866),re}function U(re,ee,ie,xe){return ee===null||ee.tag!==6?(ee=Bp(ie,re.mode,xe),ee.return=re,ee):(ee=x(ee,ie),ee.return=re,ee)}function W(re,ee,ie,xe){var We=ie.type;return We===v?me(re,ee,ie.props.children,xe,ie.key):ee!==null&&(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===R&&Bs(We)===ee.type)?(ee=x(ee,ie.props),Sc(ee,ie),ee.return=re,ee):(ee=vd(ie.type,ie.key,ie.props,null,re.mode,xe),Sc(ee,ie),ee.return=re,ee)}function se(re,ee,ie,xe){return ee===null||ee.tag!==4||ee.stateNode.containerInfo!==ie.containerInfo||ee.stateNode.implementation!==ie.implementation?(ee=$p(ie,re.mode,xe),ee.return=re,ee):(ee=x(ee,ie.children||[]),ee.return=re,ee)}function me(re,ee,ie,xe,We){return ee===null||ee.tag!==7?(ee=Rs(ie,re.mode,xe,We),ee.return=re,ee):(ee=x(ee,ie),ee.return=re,ee)}function we(re,ee,ie){if(typeof ee=="string"&&ee!==""||typeof ee=="number"||typeof ee=="bigint")return ee=Bp(""+ee,re.mode,ie),ee.return=re,ee;if(typeof ee=="object"&&ee!==null){switch(ee.$$typeof){case b:return ie=vd(ee.type,ee.key,ee.props,null,re.mode,ie),Sc(ie,ee),ie.return=re,ie;case k:return ee=$p(ee,re.mode,ie),ee.return=re,ee;case R:return ee=Bs(ee),we(re,ee,ie)}if(H(ee)||F(ee))return ee=Rs(ee,re.mode,ie,null),ee.return=re,ee;if(typeof ee.then=="function")return we(re,jd(ee),ie);if(ee.$$typeof===S)return we(re,Ed(re,ee),ie);Cd(re,ee)}return null}function le(re,ee,ie,xe){var We=ee!==null?ee.key:null;if(typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint")return We!==null?null:U(re,ee,""+ie,xe);if(typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:return ie.key===We?W(re,ee,ie,xe):null;case k:return ie.key===We?se(re,ee,ie,xe):null;case R:return ie=Bs(ie),le(re,ee,ie,xe)}if(H(ie)||F(ie))return We!==null?null:me(re,ee,ie,xe,null);if(typeof ie.then=="function")return le(re,ee,jd(ie),xe);if(ie.$$typeof===S)return le(re,ee,Ed(re,ie),xe);Cd(re,ie)}return null}function fe(re,ee,ie,xe,We){if(typeof xe=="string"&&xe!==""||typeof xe=="number"||typeof xe=="bigint")return re=re.get(ie)||null,U(ee,re,""+xe,We);if(typeof xe=="object"&&xe!==null){switch(xe.$$typeof){case b:return re=re.get(xe.key===null?ie:xe.key)||null,W(ee,re,xe,We);case k:return re=re.get(xe.key===null?ie:xe.key)||null,se(ee,re,xe,We);case R:return xe=Bs(xe),fe(re,ee,ie,xe,We)}if(H(xe)||F(xe))return re=re.get(ie)||null,me(ee,re,xe,We,null);if(typeof xe.then=="function")return fe(re,ee,ie,jd(xe),We);if(xe.$$typeof===S)return fe(re,ee,ie,Ed(ee,xe),We);Cd(ee,xe)}return null}function $e(re,ee,ie,xe){for(var We=null,_t=null,He=ee,ct=ee=0,vt=null;He!==null&&ct<ie.length;ct++){He.index>ct?(vt=He,He=null):vt=He.sibling;var jt=le(re,He,ie[ct],xe);if(jt===null){He===null&&(He=vt);break}i&&He&&jt.alternate===null&&s(re,He),ee=w(jt,ee,ct),_t===null?We=jt:_t.sibling=jt,_t=jt,He=vt}if(ct===ie.length)return u(re,He),wt&&Ki(re,ct),We;if(He===null){for(;ct<ie.length;ct++)He=we(re,ie[ct],xe),He!==null&&(ee=w(He,ee,ct),_t===null?We=He:_t.sibling=He,_t=He);return wt&&Ki(re,ct),We}for(He=p(He);ct<ie.length;ct++)vt=fe(He,re,ct,ie[ct],xe),vt!==null&&(i&&vt.alternate!==null&&He.delete(vt.key===null?ct:vt.key),ee=w(vt,ee,ct),_t===null?We=vt:_t.sibling=vt,_t=vt);return i&&He.forEach(function(Ja){return s(re,Ja)}),wt&&Ki(re,ct),We}function tt(re,ee,ie,xe){if(ie==null)throw Error(r(151));for(var We=null,_t=null,He=ee,ct=ee=0,vt=null,jt=ie.next();He!==null&&!jt.done;ct++,jt=ie.next()){He.index>ct?(vt=He,He=null):vt=He.sibling;var Ja=le(re,He,jt.value,xe);if(Ja===null){He===null&&(He=vt);break}i&&He&&Ja.alternate===null&&s(re,He),ee=w(Ja,ee,ct),_t===null?We=Ja:_t.sibling=Ja,_t=Ja,He=vt}if(jt.done)return u(re,He),wt&&Ki(re,ct),We;if(He===null){for(;!jt.done;ct++,jt=ie.next())jt=we(re,jt.value,xe),jt!==null&&(ee=w(jt,ee,ct),_t===null?We=jt:_t.sibling=jt,_t=jt);return wt&&Ki(re,ct),We}for(He=p(He);!jt.done;ct++,jt=ie.next())jt=fe(He,re,ct,jt.value,xe),jt!==null&&(i&&jt.alternate!==null&&He.delete(jt.key===null?ct:jt.key),ee=w(jt,ee,ct),_t===null?We=jt:_t.sibling=jt,_t=jt);return i&&He.forEach(function(qM){return s(re,qM)}),wt&&Ki(re,ct),We}function $t(re,ee,ie,xe){if(typeof ie=="object"&&ie!==null&&ie.type===v&&ie.key===null&&(ie=ie.props.children),typeof ie=="object"&&ie!==null){switch(ie.$$typeof){case b:e:{for(var We=ie.key;ee!==null;){if(ee.key===We){if(We=ie.type,We===v){if(ee.tag===7){u(re,ee.sibling),xe=x(ee,ie.props.children),xe.return=re,re=xe;break e}}else if(ee.elementType===We||typeof We=="object"&&We!==null&&We.$$typeof===R&&Bs(We)===ee.type){u(re,ee.sibling),xe=x(ee,ie.props),Sc(xe,ie),xe.return=re,re=xe;break e}u(re,ee);break}else s(re,ee);ee=ee.sibling}ie.type===v?(xe=Rs(ie.props.children,re.mode,xe,ie.key),xe.return=re,re=xe):(xe=vd(ie.type,ie.key,ie.props,null,re.mode,xe),Sc(xe,ie),xe.return=re,re=xe)}return A(re);case k:e:{for(We=ie.key;ee!==null;){if(ee.key===We)if(ee.tag===4&&ee.stateNode.containerInfo===ie.containerInfo&&ee.stateNode.implementation===ie.implementation){u(re,ee.sibling),xe=x(ee,ie.children||[]),xe.return=re,re=xe;break e}else{u(re,ee);break}else s(re,ee);ee=ee.sibling}xe=$p(ie,re.mode,xe),xe.return=re,re=xe}return A(re);case R:return ie=Bs(ie),$t(re,ee,ie,xe)}if(H(ie))return $e(re,ee,ie,xe);if(F(ie)){if(We=F(ie),typeof We!="function")throw Error(r(150));return ie=We.call(ie),tt(re,ee,ie,xe)}if(typeof ie.then=="function")return $t(re,ee,jd(ie),xe);if(ie.$$typeof===S)return $t(re,ee,Ed(re,ie),xe);Cd(re,ie)}return typeof ie=="string"&&ie!==""||typeof ie=="number"||typeof ie=="bigint"?(ie=""+ie,ee!==null&&ee.tag===6?(u(re,ee.sibling),xe=x(ee,ie),xe.return=re,re=xe):(u(re,ee),xe=Bp(ie,re.mode,xe),xe.return=re,re=xe),A(re)):u(re,ee)}return function(re,ee,ie,xe){try{Ec=0;var We=$t(re,ee,ie,xe);return qo=null,We}catch(He){if(He===Fo||He===Nd)throw He;var _t=yr(29,He,null,re.mode);return _t.lanes=xe,_t.return=re,_t}finally{}}}var Us=Gv(!0),Vv=Gv(!1),Ia=!1;function Zp(i){i.updateQueue={baseState:i.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Jp(i,s){i=i.updateQueue,s.updateQueue===i&&(s.updateQueue={baseState:i.baseState,firstBaseUpdate:i.firstBaseUpdate,lastBaseUpdate:i.lastBaseUpdate,shared:i.shared,callbacks:null})}function za(i){return{lane:i,tag:0,payload:null,callback:null,next:null}}function Pa(i,s,u){var p=i.updateQueue;if(p===null)return null;if(p=p.shared,(Tt&2)!==0){var x=p.pending;return x===null?s.next=s:(s.next=x.next,x.next=s),p.pending=s,s=xd(i),Tv(i,null,u),s}return bd(i,p,s,u),xd(i)}function Nc(i,s,u){if(s=s.updateQueue,s!==null&&(s=s.shared,(u&4194048)!==0)){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,et(i,u)}}function em(i,s){var u=i.updateQueue,p=i.alternate;if(p!==null&&(p=p.updateQueue,u===p)){var x=null,w=null;if(u=u.firstBaseUpdate,u!==null){do{var A={lane:u.lane,tag:u.tag,payload:u.payload,callback:null,next:null};w===null?x=w=A:w=w.next=A,u=u.next}while(u!==null);w===null?x=w=s:w=w.next=s}else x=w=s;u={baseState:p.baseState,firstBaseUpdate:x,lastBaseUpdate:w,shared:p.shared,callbacks:p.callbacks},i.updateQueue=u;return}i=u.lastBaseUpdate,i===null?u.firstBaseUpdate=s:i.next=s,u.lastBaseUpdate=s}var tm=!1;function _c(){if(tm){var i=Uo;if(i!==null)throw i}}function jc(i,s,u,p){tm=!1;var x=i.updateQueue;Ia=!1;var w=x.firstBaseUpdate,A=x.lastBaseUpdate,U=x.shared.pending;if(U!==null){x.shared.pending=null;var W=U,se=W.next;W.next=null,A===null?w=se:A.next=se,A=W;var me=i.alternate;me!==null&&(me=me.updateQueue,U=me.lastBaseUpdate,U!==A&&(U===null?me.firstBaseUpdate=se:U.next=se,me.lastBaseUpdate=W))}if(w!==null){var we=x.baseState;A=0,me=se=W=null,U=w;do{var le=U.lane&-536870913,fe=le!==U.lane;if(fe?(xt&le)===le:(p&le)===le){le!==0&&le===$o&&(tm=!0),me!==null&&(me=me.next={lane:0,tag:U.tag,payload:U.payload,callback:null,next:null});e:{var $e=i,tt=U;le=s;var $t=u;switch(tt.tag){case 1:if($e=tt.payload,typeof $e=="function"){we=$e.call($t,we,le);break e}we=$e;break e;case 3:$e.flags=$e.flags&-65537|128;case 0:if($e=tt.payload,le=typeof $e=="function"?$e.call($t,we,le):$e,le==null)break e;we=m({},we,le);break e;case 2:Ia=!0}}le=U.callback,le!==null&&(i.flags|=64,fe&&(i.flags|=8192),fe=x.callbacks,fe===null?x.callbacks=[le]:fe.push(le))}else fe={lane:le,tag:U.tag,payload:U.payload,callback:U.callback,next:null},me===null?(se=me=fe,W=we):me=me.next=fe,A|=le;if(U=U.next,U===null){if(U=x.shared.pending,U===null)break;fe=U,U=fe.next,fe.next=null,x.lastBaseUpdate=fe,x.shared.pending=null}}while(!0);me===null&&(W=we),x.baseState=W,x.firstBaseUpdate=se,x.lastBaseUpdate=me,w===null&&(x.shared.lanes=0),qa|=A,i.lanes=A,i.memoizedState=we}}function Yv(i,s){if(typeof i!="function")throw Error(r(191,i));i.call(s)}function Qv(i,s){var u=i.callbacks;if(u!==null)for(i.callbacks=null,i=0;i<u.length;i++)Yv(u[i],s)}var Ho=P(null),Ad=P(0);function Wv(i,s){i=na,B(Ad,i),B(Ho,s),na=i|s.baseLanes}function nm(){B(Ad,na),B(Ho,Ho.current)}function rm(){na=Ad.current,G(Ho),G(Ad)}var br=P(null),Pr=null;function Ba(i){var s=i.alternate;B(gn,gn.current&1),B(br,i),Pr===null&&(s===null||Ho.current!==null||s.memoizedState!==null)&&(Pr=i)}function im(i){B(gn,gn.current),B(br,i),Pr===null&&(Pr=i)}function Xv(i){i.tag===22?(B(gn,gn.current),B(br,i),Pr===null&&(Pr=i)):$a()}function $a(){B(gn,gn.current),B(br,br.current)}function xr(i){G(br),Pr===i&&(Pr=null),G(gn)}var gn=P(0);function Td(i){for(var s=i;s!==null;){if(s.tag===13){var u=s.memoizedState;if(u!==null&&(u=u.dehydrated,u===null||ug(u)||dg(u)))return s}else if(s.tag===19&&(s.memoizedProps.revealOrder==="forwards"||s.memoizedProps.revealOrder==="backwards"||s.memoizedProps.revealOrder==="unstable_legacy-backwards"||s.memoizedProps.revealOrder==="together")){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Yi=0,lt=null,Pt=null,vn=null,Md=!1,Ko=!1,Fs=!1,Dd=0,Cc=0,Go=null,OT=0;function hn(){throw Error(r(321))}function am(i,s){if(s===null)return!1;for(var u=0;u<s.length&&u<i.length;u++)if(!gr(i[u],s[u]))return!1;return!0}function sm(i,s,u,p,x,w){return Yi=w,lt=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,O.H=i===null||i.memoizedState===null?R0:wm,Fs=!1,w=u(p,x),Fs=!1,Ko&&(w=Jv(s,u,p,x)),Zv(i),w}function Zv(i){O.H=Mc;var s=Pt!==null&&Pt.next!==null;if(Yi=0,vn=Pt=lt=null,Md=!1,Cc=0,Go=null,s)throw Error(r(300));i===null||wn||(i=i.dependencies,i!==null&&kd(i)&&(wn=!0))}function Jv(i,s,u,p){lt=i;var x=0;do{if(Ko&&(Go=null),Cc=0,Ko=!1,25<=x)throw Error(r(301));if(x+=1,vn=Pt=null,i.updateQueue!=null){var w=i.updateQueue;w.lastEffect=null,w.events=null,w.stores=null,w.memoCache!=null&&(w.memoCache.index=0)}O.H=L0,w=s(u,p)}while(Ko);return w}function RT(){var i=O.H,s=i.useState()[0];return s=typeof s.then=="function"?Ac(s):s,i=i.useState()[0],(Pt!==null?Pt.memoizedState:null)!==i&&(lt.flags|=1024),s}function om(){var i=Dd!==0;return Dd=0,i}function lm(i,s,u){s.updateQueue=i.updateQueue,s.flags&=-2053,i.lanes&=~u}function cm(i){if(Md){for(i=i.memoizedState;i!==null;){var s=i.queue;s!==null&&(s.pending=null),i=i.next}Md=!1}Yi=0,vn=Pt=lt=null,Ko=!1,Cc=Dd=0,Go=null}function Xn(){var i={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return vn===null?lt.memoizedState=vn=i:vn=vn.next=i,vn}function yn(){if(Pt===null){var i=lt.alternate;i=i!==null?i.memoizedState:null}else i=Pt.next;var s=vn===null?lt.memoizedState:vn.next;if(s!==null)vn=s,Pt=i;else{if(i===null)throw lt.alternate===null?Error(r(467)):Error(r(310));Pt=i,i={memoizedState:Pt.memoizedState,baseState:Pt.baseState,baseQueue:Pt.baseQueue,queue:Pt.queue,next:null},vn===null?lt.memoizedState=vn=i:vn=vn.next=i}return vn}function Od(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ac(i){var s=Cc;return Cc+=1,Go===null&&(Go=[]),i=qv(Go,i,s),s=lt,(vn===null?s.memoizedState:vn.next)===null&&(s=s.alternate,O.H=s===null||s.memoizedState===null?R0:wm),i}function Rd(i){if(i!==null&&typeof i=="object"){if(typeof i.then=="function")return Ac(i);if(i.$$typeof===S)return zn(i)}throw Error(r(438,String(i)))}function um(i){var s=null,u=lt.updateQueue;if(u!==null&&(s=u.memoCache),s==null){var p=lt.alternate;p!==null&&(p=p.updateQueue,p!==null&&(p=p.memoCache,p!=null&&(s={data:p.data.map(function(x){return x.slice()}),index:0})))}if(s==null&&(s={data:[],index:0}),u===null&&(u=Od(),lt.updateQueue=u),u.memoCache=s,u=s.data[s.index],u===void 0)for(u=s.data[s.index]=Array(i),p=0;p<i;p++)u[p]=z;return s.index++,u}function Qi(i,s){return typeof s=="function"?s(i):s}function Ld(i){var s=yn();return dm(s,Pt,i)}function dm(i,s,u){var p=i.queue;if(p===null)throw Error(r(311));p.lastRenderedReducer=u;var x=i.baseQueue,w=p.pending;if(w!==null){if(x!==null){var A=x.next;x.next=w.next,w.next=A}s.baseQueue=x=w,p.pending=null}if(w=i.baseState,x===null)i.memoizedState=w;else{s=x.next;var U=A=null,W=null,se=s,me=!1;do{var we=se.lane&-536870913;if(we!==se.lane?(xt&we)===we:(Yi&we)===we){var le=se.revertLane;if(le===0)W!==null&&(W=W.next={lane:0,revertLane:0,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null}),we===$o&&(me=!0);else if((Yi&le)===le){se=se.next,le===$o&&(me=!0);continue}else we={lane:0,revertLane:se.revertLane,gesture:null,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?(U=W=we,A=w):W=W.next=we,lt.lanes|=le,qa|=le;we=se.action,Fs&&u(w,we),w=se.hasEagerState?se.eagerState:u(w,we)}else le={lane:we,revertLane:se.revertLane,gesture:se.gesture,action:se.action,hasEagerState:se.hasEagerState,eagerState:se.eagerState,next:null},W===null?(U=W=le,A=w):W=W.next=le,lt.lanes|=we,qa|=we;se=se.next}while(se!==null&&se!==s);if(W===null?A=w:W.next=U,!gr(w,i.memoizedState)&&(wn=!0,me&&(u=Uo,u!==null)))throw u;i.memoizedState=w,i.baseState=A,i.baseQueue=W,p.lastRenderedState=w}return x===null&&(p.lanes=0),[i.memoizedState,p.dispatch]}function fm(i){var s=yn(),u=s.queue;if(u===null)throw Error(r(311));u.lastRenderedReducer=i;var p=u.dispatch,x=u.pending,w=s.memoizedState;if(x!==null){u.pending=null;var A=x=x.next;do w=i(w,A.action),A=A.next;while(A!==x);gr(w,s.memoizedState)||(wn=!0),s.memoizedState=w,s.baseQueue===null&&(s.baseState=w),u.lastRenderedState=w}return[w,p]}function e0(i,s,u){var p=lt,x=yn(),w=wt;if(w){if(u===void 0)throw Error(r(407));u=u()}else u=s();var A=!gr((Pt||x).memoizedState,u);if(A&&(x.memoizedState=u,wn=!0),x=x.queue,mm(r0.bind(null,p,x,i),[i]),x.getSnapshot!==s||A||vn!==null&&vn.memoizedState.tag&1){if(p.flags|=2048,Vo(9,{destroy:void 0},n0.bind(null,p,x,u,s),null),qt===null)throw Error(r(349));w||(Yi&127)!==0||t0(p,s,u)}return u}function t0(i,s,u){i.flags|=16384,i={getSnapshot:s,value:u},s=lt.updateQueue,s===null?(s=Od(),lt.updateQueue=s,s.stores=[i]):(u=s.stores,u===null?s.stores=[i]:u.push(i))}function n0(i,s,u,p){s.value=u,s.getSnapshot=p,i0(s)&&a0(i)}function r0(i,s,u){return u(function(){i0(s)&&a0(i)})}function i0(i){var s=i.getSnapshot;i=i.value;try{var u=s();return!gr(i,u)}catch{return!0}}function a0(i){var s=Os(i,2);s!==null&&lr(s,i,2)}function hm(i){var s=Xn();if(typeof i=="function"){var u=i;if(i=u(),Fs){Qt(!0);try{u()}finally{Qt(!1)}}}return s.memoizedState=s.baseState=i,s.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:i},s}function s0(i,s,u,p){return i.baseState=u,dm(i,Pt,typeof p=="function"?p:Qi)}function LT(i,s,u,p,x){if(Pd(i))throw Error(r(485));if(i=s.action,i!==null){var w={payload:x,action:i,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){w.listeners.push(A)}};O.T!==null?u(!0):w.isTransition=!1,p(w),u=s.pending,u===null?(w.next=s.pending=w,o0(s,w)):(w.next=u.next,s.pending=u.next=w)}}function o0(i,s){var u=s.action,p=s.payload,x=i.state;if(s.isTransition){var w=O.T,A={};O.T=A;try{var U=u(x,p),W=O.S;W!==null&&W(A,U),l0(i,s,U)}catch(se){pm(i,s,se)}finally{w!==null&&A.types!==null&&(w.types=A.types),O.T=w}}else try{w=u(x,p),l0(i,s,w)}catch(se){pm(i,s,se)}}function l0(i,s,u){u!==null&&typeof u=="object"&&typeof u.then=="function"?u.then(function(p){c0(i,s,p)},function(p){return pm(i,s,p)}):c0(i,s,u)}function c0(i,s,u){s.status="fulfilled",s.value=u,u0(s),i.state=u,s=i.pending,s!==null&&(u=s.next,u===s?i.pending=null:(u=u.next,s.next=u,o0(i,u)))}function pm(i,s,u){var p=i.pending;if(i.pending=null,p!==null){p=p.next;do s.status="rejected",s.reason=u,u0(s),s=s.next;while(s!==p)}i.action=null}function u0(i){i=i.listeners;for(var s=0;s<i.length;s++)(0,i[s])()}function d0(i,s){return s}function f0(i,s){if(wt){var u=qt.formState;if(u!==null){e:{var p=lt;if(wt){if(Wt){t:{for(var x=Wt,w=zr;x.nodeType!==8;){if(!w){x=null;break t}if(x=Br(x.nextSibling),x===null){x=null;break t}}w=x.data,x=w==="F!"||w==="F"?x:null}if(x){Wt=Br(x.nextSibling),p=x.data==="F!";break e}}Ra(p)}p=!1}p&&(s=u[0])}}return u=Xn(),u.memoizedState=u.baseState=s,p={pending:null,lanes:0,dispatch:null,lastRenderedReducer:d0,lastRenderedState:s},u.queue=p,u=M0.bind(null,lt,p),p.dispatch=u,p=hm(!1),w=vm.bind(null,lt,!1,p.queue),p=Xn(),x={state:s,dispatch:null,action:i,pending:null},p.queue=x,u=LT.bind(null,lt,x,w,u),x.dispatch=u,p.memoizedState=i,[s,u,!1]}function h0(i){var s=yn();return p0(s,Pt,i)}function p0(i,s,u){if(s=dm(i,s,d0)[0],i=Ld(Qi)[0],typeof s=="object"&&s!==null&&typeof s.then=="function")try{var p=Ac(s)}catch(A){throw A===Fo?Nd:A}else p=s;s=yn();var x=s.queue,w=x.dispatch;return u!==s.memoizedState&&(lt.flags|=2048,Vo(9,{destroy:void 0},IT.bind(null,x,u),null)),[p,w,i]}function IT(i,s){i.action=s}function m0(i){var s=yn(),u=Pt;if(u!==null)return p0(s,u,i);yn(),s=s.memoizedState,u=yn();var p=u.queue.dispatch;return u.memoizedState=i,[s,p,!1]}function Vo(i,s,u,p){return i={tag:i,create:u,deps:p,inst:s,next:null},s=lt.updateQueue,s===null&&(s=Od(),lt.updateQueue=s),u=s.lastEffect,u===null?s.lastEffect=i.next=i:(p=u.next,u.next=i,i.next=p,s.lastEffect=i),i}function g0(){return yn().memoizedState}function Id(i,s,u,p){var x=Xn();lt.flags|=i,x.memoizedState=Vo(1|s,{destroy:void 0},u,p===void 0?null:p)}function zd(i,s,u,p){var x=yn();p=p===void 0?null:p;var w=x.memoizedState.inst;Pt!==null&&p!==null&&am(p,Pt.memoizedState.deps)?x.memoizedState=Vo(s,w,u,p):(lt.flags|=i,x.memoizedState=Vo(1|s,w,u,p))}function y0(i,s){Id(8390656,8,i,s)}function mm(i,s){zd(2048,8,i,s)}function zT(i){lt.flags|=4;var s=lt.updateQueue;if(s===null)s=Od(),lt.updateQueue=s,s.events=[i];else{var u=s.events;u===null?s.events=[i]:u.push(i)}}function b0(i){var s=yn().memoizedState;return zT({ref:s,nextImpl:i}),function(){if((Tt&2)!==0)throw Error(r(440));return s.impl.apply(void 0,arguments)}}function x0(i,s){return zd(4,2,i,s)}function v0(i,s){return zd(4,4,i,s)}function w0(i,s){if(typeof s=="function"){i=i();var u=s(i);return function(){typeof u=="function"?u():s(null)}}if(s!=null)return i=i(),s.current=i,function(){s.current=null}}function k0(i,s,u){u=u!=null?u.concat([i]):null,zd(4,4,w0.bind(null,s,i),u)}function gm(){}function E0(i,s){var u=yn();s=s===void 0?null:s;var p=u.memoizedState;return s!==null&&am(s,p[1])?p[0]:(u.memoizedState=[i,s],i)}function S0(i,s){var u=yn();s=s===void 0?null:s;var p=u.memoizedState;if(s!==null&&am(s,p[1]))return p[0];if(p=i(),Fs){Qt(!0);try{i()}finally{Qt(!1)}}return u.memoizedState=[p,s],p}function ym(i,s,u){return u===void 0||(Yi&1073741824)!==0&&(xt&261930)===0?i.memoizedState=s:(i.memoizedState=u,i=Nw(),lt.lanes|=i,qa|=i,u)}function N0(i,s,u,p){return gr(u,s)?u:Ho.current!==null?(i=ym(i,u,p),gr(i,s)||(wn=!0),i):(Yi&42)===0||(Yi&1073741824)!==0&&(xt&261930)===0?(wn=!0,i.memoizedState=u):(i=Nw(),lt.lanes|=i,qa|=i,s)}function _0(i,s,u,p,x){var w=V.p;V.p=w!==0&&8>w?w:8;var A=O.T,U={};O.T=U,vm(i,!1,s,u);try{var W=x(),se=O.S;if(se!==null&&se(U,W),W!==null&&typeof W=="object"&&typeof W.then=="function"){var me=DT(W,p);Tc(i,s,me,kr(i))}else Tc(i,s,p,kr(i))}catch(we){Tc(i,s,{then:function(){},status:"rejected",reason:we},kr())}finally{V.p=w,A!==null&&U.types!==null&&(A.types=U.types),O.T=A}}function PT(){}function bm(i,s,u,p){if(i.tag!==5)throw Error(r(476));var x=j0(i).queue;_0(i,x,s,Q,u===null?PT:function(){return C0(i),u(p)})}function j0(i){var s=i.memoizedState;if(s!==null)return s;s={memoizedState:Q,baseState:Q,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:Q},next:null};var u={};return s.next={memoizedState:u,baseState:u,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Qi,lastRenderedState:u},next:null},i.memoizedState=s,i=i.alternate,i!==null&&(i.memoizedState=s),s}function C0(i){var s=j0(i);s.next===null&&(s=i.alternate.memoizedState),Tc(i,s.next.queue,{},kr())}function xm(){return zn(Vc)}function A0(){return yn().memoizedState}function T0(){return yn().memoizedState}function BT(i){for(var s=i.return;s!==null;){switch(s.tag){case 24:case 3:var u=kr();i=za(u);var p=Pa(s,i,u);p!==null&&(lr(p,s,u),Nc(p,s,u)),s={cache:Yp()},i.payload=s;return}s=s.return}}function $T(i,s,u){var p=kr();u={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null},Pd(i)?D0(s,u):(u=zp(i,s,u,p),u!==null&&(lr(u,i,p),O0(u,s,p)))}function M0(i,s,u){var p=kr();Tc(i,s,u,p)}function Tc(i,s,u,p){var x={lane:p,revertLane:0,gesture:null,action:u,hasEagerState:!1,eagerState:null,next:null};if(Pd(i))D0(s,x);else{var w=i.alternate;if(i.lanes===0&&(w===null||w.lanes===0)&&(w=s.lastRenderedReducer,w!==null))try{var A=s.lastRenderedState,U=w(A,u);if(x.hasEagerState=!0,x.eagerState=U,gr(U,A))return bd(i,s,x,0),qt===null&&yd(),!1}catch{}finally{}if(u=zp(i,s,x,p),u!==null)return lr(u,i,p),O0(u,s,p),!0}return!1}function vm(i,s,u,p){if(p={lane:2,revertLane:Zm(),gesture:null,action:p,hasEagerState:!1,eagerState:null,next:null},Pd(i)){if(s)throw Error(r(479))}else s=zp(i,u,p,2),s!==null&&lr(s,i,2)}function Pd(i){var s=i.alternate;return i===lt||s!==null&&s===lt}function D0(i,s){Ko=Md=!0;var u=i.pending;u===null?s.next=s:(s.next=u.next,u.next=s),i.pending=s}function O0(i,s,u){if((u&4194048)!==0){var p=s.lanes;p&=i.pendingLanes,u|=p,s.lanes=u,et(i,u)}}var Mc={readContext:zn,use:Rd,useCallback:hn,useContext:hn,useEffect:hn,useImperativeHandle:hn,useLayoutEffect:hn,useInsertionEffect:hn,useMemo:hn,useReducer:hn,useRef:hn,useState:hn,useDebugValue:hn,useDeferredValue:hn,useTransition:hn,useSyncExternalStore:hn,useId:hn,useHostTransitionStatus:hn,useFormState:hn,useActionState:hn,useOptimistic:hn,useMemoCache:hn,useCacheRefresh:hn};Mc.useEffectEvent=hn;var R0={readContext:zn,use:Rd,useCallback:function(i,s){return Xn().memoizedState=[i,s===void 0?null:s],i},useContext:zn,useEffect:y0,useImperativeHandle:function(i,s,u){u=u!=null?u.concat([i]):null,Id(4194308,4,w0.bind(null,s,i),u)},useLayoutEffect:function(i,s){return Id(4194308,4,i,s)},useInsertionEffect:function(i,s){Id(4,2,i,s)},useMemo:function(i,s){var u=Xn();s=s===void 0?null:s;var p=i();if(Fs){Qt(!0);try{i()}finally{Qt(!1)}}return u.memoizedState=[p,s],p},useReducer:function(i,s,u){var p=Xn();if(u!==void 0){var x=u(s);if(Fs){Qt(!0);try{u(s)}finally{Qt(!1)}}}else x=s;return p.memoizedState=p.baseState=x,i={pending:null,lanes:0,dispatch:null,lastRenderedReducer:i,lastRenderedState:x},p.queue=i,i=i.dispatch=$T.bind(null,lt,i),[p.memoizedState,i]},useRef:function(i){var s=Xn();return i={current:i},s.memoizedState=i},useState:function(i){i=hm(i);var s=i.queue,u=M0.bind(null,lt,s);return s.dispatch=u,[i.memoizedState,u]},useDebugValue:gm,useDeferredValue:function(i,s){var u=Xn();return ym(u,i,s)},useTransition:function(){var i=hm(!1);return i=_0.bind(null,lt,i.queue,!0,!1),Xn().memoizedState=i,[!1,i]},useSyncExternalStore:function(i,s,u){var p=lt,x=Xn();if(wt){if(u===void 0)throw Error(r(407));u=u()}else{if(u=s(),qt===null)throw Error(r(349));(xt&127)!==0||t0(p,s,u)}x.memoizedState=u;var w={value:u,getSnapshot:s};return x.queue=w,y0(r0.bind(null,p,w,i),[i]),p.flags|=2048,Vo(9,{destroy:void 0},n0.bind(null,p,w,u,s),null),u},useId:function(){var i=Xn(),s=qt.identifierPrefix;if(wt){var u=vi,p=xi;u=(p&~(1<<32-yt(p)-1)).toString(32)+u,s="_"+s+"R_"+u,u=Dd++,0<u&&(s+="H"+u.toString(32)),s+="_"}else u=OT++,s="_"+s+"r_"+u.toString(32)+"_";return i.memoizedState=s},useHostTransitionStatus:xm,useFormState:f0,useActionState:f0,useOptimistic:function(i){var s=Xn();s.memoizedState=s.baseState=i;var u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return s.queue=u,s=vm.bind(null,lt,!0,u),u.dispatch=s,[i,s]},useMemoCache:um,useCacheRefresh:function(){return Xn().memoizedState=BT.bind(null,lt)},useEffectEvent:function(i){var s=Xn(),u={impl:i};return s.memoizedState=u,function(){if((Tt&2)!==0)throw Error(r(440));return u.impl.apply(void 0,arguments)}}},wm={readContext:zn,use:Rd,useCallback:E0,useContext:zn,useEffect:mm,useImperativeHandle:k0,useInsertionEffect:x0,useLayoutEffect:v0,useMemo:S0,useReducer:Ld,useRef:g0,useState:function(){return Ld(Qi)},useDebugValue:gm,useDeferredValue:function(i,s){var u=yn();return N0(u,Pt.memoizedState,i,s)},useTransition:function(){var i=Ld(Qi)[0],s=yn().memoizedState;return[typeof i=="boolean"?i:Ac(i),s]},useSyncExternalStore:e0,useId:A0,useHostTransitionStatus:xm,useFormState:h0,useActionState:h0,useOptimistic:function(i,s){var u=yn();return s0(u,Pt,i,s)},useMemoCache:um,useCacheRefresh:T0};wm.useEffectEvent=b0;var L0={readContext:zn,use:Rd,useCallback:E0,useContext:zn,useEffect:mm,useImperativeHandle:k0,useInsertionEffect:x0,useLayoutEffect:v0,useMemo:S0,useReducer:fm,useRef:g0,useState:function(){return fm(Qi)},useDebugValue:gm,useDeferredValue:function(i,s){var u=yn();return Pt===null?ym(u,i,s):N0(u,Pt.memoizedState,i,s)},useTransition:function(){var i=fm(Qi)[0],s=yn().memoizedState;return[typeof i=="boolean"?i:Ac(i),s]},useSyncExternalStore:e0,useId:A0,useHostTransitionStatus:xm,useFormState:m0,useActionState:m0,useOptimistic:function(i,s){var u=yn();return Pt!==null?s0(u,Pt,i,s):(u.baseState=i,[i,u.queue.dispatch])},useMemoCache:um,useCacheRefresh:T0};L0.useEffectEvent=b0;function km(i,s,u,p){s=i.memoizedState,u=u(p,s),u=u==null?s:m({},s,u),i.memoizedState=u,i.lanes===0&&(i.updateQueue.baseState=u)}var Em={enqueueSetState:function(i,s,u){i=i._reactInternals;var p=kr(),x=za(p);x.payload=s,u!=null&&(x.callback=u),s=Pa(i,x,p),s!==null&&(lr(s,i,p),Nc(s,i,p))},enqueueReplaceState:function(i,s,u){i=i._reactInternals;var p=kr(),x=za(p);x.tag=1,x.payload=s,u!=null&&(x.callback=u),s=Pa(i,x,p),s!==null&&(lr(s,i,p),Nc(s,i,p))},enqueueForceUpdate:function(i,s){i=i._reactInternals;var u=kr(),p=za(u);p.tag=2,s!=null&&(p.callback=s),s=Pa(i,p,u),s!==null&&(lr(s,i,u),Nc(s,i,u))}};function I0(i,s,u,p,x,w,A){return i=i.stateNode,typeof i.shouldComponentUpdate=="function"?i.shouldComponentUpdate(p,w,A):s.prototype&&s.prototype.isPureReactComponent?!yc(u,p)||!yc(x,w):!0}function z0(i,s,u,p){i=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(u,p),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(u,p),s.state!==i&&Em.enqueueReplaceState(s,s.state,null)}function qs(i,s){var u=s;if("ref"in s){u={};for(var p in s)p!=="ref"&&(u[p]=s[p])}if(i=i.defaultProps){u===s&&(u=m({},u));for(var x in i)u[x]===void 0&&(u[x]=i[x])}return u}function P0(i){gd(i)}function B0(i){console.error(i)}function $0(i){gd(i)}function Bd(i,s){try{var u=i.onUncaughtError;u(s.value,{componentStack:s.stack})}catch(p){setTimeout(function(){throw p})}}function U0(i,s,u){try{var p=i.onCaughtError;p(u.value,{componentStack:u.stack,errorBoundary:s.tag===1?s.stateNode:null})}catch(x){setTimeout(function(){throw x})}}function Sm(i,s,u){return u=za(u),u.tag=3,u.payload={element:null},u.callback=function(){Bd(i,s)},u}function F0(i){return i=za(i),i.tag=3,i}function q0(i,s,u,p){var x=u.type.getDerivedStateFromError;if(typeof x=="function"){var w=p.value;i.payload=function(){return x(w)},i.callback=function(){U0(s,u,p)}}var A=u.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(i.callback=function(){U0(s,u,p),typeof x!="function"&&(Ha===null?Ha=new Set([this]):Ha.add(this));var U=p.stack;this.componentDidCatch(p.value,{componentStack:U!==null?U:""})})}function UT(i,s,u,p,x){if(u.flags|=32768,p!==null&&typeof p=="object"&&typeof p.then=="function"){if(s=u.alternate,s!==null&&Bo(s,u,x,!0),u=br.current,u!==null){switch(u.tag){case 31:case 13:return Pr===null?Xd():u.alternate===null&&pn===0&&(pn=3),u.flags&=-257,u.flags|=65536,u.lanes=x,p===_d?u.flags|=16384:(s=u.updateQueue,s===null?u.updateQueue=new Set([p]):s.add(p),Qm(i,p,x)),!1;case 22:return u.flags|=65536,p===_d?u.flags|=16384:(s=u.updateQueue,s===null?(s={transitions:null,markerInstances:null,retryQueue:new Set([p])},u.updateQueue=s):(u=s.retryQueue,u===null?s.retryQueue=new Set([p]):u.add(p)),Qm(i,p,x)),!1}throw Error(r(435,u.tag))}return Qm(i,p,x),Xd(),!1}if(wt)return s=br.current,s!==null?((s.flags&65536)===0&&(s.flags|=256),s.flags|=65536,s.lanes=x,p!==qp&&(i=Error(r(422),{cause:p}),vc(Rr(i,u)))):(p!==qp&&(s=Error(r(423),{cause:p}),vc(Rr(s,u))),i=i.current.alternate,i.flags|=65536,x&=-x,i.lanes|=x,p=Rr(p,u),x=Sm(i.stateNode,p,x),em(i,x),pn!==4&&(pn=2)),!1;var w=Error(r(520),{cause:p});if(w=Rr(w,u),Bc===null?Bc=[w]:Bc.push(w),pn!==4&&(pn=2),s===null)return!0;p=Rr(p,u),u=s;do{switch(u.tag){case 3:return u.flags|=65536,i=x&-x,u.lanes|=i,i=Sm(u.stateNode,p,i),em(u,i),!1;case 1:if(s=u.type,w=u.stateNode,(u.flags&128)===0&&(typeof s.getDerivedStateFromError=="function"||w!==null&&typeof w.componentDidCatch=="function"&&(Ha===null||!Ha.has(w))))return u.flags|=65536,x&=-x,u.lanes|=x,x=F0(x),q0(x,i,u,p),em(u,x),!1}u=u.return}while(u!==null);return!1}var Nm=Error(r(461)),wn=!1;function Pn(i,s,u,p){s.child=i===null?Vv(s,null,u,p):Us(s,i.child,u,p)}function H0(i,s,u,p,x){u=u.render;var w=s.ref;if("ref"in p){var A={};for(var U in p)U!=="ref"&&(A[U]=p[U])}else A=p;return zs(s),p=sm(i,s,u,A,w,x),U=om(),i!==null&&!wn?(lm(i,s,x),Wi(i,s,x)):(wt&&U&&Up(s),s.flags|=1,Pn(i,s,p,x),s.child)}function K0(i,s,u,p,x){if(i===null){var w=u.type;return typeof w=="function"&&!Pp(w)&&w.defaultProps===void 0&&u.compare===null?(s.tag=15,s.type=w,G0(i,s,w,p,x)):(i=vd(u.type,null,p,s,s.mode,x),i.ref=s.ref,i.return=s,s.child=i)}if(w=i.child,!Om(i,x)){var A=w.memoizedProps;if(u=u.compare,u=u!==null?u:yc,u(A,p)&&i.ref===s.ref)return Wi(i,s,x)}return s.flags|=1,i=Hi(w,p),i.ref=s.ref,i.return=s,s.child=i}function G0(i,s,u,p,x){if(i!==null){var w=i.memoizedProps;if(yc(w,p)&&i.ref===s.ref)if(wn=!1,s.pendingProps=p=w,Om(i,x))(i.flags&131072)!==0&&(wn=!0);else return s.lanes=i.lanes,Wi(i,s,x)}return _m(i,s,u,p,x)}function V0(i,s,u,p){var x=p.children,w=i!==null?i.memoizedState:null;if(i===null&&s.stateNode===null&&(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),p.mode==="hidden"){if((s.flags&128)!==0){if(w=w!==null?w.baseLanes|u:u,i!==null){for(p=s.child=i.child,x=0;p!==null;)x=x|p.lanes|p.childLanes,p=p.sibling;p=x&~w}else p=0,s.child=null;return Y0(i,s,w,u,p)}if((u&536870912)!==0)s.memoizedState={baseLanes:0,cachePool:null},i!==null&&Sd(s,w!==null?w.cachePool:null),w!==null?Wv(s,w):nm(),Xv(s);else return p=s.lanes=536870912,Y0(i,s,w!==null?w.baseLanes|u:u,u,p)}else w!==null?(Sd(s,w.cachePool),Wv(s,w),$a(),s.memoizedState=null):(i!==null&&Sd(s,null),nm(),$a());return Pn(i,s,x,u),s.child}function Dc(i,s){return i!==null&&i.tag===22||s.stateNode!==null||(s.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.sibling}function Y0(i,s,u,p,x){var w=Wp();return w=w===null?null:{parent:xn._currentValue,pool:w},s.memoizedState={baseLanes:u,cachePool:w},i!==null&&Sd(s,null),nm(),Xv(s),i!==null&&Bo(i,s,p,!0),s.childLanes=x,null}function $d(i,s){return s=Fd({mode:s.mode,children:s.children},i.mode),s.ref=i.ref,i.child=s,s.return=i,s}function Q0(i,s,u){return Us(s,i.child,null,u),i=$d(s,s.pendingProps),i.flags|=2,xr(s),s.memoizedState=null,i}function FT(i,s,u){var p=s.pendingProps,x=(s.flags&128)!==0;if(s.flags&=-129,i===null){if(wt){if(p.mode==="hidden")return i=$d(s,p),s.lanes=536870912,Dc(null,i);if(im(s),(i=Wt)?(i=o1(i,zr),i=i!==null&&i.data==="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Da!==null?{id:xi,overflow:vi}:null,retryLane:536870912,hydrationErrors:null},u=Dv(i),u.return=s,s.child=u,In=s,Wt=null)):i=null,i===null)throw Ra(s);return s.lanes=536870912,null}return $d(s,p)}var w=i.memoizedState;if(w!==null){var A=w.dehydrated;if(im(s),x)if(s.flags&256)s.flags&=-257,s=Q0(i,s,u);else if(s.memoizedState!==null)s.child=i.child,s.flags|=128,s=null;else throw Error(r(558));else if(wn||Bo(i,s,u,!1),x=(u&i.childLanes)!==0,wn||x){if(p=qt,p!==null&&(A=rn(p,u),A!==0&&A!==w.retryLane))throw w.retryLane=A,Os(i,A),lr(p,i,A),Nm;Xd(),s=Q0(i,s,u)}else i=w.treeContext,Wt=Br(A.nextSibling),In=s,wt=!0,Oa=null,zr=!1,i!==null&&Lv(s,i),s=$d(s,p),s.flags|=4096;return s}return i=Hi(i.child,{mode:p.mode,children:p.children}),i.ref=s.ref,s.child=i,i.return=s,i}function Ud(i,s){var u=s.ref;if(u===null)i!==null&&i.ref!==null&&(s.flags|=4194816);else{if(typeof u!="function"&&typeof u!="object")throw Error(r(284));(i===null||i.ref!==u)&&(s.flags|=4194816)}}function _m(i,s,u,p,x){return zs(s),u=sm(i,s,u,p,void 0,x),p=om(),i!==null&&!wn?(lm(i,s,x),Wi(i,s,x)):(wt&&p&&Up(s),s.flags|=1,Pn(i,s,u,x),s.child)}function W0(i,s,u,p,x,w){return zs(s),s.updateQueue=null,u=Jv(s,p,u,x),Zv(i),p=om(),i!==null&&!wn?(lm(i,s,w),Wi(i,s,w)):(wt&&p&&Up(s),s.flags|=1,Pn(i,s,u,w),s.child)}function X0(i,s,u,p,x){if(zs(s),s.stateNode===null){var w=Lo,A=u.contextType;typeof A=="object"&&A!==null&&(w=zn(A)),w=new u(p,w),s.memoizedState=w.state!==null&&w.state!==void 0?w.state:null,w.updater=Em,s.stateNode=w,w._reactInternals=s,w=s.stateNode,w.props=p,w.state=s.memoizedState,w.refs={},Zp(s),A=u.contextType,w.context=typeof A=="object"&&A!==null?zn(A):Lo,w.state=s.memoizedState,A=u.getDerivedStateFromProps,typeof A=="function"&&(km(s,u,A,p),w.state=s.memoizedState),typeof u.getDerivedStateFromProps=="function"||typeof w.getSnapshotBeforeUpdate=="function"||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(A=w.state,typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount(),A!==w.state&&Em.enqueueReplaceState(w,w.state,null),jc(s,p,w,x),_c(),w.state=s.memoizedState),typeof w.componentDidMount=="function"&&(s.flags|=4194308),p=!0}else if(i===null){w=s.stateNode;var U=s.memoizedProps,W=qs(u,U);w.props=W;var se=w.context,me=u.contextType;A=Lo,typeof me=="object"&&me!==null&&(A=zn(me));var we=u.getDerivedStateFromProps;me=typeof we=="function"||typeof w.getSnapshotBeforeUpdate=="function",U=s.pendingProps!==U,me||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(U||se!==A)&&z0(s,w,p,A),Ia=!1;var le=s.memoizedState;w.state=le,jc(s,p,w,x),_c(),se=s.memoizedState,U||le!==se||Ia?(typeof we=="function"&&(km(s,u,we,p),se=s.memoizedState),(W=Ia||I0(s,u,W,p,le,se,A))?(me||typeof w.UNSAFE_componentWillMount!="function"&&typeof w.componentWillMount!="function"||(typeof w.componentWillMount=="function"&&w.componentWillMount(),typeof w.UNSAFE_componentWillMount=="function"&&w.UNSAFE_componentWillMount()),typeof w.componentDidMount=="function"&&(s.flags|=4194308)):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=p,s.memoizedState=se),w.props=p,w.state=se,w.context=A,p=W):(typeof w.componentDidMount=="function"&&(s.flags|=4194308),p=!1)}else{w=s.stateNode,Jp(i,s),A=s.memoizedProps,me=qs(u,A),w.props=me,we=s.pendingProps,le=w.context,se=u.contextType,W=Lo,typeof se=="object"&&se!==null&&(W=zn(se)),U=u.getDerivedStateFromProps,(se=typeof U=="function"||typeof w.getSnapshotBeforeUpdate=="function")||typeof w.UNSAFE_componentWillReceiveProps!="function"&&typeof w.componentWillReceiveProps!="function"||(A!==we||le!==W)&&z0(s,w,p,W),Ia=!1,le=s.memoizedState,w.state=le,jc(s,p,w,x),_c();var fe=s.memoizedState;A!==we||le!==fe||Ia||i!==null&&i.dependencies!==null&&kd(i.dependencies)?(typeof U=="function"&&(km(s,u,U,p),fe=s.memoizedState),(me=Ia||I0(s,u,me,p,le,fe,W)||i!==null&&i.dependencies!==null&&kd(i.dependencies))?(se||typeof w.UNSAFE_componentWillUpdate!="function"&&typeof w.componentWillUpdate!="function"||(typeof w.componentWillUpdate=="function"&&w.componentWillUpdate(p,fe,W),typeof w.UNSAFE_componentWillUpdate=="function"&&w.UNSAFE_componentWillUpdate(p,fe,W)),typeof w.componentDidUpdate=="function"&&(s.flags|=4),typeof w.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof w.componentDidUpdate!="function"||A===i.memoizedProps&&le===i.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&le===i.memoizedState||(s.flags|=1024),s.memoizedProps=p,s.memoizedState=fe),w.props=p,w.state=fe,w.context=W,p=me):(typeof w.componentDidUpdate!="function"||A===i.memoizedProps&&le===i.memoizedState||(s.flags|=4),typeof w.getSnapshotBeforeUpdate!="function"||A===i.memoizedProps&&le===i.memoizedState||(s.flags|=1024),p=!1)}return w=p,Ud(i,s),p=(s.flags&128)!==0,w||p?(w=s.stateNode,u=p&&typeof u.getDerivedStateFromError!="function"?null:w.render(),s.flags|=1,i!==null&&p?(s.child=Us(s,i.child,null,x),s.child=Us(s,null,u,x)):Pn(i,s,u,x),s.memoizedState=w.state,i=s.child):i=Wi(i,s,x),i}function Z0(i,s,u,p){return Ls(),s.flags|=256,Pn(i,s,u,p),s.child}var jm={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cm(i){return{baseLanes:i,cachePool:Uv()}}function Am(i,s,u){return i=i!==null?i.childLanes&~u:0,s&&(i|=wr),i}function J0(i,s,u){var p=s.pendingProps,x=!1,w=(s.flags&128)!==0,A;if((A=w)||(A=i!==null&&i.memoizedState===null?!1:(gn.current&2)!==0),A&&(x=!0,s.flags&=-129),A=(s.flags&32)!==0,s.flags&=-33,i===null){if(wt){if(x?Ba(s):$a(),(i=Wt)?(i=o1(i,zr),i=i!==null&&i.data!=="&"?i:null,i!==null&&(s.memoizedState={dehydrated:i,treeContext:Da!==null?{id:xi,overflow:vi}:null,retryLane:536870912,hydrationErrors:null},u=Dv(i),u.return=s,s.child=u,In=s,Wt=null)):i=null,i===null)throw Ra(s);return dg(i)?s.lanes=32:s.lanes=536870912,null}var U=p.children;return p=p.fallback,x?($a(),x=s.mode,U=Fd({mode:"hidden",children:U},x),p=Rs(p,x,u,null),U.return=s,p.return=s,U.sibling=p,s.child=U,p=s.child,p.memoizedState=Cm(u),p.childLanes=Am(i,A,u),s.memoizedState=jm,Dc(null,p)):(Ba(s),Tm(s,U))}var W=i.memoizedState;if(W!==null&&(U=W.dehydrated,U!==null)){if(w)s.flags&256?(Ba(s),s.flags&=-257,s=Mm(i,s,u)):s.memoizedState!==null?($a(),s.child=i.child,s.flags|=128,s=null):($a(),U=p.fallback,x=s.mode,p=Fd({mode:"visible",children:p.children},x),U=Rs(U,x,u,null),U.flags|=2,p.return=s,U.return=s,p.sibling=U,s.child=p,Us(s,i.child,null,u),p=s.child,p.memoizedState=Cm(u),p.childLanes=Am(i,A,u),s.memoizedState=jm,s=Dc(null,p));else if(Ba(s),dg(U)){if(A=U.nextSibling&&U.nextSibling.dataset,A)var se=A.dgst;A=se,p=Error(r(419)),p.stack="",p.digest=A,vc({value:p,source:null,stack:null}),s=Mm(i,s,u)}else if(wn||Bo(i,s,u,!1),A=(u&i.childLanes)!==0,wn||A){if(A=qt,A!==null&&(p=rn(A,u),p!==0&&p!==W.retryLane))throw W.retryLane=p,Os(i,p),lr(A,i,p),Nm;ug(U)||Xd(),s=Mm(i,s,u)}else ug(U)?(s.flags|=192,s.child=i.child,s=null):(i=W.treeContext,Wt=Br(U.nextSibling),In=s,wt=!0,Oa=null,zr=!1,i!==null&&Lv(s,i),s=Tm(s,p.children),s.flags|=4096);return s}return x?($a(),U=p.fallback,x=s.mode,W=i.child,se=W.sibling,p=Hi(W,{mode:"hidden",children:p.children}),p.subtreeFlags=W.subtreeFlags&65011712,se!==null?U=Hi(se,U):(U=Rs(U,x,u,null),U.flags|=2),U.return=s,p.return=s,p.sibling=U,s.child=p,Dc(null,p),p=s.child,U=i.child.memoizedState,U===null?U=Cm(u):(x=U.cachePool,x!==null?(W=xn._currentValue,x=x.parent!==W?{parent:W,pool:W}:x):x=Uv(),U={baseLanes:U.baseLanes|u,cachePool:x}),p.memoizedState=U,p.childLanes=Am(i,A,u),s.memoizedState=jm,Dc(i.child,p)):(Ba(s),u=i.child,i=u.sibling,u=Hi(u,{mode:"visible",children:p.children}),u.return=s,u.sibling=null,i!==null&&(A=s.deletions,A===null?(s.deletions=[i],s.flags|=16):A.push(i)),s.child=u,s.memoizedState=null,u)}function Tm(i,s){return s=Fd({mode:"visible",children:s},i.mode),s.return=i,i.child=s}function Fd(i,s){return i=yr(22,i,null,s),i.lanes=0,i}function Mm(i,s,u){return Us(s,i.child,null,u),i=Tm(s,s.pendingProps.children),i.flags|=2,s.memoizedState=null,i}function ew(i,s,u){i.lanes|=s;var p=i.alternate;p!==null&&(p.lanes|=s),Gp(i.return,s,u)}function Dm(i,s,u,p,x,w){var A=i.memoizedState;A===null?i.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:p,tail:u,tailMode:x,treeForkCount:w}:(A.isBackwards=s,A.rendering=null,A.renderingStartTime=0,A.last=p,A.tail=u,A.tailMode=x,A.treeForkCount=w)}function tw(i,s,u){var p=s.pendingProps,x=p.revealOrder,w=p.tail;p=p.children;var A=gn.current,U=(A&2)!==0;if(U?(A=A&1|2,s.flags|=128):A&=1,B(gn,A),Pn(i,s,p,u),p=wt?xc:0,!U&&i!==null&&(i.flags&128)!==0)e:for(i=s.child;i!==null;){if(i.tag===13)i.memoizedState!==null&&ew(i,u,s);else if(i.tag===19)ew(i,u,s);else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===s)break e;for(;i.sibling===null;){if(i.return===null||i.return===s)break e;i=i.return}i.sibling.return=i.return,i=i.sibling}switch(x){case"forwards":for(u=s.child,x=null;u!==null;)i=u.alternate,i!==null&&Td(i)===null&&(x=u),u=u.sibling;u=x,u===null?(x=s.child,s.child=null):(x=u.sibling,u.sibling=null),Dm(s,!1,x,u,w,p);break;case"backwards":case"unstable_legacy-backwards":for(u=null,x=s.child,s.child=null;x!==null;){if(i=x.alternate,i!==null&&Td(i)===null){s.child=x;break}i=x.sibling,x.sibling=u,u=x,x=i}Dm(s,!0,u,null,w,p);break;case"together":Dm(s,!1,null,null,void 0,p);break;default:s.memoizedState=null}return s.child}function Wi(i,s,u){if(i!==null&&(s.dependencies=i.dependencies),qa|=s.lanes,(u&s.childLanes)===0)if(i!==null){if(Bo(i,s,u,!1),(u&s.childLanes)===0)return null}else return null;if(i!==null&&s.child!==i.child)throw Error(r(153));if(s.child!==null){for(i=s.child,u=Hi(i,i.pendingProps),s.child=u,u.return=s;i.sibling!==null;)i=i.sibling,u=u.sibling=Hi(i,i.pendingProps),u.return=s;u.sibling=null}return s.child}function Om(i,s){return(i.lanes&s)!==0?!0:(i=i.dependencies,!!(i!==null&&kd(i)))}function qT(i,s,u){switch(s.tag){case 3:J(s,s.stateNode.containerInfo),La(s,xn,i.memoizedState.cache),Ls();break;case 27:case 5:Te(s);break;case 4:J(s,s.stateNode.containerInfo);break;case 10:La(s,s.type,s.memoizedProps.value);break;case 31:if(s.memoizedState!==null)return s.flags|=128,im(s),null;break;case 13:var p=s.memoizedState;if(p!==null)return p.dehydrated!==null?(Ba(s),s.flags|=128,null):(u&s.child.childLanes)!==0?J0(i,s,u):(Ba(s),i=Wi(i,s,u),i!==null?i.sibling:null);Ba(s);break;case 19:var x=(i.flags&128)!==0;if(p=(u&s.childLanes)!==0,p||(Bo(i,s,u,!1),p=(u&s.childLanes)!==0),x){if(p)return tw(i,s,u);s.flags|=128}if(x=s.memoizedState,x!==null&&(x.rendering=null,x.tail=null,x.lastEffect=null),B(gn,gn.current),p)break;return null;case 22:return s.lanes=0,V0(i,s,u,s.pendingProps);case 24:La(s,xn,i.memoizedState.cache)}return Wi(i,s,u)}function nw(i,s,u){if(i!==null)if(i.memoizedProps!==s.pendingProps)wn=!0;else{if(!Om(i,u)&&(s.flags&128)===0)return wn=!1,qT(i,s,u);wn=(i.flags&131072)!==0}else wn=!1,wt&&(s.flags&1048576)!==0&&Rv(s,xc,s.index);switch(s.lanes=0,s.tag){case 16:e:{var p=s.pendingProps;if(i=Bs(s.elementType),s.type=i,typeof i=="function")Pp(i)?(p=qs(i,p),s.tag=1,s=X0(null,s,i,p,u)):(s.tag=0,s=_m(null,s,i,p,u));else{if(i!=null){var x=i.$$typeof;if(x===_){s.tag=11,s=H0(null,s,i,p,u);break e}else if(x===L){s.tag=14,s=K0(null,s,i,p,u);break e}}throw s=D(i)||i,Error(r(306,s,""))}}return s;case 0:return _m(i,s,s.type,s.pendingProps,u);case 1:return p=s.type,x=qs(p,s.pendingProps),X0(i,s,p,x,u);case 3:e:{if(J(s,s.stateNode.containerInfo),i===null)throw Error(r(387));p=s.pendingProps;var w=s.memoizedState;x=w.element,Jp(i,s),jc(s,p,null,u);var A=s.memoizedState;if(p=A.cache,La(s,xn,p),p!==w.cache&&Vp(s,[xn],u,!0),_c(),p=A.element,w.isDehydrated)if(w={element:p,isDehydrated:!1,cache:A.cache},s.updateQueue.baseState=w,s.memoizedState=w,s.flags&256){s=Z0(i,s,p,u);break e}else if(p!==x){x=Rr(Error(r(424)),s),vc(x),s=Z0(i,s,p,u);break e}else{switch(i=s.stateNode.containerInfo,i.nodeType){case 9:i=i.body;break;default:i=i.nodeName==="HTML"?i.ownerDocument.body:i}for(Wt=Br(i.firstChild),In=s,wt=!0,Oa=null,zr=!0,u=Vv(s,null,p,u),s.child=u;u;)u.flags=u.flags&-3|4096,u=u.sibling}else{if(Ls(),p===x){s=Wi(i,s,u);break e}Pn(i,s,p,u)}s=s.child}return s;case 26:return Ud(i,s),i===null?(u=h1(s.type,null,s.pendingProps,null))?s.memoizedState=u:wt||(u=s.type,i=s.pendingProps,p=af(ke.current).createElement(u),p[an]=s,p[Tn]=i,Bn(p,u,i),fn(p),s.stateNode=p):s.memoizedState=h1(s.type,i.memoizedProps,s.pendingProps,i.memoizedState),null;case 27:return Te(s),i===null&&wt&&(p=s.stateNode=u1(s.type,s.pendingProps,ke.current),In=s,zr=!0,x=Wt,Ya(s.type)?(fg=x,Wt=Br(p.firstChild)):Wt=x),Pn(i,s,s.pendingProps.children,u),Ud(i,s),i===null&&(s.flags|=4194304),s.child;case 5:return i===null&&wt&&((x=p=Wt)&&(p=xM(p,s.type,s.pendingProps,zr),p!==null?(s.stateNode=p,In=s,Wt=Br(p.firstChild),zr=!1,x=!0):x=!1),x||Ra(s)),Te(s),x=s.type,w=s.pendingProps,A=i!==null?i.memoizedProps:null,p=w.children,og(x,w)?p=null:A!==null&&og(x,A)&&(s.flags|=32),s.memoizedState!==null&&(x=sm(i,s,RT,null,null,u),Vc._currentValue=x),Ud(i,s),Pn(i,s,p,u),s.child;case 6:return i===null&&wt&&((i=u=Wt)&&(u=vM(u,s.pendingProps,zr),u!==null?(s.stateNode=u,In=s,Wt=null,i=!0):i=!1),i||Ra(s)),null;case 13:return J0(i,s,u);case 4:return J(s,s.stateNode.containerInfo),p=s.pendingProps,i===null?s.child=Us(s,null,p,u):Pn(i,s,p,u),s.child;case 11:return H0(i,s,s.type,s.pendingProps,u);case 7:return Pn(i,s,s.pendingProps,u),s.child;case 8:return Pn(i,s,s.pendingProps.children,u),s.child;case 12:return Pn(i,s,s.pendingProps.children,u),s.child;case 10:return p=s.pendingProps,La(s,s.type,p.value),Pn(i,s,p.children,u),s.child;case 9:return x=s.type._context,p=s.pendingProps.children,zs(s),x=zn(x),p=p(x),s.flags|=1,Pn(i,s,p,u),s.child;case 14:return K0(i,s,s.type,s.pendingProps,u);case 15:return G0(i,s,s.type,s.pendingProps,u);case 19:return tw(i,s,u);case 31:return FT(i,s,u);case 22:return V0(i,s,u,s.pendingProps);case 24:return zs(s),p=zn(xn),i===null?(x=Wp(),x===null&&(x=qt,w=Yp(),x.pooledCache=w,w.refCount++,w!==null&&(x.pooledCacheLanes|=u),x=w),s.memoizedState={parent:p,cache:x},Zp(s),La(s,xn,x)):((i.lanes&u)!==0&&(Jp(i,s),jc(s,null,null,u),_c()),x=i.memoizedState,w=s.memoizedState,x.parent!==p?(x={parent:p,cache:p},s.memoizedState=x,s.lanes===0&&(s.memoizedState=s.updateQueue.baseState=x),La(s,xn,p)):(p=w.cache,La(s,xn,p),p!==x.cache&&Vp(s,[xn],u,!0))),Pn(i,s,s.pendingProps.children,u),s.child;case 29:throw s.pendingProps}throw Error(r(156,s.tag))}function Xi(i){i.flags|=4}function Rm(i,s,u,p,x){if((s=(i.mode&32)!==0)&&(s=!1),s){if(i.flags|=16777216,(x&335544128)===x)if(i.stateNode.complete)i.flags|=8192;else if(Aw())i.flags|=8192;else throw $s=_d,Xp}else i.flags&=-16777217}function rw(i,s){if(s.type!=="stylesheet"||(s.state.loading&4)!==0)i.flags&=-16777217;else if(i.flags|=16777216,!b1(s))if(Aw())i.flags|=8192;else throw $s=_d,Xp}function qd(i,s){s!==null&&(i.flags|=4),i.flags&16384&&(s=i.tag!==22?rt():536870912,i.lanes|=s,Xo|=s)}function Oc(i,s){if(!wt)switch(i.tailMode){case"hidden":s=i.tail;for(var u=null;s!==null;)s.alternate!==null&&(u=s),s=s.sibling;u===null?i.tail=null:u.sibling=null;break;case"collapsed":u=i.tail;for(var p=null;u!==null;)u.alternate!==null&&(p=u),u=u.sibling;p===null?s||i.tail===null?i.tail=null:i.tail.sibling=null:p.sibling=null}}function Xt(i){var s=i.alternate!==null&&i.alternate.child===i.child,u=0,p=0;if(s)for(var x=i.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags&65011712,p|=x.flags&65011712,x.return=i,x=x.sibling;else for(x=i.child;x!==null;)u|=x.lanes|x.childLanes,p|=x.subtreeFlags,p|=x.flags,x.return=i,x=x.sibling;return i.subtreeFlags|=p,i.childLanes=u,s}function HT(i,s,u){var p=s.pendingProps;switch(Fp(s),s.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Xt(s),null;case 1:return Xt(s),null;case 3:return u=s.stateNode,p=null,i!==null&&(p=i.memoizedState.cache),s.memoizedState.cache!==p&&(s.flags|=2048),Vi(xn),ue(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(i===null||i.child===null)&&(Po(s)?Xi(s):i===null||i.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Hp())),Xt(s),null;case 26:var x=s.type,w=s.memoizedState;return i===null?(Xi(s),w!==null?(Xt(s),rw(s,w)):(Xt(s),Rm(s,x,null,p,u))):w?w!==i.memoizedState?(Xi(s),Xt(s),rw(s,w)):(Xt(s),s.flags&=-16777217):(i=i.memoizedProps,i!==p&&Xi(s),Xt(s),Rm(s,x,i,p,u)),null;case 27:if(Oe(s),u=ke.current,x=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Xi(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Xt(s),null}i=oe.current,Po(s)?Iv(s):(i=u1(x,p,u),s.stateNode=i,Xi(s))}return Xt(s),null;case 5:if(Oe(s),x=s.type,i!==null&&s.stateNode!=null)i.memoizedProps!==p&&Xi(s);else{if(!p){if(s.stateNode===null)throw Error(r(166));return Xt(s),null}if(w=oe.current,Po(s))Iv(s);else{var A=af(ke.current);switch(w){case 1:w=A.createElementNS("http://www.w3.org/2000/svg",x);break;case 2:w=A.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;default:switch(x){case"svg":w=A.createElementNS("http://www.w3.org/2000/svg",x);break;case"math":w=A.createElementNS("http://www.w3.org/1998/Math/MathML",x);break;case"script":w=A.createElement("div"),w.innerHTML="<script><\/script>",w=w.removeChild(w.firstChild);break;case"select":w=typeof p.is=="string"?A.createElement("select",{is:p.is}):A.createElement("select"),p.multiple?w.multiple=!0:p.size&&(w.size=p.size);break;default:w=typeof p.is=="string"?A.createElement(x,{is:p.is}):A.createElement(x)}}w[an]=s,w[Tn]=p;e:for(A=s.child;A!==null;){if(A.tag===5||A.tag===6)w.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===s)break e;for(;A.sibling===null;){if(A.return===null||A.return===s)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}s.stateNode=w;e:switch(Bn(w,x,p),x){case"button":case"input":case"select":case"textarea":p=!!p.autoFocus;break e;case"img":p=!0;break e;default:p=!1}p&&Xi(s)}}return Xt(s),Rm(s,s.type,i===null?null:i.memoizedProps,s.pendingProps,u),null;case 6:if(i&&s.stateNode!=null)i.memoizedProps!==p&&Xi(s);else{if(typeof p!="string"&&s.stateNode===null)throw Error(r(166));if(i=ke.current,Po(s)){if(i=s.stateNode,u=s.memoizedProps,p=null,x=In,x!==null)switch(x.tag){case 27:case 5:p=x.memoizedProps}i[an]=s,i=!!(i.nodeValue===u||p!==null&&p.suppressHydrationWarning===!0||Jw(i.nodeValue,u)),i||Ra(s,!0)}else i=af(i).createTextNode(p),i[an]=s,s.stateNode=i}return Xt(s),null;case 31:if(u=s.memoizedState,i===null||i.memoizedState!==null){if(p=Po(s),u!==null){if(i===null){if(!p)throw Error(r(318));if(i=s.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(557));i[an]=s}else Ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Xt(s),i=!1}else u=Hp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=u),i=!0;if(!i)return s.flags&256?(xr(s),s):(xr(s),null);if((s.flags&128)!==0)throw Error(r(558))}return Xt(s),null;case 13:if(p=s.memoizedState,i===null||i.memoizedState!==null&&i.memoizedState.dehydrated!==null){if(x=Po(s),p!==null&&p.dehydrated!==null){if(i===null){if(!x)throw Error(r(318));if(x=s.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[an]=s}else Ls(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Xt(s),x=!1}else x=Hp(),i!==null&&i.memoizedState!==null&&(i.memoizedState.hydrationErrors=x),x=!0;if(!x)return s.flags&256?(xr(s),s):(xr(s),null)}return xr(s),(s.flags&128)!==0?(s.lanes=u,s):(u=p!==null,i=i!==null&&i.memoizedState!==null,u&&(p=s.child,x=null,p.alternate!==null&&p.alternate.memoizedState!==null&&p.alternate.memoizedState.cachePool!==null&&(x=p.alternate.memoizedState.cachePool.pool),w=null,p.memoizedState!==null&&p.memoizedState.cachePool!==null&&(w=p.memoizedState.cachePool.pool),w!==x&&(p.flags|=2048)),u!==i&&u&&(s.child.flags|=8192),qd(s,s.updateQueue),Xt(s),null);case 4:return ue(),i===null&&ng(s.stateNode.containerInfo),Xt(s),null;case 10:return Vi(s.type),Xt(s),null;case 19:if(G(gn),p=s.memoizedState,p===null)return Xt(s),null;if(x=(s.flags&128)!==0,w=p.rendering,w===null)if(x)Oc(p,!1);else{if(pn!==0||i!==null&&(i.flags&128)!==0)for(i=s.child;i!==null;){if(w=Td(i),w!==null){for(s.flags|=128,Oc(p,!1),i=w.updateQueue,s.updateQueue=i,qd(s,i),s.subtreeFlags=0,i=u,u=s.child;u!==null;)Mv(u,i),u=u.sibling;return B(gn,gn.current&1|2),wt&&Ki(s,p.treeForkCount),s.child}i=i.sibling}p.tail!==null&&Ne()>Yd&&(s.flags|=128,x=!0,Oc(p,!1),s.lanes=4194304)}else{if(!x)if(i=Td(w),i!==null){if(s.flags|=128,x=!0,i=i.updateQueue,s.updateQueue=i,qd(s,i),Oc(p,!0),p.tail===null&&p.tailMode==="hidden"&&!w.alternate&&!wt)return Xt(s),null}else 2*Ne()-p.renderingStartTime>Yd&&u!==536870912&&(s.flags|=128,x=!0,Oc(p,!1),s.lanes=4194304);p.isBackwards?(w.sibling=s.child,s.child=w):(i=p.last,i!==null?i.sibling=w:s.child=w,p.last=w)}return p.tail!==null?(i=p.tail,p.rendering=i,p.tail=i.sibling,p.renderingStartTime=Ne(),i.sibling=null,u=gn.current,B(gn,x?u&1|2:u&1),wt&&Ki(s,p.treeForkCount),i):(Xt(s),null);case 22:case 23:return xr(s),rm(),p=s.memoizedState!==null,i!==null?i.memoizedState!==null!==p&&(s.flags|=8192):p&&(s.flags|=8192),p?(u&536870912)!==0&&(s.flags&128)===0&&(Xt(s),s.subtreeFlags&6&&(s.flags|=8192)):Xt(s),u=s.updateQueue,u!==null&&qd(s,u.retryQueue),u=null,i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),p=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(p=s.memoizedState.cachePool.pool),p!==u&&(s.flags|=2048),i!==null&&G(Ps),null;case 24:return u=null,i!==null&&(u=i.memoizedState.cache),s.memoizedState.cache!==u&&(s.flags|=2048),Vi(xn),Xt(s),null;case 25:return null;case 30:return null}throw Error(r(156,s.tag))}function KT(i,s){switch(Fp(s),s.tag){case 1:return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 3:return Vi(xn),ue(),i=s.flags,(i&65536)!==0&&(i&128)===0?(s.flags=i&-65537|128,s):null;case 26:case 27:case 5:return Oe(s),null;case 31:if(s.memoizedState!==null){if(xr(s),s.alternate===null)throw Error(r(340));Ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 13:if(xr(s),i=s.memoizedState,i!==null&&i.dehydrated!==null){if(s.alternate===null)throw Error(r(340));Ls()}return i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 19:return G(gn),null;case 4:return ue(),null;case 10:return Vi(s.type),null;case 22:case 23:return xr(s),rm(),i!==null&&G(Ps),i=s.flags,i&65536?(s.flags=i&-65537|128,s):null;case 24:return Vi(xn),null;case 25:return null;default:return null}}function iw(i,s){switch(Fp(s),s.tag){case 3:Vi(xn),ue();break;case 26:case 27:case 5:Oe(s);break;case 4:ue();break;case 31:s.memoizedState!==null&&xr(s);break;case 13:xr(s);break;case 19:G(gn);break;case 10:Vi(s.type);break;case 22:case 23:xr(s),rm(),i!==null&&G(Ps);break;case 24:Vi(xn)}}function Rc(i,s){try{var u=s.updateQueue,p=u!==null?u.lastEffect:null;if(p!==null){var x=p.next;u=x;do{if((u.tag&i)===i){p=void 0;var w=u.create,A=u.inst;p=w(),A.destroy=p}u=u.next}while(u!==x)}}catch(U){It(s,s.return,U)}}function Ua(i,s,u){try{var p=s.updateQueue,x=p!==null?p.lastEffect:null;if(x!==null){var w=x.next;p=w;do{if((p.tag&i)===i){var A=p.inst,U=A.destroy;if(U!==void 0){A.destroy=void 0,x=s;var W=u,se=U;try{se()}catch(me){It(x,W,me)}}}p=p.next}while(p!==w)}}catch(me){It(s,s.return,me)}}function aw(i){var s=i.updateQueue;if(s!==null){var u=i.stateNode;try{Qv(s,u)}catch(p){It(i,i.return,p)}}}function sw(i,s,u){u.props=qs(i.type,i.memoizedProps),u.state=i.memoizedState;try{u.componentWillUnmount()}catch(p){It(i,s,p)}}function Lc(i,s){try{var u=i.ref;if(u!==null){switch(i.tag){case 26:case 27:case 5:var p=i.stateNode;break;case 30:p=i.stateNode;break;default:p=i.stateNode}typeof u=="function"?i.refCleanup=u(p):u.current=p}}catch(x){It(i,s,x)}}function wi(i,s){var u=i.ref,p=i.refCleanup;if(u!==null)if(typeof p=="function")try{p()}catch(x){It(i,s,x)}finally{i.refCleanup=null,i=i.alternate,i!=null&&(i.refCleanup=null)}else if(typeof u=="function")try{u(null)}catch(x){It(i,s,x)}else u.current=null}function ow(i){var s=i.type,u=i.memoizedProps,p=i.stateNode;try{e:switch(s){case"button":case"input":case"select":case"textarea":u.autoFocus&&p.focus();break e;case"img":u.src?p.src=u.src:u.srcSet&&(p.srcset=u.srcSet)}}catch(x){It(i,i.return,x)}}function Lm(i,s,u){try{var p=i.stateNode;hM(p,i.type,u,s),p[Tn]=s}catch(x){It(i,i.return,x)}}function lw(i){return i.tag===5||i.tag===3||i.tag===26||i.tag===27&&Ya(i.type)||i.tag===4}function Im(i){e:for(;;){for(;i.sibling===null;){if(i.return===null||lw(i.return))return null;i=i.return}for(i.sibling.return=i.return,i=i.sibling;i.tag!==5&&i.tag!==6&&i.tag!==18;){if(i.tag===27&&Ya(i.type)||i.flags&2||i.child===null||i.tag===4)continue e;i.child.return=i,i=i.child}if(!(i.flags&2))return i.stateNode}}function zm(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u).insertBefore(i,s):(s=u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,s.appendChild(i),u=u._reactRootContainer,u!=null||s.onclick!==null||(s.onclick=Ae));else if(p!==4&&(p===27&&Ya(i.type)&&(u=i.stateNode,s=null),i=i.child,i!==null))for(zm(i,s,u),i=i.sibling;i!==null;)zm(i,s,u),i=i.sibling}function Hd(i,s,u){var p=i.tag;if(p===5||p===6)i=i.stateNode,s?u.insertBefore(i,s):u.appendChild(i);else if(p!==4&&(p===27&&Ya(i.type)&&(u=i.stateNode),i=i.child,i!==null))for(Hd(i,s,u),i=i.sibling;i!==null;)Hd(i,s,u),i=i.sibling}function cw(i){var s=i.stateNode,u=i.memoizedProps;try{for(var p=i.type,x=s.attributes;x.length;)s.removeAttributeNode(x[0]);Bn(s,p,u),s[an]=i,s[Tn]=u}catch(w){It(i,i.return,w)}}var Zi=!1,kn=!1,Pm=!1,uw=typeof WeakSet=="function"?WeakSet:Set,Dn=null;function GT(i,s){if(i=i.containerInfo,ag=ff,i=kv(i),Mp(i)){if("selectionStart"in i)var u={start:i.selectionStart,end:i.selectionEnd};else e:{u=(u=i.ownerDocument)&&u.defaultView||window;var p=u.getSelection&&u.getSelection();if(p&&p.rangeCount!==0){u=p.anchorNode;var x=p.anchorOffset,w=p.focusNode;p=p.focusOffset;try{u.nodeType,w.nodeType}catch{u=null;break e}var A=0,U=-1,W=-1,se=0,me=0,we=i,le=null;t:for(;;){for(var fe;we!==u||x!==0&&we.nodeType!==3||(U=A+x),we!==w||p!==0&&we.nodeType!==3||(W=A+p),we.nodeType===3&&(A+=we.nodeValue.length),(fe=we.firstChild)!==null;)le=we,we=fe;for(;;){if(we===i)break t;if(le===u&&++se===x&&(U=A),le===w&&++me===p&&(W=A),(fe=we.nextSibling)!==null)break;we=le,le=we.parentNode}we=fe}u=U===-1||W===-1?null:{start:U,end:W}}else u=null}u=u||{start:0,end:0}}else u=null;for(sg={focusedElem:i,selectionRange:u},ff=!1,Dn=s;Dn!==null;)if(s=Dn,i=s.child,(s.subtreeFlags&1028)!==0&&i!==null)i.return=s,Dn=i;else for(;Dn!==null;){switch(s=Dn,w=s.alternate,i=s.flags,s.tag){case 0:if((i&4)!==0&&(i=s.updateQueue,i=i!==null?i.events:null,i!==null))for(u=0;u<i.length;u++)x=i[u],x.ref.impl=x.nextImpl;break;case 11:case 15:break;case 1:if((i&1024)!==0&&w!==null){i=void 0,u=s,x=w.memoizedProps,w=w.memoizedState,p=u.stateNode;try{var $e=qs(u.type,x);i=p.getSnapshotBeforeUpdate($e,w),p.__reactInternalSnapshotBeforeUpdate=i}catch(tt){It(u,u.return,tt)}}break;case 3:if((i&1024)!==0){if(i=s.stateNode.containerInfo,u=i.nodeType,u===9)cg(i);else if(u===1)switch(i.nodeName){case"HEAD":case"HTML":case"BODY":cg(i);break;default:i.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((i&1024)!==0)throw Error(r(163))}if(i=s.sibling,i!==null){i.return=s.return,Dn=i;break}Dn=s.return}}function dw(i,s,u){var p=u.flags;switch(u.tag){case 0:case 11:case 15:ea(i,u),p&4&&Rc(5,u);break;case 1:if(ea(i,u),p&4)if(i=u.stateNode,s===null)try{i.componentDidMount()}catch(A){It(u,u.return,A)}else{var x=qs(u.type,s.memoizedProps);s=s.memoizedState;try{i.componentDidUpdate(x,s,i.__reactInternalSnapshotBeforeUpdate)}catch(A){It(u,u.return,A)}}p&64&&aw(u),p&512&&Lc(u,u.return);break;case 3:if(ea(i,u),p&64&&(i=u.updateQueue,i!==null)){if(s=null,u.child!==null)switch(u.child.tag){case 27:case 5:s=u.child.stateNode;break;case 1:s=u.child.stateNode}try{Qv(i,s)}catch(A){It(u,u.return,A)}}break;case 27:s===null&&p&4&&cw(u);case 26:case 5:ea(i,u),s===null&&p&4&&ow(u),p&512&&Lc(u,u.return);break;case 12:ea(i,u);break;case 31:ea(i,u),p&4&&pw(i,u);break;case 13:ea(i,u),p&4&&mw(i,u),p&64&&(i=u.memoizedState,i!==null&&(i=i.dehydrated,i!==null&&(u=tM.bind(null,u),wM(i,u))));break;case 22:if(p=u.memoizedState!==null||Zi,!p){s=s!==null&&s.memoizedState!==null||kn,x=Zi;var w=kn;Zi=p,(kn=s)&&!w?ta(i,u,(u.subtreeFlags&8772)!==0):ea(i,u),Zi=x,kn=w}break;case 30:break;default:ea(i,u)}}function fw(i){var s=i.alternate;s!==null&&(i.alternate=null,fw(s)),i.child=null,i.deletions=null,i.sibling=null,i.tag===5&&(s=i.stateNode,s!==null&&js(s)),i.stateNode=null,i.return=null,i.dependencies=null,i.memoizedProps=null,i.memoizedState=null,i.pendingProps=null,i.stateNode=null,i.updateQueue=null}var Zt=null,ir=!1;function Ji(i,s,u){for(u=u.child;u!==null;)hw(i,s,u),u=u.sibling}function hw(i,s,u){if(Mt&&typeof Mt.onCommitFiberUnmount=="function")try{Mt.onCommitFiberUnmount(dn,u)}catch{}switch(u.tag){case 26:kn||wi(u,s),Ji(i,s,u),u.memoizedState?u.memoizedState.count--:u.stateNode&&(u=u.stateNode,u.parentNode.removeChild(u));break;case 27:kn||wi(u,s);var p=Zt,x=ir;Ya(u.type)&&(Zt=u.stateNode,ir=!1),Ji(i,s,u),Hc(u.stateNode),Zt=p,ir=x;break;case 5:kn||wi(u,s);case 6:if(p=Zt,x=ir,Zt=null,Ji(i,s,u),Zt=p,ir=x,Zt!==null)if(ir)try{(Zt.nodeType===9?Zt.body:Zt.nodeName==="HTML"?Zt.ownerDocument.body:Zt).removeChild(u.stateNode)}catch(w){It(u,s,w)}else try{Zt.removeChild(u.stateNode)}catch(w){It(u,s,w)}break;case 18:Zt!==null&&(ir?(i=Zt,a1(i.nodeType===9?i.body:i.nodeName==="HTML"?i.ownerDocument.body:i,u.stateNode),al(i)):a1(Zt,u.stateNode));break;case 4:p=Zt,x=ir,Zt=u.stateNode.containerInfo,ir=!0,Ji(i,s,u),Zt=p,ir=x;break;case 0:case 11:case 14:case 15:Ua(2,u,s),kn||Ua(4,u,s),Ji(i,s,u);break;case 1:kn||(wi(u,s),p=u.stateNode,typeof p.componentWillUnmount=="function"&&sw(u,s,p)),Ji(i,s,u);break;case 21:Ji(i,s,u);break;case 22:kn=(p=kn)||u.memoizedState!==null,Ji(i,s,u),kn=p;break;default:Ji(i,s,u)}}function pw(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null))){i=i.dehydrated;try{al(i)}catch(u){It(s,s.return,u)}}}function mw(i,s){if(s.memoizedState===null&&(i=s.alternate,i!==null&&(i=i.memoizedState,i!==null&&(i=i.dehydrated,i!==null))))try{al(i)}catch(u){It(s,s.return,u)}}function VT(i){switch(i.tag){case 31:case 13:case 19:var s=i.stateNode;return s===null&&(s=i.stateNode=new uw),s;case 22:return i=i.stateNode,s=i._retryCache,s===null&&(s=i._retryCache=new uw),s;default:throw Error(r(435,i.tag))}}function Kd(i,s){var u=VT(i);s.forEach(function(p){if(!u.has(p)){u.add(p);var x=nM.bind(null,i,p);p.then(x,x)}})}function ar(i,s){var u=s.deletions;if(u!==null)for(var p=0;p<u.length;p++){var x=u[p],w=i,A=s,U=A;e:for(;U!==null;){switch(U.tag){case 27:if(Ya(U.type)){Zt=U.stateNode,ir=!1;break e}break;case 5:Zt=U.stateNode,ir=!1;break e;case 3:case 4:Zt=U.stateNode.containerInfo,ir=!0;break e}U=U.return}if(Zt===null)throw Error(r(160));hw(w,A,x),Zt=null,ir=!1,w=x.alternate,w!==null&&(w.return=null),x.return=null}if(s.subtreeFlags&13886)for(s=s.child;s!==null;)gw(s,i),s=s.sibling}var ni=null;function gw(i,s){var u=i.alternate,p=i.flags;switch(i.tag){case 0:case 11:case 14:case 15:ar(s,i),sr(i),p&4&&(Ua(3,i,i.return),Rc(3,i),Ua(5,i,i.return));break;case 1:ar(s,i),sr(i),p&512&&(kn||u===null||wi(u,u.return)),p&64&&Zi&&(i=i.updateQueue,i!==null&&(p=i.callbacks,p!==null&&(u=i.shared.hiddenCallbacks,i.shared.hiddenCallbacks=u===null?p:u.concat(p))));break;case 26:var x=ni;if(ar(s,i),sr(i),p&512&&(kn||u===null||wi(u,u.return)),p&4){var w=u!==null?u.memoizedState:null;if(p=i.memoizedState,u===null)if(p===null)if(i.stateNode===null){e:{p=i.type,u=i.memoizedProps,x=x.ownerDocument||x;t:switch(p){case"title":w=x.getElementsByTagName("title")[0],(!w||w[$i]||w[an]||w.namespaceURI==="http://www.w3.org/2000/svg"||w.hasAttribute("itemprop"))&&(w=x.createElement(p),x.head.insertBefore(w,x.querySelector("head > title"))),Bn(w,p,u),w[an]=i,fn(w),p=w;break e;case"link":var A=g1("link","href",x).get(p+(u.href||""));if(A){for(var U=0;U<A.length;U++)if(w=A[U],w.getAttribute("href")===(u.href==null||u.href===""?null:u.href)&&w.getAttribute("rel")===(u.rel==null?null:u.rel)&&w.getAttribute("title")===(u.title==null?null:u.title)&&w.getAttribute("crossorigin")===(u.crossOrigin==null?null:u.crossOrigin)){A.splice(U,1);break t}}w=x.createElement(p),Bn(w,p,u),x.head.appendChild(w);break;case"meta":if(A=g1("meta","content",x).get(p+(u.content||""))){for(U=0;U<A.length;U++)if(w=A[U],w.getAttribute("content")===(u.content==null?null:""+u.content)&&w.getAttribute("name")===(u.name==null?null:u.name)&&w.getAttribute("property")===(u.property==null?null:u.property)&&w.getAttribute("http-equiv")===(u.httpEquiv==null?null:u.httpEquiv)&&w.getAttribute("charset")===(u.charSet==null?null:u.charSet)){A.splice(U,1);break t}}w=x.createElement(p),Bn(w,p,u),x.head.appendChild(w);break;default:throw Error(r(468,p))}w[an]=i,fn(w),p=w}i.stateNode=p}else y1(x,i.type,i.stateNode);else i.stateNode=m1(x,p,i.memoizedProps);else w!==p?(w===null?u.stateNode!==null&&(u=u.stateNode,u.parentNode.removeChild(u)):w.count--,p===null?y1(x,i.type,i.stateNode):m1(x,p,i.memoizedProps)):p===null&&i.stateNode!==null&&Lm(i,i.memoizedProps,u.memoizedProps)}break;case 27:ar(s,i),sr(i),p&512&&(kn||u===null||wi(u,u.return)),u!==null&&p&4&&Lm(i,i.memoizedProps,u.memoizedProps);break;case 5:if(ar(s,i),sr(i),p&512&&(kn||u===null||wi(u,u.return)),i.flags&32){x=i.stateNode;try{nt(x,"")}catch($e){It(i,i.return,$e)}}p&4&&i.stateNode!=null&&(x=i.memoizedProps,Lm(i,x,u!==null?u.memoizedProps:x)),p&1024&&(Pm=!0);break;case 6:if(ar(s,i),sr(i),p&4){if(i.stateNode===null)throw Error(r(162));p=i.memoizedProps,u=i.stateNode;try{u.nodeValue=p}catch($e){It(i,i.return,$e)}}break;case 3:if(lf=null,x=ni,ni=sf(s.containerInfo),ar(s,i),ni=x,sr(i),p&4&&u!==null&&u.memoizedState.isDehydrated)try{al(s.containerInfo)}catch($e){It(i,i.return,$e)}Pm&&(Pm=!1,yw(i));break;case 4:p=ni,ni=sf(i.stateNode.containerInfo),ar(s,i),sr(i),ni=p;break;case 12:ar(s,i),sr(i);break;case 31:ar(s,i),sr(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Kd(i,p)));break;case 13:ar(s,i),sr(i),i.child.flags&8192&&i.memoizedState!==null!=(u!==null&&u.memoizedState!==null)&&(Vd=Ne()),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Kd(i,p)));break;case 22:x=i.memoizedState!==null;var W=u!==null&&u.memoizedState!==null,se=Zi,me=kn;if(Zi=se||x,kn=me||W,ar(s,i),kn=me,Zi=se,sr(i),p&8192)e:for(s=i.stateNode,s._visibility=x?s._visibility&-2:s._visibility|1,x&&(u===null||W||Zi||kn||Hs(i)),u=null,s=i;;){if(s.tag===5||s.tag===26){if(u===null){W=u=s;try{if(w=W.stateNode,x)A=w.style,typeof A.setProperty=="function"?A.setProperty("display","none","important"):A.display="none";else{U=W.stateNode;var we=W.memoizedProps.style,le=we!=null&&we.hasOwnProperty("display")?we.display:null;U.style.display=le==null||typeof le=="boolean"?"":(""+le).trim()}}catch($e){It(W,W.return,$e)}}}else if(s.tag===6){if(u===null){W=s;try{W.stateNode.nodeValue=x?"":W.memoizedProps}catch($e){It(W,W.return,$e)}}}else if(s.tag===18){if(u===null){W=s;try{var fe=W.stateNode;x?s1(fe,!0):s1(W.stateNode,!1)}catch($e){It(W,W.return,$e)}}}else if((s.tag!==22&&s.tag!==23||s.memoizedState===null||s===i)&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===i)break e;for(;s.sibling===null;){if(s.return===null||s.return===i)break e;u===s&&(u=null),s=s.return}u===s&&(u=null),s.sibling.return=s.return,s=s.sibling}p&4&&(p=i.updateQueue,p!==null&&(u=p.retryQueue,u!==null&&(p.retryQueue=null,Kd(i,u))));break;case 19:ar(s,i),sr(i),p&4&&(p=i.updateQueue,p!==null&&(i.updateQueue=null,Kd(i,p)));break;case 30:break;case 21:break;default:ar(s,i),sr(i)}}function sr(i){var s=i.flags;if(s&2){try{for(var u,p=i.return;p!==null;){if(lw(p)){u=p;break}p=p.return}if(u==null)throw Error(r(160));switch(u.tag){case 27:var x=u.stateNode,w=Im(i);Hd(i,w,x);break;case 5:var A=u.stateNode;u.flags&32&&(nt(A,""),u.flags&=-33);var U=Im(i);Hd(i,U,A);break;case 3:case 4:var W=u.stateNode.containerInfo,se=Im(i);zm(i,se,W);break;default:throw Error(r(161))}}catch(me){It(i,i.return,me)}i.flags&=-3}s&4096&&(i.flags&=-4097)}function yw(i){if(i.subtreeFlags&1024)for(i=i.child;i!==null;){var s=i;yw(s),s.tag===5&&s.flags&1024&&s.stateNode.reset(),i=i.sibling}}function ea(i,s){if(s.subtreeFlags&8772)for(s=s.child;s!==null;)dw(i,s.alternate,s),s=s.sibling}function Hs(i){for(i=i.child;i!==null;){var s=i;switch(s.tag){case 0:case 11:case 14:case 15:Ua(4,s,s.return),Hs(s);break;case 1:wi(s,s.return);var u=s.stateNode;typeof u.componentWillUnmount=="function"&&sw(s,s.return,u),Hs(s);break;case 27:Hc(s.stateNode);case 26:case 5:wi(s,s.return),Hs(s);break;case 22:s.memoizedState===null&&Hs(s);break;case 30:Hs(s);break;default:Hs(s)}i=i.sibling}}function ta(i,s,u){for(u=u&&(s.subtreeFlags&8772)!==0,s=s.child;s!==null;){var p=s.alternate,x=i,w=s,A=w.flags;switch(w.tag){case 0:case 11:case 15:ta(x,w,u),Rc(4,w);break;case 1:if(ta(x,w,u),p=w,x=p.stateNode,typeof x.componentDidMount=="function")try{x.componentDidMount()}catch(se){It(p,p.return,se)}if(p=w,x=p.updateQueue,x!==null){var U=p.stateNode;try{var W=x.shared.hiddenCallbacks;if(W!==null)for(x.shared.hiddenCallbacks=null,x=0;x<W.length;x++)Yv(W[x],U)}catch(se){It(p,p.return,se)}}u&&A&64&&aw(w),Lc(w,w.return);break;case 27:cw(w);case 26:case 5:ta(x,w,u),u&&p===null&&A&4&&ow(w),Lc(w,w.return);break;case 12:ta(x,w,u);break;case 31:ta(x,w,u),u&&A&4&&pw(x,w);break;case 13:ta(x,w,u),u&&A&4&&mw(x,w);break;case 22:w.memoizedState===null&&ta(x,w,u),Lc(w,w.return);break;case 30:break;default:ta(x,w,u)}s=s.sibling}}function Bm(i,s){var u=null;i!==null&&i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(u=i.memoizedState.cachePool.pool),i=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(i=s.memoizedState.cachePool.pool),i!==u&&(i!=null&&i.refCount++,u!=null&&wc(u))}function $m(i,s){i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&wc(i))}function ri(i,s,u,p){if(s.subtreeFlags&10256)for(s=s.child;s!==null;)bw(i,s,u,p),s=s.sibling}function bw(i,s,u,p){var x=s.flags;switch(s.tag){case 0:case 11:case 15:ri(i,s,u,p),x&2048&&Rc(9,s);break;case 1:ri(i,s,u,p);break;case 3:ri(i,s,u,p),x&2048&&(i=null,s.alternate!==null&&(i=s.alternate.memoizedState.cache),s=s.memoizedState.cache,s!==i&&(s.refCount++,i!=null&&wc(i)));break;case 12:if(x&2048){ri(i,s,u,p),i=s.stateNode;try{var w=s.memoizedProps,A=w.id,U=w.onPostCommit;typeof U=="function"&&U(A,s.alternate===null?"mount":"update",i.passiveEffectDuration,-0)}catch(W){It(s,s.return,W)}}else ri(i,s,u,p);break;case 31:ri(i,s,u,p);break;case 13:ri(i,s,u,p);break;case 23:break;case 22:w=s.stateNode,A=s.alternate,s.memoizedState!==null?w._visibility&2?ri(i,s,u,p):Ic(i,s):w._visibility&2?ri(i,s,u,p):(w._visibility|=2,Yo(i,s,u,p,(s.subtreeFlags&10256)!==0||!1)),x&2048&&Bm(A,s);break;case 24:ri(i,s,u,p),x&2048&&$m(s.alternate,s);break;default:ri(i,s,u,p)}}function Yo(i,s,u,p,x){for(x=x&&((s.subtreeFlags&10256)!==0||!1),s=s.child;s!==null;){var w=i,A=s,U=u,W=p,se=A.flags;switch(A.tag){case 0:case 11:case 15:Yo(w,A,U,W,x),Rc(8,A);break;case 23:break;case 22:var me=A.stateNode;A.memoizedState!==null?me._visibility&2?Yo(w,A,U,W,x):Ic(w,A):(me._visibility|=2,Yo(w,A,U,W,x)),x&&se&2048&&Bm(A.alternate,A);break;case 24:Yo(w,A,U,W,x),x&&se&2048&&$m(A.alternate,A);break;default:Yo(w,A,U,W,x)}s=s.sibling}}function Ic(i,s){if(s.subtreeFlags&10256)for(s=s.child;s!==null;){var u=i,p=s,x=p.flags;switch(p.tag){case 22:Ic(u,p),x&2048&&Bm(p.alternate,p);break;case 24:Ic(u,p),x&2048&&$m(p.alternate,p);break;default:Ic(u,p)}s=s.sibling}}var zc=8192;function Qo(i,s,u){if(i.subtreeFlags&zc)for(i=i.child;i!==null;)xw(i,s,u),i=i.sibling}function xw(i,s,u){switch(i.tag){case 26:Qo(i,s,u),i.flags&zc&&i.memoizedState!==null&&OM(u,ni,i.memoizedState,i.memoizedProps);break;case 5:Qo(i,s,u);break;case 3:case 4:var p=ni;ni=sf(i.stateNode.containerInfo),Qo(i,s,u),ni=p;break;case 22:i.memoizedState===null&&(p=i.alternate,p!==null&&p.memoizedState!==null?(p=zc,zc=16777216,Qo(i,s,u),zc=p):Qo(i,s,u));break;default:Qo(i,s,u)}}function vw(i){var s=i.alternate;if(s!==null&&(i=s.child,i!==null)){s.child=null;do s=i.sibling,i.sibling=null,i=s;while(i!==null)}}function Pc(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];Dn=p,kw(p,i)}vw(i)}if(i.subtreeFlags&10256)for(i=i.child;i!==null;)ww(i),i=i.sibling}function ww(i){switch(i.tag){case 0:case 11:case 15:Pc(i),i.flags&2048&&Ua(9,i,i.return);break;case 3:Pc(i);break;case 12:Pc(i);break;case 22:var s=i.stateNode;i.memoizedState!==null&&s._visibility&2&&(i.return===null||i.return.tag!==13)?(s._visibility&=-3,Gd(i)):Pc(i);break;default:Pc(i)}}function Gd(i){var s=i.deletions;if((i.flags&16)!==0){if(s!==null)for(var u=0;u<s.length;u++){var p=s[u];Dn=p,kw(p,i)}vw(i)}for(i=i.child;i!==null;){switch(s=i,s.tag){case 0:case 11:case 15:Ua(8,s,s.return),Gd(s);break;case 22:u=s.stateNode,u._visibility&2&&(u._visibility&=-3,Gd(s));break;default:Gd(s)}i=i.sibling}}function kw(i,s){for(;Dn!==null;){var u=Dn;switch(u.tag){case 0:case 11:case 15:Ua(8,u,s);break;case 23:case 22:if(u.memoizedState!==null&&u.memoizedState.cachePool!==null){var p=u.memoizedState.cachePool.pool;p!=null&&p.refCount++}break;case 24:wc(u.memoizedState.cache)}if(p=u.child,p!==null)p.return=u,Dn=p;else e:for(u=i;Dn!==null;){p=Dn;var x=p.sibling,w=p.return;if(fw(p),p===u){Dn=null;break e}if(x!==null){x.return=w,Dn=x;break e}Dn=w}}}var YT={getCacheForType:function(i){var s=zn(xn),u=s.data.get(i);return u===void 0&&(u=i(),s.data.set(i,u)),u},cacheSignal:function(){return zn(xn).controller.signal}},QT=typeof WeakMap=="function"?WeakMap:Map,Tt=0,qt=null,pt=null,xt=0,Lt=0,vr=null,Fa=!1,Wo=!1,Um=!1,na=0,pn=0,qa=0,Ks=0,Fm=0,wr=0,Xo=0,Bc=null,or=null,qm=!1,Vd=0,Ew=0,Yd=1/0,Qd=null,Ha=null,jn=0,Ka=null,Zo=null,ra=0,Hm=0,Km=null,Sw=null,$c=0,Gm=null;function kr(){return(Tt&2)!==0&&xt!==0?xt&-xt:O.T!==null?Zm():ka()}function Nw(){if(wr===0)if((xt&536870912)===0||wt){var i=wa;wa<<=1,(wa&3932160)===0&&(wa=262144),wr=i}else wr=536870912;return i=br.current,i!==null&&(i.flags|=32),wr}function lr(i,s,u){(i===qt&&(Lt===2||Lt===9)||i.cancelPendingCommit!==null)&&(Jo(i,0),Ga(i,xt,wr,!1)),Ot(i,u),((Tt&2)===0||i!==qt)&&(i===qt&&((Tt&2)===0&&(Ks|=u),pn===4&&Ga(i,xt,wr,!1)),ki(i))}function _w(i,s,u){if((Tt&6)!==0)throw Error(r(327));var p=!u&&(s&127)===0&&(s&i.expiredLanes)===0||ge(i,s),x=p?ZT(i,s):Ym(i,s,!0),w=p;do{if(x===0){Wo&&!p&&Ga(i,s,0,!1);break}else{if(u=i.current.alternate,w&&!WT(u)){x=Ym(i,s,!1),w=!1;continue}if(x===2){if(w=s,i.errorRecoveryDisabledLanes&w)var A=0;else A=i.pendingLanes&-536870913,A=A!==0?A:A&536870912?536870912:0;if(A!==0){s=A;e:{var U=i;x=Bc;var W=U.current.memoizedState.isDehydrated;if(W&&(Jo(U,A).flags|=256),A=Ym(U,A,!1),A!==2){if(Um&&!W){U.errorRecoveryDisabledLanes|=w,Ks|=w,x=4;break e}w=or,or=x,w!==null&&(or===null?or=w:or.push.apply(or,w))}x=A}if(w=!1,x!==2)continue}}if(x===1){Jo(i,0),Ga(i,s,0,!0);break}e:{switch(p=i,w=x,w){case 0:case 1:throw Error(r(345));case 4:if((s&4194048)!==s)break;case 6:Ga(p,s,wr,!Fa);break e;case 2:or=null;break;case 3:case 5:break;default:throw Error(r(329))}if((s&62914560)===s&&(x=Vd+300-Ne(),10<x)){if(Ga(p,s,wr,!Fa),Z(p,0,!0)!==0)break e;ra=s,p.timeoutHandle=r1(jw.bind(null,p,u,or,Qd,qm,s,wr,Ks,Xo,Fa,w,"Throttled",-0,0),x);break e}jw(p,u,or,Qd,qm,s,wr,Ks,Xo,Fa,w,null,-0,0)}}break}while(!0);ki(i)}function jw(i,s,u,p,x,w,A,U,W,se,me,we,le,fe){if(i.timeoutHandle=-1,we=s.subtreeFlags,we&8192||(we&16785408)===16785408){we={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ae},xw(s,w,we);var $e=(w&62914560)===w?Vd-Ne():(w&4194048)===w?Ew-Ne():0;if($e=RM(we,$e),$e!==null){ra=w,i.cancelPendingCommit=$e(Lw.bind(null,i,s,w,u,p,x,A,U,W,me,we,null,le,fe)),Ga(i,w,A,!se);return}}Lw(i,s,w,u,p,x,A,U,W)}function WT(i){for(var s=i;;){var u=s.tag;if((u===0||u===11||u===15)&&s.flags&16384&&(u=s.updateQueue,u!==null&&(u=u.stores,u!==null)))for(var p=0;p<u.length;p++){var x=u[p],w=x.getSnapshot;x=x.value;try{if(!gr(w(),x))return!1}catch{return!1}}if(u=s.child,s.subtreeFlags&16384&&u!==null)u.return=s,s=u;else{if(s===i)break;for(;s.sibling===null;){if(s.return===null||s.return===i)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function Ga(i,s,u,p){s&=~Fm,s&=~Ks,i.suspendedLanes|=s,i.pingedLanes&=~s,p&&(i.warmLanes|=s),p=i.expirationTimes;for(var x=s;0<x;){var w=31-yt(x),A=1<<w;p[w]=-1,x&=~A}u!==0&&Pe(i,u,s)}function Wd(){return(Tt&6)===0?(Uc(0),!1):!0}function Vm(){if(pt!==null){if(Lt===0)var i=pt.return;else i=pt,Gi=Is=null,cm(i),qo=null,Ec=0,i=pt;for(;i!==null;)iw(i.alternate,i),i=i.return;pt=null}}function Jo(i,s){var u=i.timeoutHandle;u!==-1&&(i.timeoutHandle=-1,gM(u)),u=i.cancelPendingCommit,u!==null&&(i.cancelPendingCommit=null,u()),ra=0,Vm(),qt=i,pt=u=Hi(i.current,null),xt=s,Lt=0,vr=null,Fa=!1,Wo=ge(i,s),Um=!1,Xo=wr=Fm=Ks=qa=pn=0,or=Bc=null,qm=!1,(s&8)!==0&&(s|=s&32);var p=i.entangledLanes;if(p!==0)for(i=i.entanglements,p&=s;0<p;){var x=31-yt(p),w=1<<x;s|=i[x],p&=~w}return na=s,yd(),u}function Cw(i,s){lt=null,O.H=Mc,s===Fo||s===Nd?(s=Hv(),Lt=3):s===Xp?(s=Hv(),Lt=4):Lt=s===Nm?8:s!==null&&typeof s=="object"&&typeof s.then=="function"?6:1,vr=s,pt===null&&(pn=1,Bd(i,Rr(s,i.current)))}function Aw(){var i=br.current;return i===null?!0:(xt&4194048)===xt?Pr===null:(xt&62914560)===xt||(xt&536870912)!==0?i===Pr:!1}function Tw(){var i=O.H;return O.H=Mc,i===null?Mc:i}function Mw(){var i=O.A;return O.A=YT,i}function Xd(){pn=4,Fa||(xt&4194048)!==xt&&br.current!==null||(Wo=!0),(qa&134217727)===0&&(Ks&134217727)===0||qt===null||Ga(qt,xt,wr,!1)}function Ym(i,s,u){var p=Tt;Tt|=2;var x=Tw(),w=Mw();(qt!==i||xt!==s)&&(Qd=null,Jo(i,s)),s=!1;var A=pn;e:do try{if(Lt!==0&&pt!==null){var U=pt,W=vr;switch(Lt){case 8:Vm(),A=6;break e;case 3:case 2:case 9:case 6:br.current===null&&(s=!0);var se=Lt;if(Lt=0,vr=null,el(i,U,W,se),u&&Wo){A=0;break e}break;default:se=Lt,Lt=0,vr=null,el(i,U,W,se)}}XT(),A=pn;break}catch(me){Cw(i,me)}while(!0);return s&&i.shellSuspendCounter++,Gi=Is=null,Tt=p,O.H=x,O.A=w,pt===null&&(qt=null,xt=0,yd()),A}function XT(){for(;pt!==null;)Dw(pt)}function ZT(i,s){var u=Tt;Tt|=2;var p=Tw(),x=Mw();qt!==i||xt!==s?(Qd=null,Yd=Ne()+500,Jo(i,s)):Wo=ge(i,s);e:do try{if(Lt!==0&&pt!==null){s=pt;var w=vr;t:switch(Lt){case 1:Lt=0,vr=null,el(i,s,w,1);break;case 2:case 9:if(Fv(w)){Lt=0,vr=null,Ow(s);break}s=function(){Lt!==2&&Lt!==9||qt!==i||(Lt=7),ki(i)},w.then(s,s);break e;case 3:Lt=7;break e;case 4:Lt=5;break e;case 7:Fv(w)?(Lt=0,vr=null,Ow(s)):(Lt=0,vr=null,el(i,s,w,7));break;case 5:var A=null;switch(pt.tag){case 26:A=pt.memoizedState;case 5:case 27:var U=pt;if(A?b1(A):U.stateNode.complete){Lt=0,vr=null;var W=U.sibling;if(W!==null)pt=W;else{var se=U.return;se!==null?(pt=se,Zd(se)):pt=null}break t}}Lt=0,vr=null,el(i,s,w,5);break;case 6:Lt=0,vr=null,el(i,s,w,6);break;case 8:Vm(),pn=6;break e;default:throw Error(r(462))}}JT();break}catch(me){Cw(i,me)}while(!0);return Gi=Is=null,O.H=p,O.A=x,Tt=u,pt!==null?0:(qt=null,xt=0,yd(),pn)}function JT(){for(;pt!==null&&!he();)Dw(pt)}function Dw(i){var s=nw(i.alternate,i,na);i.memoizedProps=i.pendingProps,s===null?Zd(i):pt=s}function Ow(i){var s=i,u=s.alternate;switch(s.tag){case 15:case 0:s=W0(u,s,s.pendingProps,s.type,void 0,xt);break;case 11:s=W0(u,s,s.pendingProps,s.type.render,s.ref,xt);break;case 5:cm(s);default:iw(u,s),s=pt=Mv(s,na),s=nw(u,s,na)}i.memoizedProps=i.pendingProps,s===null?Zd(i):pt=s}function el(i,s,u,p){Gi=Is=null,cm(s),qo=null,Ec=0;var x=s.return;try{if(UT(i,x,s,u,xt)){pn=1,Bd(i,Rr(u,i.current)),pt=null;return}}catch(w){if(x!==null)throw pt=x,w;pn=1,Bd(i,Rr(u,i.current)),pt=null;return}s.flags&32768?(wt||p===1?i=!0:Wo||(xt&536870912)!==0?i=!1:(Fa=i=!0,(p===2||p===9||p===3||p===6)&&(p=br.current,p!==null&&p.tag===13&&(p.flags|=16384))),Rw(s,i)):Zd(s)}function Zd(i){var s=i;do{if((s.flags&32768)!==0){Rw(s,Fa);return}i=s.return;var u=HT(s.alternate,s,na);if(u!==null){pt=u;return}if(s=s.sibling,s!==null){pt=s;return}pt=s=i}while(s!==null);pn===0&&(pn=5)}function Rw(i,s){do{var u=KT(i.alternate,i);if(u!==null){u.flags&=32767,pt=u;return}if(u=i.return,u!==null&&(u.flags|=32768,u.subtreeFlags=0,u.deletions=null),!s&&(i=i.sibling,i!==null)){pt=i;return}pt=i=u}while(i!==null);pn=6,pt=null}function Lw(i,s,u,p,x,w,A,U,W){i.cancelPendingCommit=null;do Jd();while(jn!==0);if((Tt&6)!==0)throw Error(r(327));if(s!==null){if(s===i.current)throw Error(r(177));if(w=s.lanes|s.childLanes,w|=Ip,Ue(i,u,w,A,U,W),i===qt&&(pt=qt=null,xt=0),Zo=s,Ka=i,ra=u,Hm=w,Km=x,Sw=p,(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?(i.callbackNode=null,i.callbackPriority=0,rM(Le,function(){return $w(),null})):(i.callbackNode=null,i.callbackPriority=0),p=(s.flags&13878)!==0,(s.subtreeFlags&13878)!==0||p){p=O.T,O.T=null,x=V.p,V.p=2,A=Tt,Tt|=4;try{GT(i,s,u)}finally{Tt=A,V.p=x,O.T=p}}jn=1,Iw(),zw(),Pw()}}function Iw(){if(jn===1){jn=0;var i=Ka,s=Zo,u=(s.flags&13878)!==0;if((s.subtreeFlags&13878)!==0||u){u=O.T,O.T=null;var p=V.p;V.p=2;var x=Tt;Tt|=4;try{gw(s,i);var w=sg,A=kv(i.containerInfo),U=w.focusedElem,W=w.selectionRange;if(A!==U&&U&&U.ownerDocument&&wv(U.ownerDocument.documentElement,U)){if(W!==null&&Mp(U)){var se=W.start,me=W.end;if(me===void 0&&(me=se),"selectionStart"in U)U.selectionStart=se,U.selectionEnd=Math.min(me,U.value.length);else{var we=U.ownerDocument||document,le=we&&we.defaultView||window;if(le.getSelection){var fe=le.getSelection(),$e=U.textContent.length,tt=Math.min(W.start,$e),$t=W.end===void 0?tt:Math.min(W.end,$e);!fe.extend&&tt>$t&&(A=$t,$t=tt,tt=A);var re=vv(U,tt),ee=vv(U,$t);if(re&&ee&&(fe.rangeCount!==1||fe.anchorNode!==re.node||fe.anchorOffset!==re.offset||fe.focusNode!==ee.node||fe.focusOffset!==ee.offset)){var ie=we.createRange();ie.setStart(re.node,re.offset),fe.removeAllRanges(),tt>$t?(fe.addRange(ie),fe.extend(ee.node,ee.offset)):(ie.setEnd(ee.node,ee.offset),fe.addRange(ie))}}}}for(we=[],fe=U;fe=fe.parentNode;)fe.nodeType===1&&we.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof U.focus=="function"&&U.focus(),U=0;U<we.length;U++){var xe=we[U];xe.element.scrollLeft=xe.left,xe.element.scrollTop=xe.top}}ff=!!ag,sg=ag=null}finally{Tt=x,V.p=p,O.T=u}}i.current=s,jn=2}}function zw(){if(jn===2){jn=0;var i=Ka,s=Zo,u=(s.flags&8772)!==0;if((s.subtreeFlags&8772)!==0||u){u=O.T,O.T=null;var p=V.p;V.p=2;var x=Tt;Tt|=4;try{dw(i,s.alternate,s)}finally{Tt=x,V.p=p,O.T=u}}jn=3}}function Pw(){if(jn===4||jn===3){jn=0,Ee();var i=Ka,s=Zo,u=ra,p=Sw;(s.subtreeFlags&10256)!==0||(s.flags&10256)!==0?jn=5:(jn=0,Zo=Ka=null,Bw(i,i.pendingLanes));var x=i.pendingLanes;if(x===0&&(Ha=null),Qr(u),s=s.stateNode,Mt&&typeof Mt.onCommitFiberRoot=="function")try{Mt.onCommitFiberRoot(dn,s,void 0,(s.current.flags&128)===128)}catch{}if(p!==null){s=O.T,x=V.p,V.p=2,O.T=null;try{for(var w=i.onRecoverableError,A=0;A<p.length;A++){var U=p[A];w(U.value,{componentStack:U.stack})}}finally{O.T=s,V.p=x}}(ra&3)!==0&&Jd(),ki(i),x=i.pendingLanes,(u&261930)!==0&&(x&42)!==0?i===Gm?$c++:($c=0,Gm=i):$c=0,Uc(0)}}function Bw(i,s){(i.pooledCacheLanes&=s)===0&&(s=i.pooledCache,s!=null&&(i.pooledCache=null,wc(s)))}function Jd(){return Iw(),zw(),Pw(),$w()}function $w(){if(jn!==5)return!1;var i=Ka,s=Hm;Hm=0;var u=Qr(ra),p=O.T,x=V.p;try{V.p=32>u?32:u,O.T=null,u=Km,Km=null;var w=Ka,A=ra;if(jn=0,Zo=Ka=null,ra=0,(Tt&6)!==0)throw Error(r(331));var U=Tt;if(Tt|=4,ww(w.current),bw(w,w.current,A,u),Tt=U,Uc(0,!1),Mt&&typeof Mt.onPostCommitFiberRoot=="function")try{Mt.onPostCommitFiberRoot(dn,w)}catch{}return!0}finally{V.p=x,O.T=p,Bw(i,s)}}function Uw(i,s,u){s=Rr(u,s),s=Sm(i.stateNode,s,2),i=Pa(i,s,2),i!==null&&(Ot(i,2),ki(i))}function It(i,s,u){if(i.tag===3)Uw(i,i,u);else for(;s!==null;){if(s.tag===3){Uw(s,i,u);break}else if(s.tag===1){var p=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof p.componentDidCatch=="function"&&(Ha===null||!Ha.has(p))){i=Rr(u,i),u=F0(2),p=Pa(s,u,2),p!==null&&(q0(u,p,s,i),Ot(p,2),ki(p));break}}s=s.return}}function Qm(i,s,u){var p=i.pingCache;if(p===null){p=i.pingCache=new QT;var x=new Set;p.set(s,x)}else x=p.get(s),x===void 0&&(x=new Set,p.set(s,x));x.has(u)||(Um=!0,x.add(u),i=eM.bind(null,i,s,u),s.then(i,i))}function eM(i,s,u){var p=i.pingCache;p!==null&&p.delete(s),i.pingedLanes|=i.suspendedLanes&u,i.warmLanes&=~u,qt===i&&(xt&u)===u&&(pn===4||pn===3&&(xt&62914560)===xt&&300>Ne()-Vd?(Tt&2)===0&&Jo(i,0):Fm|=u,Xo===xt&&(Xo=0)),ki(i)}function Fw(i,s){s===0&&(s=rt()),i=Os(i,s),i!==null&&(Ot(i,s),ki(i))}function tM(i){var s=i.memoizedState,u=0;s!==null&&(u=s.retryLane),Fw(i,u)}function nM(i,s){var u=0;switch(i.tag){case 31:case 13:var p=i.stateNode,x=i.memoizedState;x!==null&&(u=x.retryLane);break;case 19:p=i.stateNode;break;case 22:p=i.stateNode._retryCache;break;default:throw Error(r(314))}p!==null&&p.delete(s),Fw(i,u)}function rM(i,s){return be(i,s)}var ef=null,tl=null,Wm=!1,tf=!1,Xm=!1,Va=0;function ki(i){i!==tl&&i.next===null&&(tl===null?ef=tl=i:tl=tl.next=i),tf=!0,Wm||(Wm=!0,aM())}function Uc(i,s){if(!Xm&&tf){Xm=!0;do for(var u=!1,p=ef;p!==null;){if(i!==0){var x=p.pendingLanes;if(x===0)var w=0;else{var A=p.suspendedLanes,U=p.pingedLanes;w=(1<<31-yt(42|i)+1)-1,w&=x&~(A&~U),w=w&201326741?w&201326741|1:w?w|2:0}w!==0&&(u=!0,Gw(p,w))}else w=xt,w=Z(p,p===qt?w:0,p.cancelPendingCommit!==null||p.timeoutHandle!==-1),(w&3)===0||ge(p,w)||(u=!0,Gw(p,w));p=p.next}while(u);Xm=!1}}function iM(){qw()}function qw(){tf=Wm=!1;var i=0;Va!==0&&mM()&&(i=Va);for(var s=Ne(),u=null,p=ef;p!==null;){var x=p.next,w=Hw(p,s);w===0?(p.next=null,u===null?ef=x:u.next=x,x===null&&(tl=u)):(u=p,(i!==0||(w&3)!==0)&&(tf=!0)),p=x}jn!==0&&jn!==5||Uc(i),Va!==0&&(Va=0)}function Hw(i,s){for(var u=i.suspendedLanes,p=i.pingedLanes,x=i.expirationTimes,w=i.pendingLanes&-62914561;0<w;){var A=31-yt(w),U=1<<A,W=x[A];W===-1?((U&u)===0||(U&p)!==0)&&(x[A]=Me(U,s)):W<=s&&(i.expiredLanes|=U),w&=~U}if(s=qt,u=xt,u=Z(i,i===s?u:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p=i.callbackNode,u===0||i===s&&(Lt===2||Lt===9)||i.cancelPendingCommit!==null)return p!==null&&p!==null&&ye(p),i.callbackNode=null,i.callbackPriority=0;if((u&3)===0||ge(i,u)){if(s=u&-u,s===i.callbackPriority)return s;switch(p!==null&&ye(p),Qr(u)){case 2:case 8:u=de;break;case 32:u=Le;break;case 268435456:u=it;break;default:u=Le}return p=Kw.bind(null,i),u=be(u,p),i.callbackPriority=s,i.callbackNode=u,s}return p!==null&&p!==null&&ye(p),i.callbackPriority=2,i.callbackNode=null,2}function Kw(i,s){if(jn!==0&&jn!==5)return i.callbackNode=null,i.callbackPriority=0,null;var u=i.callbackNode;if(Jd()&&i.callbackNode!==u)return null;var p=xt;return p=Z(i,i===qt?p:0,i.cancelPendingCommit!==null||i.timeoutHandle!==-1),p===0?null:(_w(i,p,s),Hw(i,Ne()),i.callbackNode!=null&&i.callbackNode===u?Kw.bind(null,i):null)}function Gw(i,s){if(Jd())return null;_w(i,s,!0)}function aM(){yM(function(){(Tt&6)!==0?be(ne,iM):qw()})}function Zm(){if(Va===0){var i=$o;i===0&&(i=Pi,Pi<<=1,(Pi&261888)===0&&(Pi=256)),Va=i}return Va}function Vw(i){return i==null||typeof i=="symbol"||typeof i=="boolean"?null:typeof i=="function"?i:Ta(""+i)}function Yw(i,s){var u=s.ownerDocument.createElement("input");return u.name=s.name,u.value=s.value,i.id&&u.setAttribute("form",i.id),s.parentNode.insertBefore(u,s),i=new FormData(i),u.parentNode.removeChild(u),i}function sM(i,s,u,p,x){if(s==="submit"&&u&&u.stateNode===x){var w=Vw((x[Tn]||null).action),A=p.submitter;A&&(s=(s=A[Tn]||null)?Vw(s.formAction):A.getAttribute("formAction"),s!==null&&(w=s,A=null));var U=new hd("action","action",null,p,x);i.push({event:U,listeners:[{instance:null,listener:function(){if(p.defaultPrevented){if(Va!==0){var W=A?Yw(x,A):new FormData(x);bm(u,{pending:!0,data:W,method:x.method,action:w},null,W)}}else typeof w=="function"&&(U.preventDefault(),W=A?Yw(x,A):new FormData(x),bm(u,{pending:!0,data:W,method:x.method,action:w},w,W))},currentTarget:x}]})}}for(var Jm=0;Jm<Lp.length;Jm++){var eg=Lp[Jm],oM=eg.toLowerCase(),lM=eg[0].toUpperCase()+eg.slice(1);ti(oM,"on"+lM)}ti(Nv,"onAnimationEnd"),ti(_v,"onAnimationIteration"),ti(jv,"onAnimationStart"),ti("dblclick","onDoubleClick"),ti("focusin","onFocus"),ti("focusout","onBlur"),ti(ST,"onTransitionRun"),ti(NT,"onTransitionStart"),ti(_T,"onTransitionCancel"),ti(Cv,"onTransitionEnd"),_e("onMouseEnter",["mouseout","mouseover"]),_e("onMouseLeave",["mouseout","mouseover"]),_e("onPointerEnter",["pointerout","pointerover"]),_e("onPointerLeave",["pointerout","pointerover"]),Jr("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Jr("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Jr("onBeforeInput",["compositionend","keypress","textInput","paste"]),Jr("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Jr("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Jr("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fc="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(" "),cM=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Fc));function Qw(i,s){s=(s&4)!==0;for(var u=0;u<i.length;u++){var p=i[u],x=p.event;p=p.listeners;e:{var w=void 0;if(s)for(var A=p.length-1;0<=A;A--){var U=p[A],W=U.instance,se=U.currentTarget;if(U=U.listener,W!==w&&x.isPropagationStopped())break e;w=U,x.currentTarget=se;try{w(x)}catch(me){gd(me)}x.currentTarget=null,w=W}else for(A=0;A<p.length;A++){if(U=p[A],W=U.instance,se=U.currentTarget,U=U.listener,W!==w&&x.isPropagationStopped())break e;w=U,x.currentTarget=se;try{w(x)}catch(me){gd(me)}x.currentTarget=null,w=W}}}}function mt(i,s){var u=s[Sa];u===void 0&&(u=s[Sa]=new Set);var p=i+"__bubble";u.has(p)||(Ww(s,i,2,!1),u.add(p))}function tg(i,s,u){var p=0;s&&(p|=4),Ww(u,i,p,s)}var nf="_reactListening"+Math.random().toString(36).slice(2);function ng(i){if(!i[nf]){i[nf]=!0,jo.forEach(function(u){u!=="selectionchange"&&(cM.has(u)||tg(u,!1,i),tg(u,!0,i))});var s=i.nodeType===9?i:i.ownerDocument;s===null||s[nf]||(s[nf]=!0,tg("selectionchange",!1,s))}}function Ww(i,s,u,p){switch(N1(s)){case 2:var x=zM;break;case 8:x=PM;break;default:x=yg}u=x.bind(null,s,u,i),x=void 0,!kp||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(x=!0),p?x!==void 0?i.addEventListener(s,u,{capture:!0,passive:x}):i.addEventListener(s,u,!0):x!==void 0?i.addEventListener(s,u,{passive:x}):i.addEventListener(s,u,!1)}function rg(i,s,u,p,x){var w=p;if((s&1)===0&&(s&2)===0&&p!==null)e:for(;;){if(p===null)return;var A=p.tag;if(A===3||A===4){var U=p.stateNode.containerInfo;if(U===x)break;if(A===4)for(A=p.return;A!==null;){var W=A.tag;if((W===3||W===4)&&A.stateNode.containerInfo===x)return;A=A.return}for(;U!==null;){if(A=Ln(U),A===null)return;if(W=A.tag,W===5||W===6||W===26||W===27){p=w=A;continue e}U=U.parentNode}}p=p.return}cd(function(){var se=w,me=ot(u),we=[];e:{var le=Av.get(i);if(le!==void 0){var fe=hd,$e=i;switch(i){case"keypress":if(dd(u)===0)break e;case"keydown":case"keyup":fe=nT;break;case"focusin":$e="focus",fe=_p;break;case"focusout":$e="blur",fe=_p;break;case"beforeblur":case"afterblur":fe=_p;break;case"click":if(u.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=iv;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=HA;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=aT;break;case Nv:case _v:case jv:fe=VA;break;case Cv:fe=oT;break;case"scroll":case"scrollend":fe=FA;break;case"wheel":fe=cT;break;case"copy":case"cut":case"paste":fe=QA;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=sv;break;case"toggle":case"beforetoggle":fe=dT}var tt=(s&4)!==0,$t=!tt&&(i==="scroll"||i==="scrollend"),re=tt?le!==null?le+"Capture":null:le;tt=[];for(var ee=se,ie;ee!==null;){var xe=ee;if(ie=xe.stateNode,xe=xe.tag,xe!==5&&xe!==26&&xe!==27||ie===null||re===null||(xe=uc(ee,re),xe!=null&&tt.push(qc(ee,xe,ie))),$t)break;ee=ee.return}0<tt.length&&(le=new fe(le,$e,null,u,me),we.push({event:le,listeners:tt}))}}if((s&7)===0){e:{if(le=i==="mouseover"||i==="pointerover",fe=i==="mouseout"||i==="pointerout",le&&u!==qe&&($e=u.relatedTarget||u.fromElement)&&(Ln($e)||$e[Wr]))break e;if((fe||le)&&(le=me.window===me?me:(le=me.ownerDocument)?le.defaultView||le.parentWindow:window,fe?($e=u.relatedTarget||u.toElement,fe=se,$e=$e?Ln($e):null,$e!==null&&($t=o($e),tt=$e.tag,$e!==$t||tt!==5&&tt!==27&&tt!==6)&&($e=null)):(fe=null,$e=se),fe!==$e)){if(tt=iv,xe="onMouseLeave",re="onMouseEnter",ee="mouse",(i==="pointerout"||i==="pointerover")&&(tt=sv,xe="onPointerLeave",re="onPointerEnter",ee="pointer"),$t=fe==null?le:Zr(fe),ie=$e==null?le:Zr($e),le=new tt(xe,ee+"leave",fe,u,me),le.target=$t,le.relatedTarget=ie,xe=null,Ln(me)===se&&(tt=new tt(re,ee+"enter",$e,u,me),tt.target=ie,tt.relatedTarget=$t,xe=tt),$t=xe,fe&&$e)t:{for(tt=uM,re=fe,ee=$e,ie=0,xe=re;xe;xe=tt(xe))ie++;xe=0;for(var We=ee;We;We=tt(We))xe++;for(;0<ie-xe;)re=tt(re),ie--;for(;0<xe-ie;)ee=tt(ee),xe--;for(;ie--;){if(re===ee||ee!==null&&re===ee.alternate){tt=re;break t}re=tt(re),ee=tt(ee)}tt=null}else tt=null;fe!==null&&Xw(we,le,fe,tt,!1),$e!==null&&$t!==null&&Xw(we,$t,$e,tt,!0)}}e:{if(le=se?Zr(se):window,fe=le.nodeName&&le.nodeName.toLowerCase(),fe==="select"||fe==="input"&&le.type==="file")var _t=pv;else if(fv(le))if(mv)_t=wT;else{_t=xT;var He=bT}else fe=le.nodeName,!fe||fe.toLowerCase()!=="input"||le.type!=="checkbox"&&le.type!=="radio"?se&&Aa(se.elementType)&&(_t=pv):_t=vT;if(_t&&(_t=_t(i,se))){hv(we,_t,u,me);break e}He&&He(i,le,se),i==="focusout"&&se&&le.type==="number"&&se.memoizedProps.value!=null&&Ca(le,"number",le.value)}switch(He=se?Zr(se):window,i){case"focusin":(fv(He)||He.contentEditable==="true")&&(Do=He,Dp=se,bc=null);break;case"focusout":bc=Dp=Do=null;break;case"mousedown":Op=!0;break;case"contextmenu":case"mouseup":case"dragend":Op=!1,Ev(we,u,me);break;case"selectionchange":if(ET)break;case"keydown":case"keyup":Ev(we,u,me)}var ct;if(Cp)e:{switch(i){case"compositionstart":var vt="onCompositionStart";break e;case"compositionend":vt="onCompositionEnd";break e;case"compositionupdate":vt="onCompositionUpdate";break e}vt=void 0}else Mo?uv(i,u)&&(vt="onCompositionEnd"):i==="keydown"&&u.keyCode===229&&(vt="onCompositionStart");vt&&(ov&&u.locale!=="ko"&&(Mo||vt!=="onCompositionStart"?vt==="onCompositionEnd"&&Mo&&(ct=nv()):(Ma=me,Ep="value"in Ma?Ma.value:Ma.textContent,Mo=!0)),He=rf(se,vt),0<He.length&&(vt=new av(vt,i,null,u,me),we.push({event:vt,listeners:He}),ct?vt.data=ct:(ct=dv(u),ct!==null&&(vt.data=ct)))),(ct=hT?pT(i,u):mT(i,u))&&(vt=rf(se,"onBeforeInput"),0<vt.length&&(He=new av("onBeforeInput","beforeinput",null,u,me),we.push({event:He,listeners:vt}),He.data=ct)),sM(we,i,se,u,me)}Qw(we,s)})}function qc(i,s,u){return{instance:i,listener:s,currentTarget:u}}function rf(i,s){for(var u=s+"Capture",p=[];i!==null;){var x=i,w=x.stateNode;if(x=x.tag,x!==5&&x!==26&&x!==27||w===null||(x=uc(i,u),x!=null&&p.unshift(qc(i,x,w)),x=uc(i,s),x!=null&&p.push(qc(i,x,w))),i.tag===3)return p;i=i.return}return[]}function uM(i){if(i===null)return null;do i=i.return;while(i&&i.tag!==5&&i.tag!==27);return i||null}function Xw(i,s,u,p,x){for(var w=s._reactName,A=[];u!==null&&u!==p;){var U=u,W=U.alternate,se=U.stateNode;if(U=U.tag,W!==null&&W===p)break;U!==5&&U!==26&&U!==27||se===null||(W=se,x?(se=uc(u,w),se!=null&&A.unshift(qc(u,se,W))):x||(se=uc(u,w),se!=null&&A.push(qc(u,se,W)))),u=u.return}A.length!==0&&i.push({event:s,listeners:A})}var dM=/\r\n?/g,fM=/\u0000|\uFFFD/g;function Zw(i){return(typeof i=="string"?i:""+i).replace(dM,`
|
|
49
|
-
`).replace(fM,"")}function Jw(i,s){return s=Zw(s),Zw(i)===s}function Bt(i,s,u,p,x,w){switch(u){case"children":typeof p=="string"?s==="body"||s==="textarea"&&p===""||nt(i,p):(typeof p=="number"||typeof p=="bigint")&&s!=="body"&&nt(i,""+p);break;case"className":Qn(i,"class",p);break;case"tabIndex":Qn(i,"tabindex",p);break;case"dir":case"role":case"viewBox":case"width":case"height":Qn(i,u,p);break;case"style":Rt(i,p,w);break;case"data":if(s!=="object"){Qn(i,"data",p);break}case"src":case"href":if(p===""&&(s!=="a"||u!=="href")){i.removeAttribute(u);break}if(p==null||typeof p=="function"||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=Ta(""+p),i.setAttribute(u,p);break;case"action":case"formAction":if(typeof p=="function"){i.setAttribute(u,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof w=="function"&&(u==="formAction"?(s!=="input"&&Bt(i,s,"name",x.name,x,null),Bt(i,s,"formEncType",x.formEncType,x,null),Bt(i,s,"formMethod",x.formMethod,x,null),Bt(i,s,"formTarget",x.formTarget,x,null)):(Bt(i,s,"encType",x.encType,x,null),Bt(i,s,"method",x.method,x,null),Bt(i,s,"target",x.target,x,null)));if(p==null||typeof p=="symbol"||typeof p=="boolean"){i.removeAttribute(u);break}p=Ta(""+p),i.setAttribute(u,p);break;case"onClick":p!=null&&(i.onclick=Ae);break;case"onScroll":p!=null&&mt("scroll",i);break;case"onScrollEnd":p!=null&&mt("scrollend",i);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"multiple":i.multiple=p&&typeof p!="function"&&typeof p!="symbol";break;case"muted":i.muted=p&&typeof p!="function"&&typeof p!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(p==null||typeof p=="function"||typeof p=="boolean"||typeof p=="symbol"){i.removeAttribute("xlink:href");break}u=Ta(""+p),i.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",u);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""+p):i.removeAttribute(u);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":p&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,""):i.removeAttribute(u);break;case"capture":case"download":p===!0?i.setAttribute(u,""):p!==!1&&p!=null&&typeof p!="function"&&typeof p!="symbol"?i.setAttribute(u,p):i.removeAttribute(u);break;case"cols":case"rows":case"size":case"span":p!=null&&typeof p!="function"&&typeof p!="symbol"&&!isNaN(p)&&1<=p?i.setAttribute(u,p):i.removeAttribute(u);break;case"rowSpan":case"start":p==null||typeof p=="function"||typeof p=="symbol"||isNaN(p)?i.removeAttribute(u):i.setAttribute(u,p);break;case"popover":mt("beforetoggle",i),mt("toggle",i),Mn(i,"popover",p);break;case"xlinkActuate":Fn(i,"http://www.w3.org/1999/xlink","xlink:actuate",p);break;case"xlinkArcrole":Fn(i,"http://www.w3.org/1999/xlink","xlink:arcrole",p);break;case"xlinkRole":Fn(i,"http://www.w3.org/1999/xlink","xlink:role",p);break;case"xlinkShow":Fn(i,"http://www.w3.org/1999/xlink","xlink:show",p);break;case"xlinkTitle":Fn(i,"http://www.w3.org/1999/xlink","xlink:title",p);break;case"xlinkType":Fn(i,"http://www.w3.org/1999/xlink","xlink:type",p);break;case"xmlBase":Fn(i,"http://www.w3.org/XML/1998/namespace","xml:base",p);break;case"xmlLang":Fn(i,"http://www.w3.org/XML/1998/namespace","xml:lang",p);break;case"xmlSpace":Fn(i,"http://www.w3.org/XML/1998/namespace","xml:space",p);break;case"is":Mn(i,"is",p);break;case"innerText":case"textContent":break;default:(!(2<u.length)||u[0]!=="o"&&u[0]!=="O"||u[1]!=="n"&&u[1]!=="N")&&(u=Fi.get(u)||u,Mn(i,u,p))}}function ig(i,s,u,p,x,w){switch(u){case"style":Rt(i,p,w);break;case"dangerouslySetInnerHTML":if(p!=null){if(typeof p!="object"||!("__html"in p))throw Error(r(61));if(u=p.__html,u!=null){if(x.children!=null)throw Error(r(60));i.innerHTML=u}}break;case"children":typeof p=="string"?nt(i,p):(typeof p=="number"||typeof p=="bigint")&&nt(i,""+p);break;case"onScroll":p!=null&&mt("scroll",i);break;case"onScrollEnd":p!=null&&mt("scrollend",i);break;case"onClick":p!=null&&(i.onclick=Ae);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Ui.hasOwnProperty(u))e:{if(u[0]==="o"&&u[1]==="n"&&(x=u.endsWith("Capture"),s=u.slice(2,x?u.length-7:void 0),w=i[Tn]||null,w=w!=null?w[u]:null,typeof w=="function"&&i.removeEventListener(s,w,x),typeof p=="function")){typeof w!="function"&&w!==null&&(u in i?i[u]=null:i.hasAttribute(u)&&i.removeAttribute(u)),i.addEventListener(s,p,x);break e}u in i?i[u]=p:p===!0?i.setAttribute(u,""):Mn(i,u,p)}}}function Bn(i,s,u){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":mt("error",i),mt("load",i);var p=!1,x=!1,w;for(w in u)if(u.hasOwnProperty(w)){var A=u[w];if(A!=null)switch(w){case"src":p=!0;break;case"srcSet":x=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Bt(i,s,w,A,u,null)}}x&&Bt(i,s,"srcSet",u.srcSet,u,null),p&&Bt(i,s,"src",u.src,u,null);return;case"input":mt("invalid",i);var U=w=A=x=null,W=null,se=null;for(p in u)if(u.hasOwnProperty(p)){var me=u[p];if(me!=null)switch(p){case"name":x=me;break;case"type":A=me;break;case"checked":W=me;break;case"defaultChecked":se=me;break;case"value":w=me;break;case"defaultValue":U=me;break;case"children":case"dangerouslySetInnerHTML":if(me!=null)throw Error(r(137,s));break;default:Bt(i,s,p,me,u,null)}}ei(i,w,U,W,se,A,x,!1);return;case"select":mt("invalid",i),p=A=w=null;for(x in u)if(u.hasOwnProperty(x)&&(U=u[x],U!=null))switch(x){case"value":w=U;break;case"defaultValue":A=U;break;case"multiple":p=U;default:Bt(i,s,x,U,u,null)}s=w,u=A,i.multiple=!!p,s!=null?_n(i,!!p,s,!1):u!=null&&_n(i,!!p,u,!0);return;case"textarea":mt("invalid",i),w=x=p=null;for(A in u)if(u.hasOwnProperty(A)&&(U=u[A],U!=null))switch(A){case"value":p=U;break;case"defaultValue":x=U;break;case"children":w=U;break;case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(91));break;default:Bt(i,s,A,U,u,null)}To(i,p,x,w);return;case"option":for(W in u)if(u.hasOwnProperty(W)&&(p=u[W],p!=null))switch(W){case"selected":i.selected=p&&typeof p!="function"&&typeof p!="symbol";break;default:Bt(i,s,W,p,u,null)}return;case"dialog":mt("beforetoggle",i),mt("toggle",i),mt("cancel",i),mt("close",i);break;case"iframe":case"object":mt("load",i);break;case"video":case"audio":for(p=0;p<Fc.length;p++)mt(Fc[p],i);break;case"image":mt("error",i),mt("load",i);break;case"details":mt("toggle",i);break;case"embed":case"source":case"link":mt("error",i),mt("load",i);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 u)if(u.hasOwnProperty(se)&&(p=u[se],p!=null))switch(se){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,s));default:Bt(i,s,se,p,u,null)}return;default:if(Aa(s)){for(me in u)u.hasOwnProperty(me)&&(p=u[me],p!==void 0&&ig(i,s,me,p,u,void 0));return}}for(U in u)u.hasOwnProperty(U)&&(p=u[U],p!=null&&Bt(i,s,U,p,u,null))}function hM(i,s,u,p){switch(s){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var x=null,w=null,A=null,U=null,W=null,se=null,me=null;for(fe in u){var we=u[fe];if(u.hasOwnProperty(fe)&&we!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":W=we;default:p.hasOwnProperty(fe)||Bt(i,s,fe,null,p,we)}}for(var le in p){var fe=p[le];if(we=u[le],p.hasOwnProperty(le)&&(fe!=null||we!=null))switch(le){case"type":w=fe;break;case"name":x=fe;break;case"checked":se=fe;break;case"defaultChecked":me=fe;break;case"value":A=fe;break;case"defaultValue":U=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(r(137,s));break;default:fe!==we&&Bt(i,s,le,fe,p,we)}}Cs(i,A,U,W,se,me,w,x);return;case"select":fe=A=U=le=null;for(w in u)if(W=u[w],u.hasOwnProperty(w)&&W!=null)switch(w){case"value":break;case"multiple":fe=W;default:p.hasOwnProperty(w)||Bt(i,s,w,null,p,W)}for(x in p)if(w=p[x],W=u[x],p.hasOwnProperty(x)&&(w!=null||W!=null))switch(x){case"value":le=w;break;case"defaultValue":U=w;break;case"multiple":A=w;default:w!==W&&Bt(i,s,x,w,p,W)}s=U,u=A,p=fe,le!=null?_n(i,!!u,le,!1):!!p!=!!u&&(s!=null?_n(i,!!u,s,!0):_n(i,!!u,u?[]:"",!1));return;case"textarea":fe=le=null;for(U in u)if(x=u[U],u.hasOwnProperty(U)&&x!=null&&!p.hasOwnProperty(U))switch(U){case"value":break;case"children":break;default:Bt(i,s,U,null,p,x)}for(A in p)if(x=p[A],w=u[A],p.hasOwnProperty(A)&&(x!=null||w!=null))switch(A){case"value":le=x;break;case"defaultValue":fe=x;break;case"children":break;case"dangerouslySetInnerHTML":if(x!=null)throw Error(r(91));break;default:x!==w&&Bt(i,s,A,x,p,w)}As(i,le,fe);return;case"option":for(var $e in u)if(le=u[$e],u.hasOwnProperty($e)&&le!=null&&!p.hasOwnProperty($e))switch($e){case"selected":i.selected=!1;break;default:Bt(i,s,$e,null,p,le)}for(W in p)if(le=p[W],fe=u[W],p.hasOwnProperty(W)&&le!==fe&&(le!=null||fe!=null))switch(W){case"selected":i.selected=le&&typeof le!="function"&&typeof le!="symbol";break;default:Bt(i,s,W,le,p,fe)}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 tt in u)le=u[tt],u.hasOwnProperty(tt)&&le!=null&&!p.hasOwnProperty(tt)&&Bt(i,s,tt,null,p,le);for(se in p)if(le=p[se],fe=u[se],p.hasOwnProperty(se)&&le!==fe&&(le!=null||fe!=null))switch(se){case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(r(137,s));break;default:Bt(i,s,se,le,p,fe)}return;default:if(Aa(s)){for(var $t in u)le=u[$t],u.hasOwnProperty($t)&&le!==void 0&&!p.hasOwnProperty($t)&&ig(i,s,$t,void 0,p,le);for(me in p)le=p[me],fe=u[me],!p.hasOwnProperty(me)||le===fe||le===void 0&&fe===void 0||ig(i,s,me,le,p,fe);return}}for(var re in u)le=u[re],u.hasOwnProperty(re)&&le!=null&&!p.hasOwnProperty(re)&&Bt(i,s,re,null,p,le);for(we in p)le=p[we],fe=u[we],!p.hasOwnProperty(we)||le===fe||le==null&&fe==null||Bt(i,s,we,le,p,fe)}function e1(i){switch(i){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function pM(){if(typeof performance.getEntriesByType=="function"){for(var i=0,s=0,u=performance.getEntriesByType("resource"),p=0;p<u.length;p++){var x=u[p],w=x.transferSize,A=x.initiatorType,U=x.duration;if(w&&U&&e1(A)){for(A=0,U=x.responseEnd,p+=1;p<u.length;p++){var W=u[p],se=W.startTime;if(se>U)break;var me=W.transferSize,we=W.initiatorType;me&&e1(we)&&(W=W.responseEnd,A+=me*(W<U?1:(U-se)/(W-se)))}if(--p,s+=8*(w+A)/(x.duration/1e3),i++,10<i)break}}if(0<i)return s/i/1e6}return navigator.connection&&(i=navigator.connection.downlink,typeof i=="number")?i:5}var ag=null,sg=null;function af(i){return i.nodeType===9?i:i.ownerDocument}function t1(i){switch(i){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function n1(i,s){if(i===0)switch(s){case"svg":return 1;case"math":return 2;default:return 0}return i===1&&s==="foreignObject"?0:i}function og(i,s){return i==="textarea"||i==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.children=="bigint"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var lg=null;function mM(){var i=window.event;return i&&i.type==="popstate"?i===lg?!1:(lg=i,!0):(lg=null,!1)}var r1=typeof setTimeout=="function"?setTimeout:void 0,gM=typeof clearTimeout=="function"?clearTimeout:void 0,i1=typeof Promise=="function"?Promise:void 0,yM=typeof queueMicrotask=="function"?queueMicrotask:typeof i1<"u"?function(i){return i1.resolve(null).then(i).catch(bM)}:r1;function bM(i){setTimeout(function(){throw i})}function Ya(i){return i==="head"}function a1(i,s){var u=s,p=0;do{var x=u.nextSibling;if(i.removeChild(u),x&&x.nodeType===8)if(u=x.data,u==="/$"||u==="/&"){if(p===0){i.removeChild(x),al(s);return}p--}else if(u==="$"||u==="$?"||u==="$~"||u==="$!"||u==="&")p++;else if(u==="html")Hc(i.ownerDocument.documentElement);else if(u==="head"){u=i.ownerDocument.head,Hc(u);for(var w=u.firstChild;w;){var A=w.nextSibling,U=w.nodeName;w[$i]||U==="SCRIPT"||U==="STYLE"||U==="LINK"&&w.rel.toLowerCase()==="stylesheet"||u.removeChild(w),w=A}}else u==="body"&&Hc(i.ownerDocument.body);u=x}while(u);al(s)}function s1(i,s){var u=i;i=0;do{var p=u.nextSibling;if(u.nodeType===1?s?(u._stashedDisplay=u.style.display,u.style.display="none"):(u.style.display=u._stashedDisplay||"",u.getAttribute("style")===""&&u.removeAttribute("style")):u.nodeType===3&&(s?(u._stashedText=u.nodeValue,u.nodeValue=""):u.nodeValue=u._stashedText||""),p&&p.nodeType===8)if(u=p.data,u==="/$"){if(i===0)break;i--}else u!=="$"&&u!=="$?"&&u!=="$~"&&u!=="$!"||i++;u=p}while(u)}function cg(i){var s=i.firstChild;for(s&&s.nodeType===10&&(s=s.nextSibling);s;){var u=s;switch(s=s.nextSibling,u.nodeName){case"HTML":case"HEAD":case"BODY":cg(u),js(u);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(u.rel.toLowerCase()==="stylesheet")continue}i.removeChild(u)}}function xM(i,s,u,p){for(;i.nodeType===1;){var x=u;if(i.nodeName.toLowerCase()!==s.toLowerCase()){if(!p&&(i.nodeName!=="INPUT"||i.type!=="hidden"))break}else if(p){if(!i[$i])switch(s){case"meta":if(!i.hasAttribute("itemprop"))break;return i;case"link":if(w=i.getAttribute("rel"),w==="stylesheet"&&i.hasAttribute("data-precedence"))break;if(w!==x.rel||i.getAttribute("href")!==(x.href==null||x.href===""?null:x.href)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin)||i.getAttribute("title")!==(x.title==null?null:x.title))break;return i;case"style":if(i.hasAttribute("data-precedence"))break;return i;case"script":if(w=i.getAttribute("src"),(w!==(x.src==null?null:x.src)||i.getAttribute("type")!==(x.type==null?null:x.type)||i.getAttribute("crossorigin")!==(x.crossOrigin==null?null:x.crossOrigin))&&w&&i.hasAttribute("async")&&!i.hasAttribute("itemprop"))break;return i;default:return i}}else if(s==="input"&&i.type==="hidden"){var w=x.name==null?null:""+x.name;if(x.type==="hidden"&&i.getAttribute("name")===w)return i}else return i;if(i=Br(i.nextSibling),i===null)break}return null}function vM(i,s,u){if(s==="")return null;for(;i.nodeType!==3;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!u||(i=Br(i.nextSibling),i===null))return null;return i}function o1(i,s){for(;i.nodeType!==8;)if((i.nodeType!==1||i.nodeName!=="INPUT"||i.type!=="hidden")&&!s||(i=Br(i.nextSibling),i===null))return null;return i}function ug(i){return i.data==="$?"||i.data==="$~"}function dg(i){return i.data==="$!"||i.data==="$?"&&i.ownerDocument.readyState!=="loading"}function wM(i,s){var u=i.ownerDocument;if(i.data==="$~")i._reactRetry=s;else if(i.data!=="$?"||u.readyState!=="loading")s();else{var p=function(){s(),u.removeEventListener("DOMContentLoaded",p)};u.addEventListener("DOMContentLoaded",p),i._reactRetry=p}}function Br(i){for(;i!=null;i=i.nextSibling){var s=i.nodeType;if(s===1||s===3)break;if(s===8){if(s=i.data,s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"||s==="F!"||s==="F")break;if(s==="/$"||s==="/&")return null}}return i}var fg=null;function l1(i){i=i.nextSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="/$"||u==="/&"){if(s===0)return Br(i.nextSibling);s--}else u!=="$"&&u!=="$!"&&u!=="$?"&&u!=="$~"&&u!=="&"||s++}i=i.nextSibling}return null}function c1(i){i=i.previousSibling;for(var s=0;i;){if(i.nodeType===8){var u=i.data;if(u==="$"||u==="$!"||u==="$?"||u==="$~"||u==="&"){if(s===0)return i;s--}else u!=="/$"&&u!=="/&"||s++}i=i.previousSibling}return null}function u1(i,s,u){switch(s=af(u),i){case"html":if(i=s.documentElement,!i)throw Error(r(452));return i;case"head":if(i=s.head,!i)throw Error(r(453));return i;case"body":if(i=s.body,!i)throw Error(r(454));return i;default:throw Error(r(451))}}function Hc(i){for(var s=i.attributes;s.length;)i.removeAttributeNode(s[0]);js(i)}var $r=new Map,d1=new Set;function sf(i){return typeof i.getRootNode=="function"?i.getRootNode():i.nodeType===9?i:i.ownerDocument}var ia=V.d;V.d={f:kM,r:EM,D:SM,C:NM,L:_M,m:jM,X:AM,S:CM,M:TM};function kM(){var i=ia.f(),s=Wd();return i||s}function EM(i){var s=Xr(i);s!==null&&s.tag===5&&s.type==="form"?C0(s):ia.r(i)}var nl=typeof document>"u"?null:document;function f1(i,s,u){var p=nl;if(p&&typeof s=="string"&&s){var x=qn(s);x='link[rel="'+i+'"][href="'+x+'"]',typeof u=="string"&&(x+='[crossorigin="'+u+'"]'),d1.has(x)||(d1.add(x),i={rel:i,crossOrigin:u,href:s},p.querySelector(x)===null&&(s=p.createElement("link"),Bn(s,"link",i),fn(s),p.head.appendChild(s)))}}function SM(i){ia.D(i),f1("dns-prefetch",i,null)}function NM(i,s){ia.C(i,s),f1("preconnect",i,s)}function _M(i,s,u){ia.L(i,s,u);var p=nl;if(p&&i&&s){var x='link[rel="preload"][as="'+qn(s)+'"]';s==="image"&&u&&u.imageSrcSet?(x+='[imagesrcset="'+qn(u.imageSrcSet)+'"]',typeof u.imageSizes=="string"&&(x+='[imagesizes="'+qn(u.imageSizes)+'"]')):x+='[href="'+qn(i)+'"]';var w=x;switch(s){case"style":w=rl(i);break;case"script":w=il(i)}$r.has(w)||(i=m({rel:"preload",href:s==="image"&&u&&u.imageSrcSet?void 0:i,as:s},u),$r.set(w,i),p.querySelector(x)!==null||s==="style"&&p.querySelector(Kc(w))||s==="script"&&p.querySelector(Gc(w))||(s=p.createElement("link"),Bn(s,"link",i),fn(s),p.head.appendChild(s)))}}function jM(i,s){ia.m(i,s);var u=nl;if(u&&i){var p=s&&typeof s.as=="string"?s.as:"script",x='link[rel="modulepreload"][as="'+qn(p)+'"][href="'+qn(i)+'"]',w=x;switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":w=il(i)}if(!$r.has(w)&&(i=m({rel:"modulepreload",href:i},s),$r.set(w,i),u.querySelector(x)===null)){switch(p){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(u.querySelector(Gc(w)))return}p=u.createElement("link"),Bn(p,"link",i),fn(p),u.head.appendChild(p)}}}function CM(i,s,u){ia.S(i,s,u);var p=nl;if(p&&i){var x=yi(p).hoistableStyles,w=rl(i);s=s||"default";var A=x.get(w);if(!A){var U={loading:0,preload:null};if(A=p.querySelector(Kc(w)))U.loading=5;else{i=m({rel:"stylesheet",href:i,"data-precedence":s},u),(u=$r.get(w))&&hg(i,u);var W=A=p.createElement("link");fn(W),Bn(W,"link",i),W._p=new Promise(function(se,me){W.onload=se,W.onerror=me}),W.addEventListener("load",function(){U.loading|=1}),W.addEventListener("error",function(){U.loading|=2}),U.loading|=4,of(A,s,p)}A={type:"stylesheet",instance:A,count:1,state:U},x.set(w,A)}}}function AM(i,s){ia.X(i,s);var u=nl;if(u&&i){var p=yi(u).hoistableScripts,x=il(i),w=p.get(x);w||(w=u.querySelector(Gc(x)),w||(i=m({src:i,async:!0},s),(s=$r.get(x))&&pg(i,s),w=u.createElement("script"),fn(w),Bn(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function TM(i,s){ia.M(i,s);var u=nl;if(u&&i){var p=yi(u).hoistableScripts,x=il(i),w=p.get(x);w||(w=u.querySelector(Gc(x)),w||(i=m({src:i,async:!0,type:"module"},s),(s=$r.get(x))&&pg(i,s),w=u.createElement("script"),fn(w),Bn(w,"link",i),u.head.appendChild(w)),w={type:"script",instance:w,count:1,state:null},p.set(x,w))}}function h1(i,s,u,p){var x=(x=ke.current)?sf(x):null;if(!x)throw Error(r(446));switch(i){case"meta":case"title":return null;case"style":return typeof u.precedence=="string"&&typeof u.href=="string"?(s=rl(u.href),u=yi(x).hoistableStyles,p=u.get(s),p||(p={type:"style",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};case"link":if(u.rel==="stylesheet"&&typeof u.href=="string"&&typeof u.precedence=="string"){i=rl(u.href);var w=yi(x).hoistableStyles,A=w.get(i);if(A||(x=x.ownerDocument||x,A={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},w.set(i,A),(w=x.querySelector(Kc(i)))&&!w._p&&(A.instance=w,A.state.loading=5),$r.has(i)||(u={rel:"preload",as:"style",href:u.href,crossOrigin:u.crossOrigin,integrity:u.integrity,media:u.media,hrefLang:u.hrefLang,referrerPolicy:u.referrerPolicy},$r.set(i,u),w||MM(x,i,u,A.state))),s&&p===null)throw Error(r(528,""));return A}if(s&&p!==null)throw Error(r(529,""));return null;case"script":return s=u.async,u=u.src,typeof u=="string"&&s&&typeof s!="function"&&typeof s!="symbol"?(s=il(u),u=yi(x).hoistableScripts,p=u.get(s),p||(p={type:"script",instance:null,count:0,state:null},u.set(s,p)),p):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,i))}}function rl(i){return'href="'+qn(i)+'"'}function Kc(i){return'link[rel="stylesheet"]['+i+"]"}function p1(i){return m({},i,{"data-precedence":i.precedence,precedence:null})}function MM(i,s,u,p){i.querySelector('link[rel="preload"][as="style"]['+s+"]")?p.loading=1:(s=i.createElement("link"),p.preload=s,s.addEventListener("load",function(){return p.loading|=1}),s.addEventListener("error",function(){return p.loading|=2}),Bn(s,"link",u),fn(s),i.head.appendChild(s))}function il(i){return'[src="'+qn(i)+'"]'}function Gc(i){return"script[async]"+i}function m1(i,s,u){if(s.count++,s.instance===null)switch(s.type){case"style":var p=i.querySelector('style[data-href~="'+qn(u.href)+'"]');if(p)return s.instance=p,fn(p),p;var x=m({},u,{"data-href":u.href,"data-precedence":u.precedence,href:null,precedence:null});return p=(i.ownerDocument||i).createElement("style"),fn(p),Bn(p,"style",x),of(p,u.precedence,i),s.instance=p;case"stylesheet":x=rl(u.href);var w=i.querySelector(Kc(x));if(w)return s.state.loading|=4,s.instance=w,fn(w),w;p=p1(u),(x=$r.get(x))&&hg(p,x),w=(i.ownerDocument||i).createElement("link"),fn(w);var A=w;return A._p=new Promise(function(U,W){A.onload=U,A.onerror=W}),Bn(w,"link",p),s.state.loading|=4,of(w,u.precedence,i),s.instance=w;case"script":return w=il(u.src),(x=i.querySelector(Gc(w)))?(s.instance=x,fn(x),x):(p=u,(x=$r.get(w))&&(p=m({},u),pg(p,x)),i=i.ownerDocument||i,x=i.createElement("script"),fn(x),Bn(x,"link",p),i.head.appendChild(x),s.instance=x);case"void":return null;default:throw Error(r(443,s.type))}else s.type==="stylesheet"&&(s.state.loading&4)===0&&(p=s.instance,s.state.loading|=4,of(p,u.precedence,i));return s.instance}function of(i,s,u){for(var p=u.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),x=p.length?p[p.length-1]:null,w=x,A=0;A<p.length;A++){var U=p[A];if(U.dataset.precedence===s)w=U;else if(w!==x)break}w?w.parentNode.insertBefore(i,w.nextSibling):(s=u.nodeType===9?u.head:u,s.insertBefore(i,s.firstChild))}function hg(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.title==null&&(i.title=s.title)}function pg(i,s){i.crossOrigin==null&&(i.crossOrigin=s.crossOrigin),i.referrerPolicy==null&&(i.referrerPolicy=s.referrerPolicy),i.integrity==null&&(i.integrity=s.integrity)}var lf=null;function g1(i,s,u){if(lf===null){var p=new Map,x=lf=new Map;x.set(u,p)}else x=lf,p=x.get(u),p||(p=new Map,x.set(u,p));if(p.has(i))return p;for(p.set(i,null),u=u.getElementsByTagName(i),x=0;x<u.length;x++){var w=u[x];if(!(w[$i]||w[an]||i==="link"&&w.getAttribute("rel")==="stylesheet")&&w.namespaceURI!=="http://www.w3.org/2000/svg"){var A=w.getAttribute(s)||"";A=i+A;var U=p.get(A);U?U.push(w):p.set(A,[w])}}return p}function y1(i,s,u){i=i.ownerDocument||i,i.head.insertBefore(u,s==="title"?i.querySelector("head > title"):null)}function DM(i,s,u){if(u===1||s.itemProp!=null)return!1;switch(i){case"meta":case"title":return!0;case"style":if(typeof s.precedence!="string"||typeof s.href!="string"||s.href==="")break;return!0;case"link":if(typeof s.rel!="string"||typeof s.href!="string"||s.href===""||s.onLoad||s.onError)break;switch(s.rel){case"stylesheet":return i=s.disabled,typeof s.precedence=="string"&&i==null;default:return!0}case"script":if(s.async&&typeof s.async!="function"&&typeof s.async!="symbol"&&!s.onLoad&&!s.onError&&s.src&&typeof s.src=="string")return!0}return!1}function b1(i){return!(i.type==="stylesheet"&&(i.state.loading&3)===0)}function OM(i,s,u,p){if(u.type==="stylesheet"&&(typeof p.media!="string"||matchMedia(p.media).matches!==!1)&&(u.state.loading&4)===0){if(u.instance===null){var x=rl(p.href),w=s.querySelector(Kc(x));if(w){s=w._p,s!==null&&typeof s=="object"&&typeof s.then=="function"&&(i.count++,i=cf.bind(i),s.then(i,i)),u.state.loading|=4,u.instance=w,fn(w);return}w=s.ownerDocument||s,p=p1(p),(x=$r.get(x))&&hg(p,x),w=w.createElement("link"),fn(w);var A=w;A._p=new Promise(function(U,W){A.onload=U,A.onerror=W}),Bn(w,"link",p),u.instance=w}i.stylesheets===null&&(i.stylesheets=new Map),i.stylesheets.set(u,s),(s=u.state.preload)&&(u.state.loading&3)===0&&(i.count++,u=cf.bind(i),s.addEventListener("load",u),s.addEventListener("error",u))}}var mg=0;function RM(i,s){return i.stylesheets&&i.count===0&&df(i,i.stylesheets),0<i.count||0<i.imgCount?function(u){var p=setTimeout(function(){if(i.stylesheets&&df(i,i.stylesheets),i.unsuspend){var w=i.unsuspend;i.unsuspend=null,w()}},6e4+s);0<i.imgBytes&&mg===0&&(mg=62500*pM());var x=setTimeout(function(){if(i.waitingForImages=!1,i.count===0&&(i.stylesheets&&df(i,i.stylesheets),i.unsuspend)){var w=i.unsuspend;i.unsuspend=null,w()}},(i.imgBytes>mg?50:800)+s);return i.unsuspend=u,function(){i.unsuspend=null,clearTimeout(p),clearTimeout(x)}}:null}function cf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)df(this,this.stylesheets);else if(this.unsuspend){var i=this.unsuspend;this.unsuspend=null,i()}}}var uf=null;function df(i,s){i.stylesheets=null,i.unsuspend!==null&&(i.count++,uf=new Map,s.forEach(LM,i),uf=null,cf.call(i))}function LM(i,s){if(!(s.state.loading&4)){var u=uf.get(i);if(u)var p=u.get(null);else{u=new Map,uf.set(i,u);for(var x=i.querySelectorAll("link[data-precedence],style[data-precedence]"),w=0;w<x.length;w++){var A=x[w];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(u.set(A.dataset.precedence,A),p=A)}p&&u.set(null,p)}x=s.instance,A=x.getAttribute("data-precedence"),w=u.get(A)||p,w===p&&u.set(null,x),u.set(A,x),this.count++,p=cf.bind(this),x.addEventListener("load",p),x.addEventListener("error",p),w?w.parentNode.insertBefore(x,w.nextSibling):(i=i.nodeType===9?i.head:i,i.insertBefore(x,i.firstChild)),s.state.loading|=4}}var Vc={$$typeof:S,Provider:null,Consumer:null,_currentValue:Q,_currentValue2:Q,_threadCount:0};function IM(i,s,u,p,x,w,A,U,W){this.tag=1,this.containerInfo=i,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=Ft(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Ft(0),this.hiddenUpdates=Ft(null),this.identifierPrefix=p,this.onUncaughtError=x,this.onCaughtError=w,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=W,this.incompleteTransitions=new Map}function x1(i,s,u,p,x,w,A,U,W,se,me,we){return i=new IM(i,s,u,A,W,se,me,we,U),s=1,w===!0&&(s|=24),w=yr(3,null,null,s),i.current=w,w.stateNode=i,s=Yp(),s.refCount++,i.pooledCache=s,s.refCount++,w.memoizedState={element:p,isDehydrated:u,cache:s},Zp(w),i}function v1(i){return i?(i=Lo,i):Lo}function w1(i,s,u,p,x,w){x=v1(x),p.context===null?p.context=x:p.pendingContext=x,p=za(s),p.payload={element:u},w=w===void 0?null:w,w!==null&&(p.callback=w),u=Pa(i,p,s),u!==null&&(lr(u,i,s),Nc(u,i,s))}function k1(i,s){if(i=i.memoizedState,i!==null&&i.dehydrated!==null){var u=i.retryLane;i.retryLane=u!==0&&u<s?u:s}}function gg(i,s){k1(i,s),(i=i.alternate)&&k1(i,s)}function E1(i){if(i.tag===13||i.tag===31){var s=Os(i,67108864);s!==null&&lr(s,i,67108864),gg(i,67108864)}}function S1(i){if(i.tag===13||i.tag===31){var s=kr();s=Vt(s);var u=Os(i,s);u!==null&&lr(u,i,s),gg(i,s)}}var ff=!0;function zM(i,s,u,p){var x=O.T;O.T=null;var w=V.p;try{V.p=2,yg(i,s,u,p)}finally{V.p=w,O.T=x}}function PM(i,s,u,p){var x=O.T;O.T=null;var w=V.p;try{V.p=8,yg(i,s,u,p)}finally{V.p=w,O.T=x}}function yg(i,s,u,p){if(ff){var x=bg(p);if(x===null)rg(i,s,p,hf,u),_1(i,p);else if($M(x,i,s,u,p))p.stopPropagation();else if(_1(i,p),s&4&&-1<BM.indexOf(i)){for(;x!==null;){var w=Xr(x);if(w!==null)switch(w.tag){case 3:if(w=w.stateNode,w.current.memoizedState.isDehydrated){var A=Un(w.pendingLanes);if(A!==0){var U=w;for(U.pendingLanes|=2,U.entangledLanes|=2;A;){var W=1<<31-yt(A);U.entanglements[1]|=W,A&=~W}ki(w),(Tt&6)===0&&(Yd=Ne()+500,Uc(0))}}break;case 31:case 13:U=Os(w,2),U!==null&&lr(U,w,2),Wd(),gg(w,2)}if(w=bg(p),w===null&&rg(i,s,p,hf,u),w===x)break;x=w}x!==null&&p.stopPropagation()}else rg(i,s,p,null,u)}}function bg(i){return i=ot(i),xg(i)}var hf=null;function xg(i){if(hf=null,i=Ln(i),i!==null){var s=o(i);if(s===null)i=null;else{var u=s.tag;if(u===13){if(i=l(s),i!==null)return i;i=null}else if(u===31){if(i=d(s),i!==null)return i;i=null}else if(u===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;i=null}else s!==i&&(i=null)}}return hf=i,null}function N1(i){switch(i){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(Ke()){case ne:return 2;case de:return 8;case Le:case Ze:return 32;case it:return 268435456;default:return 32}default:return 32}}var vg=!1,Qa=null,Wa=null,Xa=null,Yc=new Map,Qc=new Map,Za=[],BM="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 _1(i,s){switch(i){case"focusin":case"focusout":Qa=null;break;case"dragenter":case"dragleave":Wa=null;break;case"mouseover":case"mouseout":Xa=null;break;case"pointerover":case"pointerout":Yc.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Qc.delete(s.pointerId)}}function Wc(i,s,u,p,x,w){return i===null||i.nativeEvent!==w?(i={blockedOn:s,domEventName:u,eventSystemFlags:p,nativeEvent:w,targetContainers:[x]},s!==null&&(s=Xr(s),s!==null&&E1(s)),i):(i.eventSystemFlags|=p,s=i.targetContainers,x!==null&&s.indexOf(x)===-1&&s.push(x),i)}function $M(i,s,u,p,x){switch(s){case"focusin":return Qa=Wc(Qa,i,s,u,p,x),!0;case"dragenter":return Wa=Wc(Wa,i,s,u,p,x),!0;case"mouseover":return Xa=Wc(Xa,i,s,u,p,x),!0;case"pointerover":var w=x.pointerId;return Yc.set(w,Wc(Yc.get(w)||null,i,s,u,p,x)),!0;case"gotpointercapture":return w=x.pointerId,Qc.set(w,Wc(Qc.get(w)||null,i,s,u,p,x)),!0}return!1}function j1(i){var s=Ln(i.target);if(s!==null){var u=o(s);if(u!==null){if(s=u.tag,s===13){if(s=l(u),s!==null){i.blockedOn=s,Ea(i.priority,function(){S1(u)});return}}else if(s===31){if(s=d(u),s!==null){i.blockedOn=s,Ea(i.priority,function(){S1(u)});return}}else if(s===3&&u.stateNode.current.memoizedState.isDehydrated){i.blockedOn=u.tag===3?u.stateNode.containerInfo:null;return}}}i.blockedOn=null}function pf(i){if(i.blockedOn!==null)return!1;for(var s=i.targetContainers;0<s.length;){var u=bg(i.nativeEvent);if(u===null){u=i.nativeEvent;var p=new u.constructor(u.type,u);qe=p,u.target.dispatchEvent(p),qe=null}else return s=Xr(u),s!==null&&E1(s),i.blockedOn=u,!1;s.shift()}return!0}function C1(i,s,u){pf(i)&&u.delete(s)}function UM(){vg=!1,Qa!==null&&pf(Qa)&&(Qa=null),Wa!==null&&pf(Wa)&&(Wa=null),Xa!==null&&pf(Xa)&&(Xa=null),Yc.forEach(C1),Qc.forEach(C1)}function mf(i,s){i.blockedOn===s&&(i.blockedOn=null,vg||(vg=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,UM)))}var gf=null;function A1(i){gf!==i&&(gf=i,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){gf===i&&(gf=null);for(var s=0;s<i.length;s+=3){var u=i[s],p=i[s+1],x=i[s+2];if(typeof p!="function"){if(xg(p||u)===null)continue;break}var w=Xr(u);w!==null&&(i.splice(s,3),s-=3,bm(w,{pending:!0,data:x,method:u.method,action:p},p,x))}}))}function al(i){function s(W){return mf(W,i)}Qa!==null&&mf(Qa,i),Wa!==null&&mf(Wa,i),Xa!==null&&mf(Xa,i),Yc.forEach(s),Qc.forEach(s);for(var u=0;u<Za.length;u++){var p=Za[u];p.blockedOn===i&&(p.blockedOn=null)}for(;0<Za.length&&(u=Za[0],u.blockedOn===null);)j1(u),u.blockedOn===null&&Za.shift();if(u=(i.ownerDocument||i).$$reactFormReplay,u!=null)for(p=0;p<u.length;p+=3){var x=u[p],w=u[p+1],A=x[Tn]||null;if(typeof w=="function")A||A1(u);else if(A){var U=null;if(w&&w.hasAttribute("formAction")){if(x=w,A=w[Tn]||null)U=A.formAction;else if(xg(x)!==null)continue}else U=A.action;typeof U=="function"?u[p+1]=U:(u.splice(p,3),p-=3),A1(u)}}}function T1(){function i(w){w.canIntercept&&w.info==="react-transition"&&w.intercept({handler:function(){return new Promise(function(A){return x=A})},focusReset:"manual",scroll:"manual"})}function s(){x!==null&&(x(),x=null),p||setTimeout(u,20)}function u(){if(!p&&!navigation.transition){var w=navigation.currentEntry;w&&w.url!=null&&navigation.navigate(w.url,{state:w.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var p=!1,x=null;return navigation.addEventListener("navigate",i),navigation.addEventListener("navigatesuccess",s),navigation.addEventListener("navigateerror",s),setTimeout(u,100),function(){p=!0,navigation.removeEventListener("navigate",i),navigation.removeEventListener("navigatesuccess",s),navigation.removeEventListener("navigateerror",s),x!==null&&(x(),x=null)}}}function wg(i){this._internalRoot=i}yf.prototype.render=wg.prototype.render=function(i){var s=this._internalRoot;if(s===null)throw Error(r(409));var u=s.current,p=kr();w1(u,p,i,s,null,null)},yf.prototype.unmount=wg.prototype.unmount=function(){var i=this._internalRoot;if(i!==null){this._internalRoot=null;var s=i.containerInfo;w1(i.current,2,null,i,null,null),Wd(),s[Wr]=null}};function yf(i){this._internalRoot=i}yf.prototype.unstable_scheduleHydration=function(i){if(i){var s=ka();i={blockedOn:null,target:i,priority:s};for(var u=0;u<Za.length&&s!==0&&s<Za[u].priority;u++);Za.splice(u,0,i),u===0&&j1(i)}};var M1=t.version;if(M1!=="19.2.5")throw Error(r(527,M1,"19.2.5"));V.findDOMNode=function(i){var s=i._reactInternals;if(s===void 0)throw typeof i.render=="function"?Error(r(188)):(i=Object.keys(i).join(","),Error(r(268,i)));return i=h(s),i=i!==null?g(i):null,i=i===null?null:i.stateNode,i};var FM={bundleType:0,version:"19.2.5",rendererPackageName:"react-dom",currentDispatcherRef:O,reconcilerVersion:"19.2.5"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var bf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!bf.isDisabled&&bf.supportsFiber)try{dn=bf.inject(FM),Mt=bf}catch{}}return Zc.createRoot=function(i,s){if(!a(i))throw Error(r(299));var u=!1,p="",x=P0,w=B0,A=$0;return s!=null&&(s.unstable_strictMode===!0&&(u=!0),s.identifierPrefix!==void 0&&(p=s.identifierPrefix),s.onUncaughtError!==void 0&&(x=s.onUncaughtError),s.onCaughtError!==void 0&&(w=s.onCaughtError),s.onRecoverableError!==void 0&&(A=s.onRecoverableError)),s=x1(i,1,!1,null,null,u,p,null,x,w,A,T1),i[Wr]=s.current,ng(i),new wg(s)},Zc.hydrateRoot=function(i,s,u){if(!a(i))throw Error(r(299));var p=!1,x="",w=P0,A=B0,U=$0,W=null;return u!=null&&(u.unstable_strictMode===!0&&(p=!0),u.identifierPrefix!==void 0&&(x=u.identifierPrefix),u.onUncaughtError!==void 0&&(w=u.onUncaughtError),u.onCaughtError!==void 0&&(A=u.onCaughtError),u.onRecoverableError!==void 0&&(U=u.onRecoverableError),u.formState!==void 0&&(W=u.formState)),s=x1(i,1,!0,s,u??null,p,x,W,w,A,U,T1),s.context=v1(null),u=s.current,p=kr(),p=Vt(p),x=za(p),x.callback=null,Pa(u,x,p),u=p,s.current.lanes=u,Ot(s,u),ki(s),i[Wr]=s.current,ng(i),new yf(s)},Zc.version="19.2.5",Zc}var q1;function eD(){if(q1)return Ng.exports;q1=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),Ng.exports=JM(),Ng.exports}var tD=eD(),Yl=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},eo,cs,_l,WS,nD=(WS=class extends Yl{constructor(){super();Qe(this,eo);Qe(this,cs);Qe(this,_l);Ie(this,_l,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t();return window.addEventListener("visibilitychange",n,!1),()=>{window.removeEventListener("visibilitychange",n)}}})}onSubscribe(){X(this,cs)||this.setEventListener(X(this,_l))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,cs))==null||t.call(this),Ie(this,cs,void 0))}setEventListener(t){var n;Ie(this,_l,t),(n=X(this,cs))==null||n.call(this),Ie(this,cs,t(r=>{typeof r=="boolean"?this.setFocused(r):this.onFocus()}))}setFocused(t){X(this,eo)!==t&&(Ie(this,eo,t),this.onFocus())}onFocus(){const t=this.isFocused();this.listeners.forEach(n=>{n(t)})}isFocused(){var t;return typeof X(this,eo)=="boolean"?X(this,eo):((t=globalThis.document)==null?void 0:t.visibilityState)!=="hidden"}},eo=new WeakMap,cs=new WeakMap,_l=new WeakMap,WS),Sb=new nD,rD={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},us,Eb,XS,iD=(XS=class{constructor(){Qe(this,us,rD);Qe(this,Eb,!1)}setTimeoutProvider(e){Ie(this,us,e)}setTimeout(e,t){return X(this,us).setTimeout(e,t)}clearTimeout(e){X(this,us).clearTimeout(e)}setInterval(e,t){return X(this,us).setInterval(e,t)}clearInterval(e){X(this,us).clearInterval(e)}},us=new WeakMap,Eb=new WeakMap,XS),Qs=new iD;function aD(e){setTimeout(e,0)}var sD=typeof window>"u"||"Deno"in globalThis;function er(){}function oD(e,t){return typeof e=="function"?e(t):e}function Sy(e){return typeof e=="number"&&e>=0&&e!==1/0}function lN(e,t){return Math.max(e+(t||0)-Date.now(),0)}function bs(e,t){return typeof e=="function"?e(t):e}function qr(e,t){return typeof e=="function"?e(t):e}function H1(e,t){const{type:n="all",exact:r,fetchStatus:a,predicate:o,queryKey:l,stale:d}=e;if(l){if(r){if(t.queryHash!==Nb(l,t.options))return!1}else if(!xu(t.queryKey,l))return!1}if(n!=="all"){const f=t.isActive();if(n==="active"&&!f||n==="inactive"&&f)return!1}return!(typeof d=="boolean"&&t.isStale()!==d||a&&a!==t.state.fetchStatus||o&&!o(t))}function K1(e,t){const{exact:n,status:r,predicate:a,mutationKey:o}=e;if(o){if(!t.options.mutationKey)return!1;if(n){if(fo(t.options.mutationKey)!==fo(o))return!1}else if(!xu(t.options.mutationKey,o))return!1}return!(r&&t.state.status!==r||a&&!a(t))}function Nb(e,t){return((t==null?void 0:t.queryKeyHashFn)||fo)(e)}function fo(e){return JSON.stringify(e,(t,n)=>Ny(n)?Object.keys(n).sort().reduce((r,a)=>(r[a]=n[a],r),{}):n)}function xu(e,t){return e===t?!0:typeof e!=typeof t?!1:e&&t&&typeof e=="object"&&typeof t=="object"?Object.keys(t).every(n=>xu(e[n],t[n])):!1}var lD=Object.prototype.hasOwnProperty;function cN(e,t,n=0){if(e===t)return e;if(n>500)return t;const r=G1(e)&&G1(t);if(!r&&!(Ny(e)&&Ny(t)))return t;const o=(r?e:Object.keys(e)).length,l=r?t:Object.keys(t),d=l.length,f=r?new Array(d):{};let h=0;for(let g=0;g<d;g++){const m=r?g:l[g],y=e[m],b=t[m];if(y===b){f[m]=y,(r?g<o:lD.call(e,m))&&h++;continue}if(y===null||b===null||typeof y!="object"||typeof b!="object"){f[m]=b;continue}const k=cN(y,b,n+1);f[m]=k,k===y&&h++}return o===d&&h===o?e:f}function lh(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(const n in e)if(e[n]!==t[n])return!1;return!0}function G1(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function Ny(e){if(!V1(e))return!1;const t=e.constructor;if(t===void 0)return!0;const n=t.prototype;return!(!V1(n)||!n.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(e)!==Object.prototype)}function V1(e){return Object.prototype.toString.call(e)==="[object Object]"}function cD(e){return new Promise(t=>{Qs.setTimeout(t,e)})}function _y(e,t,n){return typeof n.structuralSharing=="function"?n.structuralSharing(e,t):n.structuralSharing!==!1?cN(e,t):t}function uD(e,t,n=0){const r=[...e,t];return n&&r.length>n?r.slice(1):r}function dD(e,t,n=0){const r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var _b=Symbol();function uN(e,t){return!e.queryFn&&(t!=null&&t.initialPromise)?()=>t.initialPromise:!e.queryFn||e.queryFn===_b?()=>Promise.reject(new Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function jb(e,t){return typeof e=="function"?e(...t):!!e}function fD(e,t,n){let r=!1,a;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(a??(a=t()),r||(r=!0,a.aborted?n():a.addEventListener("abort",n,{once:!0})),a)}),e}var vu=(()=>{let e=()=>sD;return{isServer(){return e()},setIsServer(t){e=t}}})();function jy(){let e,t;const n=new Promise((a,o)=>{e=a,t=o});n.status="pending",n.catch(()=>{});function r(a){Object.assign(n,a),delete n.resolve,delete n.reject}return n.resolve=a=>{r({status:"fulfilled",value:a}),e(a)},n.reject=a=>{r({status:"rejected",reason:a}),t(a)},n}var hD=aD;function pD(){let e=[],t=0,n=d=>{d()},r=d=>{d()},a=hD;const o=d=>{t?e.push(d):a(()=>{n(d)})},l=()=>{const d=e;e=[],d.length&&a(()=>{r(()=>{d.forEach(f=>{n(f)})})})};return{batch:d=>{let f;t++;try{f=d()}finally{t--,t||l()}return f},batchCalls:d=>(...f)=>{o(()=>{d(...f)})},schedule:o,setNotifyFunction:d=>{n=d},setBatchNotifyFunction:d=>{r=d},setScheduler:d=>{a=d}}}var An=pD(),jl,ds,Cl,ZS,mD=(ZS=class extends Yl{constructor(){super();Qe(this,jl,!0);Qe(this,ds);Qe(this,Cl);Ie(this,Cl,t=>{if(typeof window<"u"&&window.addEventListener){const n=()=>t(!0),r=()=>t(!1);return window.addEventListener("online",n,!1),window.addEventListener("offline",r,!1),()=>{window.removeEventListener("online",n),window.removeEventListener("offline",r)}}})}onSubscribe(){X(this,ds)||this.setEventListener(X(this,Cl))}onUnsubscribe(){var t;this.hasListeners()||((t=X(this,ds))==null||t.call(this),Ie(this,ds,void 0))}setEventListener(t){var n;Ie(this,Cl,t),(n=X(this,ds))==null||n.call(this),Ie(this,ds,t(this.setOnline.bind(this)))}setOnline(t){X(this,jl)!==t&&(Ie(this,jl,t),this.listeners.forEach(r=>{r(t)}))}isOnline(){return X(this,jl)}},jl=new WeakMap,ds=new WeakMap,Cl=new WeakMap,ZS),ch=new mD;function gD(e){return Math.min(1e3*2**e,3e4)}function dN(e){return(e??"online")==="online"?ch.isOnline():!0}var Cy=class extends Error{constructor(e){super("CancelledError"),this.revert=e==null?void 0:e.revert,this.silent=e==null?void 0:e.silent}};function fN(e){let t=!1,n=0,r;const a=jy(),o=()=>a.status!=="pending",l=v=>{var N;if(!o()){const E=new Cy(v);y(E),(N=e.onCancel)==null||N.call(e,E)}},d=()=>{t=!0},f=()=>{t=!1},h=()=>Sb.isFocused()&&(e.networkMode==="always"||ch.isOnline())&&e.canRun(),g=()=>dN(e.networkMode)&&e.canRun(),m=v=>{o()||(r==null||r(),a.resolve(v))},y=v=>{o()||(r==null||r(),a.reject(v))},b=()=>new Promise(v=>{var N;r=E=>{(o()||h())&&v(E)},(N=e.onPause)==null||N.call(e)}).then(()=>{var v;r=void 0,o()||(v=e.onContinue)==null||v.call(e)}),k=()=>{if(o())return;let v;const N=n===0?e.initialPromise:void 0;try{v=N??e.fn()}catch(E){v=Promise.reject(E)}Promise.resolve(v).then(m).catch(E=>{var T;if(o())return;const C=e.retry??(vu.isServer()?0:3),S=e.retryDelay??gD,_=typeof S=="function"?S(n,E):S,M=C===!0||typeof C=="number"&&n<C||typeof C=="function"&&C(n,E);if(t||!M){y(E);return}n++,(T=e.onFail)==null||T.call(e,n,E),cD(_).then(()=>h()?void 0:b()).then(()=>{t?y(E):k()})})};return{promise:a,status:()=>a.status,cancel:l,continue:()=>(r==null||r(),a),cancelRetry:d,continueRetry:f,canStart:g,start:()=>(g()?k():b().then(k),a)}}var to,JS,hN=(JS=class{constructor(){Qe(this,to)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Sy(this.gcTime)&&Ie(this,to,Qs.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vu.isServer()?1/0:300*1e3))}clearGcTimeout(){X(this,to)!==void 0&&(Qs.clearTimeout(X(this,to)),Ie(this,to,void 0))}},to=new WeakMap,JS),no,Al,Fr,ro,On,Pu,io,Sr,pN,sa,eN,yD=(eN=class extends hN{constructor(t){super();Qe(this,Sr);Qe(this,no);Qe(this,Al);Qe(this,Fr);Qe(this,ro);Qe(this,On);Qe(this,Pu);Qe(this,io);Ie(this,io,!1),Ie(this,Pu,t.defaultOptions),this.setOptions(t.options),this.observers=[],Ie(this,ro,t.client),Ie(this,Fr,X(this,ro).getQueryCache()),this.queryKey=t.queryKey,this.queryHash=t.queryHash,Ie(this,no,Q1(this.options)),this.state=t.state??X(this,no),this.scheduleGc()}get meta(){return this.options.meta}get promise(){var t;return(t=X(this,On))==null?void 0:t.promise}setOptions(t){if(this.options={...X(this,Pu),...t},this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const n=Q1(this.options);n.data!==void 0&&(this.setState(Y1(n.data,n.dataUpdatedAt)),Ie(this,no,n))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&X(this,Fr).remove(this)}setData(t,n){const r=_y(this.state.data,t,this.options);return ut(this,Sr,sa).call(this,{data:r,type:"success",dataUpdatedAt:n==null?void 0:n.updatedAt,manual:n==null?void 0:n.manual}),r}setState(t,n){ut(this,Sr,sa).call(this,{type:"setState",state:t,setStateOptions:n})}cancel(t){var r,a;const n=(r=X(this,On))==null?void 0:r.promise;return(a=X(this,On))==null||a.cancel(t),n?n.then(er).catch(er):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return X(this,no)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(t=>qr(t.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===_b||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(t=>bs(t.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(t=>t.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(t=0){return this.state.data===void 0?!0:t==="static"?!1:this.state.isInvalidated?!0:!lN(this.state.dataUpdatedAt,t)}onFocus(){var n;const t=this.observers.find(r=>r.shouldFetchOnWindowFocus());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,On))==null||n.continue()}onOnline(){var n;const t=this.observers.find(r=>r.shouldFetchOnReconnect());t==null||t.refetch({cancelRefetch:!1}),(n=X(this,On))==null||n.continue()}addObserver(t){this.observers.includes(t)||(this.observers.push(t),this.clearGcTimeout(),X(this,Fr).notify({type:"observerAdded",query:this,observer:t}))}removeObserver(t){this.observers.includes(t)&&(this.observers=this.observers.filter(n=>n!==t),this.observers.length||(X(this,On)&&(X(this,io)||ut(this,Sr,pN).call(this)?X(this,On).cancel({revert:!0}):X(this,On).cancelRetry()),this.scheduleGc()),X(this,Fr).notify({type:"observerRemoved",query:this,observer:t}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||ut(this,Sr,sa).call(this,{type:"invalidate"})}async fetch(t,n){var f,h,g,m,y,b,k,v,N,E,C,S;if(this.state.fetchStatus!=="idle"&&((f=X(this,On))==null?void 0:f.status())!=="rejected"){if(this.state.data!==void 0&&(n!=null&&n.cancelRefetch))this.cancel({silent:!0});else if(X(this,On))return X(this,On).continueRetry(),X(this,On).promise}if(t&&this.setOptions(t),!this.options.queryFn){const _=this.observers.find(M=>M.options.queryFn);_&&this.setOptions(_.options)}const r=new AbortController,a=_=>{Object.defineProperty(_,"signal",{enumerable:!0,get:()=>(Ie(this,io,!0),r.signal)})},o=()=>{const _=uN(this.options,n),T=(()=>{const L={client:X(this,ro),queryKey:this.queryKey,meta:this.meta};return a(L),L})();return Ie(this,io,!1),this.options.persister?this.options.persister(_,T,this):_(T)},d=(()=>{const _={fetchOptions:n,options:this.options,queryKey:this.queryKey,client:X(this,ro),state:this.state,fetchFn:o};return a(_),_})();(h=this.options.behavior)==null||h.onFetch(d,this),Ie(this,Al,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((g=d.fetchOptions)==null?void 0:g.meta))&&ut(this,Sr,sa).call(this,{type:"fetch",meta:(m=d.fetchOptions)==null?void 0:m.meta}),Ie(this,On,fN({initialPromise:n==null?void 0:n.initialPromise,fn:d.fetchFn,onCancel:_=>{_ instanceof Cy&&_.revert&&this.setState({...X(this,Al),fetchStatus:"idle"}),r.abort()},onFail:(_,M)=>{ut(this,Sr,sa).call(this,{type:"failed",failureCount:_,error:M})},onPause:()=>{ut(this,Sr,sa).call(this,{type:"pause"})},onContinue:()=>{ut(this,Sr,sa).call(this,{type:"continue"})},retry:d.options.retry,retryDelay:d.options.retryDelay,networkMode:d.options.networkMode,canRun:()=>!0}));try{const _=await X(this,On).start();if(_===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(_),(b=(y=X(this,Fr).config).onSuccess)==null||b.call(y,_,this),(v=(k=X(this,Fr).config).onSettled)==null||v.call(k,_,this.state.error,this),_}catch(_){if(_ instanceof Cy){if(_.silent)return X(this,On).promise;if(_.revert){if(this.state.data===void 0)throw _;return this.state.data}}throw ut(this,Sr,sa).call(this,{type:"error",error:_}),(E=(N=X(this,Fr).config).onError)==null||E.call(N,_,this),(S=(C=X(this,Fr).config).onSettled)==null||S.call(C,this.state.data,_,this),_}finally{this.scheduleGc()}}},no=new WeakMap,Al=new WeakMap,Fr=new WeakMap,ro=new WeakMap,On=new WeakMap,Pu=new WeakMap,io=new WeakMap,Sr=new WeakSet,pN=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},sa=function(t){const n=r=>{switch(t.type){case"failed":return{...r,fetchFailureCount:t.failureCount,fetchFailureReason:t.error};case"pause":return{...r,fetchStatus:"paused"};case"continue":return{...r,fetchStatus:"fetching"};case"fetch":return{...r,...mN(r.data,this.options),fetchMeta:t.meta??null};case"success":const a={...r,...Y1(t.data,t.dataUpdatedAt),dataUpdateCount:r.dataUpdateCount+1,...!t.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return Ie(this,Al,t.manual?a:void 0),a;case"error":const o=t.error;return{...r,error:o,errorUpdateCount:r.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:r.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...r,isInvalidated:!0};case"setState":return{...r,...t.state}}};this.state=n(this.state),An.batch(()=>{this.observers.forEach(r=>{r.onQueryUpdate()}),X(this,Fr).notify({query:this,type:"updated",action:t})})},eN);function mN(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:dN(t.networkMode)?"fetching":"paused",...e===void 0&&{error:null,status:"pending"}}}function Y1(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Q1(e){const t=typeof e.initialData=="function"?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt=="function"?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,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,kt,Bu,Zn,ao,Tl,oa,fs,$u,Ml,Dl,so,oo,hs,Ol,Dt,lu,Ay,Ty,My,Dy,Oy,Ry,Ly,gN,tN,bD=(tN=class extends Yl{constructor(t,n){super();Qe(this,Dt);Qe(this,ur);Qe(this,kt);Qe(this,Bu);Qe(this,Zn);Qe(this,ao);Qe(this,Tl);Qe(this,oa);Qe(this,fs);Qe(this,$u);Qe(this,Ml);Qe(this,Dl);Qe(this,so);Qe(this,oo);Qe(this,hs);Qe(this,Ol,new Set);this.options=n,Ie(this,ur,t),Ie(this,fs,null),Ie(this,oa,jy()),this.bindMethods(),this.setOptions(n)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(X(this,kt).addObserver(this),W1(X(this,kt),this.options)?ut(this,Dt,lu).call(this):this.updateResult(),ut(this,Dt,Dy).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Iy(X(this,kt),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Iy(X(this,kt),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,ut(this,Dt,Oy).call(this),ut(this,Dt,Ry).call(this),X(this,kt).removeObserver(this)}setOptions(t){const n=this.options,r=X(this,kt);if(this.options=X(this,ur).defaultQueryOptions(t),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof qr(this.options.enabled,X(this,kt))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");ut(this,Dt,Ly).call(this),X(this,kt).setOptions(this.options),n._defaulted&&!lh(this.options,n)&&X(this,ur).getQueryCache().notify({type:"observerOptionsUpdated",query:X(this,kt),observer:this});const a=this.hasListeners();a&&X1(X(this,kt),r,this.options,n)&&ut(this,Dt,lu).call(this),this.updateResult(),a&&(X(this,kt)!==r||qr(this.options.enabled,X(this,kt))!==qr(n.enabled,X(this,kt))||bs(this.options.staleTime,X(this,kt))!==bs(n.staleTime,X(this,kt)))&&ut(this,Dt,Ay).call(this);const o=ut(this,Dt,Ty).call(this);a&&(X(this,kt)!==r||qr(this.options.enabled,X(this,kt))!==qr(n.enabled,X(this,kt))||o!==X(this,hs))&&ut(this,Dt,My).call(this,o)}getOptimisticResult(t){const n=X(this,ur).getQueryCache().build(X(this,ur),t),r=this.createResult(n,t);return vD(this,r)&&(Ie(this,Zn,r),Ie(this,Tl,this.options),Ie(this,ao,X(this,kt).state)),r}getCurrentResult(){return X(this,Zn)}trackResult(t,n){return new Proxy(t,{get:(r,a)=>(this.trackProp(a),n==null||n(a),a==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&X(this,oa).status==="pending"&&X(this,oa).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(r,a))})}trackProp(t){X(this,Ol).add(t)}getCurrentQuery(){return X(this,kt)}refetch({...t}={}){return this.fetch({...t})}fetchOptimistic(t){const n=X(this,ur).defaultQueryOptions(t),r=X(this,ur).getQueryCache().build(X(this,ur),n);return r.fetch().then(()=>this.createResult(r,n))}fetch(t){return ut(this,Dt,lu).call(this,{...t,cancelRefetch:t.cancelRefetch??!0}).then(()=>(this.updateResult(),X(this,Zn)))}createResult(t,n){var $;const r=X(this,kt),a=this.options,o=X(this,Zn),l=X(this,ao),d=X(this,Tl),h=t!==r?t.state:X(this,Bu),{state:g}=t;let m={...g},y=!1,b;if(n._optimisticResults){const z=this.hasListeners(),q=!z&&W1(t,n),F=z&&X1(t,r,n,a);(q||F)&&(m={...m,...mN(g.data,t.options)}),n._optimisticResults==="isRestoring"&&(m.fetchStatus="idle")}let{error:k,errorUpdatedAt:v,status:N}=m;b=m.data;let E=!1;if(n.placeholderData!==void 0&&b===void 0&&N==="pending"){let z;o!=null&&o.isPlaceholderData&&n.placeholderData===(d==null?void 0:d.placeholderData)?(z=o.data,E=!0):z=typeof n.placeholderData=="function"?n.placeholderData(($=X(this,Dl))==null?void 0:$.state.data,X(this,Dl)):n.placeholderData,z!==void 0&&(N="success",b=_y(o==null?void 0:o.data,z,n),y=!0)}if(n.select&&b!==void 0&&!E)if(o&&b===(l==null?void 0:l.data)&&n.select===X(this,$u))b=X(this,Ml);else try{Ie(this,$u,n.select),b=n.select(b),b=_y(o==null?void 0:o.data,b,n),Ie(this,Ml,b),Ie(this,fs,null)}catch(z){Ie(this,fs,z)}X(this,fs)&&(k=X(this,fs),b=X(this,Ml),v=Date.now(),N="error");const C=m.fetchStatus==="fetching",S=N==="pending",_=N==="error",M=S&&C,T=b!==void 0,R={status:N,fetchStatus:m.fetchStatus,isPending:S,isSuccess:N==="success",isError:_,isInitialLoading:M,isLoading:M,data:b,dataUpdatedAt:m.dataUpdatedAt,error:k,errorUpdatedAt:v,failureCount:m.fetchFailureCount,failureReason:m.fetchFailureReason,errorUpdateCount:m.errorUpdateCount,isFetched:t.isFetched(),isFetchedAfterMount:m.dataUpdateCount>h.dataUpdateCount||m.errorUpdateCount>h.errorUpdateCount,isFetching:C,isRefetching:C&&!S,isLoadingError:_&&!T,isPaused:m.fetchStatus==="paused",isPlaceholderData:y,isRefetchError:_&&T,isStale:Cb(t,n),refetch:this.refetch,promise:X(this,oa),isEnabled:qr(n.enabled,t)!==!1};if(this.options.experimental_prefetchInRender){const z=R.data!==void 0,q=R.status==="error"&&!z,F=H=>{q?H.reject(R.error):z&&H.resolve(R.data)},Y=()=>{const H=Ie(this,oa,R.promise=jy());F(H)},D=X(this,oa);switch(D.status){case"pending":t.queryHash===r.queryHash&&F(D);break;case"fulfilled":(q||R.data!==D.value)&&Y();break;case"rejected":(!q||R.error!==D.reason)&&Y();break}}return R}updateResult(){const t=X(this,Zn),n=this.createResult(X(this,kt),this.options);if(Ie(this,ao,X(this,kt).state),Ie(this,Tl,this.options),X(this,ao).data!==void 0&&Ie(this,Dl,X(this,kt)),lh(n,t))return;Ie(this,Zn,n);const r=()=>{if(!t)return!0;const{notifyOnChangeProps:a}=this.options,o=typeof a=="function"?a():a;if(o==="all"||!o&&!X(this,Ol).size)return!0;const l=new Set(o??X(this,Ol));return this.options.throwOnError&&l.add("error"),Object.keys(X(this,Zn)).some(d=>{const f=d;return X(this,Zn)[f]!==t[f]&&l.has(f)})};ut(this,Dt,gN).call(this,{listeners:r()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&ut(this,Dt,Dy).call(this)}},ur=new WeakMap,kt=new WeakMap,Bu=new WeakMap,Zn=new WeakMap,ao=new WeakMap,Tl=new WeakMap,oa=new WeakMap,fs=new WeakMap,$u=new WeakMap,Ml=new WeakMap,Dl=new WeakMap,so=new WeakMap,oo=new WeakMap,hs=new WeakMap,Ol=new WeakMap,Dt=new WeakSet,lu=function(t){ut(this,Dt,Ly).call(this);let n=X(this,kt).fetch(this.options,t);return t!=null&&t.throwOnError||(n=n.catch(er)),n},Ay=function(){ut(this,Dt,Oy).call(this);const t=bs(this.options.staleTime,X(this,kt));if(vu.isServer()||X(this,Zn).isStale||!Sy(t))return;const r=lN(X(this,Zn).dataUpdatedAt,t)+1;Ie(this,so,Qs.setTimeout(()=>{X(this,Zn).isStale||this.updateResult()},r))},Ty=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(X(this,kt)):this.options.refetchInterval)??!1},My=function(t){ut(this,Dt,Ry).call(this),Ie(this,hs,t),!(vu.isServer()||qr(this.options.enabled,X(this,kt))===!1||!Sy(X(this,hs))||X(this,hs)===0)&&Ie(this,oo,Qs.setInterval(()=>{(this.options.refetchIntervalInBackground||Sb.isFocused())&&ut(this,Dt,lu).call(this)},X(this,hs)))},Dy=function(){ut(this,Dt,Ay).call(this),ut(this,Dt,My).call(this,ut(this,Dt,Ty).call(this))},Oy=function(){X(this,so)!==void 0&&(Qs.clearTimeout(X(this,so)),Ie(this,so,void 0))},Ry=function(){X(this,oo)!==void 0&&(Qs.clearInterval(X(this,oo)),Ie(this,oo,void 0))},Ly=function(){const t=X(this,ur).getQueryCache().build(X(this,ur),this.options);if(t===X(this,kt))return;const n=X(this,kt);Ie(this,kt,t),Ie(this,Bu,t.state),this.hasListeners()&&(n==null||n.removeObserver(this),t.addObserver(this))},gN=function(t){An.batch(()=>{t.listeners&&this.listeners.forEach(n=>{n(X(this,Zn))}),X(this,ur).getQueryCache().notify({query:X(this,kt),type:"observerResultsUpdated"})})},tN);function xD(e,t){return qr(t.enabled,e)!==!1&&e.state.data===void 0&&!(e.state.status==="error"&&t.retryOnMount===!1)}function W1(e,t){return xD(e,t)||e.state.data!==void 0&&Iy(e,t,t.refetchOnMount)}function Iy(e,t,n){if(qr(t.enabled,e)!==!1&&bs(t.staleTime,e)!=="static"){const r=typeof n=="function"?n(e):n;return r==="always"||r!==!1&&Cb(e,t)}return!1}function X1(e,t,n,r){return(e!==t||qr(r.enabled,e)===!1)&&(!n.suspense||e.state.status!=="error")&&Cb(e,n)}function Cb(e,t){return qr(t.enabled,e)!==!1&&e.isStaleByTime(bs(t.staleTime,e))}function vD(e,t){return!lh(e.getCurrentResult(),t)}function Z1(e){return{onFetch:(t,n)=>{var g,m,y,b,k;const r=t.options,a=(y=(m=(g=t.fetchOptions)==null?void 0:g.meta)==null?void 0:m.fetchMore)==null?void 0:y.direction,o=((b=t.state.data)==null?void 0:b.pages)||[],l=((k=t.state.data)==null?void 0:k.pageParams)||[];let d={pages:[],pageParams:[]},f=0;const h=async()=>{let v=!1;const N=S=>{fD(S,()=>t.signal,()=>v=!0)},E=uN(t.options,t.fetchOptions),C=async(S,_,M)=>{if(v)return Promise.reject();if(_==null&&S.pages.length)return Promise.resolve(S);const L=(()=>{const q={client:t.client,queryKey:t.queryKey,pageParam:_,direction:M?"backward":"forward",meta:t.options.meta};return N(q),q})(),R=await E(L),{maxPages:$}=t.options,z=M?dD:uD;return{pages:z(S.pages,R,$),pageParams:z(S.pageParams,_,$)}};if(a&&o.length){const S=a==="backward",_=S?wD:J1,M={pages:o,pageParams:l},T=_(r,M);d=await C(M,T,S)}else{const S=e??o.length;do{const _=f===0?l[0]??r.initialPageParam:J1(r,d);if(f>0&&_==null)break;d=await C(d,_),f++}while(f<S)}return d};t.options.persister?t.fetchFn=()=>{var v,N;return(N=(v=t.options).persister)==null?void 0:N.call(v,h,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n)}:t.fetchFn=h}}}function J1(e,{pages:t,pageParams:n}){const r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function wD(e,{pages:t,pageParams:n}){var r;return t.length>0?(r=e.getPreviousPageParam)==null?void 0:r.call(e,t[0],t,n[0],n):void 0}var Uu,_i,Kn,lo,ji,ss,nN,kD=(nN=class extends hN{constructor(t){super();Qe(this,ji);Qe(this,Uu);Qe(this,_i);Qe(this,Kn);Qe(this,lo);Ie(this,Uu,t.client),this.mutationId=t.mutationId,Ie(this,Kn,t.mutationCache),Ie(this,_i,[]),this.state=t.state||yN(),this.setOptions(t.options),this.scheduleGc()}setOptions(t){this.options=t,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(t){X(this,_i).includes(t)||(X(this,_i).push(t),this.clearGcTimeout(),X(this,Kn).notify({type:"observerAdded",mutation:this,observer:t}))}removeObserver(t){Ie(this,_i,X(this,_i).filter(n=>n!==t)),this.scheduleGc(),X(this,Kn).notify({type:"observerRemoved",mutation:this,observer:t})}optionalRemove(){X(this,_i).length||(this.state.status==="pending"?this.scheduleGc():X(this,Kn).remove(this))}continue(){var t;return((t=X(this,lo))==null?void 0:t.continue())??this.execute(this.state.variables)}async execute(t){var l,d,f,h,g,m,y,b,k,v,N,E,C,S,_,M,T,L;const n=()=>{ut(this,ji,ss).call(this,{type:"continue"})},r={client:X(this,Uu),meta:this.options.meta,mutationKey:this.options.mutationKey};Ie(this,lo,fN({fn:()=>this.options.mutationFn?this.options.mutationFn(t,r):Promise.reject(new Error("No mutationFn found")),onFail:(R,$)=>{ut(this,ji,ss).call(this,{type:"failed",failureCount:R,error:$})},onPause:()=>{ut(this,ji,ss).call(this,{type:"pause"})},onContinue:n,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>X(this,Kn).canRun(this)}));const a=this.state.status==="pending",o=!X(this,lo).canStart();try{if(a)n();else{ut(this,ji,ss).call(this,{type:"pending",variables:t,isPaused:o}),X(this,Kn).config.onMutate&&await X(this,Kn).config.onMutate(t,this,r);const $=await((d=(l=this.options).onMutate)==null?void 0:d.call(l,t,r));$!==this.state.context&&ut(this,ji,ss).call(this,{type:"pending",context:$,variables:t,isPaused:o})}const R=await X(this,lo).start();return await((h=(f=X(this,Kn).config).onSuccess)==null?void 0:h.call(f,R,t,this.state.context,this,r)),await((m=(g=this.options).onSuccess)==null?void 0:m.call(g,R,t,this.state.context,r)),await((b=(y=X(this,Kn).config).onSettled)==null?void 0:b.call(y,R,null,this.state.variables,this.state.context,this,r)),await((v=(k=this.options).onSettled)==null?void 0:v.call(k,R,null,t,this.state.context,r)),ut(this,ji,ss).call(this,{type:"success",data:R}),R}catch(R){try{await((E=(N=X(this,Kn).config).onError)==null?void 0:E.call(N,R,t,this.state.context,this,r))}catch($){Promise.reject($)}try{await((S=(C=this.options).onError)==null?void 0:S.call(C,R,t,this.state.context,r))}catch($){Promise.reject($)}try{await((M=(_=X(this,Kn).config).onSettled)==null?void 0:M.call(_,void 0,R,this.state.variables,this.state.context,this,r))}catch($){Promise.reject($)}try{await((L=(T=this.options).onSettled)==null?void 0:L.call(T,void 0,R,t,this.state.context,r))}catch($){Promise.reject($)}throw ut(this,ji,ss).call(this,{type:"error",error:R}),R}finally{X(this,Kn).runNext(this)}}},Uu=new WeakMap,_i=new WeakMap,Kn=new WeakMap,lo=new WeakMap,ji=new WeakSet,ss=function(t){const n=r=>{switch(t.type){case"failed":return{...r,failureCount:t.failureCount,failureReason:t.error};case"pause":return{...r,isPaused:!0};case"continue":return{...r,isPaused:!1};case"pending":return{...r,context:t.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:t.isPaused,status:"pending",variables:t.variables,submittedAt:Date.now()};case"success":return{...r,data:t.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...r,data:void 0,error:t.error,failureCount:r.failureCount+1,failureReason:t.error,isPaused:!1,status:"error"}}};this.state=n(this.state),An.batch(()=>{X(this,_i).forEach(r=>{r.onMutationUpdate(t)}),X(this,Kn).notify({mutation:this,type:"updated",action:t})})},nN);function yN(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var la,ai,Fu,rN,ED=(rN=class extends Yl{constructor(t={}){super();Qe(this,la);Qe(this,ai);Qe(this,Fu);this.config=t,Ie(this,la,new Set),Ie(this,ai,new Map),Ie(this,Fu,0)}build(t,n,r){const a=new kD({client:t,mutationCache:this,mutationId:++xf(this,Fu)._,options:t.defaultMutationOptions(n),state:r});return this.add(a),a}add(t){X(this,la).add(t);const n=vf(t);if(typeof n=="string"){const r=X(this,ai).get(n);r?r.push(t):X(this,ai).set(n,[t])}this.notify({type:"added",mutation:t})}remove(t){if(X(this,la).delete(t)){const n=vf(t);if(typeof n=="string"){const r=X(this,ai).get(n);if(r)if(r.length>1){const a=r.indexOf(t);a!==-1&&r.splice(a,1)}else r[0]===t&&X(this,ai).delete(n)}}this.notify({type:"removed",mutation:t})}canRun(t){const n=vf(t);if(typeof n=="string"){const r=X(this,ai).get(n),a=r==null?void 0:r.find(o=>o.state.status==="pending");return!a||a===t}else return!0}runNext(t){var r;const n=vf(t);if(typeof n=="string"){const a=(r=X(this,ai).get(n))==null?void 0:r.find(o=>o!==t&&o.state.isPaused);return(a==null?void 0:a.continue())??Promise.resolve()}else return Promise.resolve()}clear(){An.batch(()=>{X(this,la).forEach(t=>{this.notify({type:"removed",mutation:t})}),X(this,la).clear(),X(this,ai).clear()})}getAll(){return Array.from(X(this,la))}find(t){const n={exact:!0,...t};return this.getAll().find(r=>K1(n,r))}findAll(t={}){return this.getAll().filter(n=>K1(t,n))}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}resumePausedMutations(){const t=this.getAll().filter(n=>n.state.isPaused);return An.batch(()=>Promise.all(t.map(n=>n.continue().catch(er))))}},la=new WeakMap,ai=new WeakMap,Fu=new WeakMap,rN);function vf(e){var t;return(t=e.options.scope)==null?void 0:t.id}var ca,ps,dr,ua,ma,Qf,zy,iN,SD=(iN=class extends Yl{constructor(n,r){super();Qe(this,ma);Qe(this,ca);Qe(this,ps);Qe(this,dr);Qe(this,ua);Ie(this,ca,n),this.setOptions(r),this.bindMethods(),ut(this,ma,Qf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(n){var a;const r=this.options;this.options=X(this,ca).defaultMutationOptions(n),lh(this.options,r)||X(this,ca).getMutationCache().notify({type:"observerOptionsUpdated",mutation:X(this,dr),observer:this}),r!=null&&r.mutationKey&&this.options.mutationKey&&fo(r.mutationKey)!==fo(this.options.mutationKey)?this.reset():((a=X(this,dr))==null?void 0:a.state.status)==="pending"&&X(this,dr).setOptions(this.options)}onUnsubscribe(){var n;this.hasListeners()||(n=X(this,dr))==null||n.removeObserver(this)}onMutationUpdate(n){ut(this,ma,Qf).call(this),ut(this,ma,zy).call(this,n)}getCurrentResult(){return X(this,ps)}reset(){var n;(n=X(this,dr))==null||n.removeObserver(this),Ie(this,dr,void 0),ut(this,ma,Qf).call(this),ut(this,ma,zy).call(this)}mutate(n,r){var a;return Ie(this,ua,r),(a=X(this,dr))==null||a.removeObserver(this),Ie(this,dr,X(this,ca).getMutationCache().build(X(this,ca),this.options)),X(this,dr).addObserver(this),X(this,dr).execute(n)}},ca=new WeakMap,ps=new WeakMap,dr=new WeakMap,ua=new WeakMap,ma=new WeakSet,Qf=function(){var r;const n=((r=X(this,dr))==null?void 0:r.state)??yN();Ie(this,ps,{...n,isPending:n.status==="pending",isSuccess:n.status==="success",isError:n.status==="error",isIdle:n.status==="idle",mutate:this.mutate,reset:this.reset})},zy=function(n){An.batch(()=>{var r,a,o,l,d,f,h,g;if(X(this,ua)&&this.hasListeners()){const m=X(this,ps).variables,y=X(this,ps).context,b={client:X(this,ca),meta:this.options.meta,mutationKey:this.options.mutationKey};if((n==null?void 0:n.type)==="success"){try{(a=(r=X(this,ua)).onSuccess)==null||a.call(r,n.data,m,y,b)}catch(k){Promise.reject(k)}try{(l=(o=X(this,ua)).onSettled)==null||l.call(o,n.data,null,m,y,b)}catch(k){Promise.reject(k)}}else if((n==null?void 0:n.type)==="error"){try{(f=(d=X(this,ua)).onError)==null||f.call(d,n.error,m,y,b)}catch(k){Promise.reject(k)}try{(g=(h=X(this,ua)).onSettled)==null||g.call(h,void 0,n.error,m,y,b)}catch(k){Promise.reject(k)}}}this.listeners.forEach(m=>{m(X(this,ps))})})},iN),Ci,aN,ND=(aN=class extends Yl{constructor(t={}){super();Qe(this,Ci);this.config=t,Ie(this,Ci,new Map)}build(t,n,r){const a=n.queryKey,o=n.queryHash??Nb(a,n);let l=this.get(o);return l||(l=new yD({client:t,queryKey:a,queryHash:o,options:t.defaultQueryOptions(n),state:r,defaultOptions:t.getQueryDefaults(a)}),this.add(l)),l}add(t){X(this,Ci).has(t.queryHash)||(X(this,Ci).set(t.queryHash,t),this.notify({type:"added",query:t}))}remove(t){const n=X(this,Ci).get(t.queryHash);n&&(t.destroy(),n===t&&X(this,Ci).delete(t.queryHash),this.notify({type:"removed",query:t}))}clear(){An.batch(()=>{this.getAll().forEach(t=>{this.remove(t)})})}get(t){return X(this,Ci).get(t)}getAll(){return[...X(this,Ci).values()]}find(t){const n={exact:!0,...t};return this.getAll().find(r=>H1(n,r))}findAll(t={}){const n=this.getAll();return Object.keys(t).length>0?n.filter(r=>H1(t,r)):n}notify(t){An.batch(()=>{this.listeners.forEach(n=>{n(t)})})}onFocus(){An.batch(()=>{this.getAll().forEach(t=>{t.onFocus()})})}onOnline(){An.batch(()=>{this.getAll().forEach(t=>{t.onOnline()})})}},Ci=new WeakMap,aN),mn,ms,gs,Rl,Ll,ys,Il,zl,sN,_D=(sN=class{constructor(e={}){Qe(this,mn);Qe(this,ms);Qe(this,gs);Qe(this,Rl);Qe(this,Ll);Qe(this,ys);Qe(this,Il);Qe(this,zl);Ie(this,mn,e.queryCache||new ND),Ie(this,ms,e.mutationCache||new ED),Ie(this,gs,e.defaultOptions||{}),Ie(this,Rl,new Map),Ie(this,Ll,new Map),Ie(this,ys,0)}mount(){xf(this,ys)._++,X(this,ys)===1&&(Ie(this,Il,Sb.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,mn).onFocus())})),Ie(this,zl,ch.subscribe(async e=>{e&&(await this.resumePausedMutations(),X(this,mn).onOnline())})))}unmount(){var e,t;xf(this,ys)._--,X(this,ys)===0&&((e=X(this,Il))==null||e.call(this),Ie(this,Il,void 0),(t=X(this,zl))==null||t.call(this),Ie(this,zl,void 0))}isFetching(e){return X(this,mn).findAll({...e,fetchStatus:"fetching"}).length}isMutating(e){return X(this,ms).findAll({...e,status:"pending"}).length}getQueryData(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,mn).get(t.queryHash))==null?void 0:n.state.data}ensureQueryData(e){const t=this.defaultQueryOptions(e),n=X(this,mn).build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(bs(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return X(this,mn).findAll(e).map(({queryKey:t,state:n})=>{const r=n.data;return[t,r]})}setQueryData(e,t,n){const r=this.defaultQueryOptions({queryKey:e}),a=X(this,mn).get(r.queryHash),o=a==null?void 0:a.state.data,l=oD(t,o);if(l!==void 0)return X(this,mn).build(this,r).setData(l,{...n,manual:!0})}setQueriesData(e,t,n){return An.batch(()=>X(this,mn).findAll(e).map(({queryKey:r})=>[r,this.setQueryData(r,t,n)]))}getQueryState(e){var n;const t=this.defaultQueryOptions({queryKey:e});return(n=X(this,mn).get(t.queryHash))==null?void 0:n.state}removeQueries(e){const t=X(this,mn);An.batch(()=>{t.findAll(e).forEach(n=>{t.remove(n)})})}resetQueries(e,t){const n=X(this,mn);return An.batch(()=>(n.findAll(e).forEach(r=>{r.reset()}),this.refetchQueries({type:"active",...e},t)))}cancelQueries(e,t={}){const n={revert:!0,...t},r=An.batch(()=>X(this,mn).findAll(e).map(a=>a.cancel(n)));return Promise.all(r).then(er).catch(er)}invalidateQueries(e,t={}){return An.batch(()=>(X(this,mn).findAll(e).forEach(n=>{n.invalidate()}),(e==null?void 0:e.refetchType)==="none"?Promise.resolve():this.refetchQueries({...e,type:(e==null?void 0:e.refetchType)??(e==null?void 0:e.type)??"active"},t)))}refetchQueries(e,t={}){const n={...t,cancelRefetch:t.cancelRefetch??!0},r=An.batch(()=>X(this,mn).findAll(e).filter(a=>!a.isDisabled()&&!a.isStatic()).map(a=>{let o=a.fetch(void 0,n);return n.throwOnError||(o=o.catch(er)),a.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(r).then(er)}fetchQuery(e){const t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);const n=X(this,mn).build(this,t);return n.isStaleByTime(bs(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(er).catch(er)}fetchInfiniteQuery(e){return e.behavior=Z1(e.pages),this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(er).catch(er)}ensureInfiniteQueryData(e){return e.behavior=Z1(e.pages),this.ensureQueryData(e)}resumePausedMutations(){return ch.isOnline()?X(this,ms).resumePausedMutations():Promise.resolve()}getQueryCache(){return X(this,mn)}getMutationCache(){return X(this,ms)}getDefaultOptions(){return X(this,gs)}setDefaultOptions(e){Ie(this,gs,e)}setQueryDefaults(e,t){X(this,Rl).set(fo(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){const t=[...X(this,Rl).values()],n={};return t.forEach(r=>{xu(e,r.queryKey)&&Object.assign(n,r.defaultOptions)}),n}setMutationDefaults(e,t){X(this,Ll).set(fo(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){const t=[...X(this,Ll).values()],n={};return t.forEach(r=>{xu(e,r.mutationKey)&&Object.assign(n,r.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;const t={...X(this,gs).queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||(t.queryHash=Nb(t.queryKey,t)),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!=="always"),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode="offlineFirst"),t.queryFn===_b&&(t.enabled=!1),t}defaultMutationOptions(e){return e!=null&&e._defaulted?e:{...X(this,gs).mutations,...(e==null?void 0:e.mutationKey)&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){X(this,mn).clear(),X(this,ms).clear()}},mn=new WeakMap,ms=new WeakMap,gs=new WeakMap,Rl=new WeakMap,Ll=new WeakMap,ys=new WeakMap,Il=new WeakMap,zl=new WeakMap,sN),bN=j.createContext(void 0),Gt=e=>{const t=j.useContext(bN);if(!t)throw new Error("No QueryClient set, use QueryClientProvider to set one");return t},jD=({client:e,children:t})=>(j.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),c.jsx(bN.Provider,{value:e,children:t})),xN=j.createContext(!1),CD=()=>j.useContext(xN);xN.Provider;function AD(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var TD=j.createContext(AD()),MD=()=>j.useContext(TD),DD=(e,t,n)=>{const r=n!=null&&n.state.error&&typeof e.throwOnError=="function"?jb(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},OD=e=>{j.useEffect(()=>{e.clearReset()},[e])},RD=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:a})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(a&&e.data===void 0||jb(n,[e.error,r])),LD=e=>{if(e.suspense){const n=a=>a==="static"?a:Math.max(a??1e3,1e3),r=e.staleTime;e.staleTime=typeof r=="function"?(...a)=>n(r(...a)):n(r),typeof e.gcTime=="number"&&(e.gcTime=Math.max(e.gcTime,1e3))}},ID=(e,t)=>e.isLoading&&e.isFetching&&!t,zD=(e,t)=>(e==null?void 0:e.suspense)&&t.isPending,ek=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function PD(e,t,n){var y,b,k,v;const r=CD(),a=MD(),o=Gt(),l=o.defaultQueryOptions(e);(b=(y=o.getDefaultOptions().queries)==null?void 0:y._experimental_beforeQuery)==null||b.call(y,l);const d=o.getQueryCache().get(l.queryHash);l._optimisticResults=r?"isRestoring":"optimistic",LD(l),DD(l,a,d),OD(a);const f=!o.getQueryCache().get(l.queryHash),[h]=j.useState(()=>new t(o,l)),g=h.getOptimisticResult(l),m=!r&&e.subscribed!==!1;if(j.useSyncExternalStore(j.useCallback(N=>{const E=m?h.subscribe(An.batchCalls(N)):er;return h.updateResult(),E},[h,m]),()=>h.getCurrentResult(),()=>h.getCurrentResult()),j.useEffect(()=>{h.setOptions(l)},[l,h]),zD(l,g))throw ek(l,h,a);if(RD({result:g,errorResetBoundary:a,throwOnError:l.throwOnError,query:d,suspense:l.suspense}))throw g.error;if((v=(k=o.getDefaultOptions().queries)==null?void 0:k._experimental_afterQuery)==null||v.call(k,l,g),l.experimental_prefetchInRender&&!vu.isServer()&&ID(g,r)){const N=f?ek(l,h,a):d==null?void 0:d.promise;N==null||N.catch(er).finally(()=>{h.updateResult()})}return l.notifyOnChangeProps?g:h.trackResult(g)}function Ye(e,t){return PD(e,bD)}function Ct(e,t){const n=Gt(),[r]=j.useState(()=>new SD(n,e));j.useEffect(()=>{r.setOptions(e)},[r,e]);const a=j.useSyncExternalStore(j.useCallback(l=>r.subscribe(An.batchCalls(l)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),o=j.useCallback((l,d)=>{r.mutate(l,d).catch(er)},[r]);if(a.error&&jb(r.options.throwOnError,[a.error]))throw a.error;return{...a,mutate:o,mutateAsync:a.mutate}}/**
|
|
50
|
-
* react-router v7.14.2
|
|
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 tk="popstate";function nk(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function BD(e={}){function t(r,a){var h;let o=(h=a.state)==null?void 0:h.masked,{pathname:l,search:d,hash:f}=o||r.location;return Py("",{pathname:l,search:d,hash:f},a.state&&a.state.usr||null,a.state&&a.state.key||"default",o?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function n(r,a){return typeof a=="string"?a:wu(a)}return UD(t,n,null,e)}function Jt(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function Gr(e,t){if(!e){typeof console<"u"&&console.warn(t);try{throw new Error(t)}catch{}}}function $D(){return Math.random().toString(36).substring(2,10)}function rk(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.unstable_mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Py(e,t,n=null,r,a){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof t=="string"?Ql(t):t,state:n,key:t&&t.key||r||$D(),unstable_mask:a}}function wu({pathname:e="/",search:t="",hash:n=""}){return t&&t!=="?"&&(e+=t.charAt(0)==="?"?t:"?"+t),n&&n!=="#"&&(e+=n.charAt(0)==="#"?n:"#"+n),e}function Ql(e){let t={};if(e){let n=e.indexOf("#");n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf("?");r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function UD(e,t,n,r={}){let{window:a=document.defaultView,v5Compat:o=!1}=r,l=a.history,d="POP",f=null,h=g();h==null&&(h=0,l.replaceState({...l.state,idx:h},""));function g(){return(l.state||{idx:null}).idx}function m(){d="POP";let N=g(),E=N==null?null:N-h;h=N,f&&f({action:d,location:v.location,delta:E})}function y(N,E){d="PUSH";let C=nk(N)?N:Py(v.location,N,E);h=g()+1;let S=rk(C,h),_=v.createHref(C.unstable_mask||C);try{l.pushState(S,"",_)}catch(M){if(M instanceof DOMException&&M.name==="DataCloneError")throw M;a.location.assign(_)}o&&f&&f({action:d,location:v.location,delta:1})}function b(N,E){d="REPLACE";let C=nk(N)?N:Py(v.location,N,E);h=g();let S=rk(C,h),_=v.createHref(C.unstable_mask||C);l.replaceState(S,"",_),o&&f&&f({action:d,location:v.location,delta:0})}function k(N){return FD(N)}let v={get action(){return d},get location(){return e(a,l)},listen(N){if(f)throw new Error("A history only accepts one active listener");return a.addEventListener(tk,m),f=N,()=>{a.removeEventListener(tk,m),f=null}},createHref(N){return t(a,N)},createURL:k,encodeLocation(N){let E=k(N);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:y,replace:b,go(N){return l.go(N)}};return v}function FD(e,t=!1){let n="http://localhost";typeof window<"u"&&(n=window.location.origin!=="null"?window.location.origin:window.location.href),Jt(n,"No window.location.(origin|href) available to create URL");let r=typeof e=="string"?e:wu(e);return r=r.replace(/ $/,"%20"),!t&&r.startsWith("//")&&(r=n+r),new URL(r,n)}function vN(e,t,n="/"){return qD(e,t,n,!1)}function qD(e,t,n,r){let a=typeof t=="string"?Ql(t):t,o=ga(a.pathname||"/",n);if(o==null)return null;let l=wN(e);HD(l);let d=null;for(let f=0;d==null&&f<l.length;++f){let h=tO(o);d=JD(l[f],h,r)}return d}function wN(e,t=[],n=[],r="",a=!1){let o=(l,d,f=a,h)=>{let g={relativePath:h===void 0?l.path||"":h,caseSensitive:l.caseSensitive===!0,childrenIndex:d,route:l};if(g.relativePath.startsWith("/")){if(!g.relativePath.startsWith(r)&&f)return;Jt(g.relativePath.startsWith(r),`Absolute route path "${g.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),g.relativePath=g.relativePath.slice(r.length)}let m=ui([r,g.relativePath]),y=n.concat(g);l.children&&l.children.length>0&&(Jt(l.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${m}".`),wN(l.children,t,y,m,f)),!(l.path==null&&!l.index)&&t.push({path:m,score:XD(m,l.index),routesMeta:y})};return e.forEach((l,d)=>{var f;if(l.path===""||!((f=l.path)!=null&&f.includes("?")))o(l,d);else for(let h of kN(l.path))o(l,d,!0,h)}),t}function kN(e){let t=e.split("/");if(t.length===0)return[];let[n,...r]=t,a=n.endsWith("?"),o=n.replace(/\?$/,"");if(r.length===0)return a?[o,""]:[o];let l=kN(r.join("/")),d=[];return d.push(...l.map(f=>f===""?o:[o,f].join("/"))),a&&d.push(...l),d.map(f=>e.startsWith("/")&&f===""?"/":f)}function HD(e){e.sort((t,n)=>t.score!==n.score?n.score-t.score:ZD(t.routesMeta.map(r=>r.childrenIndex),n.routesMeta.map(r=>r.childrenIndex)))}var KD=/^:[\w-]+$/,GD=3,VD=2,YD=1,QD=10,WD=-2,ik=e=>e==="*";function XD(e,t){let n=e.split("/"),r=n.length;return n.some(ik)&&(r+=WD),t&&(r+=VD),n.filter(a=>!ik(a)).reduce((a,o)=>a+(KD.test(o)?GD:o===""?YD:QD),r)}function ZD(e,t){return e.length===t.length&&e.slice(0,-1).every((r,a)=>r===t[a])?e[e.length-1]-t[t.length-1]:0}function JD(e,t,n=!1){let{routesMeta:r}=e,a={},o="/",l=[];for(let d=0;d<r.length;++d){let f=r[d],h=d===r.length-1,g=o==="/"?t:t.slice(o.length)||"/",m=uh({path:f.relativePath,caseSensitive:f.caseSensitive,end:h},g),y=f.route;if(!m&&h&&n&&!r[r.length-1].route.index&&(m=uh({path:f.relativePath,caseSensitive:f.caseSensitive,end:!1},g)),!m)return null;Object.assign(a,m.params),l.push({params:a,pathname:ui([o,m.pathname]),pathnameBase:aO(ui([o,m.pathnameBase])),route:y}),m.pathnameBase!=="/"&&(o=ui([o,m.pathnameBase]))}return l}function uh(e,t){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=eO(e.path,e.caseSensitive,e.end),a=t.match(n);if(!a)return null;let o=a[0],l=o.replace(/(.)\/+$/,"$1"),d=a.slice(1);return{params:r.reduce((h,{paramName:g,isOptional:m},y)=>{if(g==="*"){let k=d[y]||"";l=o.slice(0,o.length-k.length).replace(/(.)\/+$/,"$1")}const b=d[y];return m&&!b?h[g]=void 0:h[g]=(b||"").replace(/%2F/g,"/"),h},{}),pathname:o,pathnameBase:l,pattern:e}}function eO(e,t=!1,n=!0){Gr(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],a="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(l,d,f,h,g)=>{if(r.push({paramName:d,isOptional:f!=null}),f){let m=g.charAt(h+l.length);return m&&m!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),a+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):n?a+="\\/*$":e!==""&&e!=="/"&&(a+="(?:(?=\\/|$))"),[new RegExp(a,t?void 0:"i"),r]}function tO(e){try{return e.split("/").map(t=>decodeURIComponent(t).replace(/\//g,"%2F")).join("/")}catch(t){return Gr(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function ga(e,t){if(t==="/")return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith("/")?t.length-1:t.length,r=e.charAt(n);return r&&r!=="/"?null:e.slice(n)||"/"}var nO=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function rO(e,t="/"){let{pathname:n,search:r="",hash:a=""}=typeof e=="string"?Ql(e):e,o;return n?(n=EN(n),n.startsWith("/")?o=ak(n.substring(1),"/"):o=ak(n,t)):o=t,{pathname:o,search:sO(r),hash:oO(a)}}function ak(e,t){let n=dh(t).split("/");return e.split("/").forEach(a=>{a===".."?n.length>1&&n.pop():a!=="."&&n.push(a)}),n.length>1?n.join("/"):"/"}function Ag(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` 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 iO(e){return e.filter((t,n)=>n===0||t.route.path&&t.route.path.length>0)}function Ab(e){let t=iO(e);return t.map((n,r)=>r===t.length-1?n.pathname:n.pathnameBase)}function zh(e,t,n,r=!1){let a;typeof e=="string"?a=Ql(e):(a={...e},Jt(!a.pathname||!a.pathname.includes("?"),Ag("?","pathname","search",a)),Jt(!a.pathname||!a.pathname.includes("#"),Ag("#","pathname","hash",a)),Jt(!a.search||!a.search.includes("#"),Ag("#","search","hash",a)));let o=e===""||a.pathname==="",l=o?"/":a.pathname,d;if(l==null)d=n;else{let m=t.length-1;if(!r&&l.startsWith("..")){let y=l.split("/");for(;y[0]==="..";)y.shift(),m-=1;a.pathname=y.join("/")}d=m>=0?t[m]:"/"}let f=rO(a,d),h=l&&l!=="/"&&l.endsWith("/"),g=(o||l===".")&&n.endsWith("/");return!f.pathname.endsWith("/")&&(h||g)&&(f.pathname+="/"),f}var EN=e=>e.replace(/\/\/+/g,"/"),ui=e=>EN(e.join("/")),dh=e=>e.replace(/\/+$/,""),aO=e=>dh(e).replace(/^\/*/,"/"),sO=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,oO=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,lO=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||"",this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function cO(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function uO(e){let t=e.map(n=>n.route.path).filter(Boolean);return ui(t)||"/"}var SN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function NN(e,t){let n=e;if(typeof n!="string"||!nO.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,a=!1;if(SN)try{let o=new URL(window.location.href),l=n.startsWith("//")?new URL(o.protocol+n):new URL(n),d=ga(l.pathname,t);l.origin===o.origin&&d!=null?n=d+l.search+l.hash:a=!0}catch{Gr(!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:a,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var _N=["POST","PUT","PATCH","DELETE"];new Set(_N);var dO=["GET",..._N];new Set(dO);var Wl=j.createContext(null);Wl.displayName="DataRouter";var Ph=j.createContext(null);Ph.displayName="DataRouterState";var jN=j.createContext(!1);function fO(){return j.useContext(jN)}var CN=j.createContext({isTransitioning:!1});CN.displayName="ViewTransition";var hO=j.createContext(new Map);hO.displayName="Fetchers";var pO=j.createContext(null);pO.displayName="Await";var Ar=j.createContext(null);Ar.displayName="Navigation";var Ku=j.createContext(null);Ku.displayName="Location";var Yr=j.createContext({outlet:null,matches:[],isDataRoute:!1});Yr.displayName="Route";var Tb=j.createContext(null);Tb.displayName="RouteError";var AN="REACT_ROUTER_ERROR",mO="REDIRECT",gO="ROUTE_ERROR_RESPONSE";function yO(e){if(e.startsWith(`${AN}:${mO}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.location=="string"&&typeof t.reloadDocument=="boolean"&&typeof t.replace=="boolean")return t}catch{}}function bO(e){if(e.startsWith(`${AN}:${gO}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t=="object"&&t&&typeof t.status=="number"&&typeof t.statusText=="string")return new lO(t.status,t.statusText,t.data)}catch{}}function xO(e,{relative:t}={}){Jt(Xl(),"useHref() may be used only in the context of a <Router> component.");let{basename:n,navigator:r}=j.useContext(Ar),{hash:a,pathname:o,search:l}=Gu(e,{relative:t}),d=o;return n!=="/"&&(d=o==="/"?n:ui([n,o])),r.createHref({pathname:d,search:l,hash:a})}function Xl(){return j.useContext(Ku)!=null}function pi(){return Jt(Xl(),"useLocation() may be used only in the context of a <Router> component."),j.useContext(Ku).location}var TN="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function MN(e){j.useContext(Ar).static||j.useLayoutEffect(e)}function ks(){let{isDataRoute:e}=j.useContext(Yr);return e?RO():vO()}function vO(){Jt(Xl(),"useNavigate() may be used only in the context of a <Router> component.");let e=j.useContext(Wl),{basename:t,navigator:n}=j.useContext(Ar),{matches:r}=j.useContext(Yr),{pathname:a}=pi(),o=JSON.stringify(Ab(r)),l=j.useRef(!1);return MN(()=>{l.current=!0}),j.useCallback((f,h={})=>{if(Gr(l.current,TN),!l.current)return;if(typeof f=="number"){n.go(f);return}let g=zh(f,JSON.parse(o),a,h.relative==="path");e==null&&t!=="/"&&(g.pathname=g.pathname==="/"?t:ui([t,g.pathname])),(h.replace?n.replace:n.push)(g,h.state,h)},[t,n,o,a,e])}var wO=j.createContext(null);function kO(e){let t=j.useContext(Yr).outlet;return j.useMemo(()=>t&&j.createElement(wO.Provider,{value:e},t),[t,e])}function Mb(){let{matches:e}=j.useContext(Yr),t=e[e.length-1];return(t==null?void 0:t.params)??{}}function Gu(e,{relative:t}={}){let{matches:n}=j.useContext(Yr),{pathname:r}=pi(),a=JSON.stringify(Ab(n));return j.useMemo(()=>zh(e,JSON.parse(a),r,t==="path"),[e,a,r,t])}function EO(e,t){return DN(e,t)}function DN(e,t,n){var N;Jt(Xl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=j.useContext(Ar),{matches:a}=j.useContext(Yr),o=a[a.length-1],l=o?o.params:{},d=o?o.pathname:"/",f=o?o.pathnameBase:"/",h=o&&o.route;{let E=h&&h.path||"";RN(d,!h||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${E}">) 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="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let g=pi(),m;if(t){let E=typeof t=="string"?Ql(t):t;Jt(f==="/"||((N=E.pathname)==null?void 0:N.startsWith(f)),`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 "${f}" but pathname "${E.pathname}" was given in the \`location\` prop.`),m=E}else m=g;let y=m.pathname||"/",b=y;if(f!=="/"){let E=f.replace(/^\//,"").split("/");b="/"+y.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=vN(e,{pathname:b});Gr(h||k!=null,`No routes matched location "${m.pathname}${m.search}${m.hash}" `),Gr(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.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 v=CO(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},l,E.params),pathname:ui([f,r.encodeLocation?r.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?f:ui([f,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),a,n);return t&&v?j.createElement(Ku.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",unstable_mask:void 0,...m},navigationType:"POP"}},v):v}function SO(){let e=OO(),t=cO(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",a={padding:"0.5rem",backgroundColor:r},o={padding:"2px 4px",backgroundColor:r},l=null;return console.error("Error handled by React Router default ErrorBoundary:",e),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:o},"ErrorBoundary")," or"," ",j.createElement("code",{style:o},"errorElement")," prop on your route.")),j.createElement(j.Fragment,null,j.createElement("h2",null,"Unexpected Application Error!"),j.createElement("h3",{style:{fontStyle:"italic"}},t),n?j.createElement("pre",{style:a},n):null,l)}var NO=j.createElement(SO,null),ON=class extends j.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:t.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const n=bO(e.digest);n&&(e=n)}let t=e!==void 0?j.createElement(Yr.Provider,{value:this.props.routeContext},j.createElement(Tb.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?j.createElement(_O,{error:e},t):t}};ON.contextType=jN;var Tg=new WeakMap;function _O({children:e,error:t}){let{basename:n}=j.useContext(Ar);if(typeof t=="object"&&t&&"digest"in t&&typeof t.digest=="string"){let r=yO(t.digest);if(r){let a=Tg.get(t);if(a)throw a;let o=NN(r.location,n);if(SN&&!Tg.get(t))if(o.isExternal||r.reloadDocument)window.location.href=o.absoluteURL||o.to;else{const l=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:r.replace}));throw Tg.set(t,l),l}return j.createElement("meta",{httpEquiv:"refresh",content:`0;url=${o.absoluteURL||o.to}`})}}return e}function jO({routeContext:e,match:t,children:n}){let r=j.useContext(Wl);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),j.createElement(Yr.Provider,{value:e},n)}function CO(e,t=[],n){let r=n==null?void 0:n.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let a=e,o=r==null?void 0:r.errors;if(o!=null){let g=a.findIndex(m=>m.route.id&&(o==null?void 0:o[m.route.id])!==void 0);Jt(g>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),a=a.slice(0,Math.min(a.length,g+1))}let l=!1,d=-1;if(n&&r){l=r.renderFallback;for(let g=0;g<a.length;g++){let m=a[g];if((m.route.HydrateFallback||m.route.hydrateFallbackElement)&&(d=g),m.route.id){let{loaderData:y,errors:b}=r,k=m.route.loader&&!y.hasOwnProperty(m.route.id)&&(!b||b[m.route.id]===void 0);if(m.route.lazy||k){n.isStatic&&(l=!0),d>=0?a=a.slice(0,d+1):a=[a[0]];break}}}}let f=n==null?void 0:n.onError,h=r&&f?(g,m)=>{var y,b;f(g,{location:r.location,params:((b=(y=r.matches)==null?void 0:y[0])==null?void 0:b.params)??{},unstable_pattern:uO(r.matches),errorInfo:m})}:void 0;return a.reduceRight((g,m,y)=>{let b,k=!1,v=null,N=null;r&&(b=o&&m.route.id?o[m.route.id]:void 0,v=m.route.errorElement||NO,l&&(d<0&&y===0?(RN("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,N=null):d===y&&(k=!0,N=m.route.hydrateFallbackElement||null)));let E=t.concat(a.slice(0,y+1)),C=()=>{let S;return b?S=v:k?S=N:m.route.Component?S=j.createElement(m.route.Component,null):m.route.element?S=m.route.element:S=g,j.createElement(jO,{match:m,routeContext:{outlet:g,matches:E,isDataRoute:r!=null},children:S})};return r&&(m.route.ErrorBoundary||m.route.errorElement||y===0)?j.createElement(ON,{location:r.location,revalidation:r.revalidation,component:v,error:b,children:C(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:h}):C()},null)}function Db(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function AO(e){let t=j.useContext(Wl);return Jt(t,Db(e)),t}function TO(e){let t=j.useContext(Ph);return Jt(t,Db(e)),t}function MO(e){let t=j.useContext(Yr);return Jt(t,Db(e)),t}function Ob(e){let t=MO(e),n=t.matches[t.matches.length-1];return Jt(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function DO(){return Ob("useRouteId")}function OO(){var r;let e=j.useContext(Tb),t=TO("useRouteError"),n=Ob("useRouteError");return e!==void 0?e:(r=t.errors)==null?void 0:r[n]}function RO(){let{router:e}=AO("useNavigate"),t=Ob("useNavigate"),n=j.useRef(!1);return MN(()=>{n.current=!0}),j.useCallback(async(a,o={})=>{Gr(n.current,TN),n.current&&(typeof a=="number"?await e.navigate(a):await e.navigate(a,{fromRouteId:t,...o}))},[e,t])}var sk={};function RN(e,t,n){!t&&!sk[e]&&(sk[e]=!0,Gr(!1,n))}j.memo(LO);function LO({routes:e,future:t,state:n,isStatic:r,onError:a}){return DN(e,void 0,{state:n,isStatic:r,onError:a})}function IO({to:e,replace:t,state:n,relative:r}){Jt(Xl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:a}=j.useContext(Ar);Gr(!a,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:o}=j.useContext(Yr),{pathname:l}=pi(),d=ks(),f=zh(e,Ab(o),l,r==="path"),h=JSON.stringify(f);return j.useEffect(()=>{d(JSON.parse(h),{replace:t,state:n,relative:r})},[d,h,r,t,n]),null}function zO(e){return kO(e.context)}function Cn(e){Jt(!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 PO({basename:e="/",children:t=null,location:n,navigationType:r="POP",navigator:a,static:o=!1,unstable_useTransitions:l}){Jt(!Xl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),f=j.useMemo(()=>({basename:d,navigator:a,static:o,unstable_useTransitions:l,future:{}}),[d,a,o,l]);typeof n=="string"&&(n=Ql(n));let{pathname:h="/",search:g="",hash:m="",state:y=null,key:b="default",unstable_mask:k}=n,v=j.useMemo(()=>{let N=ga(h,d);return N==null?null:{location:{pathname:N,search:g,hash:m,state:y,key:b,unstable_mask:k},navigationType:r}},[d,h,g,m,y,b,r,k]);return Gr(v!=null,`<Router basename="${d}"> is not able to match the URL "${h}${g}${m}" because it does not start with the basename, so the <Router> won't render anything.`),v==null?null:j.createElement(Ar.Provider,{value:f},j.createElement(Ku.Provider,{children:t,value:v}))}function BO({children:e,location:t}){return EO(By(e),t)}function By(e,t=[]){let n=[];return j.Children.forEach(e,(r,a)=>{if(!j.isValidElement(r))return;let o=[...t,a];if(r.type===j.Fragment){n.push.apply(n,By(r.props.children,o));return}Jt(r.type===Cn,`[${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>`),Jt(!r.props.index||!r.props.children,"An index route cannot have child routes.");let l={id:r.props.id||o.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=By(r.props.children,o)),n.push(l)}),n}var Wf="get",Xf="application/x-www-form-urlencoded";function Bh(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function $O(e){return Bh(e)&&e.tagName.toLowerCase()==="button"}function UO(e){return Bh(e)&&e.tagName.toLowerCase()==="form"}function FO(e){return Bh(e)&&e.tagName.toLowerCase()==="input"}function qO(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function HO(e,t){return e.button===0&&(!t||t==="_self")&&!qO(e)}function $y(e=""){return new URLSearchParams(typeof e=="string"||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(a=>[n,a]):[[n,r]])},[]))}function KO(e,t){let n=$y(e);return t&&t.forEach((r,a)=>{n.has(a)||t.getAll(a).forEach(o=>{n.append(a,o)})}),n}var wf=null;function GO(){if(wf===null)try{new FormData(document.createElement("form"),0),wf=!1}catch{wf=!0}return wf}var VO=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Mg(e){return e!=null&&!VO.has(e)?(Gr(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Xf}"`),null):e}function YO(e,t){let n,r,a,o,l;if(UO(e)){let d=e.getAttribute("action");r=d?ga(d,t):null,n=e.getAttribute("method")||Wf,a=Mg(e.getAttribute("enctype"))||Xf,o=new FormData(e)}else if($O(e)||FO(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let f=e.getAttribute("formaction")||d.getAttribute("action");if(r=f?ga(f,t):null,n=e.getAttribute("formmethod")||d.getAttribute("method")||Wf,a=Mg(e.getAttribute("formenctype"))||Mg(d.getAttribute("enctype"))||Xf,o=new FormData(d,e),!GO()){let{name:h,type:g,value:m}=e;if(g==="image"){let y=h?`${h}.`:"";o.append(`${y}x`,"0"),o.append(`${y}y`,"0")}else h&&o.append(h,m)}}else{if(Bh(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');n=Wf,r=null,a=Xf,l=e}return o&&a==="text/plain"&&(l=o,o=void 0),{action:r,method:n.toLowerCase(),encType:a,formData:o,body:l}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Rb(e,t){if(e===!1||e===null||typeof e>"u")throw new Error(t)}function LN(e,t,n,r){let a=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return n?a.pathname.endsWith("/")?a.pathname=`${a.pathname}_.${r}`:a.pathname=`${a.pathname}.${r}`:a.pathname==="/"?a.pathname=`_root.${r}`:t&&ga(a.pathname,t)==="/"?a.pathname=`${dh(t)}/_root.${r}`:a.pathname=`${dh(a.pathname)}.${r}`,a}async function QO(e,t){if(e.id in t)return t[e.id];try{let n=await import(e.module);return t[e.id]=n,n}catch(n){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(n),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function WO(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function XO(e,t,n){let r=await Promise.all(e.map(async a=>{let o=t.routes[a.route.id];if(o){let l=await QO(o,n);return l.links?l.links():[]}return[]}));return tR(r.flat(1).filter(WO).filter(a=>a.rel==="stylesheet"||a.rel==="preload").map(a=>a.rel==="stylesheet"?{...a,rel:"prefetch",as:"style"}:{...a,rel:"prefetch"}))}function ok(e,t,n,r,a,o){let l=(f,h)=>n[h]?f.route.id!==n[h].route.id:!0,d=(f,h)=>{var g;return n[h].pathname!==f.pathname||((g=n[h].route.path)==null?void 0:g.endsWith("*"))&&n[h].params["*"]!==f.params["*"]};return o==="assets"?t.filter((f,h)=>l(f,h)||d(f,h)):o==="data"?t.filter((f,h)=>{var m;let g=r.routes[f.route.id];if(!g||!g.hasLoader)return!1;if(l(f,h)||d(f,h))return!0;if(f.route.shouldRevalidate){let y=f.route.shouldRevalidate({currentUrl:new URL(a.pathname+a.search+a.hash,window.origin),currentParams:((m=n[0])==null?void 0:m.params)||{},nextUrl:new URL(e,window.origin),nextParams:f.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function ZO(e,t,{includeHydrateFallback:n}={}){return JO(e.map(r=>{let a=t.routes[r.route.id];if(!a)return[];let o=[a.module];return a.clientActionModule&&(o=o.concat(a.clientActionModule)),a.clientLoaderModule&&(o=o.concat(a.clientLoaderModule)),n&&a.hydrateFallbackModule&&(o=o.concat(a.hydrateFallbackModule)),a.imports&&(o=o.concat(a.imports)),o}).flat(1))}function JO(e){return[...new Set(e)]}function eR(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function tR(e,t){let n=new Set;return new Set(t),e.reduce((r,a)=>{let o=JSON.stringify(eR(a));return n.has(o)||(n.add(o),r.push({key:o,link:a})),r},[])}function Lb(){let e=j.useContext(Wl);return Rb(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function nR(){let e=j.useContext(Ph);return Rb(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var Ib=j.createContext(void 0);Ib.displayName="FrameworkContext";function zb(){let e=j.useContext(Ib);return Rb(e,"You must render this element inside a <HydratedRouter> element"),e}function rR(e,t){let n=j.useContext(Ib),[r,a]=j.useState(!1),[o,l]=j.useState(!1),{onFocus:d,onBlur:f,onMouseEnter:h,onMouseLeave:g,onTouchStart:m}=t,y=j.useRef(null);j.useEffect(()=>{if(e==="render"&&l(!0),e==="viewport"){let v=E=>{E.forEach(C=>{l(C.isIntersecting)})},N=new IntersectionObserver(v,{threshold:.5});return y.current&&N.observe(y.current),()=>{N.disconnect()}}},[e]),j.useEffect(()=>{if(r){let v=setTimeout(()=>{l(!0)},100);return()=>{clearTimeout(v)}}},[r]);let b=()=>{a(!0)},k=()=>{a(!1),l(!1)};return n?e!=="intent"?[o,y,{}]:[o,y,{onFocus:Jc(d,b),onBlur:Jc(f,k),onMouseEnter:Jc(h,b),onMouseLeave:Jc(g,k),onTouchStart:Jc(m,b)}]:[!1,y,{}]}function Jc(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function iR({page:e,...t}){let n=fO(),{router:r}=Lb(),a=j.useMemo(()=>vN(r.routes,e,r.basename),[r.routes,e,r.basename]);return a?n?j.createElement(sR,{page:e,matches:a,...t}):j.createElement(oR,{page:e,matches:a,...t}):null}function aR(e){let{manifest:t,routeModules:n}=zb(),[r,a]=j.useState([]);return j.useEffect(()=>{let o=!1;return XO(e,t,n).then(l=>{o||a(l)}),()=>{o=!0}},[e,t,n]),r}function sR({page:e,matches:t,...n}){let r=pi(),{future:a}=zb(),{basename:o}=Lb(),l=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let d=LN(e,o,a.unstable_trailingSlashAwareDataRequests,"rsc"),f=!1,h=[];for(let g of t)typeof g.route.shouldRevalidate=="function"?f=!0:h.push(g.route.id);return f&&h.length>0&&d.searchParams.set("_routes",h.join(",")),[d.pathname+d.search]},[o,a.unstable_trailingSlashAwareDataRequests,e,r,t]);return j.createElement(j.Fragment,null,l.map(d=>j.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...n})))}function oR({page:e,matches:t,...n}){let r=pi(),{future:a,manifest:o,routeModules:l}=zb(),{basename:d}=Lb(),{loaderData:f,matches:h}=nR(),g=j.useMemo(()=>ok(e,t,h,o,r,"data"),[e,t,h,o,r]),m=j.useMemo(()=>ok(e,t,h,o,r,"assets"),[e,t,h,o,r]),y=j.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let v=new Set,N=!1;if(t.forEach(C=>{var _;let S=o.routes[C.route.id];!S||!S.hasLoader||(!g.some(M=>M.route.id===C.route.id)&&C.route.id in f&&((_=l[C.route.id])!=null&&_.shouldRevalidate)||S.hasClientLoader?N=!0:v.add(C.route.id))}),v.size===0)return[];let E=LN(e,d,a.unstable_trailingSlashAwareDataRequests,"data");return N&&v.size>0&&E.searchParams.set("_routes",t.filter(C=>v.has(C.route.id)).map(C=>C.route.id).join(",")),[E.pathname+E.search]},[d,a.unstable_trailingSlashAwareDataRequests,f,r,o,g,t,e,l]),b=j.useMemo(()=>ZO(m,o),[m,o]),k=aR(m);return j.createElement(j.Fragment,null,y.map(v=>j.createElement("link",{key:v,rel:"prefetch",as:"fetch",href:v,...n})),b.map(v=>j.createElement("link",{key:v,rel:"modulepreload",href:v,...n})),k.map(({key:v,link:N})=>j.createElement("link",{key:v,nonce:n.nonce,...N,crossOrigin:N.crossOrigin??n.crossOrigin})))}function lR(...e){return t=>{e.forEach(n=>{typeof n=="function"?n(t):n!=null&&(n.current=t)})}}var cR=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{cR&&(window.__reactRouterVersion="7.14.2")}catch{}function uR({basename:e,children:t,unstable_useTransitions:n,window:r}){let a=j.useRef();a.current==null&&(a.current=BD({window:r,v5Compat:!0}));let o=a.current,[l,d]=j.useState({action:o.action,location:o.location}),f=j.useCallback(h=>{n===!1?d(h):j.startTransition(()=>d(h))},[n]);return j.useLayoutEffect(()=>o.listen(f),[o,f]),j.createElement(PO,{basename:e,children:t,location:l.location,navigationType:l.action,navigator:o,unstable_useTransitions:n})}var IN=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,vs=j.forwardRef(function({onClick:t,discover:n="render",prefetch:r="none",relative:a,reloadDocument:o,replace:l,unstable_mask:d,state:f,target:h,to:g,preventScrollReset:m,viewTransition:y,unstable_defaultShouldRevalidate:b,...k},v){let{basename:N,navigator:E,unstable_useTransitions:C}=j.useContext(Ar),S=typeof g=="string"&&IN.test(g),_=NN(g,N);g=_.to;let M=xO(g,{relative:a}),T=pi(),L=null;if(d){let H=zh(d,[],T.unstable_mask?T.unstable_mask.pathname:"/",!0);N!=="/"&&(H.pathname=H.pathname==="/"?N:ui([N,H.pathname])),L=E.createHref(H)}let[R,$,z]=rR(r,k),q=hR(g,{replace:l,unstable_mask:d,state:f,target:h,preventScrollReset:m,relative:a,viewTransition:y,unstable_defaultShouldRevalidate:b,unstable_useTransitions:C});function F(H){t&&t(H),H.defaultPrevented||q(H)}let Y=!(_.isExternal||o),D=j.createElement("a",{...k,...z,href:(Y?L:void 0)||_.absoluteURL||M,onClick:Y?F:t,ref:lR(v,$),target:h,"data-discover":!S&&n==="render"?"true":void 0});return R&&!S?j.createElement(j.Fragment,null,D,j.createElement(iR,{page:M})):D});vs.displayName="Link";var zN=j.forwardRef(function({"aria-current":t="page",caseSensitive:n=!1,className:r="",end:a=!1,style:o,to:l,viewTransition:d,children:f,...h},g){let m=Gu(l,{relative:h.relative}),y=pi(),b=j.useContext(Ph),{navigator:k,basename:v}=j.useContext(Ar),N=b!=null&&bR(m)&&d===!0,E=k.encodeLocation?k.encodeLocation(m).pathname:m.pathname,C=y.pathname,S=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;n||(C=C.toLowerCase(),S=S?S.toLowerCase():null,E=E.toLowerCase()),S&&v&&(S=ga(S,v)||S);const _=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let M=C===E||!a&&C.startsWith(E)&&C.charAt(_)==="/",T=S!=null&&(S===E||!a&&S.startsWith(E)&&S.charAt(E.length)==="/"),L={isActive:M,isPending:T,isTransitioning:N},R=M?t:void 0,$;typeof r=="function"?$=r(L):$=[r,M?"active":null,T?"pending":null,N?"transitioning":null].filter(Boolean).join(" ");let z=typeof o=="function"?o(L):o;return j.createElement(vs,{...h,"aria-current":R,className:$,ref:g,style:z,to:l,viewTransition:d},typeof f=="function"?f(L):f)});zN.displayName="NavLink";var dR=j.forwardRef(({discover:e="render",fetcherKey:t,navigate:n,reloadDocument:r,replace:a,state:o,method:l=Wf,action:d,onSubmit:f,relative:h,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y,...b},k)=>{let{unstable_useTransitions:v}=j.useContext(Ar),N=gR(),E=yR(d,{relative:h}),C=l.toLowerCase()==="get"?"get":"post",S=typeof d=="string"&&IN.test(d),_=M=>{if(f&&f(M),M.defaultPrevented)return;M.preventDefault();let T=M.nativeEvent.submitter,L=(T==null?void 0:T.getAttribute("formmethod"))||l,R=()=>N(T||M.currentTarget,{fetcherKey:t,method:L,navigate:n,replace:a,state:o,relative:h,preventScrollReset:g,viewTransition:m,unstable_defaultShouldRevalidate:y});v&&n!==!1?j.startTransition(()=>R()):R()};return j.createElement("form",{ref:k,method:C,action:E,onSubmit:r?f:_,...b,"data-discover":!S&&e==="render"?"true":void 0})});dR.displayName="Form";function fR(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function PN(e){let t=j.useContext(Wl);return Jt(t,fR(e)),t}function hR(e,{target:t,replace:n,unstable_mask:r,state:a,preventScrollReset:o,relative:l,viewTransition:d,unstable_defaultShouldRevalidate:f,unstable_useTransitions:h}={}){let g=ks(),m=pi(),y=Gu(e,{relative:l});return j.useCallback(b=>{if(HO(b,t)){b.preventDefault();let k=n!==void 0?n:wu(m)===wu(y),v=()=>g(e,{replace:k,unstable_mask:r,state:a,preventScrollReset:o,relative:l,viewTransition:d,unstable_defaultShouldRevalidate:f});h?j.startTransition(()=>v()):v()}},[m,g,y,n,r,a,t,e,o,l,d,f,h])}function BN(e){Gr(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 t=j.useRef($y(e)),n=j.useRef(!1),r=pi(),a=j.useMemo(()=>KO(r.search,n.current?null:t.current),[r.search]),o=ks(),l=j.useCallback((d,f)=>{const h=$y(typeof d=="function"?d(new URLSearchParams(a)):d);n.current=!0,o("?"+h,f)},[o,a]);return[a,l]}var pR=0,mR=()=>`__${String(++pR)}__`;function gR(){let{router:e}=PN("useSubmit"),{basename:t}=j.useContext(Ar),n=DO(),r=e.fetch,a=e.navigate;return j.useCallback(async(o,l={})=>{let{action:d,method:f,encType:h,formData:g,body:m}=YO(o,t);if(l.navigate===!1){let y=l.fetcherKey||mR();await r(y,n,l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||f,formEncType:l.encType||h,flushSync:l.flushSync})}else await a(l.action||d,{unstable_defaultShouldRevalidate:l.unstable_defaultShouldRevalidate,preventScrollReset:l.preventScrollReset,formData:g,body:m,formMethod:l.method||f,formEncType:l.encType||h,replace:l.replace,state:l.state,fromRouteId:n,flushSync:l.flushSync,viewTransition:l.viewTransition})},[r,a,t,n])}function yR(e,{relative:t}={}){let{basename:n}=j.useContext(Ar),r=j.useContext(Yr);Jt(r,"useFormAction must be used inside a RouteContext");let[a]=r.matches.slice(-1),o={...Gu(e||".",{relative:t})},l=pi();if(e==null){o.search=l.search;let d=new URLSearchParams(o.search),f=d.getAll("index");if(f.some(g=>g==="")){d.delete("index"),f.filter(m=>m).forEach(m=>d.append("index",m));let g=d.toString();o.search=g?`?${g}`:""}}return(!e||e===".")&&a.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),n!=="/"&&(o.pathname=o.pathname==="/"?n:ui([n,o.pathname])),wu(o)}function bR(e,{relative:t}={}){let n=j.useContext(CN);Jt(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=PN("useViewTransitionState"),a=Gu(e,{relative:t});if(!n.isTransitioning)return!1;let o=ga(n.currentLocation.pathname,r)||n.currentLocation.pathname,l=ga(n.nextLocation.pathname,r)||n.nextLocation.pathname;return uh(a.pathname,l)!=null||uh(a.pathname,o)!=null}oN();/**
|
|
61
|
-
* @license lucide-react v0.544.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 xR=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),vR=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(t,n,r)=>r?r.toUpperCase():n.toLowerCase()),lk=e=>{const t=vR(e);return t.charAt(0).toUpperCase()+t.slice(1)},$N=(...e)=>e.filter((t,n,r)=>!!t&&t.trim()!==""&&r.indexOf(t)===n).join(" ").trim(),wR=e=>{for(const t in e)if(t.startsWith("aria-")||t==="role"||t==="title")return!0};/**
|
|
66
|
-
* @license lucide-react v0.544.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
|
-
*/var kR={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"};/**
|
|
71
|
-
* @license lucide-react v0.544.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 ER=j.forwardRef(({color:e="currentColor",size:t=24,strokeWidth:n=2,absoluteStrokeWidth:r,className:a="",children:o,iconNode:l,...d},f)=>j.createElement("svg",{ref:f,...kR,width:t,height:t,stroke:e,strokeWidth:r?Number(n)*24/Number(t):n,className:$N("lucide",a),...!o&&!wR(d)&&{"aria-hidden":"true"},...d},[...l.map(([h,g])=>j.createElement(h,g)),...Array.isArray(o)?o:[o]]));/**
|
|
76
|
-
* @license lucide-react v0.544.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 Re=(e,t)=>{const n=j.forwardRef(({className:r,...a},o)=>j.createElement(ER,{ref:o,iconNode:t,className:$N(`lucide-${xR(lk(e))}`,`lucide-${e}`,r),...a}));return n.displayName=lk(e),n};/**
|
|
81
|
-
* @license lucide-react v0.544.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
|
-
*/const SR=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],$h=Re("activity",SR);/**
|
|
86
|
-
* @license lucide-react v0.544.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 NR=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],_R=Re("arrow-down",NR);/**
|
|
91
|
-
* @license lucide-react v0.544.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 jR=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],UN=Re("arrow-left",jR);/**
|
|
96
|
-
* @license lucide-react v0.544.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 CR=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],FN=Re("arrow-up",CR);/**
|
|
101
|
-
* @license lucide-react v0.544.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 AR=[["path",{d:"M18 6V4a2 2 0 1 0-4 0v2",key:"1aquzs"}],["path",{d:"M20 15v6a1 1 0 0 1-1 1H6.5a1 1 0 0 1 0-5H20",key:"1rkj32"}],["path",{d:"M4 19.5v-15A2.5 2.5 0 0 1 6.5 2H10",key:"18wgow"}],["rect",{x:"12",y:"6",width:"8",height:"5",rx:"1",key:"73l30o"}]],TR=Re("book-lock",AR);/**
|
|
106
|
-
* @license lucide-react v0.544.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 MR=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],DR=Re("brain",MR);/**
|
|
111
|
-
* @license lucide-react v0.544.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 OR=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],RR=Re("check",OR);/**
|
|
116
|
-
* @license lucide-react v0.544.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 LR=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],Vu=Re("chevron-down",LR);/**
|
|
121
|
-
* @license lucide-react v0.544.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 IR=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Zl=Re("chevron-right",IR);/**
|
|
126
|
-
* @license lucide-react v0.544.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 zR=[["path",{d:"m18 15-6-6-6 6",key:"153udz"}]],PR=Re("chevron-up",zR);/**
|
|
131
|
-
* @license lucide-react v0.544.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 BR=[["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"}]],ku=Re("circle-alert",BR);/**
|
|
136
|
-
* @license lucide-react v0.544.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 $R=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],fh=Re("circle-check-big",$R);/**
|
|
141
|
-
* @license lucide-react v0.544.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 UR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],Eu=Re("circle-check",UR);/**
|
|
146
|
-
* @license lucide-react v0.544.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 FR=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],qN=Re("circle-x",FR);/**
|
|
151
|
-
* @license lucide-react v0.544.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 qR=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],HN=Re("clock",qR);/**
|
|
156
|
-
* @license lucide-react v0.544.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 HR=[["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"}]],KR=Re("copy",HR);/**
|
|
161
|
-
* @license lucide-react v0.544.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 GR=[["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M17 20v2",key:"1rnc9c"}],["path",{d:"M17 2v2",key:"11trls"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M2 17h2",key:"7oei6x"}],["path",{d:"M2 7h2",key:"asdhe0"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"M20 17h2",key:"1fpfkl"}],["path",{d:"M20 7h2",key:"1o8tra"}],["path",{d:"M7 20v2",key:"4gnj0m"}],["path",{d:"M7 2v2",key:"1i4yhu"}],["rect",{x:"4",y:"4",width:"16",height:"16",rx:"2",key:"1vbyd7"}],["rect",{x:"8",y:"8",width:"8",height:"8",rx:"1",key:"z9xiuo"}]],hh=Re("cpu",GR);/**
|
|
166
|
-
* @license lucide-react v0.544.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 VR=[["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"}]],Uh=Re("download",VR);/**
|
|
171
|
-
* @license lucide-react v0.544.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 YR=[["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"}]],QR=Re("external-link",YR);/**
|
|
176
|
-
* @license lucide-react v0.544.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 WR=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],XR=Re("eye",WR);/**
|
|
181
|
-
* @license lucide-react v0.544.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 ZR=[["path",{d:"M10 12.5 8 15l2 2.5",key:"1tg20x"}],["path",{d:"m14 12.5 2 2.5-2 2.5",key:"yinavb"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7z",key:"1mlx9k"}]],ck=Re("file-code",ZR);/**
|
|
186
|
-
* @license lucide-react v0.544.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 JR=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],Fh=Re("file-text",JR);/**
|
|
191
|
-
* @license lucide-react v0.544.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 eL=[["path",{d:"M9 20H4a2 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.9H20a2 2 0 0 1 2 2v5",key:"1w6njk"}],["circle",{cx:"13",cy:"12",r:"2",key:"1j92g6"}],["path",{d:"M18 19c-2.8 0-5-2.2-5-5v8",key:"pkpw2h"}],["circle",{cx:"20",cy:"19",r:"2",key:"1obnsp"}]],tL=Re("folder-git-2",eL);/**
|
|
196
|
-
* @license lucide-react v0.544.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 nL=[["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"}]],KN=Re("folder-open",nL);/**
|
|
201
|
-
* @license lucide-react v0.544.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 rL=[["path",{d:"M12 10v6",key:"1bos4e"}],["path",{d:"M9 13h6",key:"1uhe8q"}],["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"}]],iL=Re("folder-plus",rL);/**
|
|
206
|
-
* @license lucide-react v0.544.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 aL=[["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"}]],ph=Re("folder",aL);/**
|
|
211
|
-
* @license lucide-react v0.544.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 sL=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],oL=Re("funnel",sL);/**
|
|
216
|
-
* @license lucide-react v0.544.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 lL=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],cL=Re("git-branch",lL);/**
|
|
221
|
-
* @license lucide-react v0.544.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 uL=[["circle",{cx:"5",cy:"6",r:"3",key:"1qnov2"}],["path",{d:"M5 9v12",key:"ih889a"}],["circle",{cx:"19",cy:"18",r:"3",key:"1qljk2"}],["path",{d:"m15 9-3-3 3-3",key:"1lwv8l"}],["path",{d:"M12 6h5a2 2 0 0 1 2 2v7",key:"1yj91y"}]],dL=Re("git-pull-request-arrow",uL);/**
|
|
226
|
-
* @license lucide-react v0.544.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 fL=[["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"}]],hL=Re("globe",fL);/**
|
|
231
|
-
* @license lucide-react v0.544.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 pL=[["path",{d:"m15 12-9.373 9.373a1 1 0 0 1-3.001-3L12 9",key:"1hayfq"}],["path",{d:"m18 15 4-4",key:"16gjal"}],["path",{d:"m21.5 11.5-1.914-1.914A2 2 0 0 1 19 8.172v-.344a2 2 0 0 0-.586-1.414l-1.657-1.657A6 6 0 0 0 12.516 3H9l1.243 1.243A6 6 0 0 1 12 8.485V10l2 2h1.172a2 2 0 0 1 1.414.586L18.5 14.5",key:"15ts47"}]],mL=Re("hammer",pL);/**
|
|
236
|
-
* @license lucide-react v0.544.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 gL=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],yL=Re("history",gL);/**
|
|
241
|
-
* @license lucide-react v0.544.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 bL=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],xL=Re("house",bL);/**
|
|
246
|
-
* @license lucide-react v0.544.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 vL=[["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"}]],wL=Re("image",vL);/**
|
|
251
|
-
* @license lucide-react v0.544.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 kL=[["path",{d:"M5 3v14",key:"9nsxs2"}],["path",{d:"M12 3v8",key:"1h2ygw"}],["path",{d:"M19 3v18",key:"1sk56x"}]],EL=Re("kanban",kL);/**
|
|
256
|
-
* @license lucide-react v0.544.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 SL=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],NL=Re("key-round",SL);/**
|
|
261
|
-
* @license lucide-react v0.544.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 _L=[["rect",{width:"7",height:"7",x:"3",y:"3",rx:"1",key:"1g98yp"}],["rect",{width:"7",height:"7",x:"14",y:"3",rx:"1",key:"6d4xhi"}],["rect",{width:"7",height:"7",x:"14",y:"14",rx:"1",key:"nxv5o0"}],["rect",{width:"7",height:"7",x:"3",y:"14",rx:"1",key:"1bb6yr"}]],GN=Re("layout-grid",_L);/**
|
|
266
|
-
* @license lucide-react v0.544.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 jL=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Xe=Re("loader-circle",jL);/**
|
|
271
|
-
* @license lucide-react v0.544.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 CL=[["path",{d:"M2.992 16.342a2 2 0 0 1 .094 1.167l-1.065 3.29a1 1 0 0 0 1.236 1.168l3.413-.998a2 2 0 0 1 1.099.092 10 10 0 1 0-4.777-4.719",key:"1sd12s"}]],uk=Re("message-circle",CL);/**
|
|
276
|
-
* @license lucide-react v0.544.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 AL=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],VN=Re("message-square",AL);/**
|
|
281
|
-
* @license lucide-react v0.544.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 TL=[["rect",{x:"16",y:"16",width:"6",height:"6",rx:"1",key:"4q2zg0"}],["rect",{x:"2",y:"16",width:"6",height:"6",rx:"1",key:"8cvhb9"}],["rect",{x:"9",y:"2",width:"6",height:"6",rx:"1",key:"1egb70"}],["path",{d:"M5 16v-3a1 1 0 0 1 1-1h12a1 1 0 0 1 1 1v3",key:"1jsf9p"}],["path",{d:"M12 12V8",key:"2874zd"}]],YN=Re("network",TL);/**
|
|
286
|
-
* @license lucide-react v0.544.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 ML=[["path",{d:"M13.4 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-7.4",key:"re6nr2"}],["path",{d:"M2 6h4",key:"aawbzj"}],["path",{d:"M2 10h4",key:"l0bgd4"}],["path",{d:"M2 14h4",key:"1gsvsf"}],["path",{d:"M2 18h4",key:"1bu2t1"}],["path",{d:"M21.378 5.626a1 1 0 1 0-3.004-3.004l-5.01 5.012a2 2 0 0 0-.506.854l-.837 2.87a.5.5 0 0 0 .62.62l2.87-.837a2 2 0 0 0 .854-.506z",key:"pqwjuv"}]],QN=Re("notebook-pen",ML);/**
|
|
291
|
-
* @license lucide-react v0.544.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 DL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M15 3v18",key:"14nvp0"}],["path",{d:"m8 9 3 3-3 3",key:"12hl5m"}]],OL=Re("panel-right-close",DL);/**
|
|
296
|
-
* @license lucide-react v0.544.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 RL=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],LL=Re("paperclip",RL);/**
|
|
301
|
-
* @license lucide-react v0.544.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 IL=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],zL=Re("pause",IL);/**
|
|
306
|
-
* @license lucide-react v0.544.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 PL=[["path",{d:"M13 21h8",key:"1jsn5i"}],["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"}]],qh=Re("pen-line",PL);/**
|
|
311
|
-
* @license lucide-react v0.544.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 BL=[["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"}]],$L=Re("pencil",BL);/**
|
|
316
|
-
* @license lucide-react v0.544.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 UL=[["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"}]],Yu=Re("play",UL);/**
|
|
321
|
-
* @license lucide-react v0.544.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 FL=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],pr=Re("plus",FL);/**
|
|
326
|
-
* @license lucide-react v0.544.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 qL=[["path",{d:"M15.39 4.39a1 1 0 0 0 1.68-.474 2.5 2.5 0 1 1 3.014 3.015 1 1 0 0 0-.474 1.68l1.683 1.682a2.414 2.414 0 0 1 0 3.414L19.61 15.39a1 1 0 0 1-1.68-.474 2.5 2.5 0 1 0-3.014 3.015 1 1 0 0 1 .474 1.68l-1.683 1.682a2.414 2.414 0 0 1-3.414 0L8.61 19.61a1 1 0 0 0-1.68.474 2.5 2.5 0 1 1-3.014-3.015 1 1 0 0 0 .474-1.68l-1.683-1.682a2.414 2.414 0 0 1 0-3.414L4.39 8.61a1 1 0 0 1 1.68.474 2.5 2.5 0 1 0 3.014-3.015 1 1 0 0 1-.474-1.68l1.683-1.682a2.414 2.414 0 0 1 3.414 0z",key:"w46dr5"}]],HL=Re("puzzle",qL);/**
|
|
331
|
-
* @license lucide-react v0.544.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 KL=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}]],WN=Re("radio",KL);/**
|
|
336
|
-
* @license lucide-react v0.544.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 GL=[["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"}]],ya=Re("refresh-cw",GL);/**
|
|
341
|
-
* @license lucide-react v0.544.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 VL=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],Pb=Re("rotate-ccw",VL);/**
|
|
346
|
-
* @license lucide-react v0.544.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 YL=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M21 9H3",key:"1338ky"}],["path",{d:"M21 15H3",key:"9uk58r"}]],QL=Re("rows-3",YL);/**
|
|
351
|
-
* @license lucide-react v0.544.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 WL=[["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"}]],Ri=Re("save",WL);/**
|
|
356
|
-
* @license lucide-react v0.544.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 XL=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],Bb=Re("scroll-text",XL);/**
|
|
361
|
-
* @license lucide-react v0.544.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 ZL=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],ho=Re("search",ZL);/**
|
|
366
|
-
* @license lucide-react v0.544.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 JL=[["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"}]],XN=Re("settings",JL);/**
|
|
371
|
-
* @license lucide-react v0.544.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 e3=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],ZN=Re("shield-check",e3);/**
|
|
376
|
-
* @license lucide-react v0.544.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 t3=[["path",{d:"m12.5 17-.5-1-.5 1h1z",key:"3me087"}],["path",{d:"M15 22a1 1 0 0 0 1-1v-1a2 2 0 0 0 1.56-3.25 8 8 0 1 0-11.12 0A2 2 0 0 0 8 20v1a1 1 0 0 0 1 1z",key:"1o5pge"}],["circle",{cx:"15",cy:"12",r:"1",key:"1tmaij"}],["circle",{cx:"9",cy:"12",r:"1",key:"1vctgf"}]],n3=Re("skull",t3);/**
|
|
381
|
-
* @license lucide-react v0.544.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 r3=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],Pl=Re("sparkles",r3);/**
|
|
386
|
-
* @license lucide-react v0.544.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 i3=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],$b=Re("square",i3);/**
|
|
391
|
-
* @license lucide-react v0.544.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 a3=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],JN=Re("star",a3);/**
|
|
396
|
-
* @license lucide-react v0.544.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 s3=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],e_=Re("terminal",s3);/**
|
|
401
|
-
* @license lucide-react v0.544.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 o3=[["path",{d:"M10 2h4",key:"n1abiw"}],["path",{d:"M12 14v-4",key:"1evpnu"}],["path",{d:"M4 13a8 8 0 0 1 8-7 8 8 0 1 1-5.3 14L4 17.6",key:"1ts96g"}],["path",{d:"M9 17H4v5",key:"8t5av"}]],l3=Re("timer-reset",o3);/**
|
|
406
|
-
* @license lucide-react v0.544.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 c3=[["line",{x1:"10",x2:"14",y1:"2",y2:"2",key:"14vaq8"}],["line",{x1:"12",x2:"15",y1:"14",y2:"11",key:"17fdiu"}],["circle",{cx:"12",cy:"14",r:"8",key:"1e1u0o"}]],u3=Re("timer",c3);/**
|
|
411
|
-
* @license lucide-react v0.544.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 d3=[["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"}]],fi=Re("trash-2",d3);/**
|
|
416
|
-
* @license lucide-react v0.544.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 f3=[["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"}]],h3=Re("triangle-alert",f3);/**
|
|
421
|
-
* @license lucide-react v0.544.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 p3=[["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"}]],t_=Re("upload",p3);/**
|
|
426
|
-
* @license lucide-react v0.544.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 m3=[["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"}]],n_=Re("users",m3);/**
|
|
431
|
-
* @license lucide-react v0.544.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 g3=[["rect",{width:"8",height:"8",x:"3",y:"3",rx:"2",key:"by2w9f"}],["path",{d:"M7 11v4a2 2 0 0 0 2 2h4",key:"xkn7yn"}],["rect",{width:"8",height:"8",x:"13",y:"13",rx:"2",key:"1cgmvn"}]],Ub=Re("workflow",g3);/**
|
|
436
|
-
* @license lucide-react v0.544.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 y3=[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.106-3.105c.32-.322.863-.22.983.218a6 6 0 0 1-8.259 7.057l-7.91 7.91a1 1 0 0 1-2.999-3l7.91-7.91a6 6 0 0 1 7.057-8.259c.438.12.54.662.219.984z",key:"1ngwbx"}]],r_=Re("wrench",y3);/**
|
|
441
|
-
* @license lucide-react v0.544.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 b3=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Sn=Re("x",b3);/**
|
|
446
|
-
* @license lucide-react v0.544.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 x3=[["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"}]],v3=Re("zap",x3),w3={"app.title":"SPS Console","nav.chat":"Chat","nav.projects":"Projects","nav.board":"Board","nav.workers":"Workers","nav.logs":"Logs","nav.skills":"Skills","nav.system":"System","nav.processes":"Processes","nav.audit":"Audit Log","nav.memory":"Memory","nav.plugins":"Plugins","plugins.h1":"Plugins 🧩","plugins.desc":"Global plugin toggles. Applies to newly dispatched cards.","plugins.tab.memory":"Memory","plugins.tab.channel":"Channel","plugins.tab.model":"Model","plugins.tab.tool":"Tool","plugins.comingSoon":"Coming soon","plugins.model.title":"Agent models","plugins.model.desc":"Configure both agents (global). worker=claude executes, review·designer=openai supervises+orchestrates.","plugins.model.worker":"Worker (executes / claude)","plugins.model.reviewer":"Review·Designer (supervisor / openai)","plugins.model.provider":"Provider","plugins.model.model":"Model","plugins.model.official":"Official claude (default)","plugins.model.save":"Save","plugins.model.saved":"Saved","plugins.model.error":"Save failed","nav.arrange":"Arrange","arrange.h1":"SmartArrange 🧭","arrange.project":"Project","arrange.none":'Not started — click "Start" above to launch (task list appears in seconds; approve to run). If the dropdown is empty, create a project in SmartArrange mode first.',"arrange.start":"Start","arrange.stop":"Stop","arrange.startErr":"Start/stop failed","arrange.view":"Toggle canvas view","arrange.viewFree":"Free","arrange.viewLane":"Lanes","arrange.starting":"Starting — breaking down the task list…","arrange.planning":"Breaking down the task list…","arrange.orchestrating":"Orchestrating…","arrange.status":"Status","arrange.goal":"Goal","arrange.plan":"Task list + card chain","arrange.approve":"Approve plan","arrange.approveErr":"Approve failed","arrange.tasks":"Task list","arrange.collapse":"Collapse","arrange.expand":"Expand task list","arrange.noCards":"No cards yet — waiting for the orchestrator to dispatch (starts after approval).","arrange.cardPrompt":"Card prompt","arrange.cardSkills":"Skills","arrange.cardTask":"Task","arrange.cardLog":"Log","arrange.close":"Close","arrange.cardsCount":"cards","nav.aria":"Main navigation","memory.sub":"Cross-project memory · agentmemory proxied behind console auth","memory.searchPlaceholder":"Search memory… (e.g. how to fix the art race)","memory.search":"Search","memory.results":"Results","memory.rawHint":"(raw observation · distilled lessons appear after live capture + compression)","memory.sessions":"Recent sessions","memory.empty":"No memory yet · accumulates after live capture (P1)","processes.title":"Processes","processes.subtitle":"Claude processes launched by SPS ACP (others, e.g. your own session, are not shown)","processes.refresh":"Refresh","processes.aliveCount":"{n} running","processes.col.kind":"Type","processes.col.slot":"Slot","processes.col.project":"Project","processes.col.state":"State","processes.col.memory":"Memory","processes.col.action":"Action","processes.empty":"No SPS processes","processes.filter.all":"All","processes.filter.alive":"Running","processes.filter.offline":"Offline","processes.kind.all":"All types","processes.kind.worker":"Worker","processes.kind.chat":"Chat","processes.kill":"Kill","processes.killConfirm":"Kill process {slot}?","audit.title":"Audit Log","audit.subtitle":"Project lifecycle: create / modify / delete","audit.refresh":"Refresh","audit.filter.all":"All","audit.action.create":"Create","audit.action.modify":"Modify","audit.action.delete":"Delete","audit.action.daemon":"Daemon","audit.col.time":"Time","audit.col.action":"Action","audit.col.project":"Project","audit.col.detail":"Detail","audit.empty":"No audit records","lang.toggle.aria":"Switch interface language","lang.en":"EN","lang.zh":"中","status.server":"server","status.offline":"offline","status.sse.open":"SSE","status.sse.connecting":"SSE·connect","status.sse.down":"SSE·down","status.pipelines.tooltip":"Active pipelines","status.workers.tooltip":"Active workers","status.pipeline.unit":"pipeline","status.worker.unit":"worker","common.save":"Save","common.cancel":"Cancel","common.delete":"Delete","common.confirm":"Confirm","common.create":"Create","common.edit":"Edit","common.close":"Close","common.loading":"Loading…","common.error":"Error","common.retry":"Retry","common.empty":"Nothing here yet","common.search":"Search","common.refresh":"Refresh","common.copy":"Copy","common.copied":"Copied","common.yes":"Yes","common.no":"No","common.required":"Required","common.optional":"Optional","common.ok":"OK","projects.title":"Projects 🎯","projects.count":"{count} local project(s)","projects.refresh.hint":"Click refresh to retry","projects.new":"New project","projects.selectHint":"Select a project on the left to see its details.","projects.sort.label":"Sort by","projects.sort.activity":"Activity","projects.sort.date":"Modified","projects.sort.name":"Name","projects.load.failed":"Failed to load","projects.empty.title":"No projects yet ✨","projects.empty.hint":"Run {cmd} to create your first project.","newProject.title":"New project","newProject.subtitle":"Set up a project; the worker will run automatically","newProject.field.mode":"Execution mode","newProject.field.mode.pipeline":"Auto pipeline","newProject.field.mode.pipelineDesc":"Fixed-stage pipeline, claude worker runs cards","newProject.field.mode.smart":"SmartArrange","newProject.field.mode.smartDesc":"OpenAI monitor dispatches cards + claude worker","newProject.field.mode.pipelineHint":"Classic mode: you create cards, worker runs them by stage.","newProject.field.mode.smartHint":"Give one goal; the OpenAI monitor probes output each round, dispatches task cards dynamically, drives claude to finish.","newProject.field.goal":"Goal (GOAL.md)","newProject.field.goal.hint":"Written to docs/GOAL.md; SmartArrange derives the task list from it. Missing → tick skips the project.","newProject.field.goal.placeholder":"e.g. Build a pure-frontend, single-file Snake browser game…","newProject.field.name":"Project name","newProject.field.name.help":"Lowercase letters, digits, _ and - only","newProject.field.dir":"Project directory","newProject.field.dir.preview":"Project will be created at →","newProject.field.dir.help":"Absolute path; will be created if missing","newProject.field.branch":"Merge target branch","newProject.field.branch.help":"Default: main","newProject.field.maxWorkers":"Max concurrent workers","newProject.field.maxWorkers.help":"Per-project worker count (1 recommended)","newProject.field.ackTimeout":"ACK timeout (seconds)","newProject.field.ackTimeout.help":"How long to wait for the worker to ACK (default 300)","newProject.field.gitlabProject":"GitLab/GitHub remote","newProject.field.gitlabProject.help":"Format: user/repo (optional)","newProject.field.matrixRoom":"Matrix room ID","newProject.field.matrixRoom.help":"Optional, falls back to global default","newProject.field.git":"Enable git","newProject.field.git.help":"Off → non-code project, no commit/push/MR steps","newProject.submit":"Create project","newProject.creating":"Creating…","newProject.created":"Project created","newProject.error.dirRequired":"Project directory is required","newProject.dir.browse":"Browse","newProject.dir.browseAria":"Pick directory","newProject.back":"Back","newProject.back.aria":"Back to projects","newProject.field.name.placeholder":"e.g. acme-web","newProject.field.name.example":"Letters, digits, underscore, hyphen. e.g. acme-web","newProject.field.name.invalid":"Name only allows a-z A-Z 0-9 _ -","newProject.field.dir.long":"Absolute path of the PROJECT directory. The selected directory is the project root; project name defaults to the directory name. Has code → adopt (only adds .claude/ config, never touches source); empty → create new.","newProject.field.dir.placeholder":"/home/you/projects/my-app","newProject.field.dir.createIfMissing":"Auto-create if missing (recommended — otherwise .claude/ install gets skipped)","newProject.field.dir.pickerTitle":"Pick project directory","newProject.field.dir.adopt":"Existing content detected → will adopt (config only, source untouched)","newProject.field.dir.fresh":"Empty directory → create new project","newProject.field.name.derived":"Project name (defaults to directory name, editable)","newProject.field.maxWorkers.short":"Max workers","newProject.field.ackTimeout.minutes":"ACK timeout (min)","newProject.field.ackTimeout.minutes.help":"How long after dispatch before the worker is considered failed if no ACK","newProject.field.git.label":"Enable Git (worker auto commit + push)","newProject.field.git.detail":"When off, the worker only does the task, no version control — fits docs / data-processing non-code projects.","newProject.field.review.label":"Enable checklist review (independent agent verifies each finished card)","newProject.field.review.detail":"When on: cards carrying a checklist are verified item-by-item against the real output by an independent reviewer after the worker finishes; all-pass stays Done, any fail auto-inserts a priority fix card. Cards without a checklist are not reviewed. Write acceptance points with --checklist when creating cards.","newProject.field.git.branch":"Merge branch","newProject.field.gitlabProject.label":"Git remote project path","newProject.field.gitlabProject.help2":"Like user/repo. Empty = skip remote API (commit/push local only)","newProject.field.gitlabProject.placeholder":"user/repo","newProject.field.gitlabProjectId":"GitLab project ID","newProject.field.gitlabProjectId.help":"Number; leave blank for GitHub","newProject.field.gitlabProjectId.placeholder":"42","newProject.section.notifications":"Notifications","newProject.field.matrixRoom.label":"Matrix room ID","newProject.field.matrixRoom.help2":"Empty = use global config; blank = no notifications","newProject.field.matrixRoom.placeholder":"!abc:matrix.example.com","newProject.error.create.title":"Create failed","projectDetail.tab.pipeline":"Pipeline","projectDetail.tab.conf":"Conf","projectDetail.tab.delete":"Delete project","projectDetail.delete.title":"Delete this project","projectDetail.delete.warn":"This will remove the project conf, runtime, and worktrees. The repository under {repoDir} is untouched.","projectDetail.delete.confirmLabel":"Type the project name to confirm","projectDetail.delete.button":"Delete project","projectDetail.delete.deleting":"Deleting…","projectDetail.lastActivity":"Last activity","projectDetail.notFound":"Project not found","projectDetail.notFoundHint":"It may have been deleted or renamed.","projectDetail.backToList":"Back to projects","pipeline.editor.title":"Pipeline YAML","pipeline.editor.savedAt":"Saved {time}","pipeline.editor.unsaved":"Unsaved changes","pipeline.editor.save":"Save","pipeline.editor.saving":"Saving…","pipeline.editor.reload":"Reload from disk","pipeline.editor.discard.title":"Discard unsaved changes?","pipeline.editor.discard.body":"Your edits will be lost.","pipeline.editor.errors":"YAML parse errors","pipeline.editor.list":"Pipelines","pipeline.editor.list.add":"New pipeline","pipeline.editor.list.delete":"Delete pipeline","pipeline.editor.list.use":"Use as active","pipeline.editor.list.activeBadge":"active","pipeline.editor.list.sample":"sample","pipeline.editor.delete.confirm.title":"Delete pipeline {name}?","pipeline.editor.delete.confirm.body":"This action cannot be undone.","pipeline.newDialog.title":"New pipeline","pipeline.newDialog.field.filename":"Filename","pipeline.newDialog.field.filename.help":"Letters, digits, _ and - only; .yaml will be appended","pipeline.newDialog.field.copyFrom":"Copy from","pipeline.newDialog.copyFrom.sample":"sample template","pipeline.newDialog.copyFrom.active":"current active","pipeline.newDialog.create":"Create","projectDetail.tab.overview":"Overview","projectDetail.tab.config":"Config","projectDetail.tab.pipelines":"Pipelines","projectDetail.tab.danger":"Danger zone","projectDetail.openBoard":"Board","projectDetail.overview.repoDir":"Repo path","projectDetail.overview.pmBackend":"PM backend","projectDetail.overview.agent":"Agent","projectDetail.overview.cards":"Cards","projectDetail.overview.cards.value":"{total} total · {inprogress} in progress · {done} done","projectDetail.overview.workers":"Workers","projectDetail.overview.workers.value":"{total} total ({active} active)","projectDetail.overview.pipeline":"Pipeline","projectDetail.overview.lastActivity":"Last activity","projectDetail.overview.notFound":"Project {name} not found or unreadable.","projectDetail.config.confDirty":"● Unsaved changes","projectDetail.config.reload":"Reload","projectDetail.config.save":"Save","projectDetail.config.saveAria":"Save config","projectDetail.config.editorAria":"conf file editor","projectDetail.config.error.conflict.title":"Config was modified elsewhere","projectDetail.config.error.conflict.body":"The conf file was changed while you were editing. Click Reload, then re-edit.","projectDetail.config.error.save.title":"Save failed","projectDetail.config.error.load":"Load failed: {detail}","projectDetail.pipelines.title":"Pipelines","projectDetail.pipelines.add":"New pipeline","projectDetail.pipelines.empty":'No pipeline files yet. Click "New pipeline" to start.',"projectDetail.pipelines.activeBadge":"active","projectDetail.pipelines.edit":"Edit","projectDetail.pipelines.editAria":"Edit {name}","projectDetail.pipelines.switch":"Switch","projectDetail.pipelines.switchAria":"Switch to {name}","projectDetail.pipelines.switch.confirm.title":"Switch to {name}","projectDetail.pipelines.switch.confirm.body":"The current project.yaml will be overwritten with the contents of {name}. Continue?","projectDetail.pipelines.switch.confirm.button":"Switch","projectDetail.pipelines.switch.error":"Switch failed","projectDetail.pipelines.delete.confirm.title":"Delete {name}","projectDetail.pipelines.delete.confirm.body":"This pipeline file will be permanently deleted.","projectDetail.pipelines.delete.error":"Delete failed","projectDetail.pipelines.deleteAria":"Delete {name}","projectDetail.pipelines.create.error":"Create failed","projectDetail.danger.title":"Delete project","projectDetail.danger.body":"This clears {path} (all cards, runtime, logs).","projectDetail.danger.includeClaude.label":"Also clear repo's .claude/","projectDetail.danger.includeClaude.note":"The repo itself is untouched; only this directory is cleaned.","projectDetail.danger.confirmPrompt":"Type the project name {name} to confirm:","projectDetail.danger.deleteAria":"Permanently delete project","projectDetail.danger.deleteButton":"Permanently delete","projectDetail.danger.deleted.title":"Deleted","projectDetail.danger.deleted.bodyWithList":`Project deleted. Also cleaned up:
|
|
451
|
-
{paths}`,"projectDetail.danger.deleted.body":"Project deleted.","projectDetail.danger.error":"Delete failed","pipelineEditor.close":"Close","pipelineEditor.error.conflict.title":"File was modified elsewhere","pipelineEditor.error.yaml.title":"YAML syntax error","pipelineEditor.error.save.title":"Save failed","pipelineEditor.error.serialize.title":"YAML serialize failed","pipelineEditor.error.load":"Load failed: {detail}","pipelineEditor.mode.structured":"Structured","pipelineEditor.mode.yaml":"Raw YAML","pipelineEditor.parseError.prefix":"YAML parse: {detail}","pipelineEditor.activeWarning":"⚠ This is the active pipeline — saving will take effect on the next tick","pipelineEditor.yamlAria":"pipeline YAML editor","pipelineEditor.status.unsaved":"● Unsaved","pipelineEditor.status.saved":"Saved","pipelineEditor.status.noChanges":"No changes","pipelineEditor.reload":"Reload","pipelineEditor.save":"Save","pipelineEditor.saveAria":"Save pipeline","pipelineEditor.activeBadge":"active","pipelineEditor.modeHint":"project = event-driven pipeline (default) · steps = sequential script","pipelineEditor.stages.heading":"Stages ({count})","pipelineEditor.stages.add":"Add stage","pipelineEditor.stages.empty":'No stages yet. Click "Add stage" to start.',"pipelineEditor.stage.name.hint":"Unique stage name","pipelineEditor.stage.profile.hint":"skill profile, may be empty","pipelineEditor.stage.cardState.hint":"Card state during this stage","pipelineEditor.stage.timeout.hint":"Optional, e.g. 30m 2h","pipelineEditor.stage.trigger.hint":"Trigger condition, blank uses default","pipelineEditor.stage.onComplete.hint":"Action on success","pipelineEditor.stage.onFail.action.hint":"Action on failure, e.g. label NEEDS-FIX","pipelineEditor.stage.onFail.comment.hint":"Comment written on the card","pipelineEditor.stage.halt.note":"(stops pipeline on failure; uncheck to continue with next card)","pipelineEditor.stage.moveUp":"Move up","pipelineEditor.stage.moveDown":"Move down","pipelineEditor.stage.remove":"Remove stage","newPipelineDialog.title":"New pipeline","newPipelineDialog.field.filename.label":"Filename","newPipelineDialog.field.filename.placeholder":"e.g. ci","newPipelineDialog.field.filename.help":"Will be saved as {filename}. Only a-z A-Z 0-9 _ - allowed; an existing file errors 409.","newPipelineDialog.section.template":"Initial content","newPipelineDialog.template.blank.label":"Blank template","newPipelineDialog.template.blank.desc":"Minimal 1-stage pipeline (develop → Done)","newPipelineDialog.template.sample.label":"Tutorial template","newPipelineDialog.template.sample.desc":"Copied from sample.yaml.example (annotated, every field explained)","newPipelineDialog.template.sample.unavailable":"sample.yaml.example does not exist","newPipelineDialog.template.active.label":"Copy current active","newPipelineDialog.template.active.desc":"Copied from project.yaml (build on the current config)","newPipelineDialog.template.active.unavailable":"project.yaml does not exist","newPipelineDialog.create.aria":"Create pipeline","newPipelineDialog.cancel":"Cancel","board.title":"Board ✨","board.title.bare":"Board","board.subtitle":"{name} · {cards} cards · {workers} workers active","board.pickPrompt.title":"Pick a project 🎯","board.pickPrompt.body":"The board is per-project. Pick one to start:","board.action.start":"Start","board.action.stop":"Stop","board.action.startAria":"Start pipeline","board.action.stopAria":"Stop pipeline","board.action.startError":"Failed to start pipeline","board.action.stopError":"Failed to stop pipeline","board.action.reset":"Reset","board.action.resetError":"Reset failed","board.action.reset.confirm.title":"Reset the entire pipeline","board.action.reset.confirm.body":"This clears all cards’ run state, worker markers, and branches. Cannot be undone.","board.action.reset.confirm.button":"Reset all","board.action.newCard":"New card","board.action.newCard.error":"Failed to create card","board.action.moveCard.error":"Failed to move card","board.search.placeholder":"Search title / skill / label…","board.search.aria":"Search cards","board.filter.clear":"Clear","board.filter.clearAria":"Clear filters","board.filter.aria":"Filter by {label}","board.filter.clearSelection":"Clear selection","board.error.loadCards":"Failed to load cards","board.col.planning":"Planning","board.col.backlog":"Backlog","board.col.todo":"Todo","board.col.inprogress":"Inprogress","board.col.qa":"QA / Review","board.col.done":"Done","kanban.checklist.label":"Checklist {done}/{total}","kanban.checklist.more":"… {count} more","kanban.column.empty":"— empty —","kanban.time.justNow":"just now","kanban.time.minutes":"{n}m ago","kanban.time.hours":"{n}h ago","kanban.time.days":"{n}d ago","newCard.title":"New card","newCard.field.title":"Title *","newCard.field.title.placeholder":"e.g. Add GitHub OAuth login","newCard.field.title.help":"Short, clear goal (<200 chars)","newCard.field.description":"Description","newCard.field.description.placeholder":"User story, requirements, acceptance criteria, references… Claude reads this when starting","newCard.field.description.help":"Markdown supported. If empty, Claude only sees the title.","newCard.field.skills":"Skills","newCard.field.skills.help":"Pick which skills get loaded (via frontmatter `skills:`). Optional — worker falls back to project-level skills.","newCard.field.skills.loading":"Loading skills…","newCard.field.skills.error":"Failed to load skills (creation still works): {detail}","newCard.field.skills.selected":"{count} selected: {names}","newCard.field.dispatch":"Dispatch","newCard.field.dispatch.label":"Dispatch immediately (go straight to Backlog)","newCard.field.dispatch.help":"Default off: card lands in Planning to wait; drag to Backlog when ready. On: skip Planning, the next tick assigns a worker.","newCard.create.aria":"Create card","cardDetail.loading":"Loading…","cardDetail.error.load":"Failed to load card","cardDetail.tabs.overview":"Overview","cardDetail.tabs.body":"Description","cardDetail.tabs.checklist":"Checklist","cardDetail.tabs.history":"History","cardDetail.tabs.actions":"Actions","cardDetail.field.state":"State","cardDetail.field.skills":"Skills","cardDetail.field.labels":"Labels","cardDetail.field.branch":"Branch","cardDetail.field.assignee":"Assignee","cardDetail.field.created":"Created","cardDetail.field.updated":"Updated","cardDetail.field.empty":"—","cardDetail.actions.delete":"Delete card","cardDetail.actions.delete.confirm.title":"Delete card #{seq}","cardDetail.actions.delete.confirm.body":"This card will be permanently deleted.","cardDetail.actions.delete.error":"Delete failed","cardDetail.actions.update.error":"Update failed","cardDetail.body.empty":"No description","cardDetail.checklist.empty":"No checklist","cardDetail.checklist.progress":"Progress {done}/{total}","cardDetail.history.empty":"No history","cardDetail.notFound":"Card #{seq} not found","cardDetail.copy.aria":"Copy seq","cardDetail.close.aria":"Close","cardDetail.save":"Save","cardDetail.saving":"Saving…","workers.title":"Workers 👷","workers.summary":"Across {projects} projects · {running} running · {starting} starting · {stuck} stuck · {crashed} crashed · {idle} idle","workers.summary.stuck":"{n} stuck","workers.summary.crashed":"{n} crashed","workers.refresh.aria":"Refresh","workers.refresh":"Refresh","workers.error.load":"Load failed: {detail}","workers.empty.hint":"Click a project / worker to see details","logs.title":"Logs 📜","logs.subtitle.allProjects":"All projects","logs.subtitle.project":"{name} live tail","logs.filter.errors":"Errors only","logs.filter.errors.aria":"Show errors only","logs.filter.search.placeholder":"Filter messages…","logs.empty":"No logs yet — waiting for events","logs.error.load":"Failed to load logs","logs.refresh":"Refresh","logs.refresh.aria":"Refresh logs","logs.scroll.bottom.aria":"Scroll to bottom","logs.scroll.pause":"Paused (autoscroll off)","logs.scroll.resume":"Resume autoscroll","logs.subtitle.allProjectsCount":"All projects ({count})","logs.poll.5s":"5s polling","logs.paused":"⏸ PAUSED","logs.mode.live":"Live","logs.mode.history":"History","logs.history.startAria":"Query start time","logs.history.queryAria":"Query","logs.history.query":"Query","logs.filter.project.aria":"Filter project","logs.filter.project.all":"All projects","logs.filter.keyword.placeholder":"Filter keyword…","logs.filter.keyword.aria":"Filter logs","logs.empty.match":"No matching logs","skills.title":"Skills 🧠","skills.subtitle":"Skills shared across projects (managed via `sps skill ...`)","skills.empty.title":"No skills yet","skills.empty.hint":"Run {cmd} to sync the bundled skills.","skills.linked.tooltip":"linked into this project","skills.frozen.tooltip":"frozen (per-project copy)","skills.category.all":"All","skills.category.language":"language","skills.category.end":"end","skills.category.persona":"persona","skills.category.workflow":"workflow","skills.category.other":"other","skills.subtitleCount":"{count} user-level skill(s)","skills.search.placeholder":"Search skill…","skills.search.aria":"Search skill","skillDetail.actionFailed":"{label} failed","skillDetail.unfreezeAction":"Unfreeze","skillDetail.freezeAction":"Freeze","skillDetail.removeAction":"Remove","skillDetail.removeConfirm.title":"Remove {name} from {project}","skillDetail.removeConfirm.body":"The skill link will be removed; the project will not see this skill on next run.","skillDetail.removeConfirm.button":"Remove","skillDetail.unfreezeConfirm.title":"Unfreeze {name} @ {project}","skillDetail.unfreezeConfirm.body":"Local changes to this skill will be overwritten with the latest shared version.","skillDetail.unfreezeConfirm.button":"Unfreeze","skillDetail.close.aria":"Close","skillDetail.loading":"Loading…","skillDetail.error.load":"Load failed: {detail}","skillDetail.section.projects":"Per-project link status","skillDetail.section.empty":"No projects yet. Create one first.","skillDetail.section.preview":"SKILL.md preview","skillDetail.toggleSection.aria":"{action} {file}","skillDetail.expand":"Expand","skillDetail.collapse":"Collapse","system.title":"System 🛠","system.subtitle":"Global config + diagnostics + upgrades","system.section.env":"Global env","system.section.env.help":"Stored in ~/.coral/env (mode 600). Used by all projects.","system.section.env.save":"Save env","system.section.env.error.conflict":"env was modified elsewhere","system.section.env.error.save":"Failed to save env","system.section.env.error.load":"Failed to load env","system.section.env.dirtyDot":"● Unsaved","system.section.env.aria":"env editor","system.section.env.reload":"Reload","system.section.upgrade":"Upgrade","system.section.upgrade.current":"Current: v{version}","system.section.upgrade.latest":"Latest on npm: v{version}","system.section.upgrade.uptodate":"Up to date","system.section.upgrade.update":"Upgrade now","system.section.upgrade.upgrading":"Upgrading…","system.section.upgrade.checking":"Checking npm…","system.section.upgrade.checkError":"Check failed: {detail}","system.section.upgrade.upgradeError":"Upgrade failed: {detail}","system.section.upgrade.upgradeError.title":"Upgrade failed","system.section.upgrade.command":"Or run in terminal: {cmd}","system.section.upgrade.runningPipelines":"Pipelines running — stop them first: {projects}","system.section.diagnostics":"Diagnostics","system.section.diagnostics.help":"Run sps doctor across all projects, see failures at a glance","system.section.diagnostics.run":"Run diagnostics","system.section.diagnostics.running":"Running…","system.section.diagnostics.empty":"No projects","system.section.diagnostics.checkAria":"Check {project}","system.section.diagnostics.statusOk":"OK","system.section.diagnostics.statusFail":"Issues","system.section.diagnostics.error":"Diagnostic failed: {detail}","system.h1":"System ⚙️","system.runtime":"Runtime","system.memory.title":"Memory backend","system.memory.desc":"Global setting: which backend workers read/write memory through. Applies to newly dispatched cards.","system.memory.provider":"Backend","system.memory.url":"Custom URL","system.memory.url.placeholder":"http://127.0.0.1:3111","system.memory.save":"Save","system.memory.save.aria":"Save memory backend setting","system.memory.saved":"Saved","system.memory.error":"Save failed","system.memory.opt.none":"Off (none)","system.memory.opt.builtin":"Local file memory (builtin)","system.memory.opt.agentmemory":"agentmemory (semantic)","system.memory.opt.custom":"Custom REST (custom)","system.env.title.code":"~/.coral/env","system.env.title.prefix":"Global config ","system.env.edit.aria":"Edit env file","system.env.edit.button":"Edit","system.env.editing.label":"⚠ Editing","system.env.empty.before":'env file does not exist. Click "Edit" or run ',"system.env.empty.after":" in the terminal.","system.env.warning":"⚠ This file contains plaintext credentials. Keep mode 0600 on save.","system.env.aria":"env editor","system.env.dirtyMark":" · ● Unsaved","system.env.cancel":"Cancel","system.env.save":"Save","system.env.save.aria":"Save env","system.env.error.conflict.title":"env was modified elsewhere","system.env.error.save.title":"Save failed","system.env.error.conflict.body":"Cancel and reopen the editor.","system.upgrade.title":"Version","system.upgrade.checkLatest.aria":"Check latest version","system.upgrade.checkUpdate":"Check update","system.upgrade.label.current":"sps-cli (current)","system.upgrade.label.latest":"npm (latest)","system.upgrade.latestPill":"latest","system.upgrade.button.upgradeAria":"Upgrade to latest","system.upgrade.button.upgrade":"Upgrade","system.upgrade.button.copyAria":"Copy upgrade command","system.upgrade.button.copyTitle":"Copy command (run manually if auto upgrade fails)","system.upgrade.button.copy":"Copy command","system.upgrade.label.installed":"Installed","system.upgrade.installed.ok":"Active (restart console to see)","system.upgrade.installed.fail":"Upgrade not effective","system.upgrade.label.check":"Check","system.upgrade.confirm.title":"Upgrade sps-cli","system.upgrade.confirm.body":"Current {current}, upgrade to {latest}. Requires all pipelines stopped. Restart sps console after upgrade.","system.upgrade.confirm.button":"Upgrade","system.upgrade.success.title":"Upgrade complete","system.upgrade.success.body":'Installed v{version}. Run `pkill -f "sps console"` and restart to see it.',"system.upgrade.notEffective.title":"Upgrade not effective","system.upgrade.notEffective.same":"npm finished but the version did not change (still {version}) — likely a permissions or registry issue. Copy the command below to run manually.","system.upgrade.notEffective.notInstalled":"npm did not install a new version. Copy the command to run manually, or check the log below.","system.upgrade.error.title":"Upgrade failed","system.upgrade.copy.success.title":"Command copied","system.upgrade.copy.success.body":`Paste it into a terminal:
|
|
452
|
-
{cmd}`,"system.upgrade.copy.fail.title":"Copy failed","system.upgrade.copy.fail.body":`Copy manually:
|
|
453
|
-
{cmd}`,"system.diagnostics.title":"Project health check","system.diagnostics.checkAll":"Check all","system.diagnostics.empty":"No projects yet.","system.diagnostics.expandAria":"Expand","system.diagnostics.collapseAria":"Collapse","system.diagnostics.never":'Click "Check" to run sps doctor',"system.diagnostics.checkAria":"Check","system.diagnostics.check":"Check","system.diagnostics.noFixesNeeded":"Nothing to fix","system.diagnostics.fix.tip":"Run sps doctor <proj> --fix: auto-create .claude/hooks/stop.sh, state.json, etc.","system.diagnostics.fixAria":"Auto fix","system.diagnostics.fix":"Fix","system.diagnostics.fixed":"Fixed","system.diagnostics.error.fix":"doctor fix failed","system.diagnostics.error.check":"doctor check failed","chat.title":"Chat 💬","chat.empty.title":"Chat 💬","chat.empty.hint":'Click "New chat" on the left to start a session, or just type below — a session will be auto-created.',"chat.empty.shortcuts":"Enter to send · Shift+Enter for newline · streamed reply","chat.list.heading":"History {count}","chat.list.new":"New chat","chat.list.empty":"No chats yet. Click above to start.","chat.list.delete.aria":"Delete chat","chat.list.deleteCli.aria":"Remove this CLI session from the Console (does not affect Claude jsonl history)","chat.list.openAria":"Open chat {title}{cwd}","chat.list.cwdSuffix":" (cwd: {cwd})","chat.list.msgs":"{count} msg · {time}","chat.list.olderToggle":"Earlier · {count}","chat.detail.model.tooltip":"Current model in use","chat.detail.claudeSession.tooltip":"Underlying claude session id — the anchor for resuming session & memory","chat.delete.confirm.title":"Delete chat","chat.delete.confirm.body.cli":"Will be removed from the Console list (the daemon session is stopped). The Claude CLI history under ~/.claude/projects is preserved — to continue, run `sps agent --chat --name <name>` in a terminal.","chat.delete.confirm.body.console":"Chat history will be permanently deleted.","chat.delete.confirm.button":"Delete","chat.cli.banner.bold":"CLI session","chat.cli.banner":"This session was created by sps agent. The Console only shows history. To continue, run in a terminal:","chat.input.placeholder":"Say something… (Enter to send, Shift+Enter for newline, drag files / paste images)","chat.input.dragOver":"Drop to attach…","chat.input.aria":"Message input","chat.input.attach.aria":"Attach a local file","chat.input.attach.title":"Attach a local file (also drag / paste images)","chat.input.send":"Send","chat.input.send.aria":"Send","chat.input.interrupt":"Stop","chat.input.interrupt.aria":"Stop generation","chat.input.uploading":"Uploading…","chat.input.removeAttachment":"Remove {name}","chat.error.interrupt.title":"Interrupt failed","chat.cliBadge":"CLI","chat.cliBadge.tooltip":"Created by sps agent CLI; history is read live from Claude jsonl (read-only).","chat.session.title":"{title}","chat.session.id":"{id}","chat.session.empty":"Type a question below to start · Enter to send · Shift+Enter for newline","notFound.title":"404","notFound.body":"This page does not exist.","notFound.home":"Back to home","workers.active.empty":"No workers running.","workers.alerts.allHealthy":"All workers healthy","workers.alerts.pidDead":"PID dead.","workers.alerts.markerStale":"marker stale {ago}.","workers.capacity.col.project":"Project","workers.capacity.col.usage":"Usage","workers.capacity.col.other":"Other","workers.capacity.detailHint":"details →","workers.panel.boardLink":"Board →","workers.panel.loading":"Loading workers…","workers.panel.empty.slots":"This project has no worker slots.","workers.panel.empty.noWorker":"No workers","workers.panel.empty.pickOne":"Pick a worker","workers.panel.idle.short":"idle","workers.panel.section.currentCard":"Current card","workers.panel.idle.full":"Slot idle, no current card.","workers.panel.section.claudeOutput":"Claude output · last {n} lines","workers.panel.output.loading":"Loading…","workers.panel.output.empty":"No session output yet. The worker needs a few seconds to start.","workers.panel.section.heartbeat":"Supervisor heartbeat · last {n} lines","workers.panel.heartbeat.fullLog":"View full log →","workers.panel.action.restart":"Restart","workers.panel.action.restart.confirm.title":"Restart worker-{slot}","workers.panel.action.restart.confirm.body":"Kill the process, then re-launch onto #{seq}","workers.panel.action.restart.confirm.button":"Restart","workers.panel.action.restart.error":"Restart failed","workers.panel.action.kill":"Kill","workers.panel.action.kill.confirm.title":"Kill worker-{slot}","workers.panel.action.kill.confirm.body":"The current task will be force-aborted.","workers.panel.action.kill.confirm.button":"Kill","workers.panel.action.kill.error":"Kill failed","dialog.confirm.default":"OK","dialog.alert.default":"Got it","dialog.cancel.default":"Cancel","dirPicker.title.default":"Pick a directory","dirPicker.close.aria":"Close","dirPicker.up.aria":"Parent directory","dirPicker.up.title":"Parent directory","dirPicker.home.aria":"Back to home","dirPicker.home.title":"Back to home","dirPicker.loading":"Loading…","dirPicker.error.title":"Read failed","dirPicker.empty":"— empty —","dirPicker.enter.aria":"Enter {name}/","dirPicker.pickFile.aria":"Pick {name} (double-click to confirm)","dirPicker.fileLocked":"File not selectable","dirPicker.cancel":"Cancel","dirPicker.useFile":"Use this file","dirPicker.useFile.tooltip.empty":"Click a file first","dirPicker.useDir":"Use this directory","dirPicker.newDir":"New folder","dirPicker.newDir.aria":"Create a subdirectory in the current directory","dirPicker.newDir.prompt":"New folder name (letters, digits, _ . - only)","dirPicker.newDir.placeholder":"Folder name","dirPicker.newDir.create":"Create","dirPicker.newDir.error.title":"Failed to create folder","errorBoundary.title":"💥 UI crashed","errorBoundary.refresh":"Refresh page","chat.error.create.title":"Failed to create chat","chat.error.send.title":"Send failed","chat.error.fileTooBig.title":"File too large","chat.error.fileTooBig.body":"Per-file limit is 50 MB; this is {size} MB ({name})","chat.error.uploadAttachment.title":"Attachment upload failed","chat.placeholder.attachment":"(attachment)","chat.placeholder.viewAttachment":"(see attachment)","chat.placeholder.attachmentTitle":"Attachment","chat.attachment.previewTooltip":`{name}
|
|
454
|
-
{path}
|
|
455
|
-
Click to preview`,"chat.attachment.previewSimpleTooltip":`{name}
|
|
456
|
-
Click to zoom`,"chat.attachment.preview.aria":"Preview {name}","chat.attachment.close.aria":"Close","chat.attachment.readErr":"Read failed: {detail}","chat.attachment.loading":"Loading…","chat.attachment.unsupported":"This file type cannot be previewed inline.","chat.attachment.download":"Download","chat.message.role.you":"You","chat.message.role.error":"Error","chat.message.role.assistant":"assistant","chat.message.truncated":"⚠ Output exceeded 10MB and was truncated","chat.filePicker.title":"Pick attachment file","chat.newSession.title":"New chat","chat.newSession.title.aria":"New chat","chat.newSession.close.aria":"Close","chat.newSession.field.agent":"Agent","chat.newSession.field.model":"Model (optional)","chat.newSession.field.model.default":"Use global default model","chat.newSession.field.title":"Title (optional)","chat.newSession.field.title.placeholder":"Empty = auto-generate from first message","chat.newSession.field.cwd":"Working directory (optional)","chat.newSession.field.cwd.browse":"Browse","chat.newSession.field.cwd.browseAria":"Pick directory","chat.newSession.field.cwd.title":"Pick directory","chat.newSession.field.cwd.help1":"The agent reads/writes files here. Absolute path; must exist.","chat.newSession.field.cwd.help2":"Empty = use the daemon’s startup cwd.","chat.newSession.cancel":"Cancel","chat.newSession.create":"Create","cardModal.editing":"⚠ Editing","cardModal.title.aria":"Card title","cardModal.editAria":"Edit card","cardModal.edit":"Edit","cardModal.close.aria":"Close","cardModal.error.save.title":"Save failed","cardModal.error.load":"Load failed: {detail}","cardModal.skills.loading":"Loading skill list…","cardModal.label.removeAria":"Remove {label}","cardModal.label.addPlaceholder":"+ Add label","cardModal.label.addAria":"Add label","cardModal.label.note":"Note: AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX are managed by the pipeline; manual changes may be overwritten","cardModal.section.description":"Description","cardModal.section.empty":"(empty)","cardModal.section.checklist":"Checklist","cardModal.checklist.empty":"No checklist items. Add `- [ ] item` syntax in the description.","cardModal.section.log":"Log","cardModal.body.aria":"Card description","cardModal.body.replaceNote":'Only replaces the "## Description" section; checklist and log sections are untouched.',"cardModal.action.launch":"Launch worker","cardModal.action.launch.disabledDone":"Card is done; drag back to Todo to launch","cardModal.action.launch.disabledRunning":"Pipeline is running — supervisor dispatches automatically, no manual launch needed","cardModal.action.launch.error":"Launch worker failed","cardModal.action.reset":"Reset card","cardModal.action.reset.confirm.title":"Reset card #{seq}","cardModal.action.reset.confirm.body":"Card state goes back to initial; checklist progress is cleared.","cardModal.action.reset.confirm.button":"Reset","cardModal.action.reset.error":"Reset failed","cardModal.action.delete":"Delete card","cardModal.action.delete.confirm1.title":"Delete card #{seq}","cardModal.action.delete.confirm1.body":'About to delete "{title}". This cannot be undone (the md file is physically removed). Continue?',"cardModal.action.delete.confirm1.button":"Continue","cardModal.action.delete.confirm2.title":"Final confirmation","cardModal.action.delete.confirm2.body":"Please re-confirm deleting card #{seq}.","projectDetail.tab.skills":"Skills","projectDetail.tab.rules":"Rules","projectDetail.skills.title":"Skill whitelist","projectDetail.skills.desc":"Pick which skills this project loads. Narrows what workers, subagents and chat see — cuts token cost.","projectDetail.skills.noPolicy":"No whitelist — all skills are available (subagents load the full set from disk).","projectDetail.skills.hasPolicy":"Whitelist active — {count} skill(s) eligible.","projectDetail.skills.save":"Save whitelist","projectDetail.skills.clear":"Clear (load all)","projectDetail.skills.saveError":"Failed to save whitelist","projectDetail.skills.applied":"Saved. Projected {linked} linked, {pruned} pruned.","projectDetail.skills.unknown":"Unknown skill name(s), ignored: {names}","projectDetail.skills.empty":"No skills installed. Run `sps skill sync` first.","projectDetail.skills.selectAll":"Select all","projectDetail.skills.selectNone":"Select none","projectDetail.rules.title":"Project rules (read-only)","projectDetail.rules.readonly":"sps-cli only reads these. Editing is done at project creation or by an agent later.","projectDetail.rules.missing":"Not present","nav.prompts":"Prompts","prompts.title":"Prompt library","prompts.desc":"Reusable prompts with {{variable}} templates. Insert them into chat.","prompts.new":"New prompt","prompts.search":"Search prompts…","prompts.empty":"No prompts yet. Create one.","prompts.name":"Name","prompts.namePlaceholder":"kebab-case, e.g. code-review","prompts.nameError":"Name must be kebab-case (a-z, 0-9, dashes).","prompts.description":"Description","prompts.tags":"Tags","prompts.tagsPlaceholder":"comma,separated","prompts.body":"Body","prompts.bodyPlaceholder":"Write your prompt. Use {{variable}} for fill-ins.","prompts.favorite":"Favorite","prompts.save":"Save","prompts.delete":"Delete","prompts.deleteConfirm":'Delete prompt "{name}"? This removes the file.',"prompts.saveError":"Failed to save prompt","prompts.vars":"Variables: {names}","prompts.noVars":"No variables","prompts.insert":"Insert a prompt","prompts.selectHint":"Select a prompt on the left, or create a new one.","prompts.tagAdd":"Type a tag, press Enter","prompts.ai":"AI generate","prompts.ai.title":"AI generate a prompt","prompts.ai.intent":"Describe what you want","prompts.ai.placeholder":"e.g. a prompt for reviewing TypeScript code for security issues","prompts.ai.submit":"Generate","prompts.ai.wait":"The agent is writing… this can take a while.","prompts.ai.error":"Generation failed","skills.import":"Import","skills.import.title":"Import a skill","skills.import.name":"Name (kebab-case)","skills.import.body":"SKILL.md content","skills.import.submit":"Import","skills.import.error":"Import failed","skills.export":"Export SKILL.md","skills.updates.badge":"{count} update(s) available","skills.updates.none":"Up to date","skills.ai":"AI create","skills.ai.title":"AI create a skill","skills.ai.name":"Name (kebab-case)","skills.ai.intent":"What is this skill for?","skills.ai.placeholder":"e.g. how to write idiomatic Rust error handling","skills.ai.submit":"Create","skills.ai.wait":"The agent is writing the skill… this can take a while.","skills.ai.error":"Create failed","projectDetail.tab.graph":"Code Graph","projectDetail.tab.logs":"Logs","graph.title":"Code Graph","graph.desc":"A symbol-level dependency graph of this project (tree-sitter, zero-token). Gives agents surgical context so they explore fewer files.","graph.build":"Build graph","graph.rebuild":"Rebuild","graph.building":"Building…","graph.sync":"Sync","graph.syncing":"Syncing…","graph.sync.desc":"Incremental — only re-index changed files (fast)","graph.empty":"No graph yet — build one to enable agent navigation and the dependency view.","graph.buildFailed":"Build failed","graph.stat.files":"Files","graph.stat.nodes":"Nodes","graph.stat.edges":"Edges","graph.stat.db":"DB size","graph.stat.lastBuilt":"Last built","graph.viz.title":"File dependency graph","graph.viz.loading":"Loading graph…","graph.viz.empty":"Build the graph to see the dependency view.","graph.viz.hint":"Node = file · edge = import · drag to explore · search to highlight","graph.viz.search":"Highlight files…"},k3={"app.title":"SPS 控制台","nav.chat":"对话","nav.projects":"项目","nav.board":"看板","nav.workers":"Workers","nav.logs":"日志","nav.skills":"技能","nav.system":"系统","nav.processes":"进程","nav.audit":"审计日志","nav.memory":"记忆","nav.plugins":"插件","plugins.h1":"插件 🧩","plugins.desc":"全局插件开关。改动对之后新派发的卡生效。","plugins.tab.memory":"记忆","plugins.tab.channel":"频道","plugins.tab.model":"模型","plugins.tab.tool":"工具","plugins.comingSoon":"即将上线","plugins.model.title":"智能体模型","plugins.model.desc":"配置两个智能体的模型(全局)。worker=claude 执行、review·designer=openai 监工+编排。","plugins.model.worker":"Worker(执行 / claude)","plugins.model.reviewer":"Review·Designer(监工 / openai)","plugins.model.provider":"Provider","plugins.model.model":"模型","plugins.model.official":"官方 claude(默认)","plugins.model.save":"保存","plugins.model.saved":"已保存","plugins.model.error":"保存失败","nav.arrange":"编排","arrange.h1":"智能编排 🧭","arrange.project":"项目","arrange.none":"尚未开始 — 点上方「启动」拉起编排(几秒后出任务清单,确认即跑)。若下拉无项目,先在「新建项目」选智能编排模式。","arrange.start":"启动","arrange.stop":"停止","arrange.startErr":"启动/停止失败","arrange.view":"切换画板视图","arrange.viewFree":"自由","arrange.viewLane":"泳道","arrange.starting":"启动中,正在拆解任务清单…","arrange.planning":"正在拆解任务清单…","arrange.orchestrating":"正在编排中…","arrange.status":"状态","arrange.goal":"目标","arrange.plan":"任务清单 + 卡链路","arrange.approve":"确认任务清单","arrange.approveErr":"确认失败","arrange.tasks":"任务清单","arrange.collapse":"收起","arrange.expand":"展开任务清单","arrange.noCards":"暂无卡片 — 等待 orchestrator 派卡(确认清单后开始)。","arrange.cardPrompt":"卡片提示词","arrange.cardSkills":"技能","arrange.cardTask":"所属任务","arrange.cardLog":"日志","arrange.close":"关闭","arrange.cardsCount":"张卡","nav.aria":"主导航","memory.sub":"跨项目记忆 · 经 console 鉴权代理 agentmemory","memory.searchPlaceholder":"搜索记忆…(如:三消美术竞态怎么修)","memory.search":"搜索","memory.results":"召回结果","memory.rawHint":"(原始观察 · 接入实时捕获+压缩后这里会显示提炼的教训)","memory.sessions":"最近会话","memory.empty":"暂无记忆 · 接入实时捕获(P1)后自动累积","processes.title":"进程监控","processes.subtitle":"SPS ACP 启动的 claude 进程(其它途径启动的,如你自己的会话,不显示)","processes.refresh":"刷新","processes.aliveCount":"运行中 {n}","processes.col.kind":"类型","processes.col.slot":"会话槽","processes.col.project":"项目","processes.col.state":"状态","processes.col.memory":"内存","processes.col.action":"操作","processes.empty":"没有 SPS 进程","processes.filter.all":"全部","processes.filter.alive":"运行中","processes.filter.offline":"离线","processes.kind.all":"全部类型","processes.kind.worker":"构建 Worker","processes.kind.chat":"对话","processes.kill":"关闭","processes.killConfirm":"确定关闭进程 {slot}?","audit.title":"审计日志","audit.subtitle":"项目生命周期:创建 / 修改 / 删除","audit.refresh":"刷新","audit.filter.all":"全部","audit.action.create":"创建","audit.action.modify":"修改","audit.action.delete":"删除","audit.action.daemon":"Daemon","audit.col.time":"时间","audit.col.action":"动作","audit.col.project":"项目","audit.col.detail":"详情","audit.empty":"暂无审计记录","lang.toggle.aria":"切换界面语言","lang.en":"EN","lang.zh":"中","status.server":"服务","status.offline":"离线","status.sse.open":"SSE","status.sse.connecting":"SSE·连接中","status.sse.down":"SSE·断开","status.pipelines.tooltip":"活跃流水线数","status.workers.tooltip":"活跃 Worker 数","status.pipeline.unit":"流水线","status.worker.unit":"Worker","common.save":"保存","common.cancel":"取消","common.delete":"删除","common.confirm":"确认","common.create":"创建","common.edit":"编辑","common.close":"关闭","common.loading":"加载中…","common.error":"出错","common.retry":"重试","common.empty":"暂无内容","common.search":"搜索","common.refresh":"刷新","common.copy":"复制","common.copied":"已复制","common.yes":"是","common.no":"否","common.required":"必填","common.optional":"可选","common.ok":"好","projects.title":"项目 🎯","projects.count":"本机有 {count} 个项目","projects.refresh.hint":"点击刷新重试","projects.new":"新建项目","projects.selectHint":"在左侧选择一个项目查看详情。","projects.sort.label":"排序方式","projects.sort.activity":"活跃度","projects.sort.date":"修改日期","projects.sort.name":"名字","projects.load.failed":"加载失败","projects.empty.title":"还没有项目 ✨","projects.empty.hint":"运行 {cmd} 创建第一个项目。","newProject.title":"新建项目","newProject.subtitle":"配置一个项目,worker 自动开跑","newProject.field.mode":"执行模式","newProject.field.mode.pipeline":"自动工作流","newProject.field.mode.pipelineDesc":"固定阶段流水线,claude worker 按卡执行","newProject.field.mode.smart":"智能编排","newProject.field.mode.smartDesc":"OpenAI 监工动态派卡 + claude worker 执行","newProject.field.mode.pipelineHint":"传统模式:你建卡片,worker 按阶段跑。","newProject.field.mode.smartHint":"给一个总目标,OpenAI 监工每轮探查产物、动态生成任务卡、驱动 claude 完成。","newProject.field.goal":"总目标 (GOAL.md)","newProject.field.goal.hint":"写入 docs/GOAL.md;智能编排据此拆任务清单。缺失则 tick 跳过该项目。","newProject.field.goal.placeholder":"例:做一个纯前端、单文件可运行的贪吃蛇网页小游戏…","newProject.field.name":"项目名","newProject.field.name.help":"只允许小写字母、数字、_ 和 -","newProject.field.dir":"项目目录","newProject.field.dir.preview":"项目将创建在 →","newProject.field.dir.help":"绝对路径;不存在会自动创建","newProject.field.branch":"合并目标分支","newProject.field.branch.help":"默认 main","newProject.field.maxWorkers":"最大并发 Worker 数","newProject.field.maxWorkers.help":"单项目并发数(推荐 1)","newProject.field.ackTimeout":"ACK 超时(秒)","newProject.field.ackTimeout.help":"Worker 响应等待秒数(默认 300)","newProject.field.gitlabProject":"GitLab/GitHub 远程","newProject.field.gitlabProject.help":"格式:用户名/仓库(可选)","newProject.field.matrixRoom":"Matrix 房间 ID","newProject.field.matrixRoom.help":"可选;不填则用全局默认","newProject.field.git":"启用 git","newProject.field.git.help":"关闭 → 非代码项目,跳过 commit/push/MR","newProject.submit":"创建项目","newProject.creating":"创建中…","newProject.created":"项目已创建","newProject.error.dirRequired":"项目目录必填","newProject.dir.browse":"浏览","newProject.dir.browseAria":"选择目录","newProject.back":"返回","newProject.back.aria":"返回项目列表","newProject.field.name.placeholder":"例如:acme-web","newProject.field.name.example":"只能用字母、数字、下划线、连字符。例如 acme-web","newProject.field.name.invalid":"名称只能包含 a-z A-Z 0-9 _ -","newProject.field.dir.long":"本机绝对路径的【项目目录】。选中的目录本身就是项目根;项目名默认取目录名。已有代码 → 收编(只加 .claude/ 配置,不动源码);空目录 → 新建。","newProject.field.dir.placeholder":"/home/you/projects/my-app","newProject.field.dir.createIfMissing":"目录不存在时自动创建(推荐 —— 否则 .claude/ 安装会被跳过)","newProject.field.dir.pickerTitle":"选择项目目录","newProject.field.dir.adopt":"检测到已有内容 → 将收编(只加配置,不动源码)","newProject.field.dir.fresh":"空目录 → 新建项目","newProject.field.name.derived":"项目名(默认取目录名,可微调)","newProject.field.maxWorkers.short":"最大 Worker 数","newProject.field.ackTimeout.minutes":"ACK 超时(分钟)","newProject.field.ackTimeout.minutes.help":"Worker 启动后多久没 ACK 视为失败","newProject.field.git.label":"启用 Git(Worker 自动 commit + push)","newProject.field.git.detail":"关闭后 Worker 只做任务、不做版本控制;适合文档/数据处理等非代码项目。","newProject.field.review.label":"启用清单验收(每卡完成后独立 agent 审核)","newProject.field.review.detail":"开启后:卡带「检查清单」的,Worker 完成后由独立 reviewer 逐条对着真实产物验收;全过留 Done,有不过自动插一张修正卡(优先跑)。无清单的卡不审。建卡时用 --checklist 写验收点。","newProject.field.git.branch":"合并分支","newProject.field.gitlabProject.label":"Git 远程项目路径","newProject.field.gitlabProject.help2":"如 user/repo,空则跳过远程 API(只本地 commit/push)","newProject.field.gitlabProject.placeholder":"user/repo","newProject.field.gitlabProjectId":"GitLab 项目 ID","newProject.field.gitlabProjectId.help":"数字;GitHub 用户留空","newProject.field.gitlabProjectId.placeholder":"42","newProject.section.notifications":"通知","newProject.field.matrixRoom.label":"Matrix 房间 ID","newProject.field.matrixRoom.help2":"空则使用全局配置;不填 = 不通知","newProject.field.matrixRoom.placeholder":"!abc:matrix.example.com","newProject.error.create.title":"创建失败","projectDetail.tab.pipeline":"流水线","projectDetail.tab.conf":"配置","projectDetail.tab.delete":"删除项目","projectDetail.delete.title":"删除该项目","projectDetail.delete.warn":"会删除项目配置、运行时和 worktree。{repoDir} 下的代码仓库不动。","projectDetail.delete.confirmLabel":"输入项目名以确认","projectDetail.delete.button":"删除项目","projectDetail.delete.deleting":"删除中…","projectDetail.lastActivity":"最后活跃","projectDetail.notFound":"项目不存在","projectDetail.notFoundHint":"可能已被删除或重命名。","projectDetail.backToList":"返回项目列表","pipeline.editor.title":"流水线 YAML","pipeline.editor.savedAt":"{time} 已保存","pipeline.editor.unsaved":"有未保存的修改","pipeline.editor.save":"保存","pipeline.editor.saving":"保存中…","pipeline.editor.reload":"从磁盘重新加载","pipeline.editor.discard.title":"放弃未保存的修改?","pipeline.editor.discard.body":"你的编辑会丢失。","pipeline.editor.errors":"YAML 解析错误","pipeline.editor.list":"流水线","pipeline.editor.list.add":"新建流水线","pipeline.editor.list.delete":"删除流水线","pipeline.editor.list.use":"设为当前","pipeline.editor.list.activeBadge":"当前","pipeline.editor.list.sample":"示例","pipeline.editor.delete.confirm.title":"删除流水线 {name}?","pipeline.editor.delete.confirm.body":"此操作不可撤销。","pipeline.newDialog.title":"新建流水线","pipeline.newDialog.field.filename":"文件名","pipeline.newDialog.field.filename.help":"只允许字母、数字、_ 和 -;自动追加 .yaml","pipeline.newDialog.field.copyFrom":"复制自","pipeline.newDialog.copyFrom.sample":"示例模板","pipeline.newDialog.copyFrom.active":"当前活动","pipeline.newDialog.create":"创建","projectDetail.tab.overview":"概览","projectDetail.tab.config":"配置","projectDetail.tab.pipelines":"流水线","projectDetail.tab.danger":"危险操作","projectDetail.openBoard":"看板","projectDetail.overview.repoDir":"仓库路径","projectDetail.overview.pmBackend":"PM 后端","projectDetail.overview.agent":"Agent","projectDetail.overview.cards":"卡片","projectDetail.overview.cards.value":"共 {total} 张 · {inprogress} 进行中 · {done} 完成","projectDetail.overview.workers":"Worker","projectDetail.overview.workers.value":"共 {total} 个({active} 活跃)","projectDetail.overview.pipeline":"Pipeline","projectDetail.overview.lastActivity":"最近活动","projectDetail.overview.notFound":"项目 {name} 不存在或无法读取。","projectDetail.config.confDirty":"● 未保存的修改","projectDetail.config.reload":"重新加载","projectDetail.config.save":"保存","projectDetail.config.saveAria":"保存配置","projectDetail.config.editorAria":"conf 文件编辑器","projectDetail.config.error.conflict.title":"配置已被其他地方修改","projectDetail.config.error.conflict.body":'conf 文件在你编辑期间被改过。点"重新加载"后再编辑。',"projectDetail.config.error.save.title":"保存失败","projectDetail.config.error.load":"加载失败:{detail}","projectDetail.pipelines.title":"流水线","projectDetail.pipelines.add":"新建流水线","projectDetail.pipelines.empty":'还没有流水线文件。点"新建流水线"开始。',"projectDetail.pipelines.activeBadge":"当前","projectDetail.pipelines.edit":"编辑","projectDetail.pipelines.editAria":"编辑 {name}","projectDetail.pipelines.switch":"切换","projectDetail.pipelines.switchAria":"切换到 {name}","projectDetail.pipelines.switch.confirm.title":"切换到 {name}","projectDetail.pipelines.switch.confirm.body":"当前 project.yaml 会被 {name} 的内容覆盖。继续?","projectDetail.pipelines.switch.confirm.button":"切换","projectDetail.pipelines.switch.error":"切换失败","projectDetail.pipelines.delete.confirm.title":"删除 {name}","projectDetail.pipelines.delete.confirm.body":"这个流水线文件会被永久删除。","projectDetail.pipelines.delete.error":"删除失败","projectDetail.pipelines.deleteAria":"删除 {name}","projectDetail.pipelines.create.error":"创建失败","projectDetail.danger.title":"删除项目","projectDetail.danger.body":"这会清理 {path}(包括所有卡片、runtime、logs)。","projectDetail.danger.includeClaude.label":"同时清理 repo 的 .claude/","projectDetail.danger.includeClaude.note":"repo 本身不动,只清这个目录。","projectDetail.danger.confirmPrompt":"输入项目名 {name} 确认:","projectDetail.danger.deleteAria":"永久删除项目","projectDetail.danger.deleteButton":"永久删除","projectDetail.danger.deleted.title":"已删除","projectDetail.danger.deleted.bodyWithList":`项目已删除。同时清理了:
|
|
457
|
-
{paths}`,"projectDetail.danger.deleted.body":"项目已删除。","projectDetail.danger.error":"删除失败","pipelineEditor.close":"关闭","pipelineEditor.error.conflict.title":"文件已被其他地方修改","pipelineEditor.error.yaml.title":"YAML 语法错误","pipelineEditor.error.save.title":"保存失败","pipelineEditor.error.serialize.title":"YAML 序列化失败","pipelineEditor.error.load":"加载失败:{detail}","pipelineEditor.mode.structured":"结构化","pipelineEditor.mode.yaml":"原始 YAML","pipelineEditor.parseError.prefix":"YAML 解析:{detail}","pipelineEditor.activeWarning":"⚠ 这是当前激活的流水线,保存后下一轮 tick 生效","pipelineEditor.yamlAria":"pipeline YAML 编辑器","pipelineEditor.status.unsaved":"● 未保存","pipelineEditor.status.saved":"已保存","pipelineEditor.status.noChanges":"无变化","pipelineEditor.reload":"重新加载","pipelineEditor.save":"保存","pipelineEditor.saveAria":"保存 pipeline","pipelineEditor.activeBadge":"当前","pipelineEditor.modeHint":"project = 事件驱动流水线(默认) · steps = 顺序脚本","pipelineEditor.stages.heading":"Stages({count})","pipelineEditor.stages.add":"添加 stage","pipelineEditor.stages.empty":'还没 stage。点"添加 stage"开始。',"pipelineEditor.stage.name.hint":"stage 唯一名","pipelineEditor.stage.profile.hint":"skill 画像,可空","pipelineEditor.stage.cardState.hint":"本 stage 期间卡片状态","pipelineEditor.stage.timeout.hint":"可选,如 30m 2h","pipelineEditor.stage.trigger.hint":"触发条件,可空走默认","pipelineEditor.stage.onComplete.hint":"成功后动作","pipelineEditor.stage.onFail.action.hint":"失败时动作,如 label NEEDS-FIX","pipelineEditor.stage.onFail.comment.hint":"写进卡片的注释","pipelineEditor.stage.halt.note":"(失败后停流水线;去掉则继续下一张卡)","pipelineEditor.stage.moveUp":"上移","pipelineEditor.stage.moveDown":"下移","pipelineEditor.stage.remove":"删除 stage","newPipelineDialog.title":"新建流水线","newPipelineDialog.field.filename.label":"文件名","newPipelineDialog.field.filename.placeholder":"例如 ci","newPipelineDialog.field.filename.help":"实际会保存为 {filename}。只允许 a-z A-Z 0-9 _ -;已有同名文件会 409 报错。","newPipelineDialog.section.template":"初始内容","newPipelineDialog.template.blank.label":"空白模板","newPipelineDialog.template.blank.desc":"最简 1 stage(develop → Done)","newPipelineDialog.template.sample.label":"教学模板","newPipelineDialog.template.sample.desc":"从 sample.yaml.example 复制(带注释,讲解所有字段)","newPipelineDialog.template.sample.unavailable":"sample.yaml.example 不存在","newPipelineDialog.template.active.label":"复制当前活动的","newPipelineDialog.template.active.desc":"从 project.yaml 复制(基于目前的配置改)","newPipelineDialog.template.active.unavailable":"project.yaml 不存在","newPipelineDialog.create.aria":"创建 pipeline","newPipelineDialog.cancel":"取消","board.title":"看板 ✨","board.title.bare":"看板","board.subtitle":"{name} · {cards} 张卡片 · {workers} workers 活跃","board.pickPrompt.title":"选择一个项目 🎯","board.pickPrompt.body":"看板按项目分。挑一个开始:","board.action.start":"启动","board.action.stop":"停止","board.action.startAria":"启动 pipeline","board.action.stopAria":"停止 pipeline","board.action.startError":"启动 pipeline 失败","board.action.stopError":"停止 pipeline 失败","board.action.reset":"重置","board.action.resetError":"重置失败","board.action.reset.confirm.title":"重置整个流水线","board.action.reset.confirm.body":"这会清空所有卡片的运行状态、worker marker、分支。不可撤销。","board.action.reset.confirm.button":"重置全部","board.action.newCard":"新卡片","board.action.newCard.error":"新建卡片失败","board.action.moveCard.error":"移动卡片失败","board.search.placeholder":"搜索标题 / skill / label…","board.search.aria":"搜索卡片","board.filter.clear":"清空","board.filter.clearAria":"清空筛选","board.filter.aria":"按 {label} 筛选","board.filter.clearSelection":"清空选择","board.error.loadCards":"加载卡片失败","board.col.planning":"Planning","board.col.backlog":"Backlog","board.col.todo":"Todo","board.col.inprogress":"Inprogress","board.col.qa":"QA / Review","board.col.done":"Done","kanban.checklist.label":"检查清单 {done}/{total}","kanban.checklist.more":"… 还有 {count} 条","kanban.column.empty":"— 空 —","kanban.time.justNow":"刚才","kanban.time.minutes":"{n} 分钟前","kanban.time.hours":"{n} 小时前","kanban.time.days":"{n} 天前","newCard.title":"新建卡片","newCard.field.title":"标题 *","newCard.field.title.placeholder":"例如:接入 GitHub OAuth 登录","newCard.field.title.help":"写简短明了的目标(<200 字符)","newCard.field.description":"描述","newCard.field.description.placeholder":"用户故事、需求、验收标准、参考资料… Claude 启动时会读这里的内容","newCard.field.description.help":"支持 markdown。空的话就只有 title,Claude 只能靠 title 推断要做啥。","newCard.field.skills":"技能","newCard.field.skills.help":"勾选哪些 skill 会被加载(走 frontmatter `skills:`)。不选也行,Worker 默认加载项目级 skills。","newCard.field.skills.loading":"加载 skill 列表…","newCard.field.skills.error":"skill 列表加载失败,不影响创建:{detail}","newCard.field.skills.selected":"已选 {count} 个:{names}","newCard.field.dispatch":"派发","newCard.field.dispatch.label":"立即派发执行(直接进 Backlog)","newCard.field.dispatch.help":"默认不勾:卡进 Planning 暂存,等你看板上拖到 Backlog 再开工。勾上:跳过暂存,下次 tick 直接派 worker 跑。","newCard.create.aria":"创建卡片","cardDetail.loading":"加载中…","cardDetail.error.load":"卡片加载失败","cardDetail.tabs.overview":"概览","cardDetail.tabs.body":"描述","cardDetail.tabs.checklist":"检查清单","cardDetail.tabs.history":"历史","cardDetail.tabs.actions":"操作","cardDetail.field.state":"状态","cardDetail.field.skills":"技能","cardDetail.field.labels":"标签","cardDetail.field.branch":"分支","cardDetail.field.assignee":"处理人","cardDetail.field.created":"创建时间","cardDetail.field.updated":"更新时间","cardDetail.field.empty":"—","cardDetail.actions.delete":"删除卡片","cardDetail.actions.delete.confirm.title":"删除卡片 #{seq}","cardDetail.actions.delete.confirm.body":"该卡片会被永久删除。","cardDetail.actions.delete.error":"删除失败","cardDetail.actions.update.error":"更新失败","cardDetail.body.empty":"没有描述","cardDetail.checklist.empty":"没有检查清单","cardDetail.checklist.progress":"进度 {done}/{total}","cardDetail.history.empty":"没有历史记录","cardDetail.notFound":"卡片 #{seq} 不存在","cardDetail.copy.aria":"复制 seq","cardDetail.close.aria":"关闭","cardDetail.save":"保存","cardDetail.saving":"保存中…","workers.title":"Workers 👷","workers.summary":"跨 {projects} 项目 · {running} 跑 · {starting} 启动 · {stuck} 卡 · {crashed} 崩 · {idle} 闲","workers.summary.stuck":"{n} 卡","workers.summary.crashed":"{n} 崩","workers.refresh.aria":"刷新","workers.refresh":"刷新","workers.error.load":"加载失败:{detail}","workers.empty.hint":"点击项目 / worker 查看详情","logs.title":"日志 📜","logs.subtitle.allProjects":"全部项目","logs.subtitle.project":"{name} 实时日志","logs.filter.errors":"只看错误","logs.filter.errors.aria":"只显示错误","logs.filter.search.placeholder":"过滤消息…","logs.empty":"还没有日志 —— 等待事件中","logs.error.load":"日志加载失败","logs.refresh":"刷新","logs.refresh.aria":"刷新日志","logs.scroll.bottom.aria":"滚动到底部","logs.scroll.pause":"已暂停(自动滚动关闭)","logs.scroll.resume":"恢复自动滚动","logs.subtitle.allProjectsCount":"全部项目({count})","logs.poll.5s":"5s 轮询","logs.paused":"⏸ 已暂停","logs.mode.live":"实时","logs.mode.history":"历史","logs.history.startAria":"查询起始时间","logs.history.queryAria":"查询","logs.history.query":"查询","logs.filter.project.aria":"筛选项目","logs.filter.project.all":"全部项目","logs.filter.keyword.placeholder":"过滤关键字…","logs.filter.keyword.aria":"过滤日志","logs.empty.match":"没有匹配的日志","skills.title":"技能 🧠","skills.subtitle":"跨项目共用的 skill(用 `sps skill ...` 管理)","skills.empty.title":"还没有 skill","skills.empty.hint":"运行 {cmd} 同步 bundled skills。","skills.linked.tooltip":"已链接到该项目","skills.frozen.tooltip":"已冻结(项目独立副本)","skills.category.all":"全部","skills.category.language":"语言","skills.category.end":"终端","skills.category.persona":"角色","skills.category.workflow":"流程","skills.category.other":"其它","skills.subtitleCount":"{count} 个 user-level skill","skills.search.placeholder":"搜索 skill…","skills.search.aria":"搜索 skill","skillDetail.actionFailed":"{label}失败","skillDetail.unfreezeAction":"解冻","skillDetail.freezeAction":"冻结","skillDetail.removeAction":"移除","skillDetail.removeConfirm.title":"从 {project} 移除 {name}","skillDetail.removeConfirm.body":"skill 链接会被解除,项目后续运行时将无法使用该 skill。","skillDetail.removeConfirm.button":"移除","skillDetail.unfreezeConfirm.title":"解冻 {name} @ {project}","skillDetail.unfreezeConfirm.body":"本地对这个 skill 的改动会被覆盖,回到最新共享版本。","skillDetail.unfreezeConfirm.button":"解冻","skillDetail.close.aria":"关闭","skillDetail.loading":"加载中…","skillDetail.error.load":"加载失败:{detail}","skillDetail.section.projects":"项目链接状态","skillDetail.section.empty":"还没有任何项目。先去创建一个项目。","skillDetail.section.preview":"SKILL.md 预览","skillDetail.toggleSection.aria":"{action} {file}","skillDetail.expand":"展开","skillDetail.collapse":"收起","system.title":"系统 🛠","system.subtitle":"全局配置 + 诊断 + 升级","system.section.env":"全局 env","system.section.env.help":"存储在 ~/.coral/env(mode 600)。所有项目共用。","system.section.env.save":"保存 env","system.section.env.error.conflict":"env 已被其它地方修改","system.section.env.error.save":"保存 env 失败","system.section.env.error.load":"加载 env 失败","system.section.env.dirtyDot":"● 未保存","system.section.env.aria":"env 编辑器","system.section.env.reload":"重新加载","system.section.upgrade":"升级","system.section.upgrade.current":"当前:v{version}","system.section.upgrade.latest":"npm 最新:v{version}","system.section.upgrade.uptodate":"已是最新","system.section.upgrade.update":"立即升级","system.section.upgrade.upgrading":"升级中…","system.section.upgrade.checking":"正在查询 npm…","system.section.upgrade.checkError":"查询失败:{detail}","system.section.upgrade.upgradeError":"升级失败:{detail}","system.section.upgrade.upgradeError.title":"升级失败","system.section.upgrade.command":"或在终端执行:{cmd}","system.section.upgrade.runningPipelines":"有 pipeline 在跑,先停止:{projects}","system.section.diagnostics":"诊断","system.section.diagnostics.help":"一次性跑所有项目的 sps doctor,看哪些项目出问题","system.section.diagnostics.run":"运行诊断","system.section.diagnostics.running":"运行中…","system.section.diagnostics.empty":"没有项目","system.section.diagnostics.checkAria":"检查 {project}","system.section.diagnostics.statusOk":"正常","system.section.diagnostics.statusFail":"有问题","system.section.diagnostics.error":"诊断失败:{detail}","system.h1":"系统 ⚙️","system.runtime":"运行时","system.memory.title":"记忆后端","system.memory.desc":"全局设置:worker 的记忆读写走哪个后端。改动对新派发的卡生效。","system.memory.provider":"后端","system.memory.url":"自定义 URL","system.memory.url.placeholder":"http://127.0.0.1:3111","system.memory.save":"保存","system.memory.save.aria":"保存记忆后端设置","system.memory.saved":"已保存","system.memory.error":"保存失败","system.memory.opt.none":"关闭(none)","system.memory.opt.builtin":"本地文件记忆(builtin)","system.memory.opt.agentmemory":"agentmemory(语义库)","system.memory.opt.custom":"自定义 REST(custom)","system.env.title.code":"~/.coral/env","system.env.title.prefix":"全局配置 ","system.env.edit.aria":"编辑 env 文件","system.env.edit.button":"编辑","system.env.editing.label":"⚠ 编辑模式","system.env.empty.before":'env 文件不存在。点"编辑"或者终端运行 ',"system.env.empty.after":"。","system.env.warning":"⚠ 文件包含凭证明文。保存时保持 0600 权限。","system.env.aria":"env 文件编辑器","system.env.dirtyMark":" · ● 未保存","system.env.cancel":"取消","system.env.save":"保存","system.env.save.aria":"保存 env","system.env.error.conflict.title":"env 被其他地方修改了","system.env.error.save.title":"保存失败","system.env.error.conflict.body":"请点取消后重开编辑。","system.upgrade.title":"版本","system.upgrade.checkLatest.aria":"检查最新版本","system.upgrade.checkUpdate":"检查更新","system.upgrade.label.current":"sps-cli(当前)","system.upgrade.label.latest":"npm(最新)","system.upgrade.latestPill":"最新","system.upgrade.button.upgradeAria":"升级到最新版本","system.upgrade.button.upgrade":"升级","system.upgrade.button.copyAria":"复制升级命令","system.upgrade.button.copyTitle":"自动升级失败时手动跑","system.upgrade.button.copy":"复制命令","system.upgrade.label.installed":"已安装","system.upgrade.installed.ok":"已生效(重启 console 后可见)","system.upgrade.installed.fail":"未升级成功","system.upgrade.label.check":"检查","system.upgrade.confirm.title":"升级 sps-cli","system.upgrade.confirm.body":"当前 {current},升级到 {latest}。要求所有 pipeline 已停止。升级后请重启 sps console 生效。","system.upgrade.confirm.button":"升级","system.upgrade.success.title":"升级完成","system.upgrade.success.body":'装上了 v{version}。请 `pkill -f "sps console"` 再重启以生效。',"system.upgrade.notEffective.title":"升级未生效","system.upgrade.notEffective.same":"npm 执行完毕但版本没变(仍 {version})——多半是权限或 registry 问题。可复制下面的命令在终端手动跑。","system.upgrade.notEffective.notInstalled":"npm 没装上新版本。可复制命令手动跑,或看下面日志定位。","system.upgrade.error.title":"升级失败","system.upgrade.copy.success.title":"命令已复制","system.upgrade.copy.success.body":`粘贴到终端运行即可:
|
|
458
|
-
{cmd}`,"system.upgrade.copy.fail.title":"复制失败","system.upgrade.copy.fail.body":`请手动复制:
|
|
459
|
-
{cmd}`,"system.diagnostics.title":"项目健康检查","system.diagnostics.checkAll":"检查全部","system.diagnostics.empty":"还没有项目。","system.diagnostics.expandAria":"展开","system.diagnostics.collapseAria":"折叠","system.diagnostics.never":'点 "检查" 运行 sps doctor',"system.diagnostics.checkAria":"检查","system.diagnostics.check":"检查","system.diagnostics.noFixesNeeded":"已无可修问题","system.diagnostics.fix.tip":"调 sps doctor <proj> --fix:自动创建 .claude/hooks/stop.sh、state.json 等","system.diagnostics.fixAria":"自动修复","system.diagnostics.fix":"修复","system.diagnostics.fixed":"已修复","system.diagnostics.error.fix":"doctor 修复失败","system.diagnostics.error.check":"doctor 检查失败","chat.title":"对话 💬","chat.empty.title":"对话 💬","chat.empty.hint":'点左上角"新建对话"开始一个 session。或直接在下方输入,会自动建 session。',"chat.empty.shortcuts":"Enter 发送 · Shift+Enter 换行 · 内容流式返回","chat.list.heading":"历史 {count}","chat.list.new":"新建对话","chat.list.empty":"还没对话。点上面新建。","chat.list.delete.aria":"删除对话","chat.list.deleteCli.aria":"从 Console 移除该 CLI 会话(不影响 Claude jsonl 存档)","chat.list.openAria":"打开对话 {title}{cwd}","chat.list.cwdSuffix":"(工作目录 {cwd})","chat.list.msgs":"{count} 条 · {time}","chat.list.olderToggle":"更早 · {count} 条","chat.detail.model.tooltip":"当前使用的模型","chat.detail.claudeSession.tooltip":"底层 claude 会话 id —— 恢复会话与记忆的锚","chat.delete.confirm.title":"删除对话","chat.delete.confirm.body.cli":"会从 Console 列表移除(停 daemon 会话)。Claude CLI 在 ~/.claude/projects 下的对话存档会保留 —— 想恢复到终端继续聊就重新跑 sps agent --chat --name <名>。","chat.delete.confirm.body.console":"对话记录会永久删除,不可恢复。","chat.delete.confirm.button":"删除","chat.cli.banner.bold":"CLI 会话","chat.cli.banner":"这是 CLI 会话(由 sps agent 创建),Console 仅展示历史。续聊请在终端运行:","chat.input.placeholder":"说点什么… (Enter 发送,Shift+Enter 换行,可拖入文件 / 粘贴图片)","chat.input.dragOver":"松开鼠标以附加文件…","chat.input.aria":"消息输入","chat.input.attach.aria":"附加本地文件","chat.input.attach.title":"附加本地文件(也可拖拽 / 粘贴图片)","chat.input.send":"发送","chat.input.send.aria":"发送","chat.input.interrupt":"中断","chat.input.interrupt.aria":"中断生成","chat.input.uploading":"上传中…","chat.input.removeAttachment":"移除 {name}","chat.error.interrupt.title":"中断失败","chat.cliBadge":"CLI","chat.cliBadge.tooltip":"该会话由 sps agent CLI 创建,从 Claude jsonl 实时读取(只读)","chat.session.title":"{title}","chat.session.id":"{id}","chat.session.empty":"下方输入问题开始对话 · Enter 发送 · Shift+Enter 换行","notFound.title":"404","notFound.body":"这个页面不存在。","notFound.home":"回到首页","workers.active.empty":"没有 worker 在运行。","workers.alerts.allHealthy":"全部 worker 健康","workers.alerts.pidDead":"PID 已死。","workers.alerts.markerStale":"marker 停 {ago}。","workers.capacity.col.project":"项目","workers.capacity.col.usage":"占用","workers.capacity.col.other":"其它","workers.capacity.detailHint":"详情 →","workers.panel.boardLink":"看板 →","workers.panel.loading":"加载 workers…","workers.panel.empty.slots":"该项目没有 worker slot。","workers.panel.empty.noWorker":"无 worker","workers.panel.empty.pickOne":"请选择一个 worker","workers.panel.idle.short":"空闲","workers.panel.section.currentCard":"当前卡片","workers.panel.idle.full":"slot 空闲,没有当前卡片。","workers.panel.section.claudeOutput":"Claude 输出 · 最近 {n} 行","workers.panel.output.loading":"加载中…","workers.panel.output.empty":"还没收到 session 输出。Worker 刚启动时需要几秒。","workers.panel.section.heartbeat":"Supervisor 心跳 · 最近 {n} 行","workers.panel.heartbeat.fullLog":"查看完整 log →","workers.panel.action.restart":"重启","workers.panel.action.restart.confirm.title":"重启 worker-{slot}","workers.panel.action.restart.confirm.body":"先杀进程,再重新 launch 到 #{seq}","workers.panel.action.restart.confirm.button":"重启","workers.panel.action.restart.error":"重启失败","workers.panel.action.kill":"终止","workers.panel.action.kill.confirm.title":"终止 worker-{slot}","workers.panel.action.kill.confirm.body":"当前任务强制中断。","workers.panel.action.kill.confirm.button":"终止","workers.panel.action.kill.error":"终止失败","dialog.confirm.default":"确定","dialog.alert.default":"知道了","dialog.cancel.default":"取消","dirPicker.title.default":"选择目录","dirPicker.close.aria":"关闭","dirPicker.up.aria":"上级目录","dirPicker.up.title":"上级目录","dirPicker.home.aria":"回到 Home","dirPicker.home.title":"回到 Home","dirPicker.loading":"加载中...","dirPicker.error.title":"读取失败","dirPicker.empty":"— 空目录 —","dirPicker.enter.aria":"进入 {name}/","dirPicker.pickFile.aria":"选择 {name}(双击直接确认)","dirPicker.fileLocked":"文件不可选","dirPicker.cancel":"取消","dirPicker.useFile":"使用此文件","dirPicker.useFile.tooltip.empty":"请先点选一个文件","dirPicker.useDir":"选此目录","dirPicker.newDir":"新建目录","dirPicker.newDir.aria":"在当前目录下新建子目录","dirPicker.newDir.prompt":"新目录名(仅字母数字 _ . -)","dirPicker.newDir.placeholder":"目录名","dirPicker.newDir.create":"创建","dirPicker.newDir.error.title":"新建目录失败","errorBoundary.title":"💥 UI 崩了","errorBoundary.refresh":"刷新页面","chat.error.create.title":"新建对话失败","chat.error.send.title":"发送失败","chat.error.fileTooBig.title":"文件超过上限","chat.error.fileTooBig.body":"单文件上限 50 MB;当前 {size} MB({name})","chat.error.uploadAttachment.title":"附件上传失败","chat.placeholder.attachment":"(附件)","chat.placeholder.viewAttachment":"(请查看附件)","chat.placeholder.attachmentTitle":"附件","chat.attachment.previewTooltip":`{name}
|
|
460
|
-
{path}
|
|
461
|
-
点击预览`,"chat.attachment.previewSimpleTooltip":`{name}
|
|
462
|
-
点击放大`,"chat.attachment.preview.aria":"预览 {name}","chat.attachment.close.aria":"关闭","chat.attachment.readErr":"读取失败:{detail}","chat.attachment.loading":"加载中...","chat.attachment.unsupported":"此文件类型不支持内联预览。","chat.attachment.download":"下载","chat.message.role.you":"你","chat.message.role.error":"错误","chat.message.role.assistant":"assistant","chat.message.truncated":"⚠ 输出超过 10MB,已截断","chat.filePicker.title":"选择附件文件","chat.newSession.title":"新建对话","chat.newSession.title.aria":"新建对话","chat.newSession.close.aria":"关闭","chat.newSession.field.agent":"Agent","chat.newSession.field.model":"模型(可选)","chat.newSession.field.model.default":"用全局默认模型","chat.newSession.field.title":"标题(可选)","chat.newSession.field.title.placeholder":"留空 = 自动用首条消息生成","chat.newSession.field.cwd":"工作目录(可选)","chat.newSession.field.cwd.browse":"浏览","chat.newSession.field.cwd.browseAria":"浏览选择目录","chat.newSession.field.cwd.title":"选择目录","chat.newSession.field.cwd.help1":"Agent 在该目录下读写文件。绝对路径,必须存在。","chat.newSession.field.cwd.help2":"留空则用 daemon 启动时的目录。","chat.newSession.cancel":"取消","chat.newSession.create":"创建","cardModal.editing":"⚠ 编辑中","cardModal.title.aria":"卡片标题","cardModal.editAria":"编辑卡片","cardModal.edit":"编辑","cardModal.close.aria":"关闭","cardModal.error.save.title":"保存失败","cardModal.error.load":"加载失败:{detail}","cardModal.skills.loading":"加载 skill 列表…","cardModal.label.removeAria":"删除 {label}","cardModal.label.addPlaceholder":"+ 添加 label","cardModal.label.addAria":"添加 label","cardModal.label.note":"注意:AI-PIPELINE / STARTED-* / COMPLETED-* / NEEDS-FIX 由流水线自动管理,手动改可能被覆盖","cardModal.section.description":"描述","cardModal.section.empty":"(空)","cardModal.section.checklist":"检查清单","cardModal.checklist.empty":"暂无清单项。在描述里用 `- [ ] 项` 语法添加。","cardModal.section.log":"日志","cardModal.body.aria":"卡片描述","cardModal.body.replaceNote":'只替换 "## 描述" 段的内容;检查清单和日志段不动。',"cardModal.action.launch":"启动 worker","cardModal.action.launch.disabledDone":"卡片已完成;先拖回 Todo 再启动","cardModal.action.launch.disabledRunning":"Pipeline 正在跑——supervisor 会自动 dispatch,无需手动启动","cardModal.action.launch.error":"启动 worker 失败","cardModal.action.reset":"重置卡片","cardModal.action.reset.confirm.title":"重置卡片 #{seq}","cardModal.action.reset.confirm.body":"卡片状态会回到初始,已做的 checklist 会清空。","cardModal.action.reset.confirm.button":"重置","cardModal.action.reset.error":"重置失败","cardModal.action.delete":"删除卡片","cardModal.action.delete.confirm1.title":"删除卡片 #{seq}","cardModal.action.delete.confirm1.body":'即将删除 "{title}"。此操作不可恢复(md 文件将被物理删除)。是否继续?',"cardModal.action.delete.confirm1.button":"继续","cardModal.action.delete.confirm2.title":"最终确认","cardModal.action.delete.confirm2.body":"请再次确认删除卡片 #{seq}。","projectDetail.tab.skills":"技能","projectDetail.tab.rules":"规则","projectDetail.skills.title":"Skill 白名单","projectDetail.skills.desc":"选择本项目加载哪些 skill。收窄 worker、subagent 与 chat 能看到的范围,降低 token 消耗。","projectDetail.skills.noPolicy":"未设白名单 —— 全部 skill 都可用(subagent 会从磁盘吃全量)。","projectDetail.skills.hasPolicy":"白名单已生效 —— {count} 个 skill 合格。","projectDetail.skills.save":"保存白名单","projectDetail.skills.clear":"清除(加载全部)","projectDetail.skills.saveError":"保存白名单失败","projectDetail.skills.applied":"已保存。投影 {linked} 个链接,清理 {pruned} 个。","projectDetail.skills.unknown":"未识别的 skill 名(已忽略):{names}","projectDetail.skills.empty":"尚无已安装的 skill,先跑 `sps skill sync`。","projectDetail.skills.selectAll":"全选","projectDetail.skills.selectNone":"全不选","projectDetail.rules.title":"项目规则(只读)","projectDetail.rules.readonly":"sps-cli 只读这些文件。编辑在项目创建时或日后由 agent 协助完成。","projectDetail.rules.missing":"不存在","nav.prompts":"提示词","prompts.title":"提示词库","prompts.desc":"带 {{变量}} 模板的可复用提示词,可插入到会话中。","prompts.new":"新建提示词","prompts.search":"搜索提示词…","prompts.empty":"还没有提示词,新建一个。","prompts.name":"名称","prompts.namePlaceholder":"kebab-case,如 code-review","prompts.nameError":"名称须为 kebab-case(小写字母、数字、连字符)。","prompts.description":"描述","prompts.tags":"标签","prompts.tagsPlaceholder":"逗号,分隔","prompts.body":"正文","prompts.bodyPlaceholder":"写你的提示词。用 {{变量}} 做填充位。","prompts.favorite":"收藏","prompts.save":"保存","prompts.delete":"删除","prompts.deleteConfirm":"删除提示词「{name}」?会移除文件。","prompts.saveError":"保存提示词失败","prompts.vars":"变量:{names}","prompts.noVars":"无变量","prompts.insert":"插入提示词","prompts.selectHint":"在左侧选择一个提示词,或新建一个。","prompts.tagAdd":"输入标签后按 Enter","prompts.ai":"AI 生成","prompts.ai.title":"AI 生成提示词","prompts.ai.intent":"描述你想要什么","prompts.ai.placeholder":"例如:一个用于审查 TypeScript 代码安全问题的提示词","prompts.ai.submit":"生成","prompts.ai.wait":"agent 正在生成…可能需要一会儿。","prompts.ai.error":"生成失败","skills.import":"导入","skills.import.title":"导入 Skill","skills.import.name":"名称(kebab-case)","skills.import.body":"SKILL.md 内容","skills.import.submit":"导入","skills.import.error":"导入失败","skills.export":"导出 SKILL.md","skills.updates.badge":"有 {count} 个可更新","skills.updates.none":"已是最新","skills.ai":"AI 创建","skills.ai.title":"AI 创建 Skill","skills.ai.name":"名称(kebab-case)","skills.ai.intent":"这个 skill 用来做什么?","skills.ai.placeholder":"例如:如何写地道的 Rust 错误处理","skills.ai.submit":"创建","skills.ai.wait":"agent 正在生成 skill…可能需要一会儿。","skills.ai.error":"创建失败","projectDetail.tab.graph":"代码图谱","projectDetail.tab.logs":"日志","graph.title":"代码图谱","graph.desc":"本项目的符号级依赖图(tree-sitter,零 token)。给 agent 精准上下文,少读文件、省 token。","graph.build":"建图","graph.rebuild":"重建","graph.building":"建图中…","graph.sync":"增量同步","graph.syncing":"同步中…","graph.sync.desc":"增量 —— 只重新索引变化的文件(快)","graph.empty":"尚未建图 —— 建一次即可启用 agent 导航与依赖图。","graph.buildFailed":"建图失败","graph.stat.files":"文件","graph.stat.nodes":"节点","graph.stat.edges":"边","graph.stat.db":"DB 体积","graph.stat.lastBuilt":"上次建图","graph.viz.title":"文件依赖图","graph.viz.loading":"加载图谱…","graph.viz.empty":"建图后可查看依赖图。","graph.viz.hint":"节点=文件 · 边=import · 拖拽探索 · 搜索高亮","graph.viz.search":"高亮文件…"},i_=j.createContext(null),a_="sps-console-lang";function E3(){if(typeof window>"u")return"en";try{const e=window.localStorage.getItem(a_);if(e==="en"||e==="zh")return e}catch{}return"en"}function S3(e){try{window.localStorage.setItem(a_,e)}catch{}}function N3({children:e}){const[t,n]=j.useState(()=>E3());j.useEffect(()=>{typeof document<"u"&&(document.documentElement.lang=t==="zh"?"zh-CN":"en")},[t]);const r=j.useCallback(l=>{n(l),S3(l)},[]),a=j.useMemo(()=>{const l=t==="zh"?k3:w3;return(d,f)=>{let h=l[d]??d;if(f)for(const[g,m]of Object.entries(f))m!==void 0&&(h=h.replace(`{${g}}`,String(m)));return h}},[t]),o=j.useMemo(()=>({lang:t,setLang:r,t:a}),[t,r,a]);return c.jsx(i_.Provider,{value:o,children:e})}function s_(){const e=j.useContext(i_);if(!e)throw new Error("useLang must be used inside I18nProvider");return e}function Be(){return s_().t}function _3(){const{lang:e,setLang:t,t:n}=s_();return c.jsxs("div",{role:"group","aria-label":n("lang.toggle.aria"),className:"flex border-2 border-[var(--color-text)] rounded-lg overflow-hidden shadow-[2px_2px_0_var(--color-text)]",children:[c.jsx(dk,{active:e==="en",onClick:()=>t("en"),label:n("lang.en"),ariaLabel:"English"}),c.jsx(dk,{active:e==="zh",onClick:()=>t("zh"),label:n("lang.zh"),ariaLabel:"中文"})]})}function dk({active:e,onClick:t,label:n,ariaLabel:r}){return c.jsx("button",{type:"button",onClick:t,"aria-label":r,"aria-pressed":e,className:["flex-1 py-1.5 text-xs font-bold font-[family-name:var(--font-mono)] cursor-pointer transition-colors",e?"bg-[var(--color-accent-mint)] text-[var(--color-text)]":"bg-[var(--color-bg)] text-[var(--color-text-muted)] hover:bg-[var(--color-bg-cream)]"].join(" "),children:n})}const j3=[{to:"/chat",labelKey:"nav.chat",icon:VN},{to:"/projects",labelKey:"nav.projects",icon:GN},{to:"/board",labelKey:"nav.board",icon:EL},{to:"/workers",labelKey:"nav.workers",icon:n_},{to:"/skills",labelKey:"nav.skills",icon:hL},{to:"/prompts",labelKey:"nav.prompts",icon:QN},{to:"/arrange",labelKey:"nav.arrange",icon:Ub},{to:"/plugins",labelKey:"nav.plugins",icon:HL},{to:"/system",labelKey:"nav.system",icon:XN},{to:"/processes",labelKey:"nav.processes",icon:hh},{to:"/audit",labelKey:"nav.audit",icon:Bb},{to:"/memory",labelKey:"nav.memory",icon:DR}];function C3(){const e=Be();return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"font-[family-name:var(--font-heading)] font-bold text-lg px-3 pt-2 pb-4 flex items-center gap-3 text-[var(--color-text)]",children:[c.jsx("span",{className:"w-5 h-5 rounded-md bg-[var(--color-accent-mint)] border-2 border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]"}),e("app.title")]}),c.jsx("nav",{className:"flex flex-col gap-1.5 mt-2","aria-label":e("nav.aria"),children:j3.map(t=>{const n=t.icon;return c.jsxs(zN,{to:t.to,className:({isActive:r})=>["flex items-center gap-3 px-3 py-2.5 rounded-xl font-semibold text-sm cursor-pointer transition-transform duration-150","border-2 border-transparent",r?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] font-bold":"text-[var(--color-text)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)] hover:shadow-[3px_3px_0_var(--color-text)] hover:-translate-x-px hover:-translate-y-px"].join(" "),children:[c.jsx(n,{size:18,strokeWidth:2.5}),e(t.labelKey)]},t.to)})}),c.jsx("div",{className:"mt-auto pt-3",children:c.jsx(_3,{})})]})}class A3 extends Error{constructor(t,n,r){super(n),this.status=t,this.detail=r,this.name="ApiError"}}async function Fb(e){const t=await e.text().catch(()=>"");let n=t,r=`${e.status} ${e.statusText}`;try{const a=JSON.parse(t);if(n=a,a&&typeof a=="object"){const o=a,l=o.detail??o.title??o.message;typeof l=="string"&&l&&(r=l)}}catch{t&&(r=t.slice(0,300))}return new A3(e.status,r,n)}async function ft(e){const t=await fetch(e,{headers:{Accept:"application/json"}});if(!t.ok)throw await Fb(t);return await t.json()}async function Li(e,t){return o_("POST",e,t)}async function qb(e,t){return o_("PUT",e,t)}async function T3(e){const t=await fetch(e,{method:"DELETE",headers:{Accept:"application/json"}});if(!t.ok)throw await Fb(t)}async function o_(e,t,n){const r=await fetch(t,{method:e,headers:{Accept:"application/json","Content-Type":"application/json"},body:n===void 0?void 0:JSON.stringify(n)});if(!r.ok)throw await Fb(r);return await r.json()}function l_(){return ft("/api/system/info")}function M3(){return ft("/api/system/env")}function D3(){return ft("/api/system/env/raw")}async function O3(e,t){const n=await fetch("/api/system/env",{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:e,etag:t})});if(!n.ok){const r=await n.text(),a=new Error(`${n.status}: ${r}`);throw a.status=n.status,a}return n.json()}function R3(){return ft("/api/system/memory")}async function L3(e,t){const n=await fetch("/api/system/memory",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({provider:e,url:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json()}function Hb(){return ft("/api/system/agents")}async function I3(e){const t=await fetch("/api/system/agents",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return t.json()}function z3(){return ft("/api/system/latest-version")}async function P3(){const e=await fetch("/api/system/upgrade",{method:"POST"});if(!e.ok&&e.status!==409)throw new Error(`${e.status}: ${await e.text()}`);return e.json()}async function B3(e,t=!1){const n=t?"?fix=1":"",r=await fetch(`/api/system/doctor/${encodeURIComponent(e)}${n}`,{method:"POST"});if(!r.ok)throw new Error(`${r.status}: ${await r.text()}`);return r.json()}function Es(){return ft("/api/projects")}function $3(e){return ft(`/api/projects/${encodeURIComponent(e)}`)}async function U3(e){const t=await fetch("/api/projects",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok){const n=await t.text();throw new Error(`${t.status}: ${n}`)}return t.json()}function F3(e){return ft(`/api/projects/${encodeURIComponent(e)}/conf`)}async function q3(e,t,n){const r=await fetch(`/api/projects/${encodeURIComponent(e)}/conf`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,etag:n})});if(!r.ok){const a=await r.text(),o=new Error(`${r.status}: ${a}`);throw o.status=r.status,o}return r.json()}async function H3(e,t={}){const n=await fetch(`/api/projects/${encodeURIComponent(e)}`,{method:"DELETE",headers:{"Content-Type":"application/json"},body:JSON.stringify(t)});if(!n.ok){const r=await n.text();throw new Error(`${n.status}: ${r}`)}return n.json()}function K3(e){return ft(`/api/projects/${encodeURIComponent(e)}/pipelines`)}async function G3(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipeline`,{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({pipeline:t})});if(!n.ok){const r=await n.text();throw new Error(`${n.status}: ${r}`)}return n.json()}function V3(e,t){return ft(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`)}async function Y3(e,t,n,r){const a=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:n,etag:r})});if(!a.ok){const o=await a.text(),l=new Error(`${a.status}: ${o}`);throw l.status=a.status,l}return a.json()}async function Q3(e,t,n="blank"){const r=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({name:t,template:n})});if(!r.ok){const a=await r.text();throw new Error(`${r.status}: ${a}`)}return r.json()}async function W3(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/pipelines/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok){const r=await n.text();throw new Error(`${n.status}: ${r}`)}}function X3(){var f;const e=Be(),t=Ye({queryKey:["system-info"],queryFn:l_,refetchInterval:3e4}),n=Ye({queryKey:["projects"],queryFn:Es,refetchInterval:1e4}),r=J3(),a=!t.isError,o=((f=n.data)==null?void 0:f.data)??[],l=o.filter(h=>h.pipelineStatus==="running").length,d=o.reduce((h,g)=>h+g.workers.active,0);return c.jsxs("div",{className:"h-10 flex items-center gap-3 px-6 font-[family-name:var(--font-mono)] text-[11px] text-[var(--color-text-muted)]",children:[c.jsx("span",{className:"nb-status",style:{background:a?"var(--color-running-bg)":"var(--color-crashed-bg)",color:a?"var(--color-running)":"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:e(a?"status.server":"status.offline")}),c.jsx(Z3,{state:r}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1",title:e("status.pipelines.tooltip"),children:[c.jsx($h,{size:10,strokeWidth:2.5}),c.jsx("span",{className:"font-bold text-[var(--color-text)]",children:l})," ",e("status.pipeline.unit")]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1",title:e("status.workers.tooltip"),children:[c.jsx(WN,{size:10,strokeWidth:2.5}),c.jsx("span",{className:"font-bold text-[var(--color-text)]",children:d})," ",e("status.worker.unit")]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{children:["localhost:",window.location.port]}),t.data&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{children:["v",t.data.version]}),c.jsx("span",{className:"text-[var(--color-text-subtle)]",children:"·"}),c.jsxs("span",{children:["node ",t.data.nodeVersion]})]})]})}function Z3({state:e}){const t=Be();return e==="open"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px 2px 7px"},children:t("status.sse.open")}):e==="connecting"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)",padding:"2px 8px 2px 7px"},children:t("status.sse.connecting")}):c.jsxs("span",{className:"nb-status",style:{background:"var(--color-crashed-bg)",color:"var(--color-crashed)",padding:"2px 8px 2px 7px"},children:[c.jsx(ku,{size:9,strokeWidth:2.5}),t("status.sse.down")]})}function J3(){const[e,t]=j.useState("connecting");return j.useEffect(()=>{let n=null,r=null,a=!1;const o=()=>{a||(n=new EventSource("/stream/heartbeat"),n.addEventListener("server.heartbeat",()=>t("open")),n.addEventListener("open",()=>t("open")),n.addEventListener("error",()=>{(n==null?void 0:n.readyState)===EventSource.CLOSED?(t("closed"),r==null&&(r=setTimeout(()=>{r=null,n==null||n.close(),o()},1e4))):t("connecting")}))};return o(),()=>{a=!0,r!=null&&clearTimeout(r),n==null||n.close()}},[]),e}function eI(){return c.jsxs("div",{className:"grid grid-cols-[240px_1fr] grid-rows-[1fr_40px] h-screen",children:[c.jsx("aside",{className:"row-span-1 row-start-1 border-r-[3px] border-[var(--color-text)] bg-[var(--color-bg)] p-4 flex flex-col",children:c.jsx(C3,{})}),c.jsx("main",{className:"row-start-1 overflow-auto p-6 flex flex-col gap-4",children:c.jsx(zO,{})}),c.jsx("footer",{className:"col-span-2 row-start-2 border-t-[3px] border-[var(--color-text)] bg-[var(--color-bg)]",children:c.jsx(X3,{})})]})}function Uy(e,t){try{const n=JSON.stringify({message:(e instanceof Error?e.message:String(e)).slice(0,1e3),stack:(e instanceof Error?e.stack??"":"").slice(0,4e3),url:typeof window<"u"?window.location.href:"",ua:typeof navigator<"u"?navigator.userAgent:"",ts:new Date().toISOString(),context:t==null?void 0:t.slice(0,200)});fetch("/api/system/client-errors",{method:"POST",headers:{"Content-Type":"application/json"},body:n,keepalive:!0}).catch(()=>{})}catch{}}function tI(){typeof window>"u"||(window.addEventListener("error",e=>{Uy(e.error??e.message??"unknown error","window.error")}),window.addEventListener("unhandledrejection",e=>{const t=e.reason;Uy(t instanceof Error?t:String(t),"unhandledrejection")}))}class nI extends j.Component{constructor(){super(...arguments);O1(this,"state",{error:null})}static getDerivedStateFromError(n){return{error:n}}componentDidCatch(n,r){var a;Uy(n,`ErrorBoundary: ${((a=r.componentStack)==null?void 0:a.slice(0,200))??""}`),console.error("[ErrorBoundary]",n,r)}render(){if(this.state.error){const n=(()=>{try{return window.localStorage.getItem("sps-console-lang")==="zh"?"zh":"en"}catch{return"en"}})(),r=n==="zh"?"💥 UI 崩了":"💥 UI crashed",a=n==="zh"?"刷新页面":"Refresh page";return c.jsx("div",{className:"p-6",children:c.jsxs("div",{className:"nb-card max-w-2xl bg-[var(--color-crashed-bg)]",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:r}),c.jsx("p",{className:"text-sm mb-3 text-[var(--color-text-muted)]",children:this.state.error.message}),c.jsxs("details",{className:"text-xs mb-4",children:[c.jsx("summary",{className:"cursor-pointer font-semibold",children:"stack"}),c.jsx("pre",{className:"mt-2 font-[family-name:var(--font-mono)] overflow-auto max-h-60 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-md p-3",children:this.state.error.stack??"(no stack)"})]}),c.jsx("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>{this.setState({error:null}),window.location.reload()},children:a})]})})}return this.props.children}}function Kb(e,t){const[n,r]=j.useState(()=>{try{const a=localStorage.getItem(e);return a!==null?JSON.parse(a):t}catch{return t}});return j.useEffect(()=>{try{localStorage.setItem(e,JSON.stringify(n))}catch{}},[e,n]),[n,r]}const kf=e=>e.lastActivityAt?Date.parse(e.lastActivityAt):0;function c_(e,t){const n=[...e];return t==="name"?n.sort((r,a)=>r.name.localeCompare(a.name)):t==="date"?n.sort((r,a)=>kf(a)-kf(r)):n.sort((r,a)=>{const o=r.pipelineStatus==="running"?1:0,l=a.pipelineStatus==="running"?1:0;return o!==l?l-o:kf(a)-kf(r)})}function rI(e,t,n=7){const r=Date.now()-n*864e5,a=[],o=[];for(const l of e){const d=t(l);((d?Date.parse(d):0)>=r?a:o).push(l)}return{recent:a,older:o}}function iI(e){const t=new URLSearchParams;return e.project&&t.set("project",e.project),e.worker&&t.set("worker",e.worker),t.set("limit",String(e.limit)),e.since&&t.set("since",e.since),e.file&&t.set("file",e.file),ft(`/api/logs?${t}`)}function aI(e){return ft(`/api/logs/sources?project=${encodeURIComponent(e)}`)}const sI=["error","warn","info","debug"],oI=["error","warn","info"];function lI({project:e,initialWorker:t}){const n=Be(),r=t??"",[a,o]=j.useState([]),[l,d]=j.useState(!1),[f,h]=j.useState(!0),[g,m]=j.useState(()=>new Set(oI)),[y,b]=j.useState(""),[k,v]=j.useState("live"),[N,E]=j.useState(()=>{const F=new Date(Date.now()-36e5),Y=D=>String(D).padStart(2,"0");return`${F.getFullYear()}-${Y(F.getMonth()+1)}-${Y(F.getDate())}T${Y(F.getHours())}:${Y(F.getMinutes())}`}),C=j.useRef(null),[S,_]=j.useState(""),{data:M}=Ye({queryKey:["log-sources",e],queryFn:()=>aI(e),enabled:!!e,refetchInterval:5e3}),T=j.useMemo(()=>(M==null?void 0:M.sources)??[],[M]),L=T.find(F=>F.key===S)??(r?T.find(F=>F.worker===Number(r)):void 0)??T.find(F=>F.kind==="pipeline")??T[0],R=L==null?void 0:L.file;j.useEffect(()=>{o([])},[e,R]);const{data:$,refetch:z}=Ye({queryKey:["logs",e,R,k,k==="history"?N:"live"],queryFn:()=>iI({project:e,file:R,limit:k==="history"?2e3:500,since:k==="history"?new Date(N).toISOString():void 0}),enabled:!!e,refetchInterval:k==="live"&&!l?2500:!1});j.useEffect(()=>{$!=null&&$.data&&o($.data)},[$]),j.useEffect(()=>{if(!f)return;const F=C.current;F&&(F.scrollTop=F.scrollHeight)},[a,f]);const q=j.useMemo(()=>{const F=y.toLowerCase();return a.filter(Y=>!(!g.has(Y.level)||F&&!Y.msg.toLowerCase().includes(F)))},[a,g,y]);return c.jsxs("div",{className:"flex flex-col gap-3 max-w-full",children:[T.length>0&&c.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap",children:[T.filter(F=>F.worker==null).map(F=>c.jsx(fk,{s:F,active:(L==null?void 0:L.key)===F.key,onClick:()=>_(F.key)},F.key)),c.jsx("div",{className:"ml-auto flex items-center gap-1.5 flex-wrap",children:T.filter(F=>F.worker!=null).map(F=>c.jsx(fk,{s:F,active:(L==null?void 0:L.key)===F.key,onClick:()=>_(F.key)},F.key))})]}),c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[c.jsxs("button",{type:"button",onClick:()=>v("live"),"aria-pressed":k==="live",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",k==="live"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(WN,{size:11,strokeWidth:2.5}),n("logs.mode.live")]}),c.jsxs("button",{type:"button",onClick:()=>v("history"),"aria-pressed":k==="history",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",k==="history"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(yL,{size:11,strokeWidth:2.5}),n("logs.mode.history")]})]}),k==="history"&&c.jsxs(c.Fragment,{children:[c.jsx("input",{type:"datetime-local",className:"nb-input",style:{padding:"4px 8px",fontSize:12},value:N,onChange:F=>E(F.target.value),"aria-label":n("logs.history.startAria")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>z(),type:"button","aria-label":n("logs.history.queryAria"),children:[c.jsx(ho,{size:11,strokeWidth:3}),n("logs.history.query")]})]}),c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(ho,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:n("logs.filter.keyword.placeholder"),value:y,onChange:F=>b(F.target.value),"aria-label":n("logs.filter.keyword.aria")})]}),c.jsx("div",{className:"flex items-center gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:sI.map(F=>c.jsx(cI,{level:F,enabled:g.has(F),onToggle:()=>{m(Y=>{const D=new Set(Y);return D.has(F)?D.delete(F):D.add(F),D})}},F))}),c.jsxs("div",{className:"ml-auto flex gap-2",children:[k==="live"&&c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>h(F=>!F),type:"button",children:f?"✓ Auto-scroll":"Auto-scroll"}),c.jsx("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>d(F=>!F),type:"button",children:l?c.jsxs(c.Fragment,{children:[c.jsx(Yu,{size:12,strokeWidth:3})," Resume"]}):c.jsxs(c.Fragment,{children:[c.jsx(zL,{size:12,strokeWidth:3})," Pause"]})})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>{const F=new Blob([q.map(H=>H.raw).join(`
|
|
463
|
-
`)],{type:"text/plain"}),Y=URL.createObjectURL(F),D=document.createElement("a");D.href=Y,D.download=`${e}-log-${Date.now()}.log`,D.click(),URL.revokeObjectURL(Y)},type:"button",children:[c.jsx(Uh,{size:12,strokeWidth:2.5})," Export"]})]})]}),c.jsxs("div",{className:"nb-card p-0 overflow-hidden",children:[c.jsxs("div",{className:"px-4 py-2 bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)] flex items-center justify-between font-[family-name:var(--font-mono)] text-xs",children:[c.jsxs("span",{className:"text-[var(--color-text-muted)]",children:[($==null?void 0:$.file)??`~/.coral/projects/${e}/logs/*.log`," · ",a.length," lines",l&&c.jsx("span",{className:"text-[var(--color-stuck)] ml-2 font-bold",children:n("logs.paused")})]}),k==="live"?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"live"}):c.jsx("span",{className:"nb-status",style:{background:"var(--color-accent-purple)",color:"var(--color-text)"},children:"history"})]}),c.jsxs("div",{ref:C,className:"overflow-auto font-[family-name:var(--font-mono)] text-[12px] leading-[22px] max-h-[70vh] bg-[var(--color-bg)] p-2",onScroll:F=>{const Y=F.currentTarget;!(Y.scrollHeight-Y.scrollTop-Y.clientHeight<40)&&f&&h(!1)},children:[q.map((F,Y)=>c.jsx(uI,{line:F},Y)),q.length===0&&c.jsx("div",{className:"text-center py-12 text-[var(--color-text-subtle)]",children:n("logs.empty.match")})]})]})]})}function cI({level:e,enabled:t,onToggle:n}){const r={error:"var(--color-crashed-bg)",warn:"var(--color-stuck-bg)",info:"var(--color-secondary)",debug:"var(--color-accent-purple)"},a={error:"var(--color-crashed)",warn:"var(--color-stuck)",info:"var(--color-text)",debug:"var(--color-text)"};return c.jsx("button",{type:"button",onClick:n,"aria-pressed":t,className:["px-3 py-0.5 rounded-full font-[family-name:var(--font-mono)] text-[10px] font-bold tracking-widest cursor-pointer",t?"border-[1.5px] border-[var(--color-text)]":"text-[var(--color-text-subtle)]"].join(" "),style:t?{background:r[e],color:a[e]}:{},children:e.toUpperCase()})}function uI({line:e}){var n;const t={error:"bg-[var(--color-crashed)] text-[var(--color-text)]",warn:"bg-[var(--color-stuck)] text-[var(--color-text)]",info:"bg-[var(--color-secondary)] text-[var(--color-text)]",debug:"",trace:""};return c.jsxs("div",{className:"grid gap-2 px-2 py-0.5 rounded hover:bg-[var(--color-bg-cream)] grid-cols-[100px_60px_1fr]",children:[c.jsx("span",{className:"text-[var(--color-text-subtle)] whitespace-nowrap",children:e.ts?((n=e.ts.split("T")[1])==null?void 0:n.replace("Z",""))??e.ts:"--"}),c.jsx("span",{className:`text-center font-bold ${t[e.level]??""}`,style:{borderRadius:4,padding:"0 6px"},children:e.level.toUpperCase()}),c.jsx("span",{className:"truncate text-[var(--color-text)]",children:e.msg})]})}function fk({s:e,active:t,onClick:n}){const r=e.status==="running"?"#22c55e":e.status==="error"?"#ef4444":"#9ca3af";return c.jsxs("button",{type:"button",onClick:n,"aria-pressed":t,"aria-label":`查看${e.label}日志`,className:["px-2.5 py-1 rounded-full text-xs font-bold border-[2px] border-[var(--color-text)] flex items-center gap-1.5",t?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"bg-white text-[var(--color-text-muted)] hover:-translate-y-px"].join(" "),children:[e.worker!=null&&c.jsx("span",{style:{width:8,height:8,borderRadius:"50%",background:r,display:"inline-block"},"aria-hidden":!0}),e.label]})}function dI({title:e,body:t,confirm:n,cancel:r,onConfirm:a,onCancel:o,danger:l}){const d=Be();return j.useEffect(()=>{const f=h=>{h.key==="Escape"&&o()};return window.addEventListener("keydown",f),()=>window.removeEventListener("keydown",f)},[o]),c.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"confirm-title",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{id:"confirm-title",className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5",children:t}),c.jsxs("div",{className:"flex gap-3 justify-end",children:[c.jsx("button",{className:"nb-btn",onClick:o,type:"button",children:r??d("dialog.cancel.default")}),c.jsx("button",{className:l?"nb-btn nb-btn-danger":"nb-btn nb-btn-yellow",onClick:async()=>{await a()},type:"button",children:n})]})]})})}const u_=j.createContext(null);function fI({children:e}){const t=Be(),[n,r]=j.useState(null),a=j.useCallback(d=>new Promise(f=>{r({kind:"confirm",opts:d,resolve:h=>{r(null),f(h)}})}),[]),o=j.useCallback(d=>new Promise(f=>{r({kind:"alert",opts:d,resolve:()=>{r(null),f()}})}),[]),l=j.useCallback(d=>new Promise(f=>{r({kind:"prompt",opts:d,resolve:h=>{r(null),f(h)}})}),[]);return c.jsxs(u_.Provider,{value:{confirm:a,alert:o,prompt:l},children:[e,(n==null?void 0:n.kind)==="confirm"&&c.jsx(dI,{title:n.opts.title,body:n.opts.body,confirm:n.opts.confirm??t("dialog.confirm.default"),cancel:n.opts.cancel,danger:n.opts.danger,onConfirm:()=>n.resolve(!0),onCancel:()=>n.resolve(!1)}),(n==null?void 0:n.kind)==="alert"&&c.jsx(hI,{title:n.opts.title,body:n.opts.body,confirm:n.opts.confirm??t("dialog.alert.default"),onClose:()=>n.resolve()}),(n==null?void 0:n.kind)==="prompt"&&c.jsx(pI,{title:n.opts.title,body:n.opts.body,placeholder:n.opts.placeholder,defaultValue:n.opts.defaultValue,confirm:n.opts.confirm??t("dialog.confirm.default"),cancel:n.opts.cancel??t("dialog.cancel.default"),onConfirm:d=>n.resolve(d),onCancel:()=>n.resolve(null)})]})}function un(){const e=j.useContext(u_);if(!e)throw new Error("useDialog must be used inside <DialogProvider>");return e}function hI({title:e,body:t,confirm:n,onClose:r}){return j.useEffect(()=>{const a=o=>{(o.key==="Escape"||o.key==="Enter")&&r()};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[r]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-5 whitespace-pre-wrap break-words",children:t}),c.jsx("div",{className:"flex gap-3 justify-end",children:c.jsx("button",{className:"nb-btn nb-btn-primary",onClick:r,type:"button",autoFocus:!0,children:n})})]})})}function pI({title:e,body:t,placeholder:n,defaultValue:r,confirm:a,cancel:o,onConfirm:l,onCancel:d}){const[f,h]=j.useState(r??""),g=j.useRef(null);j.useEffect(()=>{var b,k;(b=g.current)==null||b.focus(),(k=g.current)==null||k.select();const y=v=>{v.key==="Escape"&&d()};return window.addEventListener("keydown",y),()=>window.removeEventListener("keydown",y)},[d]);const m=()=>{const y=f.trim();y&&l(y)};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e}),t&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-3 whitespace-pre-wrap break-words",children:t}),c.jsx("input",{ref:g,type:"text",className:"nb-input w-full mb-5",placeholder:n,value:f,onChange:y=>h(y.target.value),onKeyDown:y=>{y.key==="Enter"&&!y.nativeEvent.isComposing&&(y.preventDefault(),m())}}),c.jsxs("div",{className:"flex gap-3 justify-end",children:[c.jsx("button",{className:"nb-btn",onClick:d,type:"button",children:o}),c.jsx("button",{className:"nb-btn nb-btn-primary",onClick:m,type:"button",disabled:!f.trim(),children:a})]})]})})}const Gb=Symbol.for("yaml.alias"),Fy=Symbol.for("yaml.document"),xs=Symbol.for("yaml.map"),d_=Symbol.for("yaml.pair"),Oi=Symbol.for("yaml.scalar"),Jl=Symbol.for("yaml.seq"),Vr=Symbol.for("yaml.node.type"),Ss=e=>!!e&&typeof e=="object"&&e[Vr]===Gb,wo=e=>!!e&&typeof e=="object"&&e[Vr]===Fy,ec=e=>!!e&&typeof e=="object"&&e[Vr]===xs,en=e=>!!e&&typeof e=="object"&&e[Vr]===d_,Kt=e=>!!e&&typeof e=="object"&&e[Vr]===Oi,tc=e=>!!e&&typeof e=="object"&&e[Vr]===Jl;function ln(e){if(e&&typeof e=="object")switch(e[Vr]){case xs:case Jl:return!0}return!1}function cn(e){if(e&&typeof e=="object")switch(e[Vr]){case Gb:case xs:case Oi:case Jl:return!0}return!1}const f_=e=>(Kt(e)||ln(e))&&!!e.anchor,fr=Symbol("break visit"),h_=Symbol("skip children"),Mi=Symbol("remove node");function ko(e,t){const n=p_(t);wo(e)?ml(null,e.contents,n,Object.freeze([e]))===Mi&&(e.contents=null):ml(null,e,n,Object.freeze([]))}ko.BREAK=fr;ko.SKIP=h_;ko.REMOVE=Mi;function ml(e,t,n,r){const a=m_(e,t,n,r);if(cn(a)||en(a))return g_(e,r,a),ml(e,a,n,r);if(typeof a!="symbol"){if(ln(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){const l=ml(o,t.items[o],n,r);if(typeof l=="number")o=l-1;else{if(l===fr)return fr;l===Mi&&(t.items.splice(o,1),o-=1)}}}else if(en(t)){r=Object.freeze(r.concat(t));const o=ml("key",t.key,n,r);if(o===fr)return fr;o===Mi&&(t.key=null);const l=ml("value",t.value,n,r);if(l===fr)return fr;l===Mi&&(t.value=null)}}return a}async function Hh(e,t){const n=p_(t);wo(e)?await gl(null,e.contents,n,Object.freeze([e]))===Mi&&(e.contents=null):await gl(null,e,n,Object.freeze([]))}Hh.BREAK=fr;Hh.SKIP=h_;Hh.REMOVE=Mi;async function gl(e,t,n,r){const a=await m_(e,t,n,r);if(cn(a)||en(a))return g_(e,r,a),gl(e,a,n,r);if(typeof a!="symbol"){if(ln(t)){r=Object.freeze(r.concat(t));for(let o=0;o<t.items.length;++o){const l=await gl(o,t.items[o],n,r);if(typeof l=="number")o=l-1;else{if(l===fr)return fr;l===Mi&&(t.items.splice(o,1),o-=1)}}}else if(en(t)){r=Object.freeze(r.concat(t));const o=await gl("key",t.key,n,r);if(o===fr)return fr;o===Mi&&(t.key=null);const l=await gl("value",t.value,n,r);if(l===fr)return fr;l===Mi&&(t.value=null)}}return a}function p_(e){return typeof e=="object"&&(e.Collection||e.Node||e.Value)?Object.assign({Alias:e.Node,Map:e.Node,Scalar:e.Node,Seq:e.Node},e.Value&&{Map:e.Value,Scalar:e.Value,Seq:e.Value},e.Collection&&{Map:e.Collection,Seq:e.Collection},e):e}function m_(e,t,n,r){var a,o,l,d,f;if(typeof n=="function")return n(e,t,r);if(ec(t))return(a=n.Map)==null?void 0:a.call(n,e,t,r);if(tc(t))return(o=n.Seq)==null?void 0:o.call(n,e,t,r);if(en(t))return(l=n.Pair)==null?void 0:l.call(n,e,t,r);if(Kt(t))return(d=n.Scalar)==null?void 0:d.call(n,e,t,r);if(Ss(t))return(f=n.Alias)==null?void 0:f.call(n,e,t,r)}function g_(e,t,n){const r=t[t.length-1];if(ln(r))r.items[e]=n;else if(en(r))e==="key"?r.key=n:r.value=n;else if(wo(r))r.contents=n;else{const a=Ss(r)?"alias":"scalar";throw new Error(`Cannot replace node with ${a} parent`)}}const mI={"!":"%21",",":"%2C","[":"%5B","]":"%5D","{":"%7B","}":"%7D"},gI=e=>e.replace(/[!,[\]{}]/g,t=>mI[t]);class tr{constructor(t,n){this.docStart=null,this.docEnd=!1,this.yaml=Object.assign({},tr.defaultYaml,t),this.tags=Object.assign({},tr.defaultTags,n)}clone(){const t=new tr(this.yaml,this.tags);return t.docStart=this.docStart,t}atDocument(){const t=new tr(this.yaml,this.tags);switch(this.yaml.version){case"1.1":this.atNextDocument=!0;break;case"1.2":this.atNextDocument=!1,this.yaml={explicit:tr.defaultYaml.explicit,version:"1.2"},this.tags=Object.assign({},tr.defaultTags);break}return t}add(t,n){this.atNextDocument&&(this.yaml={explicit:tr.defaultYaml.explicit,version:"1.1"},this.tags=Object.assign({},tr.defaultTags),this.atNextDocument=!1);const r=t.trim().split(/[ \t]+/),a=r.shift();switch(a){case"%TAG":{if(r.length!==2&&(n(0,"%TAG directive should contain exactly two parts"),r.length<2))return!1;const[o,l]=r;return this.tags[o]=l,!0}case"%YAML":{if(this.yaml.explicit=!0,r.length!==1)return n(0,"%YAML directive should contain exactly one part"),!1;const[o]=r;if(o==="1.1"||o==="1.2")return this.yaml.version=o,!0;{const l=/^\d+\.\d+$/.test(o);return n(6,`Unsupported YAML version ${o}`,l),!1}}default:return n(0,`Unknown directive ${a}`,!0),!1}}tagName(t,n){if(t==="!")return"!";if(t[0]!=="!")return n(`Not a valid tag: ${t}`),null;if(t[1]==="<"){const l=t.slice(2,-1);return l==="!"||l==="!!"?(n(`Verbatim tags aren't resolved, so ${t} is invalid.`),null):(t[t.length-1]!==">"&&n("Verbatim tags must end with a >"),l)}const[,r,a]=t.match(/^(.*!)([^!]*)$/s);a||n(`The ${t} tag has no suffix`);const o=this.tags[r];if(o)try{return o+decodeURIComponent(a)}catch(l){return n(String(l)),null}return r==="!"?t:(n(`Could not resolve tag: ${t}`),null)}tagString(t){for(const[n,r]of Object.entries(this.tags))if(t.startsWith(r))return n+gI(t.substring(r.length));return t[0]==="!"?t:`!<${t}>`}toString(t){const n=this.yaml.explicit?[`%YAML ${this.yaml.version||"1.2"}`]:[],r=Object.entries(this.tags);let a;if(t&&r.length>0&&cn(t.contents)){const o={};ko(t.contents,(l,d)=>{cn(d)&&d.tag&&(o[d.tag]=!0)}),a=Object.keys(o)}else a=[];for(const[o,l]of r)o==="!!"&&l==="tag:yaml.org,2002:"||(!t||a.some(d=>d.startsWith(l)))&&n.push(`%TAG ${o} ${l}`);return n.join(`
|
|
464
|
-
`)}}tr.defaultYaml={explicit:!1,version:"1.2"};tr.defaultTags={"!!":"tag:yaml.org,2002:"};function y_(e){if(/[\x00-\x19\s,[\]{}]/.test(e)){const n=`Anchor must not contain whitespace or control characters: ${JSON.stringify(e)}`;throw new Error(n)}return!0}function b_(e){const t=new Set;return ko(e,{Value(n,r){r.anchor&&t.add(r.anchor)}}),t}function x_(e,t){for(let n=1;;++n){const r=`${e}${n}`;if(!t.has(r))return r}}function yI(e,t){const n=[],r=new Map;let a=null;return{onAnchor:o=>{n.push(o),a??(a=b_(e));const l=x_(t,a);return a.add(l),l},setAnchors:()=>{for(const o of n){const l=r.get(o);if(typeof l=="object"&&l.anchor&&(Kt(l.node)||ln(l.node)))l.node.anchor=l.anchor;else{const d=new Error("Failed to resolve repeated object (this should not happen)");throw d.source=o,d}}},sourceObjects:r}}function yl(e,t,n,r){if(r&&typeof r=="object")if(Array.isArray(r))for(let a=0,o=r.length;a<o;++a){const l=r[a],d=yl(e,r,String(a),l);d===void 0?delete r[a]:d!==l&&(r[a]=d)}else if(r instanceof Map)for(const a of Array.from(r.keys())){const o=r.get(a),l=yl(e,r,a,o);l===void 0?r.delete(a):l!==o&&r.set(a,l)}else if(r instanceof Set)for(const a of Array.from(r)){const o=yl(e,r,a,a);o===void 0?r.delete(a):o!==a&&(r.delete(a),r.add(o))}else for(const[a,o]of Object.entries(r)){const l=yl(e,r,a,o);l===void 0?delete r[a]:l!==o&&(r[a]=l)}return e.call(t,n,r)}function Kr(e,t,n){if(Array.isArray(e))return e.map((r,a)=>Kr(r,String(a),n));if(e&&typeof e.toJSON=="function"){if(!n||!f_(e))return e.toJSON(t,n);const r={aliasCount:0,count:1,res:void 0};n.anchors.set(e,r),n.onCreate=o=>{r.res=o,delete n.onCreate};const a=e.toJSON(t,n);return n.onCreate&&n.onCreate(a),a}return typeof e=="bigint"&&!(n!=null&&n.keep)?Number(e):e}class Vb{constructor(t){Object.defineProperty(this,Vr,{value:t})}clone(){const t=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return this.range&&(t.range=this.range.slice()),t}toJS(t,{mapAsMap:n,maxAliasCount:r,onAnchor:a,reviver:o}={}){if(!wo(t))throw new TypeError("A document argument is required");const l={anchors:new Map,doc:t,keep:!0,mapAsMap:n===!0,mapKeyWarned:!1,maxAliasCount:typeof r=="number"?r:100},d=Kr(this,"",l);if(typeof a=="function")for(const{count:f,res:h}of l.anchors.values())a(h,f);return typeof o=="function"?yl(o,{"":d},"",d):d}}class Kh extends Vb{constructor(t){super(Gb),this.source=t,Object.defineProperty(this,"tag",{set(){throw new Error("Alias nodes cannot have tags")}})}resolve(t,n){let r;n!=null&&n.aliasResolveCache?r=n.aliasResolveCache:(r=[],ko(t,{Node:(o,l)=>{(Ss(l)||f_(l))&&r.push(l)}}),n&&(n.aliasResolveCache=r));let a;for(const o of r){if(o===this)break;o.anchor===this.source&&(a=o)}return a}toJSON(t,n){if(!n)return{source:this.source};const{anchors:r,doc:a,maxAliasCount:o}=n,l=this.resolve(a,n);if(!l){const f=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new ReferenceError(f)}let d=r.get(l);if(d||(Kr(l,null,n),d=r.get(l)),(d==null?void 0:d.res)===void 0){const f="This should not happen: Alias anchor was not resolved?";throw new ReferenceError(f)}if(o>=0&&(d.count+=1,d.aliasCount===0&&(d.aliasCount=Zf(a,l,r)),d.count*d.aliasCount>o)){const f="Excessive alias count indicates a resource exhaustion attack";throw new ReferenceError(f)}return d.res}toString(t,n,r){const a=`*${this.source}`;if(t){if(y_(this.source),t.options.verifyAliasOrder&&!t.anchors.has(this.source)){const o=`Unresolved alias (the anchor must be set before the alias): ${this.source}`;throw new Error(o)}if(t.implicitKey)return`${a} `}return a}}function Zf(e,t,n){if(Ss(t)){const r=t.resolve(e),a=n&&r&&n.get(r);return a?a.count*a.aliasCount:0}else if(ln(t)){let r=0;for(const a of t.items){const o=Zf(e,a,n);o>r&&(r=o)}return r}else if(en(t)){const r=Zf(e,t.key,n),a=Zf(e,t.value,n);return Math.max(r,a)}return 1}const v_=e=>!e||typeof e!="function"&&typeof e!="object";class st extends Vb{constructor(t){super(Oi),this.value=t}toJSON(t,n){return n!=null&&n.keep?this.value:Kr(this.value,t,n)}toString(){return String(this.value)}}st.BLOCK_FOLDED="BLOCK_FOLDED";st.BLOCK_LITERAL="BLOCK_LITERAL";st.PLAIN="PLAIN";st.QUOTE_DOUBLE="QUOTE_DOUBLE";st.QUOTE_SINGLE="QUOTE_SINGLE";const bI="tag:yaml.org,2002:";function xI(e,t,n){if(t){const r=n.filter(o=>o.tag===t),a=r.find(o=>!o.format)??r[0];if(!a)throw new Error(`Tag ${t} not found`);return a}return n.find(r=>{var a;return((a=r.identify)==null?void 0:a.call(r,e))&&!r.format})}function Su(e,t,n){var m,y,b;if(wo(e)&&(e=e.contents),cn(e))return e;if(en(e)){const k=(y=(m=n.schema[xs]).createNode)==null?void 0:y.call(m,n.schema,null,n);return k.items.push(e),k}(e instanceof String||e instanceof Number||e instanceof Boolean||typeof BigInt<"u"&&e instanceof BigInt)&&(e=e.valueOf());const{aliasDuplicateObjects:r,onAnchor:a,onTagObj:o,schema:l,sourceObjects:d}=n;let f;if(r&&e&&typeof e=="object"){if(f=d.get(e),f)return f.anchor??(f.anchor=a(e)),new Kh(f.anchor);f={anchor:null,node:null},d.set(e,f)}t!=null&&t.startsWith("!!")&&(t=bI+t.slice(2));let h=xI(e,t,l.tags);if(!h){if(e&&typeof e.toJSON=="function"&&(e=e.toJSON()),!e||typeof e!="object"){const k=new st(e);return f&&(f.node=k),k}h=e instanceof Map?l[xs]:Symbol.iterator in Object(e)?l[Jl]:l[xs]}o&&(o(h),delete n.onTagObj);const g=h!=null&&h.createNode?h.createNode(n.schema,e,n):typeof((b=h==null?void 0:h.nodeClass)==null?void 0:b.from)=="function"?h.nodeClass.from(n.schema,e,n):new st(e);return t?g.tag=t:h.default||(g.tag=h.tag),f&&(f.node=g),g}function mh(e,t,n){let r=n;for(let a=t.length-1;a>=0;--a){const o=t[a];if(typeof o=="number"&&Number.isInteger(o)&&o>=0){const l=[];l[o]=r,r=l}else r=new Map([[o,r]])}return Su(r,void 0,{aliasDuplicateObjects:!1,keepUndefined:!1,onAnchor:()=>{throw new Error("This should not happen, please report a bug.")},schema:e,sourceObjects:new Map})}const cu=e=>e==null||typeof e=="object"&&!!e[Symbol.iterator]().next().done;class w_ extends Vb{constructor(t,n){super(t),Object.defineProperty(this,"schema",{value:n,configurable:!0,enumerable:!1,writable:!0})}clone(t){const n=Object.create(Object.getPrototypeOf(this),Object.getOwnPropertyDescriptors(this));return t&&(n.schema=t),n.items=n.items.map(r=>cn(r)||en(r)?r.clone(t):r),this.range&&(n.range=this.range.slice()),n}addIn(t,n){if(cu(t))this.add(n);else{const[r,...a]=t,o=this.get(r,!0);if(ln(o))o.addIn(a,n);else if(o===void 0&&this.schema)this.set(r,mh(this.schema,a,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}deleteIn(t){const[n,...r]=t;if(r.length===0)return this.delete(n);const a=this.get(n,!0);if(ln(a))return a.deleteIn(r);throw new Error(`Expected YAML collection at ${n}. Remaining path: ${r}`)}getIn(t,n){const[r,...a]=t,o=this.get(r,!0);return a.length===0?!n&&Kt(o)?o.value:o:ln(o)?o.getIn(a,n):void 0}hasAllNullValues(t){return this.items.every(n=>{if(!en(n))return!1;const r=n.value;return r==null||t&&Kt(r)&&r.value==null&&!r.commentBefore&&!r.comment&&!r.tag})}hasIn(t){const[n,...r]=t;if(r.length===0)return this.has(n);const a=this.get(n,!0);return ln(a)?a.hasIn(r):!1}setIn(t,n){const[r,...a]=t;if(a.length===0)this.set(r,n);else{const o=this.get(r,!0);if(ln(o))o.setIn(a,n);else if(o===void 0&&this.schema)this.set(r,mh(this.schema,a,n));else throw new Error(`Expected YAML collection at ${r}. Remaining path: ${a}`)}}}const vI=e=>e.replace(/^(?!$)(?: $)?/gm,"#");function da(e,t){return/^\n+$/.test(e)?e.substring(1):t?e.replace(/^(?! *$)/gm,t):e}const Ws=(e,t,n)=>e.endsWith(`
|
|
465
|
-
`)?da(n,t):n.includes(`
|
|
466
|
-
`)?`
|
|
467
|
-
`+da(n,t):(e.endsWith(" ")?"":" ")+n,k_="flow",qy="block",Jf="quoted";function Gh(e,t,n="flow",{indentAtStart:r,lineWidth:a=80,minContentWidth:o=20,onFold:l,onOverflow:d}={}){if(!a||a<0)return e;a<o&&(o=0);const f=Math.max(1+o,1+a-t.length);if(e.length<=f)return e;const h=[],g={};let m=a-t.length;typeof r=="number"&&(r>a-Math.max(2,o)?h.push(0):m=a-r);let y,b,k=!1,v=-1,N=-1,E=-1;n===qy&&(v=hk(e,v,t.length),v!==-1&&(m=v+f));for(let S;S=e[v+=1];){if(n===Jf&&S==="\\"){switch(N=v,e[v+1]){case"x":v+=3;break;case"u":v+=5;break;case"U":v+=9;break;default:v+=1}E=v}if(S===`
|
|
468
|
-
`)n===qy&&(v=hk(e,v,t.length)),m=v+t.length+f,y=void 0;else{if(S===" "&&b&&b!==" "&&b!==`
|
|
469
|
-
`&&b!==" "){const _=e[v+1];_&&_!==" "&&_!==`
|
|
470
|
-
`&&_!==" "&&(y=v)}if(v>=m)if(y)h.push(y),m=y+f,y=void 0;else if(n===Jf){for(;b===" "||b===" ";)b=S,S=e[v+=1],k=!0;const _=v>E+1?v-2:N-1;if(g[_])return e;h.push(_),g[_]=!0,m=_+f,y=void 0}else k=!0}b=S}if(k&&d&&d(),h.length===0)return e;l&&l();let C=e.slice(0,h[0]);for(let S=0;S<h.length;++S){const _=h[S],M=h[S+1]||e.length;_===0?C=`
|
|
471
|
-
${t}${e.slice(0,M)}`:(n===Jf&&g[_]&&(C+=`${e[_]}\\`),C+=`
|
|
472
|
-
${t}${e.slice(_+1,M)}`)}return C}function hk(e,t,n){let r=t,a=t+1,o=e[a];for(;o===" "||o===" ";)if(t<a+n)o=e[++t];else{do o=e[++t];while(o&&o!==`
|
|
473
|
-
`);r=t,a=t+1,o=e[a]}return r}const Vh=(e,t)=>({indentAtStart:t?e.indent.length:e.indentAtStart,lineWidth:e.options.lineWidth,minContentWidth:e.options.minContentWidth}),Yh=e=>/^(%|---|\.\.\.)/m.test(e);function wI(e,t,n){if(!t||t<0)return!1;const r=t-n,a=e.length;if(a<=r)return!1;for(let o=0,l=0;o<a;++o)if(e[o]===`
|
|
474
|
-
`){if(o-l>r)return!0;if(l=o+1,a-l<=r)return!1}return!0}function fu(e,t){const n=JSON.stringify(e);if(t.options.doubleQuotedAsJSON)return n;const{implicitKey:r}=t,a=t.options.doubleQuotedMinMultiLineLength,o=t.indent||(Yh(e)?" ":"");let l="",d=0;for(let f=0,h=n[f];h;h=n[++f])if(h===" "&&n[f+1]==="\\"&&n[f+2]==="n"&&(l+=n.slice(d,f)+"\\ ",f+=1,d=f,h="\\"),h==="\\")switch(n[f+1]){case"u":{l+=n.slice(d,f);const g=n.substr(f+2,4);switch(g){case"0000":l+="\\0";break;case"0007":l+="\\a";break;case"000b":l+="\\v";break;case"001b":l+="\\e";break;case"0085":l+="\\N";break;case"00a0":l+="\\_";break;case"2028":l+="\\L";break;case"2029":l+="\\P";break;default:g.substr(0,2)==="00"?l+="\\x"+g.substr(2):l+=n.substr(f,6)}f+=5,d=f+1}break;case"n":if(r||n[f+2]==='"'||n.length<a)f+=1;else{for(l+=n.slice(d,f)+`
|
|
475
|
-
|
|
476
|
-
`;n[f+2]==="\\"&&n[f+3]==="n"&&n[f+4]!=='"';)l+=`
|
|
477
|
-
`,f+=2;l+=o,n[f+2]===" "&&(l+="\\"),f+=1,d=f+1}break;default:f+=1}return l=d?l+n.slice(d):n,r?l:Gh(l,o,Jf,Vh(t,!1))}function Hy(e,t){if(t.options.singleQuote===!1||t.implicitKey&&e.includes(`
|
|
478
|
-
`)||/[ \t]\n|\n[ \t]/.test(e))return fu(e,t);const n=t.indent||(Yh(e)?" ":""),r="'"+e.replace(/'/g,"''").replace(/\n+/g,`$&
|
|
479
|
-
${n}`)+"'";return t.implicitKey?r:Gh(r,n,k_,Vh(t,!1))}function bl(e,t){const{singleQuote:n}=t.options;let r;if(n===!1)r=fu;else{const a=e.includes('"'),o=e.includes("'");a&&!o?r=Hy:o&&!a?r=fu:r=n?Hy:fu}return r(e,t)}let Ky;try{Ky=new RegExp(`(^|(?<!
|
|
480
|
-
))
|
|
481
|
-
+(?!
|
|
482
|
-
|$)`,"g")}catch{Ky=/\n+(?!\n|$)/g}function eh({comment:e,type:t,value:n},r,a,o){const{blockQuote:l,commentString:d,lineWidth:f}=r.options;if(!l||/\n[\t ]+$/.test(n))return bl(n,r);const h=r.indent||(r.forceBlockIndent||Yh(n)?" ":""),g=l==="literal"?!0:l==="folded"||t===st.BLOCK_FOLDED?!1:t===st.BLOCK_LITERAL?!0:!wI(n,f,h.length);if(!n)return g?`|
|
|
483
|
-
`:`>
|
|
484
|
-
`;let m,y;for(y=n.length;y>0;--y){const M=n[y-1];if(M!==`
|
|
485
|
-
`&&M!==" "&&M!==" ")break}let b=n.substring(y);const k=b.indexOf(`
|
|
486
|
-
`);k===-1?m="-":n===b||k!==b.length-1?(m="+",o&&o()):m="",b&&(n=n.slice(0,-b.length),b[b.length-1]===`
|
|
487
|
-
`&&(b=b.slice(0,-1)),b=b.replace(Ky,`$&${h}`));let v=!1,N,E=-1;for(N=0;N<n.length;++N){const M=n[N];if(M===" ")v=!0;else if(M===`
|
|
488
|
-
`)E=N;else break}let C=n.substring(0,E<N?E+1:N);C&&(n=n.substring(C.length),C=C.replace(/\n+/g,`$&${h}`));let _=(v?h?"2":"1":"")+m;if(e&&(_+=" "+d(e.replace(/ ?[\r\n]+/g," ")),a&&a()),!g){const M=n.replace(/\n+/g,`
|
|
489
|
-
$&`).replace(/(?:^|\n)([\t ].*)(?:([\n\t ]*)\n(?![\n\t ]))?/g,"$1$2").replace(/\n+/g,`$&${h}`);let T=!1;const L=Vh(r,!0);l!=="folded"&&t!==st.BLOCK_FOLDED&&(L.onOverflow=()=>{T=!0});const R=Gh(`${C}${M}${b}`,h,qy,L);if(!T)return`>${_}
|
|
490
|
-
${h}${R}`}return n=n.replace(/\n+/g,`$&${h}`),`|${_}
|
|
491
|
-
${h}${C}${n}${b}`}function kI(e,t,n,r){const{type:a,value:o}=e,{actualString:l,implicitKey:d,indent:f,indentStep:h,inFlow:g}=t;if(d&&o.includes(`
|
|
492
|
-
`)||g&&/[[\]{},]/.test(o))return bl(o,t);if(/^[\n\t ,[\]{}#&*!|>'"%@`]|^[?-]$|^[?-][ \t]|[\n:][ \t]|[ \t]\n|[\n\t ]#|[\n\t :]$/.test(o))return d||g||!o.includes(`
|
|
493
|
-
`)?bl(o,t):eh(e,t,n,r);if(!d&&!g&&a!==st.PLAIN&&o.includes(`
|
|
494
|
-
`))return eh(e,t,n,r);if(Yh(o)){if(f==="")return t.forceBlockIndent=!0,eh(e,t,n,r);if(d&&f===h)return bl(o,t)}const m=o.replace(/\n+/g,`$&
|
|
495
|
-
${f}`);if(l){const y=v=>{var N;return v.default&&v.tag!=="tag:yaml.org,2002:str"&&((N=v.test)==null?void 0:N.test(m))},{compat:b,tags:k}=t.doc.schema;if(k.some(y)||b!=null&&b.some(y))return bl(o,t)}return d?m:Gh(m,f,k_,Vh(t,!1))}function Qu(e,t,n,r){const{implicitKey:a,inFlow:o}=t,l=typeof e.value=="string"?e:Object.assign({},e,{value:String(e.value)});let{type:d}=e;d!==st.QUOTE_DOUBLE&&/[\x00-\x08\x0b-\x1f\x7f-\x9f\u{D800}-\u{DFFF}]/u.test(l.value)&&(d=st.QUOTE_DOUBLE);const f=g=>{switch(g){case st.BLOCK_FOLDED:case st.BLOCK_LITERAL:return a||o?bl(l.value,t):eh(l,t,n,r);case st.QUOTE_DOUBLE:return fu(l.value,t);case st.QUOTE_SINGLE:return Hy(l.value,t);case st.PLAIN:return kI(l,t,n,r);default:return null}};let h=f(d);if(h===null){const{defaultKeyType:g,defaultStringType:m}=t.options,y=a&&g||m;if(h=f(y),h===null)throw new Error(`Unsupported default string type ${y}`)}return h}function E_(e,t){const n=Object.assign({blockQuote:!0,commentString:vI,defaultKeyType:null,defaultStringType:"PLAIN",directives:null,doubleQuotedAsJSON:!1,doubleQuotedMinMultiLineLength:40,falseStr:"false",flowCollectionPadding:!0,indentSeq:!0,lineWidth:80,minContentWidth:20,nullStr:"null",simpleKeys:!1,singleQuote:null,trailingComma:!1,trueStr:"true",verifyAliasOrder:!0},e.schema.toStringOptions,t);let r;switch(n.collectionStyle){case"block":r=!1;break;case"flow":r=!0;break;default:r=null}return{anchors:new Set,doc:e,flowCollectionPadding:n.flowCollectionPadding?" ":"",indent:"",indentStep:typeof n.indent=="number"?" ".repeat(n.indent):" ",inFlow:r,options:n}}function EI(e,t){var a;if(t.tag){const o=e.filter(l=>l.tag===t.tag);if(o.length>0)return o.find(l=>l.format===t.format)??o[0]}let n,r;if(Kt(t)){r=t.value;let o=e.filter(l=>{var d;return(d=l.identify)==null?void 0:d.call(l,r)});if(o.length>1){const l=o.filter(d=>d.test);l.length>0&&(o=l)}n=o.find(l=>l.format===t.format)??o.find(l=>!l.format)}else r=t,n=e.find(o=>o.nodeClass&&r instanceof o.nodeClass);if(!n){const o=((a=r==null?void 0:r.constructor)==null?void 0:a.name)??(r===null?"null":typeof r);throw new Error(`Tag not resolved for ${o} value`)}return n}function SI(e,t,{anchors:n,doc:r}){if(!r.directives)return"";const a=[],o=(Kt(e)||ln(e))&&e.anchor;o&&y_(o)&&(n.add(o),a.push(`&${o}`));const l=e.tag??(t.default?null:t.tag);return l&&a.push(r.directives.tagString(l)),a.join(" ")}function Bl(e,t,n,r){var f;if(en(e))return e.toString(t,n,r);if(Ss(e)){if(t.doc.directives)return e.toString(t);if((f=t.resolvedAliases)!=null&&f.has(e))throw new TypeError("Cannot stringify circular structure without alias nodes");t.resolvedAliases?t.resolvedAliases.add(e):t.resolvedAliases=new Set([e]),e=e.resolve(t.doc)}let a;const o=cn(e)?e:t.doc.createNode(e,{onTagObj:h=>a=h});a??(a=EI(t.doc.schema.tags,o));const l=SI(o,a,t);l.length>0&&(t.indentAtStart=(t.indentAtStart??0)+l.length+1);const d=typeof a.stringify=="function"?a.stringify(o,t,n,r):Kt(o)?Qu(o,t,n,r):o.toString(t,n,r);return l?Kt(o)||d[0]==="{"||d[0]==="["?`${l} ${d}`:`${l}
|
|
496
|
-
${t.indent}${d}`:d}function NI({key:e,value:t},n,r,a){const{allNullValues:o,doc:l,indent:d,indentStep:f,options:{commentString:h,indentSeq:g,simpleKeys:m}}=n;let y=cn(e)&&e.comment||null;if(m){if(y)throw new Error("With simple keys, key nodes cannot have comments");if(ln(e)||!cn(e)&&typeof e=="object"){const L="With simple keys, collection cannot be used as a key value";throw new Error(L)}}let b=!m&&(!e||y&&t==null&&!n.inFlow||ln(e)||(Kt(e)?e.type===st.BLOCK_FOLDED||e.type===st.BLOCK_LITERAL:typeof e=="object"));n=Object.assign({},n,{allNullValues:!1,implicitKey:!b&&(m||!o),indent:d+f});let k=!1,v=!1,N=Bl(e,n,()=>k=!0,()=>v=!0);if(!b&&!n.inFlow&&N.length>1024){if(m)throw new Error("With simple keys, single line scalar must not span more than 1024 characters");b=!0}if(n.inFlow){if(o||t==null)return k&&r&&r(),N===""?"?":b?`? ${N}`:N}else if(o&&!m||t==null&&b)return N=`? ${N}`,y&&!k?N+=Ws(N,n.indent,h(y)):v&&a&&a(),N;k&&(y=null),b?(y&&(N+=Ws(N,n.indent,h(y))),N=`? ${N}
|
|
497
|
-
${d}:`):(N=`${N}:`,y&&(N+=Ws(N,n.indent,h(y))));let E,C,S;cn(t)?(E=!!t.spaceBefore,C=t.commentBefore,S=t.comment):(E=!1,C=null,S=null,t&&typeof t=="object"&&(t=l.createNode(t))),n.implicitKey=!1,!b&&!y&&Kt(t)&&(n.indentAtStart=N.length+1),v=!1,!g&&f.length>=2&&!n.inFlow&&!b&&tc(t)&&!t.flow&&!t.tag&&!t.anchor&&(n.indent=n.indent.substring(2));let _=!1;const M=Bl(t,n,()=>_=!0,()=>v=!0);let T=" ";if(y||E||C){if(T=E?`
|
|
498
|
-
`:"",C){const L=h(C);T+=`
|
|
499
|
-
${da(L,n.indent)}`}M===""&&!n.inFlow?T===`
|
|
500
|
-
`&&S&&(T=`
|
|
501
|
-
|
|
502
|
-
`):T+=`
|
|
503
|
-
${n.indent}`}else if(!b&&ln(t)){const L=M[0],R=M.indexOf(`
|
|
504
|
-
`),$=R!==-1,z=n.inFlow??t.flow??t.items.length===0;if($||!z){let q=!1;if($&&(L==="&"||L==="!")){let F=M.indexOf(" ");L==="&"&&F!==-1&&F<R&&M[F+1]==="!"&&(F=M.indexOf(" ",F+1)),(F===-1||R<F)&&(q=!0)}q||(T=`
|
|
505
|
-
${n.indent}`)}}else(M===""||M[0]===`
|
|
506
|
-
`)&&(T="");return N+=T+M,n.inFlow?_&&r&&r():S&&!_?N+=Ws(N,n.indent,h(S)):v&&a&&a(),N}function S_(e,t){(e==="debug"||e==="warn")&&console.warn(t)}const Ef="<<",ha={identify:e=>e===Ef||typeof e=="symbol"&&e.description===Ef,default:"key",tag:"tag:yaml.org,2002:merge",test:/^<<$/,resolve:()=>Object.assign(new st(Symbol(Ef)),{addToJSMap:N_}),stringify:()=>Ef},_I=(e,t)=>(ha.identify(t)||Kt(t)&&(!t.type||t.type===st.PLAIN)&&ha.identify(t.value))&&(e==null?void 0:e.doc.schema.tags.some(n=>n.tag===ha.tag&&n.default));function N_(e,t,n){if(n=e&&Ss(n)?n.resolve(e.doc):n,tc(n))for(const r of n.items)Dg(e,t,r);else if(Array.isArray(n))for(const r of n)Dg(e,t,r);else Dg(e,t,n)}function Dg(e,t,n){const r=e&&Ss(n)?n.resolve(e.doc):n;if(!ec(r))throw new Error("Merge sources must be maps or map aliases");const a=r.toJSON(null,e,Map);for(const[o,l]of a)t instanceof Map?t.has(o)||t.set(o,l):t instanceof Set?t.add(o):Object.prototype.hasOwnProperty.call(t,o)||Object.defineProperty(t,o,{value:l,writable:!0,enumerable:!0,configurable:!0});return t}function __(e,t,{key:n,value:r}){if(cn(n)&&n.addToJSMap)n.addToJSMap(e,t,r);else if(_I(e,n))N_(e,t,r);else{const a=Kr(n,"",e);if(t instanceof Map)t.set(a,Kr(r,a,e));else if(t instanceof Set)t.add(a);else{const o=jI(n,a,e),l=Kr(r,o,e);o in t?Object.defineProperty(t,o,{value:l,writable:!0,enumerable:!0,configurable:!0}):t[o]=l}}return t}function jI(e,t,n){if(t===null)return"";if(typeof t!="object")return String(t);if(cn(e)&&(n!=null&&n.doc)){const r=E_(n.doc,{});r.anchors=new Set;for(const o of n.anchors.keys())r.anchors.add(o.anchor);r.inFlow=!0,r.inStringifyKey=!0;const a=e.toString(r);if(!n.mapKeyWarned){let o=JSON.stringify(a);o.length>40&&(o=o.substring(0,36)+'..."'),S_(n.doc.options.logLevel,`Keys with collection values will be stringified due to JS Object restrictions: ${o}. Set mapAsMap: true to use object keys.`),n.mapKeyWarned=!0}return a}return JSON.stringify(t)}function Yb(e,t,n){const r=Su(e,void 0,n),a=Su(t,void 0,n);return new Vn(r,a)}class Vn{constructor(t,n=null){Object.defineProperty(this,Vr,{value:d_}),this.key=t,this.value=n}clone(t){let{key:n,value:r}=this;return cn(n)&&(n=n.clone(t)),cn(r)&&(r=r.clone(t)),new Vn(n,r)}toJSON(t,n){const r=n!=null&&n.mapAsMap?new Map:{};return __(n,r,this)}toString(t,n,r){return t!=null&&t.doc?NI(this,t,n,r):JSON.stringify(this)}}function j_(e,t,n){return(t.inFlow??e.flow?AI:CI)(e,t,n)}function CI({comment:e,items:t},n,{blockItemPrefix:r,flowChars:a,itemIndent:o,onChompKeep:l,onComment:d}){const{indent:f,options:{commentString:h}}=n,g=Object.assign({},n,{indent:o,type:null});let m=!1;const y=[];for(let k=0;k<t.length;++k){const v=t[k];let N=null;if(cn(v))!m&&v.spaceBefore&&y.push(""),gh(n,y,v.commentBefore,m),v.comment&&(N=v.comment);else if(en(v)){const C=cn(v.key)?v.key:null;C&&(!m&&C.spaceBefore&&y.push(""),gh(n,y,C.commentBefore,m))}m=!1;let E=Bl(v,g,()=>N=null,()=>m=!0);N&&(E+=Ws(E,o,h(N))),m&&N&&(m=!1),y.push(r+E)}let b;if(y.length===0)b=a.start+a.end;else{b=y[0];for(let k=1;k<y.length;++k){const v=y[k];b+=v?`
|
|
507
|
-
${f}${v}`:`
|
|
508
|
-
`}}return e?(b+=`
|
|
509
|
-
`+da(h(e),f),d&&d()):m&&l&&l(),b}function AI({items:e},t,{flowChars:n,itemIndent:r}){const{indent:a,indentStep:o,flowCollectionPadding:l,options:{commentString:d}}=t;r+=o;const f=Object.assign({},t,{indent:r,inFlow:!0,type:null});let h=!1,g=0;const m=[];for(let k=0;k<e.length;++k){const v=e[k];let N=null;if(cn(v))v.spaceBefore&&m.push(""),gh(t,m,v.commentBefore,!1),v.comment&&(N=v.comment);else if(en(v)){const C=cn(v.key)?v.key:null;C&&(C.spaceBefore&&m.push(""),gh(t,m,C.commentBefore,!1),C.comment&&(h=!0));const S=cn(v.value)?v.value:null;S?(S.comment&&(N=S.comment),S.commentBefore&&(h=!0)):v.value==null&&(C!=null&&C.comment)&&(N=C.comment)}N&&(h=!0);let E=Bl(v,f,()=>N=null);h||(h=m.length>g||E.includes(`
|
|
510
|
-
`)),k<e.length-1?E+=",":t.options.trailingComma&&(t.options.lineWidth>0&&(h||(h=m.reduce((C,S)=>C+S.length+2,2)+(E.length+2)>t.options.lineWidth)),h&&(E+=",")),N&&(E+=Ws(E,r,d(N))),m.push(E),g=m.length}const{start:y,end:b}=n;if(m.length===0)return y+b;if(!h){const k=m.reduce((v,N)=>v+N.length+2,2);h=t.options.lineWidth>0&&k>t.options.lineWidth}if(h){let k=y;for(const v of m)k+=v?`
|
|
511
|
-
${o}${a}${v}`:`
|
|
512
|
-
`;return`${k}
|
|
513
|
-
${a}${b}`}else return`${y}${l}${m.join(" ")}${l}${b}`}function gh({indent:e,options:{commentString:t}},n,r,a){if(r&&a&&(r=r.replace(/^\n+/,"")),r){const o=da(t(r),e);n.push(o.trimStart())}}function Xs(e,t){const n=Kt(t)?t.value:t;for(const r of e)if(en(r)&&(r.key===t||r.key===n||Kt(r.key)&&r.key.value===n))return r}class Nr extends w_{static get tagName(){return"tag:yaml.org,2002:map"}constructor(t){super(xs,t),this.items=[]}static from(t,n,r){const{keepUndefined:a,replacer:o}=r,l=new this(t),d=(f,h)=>{if(typeof o=="function")h=o.call(n,f,h);else if(Array.isArray(o)&&!o.includes(f))return;(h!==void 0||a)&&l.items.push(Yb(f,h,r))};if(n instanceof Map)for(const[f,h]of n)d(f,h);else if(n&&typeof n=="object")for(const f of Object.keys(n))d(f,n[f]);return typeof t.sortMapEntries=="function"&&l.items.sort(t.sortMapEntries),l}add(t,n){var l;let r;en(t)?r=t:!t||typeof t!="object"||!("key"in t)?r=new Vn(t,t==null?void 0:t.value):r=new Vn(t.key,t.value);const a=Xs(this.items,r.key),o=(l=this.schema)==null?void 0:l.sortMapEntries;if(a){if(!n)throw new Error(`Key ${r.key} already set`);Kt(a.value)&&v_(r.value)?a.value.value=r.value:a.value=r.value}else if(o){const d=this.items.findIndex(f=>o(r,f)<0);d===-1?this.items.push(r):this.items.splice(d,0,r)}else this.items.push(r)}delete(t){const n=Xs(this.items,t);return n?this.items.splice(this.items.indexOf(n),1).length>0:!1}get(t,n){const r=Xs(this.items,t),a=r==null?void 0:r.value;return(!n&&Kt(a)?a.value:a)??void 0}has(t){return!!Xs(this.items,t)}set(t,n){this.add(new Vn(t,n),!0)}toJSON(t,n,r){const a=r?new r:n!=null&&n.mapAsMap?new Map:{};n!=null&&n.onCreate&&n.onCreate(a);for(const o of this.items)__(n,a,o);return a}toString(t,n,r){if(!t)return JSON.stringify(this);for(const a of this.items)if(!en(a))throw new Error(`Map items must all be pairs; found ${JSON.stringify(a)} instead`);return!t.allNullValues&&this.hasAllNullValues(!1)&&(t=Object.assign({},t,{allNullValues:!0})),j_(this,t,{blockItemPrefix:"",flowChars:{start:"{",end:"}"},itemIndent:t.indent||"",onChompKeep:r,onComment:n})}}const nc={collection:"map",default:!0,nodeClass:Nr,tag:"tag:yaml.org,2002:map",resolve(e,t){return ec(e)||t("Expected a mapping for this tag"),e},createNode:(e,t,n)=>Nr.from(e,t,n)};class ws extends w_{static get tagName(){return"tag:yaml.org,2002:seq"}constructor(t){super(Jl,t),this.items=[]}add(t){this.items.push(t)}delete(t){const n=Sf(t);return typeof n!="number"?!1:this.items.splice(n,1).length>0}get(t,n){const r=Sf(t);if(typeof r!="number")return;const a=this.items[r];return!n&&Kt(a)?a.value:a}has(t){const n=Sf(t);return typeof n=="number"&&n<this.items.length}set(t,n){const r=Sf(t);if(typeof r!="number")throw new Error(`Expected a valid index, not ${t}.`);const a=this.items[r];Kt(a)&&v_(n)?a.value=n:this.items[r]=n}toJSON(t,n){const r=[];n!=null&&n.onCreate&&n.onCreate(r);let a=0;for(const o of this.items)r.push(Kr(o,String(a++),n));return r}toString(t,n,r){return t?j_(this,t,{blockItemPrefix:"- ",flowChars:{start:"[",end:"]"},itemIndent:(t.indent||"")+" ",onChompKeep:r,onComment:n}):JSON.stringify(this)}static from(t,n,r){const{replacer:a}=r,o=new this(t);if(n&&Symbol.iterator in Object(n)){let l=0;for(let d of n){if(typeof a=="function"){const f=n instanceof Set?d:String(l++);d=a.call(n,f,d)}o.items.push(Su(d,void 0,r))}}return o}}function Sf(e){let t=Kt(e)?e.value:e;return t&&typeof t=="string"&&(t=Number(t)),typeof t=="number"&&Number.isInteger(t)&&t>=0?t:null}const rc={collection:"seq",default:!0,nodeClass:ws,tag:"tag:yaml.org,2002:seq",resolve(e,t){return tc(e)||t("Expected a sequence for this tag"),e},createNode:(e,t,n)=>ws.from(e,t,n)},Qh={identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify(e,t,n,r){return t=Object.assign({actualString:!0},t),Qu(e,t,n,r)}},Wh={identify:e=>e==null,createNode:()=>new st(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^(?:~|[Nn]ull|NULL)?$/,resolve:()=>new st(null),stringify:({source:e},t)=>typeof e=="string"&&Wh.test.test(e)?e:t.options.nullStr},Qb={identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:[Tt]rue|TRUE|[Ff]alse|FALSE)$/,resolve:e=>new st(e[0]==="t"||e[0]==="T"),stringify({source:e,value:t},n){if(e&&Qb.test.test(e)){const r=e[0]==="t"||e[0]==="T";if(t===r)return e}return t?n.options.trueStr:n.options.falseStr}};function mi({format:e,minFractionDigits:t,tag:n,value:r}){if(typeof r=="bigint")return String(r);const a=typeof r=="number"?r:Number(r);if(!isFinite(a))return isNaN(a)?".nan":a<0?"-.inf":".inf";let o=Object.is(r,-0)?"-0":JSON.stringify(r);if(!e&&t&&(!n||n==="tag:yaml.org,2002:float")&&/^\d/.test(o)){let l=o.indexOf(".");l<0&&(l=o.length,o+=".");let d=t-(o.length-l-1);for(;d-- >0;)o+="0"}return o}const C_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mi},A_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:\.[0-9]+|[0-9]+(?:\.[0-9]*)?)[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():mi(e)}},T_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:\.[0-9]+|[0-9]+\.[0-9]*)$/,resolve(e){const t=new st(parseFloat(e)),n=e.indexOf(".");return n!==-1&&e[e.length-1]==="0"&&(t.minFractionDigits=e.length-n-1),t},stringify:mi},Xh=e=>typeof e=="bigint"||Number.isInteger(e),Wb=(e,t,n,{intAsBigInt:r})=>r?BigInt(e):parseInt(e.substring(t),n);function M_(e,t,n){const{value:r}=e;return Xh(r)&&r>=0?n+r.toString(t):mi(e)}const D_={identify:e=>Xh(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^0o[0-7]+$/,resolve:(e,t,n)=>Wb(e,2,8,n),stringify:e=>M_(e,8,"0o")},O_={identify:Xh,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9]+$/,resolve:(e,t,n)=>Wb(e,0,10,n),stringify:mi},R_={identify:e=>Xh(e)&&e>=0,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^0x[0-9a-fA-F]+$/,resolve:(e,t,n)=>Wb(e,2,16,n),stringify:e=>M_(e,16,"0x")},TI=[nc,rc,Qh,Wh,Qb,D_,O_,R_,C_,A_,T_];function pk(e){return typeof e=="bigint"||Number.isInteger(e)}const Nf=({value:e})=>JSON.stringify(e),MI=[{identify:e=>typeof e=="string",default:!0,tag:"tag:yaml.org,2002:str",resolve:e=>e,stringify:Nf},{identify:e=>e==null,createNode:()=>new st(null),default:!0,tag:"tag:yaml.org,2002:null",test:/^null$/,resolve:()=>null,stringify:Nf},{identify:e=>typeof e=="boolean",default:!0,tag:"tag:yaml.org,2002:bool",test:/^true$|^false$/,resolve:e=>e==="true",stringify:Nf},{identify:pk,default:!0,tag:"tag:yaml.org,2002:int",test:/^-?(?:0|[1-9][0-9]*)$/,resolve:(e,t,{intAsBigInt:n})=>n?BigInt(e):parseInt(e,10),stringify:({value:e})=>pk(e)?e.toString():JSON.stringify(e)},{identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^-?(?:0|[1-9][0-9]*)(?:\.[0-9]*)?(?:[eE][-+]?[0-9]+)?$/,resolve:e=>parseFloat(e),stringify:Nf}],DI={default:!0,tag:"",test:/^/,resolve(e,t){return t(`Unresolved plain scalar ${JSON.stringify(e)}`),e}},OI=[nc,rc].concat(MI,DI),Xb={identify:e=>e instanceof Uint8Array,default:!1,tag:"tag:yaml.org,2002:binary",resolve(e,t){if(typeof atob=="function"){const n=atob(e.replace(/[\n\r]/g,"")),r=new Uint8Array(n.length);for(let a=0;a<n.length;++a)r[a]=n.charCodeAt(a);return r}else return t("This environment does not support reading binary tags; either Buffer or atob is required"),e},stringify({comment:e,type:t,value:n},r,a,o){if(!n)return"";const l=n;let d;if(typeof btoa=="function"){let f="";for(let h=0;h<l.length;++h)f+=String.fromCharCode(l[h]);d=btoa(f)}else throw new Error("This environment does not support writing binary tags; either Buffer or btoa is required");if(t??(t=st.BLOCK_LITERAL),t!==st.QUOTE_DOUBLE){const f=Math.max(r.options.lineWidth-r.indent.length,r.options.minContentWidth),h=Math.ceil(d.length/f),g=new Array(h);for(let m=0,y=0;m<h;++m,y+=f)g[m]=d.substr(y,f);d=g.join(t===st.BLOCK_LITERAL?`
|
|
514
|
-
`:" ")}return Qu({comment:e,type:t,value:d},r,a,o)}};function L_(e,t){if(tc(e))for(let n=0;n<e.items.length;++n){let r=e.items[n];if(!en(r)){if(ec(r)){r.items.length>1&&t("Each pair must have its own sequence indicator");const a=r.items[0]||new Vn(new st(null));if(r.commentBefore&&(a.key.commentBefore=a.key.commentBefore?`${r.commentBefore}
|
|
515
|
-
${a.key.commentBefore}`:r.commentBefore),r.comment){const o=a.value??a.key;o.comment=o.comment?`${r.comment}
|
|
516
|
-
${o.comment}`:r.comment}r=a}e.items[n]=en(r)?r:new Vn(r)}}else t("Expected a sequence for this tag");return e}function I_(e,t,n){const{replacer:r}=n,a=new ws(e);a.tag="tag:yaml.org,2002:pairs";let o=0;if(t&&Symbol.iterator in Object(t))for(let l of t){typeof r=="function"&&(l=r.call(t,String(o++),l));let d,f;if(Array.isArray(l))if(l.length===2)d=l[0],f=l[1];else throw new TypeError(`Expected [key, value] tuple: ${l}`);else if(l&&l instanceof Object){const h=Object.keys(l);if(h.length===1)d=h[0],f=l[d];else throw new TypeError(`Expected tuple with one key, not ${h.length} keys`)}else d=l;a.items.push(Yb(d,f,n))}return a}const Zb={collection:"seq",default:!1,tag:"tag:yaml.org,2002:pairs",resolve:L_,createNode:I_};class wl extends ws{constructor(){super(),this.add=Nr.prototype.add.bind(this),this.delete=Nr.prototype.delete.bind(this),this.get=Nr.prototype.get.bind(this),this.has=Nr.prototype.has.bind(this),this.set=Nr.prototype.set.bind(this),this.tag=wl.tag}toJSON(t,n){if(!n)return super.toJSON(t);const r=new Map;n!=null&&n.onCreate&&n.onCreate(r);for(const a of this.items){let o,l;if(en(a)?(o=Kr(a.key,"",n),l=Kr(a.value,o,n)):o=Kr(a,"",n),r.has(o))throw new Error("Ordered maps must not include duplicate keys");r.set(o,l)}return r}static from(t,n,r){const a=I_(t,n,r),o=new this;return o.items=a.items,o}}wl.tag="tag:yaml.org,2002:omap";const Jb={collection:"seq",identify:e=>e instanceof Map,nodeClass:wl,default:!1,tag:"tag:yaml.org,2002:omap",resolve(e,t){const n=L_(e,t),r=[];for(const{key:a}of n.items)Kt(a)&&(r.includes(a.value)?t(`Ordered maps must not include duplicate keys: ${a.value}`):r.push(a.value));return Object.assign(new wl,n)},createNode:(e,t,n)=>wl.from(e,t,n)};function z_({value:e,source:t},n){return t&&(e?P_:B_).test.test(t)?t:e?n.options.trueStr:n.options.falseStr}const P_={identify:e=>e===!0,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:Y|y|[Yy]es|YES|[Tt]rue|TRUE|[Oo]n|ON)$/,resolve:()=>new st(!0),stringify:z_},B_={identify:e=>e===!1,default:!0,tag:"tag:yaml.org,2002:bool",test:/^(?:N|n|[Nn]o|NO|[Ff]alse|FALSE|[Oo]ff|OFF)$/,resolve:()=>new st(!1),stringify:z_},RI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^(?:[-+]?\.(?:inf|Inf|INF)|\.nan|\.NaN|\.NAN)$/,resolve:e=>e.slice(-3).toLowerCase()==="nan"?NaN:e[0]==="-"?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY,stringify:mi},LI={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"EXP",test:/^[-+]?(?:[0-9][0-9_]*)?(?:\.[0-9_]*)?[eE][-+]?[0-9]+$/,resolve:e=>parseFloat(e.replace(/_/g,"")),stringify(e){const t=Number(e.value);return isFinite(t)?t.toExponential():mi(e)}},II={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",test:/^[-+]?(?:[0-9][0-9_]*)?\.[0-9_]*$/,resolve(e){const t=new st(parseFloat(e.replace(/_/g,""))),n=e.indexOf(".");if(n!==-1){const r=e.substring(n+1).replace(/_/g,"");r[r.length-1]==="0"&&(t.minFractionDigits=r.length)}return t},stringify:mi},Wu=e=>typeof e=="bigint"||Number.isInteger(e);function Zh(e,t,n,{intAsBigInt:r}){const a=e[0];if((a==="-"||a==="+")&&(t+=1),e=e.substring(t).replace(/_/g,""),r){switch(n){case 2:e=`0b${e}`;break;case 8:e=`0o${e}`;break;case 16:e=`0x${e}`;break}const l=BigInt(e);return a==="-"?BigInt(-1)*l:l}const o=parseInt(e,n);return a==="-"?-1*o:o}function ex(e,t,n){const{value:r}=e;if(Wu(r)){const a=r.toString(t);return r<0?"-"+n+a.substr(1):n+a}return mi(e)}const zI={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",format:"BIN",test:/^[-+]?0b[0-1_]+$/,resolve:(e,t,n)=>Zh(e,2,2,n),stringify:e=>ex(e,2,"0b")},PI={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",format:"OCT",test:/^[-+]?0[0-7_]+$/,resolve:(e,t,n)=>Zh(e,1,8,n),stringify:e=>ex(e,8,"0")},BI={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",test:/^[-+]?[0-9][0-9_]*$/,resolve:(e,t,n)=>Zh(e,0,10,n),stringify:mi},$I={identify:Wu,default:!0,tag:"tag:yaml.org,2002:int",format:"HEX",test:/^[-+]?0x[0-9a-fA-F_]+$/,resolve:(e,t,n)=>Zh(e,2,16,n),stringify:e=>ex(e,16,"0x")};class kl extends Nr{constructor(t){super(t),this.tag=kl.tag}add(t){let n;en(t)?n=t:t&&typeof t=="object"&&"key"in t&&"value"in t&&t.value===null?n=new Vn(t.key,null):n=new Vn(t,null),Xs(this.items,n.key)||this.items.push(n)}get(t,n){const r=Xs(this.items,t);return!n&&en(r)?Kt(r.key)?r.key.value:r.key:r}set(t,n){if(typeof n!="boolean")throw new Error(`Expected boolean value for set(key, value) in a YAML set, not ${typeof n}`);const r=Xs(this.items,t);r&&!n?this.items.splice(this.items.indexOf(r),1):!r&&n&&this.items.push(new Vn(t))}toJSON(t,n){return super.toJSON(t,n,Set)}toString(t,n,r){if(!t)return JSON.stringify(this);if(this.hasAllNullValues(!0))return super.toString(Object.assign({},t,{allNullValues:!0}),n,r);throw new Error("Set items must all have null values")}static from(t,n,r){const{replacer:a}=r,o=new this(t);if(n&&Symbol.iterator in Object(n))for(let l of n)typeof a=="function"&&(l=a.call(n,l,l)),o.items.push(Yb(l,null,r));return o}}kl.tag="tag:yaml.org,2002:set";const tx={collection:"map",identify:e=>e instanceof Set,nodeClass:kl,default:!1,tag:"tag:yaml.org,2002:set",createNode:(e,t,n)=>kl.from(e,t,n),resolve(e,t){if(ec(e)){if(e.hasAllNullValues(!0))return Object.assign(new kl,e);t("Set items must all have null values")}else t("Expected a mapping for this tag");return e}};function nx(e,t){const n=e[0],r=n==="-"||n==="+"?e.substring(1):e,a=l=>t?BigInt(l):Number(l),o=r.replace(/_/g,"").split(":").reduce((l,d)=>l*a(60)+a(d),a(0));return n==="-"?a(-1)*o:o}function $_(e){let{value:t}=e,n=l=>l;if(typeof t=="bigint")n=l=>BigInt(l);else if(isNaN(t)||!isFinite(t))return mi(e);let r="";t<0&&(r="-",t*=n(-1));const a=n(60),o=[t%a];return t<60?o.unshift(0):(t=(t-o[0])/a,o.unshift(t%a),t>=60&&(t=(t-o[0])/a,o.unshift(t))),r+o.map(l=>String(l).padStart(2,"0")).join(":").replace(/000000\d*$/,"")}const U_={identify:e=>typeof e=="bigint"||Number.isInteger(e),default:!0,tag:"tag:yaml.org,2002:int",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+$/,resolve:(e,t,{intAsBigInt:n})=>nx(e,n),stringify:$_},F_={identify:e=>typeof e=="number",default:!0,tag:"tag:yaml.org,2002:float",format:"TIME",test:/^[-+]?[0-9][0-9_]*(?::[0-5]?[0-9])+\.[0-9_]*$/,resolve:e=>nx(e,!1),stringify:$_},Jh={identify:e=>e instanceof Date,default:!0,tag:"tag:yaml.org,2002:timestamp",test:RegExp("^([0-9]{4})-([0-9]{1,2})-([0-9]{1,2})(?:(?:t|T|[ \\t]+)([0-9]{1,2}):([0-9]{1,2}):([0-9]{1,2}(\\.[0-9]+)?)(?:[ \\t]*(Z|[-+][012]?[0-9](?::[0-9]{2})?))?)?$"),resolve(e){const t=e.match(Jh.test);if(!t)throw new Error("!!timestamp expects a date, starting with yyyy-mm-dd");const[,n,r,a,o,l,d]=t.map(Number),f=t[7]?Number((t[7]+"00").substr(1,3)):0;let h=Date.UTC(n,r-1,a,o||0,l||0,d||0,f);const g=t[8];if(g&&g!=="Z"){let m=nx(g,!1);Math.abs(m)<30&&(m*=60),h-=6e4*m}return new Date(h)},stringify:({value:e})=>(e==null?void 0:e.toISOString().replace(/(T00:00:00)?\.000Z$/,""))??""},mk=[nc,rc,Qh,Wh,P_,B_,zI,PI,BI,$I,RI,LI,II,Xb,ha,Jb,Zb,tx,U_,F_,Jh],gk=new Map([["core",TI],["failsafe",[nc,rc,Qh]],["json",OI],["yaml11",mk],["yaml-1.1",mk]]),yk={binary:Xb,bool:Qb,float:T_,floatExp:A_,floatNaN:C_,floatTime:F_,int:O_,intHex:R_,intOct:D_,intTime:U_,map:nc,merge:ha,null:Wh,omap:Jb,pairs:Zb,seq:rc,set:tx,timestamp:Jh},UI={"tag:yaml.org,2002:binary":Xb,"tag:yaml.org,2002:merge":ha,"tag:yaml.org,2002:omap":Jb,"tag:yaml.org,2002:pairs":Zb,"tag:yaml.org,2002:set":tx,"tag:yaml.org,2002:timestamp":Jh};function Og(e,t,n){const r=gk.get(t);if(r&&!e)return n&&!r.includes(ha)?r.concat(ha):r.slice();let a=r;if(!a)if(Array.isArray(e))a=[];else{const o=Array.from(gk.keys()).filter(l=>l!=="yaml11").map(l=>JSON.stringify(l)).join(", ");throw new Error(`Unknown schema "${t}"; use one of ${o} or define customTags array`)}if(Array.isArray(e))for(const o of e)a=a.concat(o);else typeof e=="function"&&(a=e(a.slice()));return n&&(a=a.concat(ha)),a.reduce((o,l)=>{const d=typeof l=="string"?yk[l]:l;if(!d){const f=JSON.stringify(l),h=Object.keys(yk).map(g=>JSON.stringify(g)).join(", ");throw new Error(`Unknown custom tag ${f}; use one of ${h}`)}return o.includes(d)||o.push(d),o},[])}const FI=(e,t)=>e.key<t.key?-1:e.key>t.key?1:0;let q_=class H_{constructor({compat:t,customTags:n,merge:r,resolveKnownTags:a,schema:o,sortMapEntries:l,toStringDefaults:d}){this.compat=Array.isArray(t)?Og(t,"compat"):t?Og(null,t):null,this.name=typeof o=="string"&&o||"core",this.knownTags=a?UI:{},this.tags=Og(n,this.name,r),this.toStringOptions=d??null,Object.defineProperty(this,xs,{value:nc}),Object.defineProperty(this,Oi,{value:Qh}),Object.defineProperty(this,Jl,{value:rc}),this.sortMapEntries=typeof l=="function"?l:l===!0?FI:null}clone(){const t=Object.create(H_.prototype,Object.getOwnPropertyDescriptors(this));return t.tags=this.tags.slice(),t}};function qI(e,t){var f;const n=[];let r=t.directives===!0;if(t.directives!==!1&&e.directives){const h=e.directives.toString(e);h?(n.push(h),r=!0):e.directives.docStart&&(r=!0)}r&&n.push("---");const a=E_(e,t),{commentString:o}=a.options;if(e.commentBefore){n.length!==1&&n.unshift("");const h=o(e.commentBefore);n.unshift(da(h,""))}let l=!1,d=null;if(e.contents){if(cn(e.contents)){if(e.contents.spaceBefore&&r&&n.push(""),e.contents.commentBefore){const m=o(e.contents.commentBefore);n.push(da(m,""))}a.forceBlockIndent=!!e.comment,d=e.contents.comment}const h=d?void 0:()=>l=!0;let g=Bl(e.contents,a,()=>d=null,h);d&&(g+=Ws(g,"",o(d))),(g[0]==="|"||g[0]===">")&&n[n.length-1]==="---"?n[n.length-1]=`--- ${g}`:n.push(g)}else n.push(Bl(e.contents,a));if((f=e.directives)!=null&&f.docEnd)if(e.comment){const h=o(e.comment);h.includes(`
|
|
517
|
-
`)?(n.push("..."),n.push(da(h,""))):n.push(`... ${h}`)}else n.push("...");else{let h=e.comment;h&&l&&(h=h.replace(/^\n+/,"")),h&&((!l||d)&&n[n.length-1]!==""&&n.push(""),n.push(da(o(h),"")))}return n.join(`
|
|
518
|
-
`)+`
|
|
519
|
-
`}class ic{constructor(t,n,r){this.commentBefore=null,this.comment=null,this.errors=[],this.warnings=[],Object.defineProperty(this,Vr,{value:Fy});let a=null;typeof n=="function"||Array.isArray(n)?a=n:r===void 0&&n&&(r=n,n=void 0);const o=Object.assign({intAsBigInt:!1,keepSourceTokens:!1,logLevel:"warn",prettyErrors:!0,strict:!0,stringKeys:!1,uniqueKeys:!0,version:"1.2"},r);this.options=o;let{version:l}=o;r!=null&&r._directives?(this.directives=r._directives.atDocument(),this.directives.yaml.explicit&&(l=this.directives.yaml.version)):this.directives=new tr({version:l}),this.setSchema(l,r),this.contents=t===void 0?null:this.createNode(t,a,r)}clone(){const t=Object.create(ic.prototype,{[Vr]:{value:Fy}});return t.commentBefore=this.commentBefore,t.comment=this.comment,t.errors=this.errors.slice(),t.warnings=this.warnings.slice(),t.options=Object.assign({},this.options),this.directives&&(t.directives=this.directives.clone()),t.schema=this.schema.clone(),t.contents=cn(this.contents)?this.contents.clone(t.schema):this.contents,this.range&&(t.range=this.range.slice()),t}add(t){sl(this.contents)&&this.contents.add(t)}addIn(t,n){sl(this.contents)&&this.contents.addIn(t,n)}createAlias(t,n){if(!t.anchor){const r=b_(this);t.anchor=!n||r.has(n)?x_(n||"a",r):n}return new Kh(t.anchor)}createNode(t,n,r){let a;if(typeof n=="function")t=n.call({"":t},"",t),a=n;else if(Array.isArray(n)){const N=C=>typeof C=="number"||C instanceof String||C instanceof Number,E=n.filter(N).map(String);E.length>0&&(n=n.concat(E)),a=n}else r===void 0&&n&&(r=n,n=void 0);const{aliasDuplicateObjects:o,anchorPrefix:l,flow:d,keepUndefined:f,onTagObj:h,tag:g}=r??{},{onAnchor:m,setAnchors:y,sourceObjects:b}=yI(this,l||"a"),k={aliasDuplicateObjects:o??!0,keepUndefined:f??!1,onAnchor:m,onTagObj:h,replacer:a,schema:this.schema,sourceObjects:b},v=Su(t,g,k);return d&&ln(v)&&(v.flow=!0),y(),v}createPair(t,n,r={}){const a=this.createNode(t,null,r),o=this.createNode(n,null,r);return new Vn(a,o)}delete(t){return sl(this.contents)?this.contents.delete(t):!1}deleteIn(t){return cu(t)?this.contents==null?!1:(this.contents=null,!0):sl(this.contents)?this.contents.deleteIn(t):!1}get(t,n){return ln(this.contents)?this.contents.get(t,n):void 0}getIn(t,n){return cu(t)?!n&&Kt(this.contents)?this.contents.value:this.contents:ln(this.contents)?this.contents.getIn(t,n):void 0}has(t){return ln(this.contents)?this.contents.has(t):!1}hasIn(t){return cu(t)?this.contents!==void 0:ln(this.contents)?this.contents.hasIn(t):!1}set(t,n){this.contents==null?this.contents=mh(this.schema,[t],n):sl(this.contents)&&this.contents.set(t,n)}setIn(t,n){cu(t)?this.contents=n:this.contents==null?this.contents=mh(this.schema,Array.from(t),n):sl(this.contents)&&this.contents.setIn(t,n)}setSchema(t,n={}){typeof t=="number"&&(t=String(t));let r;switch(t){case"1.1":this.directives?this.directives.yaml.version="1.1":this.directives=new tr({version:"1.1"}),r={resolveKnownTags:!1,schema:"yaml-1.1"};break;case"1.2":case"next":this.directives?this.directives.yaml.version=t:this.directives=new tr({version:t}),r={resolveKnownTags:!0,schema:"core"};break;case null:this.directives&&delete this.directives,r=null;break;default:{const a=JSON.stringify(t);throw new Error(`Expected '1.1', '1.2' or null as first argument, but found: ${a}`)}}if(n.schema instanceof Object)this.schema=n.schema;else if(r)this.schema=new q_(Object.assign(r,n));else throw new Error("With a null YAML version, the { schema: Schema } option is required")}toJS({json:t,jsonArg:n,mapAsMap:r,maxAliasCount:a,onAnchor:o,reviver:l}={}){const d={anchors:new Map,doc:this,keep:!t,mapAsMap:r===!0,mapKeyWarned:!1,maxAliasCount:typeof a=="number"?a:100},f=Kr(this.contents,n??"",d);if(typeof o=="function")for(const{count:h,res:g}of d.anchors.values())o(g,h);return typeof l=="function"?yl(l,{"":f},"",f):f}toJSON(t,n){return this.toJS({json:!0,jsonArg:t,mapAsMap:!1,onAnchor:n})}toString(t={}){if(this.errors.length>0)throw new Error("Document with errors cannot be stringified");if("indent"in t&&(!Number.isInteger(t.indent)||Number(t.indent)<=0)){const n=JSON.stringify(t.indent);throw new Error(`"indent" option must be a positive integer, not ${n}`)}return qI(this,t)}}function sl(e){if(ln(e))return!0;throw new Error("Expected a YAML collection as document contents")}class rx extends Error{constructor(t,n,r,a){super(),this.name=t,this.code=r,this.message=a,this.pos=n}}class Zs extends rx{constructor(t,n,r){super("YAMLParseError",t,n,r)}}class K_ extends rx{constructor(t,n,r){super("YAMLWarning",t,n,r)}}const yh=(e,t)=>n=>{if(n.pos[0]===-1)return;n.linePos=n.pos.map(d=>t.linePos(d));const{line:r,col:a}=n.linePos[0];n.message+=` at line ${r}, column ${a}`;let o=a-1,l=e.substring(t.lineStarts[r-1],t.lineStarts[r]).replace(/[\n\r]+$/,"");if(o>=60&&l.length>80){const d=Math.min(o-39,l.length-79);l="…"+l.substring(d),o-=d-1}if(l.length>80&&(l=l.substring(0,79)+"…"),r>1&&/^ *$/.test(l.substring(0,o))){let d=e.substring(t.lineStarts[r-2],t.lineStarts[r-1]);d.length>80&&(d=d.substring(0,79)+`…
|
|
520
|
-
`),l=d+l}if(/[^ ]/.test(l)){let d=1;const f=n.linePos[1];(f==null?void 0:f.line)===r&&f.col>a&&(d=Math.max(1,Math.min(f.col-a,80-o)));const h=" ".repeat(o)+"^".repeat(d);n.message+=`:
|
|
521
|
-
|
|
522
|
-
${l}
|
|
523
|
-
${h}
|
|
524
|
-
`}};function $l(e,{flow:t,indicator:n,next:r,offset:a,onError:o,parentIndent:l,startOnNewline:d}){let f=!1,h=d,g=d,m="",y="",b=!1,k=!1,v=null,N=null,E=null,C=null,S=null,_=null,M=null;for(const R of e)switch(k&&(R.type!=="space"&&R.type!=="newline"&&R.type!=="comma"&&o(R.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),k=!1),v&&(h&&R.type!=="comment"&&R.type!=="newline"&&o(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),v=null),R.type){case"space":!t&&(n!=="doc-start"||(r==null?void 0:r.type)!=="flow-collection")&&R.source.includes(" ")&&(v=R),g=!0;break;case"comment":{g||o(R,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const $=R.source.substring(1)||" ";m?m+=y+$:m=$,y="",h=!1;break}case"newline":h?m?m+=R.source:(!_||n!=="seq-item-ind")&&(f=!0):y+=R.source,h=!0,b=!0,(N||E)&&(C=R),g=!0;break;case"anchor":N&&o(R,"MULTIPLE_ANCHORS","A node can have at most one anchor"),R.source.endsWith(":")&&o(R.offset+R.source.length-1,"BAD_ALIAS","Anchor ending in : is ambiguous",!0),N=R,M??(M=R.offset),h=!1,g=!1,k=!0;break;case"tag":{E&&o(R,"MULTIPLE_TAGS","A node can have at most one tag"),E=R,M??(M=R.offset),h=!1,g=!1,k=!0;break}case n:(N||E)&&o(R,"BAD_PROP_ORDER",`Anchors and tags must be after the ${R.source} indicator`),_&&o(R,"UNEXPECTED_TOKEN",`Unexpected ${R.source} in ${t??"collection"}`),_=R,h=n==="seq-item-ind"||n==="explicit-key-ind",g=!1;break;case"comma":if(t){S&&o(R,"UNEXPECTED_TOKEN",`Unexpected , in ${t}`),S=R,h=!1,g=!1;break}default:o(R,"UNEXPECTED_TOKEN",`Unexpected ${R.type} token`),h=!1,g=!1}const T=e[e.length-1],L=T?T.offset+T.source.length:a;return k&&r&&r.type!=="space"&&r.type!=="newline"&&r.type!=="comma"&&(r.type!=="scalar"||r.source!=="")&&o(r.offset,"MISSING_CHAR","Tags and anchors must be separated from the next token by white space"),v&&(h&&v.indent<=l||(r==null?void 0:r.type)==="block-map"||(r==null?void 0:r.type)==="block-seq")&&o(v,"TAB_AS_INDENT","Tabs are not allowed as indentation"),{comma:S,found:_,spaceBefore:f,comment:m,hasNewline:b,anchor:N,tag:E,newlineAfterProp:C,end:L,start:M??L}}function Nu(e){if(!e)return null;switch(e.type){case"alias":case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":if(e.source.includes(`
|
|
525
|
-
`))return!0;if(e.end){for(const t of e.end)if(t.type==="newline")return!0}return!1;case"flow-collection":for(const t of e.items){for(const n of t.start)if(n.type==="newline")return!0;if(t.sep){for(const n of t.sep)if(n.type==="newline")return!0}if(Nu(t.key)||Nu(t.value))return!0}return!1;default:return!0}}function Gy(e,t,n){if((t==null?void 0:t.type)==="flow-collection"){const r=t.end[0];r.indent===e&&(r.source==="]"||r.source==="}")&&Nu(t)&&n(r,"BAD_INDENT","Flow end indicator should be more indented than parent",!0)}}function G_(e,t,n){const{uniqueKeys:r}=e.options;if(r===!1)return!1;const a=typeof r=="function"?r:(o,l)=>o===l||Kt(o)&&Kt(l)&&o.value===l.value;return t.some(o=>a(o.key,n))}const bk="All mapping items must start at the same column";function HI({composeNode:e,composeEmptyNode:t},n,r,a,o){var g;const l=(o==null?void 0:o.nodeClass)??Nr,d=new l(n.schema);n.atRoot&&(n.atRoot=!1);let f=r.offset,h=null;for(const m of r.items){const{start:y,key:b,sep:k,value:v}=m,N=$l(y,{indicator:"explicit-key-ind",next:b??(k==null?void 0:k[0]),offset:f,onError:a,parentIndent:r.indent,startOnNewline:!0}),E=!N.found;if(E){if(b&&(b.type==="block-seq"?a(f,"BLOCK_AS_IMPLICIT_KEY","A block sequence may not be used as an implicit map key"):"indent"in b&&b.indent!==r.indent&&a(f,"BAD_INDENT",bk)),!N.anchor&&!N.tag&&!k){h=N.end,N.comment&&(d.comment?d.comment+=`
|
|
526
|
-
`+N.comment:d.comment=N.comment);continue}(N.newlineAfterProp||Nu(b))&&a(b??y[y.length-1],"MULTILINE_IMPLICIT_KEY","Implicit keys need to be on a single line")}else((g=N.found)==null?void 0:g.indent)!==r.indent&&a(f,"BAD_INDENT",bk);n.atKey=!0;const C=N.end,S=b?e(n,b,N,a):t(n,C,y,null,N,a);n.schema.compat&&Gy(r.indent,b,a),n.atKey=!1,G_(n,d.items,S)&&a(C,"DUPLICATE_KEY","Map keys must be unique");const _=$l(k??[],{indicator:"map-value-ind",next:v,offset:S.range[2],onError:a,parentIndent:r.indent,startOnNewline:!b||b.type==="block-scalar"});if(f=_.end,_.found){E&&((v==null?void 0:v.type)==="block-map"&&!_.hasNewline&&a(f,"BLOCK_AS_IMPLICIT_KEY","Nested mappings are not allowed in compact mappings"),n.options.strict&&N.start<_.found.offset-1024&&a(S.range,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit block mapping key"));const M=v?e(n,v,_,a):t(n,f,k,null,_,a);n.schema.compat&&Gy(r.indent,v,a),f=M.range[2];const T=new Vn(S,M);n.options.keepSourceTokens&&(T.srcToken=m),d.items.push(T)}else{E&&a(S.range,"MISSING_CHAR","Implicit map keys need to be followed by map values"),_.comment&&(S.comment?S.comment+=`
|
|
527
|
-
`+_.comment:S.comment=_.comment);const M=new Vn(S);n.options.keepSourceTokens&&(M.srcToken=m),d.items.push(M)}}return h&&h<f&&a(h,"IMPOSSIBLE","Map comment with trailing content"),d.range=[r.offset,f,h??f],d}function KI({composeNode:e,composeEmptyNode:t},n,r,a,o){const l=(o==null?void 0:o.nodeClass)??ws,d=new l(n.schema);n.atRoot&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let f=r.offset,h=null;for(const{start:g,value:m}of r.items){const y=$l(g,{indicator:"seq-item-ind",next:m,offset:f,onError:a,parentIndent:r.indent,startOnNewline:!0});if(!y.found)if(y.anchor||y.tag||m)(m==null?void 0:m.type)==="block-seq"?a(y.end,"BAD_INDENT","All sequence items must start at the same column"):a(f,"MISSING_CHAR","Sequence item without - indicator");else{h=y.end,y.comment&&(d.comment=y.comment);continue}const b=m?e(n,m,y,a):t(n,y.end,g,null,y,a);n.schema.compat&&Gy(r.indent,m,a),f=b.range[2],d.items.push(b)}return d.range=[r.offset,f,h??f],d}function Xu(e,t,n,r){let a="";if(e){let o=!1,l="";for(const d of e){const{source:f,type:h}=d;switch(h){case"space":o=!0;break;case"comment":{n&&!o&&r(d,"MISSING_CHAR","Comments must be separated from other tokens by white space characters");const g=f.substring(1)||" ";a?a+=l+g:a=g,l="";break}case"newline":a&&(l+=f),o=!0;break;default:r(d,"UNEXPECTED_TOKEN",`Unexpected ${h} at node end`)}t+=f.length}}return{comment:a,offset:t}}const Rg="Block collections are not allowed within flow collections",Lg=e=>e&&(e.type==="block-map"||e.type==="block-seq");function GI({composeNode:e,composeEmptyNode:t},n,r,a,o){var N;const l=r.start.source==="{",d=l?"flow map":"flow sequence",f=(o==null?void 0:o.nodeClass)??(l?Nr:ws),h=new f(n.schema);h.flow=!0;const g=n.atRoot;g&&(n.atRoot=!1),n.atKey&&(n.atKey=!1);let m=r.offset+r.start.source.length;for(let E=0;E<r.items.length;++E){const C=r.items[E],{start:S,key:_,sep:M,value:T}=C,L=$l(S,{flow:d,indicator:"explicit-key-ind",next:_??(M==null?void 0:M[0]),offset:m,onError:a,parentIndent:r.indent,startOnNewline:!1});if(!L.found){if(!L.anchor&&!L.tag&&!M&&!T){E===0&&L.comma?a(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`):E<r.items.length-1&&a(L.start,"UNEXPECTED_TOKEN",`Unexpected empty item in ${d}`),L.comment&&(h.comment?h.comment+=`
|
|
528
|
-
`+L.comment:h.comment=L.comment),m=L.end;continue}!l&&n.options.strict&&Nu(_)&&a(_,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line")}if(E===0)L.comma&&a(L.comma,"UNEXPECTED_TOKEN",`Unexpected , in ${d}`);else if(L.comma||a(L.start,"MISSING_CHAR",`Missing , between ${d} items`),L.comment){let R="";e:for(const $ of S)switch($.type){case"comma":case"space":break;case"comment":R=$.source.substring(1);break e;default:break e}if(R){let $=h.items[h.items.length-1];en($)&&($=$.value??$.key),$.comment?$.comment+=`
|
|
529
|
-
`+R:$.comment=R,L.comment=L.comment.substring(R.length+1)}}if(!l&&!M&&!L.found){const R=T?e(n,T,L,a):t(n,L.end,M,null,L,a);h.items.push(R),m=R.range[2],Lg(T)&&a(R.range,"BLOCK_IN_FLOW",Rg)}else{n.atKey=!0;const R=L.end,$=_?e(n,_,L,a):t(n,R,S,null,L,a);Lg(_)&&a($.range,"BLOCK_IN_FLOW",Rg),n.atKey=!1;const z=$l(M??[],{flow:d,indicator:"map-value-ind",next:T,offset:$.range[2],onError:a,parentIndent:r.indent,startOnNewline:!1});if(z.found){if(!l&&!L.found&&n.options.strict){if(M)for(const Y of M){if(Y===z.found)break;if(Y.type==="newline"){a(Y,"MULTILINE_IMPLICIT_KEY","Implicit keys of flow sequence pairs need to be on a single line");break}}L.start<z.found.offset-1024&&a(z.found,"KEY_OVER_1024_CHARS","The : indicator must be at most 1024 chars after the start of an implicit flow sequence key")}}else T&&("source"in T&&((N=T.source)==null?void 0:N[0])===":"?a(T,"MISSING_CHAR",`Missing space after : in ${d}`):a(z.start,"MISSING_CHAR",`Missing , or : between ${d} items`));const q=T?e(n,T,z,a):z.found?t(n,z.end,M,null,z,a):null;q?Lg(T)&&a(q.range,"BLOCK_IN_FLOW",Rg):z.comment&&($.comment?$.comment+=`
|
|
530
|
-
`+z.comment:$.comment=z.comment);const F=new Vn($,q);if(n.options.keepSourceTokens&&(F.srcToken=C),l){const Y=h;G_(n,Y.items,$)&&a(R,"DUPLICATE_KEY","Map keys must be unique"),Y.items.push(F)}else{const Y=new Nr(n.schema);Y.flow=!0,Y.items.push(F);const D=(q??$).range;Y.range=[$.range[0],D[1],D[2]],h.items.push(Y)}m=q?q.range[2]:z.end}}const y=l?"}":"]",[b,...k]=r.end;let v=m;if((b==null?void 0:b.source)===y)v=b.offset+b.source.length;else{const E=d[0].toUpperCase()+d.substring(1),C=g?`${E} must end with a ${y}`:`${E} in block collection must be sufficiently indented and end with a ${y}`;a(m,g?"MISSING_CHAR":"BAD_INDENT",C),b&&b.source.length!==1&&k.unshift(b)}if(k.length>0){const E=Xu(k,v,n.options.strict,a);E.comment&&(h.comment?h.comment+=`
|
|
531
|
-
`+E.comment:h.comment=E.comment),h.range=[r.offset,v,E.offset]}else h.range=[r.offset,v,v];return h}function Ig(e,t,n,r,a,o){const l=n.type==="block-map"?HI(e,t,n,r,o):n.type==="block-seq"?KI(e,t,n,r,o):GI(e,t,n,r,o),d=l.constructor;return a==="!"||a===d.tagName?(l.tag=d.tagName,l):(a&&(l.tag=a),l)}function VI(e,t,n,r,a){var y;const o=r.tag,l=o?t.directives.tagName(o.source,b=>a(o,"TAG_RESOLVE_FAILED",b)):null;if(n.type==="block-seq"){const{anchor:b,newlineAfterProp:k}=r,v=b&&o?b.offset>o.offset?b:o:b??o;v&&(!k||k.offset<v.offset)&&a(v,"MISSING_CHAR","Missing newline after block sequence props")}const d=n.type==="block-map"?"map":n.type==="block-seq"?"seq":n.start.source==="{"?"map":"seq";if(!o||!l||l==="!"||l===Nr.tagName&&d==="map"||l===ws.tagName&&d==="seq")return Ig(e,t,n,a,l);let f=t.schema.tags.find(b=>b.tag===l&&b.collection===d);if(!f){const b=t.schema.knownTags[l];if((b==null?void 0:b.collection)===d)t.schema.tags.push(Object.assign({},b,{default:!1})),f=b;else return b?a(o,"BAD_COLLECTION_TYPE",`${b.tag} used for ${d} collection, but expects ${b.collection??"scalar"}`,!0):a(o,"TAG_RESOLVE_FAILED",`Unresolved tag: ${l}`,!0),Ig(e,t,n,a,l)}const h=Ig(e,t,n,a,l,f),g=((y=f.resolve)==null?void 0:y.call(f,h,b=>a(o,"TAG_RESOLVE_FAILED",b),t.options))??h,m=cn(g)?g:new st(g);return m.range=h.range,m.tag=l,f!=null&&f.format&&(m.format=f.format),m}function V_(e,t,n){const r=t.offset,a=YI(t,e.options.strict,n);if(!a)return{value:"",type:null,comment:"",range:[r,r,r]};const o=a.mode===">"?st.BLOCK_FOLDED:st.BLOCK_LITERAL,l=t.source?QI(t.source):[];let d=l.length;for(let v=l.length-1;v>=0;--v){const N=l[v][1];if(N===""||N==="\r")d=v;else break}if(d===0){const v=a.chomp==="+"&&l.length>0?`
|
|
532
|
-
`.repeat(Math.max(1,l.length-1)):"";let N=r+a.length;return t.source&&(N+=t.source.length),{value:v,type:o,comment:a.comment,range:[r,N,N]}}let f=t.indent+a.indent,h=t.offset+a.length,g=0;for(let v=0;v<d;++v){const[N,E]=l[v];if(E===""||E==="\r")a.indent===0&&N.length>f&&(f=N.length);else{N.length<f&&n(h+N.length,"MISSING_CHAR","Block scalars with more-indented leading empty lines must use an explicit indentation indicator"),a.indent===0&&(f=N.length),g=v,f===0&&!e.atRoot&&n(h,"BAD_INDENT","Block scalar values in collections must be indented");break}h+=N.length+E.length+1}for(let v=l.length-1;v>=d;--v)l[v][0].length>f&&(d=v+1);let m="",y="",b=!1;for(let v=0;v<g;++v)m+=l[v][0].slice(f)+`
|
|
533
|
-
`;for(let v=g;v<d;++v){let[N,E]=l[v];h+=N.length+E.length+1;const C=E[E.length-1]==="\r";if(C&&(E=E.slice(0,-1)),E&&N.length<f){const _=`Block scalar lines must not be less indented than their ${a.indent?"explicit indentation indicator":"first line"}`;n(h-E.length-(C?2:1),"BAD_INDENT",_),N=""}o===st.BLOCK_LITERAL?(m+=y+N.slice(f)+E,y=`
|
|
534
|
-
`):N.length>f||E[0]===" "?(y===" "?y=`
|
|
535
|
-
`:!b&&y===`
|
|
536
|
-
`&&(y=`
|
|
537
|
-
|
|
538
|
-
`),m+=y+N.slice(f)+E,y=`
|
|
539
|
-
`,b=!0):E===""?y===`
|
|
540
|
-
`?m+=`
|
|
541
|
-
`:y=`
|
|
542
|
-
`:(m+=y+E,y=" ",b=!1)}switch(a.chomp){case"-":break;case"+":for(let v=d;v<l.length;++v)m+=`
|
|
543
|
-
`+l[v][0].slice(f);m[m.length-1]!==`
|
|
544
|
-
`&&(m+=`
|
|
545
|
-
`);break;default:m+=`
|
|
546
|
-
`}const k=r+a.length+t.source.length;return{value:m,type:o,comment:a.comment,range:[r,k,k]}}function YI({offset:e,props:t},n,r){if(t[0].type!=="block-scalar-header")return r(t[0],"IMPOSSIBLE","Block scalar header not found"),null;const{source:a}=t[0],o=a[0];let l=0,d="",f=-1;for(let y=1;y<a.length;++y){const b=a[y];if(!d&&(b==="-"||b==="+"))d=b;else{const k=Number(b);!l&&k?l=k:f===-1&&(f=e+y)}}f!==-1&&r(f,"UNEXPECTED_TOKEN",`Block scalar header includes extra characters: ${a}`);let h=!1,g="",m=a.length;for(let y=1;y<t.length;++y){const b=t[y];switch(b.type){case"space":h=!0;case"newline":m+=b.source.length;break;case"comment":n&&!h&&r(b,"MISSING_CHAR","Comments must be separated from other tokens by white space characters"),m+=b.source.length,g=b.source.substring(1);break;case"error":r(b,"UNEXPECTED_TOKEN",b.message),m+=b.source.length;break;default:{const k=`Unexpected token in block scalar header: ${b.type}`;r(b,"UNEXPECTED_TOKEN",k);const v=b.source;v&&typeof v=="string"&&(m+=v.length)}}}return{mode:o,indent:l,chomp:d,comment:g,length:m}}function QI(e){const t=e.split(/\n( *)/),n=t[0],r=n.match(/^( *)/),o=[r!=null&&r[1]?[r[1],n.slice(r[1].length)]:["",n]];for(let l=1;l<t.length;l+=2)o.push([t[l],t[l+1]]);return o}function Y_(e,t,n){const{offset:r,type:a,source:o,end:l}=e;let d,f;const h=(y,b,k)=>n(r+y,b,k);switch(a){case"scalar":d=st.PLAIN,f=WI(o,h);break;case"single-quoted-scalar":d=st.QUOTE_SINGLE,f=XI(o,h);break;case"double-quoted-scalar":d=st.QUOTE_DOUBLE,f=ZI(o,h);break;default:return n(e,"UNEXPECTED_TOKEN",`Expected a flow scalar value, but found: ${a}`),{value:"",type:null,comment:"",range:[r,r+o.length,r+o.length]}}const g=r+o.length,m=Xu(l,g,t,n);return{value:f,type:d,comment:m.comment,range:[r,g,m.offset]}}function WI(e,t){let n="";switch(e[0]){case" ":n="a tab character";break;case",":n="flow indicator character ,";break;case"%":n="directive indicator character %";break;case"|":case">":{n=`block scalar indicator ${e[0]}`;break}case"@":case"`":{n=`reserved character ${e[0]}`;break}}return n&&t(0,"BAD_SCALAR_START",`Plain value cannot start with ${n}`),Q_(e)}function XI(e,t){return(e[e.length-1]!=="'"||e.length===1)&&t(e.length,"MISSING_CHAR","Missing closing 'quote"),Q_(e.slice(1,-1)).replace(/''/g,"'")}function Q_(e){let t,n;try{t=new RegExp(`(.*?)(?<![ ])[ ]*\r?
|
|
547
|
-
`,"sy"),n=new RegExp(`[ ]*(.*?)(?:(?<![ ])[ ]*)?\r?
|
|
548
|
-
`,"sy")}catch{t=/(.*?)[ \t]*\r?\n/sy,n=/[ \t]*(.*?)[ \t]*\r?\n/sy}let r=t.exec(e);if(!r)return e;let a=r[1],o=" ",l=t.lastIndex;for(n.lastIndex=l;r=n.exec(e);)r[1]===""?o===`
|
|
549
|
-
`?a+=o:o=`
|
|
550
|
-
`:(a+=o+r[1],o=" "),l=n.lastIndex;const d=/[ \t]*(.*)/sy;return d.lastIndex=l,r=d.exec(e),a+o+((r==null?void 0:r[1])??"")}function ZI(e,t){let n="";for(let r=1;r<e.length-1;++r){const a=e[r];if(!(a==="\r"&&e[r+1]===`
|
|
551
|
-
`))if(a===`
|
|
552
|
-
`){const{fold:o,offset:l}=JI(e,r);n+=o,r=l}else if(a==="\\"){let o=e[++r];const l=ez[o];if(l)n+=l;else if(o===`
|
|
553
|
-
`)for(o=e[r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="\r"&&e[r+1]===`
|
|
554
|
-
`)for(o=e[++r+1];o===" "||o===" ";)o=e[++r+1];else if(o==="x"||o==="u"||o==="U"){const d={x:2,u:4,U:8}[o];n+=tz(e,r+1,d,t),r+=d}else{const d=e.substr(r-1,2);t(r-1,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),n+=d}}else if(a===" "||a===" "){const o=r;let l=e[r+1];for(;l===" "||l===" ";)l=e[++r+1];l!==`
|
|
555
|
-
`&&!(l==="\r"&&e[r+2]===`
|
|
556
|
-
`)&&(n+=r>o?e.slice(o,r+1):a)}else n+=a}return(e[e.length-1]!=='"'||e.length===1)&&t(e.length,"MISSING_CHAR",'Missing closing "quote'),n}function JI(e,t){let n="",r=e[t+1];for(;(r===" "||r===" "||r===`
|
|
557
|
-
`||r==="\r")&&!(r==="\r"&&e[t+2]!==`
|
|
558
|
-
`);)r===`
|
|
559
|
-
`&&(n+=`
|
|
560
|
-
`),t+=1,r=e[t+1];return n||(n=" "),{fold:n,offset:t}}const ez={0:"\0",a:"\x07",b:"\b",e:"\x1B",f:"\f",n:`
|
|
561
|
-
`,r:"\r",t:" ",v:"\v",N:"
",_:" ",L:"\u2028",P:"\u2029"," ":" ",'"':'"',"/":"/","\\":"\\"," ":" "};function tz(e,t,n,r){const a=e.substr(t,n),l=a.length===n&&/^[0-9a-fA-F]+$/.test(a)?parseInt(a,16):NaN;if(isNaN(l)){const d=e.substr(t-2,n+2);return r(t-2,"BAD_DQ_ESCAPE",`Invalid escape sequence ${d}`),d}return String.fromCodePoint(l)}function W_(e,t,n,r){const{value:a,type:o,comment:l,range:d}=t.type==="block-scalar"?V_(e,t,r):Y_(t,e.options.strict,r),f=n?e.directives.tagName(n.source,m=>r(n,"TAG_RESOLVE_FAILED",m)):null;let h;e.options.stringKeys&&e.atKey?h=e.schema[Oi]:f?h=nz(e.schema,a,f,n,r):t.type==="scalar"?h=rz(e,a,t,r):h=e.schema[Oi];let g;try{const m=h.resolve(a,y=>r(n??t,"TAG_RESOLVE_FAILED",y),e.options);g=Kt(m)?m:new st(m)}catch(m){const y=m instanceof Error?m.message:String(m);r(n??t,"TAG_RESOLVE_FAILED",y),g=new st(a)}return g.range=d,g.source=a,o&&(g.type=o),f&&(g.tag=f),h.format&&(g.format=h.format),l&&(g.comment=l),g}function nz(e,t,n,r,a){var d;if(n==="!")return e[Oi];const o=[];for(const f of e.tags)if(!f.collection&&f.tag===n)if(f.default&&f.test)o.push(f);else return f;for(const f of o)if((d=f.test)!=null&&d.test(t))return f;const l=e.knownTags[n];return l&&!l.collection?(e.tags.push(Object.assign({},l,{default:!1,test:void 0})),l):(a(r,"TAG_RESOLVE_FAILED",`Unresolved tag: ${n}`,n!=="tag:yaml.org,2002:str"),e[Oi])}function rz({atKey:e,directives:t,schema:n},r,a,o){const l=n.tags.find(d=>{var f;return(d.default===!0||e&&d.default==="key")&&((f=d.test)==null?void 0:f.test(r))})||n[Oi];if(n.compat){const d=n.compat.find(f=>{var h;return f.default&&((h=f.test)==null?void 0:h.test(r))})??n[Oi];if(l.tag!==d.tag){const f=t.tagString(l.tag),h=t.tagString(d.tag),g=`Value may be parsed as either ${f} or ${h}`;o(a,"TAG_RESOLVE_FAILED",g,!0)}}return l}function iz(e,t,n){if(t){n??(n=t.length);for(let r=n-1;r>=0;--r){let a=t[r];switch(a.type){case"space":case"comment":case"newline":e-=a.source.length;continue}for(a=t[++r];(a==null?void 0:a.type)==="space";)e+=a.source.length,a=t[++r];break}}return e}const az={composeNode:X_,composeEmptyNode:ix};function X_(e,t,n,r){const a=e.atKey,{spaceBefore:o,comment:l,anchor:d,tag:f}=n;let h,g=!0;switch(t.type){case"alias":h=sz(e,t,r),(d||f)&&r(t,"ALIAS_PROPS","An alias node must not specify any properties");break;case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"block-scalar":h=W_(e,t,f,r),d&&(h.anchor=d.source.substring(1));break;case"block-map":case"block-seq":case"flow-collection":try{h=VI(az,e,t,n,r),d&&(h.anchor=d.source.substring(1))}catch(m){const y=m instanceof Error?m.message:String(m);r(t,"RESOURCE_EXHAUSTION",y)}break;default:{const m=t.type==="error"?t.message:`Unsupported token (type: ${t.type})`;r(t,"UNEXPECTED_TOKEN",m),g=!1}}return h??(h=ix(e,t.offset,void 0,null,n,r)),d&&h.anchor===""&&r(d,"BAD_ALIAS","Anchor cannot be an empty string"),a&&e.options.stringKeys&&(!Kt(h)||typeof h.value!="string"||h.tag&&h.tag!=="tag:yaml.org,2002:str")&&r(f??t,"NON_STRING_KEY","With stringKeys, all keys must be strings"),o&&(h.spaceBefore=!0),l&&(t.type==="scalar"&&t.source===""?h.comment=l:h.commentBefore=l),e.options.keepSourceTokens&&g&&(h.srcToken=t),h}function ix(e,t,n,r,{spaceBefore:a,comment:o,anchor:l,tag:d,end:f},h){const g={type:"scalar",offset:iz(t,n,r),indent:-1,source:""},m=W_(e,g,d,h);return l&&(m.anchor=l.source.substring(1),m.anchor===""&&h(l,"BAD_ALIAS","Anchor cannot be an empty string")),a&&(m.spaceBefore=!0),o&&(m.comment=o,m.range[2]=f),m}function sz({options:e},{offset:t,source:n,end:r},a){const o=new Kh(n.substring(1));o.source===""&&a(t,"BAD_ALIAS","Alias cannot be an empty string"),o.source.endsWith(":")&&a(t+n.length-1,"BAD_ALIAS","Alias ending in : is ambiguous",!0);const l=t+n.length,d=Xu(r,l,e.strict,a);return o.range=[t,l,d.offset],d.comment&&(o.comment=d.comment),o}function oz(e,t,{offset:n,start:r,value:a,end:o},l){const d=Object.assign({_directives:t},e),f=new ic(void 0,d),h={atKey:!1,atRoot:!0,directives:f.directives,options:f.options,schema:f.schema},g=$l(r,{indicator:"doc-start",next:a??(o==null?void 0:o[0]),offset:n,onError:l,parentIndent:0,startOnNewline:!0});g.found&&(f.directives.docStart=!0,a&&(a.type==="block-map"||a.type==="block-seq")&&!g.hasNewline&&l(g.end,"MISSING_CHAR","Block collection cannot start on same line with directives-end marker")),f.contents=a?X_(h,a,g,l):ix(h,g.end,r,null,g,l);const m=f.contents.range[2],y=Xu(o,m,!1,l);return y.comment&&(f.comment=y.comment),f.range=[n,m,y.offset],f}function eu(e){if(typeof e=="number")return[e,e+1];if(Array.isArray(e))return e.length===2?e:[e[0],e[1]];const{offset:t,source:n}=e;return[t,t+(typeof n=="string"?n.length:1)]}function xk(e){var a;let t="",n=!1,r=!1;for(let o=0;o<e.length;++o){const l=e[o];switch(l[0]){case"#":t+=(t===""?"":r?`
|
|
562
|
-
|
|
563
|
-
`:`
|
|
564
|
-
`)+(l.substring(1)||" "),n=!0,r=!1;break;case"%":((a=e[o+1])==null?void 0:a[0])!=="#"&&(o+=1),n=!1;break;default:n||(r=!0),n=!1}}return{comment:t,afterEmptyLine:r}}class ax{constructor(t={}){this.doc=null,this.atDirectives=!1,this.prelude=[],this.errors=[],this.warnings=[],this.onError=(n,r,a,o)=>{const l=eu(n);o?this.warnings.push(new K_(l,r,a)):this.errors.push(new Zs(l,r,a))},this.directives=new tr({version:t.version||"1.2"}),this.options=t}decorate(t,n){const{comment:r,afterEmptyLine:a}=xk(this.prelude);if(r){const o=t.contents;if(n)t.comment=t.comment?`${t.comment}
|
|
565
|
-
${r}`:r;else if(a||t.directives.docStart||!o)t.commentBefore=r;else if(ln(o)&&!o.flow&&o.items.length>0){let l=o.items[0];en(l)&&(l=l.key);const d=l.commentBefore;l.commentBefore=d?`${r}
|
|
566
|
-
${d}`:r}else{const l=o.commentBefore;o.commentBefore=l?`${r}
|
|
567
|
-
${l}`:r}}n?(Array.prototype.push.apply(t.errors,this.errors),Array.prototype.push.apply(t.warnings,this.warnings)):(t.errors=this.errors,t.warnings=this.warnings),this.prelude=[],this.errors=[],this.warnings=[]}streamInfo(){return{comment:xk(this.prelude).comment,directives:this.directives,errors:this.errors,warnings:this.warnings}}*compose(t,n=!1,r=-1){for(const a of t)yield*this.next(a);yield*this.end(n,r)}*next(t){switch(t.type){case"directive":this.directives.add(t.source,(n,r,a)=>{const o=eu(t);o[0]+=n,this.onError(o,"BAD_DIRECTIVE",r,a)}),this.prelude.push(t.source),this.atDirectives=!0;break;case"document":{const n=oz(this.options,this.directives,t,this.onError);this.atDirectives&&!n.directives.docStart&&this.onError(t,"MISSING_CHAR","Missing directives-end/doc-start indicator line"),this.decorate(n,!1),this.doc&&(yield this.doc),this.doc=n,this.atDirectives=!1;break}case"byte-order-mark":case"space":break;case"comment":case"newline":this.prelude.push(t.source);break;case"error":{const n=t.source?`${t.message}: ${JSON.stringify(t.source)}`:t.message,r=new Zs(eu(t),"UNEXPECTED_TOKEN",n);this.atDirectives||!this.doc?this.errors.push(r):this.doc.errors.push(r);break}case"doc-end":{if(!this.doc){const r="Unexpected doc-end without preceding document";this.errors.push(new Zs(eu(t),"UNEXPECTED_TOKEN",r));break}this.doc.directives.docEnd=!0;const n=Xu(t.end,t.offset+t.source.length,this.doc.options.strict,this.onError);if(this.decorate(this.doc,!0),n.comment){const r=this.doc.comment;this.doc.comment=r?`${r}
|
|
568
|
-
${n.comment}`:n.comment}this.doc.range[2]=n.offset;break}default:this.errors.push(new Zs(eu(t),"UNEXPECTED_TOKEN",`Unsupported token ${t.type}`))}}*end(t=!1,n=-1){if(this.doc)this.decorate(this.doc,!0),yield this.doc,this.doc=null;else if(t){const r=Object.assign({_directives:this.directives},this.options),a=new ic(void 0,r);this.atDirectives&&this.onError(n,"MISSING_CHAR","Missing directives-end indicator line"),a.range=[0,n,n],this.decorate(a,!1),yield a}}}function lz(e,t=!0,n){if(e){const r=(a,o,l)=>{const d=typeof a=="number"?a:Array.isArray(a)?a[0]:a.offset;if(n)n(d,o,l);else throw new Zs([d,d+1],o,l)};switch(e.type){case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return Y_(e,t,r);case"block-scalar":return V_({options:{strict:t}},e,r)}}return null}function cz(e,t){const{implicitKey:n=!1,indent:r,inFlow:a=!1,offset:o=-1,type:l="PLAIN"}=t,d=Qu({type:l,value:e},{implicitKey:n,indent:r>0?" ".repeat(r):"",inFlow:a,options:{blockQuote:!0,lineWidth:-1}}),f=t.end??[{type:"newline",offset:-1,indent:r,source:`
|
|
569
|
-
`}];switch(d[0]){case"|":case">":{const h=d.indexOf(`
|
|
570
|
-
`),g=d.substring(0,h),m=d.substring(h+1)+`
|
|
571
|
-
`,y=[{type:"block-scalar-header",offset:o,indent:r,source:g}];return Z_(y,f)||y.push({type:"newline",offset:-1,indent:r,source:`
|
|
572
|
-
`}),{type:"block-scalar",offset:o,indent:r,props:y,source:m}}case'"':return{type:"double-quoted-scalar",offset:o,indent:r,source:d,end:f};case"'":return{type:"single-quoted-scalar",offset:o,indent:r,source:d,end:f};default:return{type:"scalar",offset:o,indent:r,source:d,end:f}}}function uz(e,t,n={}){let{afterKey:r=!1,implicitKey:a=!1,inFlow:o=!1,type:l}=n,d="indent"in e?e.indent:null;if(r&&typeof d=="number"&&(d+=2),!l)switch(e.type){case"single-quoted-scalar":l="QUOTE_SINGLE";break;case"double-quoted-scalar":l="QUOTE_DOUBLE";break;case"block-scalar":{const h=e.props[0];if(h.type!=="block-scalar-header")throw new Error("Invalid block scalar header");l=h.source[0]===">"?"BLOCK_FOLDED":"BLOCK_LITERAL";break}default:l="PLAIN"}const f=Qu({type:l,value:t},{implicitKey:a||d===null,indent:d!==null&&d>0?" ".repeat(d):"",inFlow:o,options:{blockQuote:!0,lineWidth:-1}});switch(f[0]){case"|":case">":dz(e,f);break;case'"':zg(e,f,"double-quoted-scalar");break;case"'":zg(e,f,"single-quoted-scalar");break;default:zg(e,f,"scalar")}}function dz(e,t){const n=t.indexOf(`
|
|
573
|
-
`),r=t.substring(0,n),a=t.substring(n+1)+`
|
|
574
|
-
`;if(e.type==="block-scalar"){const o=e.props[0];if(o.type!=="block-scalar-header")throw new Error("Invalid block scalar header");o.source=r,e.source=a}else{const{offset:o}=e,l="indent"in e?e.indent:-1,d=[{type:"block-scalar-header",offset:o,indent:l,source:r}];Z_(d,"end"in e?e.end:void 0)||d.push({type:"newline",offset:-1,indent:l,source:`
|
|
575
|
-
`});for(const f of Object.keys(e))f!=="type"&&f!=="offset"&&delete e[f];Object.assign(e,{type:"block-scalar",indent:l,props:d,source:a})}}function Z_(e,t){if(t)for(const n of t)switch(n.type){case"space":case"comment":e.push(n);break;case"newline":return e.push(n),!0}return!1}function zg(e,t,n){switch(e.type){case"scalar":case"double-quoted-scalar":case"single-quoted-scalar":e.type=n,e.source=t;break;case"block-scalar":{const r=e.props.slice(1);let a=t.length;e.props[0].type==="block-scalar-header"&&(a-=e.props[0].source.length);for(const o of r)o.offset+=a;delete e.props,Object.assign(e,{type:n,source:t,end:r});break}case"block-map":case"block-seq":{const a={type:"newline",offset:e.offset+t.length,indent:e.indent,source:`
|
|
576
|
-
`};delete e.items,Object.assign(e,{type:n,source:t,end:[a]});break}default:{const r="indent"in e?e.indent:-1,a="end"in e&&Array.isArray(e.end)?e.end.filter(o=>o.type==="space"||o.type==="comment"||o.type==="newline"):[];for(const o of Object.keys(e))o!=="type"&&o!=="offset"&&delete e[o];Object.assign(e,{type:n,indent:r,source:t,end:a})}}}const fz=e=>"type"in e?bh(e):th(e);function bh(e){switch(e.type){case"block-scalar":{let t="";for(const n of e.props)t+=bh(n);return t+e.source}case"block-map":case"block-seq":{let t="";for(const n of e.items)t+=th(n);return t}case"flow-collection":{let t=e.start.source;for(const n of e.items)t+=th(n);for(const n of e.end)t+=n.source;return t}case"document":{let t=th(e);if(e.end)for(const n of e.end)t+=n.source;return t}default:{let t=e.source;if("end"in e&&e.end)for(const n of e.end)t+=n.source;return t}}}function th({start:e,key:t,sep:n,value:r}){let a="";for(const o of e)a+=o.source;if(t&&(a+=bh(t)),n)for(const o of n)a+=o.source;return r&&(a+=bh(r)),a}const Vy=Symbol("break visit"),hz=Symbol("skip children"),J_=Symbol("remove item");function po(e,t){"type"in e&&e.type==="document"&&(e={start:e.start,value:e.value}),e2(Object.freeze([]),e,t)}po.BREAK=Vy;po.SKIP=hz;po.REMOVE=J_;po.itemAtPath=(e,t)=>{let n=e;for(const[r,a]of t){const o=n==null?void 0:n[r];if(o&&"items"in o)n=o.items[a];else return}return n};po.parentCollection=(e,t)=>{const n=po.itemAtPath(e,t.slice(0,-1)),r=t[t.length-1][0],a=n==null?void 0:n[r];if(a&&"items"in a)return a;throw new Error("Parent collection not found")};function e2(e,t,n){let r=n(t,e);if(typeof r=="symbol")return r;for(const a of["key","value"]){const o=t[a];if(o&&"items"in o){for(let l=0;l<o.items.length;++l){const d=e2(Object.freeze(e.concat([[a,l]])),o.items[l],n);if(typeof d=="number")l=d-1;else{if(d===Vy)return Vy;d===J_&&(o.items.splice(l,1),l-=1)}}typeof r=="function"&&a==="key"&&(r=r(t,e))}}return typeof r=="function"?r(t,e):r}const ep="\uFEFF",tp="",np="",_u="",pz=e=>!!e&&"items"in e,mz=e=>!!e&&(e.type==="scalar"||e.type==="single-quoted-scalar"||e.type==="double-quoted-scalar"||e.type==="block-scalar");function gz(e){switch(e){case ep:return"<BOM>";case tp:return"<DOC>";case np:return"<FLOW_END>";case _u:return"<SCALAR>";default:return JSON.stringify(e)}}function t2(e){switch(e){case ep:return"byte-order-mark";case tp:return"doc-mode";case np:return"flow-error-end";case _u:return"scalar";case"---":return"doc-start";case"...":return"doc-end";case"":case`
|
|
577
|
-
`:case`\r
|
|
578
|
-
`:return"newline";case"-":return"seq-item-ind";case"?":return"explicit-key-ind";case":":return"map-value-ind";case"{":return"flow-map-start";case"}":return"flow-map-end";case"[":return"flow-seq-start";case"]":return"flow-seq-end";case",":return"comma"}switch(e[0]){case" ":case" ":return"space";case"#":return"comment";case"%":return"directive-line";case"*":return"alias";case"&":return"anchor";case"!":return"tag";case"'":return"single-quoted-scalar";case'"':return"double-quoted-scalar";case"|":case">":return"block-scalar-header"}return null}const yz=Object.freeze(Object.defineProperty({__proto__:null,BOM:ep,DOCUMENT:tp,FLOW_END:np,SCALAR:_u,createScalarToken:cz,isCollection:pz,isScalar:mz,prettyToken:gz,resolveAsScalar:lz,setScalarValue:uz,stringify:fz,tokenType:t2,visit:po},Symbol.toStringTag,{value:"Module"}));function ii(e){switch(e){case void 0:case" ":case`
|
|
579
|
-
`:case"\r":case" ":return!0;default:return!1}}const vk=new Set("0123456789ABCDEFabcdef"),bz=new Set("0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz-#;/?:@&=+$_.!~*'()"),_f=new Set(",[]{}"),xz=new Set(` ,[]{}
|
|
580
|
-
\r `),Pg=e=>!e||xz.has(e);class n2{constructor(){this.atEnd=!1,this.blockScalarIndent=-1,this.blockScalarKeep=!1,this.buffer="",this.flowKey=!1,this.flowLevel=0,this.indentNext=0,this.indentValue=0,this.lineEndPos=null,this.next=null,this.pos=0}*lex(t,n=!1){if(t){if(typeof t!="string")throw TypeError("source is not a string");this.buffer=this.buffer?this.buffer+t:t,this.lineEndPos=null}this.atEnd=!n;let r=this.next??"stream";for(;r&&(n||this.hasChars(1));)r=yield*this.parseNext(r)}atLineEnd(){let t=this.pos,n=this.buffer[t];for(;n===" "||n===" ";)n=this.buffer[++t];return!n||n==="#"||n===`
|
|
581
|
-
`?!0:n==="\r"?this.buffer[t+1]===`
|
|
582
|
-
`:!1}charAt(t){return this.buffer[this.pos+t]}continueScalar(t){let n=this.buffer[t];if(this.indentNext>0){let r=0;for(;n===" ";)n=this.buffer[++r+t];if(n==="\r"){const a=this.buffer[r+t+1];if(a===`
|
|
583
|
-
`||!a&&!this.atEnd)return t+r+1}return n===`
|
|
584
|
-
`||r>=this.indentNext||!n&&!this.atEnd?t+r:-1}if(n==="-"||n==="."){const r=this.buffer.substr(t,3);if((r==="---"||r==="...")&&ii(this.buffer[t+3]))return-1}return t}getLine(){let t=this.lineEndPos;return(typeof t!="number"||t!==-1&&t<this.pos)&&(t=this.buffer.indexOf(`
|
|
585
|
-
`,this.pos),this.lineEndPos=t),t===-1?this.atEnd?this.buffer.substring(this.pos):null:(this.buffer[t-1]==="\r"&&(t-=1),this.buffer.substring(this.pos,t))}hasChars(t){return this.pos+t<=this.buffer.length}setNext(t){return this.buffer=this.buffer.substring(this.pos),this.pos=0,this.lineEndPos=null,this.next=t,null}peek(t){return this.buffer.substr(this.pos,t)}*parseNext(t){switch(t){case"stream":return yield*this.parseStream();case"line-start":return yield*this.parseLineStart();case"block-start":return yield*this.parseBlockStart();case"doc":return yield*this.parseDocument();case"flow":return yield*this.parseFlowCollection();case"quoted-scalar":return yield*this.parseQuotedScalar();case"block-scalar":return yield*this.parseBlockScalar();case"plain-scalar":return yield*this.parsePlainScalar()}}*parseStream(){let t=this.getLine();if(t===null)return this.setNext("stream");if(t[0]===ep&&(yield*this.pushCount(1),t=t.substring(1)),t[0]==="%"){let n=t.length,r=t.indexOf("#");for(;r!==-1;){const o=t[r-1];if(o===" "||o===" "){n=r-1;break}else r=t.indexOf("#",r+1)}for(;;){const o=t[n-1];if(o===" "||o===" ")n-=1;else break}const a=(yield*this.pushCount(n))+(yield*this.pushSpaces(!0));return yield*this.pushCount(t.length-a),this.pushNewline(),"stream"}if(this.atLineEnd()){const n=yield*this.pushSpaces(!0);return yield*this.pushCount(t.length-n),yield*this.pushNewline(),"stream"}return yield tp,yield*this.parseLineStart()}*parseLineStart(){const t=this.charAt(0);if(!t&&!this.atEnd)return this.setNext("line-start");if(t==="-"||t==="."){if(!this.atEnd&&!this.hasChars(4))return this.setNext("line-start");const n=this.peek(3);if((n==="---"||n==="...")&&ii(this.charAt(3)))return yield*this.pushCount(3),this.indentValue=0,this.indentNext=0,n==="---"?"doc":"stream"}return this.indentValue=yield*this.pushSpaces(!1),this.indentNext>this.indentValue&&!ii(this.charAt(1))&&(this.indentNext=this.indentValue),yield*this.parseBlockStart()}*parseBlockStart(){const[t,n]=this.peek(2);if(!n&&!this.atEnd)return this.setNext("block-start");if((t==="-"||t==="?"||t===":")&&ii(n)){const r=(yield*this.pushCount(1))+(yield*this.pushSpaces(!0));return this.indentNext=this.indentValue+1,this.indentValue+=r,yield*this.parseBlockStart()}return"doc"}*parseDocument(){yield*this.pushSpaces(!0);const t=this.getLine();if(t===null)return this.setNext("doc");let n=yield*this.pushIndicators();switch(t[n]){case"#":yield*this.pushCount(t.length-n);case void 0:return yield*this.pushNewline(),yield*this.parseLineStart();case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel=1,"flow";case"}":case"]":return yield*this.pushCount(1),"doc";case"*":return yield*this.pushUntil(Pg),"doc";case'"':case"'":return yield*this.parseQuotedScalar();case"|":case">":return n+=yield*this.parseBlockScalarHeader(),n+=yield*this.pushSpaces(!0),yield*this.pushCount(t.length-n),yield*this.pushNewline(),yield*this.parseBlockScalar();default:return yield*this.parsePlainScalar()}}*parseFlowCollection(){let t,n,r=-1;do t=yield*this.pushNewline(),t>0?(n=yield*this.pushSpaces(!1),this.indentValue=r=n):n=0,n+=yield*this.pushSpaces(!0);while(t+n>0);const a=this.getLine();if(a===null)return this.setNext("flow");if((r!==-1&&r<this.indentNext&&a[0]!=="#"||r===0&&(a.startsWith("---")||a.startsWith("..."))&&ii(a[3]))&&!(r===this.indentNext-1&&this.flowLevel===1&&(a[0]==="]"||a[0]==="}")))return this.flowLevel=0,yield np,yield*this.parseLineStart();let o=0;for(;a[o]===",";)o+=yield*this.pushCount(1),o+=yield*this.pushSpaces(!0),this.flowKey=!1;switch(o+=yield*this.pushIndicators(),a[o]){case void 0:return"flow";case"#":return yield*this.pushCount(a.length-o),"flow";case"{":case"[":return yield*this.pushCount(1),this.flowKey=!1,this.flowLevel+=1,"flow";case"}":case"]":return yield*this.pushCount(1),this.flowKey=!0,this.flowLevel-=1,this.flowLevel?"flow":"doc";case"*":return yield*this.pushUntil(Pg),"flow";case'"':case"'":return this.flowKey=!0,yield*this.parseQuotedScalar();case":":{const l=this.charAt(1);if(this.flowKey||ii(l)||l===",")return this.flowKey=!1,yield*this.pushCount(1),yield*this.pushSpaces(!0),"flow"}default:return this.flowKey=!1,yield*this.parsePlainScalar()}}*parseQuotedScalar(){const t=this.charAt(0);let n=this.buffer.indexOf(t,this.pos+1);if(t==="'")for(;n!==-1&&this.buffer[n+1]==="'";)n=this.buffer.indexOf("'",n+2);else for(;n!==-1;){let o=0;for(;this.buffer[n-1-o]==="\\";)o+=1;if(o%2===0)break;n=this.buffer.indexOf('"',n+1)}const r=this.buffer.substring(0,n);let a=r.indexOf(`
|
|
586
|
-
`,this.pos);if(a!==-1){for(;a!==-1;){const o=this.continueScalar(a+1);if(o===-1)break;a=r.indexOf(`
|
|
587
|
-
`,o)}a!==-1&&(n=a-(r[a-1]==="\r"?2:1))}if(n===-1){if(!this.atEnd)return this.setNext("quoted-scalar");n=this.buffer.length}return yield*this.pushToIndex(n+1,!1),this.flowLevel?"flow":"doc"}*parseBlockScalarHeader(){this.blockScalarIndent=-1,this.blockScalarKeep=!1;let t=this.pos;for(;;){const n=this.buffer[++t];if(n==="+")this.blockScalarKeep=!0;else if(n>"0"&&n<="9")this.blockScalarIndent=Number(n)-1;else if(n!=="-")break}return yield*this.pushUntil(n=>ii(n)||n==="#")}*parseBlockScalar(){let t=this.pos-1,n=0,r;e:for(let o=this.pos;r=this.buffer[o];++o)switch(r){case" ":n+=1;break;case`
|
|
588
|
-
`:t=o,n=0;break;case"\r":{const l=this.buffer[o+1];if(!l&&!this.atEnd)return this.setNext("block-scalar");if(l===`
|
|
589
|
-
`)break}default:break e}if(!r&&!this.atEnd)return this.setNext("block-scalar");if(n>=this.indentNext){this.blockScalarIndent===-1?this.indentNext=n:this.indentNext=this.blockScalarIndent+(this.indentNext===0?1:this.indentNext);do{const o=this.continueScalar(t+1);if(o===-1)break;t=this.buffer.indexOf(`
|
|
590
|
-
`,o)}while(t!==-1);if(t===-1){if(!this.atEnd)return this.setNext("block-scalar");t=this.buffer.length}}let a=t+1;for(r=this.buffer[a];r===" ";)r=this.buffer[++a];if(r===" "){for(;r===" "||r===" "||r==="\r"||r===`
|
|
591
|
-
`;)r=this.buffer[++a];t=a-1}else if(!this.blockScalarKeep)do{let o=t-1,l=this.buffer[o];l==="\r"&&(l=this.buffer[--o]);const d=o;for(;l===" ";)l=this.buffer[--o];if(l===`
|
|
592
|
-
`&&o>=this.pos&&o+1+n>d)t=o;else break}while(!0);return yield _u,yield*this.pushToIndex(t+1,!0),yield*this.parseLineStart()}*parsePlainScalar(){const t=this.flowLevel>0;let n=this.pos-1,r=this.pos-1,a;for(;a=this.buffer[++r];)if(a===":"){const o=this.buffer[r+1];if(ii(o)||t&&_f.has(o))break;n=r}else if(ii(a)){let o=this.buffer[r+1];if(a==="\r"&&(o===`
|
|
593
|
-
`?(r+=1,a=`
|
|
594
|
-
`,o=this.buffer[r+1]):n=r),o==="#"||t&&_f.has(o))break;if(a===`
|
|
595
|
-
`){const l=this.continueScalar(r+1);if(l===-1)break;r=Math.max(r,l-2)}}else{if(t&&_f.has(a))break;n=r}return!a&&!this.atEnd?this.setNext("plain-scalar"):(yield _u,yield*this.pushToIndex(n+1,!0),t?"flow":"doc")}*pushCount(t){return t>0?(yield this.buffer.substr(this.pos,t),this.pos+=t,t):0}*pushToIndex(t,n){const r=this.buffer.slice(this.pos,t);return r?(yield r,this.pos+=r.length,r.length):(n&&(yield""),0)}*pushIndicators(){switch(this.charAt(0)){case"!":return(yield*this.pushTag())+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"&":return(yield*this.pushUntil(Pg))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators());case"-":case"?":case":":{const t=this.flowLevel>0,n=this.charAt(1);if(ii(n)||t&&_f.has(n))return t?this.flowKey&&(this.flowKey=!1):this.indentNext=this.indentValue+1,(yield*this.pushCount(1))+(yield*this.pushSpaces(!0))+(yield*this.pushIndicators())}}return 0}*pushTag(){if(this.charAt(1)==="<"){let t=this.pos+2,n=this.buffer[t];for(;!ii(n)&&n!==">";)n=this.buffer[++t];return yield*this.pushToIndex(n===">"?t+1:t,!1)}else{let t=this.pos+1,n=this.buffer[t];for(;n;)if(bz.has(n))n=this.buffer[++t];else if(n==="%"&&vk.has(this.buffer[t+1])&&vk.has(this.buffer[t+2]))n=this.buffer[t+=3];else break;return yield*this.pushToIndex(t,!1)}}*pushNewline(){const t=this.buffer[this.pos];return t===`
|
|
596
|
-
`?yield*this.pushCount(1):t==="\r"&&this.charAt(1)===`
|
|
597
|
-
`?yield*this.pushCount(2):0}*pushSpaces(t){let n=this.pos-1,r;do r=this.buffer[++n];while(r===" "||t&&r===" ");const a=n-this.pos;return a>0&&(yield this.buffer.substr(this.pos,a),this.pos=n),a}*pushUntil(t){let n=this.pos,r=this.buffer[n];for(;!t(r);)r=this.buffer[++n];return yield*this.pushToIndex(n,!1)}}class r2{constructor(){this.lineStarts=[],this.addNewLine=t=>this.lineStarts.push(t),this.linePos=t=>{let n=0,r=this.lineStarts.length;for(;n<r;){const o=n+r>>1;this.lineStarts[o]<t?n=o+1:r=o}if(this.lineStarts[n]===t)return{line:n+1,col:1};if(n===0)return{line:0,col:t};const a=this.lineStarts[n-1];return{line:n,col:t-a+1}}}}function os(e,t){for(let n=0;n<e.length;++n)if(e[n].type===t)return!0;return!1}function wk(e){for(let t=0;t<e.length;++t)switch(e[t].type){case"space":case"comment":case"newline":break;default:return t}return-1}function i2(e){switch(e==null?void 0:e.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":case"flow-collection":return!0;default:return!1}}function jf(e){switch(e.type){case"document":return e.start;case"block-map":{const t=e.items[e.items.length-1];return t.sep??t.start}case"block-seq":return e.items[e.items.length-1].start;default:return[]}}function ol(e){var n;if(e.length===0)return[];let t=e.length;e:for(;--t>=0;)switch(e[t].type){case"doc-start":case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":case"newline":break e}for(;((n=e[++t])==null?void 0:n.type)==="space";);return e.splice(t,e.length)}function kk(e){if(e.start.type==="flow-seq-start")for(const t of e.items)t.sep&&!t.value&&!os(t.start,"explicit-key-ind")&&!os(t.sep,"map-value-ind")&&(t.key&&(t.value=t.key),delete t.key,i2(t.value)?t.value.end?Array.prototype.push.apply(t.value.end,t.sep):t.value.end=t.sep:Array.prototype.push.apply(t.start,t.sep),delete t.sep)}class sx{constructor(t){this.atNewLine=!0,this.atScalar=!1,this.indent=0,this.offset=0,this.onKeyLine=!1,this.stack=[],this.source="",this.type="",this.lexer=new n2,this.onNewLine=t}*parse(t,n=!1){this.onNewLine&&this.offset===0&&this.onNewLine(0);for(const r of this.lexer.lex(t,n))yield*this.next(r);n||(yield*this.end())}*next(t){if(this.source=t,this.atScalar){this.atScalar=!1,yield*this.step(),this.offset+=t.length;return}const n=t2(t);if(n)if(n==="scalar")this.atNewLine=!1,this.atScalar=!0,this.type="scalar";else{switch(this.type=n,yield*this.step(),n){case"newline":this.atNewLine=!0,this.indent=0,this.onNewLine&&this.onNewLine(this.offset+t.length);break;case"space":this.atNewLine&&t[0]===" "&&(this.indent+=t.length);break;case"explicit-key-ind":case"map-value-ind":case"seq-item-ind":this.atNewLine&&(this.indent+=t.length);break;case"doc-mode":case"flow-error-end":return;default:this.atNewLine=!1}this.offset+=t.length}else{const r=`Not a YAML token: ${t}`;yield*this.pop({type:"error",offset:this.offset,message:r,source:t}),this.offset+=t.length}}*end(){for(;this.stack.length>0;)yield*this.pop()}get sourceToken(){return{type:this.type,offset:this.offset,indent:this.indent,source:this.source}}*step(){const t=this.peek(1);if(this.type==="doc-end"&&(t==null?void 0:t.type)!=="doc-end"){for(;this.stack.length>0;)yield*this.pop();this.stack.push({type:"doc-end",offset:this.offset,source:this.source});return}if(!t)return yield*this.stream();switch(t.type){case"document":return yield*this.document(t);case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return yield*this.scalar(t);case"block-scalar":return yield*this.blockScalar(t);case"block-map":return yield*this.blockMap(t);case"block-seq":return yield*this.blockSequence(t);case"flow-collection":return yield*this.flowCollection(t);case"doc-end":return yield*this.documentEnd(t)}yield*this.pop()}peek(t){return this.stack[this.stack.length-t]}*pop(t){const n=t??this.stack.pop();if(!n)yield{type:"error",offset:this.offset,source:"",message:"Tried to pop an empty stack"};else if(this.stack.length===0)yield n;else{const r=this.peek(1);switch(n.type==="block-scalar"?n.indent="indent"in r?r.indent:0:n.type==="flow-collection"&&r.type==="document"&&(n.indent=0),n.type==="flow-collection"&&kk(n),r.type){case"document":r.value=n;break;case"block-scalar":r.props.push(n);break;case"block-map":{const a=r.items[r.items.length-1];if(a.value){r.items.push({start:[],key:n,sep:[]}),this.onKeyLine=!0;return}else if(a.sep)a.value=n;else{Object.assign(a,{key:n,sep:[]}),this.onKeyLine=!a.explicitKey;return}break}case"block-seq":{const a=r.items[r.items.length-1];a.value?r.items.push({start:[],value:n}):a.value=n;break}case"flow-collection":{const a=r.items[r.items.length-1];!a||a.value?r.items.push({start:[],key:n,sep:[]}):a.sep?a.value=n:Object.assign(a,{key:n,sep:[]});return}default:yield*this.pop(),yield*this.pop(n)}if((r.type==="document"||r.type==="block-map"||r.type==="block-seq")&&(n.type==="block-map"||n.type==="block-seq")){const a=n.items[n.items.length-1];a&&!a.sep&&!a.value&&a.start.length>0&&wk(a.start)===-1&&(n.indent===0||a.start.every(o=>o.type!=="comment"||o.indent<n.indent))&&(r.type==="document"?r.end=a.start:r.items.push({start:a.start}),n.items.splice(-1,1))}}}*stream(){switch(this.type){case"directive-line":yield{type:"directive",offset:this.offset,source:this.source};return;case"byte-order-mark":case"space":case"comment":case"newline":yield this.sourceToken;return;case"doc-mode":case"doc-start":{const t={type:"document",offset:this.offset,start:[]};this.type==="doc-start"&&t.start.push(this.sourceToken),this.stack.push(t);return}}yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML stream`,source:this.source}}*document(t){if(t.value)return yield*this.lineEnd(t);switch(this.type){case"doc-start":{wk(t.start)!==-1?(yield*this.pop(),yield*this.step()):t.start.push(this.sourceToken);return}case"anchor":case"tag":case"space":case"comment":case"newline":t.start.push(this.sourceToken);return}const n=this.startBlockValue(t);n?this.stack.push(n):yield{type:"error",offset:this.offset,message:`Unexpected ${this.type} token in YAML document`,source:this.source}}*scalar(t){if(this.type==="map-value-ind"){const n=jf(this.peek(2)),r=ol(n);let a;t.end?(a=t.end,a.push(this.sourceToken),delete t.end):a=[this.sourceToken];const o={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:r,key:t,sep:a}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=o}else yield*this.lineEnd(t)}*blockScalar(t){switch(this.type){case"space":case"comment":case"newline":t.props.push(this.sourceToken);return;case"scalar":if(t.source=this.source,this.atNewLine=!0,this.indent=0,this.onNewLine){let n=this.source.indexOf(`
|
|
598
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
599
|
-
`,n)+1}yield*this.pop();break;default:yield*this.pop(),yield*this.step()}}*blockMap(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(this.onKeyLine=!1,n.value){const a="end"in n.value?n.value.end:void 0,o=Array.isArray(a)?a[a.length-1]:void 0;(o==null?void 0:o.type)==="comment"?a==null||a.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else if(n.sep)n.sep.push(this.sourceToken);else{if(this.atIndentedComment(n.start,t.indent)){const a=t.items[t.items.length-2],o=(r=a==null?void 0:a.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return}if(this.indent>=t.indent){const a=!this.onKeyLine&&this.indent===t.indent,o=a&&(n.sep||n.explicitKey)&&this.type!=="seq-item-ind";let l=[];if(o&&n.sep&&!n.value){const d=[];for(let f=0;f<n.sep.length;++f){const h=n.sep[f];switch(h.type){case"newline":d.push(f);break;case"space":break;case"comment":h.indent>t.indent&&(d.length=0);break;default:d.length=0}}d.length>=2&&(l=n.sep.splice(d[1]))}switch(this.type){case"anchor":case"tag":o||n.value?(l.push(this.sourceToken),t.items.push({start:l}),this.onKeyLine=!0):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"explicit-key-ind":!n.sep&&!n.explicitKey?(n.start.push(this.sourceToken),n.explicitKey=!0):o||n.value?(l.push(this.sourceToken),t.items.push({start:l,explicitKey:!0})):this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken],explicitKey:!0}]}),this.onKeyLine=!0;return;case"map-value-ind":if(n.explicitKey)if(n.sep)if(n.value)t.items.push({start:[],key:null,sep:[this.sourceToken]});else if(os(n.sep,"map-value-ind"))this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:l,key:null,sep:[this.sourceToken]}]});else if(i2(n.key)&&!os(n.sep,"newline")){const d=ol(n.start),f=n.key,h=n.sep;h.push(this.sourceToken),delete n.key,delete n.sep,this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:f,sep:h}]})}else l.length>0?n.sep=n.sep.concat(l,this.sourceToken):n.sep.push(this.sourceToken);else if(os(n.start,"newline"))Object.assign(n,{key:null,sep:[this.sourceToken]});else{const d=ol(n.start);this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:d,key:null,sep:[this.sourceToken]}]})}else n.sep?n.value||o?t.items.push({start:l,key:null,sep:[this.sourceToken]}):os(n.sep,"map-value-ind")?this.stack.push({type:"block-map",offset:this.offset,indent:this.indent,items:[{start:[],key:null,sep:[this.sourceToken]}]}):n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});this.onKeyLine=!0;return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const d=this.flowScalar(this.type);o||n.value?(t.items.push({start:l,key:d,sep:[]}),this.onKeyLine=!0):n.sep?this.stack.push(d):(Object.assign(n,{key:d,sep:[]}),this.onKeyLine=!0);return}default:{const d=this.startBlockValue(t);if(d){if(d.type==="block-seq"){if(!n.explicitKey&&n.sep&&!os(n.sep,"newline")){yield*this.pop({type:"error",offset:this.offset,message:"Unexpected block-seq-ind on same line with key",source:this.source});return}}else a&&t.items.push({start:l});this.stack.push(d);return}}}}yield*this.pop(),yield*this.step()}*blockSequence(t){var r;const n=t.items[t.items.length-1];switch(this.type){case"newline":if(n.value){const a="end"in n.value?n.value.end:void 0,o=Array.isArray(a)?a[a.length-1]:void 0;(o==null?void 0:o.type)==="comment"?a==null||a.push(this.sourceToken):t.items.push({start:[this.sourceToken]})}else n.start.push(this.sourceToken);return;case"space":case"comment":if(n.value)t.items.push({start:[this.sourceToken]});else{if(this.atIndentedComment(n.start,t.indent)){const a=t.items[t.items.length-2],o=(r=a==null?void 0:a.value)==null?void 0:r.end;if(Array.isArray(o)){Array.prototype.push.apply(o,n.start),o.push(this.sourceToken),t.items.pop();return}}n.start.push(this.sourceToken)}return;case"anchor":case"tag":if(n.value||this.indent<=t.indent)break;n.start.push(this.sourceToken);return;case"seq-item-ind":if(this.indent!==t.indent)break;n.value||os(n.start,"seq-item-ind")?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return}if(this.indent>t.indent){const a=this.startBlockValue(t);if(a){this.stack.push(a);return}}yield*this.pop(),yield*this.step()}*flowCollection(t){const n=t.items[t.items.length-1];if(this.type==="flow-error-end"){let r;do yield*this.pop(),r=this.peek(1);while((r==null?void 0:r.type)==="flow-collection")}else if(t.end.length===0){switch(this.type){case"comma":case"explicit-key-ind":!n||n.sep?t.items.push({start:[this.sourceToken]}):n.start.push(this.sourceToken);return;case"map-value-ind":!n||n.value?t.items.push({start:[],key:null,sep:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):Object.assign(n,{key:null,sep:[this.sourceToken]});return;case"space":case"comment":case"newline":case"anchor":case"tag":!n||n.value?t.items.push({start:[this.sourceToken]}):n.sep?n.sep.push(this.sourceToken):n.start.push(this.sourceToken);return;case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":{const a=this.flowScalar(this.type);!n||n.value?t.items.push({start:[],key:a,sep:[]}):n.sep?this.stack.push(a):Object.assign(n,{key:a,sep:[]});return}case"flow-map-end":case"flow-seq-end":t.end.push(this.sourceToken);return}const r=this.startBlockValue(t);r?this.stack.push(r):(yield*this.pop(),yield*this.step())}else{const r=this.peek(2);if(r.type==="block-map"&&(this.type==="map-value-ind"&&r.indent===t.indent||this.type==="newline"&&!r.items[r.items.length-1].sep))yield*this.pop(),yield*this.step();else if(this.type==="map-value-ind"&&r.type!=="flow-collection"){const a=jf(r),o=ol(a);kk(t);const l=t.end.splice(1,t.end.length);l.push(this.sourceToken);const d={type:"block-map",offset:t.offset,indent:t.indent,items:[{start:o,key:t,sep:l}]};this.onKeyLine=!0,this.stack[this.stack.length-1]=d}else yield*this.lineEnd(t)}}flowScalar(t){if(this.onNewLine){let n=this.source.indexOf(`
|
|
600
|
-
`)+1;for(;n!==0;)this.onNewLine(this.offset+n),n=this.source.indexOf(`
|
|
601
|
-
`,n)+1}return{type:t,offset:this.offset,indent:this.indent,source:this.source}}startBlockValue(t){switch(this.type){case"alias":case"scalar":case"single-quoted-scalar":case"double-quoted-scalar":return this.flowScalar(this.type);case"block-scalar-header":return{type:"block-scalar",offset:this.offset,indent:this.indent,props:[this.sourceToken],source:""};case"flow-map-start":case"flow-seq-start":return{type:"flow-collection",offset:this.offset,indent:this.indent,start:this.sourceToken,items:[],end:[]};case"seq-item-ind":return{type:"block-seq",offset:this.offset,indent:this.indent,items:[{start:[this.sourceToken]}]};case"explicit-key-ind":{this.onKeyLine=!0;const n=jf(t),r=ol(n);return r.push(this.sourceToken),{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,explicitKey:!0}]}}case"map-value-ind":{this.onKeyLine=!0;const n=jf(t),r=ol(n);return{type:"block-map",offset:this.offset,indent:this.indent,items:[{start:r,key:null,sep:[this.sourceToken]}]}}}return null}atIndentedComment(t,n){return this.type!=="comment"||this.indent<=n?!1:t.every(r=>r.type==="newline"||r.type==="space")}*documentEnd(t){this.type!=="doc-mode"&&(t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop()))}*lineEnd(t){switch(this.type){case"comma":case"doc-start":case"doc-end":case"flow-seq-end":case"flow-map-end":case"map-value-ind":yield*this.pop(),yield*this.step();break;case"newline":this.onKeyLine=!1;case"space":case"comment":default:t.end?t.end.push(this.sourceToken):t.end=[this.sourceToken],this.type==="newline"&&(yield*this.pop())}}}function a2(e){const t=e.prettyErrors!==!1;return{lineCounter:e.lineCounter||t&&new r2||null,prettyErrors:t}}function vz(e,t={}){const{lineCounter:n,prettyErrors:r}=a2(t),a=new sx(n==null?void 0:n.addNewLine),o=new ax(t),l=Array.from(o.compose(a.parse(e)));if(r&&n)for(const d of l)d.errors.forEach(yh(e,n)),d.warnings.forEach(yh(e,n));return l.length>0?l:Object.assign([],{empty:!0},o.streamInfo())}function s2(e,t={}){const{lineCounter:n,prettyErrors:r}=a2(t),a=new sx(n==null?void 0:n.addNewLine),o=new ax(t);let l=null;for(const d of o.compose(a.parse(e),!0,e.length))if(!l)l=d;else if(l.options.logLevel!=="silent"){l.errors.push(new Zs(d.range.slice(0,2),"MULTIPLE_DOCS","Source contains multiple documents; please use YAML.parseAllDocuments()"));break}return r&&n&&(l.errors.forEach(yh(e,n)),l.warnings.forEach(yh(e,n))),l}function wz(e,t,n){let r;typeof t=="function"?r=t:n===void 0&&t&&typeof t=="object"&&(n=t);const a=s2(e,n);if(!a)return null;if(a.warnings.forEach(o=>S_(a.options.logLevel,o)),a.errors.length>0){if(a.options.logLevel!=="silent")throw a.errors[0];a.errors=[]}return a.toJS(Object.assign({reviver:r},n))}function kz(e,t,n){let r=null;if(typeof t=="function"||Array.isArray(t)?r=t:n===void 0&&t&&(n=t),typeof n=="string"&&(n=n.length),typeof n=="number"){const a=Math.round(n);n=a<1?void 0:a>8?{indent:8}:{indent:a}}if(e===void 0){const{keepUndefined:a}=n??t??{};if(!a)return}return wo(e)&&!r?e.toString(n):new ic(e,r,n).toString(n)}const Ek=Object.freeze(Object.defineProperty({__proto__:null,Alias:Kh,CST:yz,Composer:ax,Document:ic,Lexer:n2,LineCounter:r2,Pair:Vn,Parser:sx,Scalar:st,Schema:q_,YAMLError:rx,YAMLMap:Nr,YAMLParseError:Zs,YAMLSeq:ws,YAMLWarning:K_,isAlias:Ss,isCollection:ln,isDocument:wo,isMap:ec,isNode:cn,isPair:en,isScalar:Kt,isSeq:tc,parse:wz,parseAllDocuments:vz,parseDocument:s2,stringify:kz,visit:ko,visitAsync:Hh},Symbol.toStringTag,{value:"Module"}));function Ez({projectName:e,file:t,onClose:n,onSaved:r}){const a=Be(),o=Gt(),{alert:l}=un(),{data:d,isLoading:f,isError:h,error:g,refetch:m}=Ye({queryKey:["pipeline-file",e,t],queryFn:()=>V3(e,t)}),[y,b]=j.useState("structured"),[k,v]=j.useState(null),[N,E]=j.useState(null);j.useEffect(()=>{d&&k===null&&(v(d.content),E(d.etag),d.parseError&&b("yaml"))},[d,k]),j.useEffect(()=>{const L=R=>{R.key==="Escape"&&n()};return window.addEventListener("keydown",L),()=>window.removeEventListener("keydown",L)},[n]);const C=Ct({mutationFn:()=>{if(k===null||N===null)throw new Error("no draft");return Y3(e,t,k,N)},onSuccess:L=>{E(L.etag),o.invalidateQueries({queryKey:["pipeline-file",e,t]}),o.invalidateQueries({queryKey:["project-pipelines",e]}),r()},onError:L=>{const R=L.status;l({title:a(R===409?"pipelineEditor.error.conflict.title":R===422?"pipelineEditor.error.yaml.title":"pipelineEditor.error.save.title"),body:L instanceof Error?L.message:String(L)})}}),S=k!==null&&d&&k!==d.content,{parsed:_,parseError:M}=j.useMemo(()=>{if(k===null)return{parsed:null,parseError:null};try{return{parsed:Ek.parse(k)??{},parseError:null}}catch(L){return{parsed:null,parseError:L instanceof Error?L.message:String(L)}}},[k]),T=L=>{try{const R=Ek.stringify(L,{lineWidth:0});v(R)}catch(R){l({title:a("pipelineEditor.error.serialize.title"),body:R instanceof Error?R.message:String(R)})}};return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[c.jsxs("header",{className:"flex items-start justify-between gap-3 mb-3 flex-shrink-0",children:[c.jsxs("div",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold flex items-center gap-2",children:[c.jsx(ck,{size:20,strokeWidth:2.5}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-lg",children:t}),(d==null?void 0:d.isActive)&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)",padding:"2px 8px"},children:a("pipelineEditor.activeBadge")})]}),c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:[e,"/pipelines/",t,N&&` · etag ${N}`]})]}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":a("pipelineEditor.close"),children:c.jsx(Sn,{size:14,strokeWidth:3})})]}),f&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:a("common.loading")}),h&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:a("pipelineEditor.error.load",{detail:g instanceof Error?g.message:String(g)})}),d&&k!==null&&c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex items-center gap-3 mb-3 flex-shrink-0 flex-wrap",children:[c.jsxs("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:[c.jsxs("button",{type:"button",onClick:()=>b("structured"),"aria-pressed":y==="structured",disabled:!!M,className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",y==="structured"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]",M?"opacity-50 cursor-not-allowed":""].join(" "),title:M??void 0,children:[c.jsx(Fh,{size:11,strokeWidth:2.5}),a("pipelineEditor.mode.structured")]}),c.jsxs("button",{type:"button",onClick:()=>b("yaml"),"aria-pressed":y==="yaml",className:["px-3 py-1 rounded-full text-xs font-bold flex items-center gap-1.5",y==="yaml"?"bg-[var(--color-primary)] text-[var(--color-text)] shadow-[1px_1px_0_var(--color-text)]":"text-[var(--color-text-muted)]"].join(" "),children:[c.jsx(ck,{size:11,strokeWidth:2.5}),a("pipelineEditor.mode.yaml")]})]}),M&&c.jsxs("div",{className:"flex items-center gap-1 text-xs text-[var(--color-crashed)] font-bold",children:[c.jsx(ku,{size:12,strokeWidth:2.5}),a("pipelineEditor.parseError.prefix",{detail:M})]}),(d==null?void 0:d.isActive)&&c.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold ml-auto",children:a("pipelineEditor.activeWarning")})]}),c.jsxs("div",{className:"flex-1 overflow-auto",children:[y==="structured"&&_&&c.jsx(Sz,{parsed:_,onChange:T}),y==="yaml"&&c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:400,resize:"vertical"},value:k,onChange:L=>v(L.target.value),spellCheck:!1,"aria-label":a("pipelineEditor.yamlAria")})]}),c.jsxs("div",{className:"flex items-center justify-between mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:S?c.jsx("span",{className:"text-[var(--color-stuck)] font-bold",children:a("pipelineEditor.status.unsaved")}):C.isSuccess?c.jsxs("span",{className:"text-[var(--color-running)] font-bold flex items-center gap-1",children:[c.jsx(Eu,{size:12,strokeWidth:2.5})," ",a("pipelineEditor.status.saved")]}):a("pipelineEditor.status.noChanges")}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:()=>{v(null),m()},disabled:C.isPending,type:"button",children:a("pipelineEditor.reload")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:()=>C.mutate(),disabled:!S||C.isPending,type:"button","aria-label":a("pipelineEditor.saveAria"),children:[C.isPending?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(Ri,{size:13,strokeWidth:3}),a("pipelineEditor.save")]})]})]})]})]})})}function Sz({parsed:e,onChange:t}){const n=Be(),r=e.stages??[],a=h=>{t({...e,stages:h})},o=()=>{a([...r,{name:`stage-${r.length+1}`,on_complete:"move_card Done"}])},l=h=>{a(r.filter((g,m)=>m!==h))},d=(h,g)=>{const m=[...r],y=h+g;y<0||y>=m.length||([m[h],m[y]]=[m[y],m[h]],a(m))},f=(h,g)=>{a(r.map((m,y)=>y===h?{...m,...g}:m))};return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[c.jsxs("label",{className:"flex items-center gap-2 text-sm",children:[c.jsx("span",{className:"font-bold",children:"mode:"}),c.jsxs("select",{className:"nb-input",style:{padding:"4px 10px",fontSize:12},value:e.mode??"project",onChange:h=>t({...e,mode:h.target.value}),children:[c.jsx("option",{value:"project",children:"project"}),c.jsx("option",{value:"steps",children:"steps"})]})]}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:n("pipelineEditor.modeHint")})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider",children:n("pipelineEditor.stages.heading",{count:r.length})}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 12px",fontSize:12},onClick:o,"aria-label":n("pipelineEditor.stages.add"),children:[c.jsx(pr,{size:11,strokeWidth:3})," ",n("pipelineEditor.stages.add")]})]}),r.length===0?c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:n("pipelineEditor.stages.empty")}):c.jsx("div",{className:"flex flex-col gap-3",children:r.map((h,g)=>c.jsx(Nz,{stage:h,index:g,total:r.length,onChange:m=>f(g,m),onRemove:()=>l(g),onMoveUp:()=>d(g,-1),onMoveDown:()=>d(g,1)},g))})]})]})}function Nz({stage:e,index:t,total:n,onChange:r,onRemove:a,onMoveUp:o,onMoveDown:l}){const d=Be(),f=e.on_fail??{};return c.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-4",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h4",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["Stage #",t+1,e.name&&c.jsx("code",{className:"ml-2 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:e.name})]}),c.jsxs("div",{className:"flex gap-1",children:[c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:o,disabled:t===0,"aria-label":d("pipelineEditor.stage.moveUp"),children:c.jsx(PR,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"3px 8px"},onClick:l,disabled:t===n-1,"aria-label":d("pipelineEditor.stage.moveDown"),children:c.jsx(Vu,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"3px 8px"},onClick:a,"aria-label":d("pipelineEditor.stage.remove"),children:c.jsx(fi,{size:12,strokeWidth:3})})]})]}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.jsx(es,{label:"name",hint:d("pipelineEditor.stage.name.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.name??"",onChange:h=>r({name:h.target.value}),placeholder:"develop"})}),c.jsx(es,{label:"profile",hint:d("pipelineEditor.stage.profile.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.profile??"",onChange:h=>r({profile:h.target.value||void 0}),placeholder:"fullstack"})}),c.jsx(es,{label:"card_state",hint:d("pipelineEditor.stage.cardState.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.card_state??"",onChange:h=>r({card_state:h.target.value||void 0}),placeholder:"Inprogress"})}),c.jsx(es,{label:"timeout",hint:d("pipelineEditor.stage.timeout.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.timeout??"",onChange:h=>r({timeout:h.target.value||void 0}),placeholder:"2h"})}),c.jsx(es,{label:"trigger",hint:d("pipelineEditor.stage.trigger.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.trigger??"",onChange:h=>r({trigger:h.target.value||void 0}),placeholder:"card_enters 'Todo'"})}),c.jsx(es,{label:"on_complete",hint:d("pipelineEditor.stage.onComplete.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:e.on_complete??"",onChange:h=>r({on_complete:h.target.value}),placeholder:"move_card Done"})})]}),c.jsxs("div",{className:"mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)]",children:[c.jsx("h5",{className:"text-xs font-bold uppercase tracking-wider mb-2 text-[var(--color-text-muted)]",children:"on_fail"}),c.jsxs("div",{className:"grid grid-cols-2 gap-3 text-sm",children:[c.jsx(es,{label:"action",hint:d("pipelineEditor.stage.onFail.action.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.action??"",onChange:h=>r({on_fail:{...f,action:h.target.value||void 0}}),placeholder:"label NEEDS-FIX"})}),c.jsx(es,{label:"comment",hint:d("pipelineEditor.stage.onFail.comment.hint"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:f.comment??"",onChange:h=>r({on_fail:{...f,comment:h.target.value||void 0}}),placeholder:"Worker failed. Check logs."})})]}),c.jsxs("label",{className:"flex items-center gap-2 mt-3 text-sm cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:f.halt??!0,onChange:h=>r({on_fail:{...f,halt:h.target.checked}})}),c.jsx("span",{className:"font-bold",children:"halt"}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:d("pipelineEditor.stage.halt.note")})]})]})]})}function es({label:e,hint:t,children:n}){return c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-xs font-bold font-[family-name:var(--font-mono)]",children:e}),n,t&&c.jsx("span",{className:"text-[10px] text-[var(--color-text-muted)]",children:t})]})}function _z({onCancel:e,onCreate:t,hasActive:n,hasSample:r,isPending:a}){const o=Be(),[l,d]=j.useState(""),[f,h]=j.useState("blank");j.useEffect(()=>{const N=E=>{E.key==="Escape"&&e()};return window.addEventListener("keydown",N),()=>window.removeEventListener("keydown",N)},[e]);const g=l.trim(),m=g.endsWith(".yaml")?g:g?`${g}.yaml`:"",y=m&&/^[a-zA-Z0-9_.-]+\.yaml$/.test(m),b=()=>{!y||a||t(m,f)},v=o("newPipelineDialog.field.filename.help",{filename:"__FN__"}).split("__FN__");return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-50 flex items-center justify-center p-6 bg-black/30",children:c.jsxs("div",{className:"nb-card max-w-md w-full",children:[c.jsxs("header",{className:"flex items-start justify-between mb-4",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:o("newPipelineDialog.title")}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:e,type:"button","aria-label":o("common.close"),children:c.jsx(Sn,{size:14,strokeWidth:3})})]}),c.jsxs("form",{onSubmit:N=>{N.preventDefault(),b()},className:"flex flex-col gap-4",children:[c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:o("newPipelineDialog.field.filename.label")}),c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:o("newPipelineDialog.field.filename.placeholder"),value:l,onChange:N=>d(N.target.value),autoFocus:!0}),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)]",children:[v[0],c.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:m||"xxx.yaml"}),v[1]]})]}),c.jsxs("fieldset",{className:"flex flex-col gap-2",children:[c.jsx("legend",{className:"text-sm font-bold mb-1",children:o("newPipelineDialog.section.template")}),c.jsx(Bg,{value:"blank",current:f,label:o("newPipelineDialog.template.blank.label"),desc:o("newPipelineDialog.template.blank.desc"),onSelect:h}),c.jsx(Bg,{value:"sample",current:f,label:o("newPipelineDialog.template.sample.label"),desc:o("newPipelineDialog.template.sample.desc"),onSelect:h,disabled:!r,disabledReason:o("newPipelineDialog.template.sample.unavailable")}),c.jsx(Bg,{value:"active",current:f,label:o("newPipelineDialog.template.active.label"),desc:o("newPipelineDialog.template.active.desc"),onSelect:h,disabled:!n,disabledReason:o("newPipelineDialog.template.active.unavailable")})]}),c.jsxs("div",{className:"flex gap-3 justify-end pt-2",children:[c.jsx("button",{className:"nb-btn",onClick:e,type:"button",disabled:a,children:o("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"submit",disabled:!y||a,"aria-label":o("newPipelineDialog.create.aria"),children:[a?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(pr,{size:13,strokeWidth:3}),o("common.create")]})]})]})]})})}function Bg({value:e,current:t,label:n,desc:r,onSelect:a,disabled:o,disabledReason:l}){const d=t===e;return c.jsxs("label",{className:["flex items-start gap-2 p-2 rounded-lg border-2 cursor-pointer",o?"border-[var(--color-border-light)] opacity-50 cursor-not-allowed":d?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"border-[var(--color-border-light)] hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[c.jsx("input",{type:"radio",name:"pipeline-template",value:e,checked:d,disabled:o,onChange:()=>a(e),className:"mt-1 flex-shrink-0"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"text-sm font-bold",children:n}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)]",children:o?l:r})]})]})}function jz(e){return ft(`/api/rules/${encodeURIComponent(e)}`)}function ox(e){const t=e?`?project=${encodeURIComponent(e)}`:"";return ft(`/api/skills${t}`)}function Cz(e){return ft(`/api/skills/${encodeURIComponent(e)}`)}function Az(e,t){return ft(`/api/skills/${encodeURIComponent(e)}/references/${encodeURIComponent(t)}`)}async function Tz(e,t){const n=await fetch(e,{method:"POST",headers:void 0,body:void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function Mz(){return Tz("/api/skills/sync")}function Dz(e){return ft(`/api/skills/policy/${encodeURIComponent(e)}`)}function Oz(e,t){return qb(`/api/skills/policy/${encodeURIComponent(e)}`,t)}function Rz(){return ft("/api/skills/updates")}function Lz(e,t,n){return Li("/api/skills/import",{name:e,files:t,overwrite:n})}function Iz(e){return ft(`/api/skills/${encodeURIComponent(e)}/export`)}function zz(e,t){return Li("/api/skills/create",{name:e,intent:t})}function o2(){return c.jsx("div",{className:"nb-card",children:c.jsxs("p",{className:"text-[var(--color-text-muted)] flex items-center gap-2",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," …"]})})}function l2({msg:e}){return c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:e})})}function Pz({name:e}){var b,k;const t=Be(),n=Gt(),{alert:r}=un(),a=Ye({queryKey:["skill-policy",e],queryFn:()=>Dz(e),enabled:!!e}),o=(b=a.data)==null?void 0:b.data,[l,d]=j.useState(null),[f,h]=j.useState(null);j.useEffect(()=>{var v;o&&l===null&&d((v=o.policy.allow)!=null&&v.length?new Set(o.policy.allow):new Set(o.skills.map(N=>N.name)))},[o,l]);const g=Ct({mutationFn:v=>Oz(e,v),onSuccess:v=>{h(v),d(null),n.invalidateQueries({queryKey:["skill-policy",e]})},onError:v=>void r({title:t("projectDetail.skills.saveError"),body:v instanceof Error?v.message:String(v)})});if(a.isLoading||o&&l===null)return c.jsx(o2,{});if(a.isError)return c.jsx(l2,{msg:a.error instanceof Error?a.error.message:String(a.error)});if(!o||!l)return null;if(o.skills.length===0)return c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("projectDetail.skills.empty")})});const m=o.eligible!==null,y=v=>d(N=>{const E=new Set(N);return E.has(v)?E.delete(v):E.add(v),E});return c.jsxs("div",{className:"nb-card flex flex-col gap-4 h-full min-h-0",children:[c.jsxs("div",{className:"shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(ZN,{size:18,strokeWidth:2.5}),t("projectDetail.skills.title")]}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:t("projectDetail.skills.desc")}),c.jsx("p",{className:"text-sm mt-1 font-medium",children:m?t("projectDetail.skills.hasPolicy",{count:String(((k=o.eligible)==null?void 0:k.length)??0)}):t("projectDetail.skills.noPolicy")})]}),c.jsxs("div",{className:"flex gap-2 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:12},onClick:()=>d(new Set(o.skills.map(v=>v.name))),children:t("projectDetail.skills.selectAll")}),c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:12},onClick:()=>d(new Set),children:t("projectDetail.skills.selectNone")})]}),c.jsx("div",{className:"flex flex-col gap-1 flex-1 min-h-0 overflow-auto border-2 border-[var(--color-text)] rounded p-2",children:o.skills.map(v=>c.jsxs("label",{className:"flex items-start gap-2 px-2 py-1 rounded hover:bg-[var(--color-bg-cream)] cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:l.has(v.name),onChange:()=>y(v.name),className:"mt-1"}),c.jsxs("span",{className:"flex-1",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold",children:v.name}),c.jsx("span",{className:"ml-2 text-[10px] uppercase text-[var(--color-text-muted)]",children:v.category}),v.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)]",children:v.description})]})]},v.name))}),c.jsxs("div",{className:"flex items-center gap-2 flex-wrap shrink-0",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",disabled:g.isPending,onClick:()=>g.mutate({allow:[...l]}),children:[g.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(Ri,{size:14,strokeWidth:3}),t("projectDetail.skills.save")]}),c.jsxs("button",{type:"button",className:"nb-btn",disabled:g.isPending,onClick:()=>g.mutate({}),children:[c.jsx(Pb,{size:14,strokeWidth:3}),t("projectDetail.skills.clear")]}),c.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:[l.size,"/",o.skills.length]})]}),f&&c.jsxs("div",{className:"text-sm border-2 border-[var(--color-text)] rounded p-2 bg-[var(--color-bg-cream)]",children:[c.jsx("p",{children:t("projectDetail.skills.applied",{linked:String(f.applied.linked),pruned:String(f.applied.pruned)})}),f.unknown.length>0&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("projectDetail.skills.unknown",{names:f.unknown.join(", ")})})]})]})}function Bz({name:e}){var a;const t=Be(),n=Ye({queryKey:["rules",e],queryFn:()=>jz(e),enabled:!!e});if(n.isLoading)return c.jsx(o2,{});if(n.isError)return c.jsx(l2,{msg:n.error instanceof Error?n.error.message:String(n.error)});const r=((a=n.data)==null?void 0:a.data)??[];return c.jsxs("div",{className:"flex flex-col gap-4 min-h-full",children:[c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:t("projectDetail.rules.readonly")}),r.map(o=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:o.name}),!o.exists&&c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:t("projectDetail.rules.missing")})]}),o.exists&&c.jsx("pre",{className:"overflow-auto max-h-[28rem] text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-3",children:o.content})]},o.name))]})}const rp=e=>`/api/projects/${encodeURIComponent(e)}/graph`;function $z(e){return ft(`${rp(e)}/status`)}function Uz(e){return ft(`${rp(e)}/data`)}function Fz(e){return Li(`${rp(e)}/build`)}function qz(e){return Li(`${rp(e)}/sync`)}const Hz={typescript:"#1D4E89",tsx:"#2563EB",javascript:"#B8860B",json:"#6B7280",yaml:"#C2410C"},Cf=e=>Hz[e]??"#2D6A4F";function Sk(e){return[parseInt(e.slice(1,3),16),parseInt(e.slice(3,5),16),parseInt(e.slice(5,7),16)]}const Kz=e=>Math.max(8,Math.min(22,8+e*2.5));function Gz(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(0)} KB`:`${(e/1024/1024).toFixed(2)} MB`}function Vz(e){if(!e)return"—";const t=new Date(e);if(Number.isNaN(t.getTime()))return"—";const n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}`}function Yz({name:e,status:t}){var y,b,k,v;const n=Be(),r=Ye({queryKey:["graph-data",e],queryFn:()=>Uz(e)}),[a,o]=j.useState(""),l=j.useRef(null),d=j.useRef(null),f=j.useRef(null),h=j.useRef(null),g=[...new Set((((b=(y=r.data)==null?void 0:y.data)==null?void 0:b.nodes)??[]).map(N=>N.language))];if(j.useEffect(()=>{h.current&&(h.current.search=a.trim().toLowerCase())},[a]),j.useEffect(()=>{var De;const N=(De=r.data)==null?void 0:De.data,E=d.current,C=l.current;if(!N||!N.nodes.length||!E||!C)return;const S=E.getContext("2d");if(!S)return;const _={};for(const ce of N.links)_[ce.source]=(_[ce.source]??0)+1,_[ce.target]=(_[ce.target]??0)+1;const M=N.nodes.length,T=window.devicePixelRatio||1,L=C.getBoundingClientRect(),R=L.width||800,$=L.height||500,z=Math.min(R,$)*.35+M*1.5,q=N.nodes.map((ce,Ce)=>{const te=2*Math.PI*Ce/Math.max(M,1),pe=_[ce.id]??0;return{id:ce.id,language:ce.language,symbols:ce.symbols,deg:pe,name:ce.id.split("/").pop()||ce.id,x:Math.cos(te)*z+Math.sin(Ce*12.9898)*43758.5453%1*40,y:Math.sin(te)*z+Math.sin(Ce*78.233)*12345.678%1*40,vx:0,vy:0,r:Kz(pe)}}),F={};for(const ce of q)F[ce.id]=ce;const Y=N.links.map(ce=>({source:ce.source,target:ce.target,weight:ce.weight})),D={nodes:q,edges:Y,map:F,panX:R/2,panY:$/2,zoom:1,drag:null,mouseX:0,mouseY:0,raf:null,tick:0,quiet:0,sel:null,search:a.trim().toLowerCase(),fitted:!1};h.current=D;const H=()=>{const ce=C.getBoundingClientRect();E.width=ce.width*T,E.height=ce.height*T,E.style.width=ce.width+"px",E.style.height=ce.height+"px",S.setTransform(T,0,0,T,0,0)};H();const O=new ResizeObserver(H);O.observe(C);const V=()=>{let ce=1/0,Ce=1/0,te=-1/0,pe=-1/0;for(const be of q)ce=Math.min(ce,be.x-be.r),Ce=Math.min(Ce,be.y-be.r),te=Math.max(te,be.x+be.r),pe=Math.max(pe,be.y+be.r);const Fe=E.width/T,ze=E.height/T,ae=Math.min(Fe/Math.max(te-ce,1),ze/Math.max(pe-Ce,1),1.4)*.88;D.zoom=ae,D.panX=Fe/2-(ce+te)/2*ae,D.panY=ze/2-(Ce+pe)/2*ae},Q=()=>{const ce=q.length;D.tick++;const Ce=.9-Math.min(.4,D.tick/1500),te=ce>1e3?3e3:ce>100?2e3:ce>50?1200:800,pe=ce>100?.002:.005,Fe=ce>1e3?.012:ce>100?.005:.01,ze=ce>1e3?6:ce>200?12:24;for(let ye=0;ye<ce;ye++){const he=q[ye];let Ee=-he.x*Fe,Ne=-he.y*Fe;for(let Ke=0;Ke<ce;Ke++){if(ye===Ke)continue;const ne=q[Ke],de=he.x-ne.x,Le=he.y-ne.y,Ze=de*de+Le*Le||1,it=Math.sqrt(Ze),At=te/Ze;Ee+=de/it*At,Ne+=Le/it*At}if(he!==D.drag){let Ke=(he.vx+Ee)*Ce,ne=(he.vy+Ne)*Ce;Ke=Math.max(-ze,Math.min(ze,Ke)),ne=Math.max(-ze,Math.min(ze,ne)),he.vx=Ke,he.vy=ne}}for(const ye of Y){const he=F[ye.source],Ee=F[ye.target];if(!he||!Ee)continue;const Ne=Ee.x-he.x,Ke=Ee.y-he.y,ne=Math.sqrt(Ne*Ne+Ke*Ke)||1,de=(ne-100)*pe,Le=Ne/ne*de,Ze=Ke/ne*de;he!==D.drag&&(he.vx+=Le,he.vy+=Ze),Ee!==D.drag&&(Ee.vx-=Le,Ee.vy-=Ze)}let ae=0;for(const ye of q)ye!==D.drag&&(ye.x+=ye.vx,ye.y+=ye.vy,ae+=ye.vx*ye.vx+ye.vy*ye.vy);(ce?Math.sqrt(ae/ce):0)<.05&&D.tick>60&&!D.drag?D.quiet++:D.quiet=0,!D.fitted&&(D.quiet>8||D.tick>400)&&(D.fitted=!0,V())},K=()=>{const ce=E.width/T,Ce=E.height/T;S.clearRect(0,0,ce,Ce),S.strokeStyle="rgba(45,55,72,0.05)",S.lineWidth=.5;for(let be=0;be<ce;be+=24)S.beginPath(),S.moveTo(be,0),S.lineTo(be,Ce),S.stroke();for(let be=0;be<Ce;be+=24)S.beginPath(),S.moveTo(0,be),S.lineTo(ce,be),S.stroke();S.save(),S.translate(D.panX,D.panY),S.scale(D.zoom,D.zoom);const te=D.search,pe=q.length>40;let Fe=null;if(!D.drag){const be=E.getBoundingClientRect(),ye=(D.mouseX-be.left-D.panX)/D.zoom,he=(D.mouseY-be.top-D.panY)/D.zoom;for(let Ee=q.length-1;Ee>=0;Ee--){const Ne=q[Ee],Ke=Ne.x-ye,ne=Ne.y-he;if(Ke*Ke+ne*ne<Ne.r*Ne.r+25){Fe=Ne.id;break}}}const ze=D.sel||Fe;for(const be of Y){const ye=F[be.source],he=F[be.target];if(!ye||!he)continue;const Ee=te&&!(ye.name.toLowerCase().includes(te)||he.name.toLowerCase().includes(te)),Ne=ze&&(be.source===ze||be.target===ze),Ke=he.x-ye.x,ne=he.y-ye.y,de=Math.sqrt(Ke*Ke+ne*ne)||1,Le=pe?12:18,Ze=(ye.x+he.x)/2+-ne/de*Le,it=(ye.y+he.y)/2+Ke/de*Le,[At,$n,dn]=Sk(Cf(ye.language));let Mt;if(Ee?Mt=.05:ze&&Ne?Mt=.6:ze&&!Ne?Mt=.05:Mt=pe?.14:.24,S.beginPath(),S.moveTo(ye.x,ye.y),S.quadraticCurveTo(Ze,it,he.x,he.y),S.strokeStyle=`rgba(${At},${$n},${dn},${Mt})`,S.lineWidth=Ne?2+be.weight*.4:1+be.weight*.25,S.stroke(),!pe||Ne){const Qt=Math.atan2(he.y-it,he.x-Ze),yt=5+S.lineWidth;S.beginPath(),S.moveTo(he.x-he.r*Math.cos(Qt),he.y-he.r*Math.sin(Qt)),S.lineTo(he.x-(he.r+yt)*Math.cos(Qt-.3),he.y-(he.r+yt)*Math.sin(Qt-.3)),S.lineTo(he.x-(he.r+yt)*Math.cos(Qt+.3),he.y-(he.r+yt)*Math.sin(Qt+.3)),S.closePath(),S.fillStyle=`rgba(${At},${$n},${dn},${Ee?.05:Ne?.55:.18})`,S.fill()}}const ae=pe?1.5:.5;for(const be of q){const ye=Cf(be.language),he=D.sel===be.id,Ee=Fe===be.id,Ne=!te||be.name.toLowerCase().includes(te),Ke=ze&&be.id!==ze&&!Y.some(At=>At.source===ze&&At.target===be.id||At.target===ze&&At.source===be.id),ne=Ne?Ke?.2:1:.12;S.save(),S.globalAlpha=ne,Ne&&!Ke&&(he||Ee||!te)&&(S.shadowColor=ye,S.shadowBlur=he?20:Ee?16:pe?4:8);const[de,Le,Ze]=Sk(ye),it=S.createRadialGradient(be.x-be.r*.3,be.y-be.r*.3,0,be.x,be.y,be.r*1.2);if(it.addColorStop(0,`rgba(${Math.min(255,de+60)},${Math.min(255,Le+60)},${Math.min(255,Ze+60)},0.95)`),it.addColorStop(1,ye),S.beginPath(),S.arc(be.x,be.y,be.r,0,Math.PI*2),S.fillStyle=it,S.fill(),S.shadowBlur=0,S.lineWidth=he?2.5:1,S.strokeStyle=he?"#111827":"rgba(255,255,255,0.7)",S.stroke(),S.restore(),Ne&&!Ke&&(he||Ee||D.zoom>ae)){const At=1/D.zoom;S.save(),S.globalAlpha=ne,S.fillStyle="rgba(45,55,72,0.92)",S.font=`${(10*At).toFixed(1)}px 'DM Sans', sans-serif`,S.textAlign="center",S.fillText(be.name,be.x,be.y+be.r+11*At),S.restore()}}S.restore()},I=()=>{if(Q(),K(),D.quiet>40&&!D.drag){D.raf=null;return}D.raf=requestAnimationFrame(I)},P=()=>{D.raf==null&&(D.quiet=0,D.raf=requestAnimationFrame(I))};D.raf=requestAnimationFrame(I);let G=!1,B=0,oe=0;const ve=ce=>{const Ce=E.getBoundingClientRect();return{x:(ce.clientX-Ce.left-D.panX)/D.zoom,y:(ce.clientY-Ce.top-D.panY)/D.zoom}},ke=(ce,Ce)=>{for(let te=q.length-1;te>=0;te--){const pe=q[te];if(!pe)continue;const Fe=pe.x-ce,ze=pe.y-Ce;if(Fe*Fe+ze*ze<pe.r*pe.r+25)return pe}return null},Se=ce=>{const Ce=ve(ce),te=ke(Ce.x,Ce.y);te?D.drag=te:G=!0,B=ce.clientX,oe=ce.clientY,P()},J=ce=>{const Ce=ce.clientX-B,te=ce.clientY-oe;D.drag?(D.drag.x+=Ce/D.zoom,D.drag.y+=te/D.zoom,D.drag.vx=0,D.drag.vy=0,P()):G&&(D.panX+=Ce,D.panY+=te,P()),B=ce.clientX,oe=ce.clientY,D.mouseX=ce.clientX,D.mouseY=ce.clientY;const pe=f.current,Fe=ve(ce),ze=!D.drag&&!G?ke(Fe.x,Fe.y):null;if(pe)if(ze){const ae=Y.filter(ye=>ye.source===ze.id||ye.target===ze.id).length;pe.innerHTML=`<div style="font-weight:700;word-break:break-all">${ze.id}</div><div style="margin-top:4px;color:#64748b;font-family:var(--font-mono,monospace)"><span style="color:${Cf(ze.language)}">●</span> ${ze.language} · ${ze.symbols} symbols · ${ae} links</div>`;const be=E.getBoundingClientRect();pe.style.left=ce.clientX-be.left+14+"px",pe.style.top=ce.clientY-be.top+14+"px",pe.style.display="block",E.style.cursor="pointer"}else pe.style.display="none",E.style.cursor=D.drag||G?"grabbing":"grab";P()},ue=ce=>{D.drag&&!G?Math.abs(ce.clientX-B)>3||(D.sel=D.sel===D.drag.id?null:D.drag.id):G&&Math.abs(ce.clientX-B)<3&&Math.abs(ce.clientY-oe)<3&&(D.sel=null),D.drag=null,G=!1,P()},Te=ce=>{ce.preventDefault();const Ce=E.getBoundingClientRect(),te=ce.clientX-Ce.left,pe=ce.clientY-Ce.top,Fe=ce.deltaY>0?.9:1.1,ze=Math.max(.1,Math.min(5,D.zoom*Fe));D.panX=te-(te-D.panX)/D.zoom*ze,D.panY=pe-(pe-D.panY)/D.zoom*ze,D.zoom=ze,P()},Oe=()=>{f.current&&(f.current.style.display="none")};return E.addEventListener("mousedown",Se),window.addEventListener("mousemove",J),window.addEventListener("mouseup",ue),E.addEventListener("wheel",Te,{passive:!1}),E.addEventListener("mouseleave",Oe),()=>{D.raf!=null&&cancelAnimationFrame(D.raf),O.disconnect(),E.removeEventListener("mousedown",Se),window.removeEventListener("mousemove",J),window.removeEventListener("mouseup",ue),E.removeEventListener("wheel",Te),E.removeEventListener("mouseleave",Oe),h.current=null}},[r.data]),r.isLoading)return c.jsxs("div",{className:"nb-card flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," ",n("graph.viz.loading")]});if(!((v=(k=r.data)==null?void 0:k.data)!=null&&v.nodes.length))return c.jsx("div",{className:"nb-card text-sm text-[var(--color-text-muted)]",children:n("graph.viz.empty")});const m=[{label:n("graph.stat.files"),value:t.files.toLocaleString()},{label:n("graph.stat.nodes"),value:t.nodes.toLocaleString()},{label:n("graph.stat.edges"),value:t.edges.toLocaleString()},{label:n("graph.stat.db"),value:Gz(t.dbSizeBytes)},{label:n("graph.stat.lastBuilt"),value:Vz(t.lastIndexedAt)}];return c.jsxs("div",{ref:l,className:"relative w-full flex-1 min-h-[420px] nb-card p-0 overflow-hidden",style:{background:"var(--color-bg-cream)"},children:[c.jsx("canvas",{ref:d,className:"block absolute inset-0",style:{cursor:"grab"}}),c.jsx("div",{ref:f,className:"absolute z-40 pointer-events-none nb-card bg-[var(--color-bg)] px-3 py-2 text-xs max-w-xs",style:{display:"none"}}),c.jsxs("div",{className:"absolute top-3 right-3 w-52 flex flex-col gap-2 pointer-events-none",children:[c.jsxs("div",{className:"relative pointer-events-auto",children:[c.jsx(ho,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full text-sm",placeholder:n("graph.viz.search"),value:a,onChange:N=>o(N.target.value),"aria-label":n("graph.viz.search")})]}),c.jsxs("div",{className:"nb-card p-3 flex flex-col gap-1.5 pointer-events-auto bg-[var(--color-bg)]",children:[m.map(N=>c.jsxs("div",{className:"flex items-center justify-between gap-2 text-xs",children:[c.jsx("span",{className:"text-[var(--color-text-subtle)] shrink-0",children:N.label}),c.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)] text-right",children:N.value})]},N.label)),c.jsx("div",{className:"mt-1 pt-1.5 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex flex-wrap gap-x-2 gap-y-1",children:g.map(N=>c.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"inline-block w-2.5 h-2.5 rounded-full border-[1.5px] border-[var(--color-text)]",style:{background:Cf(N)}}),N]},N))})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-subtle)] text-right leading-tight pointer-events-none",children:n("graph.viz.hint")})]})]})}function Qz({name:e}){var m,y;const t=Be(),n=Gt(),r=Ye({queryKey:["graph-status",e],queryFn:()=>$z(e)}),a=()=>{n.invalidateQueries({queryKey:["graph-status",e]}),n.invalidateQueries({queryKey:["graph-data",e]})},o=Ct({mutationFn:()=>Fz(e),onSuccess:a}),l=Ct({mutationFn:()=>qz(e),onSuccess:a}),d=((m=r.data)==null?void 0:m.data)??null,f=o.isPending,h=l.isPending,g=f||h;return c.jsxs("div",{className:"flex flex-col gap-3 max-w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(YN,{size:20,strokeWidth:2.5,className:"shrink-0"}),c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold shrink-0",children:t("graph.title")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] truncate hidden sm:inline",children:t("graph.desc")})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[d&&c.jsxs("button",{className:"nb-btn shrink-0",onClick:()=>l.mutate(),disabled:g,type:"button",title:t("graph.sync.desc"),children:[h?c.jsx(Xe,{size:14,strokeWidth:2.5,className:"animate-spin"}):c.jsx(dL,{size:14,strokeWidth:2.5}),t(h?"graph.syncing":"graph.sync")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint shrink-0",onClick:()=>o.mutate(),disabled:g,type:"button",children:[f?c.jsx(Xe,{size:14,strokeWidth:2.5,className:"animate-spin"}):d?c.jsx(ya,{size:14,strokeWidth:2.5}):c.jsx(mL,{size:14,strokeWidth:2.5}),t(f?"graph.building":d?"graph.rebuild":"graph.build")]})]})]}),(o.isError||l.isError)&&c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)] text-sm shrink-0",children:[t("graph.buildFailed"),": ",((y=o.error||l.error)==null?void 0:y.message)??""]}),r.isLoading?c.jsxs("div",{className:"nb-card flex items-center gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,className:"animate-spin"})," ",t("graph.viz.loading")]}):d?c.jsx(Yz,{name:e,status:d}):c.jsx("div",{className:"nb-card text-sm text-[var(--color-text-muted)]",children:t("graph.empty")})]})}const Nk=["overview","config","pipelines","skills","rules","graph","logs","danger"];function Wz({name:e,embedded:t}={}){var b;const n=Be(),{name:r=""}=Mb(),a=e??r,o=ks(),[l]=BN(),[d,f]=Kb("projectDetail.tab","overview"),h=Nk.includes(d)?d:"overview",g=l.get("tab"),m=l.get("worker")??void 0;j.useEffect(()=>{g&&Nk.includes(g)&&f(g)},[g]);const y=Ye({queryKey:["project",a],queryFn:()=>$3(a),enabled:!!a});return c.jsxs("div",{className:"flex flex-col gap-4 w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center gap-3 shrink-0",children:[!t&&c.jsxs("button",{type:"button",onClick:()=>o("/projects"),className:"nb-btn",style:{padding:"6px 12px"},"aria-label":n("newProject.back.aria"),children:[c.jsx(UN,{size:14,strokeWidth:3}),n("newProject.back")]}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold flex-1 truncate",children:a})]}),c.jsxs("nav",{className:"flex items-center gap-2 flex-wrap shrink-0",children:[c.jsx(ts,{current:h,value:"overview",onSelect:f,icon:tL,children:n("projectDetail.tab.overview")}),c.jsx(ts,{current:h,value:"config",onSelect:f,icon:XN,children:n("projectDetail.tab.config")}),c.jsx(ts,{current:h,value:"pipelines",onSelect:f,icon:Ub,children:n("projectDetail.tab.pipelines")}),c.jsx(ts,{current:h,value:"skills",onSelect:f,icon:ZN,children:n("projectDetail.tab.skills")}),c.jsx(ts,{current:h,value:"rules",onSelect:f,icon:TR,children:n("projectDetail.tab.rules")}),c.jsx(ts,{current:h,value:"graph",onSelect:f,icon:YN,children:n("projectDetail.tab.graph")}),c.jsx(ts,{current:h,value:"logs",onSelect:f,icon:Bb,children:n("projectDetail.tab.logs")}),c.jsx(ts,{current:h,value:"danger",onSelect:f,icon:fi,children:n("projectDetail.tab.danger")}),c.jsx(vs,{to:`/board?project=${encodeURIComponent(a)}`,className:"nb-btn nb-btn-mint ml-auto",children:n("projectDetail.openBoard")})]}),c.jsxs("div",{className:"flex-1 min-h-0 overflow-y-auto pr-1 flex flex-col",children:[h==="overview"&&c.jsx(Xz,{name:a,data:y.data,loading:y.isLoading}),h==="config"&&c.jsx(Zz,{name:a}),h==="pipelines"&&c.jsx(Jz,{name:a}),h==="skills"&&c.jsx(Pz,{name:a}),h==="rules"&&c.jsx(Bz,{name:a}),h==="graph"&&c.jsx(Qz,{name:a}),h==="logs"&&c.jsx(lI,{project:a,initialWorker:h==="logs"?m:void 0}),h==="danger"&&c.jsx(e4,{name:a,repoDir:((b=y.data)==null?void 0:b.repoDir)??null})]})]})}function ts({current:e,value:t,onSelect:n,icon:r,children:a}){const o=e===t;return c.jsxs("button",{type:"button",onClick:()=>n(t),"aria-current":o?"page":void 0,className:["nb-btn",o?"nb-btn-primary":""].join(" "),style:{padding:"6px 14px",fontSize:13},children:[c.jsx(r,{size:13,strokeWidth:2.5}),a]})}function Xz({name:e,data:t,loading:n}){const r=Be();return n?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:r("common.loading")})}):t?c.jsx("div",{className:"nb-card",children:c.jsxs("dl",{className:"grid grid-cols-[160px_1fr] gap-y-3 text-sm",children:[c.jsx("dt",{className:"font-bold",children:r("projectDetail.overview.repoDir")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.repoDir??"—"}),c.jsx("dt",{className:"font-bold",children:r("projectDetail.overview.pmBackend")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pmBackend}),c.jsx("dt",{className:"font-bold",children:r("projectDetail.overview.agent")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.agentProvider}),c.jsx("dt",{className:"font-bold",children:r("projectDetail.overview.cards")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:r("projectDetail.overview.cards.value",{total:t.cards.total,inprogress:t.cards.inprogress,done:t.cards.done})}),c.jsx("dt",{className:"font-bold",children:r("projectDetail.overview.workers")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:r("projectDetail.overview.workers.value",{total:t.workers.total,active:t.workers.active})}),c.jsx("dt",{className:"font-bold",children:r("projectDetail.overview.pipeline")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pipelineStatus}),c.jsx("dt",{className:"font-bold",children:r("projectDetail.overview.lastActivity")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.lastActivityAt?new Date(t.lastActivityAt).toLocaleString():"—"})]})}):c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:r("projectDetail.overview.notFound",{name:e})})})}function Zz({name:e}){const t=Be(),n=Gt(),{alert:r}=un(),{data:a,isLoading:o,isError:l,error:d,refetch:f}=Ye({queryKey:["project-conf",e],queryFn:()=>F3(e)}),[h,g]=j.useState(null),[m,y]=j.useState(null);j.useEffect(()=>{a&&h===null&&(g(a.content),y(a.etag))},[a,h]);const b=h!==null&&a!==void 0&&h!==a.content,k=Ct({mutationFn:()=>{if(h===null||m===null)throw new Error("no draft");return q3(e,h,m)},onSuccess:v=>{y(v.etag),n.invalidateQueries({queryKey:["project-conf",e]}),n.invalidateQueries({queryKey:["project",e]})},onError:v=>{const N=v.status;r({title:t(N===409?"projectDetail.config.error.conflict.title":"projectDetail.config.error.save.title"),body:N===409?t("projectDetail.config.error.conflict.body"):v instanceof Error?v.message:String(v)})}});return o?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")})}):l?c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:t("projectDetail.config.error.load",{detail:d instanceof Error?d.message:String(d)})})}):c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:c.jsxs("code",{className:"font-[family-name:var(--font-mono)] text-sm bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:["~/.coral/projects/",e,"/conf"]})}),m&&c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] mt-1",children:["etag: ",m]})]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px"},onClick:()=>{g(null),f()},disabled:k.isPending,"aria-label":t("projectDetail.config.reload"),children:[c.jsx(ya,{size:13,strokeWidth:2.5}),t("projectDetail.config.reload")]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>k.mutate(),disabled:!b||k.isPending,"aria-label":t("projectDetail.config.saveAria"),children:[k.isPending?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):k.isSuccess&&!b?c.jsx(RR,{size:13,strokeWidth:3}):c.jsx(Ri,{size:13,strokeWidth:3}),t("projectDetail.config.save")]})]})]}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:480,resize:"vertical"},value:h??"",onChange:v=>g(v.target.value),spellCheck:!1,"aria-label":t("projectDetail.config.editorAria")}),b&&c.jsx("p",{className:"text-xs text-[var(--color-stuck)] mt-2 font-bold",children:t("projectDetail.config.confDirty")})]})}function Jz({name:e}){const t=Be(),n=Gt(),{confirm:r,alert:a}=un(),{data:o,isLoading:l}=Ye({queryKey:["project-pipelines",e],queryFn:()=>K3(e)}),[d,f]=j.useState(null),[h,g]=j.useState(!1),m=Ct({mutationFn:v=>G3(e,v),onSuccess:()=>n.invalidateQueries({queryKey:["project-pipelines",e]}),onError:v=>{a({title:t("projectDetail.pipelines.switch.error"),body:v instanceof Error?v.message:String(v)})}}),y=Ct({mutationFn:v=>W3(e,v),onSuccess:()=>n.invalidateQueries({queryKey:["project-pipelines",e]}),onError:v=>{a({title:t("projectDetail.pipelines.delete.error"),body:v instanceof Error?v.message:String(v)})}}),b=Ct({mutationFn:v=>Q3(e,v.name,v.template),onSuccess:v=>{n.invalidateQueries({queryKey:["project-pipelines",e]}),g(!1),f(v.name)},onError:v=>{a({title:t("projectDetail.pipelines.create.error"),body:v instanceof Error?v.message:String(v)})}});if(l)return c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")})});const k=[];o!=null&&o.active&&k.push({name:o.active,isActive:!0});for(const v of(o==null?void 0:o.available)??[])k.push({name:v.name,isActive:!1});return c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:t("projectDetail.pipelines.title")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>g(!0),disabled:b.isPending,"aria-label":t("projectDetail.pipelines.add"),children:[c.jsx(pr,{size:12,strokeWidth:3}),t("projectDetail.pipelines.add")]})]}),k.length===0?c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic p-4 border-2 border-dashed border-[var(--color-text)] rounded-lg text-center",children:t("projectDetail.pipelines.empty")}):c.jsx("ul",{className:"flex flex-col gap-2",children:k.map(v=>c.jsxs("li",{className:"flex items-center gap-3 p-3 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[c.jsx(Ub,{size:16,strokeWidth:2.5}),c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold flex-1",children:v.name}),v.isActive&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("projectDetail.pipelines.activeBadge")}),c.jsxs("div",{className:"flex gap-1",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>f(v.name),"aria-label":t("projectDetail.pipelines.editAria",{name:v.name}),children:[c.jsx(qh,{size:11,strokeWidth:2.5}),t("projectDetail.pipelines.edit")]}),!v.isActive&&c.jsxs(c.Fragment,{children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await r({title:t("projectDetail.pipelines.switch.confirm.title",{name:v.name}),body:t("projectDetail.pipelines.switch.confirm.body",{name:v.name}),confirm:t("projectDetail.pipelines.switch.confirm.button")})&&m.mutate(v.name)},disabled:m.isPending,"aria-label":t("projectDetail.pipelines.switchAria",{name:v.name}),children:t("projectDetail.pipelines.switch")}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{await r({title:t("projectDetail.pipelines.delete.confirm.title",{name:v.name}),body:t("projectDetail.pipelines.delete.confirm.body"),confirm:t("common.delete"),danger:!0})&&y.mutate(v.name)},disabled:y.isPending,"aria-label":t("projectDetail.pipelines.deleteAria",{name:v.name}),children:c.jsx(fi,{size:11,strokeWidth:2.5})})]})]})]},v.name))})]}),d&&c.jsx(Ez,{projectName:e,file:d,onClose:()=>f(null),onSaved:()=>{n.invalidateQueries({queryKey:["project-pipelines",e]})}}),h&&c.jsx(_z,{hasActive:!!(o!=null&&o.active),hasSample:!0,isPending:b.isPending,onCancel:()=>g(!1),onCreate:(v,N)=>b.mutate({name:v,template:N})})]})}function e4({name:e,repoDir:t}){const n=Be(),r=ks(),a=Gt(),{alert:o}=un(),[l,d]=j.useState(""),[f,h]=j.useState(!0),g=Ct({mutationFn:()=>H3(e,{includeClaudeDir:f}),onSuccess:v=>{a.invalidateQueries({queryKey:["projects"]});const N=v.claudeRemoved.filter(E=>E.ok).map(E=>E.path);o({title:n("projectDetail.danger.deleted.title"),body:N.length>0?n("projectDetail.danger.deleted.bodyWithList",{paths:N.join(`
|
|
602
|
-
`)}):n("projectDetail.danger.deleted.body")}).then(()=>r("/projects"))},onError:v=>{o({title:n("projectDetail.danger.error"),body:v instanceof Error?v.message:String(v)})}}),y=n("projectDetail.danger.body",{path:"__PATH__"}).split("__PATH__"),k=n("projectDetail.danger.confirmPrompt",{name:"__NAME__"}).split("__NAME__");return c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold mb-2 text-[var(--color-crashed)]",children:n("projectDetail.danger.title")}),c.jsxs("p",{className:"text-sm mb-4",children:[y[0],c.jsxs("code",{className:"font-[family-name:var(--font-mono)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-1.5 py-0.5 rounded",children:["~/.coral/projects/",e,"/"]}),y[1]]}),t&&c.jsxs("label",{className:"flex items-start gap-2 mb-4 p-3 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-lg cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:f,onChange:v=>h(v.target.checked),className:"mt-0.5"}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"text-sm font-bold",children:n("projectDetail.danger.includeClaude.label")}),c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[t,"/.claude/"]}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:n("projectDetail.danger.includeClaude.note")})]})]}),c.jsx("div",{className:"mb-4",children:c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsxs("span",{className:"text-sm font-bold",children:[k[0],c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-xs",children:e}),k[1]]}),c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:l,onChange:v=>d(v.target.value),placeholder:e})]})}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",disabled:l!==e||g.isPending,onClick:()=>g.mutate(),"aria-label":n("projectDetail.danger.deleteAria"),children:[g.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(fi,{size:14,strokeWidth:3}),n("projectDetail.danger.deleteButton")]})]})}function lx(){return ft("/api/providers")}function c2(e){const t=[];for(const n of e)for(const r of n.models)t.push({providerId:n.id,model:r,label:`${r} · ${n.name}`});return t}async function t4(e,t){const n=await fetch("/api/providers",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({kind:e,entry:t})});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json()}async function n4(e,t){const n=await fetch(`/api/providers/${e}/${encodeURIComponent(t)}`,{method:"DELETE"});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json()}function u2(e){const t=e?`?path=${encodeURIComponent(e)}`:"";return ft(`/api/fs/browse${t}`)}async function r4(e,t){const n=await fetch("/api/fs/mkdir",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({path:e,name:t})});if(!n.ok){const r=await n.text();throw new Error(`${n.status}: ${r}`)}return await n.json()}const d2=50*1024*1024;async function i4(e,t){if(t.size>d2)throw new Error(`文件超过 50 MB 上限(当前 ${(t.size/1024/1024).toFixed(2)} MB)`);const n=new FormData;n.append("sessionId",e),n.append("file",t,t.name);const r=await fetch("/api/fs/upload",{method:"POST",body:n});if(!r.ok){const a=await r.text();throw new Error(`${r.status}: ${a}`)}return await r.json()}function Yy(e,t){return`/api/fs/file?${new URLSearchParams({path:t,sessionId:e}).toString()}`}function cx({initialPath:e,onCancel:t,onSelect:n,title:r,mode:a="directory"}){var C,S,_;const o=Be(),{prompt:l,alert:d}=un(),f=r??o("dirPicker.title.default"),[h,g]=j.useState(e??null),[m,y]=j.useState(null),b=Ye({queryKey:["fs-browse",h],queryFn:()=>u2(h??void 0),staleTime:0,gcTime:0}),k=((C=b.data)==null?void 0:C.path)??h??"",v=((S=b.data)==null?void 0:S.parent)??null,N=((_=b.data)==null?void 0:_.home)??null,E=async()=>{var T;if(!k)return;const M=(T=await l({title:o("dirPicker.newDir"),body:o("dirPicker.newDir.prompt"),placeholder:o("dirPicker.newDir.placeholder"),confirm:o("dirPicker.newDir.create")}))==null?void 0:T.trim();if(M)try{const L=await r4(k,M);g(L.path)}catch(L){d({title:o("dirPicker.newDir.error.title"),body:L instanceof Error?L.message:String(L)})}};return j.useEffect(()=>{const M=T=>{T.key==="Escape"&&(T.preventDefault(),t())};return window.addEventListener("keydown",M),()=>window.removeEventListener("keydown",M)},[t]),c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(45,55,72,0.5)] p-4",role:"presentation",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-lg w-full p-5 flex flex-col",style:{maxHeight:"70vh"},role:"dialog","aria-modal":"true","aria-label":f,children:[c.jsxs("header",{className:"flex items-center justify-between mb-3 shrink-0",children:[c.jsx("div",{className:"flex items-center gap-2 min-w-0",children:c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-base truncate",children:f})}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded",onClick:t,"aria-label":o("dirPicker.close.aria"),children:c.jsx(Sn,{size:14,strokeWidth:3})})]}),c.jsxs("div",{className:"flex items-center gap-2 mb-3 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>v&&g(v),disabled:!v||b.isLoading,"aria-label":o("dirPicker.up.aria"),title:o("dirPicker.up.title"),children:c.jsx(FN,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>N&&g(N),disabled:!N||b.isLoading,"aria-label":o("dirPicker.home.aria"),title:o("dirPicker.home.title"),children:c.jsx(xL,{size:12,strokeWidth:3})}),c.jsx("button",{type:"button",className:"nb-btn flex-shrink-0",style:{padding:"4px 10px",fontSize:12},onClick:()=>void E(),disabled:!k||b.isLoading||b.isError,"aria-label":o("dirPicker.newDir.aria"),title:o("dirPicker.newDir.aria"),children:c.jsx(iL,{size:12,strokeWidth:3})}),c.jsx("div",{className:"flex-1 min-w-0 nb-input font-[family-name:var(--font-mono)] text-xs px-2 py-1.5 truncate",title:k,dir:"rtl",children:k||"..."})]}),c.jsxs("div",{className:"flex-1 overflow-y-auto border-2 border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)] min-h-0",children:[b.isLoading&&c.jsxs("div",{className:"flex items-center justify-center py-12 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:16,strokeWidth:3,className:"animate-spin mr-2"}),o("dirPicker.loading")]}),b.isError&&c.jsxs("div",{className:"p-4 text-sm text-[var(--color-crashed)]",children:[c.jsx("p",{className:"font-bold mb-1",children:o("dirPicker.error.title")}),c.jsx("p",{className:"text-xs font-[family-name:var(--font-mono)] break-all",children:b.error instanceof Error?b.error.message:String(b.error)})]}),b.data&&c.jsxs("ul",{className:"divide-y-2 divide-[var(--color-text)]/20",children:[b.data.entries.length===0&&c.jsx("li",{className:"p-4 text-xs text-[var(--color-text-subtle)] italic text-center",children:o("dirPicker.empty")}),b.data.entries.map(M=>{const T=(()=>{const $=k.endsWith("/")||k.endsWith("\\")?"":"/";return`${k}${$}${M.name}`})(),L=a==="file"&&m===T,R=M.isDirectory||a==="file";return c.jsx("li",{children:c.jsxs("button",{type:"button",className:["w-full flex items-center gap-2 px-3 py-2 text-left text-sm font-[family-name:var(--font-mono)]","disabled:opacity-50 disabled:cursor-not-allowed",L?"bg-[var(--color-accent-mint)] font-bold":"hover:bg-[var(--color-accent-mint)]"].join(" "),disabled:!R,onClick:()=>{M.isDirectory?(y(null),g(T)):a==="file"&&y(T)},onDoubleClick:()=>{a==="file"&&!M.isDirectory&&n(T)},title:M.isDirectory?o("dirPicker.enter.aria",{name:M.name}):a==="file"?o("dirPicker.pickFile.aria",{name:M.name}):o("dirPicker.fileLocked"),children:[M.isDirectory?c.jsx(ph,{size:14,strokeWidth:2.5,className:"flex-shrink-0 text-[var(--color-text)]"}):c.jsx("span",{className:"w-3.5 h-3.5 flex-shrink-0"}),c.jsx("span",{className:"truncate",children:M.name}),M.isDirectory&&c.jsx(Zl,{size:12,strokeWidth:2.5,className:"ml-auto flex-shrink-0 text-[var(--color-text-muted)]"})]})},M.name)})]})]}),c.jsxs("div",{className:"flex gap-2 justify-end pt-3 shrink-0",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:t,children:o("dirPicker.cancel")}),a==="file"?c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:()=>m&&n(m),disabled:!m||b.isLoading||b.isError,title:m??o("dirPicker.useFile.tooltip.empty"),children:[c.jsx(Eu,{size:14,strokeWidth:3}),o("dirPicker.useFile")]}):c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:()=>n(k),disabled:!k||b.isLoading||b.isError,children:[c.jsx(Eu,{size:14,strokeWidth:3}),o("dirPicker.useDir")]})]})]})})}function Af(e){return(e.replace(/\/+$/,"").split("/").pop()??"").replace(/[^a-zA-Z0-9_-]/g,"-").replace(/-+/g,"-").replace(/^-+|-+$/g,"")}function f2({onCancel:e,onCreated:t}={}){var z,q,F,Y,D,H;const n=Be(),r=ks(),a=Gt(),{alert:o}=un(),l=e??(()=>r("/projects")),[d,f]=j.useState({name:"",projectDir:"",enableGit:!0,createIfMissing:!0,mergeBranch:"main",maxWorkers:"1",ackTimeoutMin:"5",pipelineMode:"pipeline"}),h=d.pipelineMode==="smartArrange",g=Ye({queryKey:["system-agents"],queryFn:Hb}),m=((z=g.data)==null?void 0:z.agents.worker.model)??"",y=((q=g.data)==null?void 0:q.agents.reviewer.model)??"",b=[...new Set((((F=g.data)==null?void 0:F.providers.openai)??[]).flatMap(O=>O.models))],k=Ye({queryKey:["providers"],queryFn:lx}),v=c2(((Y=k.data)==null?void 0:Y.anthropic)??[]),N=d.workerModel?`${d.workerProviderId??""}::${d.workerModel}`:"",[E,C]=j.useState(!1),S=Ct({mutationFn:O=>U3(O),onSuccess:O=>{a.invalidateQueries({queryKey:["projects"]}),t?t(O.name):r(`/projects/${encodeURIComponent(O.name)}`)},onError:O=>{o({title:n("newProject.error.create.title"),body:O instanceof Error?O.message:String(O)})}}),_=/^[a-zA-Z0-9_-]+$/.test(d.name),M=_&&d.projectDir.trim()!==""&&!S.isPending,T=d.projectDir.trim(),L=Ye({queryKey:["fs-browse-probe",T],queryFn:()=>u2(T),enabled:T.startsWith("/"),staleTime:0,gcTime:0,retry:!1}),R=L.isSuccess&&(((D=L.data)==null?void 0:D.entries.length)??0)>0,$=L.isError||L.isSuccess&&(((H=L.data)==null?void 0:H.entries.length)??0)===0;return c.jsxs("div",{className:"w-full",children:[c.jsxs("div",{className:"nb-card flex flex-col gap-4",children:[c.jsxs("header",{className:"flex items-center gap-3",children:[c.jsxs("button",{type:"button",onClick:l,className:"nb-btn",style:{padding:"6px 12px"},"aria-label":n("newProject.back.aria"),children:[c.jsx(UN,{size:14,strokeWidth:3}),n("newProject.back")]}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:n("newProject.title")})]}),c.jsxs("form",{onSubmit:O=>{O.preventDefault(),M&&S.mutate(d)},className:"grid grid-cols-1 md:grid-cols-2 gap-x-6 gap-y-4",children:[c.jsx(Ur,{className:"md:col-span-2",label:n("newProject.field.mode"),hint:n(h?"newProject.field.mode.smartHint":"newProject.field.mode.pipelineHint"),children:c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:["pipeline","smartArrange"].map(O=>{const V=d.pipelineMode===O;return c.jsxs("button",{type:"button",onClick:()=>f({...d,pipelineMode:O}),"aria-pressed":V,className:["text-left rounded-xl border-2 p-3 transition-all",V?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:[c.jsx("div",{className:"text-sm font-bold",children:n(O==="pipeline"?"newProject.field.mode.pipeline":"newProject.field.mode.smart")}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:n(O==="pipeline"?"newProject.field.mode.pipelineDesc":"newProject.field.mode.smartDesc")})]},O)})})}),h&&c.jsx(Ur,{className:"md:col-span-2",label:n("newProject.field.goal"),hint:n("newProject.field.goal.hint"),children:c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",style:{minHeight:110,resize:"vertical"},placeholder:n("newProject.field.goal.placeholder"),value:d.goal??"",onChange:O=>f({...d,goal:O.target.value})})}),c.jsx(Ur,{label:"Worker 模型",hint:`默认:${m||"全局默认"}(留空用默认)`,children:c.jsxs("select",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:N,onChange:O=>{const V=O.target.value;if(!V)return f({...d,workerModel:void 0,workerProviderId:void 0});const[Q,K]=V.split("::");f({...d,workerModel:K,workerProviderId:Q||void 0})},children:[c.jsx("option",{value:"",children:"用全局默认模型"}),v.map(O=>c.jsx("option",{value:`${O.providerId}::${O.model}`,children:O.label},`${O.providerId}::${O.model}`))]})}),h&&c.jsxs(Ur,{label:"OpenAI Agent(监工)模型",hint:`默认:${y||"全局默认"}(留空用默认)`,children:[c.jsx("input",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",value:d.reviewerModel??"",onChange:O=>f({...d,reviewerModel:O.target.value}),placeholder:y,list:"np-reviewer-models",spellCheck:!1}),c.jsx("datalist",{id:"np-reviewer-models",children:b.map(O=>c.jsx("option",{value:O},O))})]}),c.jsxs(Ur,{label:n("newProject.field.name"),hint:n("newProject.field.name.derived"),children:[c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:n("newProject.field.name.placeholder"),value:d.name,onChange:O=>f({...d,name:O.target.value}),required:!0}),d.name&&!_&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)] mt-1",children:n("newProject.field.name.invalid")})]}),c.jsxs(Ur,{className:"md:col-span-2",label:n("newProject.field.dir"),hint:n("newProject.field.dir.long"),children:[c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{type:"text",className:"nb-input flex-1 font-[family-name:var(--font-mono)]",placeholder:n("newProject.field.dir.placeholder"),value:d.projectDir,onChange:O=>{const V=O.target.value,Q=Af(V),K=Af(d.projectDir),I=d.name&&d.name!==K;f({...d,projectDir:V,name:I?d.name:Q})},required:!0}),c.jsxs("button",{type:"button",className:"nb-btn flex-shrink-0",onClick:()=>C(!0),"aria-label":n("newProject.dir.browseAria"),title:n("newProject.dir.browseAria"),children:[c.jsx(KN,{size:14,strokeWidth:2.5}),n("newProject.dir.browse")]})]}),R&&c.jsx("p",{className:"text-xs mt-1.5 font-bold text-[var(--color-text)]",children:n("newProject.field.dir.adopt")}),$&&T.startsWith("/")&&c.jsx("p",{className:"text-xs mt-1.5 text-[var(--color-text-muted)]",children:n("newProject.field.dir.fresh")}),c.jsxs("label",{className:"flex items-center gap-2 mt-2 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:d.createIfMissing!==!1,onChange:O=>f({...d,createIfMissing:O.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:n("newProject.field.dir.createIfMissing")})]})]}),c.jsx(Ur,{label:n("newProject.field.maxWorkers.short"),children:c.jsx("input",{type:"number",min:"1",max:"8",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:d.maxWorkers,onChange:O=>f({...d,maxWorkers:O.target.value})})}),c.jsx(Ur,{label:n("newProject.field.ackTimeout.minutes"),hint:n("newProject.field.ackTimeout.minutes.help"),children:c.jsx("input",{type:"number",min:"1",max:"30",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:d.ackTimeoutMin??"5",onChange:O=>f({...d,ackTimeoutMin:O.target.value})})}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsxs("label",{className:"flex items-center gap-3 mb-2 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:d.enableReview??!1,onChange:O=>f({...d,enableReview:O.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-sm font-bold",children:n("newProject.field.review.label")})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:n("newProject.field.review.detail")})]}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsxs("label",{className:"flex items-center gap-3 mb-3 cursor-pointer select-none",children:[c.jsx("input",{type:"checkbox",checked:d.enableGit??!0,onChange:O=>f({...d,enableGit:O.target.checked}),className:"w-4 h-4 cursor-pointer"}),c.jsx("span",{className:"text-sm font-bold",children:n("newProject.field.git.label")})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-3",children:n("newProject.field.git.detail")}),d.enableGit!==!1&&c.jsxs("div",{className:"flex flex-col gap-4 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4",children:[c.jsx(Ur,{label:n("newProject.field.git.branch"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",value:d.mergeBranch??"main",onChange:O=>f({...d,mergeBranch:O.target.value})})}),c.jsx(Ur,{label:n("newProject.field.gitlabProject.label"),hint:n("newProject.field.gitlabProject.help2"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:n("newProject.field.gitlabProject.placeholder"),value:d.gitlabProject??"",onChange:O=>f({...d,gitlabProject:O.target.value})})}),d.gitlabProject&&c.jsx(Ur,{label:n("newProject.field.gitlabProjectId"),hint:n("newProject.field.gitlabProjectId.help"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:n("newProject.field.gitlabProjectId.placeholder"),value:d.gitlabProjectId??"",onChange:O=>f({...d,gitlabProjectId:O.target.value})})})]})]}),c.jsxs("div",{className:"md:col-span-2 pt-3 border-t-2 border-[var(--color-text)] border-dashed",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-3 text-[var(--color-text-muted)]",children:n("newProject.section.notifications")}),c.jsx(Ur,{label:n("newProject.field.matrixRoom.label"),hint:n("newProject.field.matrixRoom.help2"),children:c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-mono)]",placeholder:n("newProject.field.matrixRoom.placeholder"),value:d.matrixRoomId??"",onChange:O=>f({...d,matrixRoomId:O.target.value})})})]}),c.jsxs("div",{className:"md:col-span-2 flex gap-3 justify-end pt-3",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:l,disabled:S.isPending,children:n("common.cancel")}),c.jsx("button",{type:"submit",className:"nb-btn nb-btn-primary",disabled:!M,"aria-label":n("newProject.submit"),children:S.isPending?c.jsxs(c.Fragment,{children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}),n("newProject.creating")]}):c.jsxs(c.Fragment,{children:[c.jsx(pr,{size:14,strokeWidth:3}),n("common.create")]})})]})]})]}),E&&c.jsx(cx,{title:n("newProject.field.dir.pickerTitle"),initialPath:d.projectDir.trim()||void 0,onCancel:()=>C(!1),onSelect:O=>{const V=Af(O),Q=Af(d.projectDir),K=d.name&&d.name!==Q;f({...d,projectDir:O,name:K?d.name:V}),C(!1)}})]})}function Ur({label:e,hint:t,children:n,className:r}){return c.jsxs("label",{className:`flex flex-col gap-1.5 ${r??""}`,children:[c.jsx("span",{className:"text-sm font-bold",children:e}),n,t&&c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:t})]})}function a4({onClose:e,onCreated:t}){return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-4xl my-8",children:c.jsx(f2,{onCancel:e,onCreated:n=>{e(),t(n)}})})})}const _k="projects.last",s4=["activity","date","name"];function jk(){const e=Be(),t=ks(),{name:n}=Mb(),[r,a]=Kb("projects.sort","activity"),[o,l]=j.useState(!1),[d,f]=j.useState(!1),{data:h,isLoading:g,isError:m,error:y,refetch:b}=Ye({queryKey:["projects"],queryFn:Es}),k=M=>t(`/projects/${encodeURIComponent(M)}`),v=h?c_(h.data,r):[],N=r!=="name",{recent:E,older:C}=N?rI(v,M=>M.lastActivityAt):{recent:v,older:[]},S=o?C:C.filter(M=>M.name===n),_=C.length-S.length;return j.useEffect(()=>{if(n)try{localStorage.setItem(_k,n)}catch{}},[n]),j.useEffect(()=>{if(n||!h)return;let M=null;try{M=localStorage.getItem(_k)}catch{}M&&h.data.some(T=>T.name===M)&&t(`/projects/${encodeURIComponent(M)}`,{replace:!0})},[n,h,t]),c.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full",children:[m?c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-2",children:e("projects.load.failed")}),c.jsx("p",{className:"text-sm text-[var(--color-text)]",children:y instanceof Error?y.message:String(y)}),c.jsx("button",{className:"nb-btn mt-4",onClick:()=>b(),type:"button",children:e("common.retry")})]}):h&&h.data.length===0?c.jsx(u4,{onNew:()=>f(!0)}):c.jsxs("div",{className:"flex gap-5 flex-1 min-h-0",children:[c.jsxs("aside",{className:"w-80 shrink-0 flex flex-col min-h-0",children:[c.jsxs("div",{className:"shrink-0 flex flex-col gap-2 pb-3",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold truncate",children:e("projects.title")}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:h?e("projects.count",{count:h.data.length}):e("common.loading")})]}),c.jsxs("button",{className:"nb-btn nb-btn-primary shrink-0",type:"button",onClick:()=>f(!0),"aria-label":e("projects.new"),children:[c.jsx(pr,{size:16,strokeWidth:3}),e("projects.new")]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("div",{className:"inline-flex flex-1 border-[3px] border-[var(--color-text)] rounded-xl overflow-hidden shadow-[3px_3px_0_var(--color-text)]",role:"group","aria-label":e("projects.sort.label"),children:s4.map(M=>c.jsx("button",{type:"button","aria-pressed":r===M,onClick:()=>a(M),className:["flex-1 px-2 py-1.5 text-xs font-bold font-[family-name:var(--font-mono)] focus-visible:outline focus-visible:outline-2",r===M?"bg-[var(--color-accent-mint)]":"bg-[var(--color-bg)] hover:bg-[var(--color-bg-cream)]"].join(" "),children:e(`projects.sort.${M}`)},M))}),c.jsx("button",{className:"nb-btn nb-btn-yellow shrink-0",style:{padding:"6px 10px"},onClick:()=>b(),type:"button","aria-label":e("common.refresh"),children:c.jsx($h,{size:16,strokeWidth:2.5})})]})]}),c.jsx("ul",{className:"flex-1 min-h-0 overflow-y-auto flex flex-col gap-2 pr-1",children:g?c.jsx(c4,{}):c.jsxs(c.Fragment,{children:[[...E,...S].map(M=>c.jsx(o4,{project:M,selected:M.name===n,onClick:()=>k(M.name)},M.name)),(_>0||o&&C.length>0)&&c.jsx("button",{type:"button",className:"nb-btn text-xs self-start mt-1",onClick:()=>l(M=>!M),"aria-label":o?"收起更早项目":"显示更早项目",children:o?"收起更早":`含更早 (${_})`})]})})]}),c.jsx("div",{className:"flex-1 min-w-0 min-h-0 flex flex-col",children:n?c.jsx(Wz,{name:n,embedded:!0}):c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("projects.selectHint")})})})]}),d&&c.jsx(a4,{onClose:()=>f(!1),onCreated:k})]})}function o4({project:e,selected:t,onClick:n}){return c.jsx("li",{children:c.jsxs("button",{type:"button",onClick:n,className:`nb-card w-full text-left ${t?"bg-[var(--color-accent-mint)]":""}`,style:{padding:"10px 12px"},children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold truncate",children:e.name}),c.jsx(l4,{status:e.pipelineStatus})]}),e.repoDir&&c.jsx("p",{className:"text-[10px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] truncate mt-0.5",children:e.repoDir}),c.jsxs("div",{className:"flex gap-3 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] mt-1.5",children:[c.jsxs("span",{children:[e.cards.total," cards"]}),c.jsxs("span",{children:[e.cards.inprogress," run"]}),c.jsxs("span",{children:[e.workers.active,"/",e.workers.total," w"]})]})]})})}function l4({status:e}){const t={running:{bg:"var(--color-running-bg)",label:"running"},idle:{bg:"var(--color-idle-bg)",label:"idle"},stopping:{bg:"var(--color-stuck-bg)",label:"stopping"},error:{bg:"var(--color-crashed-bg)",label:"error"}},{bg:n,label:r}=t[e],a=e==="running"?"var(--color-running)":e==="error"?"var(--color-crashed)":e==="stopping"?"var(--color-stuck)":"var(--color-idle)";return c.jsx("span",{className:"nb-status",style:{background:n,color:a},children:r})}function c4(){return c.jsx(c.Fragment,{children:[0,1,2].map(e=>c.jsxs("div",{className:"nb-card opacity-60 animate-pulse",style:{padding:"10px 12px"},children:[c.jsx("div",{className:"h-5 w-28 bg-[var(--color-border-light)] rounded-md mb-2"}),c.jsx("div",{className:"h-3 w-2/3 bg-[var(--color-border-light)] rounded-md"})]},e))})}function u4({onNew:e}){const t=Be(),n=t("projects.empty.hint",{cmd:"__CMD__"}),[r,a]=n.split("__CMD__");return c.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] flex items-center gap-6 p-8",children:[c.jsx("div",{className:"w-20 h-20 rounded-2xl bg-[var(--color-accent-mint)] border-[3px] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] flex items-center justify-center",children:c.jsx(n_,{size:32,strokeWidth:2.5})}),c.jsxs("div",{className:"flex-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:t("projects.empty.title")}),c.jsxs("p",{className:"text-sm text-[var(--color-text)] mb-4",children:[r,c.jsx("code",{className:"bg-[var(--color-bg)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded-md font-[family-name:var(--font-mono)]",children:"sps project init <name>"}),a]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:e,children:[c.jsx(pr,{size:16,strokeWidth:3}),t("projects.new")]})]})]})}function d4({project:e,isPending:t,onCancel:n,onCreate:r}){var S;const a=Be(),[o,l]=j.useState(""),[d,f]=j.useState(""),[h,g]=j.useState(new Set),[m,y]=j.useState(!1),b=Ye({queryKey:["skills-all",e],queryFn:()=>ox(e)});j.useEffect(()=>{const _=M=>{M.key==="Escape"&&n()};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[n]);const v=o.trim().length>0&&o.trim().length<=200&&!t,N=_=>{const M=new Set(h);M.has(_)?M.delete(_):M.add(_),g(M)},E=()=>{v&&r({title:o.trim(),description:d.trim(),skills:[...h],labels:["AI-PIPELINE"],initialState:m?"Backlog":"Planning"})},C=((S=b.data)==null?void 0:S.data)??[];return c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-xl flex flex-col",style:{maxHeight:"calc(100vh - 64px)"},children:[c.jsxs("header",{className:"flex items-center justify-between mb-4 flex-shrink-0",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold",children:a("newCard.title")}),c.jsx("button",{className:"nb-btn nb-btn-mint p-2",onClick:n,type:"button","aria-label":a("common.close"),children:c.jsx(Sn,{size:14,strokeWidth:3})})]}),c.jsxs("form",{onSubmit:_=>{_.preventDefault(),E()},className:"flex flex-col gap-4 overflow-auto",children:[c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.title")}),c.jsx("input",{type:"text",className:"nb-input w-full",placeholder:a("newCard.field.title.placeholder"),value:o,onChange:_=>l(_.target.value),maxLength:200,autoFocus:!0,required:!0}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.title.help")})]}),c.jsxs("label",{className:"flex flex-col gap-1.5",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.description")}),c.jsx("textarea",{className:"nb-input w-full",style:{minHeight:120,resize:"vertical"},placeholder:a("newCard.field.description.placeholder"),value:d,onChange:_=>f(_.target.value)}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.description.help")})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.skills")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.skills.help")}),b.isLoading&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("newCard.field.skills.loading")}),b.isError&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)]",children:a("newCard.field.skills.error",{detail:b.error instanceof Error?b.error.message:String(b.error)})}),C.length>0&&c.jsx("div",{className:"flex flex-wrap gap-2",children:C.map(_=>{const M=h.has(_.name);return c.jsx("button",{type:"button",onClick:()=>N(_.name),className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",M?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),"aria-pressed":M,children:_.name},_.name)})}),h.size>0&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:a("newCard.field.skills.selected",{count:h.size,names:[...h].join(", ")})})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("span",{className:"text-sm font-bold",children:a("newCard.field.dispatch")}),c.jsxs("label",{className:"flex items-center gap-3 cursor-pointer select-none p-3 border-[2px] border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)]",children:[c.jsx("input",{type:"checkbox",className:"w-4 h-4 accent-[var(--color-cta)] cursor-pointer",checked:m,onChange:_=>y(_.target.checked)}),c.jsxs("div",{className:"flex-1",children:[c.jsx("div",{className:"text-sm font-bold",children:a("newCard.field.dispatch.label")}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-0.5",children:a("newCard.field.dispatch.help")})]})]})]})]}),c.jsxs("div",{className:"flex gap-2 justify-end mt-4 pt-3 border-t-2 border-dashed border-[var(--color-text)] flex-shrink-0",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},onClick:n,disabled:t,type:"button",children:a("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 14px"},onClick:E,disabled:!v,type:"button","aria-label":a("newCard.create.aria"),children:[t?c.jsx(Xe,{size:13,strokeWidth:3,className:"animate-spin"}):c.jsx(pr,{size:13,strokeWidth:3}),a("common.create")]})]})]})})}function f4(e){return ft(`/api/projects/${encodeURIComponent(e)}/cards`)}function h4(e,t){return ft(`/api/projects/${encodeURIComponent(e)}/cards/${t}`)}async function ac(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok){const r=await n.text();throw new Error(`${n.status} ${n.statusText}: ${r}`)}return n.json().catch(()=>({}))}function p4(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/cards/${t}/reset`)}async function m4(e,t){const n=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"DELETE"});if(!n.ok){const r=await n.text();throw new Error(`${n.status}: ${r}`)}}function g4(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/cards/${t}/launch`)}function y4(e,t){const n=typeof t=="string"?{title:t}:t;return ac(`/api/projects/${encodeURIComponent(e)}/cards`,n)}async function b4(e,t,n){const r=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:n})});if(!r.ok){const a=await r.text();throw new Error(`${r.status}: ${a}`)}}async function x4(e,t,n){const r=await fetch(`/api/projects/${encodeURIComponent(e)}/cards/${t}`,{method:"PATCH",headers:{"Content-Type":"application/json"},body:JSON.stringify(n)});if(!r.ok){const a=await r.text();throw new Error(`${r.status}: ${a}`)}return r.json()}function h2(e){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/start`)}function p2(e){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/stop`)}function v4(e,t){return ac(`/api/projects/${encodeURIComponent(e)}/pipeline/reset`,t??{})}function w4(e){const t=Gt();j.useEffect(()=>{if(!e)return;const n=`/stream/projects/${encodeURIComponent(e)}`,r=new EventSource(n),a=d=>{try{const f=JSON.parse(d.data);t.invalidateQueries({queryKey:["cards",f.project]}),t.invalidateQueries({queryKey:["card",f.project,f.seq]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},o=d=>{try{const f=JSON.parse(d.data);t.invalidateQueries({queryKey:["workers",f.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}},l=d=>{try{const f=JSON.parse(d.data);t.invalidateQueries({queryKey:["pipeline-status",f.project]}),t.invalidateQueries({queryKey:["projects"]})}catch{}};return r.addEventListener("card.created",a),r.addEventListener("card.updated",a),r.addEventListener("card.moved",a),r.addEventListener("card.deleted",a),r.addEventListener("worker.updated",o),r.addEventListener("worker.added",o),r.addEventListener("worker.deleted",o),r.addEventListener("pipeline.status",l),r.addEventListener("pipeline.started",l),r.addEventListener("pipeline.stopped",l),()=>r.close()},[e,t])}const k4=new Set(["python","typescript","golang","rust","kotlin","swift","java"]),E4=new Set(["frontend","backend","mobile","database","devops"]),S4=new Set(["backend-architect","frontend-developer","code-reviewer","database-optimizer","devops-automator","security-engineer","qa-tester","security","qa","architect","db-opt"]),N4=new Set(["coding-standards","tdd-workflow","git-workflow","architecture-decision-records","debugging-workflow"]);function _4(e){return k4.has(e)?"lang":E4.has(e)?"end":S4.has(e)?"persona":N4.has(e)?"workflow":"other"}const j4={lang:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg)"};function ux({name:e}){const t=j4[_4(e)];return c.jsx("span",{className:"nb-badge",style:{background:t},children:e})}function m2({label:e,kind:t="default"}){const n=t==="warn"?"var(--color-accent-pink)":t==="accent"?"var(--color-accent-yellow)":"var(--color-bg-cream)";return c.jsx("span",{className:"nb-badge",style:{background:n},children:e})}function C4({card:e,onClick:t,done:n,draggable:r}){const a=Be(),o=e.labels.some(l=>l.startsWith("STARTED-"))&&!n;return c.jsxs("article",{onClick:t,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),t())},draggable:r,onDragStart:l=>{l.dataTransfer.setData("application/x-sps-card-seq",String(e.seq)),l.dataTransfer.effectAllowed="move"},tabIndex:0,role:"button","aria-label":`Card #${e.seq}: ${e.title}`,className:["bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl p-3","shadow-[3px_3px_0_var(--color-text)] cursor-pointer","transition-[transform,box-shadow] duration-[180ms] ease-out","hover:-translate-x-0.5 hover:-translate-y-0.5 hover:shadow-[5px_5px_0_var(--color-text)]","focus:outline-none focus-visible:ring-[3px] focus-visible:ring-offset-2 focus-visible:ring-[var(--color-text)]",n?"opacity-60":"",r?"active:cursor-grabbing":""].join(" "),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2 mb-2",children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-[11px] px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),o&&c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:"running"})]}),c.jsx("p",{className:`font-bold text-sm leading-5 mb-2 line-clamp-2 ${n?"line-through decoration-2":""}`,children:e.title}),(e.skills.length>0||e.labels.length>0)&&c.jsxs("div",{className:"flex flex-wrap gap-1 mb-2",children:[e.skills.slice(0,3).map(l=>c.jsx(ux,{name:l},l)),e.labels.filter(l=>l==="NEEDS-FIX").map(l=>c.jsx(m2,{label:l,kind:"warn"},l))]}),e.checklist&&e.checklist.total>0&&c.jsx(A4,{stats:e.checklist}),c.jsxs("div",{className:"pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)] flex items-center gap-2 text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-subtle)]",children:[c.jsx("span",{children:T4(e.updatedAt??e.createdAt,a)}),e.branch&&c.jsxs("span",{className:"truncate",children:["· ",e.branch]})]})]})}function A4({stats:e}){const t=Be();return c.jsxs("div",{className:"mb-2",children:[c.jsxs("div",{className:"flex items-center justify-between text-[11px] font-[family-name:var(--font-mono)] mb-1",children:[c.jsx("span",{className:"font-bold",children:t("kanban.checklist.label",{done:e.done,total:e.total})}),c.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[e.percent,"%"]})]}),c.jsx("div",{className:"w-full h-1.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full overflow-hidden mb-1.5",children:c.jsx("div",{className:"h-full bg-[var(--color-cta)] transition-[width] duration-200",style:{width:`${e.percent}%`}})}),c.jsxs("ul",{className:"text-[11px] space-y-0.5",children:[e.items.slice(0,3).map((n,r)=>c.jsxs("li",{className:`flex items-start gap-1 ${n.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{className:"flex-shrink-0 mt-0.5",children:n.done?"✓":"○"}),c.jsx("span",{className:"line-clamp-1",children:n.text})]},r)),e.items.length>3&&c.jsx("li",{className:"text-[var(--color-text-subtle)] italic pl-3",children:t("kanban.checklist.more",{count:e.items.length-3})})]})]})}function T4(e,t){if(!e)return"—";const n=new Date(e),r=Date.now()-n.getTime();return r<6e4?t("kanban.time.justNow"):r<36e5?t("kanban.time.minutes",{n:Math.floor(r/6e4)}):r<864e5?t("kanban.time.hours",{n:Math.floor(r/36e5)}):n.toLocaleDateString()}function M4({label:e,bg:t,cards:n,onCardClick:r,onDropCard:a}){const o=Be(),[l,d]=j.useState(!1);return c.jsxs("div",{className:["flex flex-col p-3 rounded-2xl border-[3px] min-h-[280px] h-full min-h-0 overflow-hidden","transition-all",l?"border-[var(--color-cta)] shadow-[4px_4px_0_var(--color-cta)]":"border-[var(--color-text)]"].join(" "),style:{background:t},onDragOver:f=>{!a||!f.dataTransfer.types.includes("application/x-sps-card-seq")||(f.preventDefault(),f.dataTransfer.dropEffect="move",l||d(!0))},onDragLeave:()=>d(!1),onDrop:f=>{if(d(!1),!a)return;const h=f.dataTransfer.getData("application/x-sps-card-seq"),g=Number.parseInt(h,10);Number.isFinite(g)&&(f.preventDefault(),a(g))},children:[c.jsxs("div",{className:"flex items-center justify-between px-1 pb-2 mb-2 border-b-2 border-[var(--color-text)] shrink-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-sm uppercase tracking-wider",children:e}),c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full",children:n.length})]}),c.jsxs("div",{className:"flex flex-col gap-2 flex-1 min-h-0 overflow-y-auto pr-1 -mr-1",style:{scrollbarWidth:"thin",scrollbarColor:"var(--color-text) transparent"},children:[n.length===0&&c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] text-center py-6 italic",children:o("kanban.column.empty")}),n.map(f=>c.jsx(C4,{card:f,onClick:()=>r(f),done:e==="Done",draggable:!!a},f.seq))]})]})}function Qy(e,t){if(!e)return"";const n=e.split(`
|
|
603
|
-
`),r=new RegExp(`^##\\s+${t}\\s*$`),a=n.findIndex(l=>r.test(l));if(a===-1)return"";let o=n.length;for(let l=a+1;l<n.length;l++)if(/^##\s+/.test(n[l]??"")){o=l;break}return n.slice(a+1,o).join(`
|
|
604
|
-
`).trim()}function $g(e){return Qy(e,"描述")}function D4({project:e,seq:t,onClose:n,onChanged:r}){var V,Q,K,I,P,G,B,oe,ve,ke,Se;const a=Be(),o=Gt(),{confirm:l,alert:d}=un(),{data:f,isLoading:h,isError:g,error:m,refetch:y}=Ye({queryKey:["card",e,t],queryFn:()=>h4(e,t)}),[b,k]=j.useState(!1),[v,N]=j.useState(""),[E,C]=j.useState(""),[S,_]=j.useState(new Set),[M,T]=j.useState([]),[L,R]=j.useState(""),$=Ye({queryKey:["skills-all",e],queryFn:()=>ox(e),enabled:b}),q=((Q=(V=Ye({queryKey:["projects"],queryFn:Es,refetchInterval:1e4}).data)==null?void 0:V.data.find(J=>J.name===e))==null?void 0:Q.pipelineStatus)==="running";j.useEffect(()=>{b&&f&&(N(f.title),C($g(f.body)),_(new Set(f.skills)),T([...f.labels]))},[b,f]),j.useEffect(()=>{const J=ue=>{ue.key==="Escape"&&(b?k(!1):n())};return window.addEventListener("keydown",J),()=>window.removeEventListener("keydown",J)},[n,b]);const F=Ct({mutationFn:()=>{if(!f)throw new Error("no data");const J={},ue=v.trim();ue&&ue!==f.title&&(J.title=ue);const Te=$g(f.body);E!==Te&&(J.description=E);const Oe=[...S].sort(),De=[...f.skills].sort();return JSON.stringify(Oe)!==JSON.stringify(De)&&(J.skills=Oe),JSON.stringify(M)!==JSON.stringify(f.labels)&&(J.labels=M),Object.keys(J).length===0?Promise.resolve({ok:!0,noop:!0}):x4(e,t,J)},onSuccess:()=>{o.invalidateQueries({queryKey:["card",e,t]}),o.invalidateQueries({queryKey:["cards",e]}),k(!1),r()},onError:J=>{d({title:a("cardModal.error.save.title"),body:J instanceof Error?J.message:String(J)})}}),Y=j.useMemo(()=>{if(!b||!f)return!1;if(v.trim()!==f.title||E!==$g(f.body))return!0;const J=[...S].sort(),ue=[...f.skills].sort();return JSON.stringify(J)!==JSON.stringify(ue)||JSON.stringify(M)!==JSON.stringify(f.labels)},[b,f,v,E,S,M]),D=J=>{const ue=new Set(S);ue.has(J)?ue.delete(J):ue.add(J),_(ue)},H=()=>{const J=L.trim();if(J){if(M.includes(J)){R("");return}T([...M,J]),R("")}},O=J=>{T(M.filter(ue=>ue!==J))};return c.jsx("div",{role:"dialog","aria-modal":"true","aria-labelledby":"card-modal-title",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-12 w-full max-w-3xl bg-[var(--color-bg)]",children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",t]}),(f==null?void 0:f.state)&&c.jsx("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:f.state}),b&&c.jsx("span",{className:"text-xs font-bold text-[var(--color-stuck)]",children:a("cardModal.editing")})]}),b?c.jsx("input",{type:"text",className:"nb-input w-full font-[family-name:var(--font-heading)] text-xl font-bold",value:v,onChange:J=>N(J.target.value),maxLength:200,"aria-label":a("cardModal.title.aria")}):c.jsx("h2",{id:"card-modal-title",className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:(f==null?void 0:f.title)??a("common.loading")})]}),c.jsxs("div",{className:"flex gap-2 flex-shrink-0",children:[!b&&f&&c.jsxs("button",{onClick:()=>k(!0),className:"nb-btn",style:{padding:"6px 12px"},type:"button","aria-label":a("cardModal.editAria"),children:[c.jsx(qh,{size:12,strokeWidth:2.5})," ",a("cardModal.edit")]}),c.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2","aria-label":a("cardModal.close.aria"),type:"button",children:c.jsx(Sn,{size:14,strokeWidth:3})})]})]}),h&&c.jsx("p",{className:"text-[var(--color-text-muted)]",children:a("common.loading")}),g&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:a("cardModal.error.load",{detail:m instanceof Error?m.message:String(m)})}),f&&c.jsxs("div",{className:"flex flex-col gap-4",children:[f.branch&&!b&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(cL,{size:14}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:f.branch})]}),b?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),$.isLoading&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("cardModal.skills.loading")}),$.data&&$.data.data.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:$.data.data.map(J=>{const ue=S.has(J.name);return c.jsx("button",{type:"button",onClick:()=>D(J.name),"aria-pressed":ue,className:["px-2.5 py-1 text-xs font-[family-name:var(--font-mono)] rounded-full border-2 transition-all",ue?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)] font-bold":"bg-[var(--color-bg)] border-[var(--color-border-light)] hover:border-[var(--color-text)]"].join(" "),children:J.name},J.name)})})]}),c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),c.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[M.map(J=>c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] rounded-full",children:[J,c.jsx("button",{type:"button",onClick:()=>O(J),className:"hover:text-[var(--color-crashed)]","aria-label":a("cardModal.label.removeAria",{label:J}),children:c.jsx(Sn,{size:10,strokeWidth:3})})]},J)),c.jsx("input",{type:"text",className:"nb-input",style:{padding:"4px 8px",fontSize:12,width:140},placeholder:a("cardModal.label.addPlaceholder"),value:L,onChange:J=>R(J.target.value),onKeyDown:J=>{J.key==="Enter"&&!J.nativeEvent.isComposing&&(J.preventDefault(),H())}}),L&&c.jsx("button",{type:"button",className:"nb-btn",style:{padding:"2px 6px",fontSize:11},onClick:H,"aria-label":a("cardModal.label.addAria"),children:c.jsx(pr,{size:10,strokeWidth:3})})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:a("cardModal.label.note")})]})]}):c.jsxs(c.Fragment,{children:[f.skills.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Skills"}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.skills.map(J=>c.jsx(ux,{name:J},J))})]}),f.labels.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:"Labels"}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:f.labels.map(J=>c.jsx(m2,{label:J,kind:J==="NEEDS-FIX"?"warn":"default"},J))})]})]}),b?c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:a("cardModal.section.description")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:180,resize:"vertical"},value:E,onChange:J=>C(J.target.value),"aria-label":a("cardModal.body.aria")}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] mt-1",children:a("cardModal.body.replaceNote")})]}),(((oe=f.checklist)==null?void 0:oe.total)??0)>0&&c.jsxs("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:[c.jsx("div",{className:"flex items-center justify-between mb-2",children:c.jsxs("span",{className:"font-bold text-sm",children:[a("cardModal.section.checklist")," ",((ve=f.checklist)==null?void 0:ve.done)??0,"/",((ke=f.checklist)==null?void 0:ke.total)??0]})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((Se=f.checklist)==null?void 0:Se.items)??[]).map((J,ue)=>c.jsxs("li",{className:`flex items-start gap-2 ${J.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:J.done?"✓":"○"}),c.jsx("span",{children:J.text})]},ue))})]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:a("cardModal.section.description")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:Qy(f.body,"描述")||a("cardModal.section.empty")})]}),c.jsxs("div",{children:[c.jsxs("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:[a("cardModal.section.checklist")," ",c.jsxs("span",{className:"text-[var(--color-text-muted)] normal-case tracking-normal",children:[((K=f.checklist)==null?void 0:K.done)??0,"/",((I=f.checklist)==null?void 0:I.total)??0]})]}),c.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)] p-3",children:(((P=f.checklist)==null?void 0:P.total)??0)>0?c.jsxs(c.Fragment,{children:[c.jsx("div",{className:"flex items-center justify-end mb-2",children:c.jsx("div",{className:"w-24 h-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-full overflow-hidden",children:c.jsx("div",{className:"h-full bg-[var(--color-cta)]",style:{width:`${((G=f.checklist)==null?void 0:G.percent)??0}%`}})})}),c.jsx("ul",{className:"text-sm space-y-1",children:(((B=f.checklist)==null?void 0:B.items)??[]).map((J,ue)=>c.jsxs("li",{className:`flex items-start gap-2 ${J.done?"opacity-60 line-through":""}`,children:[c.jsx("span",{children:J.done?"✓":"○"}),c.jsx("span",{children:J.text})]},ue))})]}):c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:a("cardModal.checklist.empty")})})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:a("cardModal.section.log")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-64 overflow-auto",children:Qy(f.body,"日志")||a("cardModal.section.empty")})]})]}),c.jsx("div",{className:"flex gap-2 pt-2 border-t-2 border-[var(--color-border-light)] justify-end flex-wrap",children:b?c.jsxs(c.Fragment,{children:[c.jsx("button",{className:"nb-btn",type:"button",onClick:()=>{k(!1),y()},disabled:F.isPending,children:a("common.cancel")}),c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",onClick:()=>F.mutate(),disabled:!Y||!v.trim()||F.isPending,"aria-label":a("cardDetail.save"),children:[F.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Ri,{size:14,strokeWidth:3}),a("common.save")]})]}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"nb-btn nb-btn-primary",type:"button",disabled:f.state==="Done"||q,title:f.state==="Done"?a("cardModal.action.launch.disabledDone"):q?a("cardModal.action.launch.disabledRunning"):void 0,onClick:async()=>{try{await g4(e,t),r()}catch(J){d({title:a("cardModal.action.launch.error"),body:J instanceof Error?J.message:String(J)})}},children:[c.jsx(Yu,{size:14,strokeWidth:3}),a("cardModal.action.launch")]}),c.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{if(await l({title:a("cardModal.action.reset.confirm.title",{seq:t}),body:a("cardModal.action.reset.confirm.body"),confirm:a("cardModal.action.reset.confirm.button"),danger:!0}))try{await p4(e,t),r(),n()}catch(ue){d({title:a("cardModal.action.reset.error"),body:ue instanceof Error?ue.message:String(ue)})}},children:[c.jsx(Pb,{size:14,strokeWidth:2.5}),a("cardModal.action.reset")]}),c.jsxs("button",{className:"nb-btn",style:{background:"var(--color-crashed)",color:"var(--color-bg)"},type:"button",onClick:async()=>{if(!(!await l({title:a("cardModal.action.delete.confirm1.title",{seq:t}),body:a("cardModal.action.delete.confirm1.body",{title:f.title}),confirm:a("cardModal.action.delete.confirm1.button"),danger:!0})||!await l({title:a("cardModal.action.delete.confirm2.title"),body:a("cardModal.action.delete.confirm2.body",{seq:t}),confirm:a("cardModal.action.delete"),danger:!0})))try{await m4(e,t),r(),n()}catch(Te){d({title:a("projectDetail.pipelines.delete.error"),body:Te instanceof Error?Te.message:String(Te)})}},"aria-label":a("cardModal.action.delete"),children:[c.jsx(fi,{size:14,strokeWidth:2.5}),a("cardModal.action.delete")]})]})})]})]})})}function O4({current:e,onChange:t}){const[n,r]=j.useState(!1),a=j.useRef(null),{data:o}=Ye({queryKey:["projects"],queryFn:Es});return j.useEffect(()=>{const l=d=>{var f;(f=a.current)!=null&&f.contains(d.target)||r(!1)};return document.addEventListener("mousedown",l),()=>document.removeEventListener("mousedown",l)},[]),c.jsxs("div",{className:"relative",ref:a,children:[c.jsxs("button",{type:"button",className:"inline-flex items-center gap-2 px-3 py-2 bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[3px_3px_0_var(--color-text)] font-[family-name:var(--font-mono)] text-sm font-bold hover:-translate-x-px hover:-translate-y-px hover:shadow-[4px_4px_0_var(--color-text)] transition-[transform,box-shadow] duration-150",onClick:()=>r(l=>!l),children:[e,c.jsx(Vu,{size:14,strokeWidth:2.5})]}),n&&o&&c.jsx("div",{className:"absolute right-0 mt-2 z-20 min-w-[200px] max-h-[60vh] overflow-y-auto bg-[var(--color-bg)] border-[3px] border-[var(--color-text)] rounded-xl shadow-[5px_5px_0_var(--color-text)]",children:c_(o.data,"activity").map(l=>{const d=l.pipelineStatus==="running";return c.jsxs("button",{type:"button",onClick:()=>{t(l.name),r(!1)},className:["w-full text-left px-4 py-2 text-sm font-semibold flex items-center gap-2",l.name===e?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[d&&c.jsx(Yu,{size:12,strokeWidth:3,className:"text-[var(--color-running)] shrink-0","aria-label":"运行中"}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:l.name}),c.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)]",children:[l.cards.total," cards"]})]},l.name)})})]})}const R4=[{state:"Planning",labelKey:"board.col.planning",bg:"var(--color-accent-purple)"},{state:"Backlog",labelKey:"board.col.backlog",bg:"var(--color-bg-cream)"},{state:"Todo",labelKey:"board.col.todo",bg:"var(--color-accent-yellow)"},{state:"Inprogress",labelKey:"board.col.inprogress",bg:"var(--color-secondary)"},{state:"QA",labelKey:"board.col.qa",bg:"var(--color-accent-pink)"},{state:"Done",labelKey:"board.col.done",bg:"var(--color-accent-mint)"}],g2="sps-console:last-board-project";function L4(){if(typeof window>"u")return null;try{return localStorage.getItem(g2)}catch{return null}}function I4(e){if(!(typeof window>"u"))try{localStorage.setItem(g2,e)}catch{}}function z4(){var O,V,Q;const e=Be(),[t,n]=BN(),r=t.get("project"),[a,o]=j.useState(null),[l,d]=j.useState(""),[f,h]=j.useState(()=>new Set),[g,m]=j.useState(()=>new Set),{confirm:y,alert:b}=un();w4(r);const k=Ye({queryKey:["projects"],queryFn:Es}),v=Ye({queryKey:["cards",r],queryFn:()=>f4(r??""),enabled:!!r}),N=Gt(),E=()=>{N.invalidateQueries({queryKey:["cards",r]}),N.invalidateQueries({queryKey:["projects"]}),N.invalidateQueries({queryKey:["pipeline-status",r]})},C=K=>{n({project:K})};j.useEffect(()=>{var I;if(r){I4(r);return}const K=L4();K&&((I=k.data)!=null&&I.data.some(P=>P.name===K))&&n({project:K},{replace:!0})},[r,k.data,n]);const S=Ct({mutationFn:()=>h2(r),onSuccess:()=>{E()},onError:K=>{b({title:e("board.action.startError"),body:K instanceof Error?K.message:String(K)})}}),_=Ct({mutationFn:()=>p2(r),onSuccess:()=>E(),onError:K=>{b({title:e("board.action.stopError"),body:K instanceof Error?K.message:String(K)})}}),M=Ct({mutationFn:()=>v4(r,{all:!0}),onSuccess:()=>E(),onError:K=>{b({title:e("board.action.resetError"),body:K instanceof Error?K.message:String(K)})}}),[T,L]=j.useState(!1),R=Ct({mutationFn:K=>y4(r,K),onSuccess:()=>{E(),L(!1)},onError:K=>{b({title:e("board.action.newCard.error"),body:K instanceof Error?K.message:String(K)})}}),$=Ct({mutationFn:({seq:K,state:I})=>b4(r,K,I),onMutate:async({seq:K,state:I})=>{await N.cancelQueries({queryKey:["cards",r]});const P=N.getQueryData(["cards",r]);return P&&N.setQueryData(["cards",r],{...P,data:P.data.map(G=>G.seq===K?{...G,state:I}:G)}),{prev:P}},onError:(K,I,P)=>{P!=null&&P.prev&&N.setQueryData(["cards",r],P.prev),b({title:e("board.action.moveCard.error"),body:K instanceof Error?K.message:String(K)})},onSettled:()=>{N.invalidateQueries({queryKey:["cards",r]})}}),z=((O=v.data)==null?void 0:O.data)??[],{allSkills:q,allLabels:F}=j.useMemo(()=>{const K=new Set,I=new Set;for(const P of z){for(const G of P.skills)K.add(G);for(const G of P.labels)I.add(G)}return{allSkills:[...K].sort(),allLabels:[...I].sort()}},[z]);if(!r)return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("board.title.bare")}),c.jsxs("div",{className:"nb-card bg-[var(--color-accent-yellow)] max-w-2xl",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:e("board.pickPrompt.title")}),c.jsx("p",{className:"text-sm mb-4 text-[var(--color-text-muted)]",children:e("board.pickPrompt.body")}),c.jsx("div",{className:"flex flex-wrap gap-2",children:(V=k.data)==null?void 0:V.data.map(K=>c.jsx("button",{className:"nb-btn nb-btn-blue",onClick:()=>C(K.name),type:"button",children:K.name},K.name))})]})]});const Y=z.filter(K=>{if(l){const I=l.toLowerCase();if(!(K.title.toLowerCase().includes(I)||K.skills.some(G=>G.toLowerCase().includes(I))||K.labels.some(G=>G.toLowerCase().includes(I))))return!1}return!(f.size>0&&!K.skills.some(P=>f.has(P))||g.size>0&&!K.labels.some(P=>g.has(P)))}),D=(Q=k.data)==null?void 0:Q.data.find(K=>K.name===r),H=(D==null?void 0:D.pipelineStatus)==="running";return c.jsxs("div",{className:"flex flex-col gap-4 max-w-full flex-1 min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3 shrink-0",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:e("board.title")}),c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm mt-1",children:D?e("board.subtitle",{name:D.name,cards:D.cards.total,workers:D.workers.active}):e("common.loading")})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsx(O4,{current:r,onChange:C}),c.jsxs("button",{className:H?"nb-btn nb-btn-danger":"nb-btn nb-btn-primary",onClick:()=>H?_.mutate():S.mutate(),disabled:S.isPending||_.isPending,type:"button","aria-label":e(H?"board.action.stopAria":"board.action.startAria"),title:e(H?"board.action.stopAria":"board.action.startAria"),children:[S.isPending||_.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):H?c.jsx($b,{size:14,strokeWidth:3}):c.jsx(Yu,{size:14,strokeWidth:3}),e(H?"board.action.stop":"board.action.start")]}),c.jsxs("button",{className:"nb-btn nb-btn-yellow",type:"button",onClick:async()=>{await y({title:e("board.action.reset.confirm.title"),body:e("board.action.reset.confirm.body"),confirm:e("board.action.reset.confirm.button"),danger:!0})&&M.mutate()},disabled:M.isPending,children:[M.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Pb,{size:14,strokeWidth:2.5}),e("board.action.reset")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>L(!0),disabled:R.isPending,children:[R.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(pr,{size:14,strokeWidth:3}),e("board.action.newCard")]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap shrink-0",children:[c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(ho,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:e("board.search.placeholder"),value:l,onChange:K=>d(K.target.value),"aria-label":e("board.search.aria")})]}),c.jsx(Ck,{label:"skill",options:q,selected:f,onChange:h}),c.jsx(Ck,{label:"label",options:F,selected:g,onChange:m}),(l||f.size>0||g.size>0)&&c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{d(""),h(new Set),m(new Set)},type:"button","aria-label":e("board.filter.clearAria"),children:[c.jsx(Sn,{size:11,strokeWidth:3}),e("board.filter.clear")]}),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] flex items-center gap-1 font-[family-name:var(--font-mono)]",children:[c.jsx(oL,{size:12}),Y.length," / ",z.length]})]}),v.isError&&c.jsxs("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:[c.jsx("p",{className:"font-semibold",children:e("board.error.loadCards")}),c.jsx("p",{className:"text-sm mt-1 text-[var(--color-text-muted)]",children:v.error instanceof Error?v.error.message:String(v.error)})]}),!v.isError&&c.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 xl:grid-cols-6 auto-rows-fr gap-3 flex-1 min-h-0",children:R4.map(K=>c.jsx(M4,{label:e(K.labelKey),bg:K.bg,cards:Y.filter(P4(K.state)),onCardClick:I=>o(I.seq),onDropCard:I=>$.mutate({seq:I,state:K.state})},K.state))}),a!==null&&c.jsx(D4,{project:r,seq:a,onClose:()=>o(null),onChanged:E}),T&&c.jsx(d4,{project:r,isPending:R.isPending,onCancel:()=>L(!1),onCreate:K=>R.mutate(K)})]})}function P4(e){return t=>e==="QA"?t.state==="QA"||t.state==="Review":e==="Done"?t.state==="Done"||t.state==="Canceled":t.state===e}function Ck({label:e,options:t,selected:n,onChange:r}){const a=Be(),[o,l]=j.useState(!1),d=j.useRef(null);j.useEffect(()=>{if(!o)return;const m=b=>{var k;(k=d.current)!=null&&k.contains(b.target)||l(!1)},y=b=>{b.key==="Escape"&&l(!1)};return window.addEventListener("click",m),window.addEventListener("keydown",y),()=>{window.removeEventListener("click",m),window.removeEventListener("keydown",y)}},[o]);const f=m=>{const y=new Set(n);y.has(m)?y.delete(m):y.add(m),r(y)},h=t.length===0,g=n.size;return c.jsxs("div",{ref:d,className:"relative",children:[c.jsxs("button",{type:"button",className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>!h&&l(m=>!m),disabled:h,"aria-haspopup":"listbox","aria-expanded":o,"aria-label":a("board.filter.aria",{label:e}),children:[e,g>0&&c.jsx("span",{className:"ml-1 px-1.5 py-0.5 text-[10px] font-bold rounded-full bg-[var(--color-primary)] text-[var(--color-text)] border border-[var(--color-text)]",children:g}),c.jsx(Vu,{size:11,strokeWidth:3,className:["transition-transform",o?"rotate-180":""].join(" ")})]}),o&&c.jsxs("div",{role:"listbox",className:"absolute left-0 top-full mt-2 z-20 min-w-[200px] max-h-64 overflow-auto nb-card p-2",style:{padding:8},children:[t.map(m=>{const y=n.has(m);return c.jsxs("label",{className:["flex items-center gap-2 px-2 py-1.5 rounded cursor-pointer text-sm font-[family-name:var(--font-mono)]",y?"bg-[var(--color-accent-mint)]":"hover:bg-[var(--color-bg-cream)]"].join(" "),children:[c.jsx("input",{type:"checkbox",checked:y,onChange:()=>f(m),className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",children:m})]},m)}),g>0&&c.jsx("button",{type:"button",className:"w-full mt-2 pt-2 border-t-2 border-dashed border-[var(--color-text)] text-xs font-bold text-[var(--color-crashed)] text-center",onClick:()=>r(new Set),children:a("board.filter.clearSelection")})]})]})}function B4(){return ft("/api/workers/all")}function $4(e){return ft(`/api/projects/${encodeURIComponent(e)}/workers`)}function U4(e,t){return ft(`/api/projects/${encodeURIComponent(e)}/workers/${t}`)}async function y2(e,t){const n=await fetch(e,{method:"POST",headers:t?{"Content-Type":"application/json"}:void 0,body:t?JSON.stringify(t):void 0});if(!n.ok)throw new Error(`${n.status}: ${await n.text()}`);return n.json().catch(()=>({}))}function Ak(e,t){return y2(`/api/projects/${encodeURIComponent(e)}/workers/${t}/kill`)}function F4(e,t,n){return y2(`/api/projects/${encodeURIComponent(e)}/workers/${t}/launch`,n?{seq:n}:void 0)}function dx({state:e}){const n={running:{bg:"var(--color-running-bg)",color:"var(--color-running)",label:"running"},starting:{bg:"var(--color-secondary)",color:"var(--color-text)",label:"starting",icon:c.jsx(Xe,{size:9,strokeWidth:3,className:"animate-spin"})},stuck:{bg:"var(--color-stuck-bg)",color:"var(--color-stuck)",label:"stuck"},crashed:{bg:"var(--color-crashed-bg)",color:"var(--color-crashed)",label:"crashed",icon:c.jsx(n3,{size:9,strokeWidth:2.5})},idle:{bg:"var(--color-idle-bg)",color:"var(--color-idle)",label:"idle"}}[e];return c.jsxs("span",{className:"nb-status inline-flex items-center gap-1",style:{background:n.bg,color:n.color},children:[n.icon,n.label]})}function fx(e){if(e==null||e<=0)return"—";const t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),a=t%60;return n>0?`${n}h ${r}m`:r>0?`${r}m ${a}s`:`${a}s`}function q4(e){if(e==null||e<=0)return"text-[var(--color-text-muted)]";const t=e/6e4;return t<10?"text-[var(--color-running)]":t<60?"text-[var(--color-stuck)]":"text-[var(--color-crashed)]"}function hx(e){const t=Date.now()-new Date(e).getTime();return t<6e4?`${Math.floor(t/1e3)}s 前`:t<36e5?`${Math.floor(t/6e4)}m 前`:`${Math.floor(t/36e5)}h 前`}function H4({alerts:e,selected:t,onSelect:n}){const r=Be();return e.length===0?c.jsxs("div",{className:"nb-card bg-[var(--color-running-bg)] flex items-center gap-3",children:[c.jsx(Eu,{size:18,strokeWidth:2.5,className:"text-[var(--color-running)]"}),c.jsx("span",{className:"text-sm font-bold text-[var(--color-running)]",children:r("workers.alerts.allHealthy")})]}):c.jsxs("section",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2 text-[var(--color-crashed)]",children:[c.jsx(h3,{size:14,strokeWidth:2.5}),"Alerts (",e.length,")"]}),c.jsx("div",{className:"flex flex-col gap-2",children:e.map(a=>{const o=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return c.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="crashed"?"bg-[var(--color-crashed-bg)]":"bg-[var(--color-stuck-bg)]",o?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(dx,{state:a.state}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold",children:[a.project,"/worker-",a.slot]}),a.card&&c.jsxs("span",{className:"truncate",children:["#",a.card.seq," ",a.card.title]}),c.jsxs("span",{className:"ml-auto text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1",children:[c.jsx(HN,{size:10,strokeWidth:2.5}),fx(a.runtimeMs)]})]}),a.markerUpdatedAt&&c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] mt-1 font-[family-name:var(--font-mono)]",children:a.state==="crashed"?r("workers.alerts.pidDead"):r("workers.alerts.markerStale",{ago:hx(a.markerUpdatedAt)})})]},`${a.project}-${a.slot}`)})})]})}function K4({active:e,selected:t,onSelect:n}){const r=Be();return e.length===0?c.jsx("div",{className:"nb-card bg-[var(--color-bg-cream)]",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:r("workers.active.empty")})}):c.jsxs("section",{children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 flex items-center gap-2",children:[c.jsx($h,{size:14,strokeWidth:2.5}),"Active (",e.length,")"]}),c.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:e.map(a=>{const o=(t==null?void 0:t.project)===a.project&&(t==null?void 0:t.slot)===a.slot;return c.jsxs("button",{type:"button",onClick:()=>n(a.project,a.slot),className:["nb-card p-3 text-left",a.state==="starting"?"bg-[var(--color-secondary)]":"bg-[var(--color-running-bg)]",o?"ring-4 ring-[var(--color-text)]":""].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(dx,{state:a.state}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm flex-1 truncate",children:[a.project,"/worker-",a.slot]}),c.jsx("span",{className:`text-xs font-[family-name:var(--font-mono)] ${q4(a.runtimeMs)}`,children:fx(a.runtimeMs)})]}),a.card&&c.jsxs("div",{className:"text-sm font-semibold mb-1 truncate",children:["#",a.card.seq," · ",a.card.title]}),c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-2 mb-1",children:[a.stage&&c.jsxs("span",{children:["stage: ",a.stage]}),a.markerUpdatedAt&&c.jsxs("span",{className:"ml-auto",children:["marker ",hx(a.markerUpdatedAt)]})]}),a.lastLogLine&&c.jsxs("div",{className:"text-[11px] font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded px-2 py-1 mt-2 truncate",children:[c.jsx(e_,{size:9,strokeWidth:2.5,className:"inline-block mr-1 align-text-bottom"}),a.lastLogLine.msg]})]},`${a.project}-${a.slot}`)})})]})}function G4({capacity:e,selected:t,onSelect:n}){const r=Be();return e.length===0?null:c.jsxs("section",{className:"flex flex-col min-h-0 flex-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-sm font-bold uppercase tracking-wider mb-2 shrink-0",children:"Capacity"}),c.jsx("div",{className:"nb-card p-0 overflow-y-auto min-h-0 flex-1",children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{children:c.jsxs("tr",{className:"bg-[var(--color-bg-cream)] border-b-2 border-[var(--color-text)]",children:[c.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:r("workers.capacity.col.project")}),c.jsx("th",{className:"px-3 py-2 text-left font-bold text-xs uppercase tracking-wider",children:r("workers.capacity.col.usage")}),c.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:"running"}),c.jsx("th",{className:"px-3 py-2 text-right font-bold text-xs uppercase tracking-wider",children:r("workers.capacity.col.other")}),c.jsx("th",{className:"px-3 py-2"})]})}),c.jsx("tbody",{children:e.map(a=>{const o=a.running+a.starting+a.stuck+a.crashed,l=(t==null?void 0:t.project)===a.project;return c.jsxs("tr",{onClick:()=>n(a.project),className:["border-b border-dashed border-[var(--color-border-light)] last:border-0 cursor-pointer hover:bg-[var(--color-accent-yellow)]",l?"bg-[var(--color-accent-yellow)]":""].join(" "),children:[c.jsx("td",{className:"px-3 py-2 font-[family-name:var(--font-mono)] font-bold",children:a.project}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(V4,{total:a.total,cap:a})}),c.jsxs("td",{className:"px-3 py-2 text-right font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"text-[var(--color-running)] font-bold",children:a.running}),c.jsxs("span",{className:"text-[var(--color-text-muted)]",children:["/",a.total]})]}),c.jsxs("td",{className:"px-3 py-2 text-right text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)]",children:[a.starting>0&&c.jsxs("span",{className:"mr-2",children:["starting ",a.starting]}),a.stuck>0&&c.jsxs("span",{className:"text-[var(--color-stuck)] font-bold mr-2",children:["stuck ",a.stuck]}),a.crashed>0&&c.jsxs("span",{className:"text-[var(--color-crashed)] font-bold mr-2",children:["crashed ",a.crashed]}),o===0&&c.jsx("span",{children:"idle"})]}),c.jsx("td",{className:"px-3 py-2 text-right",children:c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:r("workers.capacity.detailHint")})})]},a.project)})})]})})]})}function V4({total:e,cap:t}){const n=[];for(let r=0;r<t.crashed;r++)n.push("crashed");for(let r=0;r<t.stuck;r++)n.push("stuck");for(let r=0;r<t.starting;r++)n.push("starting");for(let r=0;r<t.running;r++)n.push("running");for(let r=0;r<t.idle;r++)n.push("idle");return c.jsxs("div",{className:"flex gap-1 items-center",children:[n.map((r,a)=>c.jsx("span",{className:"inline-block w-3 h-3 rounded-full border-2 border-[var(--color-text)]",style:{background:Y4(r)},title:r},a)),c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] ml-2 font-[family-name:var(--font-mono)]",children:[e," slot",e!==1?"s":""]})]})}function Y4(e){switch(e){case"running":return"var(--color-running-bg)";case"starting":return"var(--color-secondary)";case"stuck":return"var(--color-stuck-bg)";case"crashed":return"var(--color-crashed-bg)";default:return"var(--color-idle-bg)"}}function Q4({project:e,initialSlot:t,onChange:n}){var h;const r=Be(),a=Ye({queryKey:["workers",e],queryFn:()=>$4(e),refetchInterval:3e3}),o=((h=a.data)==null?void 0:h.data)??[],[l,d]=j.useState(null);j.useEffect(()=>{if(o.length===0){d(null);return}const g=o[0].slot;d(m=>m!=null&&o.some(y=>y.slot===m)?m:t!=null&&o.some(y=>y.slot===t)?t:g)},[e,t,o.length]);const f=o.find(g=>g.slot===l)??null;return c.jsxs("div",{className:"flex flex-col h-full",children:[c.jsxs("div",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[c.jsxs("div",{className:"flex items-center justify-between mb-2",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold truncate",children:e}),c.jsx(vs,{to:`/board?project=${encodeURIComponent(e)}`,className:"text-xs underline text-[var(--color-text-muted)] hover:text-[var(--color-text)]",children:r("workers.panel.boardLink")})]}),a.isLoading&&o.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:r("workers.panel.loading")}):o.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:r("workers.panel.empty.slots")}):c.jsx("div",{className:"flex flex-wrap gap-2",children:o.map(g=>c.jsx(W4,{worker:g,active:g.slot===l,onClick:()=>d(g.slot)},g.slot))})]}),f?c.jsx(X4,{project:e,worker:f,onChange:n}):c.jsx("div",{className:"flex-1 flex items-center justify-center p-6 text-center",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:o.length===0?r("workers.panel.empty.noWorker"):r("workers.panel.empty.pickOne")})})]})}function W4({worker:e,active:t,onClick:n}){const r=Be();return c.jsxs("button",{type:"button",onClick:n,className:["nb-card p-2 text-left min-w-[130px] transition-transform",t?"ring-4 ring-[var(--color-text)]":"opacity-80 hover:opacity-100"].join(" "),children:[c.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[c.jsx(dx,{state:e.state}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs",children:["worker-",e.slot]})]}),e.card?c.jsxs("div",{className:"text-[11px] truncate font-[family-name:var(--font-mono)]",children:["#",e.card.seq," ",e.card.title]}):c.jsx("div",{className:"text-[11px] text-[var(--color-text-muted)] italic",children:r("workers.panel.idle.short")})]})}function X4({project:e,worker:t,onChange:n}){var y,b;const r=Be(),{confirm:a,alert:o}=un(),l=t.state==="crashed"||t.state==="stuck",d=Ye({queryKey:["worker-detail",e,t.slot],queryFn:()=>U4(e,t.slot),refetchInterval:3e3}),f=((y=d.data)==null?void 0:y.recentOutput)??[],h=((b=d.data)==null?void 0:b.recentLogs)??[],g=j.useRef(null),m=j.useRef(!0);return j.useEffect(()=>{const k=g.current;k&&m.current&&(k.scrollTop=k.scrollHeight)},[f]),c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[t.card?c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1",children:r("workers.panel.section.currentCard")}),c.jsxs("div",{className:"text-sm font-semibold break-words",children:["#",t.card.seq," · ",t.card.title]})]}):c.jsx("div",{className:"text-sm text-[var(--color-text-muted)] italic",children:r("workers.panel.idle.full")}),c.jsxs("dl",{className:"grid grid-cols-[100px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:"Stage"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.stage??"—"}),c.jsx("dt",{className:"font-bold",children:"PID"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.pid??"—"}),c.jsx("dt",{className:"font-bold",children:"Runtime"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:fx(t.runtimeMs)}),c.jsx("dt",{className:"font-bold",children:"Started"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.startedAt?new Date(t.startedAt).toLocaleString():"—"}),c.jsx("dt",{className:"font-bold",children:"Marker"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)] text-xs",children:t.markerUpdatedAt?hx(t.markerUpdatedAt):"—"})]}),c.jsxs("div",{children:[c.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 flex items-center gap-1",children:[c.jsx(e_,{size:10,strokeWidth:2.5}),r("workers.panel.section.claudeOutput",{n:f.length})]}),d.isLoading&&f.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:r("workers.panel.output.loading")}):f.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] italic",children:r("workers.panel.output.empty")}):c.jsx("pre",{ref:g,onScroll:k=>{const v=k.currentTarget;m.current=v.scrollHeight-v.scrollTop-v.clientHeight<24},className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-80 overflow-auto whitespace-pre-wrap break-words",children:f.map(k=>`${k.ts?`${k.ts} [${k.kind}] `:`[${k.kind}] `}${k.text}`).join(`
|
|
605
|
-
`)})]}),h.length>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-1 opacity-60",children:r("workers.panel.section.heartbeat",{n:h.length})}),c.jsx("pre",{className:"text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-2 max-h-40 overflow-auto whitespace-pre-wrap break-words opacity-80",children:h.map(k=>`${k.ts??""} [${k.level}] ${k.msg}`).join(`
|
|
606
|
-
`)}),c.jsx(vs,{to:`/projects/${encodeURIComponent(e)}?tab=logs&worker=${t.slot}`,className:"text-xs underline text-[var(--color-running)] mt-1 inline-block",children:r("workers.panel.heartbeat.fullLog")})]})]}),c.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] flex gap-2 justify-end flex-wrap",children:[l&&t.card&&c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await a({title:r("workers.panel.action.restart.confirm.title",{slot:t.slot}),body:r("workers.panel.action.restart.confirm.body",{seq:t.card.seq}),confirm:r("workers.panel.action.restart.confirm.button")})){try{await Ak(e,t.slot)}catch{}try{await F4(e,t.slot,t.card.seq),n()}catch(v){o({title:r("workers.panel.action.restart.error"),body:v instanceof Error?v.message:String(v)})}}},children:[c.jsx(l3,{size:11,strokeWidth:2.5})," ",r("workers.panel.action.restart")]}),t.state!=="idle"&&c.jsxs("button",{type:"button",className:"nb-btn nb-btn-danger",style:{padding:"4px 10px",fontSize:11},onClick:async()=>{if(await a({title:r("workers.panel.action.kill.confirm.title",{slot:t.slot}),body:r("workers.panel.action.kill.confirm.body"),confirm:r("workers.panel.action.kill.confirm.button"),danger:!0}))try{await Ak(e,t.slot),n()}catch(v){o({title:r("workers.panel.action.kill.error"),body:v instanceof Error?v.message:String(v)})}},children:[c.jsx(v3,{size:11,strokeWidth:2.5})," ",r("workers.panel.action.kill")]})]})]})}function Z4(){var l;const e=Be(),t=Gt(),[n,r]=j.useState(null),a=Ye({queryKey:["workers-agg"],queryFn:B4,refetchInterval:5e3});j.useEffect(()=>{if(!a.data)return;const d=a.data.capacity.map(h=>h.project),f=[];for(const h of d){const g=new EventSource(`/stream/projects/${encodeURIComponent(h)}`),m=()=>{t.invalidateQueries({queryKey:["workers-agg"]})};g.addEventListener("worker.updated",m),g.addEventListener("worker.added",m),g.addEventListener("worker.deleted",m),g.addEventListener("card.updated",m),f.push(g)}return()=>{for(const h of f)h.close()}},[(l=a.data)==null?void 0:l.capacity.map(d=>d.project).join(","),t]);const o=j.useMemo(()=>{if(!a.data)return{projects:0,running:0,starting:0,stuck:0,crashed:0,idle:0};const d={projects:a.data.capacity.length,running:0,starting:0,stuck:0,crashed:0,idle:0};for(const f of a.data.capacity)d.running+=f.running,d.starting+=f.starting,d.stuck+=f.stuck,d.crashed+=f.crashed,d.idle+=f.idle;return d},[a.data]);return c.jsxs("div",{className:"flex flex-col gap-4 h-[calc(100vh-140px)]",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold tracking-tight",children:e("workers.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:e("workers.summary",{projects:o.projects,running:o.running,starting:o.starting,stuck:o.stuck,crashed:o.crashed,idle:o.idle})})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a.refetch(),disabled:a.isFetching,type:"button","aria-label":e("workers.refresh.aria"),children:[a.isFetching?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(ya,{size:12,strokeWidth:2.5}),e("workers.refresh")]})]}),c.jsxs("div",{className:"grid grid-cols-1 xl:grid-cols-2 gap-4 flex-1 min-h-0",children:[c.jsxs("div",{className:"flex flex-col gap-4 min-h-0 pr-2",children:[a.isLoading&&c.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:e("common.loading")}),a.isError&&c.jsx("div",{className:"nb-card bg-[var(--color-crashed-bg)]",children:c.jsx("p",{children:e("workers.error.load",{detail:a.error instanceof Error?a.error.message:String(a.error)})})}),a.data&&c.jsxs(c.Fragment,{children:[c.jsx(H4,{alerts:a.data.alerts,selected:n,onSelect:(d,f)=>r({project:d,slot:f})}),c.jsx(K4,{active:a.data.active,selected:n,onSelect:(d,f)=>r({project:d,slot:f})}),c.jsx(G4,{capacity:a.data.capacity,selected:n,onSelect:d=>r({project:d})})]})]}),c.jsx("aside",{className:"nb-card p-0 overflow-hidden flex flex-col h-full",children:n?c.jsx(Q4,{project:n.project,initialSlot:n.slot,onChange:()=>t.invalidateQueries({queryKey:["workers-agg"]})}):c.jsx("div",{className:"flex-1 flex items-center justify-center p-6 text-center",children:c.jsxs("div",{children:[c.jsx($h,{size:32,className:"mx-auto mb-3 text-[var(--color-text-subtle)]",strokeWidth:2}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("workers.empty.hint")})]})})})]})]})}function b2(){return ft("/api/gen/jobs")}function J4(e,t){const n={};return(e[e.length-1]===""?[...e,""]:e).join((n.padRight?" ":"")+","+(n.padLeft===!1?"":" ")).trim()}const eP=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,tP=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,nP={};function Tk(e,t){return(nP.jsx?tP:eP).test(e)}const rP=/[ \t\n\f\r]/g;function iP(e){return typeof e=="object"?e.type==="text"?Mk(e.value):!1:Mk(e)}function Mk(e){return e.replace(rP,"")===""}class Zu{constructor(t,n,r){this.normal=n,this.property=t,r&&(this.space=r)}}Zu.prototype.normal={};Zu.prototype.property={};Zu.prototype.space=void 0;function x2(e,t){const n={},r={};for(const a of e)Object.assign(n,a.property),Object.assign(r,a.normal);return new Zu(n,r,t)}function Wy(e){return e.toLowerCase()}class mr{constructor(t,n){this.attribute=n,this.property=t}}mr.prototype.attribute="";mr.prototype.booleanish=!1;mr.prototype.boolean=!1;mr.prototype.commaOrSpaceSeparated=!1;mr.prototype.commaSeparated=!1;mr.prototype.defined=!1;mr.prototype.mustUseProperty=!1;mr.prototype.number=!1;mr.prototype.overloadedBoolean=!1;mr.prototype.property="";mr.prototype.spaceSeparated=!1;mr.prototype.space=void 0;let aP=0;const dt=Eo(),En=Eo(),Xy=Eo(),je=Eo(),Yt=Eo(),El=Eo(),Er=Eo();function Eo(){return 2**++aP}const Zy=Object.freeze(Object.defineProperty({__proto__:null,boolean:dt,booleanish:En,commaOrSpaceSeparated:Er,commaSeparated:El,number:je,overloadedBoolean:Xy,spaceSeparated:Yt},Symbol.toStringTag,{value:"Module"})),Ug=Object.keys(Zy);class px extends mr{constructor(t,n,r,a){let o=-1;if(super(t,n),Dk(this,"space",a),typeof r=="number")for(;++o<Ug.length;){const l=Ug[o];Dk(this,Ug[o],(r&Zy[l])===Zy[l])}}}px.prototype.defined=!0;function Dk(e,t,n){n&&(e[t]=n)}function sc(e){const t={},n={};for(const[r,a]of Object.entries(e.properties)){const o=new px(r,e.transform(e.attributes||{},r),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(o.mustUseProperty=!0),t[r]=o,n[Wy(r)]=r,n[Wy(o.attribute)]=r}return new Zu(t,n,e.space)}const v2=sc({properties:{ariaActiveDescendant:null,ariaAtomic:En,ariaAutoComplete:null,ariaBusy:En,ariaChecked:En,ariaColCount:je,ariaColIndex:je,ariaColSpan:je,ariaControls:Yt,ariaCurrent:null,ariaDescribedBy:Yt,ariaDetails:null,ariaDisabled:En,ariaDropEffect:Yt,ariaErrorMessage:null,ariaExpanded:En,ariaFlowTo:Yt,ariaGrabbed:En,ariaHasPopup:null,ariaHidden:En,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:Yt,ariaLevel:je,ariaLive:null,ariaModal:En,ariaMultiLine:En,ariaMultiSelectable:En,ariaOrientation:null,ariaOwns:Yt,ariaPlaceholder:null,ariaPosInSet:je,ariaPressed:En,ariaReadOnly:En,ariaRelevant:null,ariaRequired:En,ariaRoleDescription:Yt,ariaRowCount:je,ariaRowIndex:je,ariaRowSpan:je,ariaSelected:En,ariaSetSize:je,ariaSort:null,ariaValueMax:je,ariaValueMin:je,ariaValueNow:je,ariaValueText:null,role:null},transform(e,t){return t==="role"?t:"aria-"+t.slice(4).toLowerCase()}});function w2(e,t){return t in e?e[t]:t}function k2(e,t){return w2(e,t.toLowerCase())}const sP=sc({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:El,acceptCharset:Yt,accessKey:Yt,action:null,allow:null,allowFullScreen:dt,allowPaymentRequest:dt,allowUserMedia:dt,alt:null,as:null,async:dt,autoCapitalize:null,autoComplete:Yt,autoFocus:dt,autoPlay:dt,blocking:Yt,capture:null,charSet:null,checked:dt,cite:null,className:Yt,cols:je,colSpan:null,content:null,contentEditable:En,controls:dt,controlsList:Yt,coords:je|El,crossOrigin:null,data:null,dateTime:null,decoding:null,default:dt,defer:dt,dir:null,dirName:null,disabled:dt,download:Xy,draggable:En,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:dt,formTarget:null,headers:Yt,height:je,hidden:Xy,high:je,href:null,hrefLang:null,htmlFor:Yt,httpEquiv:Yt,id:null,imageSizes:null,imageSrcSet:null,inert:dt,inputMode:null,integrity:null,is:null,isMap:dt,itemId:null,itemProp:Yt,itemRef:Yt,itemScope:dt,itemType:Yt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:dt,low:je,manifest:null,max:null,maxLength:je,media:null,method:null,min:null,minLength:je,multiple:dt,muted:dt,name:null,nonce:null,noModule:dt,noValidate:dt,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:dt,optimum:je,pattern:null,ping:Yt,placeholder:null,playsInline:dt,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:dt,referrerPolicy:null,rel:Yt,required:dt,reversed:dt,rows:je,rowSpan:je,sandbox:Yt,scope:null,scoped:dt,seamless:dt,selected:dt,shadowRootClonable:dt,shadowRootDelegatesFocus:dt,shadowRootMode:null,shape:null,size:je,sizes:null,slot:null,span:je,spellCheck:En,src:null,srcDoc:null,srcLang:null,srcSet:null,start:je,step:null,style:null,tabIndex:je,target:null,title:null,translate:null,type:null,typeMustMatch:dt,useMap:null,value:En,width:je,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:Yt,axis:null,background:null,bgColor:null,border:je,borderColor:null,bottomMargin:je,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:dt,declare:dt,event:null,face:null,frame:null,frameBorder:null,hSpace:je,leftMargin:je,link:null,longDesc:null,lowSrc:null,marginHeight:je,marginWidth:je,noResize:dt,noHref:dt,noShade:dt,noWrap:dt,object:null,profile:null,prompt:null,rev:null,rightMargin:je,rules:null,scheme:null,scrolling:En,standby:null,summary:null,text:null,topMargin:je,valueType:null,version:null,vAlign:null,vLink:null,vSpace:je,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:dt,disableRemotePlayback:dt,prefix:null,property:null,results:je,security:null,unselectable:null},space:"html",transform:k2}),oP=sc({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:je,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:je,amplitude:je,arabicForm:null,ascent:je,attributeName:null,attributeType:null,azimuth:je,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:je,by:null,calcMode:null,capHeight:je,className:Yt,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:je,diffuseConstant:je,direction:null,display:null,dur:null,divisor:je,dominantBaseline:null,download:dt,dx:null,dy:null,edgeMode:null,editable:null,elevation:je,enableBackground:null,end:null,event:null,exponent:je,externalResourcesRequired:null,fill:null,fillOpacity:je,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:El,g2:El,glyphName:El,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:je,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:je,horizOriginX:je,horizOriginY:je,id:null,ideographic:je,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:je,k:je,k1:je,k2:je,k3:je,k4:je,kernelMatrix:Er,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:je,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:je,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:je,overlineThickness:je,paintOrder:null,panose1:null,path:null,pathLength:je,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:Yt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:je,pointsAtY:je,pointsAtZ:je,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:je,specularExponent:je,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:je,strikethroughThickness:je,string:null,stroke:null,strokeDashArray:Er,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:je,strokeOpacity:je,strokeWidth:null,style:null,surfaceScale:je,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Er,tabIndex:je,tableValues:null,target:null,targetX:je,targetY:je,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:je,underlineThickness:je,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:je,values:null,vAlphabetic:je,vMathematical:je,vectorEffect:null,vHanging:je,vIdeographic:je,version:null,vertAdvY:je,vertOriginX:je,vertOriginY:je,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:je,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:w2}),E2=sc({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,t){return"xlink:"+t.slice(5).toLowerCase()}}),S2=sc({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:k2}),N2=sc({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,t){return"xml:"+t.slice(3).toLowerCase()}}),lP={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"},cP=/[A-Z]/g,Ok=/-[a-z]/g,uP=/^data[-\w.:]+$/i;function dP(e,t){const n=Wy(t);let r=t,a=mr;if(n in e.normal)return e.property[e.normal[n]];if(n.length>4&&n.slice(0,4)==="data"&&uP.test(t)){if(t.charAt(4)==="-"){const o=t.slice(5).replace(Ok,hP);r="data"+o.charAt(0).toUpperCase()+o.slice(1)}else{const o=t.slice(4);if(!Ok.test(o)){let l=o.replace(cP,fP);l.charAt(0)!=="-"&&(l="-"+l),t="data"+l}}a=px}return new a(r,t)}function fP(e){return"-"+e.toLowerCase()}function hP(e){return e.charAt(1).toUpperCase()}const pP=x2([v2,sP,E2,S2,N2],"html"),mx=x2([v2,oP,E2,S2,N2],"svg");function mP(e){return e.join(" ").trim()}var ll={},Fg,Rk;function gP(){if(Rk)return Fg;Rk=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,t=/\n/g,n=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,o=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,l=/^[;\s]*/,d=/^\s+|\s+$/g,f=`
|
|
607
|
-
`,h="/",g="*",m="",y="comment",b="declaration";function k(N,E){if(typeof N!="string")throw new TypeError("First argument must be a string");if(!N)return[];E=E||{};var C=1,S=1;function _(D){var H=D.match(t);H&&(C+=H.length);var O=D.lastIndexOf(f);S=~O?D.length-O:S+D.length}function M(){var D={line:C,column:S};return function(H){return H.position=new T(D),$(),H}}function T(D){this.start=D,this.end={line:C,column:S},this.source=E.source}T.prototype.content=N;function L(D){var H=new Error(E.source+":"+C+":"+S+": "+D);if(H.reason=D,H.filename=E.source,H.line=C,H.column=S,H.source=N,!E.silent)throw H}function R(D){var H=D.exec(N);if(H){var O=H[0];return _(O),N=N.slice(O.length),H}}function $(){R(n)}function z(D){var H;for(D=D||[];H=q();)H!==!1&&D.push(H);return D}function q(){var D=M();if(!(h!=N.charAt(0)||g!=N.charAt(1))){for(var H=2;m!=N.charAt(H)&&(g!=N.charAt(H)||h!=N.charAt(H+1));)++H;if(H+=2,m===N.charAt(H-1))return L("End of comment missing");var O=N.slice(2,H-2);return S+=2,_(O),N=N.slice(H),S+=2,D({type:y,comment:O})}}function F(){var D=M(),H=R(r);if(H){if(q(),!R(a))return L("property missing ':'");var O=R(o),V=D({type:b,property:v(H[0].replace(e,m)),value:O?v(O[0].replace(e,m)):m});return R(l),V}}function Y(){var D=[];z(D);for(var H;H=F();)H!==!1&&(D.push(H),z(D));return D}return $(),Y()}function v(N){return N?N.replace(d,m):m}return Fg=k,Fg}var Lk;function yP(){if(Lk)return ll;Lk=1;var e=ll&&ll.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(ll,"__esModule",{value:!0}),ll.default=n;const t=e(gP());function n(r,a){let o=null;if(!r||typeof r!="string")return o;const l=(0,t.default)(r),d=typeof a=="function";return l.forEach(f=>{if(f.type!=="declaration")return;const{property:h,value:g}=f;d?a(h,g,f):g&&(o=o||{},o[h]=g)}),o}return ll}var tu={},Ik;function bP(){if(Ik)return tu;Ik=1,Object.defineProperty(tu,"__esModule",{value:!0}),tu.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,t=/-([a-z])/g,n=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,o=function(h){return!h||n.test(h)||e.test(h)},l=function(h,g){return g.toUpperCase()},d=function(h,g){return"".concat(g,"-")},f=function(h,g){return g===void 0&&(g={}),o(h)?h:(h=h.toLowerCase(),g.reactCompat?h=h.replace(a,d):h=h.replace(r,d),h.replace(t,l))};return tu.camelCase=f,tu}var nu,zk;function xP(){if(zk)return nu;zk=1;var e=nu&&nu.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},t=e(yP()),n=bP();function r(a,o){var l={};return!a||typeof a!="string"||(0,t.default)(a,function(d,f){d&&f&&(l[(0,n.camelCase)(d,o)]=f)}),l}return r.default=r,nu=r,nu}var vP=xP();const wP=qu(vP),_2=j2("end"),gx=j2("start");function j2(e){return t;function t(n){const r=n&&n.position&&n.position[e]||{};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 kP(e){const t=gx(e),n=_2(e);if(t&&n)return{start:t,end:n}}function hu(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Pk(e.position):"start"in e||"end"in e?Pk(e):"line"in e||"column"in e?Jy(e):""}function Jy(e){return Bk(e&&e.line)+":"+Bk(e&&e.column)}function Pk(e){return Jy(e&&e.start)+"-"+Jy(e&&e.end)}function Bk(e){return e&&typeof e=="number"?e:1}class Yn extends Error{constructor(t,n,r){super(),typeof n=="string"&&(r=n,n=void 0);let a="",o={},l=!1;if(n&&("line"in n&&"column"in n?o={place:n}:"start"in n&&"end"in n?o={place:n}:"type"in n?o={ancestors:[n],place:n.position}:o={...n}),typeof t=="string"?a=t:!o.cause&&t&&(l=!0,a=t.message,o.cause=t),!o.ruleId&&!o.source&&typeof r=="string"){const f=r.indexOf(":");f===-1?o.ruleId=r:(o.source=r.slice(0,f),o.ruleId=r.slice(f+1))}if(!o.place&&o.ancestors&&o.ancestors){const f=o.ancestors[o.ancestors.length-1];f&&(o.place=f.position)}const d=o.place&&"start"in o.place?o.place.start:o.place;this.ancestors=o.ancestors||void 0,this.cause=o.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=d?d.line:void 0,this.name=hu(o.place)||"1:1",this.place=o.place||void 0,this.reason=this.message,this.ruleId=o.ruleId||void 0,this.source=o.source||void 0,this.stack=l&&o.cause&&typeof o.cause.stack=="string"?o.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}Yn.prototype.file="";Yn.prototype.name="";Yn.prototype.reason="";Yn.prototype.message="";Yn.prototype.stack="";Yn.prototype.column=void 0;Yn.prototype.line=void 0;Yn.prototype.ancestors=void 0;Yn.prototype.cause=void 0;Yn.prototype.fatal=void 0;Yn.prototype.place=void 0;Yn.prototype.ruleId=void 0;Yn.prototype.source=void 0;const yx={}.hasOwnProperty,EP=new Map,SP=/[A-Z]/g,NP=new Set(["table","tbody","thead","tfoot","tr"]),_P=new Set(["td","th"]),C2="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function jP(e,t){if(!t||t.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const n=t.filePath||void 0;let r;if(t.development){if(typeof t.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=LP(n,t.jsxDEV)}else{if(typeof t.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof t.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");r=RP(n,t.jsx,t.jsxs)}const a={Fragment:t.Fragment,ancestors:[],components:t.components||{},create:r,elementAttributeNameCase:t.elementAttributeNameCase||"react",evaluater:t.createEvaluater?t.createEvaluater():void 0,filePath:n,ignoreInvalidStyle:t.ignoreInvalidStyle||!1,passKeys:t.passKeys!==!1,passNode:t.passNode||!1,schema:t.space==="svg"?mx:pP,stylePropertyNameCase:t.stylePropertyNameCase||"dom",tableCellAlignToStyle:t.tableCellAlignToStyle!==!1},o=A2(a,e,void 0);return o&&typeof o!="string"?o:a.create(e,a.Fragment,{children:o||void 0},void 0)}function A2(e,t,n){if(t.type==="element")return CP(e,t,n);if(t.type==="mdxFlowExpression"||t.type==="mdxTextExpression")return AP(e,t);if(t.type==="mdxJsxFlowElement"||t.type==="mdxJsxTextElement")return MP(e,t,n);if(t.type==="mdxjsEsm")return TP(e,t);if(t.type==="root")return DP(e,t,n);if(t.type==="text")return OP(e,t)}function CP(e,t,n){const r=e.schema;let a=r;t.tagName.toLowerCase()==="svg"&&r.space==="html"&&(a=mx,e.schema=a),e.ancestors.push(t);const o=M2(e,t.tagName,!1),l=IP(e,t);let d=xx(e,t);return NP.has(t.tagName)&&(d=d.filter(function(f){return typeof f=="string"?!iP(f):!0})),T2(e,l,o,t),bx(l,d),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function AP(e,t){if(t.data&&t.data.estree&&e.evaluater){const r=t.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}ju(e,t.position)}function TP(e,t){if(t.data&&t.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(t.data.estree);ju(e,t.position)}function MP(e,t,n){const r=e.schema;let a=r;t.name==="svg"&&r.space==="html"&&(a=mx,e.schema=a),e.ancestors.push(t);const o=t.name===null?e.Fragment:M2(e,t.name,!0),l=zP(e,t),d=xx(e,t);return T2(e,l,o,t),bx(l,d),e.ancestors.pop(),e.schema=r,e.create(t,o,l,n)}function DP(e,t,n){const r={};return bx(r,xx(e,t)),e.create(t,e.Fragment,r,n)}function OP(e,t){return t.value}function T2(e,t,n,r){typeof n!="string"&&n!==e.Fragment&&e.passNode&&(t.node=r)}function bx(e,t){if(t.length>0){const n=t.length>1?t:t[0];n&&(e.children=n)}}function RP(e,t,n){return r;function r(a,o,l,d){const h=Array.isArray(l.children)?n:t;return d?h(o,l,d):h(o,l)}}function LP(e,t){return n;function n(r,a,o,l){const d=Array.isArray(o.children),f=gx(r);return t(a,o,l,d,{columnNumber:f?f.column-1:void 0,fileName:e,lineNumber:f?f.line:void 0},void 0)}}function IP(e,t){const n={};let r,a;for(a in t.properties)if(a!=="children"&&yx.call(t.properties,a)){const o=PP(e,a,t.properties[a]);if(o){const[l,d]=o;e.tableCellAlignToStyle&&l==="align"&&typeof d=="string"&&_P.has(t.tagName)?r=d:n[l]=d}}if(r){const o=n.style||(n.style={});o[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return n}function zP(e,t){const n={};for(const r of t.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const o=r.data.estree.body[0];o.type;const l=o.expression;l.type;const d=l.properties[0];d.type,Object.assign(n,e.evaluater.evaluateExpression(d.argument))}else ju(e,t.position);else{const a=r.name;let o;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const d=r.value.data.estree.body[0];d.type,o=e.evaluater.evaluateExpression(d.expression)}else ju(e,t.position);else o=r.value===null?!0:r.value;n[a]=o}return n}function xx(e,t){const n=[];let r=-1;const a=e.passKeys?new Map:EP;for(;++r<t.children.length;){const o=t.children[r];let l;if(e.passKeys){const f=o.type==="element"?o.tagName:o.type==="mdxJsxFlowElement"||o.type==="mdxJsxTextElement"?o.name:void 0;if(f){const h=a.get(f)||0;l=f+"-"+h,a.set(f,h+1)}}const d=A2(e,o,l);d!==void 0&&n.push(d)}return n}function PP(e,t,n){const r=dP(e.schema,t);if(!(n==null||typeof n=="number"&&Number.isNaN(n))){if(Array.isArray(n)&&(n=r.commaSeparated?J4(n):mP(n)),r.property==="style"){let a=typeof n=="object"?n:BP(e,String(n));return e.stylePropertyNameCase==="css"&&(a=$P(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&r.space?lP[r.property]||r.property:r.attribute,n]}}function BP(e,t){try{return wP(t,{reactCompat:!0})}catch(n){if(e.ignoreInvalidStyle)return{};const r=n,a=new Yn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=C2+"#cannot-parse-style-attribute",a}}function M2(e,t,n){let r;if(!n)r={type:"Literal",value:t};else if(t.includes(".")){const a=t.split(".");let o=-1,l;for(;++o<a.length;){const d=Tk(a[o])?{type:"Identifier",name:a[o]}:{type:"Literal",value:a[o]};l=l?{type:"MemberExpression",object:l,property:d,computed:!!(o&&d.type==="Literal"),optional:!1}:d}r=l}else r=Tk(t)&&!/^[a-z]/.test(t)?{type:"Identifier",name:t}:{type:"Literal",value:t};if(r.type==="Literal"){const a=r.value;return yx.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(r);ju(e)}function ju(e,t){const n=new Yn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:t,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw n.file=e.filePath||void 0,n.url=C2+"#cannot-handle-mdx-estrees-without-createevaluater",n}function $P(e){const t={};let n;for(n in e)yx.call(e,n)&&(t[UP(n)]=e[n]);return t}function UP(e){let t=e.replace(SP,FP);return t.slice(0,3)==="ms-"&&(t="-"+t),t}function FP(e){return"-"+e.toLowerCase()}const qg={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"]},qP={};function vx(e,t){const n=qP,r=typeof n.includeImageAlt=="boolean"?n.includeImageAlt:!0,a=typeof n.includeHtml=="boolean"?n.includeHtml:!0;return D2(e,r,a)}function D2(e,t,n){if(HP(e)){if("value"in e)return e.type==="html"&&!n?"":e.value;if(t&&"alt"in e&&e.alt)return e.alt;if("children"in e)return $k(e.children,t,n)}return Array.isArray(e)?$k(e,t,n):""}function $k(e,t,n){const r=[];let a=-1;for(;++a<e.length;)r[a]=D2(e[a],t,n);return r.join("")}function HP(e){return!!(e&&typeof e=="object")}const Uk=document.createElement("i");function wx(e){const t="&"+e+";";Uk.innerHTML=t;const n=Uk.textContent;return n.charCodeAt(n.length-1)===59&&e!=="semi"||n===t?!1:n}function jr(e,t,n,r){const a=e.length;let o=0,l;if(t<0?t=-t>a?0:a+t:t=t>a?a:t,n=n>0?n:0,r.length<1e4)l=Array.from(r),l.unshift(t,n),e.splice(...l);else for(n&&e.splice(t,n);o<r.length;)l=r.slice(o,o+1e4),l.unshift(t,0),e.splice(...l),o+=1e4,t+=1e4}function Hr(e,t){return e.length>0?(jr(e,e.length,0,t),e):t}const Fk={}.hasOwnProperty;function O2(e){const t={};let n=-1;for(;++n<e.length;)KP(t,e[n]);return t}function KP(e,t){let n;for(n in t){const a=(Fk.call(e,n)?e[n]:void 0)||(e[n]={}),o=t[n];let l;if(o)for(l in o){Fk.call(a,l)||(a[l]=[]);const d=o[l];GP(a[l],Array.isArray(d)?d:d?[d]:[])}}}function GP(e,t){let n=-1;const r=[];for(;++n<t.length;)(t[n].add==="after"?e:r).push(t[n]);jr(e,0,0,r)}function R2(e,t){const n=Number.parseInt(e,t);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 di(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const nr=Ns(/[A-Za-z]/),Gn=Ns(/[\dA-Za-z]/),VP=Ns(/[#-'*+\--9=?A-Z^-~]/);function xh(e){return e!==null&&(e<32||e===127)}const eb=Ns(/\d/),YP=Ns(/[\dA-Fa-f]/),QP=Ns(/[!-/:-@[-`{-~]/);function Je(e){return e!==null&&e<-2}function Ht(e){return e!==null&&(e<0||e===32)}function gt(e){return e===-2||e===-1||e===32}const ip=Ns(new RegExp("\\p{P}|\\p{S}","u")),mo=Ns(/\s/);function Ns(e){return t;function t(n){return n!==null&&n>-1&&e.test(String.fromCharCode(n))}}function oc(e){const t=[];let n=-1,r=0,a=0;for(;++n<e.length;){const o=e.charCodeAt(n);let l="";if(o===37&&Gn(e.charCodeAt(n+1))&&Gn(e.charCodeAt(n+2)))a=2;else if(o<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(o))||(l=String.fromCharCode(o));else if(o>55295&&o<57344){const d=e.charCodeAt(n+1);o<56320&&d>56319&&d<57344?(l=String.fromCharCode(o,d),a=1):l="�"}else l=String.fromCharCode(o);l&&(t.push(e.slice(r,n),encodeURIComponent(l)),r=n+a+1,l=""),a&&(n+=a,a=0)}return t.join("")+e.slice(r)}function Et(e,t,n,r){const a=r?r-1:Number.POSITIVE_INFINITY;let o=0;return l;function l(f){return gt(f)?(e.enter(n),d(f)):t(f)}function d(f){return gt(f)&&o++<a?(e.consume(f),d):(e.exit(n),t(f))}}const WP={tokenize:XP};function XP(e){const t=e.attempt(this.parser.constructs.contentInitial,r,a);let n;return t;function r(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Et(e,t,"linePrefix")}function a(d){return e.enter("paragraph"),o(d)}function o(d){const f=e.enter("chunkText",{contentType:"text",previous:n});return n&&(n.next=f),n=f,l(d)}function l(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Je(d)?(e.consume(d),e.exit("chunkText"),o):(e.consume(d),l)}}const ZP={tokenize:JP},qk={tokenize:e5};function JP(e){const t=this,n=[];let r=0,a,o,l;return d;function d(S){if(r<n.length){const _=n[r];return t.containerState=_[1],e.attempt(_[0].continuation,f,h)(S)}return h(S)}function f(S){if(r++,t.containerState._closeFlow){t.containerState._closeFlow=void 0,a&&C();const _=t.events.length;let M=_,T;for(;M--;)if(t.events[M][0]==="exit"&&t.events[M][1].type==="chunkFlow"){T=t.events[M][1].end;break}E(r);let L=_;for(;L<t.events.length;)t.events[L][1].end={...T},L++;return jr(t.events,M+1,0,t.events.slice(_)),t.events.length=L,h(S)}return d(S)}function h(S){if(r===n.length){if(!a)return y(S);if(a.currentConstruct&&a.currentConstruct.concrete)return k(S);t.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return t.containerState={},e.check(qk,g,m)(S)}function g(S){return a&&C(),E(r),y(S)}function m(S){return t.parser.lazy[t.now().line]=r!==n.length,l=t.now().offset,k(S)}function y(S){return t.containerState={},e.attempt(qk,b,k)(S)}function b(S){return r++,n.push([t.currentConstruct,t.containerState]),y(S)}function k(S){if(S===null){a&&C(),E(0),e.consume(S);return}return a=a||t.parser.flow(t.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:o}),v(S)}function v(S){if(S===null){N(e.exit("chunkFlow"),!0),E(0),e.consume(S);return}return Je(S)?(e.consume(S),N(e.exit("chunkFlow")),r=0,t.interrupt=void 0,d):(e.consume(S),v)}function N(S,_){const M=t.sliceStream(S);if(_&&M.push(null),S.previous=o,o&&(o.next=S),o=S,a.defineSkip(S.start),a.write(M),t.parser.lazy[S.start.line]){let T=a.events.length;for(;T--;)if(a.events[T][1].start.offset<l&&(!a.events[T][1].end||a.events[T][1].end.offset>l))return;const L=t.events.length;let R=L,$,z;for(;R--;)if(t.events[R][0]==="exit"&&t.events[R][1].type==="chunkFlow"){if($){z=t.events[R][1].end;break}$=!0}for(E(r),T=L;T<t.events.length;)t.events[T][1].end={...z},T++;jr(t.events,R+1,0,t.events.slice(L)),t.events.length=T}}function E(S){let _=n.length;for(;_-- >S;){const M=n[_];t.containerState=M[1],M[0].exit.call(t,e)}n.length=S}function C(){a.write([null]),o=void 0,a=void 0,t.containerState._closeFlow=void 0}}function e5(e,t,n){return Et(e,e.attempt(this.parser.constructs.document,t,n),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function Ul(e){if(e===null||Ht(e)||mo(e))return 1;if(ip(e))return 2}function ap(e,t,n){const r=[];let a=-1;for(;++a<e.length;){const o=e[a].resolveAll;o&&!r.includes(o)&&(t=o(t,n),r.push(o))}return t}const tb={name:"attention",resolveAll:t5,tokenize:n5};function t5(e,t){let n=-1,r,a,o,l,d,f,h,g;for(;++n<e.length;)if(e[n][0]==="enter"&&e[n][1].type==="attentionSequence"&&e[n][1]._close){for(r=n;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&t.sliceSerialize(e[r][1]).charCodeAt(0)===t.sliceSerialize(e[n][1]).charCodeAt(0)){if((e[r][1]._close||e[n][1]._open)&&(e[n][1].end.offset-e[n][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[n][1].end.offset-e[n][1].start.offset)%3))continue;f=e[r][1].end.offset-e[r][1].start.offset>1&&e[n][1].end.offset-e[n][1].start.offset>1?2:1;const m={...e[r][1].end},y={...e[n][1].start};Hk(m,-f),Hk(y,f),l={type:f>1?"strongSequence":"emphasisSequence",start:m,end:{...e[r][1].end}},d={type:f>1?"strongSequence":"emphasisSequence",start:{...e[n][1].start},end:y},o={type:f>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[n][1].start}},a={type:f>1?"strong":"emphasis",start:{...l.start},end:{...d.end}},e[r][1].end={...l.start},e[n][1].start={...d.end},h=[],e[r][1].end.offset-e[r][1].start.offset&&(h=Hr(h,[["enter",e[r][1],t],["exit",e[r][1],t]])),h=Hr(h,[["enter",a,t],["enter",l,t],["exit",l,t],["enter",o,t]]),h=Hr(h,ap(t.parser.constructs.insideSpan.null,e.slice(r+1,n),t)),h=Hr(h,[["exit",o,t],["enter",d,t],["exit",d,t],["exit",a,t]]),e[n][1].end.offset-e[n][1].start.offset?(g=2,h=Hr(h,[["enter",e[n][1],t],["exit",e[n][1],t]])):g=0,jr(e,r-1,n-r+3,h),n=r+h.length-g-2;break}}for(n=-1;++n<e.length;)e[n][1].type==="attentionSequence"&&(e[n][1].type="data");return e}function n5(e,t){const n=this.parser.constructs.attentionMarkers.null,r=this.previous,a=Ul(r);let o;return l;function l(f){return o=f,e.enter("attentionSequence"),d(f)}function d(f){if(f===o)return e.consume(f),d;const h=e.exit("attentionSequence"),g=Ul(f),m=!g||g===2&&a||n.includes(f),y=!a||a===2&&g||n.includes(r);return h._open=!!(o===42?m:m&&(a||!y)),h._close=!!(o===42?y:y&&(g||!m)),t(f)}}function Hk(e,t){e.column+=t,e.offset+=t,e._bufferIndex+=t}const r5={name:"autolink",tokenize:i5};function i5(e,t,n){let r=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),o}function o(b){return nr(b)?(e.consume(b),l):b===64?n(b):h(b)}function l(b){return b===43||b===45||b===46||Gn(b)?(r=1,d(b)):h(b)}function d(b){return b===58?(e.consume(b),r=0,f):(b===43||b===45||b===46||Gn(b))&&r++<32?(e.consume(b),d):(r=0,h(b))}function f(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):b===null||b===32||b===60||xh(b)?n(b):(e.consume(b),f)}function h(b){return b===64?(e.consume(b),g):VP(b)?(e.consume(b),h):n(b)}function g(b){return Gn(b)?m(b):n(b)}function m(b){return b===46?(e.consume(b),r=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),t):y(b)}function y(b){if((b===45||Gn(b))&&r++<63){const k=b===45?y:m;return e.consume(b),k}return n(b)}}const Ju={partial:!0,tokenize:a5};function a5(e,t,n){return r;function r(o){return gt(o)?Et(e,a,"linePrefix")(o):a(o)}function a(o){return o===null||Je(o)?t(o):n(o)}}const L2={continuation:{tokenize:o5},exit:l5,name:"blockQuote",tokenize:s5};function s5(e,t,n){const r=this;return a;function a(l){if(l===62){const d=r.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(l),e.exit("blockQuoteMarker"),o}return n(l)}function o(l){return gt(l)?(e.enter("blockQuotePrefixWhitespace"),e.consume(l),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),t):(e.exit("blockQuotePrefix"),t(l))}}function o5(e,t,n){const r=this;return a;function a(l){return gt(l)?Et(e,o,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(l):o(l)}function o(l){return e.attempt(L2,t,n)(l)}}function l5(e){e.exit("blockQuote")}const I2={name:"characterEscape",tokenize:c5};function c5(e,t,n){return r;function r(o){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(o),e.exit("escapeMarker"),a}function a(o){return QP(o)?(e.enter("characterEscapeValue"),e.consume(o),e.exit("characterEscapeValue"),e.exit("characterEscape"),t):n(o)}}const z2={name:"characterReference",tokenize:u5};function u5(e,t,n){const r=this;let a=0,o,l;return d;function d(m){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),f}function f(m){return m===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(m),e.exit("characterReferenceMarkerNumeric"),h):(e.enter("characterReferenceValue"),o=31,l=Gn,g(m))}function h(m){return m===88||m===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(m),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),o=6,l=YP,g):(e.enter("characterReferenceValue"),o=7,l=eb,g(m))}function g(m){if(m===59&&a){const y=e.exit("characterReferenceValue");return l===Gn&&!wx(r.sliceSerialize(y))?n(m):(e.enter("characterReferenceMarker"),e.consume(m),e.exit("characterReferenceMarker"),e.exit("characterReference"),t)}return l(m)&&a++<o?(e.consume(m),g):n(m)}}const Kk={partial:!0,tokenize:f5},Gk={concrete:!0,name:"codeFenced",tokenize:d5};function d5(e,t,n){const r=this,a={partial:!0,tokenize:M};let o=0,l=0,d;return f;function f(T){return h(T)}function h(T){const L=r.events[r.events.length-1];return o=L&&L[1].type==="linePrefix"?L[2].sliceSerialize(L[1],!0).length:0,d=T,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(T)}function g(T){return T===d?(l++,e.consume(T),g):l<3?n(T):(e.exit("codeFencedFenceSequence"),gt(T)?Et(e,m,"whitespace")(T):m(T))}function m(T){return T===null||Je(T)?(e.exit("codeFencedFence"),r.interrupt?t(T):e.check(Kk,v,_)(T)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),y(T))}function y(T){return T===null||Je(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),m(T)):gt(T)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Et(e,b,"whitespace")(T)):T===96&&T===d?n(T):(e.consume(T),y)}function b(T){return T===null||Je(T)?m(T):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(T))}function k(T){return T===null||Je(T)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),m(T)):T===96&&T===d?n(T):(e.consume(T),k)}function v(T){return e.attempt(a,_,N)(T)}function N(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),E}function E(T){return o>0&>(T)?Et(e,C,"linePrefix",o+1)(T):C(T)}function C(T){return T===null||Je(T)?e.check(Kk,v,_)(T):(e.enter("codeFlowValue"),S(T))}function S(T){return T===null||Je(T)?(e.exit("codeFlowValue"),C(T)):(e.consume(T),S)}function _(T){return e.exit("codeFenced"),t(T)}function M(T,L,R){let $=0;return z;function z(H){return T.enter("lineEnding"),T.consume(H),T.exit("lineEnding"),q}function q(H){return T.enter("codeFencedFence"),gt(H)?Et(T,F,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(H):F(H)}function F(H){return H===d?(T.enter("codeFencedFenceSequence"),Y(H)):R(H)}function Y(H){return H===d?($++,T.consume(H),Y):$>=l?(T.exit("codeFencedFenceSequence"),gt(H)?Et(T,D,"whitespace")(H):D(H)):R(H)}function D(H){return H===null||Je(H)?(T.exit("codeFencedFence"),L(H)):R(H)}}}function f5(e,t,n){const r=this;return a;function a(l){return l===null?n(l):(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}const Hg={name:"codeIndented",tokenize:p5},h5={partial:!0,tokenize:m5};function p5(e,t,n){const r=this;return a;function a(h){return e.enter("codeIndented"),Et(e,o,"linePrefix",5)(h)}function o(h){const g=r.events[r.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?l(h):n(h)}function l(h){return h===null?f(h):Je(h)?e.attempt(h5,l,f)(h):(e.enter("codeFlowValue"),d(h))}function d(h){return h===null||Je(h)?(e.exit("codeFlowValue"),l(h)):(e.consume(h),d)}function f(h){return e.exit("codeIndented"),t(h)}}function m5(e,t,n){const r=this;return a;function a(l){return r.parser.lazy[r.now().line]?n(l):Je(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),a):Et(e,o,"linePrefix",5)(l)}function o(l){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):Je(l)?a(l):n(l)}}const g5={name:"codeText",previous:b5,resolve:y5,tokenize:x5};function y5(e){let t=e.length-4,n=3,r,a;if((e[n][1].type==="lineEnding"||e[n][1].type==="space")&&(e[t][1].type==="lineEnding"||e[t][1].type==="space")){for(r=n;++r<t;)if(e[r][1].type==="codeTextData"){e[n][1].type="codeTextPadding",e[t][1].type="codeTextPadding",n+=2,t-=2;break}}for(r=n-1,t++;++r<=t;)a===void 0?r!==t&&e[r][1].type!=="lineEnding"&&(a=r):(r===t||e[r][1].type==="lineEnding")&&(e[a][1].type="codeTextData",r!==a+2&&(e[a][1].end=e[r-1][1].end,e.splice(a+2,r-a-2),t-=r-a-2,r=a+2),a=void 0);return e}function b5(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function x5(e,t,n){let r=0,a,o;return l;function l(m){return e.enter("codeText"),e.enter("codeTextSequence"),d(m)}function d(m){return m===96?(e.consume(m),r++,d):(e.exit("codeTextSequence"),f(m))}function f(m){return m===null?n(m):m===32?(e.enter("space"),e.consume(m),e.exit("space"),f):m===96?(o=e.enter("codeTextSequence"),a=0,g(m)):Je(m)?(e.enter("lineEnding"),e.consume(m),e.exit("lineEnding"),f):(e.enter("codeTextData"),h(m))}function h(m){return m===null||m===32||m===96||Je(m)?(e.exit("codeTextData"),f(m)):(e.consume(m),h)}function g(m){return m===96?(e.consume(m),a++,g):a===r?(e.exit("codeTextSequence"),e.exit("codeText"),t(m)):(o.type="codeTextData",h(m))}}class v5{constructor(t){this.left=t?[...t]:[],this.right=[]}get(t){if(t<0||t>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+t+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return t<this.left.length?this.left[t]:this.right[this.right.length-t+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(t,n){const r=n??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(t,r):t>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-t+this.left.length).reverse():this.left.slice(t).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(t,n,r){const a=n||0;this.setCursor(Math.trunc(t));const o=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return r&&ru(this.left,r),o.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(t){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(t)}pushMany(t){this.setCursor(Number.POSITIVE_INFINITY),ru(this.left,t)}unshift(t){this.setCursor(0),this.right.push(t)}unshiftMany(t){this.setCursor(0),ru(this.right,t.reverse())}setCursor(t){if(!(t===this.left.length||t>this.left.length&&this.right.length===0||t<0&&this.left.length===0))if(t<this.left.length){const n=this.left.splice(t,Number.POSITIVE_INFINITY);ru(this.right,n.reverse())}else{const n=this.right.splice(this.left.length+this.right.length-t,Number.POSITIVE_INFINITY);ru(this.left,n.reverse())}}}function ru(e,t){let n=0;if(t.length<1e4)e.push(...t);else for(;n<t.length;)e.push(...t.slice(n,n+1e4)),n+=1e4}function P2(e){const t={};let n=-1,r,a,o,l,d,f,h;const g=new v5(e);for(;++n<g.length;){for(;n in t;)n=t[n];if(r=g.get(n),n&&r[1].type==="chunkFlow"&&g.get(n-1)[1].type==="listItemPrefix"&&(f=r[1]._tokenizer.events,o=0,o<f.length&&f[o][1].type==="lineEndingBlank"&&(o+=2),o<f.length&&f[o][1].type==="content"))for(;++o<f.length&&f[o][1].type!=="content";)f[o][1].type==="chunkText"&&(f[o][1]._isInFirstContentOfListItem=!0,o++);if(r[0]==="enter")r[1].contentType&&(Object.assign(t,w5(g,n)),n=t[n],h=!0);else if(r[1]._container){for(o=n,a=void 0;o--;)if(l=g.get(o),l[1].type==="lineEnding"||l[1].type==="lineEndingBlank")l[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),l[1].type="lineEnding",a=o);else if(!(l[1].type==="linePrefix"||l[1].type==="listItemIndent"))break;a&&(r[1].end={...g.get(a)[1].start},d=g.slice(a,n),d.unshift(r),g.splice(a,n-a+1,d))}}return jr(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!h}function w5(e,t){const n=e.get(t)[1],r=e.get(t)[2];let a=t-1;const o=[];let l=n._tokenizer;l||(l=r.parser[n.contentType](n.start),n._contentTypeTextTrailing&&(l._contentTypeTextTrailing=!0));const d=l.events,f=[],h={};let g,m,y=-1,b=n,k=0,v=0;const N=[v];for(;b;){for(;e.get(++a)[1]!==b;);o.push(a),b._tokenizer||(g=r.sliceStream(b),b.next||g.push(null),m&&l.defineSkip(b.start),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=!0),l.write(g),b._isInFirstContentOfListItem&&(l._gfmTasklistFirstContentOfListItem=void 0)),m=b,b=b.next}for(b=n;++y<d.length;)d[y][0]==="exit"&&d[y-1][0]==="enter"&&d[y][1].type===d[y-1][1].type&&d[y][1].start.line!==d[y][1].end.line&&(v=y+1,N.push(v),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(l.events=[],b?(b._tokenizer=void 0,b.previous=void 0):N.pop(),y=N.length;y--;){const E=d.slice(N[y],N[y+1]),C=o.pop();f.push([C,C+E.length-1]),e.splice(C,2,E)}for(f.reverse(),y=-1;++y<f.length;)h[k+f[y][0]]=k+f[y][1],k+=f[y][1]-f[y][0]-1;return h}const k5={resolve:S5,tokenize:N5},E5={partial:!0,tokenize:_5};function S5(e){return P2(e),e}function N5(e,t){let n;return r;function r(d){return e.enter("content"),n=e.enter("chunkContent",{contentType:"content"}),a(d)}function a(d){return d===null?o(d):Je(d)?e.check(E5,l,o)(d):(e.consume(d),a)}function o(d){return e.exit("chunkContent"),e.exit("content"),t(d)}function l(d){return e.consume(d),e.exit("chunkContent"),n.next=e.enter("chunkContent",{contentType:"content",previous:n}),n=n.next,a}}function _5(e,t,n){const r=this;return a;function a(l){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),Et(e,o,"linePrefix")}function o(l){if(l===null||Je(l))return n(l);const d=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?t(l):e.interrupt(r.parser.constructs.flow,n,t)(l)}}function B2(e,t,n,r,a,o,l,d,f){const h=f||Number.POSITIVE_INFINITY;let g=0;return m;function m(E){return E===60?(e.enter(r),e.enter(a),e.enter(o),e.consume(E),e.exit(o),y):E===null||E===32||E===41||xh(E)?n(E):(e.enter(r),e.enter(l),e.enter(d),e.enter("chunkString",{contentType:"string"}),v(E))}function y(E){return E===62?(e.enter(o),e.consume(E),e.exit(o),e.exit(a),e.exit(r),t):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(d),y(E)):E===null||E===60||Je(E)?n(E):(e.consume(E),E===92?k:b)}function k(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function v(E){return!g&&(E===null||E===41||Ht(E))?(e.exit("chunkString"),e.exit(d),e.exit(l),e.exit(r),t(E)):g<h&&E===40?(e.consume(E),g++,v):E===41?(e.consume(E),g--,v):E===null||E===32||E===40||xh(E)?n(E):(e.consume(E),E===92?N:v)}function N(E){return E===40||E===41||E===92?(e.consume(E),v):v(E)}}function $2(e,t,n,r,a,o){const l=this;let d=0,f;return h;function h(b){return e.enter(r),e.enter(a),e.consume(b),e.exit(a),e.enter(o),g}function g(b){return d>999||b===null||b===91||b===93&&!f||b===94&&!d&&"_hiddenFootnoteSupport"in l.parser.constructs?n(b):b===93?(e.exit(o),e.enter(a),e.consume(b),e.exit(a),e.exit(r),t):Je(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),m(b))}function m(b){return b===null||b===91||b===93||Je(b)||d++>999?(e.exit("chunkString"),g(b)):(e.consume(b),f||(f=!gt(b)),b===92?y:m)}function y(b){return b===91||b===92||b===93?(e.consume(b),d++,m):m(b)}}function U2(e,t,n,r,a,o){let l;return d;function d(y){return y===34||y===39||y===40?(e.enter(r),e.enter(a),e.consume(y),e.exit(a),l=y===40?41:y,f):n(y)}function f(y){return y===l?(e.enter(a),e.consume(y),e.exit(a),e.exit(r),t):(e.enter(o),h(y))}function h(y){return y===l?(e.exit(o),f(l)):y===null?n(y):Je(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),Et(e,h,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(y))}function g(y){return y===l||y===null||Je(y)?(e.exit("chunkString"),h(y)):(e.consume(y),y===92?m:g)}function m(y){return y===l||y===92?(e.consume(y),g):g(y)}}function pu(e,t){let n;return r;function r(a){return Je(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),n=!0,r):gt(a)?Et(e,r,n?"linePrefix":"lineSuffix")(a):t(a)}}const j5={name:"definition",tokenize:A5},C5={partial:!0,tokenize:T5};function A5(e,t,n){const r=this;let a;return o;function o(b){return e.enter("definition"),l(b)}function l(b){return $2.call(r,e,d,n,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return a=di(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),f):n(b)}function f(b){return Ht(b)?pu(e,h)(b):h(b)}function h(b){return B2(e,g,n,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(C5,m,m)(b)}function m(b){return gt(b)?Et(e,y,"whitespace")(b):y(b)}function y(b){return b===null||Je(b)?(e.exit("definition"),r.parser.defined.push(a),t(b)):n(b)}}function T5(e,t,n){return r;function r(d){return Ht(d)?pu(e,a)(d):n(d)}function a(d){return U2(e,o,n,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function o(d){return gt(d)?Et(e,l,"whitespace")(d):l(d)}function l(d){return d===null||Je(d)?t(d):n(d)}}const M5={name:"hardBreakEscape",tokenize:D5};function D5(e,t,n){return r;function r(o){return e.enter("hardBreakEscape"),e.consume(o),a}function a(o){return Je(o)?(e.exit("hardBreakEscape"),t(o)):n(o)}}const O5={name:"headingAtx",resolve:R5,tokenize:L5};function R5(e,t){let n=e.length-2,r=3,a,o;return e[r][1].type==="whitespace"&&(r+=2),n-2>r&&e[n][1].type==="whitespace"&&(n-=2),e[n][1].type==="atxHeadingSequence"&&(r===n-1||n-4>r&&e[n-2][1].type==="whitespace")&&(n-=r+1===n?2:4),n>r&&(a={type:"atxHeadingText",start:e[r][1].start,end:e[n][1].end},o={type:"chunkText",start:e[r][1].start,end:e[n][1].end,contentType:"text"},jr(e,r,n-r+1,[["enter",a,t],["enter",o,t],["exit",o,t],["exit",a,t]])),e}function L5(e,t,n){let r=0;return a;function a(g){return e.enter("atxHeading"),o(g)}function o(g){return e.enter("atxHeadingSequence"),l(g)}function l(g){return g===35&&r++<6?(e.consume(g),l):g===null||Ht(g)?(e.exit("atxHeadingSequence"),d(g)):n(g)}function d(g){return g===35?(e.enter("atxHeadingSequence"),f(g)):g===null||Je(g)?(e.exit("atxHeading"),t(g)):gt(g)?Et(e,d,"whitespace")(g):(e.enter("atxHeadingText"),h(g))}function f(g){return g===35?(e.consume(g),f):(e.exit("atxHeadingSequence"),d(g))}function h(g){return g===null||g===35||Ht(g)?(e.exit("atxHeadingText"),d(g)):(e.consume(g),h)}}const I5=["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"],Vk=["pre","script","style","textarea"],z5={concrete:!0,name:"htmlFlow",resolveTo:$5,tokenize:U5},P5={partial:!0,tokenize:q5},B5={partial:!0,tokenize:F5};function $5(e){let t=e.length;for(;t--&&!(e[t][0]==="enter"&&e[t][1].type==="htmlFlow"););return t>1&&e[t-2][1].type==="linePrefix"&&(e[t][1].start=e[t-2][1].start,e[t+1][1].start=e[t-2][1].start,e.splice(t-2,2)),e}function U5(e,t,n){const r=this;let a,o,l,d,f;return h;function h(B){return g(B)}function g(B){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(B),m}function m(B){return B===33?(e.consume(B),y):B===47?(e.consume(B),o=!0,v):B===63?(e.consume(B),a=3,r.interrupt?t:I):nr(B)?(e.consume(B),l=String.fromCharCode(B),N):n(B)}function y(B){return B===45?(e.consume(B),a=2,b):B===91?(e.consume(B),a=5,d=0,k):nr(B)?(e.consume(B),a=4,r.interrupt?t:I):n(B)}function b(B){return B===45?(e.consume(B),r.interrupt?t:I):n(B)}function k(B){const oe="CDATA[";return B===oe.charCodeAt(d++)?(e.consume(B),d===oe.length?r.interrupt?t:F:k):n(B)}function v(B){return nr(B)?(e.consume(B),l=String.fromCharCode(B),N):n(B)}function N(B){if(B===null||B===47||B===62||Ht(B)){const oe=B===47,ve=l.toLowerCase();return!oe&&!o&&Vk.includes(ve)?(a=1,r.interrupt?t(B):F(B)):I5.includes(l.toLowerCase())?(a=6,oe?(e.consume(B),E):r.interrupt?t(B):F(B)):(a=7,r.interrupt&&!r.parser.lazy[r.now().line]?n(B):o?C(B):S(B))}return B===45||Gn(B)?(e.consume(B),l+=String.fromCharCode(B),N):n(B)}function E(B){return B===62?(e.consume(B),r.interrupt?t:F):n(B)}function C(B){return gt(B)?(e.consume(B),C):z(B)}function S(B){return B===47?(e.consume(B),z):B===58||B===95||nr(B)?(e.consume(B),_):gt(B)?(e.consume(B),S):z(B)}function _(B){return B===45||B===46||B===58||B===95||Gn(B)?(e.consume(B),_):M(B)}function M(B){return B===61?(e.consume(B),T):gt(B)?(e.consume(B),M):S(B)}function T(B){return B===null||B===60||B===61||B===62||B===96?n(B):B===34||B===39?(e.consume(B),f=B,L):gt(B)?(e.consume(B),T):R(B)}function L(B){return B===f?(e.consume(B),f=null,$):B===null||Je(B)?n(B):(e.consume(B),L)}function R(B){return B===null||B===34||B===39||B===47||B===60||B===61||B===62||B===96||Ht(B)?M(B):(e.consume(B),R)}function $(B){return B===47||B===62||gt(B)?S(B):n(B)}function z(B){return B===62?(e.consume(B),q):n(B)}function q(B){return B===null||Je(B)?F(B):gt(B)?(e.consume(B),q):n(B)}function F(B){return B===45&&a===2?(e.consume(B),O):B===60&&a===1?(e.consume(B),V):B===62&&a===4?(e.consume(B),P):B===63&&a===3?(e.consume(B),I):B===93&&a===5?(e.consume(B),K):Je(B)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(P5,G,Y)(B)):B===null||Je(B)?(e.exit("htmlFlowData"),Y(B)):(e.consume(B),F)}function Y(B){return e.check(B5,D,G)(B)}function D(B){return e.enter("lineEnding"),e.consume(B),e.exit("lineEnding"),H}function H(B){return B===null||Je(B)?Y(B):(e.enter("htmlFlowData"),F(B))}function O(B){return B===45?(e.consume(B),I):F(B)}function V(B){return B===47?(e.consume(B),l="",Q):F(B)}function Q(B){if(B===62){const oe=l.toLowerCase();return Vk.includes(oe)?(e.consume(B),P):F(B)}return nr(B)&&l.length<8?(e.consume(B),l+=String.fromCharCode(B),Q):F(B)}function K(B){return B===93?(e.consume(B),I):F(B)}function I(B){return B===62?(e.consume(B),P):B===45&&a===2?(e.consume(B),I):F(B)}function P(B){return B===null||Je(B)?(e.exit("htmlFlowData"),G(B)):(e.consume(B),P)}function G(B){return e.exit("htmlFlow"),t(B)}}function F5(e,t,n){const r=this;return a;function a(l){return Je(l)?(e.enter("lineEnding"),e.consume(l),e.exit("lineEnding"),o):n(l)}function o(l){return r.parser.lazy[r.now().line]?n(l):t(l)}}function q5(e,t,n){return r;function r(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Ju,t,n)}}const H5={name:"htmlText",tokenize:K5};function K5(e,t,n){const r=this;let a,o,l;return d;function d(I){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(I),f}function f(I){return I===33?(e.consume(I),h):I===47?(e.consume(I),M):I===63?(e.consume(I),S):nr(I)?(e.consume(I),R):n(I)}function h(I){return I===45?(e.consume(I),g):I===91?(e.consume(I),o=0,k):nr(I)?(e.consume(I),C):n(I)}function g(I){return I===45?(e.consume(I),b):n(I)}function m(I){return I===null?n(I):I===45?(e.consume(I),y):Je(I)?(l=m,V(I)):(e.consume(I),m)}function y(I){return I===45?(e.consume(I),b):m(I)}function b(I){return I===62?O(I):I===45?y(I):m(I)}function k(I){const P="CDATA[";return I===P.charCodeAt(o++)?(e.consume(I),o===P.length?v:k):n(I)}function v(I){return I===null?n(I):I===93?(e.consume(I),N):Je(I)?(l=v,V(I)):(e.consume(I),v)}function N(I){return I===93?(e.consume(I),E):v(I)}function E(I){return I===62?O(I):I===93?(e.consume(I),E):v(I)}function C(I){return I===null||I===62?O(I):Je(I)?(l=C,V(I)):(e.consume(I),C)}function S(I){return I===null?n(I):I===63?(e.consume(I),_):Je(I)?(l=S,V(I)):(e.consume(I),S)}function _(I){return I===62?O(I):S(I)}function M(I){return nr(I)?(e.consume(I),T):n(I)}function T(I){return I===45||Gn(I)?(e.consume(I),T):L(I)}function L(I){return Je(I)?(l=L,V(I)):gt(I)?(e.consume(I),L):O(I)}function R(I){return I===45||Gn(I)?(e.consume(I),R):I===47||I===62||Ht(I)?$(I):n(I)}function $(I){return I===47?(e.consume(I),O):I===58||I===95||nr(I)?(e.consume(I),z):Je(I)?(l=$,V(I)):gt(I)?(e.consume(I),$):O(I)}function z(I){return I===45||I===46||I===58||I===95||Gn(I)?(e.consume(I),z):q(I)}function q(I){return I===61?(e.consume(I),F):Je(I)?(l=q,V(I)):gt(I)?(e.consume(I),q):$(I)}function F(I){return I===null||I===60||I===61||I===62||I===96?n(I):I===34||I===39?(e.consume(I),a=I,Y):Je(I)?(l=F,V(I)):gt(I)?(e.consume(I),F):(e.consume(I),D)}function Y(I){return I===a?(e.consume(I),a=void 0,H):I===null?n(I):Je(I)?(l=Y,V(I)):(e.consume(I),Y)}function D(I){return I===null||I===34||I===39||I===60||I===61||I===96?n(I):I===47||I===62||Ht(I)?$(I):(e.consume(I),D)}function H(I){return I===47||I===62||Ht(I)?$(I):n(I)}function O(I){return I===62?(e.consume(I),e.exit("htmlTextData"),e.exit("htmlText"),t):n(I)}function V(I){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(I),e.exit("lineEnding"),Q}function Q(I){return gt(I)?Et(e,K,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(I):K(I)}function K(I){return e.enter("htmlTextData"),l(I)}}const kx={name:"labelEnd",resolveAll:Q5,resolveTo:W5,tokenize:X5},G5={tokenize:Z5},V5={tokenize:J5},Y5={tokenize:eB};function Q5(e){let t=-1;const n=[];for(;++t<e.length;){const r=e[t][1];if(n.push(e[t]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const a=r.type==="labelImage"?4:2;r.type="data",t+=a}}return e.length!==n.length&&jr(e,0,e.length,n),e}function W5(e,t){let n=e.length,r=0,a,o,l,d;for(;n--;)if(a=e[n][1],o){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[n][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(l){if(e[n][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(o=n,a.type!=="labelLink")){r=2;break}}else a.type==="labelEnd"&&(l=n);const f={type:e[o][1].type==="labelLink"?"link":"image",start:{...e[o][1].start},end:{...e[e.length-1][1].end}},h={type:"label",start:{...e[o][1].start},end:{...e[l][1].end}},g={type:"labelText",start:{...e[o+r+2][1].end},end:{...e[l-2][1].start}};return d=[["enter",f,t],["enter",h,t]],d=Hr(d,e.slice(o+1,o+r+3)),d=Hr(d,[["enter",g,t]]),d=Hr(d,ap(t.parser.constructs.insideSpan.null,e.slice(o+r+4,l-3),t)),d=Hr(d,[["exit",g,t],e[l-2],e[l-1],["exit",h,t]]),d=Hr(d,e.slice(l+1)),d=Hr(d,[["exit",f,t]]),jr(e,o,e.length,d),e}function X5(e,t,n){const r=this;let a=r.events.length,o,l;for(;a--;)if((r.events[a][1].type==="labelImage"||r.events[a][1].type==="labelLink")&&!r.events[a][1]._balanced){o=r.events[a][1];break}return d;function d(y){return o?o._inactive?m(y):(l=r.parser.defined.includes(di(r.sliceSerialize({start:o.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(y),e.exit("labelMarker"),e.exit("labelEnd"),f):n(y)}function f(y){return y===40?e.attempt(G5,g,l?g:m)(y):y===91?e.attempt(V5,g,l?h:m)(y):l?g(y):m(y)}function h(y){return e.attempt(Y5,g,m)(y)}function g(y){return t(y)}function m(y){return o._balanced=!0,n(y)}}function Z5(e,t,n){return r;function r(m){return e.enter("resource"),e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),a}function a(m){return Ht(m)?pu(e,o)(m):o(m)}function o(m){return m===41?g(m):B2(e,l,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(m)}function l(m){return Ht(m)?pu(e,f)(m):g(m)}function d(m){return n(m)}function f(m){return m===34||m===39||m===40?U2(e,h,n,"resourceTitle","resourceTitleMarker","resourceTitleString")(m):g(m)}function h(m){return Ht(m)?pu(e,g)(m):g(m)}function g(m){return m===41?(e.enter("resourceMarker"),e.consume(m),e.exit("resourceMarker"),e.exit("resource"),t):n(m)}}function J5(e,t,n){const r=this;return a;function a(d){return $2.call(r,e,o,l,"reference","referenceMarker","referenceString")(d)}function o(d){return r.parser.defined.includes(di(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?t(d):n(d)}function l(d){return n(d)}}function eB(e,t,n){return r;function r(o){return e.enter("reference"),e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),a}function a(o){return o===93?(e.enter("referenceMarker"),e.consume(o),e.exit("referenceMarker"),e.exit("reference"),t):n(o)}}const tB={name:"labelStartImage",resolveAll:kx.resolveAll,tokenize:nB};function nB(e,t,n){const r=this;return a;function a(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),o}function o(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),l):n(d)}function l(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(d):t(d)}}const rB={name:"labelStartLink",resolveAll:kx.resolveAll,tokenize:iB};function iB(e,t,n){const r=this;return a;function a(l){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(l),e.exit("labelMarker"),e.exit("labelLink"),o}function o(l){return l===94&&"_hiddenFootnoteSupport"in r.parser.constructs?n(l):t(l)}}const Kg={name:"lineEnding",tokenize:aB};function aB(e,t){return n;function n(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Et(e,t,"linePrefix")}}const nh={name:"thematicBreak",tokenize:sB};function sB(e,t,n){let r=0,a;return o;function o(h){return e.enter("thematicBreak"),l(h)}function l(h){return a=h,d(h)}function d(h){return h===a?(e.enter("thematicBreakSequence"),f(h)):r>=3&&(h===null||Je(h))?(e.exit("thematicBreak"),t(h)):n(h)}function f(h){return h===a?(e.consume(h),r++,f):(e.exit("thematicBreakSequence"),gt(h)?Et(e,d,"whitespace")(h):d(h))}}const cr={continuation:{tokenize:uB},exit:fB,name:"list",tokenize:cB},oB={partial:!0,tokenize:hB},lB={partial:!0,tokenize:dB};function cB(e,t,n){const r=this,a=r.events[r.events.length-1];let o=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,l=0;return d;function d(b){const k=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:eb(b)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(nh,n,h)(b):h(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),f(b)}return n(b)}function f(b){return eb(b)&&++l<10?(e.consume(b),f):(!r.interrupt||l<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),h(b)):n(b)}function h(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(Ju,r.interrupt?n:g,e.attempt(oB,y,m))}function g(b){return r.containerState.initialBlankLine=!0,o++,y(b)}function m(b){return gt(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),y):n(b)}function y(b){return r.containerState.size=o+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,t(b)}}function uB(e,t,n){const r=this;return r.containerState._closeFlow=void 0,e.check(Ju,a,o);function a(d){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Et(e,t,"listItemIndent",r.containerState.size+1)(d)}function o(d){return r.containerState.furtherBlankLines||!gt(d)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,l(d)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(lB,t,l)(d))}function l(d){return r.containerState._closeFlow=!0,r.interrupt=void 0,Et(e,e.attempt(cr,t,n),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function dB(e,t,n){const r=this;return Et(e,a,"listItemIndent",r.containerState.size+1);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="listItemIndent"&&l[2].sliceSerialize(l[1],!0).length===r.containerState.size?t(o):n(o)}}function fB(e){e.exit(this.containerState.type)}function hB(e,t,n){const r=this;return Et(e,a,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(o){const l=r.events[r.events.length-1];return!gt(o)&&l&&l[1].type==="listItemPrefixWhitespace"?t(o):n(o)}}const Yk={name:"setextUnderline",resolveTo:pB,tokenize:mB};function pB(e,t){let n=e.length,r,a,o;for(;n--;)if(e[n][0]==="enter"){if(e[n][1].type==="content"){r=n;break}e[n][1].type==="paragraph"&&(a=n)}else e[n][1].type==="content"&&e.splice(n,1),!o&&e[n][1].type==="definition"&&(o=n);const l={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",o?(e.splice(a,0,["enter",l,t]),e.splice(o+1,0,["exit",e[r][1],t]),e[r][1].end={...e[o][1].end}):e[r][1]=l,e.push(["exit",l,t]),e}function mB(e,t,n){const r=this;let a;return o;function o(h){let g=r.events.length,m;for(;g--;)if(r.events[g][1].type!=="lineEnding"&&r.events[g][1].type!=="linePrefix"&&r.events[g][1].type!=="content"){m=r.events[g][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||m)?(e.enter("setextHeadingLine"),a=h,l(h)):n(h)}function l(h){return e.enter("setextHeadingLineSequence"),d(h)}function d(h){return h===a?(e.consume(h),d):(e.exit("setextHeadingLineSequence"),gt(h)?Et(e,f,"lineSuffix")(h):f(h))}function f(h){return h===null||Je(h)?(e.exit("setextHeadingLine"),t(h)):n(h)}}const gB={tokenize:yB};function yB(e){const t=this,n=e.attempt(Ju,r,e.attempt(this.parser.constructs.flowInitial,a,Et(e,e.attempt(this.parser.constructs.flow,a,e.attempt(k5,a)),"linePrefix")));return n;function r(o){if(o===null){e.consume(o);return}return e.enter("lineEndingBlank"),e.consume(o),e.exit("lineEndingBlank"),t.currentConstruct=void 0,n}function a(o){if(o===null){e.consume(o);return}return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),t.currentConstruct=void 0,n}}const bB={resolveAll:q2()},xB=F2("string"),vB=F2("text");function F2(e){return{resolveAll:q2(e==="text"?wB:void 0),tokenize:t};function t(n){const r=this,a=this.parser.constructs[e],o=n.attempt(a,l,d);return l;function l(g){return h(g)?o(g):d(g)}function d(g){if(g===null){n.consume(g);return}return n.enter("data"),n.consume(g),f}function f(g){return h(g)?(n.exit("data"),o(g)):(n.consume(g),f)}function h(g){if(g===null)return!0;const m=a[g];let y=-1;if(m)for(;++y<m.length;){const b=m[y];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function q2(e){return t;function t(n,r){let a=-1,o;for(;++a<=n.length;)o===void 0?n[a]&&n[a][1].type==="data"&&(o=a,a++):(!n[a]||n[a][1].type!=="data")&&(a!==o+2&&(n[o][1].end=n[a-1][1].end,n.splice(o+2,a-o-2),a=o+2),o=void 0);return e?e(n,r):n}}function wB(e,t){let n=0;for(;++n<=e.length;)if((n===e.length||e[n][1].type==="lineEnding")&&e[n-1][1].type==="data"){const r=e[n-1][1],a=t.sliceStream(r);let o=a.length,l=-1,d=0,f;for(;o--;){const h=a[o];if(typeof h=="string"){for(l=h.length;h.charCodeAt(l-1)===32;)d++,l--;if(l)break;l=-1}else if(h===-2)f=!0,d++;else if(h!==-1){o++;break}}if(t._contentTypeTextTrailing&&n===e.length&&(d=0),d){const h={type:n===e.length||f||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:o?l:r.start._bufferIndex+l,_index:r.start._index+o,line:r.end.line,column:r.end.column-d,offset:r.end.offset-d},end:{...r.end}};r.end={...h.start},r.start.offset===r.end.offset?Object.assign(r,h):(e.splice(n,0,["enter",h,t],["exit",h,t]),n+=2)}n++}return e}const kB={42:cr,43:cr,45:cr,48:cr,49:cr,50:cr,51:cr,52:cr,53:cr,54:cr,55:cr,56:cr,57:cr,62:L2},EB={91:j5},SB={[-2]:Hg,[-1]:Hg,32:Hg},NB={35:O5,42:nh,45:[Yk,nh],60:z5,61:Yk,95:nh,96:Gk,126:Gk},_B={38:z2,92:I2},jB={[-5]:Kg,[-4]:Kg,[-3]:Kg,33:tB,38:z2,42:tb,60:[r5,H5],91:rB,92:[M5,I2],93:kx,95:tb,96:g5},CB={null:[tb,bB]},AB={null:[42,95]},TB={null:[]},MB=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:AB,contentInitial:EB,disable:TB,document:kB,flow:NB,flowInitial:SB,insideSpan:CB,string:_B,text:jB},Symbol.toStringTag,{value:"Module"}));function DB(e,t,n){let r={_bufferIndex:-1,_index:0,line:n&&n.line||1,column:n&&n.column||1,offset:n&&n.offset||0};const a={},o=[];let l=[],d=[];const f={attempt:L(M),check:L(T),consume:C,enter:S,exit:_,interrupt:L(T,{interrupt:!0})},h={code:null,containerState:{},defineSkip:v,events:[],now:k,parser:e,previous:null,sliceSerialize:y,sliceStream:b,write:m};let g=t.tokenize.call(h,f);return t.resolveAll&&o.push(t),h;function m(q){return l=Hr(l,q),N(),l[l.length-1]!==null?[]:(R(t,0),h.events=ap(o,h.events,h),h.events)}function y(q,F){return RB(b(q),F)}function b(q){return OB(l,q)}function k(){const{_bufferIndex:q,_index:F,line:Y,column:D,offset:H}=r;return{_bufferIndex:q,_index:F,line:Y,column:D,offset:H}}function v(q){a[q.line]=q.column,z()}function N(){let q;for(;r._index<l.length;){const F=l[r._index];if(typeof F=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<F.length;)E(F.charCodeAt(r._bufferIndex));else E(F)}}function E(q){g=g(q)}function C(q){Je(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,z()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===l[r._index].length&&(r._bufferIndex=-1,r._index++)),h.previous=q}function S(q,F){const Y=F||{};return Y.type=q,Y.start=k(),h.events.push(["enter",Y,h]),d.push(Y),Y}function _(q){const F=d.pop();return F.end=k(),h.events.push(["exit",F,h]),F}function M(q,F){R(q,F.from)}function T(q,F){F.restore()}function L(q,F){return Y;function Y(D,H,O){let V,Q,K,I;return Array.isArray(D)?G(D):"tokenize"in D?G([D]):P(D);function P(ke){return Se;function Se(J){const ue=J!==null&&ke[J],Te=J!==null&&ke.null,Oe=[...Array.isArray(ue)?ue:ue?[ue]:[],...Array.isArray(Te)?Te:Te?[Te]:[]];return G(Oe)(J)}}function G(ke){return V=ke,Q=0,ke.length===0?O:B(ke[Q])}function B(ke){return Se;function Se(J){return I=$(),K=ke,ke.partial||(h.currentConstruct=ke),ke.name&&h.parser.constructs.disable.null.includes(ke.name)?ve():ke.tokenize.call(F?Object.assign(Object.create(h),F):h,f,oe,ve)(J)}}function oe(ke){return q(K,I),H}function ve(ke){return I.restore(),++Q<V.length?B(V[Q]):O}}}function R(q,F){q.resolveAll&&!o.includes(q)&&o.push(q),q.resolve&&jr(h.events,F,h.events.length-F,q.resolve(h.events.slice(F),h)),q.resolveTo&&(h.events=q.resolveTo(h.events,h))}function $(){const q=k(),F=h.previous,Y=h.currentConstruct,D=h.events.length,H=Array.from(d);return{from:D,restore:O};function O(){r=q,h.previous=F,h.currentConstruct=Y,h.events.length=D,d=H,z()}}function z(){r.line in a&&r.column<2&&(r.column=a[r.line],r.offset+=a[r.line]-1)}}function OB(e,t){const n=t.start._index,r=t.start._bufferIndex,a=t.end._index,o=t.end._bufferIndex;let l;if(n===a)l=[e[n].slice(r,o)];else{if(l=e.slice(n,a),r>-1){const d=l[0];typeof d=="string"?l[0]=d.slice(r):l.shift()}o>0&&l.push(e[a].slice(0,o))}return l}function RB(e,t){let n=-1;const r=[];let a;for(;++n<e.length;){const o=e[n];let l;if(typeof o=="string")l=o;else switch(o){case-5:{l="\r";break}case-4:{l=`
|
|
608
|
-
`;break}case-3:{l=`\r
|
|
609
|
-
`;break}case-2:{l=t?" ":" ";break}case-1:{if(!t&&a)continue;l=" ";break}default:l=String.fromCharCode(o)}a=o===-2,r.push(l)}return r.join("")}function LB(e){const r={constructs:O2([MB,...(e||{}).extensions||[]]),content:a(WP),defined:[],document:a(ZP),flow:a(gB),lazy:{},string:a(xB),text:a(vB)};return r;function a(o){return l;function l(d){return DB(r,o,d)}}}function IB(e){for(;!P2(e););return e}const Qk=/[\0\t\n\r]/g;function zB(){let e=1,t="",n=!0,r;return a;function a(o,l,d){const f=[];let h,g,m,y,b;for(o=t+(typeof o=="string"?o.toString():new TextDecoder(l||void 0).decode(o)),m=0,t="",n&&(o.charCodeAt(0)===65279&&m++,n=void 0);m<o.length;){if(Qk.lastIndex=m,h=Qk.exec(o),y=h&&h.index!==void 0?h.index:o.length,b=o.charCodeAt(y),!h){t=o.slice(m);break}if(b===10&&m===y&&r)f.push(-3),r=void 0;else switch(r&&(f.push(-5),r=void 0),m<y&&(f.push(o.slice(m,y)),e+=y-m),b){case 0:{f.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,f.push(-2);e++<g;)f.push(-1);break}case 10:{f.push(-4),e=1;break}default:r=!0,e=1}m=y+1}return d&&(r&&f.push(-5),t&&f.push(t),f.push(null)),f}}const PB=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function BB(e){return e.replace(PB,$B)}function $B(e,t,n){if(t)return t;if(n.charCodeAt(0)===35){const a=n.charCodeAt(1),o=a===120||a===88;return R2(n.slice(o?2:1),o?16:10)}return wx(n)||e}const H2={}.hasOwnProperty;function UB(e,t,n){return t&&typeof t=="object"&&(n=t,t=void 0),FB(n)(IB(LB(n).document().write(zB()(e,t,!0))))}function FB(e){const t={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:o(ae),autolinkProtocol:$,autolinkEmail:$,atxHeading:o(te),blockQuote:o(Te),characterEscape:$,characterReference:$,codeFenced:o(Oe),codeFencedFenceInfo:l,codeFencedFenceMeta:l,codeIndented:o(Oe,l),codeText:o(De,l),codeTextData:$,data:$,codeFlowValue:$,definition:o(ce),definitionDestinationString:l,definitionLabelString:l,definitionTitleString:l,emphasis:o(Ce),hardBreakEscape:o(pe),hardBreakTrailing:o(pe),htmlFlow:o(Fe,l),htmlFlowData:$,htmlText:o(Fe,l),htmlTextData:$,image:o(ze),label:l,link:o(ae),listItem:o(ye),listItemValue:y,listOrdered:o(be,m),listUnordered:o(be),paragraph:o(he),reference:B,referenceString:l,resourceDestinationString:l,resourceTitleString:l,setextHeading:o(te),strong:o(Ee),thematicBreak:o(Ke)},exit:{atxHeading:f(),atxHeadingSequence:M,autolink:f(),autolinkEmail:ue,autolinkProtocol:J,blockQuote:f(),characterEscapeValue:z,characterReferenceMarkerHexadecimal:ve,characterReferenceMarkerNumeric:ve,characterReferenceValue:ke,characterReference:Se,codeFenced:f(N),codeFencedFence:v,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:z,codeIndented:f(E),codeText:f(H),codeTextData:z,data:z,definition:f(),definitionDestinationString:_,definitionLabelString:C,definitionTitleString:S,emphasis:f(),hardBreakEscape:f(F),hardBreakTrailing:f(F),htmlFlow:f(Y),htmlFlowData:z,htmlText:f(D),htmlTextData:z,image:f(V),label:K,labelText:Q,lineEnding:q,link:f(O),listItem:f(),listOrdered:f(),listUnordered:f(),paragraph:f(),referenceString:oe,resourceDestinationString:I,resourceTitleString:P,resource:G,setextHeading:f(R),setextHeadingLineSequence:L,setextHeadingText:T,strong:f(),thematicBreak:f()}};K2(t,(e||{}).mdastExtensions||[]);const n={};return r;function r(ne){let de={type:"root",children:[]};const Le={stack:[de],tokenStack:[],config:t,enter:d,exit:h,buffer:l,resume:g,data:n},Ze=[];let it=-1;for(;++it<ne.length;)if(ne[it][1].type==="listOrdered"||ne[it][1].type==="listUnordered")if(ne[it][0]==="enter")Ze.push(it);else{const At=Ze.pop();it=a(ne,At,it)}for(it=-1;++it<ne.length;){const At=t[ne[it][0]];H2.call(At,ne[it][1].type)&&At[ne[it][1].type].call(Object.assign({sliceSerialize:ne[it][2].sliceSerialize},Le),ne[it][1])}if(Le.tokenStack.length>0){const At=Le.tokenStack[Le.tokenStack.length-1];(At[1]||Wk).call(Le,void 0,At[0])}for(de.position={start:ns(ne.length>0?ne[0][1].start:{line:1,column:1,offset:0}),end:ns(ne.length>0?ne[ne.length-2][1].end:{line:1,column:1,offset:0})},it=-1;++it<t.transforms.length;)de=t.transforms[it](de)||de;return de}function a(ne,de,Le){let Ze=de-1,it=-1,At=!1,$n,dn,Mt,Qt;for(;++Ze<=Le;){const yt=ne[Ze];switch(yt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{yt[0]==="enter"?it++:it--,Qt=void 0;break}case"lineEndingBlank":{yt[0]==="enter"&&($n&&!Qt&&!it&&!Mt&&(Mt=Ze),Qt=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Qt=void 0}if(!it&&yt[0]==="enter"&&yt[1].type==="listItemPrefix"||it===-1&&yt[0]==="exit"&&(yt[1].type==="listUnordered"||yt[1].type==="listOrdered")){if($n){let Tr=Ze;for(dn=void 0;Tr--;){const Rn=ne[Tr];if(Rn[1].type==="lineEnding"||Rn[1].type==="lineEndingBlank"){if(Rn[0]==="exit")continue;dn&&(ne[dn][1].type="lineEndingBlank",At=!0),Rn[1].type="lineEnding",dn=Tr}else if(!(Rn[1].type==="linePrefix"||Rn[1].type==="blockQuotePrefix"||Rn[1].type==="blockQuotePrefixWhitespace"||Rn[1].type==="blockQuoteMarker"||Rn[1].type==="listItemIndent"))break}Mt&&(!dn||Mt<dn)&&($n._spread=!0),$n.end=Object.assign({},dn?ne[dn][1].start:yt[1].end),ne.splice(dn||Ze,0,["exit",$n,yt[2]]),Ze++,Le++}if(yt[1].type==="listItemPrefix"){const Tr={type:"listItem",_spread:!1,start:Object.assign({},yt[1].start),end:void 0};$n=Tr,ne.splice(Ze,0,["enter",Tr,yt[2]]),Ze++,Le++,Mt=void 0,Qt=!0}}}return ne[de][1]._spread=At,Le}function o(ne,de){return Le;function Le(Ze){d.call(this,ne(Ze),Ze),de&&de.call(this,Ze)}}function l(){this.stack.push({type:"fragment",children:[]})}function d(ne,de,Le){this.stack[this.stack.length-1].children.push(ne),this.stack.push(ne),this.tokenStack.push([de,Le||void 0]),ne.position={start:ns(de.start),end:void 0}}function f(ne){return de;function de(Le){ne&&ne.call(this,Le),h.call(this,Le)}}function h(ne,de){const Le=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==ne.type&&(de?de.call(this,ne,Ze[0]):(Ze[1]||Wk).call(this,ne,Ze[0]));else throw new Error("Cannot close `"+ne.type+"` ("+hu({start:ne.start,end:ne.end})+"): it’s not open");Le.position.end=ns(ne.end)}function g(){return vx(this.stack.pop())}function m(){this.data.expectingFirstListItemValue=!0}function y(ne){if(this.data.expectingFirstListItemValue){const de=this.stack[this.stack.length-2];de.start=Number.parseInt(this.sliceSerialize(ne),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.lang=ne}function k(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.meta=ne}function v(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function N(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne.replace(/(\r?\n|\r)$/g,"")}function C(ne){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=di(this.sliceSerialize(ne)).toLowerCase()}function S(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function _(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function M(ne){const de=this.stack[this.stack.length-1];if(!de.depth){const Le=this.sliceSerialize(ne).length;de.depth=Le}}function T(){this.data.setextHeadingSlurpLineEnding=!0}function L(ne){const de=this.stack[this.stack.length-1];de.depth=this.sliceSerialize(ne).codePointAt(0)===61?1:2}function R(){this.data.setextHeadingSlurpLineEnding=void 0}function $(ne){const Le=this.stack[this.stack.length-1].children;let Ze=Le[Le.length-1];(!Ze||Ze.type!=="text")&&(Ze=Ne(),Ze.position={start:ns(ne.start),end:void 0},Le.push(Ze)),this.stack.push(Ze)}function z(ne){const de=this.stack.pop();de.value+=this.sliceSerialize(ne),de.position.end=ns(ne.end)}function q(ne){const de=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Le=de.children[de.children.length-1];Le.position.end=ns(ne.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&t.canContainEols.includes(de.type)&&($.call(this,ne),z.call(this,ne))}function F(){this.data.atHardBreak=!0}function Y(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function D(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function H(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.value=ne}function O(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function V(){const ne=this.stack[this.stack.length-1];if(this.data.inReference){const de=this.data.referenceType||"shortcut";ne.type+="Reference",ne.referenceType=de,delete ne.url,delete ne.title}else delete ne.identifier,delete ne.label;this.data.referenceType=void 0}function Q(ne){const de=this.sliceSerialize(ne),Le=this.stack[this.stack.length-2];Le.label=BB(de),Le.identifier=di(de).toLowerCase()}function K(){const ne=this.stack[this.stack.length-1],de=this.resume(),Le=this.stack[this.stack.length-1];if(this.data.inReference=!0,Le.type==="link"){const Ze=ne.children;Le.children=Ze}else Le.alt=de}function I(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.url=ne}function P(){const ne=this.resume(),de=this.stack[this.stack.length-1];de.title=ne}function G(){this.data.inReference=void 0}function B(){this.data.referenceType="collapsed"}function oe(ne){const de=this.resume(),Le=this.stack[this.stack.length-1];Le.label=de,Le.identifier=di(this.sliceSerialize(ne)).toLowerCase(),this.data.referenceType="full"}function ve(ne){this.data.characterReferenceType=ne.type}function ke(ne){const de=this.sliceSerialize(ne),Le=this.data.characterReferenceType;let Ze;Le?(Ze=R2(de,Le==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=wx(de);const it=this.stack[this.stack.length-1];it.value+=Ze}function Se(ne){const de=this.stack.pop();de.position.end=ns(ne.end)}function J(ne){z.call(this,ne);const de=this.stack[this.stack.length-1];de.url=this.sliceSerialize(ne)}function ue(ne){z.call(this,ne);const de=this.stack[this.stack.length-1];de.url="mailto:"+this.sliceSerialize(ne)}function Te(){return{type:"blockquote",children:[]}}function Oe(){return{type:"code",lang:null,meta:null,value:""}}function De(){return{type:"inlineCode",value:""}}function ce(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ce(){return{type:"emphasis",children:[]}}function te(){return{type:"heading",depth:0,children:[]}}function pe(){return{type:"break"}}function Fe(){return{type:"html",value:""}}function ze(){return{type:"image",title:null,url:"",alt:null}}function ae(){return{type:"link",title:null,url:"",children:[]}}function be(ne){return{type:"list",ordered:ne.type==="listOrdered",start:null,spread:ne._spread,children:[]}}function ye(ne){return{type:"listItem",spread:ne._spread,checked:null,children:[]}}function he(){return{type:"paragraph",children:[]}}function Ee(){return{type:"strong",children:[]}}function Ne(){return{type:"text",value:""}}function Ke(){return{type:"thematicBreak"}}}function ns(e){return{line:e.line,column:e.column,offset:e.offset}}function K2(e,t){let n=-1;for(;++n<t.length;){const r=t[n];Array.isArray(r)?K2(e,r):qB(e,r)}}function qB(e,t){let n;for(n in t)if(H2.call(t,n))switch(n){case"canContainEols":{const r=t[n];r&&e[n].push(...r);break}case"transforms":{const r=t[n];r&&e[n].push(...r);break}case"enter":case"exit":{const r=t[n];r&&Object.assign(e[n],r);break}}}function Wk(e,t){throw e?new Error("Cannot close `"+e.type+"` ("+hu({start:e.start,end:e.end})+"): a different token (`"+t.type+"`, "+hu({start:t.start,end:t.end})+") is open"):new Error("Cannot close document, a token (`"+t.type+"`, "+hu({start:t.start,end:t.end})+") is still open")}function HB(e){const t=this;t.parser=n;function n(r){return UB(r,{...t.data("settings"),...e,extensions:t.data("micromarkExtensions")||[],mdastExtensions:t.data("fromMarkdownExtensions")||[]})}}function KB(e,t){const n={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(t),!0)};return e.patch(t,n),e.applyData(t,n)}function GB(e,t){const n={type:"element",tagName:"br",properties:{},children:[]};return e.patch(t,n),[e.applyData(t,n),{type:"text",value:`
|
|
610
|
-
`}]}function VB(e,t){const n=t.value?t.value+`
|
|
611
|
-
`:"",r={},a=t.lang?t.lang.split(/\s+/):[];a.length>0&&(r.className=["language-"+a[0]]);let o={type:"element",tagName:"code",properties:r,children:[{type:"text",value:n}]};return t.meta&&(o.data={meta:t.meta}),e.patch(t,o),o=e.applyData(t,o),o={type:"element",tagName:"pre",properties:{},children:[o]},e.patch(t,o),o}function YB(e,t){const n={type:"element",tagName:"del",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function QB(e,t){const n={type:"element",tagName:"em",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function WB(e,t){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(t.identifier).toUpperCase(),a=oc(r.toLowerCase()),o=e.footnoteOrder.indexOf(r);let l,d=e.footnoteCounts.get(r);d===void 0?(d=0,e.footnoteOrder.push(r),l=e.footnoteOrder.length):l=o+1,d+=1,e.footnoteCounts.set(r,d);const f={type:"element",tagName:"a",properties:{href:"#"+n+"fn-"+a,id:n+"fnref-"+a+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(l)}]};e.patch(t,f);const h={type:"element",tagName:"sup",properties:{},children:[f]};return e.patch(t,h),e.applyData(t,h)}function XB(e,t){const n={type:"element",tagName:"h"+t.depth,properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function ZB(e,t){if(e.options.allowDangerousHtml){const n={type:"raw",value:t.value};return e.patch(t,n),e.applyData(t,n)}}function G2(e,t){const n=t.referenceType;let r="]";if(n==="collapsed"?r+="[]":n==="full"&&(r+="["+(t.label||t.identifier)+"]"),t.type==="imageReference")return[{type:"text",value:"!["+t.alt+r}];const a=e.all(t),o=a[0];o&&o.type==="text"?o.value="["+o.value:a.unshift({type:"text",value:"["});const l=a[a.length-1];return l&&l.type==="text"?l.value+=r:a.push({type:"text",value:r}),a}function JB(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return G2(e,t);const a={src:oc(r.url||""),alt:t.alt};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"img",properties:a,children:[]};return e.patch(t,o),e.applyData(t,o)}function e6(e,t){const n={src:oc(t.url)};t.alt!==null&&t.alt!==void 0&&(n.alt=t.alt),t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"img",properties:n,children:[]};return e.patch(t,r),e.applyData(t,r)}function t6(e,t){const n={type:"text",value:t.value.replace(/\r?\n|\r/g," ")};e.patch(t,n);const r={type:"element",tagName:"code",properties:{},children:[n]};return e.patch(t,r),e.applyData(t,r)}function n6(e,t){const n=String(t.identifier).toUpperCase(),r=e.definitionById.get(n);if(!r)return G2(e,t);const a={href:oc(r.url||"")};r.title!==null&&r.title!==void 0&&(a.title=r.title);const o={type:"element",tagName:"a",properties:a,children:e.all(t)};return e.patch(t,o),e.applyData(t,o)}function r6(e,t){const n={href:oc(t.url)};t.title!==null&&t.title!==void 0&&(n.title=t.title);const r={type:"element",tagName:"a",properties:n,children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function i6(e,t,n){const r=e.all(t),a=n?a6(n):V2(t),o={},l=[];if(typeof t.checked=="boolean"){const g=r[0];let m;g&&g.type==="element"&&g.tagName==="p"?m=g:(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:t.checked,disabled:!0},children:[]}),o.className=["task-list-item"]}let d=-1;for(;++d<r.length;){const g=r[d];(a||d!==0||g.type!=="element"||g.tagName!=="p")&&l.push({type:"text",value:`
|
|
612
|
-
`}),g.type==="element"&&g.tagName==="p"&&!a?l.push(...g.children):l.push(g)}const f=r[r.length-1];f&&(a||f.type!=="element"||f.tagName!=="p")&&l.push({type:"text",value:`
|
|
613
|
-
`});const h={type:"element",tagName:"li",properties:o,children:l};return e.patch(t,h),e.applyData(t,h)}function a6(e){let t=!1;if(e.type==="list"){t=e.spread||!1;const n=e.children;let r=-1;for(;!t&&++r<n.length;)t=V2(n[r])}return t}function V2(e){const t=e.spread;return t??e.children.length>1}function s6(e,t){const n={},r=e.all(t);let a=-1;for(typeof t.start=="number"&&t.start!==1&&(n.start=t.start);++a<r.length;){const l=r[a];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 o={type:"element",tagName:t.ordered?"ol":"ul",properties:n,children:e.wrap(r,!0)};return e.patch(t,o),e.applyData(t,o)}function o6(e,t){const n={type:"element",tagName:"p",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function l6(e,t){const n={type:"root",children:e.wrap(e.all(t))};return e.patch(t,n),e.applyData(t,n)}function c6(e,t){const n={type:"element",tagName:"strong",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}function u6(e,t){const n=e.all(t),r=n.shift(),a=[];if(r){const l={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(t.children[0],l),a.push(l)}if(n.length>0){const l={type:"element",tagName:"tbody",properties:{},children:e.wrap(n,!0)},d=gx(t.children[1]),f=_2(t.children[t.children.length-1]);d&&f&&(l.position={start:d,end:f}),a.push(l)}const o={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(t,o),e.applyData(t,o)}function d6(e,t,n){const r=n?n.children:void 0,o=(r?r.indexOf(t):1)===0?"th":"td",l=n&&n.type==="table"?n.align:void 0,d=l?l.length:t.children.length;let f=-1;const h=[];for(;++f<d;){const m=t.children[f],y={},b=l?l[f]:void 0;b&&(y.align=b);let k={type:"element",tagName:o,properties:y,children:[]};m&&(k.children=e.all(m),e.patch(m,k),k=e.applyData(m,k)),h.push(k)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(h,!0)};return e.patch(t,g),e.applyData(t,g)}function f6(e,t){const n={type:"element",tagName:"td",properties:{},children:e.all(t)};return e.patch(t,n),e.applyData(t,n)}const Xk=9,Zk=32;function h6(e){const t=String(e),n=/\r?\n|\r/g;let r=n.exec(t),a=0;const o=[];for(;r;)o.push(Jk(t.slice(a,r.index),a>0,!0),r[0]),a=r.index+r[0].length,r=n.exec(t);return o.push(Jk(t.slice(a),a>0,!1)),o.join("")}function Jk(e,t,n){let r=0,a=e.length;if(t){let o=e.codePointAt(r);for(;o===Xk||o===Zk;)r++,o=e.codePointAt(r)}if(n){let o=e.codePointAt(a-1);for(;o===Xk||o===Zk;)a--,o=e.codePointAt(a-1)}return a>r?e.slice(r,a):""}function p6(e,t){const n={type:"text",value:h6(String(t.value))};return e.patch(t,n),e.applyData(t,n)}function m6(e,t){const n={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(t,n),e.applyData(t,n)}const g6={blockquote:KB,break:GB,code:VB,delete:YB,emphasis:QB,footnoteReference:WB,heading:XB,html:ZB,imageReference:JB,image:e6,inlineCode:t6,linkReference:n6,link:r6,listItem:i6,list:s6,paragraph:o6,root:l6,strong:c6,table:u6,tableCell:f6,tableRow:d6,text:p6,thematicBreak:m6,toml:Tf,yaml:Tf,definition:Tf,footnoteDefinition:Tf};function Tf(){}const Y2=-1,sp=0,mu=1,vh=2,Ex=3,Sx=4,Nx=5,_x=6,Q2=7,W2=8,eE=typeof self=="object"?self:globalThis,y6=(e,t)=>{const n=(a,o)=>(e.set(o,a),a),r=a=>{if(e.has(a))return e.get(a);const[o,l]=t[a];switch(o){case sp:case Y2:return n(l,a);case mu:{const d=n([],a);for(const f of l)d.push(r(f));return d}case vh:{const d=n({},a);for(const[f,h]of l)d[r(f)]=r(h);return d}case Ex:return n(new Date(l),a);case Sx:{const{source:d,flags:f}=l;return n(new RegExp(d,f),a)}case Nx:{const d=n(new Map,a);for(const[f,h]of l)d.set(r(f),r(h));return d}case _x:{const d=n(new Set,a);for(const f of l)d.add(r(f));return d}case Q2:{const{name:d,message:f}=l;return n(new eE[d](f),a)}case W2:return n(BigInt(l),a);case"BigInt":return n(Object(BigInt(l)),a);case"ArrayBuffer":return n(new Uint8Array(l).buffer,l);case"DataView":{const{buffer:d}=new Uint8Array(l);return n(new DataView(d),l)}}return n(new eE[o](l),a)};return r},tE=e=>y6(new Map,e)(0),cl="",{toString:b6}={},{keys:x6}=Object,iu=e=>{const t=typeof e;if(t!=="object"||!e)return[sp,t];const n=b6.call(e).slice(8,-1);switch(n){case"Array":return[mu,cl];case"Object":return[vh,cl];case"Date":return[Ex,cl];case"RegExp":return[Sx,cl];case"Map":return[Nx,cl];case"Set":return[_x,cl];case"DataView":return[mu,n]}return n.includes("Array")?[mu,n]:n.includes("Error")?[Q2,n]:[vh,n]},Mf=([e,t])=>e===sp&&(t==="function"||t==="symbol"),v6=(e,t,n,r)=>{const a=(l,d)=>{const f=r.push(l)-1;return n.set(d,f),f},o=l=>{if(n.has(l))return n.get(l);let[d,f]=iu(l);switch(d){case sp:{let g=l;switch(f){case"bigint":d=W2,g=l.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+f);g=null;break;case"undefined":return a([Y2],l)}return a([d,g],l)}case mu:{if(f){let y=l;return f==="DataView"?y=new Uint8Array(l.buffer):f==="ArrayBuffer"&&(y=new Uint8Array(l)),a([f,[...y]],l)}const g=[],m=a([d,g],l);for(const y of l)g.push(o(y));return m}case vh:{if(f)switch(f){case"BigInt":return a([f,l.toString()],l);case"Boolean":case"Number":case"String":return a([f,l.valueOf()],l)}if(t&&"toJSON"in l)return o(l.toJSON());const g=[],m=a([d,g],l);for(const y of x6(l))(e||!Mf(iu(l[y])))&&g.push([o(y),o(l[y])]);return m}case Ex:return a([d,l.toISOString()],l);case Sx:{const{source:g,flags:m}=l;return a([d,{source:g,flags:m}],l)}case Nx:{const g=[],m=a([d,g],l);for(const[y,b]of l)(e||!(Mf(iu(y))||Mf(iu(b))))&&g.push([o(y),o(b)]);return m}case _x:{const g=[],m=a([d,g],l);for(const y of l)(e||!Mf(iu(y)))&&g.push(o(y));return m}}const{message:h}=l;return a([d,{name:f,message:h}],l)};return o},nE=(e,{json:t,lossy:n}={})=>{const r=[];return v6(!(t||n),!!t,new Map,r)(e),r},wh=typeof structuredClone=="function"?(e,t)=>t&&("json"in t||"lossy"in t)?tE(nE(e,t)):structuredClone(e):(e,t)=>tE(nE(e,t));function w6(e,t){const n=[{type:"text",value:"↩"}];return t>1&&n.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(t)}]}),n}function k6(e,t){return"Back to reference "+(e+1)+(t>1?"-"+t:"")}function E6(e){const t=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",n=e.options.footnoteBackContent||w6,r=e.options.footnoteBackLabel||k6,a=e.options.footnoteLabel||"Footnotes",o=e.options.footnoteLabelTagName||"h2",l=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let f=-1;for(;++f<e.footnoteOrder.length;){const h=e.footnoteById.get(e.footnoteOrder[f]);if(!h)continue;const g=e.all(h),m=String(h.identifier).toUpperCase(),y=oc(m.toLowerCase());let b=0;const k=[],v=e.footnoteCounts.get(m);for(;v!==void 0&&++b<=v;){k.length>0&&k.push({type:"text",value:" "});let C=typeof n=="string"?n:n(f,b);typeof C=="string"&&(C={type:"text",value:C}),k.push({type:"element",tagName:"a",properties:{href:"#"+t+"fnref-"+y+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(f,b),className:["data-footnote-backref"]},children:Array.isArray(C)?C:[C]})}const N=g[g.length-1];if(N&&N.type==="element"&&N.tagName==="p"){const C=N.children[N.children.length-1];C&&C.type==="text"?C.value+=" ":N.children.push({type:"text",value:" "}),N.children.push(...k)}else g.push(...k);const E={type:"element",tagName:"li",properties:{id:t+"fn-"+y},children:e.wrap(g,!0)};e.patch(h,E),d.push(E)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:o,properties:{...wh(l),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
614
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
615
|
-
`}]}}const ed=(function(e){if(e==null)return j6;if(typeof e=="function")return op(e);if(typeof e=="object")return Array.isArray(e)?S6(e):N6(e);if(typeof e=="string")return _6(e);throw new Error("Expected function, string, or object as test")});function S6(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=ed(e[n]);return op(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function N6(e){const t=e;return op(n);function n(r){const a=r;let o;for(o in e)if(a[o]!==t[o])return!1;return!0}}function _6(e){return op(t);function t(n){return n&&n.type===e}}function op(e){return t;function t(n,r,a){return!!(C6(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function j6(){return!0}function C6(e){return e!==null&&typeof e=="object"&&"type"in e}const X2=[],A6=!0,nb=!1,T6="skip";function Z2(e,t,n,r){let a;typeof t=="function"&&typeof n!="function"?(r=n,n=t):a=t;const o=ed(a),l=r?-1:1;d(e,void 0,[])();function d(f,h,g){const m=f&&typeof f=="object"?f:{};if(typeof m.type=="string"){const b=typeof m.tagName=="string"?m.tagName:typeof m.name=="string"?m.name:void 0;Object.defineProperty(y,"name",{value:"node ("+(f.type+(b?"<"+b+">":""))+")"})}return y;function y(){let b=X2,k,v,N;if((!t||o(f,h,g[g.length-1]||void 0))&&(b=M6(n(f,g)),b[0]===nb))return b;if("children"in f&&f.children){const E=f;if(E.children&&b[0]!==T6)for(v=(r?E.children.length:-1)+l,N=g.concat(E);v>-1&&v<E.children.length;){const C=E.children[v];if(k=d(C,v,N)(),k[0]===nb)return k;v=typeof k[1]=="number"?k[1]:v+l}}return b}}}function M6(e){return Array.isArray(e)?e:typeof e=="number"?[A6,e]:e==null?X2:[e]}function lp(e,t,n,r){let a,o,l;typeof t=="function"&&typeof n!="function"?(o=void 0,l=t,a=n):(o=t,l=n,a=r),Z2(e,o,d,a);function d(f,h){const g=h[h.length-1],m=g?g.children.indexOf(f):void 0;return l(f,m,g)}}const rb={}.hasOwnProperty,D6={};function O6(e,t){const n=t||D6,r=new Map,a=new Map,o=new Map,l={...g6,...n.handlers},d={all:h,applyData:L6,definitionById:r,footnoteById:a,footnoteCounts:o,footnoteOrder:[],handlers:l,one:f,options:n,patch:R6,wrap:z6};return lp(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const m=g.type==="definition"?r:a,y=String(g.identifier).toUpperCase();m.has(y)||m.set(y,g)}}),d;function f(g,m){const y=g.type,b=d.handlers[y];if(rb.call(d.handlers,y)&&b)return b(d,g,m);if(d.options.passThrough&&d.options.passThrough.includes(y)){if("children"in g){const{children:v,...N}=g,E=wh(N);return E.children=d.all(g),E}return wh(g)}return(d.options.unknownHandler||I6)(d,g,m)}function h(g){const m=[];if("children"in g){const y=g.children;let b=-1;for(;++b<y.length;){const k=d.one(y[b],g);if(k){if(b&&y[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=rE(k.value)),!Array.isArray(k)&&k.type==="element")){const v=k.children[0];v&&v.type==="text"&&(v.value=rE(v.value))}Array.isArray(k)?m.push(...k):m.push(k)}}}return m}}function R6(e,t){e.position&&(t.position=kP(e))}function L6(e,t){let n=t;if(e&&e.data){const r=e.data.hName,a=e.data.hChildren,o=e.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"&&o&&Object.assign(n.properties,wh(o)),"children"in n&&n.children&&a!==null&&a!==void 0&&(n.children=a)}return n}function I6(e,t){const n=t.data||{},r="value"in t&&!(rb.call(n,"hProperties")||rb.call(n,"hChildren"))?{type:"text",value:t.value}:{type:"element",tagName:"div",properties:{},children:e.all(t)};return e.patch(t,r),e.applyData(t,r)}function z6(e,t){const n=[];let r=-1;for(t&&n.push({type:"text",value:`
|
|
616
|
-
`});++r<e.length;)r&&n.push({type:"text",value:`
|
|
617
|
-
`}),n.push(e[r]);return t&&e.length>0&&n.push({type:"text",value:`
|
|
618
|
-
`}),n}function rE(e){let t=0,n=e.charCodeAt(t);for(;n===9||n===32;)t++,n=e.charCodeAt(t);return e.slice(t)}function iE(e,t){const n=O6(e,t),r=n.one(e,void 0),a=E6(n),o=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return a&&o.children.push({type:"text",value:`
|
|
619
|
-
`},a),o}function P6(e,t){return e&&"run"in e?async function(n,r){const a=iE(n,{file:r,...t});await e.run(a,r)}:function(n,r){return iE(n,{file:r,...e||t})}}function aE(e){if(e)throw e}var Gg,sE;function B6(){if(sE)return Gg;sE=1;var e=Object.prototype.hasOwnProperty,t=Object.prototype.toString,n=Object.defineProperty,r=Object.getOwnPropertyDescriptor,a=function(h){return typeof Array.isArray=="function"?Array.isArray(h):t.call(h)==="[object Array]"},o=function(h){if(!h||t.call(h)!=="[object Object]")return!1;var g=e.call(h,"constructor"),m=h.constructor&&h.constructor.prototype&&e.call(h.constructor.prototype,"isPrototypeOf");if(h.constructor&&!g&&!m)return!1;var y;for(y in h);return typeof y>"u"||e.call(h,y)},l=function(h,g){n&&g.name==="__proto__"?n(h,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):h[g.name]=g.newValue},d=function(h,g){if(g==="__proto__")if(e.call(h,g)){if(r)return r(h,g).value}else return;return h[g]};return Gg=function f(){var h,g,m,y,b,k,v=arguments[0],N=1,E=arguments.length,C=!1;for(typeof v=="boolean"&&(C=v,v=arguments[1]||{},N=2),(v==null||typeof v!="object"&&typeof v!="function")&&(v={});N<E;++N)if(h=arguments[N],h!=null)for(g in h)m=d(v,g),y=d(h,g),v!==y&&(C&&y&&(o(y)||(b=a(y)))?(b?(b=!1,k=m&&a(m)?m:[]):k=m&&o(m)?m:{},l(v,{name:g,newValue:f(C,k,y)})):typeof y<"u"&&l(v,{name:g,newValue:y}));return v},Gg}var $6=B6();const Vg=qu($6);function ib(e){if(typeof e!="object"||e===null)return!1;const t=Object.getPrototypeOf(e);return(t===null||t===Object.prototype||Object.getPrototypeOf(t)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function U6(){const e=[],t={run:n,use:r};return t;function n(...a){let o=-1;const l=a.pop();if(typeof l!="function")throw new TypeError("Expected function as last argument, not "+l);d(null,...a);function d(f,...h){const g=e[++o];let m=-1;if(f){l(f);return}for(;++m<a.length;)(h[m]===null||h[m]===void 0)&&(h[m]=a[m]);a=h,g?F6(g,d)(...h):l(null,...h)}}function r(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),t}}function F6(e,t){let n;return r;function r(...l){const d=e.length>l.length;let f;d&&l.push(a);try{f=e.apply(this,l)}catch(h){const g=h;if(d&&n)throw g;return a(g)}d||(f&&f.then&&typeof f.then=="function"?f.then(o,a):f instanceof Error?a(f):o(f))}function a(l,...d){n||(n=!0,t(l,...d))}function o(l){a(null,l)}}const Ni={basename:q6,dirname:H6,extname:K6,join:G6,sep:"/"};function q6(e,t){if(t!==void 0&&typeof t!="string")throw new TypeError('"ext" argument must be a string');td(e);let n=0,r=-1,a=e.length,o;if(t===void 0||t.length===0||t.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else r<0&&(o=!0,r=a+1);return r<0?"":e.slice(n,r)}if(t===e)return"";let l=-1,d=t.length-1;for(;a--;)if(e.codePointAt(a)===47){if(o){n=a+1;break}}else l<0&&(o=!0,l=a+1),d>-1&&(e.codePointAt(a)===t.codePointAt(d--)?d<0&&(r=a):(d=-1,r=l));return n===r?r=l:r<0&&(r=e.length),e.slice(n,r)}function H6(e){if(td(e),e.length===0)return".";let t=-1,n=e.length,r;for(;--n;)if(e.codePointAt(n)===47){if(r){t=n;break}}else r||(r=!0);return t<0?e.codePointAt(0)===47?"/":".":t===1&&e.codePointAt(0)===47?"//":e.slice(0,t)}function K6(e){td(e);let t=e.length,n=-1,r=0,a=-1,o=0,l;for(;t--;){const d=e.codePointAt(t);if(d===47){if(l){r=t+1;break}continue}n<0&&(l=!0,n=t+1),d===46?a<0?a=t:o!==1&&(o=1):a>-1&&(o=-1)}return a<0||n<0||o===0||o===1&&a===n-1&&a===r+1?"":e.slice(a,n)}function G6(...e){let t=-1,n;for(;++t<e.length;)td(e[t]),e[t]&&(n=n===void 0?e[t]:n+"/"+e[t]);return n===void 0?".":V6(n)}function V6(e){td(e);const t=e.codePointAt(0)===47;let n=Y6(e,!t);return n.length===0&&!t&&(n="."),n.length>0&&e.codePointAt(e.length-1)===47&&(n+="/"),t?"/"+n:n}function Y6(e,t){let n="",r=0,a=-1,o=0,l=-1,d,f;for(;++l<=e.length;){if(l<e.length)d=e.codePointAt(l);else{if(d===47)break;d=47}if(d===47){if(!(a===l-1||o===1))if(a!==l-1&&o===2){if(n.length<2||r!==2||n.codePointAt(n.length-1)!==46||n.codePointAt(n.length-2)!==46){if(n.length>2){if(f=n.lastIndexOf("/"),f!==n.length-1){f<0?(n="",r=0):(n=n.slice(0,f),r=n.length-1-n.lastIndexOf("/")),a=l,o=0;continue}}else if(n.length>0){n="",r=0,a=l,o=0;continue}}t&&(n=n.length>0?n+"/..":"..",r=2)}else n.length>0?n+="/"+e.slice(a+1,l):n=e.slice(a+1,l),r=l-a-1;a=l,o=0}else d===46&&o>-1?o++:o=-1}return n}function td(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const Q6={cwd:W6};function W6(){return"/"}function ab(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function X6(e){if(typeof e=="string")e=new URL(e);else if(!ab(e)){const t=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw t.code="ERR_INVALID_ARG_TYPE",t}if(e.protocol!=="file:"){const t=new TypeError("The URL must be of scheme file");throw t.code="ERR_INVALID_URL_SCHEME",t}return Z6(e)}function Z6(e){if(e.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 t=e.pathname;let n=-1;for(;++n<t.length;)if(t.codePointAt(n)===37&&t.codePointAt(n+1)===50){const r=t.codePointAt(n+2);if(r===70||r===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(t)}const Yg=["history","path","basename","stem","extname","dirname"];class J2{constructor(t){let n;t?ab(t)?n={path:t}:typeof t=="string"||J6(t)?n={value:t}:n=t:n={},this.cwd="cwd"in n?"":Q6.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<Yg.length;){const o=Yg[r];o in n&&n[o]!==void 0&&n[o]!==null&&(this[o]=o==="history"?[...n[o]]:n[o])}let a;for(a in n)Yg.includes(a)||(this[a]=n[a])}get basename(){return typeof this.path=="string"?Ni.basename(this.path):void 0}set basename(t){Wg(t,"basename"),Qg(t,"basename"),this.path=Ni.join(this.dirname||"",t)}get dirname(){return typeof this.path=="string"?Ni.dirname(this.path):void 0}set dirname(t){oE(this.basename,"dirname"),this.path=Ni.join(t||"",this.basename)}get extname(){return typeof this.path=="string"?Ni.extname(this.path):void 0}set extname(t){if(Qg(t,"extname"),oE(this.dirname,"extname"),t){if(t.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(t.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=Ni.join(this.dirname,this.stem+(t||""))}get path(){return this.history[this.history.length-1]}set path(t){ab(t)&&(t=X6(t)),Wg(t,"path"),this.path!==t&&this.history.push(t)}get stem(){return typeof this.path=="string"?Ni.basename(this.path,this.extname):void 0}set stem(t){Wg(t,"stem"),Qg(t,"stem"),this.path=Ni.join(this.dirname||"",t+(this.extname||""))}fail(t,n,r){const a=this.message(t,n,r);throw a.fatal=!0,a}info(t,n,r){const a=this.message(t,n,r);return a.fatal=void 0,a}message(t,n,r){const a=new Yn(t,n,r);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(t){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(t||void 0).decode(this.value)}}function Qg(e,t){if(e&&e.includes(Ni.sep))throw new Error("`"+t+"` cannot be a path: did not expect `"+Ni.sep+"`")}function Wg(e,t){if(!e)throw new Error("`"+t+"` cannot be empty")}function oE(e,t){if(!e)throw new Error("Setting `"+t+"` requires `path` to be set too")}function J6(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const e$=(function(e){const r=this.constructor.prototype,a=r[e],o=function(){return a.apply(o,arguments)};return Object.setPrototypeOf(o,r),o}),t$={}.hasOwnProperty;class jx extends e${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=U6()}copy(){const t=new jx;let n=-1;for(;++n<this.attachers.length;){const r=this.attachers[n];t.use(...r)}return t.data(Vg(!0,{},this.namespace)),t}data(t,n){return typeof t=="string"?arguments.length===2?(Jg("data",this.frozen),this.namespace[t]=n,this):t$.call(this.namespace,t)&&this.namespace[t]||void 0:t?(Jg("data",this.frozen),this.namespace=t,this):this.namespace}freeze(){if(this.frozen)return this;const t=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 a=n.call(t,...r);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(t){this.freeze();const n=Df(t),r=this.parser||this.Parser;return Xg("parse",r),r(String(n),n)}process(t,n){const r=this;return this.freeze(),Xg("process",this.parser||this.Parser),Zg("process",this.compiler||this.Compiler),n?a(void 0,n):new Promise(a);function a(o,l){const d=Df(t),f=r.parse(d);r.run(f,d,function(g,m,y){if(g||!m||!y)return h(g);const b=m,k=r.stringify(b,y);i$(k)?y.value=k:y.result=k,h(g,y)});function h(g,m){g||!m?l(g):o?o(m):n(void 0,m)}}}processSync(t){let n=!1,r;return this.freeze(),Xg("processSync",this.parser||this.Parser),Zg("processSync",this.compiler||this.Compiler),this.process(t,a),cE("processSync","process",n),r;function a(o,l){n=!0,aE(o),r=l}}run(t,n,r){lE(t),this.freeze();const a=this.transformers;return!r&&typeof n=="function"&&(r=n,n=void 0),r?o(void 0,r):new Promise(o);function o(l,d){const f=Df(n);a.run(t,f,h);function h(g,m,y){const b=m||t;g?d(g):l?l(b):r(void 0,b,y)}}}runSync(t,n){let r=!1,a;return this.run(t,n,o),cE("runSync","run",r),a;function o(l,d){aE(l),a=d,r=!0}}stringify(t,n){this.freeze();const r=Df(n),a=this.compiler||this.Compiler;return Zg("stringify",a),lE(t),a(t,r)}use(t,...n){const r=this.attachers,a=this.namespace;if(Jg("use",this.frozen),t!=null)if(typeof t=="function")f(t,n);else if(typeof t=="object")Array.isArray(t)?d(t):l(t);else throw new TypeError("Expected usable value, not `"+t+"`");return this;function o(h){if(typeof h=="function")f(h,[]);else if(typeof h=="object")if(Array.isArray(h)){const[g,...m]=h;f(g,m)}else l(h);else throw new TypeError("Expected usable value, not `"+h+"`")}function l(h){if(!("plugins"in h)&&!("settings"in h))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");d(h.plugins),h.settings&&(a.settings=Vg(!0,a.settings,h.settings))}function d(h){let g=-1;if(h!=null)if(Array.isArray(h))for(;++g<h.length;){const m=h[g];o(m)}else throw new TypeError("Expected a list of plugins, not `"+h+"`")}function f(h,g){let m=-1,y=-1;for(;++m<r.length;)if(r[m][0]===h){y=m;break}if(y===-1)r.push([h,...g]);else if(g.length>0){let[b,...k]=g;const v=r[y][1];ib(v)&&ib(b)&&(b=Vg(!0,v,b)),r[y]=[h,b,...k]}}}}const n$=new jx().freeze();function Xg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Zg(e,t){if(typeof t!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Jg(e,t){if(t)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function lE(e){if(!ib(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function cE(e,t,n){if(!n)throw new Error("`"+e+"` finished async. Use `"+t+"` instead")}function Df(e){return r$(e)?e:new J2(e)}function r$(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function i$(e){return typeof e=="string"||a$(e)}function a$(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const s$="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",uE=[],dE={allowDangerousHtml:!0},o$=/^(https?|ircs?|mailto|xmpp)$/i,l$=[{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 Cx(e){const t=c$(e),n=u$(e);return d$(t.runSync(t.parse(n),n),e)}function c$(e){const t=e.rehypePlugins||uE,n=e.remarkPlugins||uE,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...dE}:dE;return n$().use(HB).use(n).use(P6,r).use(t)}function u$(e){const t=e.children||"",n=new J2;return typeof t=="string"&&(n.value=t),n}function d$(e,t){const n=t.allowedElements,r=t.allowElement,a=t.components,o=t.disallowedElements,l=t.skipHtml,d=t.unwrapDisallowed,f=t.urlTransform||f$;for(const g of l$)Object.hasOwn(t,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+s$+g.id,void 0);return lp(e,h),jP(e,{Fragment:c.Fragment,components:a,ignoreInvalidStyle:!0,jsx:c.jsx,jsxs:c.jsxs,passKeys:!0,passNode:!0});function h(g,m,y){if(g.type==="raw"&&y&&typeof m=="number")return l?y.children.splice(m,1):y.children[m]={type:"text",value:g.value},m;if(g.type==="element"){let b;for(b in qg)if(Object.hasOwn(qg,b)&&Object.hasOwn(g.properties,b)){const k=g.properties[b],v=qg[b];(v===null||v.includes(g.tagName))&&(g.properties[b]=f(String(k||""),b,g))}}if(g.type==="element"){let b=n?!n.includes(g.tagName):o?o.includes(g.tagName):!1;if(!b&&r&&typeof m=="number"&&(b=!r(g,m,y)),b&&y&&typeof m=="number")return d&&g.children?y.children.splice(m,1,...g.children):y.children.splice(m,1),m}}}function f$(e){const t=e.indexOf(":"),n=e.indexOf("?"),r=e.indexOf("#"),a=e.indexOf("/");return t===-1||a!==-1&&t>a||n!==-1&&t>n||r!==-1&&t>r||o$.test(e.slice(0,t))?e:""}function fE(e,t){const n=String(e);if(typeof t!="string")throw new TypeError("Expected character");let r=0,a=n.indexOf(t);for(;a!==-1;)r++,a=n.indexOf(t,a+t.length);return r}function h$(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function p$(e,t,n){const a=ed((n||{}).ignore||[]),o=m$(t);let l=-1;for(;++l<o.length;)Z2(e,"text",d);function d(h,g){let m=-1,y;for(;++m<g.length;){const b=g[m],k=y?y.children:void 0;if(a(b,k?k.indexOf(b):void 0,y))return;y=b}if(y)return f(h,g)}function f(h,g){const m=g[g.length-1],y=o[l][0],b=o[l][1];let k=0;const N=m.children.indexOf(h);let E=!1,C=[];y.lastIndex=0;let S=y.exec(h.value);for(;S;){const _=S.index,M={index:S.index,input:S.input,stack:[...g,h]};let T=b(...S,M);if(typeof T=="string"&&(T=T.length>0?{type:"text",value:T}:void 0),T===!1?y.lastIndex=_+1:(k!==_&&C.push({type:"text",value:h.value.slice(k,_)}),Array.isArray(T)?C.push(...T):T&&C.push(T),k=_+S[0].length,E=!0),!y.global)break;S=y.exec(h.value)}return E?(k<h.value.length&&C.push({type:"text",value:h.value.slice(k)}),m.children.splice(N,1,...C)):C=[h],N+C.length}}function m$(e){const t=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const n=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<n.length;){const a=n[r];t.push([g$(a[0]),y$(a[1])])}return t}function g$(e){return typeof e=="string"?new RegExp(h$(e),"g"):e}function y$(e){return typeof e=="function"?e:function(){return e}}const ey="phrasing",ty=["autolink","link","image","label"];function b$(){return{transforms:[N$],enter:{literalAutolink:v$,literalAutolinkEmail:ny,literalAutolinkHttp:ny,literalAutolinkWww:ny},exit:{literalAutolink:S$,literalAutolinkEmail:E$,literalAutolinkHttp:w$,literalAutolinkWww:k$}}}function x$(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:ey,notInConstruct:ty},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:ey,notInConstruct:ty},{character:":",before:"[ps]",after:"\\/",inConstruct:ey,notInConstruct:ty}]}}function v$(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function ny(e){this.config.enter.autolinkProtocol.call(this,e)}function w$(e){this.config.exit.autolinkProtocol.call(this,e)}function k$(e){this.config.exit.data.call(this,e);const t=this.stack[this.stack.length-1];t.type,t.url="http://"+this.sliceSerialize(e)}function E$(e){this.config.exit.autolinkEmail.call(this,e)}function S$(e){this.exit(e)}function N$(e){p$(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,_$],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),j$]],{ignore:["link","linkReference"]})}function _$(e,t,n,r,a){let o="";if(!ej(a)||(/^w/i.test(t)&&(n=t+n,t="",o="http://"),!C$(n)))return!1;const l=A$(n+r);if(!l[0])return!1;const d={type:"link",title:null,url:o+t+l[0],children:[{type:"text",value:t+l[0]}]};return l[1]?[d,{type:"text",value:l[1]}]:d}function j$(e,t,n,r){return!ej(r,!0)||/[-\d_]$/.test(n)?!1:{type:"link",title:null,url:"mailto:"+t+"@"+n,children:[{type:"text",value:t+"@"+n}]}}function C$(e){const t=e.split(".");return!(t.length<2||t[t.length-1]&&(/_/.test(t[t.length-1])||!/[a-zA-Z\d]/.test(t[t.length-1]))||t[t.length-2]&&(/_/.test(t[t.length-2])||!/[a-zA-Z\d]/.test(t[t.length-2])))}function A$(e){const t=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!t)return[e,void 0];e=e.slice(0,t.index);let n=t[0],r=n.indexOf(")");const a=fE(e,"(");let o=fE(e,")");for(;r!==-1&&a>o;)e+=n.slice(0,r+1),n=n.slice(r+1),r=n.indexOf(")"),o++;return[e,n]}function ej(e,t){const n=e.input.charCodeAt(e.index-1);return(e.index===0||mo(n)||ip(n))&&(!t||n!==47)}tj.peek=P$;function T$(){this.buffer()}function M$(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function D$(){this.buffer()}function O$(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function R$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=di(this.sliceSerialize(e)).toLowerCase(),n.label=t}function L$(e){this.exit(e)}function I$(e){const t=this.resume(),n=this.stack[this.stack.length-1];n.type,n.identifier=di(this.sliceSerialize(e)).toLowerCase(),n.label=t}function z$(e){this.exit(e)}function P$(){return"["}function tj(e,t,n,r){const a=n.createTracker(r);let o=a.move("[^");const l=n.enter("footnoteReference"),d=n.enter("reference");return o+=a.move(n.safe(n.associationId(e),{after:"]",before:o})),d(),l(),o+=a.move("]"),o}function B$(){return{enter:{gfmFootnoteCallString:T$,gfmFootnoteCall:M$,gfmFootnoteDefinitionLabelString:D$,gfmFootnoteDefinition:O$},exit:{gfmFootnoteCallString:R$,gfmFootnoteCall:L$,gfmFootnoteDefinitionLabelString:I$,gfmFootnoteDefinition:z$}}}function $$(e){let t=!1;return e&&e.firstLineBlank&&(t=!0),{handlers:{footnoteDefinition:n,footnoteReference:tj},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function n(r,a,o,l){const d=o.createTracker(l);let f=d.move("[^");const h=o.enter("footnoteDefinition"),g=o.enter("label");return f+=d.move(o.safe(o.associationId(r),{before:f,after:"]"})),g(),f+=d.move("]:"),r.children&&r.children.length>0&&(d.shift(4),f+=d.move((t?`
|
|
620
|
-
`:" ")+o.indentLines(o.containerFlow(r,d.current()),t?nj:U$))),h(),f}}function U$(e,t,n){return t===0?e:nj(e,t,n)}function nj(e,t,n){return(n?"":" ")+e}const F$=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];rj.peek=V$;function q$(){return{canContainEols:["delete"],enter:{strikethrough:K$},exit:{strikethrough:G$}}}function H$(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:F$}],handlers:{delete:rj}}}function K$(e){this.enter({type:"delete",children:[]},e)}function G$(e){this.exit(e)}function rj(e,t,n,r){const a=n.createTracker(r),o=n.enter("strikethrough");let l=a.move("~~");return l+=n.containerPhrasing(e,{...a.current(),before:l,after:"~"}),l+=a.move("~~"),o(),l}function V$(){return"~"}function Y$(e){return e.length}function Q$(e,t){const n=t||{},r=(n.align||[]).concat(),a=n.stringLength||Y$,o=[],l=[],d=[],f=[];let h=0,g=-1;for(;++g<e.length;){const v=[],N=[];let E=-1;for(e[g].length>h&&(h=e[g].length);++E<e[g].length;){const C=W$(e[g][E]);if(n.alignDelimiters!==!1){const S=a(C);N[E]=S,(f[E]===void 0||S>f[E])&&(f[E]=S)}v.push(C)}l[g]=v,d[g]=N}let m=-1;if(typeof r=="object"&&"length"in r)for(;++m<h;)o[m]=hE(r[m]);else{const v=hE(r);for(;++m<h;)o[m]=v}m=-1;const y=[],b=[];for(;++m<h;){const v=o[m];let N="",E="";v===99?(N=":",E=":"):v===108?N=":":v===114&&(E=":");let C=n.alignDelimiters===!1?1:Math.max(1,f[m]-N.length-E.length);const S=N+"-".repeat(C)+E;n.alignDelimiters!==!1&&(C=N.length+C+E.length,C>f[m]&&(f[m]=C),b[m]=C),y[m]=S}l.splice(1,0,y),d.splice(1,0,b),g=-1;const k=[];for(;++g<l.length;){const v=l[g],N=d[g];m=-1;const E=[];for(;++m<h;){const C=v[m]||"";let S="",_="";if(n.alignDelimiters!==!1){const M=f[m]-(N[m]||0),T=o[m];T===114?S=" ".repeat(M):T===99?M%2?(S=" ".repeat(M/2+.5),_=" ".repeat(M/2-.5)):(S=" ".repeat(M/2),_=S):_=" ".repeat(M)}n.delimiterStart!==!1&&!m&&E.push("|"),n.padding!==!1&&!(n.alignDelimiters===!1&&C==="")&&(n.delimiterStart!==!1||m)&&E.push(" "),n.alignDelimiters!==!1&&E.push(S),E.push(C),n.alignDelimiters!==!1&&E.push(_),n.padding!==!1&&E.push(" "),(n.delimiterEnd!==!1||m!==h-1)&&E.push("|")}k.push(n.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
|
|
621
|
-
`)}function W$(e){return e==null?"":String(e)}function hE(e){const t=typeof e=="string"?e.codePointAt(0):0;return t===67||t===99?99:t===76||t===108?108:t===82||t===114?114:0}function X$(e,t,n,r){const a=n.enter("blockquote"),o=n.createTracker(r);o.move("> "),o.shift(2);const l=n.indentLines(n.containerFlow(e,o.current()),Z$);return a(),l}function Z$(e,t,n){return">"+(n?"":" ")+e}function J$(e,t){return pE(e,t.inConstruct,!0)&&!pE(e,t.notInConstruct,!1)}function pE(e,t,n){if(typeof t=="string"&&(t=[t]),!t||t.length===0)return n;let r=-1;for(;++r<t.length;)if(e.includes(t[r]))return!0;return!1}function mE(e,t,n,r){let a=-1;for(;++a<n.unsafe.length;)if(n.unsafe[a].character===`
|
|
622
|
-
`&&J$(n.stack,n.unsafe[a]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
623
|
-
`}function eU(e,t){const n=String(e);let r=n.indexOf(t),a=r,o=0,l=0;if(typeof t!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===a?++o>l&&(l=o):o=1,a=r+t.length,r=n.indexOf(t,a);return l}function tU(e,t){return!!(t.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function nU(e){const t=e.options.fence||"`";if(t!=="`"&&t!=="~")throw new Error("Cannot serialize code with `"+t+"` for `options.fence`, expected `` ` `` or `~`");return t}function rU(e,t,n,r){const a=nU(n),o=e.value||"",l=a==="`"?"GraveAccent":"Tilde";if(tU(e,n)){const m=n.enter("codeIndented"),y=n.indentLines(o,iU);return m(),y}const d=n.createTracker(r),f=a.repeat(Math.max(eU(o,a)+1,3)),h=n.enter("codeFenced");let g=d.move(f);if(e.lang){const m=n.enter(`codeFencedLang${l}`);g+=d.move(n.safe(e.lang,{before:g,after:" ",encode:["`"],...d.current()})),m()}if(e.lang&&e.meta){const m=n.enter(`codeFencedMeta${l}`);g+=d.move(" "),g+=d.move(n.safe(e.meta,{before:g,after:`
|
|
624
|
-
`,encode:["`"],...d.current()})),m()}return g+=d.move(`
|
|
625
|
-
`),o&&(g+=d.move(o+`
|
|
626
|
-
`)),g+=d.move(f),h(),g}function iU(e,t,n){return(n?"":" ")+e}function Ax(e){const t=e.options.quote||'"';if(t!=='"'&&t!=="'")throw new Error("Cannot serialize title with `"+t+"` for `options.quote`, expected `\"`, or `'`");return t}function aU(e,t,n,r){const a=Ax(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("definition");let d=n.enter("label");const f=n.createTracker(r);let h=f.move("[");return h+=f.move(n.safe(n.associationId(e),{before:h,after:"]",...f.current()})),h+=f.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":`
|
|
627
|
-
`,...f.current()}))),d(),e.title&&(d=n.enter(`title${o}`),h+=f.move(" "+a),h+=f.move(n.safe(e.title,{before:h,after:a,...f.current()})),h+=f.move(a),d()),l(),h}function sU(e){const t=e.options.emphasis||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize emphasis with `"+t+"` for `options.emphasis`, expected `*`, or `_`");return t}function Cu(e){return"&#x"+e.toString(16).toUpperCase()+";"}function kh(e,t,n){const r=Ul(e),a=Ul(t);return r===void 0?a===void 0?n==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===void 0?{inside:!1,outside:!1}:a===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}ij.peek=oU;function ij(e,t,n,r){const a=sU(n),o=n.enter("emphasis"),l=n.createTracker(r),d=l.move(a);let f=l.move(n.containerPhrasing(e,{after:a,before:d,...l.current()}));const h=f.charCodeAt(0),g=kh(r.before.charCodeAt(r.before.length-1),h,a);g.inside&&(f=Cu(h)+f.slice(1));const m=f.charCodeAt(f.length-1),y=kh(r.after.charCodeAt(0),m,a);y.inside&&(f=f.slice(0,-1)+Cu(m));const b=l.move(a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},d+f+b}function oU(e,t,n){return n.options.emphasis||"*"}function lU(e,t){let n=!1;return lp(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return n=!0,nb}),!!((!e.depth||e.depth<3)&&vx(e)&&(t.options.setext||n))}function cU(e,t,n,r){const a=Math.max(Math.min(6,e.depth||1),1),o=n.createTracker(r);if(lU(e,n)){const g=n.enter("headingSetext"),m=n.enter("phrasing"),y=n.containerPhrasing(e,{...o.current(),before:`
|
|
628
|
-
`,after:`
|
|
629
|
-
`});return m(),g(),y+`
|
|
630
|
-
`+(a===1?"=":"-").repeat(y.length-(Math.max(y.lastIndexOf("\r"),y.lastIndexOf(`
|
|
631
|
-
`))+1))}const l="#".repeat(a),d=n.enter("headingAtx"),f=n.enter("phrasing");o.move(l+" ");let h=n.containerPhrasing(e,{before:"# ",after:`
|
|
632
|
-
`,...o.current()});return/^[\t ]/.test(h)&&(h=Cu(h.charCodeAt(0))+h.slice(1)),h=h?l+" "+h:l,n.options.closeAtx&&(h+=" "+l),f(),d(),h}aj.peek=uU;function aj(e){return e.value||""}function uU(){return"<"}sj.peek=dU;function sj(e,t,n,r){const a=Ax(n),o=a==='"'?"Quote":"Apostrophe",l=n.enter("image");let d=n.enter("label");const f=n.createTracker(r);let h=f.move("![");return h+=f.move(n.safe(e.alt,{before:h,after:"]",...f.current()})),h+=f.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=n.enter("destinationLiteral"),h+=f.move("<"),h+=f.move(n.safe(e.url,{before:h,after:">",...f.current()})),h+=f.move(">")):(d=n.enter("destinationRaw"),h+=f.move(n.safe(e.url,{before:h,after:e.title?" ":")",...f.current()}))),d(),e.title&&(d=n.enter(`title${o}`),h+=f.move(" "+a),h+=f.move(n.safe(e.title,{before:h,after:a,...f.current()})),h+=f.move(a),d()),h+=f.move(")"),l(),h}function dU(){return"!"}oj.peek=fU;function oj(e,t,n,r){const a=e.referenceType,o=n.enter("imageReference");let l=n.enter("label");const d=n.createTracker(r);let f=d.move("![");const h=n.safe(e.alt,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return l(),n.stack=g,o(),a==="full"||!h||h!==m?f+=d.move(m+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function fU(){return"!"}lj.peek=hU;function lj(e,t,n){let r=e.value||"",a="`",o=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(r);)a+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++o<n.unsafe.length;){const l=n.unsafe[o],d=n.compilePattern(l);let f;if(l.atBreak)for(;f=d.exec(r);){let h=f.index;r.charCodeAt(h)===10&&r.charCodeAt(h-1)===13&&h--,r=r.slice(0,h)+" "+r.slice(f.index+1)}}return a+r+a}function hU(){return"`"}function cj(e,t){const n=vx(e);return!!(!t.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(n===e.url||"mailto:"+n===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}uj.peek=pU;function uj(e,t,n,r){const a=Ax(n),o=a==='"'?"Quote":"Apostrophe",l=n.createTracker(r);let d,f;if(cj(e,n)){const g=n.stack;n.stack=[],d=n.enter("autolink");let m=l.move("<");return m+=l.move(n.containerPhrasing(e,{before:m,after:">",...l.current()})),m+=l.move(">"),d(),n.stack=g,m}d=n.enter("link"),f=n.enter("label");let h=l.move("[");return h+=l.move(n.containerPhrasing(e,{before:h,after:"](",...l.current()})),h+=l.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=n.enter("destinationLiteral"),h+=l.move("<"),h+=l.move(n.safe(e.url,{before:h,after:">",...l.current()})),h+=l.move(">")):(f=n.enter("destinationRaw"),h+=l.move(n.safe(e.url,{before:h,after:e.title?" ":")",...l.current()}))),f(),e.title&&(f=n.enter(`title${o}`),h+=l.move(" "+a),h+=l.move(n.safe(e.title,{before:h,after:a,...l.current()})),h+=l.move(a),f()),h+=l.move(")"),d(),h}function pU(e,t,n){return cj(e,n)?"<":"["}dj.peek=mU;function dj(e,t,n,r){const a=e.referenceType,o=n.enter("linkReference");let l=n.enter("label");const d=n.createTracker(r);let f=d.move("[");const h=n.containerPhrasing(e,{before:f,after:"]",...d.current()});f+=d.move(h+"]["),l();const g=n.stack;n.stack=[],l=n.enter("reference");const m=n.safe(n.associationId(e),{before:f,after:"]",...d.current()});return l(),n.stack=g,o(),a==="full"||!h||h!==m?f+=d.move(m+"]"):a==="shortcut"?f=f.slice(0,-1):f+=d.move("]"),f}function mU(){return"["}function Tx(e){const t=e.options.bullet||"*";if(t!=="*"&&t!=="+"&&t!=="-")throw new Error("Cannot serialize items with `"+t+"` for `options.bullet`, expected `*`, `+`, or `-`");return t}function gU(e){const t=Tx(e),n=e.options.bulletOther;if(!n)return t==="*"?"-":"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(n===t)throw new Error("Expected `bullet` (`"+t+"`) and `bulletOther` (`"+n+"`) to be different");return n}function yU(e){const t=e.options.bulletOrdered||".";if(t!=="."&&t!==")")throw new Error("Cannot serialize items with `"+t+"` for `options.bulletOrdered`, expected `.` or `)`");return t}function fj(e){const t=e.options.rule||"*";if(t!=="*"&&t!=="-"&&t!=="_")throw new Error("Cannot serialize rules with `"+t+"` for `options.rule`, expected `*`, `-`, or `_`");return t}function bU(e,t,n,r){const a=n.enter("list"),o=n.bulletCurrent;let l=e.ordered?yU(n):Tx(n);const d=e.ordered?l==="."?")":".":gU(n);let f=t&&n.bulletLastUsed?l===n.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((l==="*"||l==="-")&&g&&(!g.children||!g.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&&(f=!0),fj(n)===l&&g){let m=-1;for(;++m<e.children.length;){const y=e.children[m];if(y&&y.type==="listItem"&&y.children&&y.children[0]&&y.children[0].type==="thematicBreak"){f=!0;break}}}}f&&(l=d),n.bulletCurrent=l;const h=n.containerFlow(e,r);return n.bulletLastUsed=l,n.bulletCurrent=o,a(),h}function xU(e){const t=e.options.listItemIndent||"one";if(t!=="tab"&&t!=="one"&&t!=="mixed")throw new Error("Cannot serialize items with `"+t+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return t}function vU(e,t,n,r){const a=xU(n);let o=n.bulletCurrent||Tx(n);t&&t.type==="list"&&t.ordered&&(o=(typeof t.start=="number"&&t.start>-1?t.start:1)+(n.options.incrementListMarker===!1?0:t.children.indexOf(e))+o);let l=o.length+1;(a==="tab"||a==="mixed"&&(t&&t.type==="list"&&t.spread||e.spread))&&(l=Math.ceil(l/4)*4);const d=n.createTracker(r);d.move(o+" ".repeat(l-o.length)),d.shift(l);const f=n.enter("listItem"),h=n.indentLines(n.containerFlow(e,d.current()),g);return f(),h;function g(m,y,b){return y?(b?"":" ".repeat(l))+m:(b?o:o+" ".repeat(l-o.length))+m}}function wU(e,t,n,r){const a=n.enter("paragraph"),o=n.enter("phrasing"),l=n.containerPhrasing(e,r);return o(),a(),l}const kU=ed(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function EU(e,t,n,r){return(e.children.some(function(l){return kU(l)})?n.containerPhrasing:n.containerFlow).call(n,e,r)}function SU(e){const t=e.options.strong||"*";if(t!=="*"&&t!=="_")throw new Error("Cannot serialize strong with `"+t+"` for `options.strong`, expected `*`, or `_`");return t}hj.peek=NU;function hj(e,t,n,r){const a=SU(n),o=n.enter("strong"),l=n.createTracker(r),d=l.move(a+a);let f=l.move(n.containerPhrasing(e,{after:a,before:d,...l.current()}));const h=f.charCodeAt(0),g=kh(r.before.charCodeAt(r.before.length-1),h,a);g.inside&&(f=Cu(h)+f.slice(1));const m=f.charCodeAt(f.length-1),y=kh(r.after.charCodeAt(0),m,a);y.inside&&(f=f.slice(0,-1)+Cu(m));const b=l.move(a+a);return o(),n.attentionEncodeSurroundingInfo={after:y.outside,before:g.outside},d+f+b}function NU(e,t,n){return n.options.strong||"*"}function _U(e,t,n,r){return n.safe(e.value,r)}function jU(e){const t=e.options.ruleRepetition||3;if(t<3)throw new Error("Cannot serialize rules with repetition `"+t+"` for `options.ruleRepetition`, expected `3` or more");return t}function CU(e,t,n){const r=(fj(n)+(n.options.ruleSpaces?" ":"")).repeat(jU(n));return n.options.ruleSpaces?r.slice(0,-1):r}const pj={blockquote:X$,break:mE,code:rU,definition:aU,emphasis:ij,hardBreak:mE,heading:cU,html:aj,image:sj,imageReference:oj,inlineCode:lj,link:uj,linkReference:dj,list:bU,listItem:vU,paragraph:wU,root:EU,strong:hj,text:_U,thematicBreak:CU};function AU(){return{enter:{table:TU,tableData:gE,tableHeader:gE,tableRow:DU},exit:{codeText:OU,table:MU,tableData:ry,tableHeader:ry,tableRow:ry}}}function TU(e){const t=e._align;this.enter({type:"table",align:t.map(function(n){return n==="none"?null:n}),children:[]},e),this.data.inTable=!0}function MU(e){this.exit(e),this.data.inTable=void 0}function DU(e){this.enter({type:"tableRow",children:[]},e)}function ry(e){this.exit(e)}function gE(e){this.enter({type:"tableCell",children:[]},e)}function OU(e){let t=this.resume();this.data.inTable&&(t=t.replace(/\\([\\|])/g,RU));const n=this.stack[this.stack.length-1];n.type,n.value=t,this.exit(e)}function RU(e,t){return t==="|"?t:e}function LU(e){const t=e||{},n=t.tableCellPadding,r=t.tablePipeAlign,a=t.stringLength,o=n?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
633
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:y,table:l,tableCell:f,tableRow:d}};function l(b,k,v,N){return h(g(b,v,N),b.align)}function d(b,k,v,N){const E=m(b,v,N),C=h([E]);return C.slice(0,C.indexOf(`
|
|
634
|
-
`))}function f(b,k,v,N){const E=v.enter("tableCell"),C=v.enter("phrasing"),S=v.containerPhrasing(b,{...N,before:o,after:o});return C(),E(),S}function h(b,k){return Q$(b,{align:k,alignDelimiters:r,padding:n,stringLength:a})}function g(b,k,v){const N=b.children;let E=-1;const C=[],S=k.enter("table");for(;++E<N.length;)C[E]=m(N[E],k,v);return S(),C}function m(b,k,v){const N=b.children;let E=-1;const C=[],S=k.enter("tableRow");for(;++E<N.length;)C[E]=f(N[E],b,k,v);return S(),C}function y(b,k,v){let N=pj.inlineCode(b,k,v);return v.stack.includes("tableCell")&&(N=N.replace(/\|/g,"\\$&")),N}}function IU(){return{exit:{taskListCheckValueChecked:yE,taskListCheckValueUnchecked:yE,paragraph:PU}}}function zU(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:BU}}}function yE(e){const t=this.stack[this.stack.length-2];t.type,t.checked=e.type==="taskListCheckValueChecked"}function PU(e){const t=this.stack[this.stack.length-2];if(t&&t.type==="listItem"&&typeof t.checked=="boolean"){const n=this.stack[this.stack.length-1];n.type;const r=n.children[0];if(r&&r.type==="text"){const a=t.children;let o=-1,l;for(;++o<a.length;){const d=a[o];if(d.type==="paragraph"){l=d;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(e)}function BU(e,t,n,r){const a=e.children[0],o=typeof e.checked=="boolean"&&a&&a.type==="paragraph",l="["+(e.checked?"x":" ")+"] ",d=n.createTracker(r);o&&d.move(l);let f=pj.listItem(e,t,n,{...r,...d.current()});return o&&(f=f.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,h)),f;function h(g){return g+l}}function $U(){return[b$(),B$(),q$(),AU(),IU()]}function UU(e){return{extensions:[x$(),$$(e),H$(),LU(e),zU()]}}const FU={tokenize:YU,partial:!0},mj={tokenize:QU,partial:!0},gj={tokenize:WU,partial:!0},yj={tokenize:XU,partial:!0},qU={tokenize:ZU,partial:!0},bj={name:"wwwAutolink",tokenize:GU,previous:vj},xj={name:"protocolAutolink",tokenize:VU,previous:wj},xa={name:"emailAutolink",tokenize:KU,previous:kj},Ii={};function HU(){return{text:Ii}}let Gs=48;for(;Gs<123;)Ii[Gs]=xa,Gs++,Gs===58?Gs=65:Gs===91&&(Gs=97);Ii[43]=xa;Ii[45]=xa;Ii[46]=xa;Ii[95]=xa;Ii[72]=[xa,xj];Ii[104]=[xa,xj];Ii[87]=[xa,bj];Ii[119]=[xa,bj];function KU(e,t,n){const r=this;let a,o;return l;function l(m){return!sb(m)||!kj.call(r,r.previous)||Mx(r.events)?n(m):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(m))}function d(m){return sb(m)?(e.consume(m),d):m===64?(e.consume(m),f):n(m)}function f(m){return m===46?e.check(qU,g,h)(m):m===45||m===95||Gn(m)?(o=!0,e.consume(m),f):g(m)}function h(m){return e.consume(m),a=!0,f}function g(m){return o&&a&&nr(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),t(m)):n(m)}}function GU(e,t,n){const r=this;return a;function a(l){return l!==87&&l!==119||!vj.call(r,r.previous)||Mx(r.events)?n(l):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(FU,e.attempt(mj,e.attempt(gj,o),n),n)(l))}function o(l){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),t(l)}}function VU(e,t,n){const r=this;let a="",o=!1;return l;function l(m){return(m===72||m===104)&&wj.call(r,r.previous)&&!Mx(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(m),e.consume(m),d):n(m)}function d(m){if(nr(m)&&a.length<5)return a+=String.fromCodePoint(m),e.consume(m),d;if(m===58){const y=a.toLowerCase();if(y==="http"||y==="https")return e.consume(m),f}return n(m)}function f(m){return m===47?(e.consume(m),o?h:(o=!0,f)):n(m)}function h(m){return m===null||xh(m)||Ht(m)||mo(m)||ip(m)?n(m):e.attempt(mj,e.attempt(gj,g),n)(m)}function g(m){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),t(m)}}function YU(e,t,n){let r=0;return a;function a(l){return(l===87||l===119)&&r<3?(r++,e.consume(l),a):l===46&&r===3?(e.consume(l),o):n(l)}function o(l){return l===null?n(l):t(l)}}function QU(e,t,n){let r,a,o;return l;function l(h){return h===46||h===95?e.check(yj,f,d)(h):h===null||Ht(h)||mo(h)||h!==45&&ip(h)?f(h):(o=!0,e.consume(h),l)}function d(h){return h===95?r=!0:(a=r,r=void 0),e.consume(h),l}function f(h){return a||r||!o?n(h):t(h)}}function WU(e,t){let n=0,r=0;return a;function a(l){return l===40?(n++,e.consume(l),a):l===41&&r<n?o(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?e.check(yj,t,o)(l):l===null||Ht(l)||mo(l)?t(l):(e.consume(l),a)}function o(l){return l===41&&r++,e.consume(l),a}}function XU(e,t,n){return r;function r(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),r):d===38?(e.consume(d),o):d===93?(e.consume(d),a):d===60||d===null||Ht(d)||mo(d)?t(d):n(d)}function a(d){return d===null||d===40||d===91||Ht(d)||mo(d)?t(d):r(d)}function o(d){return nr(d)?l(d):n(d)}function l(d){return d===59?(e.consume(d),r):nr(d)?(e.consume(d),l):n(d)}}function ZU(e,t,n){return r;function r(o){return e.consume(o),a}function a(o){return Gn(o)?n(o):t(o)}}function vj(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||Ht(e)}function wj(e){return!nr(e)}function kj(e){return!(e===47||sb(e))}function sb(e){return e===43||e===45||e===46||e===95||Gn(e)}function Mx(e){let t=e.length,n=!1;for(;t--;){const r=e[t][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){n=!0;break}if(r._gfmAutolinkLiteralWalkedInto){n=!1;break}}return e.length>0&&!n&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),n}const JU={tokenize:o9,partial:!0};function e9(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:i9,continuation:{tokenize:a9},exit:s9}},text:{91:{name:"gfmFootnoteCall",tokenize:r9},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:t9,resolveTo:n9}}}}function t9(e,t,n){const r=this;let a=r.events.length;const o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let l;for(;a--;){const f=r.events[a][1];if(f.type==="labelImage"){l=f;break}if(f.type==="gfmFootnoteCall"||f.type==="labelLink"||f.type==="label"||f.type==="image"||f.type==="link")break}return d;function d(f){if(!l||!l._balanced)return n(f);const h=di(r.sliceSerialize({start:l.end,end:r.now()}));return h.codePointAt(0)!==94||!o.includes(h.slice(1))?n(f):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(f),e.exit("gfmFootnoteCallLabelMarker"),t(f))}}function n9(e,t){let n=e.length;for(;n--;)if(e[n][1].type==="labelImage"&&e[n][0]==="enter"){e[n][1];break}e[n+1][1].type="data",e[n+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[n+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[n+3][1].end),end:Object.assign({},e[n+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const o={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},l={type:"chunkString",contentType:"string",start:Object.assign({},o.start),end:Object.assign({},o.end)},d=[e[n+1],e[n+2],["enter",r,t],e[n+3],e[n+4],["enter",a,t],["exit",a,t],["enter",o,t],["enter",l,t],["exit",l,t],["exit",o,t],e[e.length-2],e[e.length-1],["exit",r,t]];return e.splice(n,e.length-n+1,...d),e}function r9(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o=0,l;return d;function d(m){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),f}function f(m){return m!==94?n(m):(e.enter("gfmFootnoteCallMarker"),e.consume(m),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",h)}function h(m){if(o>999||m===93&&!l||m===null||m===91||Ht(m))return n(m);if(m===93){e.exit("chunkString");const y=e.exit("gfmFootnoteCallString");return a.includes(di(r.sliceSerialize(y)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(m),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),t):n(m)}return Ht(m)||(l=!0),o++,e.consume(m),m===92?g:h}function g(m){return m===91||m===92||m===93?(e.consume(m),o++,h):h(m)}}function i9(e,t,n){const r=this,a=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let o,l=0,d;return f;function f(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),h}function h(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):n(k)}function g(k){if(l>999||k===93&&!d||k===null||k===91||Ht(k))return n(k);if(k===93){e.exit("chunkString");const v=e.exit("gfmFootnoteDefinitionLabelString");return o=di(r.sliceSerialize(v)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),y}return Ht(k)||(d=!0),l++,e.consume(k),k===92?m:g}function m(k){return k===91||k===92||k===93?(e.consume(k),l++,g):g(k)}function y(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),a.includes(o)||a.push(o),Et(e,b,"gfmFootnoteDefinitionWhitespace")):n(k)}function b(k){return t(k)}}function a9(e,t,n){return e.check(Ju,t,e.attempt(JU,t,n))}function s9(e){e.exit("gfmFootnoteDefinition")}function o9(e,t,n){const r=this;return Et(e,a,"gfmFootnoteDefinitionIndent",5);function a(o){const l=r.events[r.events.length-1];return l&&l[1].type==="gfmFootnoteDefinitionIndent"&&l[2].sliceSerialize(l[1],!0).length===4?t(o):n(o)}}function l9(e){let n=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:o,resolveAll:a};return n==null&&(n=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function a(l,d){let f=-1;for(;++f<l.length;)if(l[f][0]==="enter"&&l[f][1].type==="strikethroughSequenceTemporary"&&l[f][1]._close){let h=f;for(;h--;)if(l[h][0]==="exit"&&l[h][1].type==="strikethroughSequenceTemporary"&&l[h][1]._open&&l[f][1].end.offset-l[f][1].start.offset===l[h][1].end.offset-l[h][1].start.offset){l[f][1].type="strikethroughSequence",l[h][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},l[h][1].start),end:Object.assign({},l[f][1].end)},m={type:"strikethroughText",start:Object.assign({},l[h][1].end),end:Object.assign({},l[f][1].start)},y=[["enter",g,d],["enter",l[h][1],d],["exit",l[h][1],d],["enter",m,d]],b=d.parser.constructs.insideSpan.null;b&&jr(y,y.length,0,ap(b,l.slice(h+1,f),d)),jr(y,y.length,0,[["exit",m,d],["enter",l[f][1],d],["exit",l[f][1],d],["exit",g,d]]),jr(l,h-1,f-h+3,y),f=h+y.length-2;break}}for(f=-1;++f<l.length;)l[f][1].type==="strikethroughSequenceTemporary"&&(l[f][1].type="data");return l}function o(l,d,f){const h=this.previous,g=this.events;let m=0;return y;function y(k){return h===126&&g[g.length-1][1].type!=="characterEscape"?f(k):(l.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const v=Ul(h);if(k===126)return m>1?f(k):(l.consume(k),m++,b);if(m<2&&!n)return f(k);const N=l.exit("strikethroughSequenceTemporary"),E=Ul(k);return N._open=!E||E===2&&!!v,N._close=!v||v===2&&!!E,d(k)}}}class c9{constructor(){this.map=[]}add(t,n,r){u9(this,t,n,r)}consume(t){if(this.map.sort(function(o,l){return o[0]-l[0]}),this.map.length===0)return;let n=this.map.length;const r=[];for(;n>0;)n-=1,r.push(t.slice(this.map[n][0]+this.map[n][1]),this.map[n][2]),t.length=this.map[n][0];r.push(t.slice()),t.length=0;let a=r.pop();for(;a;){for(const o of a)t.push(o);a=r.pop()}this.map.length=0}}function u9(e,t,n,r){let a=0;if(!(n===0&&r.length===0)){for(;a<e.map.length;){if(e.map[a][0]===t){e.map[a][1]+=n,e.map[a][2].push(...r);return}a+=1}e.map.push([t,n,r])}}function d9(e,t){let n=!1;const r=[];for(;t<e.length;){const a=e[t];if(n){if(a[0]==="enter")a[1].type==="tableContent"&&r.push(e[t+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[t-1][1].type==="tableDelimiterMarker"){const o=r.length-1;r[o]=r[o]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(n=!0);t+=1}return r}function f9(){return{flow:{null:{name:"table",tokenize:h9,resolveAll:p9}}}}function h9(e,t,n){const r=this;let a=0,o=0,l;return d;function d(z){let q=r.events.length-1;for(;q>-1;){const D=r.events[q][1].type;if(D==="lineEnding"||D==="linePrefix")q--;else break}const F=q>-1?r.events[q][1].type:null,Y=F==="tableHead"||F==="tableRow"?T:f;return Y===T&&r.parser.lazy[r.now().line]?n(z):Y(z)}function f(z){return e.enter("tableHead"),e.enter("tableRow"),h(z)}function h(z){return z===124||(l=!0,o+=1),g(z)}function g(z){return z===null?n(z):Je(z)?o>1?(o=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(z),e.exit("lineEnding"),b):n(z):gt(z)?Et(e,g,"whitespace")(z):(o+=1,l&&(l=!1,a+=1),z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),l=!0,g):(e.enter("data"),m(z)))}function m(z){return z===null||z===124||Ht(z)?(e.exit("data"),g(z)):(e.consume(z),z===92?y:m)}function y(z){return z===92||z===124?(e.consume(z),m):m(z)}function b(z){return r.interrupt=!1,r.parser.lazy[r.now().line]?n(z):(e.enter("tableDelimiterRow"),l=!1,gt(z)?Et(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(z):k(z))}function k(z){return z===45||z===58?N(z):z===124?(l=!0,e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),v):M(z)}function v(z){return gt(z)?Et(e,N,"whitespace")(z):N(z)}function N(z){return z===58?(o+=1,l=!0,e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),E):z===45?(o+=1,E(z)):z===null||Je(z)?_(z):M(z)}function E(z){return z===45?(e.enter("tableDelimiterFiller"),C(z)):M(z)}function C(z){return z===45?(e.consume(z),C):z===58?(l=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(z),e.exit("tableDelimiterMarker"),S):(e.exit("tableDelimiterFiller"),S(z))}function S(z){return gt(z)?Et(e,_,"whitespace")(z):_(z)}function _(z){return z===124?k(z):z===null||Je(z)?!l||a!==o?M(z):(e.exit("tableDelimiterRow"),e.exit("tableHead"),t(z)):M(z)}function M(z){return n(z)}function T(z){return e.enter("tableRow"),L(z)}function L(z){return z===124?(e.enter("tableCellDivider"),e.consume(z),e.exit("tableCellDivider"),L):z===null||Je(z)?(e.exit("tableRow"),t(z)):gt(z)?Et(e,L,"whitespace")(z):(e.enter("data"),R(z))}function R(z){return z===null||z===124||Ht(z)?(e.exit("data"),L(z)):(e.consume(z),z===92?$:R)}function $(z){return z===92||z===124?(e.consume(z),R):R(z)}}function p9(e,t){let n=-1,r=!0,a=0,o=[0,0,0,0],l=[0,0,0,0],d=!1,f=0,h,g,m;const y=new c9;for(;++n<e.length;){const b=e[n],k=b[1];b[0]==="enter"?k.type==="tableHead"?(d=!1,f!==0&&(bE(y,t,f,h,g),g=void 0,f=0),h={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",h,t]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,m=void 0,o=[0,0,0,0],l=[0,n+1,0,0],d&&(d=!1,g={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},y.add(n,0,[["enter",g,t]])),a=k.type==="tableDelimiterRow"?2:g?3:1):a&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,l[2]===0&&(o[1]!==0&&(l[0]=l[1],m=Of(y,t,o,a,void 0,m),o=[0,0,0,0]),l[2]=n)):k.type==="tableCellDivider"&&(r?r=!1:(o[1]!==0&&(l[0]=l[1],m=Of(y,t,o,a,void 0,m)),o=l,l=[o[1],n,0,0])):k.type==="tableHead"?(d=!0,f=n):k.type==="tableRow"||k.type==="tableDelimiterRow"?(f=n,o[1]!==0?(l[0]=l[1],m=Of(y,t,o,a,n,m)):l[1]!==0&&(m=Of(y,t,l,a,n,m)),a=0):a&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(l[3]=n)}for(f!==0&&bE(y,t,f,h,g),y.consume(t.events),n=-1;++n<t.events.length;){const b=t.events[n];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=d9(t.events,n))}return e}function Of(e,t,n,r,a,o){const l=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",d="tableContent";n[0]!==0&&(o.end=Object.assign({},fl(t.events,n[0])),e.add(n[0],0,[["exit",o,t]]));const f=fl(t.events,n[1]);if(o={type:l,start:Object.assign({},f),end:Object.assign({},f)},e.add(n[1],0,[["enter",o,t]]),n[2]!==0){const h=fl(t.events,n[2]),g=fl(t.events,n[3]),m={type:d,start:Object.assign({},h),end:Object.assign({},g)};if(e.add(n[2],0,[["enter",m,t]]),r!==2){const y=t.events[n[2]],b=t.events[n[3]];if(y[1].end=Object.assign({},b[1].end),y[1].type="chunkText",y[1].contentType="text",n[3]>n[2]+1){const k=n[2]+1,v=n[3]-n[2]-1;e.add(k,v,[])}}e.add(n[3]+1,0,[["exit",m,t]])}return a!==void 0&&(o.end=Object.assign({},fl(t.events,a)),e.add(a,0,[["exit",o,t]]),o=void 0),o}function bE(e,t,n,r,a){const o=[],l=fl(t.events,n);a&&(a.end=Object.assign({},l),o.push(["exit",a,t])),r.end=Object.assign({},l),o.push(["exit",r,t]),e.add(n+1,0,o)}function fl(e,t){const n=e[t],r=n[0]==="enter"?"start":"end";return n[1][r]}const m9={name:"tasklistCheck",tokenize:y9};function g9(){return{text:{91:m9}}}function y9(e,t,n){const r=this;return a;function a(f){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?n(f):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),o)}function o(f){return Ht(f)?(e.enter("taskListCheckValueUnchecked"),e.consume(f),e.exit("taskListCheckValueUnchecked"),l):f===88||f===120?(e.enter("taskListCheckValueChecked"),e.consume(f),e.exit("taskListCheckValueChecked"),l):n(f)}function l(f){return f===93?(e.enter("taskListCheckMarker"),e.consume(f),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):n(f)}function d(f){return Je(f)?t(f):gt(f)?e.check({tokenize:b9},t,n)(f):n(f)}}function b9(e,t,n){return Et(e,r,"whitespace");function r(a){return a===null?n(a):t(a)}}function x9(e){return O2([HU(),e9(),l9(e),f9(),g9()])}const v9={};function Dx(e){const t=this,n=e||v9,r=t.data(),a=r.micromarkExtensions||(r.micromarkExtensions=[]),o=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),l=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);a.push(x9(n)),o.push($U()),l.push(UU(n))}const xE=(function(e,t,n){const r=ed(n);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof t=="number"){if(t<0||t===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(t=e.children.indexOf(t),t<0)throw new Error("Expected child node or index");for(;++t<e.children.length;)if(r(e.children[t],t,e))return e.children[t]}),So=(function(e){if(e==null)return E9;if(typeof e=="string")return k9(e);if(typeof e=="object")return w9(e);if(typeof e=="function")return Ox(e);throw new Error("Expected function, string, or array as `test`")});function w9(e){const t=[];let n=-1;for(;++n<e.length;)t[n]=So(e[n]);return Ox(r);function r(...a){let o=-1;for(;++o<t.length;)if(t[o].apply(this,a))return!0;return!1}}function k9(e){return Ox(t);function t(n){return n.tagName===e}}function Ox(e){return t;function t(n,r,a){return!!(S9(n)&&e.call(this,n,typeof r=="number"?r:void 0,a||void 0))}}function E9(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function S9(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const vE=/\n/g,wE=/[\t ]+/g,ob=So("br"),kE=So(D9),N9=So("p"),EE=So("tr"),_9=So(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",M9,O9]),Ej=So(["address","article","aside","blockquote","body","caption","center","dd","dialog","dir","dl","dt","div","figure","figcaption","footer","form,","h1","h2","h3","h4","h5","h6","header","hgroup","hr","html","legend","li","listing","main","menu","nav","ol","p","plaintext","pre","section","ul","xmp"]);function j9(e,t){const n=t||{},r="children"in e?e.children:[],a=Ej(e),o=_j(e,{whitespace:n.whitespace||"normal"}),l=[];(e.type==="text"||e.type==="comment")&&l.push(...Nj(e,{breakBefore:!0,breakAfter:!0}));let d=-1;for(;++d<r.length;)l.push(...Sj(r[d],e,{whitespace:o,breakBefore:d?void 0:a,breakAfter:d<r.length-1?ob(r[d+1]):a}));const f=[];let h;for(d=-1;++d<l.length;){const g=l[d];typeof g=="number"?h!==void 0&&g>h&&(h=g):g&&(h!==void 0&&h>-1&&f.push(`
|
|
635
|
-
`.repeat(h)||" "),h=-1,f.push(g))}return f.join("")}function Sj(e,t,n){return e.type==="element"?C9(e,t,n):e.type==="text"?n.whitespace==="normal"?Nj(e,n):A9(e):[]}function C9(e,t,n){const r=_j(e,n),a=e.children||[];let o=-1,l=[];if(_9(e))return l;let d,f;for(ob(e)||EE(e)&&xE(t,e,EE)?f=`
|
|
636
|
-
`:N9(e)?(d=2,f=2):Ej(e)&&(d=1,f=1);++o<a.length;)l=l.concat(Sj(a[o],e,{whitespace:r,breakBefore:o?void 0:d,breakAfter:o<a.length-1?ob(a[o+1]):f}));return kE(e)&&xE(t,e,kE)&&l.push(" "),d&&l.unshift(d),f&&l.push(f),l}function Nj(e,t){const n=String(e.value),r=[],a=[];let o=0;for(;o<=n.length;){vE.lastIndex=o;const f=vE.exec(n),h=f&&"index"in f?f.index:n.length;r.push(T9(n.slice(o,h).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),o===0?t.breakBefore:!0,h===n.length?t.breakAfter:!0)),o=h+1}let l=-1,d;for(;++l<r.length;)r[l].charCodeAt(r[l].length-1)===8203||l<r.length-1&&r[l+1].charCodeAt(0)===8203?(a.push(r[l]),d=void 0):r[l]?(typeof d=="number"&&a.push(d),a.push(r[l]),d=0):(l===0||l===r.length-1)&&a.push(0);return a}function A9(e){return[String(e.value)]}function T9(e,t,n){const r=[];let a=0,o;for(;a<e.length;){wE.lastIndex=a;const l=wE.exec(e);o=l?l.index:e.length,!a&&!o&&l&&!t&&r.push(""),a!==o&&r.push(e.slice(a,o)),a=l?o+l[0].length:o}return a!==o&&!n&&r.push(""),r.join(" ")}function _j(e,t){if(e.type==="element"){const n=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return n.wrap?"pre-wrap":"pre";case"td":case"th":return n.noWrap?"nowrap":t.whitespace;case"textarea":return"pre-wrap"}}return t.whitespace}function M9(e){return!!(e.properties||{}).hidden}function D9(e){return e.tagName==="td"||e.tagName==="th"}function O9(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function R9(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",l="(?!struct)("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},m={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",k=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],E=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:v,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},M={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[M,m,d,n,e.C_BLOCK_COMMENT_MODE,g,h],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+l+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:b,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(L,R,M,T,[m,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function L9(e){const t={type:["boolean","byte","word","String"],built_in:["KeyboardController","MouseController","SoftwareSerial","EthernetServer","EthernetClient","LiquidCrystal","RobotControl","GSMVoiceCall","EthernetUDP","EsploraTFT","HttpClient","RobotMotor","WiFiClient","GSMScanner","FileSystem","Scheduler","GSMServer","YunClient","YunServer","IPAddress","GSMClient","GSMModem","Keyboard","Ethernet","Console","GSMBand","Esplora","Stepper","Process","WiFiUDP","GSM_SMS","Mailbox","USBHost","Firmata","PImage","Client","Server","GSMPIN","FileIO","Bridge","Serial","EEPROM","Stream","Mouse","Audio","Servo","File","Task","GPRS","WiFi","Wire","TFT","GSM","SPI","SD"],_hints:["setup","loop","runShellCommandAsynchronously","analogWriteResolution","retrieveCallingNumber","printFirmwareVersion","analogReadResolution","sendDigitalPortPair","noListenOnLocalhost","readJoystickButton","setFirmwareVersion","readJoystickSwitch","scrollDisplayRight","getVoiceCallStatus","scrollDisplayLeft","writeMicroseconds","delayMicroseconds","beginTransmission","getSignalStrength","runAsynchronously","getAsynchronously","listenOnLocalhost","getCurrentCarrier","readAccelerometer","messageAvailable","sendDigitalPorts","lineFollowConfig","countryNameWrite","runShellCommand","readStringUntil","rewindDirectory","readTemperature","setClockDivider","readLightSensor","endTransmission","analogReference","detachInterrupt","countryNameRead","attachInterrupt","encryptionType","readBytesUntil","robotNameWrite","readMicrophone","robotNameRead","cityNameWrite","userNameWrite","readJoystickY","readJoystickX","mouseReleased","openNextFile","scanNetworks","noInterrupts","digitalWrite","beginSpeaker","mousePressed","isActionDone","mouseDragged","displayLogos","noAutoscroll","addParameter","remoteNumber","getModifiers","keyboardRead","userNameRead","waitContinue","processInput","parseCommand","printVersion","readNetworks","writeMessage","blinkVersion","cityNameRead","readMessage","setDataMode","parsePacket","isListening","setBitOrder","beginPacket","isDirectory","motorsWrite","drawCompass","digitalRead","clearScreen","serialEvent","rightToLeft","setTextSize","leftToRight","requestFrom","keyReleased","compassRead","analogWrite","interrupts","WiFiServer","disconnect","playMelody","parseFloat","autoscroll","getPINUsed","setPINUsed","setTimeout","sendAnalog","readSlider","analogRead","beginWrite","createChar","motorsStop","keyPressed","tempoWrite","readButton","subnetMask","debugPrint","macAddress","writeGreen","randomSeed","attachGPRS","readString","sendString","remotePort","releaseAll","mouseMoved","background","getXChange","getYChange","answerCall","getResult","voiceCall","endPacket","constrain","getSocket","writeJSON","getButton","available","connected","findUntil","readBytes","exitValue","readGreen","writeBlue","startLoop","IPAddress","isPressed","sendSysex","pauseMode","gatewayIP","setCursor","getOemKey","tuneWrite","noDisplay","loadImage","switchPIN","onRequest","onReceive","changePIN","playFile","noBuffer","parseInt","overflow","checkPIN","knobRead","beginTFT","bitClear","updateIR","bitWrite","position","writeRGB","highByte","writeRed","setSpeed","readBlue","noStroke","remoteIP","transfer","shutdown","hangCall","beginSMS","endWrite","attached","maintain","noCursor","checkReg","checkPUK","shiftOut","isValid","shiftIn","pulseIn","connect","println","localIP","pinMode","getIMEI","display","noBlink","process","getBand","running","beginSD","drawBMP","lowByte","setBand","release","bitRead","prepare","pointTo","readRed","setMode","noFill","remove","listen","stroke","detach","attach","noTone","exists","buffer","height","bitSet","circle","config","cursor","random","IRread","setDNS","endSMS","getKey","micros","millis","begin","print","write","ready","flush","width","isPIN","blink","clear","press","mkdir","rmdir","close","point","yield","image","BSSID","click","delay","read","text","move","peek","beep","rect","line","open","seek","fill","size","turn","stop","home","find","step","tone","sqrt","RSSI","SSID","end","bit","tan","cos","sin","pow","map","abs","max","min","get","run","put"],literal:["DIGITAL_MESSAGE","FIRMATA_STRING","ANALOG_MESSAGE","REPORT_DIGITAL","REPORT_ANALOG","INPUT_PULLUP","SET_PIN_MODE","INTERNAL2V56","SYSTEM_RESET","LED_BUILTIN","INTERNAL1V1","SYSEX_START","INTERNAL","EXTERNAL","DEFAULT","OUTPUT","INPUT","HIGH","LOW"]},n=R9(e),r=n.keywords;return r.type=[...r.type,...t.type],r.literal=[...r.literal,...t.literal],r.built_in=[...r.built_in,...t.built_in],r._hints=t._hints,n.name="Arduino",n.aliases=["ino"],n.supersetOf="cpp",n}function I9(e){const t=e.regex,n={},r={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[n]}]};Object.assign(n,{className:"variable",variants:[{begin:t.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},r]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},o=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),l={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},d={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n,a]};a.contains.push(d);const f={match:/\\"/},h={className:"string",begin:/'/,end:/'/},g={match:/\\'/},m={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,n]},y=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=e.SHEBANG({binary:`(${y.join("|")})`,relevance:10}),k={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},v=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],N=["true","false"],E={match:/(\/[a-z._-]+)+/},C=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],S=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],_=["autoload","bg","bindkey","bye","cap","chdir","clone","comparguments","compcall","compctl","compdescribe","compfiles","compgroups","compquote","comptags","comptry","compvalues","dirs","disable","disown","echotc","echoti","emulate","fc","fg","float","functions","getcap","getln","history","integer","jobs","kill","limit","log","noglob","popd","print","pushd","pushln","rehash","sched","setcap","setopt","stat","suspend","ttyctl","unfunction","unhash","unlimit","unsetopt","vared","wait","whence","where","which","zcompile","zformat","zftp","zle","zmodload","zparseopts","zprof","zpty","zregexparse","zsocket","zstyle","ztcp"],M=["chcon","chgrp","chown","chmod","cp","dd","df","dir","dircolors","ln","ls","mkdir","mkfifo","mknod","mktemp","mv","realpath","rm","rmdir","shred","sync","touch","truncate","vdir","b2sum","base32","base64","cat","cksum","comm","csplit","cut","expand","fmt","fold","head","join","md5sum","nl","numfmt","od","paste","ptx","pr","sha1sum","sha224sum","sha256sum","sha384sum","sha512sum","shuf","sort","split","sum","tac","tail","tr","tsort","unexpand","uniq","wc","arch","basename","chroot","date","dirname","du","echo","env","expr","factor","groups","hostid","id","link","logname","nice","nohup","nproc","pathchk","pinky","printenv","printf","pwd","readlink","runcon","seq","sleep","stat","stdbuf","stty","tee","test","timeout","tty","uname","unlink","uptime","users","who","whoami","yes"];return{name:"Bash",aliases:["sh","zsh"],keywords:{$pattern:/\b[a-z][a-z0-9._-]+\b/,keyword:v,literal:N,built_in:[...C,...S,"set","shopt",..._,...M]},contains:[b,e.SHEBANG(),k,m,o,l,E,d,f,h,g,n]}}function z9(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",l="("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{match:/\b(0b[01']+)/},{match:/(-?)\b([\d']+(\.[\d']*)?|\.[\d']+)((ll|LL|l|L)(u|U)?|(u|U)(ll|LL|l|L)?|f|F|b|B)/},{match:/(-?)\b(0[xX][a-fA-F0-9]+(?:'[a-fA-F0-9]+)*(?:\.[a-fA-F0-9]*(?:'[a-fA-F0-9]*)*)?(?:[pP][-+]?[0-9]+)?(l|L)?(u|U)?)/},{match:/(-?)\b\d+(?:'\d+)*(?:\.\d*(?:'\d*)*)?(?:[eE][-+]?\d+)?/}],relevance:0},m={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef elifdef elifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",N={keyword:["asm","auto","break","case","continue","default","do","else","enum","extern","for","fortran","goto","if","inline","register","restrict","return","sizeof","typeof","typeof_unqual","struct","switch","typedef","union","volatile","while","_Alignas","_Alignof","_Atomic","_Generic","_Noreturn","_Static_assert","_Thread_local","alignas","alignof","noreturn","static_assert","thread_local","_Pragma"],type:["float","double","signed","unsigned","int","short","long","char","void","_Bool","_BitInt","_Complex","_Imaginary","_Decimal32","_Decimal64","_Decimal96","_Decimal128","_Decimal64x","_Decimal128x","_Float16","_Float32","_Float64","_Float128","_Float32x","_Float64x","_Float128x","const","static","constexpr","complex","bool","imaginary"],literal:"true false NULL",built_in:"std string wstring cin cout cerr clog stdin stdout stderr stringstream istringstream ostringstream auto_ptr deque list queue stack vector map set pair bitset multiset multimap unordered_set unordered_map unordered_multiset unordered_multimap priority_queue make_pair array shared_ptr abort terminate abs acos asin atan2 atan calloc ceil cosh cos exit exp fabs floor fmod fprintf fputs free frexp fscanf future isalnum isalpha iscntrl isdigit isgraph islower isprint ispunct isspace isupper isxdigit tolower toupper labs ldexp log10 log malloc realloc memchr memcmp memcpy memset modf pow printf putchar puts scanf sinh sin snprintf sprintf sqrt sscanf strcat strchr strcmp strcpy strcspn strlen strncat strncmp strncpy strpbrk strrchr strspn strstr tanh tan vfprintf vprintf vsprintf endl initializer_list unique_ptr"},E=[m,d,n,e.C_BLOCK_COMMENT_MODE,g,h],C={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:N,contains:E.concat([{begin:/\(/,end:/\)/,keywords:N,contains:E.concat(["self"]),relevance:0}]),relevance:0},S={begin:"("+l+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:N,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:N,relevance:0},{begin:b,returnBegin:!0,contains:[e.inherit(y,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:N,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C",aliases:["h"],keywords:N,disableAutodetect:!0,illegal:"</",contains:[].concat(C,S,E,[m,{begin:e.IDENT_RE+"::",keywords:N},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:m,strings:h,keywords:N}}}function P9(e){const t=e.regex,n=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),r="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",l="(?!struct)("+r+"|"+t.optional(a)+"[a-zA-Z_]\\w*"+t.optional("<[^<>]+>")+")",d={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},h={className:"string",variants:[{begin:'(u8?|U|L)?"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]},{begin:"(u8?|U|L)?'("+"\\\\(x[0-9A-Fa-f]{2}|u[0-9A-Fa-f]{4,8}|[0-7]{3}|\\S)"+"|.)",end:"'",illegal:"."},e.END_SAME_AS_BEGIN({begin:/(?:u8?|U|L)?R"([^()\\ ]{0,16})\(/,end:/\)([^()\\ ]{0,16})"/})]},g={className:"number",variants:[{begin:"[+-]?(?:(?:[0-9](?:'?[0-9])*\\.(?:[0-9](?:'?[0-9])*)?|\\.[0-9](?:'?[0-9])*)(?:[Ee][+-]?[0-9](?:'?[0-9])*)?|[0-9](?:'?[0-9])*[Ee][+-]?[0-9](?:'?[0-9])*|0[Xx](?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*(?:\\.(?:[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)?)?|\\.[0-9A-Fa-f](?:'?[0-9A-Fa-f])*)[Pp][+-]?[0-9](?:'?[0-9])*)(?:[Ff](?:16|32|64|128)?|(BF|bf)16|[Ll]|)"},{begin:"[+-]?\\b(?:0[Bb][01](?:'?[01])*|0[Xx][0-9A-Fa-f](?:'?[0-9A-Fa-f])*|0(?:'?[0-7])*|[1-9](?:'?[0-9])*)(?:[Uu](?:LL?|ll?)|[Uu][Zz]?|(?:LL?|ll?)[Uu]?|[Zz][Uu]|)"}],relevance:0},m={className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma _Pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(h,{className:"string"}),{className:"string",begin:/<.*?>/},n,e.C_BLOCK_COMMENT_MODE]},y={className:"title",begin:t.optional(a)+e.IDENT_RE,relevance:0},b=t.optional(a)+e.IDENT_RE+"\\s*\\(",k=["alignas","alignof","and","and_eq","asm","atomic_cancel","atomic_commit","atomic_noexcept","auto","bitand","bitor","break","case","catch","class","co_await","co_return","co_yield","compl","concept","const_cast|10","consteval","constexpr","constinit","continue","decltype","default","delete","do","dynamic_cast|10","else","enum","explicit","export","extern","false","final","for","friend","goto","if","import","inline","module","mutable","namespace","new","noexcept","not","not_eq","nullptr","operator","or","or_eq","override","private","protected","public","reflexpr","register","reinterpret_cast|10","requires","return","sizeof","static_assert","static_cast|10","struct","switch","synchronized","template","this","thread_local","throw","transaction_safe","transaction_safe_dynamic","true","try","typedef","typeid","typename","union","using","virtual","volatile","while","xor","xor_eq"],v=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],N=["any","auto_ptr","barrier","binary_semaphore","bitset","complex","condition_variable","condition_variable_any","counting_semaphore","deque","false_type","flat_map","flat_set","future","imaginary","initializer_list","istringstream","jthread","latch","lock_guard","multimap","multiset","mutex","optional","ostringstream","packaged_task","pair","promise","priority_queue","queue","recursive_mutex","recursive_timed_mutex","scoped_lock","set","shared_future","shared_lock","shared_mutex","shared_timed_mutex","shared_ptr","stack","string_view","stringstream","timed_mutex","thread","true_type","tuple","unique_lock","unique_ptr","unordered_map","unordered_multimap","unordered_multiset","unordered_set","variant","vector","weak_ptr","wstring","wstring_view"],E=["abort","abs","acos","apply","as_const","asin","atan","atan2","calloc","ceil","cerr","cin","clog","cos","cosh","cout","declval","endl","exchange","exit","exp","fabs","floor","fmod","forward","fprintf","fputs","free","frexp","fscanf","future","invoke","isalnum","isalpha","iscntrl","isdigit","isgraph","islower","isprint","ispunct","isspace","isupper","isxdigit","labs","launder","ldexp","log","log10","make_pair","make_shared","make_shared_for_overwrite","make_tuple","make_unique","malloc","memchr","memcmp","memcpy","memset","modf","move","pow","printf","putchar","puts","realloc","scanf","sin","sinh","snprintf","sprintf","sqrt","sscanf","std","stderr","stdin","stdout","strcat","strchr","strcmp","strcpy","strcspn","strlen","strncat","strncmp","strncpy","strpbrk","strrchr","strspn","strstr","swap","tan","tanh","terminate","to_underlying","tolower","toupper","vfprintf","visit","vprintf","vsprintf"],_={type:v,keyword:k,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:N},M={className:"function.dispatch",relevance:0,keywords:{_hint:E},begin:t.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,t.lookahead(/(<[^<>]+>|)\s*\(/))},T=[M,m,d,n,e.C_BLOCK_COMMENT_MODE,g,h],L={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:_,contains:T.concat([{begin:/\(/,end:/\)/,keywords:_,contains:T.concat(["self"]),relevance:0}]),relevance:0},R={className:"function",begin:"("+l+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:_,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:r,keywords:_,relevance:0},{begin:b,returnBegin:!0,contains:[y],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[h,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:[n,e.C_BLOCK_COMMENT_MODE,h,g,d,{begin:/\(/,end:/\)/,keywords:_,relevance:0,contains:["self",n,e.C_BLOCK_COMMENT_MODE,h,g,d]}]},d,n,e.C_BLOCK_COMMENT_MODE,m]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:_,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(L,R,M,T,[m,{begin:"\\b(deque|list|queue|priority_queue|pair|stack|vector|map|set|bitset|multiset|multimap|unordered_map|unordered_set|unordered_multiset|unordered_multimap|array|tuple|optional|variant|function|flat_map|flat_set)\\s*<(?!<)",end:">",keywords:_,contains:["self",d]},{begin:e.IDENT_RE+"::",keywords:_},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function B9(e){const t=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],n=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],r=["default","false","null","true"],a=["abstract","as","base","break","case","catch","class","const","continue","do","else","event","explicit","extern","finally","fixed","for","foreach","goto","if","implicit","in","interface","internal","is","lock","namespace","new","operator","out","override","params","private","protected","public","readonly","record","ref","return","scoped","sealed","sizeof","stackalloc","static","struct","switch","this","throw","try","typeof","unchecked","unsafe","using","virtual","void","volatile","while"],o=["add","alias","and","ascending","args","async","await","by","descending","dynamic","equals","file","from","get","global","group","init","into","join","let","nameof","not","notnull","on","or","orderby","partial","record","remove","required","scoped","select","set","unmanaged","value|0","var","when","where","with","yield"],l={keyword:a.concat(o),built_in:t,literal:r},d=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),f={className:"number",variants:[{begin:"\\b(0b[01']+)"},{begin:"(-?)\\b([\\d']+(\\.[\\d']*)?|\\.[\\d']+)(u|U|l|L|ul|UL|f|F|b|B)"},{begin:"(-?)(\\b0[xX][a-fA-F0-9']+|(\\b[\\d']+(\\.[\\d']*)?|\\.[\\d']+)([eE][-+]?[\\d']+)?)"}],relevance:0},h={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},g={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},m=e.inherit(g,{illegal:/\n/}),y={className:"subst",begin:/\{/,end:/\}/,keywords:l},b=e.inherit(y,{illegal:/\n/}),k={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,b]},v={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},y]},N=e.inherit(v,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]});y.contains=[v,k,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.C_BLOCK_COMMENT_MODE],b.contains=[N,k,m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,f,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const E={variants:[h,v,k,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},C={begin:"<",end:">",contains:[{beginKeywords:"in out"},d]},S=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",_={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:l,illegal:/::/,contains:[e.COMMENT("///","$",{returnBegin:!0,contains:[{className:"doctag",variants:[{begin:"///",relevance:0},{begin:"<!--|-->"},{begin:"</?",end:">"}]}]}),e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"meta",begin:"#",end:"$",keywords:{keyword:"if else elif endif define undef warning error line region endregion pragma checksum"}},E,f,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},d,C,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[d,C,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"meta",begin:"^\\s*\\[(?=[\\w])",excludeBegin:!0,end:"\\]",excludeEnd:!0,contains:[{className:"string",begin:/"/,end:/"/}]},{beginKeywords:"new return throw await else",relevance:0},{className:"function",begin:"("+S+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:l,contains:[{beginKeywords:n.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,C],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:l,relevance:0,contains:[E,f,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},_]}}const $9=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),U9=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],F9=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],q9=[...U9,...F9],H9=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),K9=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),G9=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),V9=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function Y9(e){const t=e.regex,n=$9(e),r={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",o=/@-?\w[\w]*(-\w+)*/,l="[a-zA-Z-][a-zA-Z0-9_-]*",d=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[n.BLOCK_COMMENT,r,n.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+l,relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+K9.join("|")+")"},{begin:":(:)?("+G9.join("|")+")"}]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+V9.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[n.BLOCK_COMMENT,n.HEXCOLOR,n.IMPORTANT,n.CSS_NUMBER_MODE,...d,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...d,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},n.FUNCTION_DISPATCH]},{begin:t.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:o},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:H9.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...d,n.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+q9.join("|")+")\\b"}]}}function Q9(e){const t=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:t.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:t.either(/Index: /,/^index/,/={3,}/,/^-{3}/,/^\*{3} /,/^\+{3}/,/^diff --git/),end:/$/},{match:/^\*{15}$/}]},{className:"addition",begin:/^\+/,end:/$/},{className:"deletion",begin:/^-/,end:/$/},{className:"addition",begin:/^!/,end:/$/}]}}function W9(e){const o={keyword:["break","case","chan","const","continue","default","defer","else","fallthrough","for","func","go","goto","if","import","interface","map","package","range","return","select","struct","switch","type","var"],type:["bool","byte","complex64","complex128","error","float32","float64","int8","int16","int32","int64","string","uint8","uint16","uint32","uint64","int","uint","uintptr","rune"],literal:["true","false","iota","nil"],built_in:["append","cap","close","complex","copy","imag","len","make","new","panic","print","println","real","recover","delete"]};return{name:"Go",aliases:["golang"],keywords:o,illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{className:"string",variants:[e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{begin:"`",end:"`"}]},{className:"number",variants:[{match:/-?\b0[xX]\.[a-fA-F0-9](_?[a-fA-F0-9])*[pP][+-]?\d(_?\d)*i?/,relevance:0},{match:/-?\b0[xX](_?[a-fA-F0-9])+((\.([a-fA-F0-9](_?[a-fA-F0-9])*)?)?[pP][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b0[oO](_?[0-7])*i?/,relevance:0},{match:/-?\.\d(_?\d)*([eE][+-]?\d(_?\d)*)?i?/,relevance:0},{match:/-?\b\d(_?\d)*(\.(\d(_?\d)*)?)?([eE][+-]?\d(_?\d)*)?i?/,relevance:0}]},{begin:/:=/},{className:"function",beginKeywords:"func",end:"\\s*(\\{|$)",excludeEnd:!0,contains:[e.TITLE_MODE,{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:o,illegal:/["']/}]}]}}function X9(e){const t=e.regex,n=/[_A-Za-z][_0-9A-Za-z]*/;return{name:"GraphQL",aliases:["gql"],case_insensitive:!0,disableAutodetect:!1,keywords:{keyword:["query","mutation","subscription","type","input","schema","directive","interface","union","scalar","fragment","enum","on"],literal:["true","false","null"]},contains:[e.HASH_COMMENT_MODE,e.QUOTE_STRING_MODE,e.NUMBER_MODE,{scope:"punctuation",match:/[.]{3}/,relevance:0},{scope:"punctuation",begin:/[\!\(\)\:\=\[\]\{\|\}]{1}/,relevance:0},{scope:"variable",begin:/\$/,end:/\W/,excludeEnd:!0,relevance:0},{scope:"meta",match:/@\w+/,excludeEnd:!0},{scope:"symbol",begin:t.concat(n,t.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function Z9(e){const t=e.regex,n={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},r=e.COMMENT();r.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},o={className:"literal",begin:/\bon|off|true|false|yes|no\b/},l={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},d={begin:/\[/,end:/\]/,contains:[r,o,a,l,n,"self"],relevance:0},f=/[A-Za-z0-9_-]+/,h=/"(\\"|[^"])*"/,g=/'[^']*'/,m=t.either(f,h,g),y=t.concat(m,"(\\s*\\.\\s*",m,")*",t.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[r,{className:"section",begin:/\[+/,end:/\]+/},{begin:y,className:"attr",starts:{end:/$/,contains:[r,d,o,a,l,n]}}]}}var hl="[0-9](_*[0-9])*",Rf=`\\.(${hl})`,Lf="[0-9a-fA-F](_*[0-9a-fA-F])*",SE={className:"number",variants:[{begin:`(\\b(${hl})((${Rf})|\\.)?|(${Rf}))[eE][+-]?(${hl})[fFdD]?\\b`},{begin:`\\b(${hl})((${Rf})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Rf})[fFdD]?\\b`},{begin:`\\b(${hl})[fFdD]\\b`},{begin:`\\b0[xX]((${Lf})\\.?|(${Lf})?\\.(${Lf}))[pP][+-]?(${hl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Lf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function jj(e,t,n){return n===-1?"":e.replace(t,r=>jj(e,t,n-1))}function J9(e){const t=e.regex,n="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",r=n+jj("(?:<"+n+"~~~(?:\\s*,\\s*"+n+"~~~)*>)?",/~~~/g,2),f={keyword:["synchronized","abstract","private","var","static","if","const ","for","while","strictfp","finally","protected","import","native","final","void","enum","else","break","transient","catch","instanceof","volatile","case","assert","package","default","public","try","switch","continue","throws","protected","public","private","module","requires","exports","do","sealed","yield","permits","goto","when"],literal:["false","true","null"],type:["char","boolean","long","float","int","byte","short","double"],built_in:["super","this"]},h={className:"meta",begin:"@"+n,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},g={className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:f,illegal:/<\/|#/,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{begin:/\w+@/,relevance:0},{className:"doctag",begin:"@[A-Za-z]+"}]}),{begin:/import java\.[a-z]+\./,keywords:"import",relevance:2},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,{begin:/"""/,end:/"""/,className:"string",contains:[e.BACKSLASH_ESCAPE]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{match:[/\b(?:class|interface|enum|extends|implements|new)/,/\s+/,n],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[t.concat(/(?!else)/,n),/\s+/,n,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,n],className:{1:"keyword",3:"title.class"},contains:[g,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"new throw return else",relevance:0},{begin:["(?:"+r+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:f,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:f,relevance:0,contains:[h,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,SE,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},SE,h]}}const NE="[A-Za-z$_][0-9A-Za-z$_]*",eF=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],tF=["true","false","null","undefined","NaN","Infinity"],Cj=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],Aj=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Tj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],nF=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],rF=[].concat(Tj,Cj,Aj);function iF(e){const t=e.regex,n=(Q,{after:K})=>{const I="</"+Q[0].slice(1);return Q.input.indexOf(I,K)!==-1},r=NE,a={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,K)=>{const I=Q[0].length+Q.index,P=Q.input[I];if(P==="<"||P===","){K.ignoreMatch();return}P===">"&&(n(Q,{after:I})||K.ignoreMatch());let G;const B=Q.input.substring(I);if(G=B.match(/^\s*=/)){K.ignoreMatch();return}if((G=B.match(/^\s+extends\s+/))&&G.index===0){K.ignoreMatch();return}}},d={$pattern:NE,keyword:eF,literal:tF,built_in:rF,"variable.language":nF},f="[0-9](_?[0-9])*",h=`\\.(${f})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${f})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},C={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,N,{match:/\$\d+/},m];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(S)});const _=[].concat(C,y.contains),M=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M},L={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Cj,...Aj]}},$={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},z={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(Q){return t.concat("(?!",Q.join("|"),")")}const Y={match:t.concat(/\b/,F([...Tj,"super","import"].map(Q=>`${Q}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),$,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,N,C,{match:/\$\d+/},m,R,{scope:"attr",match:r+t.lookahead(":"),relevance:0},V,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:o},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},z,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,q,L,H,{match:/\$[(.]/}]}}function aF(e){const t={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},n={match:/[{}[\],:]/,className:"punctuation",relevance:0},r=["true","false","null"],a={scope:"literal",beginKeywords:r.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:r},contains:[t,n,e.QUOTE_STRING_MODE,a,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var pl="[0-9](_*[0-9])*",If=`\\.(${pl})`,zf="[0-9a-fA-F](_*[0-9a-fA-F])*",sF={className:"number",variants:[{begin:`(\\b(${pl})((${If})|\\.)?|(${If}))[eE][+-]?(${pl})[fFdD]?\\b`},{begin:`\\b(${pl})((${If})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${If})[fFdD]?\\b`},{begin:`\\b(${pl})[fFdD]\\b`},{begin:`\\b0[xX]((${zf})\\.?|(${zf})?\\.(${zf}))[pP][+-]?(${pl})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${zf})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function oF(e){const t={keyword:"abstract as val var vararg get set class object open private protected public noinline crossinline dynamic final enum if else do while for when throw try catch finally import package is in fun override companion reified inline lateinit init interface annotation data sealed internal infix operator out by constructor super tailrec where const inner suspend typealias external expect actual",built_in:"Byte Short Char Int Long Boolean Float Double Void Unit Nothing",literal:"true false null"},n={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},r={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},o={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},l={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[o,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,o,a]}]};a.contains.push(l);const d={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},f={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(l,{className:"string"}),"self"]}]},h=sF,g=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),m={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},y=m;return y.variants[1].contains=[m],m.variants[1].contains=[y],{name:"Kotlin",aliases:["kt","kts"],keywords:t,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,g,n,r,d,f,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:t,relevance:5,contains:[{begin:e.UNDERSCORE_IDENT_RE+"\\s*\\(",returnBegin:!0,relevance:0,contains:[e.UNDERSCORE_TITLE_MODE]},{className:"type",begin:/</,end:/>/,keywords:"reified",relevance:0},{className:"params",begin:/\(/,end:/\)/,endsParent:!0,keywords:t,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[m,e.C_LINE_COMMENT_MODE,g],relevance:0},e.C_LINE_COMMENT_MODE,g,d,f,l,e.C_NUMBER_MODE]},g]},{begin:[/class|interface|trait/,/\s+/,e.UNDERSCORE_IDENT_RE],beginScope:{3:"title.class"},keywords:"class interface trait",end:/[:\{(]|$/,excludeEnd:!0,illegal:"extends implements",contains:[{beginKeywords:"public protected internal private constructor"},e.UNDERSCORE_TITLE_MODE,{className:"type",begin:/</,end:/>/,excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:/[,:]\s*/,end:/[<\(,){\s]|$/,excludeBegin:!0,returnEnd:!0},d,f]},l,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
637
|
-
`},h]}}const lF=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),cF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],uF=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],dF=[...cF,...uF],fF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),Mj=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),Dj=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),hF=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse(),pF=Mj.concat(Dj).sort().reverse();function mF(e){const t=lF(e),n=pF,r="and or not only",a="[\\w-]+",o="("+a+"|@\\{"+a+"\\})",l=[],d=[],f=function(S){return{className:"string",begin:"~?"+S+".*?"+S}},h=function(S,_,M){return{className:S,begin:_,relevance:M}},g={$pattern:/[a-z-]+/,keyword:r,attribute:fF.join(" ")},m={begin:"\\(",end:"\\)",contains:d,keywords:g,relevance:0};d.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,f("'"),f('"'),t.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},t.HEXCOLOR,m,h("variable","@@?"+a,10),h("variable","@\\{"+a+"\\}"),h("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},t.IMPORTANT,{beginKeywords:"and not"},t.FUNCTION_DISPATCH);const y=d.concat({begin:/\{/,end:/\}/,contains:l}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(d)},k={begin:o+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+hF.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:d}}]},v={className:"keyword",begin:"@(import|media|charset|font-face|(-[a-z]+-)?keyframes|supports|document|namespace|page|viewport|host)\\b",starts:{end:"[;{}]",keywords:g,returnEnd:!0,contains:d,relevance:0}},N={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:y}},E={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:o,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,h("keyword","all\\b"),h("variable","@\\{"+a+"\\}"),{begin:"\\b("+dF.join("|")+")\\b",className:"selector-tag"},t.CSS_NUMBER_MODE,h("selector-tag",o,0),h("selector-id","#"+o),h("selector-class","\\."+o,0),h("selector-tag","&",0),t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Mj.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Dj.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:y},{begin:"!important"},t.FUNCTION_DISPATCH]},C={begin:a+`:(:)?(${n.join("|")})`,returnBegin:!0,contains:[E]};return l.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,v,N,C,k,E,b,t.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:l}}function gF(e){const t="\\[=*\\[",n="\\]=*\\]",r={begin:t,end:n,contains:["self"]},a=[e.COMMENT("--(?!"+t+")","$"),e.COMMENT("--"+t,n,{contains:[r],relevance:10})];return{name:"Lua",aliases:["pluto"],keywords:{$pattern:e.UNDERSCORE_IDENT_RE,literal:"true false nil",keyword:"and break do else elseif end for goto if in local not or repeat return then until while",built_in:"_G _ENV _VERSION __index __newindex __mode __call __metatable __tostring __len __gc __add __sub __mul __div __mod __pow __concat __unm __eq __lt __le assert collectgarbage dofile error getfenv getmetatable ipairs load loadfile loadstring module next pairs pcall print rawequal rawget rawset require select setfenv setmetatable tonumber tostring type unpack xpcall arg self coroutine resume yield status wrap create running debug getupvalue debug sethook getmetatable gethook setmetatable setlocal traceback setfenv getinfo setupvalue getlocal getregistry getfenv io lines write close flush open output type read stderr stdin input stdout popen tmpfile math log max acos huge ldexp pi cos tanh pow deg tan cosh sinh random randomseed frexp ceil floor rad abs sqrt modf asin min mod fmod log10 atan2 exp sin atan os exit setlocale date getenv difftime remove time clock tmpname rename execute package preload loadlib loaded loaders cpath config path seeall string sub upper len gfind rep find match char dump gmatch reverse byte format gsub lower table setn insert getn foreachi maxn foreach concat sort remove"},contains:a.concat([{className:"function",beginKeywords:"function",end:"\\)",contains:[e.inherit(e.TITLE_MODE,{begin:"([_a-zA-Z]\\w*\\.)*([_a-zA-Z]\\w*:)?[_a-zA-Z]\\w*"}),{className:"params",begin:"\\(",endsWithParent:!0,contains:a}].concat(a)},e.C_NUMBER_MODE,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,{className:"string",begin:t,end:n,contains:[r],relevance:5}])}}function yF(e){const t={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},n={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,t]},r={className:"variable",begin:/\$\([\w-]+\s/,end:/\)/,keywords:{built_in:"subst patsubst strip findstring filter filter-out sort word wordlist firstword lastword dir notdir suffix basename addsuffix addprefix join wildcard realpath abspath error warning shell origin flavor foreach if or and call eval file value"},contains:[t,n]},a={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},o={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},l={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[t]};return{name:"Makefile",aliases:["mk","mak","make"],keywords:{$pattern:/[\w-]+/,keyword:"define endef undefine ifdef ifndef ifeq ifneq else endif include -include sinclude override export unexport private vpath"},contains:[e.HASH_COMMENT_MODE,t,n,r,a,o,l]}}function bF(e){const t=e.regex,n={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},r={begin:"^[-\\*]{3,}",end:"$"},a={className:"code",variants:[{begin:"(`{3,})[^`](.|\\n)*?\\1`*[ ]*"},{begin:"(~{3,})[^~](.|\\n)*?\\1~*[ ]*"},{begin:"```",end:"```+[ ]*$"},{begin:"~~~",end:"~~~+[ ]*$"},{begin:"`.+?`"},{begin:"(?=^( {4}|\\t))",contains:[{begin:"^( {4}|\\t)",end:"(\\n)$"}],relevance:0}]},o={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},l={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},d=/[A-Za-z][A-Za-z0-9+.-]*/,f={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:t.concat(/\[.+?\]\(/,d,/:\/\/.*?\)/),relevance:2},{begin:/\[.+?\]\([./?&#].*?\)/,relevance:1},{begin:/\[.*?\]\(.*?\)/,relevance:0}],returnBegin:!0,contains:[{match:/\[(?=\])/},{className:"string",relevance:0,begin:"\\[",end:"\\]",excludeBegin:!0,returnEnd:!0},{className:"link",relevance:0,begin:"\\]\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0},{className:"symbol",relevance:0,begin:"\\]\\[",end:"\\]",excludeBegin:!0,excludeEnd:!0}]},h={className:"strong",contains:[],variants:[{begin:/_{2}(?!\s)/,end:/_{2}/},{begin:/\*{2}(?!\s)/,end:/\*{2}/}]},g={className:"emphasis",contains:[],variants:[{begin:/\*(?![*\s])/,end:/\*/},{begin:/_(?![_\s])/,end:/_/,relevance:0}]},m=e.inherit(h,{contains:[]}),y=e.inherit(g,{contains:[]});h.contains.push(y),g.contains.push(m);let b=[n,f];return[h,g,m,y].forEach(E=>{E.contains=E.contains.concat(b)}),b=b.concat(h,g),{name:"Markdown",aliases:["md","mkdown","mkd"],contains:[{className:"section",variants:[{begin:"^#{1,6}",end:"$",contains:b},{begin:"(?=^.+?\\n[=-]{2,}$)",contains:[{begin:"^[=-]*$"},{begin:"^",end:"\\n",contains:b}]}]},n,o,h,g,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},a,r,f,l,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function xF(e){const t={className:"built_in",begin:"\\b(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)\\w+"},n=/[a-zA-Z@][a-zA-Z0-9_]*/,d={"variable.language":["this","super"],$pattern:n,keyword:["while","export","sizeof","typedef","const","struct","for","union","volatile","static","mutable","if","do","return","goto","enum","else","break","extern","asm","case","default","register","explicit","typename","switch","continue","inline","readonly","assign","readwrite","self","@synchronized","id","typeof","nonatomic","IBOutlet","IBAction","strong","weak","copy","in","out","inout","bycopy","byref","oneway","__strong","__weak","__block","__autoreleasing","@private","@protected","@public","@try","@property","@end","@throw","@catch","@finally","@autoreleasepool","@synthesize","@dynamic","@selector","@optional","@required","@encode","@package","@import","@defs","@compatibility_alias","__bridge","__bridge_transfer","__bridge_retained","__bridge_retain","__covariant","__contravariant","__kindof","_Nonnull","_Nullable","_Null_unspecified","__FUNCTION__","__PRETTY_FUNCTION__","__attribute__","getter","setter","retain","unsafe_unretained","nonnull","nullable","null_unspecified","null_resettable","class","instancetype","NS_DESIGNATED_INITIALIZER","NS_UNAVAILABLE","NS_REQUIRES_SUPER","NS_RETURNS_INNER_POINTER","NS_INLINE","NS_AVAILABLE","NS_DEPRECATED","NS_ENUM","NS_OPTIONS","NS_SWIFT_UNAVAILABLE","NS_ASSUME_NONNULL_BEGIN","NS_ASSUME_NONNULL_END","NS_REFINED_FOR_SWIFT","NS_SWIFT_NAME","NS_SWIFT_NOTHROW","NS_DURING","NS_HANDLER","NS_ENDHANDLER","NS_VALUERETURN","NS_VOIDRETURN"],literal:["false","true","FALSE","TRUE","nil","YES","NO","NULL"],built_in:["dispatch_once_t","dispatch_queue_t","dispatch_sync","dispatch_async","dispatch_once"],type:["int","float","char","unsigned","signed","short","long","double","wchar_t","unichar","void","bool","BOOL","id|0","_Bool"]},f={$pattern:n,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:d,illegal:"</",contains:[t,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,e.C_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,{className:"string",variants:[{begin:'@"',end:'"',illegal:"\\n",contains:[e.BACKSLASH_ESCAPE]}]},{className:"meta",begin:/#\s*[a-z]+\b/,end:/$/,keywords:{keyword:"if else elif endif define undef warning error line pragma ifdef ifndef include"},contains:[{begin:/\\\n/,relevance:0},e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),{className:"string",begin:/<.*?>/,end:/$/,illegal:"\\n"},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{className:"class",begin:"("+f.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:f,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function vF(e){const t=e.regex,n=["abs","accept","alarm","and","atan2","bind","binmode","bless","break","caller","chdir","chmod","chomp","chop","chown","chr","chroot","class","close","closedir","connect","continue","cos","crypt","dbmclose","dbmopen","defined","delete","die","do","dump","each","else","elsif","endgrent","endhostent","endnetent","endprotoent","endpwent","endservent","eof","eval","exec","exists","exit","exp","fcntl","field","fileno","flock","for","foreach","fork","format","formline","getc","getgrent","getgrgid","getgrnam","gethostbyaddr","gethostbyname","gethostent","getlogin","getnetbyaddr","getnetbyname","getnetent","getpeername","getpgrp","getpriority","getprotobyname","getprotobynumber","getprotoent","getpwent","getpwnam","getpwuid","getservbyname","getservbyport","getservent","getsockname","getsockopt","given","glob","gmtime","goto","grep","gt","hex","if","index","int","ioctl","join","keys","kill","last","lc","lcfirst","length","link","listen","local","localtime","log","lstat","lt","ma","map","method","mkdir","msgctl","msgget","msgrcv","msgsnd","my","ne","next","no","not","oct","open","opendir","or","ord","our","pack","package","pipe","pop","pos","print","printf","prototype","push","q|0","qq","quotemeta","qw","qx","rand","read","readdir","readline","readlink","readpipe","recv","redo","ref","rename","require","reset","return","reverse","rewinddir","rindex","rmdir","say","scalar","seek","seekdir","select","semctl","semget","semop","send","setgrent","sethostent","setnetent","setpgrp","setpriority","setprotoent","setpwent","setservent","setsockopt","shift","shmctl","shmget","shmread","shmwrite","shutdown","sin","sleep","socket","socketpair","sort","splice","split","sprintf","sqrt","srand","stat","state","study","sub","substr","symlink","syscall","sysopen","sysread","sysseek","system","syswrite","tell","telldir","tie","tied","time","times","tr","truncate","uc","ucfirst","umask","undef","unless","unlink","unpack","unshift","untie","until","use","utime","values","vec","wait","waitpid","wantarray","warn","when","while","write","x|0","xor","y|0"],r=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:n.join(" ")},o={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},l={begin:/->\{/,end:/\}/},d={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},f={scope:"variable",variants:[{begin:/\$\d/},{begin:t.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[d]},h={className:"number",variants:[{match:/0?\.[0-9][0-9_]+\b/},{match:/\bv?(0|[1-9][0-9_]*(\.[0-9_]+)?|[1-9][0-9_]*)\b/},{match:/\b0[0-7][0-7_]*\b/},{match:/\b0x[0-9a-fA-F][0-9a-fA-F_]*\b/},{match:/\b0b[0-1][0-1_]*\b/}],relevance:0},g=[e.BACKSLASH_ESCAPE,o,f],m=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],y=(v,N,E="\\1")=>{const C=E==="\\1"?E:t.concat(E,N);return t.concat(t.concat("(?:",v,")"),N,/(?:\\.|[^\\\/])*?/,C,/(?:\\.|[^\\\/])*?/,E,r)},b=(v,N,E)=>t.concat(t.concat("(?:",v,")"),N,/(?:\\.|[^\\\/])*?/,E,r),k=[f,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),l,{className:"string",contains:g,variants:[{begin:"q[qwxr]?\\s*\\(",end:"\\)",relevance:5},{begin:"q[qwxr]?\\s*\\[",end:"\\]",relevance:5},{begin:"q[qwxr]?\\s*\\{",end:"\\}",relevance:5},{begin:"q[qwxr]?\\s*\\|",end:"\\|",relevance:5},{begin:"q[qwxr]?\\s*<",end:">",relevance:5},{begin:"qw\\s+q",end:"q",relevance:5},{begin:"'",end:"'",contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"'},{begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE]},{begin:/\{\w+\}/,relevance:0},{begin:"-?\\w+\\s*=>",relevance:0}]},h,{begin:"(\\/\\/|"+e.RE_STARTERS_RE+"|\\b(split|return|print|reverse|grep)\\b)\\s*",keywords:"split return print reverse grep",relevance:0,contains:[e.HASH_COMMENT_MODE,{className:"regexp",variants:[{begin:y("s|tr|y",t.either(...m,{capture:!0}))},{begin:y("s|tr|y","\\(","\\)")},{begin:y("s|tr|y","\\[","\\]")},{begin:y("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",t.either(...m,{capture:!0}),/\1/)},{begin:b("m|qr",/\(/,/\)/)},{begin:b("m|qr",/\[/,/\]/)},{begin:b("m|qr",/\{/,/\}/)}]}]},{className:"function",beginKeywords:"sub method",end:"(\\s*\\(.*?\\))?[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,d,h]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return o.contains=k,l.contains=k,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:k}}function wF(e){const t=e.regex,n=/(?![A-Za-z0-9])(?![$])/,r=t.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,n),a=t.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,n),o=t.concat(/[A-Z]+/,n),l={scope:"variable",match:"\\$+"+r},d={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},f={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},h=e.inherit(e.APOS_STRING_MODE,{illegal:null}),g=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(f)}),m={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(f),"on:begin":(D,H)=>{H.data._beginMatch=D[1]||D[2]},"on:end":(D,H)=>{H.data._beginMatch!==D[1]&&H.ignoreMatch()}},y=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[
|
|
638
|
-
]`,k={scope:"string",variants:[g,h,m,y]},v={scope:"number",variants:[{begin:"\\b0[bB][01]+(?:_[01]+)*\\b"},{begin:"\\b0[oO][0-7]+(?:_[0-7]+)*\\b"},{begin:"\\b0[xX][\\da-fA-F]+(?:_[\\da-fA-F]+)*\\b"},{begin:"(?:\\b\\d+(?:_\\d+)*(\\.(?:\\d+(?:_\\d+)*))?|\\B\\.\\d+)(?:[eE][+-]?\\d+)?"}],relevance:0},N=["false","null","true"],E=["__CLASS__","__DIR__","__FILE__","__FUNCTION__","__COMPILER_HALT_OFFSET__","__LINE__","__METHOD__","__NAMESPACE__","__TRAIT__","die","echo","exit","include","include_once","print","require","require_once","array","abstract","and","as","binary","bool","boolean","break","callable","case","catch","class","clone","const","continue","declare","default","do","double","else","elseif","empty","enddeclare","endfor","endforeach","endif","endswitch","endwhile","enum","eval","extends","final","finally","float","for","foreach","from","global","goto","if","implements","instanceof","insteadof","int","integer","interface","isset","iterable","list","match|0","mixed","new","never","object","or","private","protected","public","readonly","real","return","string","switch","throw","trait","try","unset","use","var","void","while","xor","yield"],C=["Error|0","AppendIterator","ArgumentCountError","ArithmeticError","ArrayIterator","ArrayObject","AssertionError","BadFunctionCallException","BadMethodCallException","CachingIterator","CallbackFilterIterator","CompileError","Countable","DirectoryIterator","DivisionByZeroError","DomainException","EmptyIterator","ErrorException","Exception","FilesystemIterator","FilterIterator","GlobIterator","InfiniteIterator","InvalidArgumentException","IteratorIterator","LengthException","LimitIterator","LogicException","MultipleIterator","NoRewindIterator","OutOfBoundsException","OutOfRangeException","OuterIterator","OverflowException","ParentIterator","ParseError","RangeException","RecursiveArrayIterator","RecursiveCachingIterator","RecursiveCallbackFilterIterator","RecursiveDirectoryIterator","RecursiveFilterIterator","RecursiveIterator","RecursiveIteratorIterator","RecursiveRegexIterator","RecursiveTreeIterator","RegexIterator","RuntimeException","SeekableIterator","SplDoublyLinkedList","SplFileInfo","SplFileObject","SplFixedArray","SplHeap","SplMaxHeap","SplMinHeap","SplObjectStorage","SplObserver","SplPriorityQueue","SplQueue","SplStack","SplSubject","SplTempFileObject","TypeError","UnderflowException","UnexpectedValueException","UnhandledMatchError","ArrayAccess","BackedEnum","Closure","Fiber","Generator","Iterator","IteratorAggregate","Serializable","Stringable","Throwable","Traversable","UnitEnum","WeakReference","WeakMap","Directory","__PHP_Incomplete_Class","parent","php_user_filter","self","static","stdClass"],_={keyword:E,literal:(D=>{const H=[];return D.forEach(O=>{H.push(O),O.toLowerCase()===O?H.push(O.toUpperCase()):H.push(O.toLowerCase())}),H})(N),built_in:C},M=D=>D.map(H=>H.replace(/\|\d+$/,"")),T={variants:[{match:[/new/,t.concat(b,"+"),t.concat("(?!",M(C).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},L=t.concat(r,"\\b(?!\\()"),R={variants:[{match:[t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,t.concat(/::/,t.lookahead(/(?!class\b)/)),L],scope:{1:"title.class",3:"variable.constant"}},{match:[a,t.concat("::",t.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},$={scope:"attr",match:t.concat(r,t.lookahead(":"),t.lookahead(/(?!::)/))},z={relevance:0,begin:/\(/,end:/\)/,keywords:_,contains:[$,l,R,e.C_BLOCK_COMMENT_MODE,k,v,T]},q={relevance:0,match:[/\b/,t.concat("(?!fn\\b|function\\b|",M(E).join("\\b|"),"|",M(C).join("\\b|"),"\\b)"),r,t.concat(b,"*"),t.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[z]};z.contains.push(q);const F=[$,R,e.C_BLOCK_COMMENT_MODE,k,v,T],Y={begin:t.concat(/#\[\s*\\?/,t.either(a,o)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:N,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:N,keyword:["new","array"]},contains:["self",...F]},...F,{scope:"meta",variants:[{match:a},{match:o}]}]};return{case_insensitive:!1,keywords:_,contains:[Y,e.HASH_COMMENT_MODE,e.COMMENT("//","$"),e.COMMENT("/\\*","\\*/",{contains:[{scope:"doctag",match:"@[A-Za-z]+"}]}),{match:/__halt_compiler\(\);/,keywords:"__halt_compiler",starts:{scope:"comment",end:e.MATCH_NOTHING_RE,contains:[{match:/\?>/,scope:"meta",endsParent:!0}]}},d,{scope:"variable.language",match:/\$this\b/},l,q,R,{match:[/const/,/\s/,r],scope:{1:"keyword",3:"variable.constant"}},T,{scope:"function",relevance:0,beginKeywords:"fn function",end:/[;{]/,excludeEnd:!0,illegal:"[$%\\[]",contains:[{beginKeywords:"use"},e.UNDERSCORE_TITLE_MODE,{begin:"=>",endsParent:!0},{scope:"params",begin:"\\(",end:"\\)",excludeBegin:!0,excludeEnd:!0,keywords:_,contains:["self",Y,l,R,e.C_BLOCK_COMMENT_MODE,k,v]}]},{scope:"class",variants:[{beginKeywords:"enum",illegal:/[($"]/},{beginKeywords:"class interface trait",illegal:/[:($"]/}],relevance:0,end:/\{/,excludeEnd:!0,contains:[{beginKeywords:"extends implements"},e.UNDERSCORE_TITLE_MODE]},{beginKeywords:"namespace",relevance:0,end:";",illegal:/[.']/,contains:[e.inherit(e.UNDERSCORE_TITLE_MODE,{scope:"title.class"})]},{beginKeywords:"use",relevance:0,end:";",contains:[{match:/\b(as|const|function)\b/,scope:"keyword"},e.UNDERSCORE_TITLE_MODE]},k,v]}}function kF(e){return{name:"PHP template",subLanguage:"xml",contains:[{begin:/<\?(php|=)?/,end:/\?>/,subLanguage:"php",contains:[{begin:"/\\*",end:"\\*/",skip:!0},{begin:'b"',end:'"',skip:!0},{begin:"b'",end:"'",skip:!0},e.inherit(e.APOS_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0}),e.inherit(e.QUOTE_STRING_MODE,{illegal:null,className:null,contains:null,skip:!0})]}]}}function EF(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function SF(e){const t=e.regex,n=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),r=["and","as","assert","async","await","break","case","class","continue","def","del","elif","else","except","finally","for","from","global","if","import","in","is","lambda","match","nonlocal|10","not","or","pass","raise","return","try","while","with","yield"],d={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:r,built_in:["__import__","abs","all","any","ascii","bin","bool","breakpoint","bytearray","bytes","callable","chr","classmethod","compile","complex","delattr","dict","dir","divmod","enumerate","eval","exec","filter","float","format","frozenset","getattr","globals","hasattr","hash","help","hex","id","input","int","isinstance","issubclass","iter","len","list","locals","map","max","memoryview","min","next","object","oct","open","ord","pow","print","property","range","repr","reversed","round","set","setattr","slice","sorted","staticmethod","str","sum","super","tuple","type","vars","zip"],literal:["__debug__","Ellipsis","False","None","NotImplemented","True"],type:["Any","Callable","Coroutine","Dict","List","Literal","Generic","Optional","Sequence","Set","Tuple","Type","Union"]},f={className:"meta",begin:/^(>>>|\.\.\.) /},h={className:"subst",begin:/\{/,end:/\}/,keywords:d,illegal:/#/},g={begin:/\{\{/,relevance:0},m={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,f,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,f,g,h]},{begin:/([uU]|[rR])'/,end:/'/,relevance:10},{begin:/([uU]|[rR])"/,end:/"/,relevance:10},{begin:/([bB]|[bB][rR]|[rR][bB])'/,end:/'/},{begin:/([bB]|[bB][rR]|[rR][bB])"/,end:/"/},{begin:/([fF][rR]|[rR][fF]|[fF])'/,end:/'/,contains:[e.BACKSLASH_ESCAPE,g,h]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,h]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},y="[0-9](_?[0-9])*",b=`(\\b(${y}))?\\.(${y})|\\b(${y})\\.`,k=`\\b|${r.join("|")}`,v={className:"number",relevance:0,variants:[{begin:`(\\b(${y})|(${b}))[eE][+-]?(${y})[jJ]?(?=${k})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${k})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${k})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${k})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${k})`},{begin:`\\b(${y})[jJ](?=${k})`}]},N={className:"comment",begin:t.lookahead(/# type:/),end:/$/,keywords:d,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},E={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:["self",f,v,m,e.HASH_COMMENT_MODE]}]};return h.contains=[m,v,f],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:d,illegal:/(<\/|\?)|=>/,contains:[f,v,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},m,N,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[E]},{variants:[{match:[/\bclass/,/\s+/,n,/\s*/,/\(\s*/,n,/\s*\)/]},{match:[/\bclass/,/\s+/,n]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[v,E,m]}]}}function NF(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function _F(e){const t=e.regex,n=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,r=t.either(/0[xX][0-9a-fA-F]+\.[0-9a-fA-F]*[pP][+-]?\d+i?/,/0[xX][0-9a-fA-F]+(?:[pP][+-]?\d+)?[Li]?/,/(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?[Li]?/),a=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,o=t.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:n,keyword:"function if in break next repeat else for while",literal:"NULL NA TRUE FALSE Inf NaN NA_integer_|10 NA_real_|10 NA_character_|10 NA_complex_|10",built_in:"LETTERS letters month.abb month.name pi T F abs acos acosh all any anyNA Arg as.call as.character as.complex as.double as.environment as.integer as.logical as.null.default as.numeric as.raw asin asinh atan atanh attr attributes baseenv browser c call ceiling class Conj cos cosh cospi cummax cummin cumprod cumsum digamma dim dimnames emptyenv exp expression floor forceAndCall gamma gc.time globalenv Im interactive invisible is.array is.atomic is.call is.character is.complex is.double is.environment is.expression is.finite is.function is.infinite is.integer is.language is.list is.logical is.matrix is.na is.name is.nan is.null is.numeric is.object is.pairlist is.raw is.recursive is.single is.symbol lazyLoadDBfetch length lgamma list log max min missing Mod names nargs nzchar oldClass on.exit pos.to.env proc.time prod quote range Re rep retracemem return round seq_along seq_len seq.int sign signif sin sinh sinpi sqrt standardGeneric substitute sum switch tan tanh tanpi tracemem trigamma trunc unclass untracemem UseMethod xtfrm"},contains:[e.COMMENT(/#'/,/$/,{contains:[{scope:"doctag",match:/@examples/,starts:{end:t.lookahead(t.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:n},{match:/`(?:\\.|[^`\\])+`/}],endsParent:!0}]},{scope:"doctag",match:/@[a-zA-Z]+/},{scope:"keyword",match:/\\[a-zA-Z]+/}]}),e.HASH_COMMENT_MODE,{scope:"string",contains:[e.BACKSLASH_ESCAPE],variants:[e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\(/,end:/\)(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\{/,end:/\}(-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]"(-*)\[/,end:/\](-*)"/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\(/,end:/\)(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\{/,end:/\}(-*)'/}),e.END_SAME_AS_BEGIN({begin:/[rR]'(-*)\[/,end:/\](-*)'/}),{begin:'"',end:'"',relevance:0},{begin:"'",end:"'",relevance:0}]},{relevance:0,variants:[{scope:{1:"operator",2:"number"},match:[a,r]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,r]},{scope:{1:"punctuation",2:"number"},match:[o,r]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,r]}]},{scope:{3:"operator"},match:[n,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:o},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function jF(e){const t=e.regex,n="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",r=t.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=t.concat(r,/(::\w+)*/),l={"variable.constant":["__FILE__","__LINE__","__ENCODING__"],"variable.language":["self","super"],keyword:["alias","and","begin","BEGIN","break","case","class","defined","do","else","elsif","end","END","ensure","for","if","in","module","next","not","or","redo","require","rescue","retry","return","then","undef","unless","until","when","while","yield",...["include","extend","prepend","public","private","protected","raise","throw"]],built_in:["proc","lambda","attr_accessor","attr_reader","attr_writer","define_method","private_constant","module_function"],literal:["true","false","nil"]},d={className:"doctag",begin:"@[A-Za-z]+"},f={begin:"#<",end:">"},h=[e.COMMENT("#","$",{contains:[d]}),e.COMMENT("^=begin","^=end",{contains:[d],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:l},m={className:"string",contains:[e.BACKSLASH_ESCAPE,g],variants:[{begin:/'/,end:/'/},{begin:/"/,end:/"/},{begin:/`/,end:/`/},{begin:/%[qQwWx]?\(/,end:/\)/},{begin:/%[qQwWx]?\[/,end:/\]/},{begin:/%[qQwWx]?\{/,end:/\}/},{begin:/%[qQwWx]?</,end:/>/},{begin:/%[qQwWx]?\//,end:/\//},{begin:/%[qQwWx]?%/,end:/%/},{begin:/%[qQwWx]?-/,end:/-/},{begin:/%[qQwWx]?\|/,end:/\|/},{begin:/\B\?(\\\d{1,3})/},{begin:/\B\?(\\x[A-Fa-f0-9]{1,2})/},{begin:/\B\?(\\u\{?[A-Fa-f0-9]{1,6}\}?)/},{begin:/\B\?(\\M-\\C-|\\M-\\c|\\c\\M-|\\M-|\\C-\\M-)[\x20-\x7e]/},{begin:/\B\?\\(c|C-)[\x20-\x7e]/},{begin:/\B\?\\?\S/},{begin:t.concat(/<<[-~]?'?/,t.lookahead(/(\w+)(?=\W)[^\n]*\n(?:[^\n]*\n)*?\s*\1\b/)),contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,contains:[e.BACKSLASH_ESCAPE,g]})]}]},y="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",k={className:"number",relevance:0,variants:[{begin:`\\b(${y})(\\.(${b}))?([eE][+-]?(${b})|r)?i?\\b`},{begin:"\\b0[dD][0-9](_?[0-9])*r?i?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*r?i?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*r?i?\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*r?i?\\b"},{begin:"\\b0(_?[0-7])+r?i?\\b"}]},v={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:l}]},T=[m,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:l},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:l},{relevance:0,match:[a,/\.new[. (]/],scope:{1:"title.class"}},{relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"},{relevance:0,match:r,scope:"title.class"},{match:[/def/,/\s+/,n],scope:{1:"keyword",3:"title.function"},contains:[v]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[m,{begin:n}],relevance:0},k,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:l},{begin:"("+e.RE_STARTERS_RE+"|unless)\\s*",keywords:"unless",contains:[{className:"regexp",contains:[e.BACKSLASH_ESCAPE,g],illegal:/\n/,variants:[{begin:"/",end:"/[a-z]*"},{begin:/%r\{/,end:/\}[a-z]*/},{begin:"%r\\(",end:"\\)[a-z]*"},{begin:"%r!",end:"![a-z]*"},{begin:"%r\\[",end:"\\][a-z]*"}]}].concat(f,h),relevance:0}].concat(f,h);g.contains=T,v.contains=T;const z=[{begin:/^\s*=>/,starts:{end:"$",contains:T}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:l,contains:T}}];return h.unshift(f),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:l,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(z).concat(h).concat(T)}}function CF(e){const t=e.regex,n=/(r#)?/,r=t.concat(n,e.UNDERSCORE_IDENT_RE),a=t.concat(n,e.IDENT_RE),o={className:"title.function.invoke",relevance:0,begin:t.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,t.lookahead(/\s*\(/))},l="([ui](8|16|32|64|128|size)|f(32|64))?",d=["abstract","as","async","await","become","box","break","const","continue","crate","do","dyn","else","enum","extern","false","final","fn","for","if","impl","in","let","loop","macro","match","mod","move","mut","override","priv","pub","ref","return","self","Self","static","struct","super","trait","true","try","type","typeof","union","unsafe","unsized","use","virtual","where","while","yield"],f=["true","false","Some","None","Ok","Err"],h=["drop ","Copy","Send","Sized","Sync","Drop","Fn","FnMut","FnOnce","ToOwned","Clone","Debug","PartialEq","PartialOrd","Eq","Ord","AsRef","AsMut","Into","From","Default","Iterator","Extend","IntoIterator","DoubleEndedIterator","ExactSizeIterator","SliceConcatExt","ToString","assert!","assert_eq!","bitflags!","bytes!","cfg!","col!","concat!","concat_idents!","debug_assert!","debug_assert_eq!","env!","eprintln!","panic!","file!","format!","format_args!","include_bytes!","include_str!","line!","local_data_key!","module_path!","option_env!","print!","println!","select!","stringify!","try!","unimplemented!","unreachable!","vec!","write!","writeln!","macro_rules!","assert_ne!","debug_assert_ne!"],g=["i8","i16","i32","i64","i128","isize","u8","u16","u32","u64","u128","usize","f32","f64","str","char","bool","Box","Option","Result","String","Vec"];return{name:"Rust",aliases:["rs"],keywords:{$pattern:e.IDENT_RE+"!?",type:g,keyword:d,literal:f,built_in:h},illegal:"</",contains:[e.C_LINE_COMMENT_MODE,e.COMMENT("/\\*","\\*/",{contains:["self"]}),e.inherit(e.QUOTE_STRING_MODE,{begin:/b?"/,illegal:null}),{className:"symbol",begin:/'[a-zA-Z_][a-zA-Z0-9_]*(?!')/},{scope:"string",variants:[{begin:/b?r(#*)"(.|\n)*?"\1(?!#)/},{begin:/b?'/,end:/'/,contains:[{scope:"char.escape",match:/\\('|\w|x\w{2}|u\w{4}|U\w{8})/}]}]},{className:"number",variants:[{begin:"\\b0b([01_]+)"+l},{begin:"\\b0o([0-7_]+)"+l},{begin:"\\b0x([A-Fa-f0-9_]+)"+l},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+l}],relevance:0},{begin:[/fn/,/\s+/,r],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,r],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,r,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,r],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:h,type:g}},{className:"punctuation",begin:"->"},o]}}const AF=e=>({IMPORTANT:{scope:"meta",begin:"!important"},BLOCK_COMMENT:e.C_BLOCK_COMMENT_MODE,HEXCOLOR:{scope:"number",begin:/#(([0-9a-fA-F]{3,4})|(([0-9a-fA-F]{2}){3,4}))\b/},FUNCTION_DISPATCH:{className:"built_in",begin:/[\w-]+(?=\()/},ATTRIBUTE_SELECTOR_MODE:{scope:"selector-attr",begin:/\[/,end:/\]/,illegal:"$",contains:[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},CSS_NUMBER_MODE:{scope:"number",begin:e.NUMBER_RE+"(%|em|ex|ch|rem|vw|vh|vmin|vmax|cm|mm|in|pt|pc|px|deg|grad|rad|turn|s|ms|Hz|kHz|dpi|dpcm|dppx)?",relevance:0},CSS_VARIABLE:{className:"attr",begin:/--[A-Za-z_][A-Za-z0-9_-]*/}}),TF=["a","abbr","address","article","aside","audio","b","blockquote","body","button","canvas","caption","cite","code","dd","del","details","dfn","div","dl","dt","em","fieldset","figcaption","figure","footer","form","h1","h2","h3","h4","h5","h6","header","hgroup","html","i","iframe","img","input","ins","kbd","label","legend","li","main","mark","menu","nav","object","ol","optgroup","option","p","picture","q","quote","samp","section","select","source","span","strong","summary","sup","table","tbody","td","textarea","tfoot","th","thead","time","tr","ul","var","video"],MF=["defs","g","marker","mask","pattern","svg","switch","symbol","feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feFlood","feGaussianBlur","feImage","feMerge","feMorphology","feOffset","feSpecularLighting","feTile","feTurbulence","linearGradient","radialGradient","stop","circle","ellipse","image","line","path","polygon","polyline","rect","text","use","textPath","tspan","foreignObject","clipPath"],DF=[...TF,...MF],OF=["any-hover","any-pointer","aspect-ratio","color","color-gamut","color-index","device-aspect-ratio","device-height","device-width","display-mode","forced-colors","grid","height","hover","inverted-colors","monochrome","orientation","overflow-block","overflow-inline","pointer","prefers-color-scheme","prefers-contrast","prefers-reduced-motion","prefers-reduced-transparency","resolution","scan","scripting","update","width","min-width","max-width","min-height","max-height"].sort().reverse(),RF=["active","any-link","blank","checked","current","default","defined","dir","disabled","drop","empty","enabled","first","first-child","first-of-type","fullscreen","future","focus","focus-visible","focus-within","has","host","host-context","hover","indeterminate","in-range","invalid","is","lang","last-child","last-of-type","left","link","local-link","not","nth-child","nth-col","nth-last-child","nth-last-col","nth-last-of-type","nth-of-type","only-child","only-of-type","optional","out-of-range","past","placeholder-shown","read-only","read-write","required","right","root","scope","target","target-within","user-invalid","valid","visited","where"].sort().reverse(),LF=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),IF=["accent-color","align-content","align-items","align-self","alignment-baseline","all","anchor-name","animation","animation-composition","animation-delay","animation-direction","animation-duration","animation-fill-mode","animation-iteration-count","animation-name","animation-play-state","animation-range","animation-range-end","animation-range-start","animation-timeline","animation-timing-function","appearance","aspect-ratio","backdrop-filter","backface-visibility","background","background-attachment","background-blend-mode","background-clip","background-color","background-image","background-origin","background-position","background-position-x","background-position-y","background-repeat","background-size","baseline-shift","block-size","border","border-block","border-block-color","border-block-end","border-block-end-color","border-block-end-style","border-block-end-width","border-block-start","border-block-start-color","border-block-start-style","border-block-start-width","border-block-style","border-block-width","border-bottom","border-bottom-color","border-bottom-left-radius","border-bottom-right-radius","border-bottom-style","border-bottom-width","border-collapse","border-color","border-end-end-radius","border-end-start-radius","border-image","border-image-outset","border-image-repeat","border-image-slice","border-image-source","border-image-width","border-inline","border-inline-color","border-inline-end","border-inline-end-color","border-inline-end-style","border-inline-end-width","border-inline-start","border-inline-start-color","border-inline-start-style","border-inline-start-width","border-inline-style","border-inline-width","border-left","border-left-color","border-left-style","border-left-width","border-radius","border-right","border-right-color","border-right-style","border-right-width","border-spacing","border-start-end-radius","border-start-start-radius","border-style","border-top","border-top-color","border-top-left-radius","border-top-right-radius","border-top-style","border-top-width","border-width","bottom","box-align","box-decoration-break","box-direction","box-flex","box-flex-group","box-lines","box-ordinal-group","box-orient","box-pack","box-shadow","box-sizing","break-after","break-before","break-inside","caption-side","caret-color","clear","clip","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","color-scheme","column-count","column-fill","column-gap","column-rule","column-rule-color","column-rule-style","column-rule-width","column-span","column-width","columns","contain","contain-intrinsic-block-size","contain-intrinsic-height","contain-intrinsic-inline-size","contain-intrinsic-size","contain-intrinsic-width","container","container-name","container-type","content","content-visibility","counter-increment","counter-reset","counter-set","cue","cue-after","cue-before","cursor","cx","cy","direction","display","dominant-baseline","empty-cells","enable-background","field-sizing","fill","fill-opacity","fill-rule","filter","flex","flex-basis","flex-direction","flex-flow","flex-grow","flex-shrink","flex-wrap","float","flood-color","flood-opacity","flow","font","font-display","font-family","font-feature-settings","font-kerning","font-language-override","font-optical-sizing","font-palette","font-size","font-size-adjust","font-smooth","font-smoothing","font-stretch","font-style","font-synthesis","font-synthesis-position","font-synthesis-small-caps","font-synthesis-style","font-synthesis-weight","font-variant","font-variant-alternates","font-variant-caps","font-variant-east-asian","font-variant-emoji","font-variant-ligatures","font-variant-numeric","font-variant-position","font-variation-settings","font-weight","forced-color-adjust","gap","glyph-orientation-horizontal","glyph-orientation-vertical","grid","grid-area","grid-auto-columns","grid-auto-flow","grid-auto-rows","grid-column","grid-column-end","grid-column-start","grid-gap","grid-row","grid-row-end","grid-row-start","grid-template","grid-template-areas","grid-template-columns","grid-template-rows","hanging-punctuation","height","hyphenate-character","hyphenate-limit-chars","hyphens","icon","image-orientation","image-rendering","image-resolution","ime-mode","initial-letter","initial-letter-align","inline-size","inset","inset-area","inset-block","inset-block-end","inset-block-start","inset-inline","inset-inline-end","inset-inline-start","isolation","justify-content","justify-items","justify-self","kerning","left","letter-spacing","lighting-color","line-break","line-height","line-height-step","list-style","list-style-image","list-style-position","list-style-type","margin","margin-block","margin-block-end","margin-block-start","margin-bottom","margin-inline","margin-inline-end","margin-inline-start","margin-left","margin-right","margin-top","margin-trim","marker","marker-end","marker-mid","marker-start","marks","mask","mask-border","mask-border-mode","mask-border-outset","mask-border-repeat","mask-border-slice","mask-border-source","mask-border-width","mask-clip","mask-composite","mask-image","mask-mode","mask-origin","mask-position","mask-repeat","mask-size","mask-type","masonry-auto-flow","math-depth","math-shift","math-style","max-block-size","max-height","max-inline-size","max-width","min-block-size","min-height","min-inline-size","min-width","mix-blend-mode","nav-down","nav-index","nav-left","nav-right","nav-up","none","normal","object-fit","object-position","offset","offset-anchor","offset-distance","offset-path","offset-position","offset-rotate","opacity","order","orphans","outline","outline-color","outline-offset","outline-style","outline-width","overflow","overflow-anchor","overflow-block","overflow-clip-margin","overflow-inline","overflow-wrap","overflow-x","overflow-y","overlay","overscroll-behavior","overscroll-behavior-block","overscroll-behavior-inline","overscroll-behavior-x","overscroll-behavior-y","padding","padding-block","padding-block-end","padding-block-start","padding-bottom","padding-inline","padding-inline-end","padding-inline-start","padding-left","padding-right","padding-top","page","page-break-after","page-break-before","page-break-inside","paint-order","pause","pause-after","pause-before","perspective","perspective-origin","place-content","place-items","place-self","pointer-events","position","position-anchor","position-visibility","print-color-adjust","quotes","r","resize","rest","rest-after","rest-before","right","rotate","row-gap","ruby-align","ruby-position","scale","scroll-behavior","scroll-margin","scroll-margin-block","scroll-margin-block-end","scroll-margin-block-start","scroll-margin-bottom","scroll-margin-inline","scroll-margin-inline-end","scroll-margin-inline-start","scroll-margin-left","scroll-margin-right","scroll-margin-top","scroll-padding","scroll-padding-block","scroll-padding-block-end","scroll-padding-block-start","scroll-padding-bottom","scroll-padding-inline","scroll-padding-inline-end","scroll-padding-inline-start","scroll-padding-left","scroll-padding-right","scroll-padding-top","scroll-snap-align","scroll-snap-stop","scroll-snap-type","scroll-timeline","scroll-timeline-axis","scroll-timeline-name","scrollbar-color","scrollbar-gutter","scrollbar-width","shape-image-threshold","shape-margin","shape-outside","shape-rendering","speak","speak-as","src","stop-color","stop-opacity","stroke","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke-width","tab-size","table-layout","text-align","text-align-all","text-align-last","text-anchor","text-combine-upright","text-decoration","text-decoration-color","text-decoration-line","text-decoration-skip","text-decoration-skip-ink","text-decoration-style","text-decoration-thickness","text-emphasis","text-emphasis-color","text-emphasis-position","text-emphasis-style","text-indent","text-justify","text-orientation","text-overflow","text-rendering","text-shadow","text-size-adjust","text-transform","text-underline-offset","text-underline-position","text-wrap","text-wrap-mode","text-wrap-style","timeline-scope","top","touch-action","transform","transform-box","transform-origin","transform-style","transition","transition-behavior","transition-delay","transition-duration","transition-property","transition-timing-function","translate","unicode-bidi","user-modify","user-select","vector-effect","vertical-align","view-timeline","view-timeline-axis","view-timeline-inset","view-timeline-name","view-transition-name","visibility","voice-balance","voice-duration","voice-family","voice-pitch","voice-range","voice-rate","voice-stress","voice-volume","white-space","white-space-collapse","widows","width","will-change","word-break","word-spacing","word-wrap","writing-mode","x","y","z-index","zoom"].sort().reverse();function zF(e){const t=AF(e),n=LF,r=RF,a="@[a-z-]+",o="and or not only",d={className:"variable",begin:"(\\$"+"[a-zA-Z-][a-zA-Z0-9_-]*"+")\\b",relevance:0};return{name:"SCSS",case_insensitive:!0,illegal:"[=/|']",contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,t.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},t.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+DF.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+r.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+n.join("|")+")"},d,{begin:/\(/,end:/\)/,contains:[t.CSS_NUMBER_MODE]},t.CSS_VARIABLE,{className:"attribute",begin:"\\b("+IF.join("|")+")\\b"},{begin:"\\b(whitespace|wait|w-resize|visible|vertical-text|vertical-ideographic|uppercase|upper-roman|upper-alpha|underline|transparent|top|thin|thick|text|text-top|text-bottom|tb-rl|table-header-group|table-footer-group|sw-resize|super|strict|static|square|solid|small-caps|separate|se-resize|scroll|s-resize|rtl|row-resize|ridge|right|repeat|repeat-y|repeat-x|relative|progress|pointer|overline|outside|outset|oblique|nowrap|not-allowed|normal|none|nw-resize|no-repeat|no-drop|newspaper|ne-resize|n-resize|move|middle|medium|ltr|lr-tb|lowercase|lower-roman|lower-alpha|loose|list-item|line|line-through|line-edge|lighter|left|keep-all|justify|italic|inter-word|inter-ideograph|inside|inset|inline|inline-block|inherit|inactive|ideograph-space|ideograph-parenthesis|ideograph-numeric|ideograph-alpha|horizontal|hidden|help|hand|groove|fixed|ellipsis|e-resize|double|dotted|distribute|distribute-space|distribute-letter|distribute-all-lines|disc|disabled|default|decimal|dashed|crosshair|collapse|col-resize|circle|char|center|capitalize|break-word|break-all|bottom|both|bolder|bold|block|bidi-override|below|baseline|auto|always|all-scroll|absolute|table|table-cell)\\b"},{begin:/:/,end:/[;}{]/,relevance:0,contains:[t.BLOCK_COMMENT,d,t.HEXCOLOR,t.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.IMPORTANT,t.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:a,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:o,attribute:OF.join(" ")},contains:[{begin:a,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},d,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,t.HEXCOLOR,t.CSS_NUMBER_MODE]},t.FUNCTION_DISPATCH]}}function PF(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function BF(e){const t=e.regex,n=e.COMMENT("--","$"),r={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},o=["true","false","unknown"],l=["double precision","large object","with timezone","without timezone"],d=["bigint","binary","blob","boolean","char","character","clob","date","dec","decfloat","decimal","float","int","integer","interval","nchar","nclob","national","numeric","real","row","smallint","time","timestamp","varchar","varying","varbinary"],f=["add","asc","collation","desc","final","first","last","view"],h=["abs","acos","all","allocate","alter","and","any","are","array","array_agg","array_max_cardinality","as","asensitive","asin","asymmetric","at","atan","atomic","authorization","avg","begin","begin_frame","begin_partition","between","bigint","binary","blob","boolean","both","by","call","called","cardinality","cascaded","case","cast","ceil","ceiling","char","char_length","character","character_length","check","classifier","clob","close","coalesce","collate","collect","column","commit","condition","connect","constraint","contains","convert","copy","corr","corresponding","cos","cosh","count","covar_pop","covar_samp","create","cross","cube","cume_dist","current","current_catalog","current_date","current_default_transform_group","current_path","current_role","current_row","current_schema","current_time","current_timestamp","current_path","current_role","current_transform_group_for_type","current_user","cursor","cycle","date","day","deallocate","dec","decimal","decfloat","declare","default","define","delete","dense_rank","deref","describe","deterministic","disconnect","distinct","double","drop","dynamic","each","element","else","empty","end","end_frame","end_partition","end-exec","equals","escape","every","except","exec","execute","exists","exp","external","extract","false","fetch","filter","first_value","float","floor","for","foreign","frame_row","free","from","full","function","fusion","get","global","grant","group","grouping","groups","having","hold","hour","identity","in","indicator","initial","inner","inout","insensitive","insert","int","integer","intersect","intersection","interval","into","is","join","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","language","large","last_value","lateral","lead","leading","left","like","like_regex","listagg","ln","local","localtime","localtimestamp","log","log10","lower","match","match_number","match_recognize","matches","max","member","merge","method","min","minute","mod","modifies","module","month","multiset","national","natural","nchar","nclob","new","no","none","normalize","not","nth_value","ntile","null","nullif","numeric","octet_length","occurrences_regex","of","offset","old","omit","on","one","only","open","or","order","out","outer","over","overlaps","overlay","parameter","partition","pattern","per","percent","percent_rank","percentile_cont","percentile_disc","period","portion","position","position_regex","power","precedes","precision","prepare","primary","procedure","ptf","range","rank","reads","real","recursive","ref","references","referencing","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","release","result","return","returns","revoke","right","rollback","rollup","row","row_number","rows","running","savepoint","scope","scroll","search","second","seek","select","sensitive","session_user","set","show","similar","sin","sinh","skip","smallint","some","specific","specifictype","sql","sqlexception","sqlstate","sqlwarning","sqrt","start","static","stddev_pop","stddev_samp","submultiset","subset","substring","substring_regex","succeeds","sum","symmetric","system","system_time","system_user","table","tablesample","tan","tanh","then","time","timestamp","timezone_hour","timezone_minute","to","trailing","translate","translate_regex","translation","treat","trigger","trim","trim_array","true","truncate","uescape","union","unique","unknown","unnest","update","upper","user","using","value","values","value_of","var_pop","var_samp","varbinary","varchar","varying","versioning","when","whenever","where","width_bucket","window","with","within","without","year"],g=["abs","acos","array_agg","asin","atan","avg","cast","ceil","ceiling","coalesce","corr","cos","cosh","count","covar_pop","covar_samp","cume_dist","dense_rank","deref","element","exp","extract","first_value","floor","json_array","json_arrayagg","json_exists","json_object","json_objectagg","json_query","json_table","json_table_primitive","json_value","lag","last_value","lead","listagg","ln","log","log10","lower","max","min","mod","nth_value","ntile","nullif","percent_rank","percentile_cont","percentile_disc","position","position_regex","power","rank","regr_avgx","regr_avgy","regr_count","regr_intercept","regr_r2","regr_slope","regr_sxx","regr_sxy","regr_syy","row_number","sin","sinh","sqrt","stddev_pop","stddev_samp","substring","substring_regex","sum","tan","tanh","translate","translate_regex","treat","trim","trim_array","unnest","upper","value_of","var_pop","var_samp","width_bucket"],m=["current_catalog","current_date","current_default_transform_group","current_path","current_role","current_schema","current_transform_group_for_type","current_user","session_user","system_time","system_user","current_time","localtime","current_timestamp","localtimestamp"],y=["create table","insert into","primary key","foreign key","not null","alter table","add constraint","grouping sets","on overflow","character set","respect nulls","ignore nulls","nulls first","nulls last","depth first","breadth first"],b=g,k=[...h,...f].filter(M=>!g.includes(M)),v={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},N={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},E={match:t.concat(/\b/,t.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function C(M){return t.concat(/\b/,t.either(...M.map(T=>T.replace(/\s+/,"\\s+"))),/\b/)}const S={scope:"keyword",match:C(y),relevance:0};function _(M,{exceptions:T,when:L}={}){const R=L;return T=T||[],M.map($=>$.match(/\|\d+$/)||T.includes($)?$:R($)?`${$}|0`:$)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:_(k,{when:M=>M.length<3}),literal:o,type:d,built_in:m},contains:[{scope:"type",match:C(l)},S,E,v,r,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,n,N]}}function Oj(e){return e?typeof e=="string"?e:e.source:null}function au(e){return Ut("(?=",e,")")}function Ut(...e){return e.map(n=>Oj(n)).join("")}function $F(e){const t=e[e.length-1];return typeof t=="object"&&t.constructor===Object?(e.splice(e.length-1,1),t):{}}function Jn(...e){return"("+($F(e).capture?"":"?:")+e.map(r=>Oj(r)).join("|")+")"}const Rx=e=>Ut(/\b/,e,/\w$/.test(e)?/\b/:/\B/),UF=["Protocol","Type"].map(Rx),_E=["init","self"].map(Rx),FF=["Any","Self"],iy=["actor","any","associatedtype","async","await",/as\?/,/as!/,"as","borrowing","break","case","catch","class","consume","consuming","continue","convenience","copy","default","defer","deinit","didSet","distributed","do","dynamic","each","else","enum","extension","fallthrough",/fileprivate\(set\)/,"fileprivate","final","for","func","get","guard","if","import","indirect","infix",/init\?/,/init!/,"inout",/internal\(set\)/,"internal","in","is","isolated","nonisolated","lazy","let","macro","mutating","nonmutating",/open\(set\)/,"open","operator","optional","override","package","postfix","precedencegroup","prefix",/private\(set\)/,"private","protocol",/public\(set\)/,"public","repeat","required","rethrows","return","set","some","static","struct","subscript","super","switch","throws","throw",/try\?/,/try!/,"try","typealias",/unowned\(safe\)/,/unowned\(unsafe\)/,"unowned","var","weak","where","while","willSet"],jE=["false","nil","true"],qF=["assignment","associativity","higherThan","left","lowerThan","none","right"],HF=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],CE=["abs","all","any","assert","assertionFailure","debugPrint","dump","fatalError","getVaList","isKnownUniquelyReferenced","max","min","numericCast","pointwiseMax","pointwiseMin","precondition","preconditionFailure","print","readLine","repeatElement","sequence","stride","swap","swift_unboxFromSwiftValueWithType","transcode","type","unsafeBitCast","unsafeDowncast","withExtendedLifetime","withUnsafeMutablePointer","withUnsafePointer","withVaList","withoutActuallyEscaping","zip"],Rj=Jn(/[/=\-+!*%<>&|^~?]/,/[\u00A1-\u00A7]/,/[\u00A9\u00AB]/,/[\u00AC\u00AE]/,/[\u00B0\u00B1]/,/[\u00B6\u00BB\u00BF\u00D7\u00F7]/,/[\u2016-\u2017]/,/[\u2020-\u2027]/,/[\u2030-\u203E]/,/[\u2041-\u2053]/,/[\u2055-\u205E]/,/[\u2190-\u23FF]/,/[\u2500-\u2775]/,/[\u2794-\u2BFF]/,/[\u2E00-\u2E7F]/,/[\u3001-\u3003]/,/[\u3008-\u3020]/,/[\u3030]/),Lj=Jn(Rj,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ay=Ut(Rj,Lj,"*"),Ij=Jn(/[a-zA-Z_]/,/[\u00A8\u00AA\u00AD\u00AF\u00B2-\u00B5\u00B7-\u00BA]/,/[\u00BC-\u00BE\u00C0-\u00D6\u00D8-\u00F6\u00F8-\u00FF]/,/[\u0100-\u02FF\u0370-\u167F\u1681-\u180D\u180F-\u1DBF]/,/[\u1E00-\u1FFF]/,/[\u200B-\u200D\u202A-\u202E\u203F-\u2040\u2054\u2060-\u206F]/,/[\u2070-\u20CF\u2100-\u218F\u2460-\u24FF\u2776-\u2793]/,/[\u2C00-\u2DFF\u2E80-\u2FFF]/,/[\u3004-\u3007\u3021-\u302F\u3031-\u303F\u3040-\uD7FF]/,/[\uF900-\uFD3D\uFD40-\uFDCF\uFDF0-\uFE1F\uFE30-\uFE44]/,/[\uFE47-\uFEFE\uFF00-\uFFFD]/),Eh=Jn(Ij,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),Si=Ut(Ij,Eh,"*"),Pf=Ut(/[A-Z]/,Eh,"*"),KF=["attached","autoclosure",Ut(/convention\(/,Jn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",Ut(/objc\(/,Si,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],GF=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function VF(e){const t={match:/\s+/,relevance:0},n=e.COMMENT("/\\*","\\*/",{contains:["self"]}),r=[e.C_LINE_COMMENT_MODE,n],a={match:[/\./,Jn(...UF,..._E)],className:{2:"keyword"}},o={match:Ut(/\./,Jn(...iy)),relevance:0},l=iy.filter(pe=>typeof pe=="string").concat(["_|0"]),d=iy.filter(pe=>typeof pe!="string").concat(FF).map(Rx),f={variants:[{className:"keyword",match:Jn(...d,..._E)}]},h={$pattern:Jn(/\b\w+/,/#\w+/),keyword:l.concat(HF),literal:jE},g=[a,o,f],m={match:Ut(/\./,Jn(...CE)),relevance:0},y={className:"built_in",match:Ut(/\b/,Jn(...CE),/(?=\()/)},b=[m,y],k={match:/->/,relevance:0},v={className:"operator",relevance:0,variants:[{match:ay},{match:`\\.(\\.|${Lj})+`}]},N=[k,v],E="([0-9]_*)+",C="([0-9a-fA-F]_*)+",S={className:"number",relevance:0,variants:[{match:`\\b(${E})(\\.(${E}))?([eE][+-]?(${E}))?\\b`},{match:`\\b0x(${C})(\\.(${C}))?([pP][+-]?(${E}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},_=(pe="")=>({className:"subst",variants:[{match:Ut(/\\/,pe,/[0\\tnr"']/)},{match:Ut(/\\/,pe,/u\{[0-9a-fA-F]{1,8}\}/)}]}),M=(pe="")=>({className:"subst",match:Ut(/\\/,pe,/[\t ]*(?:[\r\n]|\r\n)/)}),T=(pe="")=>({className:"subst",label:"interpol",begin:Ut(/\\/,pe,/\(/),end:/\)/}),L=(pe="")=>({begin:Ut(pe,/"""/),end:Ut(/"""/,pe),contains:[_(pe),M(pe),T(pe)]}),R=(pe="")=>({begin:Ut(pe,/"/),end:Ut(/"/,pe),contains:[_(pe),T(pe)]}),$={className:"string",variants:[L(),L("#"),L("##"),L("###"),R(),R("#"),R("##"),R("###")]},z=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],q={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:z},F=pe=>{const Fe=Ut(pe,/\//),ze=Ut(/\//,pe);return{begin:Fe,end:ze,contains:[...z,{scope:"comment",begin:`#(?!.*${ze})`,end:/$/}]}},Y={scope:"regexp",variants:[F("###"),F("##"),F("#"),q]},D={match:Ut(/`/,Si,/`/)},H={className:"variable",match:/\$\d+/},O={className:"variable",match:`\\$${Eh}+`},V=[D,H,O],Q={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:GF,contains:[...N,S,$]}]}},K={scope:"keyword",match:Ut(/@/,Jn(...KF),au(Jn(/\(/,/\s+/)))},I={scope:"meta",match:Ut(/@/,Si)},P=[Q,K,I],G={match:au(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:Ut(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,Eh,"+")},{className:"type",match:Pf,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:Ut(/\s+&\s+/,au(Pf)),relevance:0}]},B={begin:/</,end:/>/,keywords:h,contains:[...r,...g,...P,k,G]};G.contains.push(B);const oe={match:Ut(Si,/\s*:/),keywords:"_|0",relevance:0},ve={begin:/\(/,end:/\)/,relevance:0,keywords:h,contains:["self",oe,...r,Y,...g,...b,...N,S,$,...V,...P,G]},ke={begin:/</,end:/>/,keywords:"repeat each",contains:[...r,G]},Se={begin:Jn(au(Ut(Si,/\s*:/)),au(Ut(Si,/\s+/,Si,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:Si}]},J={begin:/\(/,end:/\)/,keywords:h,contains:[Se,...r,...g,...N,S,$,...P,G,ve],endsParent:!0,illegal:/["']/},ue={match:[/(func|macro)/,/\s+/,Jn(D.match,Si,ay)],className:{1:"keyword",3:"title.function"},contains:[ke,J,t],illegal:[/\[/,/%/]},Te={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[ke,J,t],illegal:/\[|%/},Oe={match:[/operator/,/\s+/,ay],className:{1:"keyword",3:"title"}},De={begin:[/precedencegroup/,/\s+/,Pf],className:{1:"keyword",3:"title"},contains:[G],keywords:[...qF,...jE],end:/}/},ce={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ce={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},te={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,Si,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:h,contains:[ke,...g,{begin:/:/,end:/\{/,keywords:h,contains:[{scope:"title.class.inherited",match:Pf},...g],relevance:0}]};for(const pe of $.variants){const Fe=pe.contains.find(ae=>ae.label==="interpol");Fe.keywords=h;const ze=[...g,...b,...N,S,$,...V];Fe.contains=[...ze,{begin:/\(/,end:/\)/,contains:["self",...ze]}]}return{name:"Swift",keywords:h,contains:[...r,ue,Te,ce,Ce,te,Oe,De,{beginKeywords:"import",end:/$/,contains:[...r],relevance:0},Y,...g,...b,...N,S,$,...V,...P,G,ve]}}const Sh="[A-Za-z$_][0-9A-Za-z$_]*",zj=["as","in","of","if","for","while","finally","var","new","function","do","return","void","else","break","catch","instanceof","with","throw","case","default","try","switch","continue","typeof","delete","let","yield","const","class","debugger","async","await","static","import","from","export","extends","using"],Pj=["true","false","null","undefined","NaN","Infinity"],Bj=["Object","Function","Boolean","Symbol","Math","Date","Number","BigInt","String","RegExp","Array","Float32Array","Float64Array","Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Int32Array","Uint16Array","Uint32Array","BigInt64Array","BigUint64Array","Set","Map","WeakSet","WeakMap","ArrayBuffer","SharedArrayBuffer","Atomics","DataView","JSON","Promise","Generator","GeneratorFunction","AsyncFunction","Reflect","Proxy","Intl","WebAssembly"],$j=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Uj=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Fj=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],qj=[].concat(Uj,Bj,$j);function YF(e){const t=e.regex,n=(Q,{after:K})=>{const I="</"+Q[0].slice(1);return Q.input.indexOf(I,K)!==-1},r=Sh,a={begin:"<>",end:"</>"},o=/<[A-Za-z0-9\\._:-]+\s*\/>/,l={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(Q,K)=>{const I=Q[0].length+Q.index,P=Q.input[I];if(P==="<"||P===","){K.ignoreMatch();return}P===">"&&(n(Q,{after:I})||K.ignoreMatch());let G;const B=Q.input.substring(I);if(G=B.match(/^\s*=/)){K.ignoreMatch();return}if((G=B.match(/^\s+extends\s+/))&&G.index===0){K.ignoreMatch();return}}},d={$pattern:Sh,keyword:zj,literal:Pj,built_in:qj,"variable.language":Fj},f="[0-9](_?[0-9])*",h=`\\.(${f})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",m={className:"number",variants:[{begin:`(\\b(${g})((${h})|\\.)?|(${h}))[eE][+-]?(${f})\\b`},{begin:`\\b(${g})\\b((${h})\\b|\\.)?|(${h})\\b`},{begin:"\\b(0|[1-9](_?[0-9])*)n\\b"},{begin:"\\b0[xX][0-9a-fA-F](_?[0-9a-fA-F])*n?\\b"},{begin:"\\b0[bB][0-1](_?[0-1])*n?\\b"},{begin:"\\b0[oO][0-7](_?[0-7])*n?\\b"},{begin:"\\b0[0-7]+n?\\b"}],relevance:0},y={className:"subst",begin:"\\$\\{",end:"\\}",keywords:d,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"xml"}},k={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"css"}},v={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,y],subLanguage:"graphql"}},N={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,y]},C={className:"comment",variants:[e.COMMENT(/\/\*\*(?!\/)/,"\\*/",{relevance:0,contains:[{begin:"(?=@[A-Za-z]+)",relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"},{className:"type",begin:"\\{",end:"\\}",excludeEnd:!0,excludeBegin:!0,relevance:0},{className:"variable",begin:r+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},S=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,N,{match:/\$\d+/},m];y.contains=S.concat({begin:/\{/,end:/\}/,keywords:d,contains:["self"].concat(S)});const _=[].concat(C,y.contains),M=_.concat([{begin:/(\s*)\(/,end:/\)/,keywords:d,contains:["self"].concat(_)}]),T={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M},L={variants:[{match:[/class/,/\s+/,r,/\s+/,/extends/,/\s+/,t.concat(r,"(",t.concat(/\./,r),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,r],scope:{1:"keyword",3:"title.class"}}]},R={relevance:0,match:t.either(/\bJSON/,/\b[A-Z][a-z]+([A-Z][a-z]*|\d)*/,/\b[A-Z]{2,}([A-Z][a-z]+|\d)+([A-Z][a-z]*)*/,/\b[A-Z]{2,}[a-z]+([A-Z][a-z]+|\d)*([A-Z][a-z]*)*/),className:"title.class",keywords:{_:[...Bj,...$j]}},$={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},z={variants:[{match:[/function/,/\s+/,r,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[T],illegal:/%/},q={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function F(Q){return t.concat("(?!",Q.join("|"),")")}const Y={match:t.concat(/\b/,F([...Uj,"super","import"].map(Q=>`${Q}\\s*\\(`)),r,t.lookahead(/\s*\(/)),className:"title.function",relevance:0},D={begin:t.concat(/\./,t.lookahead(t.concat(r,/(?![0-9A-Za-z$_(])/))),end:r,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},H={match:[/get|set/,/\s+/,r,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},T]},O="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",V={match:[/const|var|let/,/\s+/,r,/\s*/,/=\s*/,/(async\s*)?/,t.lookahead(O)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[T]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:d,exports:{PARAMS_CONTAINS:M,CLASS_REFERENCE:R},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),$,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,k,v,N,C,{match:/\$\d+/},m,R,{scope:"attr",match:r+t.lookahead(":"),relevance:0},V,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[C,e.REGEXP_MODE,{className:"function",begin:O,returnBegin:!0,end:"\\s*=>",contains:[{className:"params",variants:[{begin:e.UNDERSCORE_IDENT_RE,relevance:0},{className:null,begin:/\(\s*\)/,skip:!0},{begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:d,contains:M}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:o},{begin:l.begin,"on:begin":l.isTrulyOpeningTag,end:l.end}],subLanguage:"xml",contains:[{begin:l.begin,end:l.end,skip:!0,contains:["self"]}]}]},z,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[T,e.inherit(e.TITLE_MODE,{begin:r,className:"title.function"})]},{match:/\.\.\./,relevance:0},D,{match:"\\$"+r,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[T]},Y,q,L,H,{match:/\$[(.]/}]}}function QF(e){const t=e.regex,n=YF(e),r=Sh,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],o={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},l={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[n.exports.CLASS_REFERENCE]},d={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},f=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],h={$pattern:Sh,keyword:zj.concat(f),literal:Pj,built_in:qj.concat(a),"variable.language":Fj},g={className:"meta",begin:"@"+r},m=(v,N,E)=>{const C=v.contains.findIndex(S=>S.label===N);if(C===-1)throw new Error("can not find mode to replace");v.contains.splice(C,1,E)};Object.assign(n.keywords,h),n.exports.PARAMS_CONTAINS.push(g);const y=n.contains.find(v=>v.scope==="attr"),b=Object.assign({},y,{match:t.concat(r,t.lookahead(/\s*\?:/))});n.exports.PARAMS_CONTAINS.push([n.exports.CLASS_REFERENCE,y,b]),n.contains=n.contains.concat([g,o,l,b]),m(n,"shebang",e.SHEBANG()),m(n,"use_strict",d);const k=n.contains.find(v=>v.label==="func.def");return k.relevance=0,Object.assign(n,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),n}function WF(e){const t=e.regex,n={className:"string",begin:/"(""|[^/n])"C\b/},r={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a=/\d{1,2}\/\d{1,2}\/\d{4}/,o=/\d{4}-\d{1,2}-\d{1,2}/,l=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,d=/\d{1,2}(:\d{1,2}){1,2}/,f={className:"literal",variants:[{begin:t.concat(/# */,t.either(o,a),/ *#/)},{begin:t.concat(/# */,d,/ *#/)},{begin:t.concat(/# */,l,/ *#/)},{begin:t.concat(/# */,t.either(o,a),/ +/,t.either(l,d),/ *#/)}]},h={className:"number",relevance:0,variants:[{begin:/\b\d[\d_]*((\.[\d_]+(E[+-]?[\d_]+)?)|(E[+-]?[\d_]+))[RFD@!#]?/},{begin:/\b\d[\d_]*((U?[SIL])|[%&])?/},{begin:/&H[\dA-F_]+((U?[SIL])|[%&])?/},{begin:/&O[0-7_]+((U?[SIL])|[%&])?/},{begin:/&B[01_]+((U?[SIL])|[%&])?/}]},g={className:"label",begin:/^\w+:/},m=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),y=e.COMMENT(null,/$/,{variants:[{begin:/'/},{begin:/([\t ]|^)REM(?=\s)/}]});return{name:"Visual Basic .NET",aliases:["vb"],case_insensitive:!0,classNameAliases:{label:"symbol"},keywords:{keyword:"addhandler alias aggregate ansi as async assembly auto binary by byref byval call case catch class compare const continue custom declare default delegate dim distinct do each equals else elseif end enum erase error event exit explicit finally for friend from function get global goto group handles if implements imports in inherits interface into iterator join key let lib loop me mid module mustinherit mustoverride mybase myclass namespace narrowing new next notinheritable notoverridable of off on operator option optional order overloads overridable overrides paramarray partial preserve private property protected public raiseevent readonly redim removehandler resume return select set shadows shared skip static step stop structure strict sub synclock take text then throw to try unicode until using when where while widening with withevents writeonly yield",built_in:"addressof and andalso await directcast gettype getxmlnamespace is isfalse isnot istrue like mod nameof new not or orelse trycast typeof xor cbool cbyte cchar cdate cdbl cdec cint clng cobj csbyte cshort csng cstr cuint culng cushort",type:"boolean byte char date decimal double integer long object sbyte short single string uinteger ulong ushort",literal:"true false nothing"},illegal:"//|\\{|\\}|endif|gosub|variant|wend|^\\$ ",contains:[n,r,f,h,g,m,y,{className:"meta",begin:/[\t ]*#(const|disable|else|elseif|enable|end|externalsource|if|region)\b/,end:/$/,keywords:{keyword:"const disable else elseif enable end externalsource if region then"},contains:[y]}]}}function XF(e){e.regex;const t=e.COMMENT(/\(;/,/;\)/);t.contains.push("self");const n=e.COMMENT(/;;/,/$/),r=["anyfunc","block","br","br_if","br_table","call","call_indirect","data","drop","elem","else","end","export","func","global.get","global.set","local.get","local.set","local.tee","get_global","get_local","global","if","import","local","loop","memory","memory.grow","memory.size","module","mut","nop","offset","param","result","return","select","set_global","set_local","start","table","tee_local","then","type","unreachable"],a={begin:[/(?:func|call|call_indirect)/,/\s+/,/\$[^\s)]+/],className:{1:"keyword",3:"title.function"}},o={className:"variable",begin:/\$[\w_]+/},l={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},d={className:"number",relevance:0,match:/[+-]?\b(?:\d(?:_?\d)*(?:\.\d(?:_?\d)*)?(?:[eE][+-]?\d(?:_?\d)*)?|0x[\da-fA-F](?:_?[\da-fA-F])*(?:\.[\da-fA-F](?:_?[\da-fA-D])*)?(?:[pP][+-]?\d(?:_?\d)*)?)\b|\binf\b|\bnan(?::0x[\da-fA-F](?:_?[\da-fA-D])*)?\b/},f={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},h={className:"keyword",match:/\b(f32|f64|i32|i64)(?:\.(?:abs|add|and|ceil|clz|const|convert_[su]\/i(?:32|64)|copysign|ctz|demote\/f64|div(?:_[su])?|eqz?|extend_[su]\/i32|floor|ge(?:_[su])?|gt(?:_[su])?|le(?:_[su])?|load(?:(?:8|16|32)_[su])?|lt(?:_[su])?|max|min|mul|nearest|neg?|or|popcnt|promote\/f32|reinterpret\/[fi](?:32|64)|rem_[su]|rot[lr]|shl|shr_[su]|store(?:8|16|32)?|sqrt|sub|trunc(?:_[su]\/f(?:32|64))?|wrap\/i64|xor))\b/};return{name:"WebAssembly",keywords:{$pattern:/[\w.]+/,keyword:r},contains:[n,t,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},o,l,a,e.QUOTE_STRING_MODE,f,h,d]}}function ZF(e){const t=e.regex,n=t.concat(/[\p{L}_]/u,t.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),r=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},o={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},l=e.inherit(o,{begin:/\(/,end:/\)/}),d=e.inherit(e.APOS_STRING_MODE,{className:"string"}),f=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),h={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:r,relevance:0},{begin:/=\s*/,relevance:0,contains:[{className:"string",endsParent:!0,variants:[{begin:/"/,end:/"/,contains:[a]},{begin:/'/,end:/'/,contains:[a]},{begin:/[^\s"'=<>`]+/}]}]}]};return{name:"HTML, XML",aliases:["html","xhtml","rss","atom","xjb","xsd","xsl","plist","wsf","svg"],case_insensitive:!0,unicodeRegex:!0,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,relevance:10,contains:[o,f,d,l,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[o,l,f,d]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[f]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[h],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[h],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:t.concat(/</,t.lookahead(t.concat(n,t.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:n,relevance:0,starts:h}]},{className:"tag",begin:t.concat(/<\//,t.lookahead(t.concat(n,/>/))),contains:[{className:"name",begin:n,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function JF(e){const t="true false yes no null",n="[\\w#;/?:@&=+$,.~*'()[\\]]+",r={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},o={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},l={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},d=e.inherit(l,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),y={className:"number",begin:"\\b"+"[0-9]{4}(-[0-9][0-9]){0,2}"+"([Tt \\t][0-9][0-9]?(:[0-9][0-9]){2})?"+"(\\.[0-9]*)?"+"([ \\t])*(Z|[-+][0-9][0-9]?(:[0-9][0-9])?)?"+"\\b"},b={end:",",endsWithParent:!0,excludeEnd:!0,keywords:t,relevance:0},k={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},v={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},N=[r,{className:"meta",begin:"^---\\s*$",relevance:10},{className:"string",begin:"[\\|>]([1-9]?[+-])?[ ]*\\n( +)[^ ][^\\n]*\\n(\\2[^\\n]+\\n?)*"},{begin:"<%[%=-]?",end:"[%-]?%>",subLanguage:"ruby",excludeBegin:!0,excludeEnd:!0,relevance:0},{className:"type",begin:"!\\w+!"+n},{className:"type",begin:"!<"+n+">"},{className:"type",begin:"!"+n},{className:"type",begin:"!!"+n},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:t,keywords:{literal:t}},y,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},k,v,o,l],E=[...N];return E.pop(),E.push(d),b.contains=E,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:N}}const e8={arduino:L9,bash:I9,c:z9,cpp:P9,csharp:B9,css:Y9,diff:Q9,go:W9,graphql:X9,ini:Z9,java:J9,javascript:iF,json:aF,kotlin:oF,less:mF,lua:gF,makefile:yF,markdown:bF,objectivec:xF,perl:vF,php:wF,"php-template":kF,plaintext:EF,python:SF,"python-repl":NF,r:_F,ruby:jF,rust:CF,scss:zF,shell:PF,sql:BF,swift:VF,typescript:QF,vbnet:WF,wasm:XF,xml:ZF,yaml:JF};var sy,AE;function t8(){if(AE)return sy;AE=1;function e(Z){return Z instanceof Map?Z.clear=Z.delete=Z.set=function(){throw new Error("map is read-only")}:Z instanceof Set&&(Z.add=Z.clear=Z.delete=function(){throw new Error("set is read-only")}),Object.freeze(Z),Object.getOwnPropertyNames(Z).forEach(ge=>{const Me=Z[ge],rt=typeof Me;(rt==="object"||rt==="function")&&!Object.isFrozen(Me)&&e(Me)}),Z}class t{constructor(ge){ge.data===void 0&&(ge.data={}),this.data=ge.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function n(Z){return Z.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function r(Z,...ge){const Me=Object.create(null);for(const rt in Z)Me[rt]=Z[rt];return ge.forEach(function(rt){for(const Ft in rt)Me[Ft]=rt[Ft]}),Me}const a="</span>",o=Z=>!!Z.scope,l=(Z,{prefix:ge})=>{if(Z.startsWith("language:"))return Z.replace("language:","language-");if(Z.includes(".")){const Me=Z.split(".");return[`${ge}${Me.shift()}`,...Me.map((rt,Ft)=>`${rt}${"_".repeat(Ft+1)}`)].join(" ")}return`${ge}${Z}`};class d{constructor(ge,Me){this.buffer="",this.classPrefix=Me.classPrefix,ge.walk(this)}addText(ge){this.buffer+=n(ge)}openNode(ge){if(!o(ge))return;const Me=l(ge.scope,{prefix:this.classPrefix});this.span(Me)}closeNode(ge){o(ge)&&(this.buffer+=a)}value(){return this.buffer}span(ge){this.buffer+=`<span class="${ge}">`}}const f=(Z={})=>{const ge={children:[]};return Object.assign(ge,Z),ge};class h{constructor(){this.rootNode=f(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(ge){this.top.children.push(ge)}openNode(ge){const Me=f({scope:ge});this.add(Me),this.stack.push(Me)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(ge){return this.constructor._walk(ge,this.rootNode)}static _walk(ge,Me){return typeof Me=="string"?ge.addText(Me):Me.children&&(ge.openNode(Me),Me.children.forEach(rt=>this._walk(ge,rt)),ge.closeNode(Me)),ge}static _collapse(ge){typeof ge!="string"&&ge.children&&(ge.children.every(Me=>typeof Me=="string")?ge.children=[ge.children.join("")]:ge.children.forEach(Me=>{h._collapse(Me)}))}}class g extends h{constructor(ge){super(),this.options=ge}addText(ge){ge!==""&&this.add(ge)}startScope(ge){this.openNode(ge)}endScope(){this.closeNode()}__addSublanguage(ge,Me){const rt=ge.root;Me&&(rt.scope=`language:${Me}`),this.add(rt)}toHTML(){return new d(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function m(Z){return Z?typeof Z=="string"?Z:Z.source:null}function y(Z){return v("(?=",Z,")")}function b(Z){return v("(?:",Z,")*")}function k(Z){return v("(?:",Z,")?")}function v(...Z){return Z.map(Me=>m(Me)).join("")}function N(Z){const ge=Z[Z.length-1];return typeof ge=="object"&&ge.constructor===Object?(Z.splice(Z.length-1,1),ge):{}}function E(...Z){return"("+(N(Z).capture?"":"?:")+Z.map(rt=>m(rt)).join("|")+")"}function C(Z){return new RegExp(Z.toString()+"|").exec("").length-1}function S(Z,ge){const Me=Z&&Z.exec(ge);return Me&&Me.index===0}const _=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function M(Z,{joinWith:ge}){let Me=0;return Z.map(rt=>{Me+=1;const Ft=Me;let Ot=m(rt),Ue="";for(;Ot.length>0;){const Pe=_.exec(Ot);if(!Pe){Ue+=Ot;break}Ue+=Ot.substring(0,Pe.index),Ot=Ot.substring(Pe.index+Pe[0].length),Pe[0][0]==="\\"&&Pe[1]?Ue+="\\"+String(Number(Pe[1])+Ft):(Ue+=Pe[0],Pe[0]==="("&&Me++)}return Ue}).map(rt=>`(${rt})`).join(ge)}const T=/\b\B/,L="[a-zA-Z]\\w*",R="[a-zA-Z_]\\w*",$="\\b\\d+(\\.\\d+)?",z="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",q="\\b(0b[01]+)",F="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",Y=(Z={})=>{const ge=/^#![ ]*\//;return Z.binary&&(Z.begin=v(ge,/.*\b/,Z.binary,/\b.*/)),r({scope:"meta",begin:ge,end:/$/,relevance:0,"on:begin":(Me,rt)=>{Me.index!==0&&rt.ignoreMatch()}},Z)},D={begin:"\\\\[\\s\\S]",relevance:0},H={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[D]},O={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[D]},V={begin:/\b(a|an|the|are|I'm|isn't|don't|doesn't|won't|but|just|should|pretty|simply|enough|gonna|going|wtf|so|such|will|you|your|they|like|more)\b/},Q=function(Z,ge,Me={}){const rt=r({scope:"comment",begin:Z,end:ge,contains:[]},Me);rt.contains.push({scope:"doctag",begin:"[ ]*(?=(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):)",end:/(TODO|FIXME|NOTE|BUG|OPTIMIZE|HACK|XXX):/,excludeBegin:!0,relevance:0});const Ft=E("I","a","is","so","us","to","at","if","in","it","on",/[A-Za-z]+['](d|ve|re|ll|t|s|n)/,/[A-Za-z]+[-][a-z]+/,/[A-Za-z][a-z]{2,}/);return rt.contains.push({begin:v(/[ ]+/,"(",Ft,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),rt},K=Q("//","$"),I=Q("/\\*","\\*/"),P=Q("#","$"),G={scope:"number",begin:$,relevance:0},B={scope:"number",begin:z,relevance:0},oe={scope:"number",begin:q,relevance:0},ve={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[D,{begin:/\[/,end:/\]/,relevance:0,contains:[D]}]},ke={scope:"title",begin:L,relevance:0},Se={scope:"title",begin:R,relevance:0},J={begin:"\\.\\s*"+R,relevance:0};var Te=Object.freeze({__proto__:null,APOS_STRING_MODE:H,BACKSLASH_ESCAPE:D,BINARY_NUMBER_MODE:oe,BINARY_NUMBER_RE:q,COMMENT:Q,C_BLOCK_COMMENT_MODE:I,C_LINE_COMMENT_MODE:K,C_NUMBER_MODE:B,C_NUMBER_RE:z,END_SAME_AS_BEGIN:function(Z){return Object.assign(Z,{"on:begin":(ge,Me)=>{Me.data._beginMatch=ge[1]},"on:end":(ge,Me)=>{Me.data._beginMatch!==ge[1]&&Me.ignoreMatch()}})},HASH_COMMENT_MODE:P,IDENT_RE:L,MATCH_NOTHING_RE:T,METHOD_GUARD:J,NUMBER_MODE:G,NUMBER_RE:$,PHRASAL_WORDS_MODE:V,QUOTE_STRING_MODE:O,REGEXP_MODE:ve,RE_STARTERS_RE:F,SHEBANG:Y,TITLE_MODE:ke,UNDERSCORE_IDENT_RE:R,UNDERSCORE_TITLE_MODE:Se});function Oe(Z,ge){Z.input[Z.index-1]==="."&&ge.ignoreMatch()}function De(Z,ge){Z.className!==void 0&&(Z.scope=Z.className,delete Z.className)}function ce(Z,ge){ge&&Z.beginKeywords&&(Z.begin="\\b("+Z.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",Z.__beforeBegin=Oe,Z.keywords=Z.keywords||Z.beginKeywords,delete Z.beginKeywords,Z.relevance===void 0&&(Z.relevance=0))}function Ce(Z,ge){Array.isArray(Z.illegal)&&(Z.illegal=E(...Z.illegal))}function te(Z,ge){if(Z.match){if(Z.begin||Z.end)throw new Error("begin & end are not supported with match");Z.begin=Z.match,delete Z.match}}function pe(Z,ge){Z.relevance===void 0&&(Z.relevance=1)}const Fe=(Z,ge)=>{if(!Z.beforeMatch)return;if(Z.starts)throw new Error("beforeMatch cannot be used with starts");const Me=Object.assign({},Z);Object.keys(Z).forEach(rt=>{delete Z[rt]}),Z.keywords=Me.keywords,Z.begin=v(Me.beforeMatch,y(Me.begin)),Z.starts={relevance:0,contains:[Object.assign(Me,{endsParent:!0})]},Z.relevance=0,delete Me.beforeMatch},ze=["of","and","for","in","not","or","if","then","parent","list","value"],ae="keyword";function be(Z,ge,Me=ae){const rt=Object.create(null);return typeof Z=="string"?Ft(Me,Z.split(" ")):Array.isArray(Z)?Ft(Me,Z):Object.keys(Z).forEach(function(Ot){Object.assign(rt,be(Z[Ot],ge,Ot))}),rt;function Ft(Ot,Ue){ge&&(Ue=Ue.map(Pe=>Pe.toLowerCase())),Ue.forEach(function(Pe){const et=Pe.split("|");rt[et[0]]=[Ot,ye(et[0],et[1])]})}}function ye(Z,ge){return ge?Number(ge):he(Z)?0:1}function he(Z){return ze.includes(Z.toLowerCase())}const Ee={},Ne=Z=>{console.error(Z)},Ke=(Z,...ge)=>{console.log(`WARN: ${Z}`,...ge)},ne=(Z,ge)=>{Ee[`${Z}/${ge}`]||(console.log(`Deprecated as of ${Z}. ${ge}`),Ee[`${Z}/${ge}`]=!0)},de=new Error;function Le(Z,ge,{key:Me}){let rt=0;const Ft=Z[Me],Ot={},Ue={};for(let Pe=1;Pe<=ge.length;Pe++)Ue[Pe+rt]=Ft[Pe],Ot[Pe+rt]=!0,rt+=C(ge[Pe-1]);Z[Me]=Ue,Z[Me]._emit=Ot,Z[Me]._multi=!0}function Ze(Z){if(Array.isArray(Z.begin)){if(Z.skip||Z.excludeBegin||Z.returnBegin)throw Ne("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),de;if(typeof Z.beginScope!="object"||Z.beginScope===null)throw Ne("beginScope must be object"),de;Le(Z,Z.begin,{key:"beginScope"}),Z.begin=M(Z.begin,{joinWith:""})}}function it(Z){if(Array.isArray(Z.end)){if(Z.skip||Z.excludeEnd||Z.returnEnd)throw Ne("skip, excludeEnd, returnEnd not compatible with endScope: {}"),de;if(typeof Z.endScope!="object"||Z.endScope===null)throw Ne("endScope must be object"),de;Le(Z,Z.end,{key:"endScope"}),Z.end=M(Z.end,{joinWith:""})}}function At(Z){Z.scope&&typeof Z.scope=="object"&&Z.scope!==null&&(Z.beginScope=Z.scope,delete Z.scope)}function $n(Z){At(Z),typeof Z.beginScope=="string"&&(Z.beginScope={_wrap:Z.beginScope}),typeof Z.endScope=="string"&&(Z.endScope={_wrap:Z.endScope}),Ze(Z),it(Z)}function dn(Z){function ge(Ue,Pe){return new RegExp(m(Ue),"m"+(Z.case_insensitive?"i":"")+(Z.unicodeRegex?"u":"")+(Pe?"g":""))}class Me{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Pe,et){et.position=this.position++,this.matchIndexes[this.matchAt]=et,this.regexes.push([et,Pe]),this.matchAt+=C(Pe)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Pe=this.regexes.map(et=>et[1]);this.matcherRe=ge(M(Pe,{joinWith:"|"}),!0),this.lastIndex=0}exec(Pe){this.matcherRe.lastIndex=this.lastIndex;const et=this.matcherRe.exec(Pe);if(!et)return null;const rn=et.findIndex((Qr,ka)=>ka>0&&Qr!==void 0),Vt=this.matchIndexes[rn];return et.splice(0,rn),Object.assign(et,Vt)}}class rt{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Pe){if(this.multiRegexes[Pe])return this.multiRegexes[Pe];const et=new Me;return this.rules.slice(Pe).forEach(([rn,Vt])=>et.addRule(rn,Vt)),et.compile(),this.multiRegexes[Pe]=et,et}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Pe,et){this.rules.push([Pe,et]),et.type==="begin"&&this.count++}exec(Pe){const et=this.getMatcher(this.regexIndex);et.lastIndex=this.lastIndex;let rn=et.exec(Pe);if(this.resumingScanAtSamePosition()&&!(rn&&rn.index===this.lastIndex)){const Vt=this.getMatcher(0);Vt.lastIndex=this.lastIndex+1,rn=Vt.exec(Pe)}return rn&&(this.regexIndex+=rn.position+1,this.regexIndex===this.count&&this.considerAll()),rn}}function Ft(Ue){const Pe=new rt;return Ue.contains.forEach(et=>Pe.addRule(et.begin,{rule:et,type:"begin"})),Ue.terminatorEnd&&Pe.addRule(Ue.terminatorEnd,{type:"end"}),Ue.illegal&&Pe.addRule(Ue.illegal,{type:"illegal"}),Pe}function Ot(Ue,Pe){const et=Ue;if(Ue.isCompiled)return et;[De,te,$n,Fe].forEach(Vt=>Vt(Ue,Pe)),Z.compilerExtensions.forEach(Vt=>Vt(Ue,Pe)),Ue.__beforeBegin=null,[ce,Ce,pe].forEach(Vt=>Vt(Ue,Pe)),Ue.isCompiled=!0;let rn=null;return typeof Ue.keywords=="object"&&Ue.keywords.$pattern&&(Ue.keywords=Object.assign({},Ue.keywords),rn=Ue.keywords.$pattern,delete Ue.keywords.$pattern),rn=rn||/\w+/,Ue.keywords&&(Ue.keywords=be(Ue.keywords,Z.case_insensitive)),et.keywordPatternRe=ge(rn,!0),Pe&&(Ue.begin||(Ue.begin=/\B|\b/),et.beginRe=ge(et.begin),!Ue.end&&!Ue.endsWithParent&&(Ue.end=/\B|\b/),Ue.end&&(et.endRe=ge(et.end)),et.terminatorEnd=m(et.end)||"",Ue.endsWithParent&&Pe.terminatorEnd&&(et.terminatorEnd+=(Ue.end?"|":"")+Pe.terminatorEnd)),Ue.illegal&&(et.illegalRe=ge(Ue.illegal)),Ue.contains||(Ue.contains=[]),Ue.contains=[].concat(...Ue.contains.map(function(Vt){return Qt(Vt==="self"?Ue:Vt)})),Ue.contains.forEach(function(Vt){Ot(Vt,et)}),Ue.starts&&Ot(Ue.starts,Pe),et.matcher=Ft(et),et}if(Z.compilerExtensions||(Z.compilerExtensions=[]),Z.contains&&Z.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return Z.classNameAliases=r(Z.classNameAliases||{}),Ot(Z)}function Mt(Z){return Z?Z.endsWithParent||Mt(Z.starts):!1}function Qt(Z){return Z.variants&&!Z.cachedVariants&&(Z.cachedVariants=Z.variants.map(function(ge){return r(Z,{variants:null},ge)})),Z.cachedVariants?Z.cachedVariants:Mt(Z)?r(Z,{starts:Z.starts?r(Z.starts):null}):Object.isFrozen(Z)?r(Z):Z}var yt="11.11.1";class Tr extends Error{constructor(ge,Me){super(ge),this.name="HTMLInjectionError",this.html=Me}}const Rn=n,No=r,Pi=Symbol("nomatch"),wa=7,Bi=function(Z){const ge=Object.create(null),Me=Object.create(null),rt=[];let Ft=!0;const Ot="Could not find the language '{}', did you forget to load/include a language module?",Ue={disableAutodetect:!0,name:"Plain text",contains:[]};let Pe={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function et(_e){return Pe.noHighlightRe.test(_e)}function rn(_e){let Ve=_e.className+" ";Ve+=_e.parentNode?_e.parentNode.className:"";const ht=Pe.languageDetectRe.exec(Ve);if(ht){const Nt=Ln(ht[1]);return Nt||(Ke(Ot.replace("{}",ht[1])),Ke("Falling back to no-highlight mode for this block.",_e)),Nt?ht[1]:"no-highlight"}return Ve.split(/\s+/).find(Nt=>et(Nt)||Ln(Nt))}function Vt(_e,Ve,ht){let Nt="",sn="";typeof Ve=="object"?(Nt=_e,ht=Ve.ignoreIllegals,sn=Ve.language):(ne("10.7.0","highlight(lang, code, ...args) has been deprecated."),ne("10.7.0",`Please use highlight(code, options) instead.
|
|
639
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),sn=_e,Nt=Ve),ht===void 0&&(ht=!0);const Mn={code:Nt,language:sn};Ui("before:highlight",Mn);const Qn=Mn.result?Mn.result:Qr(Mn.language,Mn.code,ht);return Qn.code=Mn.code,Ui("after:highlight",Qn),Qn}function Qr(_e,Ve,ht,Nt){const sn=Object.create(null);function Mn(Ae,qe){return Ae.keywords[qe]}function Qn(){if(!nt.keywords){bn.addText(Rt);return}let Ae=0;nt.keywordPatternRe.lastIndex=0;let qe=nt.keywordPatternRe.exec(Rt),ot="";for(;qe;){ot+=Rt.substring(Ae,qe.index);const bt=_n.case_insensitive?qe[0].toLowerCase():qe[0],on=Mn(nt,bt);if(on){const[Dr,cc]=on;if(bn.addText(ot),ot="",sn[bt]=(sn[bt]||0)+1,sn[bt]<=wa&&(Aa+=cc),Dr.startsWith("_"))ot+=qe[0];else{const cd=_n.classNameAliases[Dr]||Dr;Wn(qe[0],cd)}}else ot+=qe[0];Ae=nt.keywordPatternRe.lastIndex,qe=nt.keywordPatternRe.exec(Rt)}ot+=Rt.substring(Ae),bn.addText(ot)}function Fn(){if(Rt==="")return;let Ae=null;if(typeof nt.subLanguage=="string"){if(!ge[nt.subLanguage]){bn.addText(Rt);return}Ae=Qr(nt.subLanguage,Rt,!0,ld[nt.subLanguage]),ld[nt.subLanguage]=Ae._top}else Ae=Ea(Rt,nt.subLanguage.length?nt.subLanguage:null);nt.relevance>0&&(Aa+=Ae.relevance),bn.__addSublanguage(Ae._emitter,Ae.language)}function zt(){nt.subLanguage!=null?Fn():Qn(),Rt=""}function Wn(Ae,qe){Ae!==""&&(bn.startScope(qe),bn.addText(Ae),bn.endScope())}function Co(Ae,qe){let ot=1;const bt=qe.length-1;for(;ot<=bt;){if(!Ae._emit[ot]){ot++;continue}const on=_n.classNameAliases[Ae[ot]]||Ae[ot],Dr=qe[ot];on?Wn(Dr,on):(Rt=Dr,Qn(),Rt=""),ot++}}function _a(Ae,qe){return Ae.scope&&typeof Ae.scope=="string"&&bn.openNode(_n.classNameAliases[Ae.scope]||Ae.scope),Ae.beginScope&&(Ae.beginScope._wrap?(Wn(Rt,_n.classNameAliases[Ae.beginScope._wrap]||Ae.beginScope._wrap),Rt=""):Ae.beginScope._multi&&(Co(Ae.beginScope,qe),Rt="")),nt=Object.create(Ae,{parent:{value:nt}}),nt}function bi(Ae,qe,ot){let bt=S(Ae.endRe,ot);if(bt){if(Ae["on:end"]){const on=new t(Ae);Ae["on:end"](qe,on),on.isMatchIgnored&&(bt=!1)}if(bt){for(;Ae.endsParent&&Ae.parent;)Ae=Ae.parent;return Ae}}if(Ae.endsWithParent)return bi(Ae.parent,qe,ot)}function ja(Ae){return nt.matcher.regexIndex===0?(Rt+=Ae[0],1):(Ta=!0,0)}function Ao(Ae){const qe=Ae[0],ot=Ae.rule,bt=new t(ot),on=[ot.__beforeBegin,ot["on:begin"]];for(const Dr of on)if(Dr&&(Dr(Ae,bt),bt.isMatchIgnored))return ja(qe);return ot.skip?Rt+=qe:(ot.excludeBegin&&(Rt+=qe),zt(),!ot.returnBegin&&!ot.excludeBegin&&(Rt=qe)),_a(ot,Ae),ot.returnBegin?0:qe.length}function qn(Ae){const qe=Ae[0],ot=Ve.substring(Ae.index),bt=bi(nt,Ae,ot);if(!bt)return Pi;const on=nt;nt.endScope&&nt.endScope._wrap?(zt(),Wn(qe,nt.endScope._wrap)):nt.endScope&&nt.endScope._multi?(zt(),Co(nt.endScope,Ae)):on.skip?Rt+=qe:(on.returnEnd||on.excludeEnd||(Rt+=qe),zt(),on.excludeEnd&&(Rt=qe));do nt.scope&&bn.closeNode(),!nt.skip&&!nt.subLanguage&&(Aa+=nt.relevance),nt=nt.parent;while(nt!==bt.parent);return bt.starts&&_a(bt.starts,Ae),on.returnEnd?0:qe.length}function Cs(){const Ae=[];for(let qe=nt;qe!==_n;qe=qe.parent)qe.scope&&Ae.unshift(qe.scope);Ae.forEach(qe=>bn.openNode(qe))}let ei={};function Ca(Ae,qe){const ot=qe&&qe[0];if(Rt+=Ae,ot==null)return zt(),0;if(ei.type==="begin"&&qe.type==="end"&&ei.index===qe.index&&ot===""){if(Rt+=Ve.slice(qe.index,qe.index+1),!Ft){const bt=new Error(`0 width match regex (${_e})`);throw bt.languageName=_e,bt.badRule=ei.rule,bt}return 1}if(ei=qe,qe.type==="begin")return Ao(qe);if(qe.type==="illegal"&&!ht){const bt=new Error('Illegal lexeme "'+ot+'" for mode "'+(nt.scope||"<unnamed>")+'"');throw bt.mode=nt,bt}else if(qe.type==="end"){const bt=qn(qe);if(bt!==Pi)return bt}if(qe.type==="illegal"&&ot==="")return Rt+=`
|
|
640
|
-
`,1;if(lc>1e5&&lc>qe.index*3)throw new Error("potential infinite loop, way more iterations than matches");return Rt+=ot,ot.length}const _n=Ln(_e);if(!_n)throw Ne(Ot.replace("{}",_e)),new Error('Unknown language: "'+_e+'"');const As=dn(_n);let To="",nt=Nt||As;const ld={},bn=new Pe.__emitter(Pe);Cs();let Rt="",Aa=0,Fi=0,lc=0,Ta=!1;try{if(_n.__emitTokens)_n.__emitTokens(Ve,bn);else{for(nt.matcher.considerAll();;){lc++,Ta?Ta=!1:nt.matcher.considerAll(),nt.matcher.lastIndex=Fi;const Ae=nt.matcher.exec(Ve);if(!Ae)break;const qe=Ve.substring(Fi,Ae.index),ot=Ca(qe,Ae);Fi=Ae.index+ot}Ca(Ve.substring(Fi))}return bn.finalize(),To=bn.toHTML(),{language:_e,value:To,relevance:Aa,illegal:!1,_emitter:bn,_top:nt}}catch(Ae){if(Ae.message&&Ae.message.includes("Illegal"))return{language:_e,value:Rn(Ve),illegal:!0,relevance:0,_illegalBy:{message:Ae.message,index:Fi,context:Ve.slice(Fi-100,Fi+100),mode:Ae.mode,resultSoFar:To},_emitter:bn};if(Ft)return{language:_e,value:Rn(Ve),illegal:!1,relevance:0,errorRaised:Ae,_emitter:bn,_top:nt};throw Ae}}function ka(_e){const Ve={value:Rn(_e),illegal:!1,relevance:0,_top:Ue,_emitter:new Pe.__emitter(Pe)};return Ve._emitter.addText(_e),Ve}function Ea(_e,Ve){Ve=Ve||Pe.languages||Object.keys(ge);const ht=ka(_e),Nt=Ve.filter(Ln).filter(Zr).map(zt=>Qr(zt,_e,!1));Nt.unshift(ht);const sn=Nt.sort((zt,Wn)=>{if(zt.relevance!==Wn.relevance)return Wn.relevance-zt.relevance;if(zt.language&&Wn.language){if(Ln(zt.language).supersetOf===Wn.language)return 1;if(Ln(Wn.language).supersetOf===zt.language)return-1}return 0}),[Mn,Qn]=sn,Fn=Mn;return Fn.secondBest=Qn,Fn}function Mr(_e,Ve,ht){const Nt=Ve&&Me[Ve]||ht;_e.classList.add("hljs"),_e.classList.add(`language-${Nt}`)}function an(_e){let Ve=null;const ht=rn(_e);if(et(ht))return;if(Ui("before:highlightElement",{el:_e,language:ht}),_e.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",_e);return}if(_e.children.length>0&&(Pe.ignoreUnescapedHTML||(console.warn("One of your code blocks includes unescaped HTML. This is a potentially serious security risk."),console.warn("https://github.com/highlightjs/highlight.js/wiki/security"),console.warn("The element with unescaped HTML:"),console.warn(_e)),Pe.throwUnescapedHTML))throw new Tr("One of your code blocks includes unescaped HTML.",_e.innerHTML);Ve=_e;const Nt=Ve.textContent,sn=ht?Vt(Nt,{language:ht,ignoreIllegals:!0}):Ea(Nt);_e.innerHTML=sn.value,_e.dataset.highlighted="yes",Mr(_e,ht,sn.language),_e.result={language:sn.language,re:sn.relevance,relevance:sn.relevance},sn.secondBest&&(_e.secondBest={language:sn.secondBest.language,relevance:sn.secondBest.relevance}),Ui("after:highlightElement",{el:_e,result:sn,text:Nt})}function Tn(_e){Pe=No(Pe,_e)}const Wr=()=>{Na(),ne("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Sa(){Na(),ne("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let _s=!1;function Na(){function _e(){Na()}if(document.readyState==="loading"){_s||window.addEventListener("DOMContentLoaded",_e,!1),_s=!0;return}document.querySelectorAll(Pe.cssSelector).forEach(an)}function _o(_e,Ve){let ht=null;try{ht=Ve(Z)}catch(Nt){if(Ne("Language definition for '{}' could not be registered.".replace("{}",_e)),Ft)Ne(Nt);else throw Nt;ht=Ue}ht.name||(ht.name=_e),ge[_e]=ht,ht.rawDefinition=Ve.bind(null,Z),ht.aliases&&Xr(ht.aliases,{languageName:_e})}function $i(_e){delete ge[_e];for(const Ve of Object.keys(Me))Me[Ve]===_e&&delete Me[Ve]}function js(){return Object.keys(ge)}function Ln(_e){return _e=(_e||"").toLowerCase(),ge[_e]||ge[Me[_e]]}function Xr(_e,{languageName:Ve}){typeof _e=="string"&&(_e=[_e]),_e.forEach(ht=>{Me[ht.toLowerCase()]=Ve})}function Zr(_e){const Ve=Ln(_e);return Ve&&!Ve.disableAutodetect}function yi(_e){_e["before:highlightBlock"]&&!_e["before:highlightElement"]&&(_e["before:highlightElement"]=Ve=>{_e["before:highlightBlock"](Object.assign({block:Ve.el},Ve))}),_e["after:highlightBlock"]&&!_e["after:highlightElement"]&&(_e["after:highlightElement"]=Ve=>{_e["after:highlightBlock"](Object.assign({block:Ve.el},Ve))})}function fn(_e){yi(_e),rt.push(_e)}function jo(_e){const Ve=rt.indexOf(_e);Ve!==-1&&rt.splice(Ve,1)}function Ui(_e,Ve){const ht=_e;rt.forEach(function(Nt){Nt[ht]&&Nt[ht](Ve)})}function Jr(_e){return ne("10.7.0","highlightBlock will be removed entirely in v12.0"),ne("10.7.0","Please use highlightElement now."),an(_e)}Object.assign(Z,{highlight:Vt,highlightAuto:Ea,highlightAll:Na,highlightElement:an,highlightBlock:Jr,configure:Tn,initHighlighting:Wr,initHighlightingOnLoad:Sa,registerLanguage:_o,unregisterLanguage:$i,listLanguages:js,getLanguage:Ln,registerAliases:Xr,autoDetection:Zr,inherit:No,addPlugin:fn,removePlugin:jo}),Z.debugMode=function(){Ft=!1},Z.safeMode=function(){Ft=!0},Z.versionString=yt,Z.regex={concat:v,lookahead:y,either:E,optional:k,anyNumberOfTimes:b};for(const _e in Te)typeof Te[_e]=="object"&&e(Te[_e]);return Object.assign(Z,Te),Z},Un=Bi({});return Un.newInstance=()=>Bi({}),sy=Un,Un.HighlightJS=Un,Un.default=Un,sy}var n8=t8();const r8=qu(n8),TE={},i8="hljs-";function a8(e){const t=r8.newInstance();return e&&o(e),{highlight:n,highlightAuto:r,listLanguages:a,register:o,registerAlias:l,registered:d};function n(f,h,g){const m=g||TE,y=typeof m.prefix=="string"?m.prefix:i8;if(!t.getLanguage(f))throw new Error("Unknown language: `"+f+"` is not registered");t.configure({__emitter:s8,classPrefix:y});const b=t.highlight(h,{ignoreIllegals:!0,language:f});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const k=b._emitter.root,v=k.data;return v.language=b.language,v.relevance=b.relevance,k}function r(f,h){const m=(h||TE).subset||a();let y=-1,b=0,k;for(;++y<m.length;){const v=m[y];if(!t.getLanguage(v))continue;const N=n(v,f,h);N.data&&N.data.relevance!==void 0&&N.data.relevance>b&&(b=N.data.relevance,k=N)}return k||{type:"root",children:[],data:{language:void 0,relevance:b}}}function a(){return t.listLanguages()}function o(f,h){if(typeof f=="string")t.registerLanguage(f,h);else{let g;for(g in f)Object.hasOwn(f,g)&&t.registerLanguage(g,f[g])}}function l(f,h){if(typeof f=="string")t.registerAliases(typeof h=="string"?h:[...h],{languageName:f});else{let g;for(g in f)if(Object.hasOwn(f,g)){const m=f[g];t.registerAliases(typeof m=="string"?m:[...m],{languageName:g})}}}function d(f){return!!t.getLanguage(f)}}class s8{constructor(t){this.options=t,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(t){if(t==="")return;const n=this.stack[this.stack.length-1],r=n.children[n.children.length-1];r&&r.type==="text"?r.value+=t:n.children.push({type:"text",value:t})}startScope(t){this.openNode(String(t))}endScope(){this.closeNode()}__addSublanguage(t,n){const r=this.stack[this.stack.length-1],a=t.root.children;n?r.children.push({type:"element",tagName:"span",properties:{className:[n]},children:a}):r.children.push(...a)}openNode(t){const n=this,r=t.split(".").map(function(l,d){return d?l+"_".repeat(d):n.options.classPrefix+l}),a=this.stack[this.stack.length-1],o={type:"element",tagName:"span",properties:{className:r},children:[]};a.children.push(o),this.stack.push(o)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const o8={};function Lx(e){const t=e||o8,n=t.aliases,r=t.detect||!1,a=t.languages||e8,o=t.plainText,l=t.prefix,d=t.subset;let f="hljs";const h=a8(a);if(n&&h.registerAlias(n),l){const g=l.indexOf("-");f=g===-1?l:l.slice(0,g)}return function(g,m){lp(g,"element",function(y,b,k){if(y.tagName!=="code"||!k||k.type!=="element"||k.tagName!=="pre")return;const v=l8(y);if(v===!1||!v&&!r||v&&o&&o.includes(v))return;Array.isArray(y.properties.className)||(y.properties.className=[]),y.properties.className.includes(f)||y.properties.className.unshift(f);const N=j9(y,{whitespace:"pre"});let E;try{E=v?h.highlight(v,N,{prefix:l}):h.highlightAuto(N,{prefix:l,subset:d})}catch(C){const S=C;if(v&&/Unknown language/.test(S.message)){m.message("Cannot highlight as `"+v+"`, it’s not registered",{ancestors:[k,y],cause:S,place:y.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw S}!v&&E.data&&E.data.language&&y.properties.className.push("language-"+E.data.language),E.children.length>0&&(y.children=E.children)})}}function l8(e){const t=e.properties.className;let n=-1;if(!Array.isArray(t))return;let r;for(;++n<t.length;){const a=String(t[n]);if(a==="no-highlight"||a==="nohighlight")return!1;!r&&a.slice(0,5)==="lang-"&&(r=a.slice(5)),!r&&a.slice(0,9)==="language-"&&(r=a.slice(9))}return r}function c8({name:e,onClose:t}){const n=Be(),{data:r,isLoading:a,isError:o,error:l}=Ye({queryKey:["skill",e],queryFn:()=>Cz(e)});return j.useEffect(()=>{const d=f=>{f.key==="Escape"&&t()};return window.addEventListener("keydown",d),()=>window.removeEventListener("keydown",d)},[t]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",children:c.jsxs("div",{className:"nb-card mt-8 w-full max-w-4xl",children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e}),r&&c.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:[r.category," · ",r.origin||"local"]})]}),c.jsx("button",{onClick:t,className:"nb-btn nb-btn-mint p-2","aria-label":n("skillDetail.close.aria"),type:"button",children:c.jsx(Sn,{size:16,strokeWidth:3})})]}),a&&c.jsx("p",{children:n("skillDetail.loading")}),o&&c.jsx("p",{className:"text-[var(--color-crashed)]",children:n("skillDetail.error.load",{detail:l instanceof Error?l.message:String(l)})}),r&&c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:n("skillDetail.section.preview")}),c.jsx("div",{className:"prose-chat bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-80 overflow-auto text-sm",children:r.body?c.jsx(Cx,{remarkPlugins:[Dx],rehypePlugins:[Lx],children:r.body}):c.jsx("p",{className:"text-[var(--color-text-muted)] italic",children:"(empty)"})})]}),r.references.length>0&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:"References"}),c.jsx("ul",{className:"flex flex-col gap-2",children:r.references.map(d=>c.jsx(u8,{skillName:e,file:d.name,lines:d.lines},d.name))})]})]})]})})}function u8({skillName:e,file:t,lines:n}){const r=Be(),[a,o]=j.useState(!1),{data:l,isLoading:d,isError:f,error:h}=Ye({queryKey:["skill-ref",e,t],queryFn:()=>Az(e,t),enabled:a,staleTime:1/0});return c.jsxs("li",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[c.jsxs("button",{type:"button",onClick:()=>o(g=>!g),"aria-label":r("skillDetail.toggleSection.aria",{action:r(a?"skillDetail.collapse":"skillDetail.expand"),file:t}),"aria-expanded":a,className:"w-full flex items-center gap-2 px-3 py-2 text-sm font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[c.jsx(Zl,{size:12,strokeWidth:3,className:["transition-transform",a?"rotate-90":""].join(" ")}),c.jsx(Fh,{size:12,strokeWidth:2.5}),c.jsx("span",{className:"flex-1 text-left font-bold",children:t}),c.jsxs("span",{className:"text-xs text-[var(--color-text-subtle)]",children:[n," lines"]})]}),a&&c.jsxs("div",{className:"px-4 py-3 border-t-2 border-[var(--color-text)] bg-[var(--color-bg)] max-h-96 overflow-auto",children:[d&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:r("skillDetail.loading")}),f&&c.jsx("p",{className:"text-xs text-[var(--color-crashed)]",children:r("skillDetail.error.load",{detail:h instanceof Error?h.message:String(h)})}),l&&c.jsx("div",{className:"prose-chat text-sm",children:c.jsx(Cx,{remarkPlugins:[Dx],rehypePlugins:[Lx],children:l.content})})]})]})}function d8({onClose:e}){const t=Be(),n=Gt(),{alert:r}=un(),[a,o]=j.useState(""),[l,d]=j.useState(""),f=/^[a-z0-9][a-z0-9-]*$/.test(a),h=Ct({mutationFn:()=>Lz(a,{"SKILL.md":l}),onSuccess:()=>{n.invalidateQueries({queryKey:["skills"]}),n.invalidateQueries({queryKey:["skill-updates"]}),e()},onError:g=>void r({title:t("skills.import.error"),body:g instanceof Error?g.message:String(g)})});return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4",onClick:e,children:c.jsxs("div",{className:"nb-card mt-16 w-full max-w-xl flex flex-col gap-3",onClick:g=>g.stopPropagation(),children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:t("skills.import.title")}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(Sn,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:t("skills.import.name")}),c.jsx("input",{className:"nb-input w-full",value:a,onChange:g=>o(g.target.value),placeholder:"code-review","aria-label":t("skills.import.name")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:t("skills.import.body")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",rows:12,value:l,onChange:g=>d(g.target.value),placeholder:`---
|
|
641
|
-
name: code-review
|
|
642
|
-
description: ...
|
|
643
|
-
---
|
|
644
|
-
|
|
645
|
-
# ...`,"aria-label":t("skills.import.body")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:h.isPending||!f||!l.trim(),onClick:()=>h.mutate(),children:[h.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(t_,{size:14,strokeWidth:3}),t("skills.import.submit")]})]})})}function f8({onClose:e,onSubmit:t}){const n=Be(),[r,a]=j.useState(""),[o,l]=j.useState(""),d=/^[a-z0-9][a-z0-9-]*$/.test(r);return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(Pl,{size:16,strokeWidth:2.5}),n("skills.ai.title")]}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(Sn,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("skills.ai.name")}),c.jsx("input",{type:"text",value:r,onChange:f=>a(f.target.value),placeholder:"rust-error-handling",className:"nb-input w-full font-[family-name:var(--font-mono)]","aria-label":n("skills.ai.name")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("skills.ai.intent")}),c.jsx("textarea",{value:o,onChange:f=>l(f.target.value),placeholder:n("skills.ai.placeholder"),rows:5,className:"nb-input w-full text-sm","aria-label":n("skills.ai.intent")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:!d||!o.trim(),onClick:()=>t(r,o),children:[c.jsx(Pl,{size:14,strokeWidth:2.5}),n("skills.ai.submit")]})]})})})}async function h8(e){const{files:t}=await Iz(e),n=t["SKILL.md"]??"",r=new Blob([n],{type:"text/markdown"}),a=URL.createObjectURL(r),o=document.createElement("a");o.href=a,o.download=`${e}.SKILL.md`,o.click(),URL.revokeObjectURL(a)}const p8=[{value:"all",labelKey:"skills.category.all"},{value:"language",labelKey:"skills.category.language"},{value:"end",labelKey:"skills.category.end"},{value:"persona",labelKey:"skills.category.persona"},{value:"workflow",labelKey:"skills.category.workflow"},{value:"other",labelKey:"skills.category.other"}],m8={language:"var(--color-accent-purple)",end:"var(--color-secondary)",persona:"var(--color-primary)",workflow:"var(--color-accent-mint)",other:"var(--color-bg-cream)"};function g8(){var R,$;const e=Be(),[t,n]=j.useState("all"),[r,a]=j.useState(""),[o,l]=j.useState(null),[d,f]=j.useState(!1),[h,g]=j.useState(!1),m=Gt(),b=(((R=Ye({queryKey:["gen-jobs"],queryFn:b2,refetchInterval:3e3}).data)==null?void 0:R.data)??[]).filter(z=>z.kind==="skill"),k=b.filter(z=>z.status!=="done"),v=j.useRef(new Set);j.useEffect(()=>{for(const z of b)(z.status==="done"||z.status==="error")&&!v.current.has(z.id)&&(v.current.add(z.id),m.invalidateQueries({queryKey:["skills"]}),m.invalidateQueries({queryKey:["skill-updates"]}))},[b,m]);const N=(z,q)=>{zz(z,q).then(()=>m.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},C=((($=Ye({queryKey:["skill-updates"],queryFn:Rz}).data)==null?void 0:$.data)??[]).filter(z=>z.status!=="same").length,{data:S,isLoading:_}=Ye({queryKey:["skills"],queryFn:()=>ox()}),M=Ye({queryKey:["projects"],queryFn:Es}),T=j.useMemo(()=>((S==null?void 0:S.data)??[]).filter(q=>!(t!=="all"&&q.category!==t||r&&!q.name.toLowerCase().includes(r.toLowerCase()))),[S,t,r]),L=j.useMemo(()=>{const z=(S==null?void 0:S.data)??[],q={all:z.length};for(const F of z)q[F.category]=(q[F.category]??0)+1;return q},[S]);return c.jsxs("div",{className:"flex flex-col gap-4 max-w-full",children:[c.jsxs("header",{className:"flex items-center justify-between flex-wrap gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:"Skills 🎯"}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:_?e("common.loading"):e("skills.subtitleCount",{count:(S==null?void 0:S.data.length)??0})})]}),c.jsxs("div",{className:"flex gap-3 items-center",children:[C>0&&c.jsx("span",{className:"nb-badge text-[10px]",title:e("skills.updates.badge",{count:String(C)}),children:e("skills.updates.badge",{count:String(C)})}),c.jsxs("button",{className:"nb-btn",onClick:()=>g(!0),type:"button",children:[c.jsx(Pl,{size:14,strokeWidth:2.5}),e("skills.ai")]}),c.jsxs("button",{className:"nb-btn",onClick:()=>f(!0),type:"button",children:[c.jsx(t_,{size:14,strokeWidth:2.5}),e("skills.import")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",onClick:async()=>{await Mz(),m.invalidateQueries({queryKey:["skills"]}),m.invalidateQueries({queryKey:["skill-updates"]})},type:"button",children:[c.jsx(ya,{size:14,strokeWidth:2.5}),"Sync bundled"]})]})]}),c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsxs("div",{className:"relative flex-1 max-w-md",children:[c.jsx(ho,{size:14,className:"absolute left-3 top-1/2 -translate-y-1/2 text-[var(--color-text-subtle)]"}),c.jsx("input",{className:"nb-input pl-9 w-full",placeholder:e("skills.search.placeholder"),value:r,onChange:z=>a(z.target.value),"aria-label":e("skills.search.aria")})]}),c.jsx("div",{className:"flex gap-1 p-1 bg-[var(--color-bg)] border-[2px] border-[var(--color-text)] rounded-full shadow-[2px_2px_0_var(--color-text)]",children:p8.map(z=>c.jsxs("button",{type:"button",onClick:()=>n(z.value),className:["px-3 py-1 rounded-full text-xs font-bold font-[family-name:var(--font-body)]",t===z.value?"bg-[var(--color-text)] text-[var(--color-bg)]":"text-[var(--color-text-muted)] hover:text-[var(--color-text)]"].join(" "),children:[e(z.labelKey)," ",L[z.value]]},z.value))})]}),c.jsxs("div",{className:"grid gap-4 grid-cols-[repeat(auto-fill,minmax(280px,1fr))]",children:[k.map(z=>c.jsxs("div",{className:`nb-card flex items-center gap-2 ${z.status==="error"?"bg-[var(--color-crashed-bg)]":"opacity-70"}`,children:[z.status==="running"?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(Sn,{size:14,strokeWidth:3}),c.jsx("span",{className:"text-sm text-[var(--color-text-muted)] truncate",children:z.status==="running"?`${z.label} · ${e("skills.ai.wait")}`:`${z.label}: ${z.error??e("skills.ai.error")}`})]},z.id)),T.map(z=>{var q;return c.jsx(y8,{skill:z,projectCount:((q=M.data)==null?void 0:q.data.length)??0,onOpen:()=>l(z.name),onExport:()=>void h8(z.name)},z.name)})]}),o&&c.jsx(c8,{name:o,onClose:()=>l(null)}),d&&c.jsx(d8,{onClose:()=>f(!1)}),h&&c.jsx(f8,{onClose:()=>g(!1),onSubmit:(z,q)=>{N(z,q),g(!1)}})]})}function y8({skill:e,projectCount:t,onOpen:n,onExport:r}){const a=Be(),o=m8[e.category];return c.jsxs("article",{onClick:n,onKeyDown:l=>{(l.key==="Enter"||l.key===" ")&&(l.preventDefault(),n())},tabIndex:0,role:"button","aria-label":`Open ${e.name}`,className:"nb-card nb-card-interactive flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:e.name}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",className:"nb-btn p-1",onClick:l=>{l.stopPropagation(),r()},"aria-label":a("skills.export"),title:a("skills.export"),children:c.jsx(Uh,{size:12,strokeWidth:2.5})}),c.jsx("span",{className:"nb-badge text-[10px]",style:{background:o},children:e.category})]})]}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] leading-5 line-clamp-3",children:e.description||"(no description)"}),c.jsxs("div",{className:"flex items-center justify-between text-xs font-[family-name:var(--font-mono)] pt-2 border-t-[1.5px] border-dashed border-[var(--color-border-light)]",children:[c.jsx("span",{className:"font-bold",children:e.linkedProjects.length>0?`● linked in ${e.linkedProjects.length}`:"○ not linked"}),c.jsxs("span",{className:"text-[var(--color-text-subtle)]",children:[t," projects"]})]})]})}function Hj(e){const t=e?`?q=${encodeURIComponent(e)}`:"";return ft(`/api/prompts${t}`)}function Ix(e){return ft(`/api/prompts/${encodeURIComponent(e)}`)}function b8(e){return Li("/api/prompts",e)}function x8(e,t){return qb(`/api/prompts/${encodeURIComponent(e)}`,t)}function v8(e){return T3(`/api/prompts/${encodeURIComponent(e)}`)}function w8(e){return Li("/api/prompts/generate",{intent:e})}function Kj(e){const t=new Set,n=[];for(const r of e.matchAll(/\{\{\s*([a-zA-Z_][a-zA-Z0-9_]*)\s*\}\}/g)){const a=r[1];a&&!t.has(a)&&(t.add(a),n.push(a))}return n}function k8(){var T,L;const e=Be(),[t,n]=Kb("prompts.last",""),[r,a]=j.useState(null),[o,l]=j.useState(!1),[d,f]=j.useState(""),[h,g]=j.useState(new Set),m=Gt(),y=Ye({queryKey:["prompts"],queryFn:()=>Hj()}),b=((T=y.data)==null?void 0:T.data)??[],k=j.useMemo(()=>[...new Set(b.flatMap(R=>R.tags))].sort(),[b]),N=(((L=Ye({queryKey:["gen-jobs"],queryFn:b2,refetchInterval:3e3}).data)==null?void 0:L.data)??[]).filter(R=>R.kind==="prompt"),E=N.filter(R=>R.status!=="done"),C=j.useRef(new Set);j.useEffect(()=>{for(const R of N)(R.status==="done"||R.status==="error")&&!C.current.has(R.id)&&(C.current.add(R.id),m.invalidateQueries({queryKey:["prompts"]}),R.status==="done"&&R.result&&n(R.result))},[N,m,n]);const S=R=>{w8(R).then(()=>m.invalidateQueries({queryKey:["gen-jobs"]})).catch(()=>{})},_=j.useMemo(()=>{const R=d.trim().toLowerCase();return b.filter($=>!(h.size&&![...h].every(z=>$.tags.includes(z))||R&&!($.name.toLowerCase().includes(R)||$.description.toLowerCase().includes(R)||$.tags.some(q=>q.toLowerCase().includes(R)))))},[b,h,d]);j.useEffect(()=>{t&&b.length&&!b.some(R=>R.name===t)&&n("")},[t,b,n]);const M=R=>g($=>{const z=new Set($);return z.has(R)?z.delete(R):z.add(R),z});return c.jsxs("div",{className:"flex flex-col flex-1 min-h-0 w-full gap-3",children:[c.jsxs("div",{className:"shrink-0 flex items-center justify-between gap-3",children:[c.jsxs("div",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e("prompts.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("prompts.desc")})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsxs("button",{className:"nb-btn",type:"button",onClick:()=>l(!0),children:[c.jsx(Pl,{size:14,strokeWidth:2.5}),e("prompts.ai")]}),c.jsxs("button",{className:"nb-btn nb-btn-mint",type:"button",onClick:()=>a({mode:"new"}),children:[c.jsx(pr,{size:14,strokeWidth:3}),e("prompts.new")]})]})]}),c.jsxs("div",{className:"shrink-0 flex flex-col gap-2",children:[c.jsxs("label",{className:"nb-input flex items-center gap-2 w-full",style:{padding:"6px 10px"},children:[c.jsx(ho,{size:14}),c.jsx("input",{type:"text",value:d,onChange:R=>f(R.target.value),placeholder:e("prompts.search"),className:"bg-transparent outline-none flex-1 text-sm","aria-label":e("prompts.search")})]}),k.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5",children:k.map(R=>c.jsx("button",{type:"button",onClick:()=>M(R),className:`text-xs border-2 border-[var(--color-text)] rounded-full px-2 py-0.5 ${h.has(R)?"bg-[var(--color-accent-mint)] font-bold":"bg-[var(--color-bg)]"}`,children:R},R))})]}),c.jsxs("div",{className:"flex gap-5 flex-1 min-h-0",children:[c.jsxs("aside",{className:"w-80 shrink-0 min-h-0 overflow-y-auto flex flex-col gap-2 pr-1",children:[E.map(R=>c.jsxs("div",{className:`nb-card flex items-center gap-2 ${R.status==="error"?"bg-[var(--color-crashed-bg)]":"opacity-70"}`,style:{padding:"8px 10px"},children:[R.status==="running"?c.jsx(Xe,{size:12,className:"animate-spin"}):c.jsx(Sn,{size:12,strokeWidth:3}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] truncate",children:R.status==="running"?e("prompts.ai.wait"):`${e("prompts.ai.error")}: ${R.error??""}`})]},R.id)),y.isLoading?c.jsx("div",{className:"nb-card",children:c.jsx(Xe,{size:14,className:"animate-spin"})}):_.length===0?c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:e("prompts.empty")})}):_.map(R=>c.jsxs("button",{type:"button",onClick:()=>n(R.name),className:`nb-card w-full text-left ${t===R.name?"bg-[var(--color-accent-mint)]":""}`,style:{padding:"8px 10px"},children:[c.jsxs("span",{className:"flex items-center gap-1.5",children:[R.favorite&&c.jsx(JN,{size:12,fill:"currentColor"}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold truncate",children:R.name})]}),R.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)] truncate",children:R.description})]},R.name))]}),c.jsx("div",{className:"flex-1 min-w-0 min-h-0",children:t?c.jsx(S8,{name:t,onEdit:()=>a({mode:"edit",name:t}),onDeleted:()=>n("")},t):c.jsx("div",{className:"nb-card",children:c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("prompts.selectHint")})})})]}),r&&c.jsx(_8,{name:r.mode==="edit"?r.name:null,onClose:()=>a(null),onSaved:R=>{a(null),n(R)}}),o&&c.jsx(E8,{onClose:()=>l(!1),onSubmit:R=>{S(R),l(!1)}})]})}function E8({onClose:e,onSubmit:t}){const n=Be(),[r,a]=j.useState("");return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold flex items-center gap-2",children:[c.jsx(Pl,{size:16,strokeWidth:2.5}),n("prompts.ai.title")]}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:e,"aria-label":"close",children:c.jsx(Sn,{size:14,strokeWidth:3})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:n("prompts.ai.intent")}),c.jsx("textarea",{value:r,onChange:o=>a(o.target.value),placeholder:n("prompts.ai.placeholder"),rows:5,className:"nb-input w-full text-sm","aria-label":n("prompts.ai.intent")})]}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint self-start",disabled:!r.trim(),onClick:()=>t(r),children:[c.jsx(Pl,{size:14,strokeWidth:2.5}),n("prompts.ai.submit")]})]})})})}function S8({name:e,onEdit:t,onDeleted:n}){const r=Be(),a=Gt(),{confirm:o}=un(),l=Ye({queryKey:["prompt",e],queryFn:()=>Ix(e)}),d=Ct({mutationFn:()=>v8(e),onSuccess:()=>{a.invalidateQueries({queryKey:["prompts"]}),n()}});if(l.isLoading)return c.jsx("div",{className:"nb-card",children:c.jsx(Xe,{size:14,className:"animate-spin"})});const f=l.data;if(!f)return null;const h=Kj(f.body);return c.jsxs("div",{className:"nb-card flex flex-col gap-3 h-full min-h-0",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 shrink-0",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold flex items-center gap-2",children:[f.favorite&&c.jsx(JN,{size:16,fill:"currentColor"}),c.jsx("code",{className:"font-[family-name:var(--font-mono)] truncate",children:f.name})]}),f.description&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:f.description})]}),c.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:t,children:[c.jsx(qh,{size:14,strokeWidth:3}),r("common.edit")]}),c.jsx("button",{type:"button",className:"nb-btn",disabled:d.isPending,onClick:async()=>{await o({title:r("prompts.delete"),body:r("prompts.deleteConfirm",{name:e})})&&d.mutate()},"aria-label":r("prompts.delete"),children:c.jsx(fi,{size:14,strokeWidth:3})})]})]}),f.tags.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5 shrink-0",children:f.tags.map(g=>c.jsx("span",{className:"text-xs bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full px-2 py-0.5",children:g},g))}),c.jsx("pre",{className:"flex-1 min-h-0 overflow-auto text-sm font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded p-3",children:f.body}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)] shrink-0",children:h.length?r("prompts.vars",{names:h.join(", ")}):r("prompts.noVars")})]})}function N8({tags:e,onChange:t}){const n=Be(),[r,a]=j.useState(""),o=()=>{const l=r.trim();l&&!e.includes(l)&&t([...e,l]),a("")};return c.jsxs("div",{className:"nb-input w-full flex flex-wrap gap-1.5 items-center",children:[e.map(l=>c.jsxs("span",{className:"inline-flex items-center gap-1 text-xs bg-[var(--color-accent-mint)] border-2 border-[var(--color-text)] rounded px-1.5 py-0.5",children:[l,c.jsx("button",{type:"button",onClick:()=>t(e.filter(d=>d!==l)),"aria-label":`remove ${l}`,children:c.jsx(Sn,{size:10,strokeWidth:3})})]},l)),c.jsx("input",{className:"flex-1 min-w-[90px] bg-transparent outline-none text-sm",value:r,onChange:l=>a(l.target.value),onKeyDown:l=>{l.key==="Enter"?(l.preventDefault(),o()):l.key==="Backspace"&&!r&&e.length&&t(e.slice(0,-1))},placeholder:e.length?"":n("prompts.tagAdd"),"aria-label":n("prompts.tags")})]})}function _8({name:e,onClose:t,onSaved:n}){const r=Be(),a=Gt(),{alert:o}=un(),l=e===null,d=Ye({queryKey:["prompt",e],queryFn:()=>Ix(e),enabled:!l}),[f,h]=j.useState(l?{name:"",description:"",tags:[],body:"",favorite:!1}:null);j.useEffect(()=>{if(!l&&d.data&&f===null){const b=d.data;h({name:b.name,description:b.description,tags:b.tags,body:b.body,favorite:b.favorite})}},[l,d.data,f]);const g=Ct({mutationFn:()=>{if(!f)throw new Error("no form");const b={description:f.description||void 0,tags:f.tags,favorite:f.favorite,body:f.body};return l?b8({name:f.name,...b}):x8(e,b)},onSuccess:b=>{a.invalidateQueries({queryKey:["prompts"]}),a.invalidateQueries({queryKey:["prompt",b.name]}),n(b.name)},onError:b=>void o({title:r("prompts.saveError"),body:b instanceof Error?b.message:String(b)})}),m=j.useMemo(()=>f?/^[a-z0-9][a-z0-9-]*$/.test(f.name):!1,[f]),y=j.useMemo(()=>f?Kj(f.body):[],[f]);return c.jsx("div",{className:"fixed inset-0 z-50 flex items-start justify-center bg-black/30 p-4 overflow-auto",children:c.jsx("div",{className:"w-full max-w-2xl my-8",children:c.jsxs("div",{className:"nb-card flex flex-col gap-3",children:[c.jsxs("div",{className:"flex items-center justify-between shrink-0",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:l?r("prompts.new"):e}),c.jsx("button",{type:"button",className:"nb-btn p-2",onClick:t,"aria-label":"close",children:c.jsx(Sn,{size:14,strokeWidth:3})})]}),!l&&d.isLoading?c.jsx(Xe,{size:14,className:"animate-spin"}):f?c.jsxs(c.Fragment,{children:[c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3",children:[c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:r("prompts.name")}),c.jsx("input",{type:"text",value:f.name,disabled:!l,onChange:b=>h({...f,name:b.target.value}),placeholder:r("prompts.namePlaceholder"),className:"nb-input w-full","aria-label":r("prompts.name")}),l&&f.name&&!m&&c.jsx("span",{className:"text-xs text-[var(--color-crashed)]",children:r("prompts.nameError")})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:r("prompts.description")}),c.jsx("input",{type:"text",value:f.description,onChange:b=>h({...f,description:b.target.value}),className:"nb-input w-full","aria-label":r("prompts.description")})]})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:r("prompts.tags")}),c.jsx(N8,{tags:f.tags,onChange:b=>h({...f,tags:b})})]}),c.jsxs("label",{className:"flex flex-col gap-1",children:[c.jsx("span",{className:"text-sm font-bold",children:r("prompts.body")}),c.jsx("textarea",{value:f.body,onChange:b=>h({...f,body:b.target.value}),placeholder:r("prompts.bodyPlaceholder"),rows:12,className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm","aria-label":r("prompts.body")}),c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:y.length?r("prompts.vars",{names:y.join(", ")}):r("prompts.noVars")})]}),c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsxs("button",{type:"button",className:"nb-btn nb-btn-mint",disabled:g.isPending||l&&!m||!f.body.trim(),onClick:()=>g.mutate(),children:[g.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(Ri,{size:14,strokeWidth:3}),r("prompts.save")]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm cursor-pointer",children:[c.jsx("input",{type:"checkbox",checked:f.favorite,onChange:b=>h({...f,favorite:b.target.checked})}),r("prompts.favorite")]})]})]}):null]})})})}function j8(){var o;const e=Be(),t=Ye({queryKey:["system-info"],queryFn:l_}),n=Ye({queryKey:["system-env"],queryFn:M3}),[r,a]=j.useState(!1);return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsx("header",{children:c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("system.h1")})}),c.jsx(C8,{current:(o=t.data)==null?void 0:o.version}),c.jsxs("section",{className:"nb-card",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-3",children:e("system.runtime")}),t.data?c.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-[160px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:"Node"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.data.nodeVersion}),c.jsx("dt",{className:"font-bold",children:"Platform"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.data.platform}),c.jsx("dt",{className:"font-bold",children:"PID"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:t.data.pid??"—"}),c.jsx("dt",{className:"font-bold",children:"Uptime"}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:D8(t.data.uptimeMs)})]}):c.jsx("p",{className:"text-[var(--color-text-muted)]",children:e("common.loading")})]}),c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:[e("system.env.title.prefix"),c.jsx("code",{className:"text-sm font-[family-name:var(--font-mono)] font-normal bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded",children:"~/.coral/env"})]}),r?c.jsx("span",{className:"text-xs text-[var(--color-stuck)] font-bold",children:e("system.env.editing.label")}):c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>a(!0),type:"button","aria-label":e("system.env.edit.aria"),children:[c.jsx(qh,{size:12,strokeWidth:2.5})," ",e("system.env.edit.button")]})]}),r?c.jsx(A8,{onClose:()=>{a(!1),n.refetch()}}):n.data&&n.data.exists?c.jsx("dl",{className:"grid grid-cols-1 sm:grid-cols-[220px_1fr] gap-y-1 text-sm font-[family-name:var(--font-mono)]",children:n.data.entries.map(l=>c.jsxs("div",{className:"contents",children:[c.jsxs("dt",{className:"font-bold flex items-center gap-2",children:[l.masked&&c.jsx("span",{className:"text-[var(--color-stuck)]",children:"🔒"}),l.key]}),c.jsx("dd",{className:"text-[var(--color-text-muted)] truncate",children:l.value})]},l.key))}):c.jsxs("p",{className:"text-[var(--color-text-muted)] text-sm",children:[e("system.env.empty.before"),c.jsx("code",{className:"bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] px-2 py-0.5 rounded font-[family-name:var(--font-mono)]",children:"sps setup"}),e("system.env.empty.after")]})]}),c.jsx(T8,{})]})}function C8({current:e}){var v;const t=Be(),{confirm:n,alert:r}=un(),[a,o]=j.useState(!1),[l,d]=j.useState(null),f=Ye({queryKey:["latest-version"],queryFn:z3,enabled:!1}),[h,g]=j.useState(null),[m,y]=j.useState("npm i -g @coralai/sps-cli@latest"),b=async()=>{var E;if(await n({title:t("system.upgrade.confirm.title"),body:t("system.upgrade.confirm.body",{current:e??"?",latest:((E=f.data)==null?void 0:E.latest)??"?"}),confirm:t("system.upgrade.confirm.button")})){o(!0),d(null),g(null);try{const C=await P3();if(d(C.output),g(C.installedVersion),y(C.command),C.ok)r({title:t("system.upgrade.success.title"),body:t("system.upgrade.success.body",{version:C.installedVersion??"?"})});else{const S=C.installedVersion&&C.installedVersion===e?t("system.upgrade.notEffective.same",{version:C.installedVersion}):t("system.upgrade.notEffective.notInstalled");r({title:t("system.upgrade.notEffective.title"),body:S})}}catch(C){d(C.message),r({title:t("system.upgrade.error.title"),body:C.message})}finally{o(!1)}}},k=async()=>{const N=f.data&&!f.data.upToDate?`npm i -g @coralai/sps-cli@${f.data.latest}`:m;try{await navigator.clipboard.writeText(N),r({title:t("system.upgrade.copy.success.title"),body:t("system.upgrade.copy.success.body",{cmd:N})})}catch{r({title:t("system.upgrade.copy.fail.title"),body:t("system.upgrade.copy.fail.body",{cmd:N})})}};return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:t("system.upgrade.title")}),c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px",fontSize:12},onClick:()=>f.refetch(),disabled:f.isFetching||!e,type:"button","aria-label":t("system.upgrade.checkLatest.aria"),children:[f.isFetching?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(ya,{size:12,strokeWidth:2.5}),t("system.upgrade.checkUpdate")]})]}),c.jsxs("dl",{className:"grid grid-cols-1 sm:grid-cols-[160px_1fr] gap-y-2 text-sm",children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.current")}),c.jsx("dd",{className:"font-[family-name:var(--font-mono)]",children:e??"—"}),f.data&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.latest")}),c.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2 flex-wrap",children:[f.data.latest,f.data.upToDate?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("system.upgrade.latestPill")}):c.jsxs(c.Fragment,{children:[c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"3px 10px",fontSize:11},onClick:b,disabled:a,type:"button","aria-label":t("system.upgrade.button.upgradeAria"),children:[a?c.jsx(Xe,{size:11,strokeWidth:3,className:"animate-spin"}):c.jsx(Uh,{size:11,strokeWidth:2.5}),t("system.upgrade.button.upgrade")]}),c.jsxs("button",{className:"nb-btn",style:{padding:"3px 10px",fontSize:11},onClick:k,type:"button","aria-label":t("system.upgrade.button.copyAria"),title:t("system.upgrade.button.copyTitle"),children:[c.jsx(KR,{size:11,strokeWidth:2.5})," ",t("system.upgrade.button.copy")]})]})]})]}),h&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.installed")}),c.jsxs("dd",{className:"font-[family-name:var(--font-mono)] flex items-center gap-2",children:[h,h===((v=f.data)==null?void 0:v.latest)?c.jsx("span",{className:"nb-status",style:{background:"var(--color-running-bg)",color:"var(--color-running)"},children:t("system.upgrade.installed.ok")}):h===e?c.jsx("span",{className:"nb-status",style:{background:"var(--color-stuck-bg)",color:"var(--color-stuck)"},children:t("system.upgrade.installed.fail")}):null]})]}),f.isError&&c.jsxs(c.Fragment,{children:[c.jsx("dt",{className:"font-bold",children:t("system.upgrade.label.check")}),c.jsx("dd",{className:"text-[var(--color-crashed)] text-xs",children:f.error instanceof Error?f.error.message:String(f.error)})]})]}),l&&c.jsx("pre",{className:"mt-3 text-xs font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-3 max-h-40 overflow-auto whitespace-pre-wrap",children:l})]})}function A8({onClose:e}){const t=Be(),n=Gt(),{alert:r}=un(),a=Ye({queryKey:["system-env-raw"],queryFn:D3}),[o,l]=j.useState(null),[d,f]=j.useState(null);j.useEffect(()=>{a.data&&o===null&&(l(a.data.content),f(a.data.etag))},[a.data,o]);const h=o!==null&&a.data&&o!==a.data.content,g=Ct({mutationFn:()=>{if(o===null)throw new Error("no draft");return O3(o,d??"")},onSuccess:()=>{n.invalidateQueries({queryKey:["system-env"]}),n.invalidateQueries({queryKey:["system-env-raw"]}),e()},onError:m=>{const y=m.status;r({title:t(y===409?"system.env.error.conflict.title":"system.env.error.save.title"),body:y===409?t("system.env.error.conflict.body"):m instanceof Error?m.message:String(m)})}});return a.isLoading?c.jsx("p",{className:"text-[var(--color-text-muted)]",children:t("common.loading")}):c.jsxs("div",{children:[c.jsx("p",{className:"text-xs text-[var(--color-stuck)] font-bold mb-2",children:t("system.env.warning")}),c.jsx("textarea",{className:"nb-input w-full font-[family-name:var(--font-mono)] text-xs",style:{minHeight:320,resize:"vertical"},value:o??"",onChange:m=>l(m.target.value),spellCheck:!1,"aria-label":t("system.env.aria")}),c.jsxs("div",{className:"flex items-center justify-between mt-3",children:[c.jsxs("span",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[d?`etag: ${d}`:"",h?t("system.env.dirtyMark"):""]}),c.jsxs("div",{className:"flex gap-2",children:[c.jsxs("button",{className:"nb-btn",style:{padding:"6px 12px"},onClick:e,disabled:g.isPending,type:"button",children:[c.jsx(Sn,{size:12,strokeWidth:3})," ",t("system.env.cancel")]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px"},onClick:()=>g.mutate(),disabled:!h||g.isPending,type:"button","aria-label":t("system.env.save.aria"),children:[g.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Ri,{size:12,strokeWidth:3}),t("system.env.save")]})]})]})]})}function T8(){var y;const e=Be(),{alert:t}=un(),n=Ye({queryKey:["projects"],queryFn:Es}),[r,a]=j.useState({}),[o,l]=j.useState({}),[d,f]=j.useState({}),h=(((y=n.data)==null?void 0:y.data)??[]).map(b=>({project:b.name})),g=async(b,k)=>{l(v=>({...v,[b]:k?"fix":"check"}));try{const v=await B3(b,k);a(N=>({...N,[b]:v})),f(N=>({...N,[b]:!0}))}catch(v){t({title:e(k?"system.diagnostics.error.fix":"system.diagnostics.error.check"),body:v instanceof Error?v.message:String(v)})}finally{l(v=>({...v,[b]:null}))}},m=async()=>{for(const b of h)await g(b.project,!1)};return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center justify-between mb-3",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:e("system.diagnostics.title")}),c.jsxs("button",{className:"nb-btn nb-btn-mint",style:{padding:"6px 12px",fontSize:12},onClick:()=>{m()},disabled:h.length===0||Object.values(o).some(Boolean),type:"button",children:[c.jsx(ya,{size:12,strokeWidth:2.5}),e("system.diagnostics.checkAll")]})]}),h.length===0?c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:e("system.diagnostics.empty")}):c.jsx("ul",{className:"flex flex-col gap-2",children:h.map(b=>{const k=r[b.project],v=o[b.project],N=k?k.checks.filter(_=>_.status==="fail").length:0,E=k?k.checks.filter(_=>_.status==="warn").length:0,C=d[b.project]??!1,S=k!=null;return c.jsxs("li",{className:"bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg",children:[c.jsxs("div",{className:"flex items-center gap-3 px-3 py-2",children:[c.jsxs("button",{type:"button",onClick:()=>f(_=>({..._,[b.project]:!C})),disabled:!S,className:"flex items-center gap-2 flex-1 text-left min-w-0","aria-label":e(C?"system.diagnostics.collapseAria":"system.diagnostics.expandAria"),children:[S&&k.ok?c.jsx(fh,{size:16,className:"text-[var(--color-running)] shrink-0",strokeWidth:2.5}):S?c.jsx(ku,{size:16,className:"text-[var(--color-stuck)] shrink-0",strokeWidth:2.5}):c.jsx(fh,{size:16,className:"text-[var(--color-text-subtle)] shrink-0",strokeWidth:2.5}),S&&(C?c.jsx(Vu,{size:12}):c.jsx(Zl,{size:12})),c.jsx("span",{className:"font-bold font-[family-name:var(--font-mono)]",children:b.project}),S?k.ok?c.jsx("span",{className:"text-xs text-[var(--color-running)] font-semibold",children:"OK"}):c.jsxs("span",{className:"text-xs text-[var(--color-stuck)] font-semibold",children:[N," fail · ",E," warn"]}):c.jsx("span",{className:"text-xs text-[var(--color-text-muted)]",children:e("system.diagnostics.never")})]}),c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:11},onClick:()=>{g(b.project,!1)},disabled:!!v,type:"button","aria-label":e("system.diagnostics.checkAria"),children:[v==="check"?c.jsx(Xe,{size:11,strokeWidth:3,className:"animate-spin"}):c.jsx(ya,{size:11,strokeWidth:2.5}),e("system.diagnostics.check")]}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 10px",fontSize:11},onClick:()=>{g(b.project,!0)},disabled:!!v||S&&k.ok,type:"button","aria-label":e("system.diagnostics.fixAria"),title:S&&k.ok?e("system.diagnostics.noFixesNeeded"):e("system.diagnostics.fix.tip"),children:[v==="fix"?c.jsx(Xe,{size:11,strokeWidth:3,className:"animate-spin"}):c.jsx(r_,{size:11,strokeWidth:2.5}),e("system.diagnostics.fix")]})]}),C&&S&&c.jsxs("div",{className:"border-t-2 border-dashed border-[var(--color-text)] px-3 py-2",children:[c.jsx("ul",{className:"flex flex-col gap-1 text-xs font-[family-name:var(--font-mono)]",children:k.checks.map((_,M)=>c.jsx(M8,{check:_},`${_.name}-${M}`))}),k.fixes.length>0&&c.jsxs("div",{className:"mt-3 bg-[var(--color-running-bg)] border-2 border-[var(--color-running)] rounded p-2",children:[c.jsx("div",{className:"text-xs font-bold text-[var(--color-running)] mb-1",children:e("system.diagnostics.fixed")}),c.jsx("ul",{className:"text-xs list-disc pl-4",children:k.fixes.map((_,M)=>c.jsx("li",{children:_},M))})]})]})]},b.project)})})]})}function M8({check:e}){const t=e.status==="pass"?c.jsx(fh,{size:12,className:"text-[var(--color-running)]",strokeWidth:2.5}):e.status==="fail"?c.jsx(ku,{size:12,className:"text-[var(--color-crashed)]",strokeWidth:2.5}):e.status==="warn"?c.jsx(ku,{size:12,className:"text-[var(--color-stuck)]",strokeWidth:2.5}):c.jsx("span",{className:"w-3 h-3 rounded-full bg-[var(--color-text-subtle)] inline-block"});return c.jsxs("li",{className:"flex items-start gap-2",children:[c.jsx("span",{className:"pt-0.5 shrink-0",children:t}),c.jsx("span",{className:"font-bold w-32 shrink-0",children:e.name}),c.jsx("span",{className:"text-[var(--color-text-muted)] break-words",children:e.message})]})}function D8(e){const t=Math.floor(e/1e3),n=Math.floor(t/3600),r=Math.floor(t%3600/60),a=t%60;return n>0?`${n}h ${r}m ${a}s`:r>0?`${r}m ${a}s`:`${a}s`}function O8(){return ft("/api/chat/sessions")}function R8(e){return ft(`/api/chat/sessions/${e}`)}async function oy(e={}){const t=await fetch("/api/chat/sessions",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify(e)});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return await t.json()}async function L8(e){const t=await fetch(`/api/chat/sessions/${e}`,{method:"DELETE"});if(!t.ok)throw new Error(`${t.status}`)}async function I8(e,t,n){const r=await fetch(`/api/chat/sessions/${e}/messages`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({content:t,attachments:n})});if(!r.ok)throw new Error(`${r.status}: ${await r.text()}`);return await r.json()}async function z8(e){const t=await fetch(`/api/chat/sessions/${e}/interrupt`,{method:"POST"});if(!t.ok&&t.status!==204)throw new Error(`${t.status}: ${await t.text()}`)}function P8(e,t){const n=t?`?since=${encodeURIComponent(t)}`:"";return ft(`/api/chat/sessions/${e}/messages${n}`)}function B8({onInsert:e,disabled:t,className:n="nb-btn"}){var m;const r=Be(),[a,o]=j.useState(!1),[l,d]=j.useState(""),h=((m=Ye({queryKey:["prompts",l],queryFn:()=>Hj(l||void 0),enabled:a}).data)==null?void 0:m.data)??[],g=async y=>{try{const b=await Ix(y);e(b.body)}finally{o(!1),d("")}};return c.jsxs("div",{className:"relative flex-shrink-0",children:[c.jsx("button",{type:"button",className:n,onClick:()=>o(y=>!y),disabled:t,"aria-label":r("prompts.insert"),title:r("prompts.insert"),children:c.jsx(QN,{size:15,strokeWidth:2.5})}),a&&c.jsxs("div",{className:"absolute bottom-full mb-2 left-0 z-20 w-72 nb-card max-h-80 overflow-auto flex flex-col gap-1",children:[c.jsxs("label",{className:"flex items-center gap-2 border-2 border-[var(--color-text)] rounded px-2 py-1",children:[c.jsx(ho,{size:12}),c.jsx("input",{autoFocus:!0,value:l,onChange:y=>d(y.target.value),placeholder:r("prompts.search"),className:"bg-transparent outline-none flex-1 text-sm","aria-label":r("prompts.search")})]}),h.length===0?c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] px-1 py-2",children:r("prompts.empty")}):h.map(y=>c.jsxs("button",{type:"button",onClick:()=>void g(y.name),className:"text-left px-2 py-1 rounded hover:bg-[var(--color-bg-cream)]",children:[c.jsx("code",{className:"font-[family-name:var(--font-mono)] text-sm font-bold",children:y.name}),y.description&&c.jsx("span",{className:"block text-xs text-[var(--color-text-muted)] truncate",children:y.description})]},y.name))]})]})}function ME(){var Te,Oe,De,ce,Ce,te,pe,Fe,ze;const e=Be(),{sessionId:t}=Mb(),n=ks(),r=Gt(),{confirm:a,alert:o}=un(),l=Ye({queryKey:["chat-sessions"],queryFn:O8,refetchInterval:5e3}),d=Ye({queryKey:["chat-session",t],queryFn:()=>R8(t??""),enabled:!!t,refetchInterval:4e3}),[f,h]=j.useState(null),g=ae=>`chat-draft:${ae??""}`,[m,y]=j.useState(()=>localStorage.getItem(g(t))??""),b=j.useCallback(ae=>{y(be=>{const ye=typeof ae=="function"?ae(be):ae;try{t&&localStorage.setItem(g(t),ye)}catch{}return ye})},[t]);j.useEffect(()=>{y(localStorage.getItem(g(t))??"")},[t]);const[k,v]=j.useState(!1),N=j.useRef(null),E=j.useRef(!0),[C,S]=j.useState(!1),_=()=>{const ae=N.current;return!ae||ae.scrollHeight-ae.scrollTop-ae.clientHeight<40},M=j.useCallback(()=>{const ae=N.current;ae&&(ae.scrollTop=ae.scrollHeight),E.current=!0,S(!1)},[]),T=j.useCallback(()=>{const ae=_();E.current=ae,S(!ae)},[]),L=j.useRef(null);j.useEffect(()=>{const ae=L.current;ae&&(ae.style.height="auto",ae.style.height=`${Math.min(ae.scrollHeight,200)}px`,ae.scrollTop=ae.scrollHeight)},[m]);const R="w-8 h-8 flex items-center justify-center rounded-lg border-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] hover:-translate-x-px hover:-translate-y-px hover:shadow-[2px_2px_0_var(--color-text)] transition-transform disabled:opacity-50 disabled:hover:translate-x-0 disabled:hover:translate-y-0 disabled:hover:shadow-none",[$,z]=j.useState(!1),[q,F]=j.useState([]),[Y,D]=j.useState(!1),[H,O]=j.useState(!1),[V,Q]=j.useState(!1),[K,I]=j.useState(null),[P,G]=j.useState(!1);j.useEffect(()=>{if(!t)return;const ae=new EventSource(`/stream/chat/${encodeURIComponent(t)}`);let be=!0;return ae.addEventListener("open",()=>{if(be){be=!1;return}const ye=r.getQueryData(["chat-session",t]),he=ye!=null&&ye.messages.length?ye.messages[ye.messages.length-1].ts:void 0;P8(t,he).then(Ee=>{Ee.data.length!==0&&r.setQueryData(["chat-session",t],Ne=>{if(!Ne)return Ne;const Ke=new Set(Ne.messages.map(de=>de.id)),ne=Ee.data.filter(de=>!Ke.has(de.id));return ne.length===0?Ne:{...Ne,messages:[...Ne.messages,...ne],lastMessageAt:ne[ne.length-1].ts,messageCount:Ne.messageCount+ne.length}})}).catch(()=>{})}),ae.addEventListener("chat.message",ye=>{try{const he=JSON.parse(ye.data);r.setQueryData(["chat-session",t],Ee=>{if(!Ee||Ee.messages.some(ne=>ne.id===he.message.id))return Ee;const Ke=Ee.messages.findIndex(ne=>ne.role==="user"&&ne.id.startsWith("optim-")&&ne.content===he.message.content);if(Ke>=0){const ne=[...Ee.messages];return ne[Ke]=he.message,{...Ee,messages:ne}}return{...Ee,messages:[...Ee.messages,he.message]}})}catch{}}),ae.addEventListener("chat.message.pending",ye=>{try{const he=JSON.parse(ye.data);h({sessionId:t,id:he.assistantId,blocks:[],done:!1,finalMessage:null})}catch{}}),ae.addEventListener("chat.message.snapshot",ye=>{try{const he=JSON.parse(ye.data);h({sessionId:t,id:he.assistantId,blocks:he.blocks.map(Ee=>Ee.type==="text"?{type:"text",target:Ee.text,displayed:Ee.text}:{type:"tool_use",id:Ee.id,title:Ee.title,kind:Ee.kind,status:Ee.status,input:Ee.input,locations:Ee.locations}),done:!1,finalMessage:null})}catch{}}),ae.addEventListener("chat.message.chunk.text",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>{if(!Ee||Ee.id!==he.assistantId)return Ee;const Ne=[...Ee.blocks],Ke=Ne[Ne.length-1];return Ke&&Ke.type==="text"?Ne[Ne.length-1]={...Ke,target:Ke.target+he.text}:Ne.push({type:"text",target:he.text,displayed:""}),{...Ee,blocks:Ne}})}catch{}}),ae.addEventListener("chat.message.chunk.tool_use",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>!Ee||Ee.id!==he.assistantId?Ee:{...Ee,blocks:[...Ee.blocks,{type:"tool_use",id:he.id,title:he.title,kind:he.kind,status:he.status,input:he.input,locations:he.locations}]})}catch{}}),ae.addEventListener("chat.message.chunk.tool_update",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>!Ee||Ee.id!==he.assistantId?Ee:{...Ee,blocks:Ee.blocks.map(Ne=>Ne.type==="tool_use"&&Ne.id===he.id?{...Ne,status:he.status,input:Ne.input??he.input,locations:Ne.locations??he.locations}:Ne)})}catch{}}),ae.addEventListener("chat.message.complete",ye=>{try{const he=JSON.parse(ye.data);h(Ee=>Ee&&Ee.id===he.assistantId?{...Ee,done:!0,finalMessage:he.message}:Ee)}catch{}}),ae.addEventListener("chat.message.error",ye=>{try{const he=JSON.parse(ye.data);h(Ne=>Ne&&Ne.sessionId===t&&(!he.assistantId||Ne.id===he.assistantId||Ne.id===he.turnId)?null:Ne),v(!1);const Ee=he.message;Ee&&r.setQueryData(["chat-session",t],Ne=>!Ne||Ne.messages.some(Ke=>Ke.id===Ee.id)?Ne:{...Ne,messages:[...Ne.messages,Ee],lastMessageAt:Ee.ts,messageCount:Ne.messageCount+1})}catch{}}),()=>ae.close()},[t,r]),j.useEffect(()=>{if(!f||f.sessionId!==t)return;const ae=f.blocks.reduce((ye,he)=>he.type==="text"?ye+(he.target.length-he.displayed.length):ye,0);if(ae<=0){if(f.done&&f.finalMessage){const ye=f.finalMessage;r.setQueryData(["chat-session",t],he=>!he||he.messages.some(Ee=>Ee.id===ye.id)?he:{...he,messages:[...he.messages,ye],lastMessageAt:ye.ts,messageCount:he.messageCount+1}),r.invalidateQueries({queryKey:["chat-sessions"]}),r.invalidateQueries({queryKey:["chat-session",t]}),h(null),v(!1)}return}const be=setTimeout(()=>{h(ye=>{if(!ye)return ye;let he=Math.max(1,Math.ceil(ae/40));const Ee=ye.blocks.map(Ne=>{if(Ne.type!=="text"||he<=0)return Ne;const Ke=Ne.target.length-Ne.displayed.length;if(Ke<=0)return Ne;const ne=Math.min(Ke,he);return he-=ne,{...Ne,displayed:Ne.target.slice(0,Ne.displayed.length+ne)}});return{...ye,blocks:Ee}})},25);return()=>clearTimeout(be)},[f,r,t]),j.useEffect(()=>{if(E.current){const ae=N.current;ae&&(ae.scrollTop=ae.scrollHeight)}},[d.data,f]),j.useEffect(()=>{E.current=!0,S(!1),v(!1)},[t]);const B=j.useCallback(async(ae={})=>{var be,ye;try{const he=await oy({cwd:((be=ae.cwd)==null?void 0:be.trim())||void 0,title:((ye=ae.title)==null?void 0:ye.trim())||void 0,agentKind:ae.agentKind,model:ae.model,providerId:ae.providerId});r.invalidateQueries({queryKey:["chat-sessions"]}),n(`/chat/${he.id}`),z(!1)}catch(he){o({title:e("chat.error.create.title"),body:he instanceof Error?he.message:String(he)})}},[r,n,o,e]),oe=j.useCallback(async()=>{const ae=m.trim();if(!ae&&q.length===0||k)return;let be=t;if(!be){const Ee=await oy();r.invalidateQueries({queryKey:["chat-sessions"]}),be=Ee.id,n(`/chat/${be}`,{replace:!0})}E.current=!0,S(!1);const ye=q.map(Ee=>Ee.path),he={id:`optim-${Date.now()}`,role:"user",content:ae||e("chat.placeholder.attachment"),ts:new Date().toISOString(),status:"complete",attachments:ye.length>0?ye:void 0};r.setQueryData(["chat-session",be],Ee=>Ee?{...Ee,messages:[...Ee.messages,he],lastMessageAt:he.ts,messageCount:Ee.messageCount+1}:{id:be,createdAt:he.ts,lastMessageAt:he.ts,title:ae.slice(0,60)||e("chat.placeholder.attachmentTitle"),project:null,messageCount:1,messages:[he]}),b(""),F([]),v(!0);try{await I8(be,ae||e("chat.placeholder.viewAttachment"),ye.length>0?ye:void 0)}catch(Ee){v(!1),console.error("sendMessage failed",Ee),o({title:e("chat.error.send.title"),body:Ee instanceof Error?Ee.message:String(Ee)})}},[m,q,k,t,r,n,o,e]),ve=j.useCallback(async ae=>{if(ae.size>d2){o({title:e("chat.error.fileTooBig.title"),body:e("chat.error.fileTooBig.body",{size:(ae.size/1024/1024).toFixed(2),name:ae.name})});return}let be=t;if(!be){const ye=await oy();r.invalidateQueries({queryKey:["chat-sessions"]}),be=ye.id,n(`/chat/${be}`,{replace:!0})}D(!0);try{const ye=await i4(be,ae);F(he=>[...he,{path:ye.path,name:ye.name}])}catch(ye){o({title:e("chat.error.uploadAttachment.title"),body:ye instanceof Error?ye.message:String(ye)})}finally{D(!1)}},[t,r,n,o,e]),ke=j.useCallback(ae=>{F(be=>be.filter(ye=>ye.path!==ae))},[]),Se=j.useCallback(async(ae,be)=>{await a({title:e("chat.delete.confirm.title"),body:e(be==="cli"?"chat.delete.confirm.body.cli":"chat.delete.confirm.body.console"),confirm:e("chat.delete.confirm.button"),danger:!0})&&(await L8(ae),r.invalidateQueries({queryKey:["chat-sessions"]}),t===ae&&n("/chat"))},[r,t,n,a,e]),J=j.useCallback(async()=>{if(t)try{await z8(t)}catch(ae){o({title:e("chat.error.interrupt.title"),body:ae instanceof Error?ae.message:String(ae)})}},[t,o,e]),ue=f&&f.sessionId===t?f:null;return c.jsxs("div",{className:"grid grid-cols-[260px_1fr] gap-4 h-[calc(100vh-140px)]",children:[c.jsxs("aside",{className:"nb-card p-3 overflow-auto flex flex-col gap-2",children:[c.jsxs("button",{className:"nb-btn nb-btn-primary w-full justify-center",onClick:()=>z(!0),type:"button",children:[c.jsx(pr,{size:14,strokeWidth:3}),e("chat.list.new")]}),c.jsx("div",{className:"mt-2 text-xs font-[family-name:var(--font-heading)] uppercase tracking-wider text-[var(--color-text-muted)] px-2",children:e("chat.list.heading",{count:((Te=l.data)==null?void 0:Te.data.length)??0})}),c.jsx("div",{className:"flex flex-col gap-1.5 mt-1",children:(()=>{var ne;const ae=((ne=l.data)==null?void 0:ne.data)??[],be=Date.now(),ye=10080*60*1e3,he=de=>new Date(de.lastMessageAt??de.createdAt).getTime(),Ee=ae.filter(de=>be-he(de)<=ye),Ne=ae.filter(de=>be-he(de)>ye),Ke=de=>c.jsxs("div",{className:["group flex items-start gap-2 p-2 rounded-lg border-2 border-transparent",t===de.id?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[2px_2px_0_var(--color-text)]":"hover:bg-[var(--color-bg-cream)] hover:border-[var(--color-text)]"].join(" "),children:[c.jsxs("button",{type:"button","aria-label":e("chat.list.openAria",{title:de.title,cwd:de.cwd?e("chat.list.cwdSuffix",{cwd:de.cwd}):""}),onClick:()=>n(`/chat/${de.id}`),className:"flex items-start gap-2 flex-1 min-w-0 text-left",children:[c.jsx(uk,{size:14,strokeWidth:2.5,className:"mt-0.5 flex-shrink-0"}),c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-1.5 min-w-0",children:[c.jsx("p",{className:"text-sm font-semibold truncate flex-1",children:de.title}),de.source==="cli"&&c.jsx("span",{className:"flex-shrink-0 px-1.5 py-0 rounded-md bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] text-[9px] font-[family-name:var(--font-mono)] uppercase tracking-wider leading-tight",title:e("chat.cliBadge.tooltip"),children:e("chat.cliBadge")})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] truncate",children:e("chat.list.msgs",{count:de.messageCount,time:Yj(de.lastMessageAt??de.createdAt,e)})}),de.cwd&&c.jsxs("p",{className:"text-[10px] text-[var(--color-text-subtle)] font-[family-name:var(--font-mono)] truncate flex items-center gap-1",title:de.cwd,children:[c.jsx(ph,{size:9,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",dir:"rtl",children:de.cwd})]})]})]}),c.jsx("button",{type:"button","aria-label":de.source==="cli"?e("chat.list.deleteCli.aria"):e("chat.list.delete.aria"),className:"opacity-0 group-hover:opacity-100 p-1 hover:text-[var(--color-crashed)]",onClick:Le=>{Le.stopPropagation(),Se(de.id,de.source)},children:c.jsx(fi,{size:12})})]},de.id);return c.jsxs(c.Fragment,{children:[Ee.map(Ke),Ne.length>0&&c.jsxs(c.Fragment,{children:[c.jsxs("button",{type:"button",onClick:()=>G(de=>!de),"aria-expanded":P,className:"flex items-center gap-1 px-2 py-1 mt-1 rounded-lg text-xs font-semibold text-[var(--color-text-muted)] hover:text-[var(--color-text)] hover:bg-[var(--color-bg-cream)] focus-visible:outline focus-visible:outline-2",children:[P?c.jsx(Vu,{size:12,strokeWidth:2.5}):c.jsx(Zl,{size:12,strokeWidth:2.5}),e("chat.list.olderToggle",{count:Ne.length})]}),P&&Ne.map(Ke)]}),ae.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic text-center py-4",children:e("chat.list.empty")})]})})()})]}),c.jsx("div",{className:"nb-card p-0 flex flex-col overflow-hidden",children:t?c.jsxs(c.Fragment,{children:[c.jsxs("header",{className:"px-4 py-3 border-b-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[c.jsxs("div",{className:"flex items-center gap-2 flex-wrap",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:((Oe=d.data)==null?void 0:Oe.title)??e("common.loading")}),((De=d.data)==null?void 0:De.model)&&c.jsxs("span",{className:"inline-flex items-center gap-1 px-2 py-0.5 rounded-md bg-[var(--color-accent-yellow)] border-2 border-[var(--color-text)] text-[10px] font-[family-name:var(--font-mono)] font-bold uppercase tracking-wider",title:e("chat.detail.model.tooltip"),children:[c.jsx(hh,{size:11,strokeWidth:2.5})," ",d.data.model]})]}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:t}),((ce=d.data)==null?void 0:ce.claudeSessionId)&&c.jsxs("p",{className:"text-xs text-[var(--color-text-subtle)] font-[family-name:var(--font-mono)] truncate",title:e("chat.detail.claudeSession.tooltip"),children:["claude: ",d.data.claudeSessionId]}),((Ce=d.data)==null?void 0:Ce.cwd)&&c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] flex items-center gap-1 mt-1",title:d.data.cwd,children:[c.jsx(ph,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate",children:d.data.cwd})]})]}),c.jsxs("div",{className:"relative flex-1 flex flex-col min-h-0",children:[c.jsxs("div",{ref:N,onScroll:T,className:"flex-1 overflow-auto p-4 flex flex-col gap-4",children:[(((te=d.data)==null?void 0:te.messages)??[]).filter(ae=>!(ue&&ae.status==="streaming")).map(ae=>c.jsx(F8,{msg:ae,sessionId:t??null,onPreviewAttachment:be=>I(be)},ae.id)),ue&&c.jsx(H8,{pending:ue}),!d.isLoading&&(((pe=d.data)==null?void 0:pe.messages)??[]).length===0&&!ue&&!k&&c.jsx("p",{className:"text-center text-[var(--color-text-subtle)] italic mt-12",children:e("chat.session.empty")})]}),C&&c.jsx("button",{type:"button",onClick:M,className:"absolute bottom-3 right-4 z-10 w-9 h-9 flex items-center justify-center rounded-full border-2 border-[var(--color-text)] bg-white shadow-[2px_2px_0_var(--color-text)] hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)] active:translate-y-px active:shadow-none transition-transform","aria-label":"滚动到底部",title:"↓ 回到底部",children:c.jsx(_R,{size:18,strokeWidth:3})})]}),((Fe=d.data)==null?void 0:Fe.source)==="cli"?c.jsxs("div",{className:"border-t-2 border-[var(--color-text)] p-4 bg-[var(--color-accent-purple)]",children:[c.jsxs("p",{className:"text-sm font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] text-center",children:[c.jsx("strong",{children:e("chat.cli.banner.bold")})," — ",e("chat.cli.banner")]}),c.jsxs("pre",{className:"mt-2 px-3 py-2 bg-[var(--color-bg)] border-2 border-[var(--color-text)] rounded-md text-xs font-[family-name:var(--font-mono)] overflow-x-auto",children:["sps agent --chat --name ",(t??"").replace(/^session-/,"")]})]}):c.jsxs("div",{className:["border-t-2 border-[var(--color-text)] p-3 bg-[var(--color-bg-cream)] transition-colors",V?"bg-[var(--color-accent-mint)]":""].join(" "),onDragOver:ae=>{ae.dataTransfer.types.includes("Files")&&(ae.preventDefault(),ae.dataTransfer.dropEffect="copy",V||Q(!0))},onDragLeave:()=>Q(!1),onDrop:ae=>{if(!ae.dataTransfer.types.includes("Files"))return;ae.preventDefault(),Q(!1);const be=Array.from(ae.dataTransfer.files??[]);for(const ye of be)ve(ye)},children:[(q.length>0||Y)&&c.jsxs("div",{className:"flex flex-wrap gap-2 mb-2",children:[q.map(ae=>c.jsxs("button",{type:"button",className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-[var(--color-bg)] border-2 border-[var(--color-text)] text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-mint)] group",onClick:()=>I(ae.path),title:e("chat.attachment.previewTooltip",{name:ae.name,path:ae.path}),children:[Nh(ae.path)?c.jsx(wL,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}):c.jsx(Fh,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[180px]",children:ae.name}),c.jsx("span",{role:"button","aria-label":e("chat.input.removeAttachment",{name:ae.name}),className:"ml-1 hover:text-[var(--color-crashed)] cursor-pointer",onClick:be=>{be.stopPropagation(),ke(ae.path)},children:c.jsx(Sn,{size:11,strokeWidth:3})})]},ae.path)),Y&&c.jsxs("span",{className:"flex items-center gap-1.5 px-2 py-1 text-xs text-[var(--color-text-muted)] font-[family-name:var(--font-mono)]",children:[c.jsx(Xe,{size:11,strokeWidth:2.5,className:"animate-spin"}),e("chat.input.uploading")]})]}),c.jsxs("div",{className:"flex flex-col gap-2 rounded-2xl border-[3px] border-[var(--color-text)] bg-white px-3 py-2 shadow-[3px_3px_0_var(--color-text)] focus-within:shadow-[4px_4px_0_var(--color-text)] transition-shadow",children:[c.jsx("textarea",{ref:L,className:"w-full resize-none border-0 bg-transparent outline-none text-sm leading-relaxed max-h-[200px] px-1 pt-1",placeholder:e(V?"chat.input.dragOver":"chat.input.placeholder"),rows:1,value:m,onChange:ae=>b(ae.target.value),onKeyDown:ae=>{ae.key==="Enter"&&!ae.shiftKey&&!ae.nativeEvent.isComposing&&(ae.preventDefault(),oe())},onPaste:ae=>{const ye=Array.from(ae.clipboardData.items??[]).filter(he=>he.kind==="file"&&he.type.startsWith("image/"));if(ye.length!==0){ae.preventDefault();for(const he of ye){const Ee=he.getAsFile();Ee&&ve(Ee)}}},"aria-label":e("chat.input.aria")}),c.jsxs("div",{className:"flex items-center gap-1.5",children:[c.jsx("button",{type:"button",className:R,onClick:()=>O(!0),disabled:k,"aria-label":e("chat.input.attach.aria"),title:e("chat.input.attach.title"),children:c.jsx(LL,{size:15,strokeWidth:2.5})}),c.jsx(B8,{className:R,disabled:k,onInsert:ae=>b(be=>be.trim()?`${be}
|
|
646
|
-
${ae}`:ae)}),c.jsx("div",{className:"flex-1"}),ue?c.jsx("button",{className:"w-9 h-9 flex items-center justify-center rounded-full border-2 border-[var(--color-text)] bg-[var(--color-crashed)] text-white shadow-[2px_2px_0_var(--color-text)] hover:-translate-x-px hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)] active:translate-x-px active:translate-y-px active:shadow-none transition-transform",onClick:J,type:"button","aria-label":e("chat.input.interrupt.aria"),title:e("chat.input.interrupt"),children:c.jsx($b,{size:14,strokeWidth:3})}):c.jsx("button",{className:"w-9 h-9 flex items-center justify-center rounded-full border-2 border-[var(--color-text)] bg-[var(--color-cta)] text-white shadow-[2px_2px_0_var(--color-text)] hover:-translate-x-px hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)] active:translate-x-px active:translate-y-px active:shadow-none transition-transform disabled:opacity-40 disabled:cursor-not-allowed disabled:hover:translate-x-0 disabled:hover:translate-y-0 disabled:hover:shadow-[2px_2px_0_var(--color-text)]",onClick:oe,disabled:!m.trim()&&q.length===0||k,type:"button","aria-label":e("chat.input.send.aria"),title:e("chat.input.send"),children:k?c.jsx(Xe,{size:16,strokeWidth:3,className:"animate-spin"}):c.jsx(FN,{size:18,strokeWidth:3})})]})]})]})]}):c.jsx("div",{className:"flex-1 flex items-center justify-center p-8",children:c.jsxs("div",{className:"text-center max-w-md",children:[c.jsx("div",{className:"w-20 h-20 rounded-2xl bg-[var(--color-accent-mint)] border-[3px] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)] flex items-center justify-center mx-auto mb-4",children:c.jsx(uk,{size:32,strokeWidth:2.5})}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold mb-2",children:e("chat.empty.title")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mb-4",children:e("chat.empty.hint")}),c.jsx("p",{className:"text-xs text-[var(--color-text-subtle)] italic",children:e("chat.empty.shortcuts")})]})})}),$&&c.jsx(U8,{onCancel:()=>z(!1),onCreate:ae=>B(ae)}),H&&c.jsx(cx,{mode:"file",title:e("chat.filePicker.title"),initialPath:((ze=d.data)==null?void 0:ze.cwd)??void 0,onCancel:()=>O(!1),onSelect:ae=>{F(be=>{if(be.some(he=>he.path===ae))return be;const ye=ae.split(/[\\/]/).pop()||ae;return[...be,{path:ae,name:ye}]}),O(!1)}}),K&&t&&c.jsx($8,{sessionId:t,path:K,onClose:()=>I(null)})]})}function Nh(e){return/\.(png|jpe?g|gif|webp|svg|avif)$/i.test(e)}function DE(e){return/\.pdf$/i.test(e)}function ly(e){return/\.(txt|md|log|json|yaml|yml|csv|html|xml|tsx?|jsx?|css|sh|ya?ml|conf|toml|ini|env|gitignore|sql|py|rb|go|rs|java|kt|swift|c|cc|cpp|h|hpp)$/i.test(e)}function $8({sessionId:e,path:t,onClose:n}){const r=Be(),[a,o]=j.useState(null),[l,d]=j.useState(null);j.useEffect(()=>{const g=m=>{m.key==="Escape"&&(m.preventDefault(),n())};return window.addEventListener("keydown",g),()=>window.removeEventListener("keydown",g)},[n]),j.useEffect(()=>{if(!ly(t))return;let g=!1;return fetch(Yy(e,t)).then(async m=>{if(!m.ok)throw new Error(`${m.status}`);return m.text()}).then(m=>{g||o(m.length>2e5?m.slice(0,2e5)+`
|
|
647
|
-
|
|
648
|
-
…(truncated)`:m)}).catch(m=>{g||d(m instanceof Error?m.message:String(m))}),()=>{g=!0}},[e,t]);const f=Yy(e,t),h=t.split(/[\\/]/).pop()??t;return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-[rgba(45,55,72,0.6)] p-4",role:"presentation",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-3xl w-full p-5 flex flex-col",style:{maxHeight:"85vh"},role:"dialog","aria-modal":"true","aria-label":r("chat.attachment.preview.aria",{name:h}),children:[c.jsxs("header",{className:"flex items-center justify-between mb-3 shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[c.jsx(XR,{size:16,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("h3",{className:"font-[family-name:var(--font-heading)] font-bold text-base truncate",children:h})]}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded flex-shrink-0",onClick:n,"aria-label":r("chat.attachment.close.aria"),children:c.jsx(Sn,{size:16,strokeWidth:3})})]}),c.jsx("p",{className:"text-[10px] text-[var(--color-text-muted)] font-[family-name:var(--font-mono)] truncate mb-2 shrink-0",title:t,dir:"rtl",children:t}),c.jsxs("div",{className:"flex-1 overflow-auto border-2 border-[var(--color-text)] rounded-lg bg-[var(--color-bg-cream)] min-h-0",children:[Nh(t)&&c.jsx("div",{className:"flex items-center justify-center p-4",children:c.jsx("img",{src:f,alt:`Preview: ${h}`,className:"max-w-full max-h-[60vh] object-contain"})}),DE(t)&&c.jsx("iframe",{src:f,title:`PDF: ${h}`,className:"w-full",style:{height:"60vh",border:0}}),ly(t)&&c.jsx("pre",{className:"p-3 text-xs font-[family-name:var(--font-mono)] whitespace-pre-wrap break-words",children:l?c.jsx("span",{className:"text-[var(--color-crashed)]",children:r("chat.attachment.readErr",{detail:l})}):a===null?c.jsx("span",{className:"text-[var(--color-text-muted)]",children:r("chat.attachment.loading")}):a}),!Nh(t)&&!DE(t)&&!ly(t)&&c.jsxs("div",{className:"p-6 text-center text-sm text-[var(--color-text-muted)]",children:[c.jsx("p",{className:"mb-3",children:r("chat.attachment.unsupported")}),c.jsx("a",{href:f,download:h,className:"nb-btn nb-btn-primary inline-flex",children:r("chat.attachment.download")})]})]})]})})}function U8({onCancel:e,onCreate:t}){var S;const n=Be(),[r,a]=j.useState(""),[o,l]=j.useState(""),[d,f]=j.useState(""),[h,g]=j.useState(!1),[m,y]=j.useState(!1),[b,k]=j.useState(!1),v=Ye({queryKey:["providers"],queryFn:lx}),N=Ye({queryKey:["system-agents"],queryFn:Hb}),E=c2(((S=v.data)==null?void 0:S.anthropic)??[]);j.useEffect(()=>{var T;if(h)return;const _=(T=N.data)==null?void 0:T.agents.worker;if(!_)return;const M=`${_.providerId||"official"}::${_.model}`;E.some(L=>`${L.providerId}::${L.model}`===M)&&f(M)},[N.data,E,h]),j.useEffect(()=>{if(b)return;const _=M=>{M.key==="Escape"&&(M.preventDefault(),e())};return window.addEventListener("keydown",_),()=>window.removeEventListener("keydown",_)},[e,b]);const C=async()=>{if(!m){y(!0);try{const[_,M]=d?d.split("::"):[void 0,void 0];t({title:r.trim()||void 0,cwd:o.trim()||void 0,agentKind:"claude",model:M,providerId:_})}finally{y(!1)}}};return c.jsxs("div",{className:"fixed inset-0 z-40 flex items-center justify-center bg-[rgba(45,55,72,0.4)] p-4",role:"presentation",children:[c.jsxs("div",{className:"nb-card bg-[var(--color-bg)] max-w-md w-full p-5",role:"dialog","aria-modal":"true","aria-label":n("chat.newSession.title.aria"),children:[c.jsxs("header",{className:"flex items-center justify-between mb-4",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:n("chat.newSession.title")}),c.jsx("button",{type:"button",className:"p-1 hover:bg-[var(--color-bg-cream)] rounded",onClick:e,"aria-label":n("chat.newSession.close.aria"),children:c.jsx(Sn,{size:16,strokeWidth:3})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-model",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.model")}),c.jsxs("select",{id:"new-session-model",className:"nb-input w-full font-[family-name:var(--font-mono)] text-sm",value:d,onChange:_=>{g(!0),f(_.target.value)},children:[c.jsx("option",{value:"",children:n("chat.newSession.field.model.default")}),E.map(_=>c.jsx("option",{value:`${_.providerId}::${_.model}`,children:_.label},`${_.providerId}::${_.model}`))]})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-title",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.title")}),c.jsx("input",{id:"new-session-title",type:"text",className:"nb-input w-full",placeholder:n("chat.newSession.field.title.placeholder"),value:r,onChange:_=>a(_.target.value),autoFocus:!0})]}),c.jsxs("div",{children:[c.jsx("label",{htmlFor:"new-session-cwd",className:"block text-xs font-bold mb-1.5 uppercase tracking-wider",children:n("chat.newSession.field.cwd")}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("input",{id:"new-session-cwd",type:"text",className:"nb-input flex-1 font-[family-name:var(--font-mono)] text-sm",placeholder:"/home/coral/projects/my-app",value:o,onChange:_=>l(_.target.value)}),c.jsxs("button",{type:"button",className:"nb-btn flex-shrink-0",onClick:()=>k(!0),"aria-label":n("chat.newSession.field.cwd.browseAria"),title:n("chat.newSession.field.cwd.browseAria"),children:[c.jsx(KN,{size:14,strokeWidth:2.5}),n("chat.newSession.field.cwd.browse")]})]}),c.jsxs("p",{className:"text-[11px] text-[var(--color-text-muted)] mt-1.5 leading-relaxed",children:[c.jsx(ph,{size:10,strokeWidth:2.5,className:"inline mr-1 -mt-0.5"}),n("chat.newSession.field.cwd.help1")," ",n("chat.newSession.field.cwd.help2")]})]}),c.jsxs("div",{className:"flex gap-2 justify-end pt-2",children:[c.jsx("button",{type:"button",className:"nb-btn",onClick:e,children:n("chat.newSession.cancel")}),c.jsxs("button",{type:"button",className:"nb-btn nb-btn-primary",onClick:C,disabled:m,children:[m?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(pr,{size:14,strokeWidth:3}),n("chat.newSession.create")]})]})]})]}),b&&c.jsx(cx,{initialPath:o.trim()||void 0,onCancel:()=>k(!1),onSelect:_=>{l(_),k(!1)}})]})}function F8({msg:e,sessionId:t,onPreviewAttachment:n}){const r=Be(),a=e.role==="user",o=e.role==="error",l=e.blocks&&e.blocks.length>0?e.blocks:[{type:"text",text:e.content}],d=e.attachments??[];return c.jsx("div",{className:a?"self-end max-w-3xl":"self-start max-w-3xl",children:c.jsxs("div",{className:["nb-card",a?"bg-[var(--color-secondary)]":o?"bg-[var(--color-crashed-bg)]":"bg-[var(--color-bg)]"].join(" "),children:[c.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:[r(a?"chat.message.role.you":o?"chat.message.role.error":"chat.message.role.assistant"),c.jsx("span",{className:"font-normal",children:"·"}),c.jsx("span",{className:"font-normal cursor-help",title:V8(e.ts),children:Yj(e.ts,r)})]}),c.jsx("div",{className:"flex flex-col gap-2",children:l.map((f,h)=>c.jsx(K8,{block:f},h))}),d.length>0&&t&&c.jsx("div",{className:"mt-3 pt-3 border-t-2 border-dashed border-[var(--color-text)]/30 flex flex-wrap gap-2",children:d.map(f=>c.jsx(q8,{sessionId:t,path:f,onPreview:()=>n(f)},f))}),e.truncated&&c.jsx("p",{className:"mt-3 px-3 py-2 bg-[var(--color-stuck-bg)] border-2 border-[var(--color-stuck)] rounded-lg text-xs text-[var(--color-stuck)] font-bold",children:r("chat.message.truncated")})]})})}function q8({sessionId:e,path:t,onPreview:n}){const r=Be(),a=t.split(/[\\/]/).pop()??t;return Nh(t)?c.jsx("button",{type:"button",onClick:n,className:"block rounded-md overflow-hidden border-2 border-[var(--color-text)] hover:shadow-[2px_2px_0_var(--color-text)] transition-shadow",title:r("chat.attachment.previewSimpleTooltip",{name:a}),children:c.jsx("img",{src:Yy(e,t),alt:a,className:"block max-h-40 max-w-[12rem] object-cover",loading:"lazy"})}):c.jsxs("button",{type:"button",onClick:n,className:"flex items-center gap-1.5 px-2 py-1 rounded-md bg-[var(--color-bg)] border-2 border-[var(--color-text)] text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-mint)]",title:r("chat.attachment.previewTooltip",{name:a,path:t}),children:[c.jsx(Fh,{size:11,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"truncate max-w-[200px]",children:a})]})}function H8({pending:e}){const t=(()=>{for(let n=e.blocks.length-1;n>=0;n--)if(e.blocks[n].type==="text")return n;return-1})();return c.jsx("div",{className:"self-start max-w-3xl",children:c.jsxs("div",{className:"nb-card bg-[var(--color-bg)]",children:[c.jsxs("p",{className:"text-xs font-bold uppercase tracking-wider text-[var(--color-text-muted)] mb-2 flex items-center gap-2",children:["assistant",c.jsx("span",{className:"font-normal",children:"·"}),c.jsxs("span",{className:"flex items-center gap-1 font-normal text-[var(--color-running)]",children:[c.jsx(Xe,{size:10,strokeWidth:3,className:"animate-spin"}),"streaming"]})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[e.blocks.length===0&&c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] italic",children:"…"}),e.blocks.map((n,r)=>{if(n.type==="text"){const a=r===t;return c.jsxs("div",{className:"relative",children:[c.jsx(Gj,{text:n.displayed}),a&&c.jsx("span",{className:"inline-block w-2 h-4 ml-1 bg-[var(--color-text)] animate-pulse align-middle"})]},r)}return c.jsx(Vj,{tool:n},r)})]})]})})}function K8({block:e}){return e.type==="text"?c.jsx(Gj,{text:e.text}):c.jsx(Vj,{tool:e})}function Gj({text:e}){return e?c.jsx("div",{className:"text-sm font-[family-name:var(--font-body)] break-words prose-chat",children:c.jsx(Cx,{remarkPlugins:[Dx],rehypePlugins:[Lx],children:e})}):null}function G8(e){if(e==null||typeof e!="object")return typeof e=="string"?e:"";const t=e,n=a=>typeof t[a]=="string"?t[a]:void 0;return n("file_path")??n("path")??n("notebook_path")??n("command")??n("pattern")??n("query")??n("url")??n("name")??n("description")??n("prompt")??Object.values(t).find(a=>typeof a=="string"&&a.trim())??""}function Vj({tool:e}){const[t,n]=j.useState(!1),r=e.status==="completed"||e.status==="complete",a=e.status==="failed",o=!r&&!a,l=G8(e.input),d=e.input!=null&&(typeof e.input!="object"||Object.keys(e.input).length>0);return c.jsxs("div",{className:"border-2 border-[var(--color-text)] rounded-lg overflow-hidden bg-[var(--color-bg-cream)]",children:[c.jsxs("button",{type:"button",onClick:()=>n(f=>!f),className:"w-full flex items-center gap-2 px-3 py-2 text-xs font-[family-name:var(--font-mono)] hover:bg-[var(--color-accent-yellow)] transition-colors",children:[c.jsx(Zl,{size:12,strokeWidth:3,className:["transition-transform flex-shrink-0",t?"rotate-90":""].join(" ")}),c.jsx(r_,{size:12,strokeWidth:2.5,className:"flex-shrink-0"}),c.jsx("span",{className:"font-bold flex-shrink-0",children:e.title||e.kind}),c.jsx("span",{className:"flex-1 text-left text-[var(--color-text-muted)] truncate",title:l,children:l}),o&&c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin text-[var(--color-running)] flex-shrink-0"}),r&&c.jsx(Eu,{size:12,strokeWidth:2.5,className:"text-[var(--color-running)] flex-shrink-0"}),a&&c.jsx(qN,{size:12,strokeWidth:2.5,className:"text-[var(--color-crashed)] flex-shrink-0"})]}),t&&c.jsxs("div",{className:"px-3 py-2 text-xs font-[family-name:var(--font-mono)] text-[var(--color-text-muted)] border-t-2 border-[var(--color-text)] space-y-1",children:[d?c.jsx("pre",{className:"whitespace-pre-wrap break-all text-[var(--color-text)] max-h-72 overflow-auto",children:typeof e.input=="string"?e.input:JSON.stringify(e.input,null,2)}):c.jsx("div",{children:"无参数"}),c.jsxs("div",{className:"opacity-60",children:["id: ",e.id," · ",e.status]})]})]})}function Yj(e,t){if(!e)return"";const n=new Date(e),r=Date.now()-n.getTime();return r<6e4?t("kanban.time.justNow"):r<36e5?t("kanban.time.minutes",{n:Math.floor(r/6e4)}):r<864e5?t("kanban.time.hours",{n:Math.floor(r/36e5)}):n.toLocaleDateString()}function V8(e){if(!e)return;const t=new Date(e),n=r=>String(r).padStart(2,"0");return`${t.getFullYear()}-${n(t.getMonth()+1)}-${n(t.getDate())} ${n(t.getHours())}:${n(t.getMinutes())}:${n(t.getSeconds())}`}function Y8(){return ft("/api/processes").then(e=>e.data)}function Q8(e){return Li(`/api/processes/${e}/kill`)}function W8(){return ft("/api/processes/reclaim")}async function X8(e){const t=await fetch("/api/processes/reclaim",{method:"PUT",headers:{"Content-Type":"application/json"},body:JSON.stringify({idleMinutes:e})});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return t.json()}const OE="border-[3px] border-[var(--color-text)] rounded-2xl bg-white shadow-[4px_4px_0_var(--color-text)]";function Z8(e){if(!e)return"—";const t=Date.now()-new Date(e).getTime();if(!Number.isFinite(t)||t<0)return"—";const n=Math.floor(t/6e4);if(n<1)return"<1m";if(n<60)return`${n}m`;const r=Math.floor(n/60);return r<24?`${r}h${n%60?` ${n%60}m`:""}`:`${Math.floor(r/24)}d${r%24?` ${r%24}h`:""}`}function cy(e){return e.project?e.project:e.cwd?e.cwd.split("/").filter(Boolean).pop()??e.slot:e.slot}function RE(e){const t=/^session-chat-(.+)$/.exec(e.slot);return(t==null?void 0:t[1])??null}function J8({p:e}){const t=e.alive?e.sessionState??"alive":"offline",n=e.alive?"bg-[var(--color-accent-mint)]":"bg-[var(--color-bg-cream)] text-[var(--color-text)]/60";return c.jsxs("span",{className:`inline-flex items-center gap-1 px-2 py-0.5 rounded-lg border-2 border-[var(--color-text)] text-xs font-bold font-[family-name:var(--font-mono)] ${n}`,children:[c.jsx("span",{className:`w-2 h-2 rounded-full ${e.alive?"bg-green-600":"bg-gray-400"}`}),t]})}function eq(){var k;const e=Be(),t=Gt(),[n,r]=j.useState(null),[a,o]=j.useState("all"),l=Ye({queryKey:["processes"],queryFn:Y8,refetchInterval:5e3}),d=Ct({mutationFn:Q8,onSuccess:v=>{r(v.message),t.invalidateQueries({queryKey:["processes"]})},onError:v=>r(v instanceof Error?v.message:String(v))}),f=Ye({queryKey:["reclaim"],queryFn:W8}),[h,g]=j.useState("");j.useEffect(()=>{f.data&&h===""&&g(String(f.data.idleMinutes))},[f.data,h]);const m=Ct({mutationFn:v=>X8(v),onSuccess:v=>{r(`自动回收已设为 ${v.idleMinutes} 分钟空闲`),t.invalidateQueries({queryKey:["reclaim"]})},onError:v=>r(v instanceof Error?v.message:String(v))}),y=l.data??[],b=y.filter(v=>a==="all"?!0:v.kind===a);return c.jsxs("div",{className:"max-w-full",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsx(hh,{size:22,strokeWidth:2.5}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl",children:e("processes.title")}),c.jsxs("button",{type:"button","aria-label":e("processes.refresh"),onClick:()=>t.invalidateQueries({queryKey:["processes"]}),className:"ml-auto inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl border-2 border-[var(--color-text)] bg-white text-sm font-semibold shadow-[2px_2px_0_var(--color-text)] hover:-translate-x-px hover:-translate-y-px focus-visible:outline focus-visible:outline-2",children:[l.isFetching?c.jsx(Xe,{size:15,className:"animate-spin"}):c.jsx(ya,{size:15}),e("processes.refresh")]})]}),c.jsxs("p",{className:"text-sm text-[var(--color-text)]/70 mb-3",children:[e("processes.subtitle")," · ",e("processes.aliveCount").replace("{n}",String(y.length))]}),c.jsxs("div",{className:`${OE} px-4 py-3 mb-4 flex flex-wrap items-center gap-2`,style:{boxShadow:"2px 2px 0 var(--color-text)"},children:[c.jsx(u3,{size:16,strokeWidth:2.5}),c.jsx("span",{className:"text-sm font-bold",children:"自动回收"}),c.jsx("span",{className:"text-sm text-[var(--color-text)]/70",children:"会话空闲"}),c.jsx("input",{type:"number",min:1,max:1440,value:h,onChange:v=>g(v.target.value),className:"w-20 px-2 py-1 rounded-lg border-2 border-[var(--color-text)] font-[family-name:var(--font-mono)] text-sm","aria-label":"自动回收空闲分钟数"}),c.jsx("span",{className:"text-sm text-[var(--color-text)]/70",children:"分钟后自动停(下次访问自动续上,不丢上下文)"}),c.jsxs("button",{type:"button",disabled:m.isPending||h===""||Number(h)===((k=f.data)==null?void 0:k.idleMinutes),onClick:()=>m.mutate(Math.round(Number(h))),className:"ml-auto inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg border-2 border-[var(--color-text)] bg-[var(--color-accent-mint)] text-sm font-bold shadow-[2px_2px_0_var(--color-text)] hover:-translate-x-px hover:-translate-y-px disabled:opacity-50 focus-visible:outline focus-visible:outline-2","aria-label":"保存自动回收设置",children:[m.isPending?c.jsx(Xe,{size:14,className:"animate-spin"}):c.jsx(Ri,{size:14,strokeWidth:3}),"保存"]})]}),n&&c.jsx("div",{className:"mb-3 px-3 py-2 rounded-xl border-2 border-[var(--color-text)] bg-[var(--color-bg-cream)] text-sm font-mono",children:n}),c.jsx("div",{className:"flex flex-wrap gap-2 mb-3 items-center",children:["all","worker","chat"].map(v=>c.jsx("button",{type:"button","aria-label":e(`processes.kind.${v}`),onClick:()=>o(v),className:`px-3 py-1 rounded-lg border-2 border-[var(--color-text)] text-sm font-bold shadow-[2px_2px_0_var(--color-text)] focus-visible:outline focus-visible:outline-2 ${a===v?"bg-[var(--color-accent-yellow)]":"bg-white hover:-translate-x-px hover:-translate-y-px"}`,children:e(`processes.kind.${v}`)},v))}),c.jsx("div",{className:`${OE} overflow-hidden`,children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-[var(--color-bg-cream)] font-[family-name:var(--font-heading)]",children:c.jsxs("tr",{className:"text-left",children:[c.jsx("th",{className:"px-3 py-2",children:e("processes.col.kind")}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.slot")}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.project")}),c.jsx("th",{className:"px-3 py-2",children:"PID"}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.state")}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.memory")}),c.jsx("th",{className:"px-3 py-2",children:"运行时间"}),c.jsx("th",{className:"px-3 py-2",children:e("processes.col.action")})]})}),c.jsxs("tbody",{className:"font-[family-name:var(--font-mono)]",children:[b.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:8,className:"px-3 py-6 text-center text-[var(--color-text)]/50",children:e("processes.empty")})}),b.map(v=>c.jsxs("tr",{className:"border-t-2 border-[var(--color-text)]/10",title:v.cwd??"",children:[c.jsx("td",{className:"px-3 py-2",children:c.jsx("span",{className:`inline-block px-2 py-0.5 rounded-lg border-2 border-[var(--color-text)] text-xs font-bold ${v.kind==="worker"?"bg-[var(--color-accent-yellow)]":"bg-[var(--color-accent-purple)]"}`,children:e(`processes.kind.${v.kind}`)})}),c.jsx("td",{className:"px-3 py-2 max-w-[220px] truncate",children:v.slot}),c.jsx("td",{className:"px-3 py-2 max-w-[220px] truncate",children:v.kind==="chat"&&RE(v)?c.jsxs(vs,{to:`/chat/${RE(v)}`,className:"inline-flex items-center gap-1 font-semibold text-[var(--color-text)] underline decoration-2 underline-offset-2 hover:opacity-70",title:"打开对话窗口",children:[c.jsx(VN,{size:12,strokeWidth:2.5})," ",cy(v)]}):v.kind==="worker"&&v.project?c.jsxs(vs,{to:`/board?project=${encodeURIComponent(v.project)}`,className:"inline-flex items-center gap-1 font-semibold text-[var(--color-text)] underline decoration-2 underline-offset-2 hover:opacity-70",title:"打开该项目看板",children:[c.jsx(hh,{size:12,strokeWidth:2.5})," ",cy(v)]}):c.jsx("span",{children:cy(v)})}),c.jsx("td",{className:"px-3 py-2",children:v.pid??"—"}),c.jsx("td",{className:"px-3 py-2",children:c.jsx(J8,{p:v})}),c.jsx("td",{className:"px-3 py-2",children:v.memoryMB!=null?`${v.memoryMB} MB`:"—"}),c.jsx("td",{className:"px-3 py-2",children:Z8(v.startedAt)}),c.jsx("td",{className:"px-3 py-2",children:v.alive&&v.pid!=null?c.jsxs("button",{type:"button","aria-label":`${e("processes.kill")} ${v.slot}`,onClick:()=>{confirm(e("processes.killConfirm").replace("{slot}",v.slot))&&d.mutate(v.pid)},className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-lg border-2 border-[var(--color-text)] bg-[var(--color-accent-pink)] text-xs font-bold shadow-[2px_2px_0_var(--color-text)] hover:-translate-x-px hover:-translate-y-px active:translate-x-0.5 active:translate-y-0.5 focus-visible:outline focus-visible:outline-2",children:[c.jsx(qN,{size:13})," ",e("processes.kill")]}):c.jsx("span",{className:"text-[var(--color-text)]/40 text-xs",children:"—"})})]},v.slot))]})]})})]})}function tq(e={}){const t=new URLSearchParams;e.project&&t.set("project",e.project),e.action&&t.set("action",e.action);const n=t.toString();return ft(`/api/audit${n?`?${n}`:""}`).then(r=>r.data)}const nq="border-[3px] border-[var(--color-text)] rounded-2xl bg-white shadow-[4px_4px_0_var(--color-text)]",rq={create:"bg-[var(--color-accent-mint)]",modify:"bg-[var(--color-accent-yellow)]",delete:"bg-[var(--color-accent-pink)]",daemon:"bg-[var(--color-accent-purple)]"};function iq(){const e=Be(),t=Gt(),[n,r]=j.useState(""),a=Ye({queryKey:["audit",n],queryFn:()=>tq(n?{action:n}:{}),refetchInterval:8e3}),o=a.data??[],l=d=>e(`audit.action.${d}`);return c.jsxs("div",{className:"max-w-full",children:[c.jsxs("div",{className:"flex items-center gap-3 mb-1",children:[c.jsx(Bb,{size:22,strokeWidth:2.5}),c.jsx("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl",children:e("audit.title")}),c.jsxs("button",{type:"button","aria-label":e("audit.refresh"),onClick:()=>t.invalidateQueries({queryKey:["audit"]}),className:"ml-auto inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl border-2 border-[var(--color-text)] bg-white text-sm font-semibold shadow-[2px_2px_0_var(--color-text)] hover:-translate-x-px hover:-translate-y-px focus-visible:outline focus-visible:outline-2",children:[a.isFetching?c.jsx(Xe,{size:15,className:"animate-spin"}):c.jsx(ya,{size:15}),e("audit.refresh")]})]}),c.jsx("p",{className:"text-sm text-[var(--color-text)]/70 mb-4",children:e("audit.subtitle")}),c.jsx("div",{className:"flex gap-2 mb-3",children:["","create","modify","delete","daemon"].map(d=>c.jsx("button",{type:"button","aria-label":d?l(d):e("audit.filter.all"),onClick:()=>r(d),className:`px-3 py-1 rounded-lg border-2 border-[var(--color-text)] text-sm font-bold shadow-[2px_2px_0_var(--color-text)] focus-visible:outline focus-visible:outline-2 ${n===d?"bg-[var(--color-accent-purple)]":"bg-white hover:-translate-x-px hover:-translate-y-px"}`,children:d?l(d):e("audit.filter.all")},d||"all"))}),c.jsx("div",{className:`${nq} overflow-hidden`,children:c.jsxs("table",{className:"w-full text-sm",children:[c.jsx("thead",{className:"bg-[var(--color-bg-cream)] font-[family-name:var(--font-heading)]",children:c.jsxs("tr",{className:"text-left",children:[c.jsx("th",{className:"px-3 py-2",children:e("audit.col.time")}),c.jsx("th",{className:"px-3 py-2",children:e("audit.col.action")}),c.jsx("th",{className:"px-3 py-2",children:e("audit.col.project")}),c.jsx("th",{className:"px-3 py-2",children:e("audit.col.detail")})]})}),c.jsxs("tbody",{className:"font-[family-name:var(--font-mono)]",children:[o.length===0&&c.jsx("tr",{children:c.jsx("td",{colSpan:4,className:"px-3 py-6 text-center text-[var(--color-text)]/50",children:e("audit.empty")})}),o.map((d,f)=>c.jsxs("tr",{className:"border-t-2 border-[var(--color-text)]/10",children:[c.jsx("td",{className:"px-3 py-2 whitespace-nowrap",children:new Date(d.ts).toLocaleString()}),c.jsx("td",{className:"px-3 py-2",children:c.jsx("span",{className:`inline-block px-2 py-0.5 rounded-lg border-2 border-[var(--color-text)] text-xs font-bold ${rq[d.action]}`,children:l(d.action)})}),c.jsx("td",{className:"px-3 py-2",children:d.project}),c.jsx("td",{className:"px-3 py-2 text-[var(--color-text)]/70",children:d.detail??(d.source?`(${d.source})`:"—")})]},`${d.ts}-${f}`))]})]})})]})}const aq=["convention","decision","gotcha","pattern","reference","note"];function rs(e){return`${e.scope}:${e.project??e.agentId??""}`}function Bf(e){return e.scope==="global"?`全局 (${e.count})`:e.scope==="project"?`项目:${e.project} (${e.count})`:`会话:${e.agentId} (${e.count})`}function Vs(e){const t={scope:e.scope};return e.project&&(t.project=e.project),e.agentId&&(t.agentId=e.agentId),t}async function Ei(e,t){const n=await fetch(e,t);if(!n.ok){const r=await n.json().catch(()=>null);throw new Error((r==null?void 0:r.detail)||(r==null?void 0:r.title)||`HTTP ${n.status}`)}return await n.json()}const sq=()=>({title:"",body:"",category:"note",tags:"",salience:3});function oq(){var ke,Se,J,ue,Te,Oe,De,ce,Ce;const e=Be(),[t,n]=j.useState([]),[r,a]=j.useState(null),[o,l]=j.useState(!1),[d,f]=j.useState([]),[h,g]=j.useState(null),[m,y]=j.useState(!1),[b,k]=j.useState(""),[v,N]=j.useState(!0),[E,C]=j.useState([]),[S,_]=j.useState(null),[M,T]=j.useState(null),[L,R]=j.useState(null),[$,z]=j.useState(null),[q,F]=j.useState(""),[Y,D]=j.useState(""),H=j.useCallback(async()=>{try{const{scopes:te}=await Ei("/api/memory/scopes");n(te),a(pe=>pe??te[0]??null)}catch(te){g(te instanceof Error?te.message:String(te))}},[]),O=j.useCallback(async te=>{try{const pe=new URLSearchParams(Vs(te)).toString(),{data:Fe}=await Ei(`/api/memory/entries?${pe}`);f(Fe)}catch(pe){g(pe instanceof Error?pe.message:String(pe))}},[]);j.useEffect(()=>{H(),Ei("/api/system/memory").then(te=>{z(te),F(te.mode),D(te.externalUrl)}).catch(()=>{})},[H]),j.useEffect(()=>{r&&O(r),(r==null?void 0:r.scope)==="project"&&r.project?Ei(`/api/memory/external?project=${encodeURIComponent(r.project)}`).then(te=>R(te)).catch(()=>R(null)):R(null)},[r,O]);const V=j.useCallback(async()=>{if(!b.trim()){C([]);return}y(!0),g(null);try{const te=new URLSearchParams({q:b,limit:"20"});if(v)te.set("all","1");else if(r)for(const[Fe,ze]of Object.entries(Vs(r)))te.set(Fe,ze);const{results:pe}=await Ei(`/api/memory/recall?${te.toString()}`);C(pe)}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}},[b,v,r]),Q=j.useCallback(async()=>{if(!(!r||!S)){y(!0),g(null);try{await Ei("/api/memory/entries",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...Vs(r),id:S.id,title:S.title,body:S.body,category:S.category,tags:S.tags.split(",").map(te=>te.trim()).filter(Boolean),salience:S.salience})}),_(null),await Promise.all([O(r),H()])}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}}},[r,S,O,H]),K=j.useCallback(async te=>{if(r){y(!0),g(null);try{const pe=new URLSearchParams(Vs(r)).toString();await Ei(`/api/memory/entries/${encodeURIComponent(te)}?${pe}`,{method:"DELETE"}),await Promise.all([O(r),H()])}catch(pe){g(pe instanceof Error?pe.message:String(pe))}finally{y(!1)}}},[r,O,H]),I=j.useCallback(async(te,pe,Fe)=>{if(r){y(!0),g(null);try{await Ei("/api/memory/promote",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({from:Vs(r),id:te.id,to:Vs(pe),move:Fe})}),T(null),await Promise.all([O(r),H()])}catch(ze){g(ze instanceof Error?ze.message:String(ze))}finally{y(!1)}}},[r,O,H]),P=j.useCallback(async()=>{if(r){y(!0),g(null);try{const pe=(await Ei("/api/memory/gc",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(Vs(r))})).results[0];pe&&g(`收敛完成:清 tombstone ${pe.purged}、去重 ${pe.deduped}、剩余 ${pe.kept}`),await Promise.all([O(r),H()])}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}}},[r,O,H]),G=j.useCallback(async()=>{y(!0),g(null);try{const te=await Ei("/api/system/memory",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({mode:q,externalUrl:Y})});z(te),F(te.mode),D(te.externalUrl),g("模式已保存(重启 worker 生效)")}catch(te){g(te instanceof Error?te.message:String(te))}finally{y(!1)}},[q,Y]),B=$!=null&&(q!==$.mode||Y!==$.externalUrl),oe=q==="external"||q==="local+external",ve=j.useMemo(()=>M?t.filter(te=>rs(te)!==rs(r??{scope:""})):[],[M,t,r]);return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-center gap-3 flex-wrap",children:[c.jsxs("h1",{className:"font-[family-name:var(--font-heading)] font-bold text-2xl text-[var(--color-text)]",children:["🧠 ",e("nav.memory")]}),c.jsx("span",{className:"text-xs text-[var(--color-text)] opacity-60",children:"本地记忆 v2 · markdown 真源"})]}),$&&c.jsxs("section",{className:"nb-card flex flex-wrap items-end gap-3",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[c.jsx("span",{className:"font-bold",children:"记忆模式"}),c.jsx("select",{className:"nb-input",value:q,onChange:te=>F(te.target.value),"aria-label":"记忆模式",children:$.modeOptions.map(te=>c.jsx("option",{value:te,children:te},te))})]}),oe&&c.jsxs("label",{className:"flex flex-col gap-1 text-sm flex-1 min-w-[220px]",children:[c.jsx("span",{className:"font-bold",children:"外部后端地址"}),c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-xs",value:Y,onChange:te=>D(te.target.value),placeholder:"http://127.0.0.1:3113",spellCheck:!1,"aria-label":"外部后端地址"})]}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:G,disabled:m||!B,"aria-label":"保存模式",children:"保存模式"})]}),c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("input",{value:b,onChange:te=>k(te.target.value),onKeyDown:te=>te.key==="Enter"&&V(),placeholder:"检索记忆…","aria-label":"检索记忆",className:"nb-input flex-1 min-w-[200px] font-[family-name:var(--font-mono)] text-sm"}),c.jsxs("label",{className:"flex items-center gap-1 text-sm font-semibold",children:[c.jsx("input",{type:"checkbox",checked:v,onChange:te=>N(te.target.checked),"aria-label":"全局检索"}),"全局"]}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:V,disabled:m,"aria-label":"检索",children:m?"…":"检索"})]}),h&&c.jsxs("div",{className:"text-sm text-[var(--color-text)] font-semibold nb-card py-2",children:["ℹ ",h]}),E.length>0&&c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:["检索结果(",E.length,")"]}),E.map(te=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-60 font-[family-name:var(--font-mono)]",children:[c.jsx("span",{className:"nb-badge",children:te.source==="external"?"🌐 外部":"📁 本地"}),c.jsx("span",{children:te.source==="external"?te.type??"":te.scope==="project"?`项目:${te.project}`:te.scope}),te.category&&c.jsxs(c.Fragment,{children:[c.jsx("span",{children:"·"}),c.jsx("span",{children:te.category})]})]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:te.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:te.snippet.slice(0,300)})]},te.id))]}),(()=>{const te=new Date(Date.now()-6048e5).toISOString(),pe=r?rs(r):"",Fe=o?t:t.filter(ae=>ae.scope!=="project"||ae.updated>=te||rs(ae)===pe),ze=t.length-Fe.length;return c.jsxs("div",{className:"flex gap-2 flex-wrap items-center",children:[c.jsx("select",{className:"nb-input",value:pe,onChange:ae=>a(t.find(be=>rs(be)===ae.target.value)??null),"aria-label":"选择作用域",children:Fe.map(ae=>c.jsx("option",{value:rs(ae),children:Bf(ae)},rs(ae)))}),(ze>0||o)&&c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>l(ae=>!ae),"aria-label":o?"收起更早项目":"显示更早项目",children:o?"收起更早":`含更早 (${ze})`}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-blue",onClick:()=>_(sq()),disabled:!r,"aria-label":"新建记忆",children:"+ 新建"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-yellow",onClick:P,disabled:m||!r,"aria-label":"收敛去重",children:"收敛"})]})})(),L&&((Se=(ke=L.profile)==null?void 0:ke.topConcepts)!=null&&Se.length||(ue=(J=L.graph)==null?void 0:J.edges)!=null&&ue.length)?c.jsxs("section",{className:"nb-card flex flex-col gap-1",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:"🌐 外部智能(agentmemory)"}),(Oe=(Te=L.profile)==null?void 0:Te.topConcepts)!=null&&Oe.length?c.jsxs("div",{className:"text-xs",children:[c.jsx("span",{className:"font-bold",children:"概念:"}),L.profile.topConcepts.slice(0,8).map(te=>c.jsx("span",{className:"nb-badge ml-1",children:te.concept},te.concept))]}):null,c.jsxs("div",{className:"text-xs opacity-70 font-[family-name:var(--font-mono)]",children:["知识图谱 ",((ce=(De=L.graph)==null?void 0:De.edges)==null?void 0:ce.length)??0," 条边 · 观测 ",((Ce=L.profile)==null?void 0:Ce.totalObservations)??0]})]}):null,S&&c.jsxs("section",{className:"nb-card flex flex-col gap-2",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:S.id?"编辑记忆":"新建记忆"}),c.jsx("input",{className:"nb-input text-sm",value:S.title,onChange:te=>_({...S,title:te.target.value}),placeholder:"标题","aria-label":"标题"}),c.jsxs("div",{className:"flex gap-2 flex-wrap",children:[c.jsx("select",{className:"nb-input",value:S.category,onChange:te=>_({...S,category:te.target.value}),"aria-label":"类别",children:aq.map(te=>c.jsx("option",{value:te,children:te},te))}),c.jsx("input",{className:"nb-input flex-1 min-w-[160px] text-sm",value:S.tags,onChange:te=>_({...S,tags:te.target.value}),placeholder:"标签(逗号分隔)","aria-label":"标签"}),c.jsxs("label",{className:"flex items-center gap-1 text-sm",children:["显著度",c.jsx("input",{className:"nb-input w-16",type:"number",min:1,max:5,value:S.salience,onChange:te=>_({...S,salience:Number(te.target.value)}),"aria-label":"显著度"})]})]}),c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm min-h-[120px]",value:S.body,onChange:te=>_({...S,body:te.target.value}),placeholder:"正文","aria-label":"正文"}),c.jsxs("div",{className:"flex gap-2",children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint",onClick:Q,disabled:m||!S.title.trim()||!S.body.trim(),"aria-label":"保存",children:"保存"}),c.jsx("button",{type:"button",className:"nb-btn",onClick:()=>_(null),"aria-label":"取消",children:"取消"})]})]}),c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] font-bold text-sm",children:r?Bf(r):"条目"}),d.length===0&&c.jsx("div",{className:"nb-card text-sm opacity-60",children:"(无记忆)"}),d.map(te=>c.jsxs("div",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-center gap-2 text-xs opacity-60 font-[family-name:var(--font-mono)] flex-wrap",children:[c.jsx("span",{className:"nb-badge",children:te.category}),c.jsxs("span",{children:["s",te.salience]}),c.jsx("span",{children:"·"}),c.jsx("span",{children:te.source}),te.tags.map(pe=>c.jsxs("span",{children:["#",pe]},pe))]}),c.jsx("div",{className:"font-bold text-sm mt-1",children:te.title}),c.jsx("div",{className:"text-sm mt-1 whitespace-pre-wrap opacity-80",children:te.body.slice(0,400)}),c.jsxs("div",{className:"flex gap-2 mt-2",children:[c.jsx("button",{type:"button",className:"nb-btn nb-btn-blue text-xs",onClick:()=>_({id:te.id,title:te.title,body:te.body,category:te.category,tags:te.tags.join(", "),salience:te.salience}),"aria-label":"编辑",children:"编辑"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-purple text-xs",onClick:()=>T(te),"aria-label":"提升",children:"提升"}),c.jsx("button",{type:"button",className:"nb-btn nb-btn-danger text-xs",onClick:()=>K(te.id),"aria-label":"删除",children:"删除"})]}),(M==null?void 0:M.id)===te.id&&c.jsxs("div",{className:"mt-2 flex flex-wrap items-center gap-2 border-t-[3px] border-[var(--color-text)] pt-2",children:[c.jsx("span",{className:"text-xs font-bold",children:"提升到:"}),ve.map(pe=>c.jsx("button",{type:"button",className:"nb-btn nb-btn-mint text-xs",onClick:()=>I(te,pe,!1),"aria-label":`复制到${Bf(pe)}`,children:Bf(pe)},rs(pe))),ve.length===0&&c.jsx("span",{className:"text-xs opacity-60",children:"(无其它作用域)"}),c.jsx("button",{type:"button",className:"nb-btn text-xs",onClick:()=>T(null),"aria-label":"取消提升",children:"取消"})]})]},te.id))]})]})}async function lq(){return(await ft("/api/channels")).data??{console:{},adapters:[]}}async function cq(e){return(await qb("/api/channels",e)).data}async function uq(){return(await ft("/api/codex-proxy")).data}async function dq(){return(await Li("/api/codex-proxy/install")).data}async function fq(e){const t=await fetch(`/api/codex-proxy?purgeAuth=${e?"1":"0"}`,{method:"DELETE",headers:{Accept:"application/json"}});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return(await t.json()).data}async function hq(){return(await Li("/api/codex-proxy/auth/start")).data}async function pq(){await Li("/api/codex-proxy/auth/cancel")}const LE=[{key:"memory",labelKey:"plugins.tab.memory"},{key:"channel",labelKey:"plugins.tab.channel"},{key:"model",labelKey:"plugins.tab.model"},{key:"tool",labelKey:"plugins.tab.tool"}];function mq(){const e=Be(),[t,n]=j.useState("memory");return c.jsxs("div",{className:"flex flex-col gap-6 w-full",children:[c.jsxs("header",{children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold",children:e("plugins.h1")}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)] mt-1",children:e("plugins.desc")})]}),c.jsx("div",{role:"tablist","aria-label":e("plugins.h1"),className:"flex gap-2 flex-wrap",children:LE.map(r=>{const a=t===r.key;return c.jsx("button",{role:"tab","aria-selected":a,type:"button",onClick:()=>n(r.key),className:["px-4 py-2 rounded-xl font-bold text-sm border-2 transition-transform duration-150",a?"bg-[var(--color-accent-mint)] border-[var(--color-text)] shadow-[3px_3px_0_var(--color-text)]":"border-[var(--color-text)] bg-white hover:-translate-x-px hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)]"].join(" "),children:e(r.labelKey)},r.key)})}),c.jsx("div",{role:"tabpanel",children:t==="memory"?c.jsx(yq,{}):t==="channel"?c.jsx(Eq,{}):t==="model"?c.jsx(bq,{}):c.jsx(gq,{label:e(LE.find(r=>r.key===t).labelKey)})})]})}function gq({label:e}){const t=Be();return c.jsx("section",{className:"nb-card",children:c.jsxs("p",{className:"text-[var(--color-text-muted)] text-sm",children:[e," — ",t("plugins.comingSoon")]})})}function yq(){var k,v,N;const e=Be(),t=Gt(),{alert:n}=un(),r=Ye({queryKey:["system-memory"],queryFn:R3}),[a,o]=j.useState(null),[l,d]=j.useState(null);j.useEffect(()=>{r.data&&a===null&&(o(r.data.provider),d(r.data.url))},[r.data,a]);const f=a??((k=r.data)==null?void 0:k.provider)??"agentmemory",h=l??((v=r.data)==null?void 0:v.url)??"",g=r.data!=null&&(f!==r.data.provider||f==="custom"&&h!==r.data.url),m=E=>{const C=`system.memory.opt.${E}`;return e(C)},y=Ct({mutationFn:()=>L3(f,f==="custom"?h:""),onSuccess:()=>{t.invalidateQueries({queryKey:["system-memory"]}),t.invalidateQueries({queryKey:["system-env"]})},onError:E=>{n({title:e("system.memory.error"),body:E instanceof Error?E.message:String(E)})}}),b=((N=r.data)==null?void 0:N.options)??["none","builtin","agentmemory","custom"];return c.jsxs("section",{className:"nb-card",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-1",children:e("system.memory.title")}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-3",children:e("system.memory.desc")}),c.jsxs("div",{className:"flex flex-col gap-3 max-w-md",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[c.jsx("span",{className:"font-bold",children:e("system.memory.provider")}),c.jsx("select",{className:"nb-input",value:f,onChange:E=>o(E.target.value),"aria-label":e("system.memory.provider"),children:b.map(E=>c.jsx("option",{value:E,children:m(E)},E))})]}),f==="custom"&&c.jsxs("label",{className:"flex flex-col gap-1 text-sm",children:[c.jsx("span",{className:"font-bold",children:e("system.memory.url")}),c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-xs",type:"text",value:h,onChange:E=>d(E.target.value),placeholder:e("system.memory.url.placeholder"),spellCheck:!1,"aria-label":e("system.memory.url")})]}),c.jsx("div",{className:"flex justify-end",children:c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>y.mutate(),disabled:!g||y.isPending,type:"button","aria-label":e("system.memory.save.aria"),children:[y.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Ri,{size:12,strokeWidth:3}),y.isSuccess&&!g?e("system.memory.saved"):e("system.memory.save")]})})]})]})}function bq(){var N,E,C;const e=Gt(),{alert:t,confirm:n}=un(),r=Ye({queryKey:["providers"],queryFn:lx}),o=(N=Ye({queryKey:["system-agents"],queryFn:Hb}).data)==null?void 0:N.agents,[l,d]=j.useState(null),f=Ct({mutationFn:()=>t4(l.kind,l.entry),onSuccess:()=>{d(null),e.invalidateQueries({queryKey:["providers"]})},onError:S=>void t({title:"保存失败",body:S instanceof Error?S.message:String(S)})}),h=Ct({mutationFn:S=>n4(S.kind,S.id),onSuccess:()=>void e.invalidateQueries({queryKey:["providers"]}),onError:S=>void t({title:"删除失败",body:S instanceof Error?S.message:String(S)})}),g=Ct({mutationFn:S=>I3(S),onSuccess:()=>void e.invalidateQueries({queryKey:["system-agents"]}),onError:S=>void t({title:"设默认失败",body:S instanceof Error?S.message:String(S)})}),m=(S,_,M)=>{if(!o)return!1;const T=S==="anthropic"?o.worker:o.reviewer;return(T.providerId||"official")===_&&T.model===M},y=(S,_,M)=>{if(!o)return;let T;if(S==="anthropic"){const L={...o.worker,model:M};_==="official"?delete L.providerId:L.providerId=_,T={...o,worker:L}}else T={...o,reviewer:{...o.reviewer,providerId:_,model:M}};g.mutate(T)},b=[{kind:"anthropic",title:"Anthropic 兼容(worker / claude)",items:((E=r.data)==null?void 0:E.anthropic)??[]},{kind:"openai",title:"OpenAI 兼容(reviewer / openai agent)",items:((C=r.data)==null?void 0:C.openai)??[]}],k=S=>d({kind:S,isNew:!0,entry:{id:"",name:"",baseUrl:"",apiKey:"",models:[]}}),v=(S,_)=>d({kind:S,isNew:!1,entry:{id:_.id,name:_.name,baseUrl:_.baseUrl,apiKey:"",models:_.models}});return c.jsxs("section",{className:"nb-card",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold mb-1",children:"模型 API 端点"}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mb-4",children:"本地官方订阅(已登录验证)自动置顶,不可编辑;下方可增删第三方兼容端点。**点模型标签设为默认**(anthropic→worker / openai→监工);✓ = 当前默认。"}),c.jsx("div",{className:"grid grid-cols-1 lg:grid-cols-2 gap-5",children:b.map(S=>c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("span",{className:"font-bold text-sm",children:S.title}),c.jsxs("button",{className:"nb-btn",style:{padding:"4px 10px",fontSize:12},type:"button",onClick:()=>k(S.kind),"aria-label":`添加 ${S.title} 端点`,children:[c.jsx(pr,{size:12,strokeWidth:3})," 添加"]})]}),S.items.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)]",children:"(无端点)"}),S.items.map(_=>_.id==="codex-proxy"?c.jsx(vq,{isDefault:M=>m(S.kind,_.id,M),pickDefault:M=>y(S.kind,_.id,M),setDefaultPending:g.isPending},_.id):c.jsxs("div",{className:["rounded-lg px-3 py-2 border-2",_.builtin?"border-[var(--color-text)] bg-[var(--color-bg-cream)]":"border-[var(--color-text)]"].join(" "),children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm",children:_.id}),c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm",children:[" · ",_.name]}),_.builtin?c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:["本地订阅",_.detail?` · ${_.detail}`:""," · 已验证可用"]}):c.jsxs("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:[_.baseUrl," · key ",_.hasKey?_.apiKey:"未设置"]})]}),_.builtin?c.jsx("span",{className:"shrink-0 text-[10px] font-bold px-2 py-0.5 rounded-md border-2 border-[var(--color-text)] bg-[var(--color-accent-yellow)]",children:"内置"}):c.jsxs("div",{className:"flex gap-1 shrink-0",children:[c.jsx("button",{className:"nb-btn",style:{padding:"4px 8px"},type:"button",onClick:()=>v(S.kind,_),"aria-label":`编辑 ${_.id}`,children:c.jsx($L,{size:12,strokeWidth:3})}),c.jsx("button",{className:"nb-btn nb-btn-danger",style:{padding:"4px 8px"},type:"button",onClick:async()=>{await n({title:"删除端点",body:`删除 ${_.id}?`,danger:!0})&&h.mutate({kind:S.kind,id:_.id})},"aria-label":`删除 ${_.id}`,children:c.jsx(fi,{size:12,strokeWidth:3})})]})]}),_.models.length>0&&c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-2",children:_.models.map(M=>{const T=m(S.kind,_.id,M);return c.jsxs("button",{type:"button",onClick:()=>y(S.kind,_.id,M),disabled:g.isPending,"aria-pressed":T,className:["px-2 py-0.5 rounded-md text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)]",T?"bg-[var(--color-accent-mint)] font-bold":"bg-[var(--color-bg)] hover:bg-[var(--color-bg-cream)]"].join(" "),title:T?"当前默认":"设为默认",children:[M,T?" ✓":""]},M)})})]},_.id))]},S.kind))}),l&&c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:()=>d(null),children:c.jsx("div",{onClick:S=>S.stopPropagation(),children:c.jsx(xq,{state:l,onChange:S=>d({...l,entry:S}),onCancel:()=>d(null),onSave:()=>f.mutate(),saving:f.isPending})})})]})}function xq({state:e,onChange:t,onCancel:n,onSave:r,saving:a}){const o=e.entry,l=f=>t({...o,...f}),d=/^[a-zA-Z0-9_-]+$/.test(o.id)&&o.name.trim()&&o.baseUrl.trim();return c.jsxs("div",{className:"border-[3px] border-[var(--color-text)] rounded-2xl p-6 bg-[var(--color-bg-cream)] shadow-[6px_6px_0_var(--color-text)] flex flex-col gap-4 w-[min(92vw,640px)] max-h-[88vh] overflow-y-auto",children:[c.jsxs("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:[e.isNew?"新增端点":`编辑 ${o.id}`,c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm font-normal",children:["(",e.kind,")"]})]}),c.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["id(英数 _ -)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)]",value:o.id,disabled:!e.isNew,onChange:f=>l({id:f.target.value}),placeholder:"如 my-openai",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["名称",c.jsx("input",{className:"nb-input",value:o.name,onChange:f=>l({name:f.target.value}),placeholder:"显示名"})]})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Base URL",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",value:o.baseUrl,onChange:f=>l({baseUrl:f.target.value}),placeholder:"https://api.example.com/v1",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["API Key",!e.isNew&&"(留空=保留)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:"password",value:o.apiKey??"",onChange:f=>l({apiKey:f.target.value}),placeholder:e.isNew?"sk-...":"••••(留空不改)",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Models(逗号或换行分隔)",c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",rows:5,value:o.models.join(", "),onChange:f=>l({models:f.target.value.split(/[,\n]/).map(h=>h.trim()).filter(Boolean)}),placeholder:"gpt-5.4, gpt-4o",spellCheck:!1})]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[c.jsx("button",{className:"nb-btn",style:{padding:"8px 16px"},type:"button",onClick:n,children:"取消"}),c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"8px 16px"},type:"button",disabled:!d||a,onClick:r,children:[a?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Ri,{size:14,strokeWidth:3})," 保存"]})]})]})}function vq({isDefault:e,pickDefault:t,setDefaultPending:n}){const r=Gt(),{alert:a,confirm:o}=un(),[l,d]=j.useState(!1),[f,h]=j.useState(null),[g,m]=j.useState(!1),[y,b]=j.useState(!1),[k,v]=j.useState(!1),E=Ye({queryKey:["codex-proxy"],queryFn:uq,refetchInterval:l?3e3:!1}).data;j.useEffect(()=>{l&&(E!=null&&E.authed)&&(d(!1),h(null),r.invalidateQueries({queryKey:["codex-proxy"]}))},[l,E==null?void 0:E.authed,r]);const C=Ct({mutationFn:dq,onSuccess:$=>{r.invalidateQueries({queryKey:["codex-proxy"]}),r.invalidateQueries({queryKey:["providers"]}),$.ok||a({title:"安装失败",body:($.output||"未知错误").slice(-600)})},onError:$=>void a({title:"安装失败",body:$ instanceof Error?$.message:String($)})}),S=Ct({mutationFn:$=>fq($),onSuccess:$=>{m(!1),b(!1),r.invalidateQueries({queryKey:["codex-proxy"]}),r.invalidateQueries({queryKey:["providers"]}),r.invalidateQueries({queryKey:["system-agents"]}),$.ok||a({title:"卸载未完成",body:$.note??"删除失败(可能需 sudo)"})},onError:$=>void a({title:"卸载失败",body:$ instanceof Error?$.message:String($)})}),_=async()=>{await o({title:"安装 claude-code-proxy",body:"将运行官方安装脚本(curl … install.sh | bash),下载预编译二进制到 ~/.local/bin。继续?"})&&C.mutate()},M=async()=>{d(!0),h(null);try{const $=await hq();h($)}catch($){d(!1),a({title:"订阅失败",body:$ instanceof Error?$.message:String($)})}},T=()=>{pq(),d(!1),h(null)},L=C.isPending||(E==null?void 0:E.installing),R=k&&(E!=null&&E.models.all.length)?E.models.all:(E==null?void 0:E.models.curated)??[];return c.jsxs("div",{className:"rounded-lg px-3 py-2 border-2 border-[var(--color-text)] bg-[var(--color-bg-cream)]",children:[c.jsxs("div",{className:"flex items-center justify-between gap-2",children:[c.jsxs("div",{className:"min-w-0",children:[c.jsx("span",{className:"font-[family-name:var(--font-mono)] font-bold text-sm",children:"codex-proxy"}),c.jsx("span",{className:"text-[var(--color-text-muted)] text-sm",children:" · ChatGPT 订阅"}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] truncate",children:E?E.binInstalled?E.authed?`已订阅${E.account?` · ${E.account.slice(0,8)}…`:""} · worker 出 GPT`:"已安装 · 未订阅":"未安装 claude-code-proxy":"加载中…"})]}),(E==null?void 0:E.binInstalled)&&c.jsx("button",{className:"nb-btn nb-btn-danger shrink-0",style:{padding:"4px 8px"},type:"button",onClick:()=>m(!0),"aria-label":"卸载 codex-proxy",children:c.jsx(fi,{size:12,strokeWidth:3})})]}),c.jsx("div",{className:"mt-2",children:E?E.binInstalled?E.authed?c.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[R.map($=>{const z=e($);return c.jsxs("button",{type:"button",onClick:()=>t($),disabled:n,"aria-pressed":z,className:["px-2 py-0.5 rounded-md text-xs font-[family-name:var(--font-mono)] border-2 border-[var(--color-text)]",z?"bg-[var(--color-accent-mint)] font-bold":"bg-[var(--color-bg)] hover:bg-[var(--color-bg-cream)]"].join(" "),title:z?"当前默认":"设为 worker 默认",children:[$,z?" ✓":""]},$)}),E.models.all.length>E.models.curated.length&&c.jsx("button",{type:"button",className:"text-xs text-[var(--color-text-muted)] underline",onClick:()=>v($=>!$),children:k?"收起":`显示全部(${E.models.all.length})`})]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 12px",fontSize:12},type:"button",onClick:M,children:[c.jsx(NL,{size:12,strokeWidth:3})," 订阅(授权 ChatGPT)"]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"4px 12px",fontSize:12},type:"button",disabled:!!L,onClick:_,children:[L?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Uh,{size:12,strokeWidth:3}),L?" 安装中…":" 安装插件"]}):c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin text-[var(--color-text-muted)]"})}),l&&c.jsxs(IE,{onClose:T,children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:"订阅 ChatGPT(设备码授权)"}),f!=null&&f.verificationUrl&&(f!=null&&f.userCode)?c.jsxs("div",{className:"flex flex-col gap-3 text-sm",children:[c.jsxs("div",{children:["① 打开"," ",c.jsxs("a",{href:f.verificationUrl,target:"_blank",rel:"noreferrer",className:"font-bold underline inline-flex items-center gap-1",children:[f.verificationUrl," ",c.jsx(QR,{size:12,strokeWidth:3})]})]}),c.jsxs("div",{children:["② 输入验证码:",c.jsx("code",{className:"ml-1 px-2 py-0.5 rounded-md border-2 border-[var(--color-text)] bg-[var(--color-accent-yellow)] font-bold font-[family-name:var(--font-mono)]",children:f.userCode})]}),c.jsx("div",{children:"③ 在浏览器完成授权"}),c.jsxs("div",{className:"flex items-center gap-2 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 等待授权…(完成后自动刷新)"]})]}):c.jsxs("div",{className:"flex flex-col gap-2 text-sm text-[var(--color-text-muted)]",children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 正在获取设备码…"]}),c.jsxs("div",{children:["若长时间无响应,可在终端运行 ",c.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:"sps codex-proxy auth"}),",完成后此处自动刷新。"]})]}),c.jsx("div",{className:"flex justify-end pt-1",children:c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},type:"button",onClick:T,children:"取消"})})]}),g&&c.jsxs(IE,{onClose:()=>m(!1),children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:"卸载 claude-code-proxy"}),c.jsx("p",{className:"text-sm text-[var(--color-text-muted)]",children:"停止 proxy 并删除二进制。默认保留授权(重装免再授权)。"}),c.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[c.jsx("input",{type:"checkbox",checked:y,onChange:$=>b($.target.checked)}),"同时清除授权(~/.config/claude-code-proxy)"]}),c.jsxs("div",{className:"flex justify-end gap-2 pt-1",children:[c.jsx("button",{className:"nb-btn",style:{padding:"6px 14px"},type:"button",onClick:()=>m(!1),children:"取消"}),c.jsxs("button",{className:"nb-btn nb-btn-danger",style:{padding:"6px 14px"},type:"button",disabled:S.isPending,onClick:()=>S.mutate(y),children:[S.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(fi,{size:14,strokeWidth:3})," 卸载"]})]})]})]})}function IE({children:e,onClose:t}){return c.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-black/40 p-4",onClick:t,children:c.jsx("div",{className:"border-[3px] border-[var(--color-text)] rounded-2xl p-6 bg-[var(--color-bg-cream)] shadow-[6px_6px_0_var(--color-text)] flex flex-col gap-4 w-[min(92vw,520px)]",onClick:n=>n.stopPropagation(),children:e})})}const wq=["telegram","dingtalk","matrix","slack","discord","feishu"],gu={telegram:"Telegram",dingtalk:"钉钉 (Stream)",matrix:"Matrix",slack:"Slack",discord:"Discord",feishu:"飞书 / Lark"},kq={telegram:[{key:"token",label:"Bot Token(@BotFather)",type:"password",placeholder:"123456:ABC-..."},{key:"allowedChatIds",label:"允许的 Chat ID(白名单,空=全放)",type:"list",placeholder:"逗号/换行分隔"}],dingtalk:[{key:"clientId",label:"Client ID(AppKey)",type:"text"},{key:"clientSecret",label:"Client Secret(AppSecret)",type:"password"},{key:"allowedConversations",label:"允许的会话 ID(白名单,空=全放)",type:"list"}],matrix:[{key:"homeserver",label:"Homeserver URL",type:"text",placeholder:"https://matrix.org"},{key:"accessToken",label:"Access Token",type:"password"},{key:"allowedRooms",label:"允许的 Room ID(白名单,空=全放)",type:"list"}],slack:[{key:"appToken",label:"App Token(xapp-,Socket Mode)",type:"password",placeholder:"xapp-..."},{key:"botToken",label:"Bot Token(xoxb-)",type:"password",placeholder:"xoxb-..."},{key:"allowedChannels",label:"允许的 Channel(白名单,空=全放)",type:"list"}],discord:[{key:"token",label:"Bot Token",type:"password"},{key:"allowedChannels",label:"允许的 Channel ID(白名单,空=全放)",type:"list"}],feishu:[{key:"appId",label:"App ID",type:"text"},{key:"appSecret",label:"App Secret",type:"password"},{key:"verificationToken",label:"Verification Token",type:"text"},{key:"encryptKey",label:"Encrypt Key(设了则事件 AES 解密)",type:"password"},{key:"port",label:"本机监听端口(默认 9800)",type:"number",placeholder:"9800"},{key:"path",label:"监听路径(默认 /feishu)",type:"text",placeholder:"/feishu"},{key:"allowedChats",label:"允许的 chat_id(白名单,空=全放)",type:"list"}]};function Eq(){var k,v,N;const e=Gt(),{alert:t}=un(),n=Ye({queryKey:["channels"],queryFn:lq}),[r,a]=j.useState(null),[o,l]=j.useState({type:"console"});j.useEffect(()=>{n.data&&!r&&a({console:n.data.console??{},adapters:n.data.adapters??[]})},[n.data,r]);const d=Ct({mutationFn:()=>cq(r),onSuccess:E=>{a({console:E.console??{},adapters:E.adapters??[]}),e.invalidateQueries({queryKey:["channels"]})},onError:E=>void t({title:"保存失败",body:E instanceof Error?E.message:String(E)})});if(!r)return c.jsx("section",{className:"nb-card",children:c.jsxs("p",{className:"text-sm text-[var(--color-text-muted)] flex items-center gap-2",children:[c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"})," 加载频道配置…"]})});const f=r.adapters??[],h=JSON.stringify(r)!==JSON.stringify({console:((k=n.data)==null?void 0:k.console)??{},adapters:((v=n.data)==null?void 0:v.adapters)??[]}),g=E=>{const C=[...f,{kind:E,enabled:!0}];a({...r,adapters:C}),l({type:"adapter",index:C.length-1})},m=E=>{const C=f.filter((S,_)=>_!==E);a({...r,adapters:C}),l({type:"console"})},y=(E,C)=>{const S=f.map((_,M)=>M===E?{..._,...C}:_);a({...r,adapters:S})},b=E=>a({...r,console:{...r.console,...E}});return c.jsxs("section",{className:"nb-card",children:[c.jsxs("div",{className:"flex items-start justify-between gap-3 mb-1",children:[c.jsxs("div",{children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-xl font-bold",children:"频道(IM 网关)"}),c.jsxs("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:["接入 Telegram / 钉钉 / 飞书 / Slack / Discord / Matrix。左侧选频道,右侧改设置。保存后 ",c.jsx("code",{className:"font-[family-name:var(--font-mono)]",children:"sps im"})," 重启生效。"]})]}),c.jsxs("button",{className:"nb-btn nb-btn-primary shrink-0",style:{padding:"8px 16px"},type:"button",disabled:!h||d.isPending,onClick:()=>d.mutate(),"aria-label":"保存频道配置",children:[d.isPending?c.jsx(Xe,{size:14,strokeWidth:3,className:"animate-spin"}):c.jsx(Ri,{size:14,strokeWidth:3})," 保存"]})]}),c.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-[220px_1fr] gap-5 mt-4",children:[c.jsxs("div",{className:"flex flex-col gap-2",children:[c.jsx(zE,{label:"console 桥接",sub:((N=r.console)==null?void 0:N.url)||"未配置",active:o.type==="console",onClick:()=>l({type:"console"})}),c.jsx("div",{className:"h-px bg-[var(--color-text)] opacity-20 my-1"}),f.length===0&&c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] px-1",children:"(无频道)"}),f.map((E,C)=>c.jsx(zE,{label:gu[E.kind]??E.kind,sub:E.enabled===!1?"已停用":"启用",active:o.type==="adapter"&&o.index===C,onClick:()=>l({type:"adapter",index:C})},C)),c.jsxs("div",{className:"mt-2",children:[c.jsx("span",{className:"text-xs font-bold text-[var(--color-text-muted)]",children:"添加频道"}),c.jsx("div",{className:"flex flex-wrap gap-1.5 mt-1.5",children:wq.map(E=>c.jsxs("button",{className:"nb-btn",style:{padding:"4px 8px",fontSize:12},type:"button",onClick:()=>g(E),"aria-label":`添加 ${gu[E]} 频道`,children:[c.jsx(pr,{size:11,strokeWidth:3})," ",gu[E]]},E))})]})]}),c.jsx("div",{className:"border-2 border-[var(--color-text)] rounded-xl p-4 bg-[var(--color-bg-cream)]",children:(()=>{if(o.type!=="adapter")return c.jsx(PE,{console:r.console??{},onChange:b});const E=f[o.index];if(!E)return c.jsx(PE,{console:r.console??{},onChange:b});const C=o.index;return c.jsx(Sq,{adapter:E,onChange:S=>y(C,S),onRemove:()=>m(C)})})()})]})]})}function zE({label:e,sub:t,active:n,onClick:r}){return c.jsxs("button",{type:"button",onClick:r,"aria-pressed":n,className:["text-left rounded-lg px-3 py-2 border-2 border-[var(--color-text)] transition-transform duration-150",n?"bg-[var(--color-accent-mint)] shadow-[3px_3px_0_var(--color-text)]":"bg-white hover:-translate-x-px hover:-translate-y-px hover:shadow-[3px_3px_0_var(--color-text)]"].join(" "),children:[c.jsx("div",{className:"font-bold text-sm",children:e}),c.jsx("div",{className:"text-xs text-[var(--color-text-muted)] truncate font-[family-name:var(--font-mono)]",children:t})]})}function PE({console:e,onChange:t}){return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:"console 桥接"}),c.jsx("p",{className:"text-xs text-[var(--color-text-muted)] mt-1",children:"IM 纯文本消息桥接到项目 agent 对话。设了 URL 才启用桥接;token 为 console 鉴权令牌。"})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Console URL",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",value:e.url??"",onChange:n=>t({url:n.target.value}),placeholder:"http://localhost:4321",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["Console Token(SPS_CONSOLE_TOKEN)",c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:"password",value:e.token??"",onChange:n=>t({token:n.target.value}),placeholder:"鉴权令牌(可空)",spellCheck:!1})]}),c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:["对话后端",c.jsxs("select",{className:"nb-input",value:e.agentKind??"claude",onChange:n=>t({agentKind:n.target.value}),children:[c.jsx("option",{value:"claude",children:"claude"}),c.jsx("option",{value:"openai",children:"openai"})]})]})]})}function Sq({adapter:e,onChange:t,onRemove:n}){const{confirm:r}=un(),a=kq[e.kind]??[],o=e.enabled!==!1;return c.jsxs("div",{className:"flex flex-col gap-4",children:[c.jsxs("div",{className:"flex items-start justify-between gap-2",children:[c.jsxs("div",{children:[c.jsx("span",{className:"font-[family-name:var(--font-heading)] font-bold text-lg",children:gu[e.kind]??e.kind}),c.jsxs("span",{className:"text-[var(--color-text-muted)] text-sm font-[family-name:var(--font-mono)]",children:[" · ",e.kind]})]}),c.jsxs("button",{className:"nb-btn nb-btn-danger shrink-0",style:{padding:"4px 10px",fontSize:12},type:"button",onClick:async()=>{await r({title:"删除频道",body:`删除 ${gu[e.kind]??e.kind} 频道?`,danger:!0})&&n()},"aria-label":"删除频道",children:[c.jsx(fi,{size:12,strokeWidth:3})," 删除"]})]}),c.jsxs("label",{className:"flex items-center gap-2 text-sm font-bold",children:[c.jsx("input",{type:"checkbox",checked:o,onChange:l=>t({enabled:l.target.checked})}),"启用此频道"]}),a.map(l=>c.jsx(Nq,{spec:l,value:e[l.key],onChange:d=>t({[l.key]:d})},l.key))]})}function Nq({spec:e,value:t,onChange:n}){if(e.type==="list"){const r=Array.isArray(t)?t.map(String):[];return c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:[e.label,c.jsx("textarea",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",rows:2,value:r.join(", "),onChange:a=>{const o=a.target.value.split(/[,\n]/).map(l=>l.trim()).filter(Boolean);n(o.length?o:void 0)},placeholder:e.placeholder,spellCheck:!1})]})}return c.jsxs("label",{className:"flex flex-col gap-1 text-sm font-bold",children:[e.label,c.jsx("input",{className:"nb-input font-[family-name:var(--font-mono)] text-sm",type:e.type==="password"?"password":"text",value:t==null?"":String(t),onChange:r=>{const a=r.target.value;e.type==="number"?n(a.trim()===""?void 0:Number(a)):n(a===""?void 0:a)},placeholder:e.placeholder,spellCheck:!1})]})}function Nn(e){if(typeof e=="string"||typeof e=="number")return""+e;let t="";if(Array.isArray(e))for(let n=0,r;n<e.length;n++)(r=Nn(e[n]))!==""&&(t+=(t&&" ")+r);else for(let n in e)e[n]&&(t+=(t&&" ")+n);return t}var _q={value:()=>{}};function cp(){for(var e=0,t=arguments.length,n={},r;e<t;++e){if(!(r=arguments[e]+"")||r in n||/[\s.]/.test(r))throw new Error("illegal type: "+r);n[r]=[]}return new rh(n)}function rh(e){this._=e}function jq(e,t){return e.trim().split(/^|\s+/).map(function(n){var r="",a=n.indexOf(".");if(a>=0&&(r=n.slice(a+1),n=n.slice(0,a)),n&&!t.hasOwnProperty(n))throw new Error("unknown type: "+n);return{type:n,name:r}})}rh.prototype=cp.prototype={constructor:rh,on:function(e,t){var n=this._,r=jq(e+"",n),a,o=-1,l=r.length;if(arguments.length<2){for(;++o<l;)if((a=(e=r[o]).type)&&(a=Cq(n[a],e.name)))return a;return}if(t!=null&&typeof t!="function")throw new Error("invalid callback: "+t);for(;++o<l;)if(a=(e=r[o]).type)n[a]=BE(n[a],e.name,t);else if(t==null)for(a in n)n[a]=BE(n[a],e.name,null);return this},copy:function(){var e={},t=this._;for(var n in t)e[n]=t[n].slice();return new rh(e)},call:function(e,t){if((a=arguments.length-2)>0)for(var n=new Array(a),r=0,a,o;r<a;++r)n[r]=arguments[r+2];if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(o=this._[e],r=0,a=o.length;r<a;++r)o[r].value.apply(t,n)},apply:function(e,t,n){if(!this._.hasOwnProperty(e))throw new Error("unknown type: "+e);for(var r=this._[e],a=0,o=r.length;a<o;++a)r[a].value.apply(t,n)}};function Cq(e,t){for(var n=0,r=e.length,a;n<r;++n)if((a=e[n]).name===t)return a.value}function BE(e,t,n){for(var r=0,a=e.length;r<a;++r)if(e[r].name===t){e[r]=_q,e=e.slice(0,r).concat(e.slice(r+1));break}return n!=null&&e.push({name:t,value:n}),e}var lb="http://www.w3.org/1999/xhtml";const $E={svg:"http://www.w3.org/2000/svg",xhtml:lb,xlink:"http://www.w3.org/1999/xlink",xml:"http://www.w3.org/XML/1998/namespace",xmlns:"http://www.w3.org/2000/xmlns/"};function up(e){var t=e+="",n=t.indexOf(":");return n>=0&&(t=e.slice(0,n))!=="xmlns"&&(e=e.slice(n+1)),$E.hasOwnProperty(t)?{space:$E[t],local:e}:e}function Aq(e){return function(){var t=this.ownerDocument,n=this.namespaceURI;return n===lb&&t.documentElement.namespaceURI===lb?t.createElement(e):t.createElementNS(n,e)}}function Tq(e){return function(){return this.ownerDocument.createElementNS(e.space,e.local)}}function Qj(e){var t=up(e);return(t.local?Tq:Aq)(t)}function Mq(){}function zx(e){return e==null?Mq:function(){return this.querySelector(e)}}function Dq(e){typeof e!="function"&&(e=zx(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var o=t[a],l=o.length,d=r[a]=new Array(l),f,h,g=0;g<l;++g)(f=o[g])&&(h=e.call(f,f.__data__,g,o))&&("__data__"in f&&(h.__data__=f.__data__),d[g]=h);return new Cr(r,this._parents)}function Oq(e){return e==null?[]:Array.isArray(e)?e:Array.from(e)}function Rq(){return[]}function Wj(e){return e==null?Rq:function(){return this.querySelectorAll(e)}}function Lq(e){return function(){return Oq(e.apply(this,arguments))}}function Iq(e){typeof e=="function"?e=Lq(e):e=Wj(e);for(var t=this._groups,n=t.length,r=[],a=[],o=0;o<n;++o)for(var l=t[o],d=l.length,f,h=0;h<d;++h)(f=l[h])&&(r.push(e.call(f,f.__data__,h,l)),a.push(f));return new Cr(r,a)}function Xj(e){return function(){return this.matches(e)}}function Zj(e){return function(t){return t.matches(e)}}var zq=Array.prototype.find;function Pq(e){return function(){return zq.call(this.children,e)}}function Bq(){return this.firstElementChild}function $q(e){return this.select(e==null?Bq:Pq(typeof e=="function"?e:Zj(e)))}var Uq=Array.prototype.filter;function Fq(){return Array.from(this.children)}function qq(e){return function(){return Uq.call(this.children,e)}}function Hq(e){return this.selectAll(e==null?Fq:qq(typeof e=="function"?e:Zj(e)))}function Kq(e){typeof e!="function"&&(e=Xj(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var o=t[a],l=o.length,d=r[a]=[],f,h=0;h<l;++h)(f=o[h])&&e.call(f,f.__data__,h,o)&&d.push(f);return new Cr(r,this._parents)}function Jj(e){return new Array(e.length)}function Gq(){return new Cr(this._enter||this._groups.map(Jj),this._parents)}function _h(e,t){this.ownerDocument=e.ownerDocument,this.namespaceURI=e.namespaceURI,this._next=null,this._parent=e,this.__data__=t}_h.prototype={constructor:_h,appendChild:function(e){return this._parent.insertBefore(e,this._next)},insertBefore:function(e,t){return this._parent.insertBefore(e,t)},querySelector:function(e){return this._parent.querySelector(e)},querySelectorAll:function(e){return this._parent.querySelectorAll(e)}};function Vq(e){return function(){return e}}function Yq(e,t,n,r,a,o){for(var l=0,d,f=t.length,h=o.length;l<h;++l)(d=t[l])?(d.__data__=o[l],r[l]=d):n[l]=new _h(e,o[l]);for(;l<f;++l)(d=t[l])&&(a[l]=d)}function Qq(e,t,n,r,a,o,l){var d,f,h=new Map,g=t.length,m=o.length,y=new Array(g),b;for(d=0;d<g;++d)(f=t[d])&&(y[d]=b=l.call(f,f.__data__,d,t)+"",h.has(b)?a[d]=f:h.set(b,f));for(d=0;d<m;++d)b=l.call(e,o[d],d,o)+"",(f=h.get(b))?(r[d]=f,f.__data__=o[d],h.delete(b)):n[d]=new _h(e,o[d]);for(d=0;d<g;++d)(f=t[d])&&h.get(y[d])===f&&(a[d]=f)}function Wq(e){return e.__data__}function Xq(e,t){if(!arguments.length)return Array.from(this,Wq);var n=t?Qq:Yq,r=this._parents,a=this._groups;typeof e!="function"&&(e=Vq(e));for(var o=a.length,l=new Array(o),d=new Array(o),f=new Array(o),h=0;h<o;++h){var g=r[h],m=a[h],y=m.length,b=Zq(e.call(g,g&&g.__data__,h,r)),k=b.length,v=d[h]=new Array(k),N=l[h]=new Array(k),E=f[h]=new Array(y);n(g,m,v,N,E,b,t);for(var C=0,S=0,_,M;C<k;++C)if(_=v[C]){for(C>=S&&(S=C+1);!(M=N[S])&&++S<k;);_._next=M||null}}return l=new Cr(l,r),l._enter=d,l._exit=f,l}function Zq(e){return typeof e=="object"&&"length"in e?e:Array.from(e)}function Jq(){return new Cr(this._exit||this._groups.map(Jj),this._parents)}function eH(e,t,n){var r=this.enter(),a=this,o=this.exit();return typeof e=="function"?(r=e(r),r&&(r=r.selection())):r=r.append(e+""),t!=null&&(a=t(a),a&&(a=a.selection())),n==null?o.remove():n(o),r&&a?r.merge(a).order():a}function tH(e){for(var t=e.selection?e.selection():e,n=this._groups,r=t._groups,a=n.length,o=r.length,l=Math.min(a,o),d=new Array(a),f=0;f<l;++f)for(var h=n[f],g=r[f],m=h.length,y=d[f]=new Array(m),b,k=0;k<m;++k)(b=h[k]||g[k])&&(y[k]=b);for(;f<a;++f)d[f]=n[f];return new Cr(d,this._parents)}function nH(){for(var e=this._groups,t=-1,n=e.length;++t<n;)for(var r=e[t],a=r.length-1,o=r[a],l;--a>=0;)(l=r[a])&&(o&&l.compareDocumentPosition(o)^4&&o.parentNode.insertBefore(l,o),o=l);return this}function rH(e){e||(e=iH);function t(m,y){return m&&y?e(m.__data__,y.__data__):!m-!y}for(var n=this._groups,r=n.length,a=new Array(r),o=0;o<r;++o){for(var l=n[o],d=l.length,f=a[o]=new Array(d),h,g=0;g<d;++g)(h=l[g])&&(f[g]=h);f.sort(t)}return new Cr(a,this._parents).order()}function iH(e,t){return e<t?-1:e>t?1:e>=t?0:NaN}function aH(){var e=arguments[0];return arguments[0]=this,e.apply(null,arguments),this}function sH(){return Array.from(this)}function oH(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,o=r.length;a<o;++a){var l=r[a];if(l)return l}return null}function lH(){let e=0;for(const t of this)++e;return e}function cH(){return!this.node()}function uH(e){for(var t=this._groups,n=0,r=t.length;n<r;++n)for(var a=t[n],o=0,l=a.length,d;o<l;++o)(d=a[o])&&e.call(d,d.__data__,o,a);return this}function dH(e){return function(){this.removeAttribute(e)}}function fH(e){return function(){this.removeAttributeNS(e.space,e.local)}}function hH(e,t){return function(){this.setAttribute(e,t)}}function pH(e,t){return function(){this.setAttributeNS(e.space,e.local,t)}}function mH(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttribute(e):this.setAttribute(e,n)}}function gH(e,t){return function(){var n=t.apply(this,arguments);n==null?this.removeAttributeNS(e.space,e.local):this.setAttributeNS(e.space,e.local,n)}}function yH(e,t){var n=up(e);if(arguments.length<2){var r=this.node();return n.local?r.getAttributeNS(n.space,n.local):r.getAttribute(n)}return this.each((t==null?n.local?fH:dH:typeof t=="function"?n.local?gH:mH:n.local?pH:hH)(n,t))}function eC(e){return e.ownerDocument&&e.ownerDocument.defaultView||e.document&&e||e.defaultView}function bH(e){return function(){this.style.removeProperty(e)}}function xH(e,t,n){return function(){this.style.setProperty(e,t,n)}}function vH(e,t,n){return function(){var r=t.apply(this,arguments);r==null?this.style.removeProperty(e):this.style.setProperty(e,r,n)}}function wH(e,t,n){return arguments.length>1?this.each((t==null?bH:typeof t=="function"?vH:xH)(e,t,n??"")):Fl(this.node(),e)}function Fl(e,t){return e.style.getPropertyValue(t)||eC(e).getComputedStyle(e,null).getPropertyValue(t)}function kH(e){return function(){delete this[e]}}function EH(e,t){return function(){this[e]=t}}function SH(e,t){return function(){var n=t.apply(this,arguments);n==null?delete this[e]:this[e]=n}}function NH(e,t){return arguments.length>1?this.each((t==null?kH:typeof t=="function"?SH:EH)(e,t)):this.node()[e]}function tC(e){return e.trim().split(/^|\s+/)}function Px(e){return e.classList||new nC(e)}function nC(e){this._node=e,this._names=tC(e.getAttribute("class")||"")}nC.prototype={add:function(e){var t=this._names.indexOf(e);t<0&&(this._names.push(e),this._node.setAttribute("class",this._names.join(" ")))},remove:function(e){var t=this._names.indexOf(e);t>=0&&(this._names.splice(t,1),this._node.setAttribute("class",this._names.join(" ")))},contains:function(e){return this._names.indexOf(e)>=0}};function rC(e,t){for(var n=Px(e),r=-1,a=t.length;++r<a;)n.add(t[r])}function iC(e,t){for(var n=Px(e),r=-1,a=t.length;++r<a;)n.remove(t[r])}function _H(e){return function(){rC(this,e)}}function jH(e){return function(){iC(this,e)}}function CH(e,t){return function(){(t.apply(this,arguments)?rC:iC)(this,e)}}function AH(e,t){var n=tC(e+"");if(arguments.length<2){for(var r=Px(this.node()),a=-1,o=n.length;++a<o;)if(!r.contains(n[a]))return!1;return!0}return this.each((typeof t=="function"?CH:t?_H:jH)(n,t))}function TH(){this.textContent=""}function MH(e){return function(){this.textContent=e}}function DH(e){return function(){var t=e.apply(this,arguments);this.textContent=t??""}}function OH(e){return arguments.length?this.each(e==null?TH:(typeof e=="function"?DH:MH)(e)):this.node().textContent}function RH(){this.innerHTML=""}function LH(e){return function(){this.innerHTML=e}}function IH(e){return function(){var t=e.apply(this,arguments);this.innerHTML=t??""}}function zH(e){return arguments.length?this.each(e==null?RH:(typeof e=="function"?IH:LH)(e)):this.node().innerHTML}function PH(){this.nextSibling&&this.parentNode.appendChild(this)}function BH(){return this.each(PH)}function $H(){this.previousSibling&&this.parentNode.insertBefore(this,this.parentNode.firstChild)}function UH(){return this.each($H)}function FH(e){var t=typeof e=="function"?e:Qj(e);return this.select(function(){return this.appendChild(t.apply(this,arguments))})}function qH(){return null}function HH(e,t){var n=typeof e=="function"?e:Qj(e),r=t==null?qH:typeof t=="function"?t:zx(t);return this.select(function(){return this.insertBefore(n.apply(this,arguments),r.apply(this,arguments)||null)})}function KH(){var e=this.parentNode;e&&e.removeChild(this)}function GH(){return this.each(KH)}function VH(){var e=this.cloneNode(!1),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function YH(){var e=this.cloneNode(!0),t=this.parentNode;return t?t.insertBefore(e,this.nextSibling):e}function QH(e){return this.select(e?YH:VH)}function WH(e){return arguments.length?this.property("__data__",e):this.node().__data__}function XH(e){return function(t){e.call(this,t,this.__data__)}}function ZH(e){return e.trim().split(/^|\s+/).map(function(t){var n="",r=t.indexOf(".");return r>=0&&(n=t.slice(r+1),t=t.slice(0,r)),{type:t,name:n}})}function JH(e){return function(){var t=this.__on;if(t){for(var n=0,r=-1,a=t.length,o;n<a;++n)o=t[n],(!e.type||o.type===e.type)&&o.name===e.name?this.removeEventListener(o.type,o.listener,o.options):t[++r]=o;++r?t.length=r:delete this.__on}}}function e7(e,t,n){return function(){var r=this.__on,a,o=XH(t);if(r){for(var l=0,d=r.length;l<d;++l)if((a=r[l]).type===e.type&&a.name===e.name){this.removeEventListener(a.type,a.listener,a.options),this.addEventListener(a.type,a.listener=o,a.options=n),a.value=t;return}}this.addEventListener(e.type,o,n),a={type:e.type,name:e.name,value:t,listener:o,options:n},r?r.push(a):this.__on=[a]}}function t7(e,t,n){var r=ZH(e+""),a,o=r.length,l;if(arguments.length<2){var d=this.node().__on;if(d){for(var f=0,h=d.length,g;f<h;++f)for(a=0,g=d[f];a<o;++a)if((l=r[a]).type===g.type&&l.name===g.name)return g.value}return}for(d=t?e7:JH,a=0;a<o;++a)this.each(d(r[a],t,n));return this}function aC(e,t,n){var r=eC(e),a=r.CustomEvent;typeof a=="function"?a=new a(t,n):(a=r.document.createEvent("Event"),n?(a.initEvent(t,n.bubbles,n.cancelable),a.detail=n.detail):a.initEvent(t,!1,!1)),e.dispatchEvent(a)}function n7(e,t){return function(){return aC(this,e,t)}}function r7(e,t){return function(){return aC(this,e,t.apply(this,arguments))}}function i7(e,t){return this.each((typeof t=="function"?r7:n7)(e,t))}function*a7(){for(var e=this._groups,t=0,n=e.length;t<n;++t)for(var r=e[t],a=0,o=r.length,l;a<o;++a)(l=r[a])&&(yield l)}var sC=[null];function Cr(e,t){this._groups=e,this._parents=t}function nd(){return new Cr([[document.documentElement]],sC)}function s7(){return this}Cr.prototype=nd.prototype={constructor:Cr,select:Dq,selectAll:Iq,selectChild:$q,selectChildren:Hq,filter:Kq,data:Xq,enter:Gq,exit:Jq,join:eH,merge:tH,selection:s7,order:nH,sort:rH,call:aH,nodes:sH,node:oH,size:lH,empty:cH,each:uH,attr:yH,style:wH,property:NH,classed:AH,text:OH,html:zH,raise:BH,lower:UH,append:FH,insert:HH,remove:GH,clone:QH,datum:WH,on:t7,dispatch:i7,[Symbol.iterator]:a7};function _r(e){return typeof e=="string"?new Cr([[document.querySelector(e)]],[document.documentElement]):new Cr([[e]],sC)}function o7(e){let t;for(;t=e.sourceEvent;)e=t;return e}function si(e,t){if(e=o7(e),t===void 0&&(t=e.currentTarget),t){var n=t.ownerSVGElement||t;if(n.createSVGPoint){var r=n.createSVGPoint();return r.x=e.clientX,r.y=e.clientY,r=r.matrixTransform(t.getScreenCTM().inverse()),[r.x,r.y]}if(t.getBoundingClientRect){var a=t.getBoundingClientRect();return[e.clientX-a.left-t.clientLeft,e.clientY-a.top-t.clientTop]}}return[e.pageX,e.pageY]}const l7={passive:!1},Au={capture:!0,passive:!1};function uy(e){e.stopImmediatePropagation()}function Sl(e){e.preventDefault(),e.stopImmediatePropagation()}function oC(e){var t=e.document.documentElement,n=_r(e).on("dragstart.drag",Sl,Au);"onselectstart"in t?n.on("selectstart.drag",Sl,Au):(t.__noselect=t.style.MozUserSelect,t.style.MozUserSelect="none")}function lC(e,t){var n=e.document.documentElement,r=_r(e).on("dragstart.drag",null);t&&(r.on("click.drag",Sl,Au),setTimeout(function(){r.on("click.drag",null)},0)),"onselectstart"in n?r.on("selectstart.drag",null):(n.style.MozUserSelect=n.__noselect,delete n.__noselect)}const $f=e=>()=>e;function cb(e,{sourceEvent:t,subject:n,target:r,identifier:a,active:o,x:l,y:d,dx:f,dy:h,dispatch:g}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},subject:{value:n,enumerable:!0,configurable:!0},target:{value:r,enumerable:!0,configurable:!0},identifier:{value:a,enumerable:!0,configurable:!0},active:{value:o,enumerable:!0,configurable:!0},x:{value:l,enumerable:!0,configurable:!0},y:{value:d,enumerable:!0,configurable:!0},dx:{value:f,enumerable:!0,configurable:!0},dy:{value:h,enumerable:!0,configurable:!0},_:{value:g}})}cb.prototype.on=function(){var e=this._.on.apply(this._,arguments);return e===this._?this:e};function c7(e){return!e.ctrlKey&&!e.button}function u7(){return this.parentNode}function d7(e,t){return t??{x:e.x,y:e.y}}function f7(){return navigator.maxTouchPoints||"ontouchstart"in this}function cC(){var e=c7,t=u7,n=d7,r=f7,a={},o=cp("start","drag","end"),l=0,d,f,h,g,m=0;function y(_){_.on("mousedown.drag",b).filter(r).on("touchstart.drag",N).on("touchmove.drag",E,l7).on("touchend.drag touchcancel.drag",C).style("touch-action","none").style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}function b(_,M){if(!(g||!e.call(this,_,M))){var T=S(this,t.call(this,_,M),_,M,"mouse");T&&(_r(_.view).on("mousemove.drag",k,Au).on("mouseup.drag",v,Au),oC(_.view),uy(_),h=!1,d=_.clientX,f=_.clientY,T("start",_))}}function k(_){if(Sl(_),!h){var M=_.clientX-d,T=_.clientY-f;h=M*M+T*T>m}a.mouse("drag",_)}function v(_){_r(_.view).on("mousemove.drag mouseup.drag",null),lC(_.view,h),Sl(_),a.mouse("end",_)}function N(_,M){if(e.call(this,_,M)){var T=_.changedTouches,L=t.call(this,_,M),R=T.length,$,z;for($=0;$<R;++$)(z=S(this,L,_,M,T[$].identifier,T[$]))&&(uy(_),z("start",_,T[$]))}}function E(_){var M=_.changedTouches,T=M.length,L,R;for(L=0;L<T;++L)(R=a[M[L].identifier])&&(Sl(_),R("drag",_,M[L]))}function C(_){var M=_.changedTouches,T=M.length,L,R;for(g&&clearTimeout(g),g=setTimeout(function(){g=null},500),L=0;L<T;++L)(R=a[M[L].identifier])&&(uy(_),R("end",_,M[L]))}function S(_,M,T,L,R,$){var z=o.copy(),q=si($||T,M),F,Y,D;if((D=n.call(_,new cb("beforestart",{sourceEvent:T,target:y,identifier:R,active:l,x:q[0],y:q[1],dx:0,dy:0,dispatch:z}),L))!=null)return F=D.x-q[0]||0,Y=D.y-q[1]||0,function H(O,V,Q){var K=q,I;switch(O){case"start":a[R]=H,I=l++;break;case"end":delete a[R],--l;case"drag":q=si(Q||V,M),I=l;break}z.call(O,_,new cb(O,{sourceEvent:V,subject:D,target:y,identifier:R,active:I,x:q[0]+F,y:q[1]+Y,dx:q[0]-K[0],dy:q[1]-K[1],dispatch:z}),L)}}return y.filter=function(_){return arguments.length?(e=typeof _=="function"?_:$f(!!_),y):e},y.container=function(_){return arguments.length?(t=typeof _=="function"?_:$f(_),y):t},y.subject=function(_){return arguments.length?(n=typeof _=="function"?_:$f(_),y):n},y.touchable=function(_){return arguments.length?(r=typeof _=="function"?_:$f(!!_),y):r},y.on=function(){var _=o.on.apply(o,arguments);return _===o?y:_},y.clickDistance=function(_){return arguments.length?(m=(_=+_)*_,y):Math.sqrt(m)},y}function Bx(e,t,n){e.prototype=t.prototype=n,n.constructor=e}function uC(e,t){var n=Object.create(e.prototype);for(var r in t)n[r]=t[r];return n}function rd(){}var Tu=.7,jh=1/Tu,Nl="\\s*([+-]?\\d+)\\s*",Mu="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Di="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",h7=/^#([0-9a-f]{3,8})$/,p7=new RegExp(`^rgb\\(${Nl},${Nl},${Nl}\\)$`),m7=new RegExp(`^rgb\\(${Di},${Di},${Di}\\)$`),g7=new RegExp(`^rgba\\(${Nl},${Nl},${Nl},${Mu}\\)$`),y7=new RegExp(`^rgba\\(${Di},${Di},${Di},${Mu}\\)$`),b7=new RegExp(`^hsl\\(${Mu},${Di},${Di}\\)$`),x7=new RegExp(`^hsla\\(${Mu},${Di},${Di},${Mu}\\)$`),UE={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};Bx(rd,go,{copy(e){return Object.assign(new this.constructor,this,e)},displayable(){return this.rgb().displayable()},hex:FE,formatHex:FE,formatHex8:v7,formatHsl:w7,formatRgb:qE,toString:qE});function FE(){return this.rgb().formatHex()}function v7(){return this.rgb().formatHex8()}function w7(){return dC(this).formatHsl()}function qE(){return this.rgb().formatRgb()}function go(e){var t,n;return e=(e+"").trim().toLowerCase(),(t=h7.exec(e))?(n=t[1].length,t=parseInt(t[1],16),n===6?HE(t):n===3?new hr(t>>8&15|t>>4&240,t>>4&15|t&240,(t&15)<<4|t&15,1):n===8?Uf(t>>24&255,t>>16&255,t>>8&255,(t&255)/255):n===4?Uf(t>>12&15|t>>8&240,t>>8&15|t>>4&240,t>>4&15|t&240,((t&15)<<4|t&15)/255):null):(t=p7.exec(e))?new hr(t[1],t[2],t[3],1):(t=m7.exec(e))?new hr(t[1]*255/100,t[2]*255/100,t[3]*255/100,1):(t=g7.exec(e))?Uf(t[1],t[2],t[3],t[4]):(t=y7.exec(e))?Uf(t[1]*255/100,t[2]*255/100,t[3]*255/100,t[4]):(t=b7.exec(e))?VE(t[1],t[2]/100,t[3]/100,1):(t=x7.exec(e))?VE(t[1],t[2]/100,t[3]/100,t[4]):UE.hasOwnProperty(e)?HE(UE[e]):e==="transparent"?new hr(NaN,NaN,NaN,0):null}function HE(e){return new hr(e>>16&255,e>>8&255,e&255,1)}function Uf(e,t,n,r){return r<=0&&(e=t=n=NaN),new hr(e,t,n,r)}function k7(e){return e instanceof rd||(e=go(e)),e?(e=e.rgb(),new hr(e.r,e.g,e.b,e.opacity)):new hr}function ub(e,t,n,r){return arguments.length===1?k7(e):new hr(e,t,n,r??1)}function hr(e,t,n,r){this.r=+e,this.g=+t,this.b=+n,this.opacity=+r}Bx(hr,ub,uC(rd,{brighter(e){return e=e==null?jh:Math.pow(jh,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,e),new hr(this.r*e,this.g*e,this.b*e,this.opacity)},rgb(){return this},clamp(){return new hr(co(this.r),co(this.g),co(this.b),Ch(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:KE,formatHex:KE,formatHex8:E7,formatRgb:GE,toString:GE}));function KE(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}`}function E7(){return`#${Js(this.r)}${Js(this.g)}${Js(this.b)}${Js((isNaN(this.opacity)?1:this.opacity)*255)}`}function GE(){const e=Ch(this.opacity);return`${e===1?"rgb(":"rgba("}${co(this.r)}, ${co(this.g)}, ${co(this.b)}${e===1?")":`, ${e})`}`}function Ch(e){return isNaN(e)?1:Math.max(0,Math.min(1,e))}function co(e){return Math.max(0,Math.min(255,Math.round(e)||0))}function Js(e){return e=co(e),(e<16?"0":"")+e.toString(16)}function VE(e,t,n,r){return r<=0?e=t=n=NaN:n<=0||n>=1?e=t=NaN:t<=0&&(e=NaN),new oi(e,t,n,r)}function dC(e){if(e instanceof oi)return new oi(e.h,e.s,e.l,e.opacity);if(e instanceof rd||(e=go(e)),!e)return new oi;if(e instanceof oi)return e;e=e.rgb();var t=e.r/255,n=e.g/255,r=e.b/255,a=Math.min(t,n,r),o=Math.max(t,n,r),l=NaN,d=o-a,f=(o+a)/2;return d?(t===o?l=(n-r)/d+(n<r)*6:n===o?l=(r-t)/d+2:l=(t-n)/d+4,d/=f<.5?o+a:2-o-a,l*=60):d=f>0&&f<1?0:l,new oi(l,d,f,e.opacity)}function S7(e,t,n,r){return arguments.length===1?dC(e):new oi(e,t,n,r??1)}function oi(e,t,n,r){this.h=+e,this.s=+t,this.l=+n,this.opacity=+r}Bx(oi,S7,uC(rd,{brighter(e){return e=e==null?jh:Math.pow(jh,e),new oi(this.h,this.s,this.l*e,this.opacity)},darker(e){return e=e==null?Tu:Math.pow(Tu,e),new oi(this.h,this.s,this.l*e,this.opacity)},rgb(){var e=this.h%360+(this.h<0)*360,t=isNaN(e)||isNaN(this.s)?0:this.s,n=this.l,r=n+(n<.5?n:1-n)*t,a=2*n-r;return new hr(dy(e>=240?e-240:e+120,a,r),dy(e,a,r),dy(e<120?e+240:e-120,a,r),this.opacity)},clamp(){return new oi(YE(this.h),Ff(this.s),Ff(this.l),Ch(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const e=Ch(this.opacity);return`${e===1?"hsl(":"hsla("}${YE(this.h)}, ${Ff(this.s)*100}%, ${Ff(this.l)*100}%${e===1?")":`, ${e})`}`}}));function YE(e){return e=(e||0)%360,e<0?e+360:e}function Ff(e){return Math.max(0,Math.min(1,e||0))}function dy(e,t,n){return(e<60?t+(n-t)*e/60:e<180?n:e<240?t+(n-t)*(240-e)/60:t)*255}const $x=e=>()=>e;function N7(e,t){return function(n){return e+n*t}}function _7(e,t,n){return e=Math.pow(e,n),t=Math.pow(t,n)-e,n=1/n,function(r){return Math.pow(e+r*t,n)}}function j7(e){return(e=+e)==1?fC:function(t,n){return n-t?_7(t,n,e):$x(isNaN(t)?n:t)}}function fC(e,t){var n=t-e;return n?N7(e,n):$x(isNaN(e)?t:e)}const Ah=(function e(t){var n=j7(t);function r(a,o){var l=n((a=ub(a)).r,(o=ub(o)).r),d=n(a.g,o.g),f=n(a.b,o.b),h=fC(a.opacity,o.opacity);return function(g){return a.r=l(g),a.g=d(g),a.b=f(g),a.opacity=h(g),a+""}}return r.gamma=e,r})(1);function C7(e,t){t||(t=[]);var n=e?Math.min(t.length,e.length):0,r=t.slice(),a;return function(o){for(a=0;a<n;++a)r[a]=e[a]*(1-o)+t[a]*o;return r}}function A7(e){return ArrayBuffer.isView(e)&&!(e instanceof DataView)}function T7(e,t){var n=t?t.length:0,r=e?Math.min(n,e.length):0,a=new Array(r),o=new Array(n),l;for(l=0;l<r;++l)a[l]=yu(e[l],t[l]);for(;l<n;++l)o[l]=t[l];return function(d){for(l=0;l<r;++l)o[l]=a[l](d);return o}}function M7(e,t){var n=new Date;return e=+e,t=+t,function(r){return n.setTime(e*(1-r)+t*r),n}}function Ai(e,t){return e=+e,t=+t,function(n){return e*(1-n)+t*n}}function D7(e,t){var n={},r={},a;(e===null||typeof e!="object")&&(e={}),(t===null||typeof t!="object")&&(t={});for(a in t)a in e?n[a]=yu(e[a],t[a]):r[a]=t[a];return function(o){for(a in n)r[a]=n[a](o);return r}}var db=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,fy=new RegExp(db.source,"g");function O7(e){return function(){return e}}function R7(e){return function(t){return e(t)+""}}function hC(e,t){var n=db.lastIndex=fy.lastIndex=0,r,a,o,l=-1,d=[],f=[];for(e=e+"",t=t+"";(r=db.exec(e))&&(a=fy.exec(t));)(o=a.index)>n&&(o=t.slice(n,o),d[l]?d[l]+=o:d[++l]=o),(r=r[0])===(a=a[0])?d[l]?d[l]+=a:d[++l]=a:(d[++l]=null,f.push({i:l,x:Ai(r,a)})),n=fy.lastIndex;return n<t.length&&(o=t.slice(n),d[l]?d[l]+=o:d[++l]=o),d.length<2?f[0]?R7(f[0].x):O7(t):(t=f.length,function(h){for(var g=0,m;g<t;++g)d[(m=f[g]).i]=m.x(h);return d.join("")})}function yu(e,t){var n=typeof t,r;return t==null||n==="boolean"?$x(t):(n==="number"?Ai:n==="string"?(r=go(t))?(t=r,Ah):hC:t instanceof go?Ah:t instanceof Date?M7:A7(t)?C7:Array.isArray(t)?T7:typeof t.valueOf!="function"&&typeof t.toString!="function"||isNaN(t)?D7:Ai)(e,t)}var QE=180/Math.PI,fb={translateX:0,translateY:0,rotate:0,skewX:0,scaleX:1,scaleY:1};function pC(e,t,n,r,a,o){var l,d,f;return(l=Math.sqrt(e*e+t*t))&&(e/=l,t/=l),(f=e*n+t*r)&&(n-=e*f,r-=t*f),(d=Math.sqrt(n*n+r*r))&&(n/=d,r/=d,f/=d),e*r<t*n&&(e=-e,t=-t,f=-f,l=-l),{translateX:a,translateY:o,rotate:Math.atan2(t,e)*QE,skewX:Math.atan(f)*QE,scaleX:l,scaleY:d}}var qf;function L7(e){const t=new(typeof DOMMatrix=="function"?DOMMatrix:WebKitCSSMatrix)(e+"");return t.isIdentity?fb:pC(t.a,t.b,t.c,t.d,t.e,t.f)}function I7(e){return e==null||(qf||(qf=document.createElementNS("http://www.w3.org/2000/svg","g")),qf.setAttribute("transform",e),!(e=qf.transform.baseVal.consolidate()))?fb:(e=e.matrix,pC(e.a,e.b,e.c,e.d,e.e,e.f))}function mC(e,t,n,r){function a(h){return h.length?h.pop()+" ":""}function o(h,g,m,y,b,k){if(h!==m||g!==y){var v=b.push("translate(",null,t,null,n);k.push({i:v-4,x:Ai(h,m)},{i:v-2,x:Ai(g,y)})}else(m||y)&&b.push("translate("+m+t+y+n)}function l(h,g,m,y){h!==g?(h-g>180?g+=360:g-h>180&&(h+=360),y.push({i:m.push(a(m)+"rotate(",null,r)-2,x:Ai(h,g)})):g&&m.push(a(m)+"rotate("+g+r)}function d(h,g,m,y){h!==g?y.push({i:m.push(a(m)+"skewX(",null,r)-2,x:Ai(h,g)}):g&&m.push(a(m)+"skewX("+g+r)}function f(h,g,m,y,b,k){if(h!==m||g!==y){var v=b.push(a(b)+"scale(",null,",",null,")");k.push({i:v-4,x:Ai(h,m)},{i:v-2,x:Ai(g,y)})}else(m!==1||y!==1)&&b.push(a(b)+"scale("+m+","+y+")")}return function(h,g){var m=[],y=[];return h=e(h),g=e(g),o(h.translateX,h.translateY,g.translateX,g.translateY,m,y),l(h.rotate,g.rotate,m,y),d(h.skewX,g.skewX,m,y),f(h.scaleX,h.scaleY,g.scaleX,g.scaleY,m,y),h=g=null,function(b){for(var k=-1,v=y.length,N;++k<v;)m[(N=y[k]).i]=N.x(b);return m.join("")}}}var z7=mC(L7,"px, ","px)","deg)"),P7=mC(I7,", ",")",")"),B7=1e-12;function WE(e){return((e=Math.exp(e))+1/e)/2}function $7(e){return((e=Math.exp(e))-1/e)/2}function U7(e){return((e=Math.exp(2*e))-1)/(e+1)}const ih=(function e(t,n,r){function a(o,l){var d=o[0],f=o[1],h=o[2],g=l[0],m=l[1],y=l[2],b=g-d,k=m-f,v=b*b+k*k,N,E;if(v<B7)E=Math.log(y/h)/t,N=function(L){return[d+L*b,f+L*k,h*Math.exp(t*L*E)]};else{var C=Math.sqrt(v),S=(y*y-h*h+r*v)/(2*h*n*C),_=(y*y-h*h-r*v)/(2*y*n*C),M=Math.log(Math.sqrt(S*S+1)-S),T=Math.log(Math.sqrt(_*_+1)-_);E=(T-M)/t,N=function(L){var R=L*E,$=WE(M),z=h/(n*C)*($*U7(t*R+M)-$7(M));return[d+z*b,f+z*k,h*$/WE(t*R+M)]}}return N.duration=E*1e3*t/Math.SQRT2,N}return a.rho=function(o){var l=Math.max(.001,+o),d=l*l,f=d*d;return e(l,d,f)},a})(Math.SQRT2,2,4);var ql=0,uu=0,su=0,gC=1e3,Th,du,Mh=0,yo=0,dp=0,Du=typeof performance=="object"&&performance.now?performance:Date,yC=typeof window=="object"&&window.requestAnimationFrame?window.requestAnimationFrame.bind(window):function(e){setTimeout(e,17)};function Ux(){return yo||(yC(F7),yo=Du.now()+dp)}function F7(){yo=0}function Dh(){this._call=this._time=this._next=null}Dh.prototype=bC.prototype={constructor:Dh,restart:function(e,t,n){if(typeof e!="function")throw new TypeError("callback is not a function");n=(n==null?Ux():+n)+(t==null?0:+t),!this._next&&du!==this&&(du?du._next=this:Th=this,du=this),this._call=e,this._time=n,hb()},stop:function(){this._call&&(this._call=null,this._time=1/0,hb())}};function bC(e,t,n){var r=new Dh;return r.restart(e,t,n),r}function q7(){Ux(),++ql;for(var e=Th,t;e;)(t=yo-e._time)>=0&&e._call.call(void 0,t),e=e._next;--ql}function XE(){yo=(Mh=Du.now())+dp,ql=uu=0;try{q7()}finally{ql=0,K7(),yo=0}}function H7(){var e=Du.now(),t=e-Mh;t>gC&&(dp-=t,Mh=e)}function K7(){for(var e,t=Th,n,r=1/0;t;)t._call?(r>t._time&&(r=t._time),e=t,t=t._next):(n=t._next,t._next=null,t=e?e._next=n:Th=n);du=e,hb(r)}function hb(e){if(!ql){uu&&(uu=clearTimeout(uu));var t=e-yo;t>24?(e<1/0&&(uu=setTimeout(XE,e-Du.now()-dp)),su&&(su=clearInterval(su))):(su||(Mh=Du.now(),su=setInterval(H7,gC)),ql=1,yC(XE))}}function ZE(e,t,n){var r=new Dh;return t=t==null?0:+t,r.restart(a=>{r.stop(),e(a+t)},t,n),r}var G7=cp("start","end","cancel","interrupt"),V7=[],xC=0,JE=1,pb=2,ah=3,eS=4,mb=5,sh=6;function fp(e,t,n,r,a,o){var l=e.__transition;if(!l)e.__transition={};else if(n in l)return;Y7(e,n,{name:t,index:r,group:a,on:G7,tween:V7,time:o.time,delay:o.delay,duration:o.duration,ease:o.ease,timer:null,state:xC})}function Fx(e,t){var n=gi(e,t);if(n.state>xC)throw new Error("too late; already scheduled");return n}function zi(e,t){var n=gi(e,t);if(n.state>ah)throw new Error("too late; already running");return n}function gi(e,t){var n=e.__transition;if(!n||!(n=n[t]))throw new Error("transition not found");return n}function Y7(e,t,n){var r=e.__transition,a;r[t]=n,n.timer=bC(o,0,n.time);function o(h){n.state=JE,n.timer.restart(l,n.delay,n.time),n.delay<=h&&l(h-n.delay)}function l(h){var g,m,y,b;if(n.state!==JE)return f();for(g in r)if(b=r[g],b.name===n.name){if(b.state===ah)return ZE(l);b.state===eS?(b.state=sh,b.timer.stop(),b.on.call("interrupt",e,e.__data__,b.index,b.group),delete r[g]):+g<t&&(b.state=sh,b.timer.stop(),b.on.call("cancel",e,e.__data__,b.index,b.group),delete r[g])}if(ZE(function(){n.state===ah&&(n.state=eS,n.timer.restart(d,n.delay,n.time),d(h))}),n.state=pb,n.on.call("start",e,e.__data__,n.index,n.group),n.state===pb){for(n.state=ah,a=new Array(y=n.tween.length),g=0,m=-1;g<y;++g)(b=n.tween[g].value.call(e,e.__data__,n.index,n.group))&&(a[++m]=b);a.length=m+1}}function d(h){for(var g=h<n.duration?n.ease.call(null,h/n.duration):(n.timer.restart(f),n.state=mb,1),m=-1,y=a.length;++m<y;)a[m].call(e,g);n.state===mb&&(n.on.call("end",e,e.__data__,n.index,n.group),f())}function f(){n.state=sh,n.timer.stop(),delete r[t];for(var h in r)return;delete e.__transition}}function oh(e,t){var n=e.__transition,r,a,o=!0,l;if(n){t=t==null?null:t+"";for(l in n){if((r=n[l]).name!==t){o=!1;continue}a=r.state>pb&&r.state<mb,r.state=sh,r.timer.stop(),r.on.call(a?"interrupt":"cancel",e,e.__data__,r.index,r.group),delete n[l]}o&&delete e.__transition}}function Q7(e){return this.each(function(){oh(this,e)})}function W7(e,t){var n,r;return function(){var a=zi(this,e),o=a.tween;if(o!==n){r=n=o;for(var l=0,d=r.length;l<d;++l)if(r[l].name===t){r=r.slice(),r.splice(l,1);break}}a.tween=r}}function X7(e,t,n){var r,a;if(typeof n!="function")throw new Error;return function(){var o=zi(this,e),l=o.tween;if(l!==r){a=(r=l).slice();for(var d={name:t,value:n},f=0,h=a.length;f<h;++f)if(a[f].name===t){a[f]=d;break}f===h&&a.push(d)}o.tween=a}}function Z7(e,t){var n=this._id;if(e+="",arguments.length<2){for(var r=gi(this.node(),n).tween,a=0,o=r.length,l;a<o;++a)if((l=r[a]).name===e)return l.value;return null}return this.each((t==null?W7:X7)(n,e,t))}function qx(e,t,n){var r=e._id;return e.each(function(){var a=zi(this,r);(a.value||(a.value={}))[t]=n.apply(this,arguments)}),function(a){return gi(a,r).value[t]}}function vC(e,t){var n;return(typeof t=="number"?Ai:t instanceof go?Ah:(n=go(t))?(t=n,Ah):hC)(e,t)}function J7(e){return function(){this.removeAttribute(e)}}function eK(e){return function(){this.removeAttributeNS(e.space,e.local)}}function tK(e,t,n){var r,a=n+"",o;return function(){var l=this.getAttribute(e);return l===a?null:l===r?o:o=t(r=l,n)}}function nK(e,t,n){var r,a=n+"",o;return function(){var l=this.getAttributeNS(e.space,e.local);return l===a?null:l===r?o:o=t(r=l,n)}}function rK(e,t,n){var r,a,o;return function(){var l,d=n(this),f;return d==null?void this.removeAttribute(e):(l=this.getAttribute(e),f=d+"",l===f?null:l===r&&f===a?o:(a=f,o=t(r=l,d)))}}function iK(e,t,n){var r,a,o;return function(){var l,d=n(this),f;return d==null?void this.removeAttributeNS(e.space,e.local):(l=this.getAttributeNS(e.space,e.local),f=d+"",l===f?null:l===r&&f===a?o:(a=f,o=t(r=l,d)))}}function aK(e,t){var n=up(e),r=n==="transform"?P7:vC;return this.attrTween(e,typeof t=="function"?(n.local?iK:rK)(n,r,qx(this,"attr."+e,t)):t==null?(n.local?eK:J7)(n):(n.local?nK:tK)(n,r,t))}function sK(e,t){return function(n){this.setAttribute(e,t.call(this,n))}}function oK(e,t){return function(n){this.setAttributeNS(e.space,e.local,t.call(this,n))}}function lK(e,t){var n,r;function a(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&oK(e,o)),n}return a._value=t,a}function cK(e,t){var n,r;function a(){var o=t.apply(this,arguments);return o!==r&&(n=(r=o)&&sK(e,o)),n}return a._value=t,a}function uK(e,t){var n="attr."+e;if(arguments.length<2)return(n=this.tween(n))&&n._value;if(t==null)return this.tween(n,null);if(typeof t!="function")throw new Error;var r=up(e);return this.tween(n,(r.local?lK:cK)(r,t))}function dK(e,t){return function(){Fx(this,e).delay=+t.apply(this,arguments)}}function fK(e,t){return t=+t,function(){Fx(this,e).delay=t}}function hK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?dK:fK)(t,e)):gi(this.node(),t).delay}function pK(e,t){return function(){zi(this,e).duration=+t.apply(this,arguments)}}function mK(e,t){return t=+t,function(){zi(this,e).duration=t}}function gK(e){var t=this._id;return arguments.length?this.each((typeof e=="function"?pK:mK)(t,e)):gi(this.node(),t).duration}function yK(e,t){if(typeof t!="function")throw new Error;return function(){zi(this,e).ease=t}}function bK(e){var t=this._id;return arguments.length?this.each(yK(t,e)):gi(this.node(),t).ease}function xK(e,t){return function(){var n=t.apply(this,arguments);if(typeof n!="function")throw new Error;zi(this,e).ease=n}}function vK(e){if(typeof e!="function")throw new Error;return this.each(xK(this._id,e))}function wK(e){typeof e!="function"&&(e=Xj(e));for(var t=this._groups,n=t.length,r=new Array(n),a=0;a<n;++a)for(var o=t[a],l=o.length,d=r[a]=[],f,h=0;h<l;++h)(f=o[h])&&e.call(f,f.__data__,h,o)&&d.push(f);return new ba(r,this._parents,this._name,this._id)}function kK(e){if(e._id!==this._id)throw new Error;for(var t=this._groups,n=e._groups,r=t.length,a=n.length,o=Math.min(r,a),l=new Array(r),d=0;d<o;++d)for(var f=t[d],h=n[d],g=f.length,m=l[d]=new Array(g),y,b=0;b<g;++b)(y=f[b]||h[b])&&(m[b]=y);for(;d<r;++d)l[d]=t[d];return new ba(l,this._parents,this._name,this._id)}function EK(e){return(e+"").trim().split(/^|\s+/).every(function(t){var n=t.indexOf(".");return n>=0&&(t=t.slice(0,n)),!t||t==="start"})}function SK(e,t,n){var r,a,o=EK(t)?Fx:zi;return function(){var l=o(this,e),d=l.on;d!==r&&(a=(r=d).copy()).on(t,n),l.on=a}}function NK(e,t){var n=this._id;return arguments.length<2?gi(this.node(),n).on.on(e):this.each(SK(n,e,t))}function _K(e){return function(){var t=this.parentNode;for(var n in this.__transition)if(+n!==e)return;t&&t.removeChild(this)}}function jK(){return this.on("end.remove",_K(this._id))}function CK(e){var t=this._name,n=this._id;typeof e!="function"&&(e=zx(e));for(var r=this._groups,a=r.length,o=new Array(a),l=0;l<a;++l)for(var d=r[l],f=d.length,h=o[l]=new Array(f),g,m,y=0;y<f;++y)(g=d[y])&&(m=e.call(g,g.__data__,y,d))&&("__data__"in g&&(m.__data__=g.__data__),h[y]=m,fp(h[y],t,n,y,h,gi(g,n)));return new ba(o,this._parents,t,n)}function AK(e){var t=this._name,n=this._id;typeof e!="function"&&(e=Wj(e));for(var r=this._groups,a=r.length,o=[],l=[],d=0;d<a;++d)for(var f=r[d],h=f.length,g,m=0;m<h;++m)if(g=f[m]){for(var y=e.call(g,g.__data__,m,f),b,k=gi(g,n),v=0,N=y.length;v<N;++v)(b=y[v])&&fp(b,t,n,v,y,k);o.push(y),l.push(g)}return new ba(o,l,t,n)}var TK=nd.prototype.constructor;function MK(){return new TK(this._groups,this._parents)}function DK(e,t){var n,r,a;return function(){var o=Fl(this,e),l=(this.style.removeProperty(e),Fl(this,e));return o===l?null:o===n&&l===r?a:a=t(n=o,r=l)}}function wC(e){return function(){this.style.removeProperty(e)}}function OK(e,t,n){var r,a=n+"",o;return function(){var l=Fl(this,e);return l===a?null:l===r?o:o=t(r=l,n)}}function RK(e,t,n){var r,a,o;return function(){var l=Fl(this,e),d=n(this),f=d+"";return d==null&&(f=d=(this.style.removeProperty(e),Fl(this,e))),l===f?null:l===r&&f===a?o:(a=f,o=t(r=l,d))}}function LK(e,t){var n,r,a,o="style."+t,l="end."+o,d;return function(){var f=zi(this,e),h=f.on,g=f.value[o]==null?d||(d=wC(t)):void 0;(h!==n||a!==g)&&(r=(n=h).copy()).on(l,a=g),f.on=r}}function IK(e,t,n){var r=(e+="")=="transform"?z7:vC;return t==null?this.styleTween(e,DK(e,r)).on("end.style."+e,wC(e)):typeof t=="function"?this.styleTween(e,RK(e,r,qx(this,"style."+e,t))).each(LK(this._id,e)):this.styleTween(e,OK(e,r,t),n).on("end.style."+e,null)}function zK(e,t,n){return function(r){this.style.setProperty(e,t.call(this,r),n)}}function PK(e,t,n){var r,a;function o(){var l=t.apply(this,arguments);return l!==a&&(r=(a=l)&&zK(e,l,n)),r}return o._value=t,o}function BK(e,t,n){var r="style."+(e+="");if(arguments.length<2)return(r=this.tween(r))&&r._value;if(t==null)return this.tween(r,null);if(typeof t!="function")throw new Error;return this.tween(r,PK(e,t,n??""))}function $K(e){return function(){this.textContent=e}}function UK(e){return function(){var t=e(this);this.textContent=t??""}}function FK(e){return this.tween("text",typeof e=="function"?UK(qx(this,"text",e)):$K(e==null?"":e+""))}function qK(e){return function(t){this.textContent=e.call(this,t)}}function HK(e){var t,n;function r(){var a=e.apply(this,arguments);return a!==n&&(t=(n=a)&&qK(a)),t}return r._value=e,r}function KK(e){var t="text";if(arguments.length<1)return(t=this.tween(t))&&t._value;if(e==null)return this.tween(t,null);if(typeof e!="function")throw new Error;return this.tween(t,HK(e))}function GK(){for(var e=this._name,t=this._id,n=kC(),r=this._groups,a=r.length,o=0;o<a;++o)for(var l=r[o],d=l.length,f,h=0;h<d;++h)if(f=l[h]){var g=gi(f,t);fp(f,e,n,h,l,{time:g.time+g.delay+g.duration,delay:0,duration:g.duration,ease:g.ease})}return new ba(r,this._parents,e,n)}function VK(){var e,t,n=this,r=n._id,a=n.size();return new Promise(function(o,l){var d={value:l},f={value:function(){--a===0&&o()}};n.each(function(){var h=zi(this,r),g=h.on;g!==e&&(t=(e=g).copy(),t._.cancel.push(d),t._.interrupt.push(d),t._.end.push(f)),h.on=t}),a===0&&o()})}var YK=0;function ba(e,t,n,r){this._groups=e,this._parents=t,this._name=n,this._id=r}function kC(){return++YK}var aa=nd.prototype;ba.prototype={constructor:ba,select:CK,selectAll:AK,selectChild:aa.selectChild,selectChildren:aa.selectChildren,filter:wK,merge:kK,selection:MK,transition:GK,call:aa.call,nodes:aa.nodes,node:aa.node,size:aa.size,empty:aa.empty,each:aa.each,on:NK,attr:aK,attrTween:uK,style:IK,styleTween:BK,text:FK,textTween:KK,remove:jK,tween:Z7,delay:hK,duration:gK,ease:bK,easeVarying:vK,end:VK,[Symbol.iterator]:aa[Symbol.iterator]};function QK(e){return((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2}var WK={time:null,delay:0,duration:250,ease:QK};function XK(e,t){for(var n;!(n=e.__transition)||!(n=n[t]);)if(!(e=e.parentNode))throw new Error(`transition ${t} not found`);return n}function ZK(e){var t,n;e instanceof ba?(t=e._id,e=e._name):(t=kC(),(n=WK).time=Ux(),e=e==null?null:e+"");for(var r=this._groups,a=r.length,o=0;o<a;++o)for(var l=r[o],d=l.length,f,h=0;h<d;++h)(f=l[h])&&fp(f,e,t,h,l,n||XK(f,t));return new ba(r,this._parents,e,t)}nd.prototype.interrupt=Q7;nd.prototype.transition=ZK;const Hf=e=>()=>e;function JK(e,{sourceEvent:t,target:n,transform:r,dispatch:a}){Object.defineProperties(this,{type:{value:e,enumerable:!0,configurable:!0},sourceEvent:{value:t,enumerable:!0,configurable:!0},target:{value:n,enumerable:!0,configurable:!0},transform:{value:r,enumerable:!0,configurable:!0},_:{value:a}})}function fa(e,t,n){this.k=e,this.x=t,this.y=n}fa.prototype={constructor:fa,scale:function(e){return e===1?this:new fa(this.k*e,this.x,this.y)},translate:function(e,t){return e===0&t===0?this:new fa(this.k,this.x+this.k*e,this.y+this.k*t)},apply:function(e){return[e[0]*this.k+this.x,e[1]*this.k+this.y]},applyX:function(e){return e*this.k+this.x},applyY:function(e){return e*this.k+this.y},invert:function(e){return[(e[0]-this.x)/this.k,(e[1]-this.y)/this.k]},invertX:function(e){return(e-this.x)/this.k},invertY:function(e){return(e-this.y)/this.k},rescaleX:function(e){return e.copy().domain(e.range().map(this.invertX,this).map(e.invert,e))},rescaleY:function(e){return e.copy().domain(e.range().map(this.invertY,this).map(e.invert,e))},toString:function(){return"translate("+this.x+","+this.y+") scale("+this.k+")"}};var hp=new fa(1,0,0);EC.prototype=fa.prototype;function EC(e){for(;!e.__zoom;)if(!(e=e.parentNode))return hp;return e.__zoom}function hy(e){e.stopImmediatePropagation()}function ou(e){e.preventDefault(),e.stopImmediatePropagation()}function eG(e){return(!e.ctrlKey||e.type==="wheel")&&!e.button}function tG(){var e=this;return e instanceof SVGElement?(e=e.ownerSVGElement||e,e.hasAttribute("viewBox")?(e=e.viewBox.baseVal,[[e.x,e.y],[e.x+e.width,e.y+e.height]]):[[0,0],[e.width.baseVal.value,e.height.baseVal.value]]):[[0,0],[e.clientWidth,e.clientHeight]]}function tS(){return this.__zoom||hp}function nG(e){return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*(e.ctrlKey?10:1)}function rG(){return navigator.maxTouchPoints||"ontouchstart"in this}function iG(e,t,n){var r=e.invertX(t[0][0])-n[0][0],a=e.invertX(t[1][0])-n[1][0],o=e.invertY(t[0][1])-n[0][1],l=e.invertY(t[1][1])-n[1][1];return e.translate(a>r?(r+a)/2:Math.min(0,r)||Math.max(0,a),l>o?(o+l)/2:Math.min(0,o)||Math.max(0,l))}function SC(){var e=eG,t=tG,n=iG,r=nG,a=rG,o=[0,1/0],l=[[-1/0,-1/0],[1/0,1/0]],d=250,f=ih,h=cp("start","zoom","end"),g,m,y,b=500,k=150,v=0,N=10;function E(D){D.property("__zoom",tS).on("wheel.zoom",R,{passive:!1}).on("mousedown.zoom",$).on("dblclick.zoom",z).filter(a).on("touchstart.zoom",q).on("touchmove.zoom",F).on("touchend.zoom touchcancel.zoom",Y).style("-webkit-tap-highlight-color","rgba(0,0,0,0)")}E.transform=function(D,H,O,V){var Q=D.selection?D.selection():D;Q.property("__zoom",tS),D!==Q?M(D,H,O,V):Q.interrupt().each(function(){T(this,arguments).event(V).start().zoom(null,typeof H=="function"?H.apply(this,arguments):H).end()})},E.scaleBy=function(D,H,O,V){E.scaleTo(D,function(){var Q=this.__zoom.k,K=typeof H=="function"?H.apply(this,arguments):H;return Q*K},O,V)},E.scaleTo=function(D,H,O,V){E.transform(D,function(){var Q=t.apply(this,arguments),K=this.__zoom,I=O==null?_(Q):typeof O=="function"?O.apply(this,arguments):O,P=K.invert(I),G=typeof H=="function"?H.apply(this,arguments):H;return n(S(C(K,G),I,P),Q,l)},O,V)},E.translateBy=function(D,H,O,V){E.transform(D,function(){return n(this.__zoom.translate(typeof H=="function"?H.apply(this,arguments):H,typeof O=="function"?O.apply(this,arguments):O),t.apply(this,arguments),l)},null,V)},E.translateTo=function(D,H,O,V,Q){E.transform(D,function(){var K=t.apply(this,arguments),I=this.__zoom,P=V==null?_(K):typeof V=="function"?V.apply(this,arguments):V;return n(hp.translate(P[0],P[1]).scale(I.k).translate(typeof H=="function"?-H.apply(this,arguments):-H,typeof O=="function"?-O.apply(this,arguments):-O),K,l)},V,Q)};function C(D,H){return H=Math.max(o[0],Math.min(o[1],H)),H===D.k?D:new fa(H,D.x,D.y)}function S(D,H,O){var V=H[0]-O[0]*D.k,Q=H[1]-O[1]*D.k;return V===D.x&&Q===D.y?D:new fa(D.k,V,Q)}function _(D){return[(+D[0][0]+ +D[1][0])/2,(+D[0][1]+ +D[1][1])/2]}function M(D,H,O,V){D.on("start.zoom",function(){T(this,arguments).event(V).start()}).on("interrupt.zoom end.zoom",function(){T(this,arguments).event(V).end()}).tween("zoom",function(){var Q=this,K=arguments,I=T(Q,K).event(V),P=t.apply(Q,K),G=O==null?_(P):typeof O=="function"?O.apply(Q,K):O,B=Math.max(P[1][0]-P[0][0],P[1][1]-P[0][1]),oe=Q.__zoom,ve=typeof H=="function"?H.apply(Q,K):H,ke=f(oe.invert(G).concat(B/oe.k),ve.invert(G).concat(B/ve.k));return function(Se){if(Se===1)Se=ve;else{var J=ke(Se),ue=B/J[2];Se=new fa(ue,G[0]-J[0]*ue,G[1]-J[1]*ue)}I.zoom(null,Se)}})}function T(D,H,O){return!O&&D.__zooming||new L(D,H)}function L(D,H){this.that=D,this.args=H,this.active=0,this.sourceEvent=null,this.extent=t.apply(D,H),this.taps=0}L.prototype={event:function(D){return D&&(this.sourceEvent=D),this},start:function(){return++this.active===1&&(this.that.__zooming=this,this.emit("start")),this},zoom:function(D,H){return this.mouse&&D!=="mouse"&&(this.mouse[1]=H.invert(this.mouse[0])),this.touch0&&D!=="touch"&&(this.touch0[1]=H.invert(this.touch0[0])),this.touch1&&D!=="touch"&&(this.touch1[1]=H.invert(this.touch1[0])),this.that.__zoom=H,this.emit("zoom"),this},end:function(){return--this.active===0&&(delete this.that.__zooming,this.emit("end")),this},emit:function(D){var H=_r(this.that).datum();h.call(D,this.that,new JK(D,{sourceEvent:this.sourceEvent,target:E,transform:this.that.__zoom,dispatch:h}),H)}};function R(D,...H){if(!e.apply(this,arguments))return;var O=T(this,H).event(D),V=this.__zoom,Q=Math.max(o[0],Math.min(o[1],V.k*Math.pow(2,r.apply(this,arguments)))),K=si(D);if(O.wheel)(O.mouse[0][0]!==K[0]||O.mouse[0][1]!==K[1])&&(O.mouse[1]=V.invert(O.mouse[0]=K)),clearTimeout(O.wheel);else{if(V.k===Q)return;O.mouse=[K,V.invert(K)],oh(this),O.start()}ou(D),O.wheel=setTimeout(I,k),O.zoom("mouse",n(S(C(V,Q),O.mouse[0],O.mouse[1]),O.extent,l));function I(){O.wheel=null,O.end()}}function $(D,...H){if(y||!e.apply(this,arguments))return;var O=D.currentTarget,V=T(this,H,!0).event(D),Q=_r(D.view).on("mousemove.zoom",G,!0).on("mouseup.zoom",B,!0),K=si(D,O),I=D.clientX,P=D.clientY;oC(D.view),hy(D),V.mouse=[K,this.__zoom.invert(K)],oh(this),V.start();function G(oe){if(ou(oe),!V.moved){var ve=oe.clientX-I,ke=oe.clientY-P;V.moved=ve*ve+ke*ke>v}V.event(oe).zoom("mouse",n(S(V.that.__zoom,V.mouse[0]=si(oe,O),V.mouse[1]),V.extent,l))}function B(oe){Q.on("mousemove.zoom mouseup.zoom",null),lC(oe.view,V.moved),ou(oe),V.event(oe).end()}}function z(D,...H){if(e.apply(this,arguments)){var O=this.__zoom,V=si(D.changedTouches?D.changedTouches[0]:D,this),Q=O.invert(V),K=O.k*(D.shiftKey?.5:2),I=n(S(C(O,K),V,Q),t.apply(this,H),l);ou(D),d>0?_r(this).transition().duration(d).call(M,I,V,D):_r(this).call(E.transform,I,V,D)}}function q(D,...H){if(e.apply(this,arguments)){var O=D.touches,V=O.length,Q=T(this,H,D.changedTouches.length===V).event(D),K,I,P,G;for(hy(D),I=0;I<V;++I)P=O[I],G=si(P,this),G=[G,this.__zoom.invert(G),P.identifier],Q.touch0?!Q.touch1&&Q.touch0[2]!==G[2]&&(Q.touch1=G,Q.taps=0):(Q.touch0=G,K=!0,Q.taps=1+!!g);g&&(g=clearTimeout(g)),K&&(Q.taps<2&&(m=G[0],g=setTimeout(function(){g=null},b)),oh(this),Q.start())}}function F(D,...H){if(this.__zooming){var O=T(this,H).event(D),V=D.changedTouches,Q=V.length,K,I,P,G;for(ou(D),K=0;K<Q;++K)I=V[K],P=si(I,this),O.touch0&&O.touch0[2]===I.identifier?O.touch0[0]=P:O.touch1&&O.touch1[2]===I.identifier&&(O.touch1[0]=P);if(I=O.that.__zoom,O.touch1){var B=O.touch0[0],oe=O.touch0[1],ve=O.touch1[0],ke=O.touch1[1],Se=(Se=ve[0]-B[0])*Se+(Se=ve[1]-B[1])*Se,J=(J=ke[0]-oe[0])*J+(J=ke[1]-oe[1])*J;I=C(I,Math.sqrt(Se/J)),P=[(B[0]+ve[0])/2,(B[1]+ve[1])/2],G=[(oe[0]+ke[0])/2,(oe[1]+ke[1])/2]}else if(O.touch0)P=O.touch0[0],G=O.touch0[1];else return;O.zoom("touch",n(S(I,P,G),O.extent,l))}}function Y(D,...H){if(this.__zooming){var O=T(this,H).event(D),V=D.changedTouches,Q=V.length,K,I;for(hy(D),y&&clearTimeout(y),y=setTimeout(function(){y=null},b),K=0;K<Q;++K)I=V[K],O.touch0&&O.touch0[2]===I.identifier?delete O.touch0:O.touch1&&O.touch1[2]===I.identifier&&delete O.touch1;if(O.touch1&&!O.touch0&&(O.touch0=O.touch1,delete O.touch1),O.touch0)O.touch0[1]=this.__zoom.invert(O.touch0[0]);else if(O.end(),O.taps===2&&(I=si(I,this),Math.hypot(m[0]-I[0],m[1]-I[1])<N)){var P=_r(this).on("dblclick.zoom");P&&P.apply(this,arguments)}}}return E.wheelDelta=function(D){return arguments.length?(r=typeof D=="function"?D:Hf(+D),E):r},E.filter=function(D){return arguments.length?(e=typeof D=="function"?D:Hf(!!D),E):e},E.touchable=function(D){return arguments.length?(a=typeof D=="function"?D:Hf(!!D),E):a},E.extent=function(D){return arguments.length?(t=typeof D=="function"?D:Hf([[+D[0][0],+D[0][1]],[+D[1][0],+D[1][1]]]),E):t},E.scaleExtent=function(D){return arguments.length?(o[0]=+D[0],o[1]=+D[1],E):[o[0],o[1]]},E.translateExtent=function(D){return arguments.length?(l[0][0]=+D[0][0],l[1][0]=+D[1][0],l[0][1]=+D[0][1],l[1][1]=+D[1][1],E):[[l[0][0],l[0][1]],[l[1][0],l[1][1]]]},E.constrain=function(D){return arguments.length?(n=D,E):n},E.duration=function(D){return arguments.length?(d=+D,E):d},E.interpolate=function(D){return arguments.length?(f=D,E):f},E.on=function(){var D=h.on.apply(h,arguments);return D===h?E:D},E.clickDistance=function(D){return arguments.length?(v=(D=+D)*D,E):Math.sqrt(v)},E.tapDistance=function(D){return arguments.length?(N=+D,E):N},E}const hi={error001:(e="react")=>`Seems like you have not used ${e==="svelte"?"SvelteFlowProvider":"ReactFlowProvider"} as an ancestor. Help: https://${e}flow.dev/error#001`,error002:()=>"It looks like you've created a new nodeTypes or edgeTypes object. If this wasn't on purpose please define the nodeTypes/edgeTypes outside of the component or memoize them.",error003:e=>`Node type "${e}" not found. Using fallback type "default".`,error004:()=>"The parent container needs a width and a height to render the graph.",error005:()=>"Only child nodes can use a parent extent.",error006:()=>"Can't create edge. An edge needs a source and a target.",error007:e=>`The old edge with id=${e} does not exist.`,error009:e=>`Marker type "${e}" doesn't exist.`,error008:(e,{id:t,sourceHandle:n,targetHandle:r})=>`Couldn't create edge for ${e} handle id: "${e==="source"?n:r}", edge id: ${t}.`,error010:()=>"Handle: No node id found. Make sure to only use a Handle inside a custom Node.",error011:e=>`Edge type "${e}" not found. Using fallback type "default".`,error012:e=>`Node with id "${e}" does not exist, it may have been removed. This can happen when a node is deleted before the "onNodeClick" handler is called.`,error013:(e="react")=>`It seems that you haven't loaded the styles. Please import '@xyflow/${e}/dist/style.css' or base.css to make sure everything is working properly.`,error014:()=>"useNodeConnections: No node ID found. Call useNodeConnections inside a custom Node or provide a node ID.",error015:()=>"It seems that you are trying to drag a node that is not initialized. Please use onNodesChange as explained in the docs.",error016:e=>`Edge with id "${e}" does not exist, it may have been removed. This can happen when an edge is deleted before the "onEdgeClick" handler is called.`},Ou=[[Number.NEGATIVE_INFINITY,Number.NEGATIVE_INFINITY],[Number.POSITIVE_INFINITY,Number.POSITIVE_INFINITY]],NC=["Enter"," ","Escape"],_C={"node.a11yDescription.default":"Press enter or space to select a node. Press delete to remove it and escape to cancel.","node.a11yDescription.keyboardDisabled":"Press enter or space to select a node. You can then use the arrow keys to move the node around. Press delete to remove it and escape to cancel.","node.a11yDescription.ariaLiveMessage":({direction:e,x:t,y:n})=>`Moved selected node ${e}. New position, x: ${t}, y: ${n}`,"edge.a11yDescription.default":"Press enter or space to select an edge. You can then press delete to remove it or escape to cancel.","controls.ariaLabel":"Control Panel","controls.zoomIn.ariaLabel":"Zoom In","controls.zoomOut.ariaLabel":"Zoom Out","controls.fitView.ariaLabel":"Fit View","controls.interactive.ariaLabel":"Toggle Interactivity","minimap.ariaLabel":"Mini Map","handle.ariaLabel":"Handle"};var Hl;(function(e){e.Strict="strict",e.Loose="loose"})(Hl||(Hl={}));var uo;(function(e){e.Free="free",e.Vertical="vertical",e.Horizontal="horizontal"})(uo||(uo={}));var Ru;(function(e){e.Partial="partial",e.Full="full"})(Ru||(Ru={}));const jC={inProgress:!1,isValid:null,from:null,fromHandle:null,fromPosition:null,fromNode:null,to:null,toHandle:null,toPosition:null,toNode:null,pointer:null};var ls;(function(e){e.Bezier="default",e.Straight="straight",e.Step="step",e.SmoothStep="smoothstep",e.SimpleBezier="simplebezier"})(ls||(ls={}));var Oh;(function(e){e.Arrow="arrow",e.ArrowClosed="arrowclosed"})(Oh||(Oh={}));var Ge;(function(e){e.Left="left",e.Top="top",e.Right="right",e.Bottom="bottom"})(Ge||(Ge={}));const nS={[Ge.Left]:Ge.Right,[Ge.Right]:Ge.Left,[Ge.Top]:Ge.Bottom,[Ge.Bottom]:Ge.Top};function CC(e){return e===null?null:e?"valid":"invalid"}const AC=e=>"id"in e&&"source"in e&&"target"in e,aG=e=>"id"in e&&"position"in e&&!("source"in e)&&!("target"in e),Hx=e=>"id"in e&&"internals"in e&&!("source"in e)&&!("target"in e),id=(e,t=[0,0])=>{const{width:n,height:r}=va(e),a=e.origin??t,o=n*a[0],l=r*a[1];return{x:e.position.x-o,y:e.position.y-l}},sG=(e,t={nodeOrigin:[0,0]})=>{if(e.length===0)return{x:0,y:0,width:0,height:0};const n=e.reduce((r,a)=>{const o=typeof a=="string";let l=!t.nodeLookup&&!o?a:void 0;t.nodeLookup&&(l=o?t.nodeLookup.get(a):Hx(a)?a:t.nodeLookup.get(a.id));const d=l?Rh(l,t.nodeOrigin):{x:0,y:0,x2:0,y2:0};return pp(r,d)},{x:1/0,y:1/0,x2:-1/0,y2:-1/0});return mp(n)},ad=(e,t={})=>{let n={x:1/0,y:1/0,x2:-1/0,y2:-1/0},r=!1;return e.forEach(a=>{(t.filter===void 0||t.filter(a))&&(n=pp(n,Rh(a)),r=!0)}),r?mp(n):{x:0,y:0,width:0,height:0}},Kx=(e,t,[n,r,a]=[0,0,1],o=!1,l=!1)=>{const d=(t.x-n)/a,f=(t.y-r)/a,h=t.width/a,g=t.height/a,m=[];for(const y of e.values()){const{measured:b,selectable:k=!0,hidden:v=!1}=y;if(l&&!k||v)continue;const N=b.width??y.width??y.initialWidth??0,E=b.height??y.height??y.initialHeight??0,{x:C,y:S}=y.internals.positionAbsolute,_=OC(d,f,h,g,C,S,N,E),M=N*E,T=o&&_>0;(!y.internals.handleBounds||T||_>=M||y.dragging)&&m.push(y)}return m},oG=(e,t)=>{const n=new Set;return e.forEach(r=>{n.add(r.id)}),t.filter(r=>n.has(r.source)||n.has(r.target))};function lG(e,t){const n=new Map,r=t!=null&&t.nodes?new Set(t.nodes.map(a=>a.id)):null;return e.forEach(a=>{a.measured.width&&a.measured.height&&((t==null?void 0:t.includeHiddenNodes)||!a.hidden)&&(!r||r.has(a.id))&&n.set(a.id,a)}),n}async function cG({nodes:e,width:t,height:n,panZoom:r,minZoom:a,maxZoom:o},l){if(e.size===0)return!0;const d=lG(e,l),f=ad(d),h=Vx(f,t,n,(l==null?void 0:l.minZoom)??a,(l==null?void 0:l.maxZoom)??o,(l==null?void 0:l.padding)??.1);return await r.setViewport(h,{duration:l==null?void 0:l.duration,ease:l==null?void 0:l.ease,interpolate:l==null?void 0:l.interpolate}),!0}function TC({nodeId:e,nextPosition:t,nodeLookup:n,nodeOrigin:r=[0,0],nodeExtent:a,onError:o}){const l=n.get(e),d=l.parentId?n.get(l.parentId):void 0,{x:f,y:h}=d?d.internals.positionAbsolute:{x:0,y:0},g=l.origin??r;let m=l.extent||a;if(l.extent==="parent"&&!l.expandParent)if(!d)o==null||o("005",hi.error005());else{const b=d.measured.width,k=d.measured.height;b&&k&&(m=[[f,h],[f+b,h+k]])}else d&&xo(l.extent)&&(m=[[l.extent[0][0]+f,l.extent[0][1]+h],[l.extent[1][0]+f,l.extent[1][1]+h]]);const y=xo(m)?bo(t,m,l.measured):t;return(l.measured.width===void 0||l.measured.height===void 0)&&(o==null||o("015",hi.error015())),{position:{x:y.x-f+(l.measured.width??0)*g[0],y:y.y-h+(l.measured.height??0)*g[1]},positionAbsolute:y}}async function uG({nodesToRemove:e=[],edgesToRemove:t=[],nodes:n,edges:r,onBeforeDelete:a}){const o=new Set(e.map(y=>y.id)),l=[];for(const y of n){if(y.deletable===!1)continue;const b=o.has(y.id),k=!b&&y.parentId&&l.find(v=>v.id===y.parentId);(b||k)&&l.push(y)}const d=new Set(t.map(y=>y.id)),f=r.filter(y=>y.deletable!==!1),g=oG(l,f);for(const y of f)d.has(y.id)&&!g.find(k=>k.id===y.id)&&g.push(y);if(!a)return{edges:g,nodes:l};const m=await a({nodes:l,edges:g});return typeof m=="boolean"?m?{edges:g,nodes:l}:{edges:[],nodes:[]}:m}const Kl=(e,t=0,n=1)=>Math.min(Math.max(e,t),n),bo=(e={x:0,y:0},t,n)=>({x:Kl(e.x,t[0][0],t[1][0]-((n==null?void 0:n.width)??0)),y:Kl(e.y,t[0][1],t[1][1]-((n==null?void 0:n.height)??0))});function MC(e,t,n){const{width:r,height:a}=va(n),{x:o,y:l}=n.internals.positionAbsolute;return bo(e,[[o,l],[o+r,l+a]],t)}const rS=(e,t,n)=>e<t?Kl(Math.abs(e-t),1,t)/t:e>n?-Kl(Math.abs(e-n),1,t)/t:0,Gx=(e,t,n=15,r=40)=>{const a=rS(e.x,r,t.width-r)*n,o=rS(e.y,r,t.height-r)*n;return[a,o]},pp=(e,t)=>({x:Math.min(e.x,t.x),y:Math.min(e.y,t.y),x2:Math.max(e.x2,t.x2),y2:Math.max(e.y2,t.y2)}),gb=({x:e,y:t,width:n,height:r})=>({x:e,y:t,x2:e+n,y2:t+r}),mp=({x:e,y:t,x2:n,y2:r})=>({x:e,y:t,width:n-e,height:r-t}),Lu=(e,t=[0,0])=>{var a,o;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:id(e,t);return{x:n,y:r,width:((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0,height:((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0}},Rh=(e,t=[0,0])=>{var a,o;const{x:n,y:r}=Hx(e)?e.internals.positionAbsolute:id(e,t);return{x:n,y:r,x2:n+(((a=e.measured)==null?void 0:a.width)??e.width??e.initialWidth??0),y2:r+(((o=e.measured)==null?void 0:o.height)??e.height??e.initialHeight??0)}},DC=(e,t)=>mp(pp(gb(e),gb(t))),OC=(e,t,n,r,a,o,l,d)=>{const f=Math.max(0,Math.min(e+n,a+l)-Math.max(e,a)),h=Math.max(0,Math.min(t+r,o+d)-Math.max(t,o));return Math.ceil(f*h)},Lh=(e,t)=>OC(e.x,e.y,e.width,e.height,t.x,t.y,t.width,t.height),iS=e=>li(e.width)&&li(e.height)&&li(e.x)&&li(e.y),li=e=>!isNaN(e)&&isFinite(e),RC=(e,t)=>(n,r)=>{},sd=(e,t=[1,1])=>({x:t[0]*Math.round(e.x/t[0]),y:t[1]*Math.round(e.y/t[1])}),od=({x:e,y:t},[n,r,a],o=!1,l=[1,1])=>{const d={x:(e-n)/a,y:(t-r)/a};return o?sd(d,l):d},Gl=({x:e,y:t},[n,r,a])=>({x:e*a+n,y:t*a+r});function ul(e,t){if(typeof e=="number")return Math.floor((t-t/(1+e))*.5);if(typeof e=="string"&&e.endsWith("px")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(n)}if(typeof e=="string"&&e.endsWith("%")){const n=parseFloat(e);if(!Number.isNaN(n))return Math.floor(t*n*.01)}return console.error(`The padding value "${e}" is invalid. Please provide a number or a string with a valid unit (px or %).`),0}function dG(e,t,n){if(typeof e=="string"||typeof e=="number"){const r=ul(e,n),a=ul(e,t);return{top:r,right:a,bottom:r,left:a,x:a*2,y:r*2}}if(typeof e=="object"){const r=ul(e.top??e.y??0,n),a=ul(e.bottom??e.y??0,n),o=ul(e.left??e.x??0,t),l=ul(e.right??e.x??0,t);return{top:r,right:l,bottom:a,left:o,x:o+l,y:r+a}}return{top:0,right:0,bottom:0,left:0,x:0,y:0}}function fG(e,t,n,r,a,o){const{x:l,y:d}=Gl(e,[t,n,r]),{x:f,y:h}=Gl({x:e.x+e.width,y:e.y+e.height},[t,n,r]),g=a-f,m=o-h;return{left:Math.floor(l),top:Math.floor(d),right:Math.floor(g),bottom:Math.floor(m)}}const Vx=(e,t,n,r,a,o)=>{const l=dG(o,t,n),d=(t-l.x)/e.width,f=(n-l.y)/e.height,h=Math.min(d,f),g=Kl(h,r,a),m=e.x+e.width/2,y=e.y+e.height/2,b=t/2-m*g,k=n/2-y*g,v=fG(e,b,k,g,t,n),N={left:Math.min(v.left-l.left,0),top:Math.min(v.top-l.top,0),right:Math.min(v.right-l.right,0),bottom:Math.min(v.bottom-l.bottom,0)};return{x:b-N.left+N.right,y:k-N.top+N.bottom,zoom:g}},Iu=()=>{var e;return typeof navigator<"u"&&((e=navigator==null?void 0:navigator.userAgent)==null?void 0:e.indexOf("Mac"))>=0};function xo(e){return e!=null&&e!=="parent"}function va(e){var t,n;return{width:((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth??0,height:((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight??0}}function LC(e){var t,n;return(((t=e.measured)==null?void 0:t.width)??e.width??e.initialWidth)!==void 0&&(((n=e.measured)==null?void 0:n.height)??e.height??e.initialHeight)!==void 0}function IC(e,t={width:0,height:0},n,r,a){const o={...e},l=r.get(n);if(l){const d=l.origin||a;o.x+=l.internals.positionAbsolute.x-(t.width??0)*d[0],o.y+=l.internals.positionAbsolute.y-(t.height??0)*d[1]}return o}function aS(e,t){if(e.size!==t.size)return!1;for(const n of e)if(!t.has(n))return!1;return!0}function hG(){let e,t;return{promise:new Promise((r,a)=>{e=r,t=a}),resolve:e,reject:t}}function pG(e){return{..._C,...e||{}}}function bu(e,{snapGrid:t=[0,0],snapToGrid:n=!1,transform:r,containerBounds:a}){const{x:o,y:l}=ci(e),d=od({x:o-((a==null?void 0:a.left)??0),y:l-((a==null?void 0:a.top)??0)},r),{x:f,y:h}=n?sd(d,t):d;return{xSnapped:f,ySnapped:h,...d}}const Yx=e=>({width:e.offsetWidth,height:e.offsetHeight}),zC=e=>{var t;return((t=e==null?void 0:e.getRootNode)==null?void 0:t.call(e))||(window==null?void 0:window.document)},mG=["INPUT","SELECT","TEXTAREA"];function PC(e){var r,a;const t=((a=(r=e.composedPath)==null?void 0:r.call(e))==null?void 0:a[0])||e.target;return(t==null?void 0:t.nodeType)!==1?!1:mG.includes(t.nodeName)||t.hasAttribute("contenteditable")||!!t.closest(".nokey")}const BC=e=>"clientX"in e,ci=(e,t)=>{var o,l;const n=BC(e),r=n?e.clientX:(o=e.touches)==null?void 0:o[0].clientX,a=n?e.clientY:(l=e.touches)==null?void 0:l[0].clientY;return{x:r-((t==null?void 0:t.left)??0),y:a-((t==null?void 0:t.top)??0)}},sS=(e,t,n,r,a)=>{const o=t.querySelectorAll(`.${e}`);return!o||!o.length?null:Array.from(o).map(l=>{const d=l.getBoundingClientRect();return{id:l.getAttribute("data-handleid"),type:e,nodeId:a,position:l.getAttribute("data-handlepos"),x:(d.left-n.left)/r,y:(d.top-n.top)/r,...Yx(l)}})};function $C({sourceX:e,sourceY:t,targetX:n,targetY:r,sourceControlX:a,sourceControlY:o,targetControlX:l,targetControlY:d}){const f=e*.125+a*.375+l*.375+n*.125,h=t*.125+o*.375+d*.375+r*.125,g=Math.abs(f-e),m=Math.abs(h-t);return[f,h,g,m]}function Kf(e,t){return e>=0?.5*e:t*25*Math.sqrt(-e)}function oS({pos:e,x1:t,y1:n,x2:r,y2:a,c:o}){switch(e){case Ge.Left:return[t-Kf(t-r,o),n];case Ge.Right:return[t+Kf(r-t,o),n];case Ge.Top:return[t,n-Kf(n-a,o)];case Ge.Bottom:return[t,n+Kf(a-n,o)]}}function UC({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:a,targetPosition:o=Ge.Top,curvature:l=.25}){const[d,f]=oS({pos:n,x1:e,y1:t,x2:r,y2:a,c:l}),[h,g]=oS({pos:o,x1:r,y1:a,x2:e,y2:t,c:l}),[m,y,b,k]=$C({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:d,sourceControlY:f,targetControlX:h,targetControlY:g});return[`M${e},${t} C${d},${f} ${h},${g} ${r},${a}`,m,y,b,k]}function FC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const a=Math.abs(n-e)/2,o=n<e?n+a:n-a,l=Math.abs(r-t)/2,d=r<t?r+l:r-l;return[o,d,a,l]}function gG({sourceNode:e,targetNode:t,selected:n=!1,zIndex:r=0,elevateOnSelect:a=!1,zIndexMode:o="basic"}){if(o==="manual")return r;const l=a&&n?r+1e3:r,d=Math.max(e.parentId||a&&e.selected?e.internals.z:0,t.parentId||a&&t.selected?t.internals.z:0);return l+d}function yG({sourceNode:e,targetNode:t,width:n,height:r,transform:a}){const o=pp(Rh(e),Rh(t));o.x===o.x2&&(o.x2+=1),o.y===o.y2&&(o.y2+=1);const l={x:-a[0]/a[2],y:-a[1]/a[2],width:n/a[2],height:r/a[2]};return Lh(l,mp(o))>0}const bG=({source:e,sourceHandle:t,target:n,targetHandle:r})=>`xy-edge__${e}${t||""}-${n}${r||""}`,xG=(e,t)=>t.some(n=>n.source===e.source&&n.target===e.target&&(n.sourceHandle===e.sourceHandle||!n.sourceHandle&&!e.sourceHandle)&&(n.targetHandle===e.targetHandle||!n.targetHandle&&!e.targetHandle)),vG=(e,t,n={})=>{var o;if(!e.source||!e.target)return(o=n.onError)==null||o.call(n,"006",hi.error006()),t;const r=n.getEdgeId||bG;let a;return AC(e)?a={...e}:a={...e,id:r(e)},xG(a,t)?t:(a.sourceHandle===null&&delete a.sourceHandle,a.targetHandle===null&&delete a.targetHandle,t.concat(a))};function qC({sourceX:e,sourceY:t,targetX:n,targetY:r}){const[a,o,l,d]=FC({sourceX:e,sourceY:t,targetX:n,targetY:r});return[`M ${e},${t}L ${n},${r}`,a,o,l,d]}const lS={[Ge.Left]:{x:-1,y:0},[Ge.Right]:{x:1,y:0},[Ge.Top]:{x:0,y:-1},[Ge.Bottom]:{x:0,y:1}},wG=({source:e,sourcePosition:t=Ge.Bottom,target:n})=>t===Ge.Left||t===Ge.Right?e.x<n.x?{x:1,y:0}:{x:-1,y:0}:e.y<n.y?{x:0,y:1}:{x:0,y:-1},cS=(e,t)=>Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2));function kG({source:e,sourcePosition:t=Ge.Bottom,target:n,targetPosition:r=Ge.Top,center:a,offset:o,stepPosition:l}){const d=lS[t],f=lS[r],h={x:e.x+d.x*o,y:e.y+d.y*o},g={x:n.x+f.x*o,y:n.y+f.y*o},m=wG({source:h,sourcePosition:t,target:g}),y=m.x!==0?"x":"y",b=m[y];let k=[],v,N;const E={x:0,y:0},C={x:0,y:0},[,,S,_]=FC({sourceX:e.x,sourceY:e.y,targetX:n.x,targetY:n.y});if(d[y]*f[y]===-1){y==="x"?(v=a.x??h.x+(g.x-h.x)*l,N=a.y??(h.y+g.y)/2):(v=a.x??(h.x+g.x)/2,N=a.y??h.y+(g.y-h.y)*l);const R=[{x:v,y:h.y},{x:v,y:g.y}],$=[{x:h.x,y:N},{x:g.x,y:N}];d[y]===b?k=y==="x"?R:$:k=y==="x"?$:R}else{const R=[{x:h.x,y:g.y}],$=[{x:g.x,y:h.y}];if(y==="x"?k=d.x===b?$:R:k=d.y===b?R:$,t===r){const D=Math.abs(e[y]-n[y]);if(D<=o){const H=Math.min(o-1,o-D);d[y]===b?E[y]=(h[y]>e[y]?-1:1)*H:C[y]=(g[y]>n[y]?-1:1)*H}}if(t!==r){const D=y==="x"?"y":"x",H=d[y]===f[D],O=h[D]>g[D],V=h[D]<g[D];(d[y]===1&&(!H&&O||H&&V)||d[y]!==1&&(!H&&V||H&&O))&&(k=y==="x"?R:$)}const z={x:h.x+E.x,y:h.y+E.y},q={x:g.x+C.x,y:g.y+C.y},F=Math.max(Math.abs(z.x-k[0].x),Math.abs(q.x-k[0].x)),Y=Math.max(Math.abs(z.y-k[0].y),Math.abs(q.y-k[0].y));F>=Y?(v=(z.x+q.x)/2,N=k[0].y):(v=k[0].x,N=(z.y+q.y)/2)}const M={x:h.x+E.x,y:h.y+E.y},T={x:g.x+C.x,y:g.y+C.y};return[[e,...M.x!==k[0].x||M.y!==k[0].y?[M]:[],...k,...T.x!==k[k.length-1].x||T.y!==k[k.length-1].y?[T]:[],n],v,N,S,_]}function EG(e,t,n,r){const a=Math.min(cS(e,t)/2,cS(t,n)/2,r),{x:o,y:l}=t;if(e.x===o&&o===n.x||e.y===l&&l===n.y)return`L${o} ${l}`;if(e.y===l){const h=e.x<n.x?-1:1,g=e.y<n.y?1:-1;return`L ${o+a*h},${l}Q ${o},${l} ${o},${l+a*g}`}const d=e.x<n.x?1:-1,f=e.y<n.y?-1:1;return`L ${o},${l+a*f}Q ${o},${l} ${o+a*d},${l}`}function yb({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:a,targetPosition:o=Ge.Top,borderRadius:l=5,centerX:d,centerY:f,offset:h=20,stepPosition:g=.5}){const[m,y,b,k,v]=kG({source:{x:e,y:t},sourcePosition:n,target:{x:r,y:a},targetPosition:o,center:{x:d,y:f},offset:h,stepPosition:g});let N=`M${m[0].x} ${m[0].y}`;for(let E=1;E<m.length-1;E++)N+=EG(m[E-1],m[E],m[E+1],l);return N+=`L${m[m.length-1].x} ${m[m.length-1].y}`,[N,y,b,k,v]}function uS(e){var t;return e&&!!(e.internals.handleBounds||(t=e.handles)!=null&&t.length)&&!!(e.measured.width||e.width||e.initialWidth)}function SG(e){var m;const{sourceNode:t,targetNode:n}=e;if(!uS(t)||!uS(n))return null;const r=t.internals.handleBounds||dS(t.handles),a=n.internals.handleBounds||dS(n.handles),o=fS((r==null?void 0:r.source)??[],e.sourceHandle),l=fS(e.connectionMode===Hl.Strict?(a==null?void 0:a.target)??[]:((a==null?void 0:a.target)??[]).concat((a==null?void 0:a.source)??[]),e.targetHandle);if(!o||!l)return(m=e.onError)==null||m.call(e,"008",hi.error008(o?"target":"source",{id:e.id,sourceHandle:e.sourceHandle,targetHandle:e.targetHandle})),null;const d=(o==null?void 0:o.position)||Ge.Bottom,f=(l==null?void 0:l.position)||Ge.Top,h=vo(t,o,d),g=vo(n,l,f);return{sourceX:h.x,sourceY:h.y,targetX:g.x,targetY:g.y,sourcePosition:d,targetPosition:f}}function dS(e){if(!e)return null;const t=[],n=[];for(const r of e)r.width=r.width??1,r.height=r.height??1,r.type==="source"?t.push(r):r.type==="target"&&n.push(r);return{source:t,target:n}}function vo(e,t,n=Ge.Left,r=!1){const a=((t==null?void 0:t.x)??0)+e.internals.positionAbsolute.x,o=((t==null?void 0:t.y)??0)+e.internals.positionAbsolute.y,{width:l,height:d}=t??va(e);if(r)return{x:a+l/2,y:o+d/2};switch((t==null?void 0:t.position)??n){case Ge.Top:return{x:a+l/2,y:o};case Ge.Right:return{x:a+l,y:o+d/2};case Ge.Bottom:return{x:a+l/2,y:o+d};case Ge.Left:return{x:a,y:o+d/2}}}function fS(e,t){return e&&(t?e.find(n=>n.id===t):e[0])||null}function bb(e,t){return e?typeof e=="string"?e:`${t?`${t}__`:""}${Object.keys(e).sort().map(r=>`${r}=${e[r]}`).join("&")}`:""}function NG(e,{id:t,defaultColor:n,defaultMarkerStart:r,defaultMarkerEnd:a}){const o=new Set;return e.reduce((l,d)=>([d.markerStart||r,d.markerEnd||a].forEach(f=>{if(f&&typeof f=="object"){const h=bb(f,t);o.has(h)||(l.push({id:h,color:f.color||n,...f}),o.add(h))}}),l),[]).sort((l,d)=>l.id.localeCompare(d.id))}const HC=1e3,_G=10,Qx={nodeOrigin:[0,0],nodeExtent:Ou,elevateNodesOnSelect:!0,zIndexMode:"basic",defaults:{}},jG={...Qx,checkEquality:!0};function Wx(e,t){const n={...e};for(const r in t)t[r]!==void 0&&(n[r]=t[r]);return n}function CG(e,t,n){const r=Wx(Qx,n);for(const a of e.values())if(a.parentId)Zx(a,e,t,r);else{const o=id(a,r.nodeOrigin),l=xo(a.extent)?a.extent:r.nodeExtent,d=bo(o,l,va(a));a.internals.positionAbsolute=d}}function AG(e,t){if(!e.handles)return e.measured?t==null?void 0:t.internals.handleBounds:void 0;const n=[],r=[];for(const a of e.handles){const o={id:a.id,width:a.width??1,height:a.height??1,nodeId:e.id,x:a.x,y:a.y,position:a.position,type:a.type};a.type==="source"?n.push(o):a.type==="target"&&r.push(o)}return{source:n,target:r}}function Xx(e){return e==="manual"}function xb(e,t,n,r={}){var g,m;const a=Wx(jG,r),o={i:0},l=new Map(t),d=a!=null&&a.elevateNodesOnSelect&&!Xx(a.zIndexMode)?HC:0;let f=e.length>0,h=!1;t.clear(),n.clear();for(const y of e){let b=l.get(y.id);if(a.checkEquality&&y===(b==null?void 0:b.internals.userNode))t.set(y.id,b);else{const k=id(y,a.nodeOrigin),v=xo(y.extent)?y.extent:a.nodeExtent,N=bo(k,v,va(y));b={...a.defaults,...y,measured:{width:(g=y.measured)==null?void 0:g.width,height:(m=y.measured)==null?void 0:m.height},internals:{positionAbsolute:N,handleBounds:AG(y,b),z:KC(y,d,a.zIndexMode),userNode:y}},t.set(y.id,b)}(b.measured===void 0||b.measured.width===void 0||b.measured.height===void 0)&&!b.hidden&&(f=!1),y.parentId&&Zx(b,t,n,r,o),h||(h=y.selected??!1)}return{nodesInitialized:f,hasSelectedNodes:h}}function TG(e,t){if(!e.parentId)return;const n=t.get(e.parentId);n?n.set(e.id,e):t.set(e.parentId,new Map([[e.id,e]]))}function Zx(e,t,n,r,a){const{elevateNodesOnSelect:o,nodeOrigin:l,nodeExtent:d,zIndexMode:f}=Wx(Qx,r),h=e.parentId,g=t.get(h);if(!g){console.warn(`Parent node ${h} not found. Please make sure that parent nodes are in front of their child nodes in the nodes array.`);return}TG(e,n),a&&!g.parentId&&g.internals.rootParentIndex===void 0&&f==="auto"&&(g.internals.rootParentIndex=++a.i,g.internals.z=g.internals.z+a.i*_G),a&&g.internals.rootParentIndex!==void 0&&(a.i=g.internals.rootParentIndex);const m=o&&!Xx(f)?HC:0,{x:y,y:b,z:k}=MG(e,g,l,d,m,f),{positionAbsolute:v}=e.internals,N=y!==v.x||b!==v.y;(N||k!==e.internals.z)&&t.set(e.id,{...e,internals:{...e.internals,positionAbsolute:N?{x:y,y:b}:v,z:k}})}function KC(e,t,n){const r=li(e.zIndex)?e.zIndex:0;return Xx(n)?r:r+(e.selected?t:0)}function MG(e,t,n,r,a,o){const{x:l,y:d}=t.internals.positionAbsolute,f=va(e),h=id(e,n),g=xo(e.extent)?bo(h,e.extent,f):h;let m=bo({x:l+g.x,y:d+g.y},r,f);e.extent==="parent"&&(m=MC(m,f,t));const y=KC(e,a,o),b=t.internals.z??0;return{x:m.x,y:m.y,z:b>=y?b+1:y}}function Jx(e,t,n,r=[0,0]){var l;const a=[],o=new Map;for(const d of e){const f=t.get(d.parentId);if(!f)continue;const h=((l=o.get(d.parentId))==null?void 0:l.expandedRect)??Lu(f),g=DC(h,d.rect);o.set(d.parentId,{expandedRect:g,parent:f})}return o.size>0&&o.forEach(({expandedRect:d,parent:f},h)=>{var S;const g=f.internals.positionAbsolute,m=va(f),y=f.origin??r,b=d.x<g.x?Math.round(Math.abs(g.x-d.x)):0,k=d.y<g.y?Math.round(Math.abs(g.y-d.y)):0,v=Math.max(m.width,Math.round(d.width)),N=Math.max(m.height,Math.round(d.height)),E=(v-m.width)*y[0],C=(N-m.height)*y[1];(b>0||k>0||E||C)&&(a.push({id:h,type:"position",position:{x:f.position.x-b+E,y:f.position.y-k+C}}),(S=n.get(h))==null||S.forEach(_=>{e.some(M=>M.id===_.id)||a.push({id:_.id,type:"position",position:{x:_.position.x+b,y:_.position.y+k}})})),(m.width<d.width||m.height<d.height||b||k)&&a.push({id:h,type:"dimensions",setAttributes:!0,dimensions:{width:v+(b?y[0]*b-E:0),height:N+(k?y[1]*k-C:0)}})}),a}function DG(e,t,n,r,a,o,l){const d=r==null?void 0:r.querySelector(".xyflow__viewport");let f=!1;if(!d)return{changes:[],updatedInternals:f};const h=[],g=window.getComputedStyle(d),{m22:m}=new window.DOMMatrixReadOnly(g.transform),y=[];for(const b of e.values()){const k=t.get(b.id);if(!k)continue;if(k.hidden){t.set(k.id,{...k,internals:{...k.internals,handleBounds:void 0}}),f=!0;continue}const v=Yx(b.nodeElement),N=k.measured.width!==v.width||k.measured.height!==v.height;if(!!(v.width&&v.height&&(N||!k.internals.handleBounds||b.force))){const C=b.nodeElement.getBoundingClientRect(),S=xo(k.extent)?k.extent:o;let{positionAbsolute:_}=k.internals;k.parentId&&k.extent==="parent"?_=MC(_,v,t.get(k.parentId)):S&&(_=bo(_,S,v));const M={...k,measured:v,internals:{...k.internals,positionAbsolute:_,handleBounds:{source:sS("source",b.nodeElement,C,m,k.id),target:sS("target",b.nodeElement,C,m,k.id)}}};t.set(k.id,M),k.parentId&&Zx(M,t,n,{nodeOrigin:a,zIndexMode:l}),f=!0,N&&(h.push({id:k.id,type:"dimensions",dimensions:v}),k.expandParent&&k.parentId&&y.push({id:k.id,parentId:k.parentId,rect:Lu(M,a)}))}}if(y.length>0){const b=Jx(y,t,n,a);h.push(...b)}return{changes:h,updatedInternals:f}}async function OG({delta:e,panZoom:t,transform:n,translateExtent:r,width:a,height:o}){if(!t||!e.x&&!e.y)return!1;const l=await t.setViewportConstrained({x:n[0]+e.x,y:n[1]+e.y,zoom:n[2]},[[0,0],[a,o]],r);return!!l&&(l.x!==n[0]||l.y!==n[1]||l.k!==n[2])}function hS(e,t,n,r,a,o){let l=a;const d=r.get(l)||new Map;r.set(l,d.set(n,t)),l=`${a}-${e}`;const f=r.get(l)||new Map;if(r.set(l,f.set(n,t)),o){l=`${a}-${e}-${o}`;const h=r.get(l)||new Map;r.set(l,h.set(n,t))}}function GC(e,t,n){e.clear(),t.clear();for(const r of n){const{source:a,target:o,sourceHandle:l=null,targetHandle:d=null}=r,f={edgeId:r.id,source:a,target:o,sourceHandle:l,targetHandle:d},h=`${a}-${l}--${o}-${d}`,g=`${o}-${d}--${a}-${l}`;hS("source",f,g,e,a,l),hS("target",f,h,e,o,d),t.set(r.id,r)}}function VC(e,t){if(!e.parentId)return!1;const n=t.get(e.parentId);return n?n.selected?!0:VC(n,t):!1}function pS(e,t,n){var a;let r=e;do{if((a=r==null?void 0:r.matches)!=null&&a.call(r,t))return!0;if(r===n)return!1;r=r==null?void 0:r.parentElement}while(r);return!1}function RG(e,t,n,r){const a=new Map;for(const[o,l]of e)if((l.selected||l.id===r)&&(!l.parentId||!VC(l,e))&&(l.draggable||t&&typeof l.draggable>"u")){const d=e.get(o);d&&a.set(o,{id:o,position:d.position||{x:0,y:0},distance:{x:n.x-d.internals.positionAbsolute.x,y:n.y-d.internals.positionAbsolute.y},extent:d.extent,parentId:d.parentId,origin:d.origin,expandParent:d.expandParent,internals:{positionAbsolute:d.internals.positionAbsolute||{x:0,y:0}},measured:{width:d.measured.width??0,height:d.measured.height??0}})}return a}function py({nodeId:e,dragItems:t,nodeLookup:n,dragging:r=!0}){var l,d,f;const a=[];for(const[h,g]of t){const m=(l=n.get(h))==null?void 0:l.internals.userNode;m&&a.push({...m,position:g.position,dragging:r})}if(!e)return[a[0],a];const o=(d=n.get(e))==null?void 0:d.internals.userNode;return[o?{...o,position:((f=t.get(e))==null?void 0:f.position)||o.position,dragging:r}:a[0],a]}function LG({dragItems:e,snapGrid:t,x:n,y:r}){const a=e.values().next().value;if(!a)return null;const o={x:n-a.distance.x,y:r-a.distance.y},l=sd(o,t);return{x:l.x-o.x,y:l.y-o.y}}function IG({onNodeMouseDown:e,getStoreItems:t,onDragStart:n,onDrag:r,onDragStop:a}){let o={x:null,y:null},l=0,d=new Map,f=!1,h={x:0,y:0},g=null,m=!1,y=null,b=!1,k=!1,v=null;function N({noDragClassName:C,handleSelector:S,domNode:_,isSelectable:M,nodeId:T,nodeClickDistance:L=0}){y=_r(_);function R({x:F,y:Y}){const{nodeLookup:D,nodeExtent:H,snapGrid:O,snapToGrid:V,nodeOrigin:Q,onNodeDrag:K,onSelectionDrag:I,onError:P,updateNodePositions:G}=t();o={x:F,y:Y};let B=!1;const oe=d.size>1,ve=oe&&H?gb(ad(d)):null,ke=oe&&V?LG({dragItems:d,snapGrid:O,x:F,y:Y}):null;for(const[Se,J]of d){if(!D.has(Se))continue;let ue={x:F-J.distance.x,y:Y-J.distance.y};V&&(ue=ke?{x:Math.round(ue.x+ke.x),y:Math.round(ue.y+ke.y)}:sd(ue,O));let Te=null;if(oe&&H&&!J.extent&&ve){const{positionAbsolute:ce}=J.internals,Ce=ce.x-ve.x+H[0][0],te=ce.x+J.measured.width-ve.x2+H[1][0],pe=ce.y-ve.y+H[0][1],Fe=ce.y+J.measured.height-ve.y2+H[1][1];Te=[[Ce,pe],[te,Fe]]}const{position:Oe,positionAbsolute:De}=TC({nodeId:Se,nextPosition:ue,nodeLookup:D,nodeExtent:Te||H,nodeOrigin:Q,onError:P});B=B||J.position.x!==Oe.x||J.position.y!==Oe.y,J.position=Oe,J.internals.positionAbsolute=De}if(k=k||B,!!B&&(G(d,!0),v&&(r||K||!T&&I))){const[Se,J]=py({nodeId:T,dragItems:d,nodeLookup:D});r==null||r(v,d,Se,J),K==null||K(v,Se,J),T||I==null||I(v,J)}}async function $(){if(!g)return;const{transform:F,panBy:Y,autoPanSpeed:D,autoPanOnNodeDrag:H}=t();if(!H){f=!1,cancelAnimationFrame(l);return}const[O,V]=Gx(h,g,D);(O!==0||V!==0)&&(o.x=(o.x??0)-O/F[2],o.y=(o.y??0)-V/F[2],await Y({x:O,y:V})&&R(o)),l=requestAnimationFrame($)}function z(F){var oe;const{nodeLookup:Y,multiSelectionActive:D,nodesDraggable:H,transform:O,snapGrid:V,snapToGrid:Q,selectNodesOnDrag:K,onNodeDragStart:I,onSelectionDragStart:P,unselectNodesAndEdges:G}=t();m=!0,(!K||!M)&&!D&&T&&((oe=Y.get(T))!=null&&oe.selected||G()),M&&K&&T&&(e==null||e(T));const B=bu(F.sourceEvent,{transform:O,snapGrid:V,snapToGrid:Q,containerBounds:g});if(o=B,d=RG(Y,H,B,T),d.size>0&&(n||I||!T&&P)){const[ve,ke]=py({nodeId:T,dragItems:d,nodeLookup:Y});n==null||n(F.sourceEvent,d,ve,ke),I==null||I(F.sourceEvent,ve,ke),T||P==null||P(F.sourceEvent,ke)}}const q=cC().clickDistance(L).on("start",F=>{const{domNode:Y,nodeDragThreshold:D,transform:H,snapGrid:O,snapToGrid:V}=t();g=(Y==null?void 0:Y.getBoundingClientRect())||null,b=!1,k=!1,v=F.sourceEvent,D===0&&z(F),o=bu(F.sourceEvent,{transform:H,snapGrid:O,snapToGrid:V,containerBounds:g}),h=ci(F.sourceEvent,g)}).on("drag",F=>{const{autoPanOnNodeDrag:Y,transform:D,snapGrid:H,snapToGrid:O,nodeDragThreshold:V,nodeLookup:Q}=t(),K=bu(F.sourceEvent,{transform:D,snapGrid:H,snapToGrid:O,containerBounds:g});if(v=F.sourceEvent,(F.sourceEvent.type==="touchmove"&&F.sourceEvent.touches.length>1||T&&!Q.has(T))&&(b=!0),!b){if(!f&&Y&&m&&(f=!0,$()),!m){const I=ci(F.sourceEvent,g),P=I.x-h.x,G=I.y-h.y;Math.sqrt(P*P+G*G)>V&&z(F)}(o.x!==K.xSnapped||o.y!==K.ySnapped)&&d&&m&&(h=ci(F.sourceEvent,g),R(K))}}).on("end",F=>{if(!m||b){b&&d.size>0&&t().updateNodePositions(d,!1);return}if(f=!1,m=!1,cancelAnimationFrame(l),d.size>0){const{nodeLookup:Y,updateNodePositions:D,onNodeDragStop:H,onSelectionDragStop:O}=t();if(k&&(D(d,!1),k=!1),a||H||!T&&O){const[V,Q]=py({nodeId:T,dragItems:d,nodeLookup:Y,dragging:!1});a==null||a(F.sourceEvent,d,V,Q),H==null||H(F.sourceEvent,V,Q),T||O==null||O(F.sourceEvent,Q)}}}).filter(F=>{const Y=F.target;return!F.button&&(!C||!pS(Y,`.${C}`,_))&&(!S||pS(Y,S,_))});y.call(q)}function E(){y==null||y.on(".drag",null)}return{update:N,destroy:E}}function zG(e,t,n){const r=[],a={x:e.x-n,y:e.y-n,width:n*2,height:n*2};for(const o of t.values())Lh(a,Lu(o))>0&&r.push(o);return r}const PG=250;function BG(e,t,n,r){var d,f;let a=[],o=1/0;const l=zG(e,n,t+PG);for(const h of l){const g=[...((d=h.internals.handleBounds)==null?void 0:d.source)??[],...((f=h.internals.handleBounds)==null?void 0:f.target)??[]];for(const m of g){if(r.nodeId===m.nodeId&&r.type===m.type&&r.id===m.id)continue;const{x:y,y:b}=vo(h,m,m.position,!0),k=Math.sqrt(Math.pow(y-e.x,2)+Math.pow(b-e.y,2));k>t||(k<o?(a=[{...m,x:y,y:b}],o=k):k===o&&a.push({...m,x:y,y:b}))}}if(!a.length)return null;if(a.length>1){const h=r.type==="source"?"target":"source";return a.find(g=>g.type===h)??a[0]}return a[0]}function YC(e,t,n,r,a,o=!1){var h,g,m;const l=r.get(e);if(!l)return null;const d=a==="strict"?(h=l.internals.handleBounds)==null?void 0:h[t]:[...((g=l.internals.handleBounds)==null?void 0:g.source)??[],...((m=l.internals.handleBounds)==null?void 0:m.target)??[]],f=(n?d==null?void 0:d.find(y=>y.id===n):d==null?void 0:d[0])??null;return f&&o?{...f,...vo(l,f,f.position,!0)}:f}function QC(e,t){return e||(t!=null&&t.classList.contains("target")?"target":t!=null&&t.classList.contains("source")?"source":null)}function $G(e,t){let n=null;return t?n=!0:e&&!t&&(n=!1),n}const WC=()=>!0;function UG(e,{connectionMode:t,connectionRadius:n,handleId:r,nodeId:a,edgeUpdaterType:o,isTarget:l,domNode:d,nodeLookup:f,lib:h,autoPanOnConnect:g,flowId:m,panBy:y,cancelConnection:b,onConnectStart:k,onConnect:v,onConnectEnd:N,isValidConnection:E=WC,onReconnectEnd:C,updateConnection:S,getTransform:_,getFromHandle:M,autoPanSpeed:T,dragThreshold:L=1,handleDomNode:R}){const $=zC(e.target);let z=0,q;const{x:F,y:Y}=ci(e),D=QC(o,R),H=d==null?void 0:d.getBoundingClientRect();let O=!1;if(!H||!D)return;const V=YC(a,D,r,f,t);if(!V)return;let Q=ci(e,H),K=!1,I=null,P=!1,G=null;function B(){if(!g||!H)return;const[Oe,De]=Gx(Q,H,T);y({x:Oe,y:De}),z=requestAnimationFrame(B)}const oe={...V,nodeId:a,type:D,position:V.position},ve=f.get(a);let Se={inProgress:!0,isValid:null,from:vo(ve,oe,Ge.Left,!0),fromHandle:oe,fromPosition:oe.position,fromNode:ve,to:Q,toHandle:null,toPosition:nS[oe.position],toNode:null,pointer:Q};function J(){O=!0,S(Se),k==null||k(e,{nodeId:a,handleId:r,handleType:D})}L===0&&J();function ue(Oe){if(!O){const{x:Fe,y:ze}=ci(Oe),ae=Fe-F,be=ze-Y;if(!(ae*ae+be*be>L*L))return;J()}if(!M()||!oe){Te(Oe);return}const De=_();Q=ci(Oe,H),q=BG(od(Q,De,!1,[1,1]),n,f,oe),K||(B(),K=!0);const ce=XC(Oe,{handle:q,connectionMode:t,fromNodeId:a,fromHandleId:r,fromType:l?"target":"source",isValidConnection:E,doc:$,lib:h,flowId:m,nodeLookup:f});G=ce.handleDomNode,I=ce.connection,P=$G(!!q,ce.isValid);const Ce=f.get(a),te=Ce?vo(Ce,oe,Ge.Left,!0):Se.from,pe={...Se,from:te,isValid:P,to:ce.toHandle&&P?Gl({x:ce.toHandle.x,y:ce.toHandle.y},De):Q,toHandle:ce.toHandle,toPosition:P&&ce.toHandle?ce.toHandle.position:nS[oe.position],toNode:ce.toHandle?f.get(ce.toHandle.nodeId):null,pointer:Q};S(pe),Se=pe}function Te(Oe){if(!("touches"in Oe&&Oe.touches.length>0)){if(O){(q||G)&&I&&P&&(v==null||v(I));const{inProgress:De,...ce}=Se,Ce={...ce,toPosition:Se.toHandle?Se.toPosition:null};N==null||N(Oe,Ce),o&&(C==null||C(Oe,Ce))}b(),cancelAnimationFrame(z),K=!1,P=!1,I=null,G=null,$.removeEventListener("mousemove",ue),$.removeEventListener("mouseup",Te),$.removeEventListener("touchmove",ue),$.removeEventListener("touchend",Te)}}$.addEventListener("mousemove",ue),$.addEventListener("mouseup",Te),$.addEventListener("touchmove",ue),$.addEventListener("touchend",Te)}function XC(e,{handle:t,connectionMode:n,fromNodeId:r,fromHandleId:a,fromType:o,doc:l,lib:d,flowId:f,isValidConnection:h=WC,nodeLookup:g}){const m=o==="target",y=t?l.querySelector(`.${d}-flow__handle[data-id="${f}-${t==null?void 0:t.nodeId}-${t==null?void 0:t.id}-${t==null?void 0:t.type}"]`):null,{x:b,y:k}=ci(e),v=l.elementFromPoint(b,k),N=v!=null&&v.classList.contains(`${d}-flow__handle`)?v:y,E={handleDomNode:N,isValid:!1,connection:null,toHandle:null};if(N){const C=QC(void 0,N),S=N.getAttribute("data-nodeid"),_=N.getAttribute("data-handleid"),M=N.classList.contains("connectable"),T=N.classList.contains("connectableend");if(!S||!C)return E;const L={source:m?S:r,sourceHandle:m?_:a,target:m?r:S,targetHandle:m?a:_};E.connection=L;const $=M&&T&&(n===Hl.Strict?m&&C==="source"||!m&&C==="target":S!==r||_!==a);E.isValid=$&&h(L),E.toHandle=YC(S,C,_,g,n,!0)}return E}const vb={onPointerDown:UG,isValid:XC};function FG({domNode:e,panZoom:t,getTransform:n,getViewScale:r}){const a=_r(e);function o({translateExtent:d,width:f,height:h,zoomStep:g=1,pannable:m=!0,zoomable:y=!0,inversePan:b=!1}){const k=S=>{if(S.sourceEvent.type!=="wheel"||!t)return;const _=n(),M=S.sourceEvent.ctrlKey&&Iu()?10:1,T=-S.sourceEvent.deltaY*(S.sourceEvent.deltaMode===1?.05:S.sourceEvent.deltaMode?1:.002)*g,L=_[2]*Math.pow(2,T*M);t.scaleTo(L)};let v=[0,0];const N=S=>{(S.sourceEvent.type==="mousedown"||S.sourceEvent.type==="touchstart")&&(v=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY])},E=S=>{const _=n();if(S.sourceEvent.type!=="mousemove"&&S.sourceEvent.type!=="touchmove"||!t)return;const M=[S.sourceEvent.clientX??S.sourceEvent.touches[0].clientX,S.sourceEvent.clientY??S.sourceEvent.touches[0].clientY],T=[M[0]-v[0],M[1]-v[1]];v=M;const L=r()*Math.max(_[2],Math.log(_[2]))*(b?-1:1),R={x:_[0]-T[0]*L,y:_[1]-T[1]*L},$=[[0,0],[f,h]];t.setViewportConstrained({x:R.x,y:R.y,zoom:_[2]},$,d)},C=SC().on("start",N).on("zoom",m?E:null).on("zoom.wheel",y?k:null);a.call(C,{})}function l(){a.on("zoom",null)}return{update:o,destroy:l,pointer:si}}const gp=e=>({x:e.x,y:e.y,zoom:e.k}),my=({x:e,y:t,zoom:n})=>hp.translate(e,t).scale(n),xl=(e,t)=>e.target.closest(`.${t}`),ZC=(e,t)=>t===2&&Array.isArray(e)&&e.includes(2),qG=e=>((e*=2)<=1?e*e*e:(e-=2)*e*e+2)/2,gy=(e,t=0,n=qG,r=()=>{})=>{const a=typeof t=="number"&&t>0;return a||r(),a?e.transition().duration(t).ease(n).on("end",r):e},JC=e=>{const t=e.ctrlKey&&Iu()?10:1;return-e.deltaY*(e.deltaMode===1?.05:e.deltaMode?1:.002)*t};function HG({zoomPanValues:e,noWheelClassName:t,d3Selection:n,d3Zoom:r,panOnScrollMode:a,panOnScrollSpeed:o,zoomOnPinch:l,onPanZoomStart:d,onPanZoom:f,onPanZoomEnd:h}){return g=>{if(xl(g,t))return g.ctrlKey&&g.preventDefault(),!1;g.preventDefault(),g.stopImmediatePropagation();const m=n.property("__zoom").k||1;if(g.ctrlKey&&l){const N=si(g),E=JC(g),C=m*Math.pow(2,E);r.scaleTo(n,C,N,g);return}const y=g.deltaMode===1?20:1;let b=a===uo.Vertical?0:g.deltaX*y,k=a===uo.Horizontal?0:g.deltaY*y;!Iu()&&g.shiftKey&&a!==uo.Vertical&&(b=g.deltaY*y,k=0),r.translateBy(n,-(b/m)*o,-(k/m)*o,{internal:!0});const v=gp(n.property("__zoom"));clearTimeout(e.panScrollTimeout),e.isPanScrolling?(f==null||f(g,v),e.panScrollTimeout=setTimeout(()=>{h==null||h(g,v),e.isPanScrolling=!1},150)):(e.isPanScrolling=!0,d==null||d(g,v))}}function KG({noWheelClassName:e,preventScrolling:t,d3ZoomHandler:n}){return function(r,a){const o=r.type==="wheel",l=!t&&o&&!r.ctrlKey,d=xl(r,e);if(r.ctrlKey&&o&&d&&r.preventDefault(),l||d)return null;r.preventDefault(),n.call(this,r,a)}}function GG({zoomPanValues:e,onDraggingChange:t,onPanZoomStart:n}){return r=>{var o,l,d;if((o=r.sourceEvent)!=null&&o.internal)return;const a=gp(r.transform);e.mouseButton=((l=r.sourceEvent)==null?void 0:l.button)||0,e.isZoomingOrPanning=!0,e.prevViewport=a,((d=r.sourceEvent)==null?void 0:d.type)==="mousedown"&&t(!0),n&&(n==null||n(r.sourceEvent,a))}}function VG({zoomPanValues:e,panOnDrag:t,onPaneContextMenu:n,onTransformChange:r,onPanZoom:a}){return o=>{var l,d;e.usedRightMouseButton=!!(n&&ZC(t,e.mouseButton??0)),(l=o.sourceEvent)!=null&&l.sync||r([o.transform.x,o.transform.y,o.transform.k]),a&&!((d=o.sourceEvent)!=null&&d.internal)&&(a==null||a(o.sourceEvent,gp(o.transform)))}}function YG({zoomPanValues:e,panOnDrag:t,panOnScroll:n,onDraggingChange:r,onPanZoomEnd:a,onPaneContextMenu:o}){return l=>{var d;if(!((d=l.sourceEvent)!=null&&d.internal)&&(e.isZoomingOrPanning=!1,o&&ZC(t,e.mouseButton??0)&&!e.usedRightMouseButton&&l.sourceEvent&&o(l.sourceEvent),e.usedRightMouseButton=!1,r(!1),a)){const f=gp(l.transform);e.prevViewport=f,clearTimeout(e.timerId),e.timerId=setTimeout(()=>{a==null||a(l.sourceEvent,f)},n?150:0)}}}function QG({zoomActivationKeyPressed:e,zoomOnScroll:t,zoomOnPinch:n,panOnDrag:r,panOnScroll:a,zoomOnDoubleClick:o,userSelectionActive:l,noWheelClassName:d,noPanClassName:f,lib:h,connectionInProgress:g}){return m=>{var N;const y=e||t,b=n&&m.ctrlKey,k=m.type==="wheel";if(m.button===1&&m.type==="mousedown"&&(xl(m,`${h}-flow__node`)||xl(m,`${h}-flow__edge`)))return!0;if(!r&&!y&&!a&&!o&&!n||l||g&&!k||xl(m,d)&&k||xl(m,f)&&(!k||a&&k&&!e)||!n&&m.ctrlKey&&k)return!1;if(!n&&m.type==="touchstart"&&((N=m.touches)==null?void 0:N.length)>1)return m.preventDefault(),!1;if(!y&&!a&&!b&&k||!r&&(m.type==="mousedown"||m.type==="touchstart")||Array.isArray(r)&&!r.includes(m.button)&&m.type==="mousedown")return!1;const v=Array.isArray(r)&&r.includes(m.button)||!m.button||m.button<=1;return(!m.ctrlKey||k)&&v}}function WG({domNode:e,minZoom:t,maxZoom:n,translateExtent:r,viewport:a,onPanZoom:o,onPanZoomStart:l,onPanZoomEnd:d,onDraggingChange:f}){const h={isZoomingOrPanning:!1,usedRightMouseButton:!1,prevViewport:{},mouseButton:0,timerId:void 0,panScrollTimeout:void 0,isPanScrolling:!1},g=e.getBoundingClientRect(),m=SC().scaleExtent([t,n]).translateExtent(r),y=_r(e).call(m);C({x:a.x,y:a.y,zoom:Kl(a.zoom,t,n)},[[0,0],[g.width,g.height]],r);const b=y.on("wheel.zoom"),k=y.on("dblclick.zoom");m.wheelDelta(JC);async function v(q,F){return y?new Promise(Y=>{m==null||m.interpolate((F==null?void 0:F.interpolate)==="linear"?yu:ih).transform(gy(y,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),q)}):!1}function N({noWheelClassName:q,noPanClassName:F,onPaneContextMenu:Y,userSelectionActive:D,panOnScroll:H,panOnDrag:O,panOnScrollMode:V,panOnScrollSpeed:Q,preventScrolling:K,zoomOnPinch:I,zoomOnScroll:P,zoomOnDoubleClick:G,zoomActivationKeyPressed:B,lib:oe,onTransformChange:ve,connectionInProgress:ke,paneClickDistance:Se,selectionOnDrag:J}){D&&!h.isZoomingOrPanning&&E();const ue=H&&!B&&!D;m.clickDistance(J?1/0:!li(Se)||Se<0?0:Se);const Te=ue?HG({zoomPanValues:h,noWheelClassName:q,d3Selection:y,d3Zoom:m,panOnScrollMode:V,panOnScrollSpeed:Q,zoomOnPinch:I,onPanZoomStart:l,onPanZoom:o,onPanZoomEnd:d}):KG({noWheelClassName:q,preventScrolling:K,d3ZoomHandler:b});y.on("wheel.zoom",Te,{passive:!1});const Oe=GG({zoomPanValues:h,onDraggingChange:f,onPanZoomStart:l});m.on("start",Oe);const De=VG({zoomPanValues:h,panOnDrag:O,onPaneContextMenu:!!Y,onPanZoom:o,onTransformChange:ve});m.on("zoom",De);const ce=YG({zoomPanValues:h,panOnDrag:O,panOnScroll:H,onPaneContextMenu:Y,onPanZoomEnd:d,onDraggingChange:f});m.on("end",ce);const Ce=QG({zoomActivationKeyPressed:B,panOnDrag:O,zoomOnScroll:P,panOnScroll:H,zoomOnDoubleClick:G,zoomOnPinch:I,userSelectionActive:D,noPanClassName:F,noWheelClassName:q,lib:oe,connectionInProgress:ke});m.filter(Ce),G?y.on("dblclick.zoom",k):y.on("dblclick.zoom",null)}function E(){m.on("zoom",null)}async function C(q,F,Y){const D=my(q),H=m==null?void 0:m.constrain()(D,F,Y);return H&&await v(H),H}async function S(q,F){const Y=my(q);return await v(Y,F),Y}function _(q){if(y){const F=my(q),Y=y.property("__zoom");(Y.k!==q.zoom||Y.x!==q.x||Y.y!==q.y)&&(m==null||m.transform(y,F,null,{sync:!0}))}}function M(){const q=y?EC(y.node()):{x:0,y:0,k:1};return{x:q.x,y:q.y,zoom:q.k}}async function T(q,F){return y?new Promise(Y=>{m==null||m.interpolate((F==null?void 0:F.interpolate)==="linear"?yu:ih).scaleTo(gy(y,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),q)}):!1}async function L(q,F){return y?new Promise(Y=>{m==null||m.interpolate((F==null?void 0:F.interpolate)==="linear"?yu:ih).scaleBy(gy(y,F==null?void 0:F.duration,F==null?void 0:F.ease,()=>Y(!0)),q)}):!1}function R(q){m==null||m.scaleExtent(q)}function $(q){m==null||m.translateExtent(q)}function z(q){const F=!li(q)||q<0?0:q;m==null||m.clickDistance(F)}return{update:N,destroy:E,setViewport:S,setViewportConstrained:C,getViewport:M,scaleTo:T,scaleBy:L,setScaleExtent:R,setTranslateExtent:$,syncViewport:_,setClickDistance:z}}var Vl;(function(e){e.Line="line",e.Handle="handle"})(Vl||(Vl={}));function XG({width:e,prevWidth:t,height:n,prevHeight:r,affectsX:a,affectsY:o}){const l=e-t,d=n-r,f=[l>0?1:l<0?-1:0,d>0?1:d<0?-1:0];return l&&a&&(f[0]=f[0]*-1),d&&o&&(f[1]=f[1]*-1),f}function mS(e){const t=e.includes("right")||e.includes("left"),n=e.includes("bottom")||e.includes("top"),r=e.includes("left"),a=e.includes("top");return{isHorizontal:t,isVertical:n,affectsX:r,affectsY:a}}function is(e,t){return Math.max(0,t-e)}function as(e,t){return Math.max(0,e-t)}function Gf(e,t,n){return Math.max(0,t-e,e-n)}function gS(e,t){return e?!t:t}function ZG(e,t,n,r,a,o,l,d){let{affectsX:f,affectsY:h}=t;const{isHorizontal:g,isVertical:m}=t,y=g&&m,{xSnapped:b,ySnapped:k}=n,{minWidth:v,maxWidth:N,minHeight:E,maxHeight:C}=r,{x:S,y:_,width:M,height:T,aspectRatio:L}=e;let R=Math.floor(g?b-e.pointerX:0),$=Math.floor(m?k-e.pointerY:0);const z=M+(f?-R:R),q=T+(h?-$:$),F=-o[0]*M,Y=-o[1]*T;let D=Gf(z,v,N),H=Gf(q,E,C);if(l){let Q=0,K=0;f&&R<0?Q=is(S+R+F,l[0][0]):!f&&R>0&&(Q=as(S+z+F,l[1][0])),h&&$<0?K=is(_+$+Y,l[0][1]):!h&&$>0&&(K=as(_+q+Y,l[1][1])),D=Math.max(D,Q),H=Math.max(H,K)}if(d){let Q=0,K=0;f&&R>0?Q=as(S+R,d[0][0]):!f&&R<0&&(Q=is(S+z,d[1][0])),h&&$>0?K=as(_+$,d[0][1]):!h&&$<0&&(K=is(_+q,d[1][1])),D=Math.max(D,Q),H=Math.max(H,K)}if(a){if(g){const Q=Gf(z/L,E,C)*L;if(D=Math.max(D,Q),l){let K=0;!f&&!h||f&&!h&&y?K=as(_+Y+z/L,l[1][1])*L:K=is(_+Y+(f?R:-R)/L,l[0][1])*L,D=Math.max(D,K)}if(d){let K=0;!f&&!h||f&&!h&&y?K=is(_+z/L,d[1][1])*L:K=as(_+(f?R:-R)/L,d[0][1])*L,D=Math.max(D,K)}}if(m){const Q=Gf(q*L,v,N)/L;if(H=Math.max(H,Q),l){let K=0;!f&&!h||h&&!f&&y?K=as(S+q*L+F,l[1][0])/L:K=is(S+(h?$:-$)*L+F,l[0][0])/L,H=Math.max(H,K)}if(d){let K=0;!f&&!h||h&&!f&&y?K=is(S+q*L,d[1][0])/L:K=as(S+(h?$:-$)*L,d[0][0])/L,H=Math.max(H,K)}}}$=$+($<0?H:-H),R=R+(R<0?D:-D),a&&(y?z>q*L?$=(gS(f,h)?-R:R)/L:R=(gS(f,h)?-$:$)*L:g?($=R/L,h=f):(R=$*L,f=h));const O=f?S+R:S,V=h?_+$:_;return{width:M+(f?-R:R),height:T+(h?-$:$),x:o[0]*R*(f?-1:1)+O,y:o[1]*$*(h?-1:1)+V}}const eA={width:0,height:0,x:0,y:0},JG={...eA,pointerX:0,pointerY:0,aspectRatio:1};function eV(e,t,n){const r=t.position.x+e.position.x,a=t.position.y+e.position.y,o=e.measured.width??0,l=e.measured.height??0,d=n[0]*o,f=n[1]*l;return[[r-d,a-f],[r+o-d,a+l-f]]}function tV({domNode:e,nodeId:t,getStoreItems:n,onChange:r,onEnd:a}){const o=_r(e);let l={controlDirection:mS("bottom-right"),boundaries:{minWidth:0,minHeight:0,maxWidth:Number.MAX_VALUE,maxHeight:Number.MAX_VALUE},resizeDirection:void 0,keepAspectRatio:!1};function d({controlPosition:h,boundaries:g,keepAspectRatio:m,resizeDirection:y,onResizeStart:b,onResize:k,onResizeEnd:v,shouldResize:N}){let E={...eA},C={...JG};l={boundaries:g,resizeDirection:y,keepAspectRatio:m,controlDirection:mS(h)};let S,_=null,M=[],T,L,R,$=!1;const z=cC().on("start",q=>{const{nodeLookup:F,transform:Y,snapGrid:D,snapToGrid:H,nodeOrigin:O,paneDomNode:V}=n();if(S=F.get(t),!S)return;_=(V==null?void 0:V.getBoundingClientRect())??null;const{xSnapped:Q,ySnapped:K}=bu(q.sourceEvent,{transform:Y,snapGrid:D,snapToGrid:H,containerBounds:_});E={width:S.measured.width??0,height:S.measured.height??0,x:S.position.x??0,y:S.position.y??0},C={...E,pointerX:Q,pointerY:K,aspectRatio:E.width/E.height},T=void 0,L=xo(S.extent)?S.extent:void 0,S.parentId&&(S.extent==="parent"||S.expandParent)&&(T=F.get(S.parentId)),T&&S.extent==="parent"&&(L=[[0,0],[T.measured.width,T.measured.height]]),M=[],R=void 0;for(const[I,P]of F)if(P.parentId===t&&(M.push({id:I,position:{...P.position},extent:P.extent}),P.extent==="parent"||P.expandParent)){const G=eV(P,S,P.origin??O);R?R=[[Math.min(G[0][0],R[0][0]),Math.min(G[0][1],R[0][1])],[Math.max(G[1][0],R[1][0]),Math.max(G[1][1],R[1][1])]]:R=G}b==null||b(q,{...E})}).on("drag",q=>{const{transform:F,snapGrid:Y,snapToGrid:D,nodeOrigin:H}=n(),O=bu(q.sourceEvent,{transform:F,snapGrid:Y,snapToGrid:D,containerBounds:_}),V=[];if(!S)return;const{x:Q,y:K,width:I,height:P}=E,G={},B=S.origin??H,{width:oe,height:ve,x:ke,y:Se}=ZG(C,l.controlDirection,O,l.boundaries,l.keepAspectRatio,B,L,R),J=oe!==I,ue=ve!==P,Te=ke!==Q&&J,Oe=Se!==K&&ue;if(!Te&&!Oe&&!J&&!ue)return;if((Te||Oe||B[0]===1||B[1]===1)&&(G.x=Te?ke:E.x,G.y=Oe?Se:E.y,E.x=G.x,E.y=G.y,M.length>0)){const te=ke-Q,pe=Se-K;for(const Fe of M)Fe.position={x:Fe.position.x-te+B[0]*(oe-I),y:Fe.position.y-pe+B[1]*(ve-P)},V.push(Fe)}if((J||ue)&&(G.width=J&&(!l.resizeDirection||l.resizeDirection==="horizontal")?oe:E.width,G.height=ue&&(!l.resizeDirection||l.resizeDirection==="vertical")?ve:E.height,E.width=G.width,E.height=G.height),T&&S.expandParent){const te=B[0]*(G.width??0);G.x&&G.x<te&&(E.x=te,C.x=C.x-(G.x-te));const pe=B[1]*(G.height??0);G.y&&G.y<pe&&(E.y=pe,C.y=C.y-(G.y-pe))}const De=XG({width:E.width,prevWidth:I,height:E.height,prevHeight:P,affectsX:l.controlDirection.affectsX,affectsY:l.controlDirection.affectsY}),ce={...E,direction:De};(N==null?void 0:N(q,ce))!==!1&&($=!0,k==null||k(q,ce),r(G,V))}).on("end",q=>{$&&(v==null||v(q,{...E}),a==null||a({...E}),$=!1)});o.call(z)}function f(){o.on(".drag",null)}return{update:d,destroy:f}}var yy={exports:{}},by={},xy={exports:{}},vy={};/**
|
|
649
|
-
* @license React
|
|
650
|
-
* use-sync-external-store-shim.production.js
|
|
651
|
-
*
|
|
652
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
653
|
-
*
|
|
654
|
-
* This source code is licensed under the MIT license found in the
|
|
655
|
-
* LICENSE file in the root directory of this source tree.
|
|
656
|
-
*/var yS;function nV(){if(yS)return vy;yS=1;var e=Hu();function t(m,y){return m===y&&(m!==0||1/m===1/y)||m!==m&&y!==y}var n=typeof Object.is=="function"?Object.is:t,r=e.useState,a=e.useEffect,o=e.useLayoutEffect,l=e.useDebugValue;function d(m,y){var b=y(),k=r({inst:{value:b,getSnapshot:y}}),v=k[0].inst,N=k[1];return o(function(){v.value=b,v.getSnapshot=y,f(v)&&N({inst:v})},[m,b,y]),a(function(){return f(v)&&N({inst:v}),m(function(){f(v)&&N({inst:v})})},[m]),l(b),b}function f(m){var y=m.getSnapshot;m=m.value;try{var b=y();return!n(m,b)}catch{return!0}}function h(m,y){return y()}var g=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?h:d;return vy.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:g,vy}var bS;function rV(){return bS||(bS=1,xy.exports=nV()),xy.exports}/**
|
|
657
|
-
* @license React
|
|
658
|
-
* use-sync-external-store-shim/with-selector.production.js
|
|
659
|
-
*
|
|
660
|
-
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
661
|
-
*
|
|
662
|
-
* This source code is licensed under the MIT license found in the
|
|
663
|
-
* LICENSE file in the root directory of this source tree.
|
|
664
|
-
*/var xS;function iV(){if(xS)return by;xS=1;var e=Hu(),t=rV();function n(h,g){return h===g&&(h!==0||1/h===1/g)||h!==h&&g!==g}var r=typeof Object.is=="function"?Object.is:n,a=t.useSyncExternalStore,o=e.useRef,l=e.useEffect,d=e.useMemo,f=e.useDebugValue;return by.useSyncExternalStoreWithSelector=function(h,g,m,y,b){var k=o(null);if(k.current===null){var v={hasValue:!1,value:null};k.current=v}else v=k.current;k=d(function(){function E(T){if(!C){if(C=!0,S=T,T=y(T),b!==void 0&&v.hasValue){var L=v.value;if(b(L,T))return _=L}return _=T}if(L=_,r(S,T))return L;var R=y(T);return b!==void 0&&b(L,R)?(S=T,L):(S=T,_=R)}var C=!1,S,_,M=m===void 0?null:m;return[function(){return E(g())},M===null?void 0:function(){return E(M())}]},[g,m,y,b]);var N=a(h,k[0],k[1]);return l(function(){v.hasValue=!0,v.value=N},[N]),f(N),N},by}var vS;function aV(){return vS||(vS=1,yy.exports=iV()),yy.exports}var sV=aV();const oV=qu(sV),lV={},wS=e=>{let t;const n=new Set,r=(g,m)=>{const y=typeof g=="function"?g(t):g;if(!Object.is(y,t)){const b=t;t=m??(typeof y!="object"||y===null)?y:Object.assign({},t,y),n.forEach(k=>k(t,b))}},a=()=>t,f={setState:r,getState:a,getInitialState:()=>h,subscribe:g=>(n.add(g),()=>n.delete(g)),destroy:()=>{(lV?"production":void 0)!=="production"&&console.warn("[DEPRECATED] The `destroy` method will be unsupported in a future version. Instead use unsubscribe function returned by subscribe. Everything will be garbage-collected if store is garbage-collected."),n.clear()}},h=t=e(r,a,f);return f},cV=e=>e?wS(e):wS,{useDebugValue:uV}=QM,{useSyncExternalStoreWithSelector:dV}=oV,fV=e=>e;function tA(e,t=fV,n){const r=dV(e.subscribe,e.getState,e.getServerState||e.getInitialState,t,n);return uV(r),r}const kS=(e,t)=>{const n=cV(e),r=(a,o=t)=>tA(n,a,o);return Object.assign(r,n),r},hV=(e,t)=>e?kS(e,t):kS;function tn(e,t){if(Object.is(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;if(e instanceof Map&&t instanceof Map){if(e.size!==t.size)return!1;for(const[r,a]of e)if(!Object.is(a,t.get(r)))return!1;return!0}if(e instanceof Set&&t instanceof Set){if(e.size!==t.size)return!1;for(const r of e)if(!t.has(r))return!1;return!0}const n=Object.keys(e);if(n.length!==Object.keys(t).length)return!1;for(const r of n)if(!Object.prototype.hasOwnProperty.call(t,r)||!Object.is(e[r],t[r]))return!1;return!0}const yp=j.createContext(null),pV=yp.Provider,nA=hi.error001("react");function St(e,t){const n=j.useContext(yp);if(n===null)throw new Error(nA);return tA(n,e,t)}function nn(){const e=j.useContext(yp);if(e===null)throw new Error(nA);return j.useMemo(()=>({getState:e.getState,setState:e.setState,subscribe:e.subscribe}),[e])}const ES={display:"none"},mV={position:"absolute",width:1,height:1,margin:-1,border:0,padding:0,overflow:"hidden",clip:"rect(0px, 0px, 0px, 0px)",clipPath:"inset(100%)"},rA="react-flow__node-desc",iA="react-flow__edge-desc",gV="react-flow__aria-live",yV=e=>e.ariaLiveMessage,bV=e=>e.ariaLabelConfig;function xV({rfId:e}){const t=St(yV);return c.jsx("div",{id:`${gV}-${e}`,"aria-live":"assertive","aria-atomic":"true",style:mV,children:t})}function vV({rfId:e,disableKeyboardA11y:t}){const n=St(bV);return c.jsxs(c.Fragment,{children:[c.jsx("div",{id:`${rA}-${e}`,style:ES,children:t?n["node.a11yDescription.default"]:n["node.a11yDescription.keyboardDisabled"]}),c.jsx("div",{id:`${iA}-${e}`,style:ES,children:n["edge.a11yDescription.default"]}),!t&&c.jsx(xV,{rfId:e})]})}const bp=j.forwardRef(({position:e="top-left",children:t,className:n,style:r,...a},o)=>{const l=`${e}`.split("-");return c.jsx("div",{className:Nn(["react-flow__panel",n,...l]),style:r,ref:o,...a,children:t})});bp.displayName="Panel";const SS="https://reactflow.dev?utm_source=attribution";function wV({proOptions:e,position:t="bottom-right"}){return e!=null&&e.hideAttribution?null:c.jsx(bp,{position:t,className:"react-flow__attribution","data-message":`Please only hide this attribution when you are subscribed to React Flow Pro: ${SS}`,children:c.jsx("a",{href:SS,target:"_blank",rel:"noopener noreferrer","aria-label":"React Flow attribution",children:"React Flow"})})}const kV=e=>{const t=[],n=[];for(const[,r]of e.nodeLookup)r.selected&&t.push(r.internals.userNode);for(const[,r]of e.edgeLookup)r.selected&&n.push(r);return{selectedNodes:t,selectedEdges:n}},Vf=e=>e.id;function EV(e,t){return tn(e.selectedNodes.map(Vf),t.selectedNodes.map(Vf))&&tn(e.selectedEdges.map(Vf),t.selectedEdges.map(Vf))}function SV({onSelectionChange:e}){const t=nn(),{selectedNodes:n,selectedEdges:r}=St(kV,EV);return j.useEffect(()=>{const a={nodes:n,edges:r};e==null||e(a),t.getState().onSelectionChangeHandlers.forEach(o=>o(a))},[n,r,e]),null}const NV=e=>!!e.onSelectionChangeHandlers;function _V({onSelectionChange:e}){const t=St(NV);return e||t?c.jsx(SV,{onSelectionChange:e}):null}const aA=[0,0],jV={x:0,y:0,zoom:1},CV=["nodes","edges","defaultNodes","defaultEdges","onConnect","onConnectStart","onConnectEnd","onClickConnectStart","onClickConnectEnd","nodesDraggable","autoPanOnNodeFocus","nodesConnectable","nodesFocusable","edgesFocusable","edgesReconnectable","elevateNodesOnSelect","elevateEdgesOnSelect","minZoom","maxZoom","nodeExtent","onNodesChange","onEdgesChange","elementsSelectable","connectionMode","snapGrid","snapToGrid","translateExtent","connectOnClick","defaultEdgeOptions","fitView","fitViewOptions","onNodesDelete","onEdgesDelete","onDelete","onNodeDrag","onNodeDragStart","onNodeDragStop","onSelectionDrag","onSelectionDragStart","onSelectionDragStop","onMoveStart","onMove","onMoveEnd","noPanClassName","nodeOrigin","autoPanOnConnect","autoPanOnNodeDrag","onError","connectionRadius","isValidConnection","selectNodesOnDrag","nodeDragThreshold","connectionDragThreshold","onBeforeDelete","debug","autoPanSpeed","ariaLabelConfig","zIndexMode"],NS=[...CV,"rfId"],AV=e=>({setNodes:e.setNodes,setEdges:e.setEdges,setMinZoom:e.setMinZoom,setMaxZoom:e.setMaxZoom,setTranslateExtent:e.setTranslateExtent,setNodeExtent:e.setNodeExtent,reset:e.reset,setDefaultNodesAndEdges:e.setDefaultNodesAndEdges}),_S={translateExtent:Ou,nodeOrigin:aA,minZoom:.5,maxZoom:2,elementsSelectable:!0,noPanClassName:"nopan",rfId:"1"};function TV(e){const{setNodes:t,setEdges:n,setMinZoom:r,setMaxZoom:a,setTranslateExtent:o,setNodeExtent:l,reset:d,setDefaultNodesAndEdges:f}=St(AV,tn),h=nn();j.useEffect(()=>(f(e.defaultNodes,e.defaultEdges),()=>{g.current=_S,d()}),[]);const g=j.useRef(_S);return j.useEffect(()=>{for(const m of NS){const y=e[m],b=g.current[m];y!==b&&(typeof e[m]>"u"||(m==="nodes"?t(y):m==="edges"?n(y):m==="minZoom"?r(y):m==="maxZoom"?a(y):m==="translateExtent"?o(y):m==="nodeExtent"?l(y):m==="ariaLabelConfig"?h.setState({ariaLabelConfig:pG(y)}):m==="fitView"?h.setState({fitViewQueued:y}):m==="fitViewOptions"?h.setState({fitViewOptions:y}):h.setState({[m]:y})))}g.current=e},NS.map(m=>e[m])),null}function jS(){return typeof window>"u"||!window.matchMedia?null:window.matchMedia("(prefers-color-scheme: dark)")}function MV(e){var r;const[t,n]=j.useState(e==="system"?null:e);return j.useEffect(()=>{if(e!=="system"){n(e);return}const a=jS(),o=()=>n(a!=null&&a.matches?"dark":"light");return o(),a==null||a.addEventListener("change",o),()=>{a==null||a.removeEventListener("change",o)}},[e]),t!==null?t:(r=jS())!=null&&r.matches?"dark":"light"}const CS=typeof document<"u"?document:null;function zu(e=null,t={target:CS,actInsideInputWithModifier:!0}){const[n,r]=j.useState(!1),a=j.useRef(!1),o=j.useRef(new Set([])),[l,d]=j.useMemo(()=>{if(e!==null){const h=(Array.isArray(e)?e:[e]).filter(m=>typeof m=="string").map(m=>m.replace("+",`
|
|
665
|
-
`).replace(`
|
|
666
|
-
|
|
667
|
-
`,`
|
|
668
|
-
+`).split(`
|
|
669
|
-
`)),g=h.reduce((m,y)=>m.concat(...y),[]);return[h,g]}return[[],[]]},[e]);return j.useEffect(()=>{const f=(t==null?void 0:t.target)??CS,h=(t==null?void 0:t.actInsideInputWithModifier)??!0;if(e!==null){const g=b=>{var N,E;if(a.current=b.ctrlKey||b.metaKey||b.shiftKey||b.altKey,(!a.current||a.current&&!h)&&PC(b))return!1;const v=TS(b.code,d);if(o.current.add(b[v]),AS(l,o.current,!1)){const C=((E=(N=b.composedPath)==null?void 0:N.call(b))==null?void 0:E[0])||b.target,S=(C==null?void 0:C.nodeName)==="BUTTON"||(C==null?void 0:C.nodeName)==="A";t.preventDefault!==!1&&(a.current||!S)&&b.preventDefault(),r(!0)}},m=b=>{const k=TS(b.code,d);AS(l,o.current,!0)?(r(!1),o.current.clear()):o.current.delete(b[k]),b.key==="Meta"&&o.current.clear(),a.current=!1},y=()=>{o.current.clear(),r(!1)};return f==null||f.addEventListener("keydown",g),f==null||f.addEventListener("keyup",m),window.addEventListener("blur",y),window.addEventListener("contextmenu",y),()=>{f==null||f.removeEventListener("keydown",g),f==null||f.removeEventListener("keyup",m),window.removeEventListener("blur",y),window.removeEventListener("contextmenu",y)}}},[e,r]),n}function AS(e,t,n){return e.filter(r=>n||r.length===t.size).some(r=>r.every(a=>t.has(a)))}function TS(e,t){return t.includes(e)?"code":"key"}const DV=()=>{const e=nn();return j.useMemo(()=>({zoomIn:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1.2,t):!1},zoomOut:async t=>{const{panZoom:n}=e.getState();return n?n.scaleBy(1/1.2,t):!1},zoomTo:async(t,n)=>{const{panZoom:r}=e.getState();return r?r.scaleTo(t,n):!1},getZoom:()=>e.getState().transform[2],setViewport:async(t,n)=>{const{transform:[r,a,o],panZoom:l}=e.getState();return l?(await l.setViewport({x:t.x??r,y:t.y??a,zoom:t.zoom??o},n),!0):!1},getViewport:()=>{const[t,n,r]=e.getState().transform;return{x:t,y:n,zoom:r}},setCenter:async(t,n,r)=>e.getState().setCenter(t,n,r),fitBounds:async(t,n)=>{const{width:r,height:a,minZoom:o,maxZoom:l,panZoom:d}=e.getState(),f=Vx(t,r,a,o,l,(n==null?void 0:n.padding)??.1);return d?(await d.setViewport(f,{duration:n==null?void 0:n.duration,ease:n==null?void 0:n.ease,interpolate:n==null?void 0:n.interpolate}),!0):!1},screenToFlowPosition:(t,n={})=>{const{transform:r,snapGrid:a,snapToGrid:o,domNode:l}=e.getState();if(!l)return t;const{x:d,y:f}=l.getBoundingClientRect(),h={x:t.x-d,y:t.y-f},g=n.snapGrid??a,m=n.snapToGrid??o;return od(h,r,m,g)},flowToScreenPosition:t=>{const{transform:n,domNode:r}=e.getState();if(!r)return t;const{x:a,y:o}=r.getBoundingClientRect(),l=Gl(t,n);return{x:l.x+a,y:l.y+o}}}),[])};function sA(e,t){const n=[],r=new Map,a=[];for(const o of e)if(o.type==="add"){a.push(o);continue}else if(o.type==="remove"||o.type==="replace")r.set(o.id,[o]);else{const l=r.get(o.id);l?l.push(o):r.set(o.id,[o])}for(const o of t){const l=r.get(o.id);if(!l){n.push(o);continue}if(l[0].type==="remove")continue;if(l[0].type==="replace"){n.push({...l[0].item});continue}const d={...o};for(const f of l)OV(f,d);n.push(d)}return a.length&&a.forEach(o=>{o.index!==void 0?n.splice(o.index,0,{...o.item}):n.push({...o.item})}),n}function OV(e,t){switch(e.type){case"select":{t.selected=e.selected;break}case"position":{typeof e.position<"u"&&(t.position=e.position),typeof e.dragging<"u"&&(t.dragging=e.dragging);break}case"dimensions":{typeof e.dimensions<"u"&&(t.measured={...e.dimensions},e.setAttributes&&((e.setAttributes===!0||e.setAttributes==="width")&&(t.width=e.dimensions.width),(e.setAttributes===!0||e.setAttributes==="height")&&(t.height=e.dimensions.height))),typeof e.resizing=="boolean"&&(t.resizing=e.resizing);break}}}function oA(e,t){return sA(e,t)}function lA(e,t){return sA(e,t)}function Ys(e,t){return{id:e,type:"select",selected:t}}function vl(e,t=new Set,n=!1){const r=[];for(const[a,o]of e){const l=t.has(a);!(o.selected===void 0&&!l)&&o.selected!==l&&(n&&(o.selected=l),r.push(Ys(o.id,l)))}return r}function MS({items:e=[],lookup:t}){var a;const n=[],r=new Map(e.map(o=>[o.id,o]));for(const[o,l]of e.entries()){const d=t.get(l.id),f=((a=d==null?void 0:d.internals)==null?void 0:a.userNode)??d;f!==void 0&&f!==l&&n.push({id:l.id,item:l,type:"replace"}),f===void 0&&n.push({item:l,type:"add",index:o})}for(const[o]of t)r.get(o)===void 0&&n.push({id:o,type:"remove"});return n}function DS(e){return{id:e.id,type:"remove"}}const RV=RC();function LV(e,t,n={}){return vG(e,t,{...n,onError:n.onError??RV})}const OS=e=>aG(e),IV=e=>AC(e);function cA(e){return j.forwardRef(e)}const zV=typeof window<"u"?j.useLayoutEffect:j.useEffect;function RS(e){const[t,n]=j.useState(BigInt(0)),[r]=j.useState(()=>PV(()=>n(a=>a+BigInt(1))));return zV(()=>{const a=r.get();a.length&&(e(a),r.reset())},[t]),r}function PV(e){let t=[];return{get:()=>t,reset:()=>{t=[]},push:n=>{t.push(n),e()}}}const uA=j.createContext(null);function BV({children:e}){const t=nn(),n=j.useCallback(d=>{const{nodes:f=[],setNodes:h,hasDefaultNodes:g,onNodesChange:m,nodeLookup:y,fitViewQueued:b,onNodesChangeMiddlewareMap:k}=t.getState();let v=f;for(const E of d)v=typeof E=="function"?E(v):E;let N=MS({items:v,lookup:y});for(const E of k.values())N=E(N);g&&h(v),N.length>0?m==null||m(N):b&&window.requestAnimationFrame(()=>{const{fitViewQueued:E,nodes:C,setNodes:S}=t.getState();E&&S(C)})},[]),r=RS(n),a=j.useCallback(d=>{const{edges:f=[],setEdges:h,hasDefaultEdges:g,onEdgesChange:m,edgeLookup:y}=t.getState();let b=f;for(const k of d)b=typeof k=="function"?k(b):k;g?h(b):m&&m(MS({items:b,lookup:y}))},[]),o=RS(a),l=j.useMemo(()=>({nodeQueue:r,edgeQueue:o}),[]);return c.jsx(uA.Provider,{value:l,children:e})}function $V(){const e=j.useContext(uA);if(!e)throw new Error("useBatchContext must be used within a BatchProvider");return e}const UV=e=>!!e.panZoom;function xp(){const e=DV(),t=nn(),n=$V(),r=St(UV),a=j.useMemo(()=>{const o=m=>t.getState().nodeLookup.get(m),l=m=>{n.nodeQueue.push(m)},d=m=>{n.edgeQueue.push(m)},f=m=>{var E,C;const{nodeLookup:y,nodeOrigin:b}=t.getState(),k=OS(m)?m:y.get(m.id),v=k.parentId?IC(k.position,k.measured,k.parentId,y,b):k.position,N={...k,position:v,width:((E=k.measured)==null?void 0:E.width)??k.width,height:((C=k.measured)==null?void 0:C.height)??k.height};return Lu(N)},h=(m,y,b={replace:!1})=>{l(k=>k.map(v=>{if(v.id===m){const N=typeof y=="function"?y(v):y;return b.replace&&OS(N)?N:{...v,...N}}return v}))},g=(m,y,b={replace:!1})=>{d(k=>k.map(v=>{if(v.id===m){const N=typeof y=="function"?y(v):y;return b.replace&&IV(N)?N:{...v,...N}}return v}))};return{getNodes:()=>t.getState().nodes.map(m=>({...m})),getNode:m=>{var y;return(y=o(m))==null?void 0:y.internals.userNode},getInternalNode:o,getEdges:()=>{const{edges:m=[]}=t.getState();return m.map(y=>({...y}))},getEdge:m=>t.getState().edgeLookup.get(m),setNodes:l,setEdges:d,addNodes:m=>{const y=Array.isArray(m)?m:[m];n.nodeQueue.push(b=>[...b,...y])},addEdges:m=>{const y=Array.isArray(m)?m:[m];n.edgeQueue.push(b=>[...b,...y])},toObject:()=>{const{nodes:m=[],edges:y=[],transform:b}=t.getState(),[k,v,N]=b;return{nodes:m.map(E=>({...E})),edges:y.map(E=>({...E})),viewport:{x:k,y:v,zoom:N}}},deleteElements:async({nodes:m=[],edges:y=[]})=>{const{nodes:b,edges:k,onNodesDelete:v,onEdgesDelete:N,triggerNodeChanges:E,triggerEdgeChanges:C,onDelete:S,onBeforeDelete:_}=t.getState(),{nodes:M,edges:T}=await uG({nodesToRemove:m,edgesToRemove:y,nodes:b,edges:k,onBeforeDelete:_}),L=T.length>0,R=M.length>0;if(L){const $=T.map(DS);N==null||N(T),C($)}if(R){const $=M.map(DS);v==null||v(M),E($)}return(R||L)&&(S==null||S({nodes:M,edges:T})),{deletedNodes:M,deletedEdges:T}},getIntersectingNodes:(m,y=!0,b)=>{const k=iS(m),v=k?m:f(m),N=b!==void 0;return v?(b||t.getState().nodes).filter(E=>{const C=t.getState().nodeLookup.get(E.id);if(C&&!k&&(E.id===m.id||!C.internals.positionAbsolute))return!1;const S=Lu(N?E:C),_=Lh(S,v);return y&&_>0||_>=S.width*S.height||_>=v.width*v.height}):[]},isNodeIntersecting:(m,y,b=!0)=>{const v=iS(m)?m:f(m);if(!v)return!1;const N=Lh(v,y);return b&&N>0||N>=y.width*y.height||N>=v.width*v.height},updateNode:h,updateNodeData:(m,y,b={replace:!1})=>{h(m,k=>{const v=typeof y=="function"?y(k):y;return b.replace?{...k,data:v}:{...k,data:{...k.data,...v}}},b)},updateEdge:g,updateEdgeData:(m,y,b={replace:!1})=>{g(m,k=>{const v=typeof y=="function"?y(k):y;return b.replace?{...k,data:v}:{...k,data:{...k.data,...v}}},b)},getNodesBounds:m=>{const{nodeLookup:y,nodeOrigin:b}=t.getState();return sG(m,{nodeLookup:y,nodeOrigin:b})},getHandleConnections:({type:m,id:y,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}-${m}${y?`-${y}`:""}`))==null?void 0:k.values())??[])},getNodeConnections:({type:m,handleId:y,nodeId:b})=>{var k;return Array.from(((k=t.getState().connectionLookup.get(`${b}${m?y?`-${m}-${y}`:`-${m}`:""}`))==null?void 0:k.values())??[])},fitView:async m=>{const y=t.getState().fitViewResolver??hG();return t.setState({fitViewQueued:!0,fitViewOptions:m,fitViewResolver:y}),n.nodeQueue.push(b=>[...b]),y.promise}}},[]);return j.useMemo(()=>({...a,...e,viewportInitialized:r}),[r])}const LS=e=>e.selected,FV=typeof window<"u"?window:void 0;function qV({deleteKeyCode:e,multiSelectionKeyCode:t}){const n=nn(),{deleteElements:r}=xp(),a=zu(e,{actInsideInputWithModifier:!1}),o=zu(t,{target:FV});j.useEffect(()=>{if(a){const{edges:l,nodes:d}=n.getState();r({nodes:d.filter(LS),edges:l.filter(LS)}),n.setState({nodesSelectionActive:!1})}},[a]),j.useEffect(()=>{n.setState({multiSelectionActive:o})},[o])}function HV(e){const t=nn();j.useEffect(()=>{const n=()=>{var a,o,l,d;if(!e.current||!(((o=(a=e.current).checkVisibility)==null?void 0:o.call(a))??!0))return!1;const r=Yx(e.current);(r.height===0||r.width===0)&&((d=(l=t.getState()).onError)==null||d.call(l,"004",hi.error004())),t.setState({width:r.width||500,height:r.height||500})};if(e.current){n(),window.addEventListener("resize",n);const r=new ResizeObserver(()=>n());return r.observe(e.current),()=>{window.removeEventListener("resize",n),r&&e.current&&r.unobserve(e.current)}}},[])}const vp={position:"absolute",width:"100%",height:"100%",top:0,left:0},KV=e=>({userSelectionActive:e.userSelectionActive,lib:e.lib,connectionInProgress:e.connection.inProgress});function GV({onPaneContextMenu:e,zoomOnScroll:t=!0,zoomOnPinch:n=!0,panOnScroll:r=!1,panOnScrollSpeed:a=.5,panOnScrollMode:o=uo.Free,zoomOnDoubleClick:l=!0,panOnDrag:d=!0,defaultViewport:f,translateExtent:h,minZoom:g,maxZoom:m,zoomActivationKeyCode:y,preventScrolling:b=!0,children:k,noWheelClassName:v,noPanClassName:N,onViewportChange:E,isControlledViewport:C,paneClickDistance:S,selectionOnDrag:_}){const M=nn(),T=j.useRef(null),{userSelectionActive:L,lib:R,connectionInProgress:$}=St(KV,tn),z=zu(y),q=j.useRef();HV(T);const F=j.useCallback(Y=>{E==null||E({x:Y[0],y:Y[1],zoom:Y[2]}),C||M.setState({transform:Y})},[E,C]);return j.useEffect(()=>{if(T.current){q.current=WG({domNode:T.current,minZoom:g,maxZoom:m,translateExtent:h,viewport:f,onDraggingChange:O=>M.setState(V=>V.paneDragging===O?V:{paneDragging:O}),onPanZoomStart:(O,V)=>{const{onViewportChangeStart:Q,onMoveStart:K}=M.getState();K==null||K(O,V),Q==null||Q(V)},onPanZoom:(O,V)=>{const{onViewportChange:Q,onMove:K}=M.getState();K==null||K(O,V),Q==null||Q(V)},onPanZoomEnd:(O,V)=>{const{onViewportChangeEnd:Q,onMoveEnd:K}=M.getState();K==null||K(O,V),Q==null||Q(V)}});const{x:Y,y:D,zoom:H}=q.current.getViewport();return M.setState({panZoom:q.current,transform:[Y,D,H],domNode:T.current.closest(".react-flow")}),()=>{var O;(O=q.current)==null||O.destroy()}}},[]),j.useEffect(()=>{var Y;(Y=q.current)==null||Y.update({onPaneContextMenu:e,zoomOnScroll:t,zoomOnPinch:n,panOnScroll:r,panOnScrollSpeed:a,panOnScrollMode:o,zoomOnDoubleClick:l,panOnDrag:d,zoomActivationKeyPressed:z,preventScrolling:b,noPanClassName:N,userSelectionActive:L,noWheelClassName:v,lib:R,onTransformChange:F,connectionInProgress:$,selectionOnDrag:_,paneClickDistance:S})},[e,t,n,r,a,o,l,d,z,b,N,L,v,R,F,$,_,S]),c.jsx("div",{className:"react-flow__renderer",ref:T,style:vp,children:k})}const VV=e=>({userSelectionActive:e.userSelectionActive,userSelectionRect:e.userSelectionRect});function YV(){const{userSelectionActive:e,userSelectionRect:t}=St(VV,tn);return e&&t?c.jsx("div",{className:"react-flow__selection react-flow__container",style:{width:t.width,height:t.height,transform:`translate(${t.x}px, ${t.y}px)`}}):null}const wy=(e,t)=>n=>{n.target===t.current&&(e==null||e(n))},QV=e=>({userSelectionActive:e.userSelectionActive,elementsSelectable:e.elementsSelectable,dragging:e.paneDragging,panBy:e.panBy,autoPanSpeed:e.autoPanSpeed});function WV({isSelecting:e,selectionKeyPressed:t,selectionMode:n=Ru.Full,panOnDrag:r,autoPanOnSelection:a,paneClickDistance:o,selectionOnDrag:l,onSelectionStart:d,onSelectionEnd:f,onPaneClick:h,onPaneContextMenu:g,onPaneScroll:m,onPaneMouseEnter:y,onPaneMouseMove:b,onPaneMouseLeave:k,children:v}){const N=j.useRef(0),E=nn(),{userSelectionActive:C,elementsSelectable:S,dragging:_,panBy:M,autoPanSpeed:T}=St(QV,tn),L=S&&(e||C),R=j.useRef(null),$=j.useRef(),z=j.useRef(new Set),q=j.useRef(new Set),F=j.useRef(!1),Y=j.useRef(!1),D=j.useRef({x:0,y:0}),H=j.useRef(!1),O=J=>{if(Y.current||F.current||E.getState().connection.inProgress){Y.current=!1,F.current=!1;return}h==null||h(J),E.getState().resetSelectedElements(),E.setState({nodesSelectionActive:!1})},V=J=>{if(Array.isArray(r)&&(r!=null&&r.includes(2))){J.preventDefault();return}g==null||g(J)},Q=m?J=>m(J):void 0,K=J=>{Y.current&&(J.stopPropagation(),Y.current=!1)},I=J=>{var Fe,ze;const{domNode:ue,transform:Te}=E.getState();if($.current=ue==null?void 0:ue.getBoundingClientRect(),!$.current)return;const Oe=J.target===R.current;if(!Oe&&!!J.target.closest(".nokey")||!e||!(l&&Oe||t)||J.button!==0||!J.isPrimary)return;(ze=(Fe=J.target)==null?void 0:Fe.setPointerCapture)==null||ze.call(Fe,J.pointerId),Y.current=!1;const{x:Ce,y:te}=ci(J.nativeEvent,$.current),pe=od({x:Ce,y:te},Te);E.setState({userSelectionRect:{width:0,height:0,startX:pe.x,startY:pe.y,x:Ce,y:te}}),Oe||(J.stopPropagation(),J.preventDefault())};function P(J,ue){const{userSelectionRect:Te}=E.getState();if(!Te)return;const{transform:Oe,nodeLookup:De,edgeLookup:ce,connectionLookup:Ce,triggerNodeChanges:te,triggerEdgeChanges:pe,defaultEdgeOptions:Fe}=E.getState(),ze={x:Te.startX,y:Te.startY},{x:ae,y:be}=Gl(ze,Oe),ye={startX:ze.x,startY:ze.y,x:J<ae?J:ae,y:ue<be?ue:be,width:Math.abs(J-ae),height:Math.abs(ue-be)},he=z.current,Ee=q.current;z.current=new Set(Kx(De,ye,Oe,n===Ru.Partial,!0).map(Ke=>Ke.id)),q.current=new Set;const Ne=(Fe==null?void 0:Fe.selectable)??!0;for(const Ke of z.current){const ne=Ce.get(Ke);if(ne)for(const{edgeId:de}of ne.values()){const Le=ce.get(de);Le&&(Le.selectable??Ne)&&q.current.add(de)}}if(!aS(he,z.current)){const Ke=vl(De,z.current,!0);te(Ke)}if(!aS(Ee,q.current)){const Ke=vl(ce,q.current);pe(Ke)}E.setState({userSelectionRect:ye,userSelectionActive:!0,nodesSelectionActive:!1})}function G(){if(!a||!$.current)return;const[J,ue]=Gx(D.current,$.current,T);M({x:J,y:ue}).then(Te=>{if(!Y.current||!Te){N.current=requestAnimationFrame(G);return}const{x:Oe,y:De}=D.current;P(Oe,De),N.current=requestAnimationFrame(G)})}const B=()=>{cancelAnimationFrame(N.current),N.current=0,H.current=!1};j.useEffect(()=>()=>B(),[]);const oe=J=>{const{userSelectionRect:ue,transform:Te,resetSelectedElements:Oe}=E.getState();if(!$.current||!ue)return;const{x:De,y:ce}=ci(J.nativeEvent,$.current);D.current={x:De,y:ce};const Ce=Gl({x:ue.startX,y:ue.startY},Te);if(!Y.current){const te=t?0:o;if(Math.hypot(De-Ce.x,ce-Ce.y)<=te)return;Oe(),d==null||d(J)}Y.current=!0,H.current||(G(),H.current=!0),P(De,ce)},ve=J=>{var ue,Te;if(!L){J.target===R.current&&E.getState().connection.inProgress&&(F.current=!0);return}J.button===0&&((Te=(ue=J.target)==null?void 0:ue.releasePointerCapture)==null||Te.call(ue,J.pointerId),!C&&J.target===R.current&&E.getState().userSelectionRect&&(O==null||O(J)),E.setState({userSelectionActive:!1,userSelectionRect:null}),Y.current&&(f==null||f(J),E.setState({nodesSelectionActive:z.current.size>0})),B())},ke=J=>{var ue,Te;(Te=(ue=J.target)==null?void 0:ue.releasePointerCapture)==null||Te.call(ue,J.pointerId),B()},Se=r===!0||Array.isArray(r)&&r.includes(0);return c.jsxs("div",{className:Nn(["react-flow__pane",{draggable:Se,dragging:_,selection:e}]),onClick:L?void 0:wy(O,R),onContextMenu:wy(V,R),onWheel:wy(Q,R),onPointerEnter:L?void 0:y,onPointerMove:L?oe:b,onPointerUp:ve,onPointerCancel:L?ke:void 0,onPointerDownCapture:L?I:void 0,onClickCapture:L?K:void 0,onPointerLeave:k,ref:R,style:vp,children:[v,c.jsx(YV,{})]})}function wb({id:e,store:t,unselect:n=!1,nodeRef:r}){const{addSelectedNodes:a,unselectNodesAndEdges:o,multiSelectionActive:l,nodeLookup:d,onError:f}=t.getState(),h=d.get(e);if(!h){f==null||f("012",hi.error012(e));return}t.setState({nodesSelectionActive:!1}),h.selected?(n||h.selected&&l)&&(o({nodes:[h],edges:[]}),requestAnimationFrame(()=>{var g;return(g=r==null?void 0:r.current)==null?void 0:g.blur()})):a([e])}function dA({nodeRef:e,disabled:t=!1,noDragClassName:n,handleSelector:r,nodeId:a,isSelectable:o,nodeClickDistance:l}){const d=nn(),[f,h]=j.useState(!1),g=j.useRef();return j.useEffect(()=>{g.current=IG({getStoreItems:()=>d.getState(),onNodeMouseDown:m=>{wb({id:m,store:d,nodeRef:e})},onDragStart:()=>{h(!0)},onDragStop:()=>{h(!1)}})},[]),j.useEffect(()=>{if(!(t||!e.current||!g.current))return g.current.update({noDragClassName:n,handleSelector:r,domNode:e.current,isSelectable:o,nodeId:a,nodeClickDistance:l}),()=>{var m;(m=g.current)==null||m.destroy()}},[n,r,t,o,e,a,l]),f}const XV=e=>t=>t.selected&&(t.draggable||e&&typeof t.draggable>"u");function fA(){const e=nn();return j.useCallback(n=>{const{nodeExtent:r,snapToGrid:a,snapGrid:o,nodesDraggable:l,onError:d,updateNodePositions:f,nodeLookup:h,nodeOrigin:g}=e.getState(),m=new Map,y=XV(l),b=a?o[0]:5,k=a?o[1]:5,v=n.direction.x*b*n.factor,N=n.direction.y*k*n.factor;for(const[,E]of h){if(!y(E))continue;let C={x:E.internals.positionAbsolute.x+v,y:E.internals.positionAbsolute.y+N};a&&(C=sd(C,o));const{position:S,positionAbsolute:_}=TC({nodeId:E.id,nextPosition:C,nodeLookup:h,nodeExtent:r,nodeOrigin:g,onError:d});E.position=S,E.internals.positionAbsolute=_,m.set(E.id,E)}f(m)},[])}const ev=j.createContext(null),ZV=ev.Provider;ev.Consumer;const hA=()=>j.useContext(ev),JV=e=>({connectOnClick:e.connectOnClick,noPanClassName:e.noPanClassName,rfId:e.rfId}),pA=j.createContext(null);function eY({children:e}){const t=St(JV,tn);return c.jsx(pA.Provider,{value:t,children:e})}function tY(){const e=j.useContext(pA);if(!e)throw new Error("useHandleConfig must be used within a HandleConfigProvider");return e}const nY={connectingFrom:!1,connectingTo:!1,clickConnecting:!1,isPossibleEndHandle:!0,connectionInProcess:!1,clickConnectionInProcess:!1,valid:!1},rY=(e,t,n)=>r=>{const{connectionClickStartHandle:a,connectionMode:o,connection:l}=r,{fromHandle:d,toHandle:f,isValid:h}=l;if(!d&&!a)return nY;const g=(f==null?void 0:f.nodeId)===e&&(f==null?void 0:f.id)===t&&(f==null?void 0:f.type)===n;return{connectingFrom:(d==null?void 0:d.nodeId)===e&&(d==null?void 0:d.id)===t&&(d==null?void 0:d.type)===n,connectingTo:g,clickConnecting:(a==null?void 0:a.nodeId)===e&&(a==null?void 0:a.id)===t&&(a==null?void 0:a.type)===n,isPossibleEndHandle:o===Hl.Strict?(d==null?void 0:d.type)!==n:e!==(d==null?void 0:d.nodeId)||t!==(d==null?void 0:d.id),connectionInProcess:!!d,clickConnectionInProcess:!!a,valid:g&&h}};function iY({type:e="source",position:t=Ge.Top,isValidConnection:n,isConnectable:r=!0,isConnectableStart:a=!0,isConnectableEnd:o=!0,id:l,onConnect:d,children:f,className:h,onMouseDown:g,onTouchStart:m,...y},b){var H,O;const k=l||null,v=e==="target",N=nn(),E=hA(),{connectOnClick:C,noPanClassName:S,rfId:_}=tY(),{connectingFrom:M,connectingTo:T,clickConnecting:L,isPossibleEndHandle:R,connectionInProcess:$,clickConnectionInProcess:z,valid:q}=St(rY(E,k,e),tn);E||(O=(H=N.getState()).onError)==null||O.call(H,"010",hi.error010());const F=V=>{const{defaultEdgeOptions:Q,onConnect:K,hasDefaultEdges:I}=N.getState(),P={...Q,...V};if(I){const{edges:G,setEdges:B,onError:oe}=N.getState();B(LV(P,G,{onError:oe}))}K==null||K(P),d==null||d(P)},Y=V=>{if(!E)return;const Q=BC(V.nativeEvent);if(a&&(Q&&V.button===0||!Q)){const K=N.getState();vb.onPointerDown(V.nativeEvent,{handleDomNode:V.currentTarget,autoPanOnConnect:K.autoPanOnConnect,connectionMode:K.connectionMode,connectionRadius:K.connectionRadius,domNode:K.domNode,nodeLookup:K.nodeLookup,lib:K.lib,isTarget:v,handleId:k,nodeId:E,flowId:K.rfId,panBy:K.panBy,cancelConnection:K.cancelConnection,onConnectStart:K.onConnectStart,onConnectEnd:(...I)=>{var P,G;return(G=(P=N.getState()).onConnectEnd)==null?void 0:G.call(P,...I)},updateConnection:K.updateConnection,onConnect:F,isValidConnection:n||((...I)=>{var P,G;return((G=(P=N.getState()).isValidConnection)==null?void 0:G.call(P,...I))??!0}),getTransform:()=>N.getState().transform,getFromHandle:()=>N.getState().connection.fromHandle,autoPanSpeed:K.autoPanSpeed,dragThreshold:K.connectionDragThreshold})}Q?g==null||g(V):m==null||m(V)},D=V=>{const{onClickConnectStart:Q,onClickConnectEnd:K,connectionClickStartHandle:I,connectionMode:P,isValidConnection:G,lib:B,rfId:oe,nodeLookup:ve,connection:ke}=N.getState();if(!E||!I&&!a)return;if(!I){Q==null||Q(V.nativeEvent,{nodeId:E,handleId:k,handleType:e}),N.setState({connectionClickStartHandle:{nodeId:E,type:e,id:k}});return}const Se=zC(V.target),J=n||G,{connection:ue,isValid:Te}=vb.isValid(V.nativeEvent,{handle:{nodeId:E,id:k,type:e},connectionMode:P,fromNodeId:I.nodeId,fromHandleId:I.id||null,fromType:I.type,isValidConnection:J,flowId:oe,doc:Se,lib:B,nodeLookup:ve});Te&&ue&&F(ue);const Oe=structuredClone(ke);delete Oe.inProgress,Oe.toPosition=Oe.toHandle?Oe.toHandle.position:null,K==null||K(V,Oe),N.setState({connectionClickStartHandle:null})};return c.jsx("div",{"data-handleid":k,"data-nodeid":E,"data-handlepos":t,"data-id":`${_}-${E}-${k}-${e}`,className:Nn(["react-flow__handle",`react-flow__handle-${t}`,"nodrag",S,h,{source:!v,target:v,connectable:r,connectablestart:a,connectableend:o,clickconnecting:L,connectingfrom:M,connectingto:T,valid:q,connectionindicator:r&&(!$||R)&&($||z?o:a)}]),onMouseDown:Y,onTouchStart:Y,onClick:C?D:void 0,ref:b,...y,children:f})}const Ti=j.memo(cA(iY));function aY({data:e,isConnectable:t,sourcePosition:n=Ge.Bottom}){return c.jsxs(c.Fragment,{children:[e==null?void 0:e.label,c.jsx(Ti,{type:"source",position:n,isConnectable:t})]})}function sY({data:e,isConnectable:t,targetPosition:n=Ge.Top,sourcePosition:r=Ge.Bottom}){return c.jsxs(c.Fragment,{children:[c.jsx(Ti,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label,c.jsx(Ti,{type:"source",position:r,isConnectable:t})]})}function oY(){return null}function lY({data:e,isConnectable:t,targetPosition:n=Ge.Top}){return c.jsxs(c.Fragment,{children:[c.jsx(Ti,{type:"target",position:n,isConnectable:t}),e==null?void 0:e.label]})}const Ih={ArrowUp:{x:0,y:-1},ArrowDown:{x:0,y:1},ArrowLeft:{x:-1,y:0},ArrowRight:{x:1,y:0}},IS={input:aY,default:sY,output:lY,group:oY};function cY(e){var t,n,r,a;return e.internals.handleBounds===void 0?{width:e.width??e.initialWidth??((t=e.style)==null?void 0:t.width),height:e.height??e.initialHeight??((n=e.style)==null?void 0:n.height)}:{width:e.width??((r=e.style)==null?void 0:r.width),height:e.height??((a=e.style)==null?void 0:a.height)}}const uY=e=>{const{width:t,height:n,x:r,y:a}=ad(e.nodeLookup,{filter:o=>!!o.selected});return{width:li(t)?t:null,height:li(n)?n:null,userSelectionActive:e.userSelectionActive,transformString:`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]}) translate(${r}px,${a}px)`}};function dY({onSelectionContextMenu:e,noPanClassName:t,disableKeyboardA11y:n}){const r=nn(),{width:a,height:o,transformString:l,userSelectionActive:d}=St(uY,tn),f=fA(),h=j.useRef(null);j.useEffect(()=>{var b;n||(b=h.current)==null||b.focus({preventScroll:!0})},[n]);const g=!d&&a!==null&&o!==null;if(dA({nodeRef:h,disabled:!g}),!g)return null;const m=e?b=>{const k=r.getState().nodes.filter(v=>v.selected);e(b,k)}:void 0,y=b=>{Object.prototype.hasOwnProperty.call(Ih,b.key)&&(b.preventDefault(),f({direction:Ih[b.key],factor:b.shiftKey?4:1}))};return c.jsx("div",{className:Nn(["react-flow__nodesselection","react-flow__container",t]),style:{transform:l},children:c.jsx("div",{ref:h,className:"react-flow__nodesselection-rect",onContextMenu:m,tabIndex:n?void 0:-1,onKeyDown:n?void 0:y,style:{width:a,height:o}})})}const zS=typeof window<"u"?window:void 0,fY=e=>({nodesSelectionActive:e.nodesSelectionActive,userSelectionActive:e.userSelectionActive});function mA({children:e,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:o,onPaneScroll:l,paneClickDistance:d,deleteKeyCode:f,selectionKeyCode:h,selectionOnDrag:g,selectionMode:m,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:k,panActivationKeyCode:v,zoomActivationKeyCode:N,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:S,panOnScroll:_,panOnScrollSpeed:M,panOnScrollMode:T,zoomOnDoubleClick:L,panOnDrag:R,autoPanOnSelection:$,defaultViewport:z,translateExtent:q,minZoom:F,maxZoom:Y,preventScrolling:D,onSelectionContextMenu:H,noWheelClassName:O,noPanClassName:V,disableKeyboardA11y:Q,onViewportChange:K,isControlledViewport:I}){const{nodesSelectionActive:P,userSelectionActive:G}=St(fY,tn),B=zu(h,{target:zS}),oe=zu(v,{target:zS}),ve=oe||R,ke=oe||_,Se=g&&ve!==!0,J=B||G||Se;return qV({deleteKeyCode:f,multiSelectionKeyCode:k}),c.jsx(GV,{onPaneContextMenu:o,elementsSelectable:E,zoomOnScroll:C,zoomOnPinch:S,panOnScroll:ke,panOnScrollSpeed:M,panOnScrollMode:T,zoomOnDoubleClick:L,panOnDrag:!B&&ve,defaultViewport:z,translateExtent:q,minZoom:F,maxZoom:Y,zoomActivationKeyCode:N,preventScrolling:D,noWheelClassName:O,noPanClassName:V,onViewportChange:K,isControlledViewport:I,paneClickDistance:d,selectionOnDrag:Se,children:c.jsxs(WV,{onSelectionStart:y,onSelectionEnd:b,onPaneClick:t,onPaneMouseEnter:n,onPaneMouseMove:r,onPaneMouseLeave:a,onPaneContextMenu:o,onPaneScroll:l,panOnDrag:ve,autoPanOnSelection:$,isSelecting:!!J,selectionMode:m,selectionKeyPressed:B,paneClickDistance:d,selectionOnDrag:Se,children:[e,P&&c.jsx(dY,{onSelectionContextMenu:H,noPanClassName:V,disableKeyboardA11y:Q})]})})}mA.displayName="FlowRenderer";const hY=j.memo(mA),pY=e=>t=>e?Kx(t.nodeLookup,{x:0,y:0,width:t.width,height:t.height},t.transform,!0).map(n=>n.id):Array.from(t.nodeLookup.keys());function mY(e){return St(j.useCallback(pY(e),[e]),tn)}const gY=e=>e.updateNodeInternals;function yY(){const e=St(gY),[t]=j.useState(()=>typeof ResizeObserver>"u"?null:new ResizeObserver(n=>{const r=new Map;n.forEach(a=>{const o=a.target.getAttribute("data-id");r.set(o,{id:o,nodeElement:a.target,force:!0})}),e(r)}));return j.useEffect(()=>()=>{t==null||t.disconnect()},[t]),t}function bY({node:e,nodeType:t,hasDimensions:n,resizeObserver:r}){const a=nn(),o=j.useRef(null),l=j.useRef(null),d=j.useRef(e.sourcePosition),f=j.useRef(e.targetPosition),h=j.useRef(t),g=n&&!!e.internals.handleBounds;return j.useEffect(()=>{o.current&&!e.hidden&&(!g||l.current!==o.current)&&(l.current&&(r==null||r.unobserve(l.current)),r==null||r.observe(o.current),l.current=o.current)},[g,e.hidden]),j.useEffect(()=>()=>{l.current&&(r==null||r.unobserve(l.current),l.current=null)},[]),j.useEffect(()=>{if(o.current){const m=h.current!==t,y=d.current!==e.sourcePosition,b=f.current!==e.targetPosition;(m||y||b)&&(h.current=t,d.current=e.sourcePosition,f.current=e.targetPosition,a.getState().updateNodeInternals(new Map([[e.id,{id:e.id,nodeElement:o.current,force:!0}]])))}},[e.id,t,e.sourcePosition,e.targetPosition]),o}function xY({id:e,onClick:t,onMouseEnter:n,onMouseMove:r,onMouseLeave:a,onContextMenu:o,onDoubleClick:l,nodesDraggable:d,elementsSelectable:f,nodesConnectable:h,nodesFocusable:g,resizeObserver:m,noDragClassName:y,noPanClassName:b,disableKeyboardA11y:k,rfId:v,nodeTypes:N,nodeClickDistance:E,onError:C}){const{node:S,internals:_,isParent:M}=St(J=>{const ue=J.nodeLookup.get(e),Te=J.parentLookup.has(e);return{node:ue,internals:ue.internals,isParent:Te}},tn);let T=S.type||"default",L=(N==null?void 0:N[T])||IS[T];L===void 0&&(C==null||C("003",hi.error003(T)),T="default",L=(N==null?void 0:N.default)||IS.default);const R=!!(S.draggable||d&&typeof S.draggable>"u"),$=!!(S.selectable||f&&typeof S.selectable>"u"),z=!!(S.connectable||h&&typeof S.connectable>"u"),q=!!(S.focusable||g&&typeof S.focusable>"u"),F=nn(),Y=LC(S),D=bY({node:S,nodeType:T,hasDimensions:Y,resizeObserver:m}),H=dA({nodeRef:D,disabled:S.hidden||!R,noDragClassName:y,handleSelector:S.dragHandle,nodeId:e,isSelectable:$,nodeClickDistance:E}),O=fA();if(S.hidden)return null;const V=va(S),Q=cY(S),K=$||R||t||n||r||a,I=n?J=>n(J,{..._.userNode}):void 0,P=r?J=>r(J,{..._.userNode}):void 0,G=a?J=>a(J,{..._.userNode}):void 0,B=o?J=>o(J,{..._.userNode}):void 0,oe=l?J=>l(J,{..._.userNode}):void 0,ve=J=>{const{selectNodesOnDrag:ue,nodeDragThreshold:Te}=F.getState();$&&(!ue||!R||Te>0)&&wb({id:e,store:F,nodeRef:D}),t&&t(J,{..._.userNode})},ke=J=>{if(!(PC(J.nativeEvent)||k)){if(NC.includes(J.key)&&$){const ue=J.key==="Escape";wb({id:e,store:F,unselect:ue,nodeRef:D})}else if(R&&S.selected&&Object.prototype.hasOwnProperty.call(Ih,J.key)){J.preventDefault();const{ariaLabelConfig:ue}=F.getState();F.setState({ariaLiveMessage:ue["node.a11yDescription.ariaLiveMessage"]({direction:J.key.replace("Arrow","").toLowerCase(),x:~~_.positionAbsolute.x,y:~~_.positionAbsolute.y})}),O({direction:Ih[J.key],factor:J.shiftKey?4:1})}}},Se=()=>{var Ce;if(k||!((Ce=D.current)!=null&&Ce.matches(":focus-visible")))return;const{transform:J,width:ue,height:Te,autoPanOnNodeFocus:Oe,setCenter:De}=F.getState();if(!Oe)return;Kx(new Map([[e,S]]),{x:0,y:0,width:ue,height:Te},J,!0).length>0||De(S.position.x+V.width/2,S.position.y+V.height/2,{zoom:J[2]})};return c.jsx("div",{className:Nn(["react-flow__node",`react-flow__node-${T}`,{[b]:R},S.className,{selected:S.selected,selectable:$,parent:M,draggable:R,dragging:H}]),ref:D,style:{zIndex:_.z,transform:`translate(${_.positionAbsolute.x}px,${_.positionAbsolute.y}px)`,pointerEvents:K?"all":"none",visibility:Y?"visible":"hidden",...S.style,...Q},"data-id":e,"data-testid":`rf__node-${e}`,onMouseEnter:I,onMouseMove:P,onMouseLeave:G,onContextMenu:B,onClick:ve,onDoubleClick:oe,onKeyDown:q?ke:void 0,tabIndex:q?0:void 0,onFocus:q?Se:void 0,role:S.ariaRole??(q?"group":void 0),"aria-roledescription":"node","aria-describedby":k?void 0:`${rA}-${v}`,"aria-label":S.ariaLabel,...S.domAttributes,children:c.jsx(ZV,{value:e,children:c.jsx(L,{id:e,data:S.data,type:T,positionAbsoluteX:_.positionAbsolute.x,positionAbsoluteY:_.positionAbsolute.y,selected:S.selected??!1,selectable:$,draggable:R,deletable:S.deletable??!0,isConnectable:z,sourcePosition:S.sourcePosition,targetPosition:S.targetPosition,dragging:H,dragHandle:S.dragHandle,zIndex:_.z,parentId:S.parentId,...V})})})}var vY=j.memo(xY);const wY=e=>({nodesDraggable:e.nodesDraggable,nodesConnectable:e.nodesConnectable,nodesFocusable:e.nodesFocusable,elementsSelectable:e.elementsSelectable,onError:e.onError});function gA(e){const{nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,onError:o}=St(wY,tn),l=mY(e.onlyRenderVisibleElements),d=yY();return c.jsx("div",{className:"react-flow__nodes",style:vp,children:l.map(f=>c.jsx(vY,{id:f,nodeTypes:e.nodeTypes,nodeExtent:e.nodeExtent,onClick:e.onNodeClick,onMouseEnter:e.onNodeMouseEnter,onMouseMove:e.onNodeMouseMove,onMouseLeave:e.onNodeMouseLeave,onContextMenu:e.onNodeContextMenu,onDoubleClick:e.onNodeDoubleClick,noDragClassName:e.noDragClassName,noPanClassName:e.noPanClassName,rfId:e.rfId,disableKeyboardA11y:e.disableKeyboardA11y,resizeObserver:d,nodesDraggable:t,nodesConnectable:n,nodesFocusable:r,elementsSelectable:a,nodeClickDistance:e.nodeClickDistance,onError:o},f))})}gA.displayName="NodeRenderer";const kY=j.memo(gA);function EY(e){return St(j.useCallback(n=>{if(!e)return n.edges.map(a=>a.id);const r=[];if(n.width&&n.height)for(const a of n.edges){const o=n.nodeLookup.get(a.source),l=n.nodeLookup.get(a.target);o&&l&&yG({sourceNode:o,targetNode:l,width:n.width,height:n.height,transform:n.transform})&&r.push(a.id)}return r},[e]),tn)}const SY=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e}};return c.jsx("polyline",{className:"arrow",style:n,strokeLinecap:"round",fill:"none",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4"})},NY=({color:e="none",strokeWidth:t=1})=>{const n={strokeWidth:t,...e&&{stroke:e,fill:e}};return c.jsx("polyline",{className:"arrowclosed",style:n,strokeLinecap:"round",strokeLinejoin:"round",points:"-5,-4 0,0 -5,4 -5,-4"})},PS={[Oh.Arrow]:SY,[Oh.ArrowClosed]:NY};function _Y(e){const t=nn();return j.useMemo(()=>{var a,o;return Object.prototype.hasOwnProperty.call(PS,e)?PS[e]:((o=(a=t.getState()).onError)==null||o.call(a,"009",hi.error009(e)),null)},[e])}const jY=({id:e,type:t,color:n,width:r=12.5,height:a=12.5,markerUnits:o="strokeWidth",strokeWidth:l,orient:d="auto-start-reverse"})=>{const f=_Y(t);return f?c.jsx("marker",{className:"react-flow__arrowhead",id:e,markerWidth:`${r}`,markerHeight:`${a}`,viewBox:"-10 -10 20 20",markerUnits:o,orient:d,refX:"0",refY:"0",children:c.jsx(f,{color:n,strokeWidth:l})}):null},yA=({defaultColor:e,rfId:t})=>{const n=St(o=>o.edges),r=St(o=>o.defaultEdgeOptions),a=j.useMemo(()=>NG(n,{id:t,defaultColor:e,defaultMarkerStart:r==null?void 0:r.markerStart,defaultMarkerEnd:r==null?void 0:r.markerEnd}),[n,r,t,e]);return a.length?c.jsx("svg",{className:"react-flow__marker","aria-hidden":"true",children:c.jsx("defs",{children:a.map(o=>c.jsx(jY,{id:o.id,type:o.type,color:o.color,width:o.width,height:o.height,markerUnits:o.markerUnits,strokeWidth:o.strokeWidth,orient:o.orient},o.id))})}):null};yA.displayName="MarkerDefinitions";var CY=j.memo(yA);function bA({x:e,y:t,label:n,labelStyle:r,labelShowBg:a=!0,labelBgStyle:o,labelBgPadding:l=[2,4],labelBgBorderRadius:d=2,children:f,className:h,...g}){const[m,y]=j.useState({x:1,y:0,width:0,height:0}),b=Nn(["react-flow__edge-textwrapper",h]),k=j.useRef(null);return j.useEffect(()=>{if(k.current){const v=k.current.getBBox();y({x:v.x,y:v.y,width:v.width,height:v.height})}},[n]),n?c.jsxs("g",{transform:`translate(${e-m.width/2} ${t-m.height/2})`,className:b,visibility:m.width?"visible":"hidden",...g,children:[a&&c.jsx("rect",{width:m.width+2*l[0],x:-l[0],y:-l[1],height:m.height+2*l[1],className:"react-flow__edge-textbg",style:o,rx:d,ry:d}),c.jsx("text",{className:"react-flow__edge-text",y:m.height/2,dy:"0.3em",ref:k,style:r,children:n}),f]}):null}bA.displayName="EdgeText";const AY=j.memo(bA);function wp({path:e,labelX:t,labelY:n,label:r,labelStyle:a,labelShowBg:o,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f,interactionWidth:h=20,...g}){return c.jsxs(c.Fragment,{children:[c.jsx("path",{...g,d:e,fill:"none",className:Nn(["react-flow__edge-path",g.className])}),h?c.jsx("path",{d:e,fill:"none",strokeOpacity:0,strokeWidth:h,className:"react-flow__edge-interaction"}):null,r&&li(t)&&li(n)?c.jsx(AY,{x:t,y:n,label:r,labelStyle:a,labelShowBg:o,labelBgStyle:l,labelBgPadding:d,labelBgBorderRadius:f}):null]})}function BS({pos:e,x1:t,y1:n,x2:r,y2:a}){return e===Ge.Left||e===Ge.Right?[.5*(t+r),n]:[t,.5*(n+a)]}function xA({sourceX:e,sourceY:t,sourcePosition:n=Ge.Bottom,targetX:r,targetY:a,targetPosition:o=Ge.Top}){const[l,d]=BS({pos:n,x1:e,y1:t,x2:r,y2:a}),[f,h]=BS({pos:o,x1:r,y1:a,x2:e,y2:t}),[g,m,y,b]=$C({sourceX:e,sourceY:t,targetX:r,targetY:a,sourceControlX:l,sourceControlY:d,targetControlX:f,targetControlY:h});return[`M${e},${t} C${l},${d} ${f},${h} ${r},${a}`,g,m,y,b]}function vA(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:o,sourcePosition:l,targetPosition:d,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:N,interactionWidth:E})=>{const[C,S,_]=xA({sourceX:n,sourceY:r,sourcePosition:l,targetX:a,targetY:o,targetPosition:d}),M=e.isInternal?void 0:t;return c.jsx(wp,{id:M,path:C,labelX:S,labelY:_,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:N,interactionWidth:E})})}const TY=vA({isInternal:!1}),wA=vA({isInternal:!0});TY.displayName="SimpleBezierEdge";wA.displayName="SimpleBezierEdgeInternal";function kA(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:o,label:l,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,sourcePosition:b=Ge.Bottom,targetPosition:k=Ge.Top,markerEnd:v,markerStart:N,pathOptions:E,interactionWidth:C})=>{const[S,_,M]=yb({sourceX:n,sourceY:r,sourcePosition:b,targetX:a,targetY:o,targetPosition:k,borderRadius:E==null?void 0:E.borderRadius,offset:E==null?void 0:E.offset,stepPosition:E==null?void 0:E.stepPosition}),T=e.isInternal?void 0:t;return c.jsx(wp,{id:T,path:S,labelX:_,labelY:M,label:l,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:v,markerStart:N,interactionWidth:C})})}const EA=kA({isInternal:!1}),SA=kA({isInternal:!0});EA.displayName="SmoothStepEdge";SA.displayName="SmoothStepEdgeInternal";function NA(e){return j.memo(({id:t,...n})=>{var a;const r=e.isInternal?void 0:t;return c.jsx(EA,{...n,id:r,pathOptions:j.useMemo(()=>{var o;return{borderRadius:0,offset:(o=n.pathOptions)==null?void 0:o.offset}},[(a=n.pathOptions)==null?void 0:a.offset])})})}const MY=NA({isInternal:!1}),_A=NA({isInternal:!0});MY.displayName="StepEdge";_A.displayName="StepEdgeInternal";function jA(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:o,label:l,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:b,markerStart:k,interactionWidth:v})=>{const[N,E,C]=qC({sourceX:n,sourceY:r,targetX:a,targetY:o}),S=e.isInternal?void 0:t;return c.jsx(wp,{id:S,path:N,labelX:E,labelY:C,label:l,labelStyle:d,labelShowBg:f,labelBgStyle:h,labelBgPadding:g,labelBgBorderRadius:m,style:y,markerEnd:b,markerStart:k,interactionWidth:v})})}const DY=jA({isInternal:!1}),CA=jA({isInternal:!0});DY.displayName="StraightEdge";CA.displayName="StraightEdgeInternal";function AA(e){return j.memo(({id:t,sourceX:n,sourceY:r,targetX:a,targetY:o,sourcePosition:l=Ge.Bottom,targetPosition:d=Ge.Top,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:N,pathOptions:E,interactionWidth:C})=>{const[S,_,M]=UC({sourceX:n,sourceY:r,sourcePosition:l,targetX:a,targetY:o,targetPosition:d,curvature:E==null?void 0:E.curvature}),T=e.isInternal?void 0:t;return c.jsx(wp,{id:T,path:S,labelX:_,labelY:M,label:f,labelStyle:h,labelShowBg:g,labelBgStyle:m,labelBgPadding:y,labelBgBorderRadius:b,style:k,markerEnd:v,markerStart:N,interactionWidth:C})})}const OY=AA({isInternal:!1}),TA=AA({isInternal:!0});OY.displayName="BezierEdge";TA.displayName="BezierEdgeInternal";const $S={default:TA,straight:CA,step:_A,smoothstep:SA,simplebezier:wA},US={sourceX:null,sourceY:null,targetX:null,targetY:null,sourcePosition:null,targetPosition:null,zIndex:void 0},RY=(e,t,n)=>n===Ge.Left?e-t:n===Ge.Right?e+t:e,LY=(e,t,n)=>n===Ge.Top?e-t:n===Ge.Bottom?e+t:e,FS="react-flow__edgeupdater";function qS({position:e,centerX:t,centerY:n,radius:r=10,onMouseDown:a,onMouseEnter:o,onMouseOut:l,type:d}){return c.jsx("circle",{onMouseDown:a,onMouseEnter:o,onMouseOut:l,className:Nn([FS,`${FS}-${d}`]),cx:RY(t,r,e),cy:LY(n,r,e),r,stroke:"transparent",fill:"transparent"})}function IY({isReconnectable:e,reconnectRadius:t,edge:n,sourceX:r,sourceY:a,targetX:o,targetY:l,sourcePosition:d,targetPosition:f,onReconnect:h,onReconnectStart:g,onReconnectEnd:m,setReconnecting:y,setUpdateHover:b}){const k=nn(),v=(_,M)=>{if(_.button!==0)return;const{autoPanOnConnect:T,domNode:L,connectionMode:R,connectionRadius:$,lib:z,onConnectStart:q,cancelConnection:F,nodeLookup:Y,rfId:D,panBy:H,updateConnection:O}=k.getState(),V=M.type==="target",Q=(P,G)=>{y(!1),m==null||m(P,n,M.type,G)},K=P=>h==null?void 0:h(n,P),I=(P,G)=>{y(!0),g==null||g(_,n,M.type),q==null||q(P,G)};vb.onPointerDown(_.nativeEvent,{autoPanOnConnect:T,connectionMode:R,connectionRadius:$,domNode:L,handleId:M.id,nodeId:M.nodeId,nodeLookup:Y,isTarget:V,edgeUpdaterType:M.type,lib:z,flowId:D,cancelConnection:F,panBy:H,isValidConnection:(...P)=>{var G,B;return((B=(G=k.getState()).isValidConnection)==null?void 0:B.call(G,...P))??!0},onConnect:K,onConnectStart:I,onConnectEnd:(...P)=>{var G,B;return(B=(G=k.getState()).onConnectEnd)==null?void 0:B.call(G,...P)},onReconnectEnd:Q,updateConnection:O,getTransform:()=>k.getState().transform,getFromHandle:()=>k.getState().connection.fromHandle,dragThreshold:k.getState().connectionDragThreshold,handleDomNode:_.currentTarget})},N=_=>v(_,{nodeId:n.target,id:n.targetHandle??null,type:"target"}),E=_=>v(_,{nodeId:n.source,id:n.sourceHandle??null,type:"source"}),C=()=>b(!0),S=()=>b(!1);return c.jsxs(c.Fragment,{children:[(e===!0||e==="source")&&c.jsx(qS,{position:d,centerX:r,centerY:a,radius:t,onMouseDown:N,onMouseEnter:C,onMouseOut:S,type:"source"}),(e===!0||e==="target")&&c.jsx(qS,{position:f,centerX:o,centerY:l,radius:t,onMouseDown:E,onMouseEnter:C,onMouseOut:S,type:"target"})]})}function zY({id:e,edgesFocusable:t,edgesReconnectable:n,elementsSelectable:r,onClick:a,onDoubleClick:o,onContextMenu:l,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:b,rfId:k,edgeTypes:v,noPanClassName:N,onError:E,disableKeyboardA11y:C}){let S=St(De=>De.edgeLookup.get(e));const _=St(De=>De.defaultEdgeOptions);S=_?{..._,...S}:S;let M=S.type||"default",T=(v==null?void 0:v[M])||$S[M];T===void 0&&(E==null||E("011",hi.error011(M)),M="default",T=(v==null?void 0:v.default)||$S.default);const L=!!(S.focusable||t&&typeof S.focusable>"u"),R=typeof m<"u"&&(S.reconnectable||n&&typeof S.reconnectable>"u"),$=!!(S.selectable||r&&typeof S.selectable>"u"),z=j.useRef(null),[q,F]=j.useState(!1),[Y,D]=j.useState(!1),H=nn(),{zIndex:O=S.zIndex,sourceX:V,sourceY:Q,targetX:K,targetY:I,sourcePosition:P,targetPosition:G}=St(j.useCallback(De=>{const ce=De.nodeLookup.get(S.source),Ce=De.nodeLookup.get(S.target);if(!ce||!Ce)return US;const te=SG({id:e,sourceNode:ce,targetNode:Ce,sourceHandle:S.sourceHandle||null,targetHandle:S.targetHandle||null,connectionMode:De.connectionMode,onError:E}),pe=gG({selected:S.selected,zIndex:S.zIndex,sourceNode:ce,targetNode:Ce,elevateOnSelect:De.elevateEdgesOnSelect,zIndexMode:De.zIndexMode});return{...te||US,zIndex:pe}},[S.source,S.target,S.sourceHandle,S.targetHandle,S.selected,S.zIndex]),tn),B=j.useMemo(()=>S.markerStart?`url('#${bb(S.markerStart,k)}')`:void 0,[S.markerStart,k]),oe=j.useMemo(()=>S.markerEnd?`url('#${bb(S.markerEnd,k)}')`:void 0,[S.markerEnd,k]);if(S.hidden||V===null||Q===null||K===null||I===null)return null;const ve=De=>{var pe;const{addSelectedEdges:ce,unselectNodesAndEdges:Ce,multiSelectionActive:te}=H.getState();$&&(H.setState({nodesSelectionActive:!1}),S.selected&&te?(Ce({nodes:[],edges:[S]}),(pe=z.current)==null||pe.blur()):ce([e])),a&&a(De,S)},ke=o?De=>{o(De,{...S})}:void 0,Se=l?De=>{l(De,{...S})}:void 0,J=d?De=>{d(De,{...S})}:void 0,ue=f?De=>{f(De,{...S})}:void 0,Te=h?De=>{h(De,{...S})}:void 0,Oe=De=>{var ce;if(!C&&NC.includes(De.key)&&$){const{unselectNodesAndEdges:Ce,addSelectedEdges:te}=H.getState();De.key==="Escape"?((ce=z.current)==null||ce.blur(),Ce({edges:[S]})):te([e])}};return c.jsx("svg",{style:{zIndex:O},children:c.jsxs("g",{className:Nn(["react-flow__edge",`react-flow__edge-${M}`,S.className,N,{selected:S.selected,animated:S.animated,inactive:!$&&!a,updating:q,selectable:$}]),onClick:ve,onDoubleClick:ke,onContextMenu:Se,onMouseEnter:J,onMouseMove:ue,onMouseLeave:Te,onKeyDown:L?Oe:void 0,tabIndex:L?0:void 0,role:S.ariaRole??(L?"group":"img"),"aria-roledescription":"edge","data-id":e,"data-testid":`rf__edge-${e}`,"aria-label":S.ariaLabel===null?void 0:S.ariaLabel||`Edge from ${S.source} to ${S.target}`,"aria-describedby":L?`${iA}-${k}`:void 0,ref:z,...S.domAttributes,children:[!Y&&c.jsx(T,{id:e,source:S.source,target:S.target,type:S.type,selected:S.selected,animated:S.animated,selectable:$,deletable:S.deletable??!0,label:S.label,labelStyle:S.labelStyle,labelShowBg:S.labelShowBg,labelBgStyle:S.labelBgStyle,labelBgPadding:S.labelBgPadding,labelBgBorderRadius:S.labelBgBorderRadius,sourceX:V,sourceY:Q,targetX:K,targetY:I,sourcePosition:P,targetPosition:G,data:S.data,style:S.style,sourceHandleId:S.sourceHandle,targetHandleId:S.targetHandle,markerStart:B,markerEnd:oe,pathOptions:"pathOptions"in S?S.pathOptions:void 0,interactionWidth:S.interactionWidth}),R&&c.jsx(IY,{edge:S,isReconnectable:R,reconnectRadius:g,onReconnect:m,onReconnectStart:y,onReconnectEnd:b,sourceX:V,sourceY:Q,targetX:K,targetY:I,sourcePosition:P,targetPosition:G,setUpdateHover:F,setReconnecting:D})]})})}var PY=j.memo(zY);const BY=e=>({edgesFocusable:e.edgesFocusable,edgesReconnectable:e.edgesReconnectable,elementsSelectable:e.elementsSelectable,connectionMode:e.connectionMode,onError:e.onError});function MA({defaultMarkerColor:e,onlyRenderVisibleElements:t,rfId:n,edgeTypes:r,noPanClassName:a,onReconnect:o,onEdgeContextMenu:l,onEdgeMouseEnter:d,onEdgeMouseMove:f,onEdgeMouseLeave:h,onEdgeClick:g,reconnectRadius:m,onEdgeDoubleClick:y,onReconnectStart:b,onReconnectEnd:k,disableKeyboardA11y:v}){const{edgesFocusable:N,edgesReconnectable:E,elementsSelectable:C,onError:S}=St(BY,tn),_=EY(t);return c.jsxs("div",{className:"react-flow__edges",children:[c.jsx(CY,{defaultColor:e,rfId:n}),_.map(M=>c.jsx(PY,{id:M,edgesFocusable:N,edgesReconnectable:E,elementsSelectable:C,noPanClassName:a,onReconnect:o,onContextMenu:l,onMouseEnter:d,onMouseMove:f,onMouseLeave:h,onClick:g,reconnectRadius:m,onDoubleClick:y,onReconnectStart:b,onReconnectEnd:k,rfId:n,onError:S,edgeTypes:r,disableKeyboardA11y:v},M))]})}MA.displayName="EdgeRenderer";const $Y=j.memo(MA),UY=e=>`translate(${e.transform[0]}px,${e.transform[1]}px) scale(${e.transform[2]})`;function FY({children:e}){const t=St(UY);return c.jsx("div",{className:"react-flow__viewport xyflow__viewport react-flow__container",style:{transform:t},children:e})}function qY(e){const t=xp(),n=j.useRef(!1);j.useEffect(()=>{!n.current&&t.viewportInitialized&&e&&(setTimeout(()=>e(t),1),n.current=!0)},[e,t.viewportInitialized])}const HY=e=>{var t;return(t=e.panZoom)==null?void 0:t.syncViewport};function KY(e){const t=St(HY),n=nn();return j.useEffect(()=>{e&&(t==null||t(e),n.setState({transform:[e.x,e.y,e.zoom]}))},[e,t]),null}function GY(e){return e.connection.inProgress?{...e.connection,to:od(e.connection.to,e.transform)}:{...e.connection}}function VY(e){return GY}function YY(e){const t=VY();return St(t,tn)}const QY=e=>({nodesConnectable:e.nodesConnectable,isValid:e.connection.isValid,inProgress:e.connection.inProgress,width:e.width,height:e.height});function WY({containerStyle:e,style:t,type:n,component:r}){const{nodesConnectable:a,width:o,height:l,isValid:d,inProgress:f}=St(QY,tn);return!(o&&a&&f)?null:c.jsx("svg",{style:e,width:o,height:l,className:"react-flow__connectionline react-flow__container",children:c.jsx("g",{className:Nn(["react-flow__connection",CC(d)]),children:c.jsx(DA,{style:t,type:n,CustomComponent:r,isValid:d})})})}const DA=({style:e,type:t=ls.Bezier,CustomComponent:n,isValid:r})=>{const{inProgress:a,from:o,fromNode:l,fromHandle:d,fromPosition:f,to:h,toNode:g,toHandle:m,toPosition:y,pointer:b}=YY();if(!a)return;if(n)return c.jsx(n,{connectionLineType:t,connectionLineStyle:e,fromNode:l,fromHandle:d,fromX:o.x,fromY:o.y,toX:h.x,toY:h.y,fromPosition:f,toPosition:y,connectionStatus:CC(r),toNode:g,toHandle:m,pointer:b});let k="";const v={sourceX:o.x,sourceY:o.y,sourcePosition:f,targetX:h.x,targetY:h.y,targetPosition:y};switch(t){case ls.Bezier:[k]=UC(v);break;case ls.SimpleBezier:[k]=xA(v);break;case ls.Step:[k]=yb({...v,borderRadius:0});break;case ls.SmoothStep:[k]=yb(v);break;default:[k]=qC(v)}return c.jsx("path",{d:k,fill:"none",className:"react-flow__connection-path",style:e})};DA.displayName="ConnectionLine";const XY={};function HS(e=XY){j.useRef(e),nn(),j.useEffect(()=>{},[e])}function ZY(){nn(),j.useRef(!1),j.useEffect(()=>{},[])}function OA({nodeTypes:e,edgeTypes:t,onInit:n,onNodeClick:r,onEdgeClick:a,onNodeDoubleClick:o,onEdgeDoubleClick:l,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,onSelectionContextMenu:m,onSelectionStart:y,onSelectionEnd:b,connectionLineType:k,connectionLineStyle:v,connectionLineComponent:N,connectionLineContainerStyle:E,selectionKeyCode:C,selectionOnDrag:S,selectionMode:_,multiSelectionKeyCode:M,panActivationKeyCode:T,zoomActivationKeyCode:L,deleteKeyCode:R,onlyRenderVisibleElements:$,elementsSelectable:z,defaultViewport:q,translateExtent:F,minZoom:Y,maxZoom:D,preventScrolling:H,defaultMarkerColor:O,zoomOnScroll:V,zoomOnPinch:Q,panOnScroll:K,panOnScrollSpeed:I,panOnScrollMode:P,zoomOnDoubleClick:G,panOnDrag:B,autoPanOnSelection:oe,onPaneClick:ve,onPaneMouseEnter:ke,onPaneMouseMove:Se,onPaneMouseLeave:J,onPaneScroll:ue,onPaneContextMenu:Te,paneClickDistance:Oe,nodeClickDistance:De,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:te,onEdgeMouseLeave:pe,reconnectRadius:Fe,onReconnect:ze,onReconnectStart:ae,onReconnectEnd:be,noDragClassName:ye,noWheelClassName:he,noPanClassName:Ee,disableKeyboardA11y:Ne,nodeExtent:Ke,rfId:ne,viewport:de,onViewportChange:Le}){return HS(e),HS(t),ZY(),qY(n),KY(de),c.jsx(hY,{onPaneClick:ve,onPaneMouseEnter:ke,onPaneMouseMove:Se,onPaneMouseLeave:J,onPaneContextMenu:Te,onPaneScroll:ue,paneClickDistance:Oe,deleteKeyCode:R,selectionKeyCode:C,selectionOnDrag:S,selectionMode:_,onSelectionStart:y,onSelectionEnd:b,multiSelectionKeyCode:M,panActivationKeyCode:T,zoomActivationKeyCode:L,elementsSelectable:z,zoomOnScroll:V,zoomOnPinch:Q,zoomOnDoubleClick:G,panOnScroll:K,panOnScrollSpeed:I,panOnScrollMode:P,panOnDrag:B,autoPanOnSelection:oe,defaultViewport:q,translateExtent:F,minZoom:Y,maxZoom:D,onSelectionContextMenu:m,preventScrolling:H,noDragClassName:ye,noWheelClassName:he,noPanClassName:Ee,disableKeyboardA11y:Ne,onViewportChange:Le,isControlledViewport:!!de,children:c.jsxs(FY,{children:[c.jsx($Y,{edgeTypes:t,onEdgeClick:a,onEdgeDoubleClick:l,onReconnect:ze,onReconnectStart:ae,onReconnectEnd:be,onlyRenderVisibleElements:$,onEdgeContextMenu:ce,onEdgeMouseEnter:Ce,onEdgeMouseMove:te,onEdgeMouseLeave:pe,reconnectRadius:Fe,defaultMarkerColor:O,noPanClassName:Ee,disableKeyboardA11y:Ne,rfId:ne}),c.jsx(WY,{style:v,type:k,component:N,containerStyle:E}),c.jsx("div",{className:"react-flow__edgelabel-renderer"}),c.jsx(kY,{nodeTypes:e,onNodeClick:r,onNodeDoubleClick:o,onNodeMouseEnter:d,onNodeMouseMove:f,onNodeMouseLeave:h,onNodeContextMenu:g,nodeClickDistance:De,onlyRenderVisibleElements:$,noPanClassName:Ee,noDragClassName:ye,disableKeyboardA11y:Ne,nodeExtent:Ke,rfId:ne}),c.jsx("div",{className:"react-flow__viewport-portal"})]})})}OA.displayName="GraphView";const JY=j.memo(OA),eQ=RC(),KS=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:o,fitView:l,fitViewOptions:d,minZoom:f=.5,maxZoom:h=2,nodeOrigin:g,nodeExtent:m,zIndexMode:y="basic"}={})=>{const b=new Map,k=new Map,v=new Map,N=new Map,E=r??t??[],C=n??e??[],S=g??[0,0],_=m??Ou;GC(v,N,E);const{nodesInitialized:M}=xb(C,b,k,{nodeOrigin:S,nodeExtent:_,zIndexMode:y});let T=[0,0,1];if(l&&a&&o){const L=ad(b,{filter:q=>!!((q.width||q.initialWidth)&&(q.height||q.initialHeight))}),{x:R,y:$,zoom:z}=Vx(L,a,o,f,h,(d==null?void 0:d.padding)??.1);T=[R,$,z]}return{rfId:"1",width:a??0,height:o??0,transform:T,nodes:C,nodesInitialized:M,nodeLookup:b,parentLookup:k,edges:E,edgeLookup:N,connectionLookup:v,onNodesChange:null,onEdgesChange:null,hasDefaultNodes:n!==void 0,hasDefaultEdges:r!==void 0,panZoom:null,minZoom:f,maxZoom:h,translateExtent:Ou,nodeExtent:_,nodesSelectionActive:!1,userSelectionActive:!1,userSelectionRect:null,connectionMode:Hl.Strict,domNode:null,paneDragging:!1,noPanClassName:"nopan",nodeOrigin:S,nodeDragThreshold:1,connectionDragThreshold:1,snapGrid:[15,15],snapToGrid:!1,nodesDraggable:!0,nodesConnectable:!0,nodesFocusable:!0,edgesFocusable:!0,edgesReconnectable:!0,elementsSelectable:!0,elevateNodesOnSelect:!0,elevateEdgesOnSelect:!0,selectNodesOnDrag:!0,multiSelectionActive:!1,fitViewQueued:l??!1,fitViewOptions:d,fitViewResolver:null,connection:{...jC},connectionClickStartHandle:null,connectOnClick:!0,ariaLiveMessage:"",autoPanOnConnect:!0,autoPanOnNodeDrag:!0,autoPanOnNodeFocus:!0,autoPanSpeed:15,connectionRadius:20,onError:eQ,isValidConnection:void 0,onSelectionChangeHandlers:[],lib:"react",debug:!1,ariaLabelConfig:_C,zIndexMode:y,onNodesChangeMiddlewareMap:new Map,onEdgesChangeMiddlewareMap:new Map}},tQ=({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:o,fitView:l,fitViewOptions:d,minZoom:f,maxZoom:h,nodeOrigin:g,nodeExtent:m,zIndexMode:y})=>hV((b,k)=>{async function v(){const{nodeLookup:N,panZoom:E,fitViewOptions:C,fitViewResolver:S,width:_,height:M,minZoom:T,maxZoom:L}=k();E&&(await cG({nodes:N,width:_,height:M,panZoom:E,minZoom:T,maxZoom:L},C),S==null||S.resolve(!0),b({fitViewResolver:null}))}return{...KS({nodes:e,edges:t,width:a,height:o,fitView:l,fitViewOptions:d,minZoom:f,maxZoom:h,nodeOrigin:g,nodeExtent:m,defaultNodes:n,defaultEdges:r,zIndexMode:y}),setNodes:N=>{const{nodeLookup:E,parentLookup:C,nodeOrigin:S,elevateNodesOnSelect:_,fitViewQueued:M,zIndexMode:T,nodesSelectionActive:L}=k(),{nodesInitialized:R,hasSelectedNodes:$}=xb(N,E,C,{nodeOrigin:S,nodeExtent:m,elevateNodesOnSelect:_,checkEquality:!0,zIndexMode:T}),z=L&&$;M&&R?(v(),b({nodes:N,nodesInitialized:R,fitViewQueued:!1,fitViewOptions:void 0,nodesSelectionActive:z})):b({nodes:N,nodesInitialized:R,nodesSelectionActive:z})},setEdges:N=>{const{connectionLookup:E,edgeLookup:C}=k();GC(E,C,N),b({edges:N})},setDefaultNodesAndEdges:(N,E)=>{if(N){const{setNodes:C}=k();C(N),b({hasDefaultNodes:!0})}if(E){const{setEdges:C}=k();C(E),b({hasDefaultEdges:!0})}},updateNodeInternals:N=>{const{triggerNodeChanges:E,nodeLookup:C,parentLookup:S,domNode:_,nodeOrigin:M,nodeExtent:T,debug:L,fitViewQueued:R,zIndexMode:$}=k(),{changes:z,updatedInternals:q}=DG(N,C,S,_,M,T,$);q&&(CG(C,S,{nodeOrigin:M,nodeExtent:T,zIndexMode:$}),R?(v(),b({fitViewQueued:!1,fitViewOptions:void 0})):b({}),(z==null?void 0:z.length)>0&&(L&&console.log("React Flow: trigger node changes",z),E==null||E(z)))},updateNodePositions:(N,E=!1)=>{const C=[];let S=[];const{nodeLookup:_,triggerNodeChanges:M,connection:T,updateConnection:L,onNodesChangeMiddlewareMap:R}=k();for(const[$,z]of N){const q=_.get($),F=!!(q!=null&&q.expandParent&&(q!=null&&q.parentId)&&(z!=null&&z.position)),Y={id:$,type:"position",position:F?{x:Math.max(0,z.position.x),y:Math.max(0,z.position.y)}:z.position,dragging:E};if(q&&T.inProgress&&T.fromNode.id===q.id){const D=vo(q,T.fromHandle,Ge.Left,!0);L({...T,from:D})}F&&q.parentId&&C.push({id:$,parentId:q.parentId,rect:{...z.internals.positionAbsolute,width:z.measured.width??0,height:z.measured.height??0}}),S.push(Y)}if(C.length>0){const{parentLookup:$,nodeOrigin:z}=k(),q=Jx(C,_,$,z);S.push(...q)}for(const $ of R.values())S=$(S);M(S)},triggerNodeChanges:N=>{const{onNodesChange:E,setNodes:C,nodes:S,hasDefaultNodes:_,debug:M}=k();if(N!=null&&N.length){if(_){const T=oA(N,S);C(T)}M&&console.log("React Flow: trigger node changes",N),E==null||E(N)}},triggerEdgeChanges:N=>{const{onEdgesChange:E,setEdges:C,edges:S,hasDefaultEdges:_,debug:M}=k();if(N!=null&&N.length){if(_){const T=lA(N,S);C(T)}M&&console.log("React Flow: trigger edge changes",N),E==null||E(N)}},addSelectedNodes:N=>{const{multiSelectionActive:E,edgeLookup:C,nodeLookup:S,triggerNodeChanges:_,triggerEdgeChanges:M}=k();if(E){const T=N.map(L=>Ys(L,!0));_(T);return}_(vl(S,new Set([...N]),!0)),M(vl(C))},addSelectedEdges:N=>{const{multiSelectionActive:E,edgeLookup:C,nodeLookup:S,triggerNodeChanges:_,triggerEdgeChanges:M}=k();if(E){const T=N.map(L=>Ys(L,!0));M(T);return}M(vl(C,new Set([...N]))),_(vl(S,new Set,!0))},unselectNodesAndEdges:({nodes:N,edges:E}={})=>{const{edges:C,nodes:S,nodeLookup:_,triggerNodeChanges:M,triggerEdgeChanges:T}=k(),L=N||S,R=E||C,$=[];for(const q of L){if(!q.selected)continue;const F=_.get(q.id);F&&(F.selected=!1),$.push(Ys(q.id,!1))}const z=[];for(const q of R)q.selected&&z.push(Ys(q.id,!1));M($),T(z)},setMinZoom:N=>{const{panZoom:E,maxZoom:C}=k();E==null||E.setScaleExtent([N,C]),b({minZoom:N})},setMaxZoom:N=>{const{panZoom:E,minZoom:C}=k();E==null||E.setScaleExtent([C,N]),b({maxZoom:N})},setTranslateExtent:N=>{var E;(E=k().panZoom)==null||E.setTranslateExtent(N),b({translateExtent:N})},resetSelectedElements:()=>{const{edges:N,nodes:E,triggerNodeChanges:C,triggerEdgeChanges:S,elementsSelectable:_}=k();if(!_)return;const M=E.reduce((L,R)=>R.selected?[...L,Ys(R.id,!1)]:L,[]),T=N.reduce((L,R)=>R.selected?[...L,Ys(R.id,!1)]:L,[]);C(M),S(T)},setNodeExtent:N=>{const{nodes:E,nodeLookup:C,parentLookup:S,nodeOrigin:_,elevateNodesOnSelect:M,nodeExtent:T,zIndexMode:L}=k();N[0][0]===T[0][0]&&N[0][1]===T[0][1]&&N[1][0]===T[1][0]&&N[1][1]===T[1][1]||(xb(E,C,S,{nodeOrigin:_,nodeExtent:N,elevateNodesOnSelect:M,checkEquality:!1,zIndexMode:L}),b({nodeExtent:N}))},panBy:N=>{const{transform:E,width:C,height:S,panZoom:_,translateExtent:M}=k();return OG({delta:N,panZoom:_,transform:E,translateExtent:M,width:C,height:S})},setCenter:async(N,E,C)=>{const{width:S,height:_,maxZoom:M,panZoom:T}=k();if(!T)return!1;const L=typeof(C==null?void 0:C.zoom)<"u"?C.zoom:M;return await T.setViewport({x:S/2-N*L,y:_/2-E*L,zoom:L},{duration:C==null?void 0:C.duration,ease:C==null?void 0:C.ease,interpolate:C==null?void 0:C.interpolate}),!0},cancelConnection:()=>{b({connection:{...jC}})},updateConnection:N=>{b({connection:N})},reset:()=>b({...KS()})}},Object.is);function RA({initialNodes:e,initialEdges:t,defaultNodes:n,defaultEdges:r,initialWidth:a,initialHeight:o,initialMinZoom:l,initialMaxZoom:d,initialFitViewOptions:f,fitView:h,nodeOrigin:g,nodeExtent:m,zIndexMode:y,children:b}){const[k]=j.useState(()=>tQ({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,width:a,height:o,fitView:h,minZoom:l,maxZoom:d,fitViewOptions:f,nodeOrigin:g,nodeExtent:m,zIndexMode:y}));return c.jsx(pV,{value:k,children:c.jsx(BV,{children:c.jsx(eY,{children:b})})})}function nQ({children:e,nodes:t,edges:n,defaultNodes:r,defaultEdges:a,width:o,height:l,fitView:d,fitViewOptions:f,minZoom:h,maxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:b}){return j.useContext(yp)?c.jsx(c.Fragment,{children:e}):c.jsx(RA,{initialNodes:t,initialEdges:n,defaultNodes:r,defaultEdges:a,initialWidth:o,initialHeight:l,fitView:d,initialFitViewOptions:f,initialMinZoom:h,initialMaxZoom:g,nodeOrigin:m,nodeExtent:y,zIndexMode:b,children:e})}const rQ={width:"100%",height:"100%",overflow:"hidden",position:"relative",zIndex:0};function iQ({nodes:e,edges:t,defaultNodes:n,defaultEdges:r,className:a,nodeTypes:o,edgeTypes:l,onNodeClick:d,onEdgeClick:f,onInit:h,onMove:g,onMoveStart:m,onMoveEnd:y,onConnect:b,onConnectStart:k,onConnectEnd:v,onClickConnectStart:N,onClickConnectEnd:E,onNodeMouseEnter:C,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:M,onNodeDoubleClick:T,onNodeDragStart:L,onNodeDrag:R,onNodeDragStop:$,onNodesDelete:z,onEdgesDelete:q,onDelete:F,onSelectionChange:Y,onSelectionDragStart:D,onSelectionDrag:H,onSelectionDragStop:O,onSelectionContextMenu:V,onSelectionStart:Q,onSelectionEnd:K,onBeforeDelete:I,connectionMode:P,connectionLineType:G=ls.Bezier,connectionLineStyle:B,connectionLineComponent:oe,connectionLineContainerStyle:ve,deleteKeyCode:ke="Backspace",selectionKeyCode:Se="Shift",selectionOnDrag:J=!1,selectionMode:ue=Ru.Full,panActivationKeyCode:Te="Space",multiSelectionKeyCode:Oe=Iu()?"Meta":"Control",zoomActivationKeyCode:De=Iu()?"Meta":"Control",snapToGrid:ce,snapGrid:Ce,onlyRenderVisibleElements:te=!1,selectNodesOnDrag:pe,nodesDraggable:Fe,autoPanOnNodeFocus:ze,nodesConnectable:ae,nodesFocusable:be,nodeOrigin:ye=aA,edgesFocusable:he,edgesReconnectable:Ee,elementsSelectable:Ne=!0,defaultViewport:Ke=jV,minZoom:ne=.5,maxZoom:de=2,translateExtent:Le=Ou,preventScrolling:Ze=!0,nodeExtent:it,defaultMarkerColor:At="#b1b1b7",zoomOnScroll:$n=!0,zoomOnPinch:dn=!0,panOnScroll:Mt=!1,panOnScrollSpeed:Qt=.5,panOnScrollMode:yt=uo.Free,zoomOnDoubleClick:Tr=!0,panOnDrag:Rn=!0,onPaneClick:No,onPaneMouseEnter:Pi,onPaneMouseMove:wa,onPaneMouseLeave:Bi,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:ge=1,nodeClickDistance:Me=0,children:rt,onReconnect:Ft,onReconnectStart:Ot,onReconnectEnd:Ue,onEdgeContextMenu:Pe,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Qr,reconnectRadius:ka=10,onNodesChange:Ea,onEdgesChange:Mr,noDragClassName:an="nodrag",noWheelClassName:Tn="nowheel",noPanClassName:Wr="nopan",fitView:Sa,fitViewOptions:_s,connectOnClick:Na,attributionPosition:_o,proOptions:$i,defaultEdgeOptions:js,elevateNodesOnSelect:Ln=!0,elevateEdgesOnSelect:Xr=!1,disableKeyboardA11y:Zr=!1,autoPanOnConnect:yi,autoPanOnNodeDrag:fn,autoPanOnSelection:jo=!0,autoPanSpeed:Ui,connectionRadius:Jr,isValidConnection:_e,onError:Ve,style:ht,id:Nt,nodeDragThreshold:sn,connectionDragThreshold:Mn,viewport:Qn,onViewportChange:Fn,width:zt,height:Wn,colorMode:Co="light",debug:_a,onScroll:bi,ariaLabelConfig:ja,zIndexMode:Ao="basic",...qn},Cs){const ei=Nt||"1",Ca=MV(Co),_n=j.useCallback(As=>{As.currentTarget.scrollTo({top:0,left:0,behavior:"instant"}),bi==null||bi(As)},[bi]);return c.jsx("div",{"data-testid":"rf__wrapper",...qn,onScroll:_n,style:{...ht,...rQ},ref:Cs,className:Nn(["react-flow",a,Ca]),id:Nt,role:"application",children:c.jsxs(nQ,{nodes:e,edges:t,width:zt,height:Wn,fitView:Sa,fitViewOptions:_s,minZoom:ne,maxZoom:de,nodeOrigin:ye,nodeExtent:it,zIndexMode:Ao,children:[c.jsx(TV,{nodes:e,edges:t,defaultNodes:n,defaultEdges:r,onConnect:b,onConnectStart:k,onConnectEnd:v,onClickConnectStart:N,onClickConnectEnd:E,nodesDraggable:Fe,autoPanOnNodeFocus:ze,nodesConnectable:ae,nodesFocusable:be,edgesFocusable:he,edgesReconnectable:Ee,elementsSelectable:Ne,elevateNodesOnSelect:Ln,elevateEdgesOnSelect:Xr,minZoom:ne,maxZoom:de,nodeExtent:it,onNodesChange:Ea,onEdgesChange:Mr,snapToGrid:ce,snapGrid:Ce,connectionMode:P,translateExtent:Le,connectOnClick:Na,defaultEdgeOptions:js,fitView:Sa,fitViewOptions:_s,onNodesDelete:z,onEdgesDelete:q,onDelete:F,onNodeDragStart:L,onNodeDrag:R,onNodeDragStop:$,onSelectionDrag:H,onSelectionDragStart:D,onSelectionDragStop:O,onMove:g,onMoveStart:m,onMoveEnd:y,noPanClassName:Wr,nodeOrigin:ye,rfId:ei,autoPanOnConnect:yi,autoPanOnNodeDrag:fn,autoPanSpeed:Ui,onError:Ve,connectionRadius:Jr,isValidConnection:_e,selectNodesOnDrag:pe,nodeDragThreshold:sn,connectionDragThreshold:Mn,onBeforeDelete:I,debug:_a,ariaLabelConfig:ja,zIndexMode:Ao}),c.jsx(JY,{onInit:h,onNodeClick:d,onEdgeClick:f,onNodeMouseEnter:C,onNodeMouseMove:S,onNodeMouseLeave:_,onNodeContextMenu:M,onNodeDoubleClick:T,nodeTypes:o,edgeTypes:l,connectionLineType:G,connectionLineStyle:B,connectionLineComponent:oe,connectionLineContainerStyle:ve,selectionKeyCode:Se,selectionOnDrag:J,selectionMode:ue,deleteKeyCode:ke,multiSelectionKeyCode:Oe,panActivationKeyCode:Te,zoomActivationKeyCode:De,onlyRenderVisibleElements:te,defaultViewport:Ke,translateExtent:Le,minZoom:ne,maxZoom:de,preventScrolling:Ze,zoomOnScroll:$n,zoomOnPinch:dn,zoomOnDoubleClick:Tr,panOnScroll:Mt,panOnScrollSpeed:Qt,panOnScrollMode:yt,panOnDrag:Rn,autoPanOnSelection:jo,onPaneClick:No,onPaneMouseEnter:Pi,onPaneMouseMove:wa,onPaneMouseLeave:Bi,onPaneScroll:Un,onPaneContextMenu:Z,paneClickDistance:ge,nodeClickDistance:Me,onSelectionContextMenu:V,onSelectionStart:Q,onSelectionEnd:K,onReconnect:Ft,onReconnectStart:Ot,onReconnectEnd:Ue,onEdgeContextMenu:Pe,onEdgeDoubleClick:et,onEdgeMouseEnter:rn,onEdgeMouseMove:Vt,onEdgeMouseLeave:Qr,reconnectRadius:ka,defaultMarkerColor:At,noDragClassName:an,noWheelClassName:Tn,noPanClassName:Wr,rfId:ei,disableKeyboardA11y:Zr,nodeExtent:it,viewport:Qn,onViewportChange:Fn}),c.jsx(_V,{onSelectionChange:Y}),rt,c.jsx(wV,{proOptions:$i,position:_o}),c.jsx(vV,{rfId:ei,disableKeyboardA11y:Zr})]})})}var aQ=cA(iQ);function sQ(e){const[t,n]=j.useState(e),r=j.useCallback(a=>n(o=>oA(a,o)),[]);return[t,n,r]}function oQ(e){const[t,n]=j.useState(e),r=j.useCallback(a=>n(o=>lA(a,o)),[]);return[t,n,r]}function lQ({dimensions:e,lineWidth:t,variant:n,className:r}){return c.jsx("path",{strokeWidth:t,d:`M${e[0]/2} 0 V${e[1]} M0 ${e[1]/2} H${e[0]}`,className:Nn(["react-flow__background-pattern",n,r])})}function cQ({radius:e,className:t}){return c.jsx("circle",{cx:e,cy:e,r:e,className:Nn(["react-flow__background-pattern","dots",t])})}var pa;(function(e){e.Lines="lines",e.Dots="dots",e.Cross="cross"})(pa||(pa={}));const uQ={[pa.Dots]:1,[pa.Lines]:1,[pa.Cross]:6},dQ=e=>({transform:e.transform,patternId:`pattern-${e.rfId}`});function LA({id:e,variant:t=pa.Dots,gap:n=20,size:r,lineWidth:a=1,offset:o=0,color:l,bgColor:d,style:f,className:h,patternClassName:g}){const m=j.useRef(null),{transform:y,patternId:b}=St(dQ,tn),k=r||uQ[t],v=t===pa.Dots,N=t===pa.Cross,E=Array.isArray(n)?n:[n,n],C=[E[0]*y[2]||1,E[1]*y[2]||1],S=k*y[2],_=Array.isArray(o)?o:[o,o],M=N?[S,S]:C,T=[_[0]*y[2]||1+M[0]/2,_[1]*y[2]||1+M[1]/2],L=`${b}${e||""}`;return c.jsxs("svg",{className:Nn(["react-flow__background",h]),style:{...f,...vp,"--xy-background-color-props":d,"--xy-background-pattern-color-props":l},ref:m,"data-testid":"rf__background",children:[c.jsx("pattern",{id:L,x:y[0]%C[0],y:y[1]%C[1],width:C[0],height:C[1],patternUnits:"userSpaceOnUse",patternTransform:`translate(-${T[0]},-${T[1]})`,children:v?c.jsx(cQ,{radius:S/2,className:g}):c.jsx(lQ,{dimensions:M,lineWidth:a,variant:t,className:g})}),c.jsx("rect",{x:"0",y:"0",width:"100%",height:"100%",fill:`url(#${L})`})]})}LA.displayName="Background";const fQ=j.memo(LA);function hQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 32",children:c.jsx("path",{d:"M32 18.133H18.133V32h-4.266V18.133H0v-4.266h13.867V0h4.266v13.867H32z"})})}function pQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 5",children:c.jsx("path",{d:"M0 0h32v4.2H0z"})})}function mQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 32 30",children:c.jsx("path",{d:"M3.692 4.63c0-.53.4-.938.939-.938h5.215V0H4.708C2.13 0 0 2.054 0 4.63v5.216h3.692V4.631zM27.354 0h-5.2v3.692h5.17c.53 0 .984.4.984.939v5.215H32V4.631A4.624 4.624 0 0027.354 0zm.954 24.83c0 .532-.4.94-.939.94h-5.215v3.768h5.215c2.577 0 4.631-2.13 4.631-4.707v-5.139h-3.692v5.139zm-23.677.94c-.531 0-.939-.4-.939-.94v-5.138H0v5.139c0 2.577 2.13 4.707 4.708 4.707h5.138V25.77H4.631z"})})}function gQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0 8 0 4.571 3.429 4.571 7.619v3.048H3.048A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047zm4.724-13.866H7.467V7.619c0-2.59 2.133-4.724 4.723-4.724 2.591 0 4.724 2.133 4.724 4.724v3.048z"})})}function yQ(){return c.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 25 32",children:c.jsx("path",{d:"M21.333 10.667H19.81V7.619C19.81 3.429 16.38 0 12.19 0c-4.114 1.828-1.37 2.133.305 2.438 1.676.305 4.42 2.59 4.42 5.181v3.048H3.047A3.056 3.056 0 000 13.714v15.238A3.056 3.056 0 003.048 32h18.285a3.056 3.056 0 003.048-3.048V13.714a3.056 3.056 0 00-3.048-3.047zM12.19 24.533a3.056 3.056 0 01-3.047-3.047 3.056 3.056 0 013.047-3.048 3.056 3.056 0 013.048 3.048 3.056 3.056 0 01-3.048 3.047z"})})}function Yf({children:e,className:t,...n}){return c.jsx("button",{type:"button",className:Nn(["react-flow__controls-button",t]),...n,children:e})}const bQ=e=>({isInteractive:e.nodesDraggable||e.nodesConnectable||e.elementsSelectable,minZoomReached:e.transform[2]<=e.minZoom,maxZoomReached:e.transform[2]>=e.maxZoom,ariaLabelConfig:e.ariaLabelConfig});function IA({style:e,showZoom:t=!0,showFitView:n=!0,showInteractive:r=!0,fitViewOptions:a,onZoomIn:o,onZoomOut:l,onFitView:d,onInteractiveChange:f,className:h,children:g,position:m="bottom-left",orientation:y="vertical","aria-label":b}){const k=nn(),{isInteractive:v,minZoomReached:N,maxZoomReached:E,ariaLabelConfig:C}=St(bQ,tn),{zoomIn:S,zoomOut:_,fitView:M}=xp(),T=()=>{S(),o==null||o()},L=()=>{_(),l==null||l()},R=()=>{M(a),d==null||d()},$=()=>{k.setState({nodesDraggable:!v,nodesConnectable:!v,elementsSelectable:!v}),f==null||f(!v)},z=y==="horizontal"?"horizontal":"vertical";return c.jsxs(bp,{className:Nn(["react-flow__controls",z,h]),position:m,style:e,"data-testid":"rf__controls","aria-label":b??C["controls.ariaLabel"],children:[t&&c.jsxs(c.Fragment,{children:[c.jsx(Yf,{onClick:T,className:"react-flow__controls-zoomin",title:C["controls.zoomIn.ariaLabel"],"aria-label":C["controls.zoomIn.ariaLabel"],disabled:E,children:c.jsx(hQ,{})}),c.jsx(Yf,{onClick:L,className:"react-flow__controls-zoomout",title:C["controls.zoomOut.ariaLabel"],"aria-label":C["controls.zoomOut.ariaLabel"],disabled:N,children:c.jsx(pQ,{})})]}),n&&c.jsx(Yf,{className:"react-flow__controls-fitview",onClick:R,title:C["controls.fitView.ariaLabel"],"aria-label":C["controls.fitView.ariaLabel"],children:c.jsx(mQ,{})}),r&&c.jsx(Yf,{className:"react-flow__controls-interactive",onClick:$,title:C["controls.interactive.ariaLabel"],"aria-label":C["controls.interactive.ariaLabel"],children:v?c.jsx(yQ,{}):c.jsx(gQ,{})}),g]})}IA.displayName="Controls";const xQ=j.memo(IA);function vQ({id:e,x:t,y:n,width:r,height:a,style:o,color:l,strokeColor:d,strokeWidth:f,className:h,borderRadius:g,shapeRendering:m,selected:y,onClick:b}){const{background:k,backgroundColor:v}=o||{},N=l||k||v;return c.jsx("rect",{className:Nn(["react-flow__minimap-node",{selected:y},h]),x:t,y:n,rx:g,ry:g,width:r,height:a,style:{fill:N,stroke:d,strokeWidth:f},shapeRendering:m,onClick:b?E=>b(E,e):void 0})}const wQ=j.memo(vQ),kQ=e=>e.nodes.map(t=>t.id),ky=e=>e instanceof Function?e:()=>e;function EQ({nodeStrokeColor:e,nodeColor:t,nodeClassName:n="",nodeBorderRadius:r=5,nodeStrokeWidth:a,nodeComponent:o=wQ,onClick:l}){const d=St(kQ,tn),f=ky(t),h=ky(e),g=ky(n),m=typeof window>"u"||window.chrome?"crispEdges":"geometricPrecision";return c.jsx(c.Fragment,{children:d.map(y=>c.jsx(NQ,{id:y,nodeColorFunc:f,nodeStrokeColorFunc:h,nodeClassNameFunc:g,nodeBorderRadius:r,nodeStrokeWidth:a,NodeComponent:o,onClick:l,shapeRendering:m},y))})}function SQ({id:e,nodeColorFunc:t,nodeStrokeColorFunc:n,nodeClassNameFunc:r,nodeBorderRadius:a,nodeStrokeWidth:o,shapeRendering:l,NodeComponent:d,onClick:f}){const{node:h,x:g,y:m,width:y,height:b}=St(k=>{const v=k.nodeLookup.get(e);if(!v)return{node:void 0,x:0,y:0,width:0,height:0};const N=v.internals.userNode,{x:E,y:C}=v.internals.positionAbsolute,{width:S,height:_}=va(N);return{node:N,x:E,y:C,width:S,height:_}},tn);return!h||h.hidden||!LC(h)?null:c.jsx(d,{x:g,y:m,width:y,height:b,style:h.style,selected:!!h.selected,className:r(h),color:t(h),borderRadius:a,strokeColor:n(h),strokeWidth:o,shapeRendering:l,onClick:f,id:h.id})}const NQ=j.memo(SQ);var _Q=j.memo(EQ);const jQ=200,CQ=150,AQ=e=>!e.hidden,TQ=e=>{const t={x:-e.transform[0]/e.transform[2],y:-e.transform[1]/e.transform[2],width:e.width/e.transform[2],height:e.height/e.transform[2]};return{viewBB:t,boundingRect:e.nodeLookup.size>0?DC(ad(e.nodeLookup,{filter:AQ}),t):t,rfId:e.rfId,panZoom:e.panZoom,translateExtent:e.translateExtent,flowWidth:e.width,flowHeight:e.height,ariaLabelConfig:e.ariaLabelConfig}},MQ="react-flow__minimap-desc";function zA({style:e,className:t,nodeStrokeColor:n,nodeColor:r,nodeClassName:a="",nodeBorderRadius:o=5,nodeStrokeWidth:l,nodeComponent:d,bgColor:f,maskColor:h,maskStrokeColor:g,maskStrokeWidth:m,position:y="bottom-right",onClick:b,onNodeClick:k,pannable:v=!1,zoomable:N=!1,ariaLabel:E,inversePan:C,zoomStep:S=1,offsetScale:_=5}){const M=nn(),T=j.useRef(null),{boundingRect:L,viewBB:R,rfId:$,panZoom:z,translateExtent:q,flowWidth:F,flowHeight:Y,ariaLabelConfig:D}=St(TQ,tn),H=(e==null?void 0:e.width)??jQ,O=(e==null?void 0:e.height)??CQ,V=L.width/H,Q=L.height/O,K=Math.max(V,Q),I=K*H,P=K*O,G=_*K,B=L.x-(I-L.width)/2-G,oe=L.y-(P-L.height)/2-G,ve=I+G*2,ke=P+G*2,Se=`${MQ}-${$}`,J=j.useRef(0),ue=j.useRef();J.current=K,j.useEffect(()=>{if(T.current&&z)return ue.current=FG({domNode:T.current,panZoom:z,getTransform:()=>M.getState().transform,getViewScale:()=>J.current}),()=>{var ce;(ce=ue.current)==null||ce.destroy()}},[z]),j.useEffect(()=>{var ce;(ce=ue.current)==null||ce.update({translateExtent:q,width:F,height:Y,inversePan:C,pannable:v,zoomStep:S,zoomable:N})},[v,N,C,S,q,F,Y]);const Te=b?ce=>{var pe;const[Ce,te]=((pe=ue.current)==null?void 0:pe.pointer(ce))||[0,0];b(ce,{x:Ce,y:te})}:void 0,Oe=k?j.useCallback((ce,Ce)=>{const te=M.getState().nodeLookup.get(Ce).internals.userNode;k(ce,te)},[]):void 0,De=E??D["minimap.ariaLabel"];return c.jsx(bp,{position:y,style:{...e,"--xy-minimap-background-color-props":typeof f=="string"?f:void 0,"--xy-minimap-mask-background-color-props":typeof h=="string"?h:void 0,"--xy-minimap-mask-stroke-color-props":typeof g=="string"?g:void 0,"--xy-minimap-mask-stroke-width-props":typeof m=="number"?m*K:void 0,"--xy-minimap-node-background-color-props":typeof r=="string"?r:void 0,"--xy-minimap-node-stroke-color-props":typeof n=="string"?n:void 0,"--xy-minimap-node-stroke-width-props":typeof l=="number"?l:void 0},className:Nn(["react-flow__minimap",t]),"data-testid":"rf__minimap",children:c.jsxs("svg",{width:H,height:O,viewBox:`${B} ${oe} ${ve} ${ke}`,className:"react-flow__minimap-svg",role:"img","aria-labelledby":Se,ref:T,onClick:Te,children:[De&&c.jsx("title",{id:Se,children:De}),c.jsx(_Q,{onClick:Oe,nodeColor:r,nodeStrokeColor:n,nodeBorderRadius:o,nodeClassName:a,nodeStrokeWidth:l,nodeComponent:d}),c.jsx("path",{className:"react-flow__minimap-mask",d:`M${B-G},${oe-G}h${ve+G*2}v${ke+G*2}h${-ve-G*2}z
|
|
670
|
-
M${R.x},${R.y}h${R.width}v${R.height}h${-R.width}z`,fillRule:"evenodd",pointerEvents:"none"})]})})}zA.displayName="MiniMap";j.memo(zA);const DQ=e=>t=>e?`${Math.max(1/t.transform[2],1)}`:void 0,OQ={[Vl.Line]:"right",[Vl.Handle]:"bottom-right"};function RQ({nodeId:e,position:t,variant:n=Vl.Handle,className:r,style:a=void 0,children:o,color:l,minWidth:d=10,minHeight:f=10,maxWidth:h=Number.MAX_VALUE,maxHeight:g=Number.MAX_VALUE,keepAspectRatio:m=!1,resizeDirection:y,autoScale:b=!0,shouldResize:k,onResizeStart:v,onResize:N,onResizeEnd:E}){const C=hA(),S=typeof e=="string"?e:C,_=nn(),M=j.useRef(null),T=n===Vl.Handle,L=St(j.useCallback(DQ(T&&b),[T,b]),tn),R=j.useRef(null),$=t??OQ[n];j.useEffect(()=>{if(!(!M.current||!S))return R.current||(R.current=tV({domNode:M.current,nodeId:S,getStoreItems:()=>{const{nodeLookup:q,transform:F,snapGrid:Y,snapToGrid:D,nodeOrigin:H,domNode:O}=_.getState();return{nodeLookup:q,transform:F,snapGrid:Y,snapToGrid:D,nodeOrigin:H,paneDomNode:O}},onChange:(q,F)=>{const{triggerNodeChanges:Y,nodeLookup:D,parentLookup:H,nodeOrigin:O}=_.getState(),V=[],Q={x:q.x,y:q.y},K=D.get(S);if(K&&K.expandParent&&K.parentId){const I=K.origin??O,P=q.width??K.measured.width??0,G=q.height??K.measured.height??0,B={id:K.id,parentId:K.parentId,rect:{width:P,height:G,...IC({x:q.x??K.position.x,y:q.y??K.position.y},{width:P,height:G},K.parentId,D,I)}},oe=Jx([B],D,H,O);V.push(...oe),Q.x=q.x?Math.max(I[0]*P,q.x):void 0,Q.y=q.y?Math.max(I[1]*G,q.y):void 0}if(Q.x!==void 0&&Q.y!==void 0){const I={id:S,type:"position",position:{...Q}};V.push(I)}if(q.width!==void 0&&q.height!==void 0){const P={id:S,type:"dimensions",resizing:!0,setAttributes:y?y==="horizontal"?"width":"height":!0,dimensions:{width:q.width,height:q.height}};V.push(P)}for(const I of F){const P={...I,type:"position"};V.push(P)}Y(V)},onEnd:({width:q,height:F})=>{const Y={id:S,type:"dimensions",resizing:!1,dimensions:{width:q,height:F}};_.getState().triggerNodeChanges([Y])}})),R.current.update({controlPosition:$,boundaries:{minWidth:d,minHeight:f,maxWidth:h,maxHeight:g},keepAspectRatio:m,resizeDirection:y,onResizeStart:v,onResize:N,onResizeEnd:E,shouldResize:k}),()=>{var q;(q=R.current)==null||q.destroy()}},[$,d,f,h,g,m,v,N,E,k]);const z=$.split("-");return c.jsx("div",{className:Nn(["react-flow__resize-control","nodrag",...z,n,r]),ref:M,style:{...a,scale:L,...l&&{[T?"backgroundColor":"borderColor"]:l}},children:o})}j.memo(RQ);function LQ(e){return ft(`/api/smartarrange/${encodeURIComponent(e)}`)}async function IQ(e){const t=await fetch(`/api/smartarrange/${encodeURIComponent(e)}/approve`,{method:"POST"});if(!t.ok)throw new Error(`${t.status}: ${await t.text()}`);return t.json()}const Ey=["var(--color-accent-mint)","var(--color-accent-pink)","var(--color-accent-purple)","var(--color-accent-yellow)","var(--color-running-bg)","var(--color-idle-bg)","var(--color-stuck-bg)"];function GS(e,t){return Ey[t%Ey.length]??Ey[0]}const PA={done:"var(--color-cta)",doing:"var(--color-secondary-dark)",todo:"var(--color-text-subtle)",stuck:"var(--color-crashed)"},dl={width:9,height:9,background:"var(--color-bg)",border:"2px solid var(--color-text)"},zQ=j.memo(function({data:t,selected:n}){var a;const r=t;return c.jsxs("div",{className:"rounded-xl border-[3px] border-[var(--color-text)] bg-[var(--color-bg)] overflow-hidden cursor-pointer flex flex-col",style:{width:260,height:158,boxShadow:n?"5px 5px 0 var(--color-text)":"3px 3px 0 var(--color-text)",transform:n?"translate(-1px,-1px)":void 0},children:[c.jsx(Ti,{id:"l-t",type:"target",position:Ge.Left,style:dl}),c.jsx(Ti,{id:"r-t",type:"target",position:Ge.Right,style:dl}),c.jsx(Ti,{id:"t-t",type:"target",position:Ge.Top,style:dl}),c.jsxs("div",{className:"flex items-center gap-2 px-2.5 py-1.5 border-b-[3px] border-[var(--color-text)]",style:{background:r.color},children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] text-xs font-bold text-[var(--color-text)]",children:["#",r.seq]}),c.jsx("span",{className:"text-[11px] text-[var(--color-text)] truncate",children:r.taskLabel}),c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block shrink-0 ml-auto border border-[var(--color-text)]",style:{background:PA[r.status]??"gray"},title:r.status})]}),c.jsxs("div",{className:"px-2.5 py-2 flex-1 min-h-0 overflow-hidden",children:[c.jsx("p",{className:"text-[13px] font-semibold text-[var(--color-text)] leading-snug line-clamp-3",children:r.title}),((a=r.skills)==null?void 0:a.length)>0&&c.jsx("div",{className:"flex flex-wrap gap-1 mt-2 max-h-[46px] overflow-hidden",children:r.skills.slice(0,6).map(o=>c.jsx("span",{className:"text-[10px] font-[family-name:var(--font-mono)] px-1.5 py-0.5 rounded border border-[var(--color-text)] bg-[var(--color-bg-cream)] text-[var(--color-text)]",children:o},o))})]}),c.jsx(Ti,{id:"r-s",type:"source",position:Ge.Right,style:dl}),c.jsx(Ti,{id:"l-s",type:"source",position:Ge.Left,style:dl}),c.jsx(Ti,{id:"b-s",type:"source",position:Ge.Bottom,style:dl})]})});function PQ({card:e,status:t,onClose:n}){var a;const r=Be();return j.useEffect(()=>{const o=l=>{l.key==="Escape"&&n()};return window.addEventListener("keydown",o),()=>window.removeEventListener("keydown",o)},[n]),c.jsx("div",{role:"dialog","aria-modal":"true",className:"fixed inset-0 z-40 flex items-start justify-center p-6 bg-black/30 overflow-auto",onClick:n,children:c.jsxs("div",{className:"nb-card mt-12 w-full max-w-2xl bg-[var(--color-bg)]",onClick:o=>o.stopPropagation(),children:[c.jsxs("header",{className:"flex items-start justify-between gap-4 mb-4",children:[c.jsxs("div",{className:"flex-1 min-w-0",children:[c.jsxs("div",{className:"flex items-center gap-2 mb-2 flex-wrap",children:[c.jsxs("span",{className:"font-[family-name:var(--font-mono)] font-bold text-xs px-2 py-0.5 bg-[var(--color-accent-purple)] border-2 border-[var(--color-text)] rounded-full",children:["#",e.seq]}),c.jsxs("span",{className:"font-[family-name:var(--font-mono)] text-xs px-2 py-0.5 bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-full font-semibold",children:[r("arrange.cardTask")," T",e.taskId]}),c.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs px-2 py-0.5 border-2 border-[var(--color-text)] rounded-full font-semibold",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block border border-[var(--color-text)]",style:{background:PA[t]??"gray"}}),t]})]}),c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-2xl font-bold break-words",children:e.title})]}),c.jsx("button",{onClick:n,className:"nb-btn nb-btn-mint p-2 flex-shrink-0","aria-label":r("arrange.close"),type:"button",children:c.jsx(Sn,{size:14,strokeWidth:3})})]}),c.jsxs("div",{className:"flex flex-col gap-4",children:[e.at&&c.jsxs("div",{className:"flex items-center gap-2 text-sm",children:[c.jsx(HN,{size:14,strokeWidth:2.5}),c.jsx("span",{className:"font-[family-name:var(--font-mono)]",children:e.at})]}),((a=e.skills)==null?void 0:a.length)>0&&c.jsxs("div",{children:[c.jsx("div",{className:"text-sm font-bold mb-1.5",children:r("arrange.cardSkills")}),c.jsx("div",{className:"flex items-center gap-2 flex-wrap",children:e.skills.map(o=>c.jsx(ux,{name:o},o))})]}),e.prompt&&c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:r("arrange.cardPrompt")}),c.jsx("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4 max-h-72 overflow-auto",children:e.prompt})]}),c.jsxs("div",{children:[c.jsx("h3",{className:"font-[family-name:var(--font-heading)] text-sm font-bold mb-2 uppercase tracking-wider",children:r("arrange.cardLog")}),c.jsxs("pre",{className:"text-xs whitespace-pre-wrap font-[family-name:var(--font-mono)] bg-[var(--color-bg-cream)] border-2 border-[var(--color-text)] rounded-lg p-4",children:[e.at?`${e.at} [派发] #${e.seq} → ${r("arrange.cardTask")} T${e.taskId}`:"—",`
|
|
671
|
-
${e.at??""} [状态] ${t}`]})]})]})]})})}const BQ=j.memo(function({data:t}){const n=t;return c.jsxs("div",{className:"relative w-full h-full rounded-2xl border-2 border-dashed border-[var(--color-text)]",children:[c.jsx("div",{className:"absolute inset-0 rounded-2xl",style:{background:n.color,opacity:.16}}),c.jsx("span",{className:"absolute top-1.5 left-2.5 px-2 py-0.5 text-[11px] font-bold rounded-md border-2 border-[var(--color-text)] bg-[var(--color-bg)] text-[var(--color-text)] whitespace-nowrap max-w-[90%] truncate",children:n.label})]})}),$Q={card:zQ,laneBox:BQ},tv=260,BA=tv+36,UQ=200,FQ={todo:"var(--color-text-subtle)",doing:"var(--color-secondary-dark)",done:"var(--color-cta)",rework:"var(--color-secondary-dark)"};function kb(e,t,n){return e==="doing"&&t<n?"stuck":e}function qQ(e,t){const n=Math.floor(e/t),r=e%t;return{x:(n%2===0?r:t-1-r)*BA,y:n*UQ}}function HQ(e,t,n){const r=Math.floor(e/n),a=Math.floor(t/n);return r===a?r%2===0?{sourceHandle:"r-s",targetHandle:"l-t"}:{sourceHandle:"l-s",targetHandle:"r-t"}:{sourceHandle:"b-s",targetHandle:"t-t"}}function KQ(e){return e==="done"?{animated:!1,style:{stroke:"var(--color-cta)",strokeWidth:2.5}}:e==="doing"?{animated:!0,style:{stroke:"var(--color-secondary-dark)",strokeWidth:3}}:e==="stuck"?{animated:!1,style:{stroke:"var(--color-crashed)",strokeWidth:2.5,strokeDasharray:"6 4"}}:{animated:!1,style:{stroke:"var(--color-accent-yellow)",strokeWidth:2.5,strokeDasharray:"6 4"}}}const $A=158,VS=tv+60,YS=$A+28,QS=40;function GQ({cards:e,taskMeta:t,view:n,onSelect:r}){const a=j.useRef(null),[o,l]=j.useState(4),d=xp(),[f,h,g]=sQ([]),[m,y]=oQ([]),b=j.useRef("");return j.useEffect(()=>{const k=a.current;if(!k)return;const v=new ResizeObserver(N=>{var C;const E=((C=N[0])==null?void 0:C.contentRect.width)??800;l(Math.max(1,Math.min(8,Math.floor((E-40)/BA))))});return v.observe(k),()=>v.disconnect()},[]),j.useEffect(()=>{const k=[...e].sort((T,L)=>T.seq-L.seq),v=`${n}:${o}:${k.length}`,N=b.current!==v;b.current=v;const E=new Map,C=(T,L)=>{var R;if(n==="lane"){const $=((R=t.get(T.taskId))==null?void 0:R.order)??0,z=E.get(T.taskId)??0;return E.set(T.taskId,z+1),{x:$*VS,y:z*YS}}return qQ(L,o)},S=[];if(n==="lane"){const T=new Map;for(const L of k)T.set(L.taskId,(T.get(L.taskId)??0)+1);for(const[L,R]of T){const $=t.get(L),z=($==null?void 0:$.order)??0;S.push({id:`lane-${L}`,type:"laneBox",position:{x:z*VS-16,y:-QS},data:{label:$!=null&&$.title?`T${L} · ${$.title}`:`T${L}`,color:($==null?void 0:$.color)??"var(--color-bg-cream)"},style:{width:tv+32,height:QS+(R-1)*YS+$A+14},draggable:!1,selectable:!1,zIndex:0})}}const _=k.length?k[k.length-1].seq:0;h(T=>{const L=new Map(T.map($=>[$.id,$])),R=k.map(($,z)=>{const q=t.get($.taskId),F={seq:$.seq,title:$.title,skills:$.skills??[],taskLabel:`T${$.taskId}`,status:kb($.status,$.seq,_),color:(q==null?void 0:q.color)??"var(--color-bg-cream)"},Y=String($.seq),D=L.get(Y),H=C($,z);return{...D&&!N?{...D,data:F}:{id:Y,type:"card",position:H,data:F},zIndex:1}});return[...S,...R]});const M=[];for(let T=1;T<k.length;T++){const L=k[T-1],R=k[T];if(!L||!R)continue;const $=n==="lane"?L.taskId===R.taskId?{sourceHandle:"b-s",targetHandle:"t-t"}:{sourceHandle:"r-s",targetHandle:"l-t"}:HQ(T-1,T,o);M.push({id:`e${L.seq}-${R.seq}`,source:String(L.seq),target:String(R.seq),...$,...KQ(kb(R.status,R.seq,_))})}y(M),N&&requestAnimationFrame(()=>d.fitView({padding:.2,maxZoom:1.1,duration:300}))},[e,o,t,n,h,y,d]),c.jsx("div",{ref:a,className:"w-full h-full",children:c.jsxs(aQ,{nodes:f,edges:m,onNodesChange:g,nodeTypes:$Q,onNodeClick:(k,v)=>r(Number(v.id)),fitView:!0,fitViewOptions:{padding:.2,maxZoom:1.1},proOptions:{hideAttribution:!0},minZoom:.15,children:[c.jsx(fQ,{variant:pa.Dots,gap:20,size:1.5,color:"var(--color-border-light)"}),c.jsx(xQ,{showInteractive:!1})]})})}function VQ(){var z,q,F;const e=Be(),t=Gt(),{alert:n}=un(),a=(((z=Ye({queryKey:["projects"],queryFn:Es,refetchInterval:3e3}).data)==null?void 0:z.data)??[]).filter(Y=>Y.pipelineMode==="smartArrange"),o=a.map(Y=>Y.name),[l,d]=j.useState(()=>localStorage.getItem("arrange.project")??""),f=l&&o.includes(l)?l:o[0]??"";j.useEffect(()=>{l&&localStorage.setItem("arrange.project",l)},[l]);const h=a.find(Y=>Y.name===f),g=(h==null?void 0:h.pipelineStatus)==="running",m=Ye({queryKey:["smartarrange",f],queryFn:()=>LQ(f),enabled:!!f,refetchInterval:3e3}),y=Ct({mutationFn:()=>IQ(f),onSuccess:()=>t.invalidateQueries({queryKey:["smartarrange",f]}),onError:Y=>void n({title:e("arrange.approveErr"),body:Y instanceof Error?Y.message:String(Y)})}),b=Ct({mutationFn:()=>h2(f),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]}),onError:Y=>void n({title:e("arrange.startErr"),body:Y instanceof Error?Y.message:String(Y)})}),k=Ct({mutationFn:()=>p2(f),onSuccess:()=>t.invalidateQueries({queryKey:["projects"]}),onError:Y=>void n({title:e("arrange.startErr"),body:Y instanceof Error?Y.message:String(Y)})}),v=(q=m.data)==null?void 0:q.plan,N=j.useMemo(()=>{var Y;return((Y=m.data)==null?void 0:Y.cards)??[]},[(F=m.data)==null?void 0:F.cards]),[E,C]=j.useState(()=>localStorage.getItem("arrange.view")==="lane"?"lane":"free");j.useEffect(()=>{localStorage.setItem("arrange.view",E)},[E]);const S=j.useMemo(()=>{const Y=new Map;return((v==null?void 0:v.tasks)??[]).forEach((D,H)=>Y.set(D.id,{order:H,status:D.status,color:GS(D.id,H),title:D.title})),Y},[v==null?void 0:v.tasks]),[_,M]=j.useState(()=>localStorage.getItem("arrange.panel")!=="0");j.useEffect(()=>{localStorage.setItem("arrange.panel",_?"1":"0")},[_]);const[T,L]=j.useState(null),R=j.useMemo(()=>N.find(Y=>Y.seq===T),[N,T]),$=N.length?Math.max(...N.map(Y=>Y.seq)):0;return c.jsxs("div",{className:"flex flex-col gap-4 h-full min-h-0",children:[c.jsxs("header",{className:"flex items-center justify-between gap-3 flex-wrap shrink-0",children:[c.jsxs("div",{className:"flex items-center gap-4 flex-wrap",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-3xl font-bold",children:e("arrange.h1")}),f&&c.jsxs("div",{className:"flex items-center gap-2",children:[g?c.jsxs("button",{className:"nb-btn nb-btn-yellow",style:{padding:"6px 12px",fontSize:12},onClick:()=>k.mutate(),disabled:k.isPending,type:"button","aria-label":e("arrange.stop"),children:[k.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx($b,{size:12,strokeWidth:3}),e("arrange.stop")]}):c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>b.mutate(),disabled:b.isPending,type:"button","aria-label":e("arrange.start"),children:[b.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(Yu,{size:12,strokeWidth:3}),e("arrange.start")]}),v&&c.jsxs(c.Fragment,{children:[c.jsx("span",{className:"nb-status",style:{background:"var(--color-bg-cream)",color:"var(--color-text)"},children:v.status}),c.jsxs("span",{className:"text-sm text-[var(--color-text-muted)]",children:["round ",v.round,"/",v.maxRounds]}),v.status==="awaiting-approval"&&c.jsxs("button",{className:"nb-btn nb-btn-primary",style:{padding:"6px 12px",fontSize:12},onClick:()=>y.mutate(),disabled:y.isPending,type:"button","aria-label":e("arrange.approve"),children:[y.isPending?c.jsx(Xe,{size:12,strokeWidth:3,className:"animate-spin"}):c.jsx(fh,{size:12,strokeWidth:2.5}),e("arrange.approve")]})]})]})]}),c.jsxs("div",{className:"flex items-center gap-2",children:[v&&c.jsxs("button",{className:"nb-btn",style:{padding:"6px 10px",fontSize:12},onClick:()=>C(E==="free"?"lane":"free"),type:"button","aria-label":e("arrange.view"),children:[E==="lane"?c.jsx(QL,{size:14,strokeWidth:2.5}):c.jsx(GN,{size:14,strokeWidth:2.5}),e(E==="lane"?"arrange.viewLane":"arrange.viewFree")]}),c.jsxs("select",{className:"nb-input",style:{maxWidth:240},value:f,onChange:Y=>d(Y.target.value),"aria-label":e("arrange.project"),children:[o.length===0&&c.jsx("option",{value:"",children:"—"}),o.map(Y=>c.jsx("option",{value:Y,children:Y},Y))]})]})]}),v?c.jsxs("div",{className:"flex gap-4 flex-1 min-h-0",children:[c.jsxs("div",{className:"relative flex-1 min-h-0 rounded-2xl border-[3px] border-[var(--color-text)] overflow-hidden bg-[var(--color-bg-soft)]",style:{boxShadow:"4px 4px 0 var(--color-text)"},children:[N.length===0?c.jsx("div",{className:"absolute inset-0 grid place-items-center p-6",children:v.status==="running"?c.jsxs("div",{className:"flex flex-col items-center gap-3 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:28,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-sm",children:e("arrange.orchestrating")})]}):c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm text-center max-w-sm",children:e("arrange.noCards")})}):c.jsx(RA,{children:c.jsx(GQ,{cards:N,taskMeta:S,view:E,onSelect:L})}),!_&&c.jsxs("button",{className:"nb-btn absolute right-3 top-3 z-10",style:{padding:"6px 10px",fontSize:12},onClick:()=>M(!0),type:"button","aria-label":e("arrange.expand"),children:[c.jsx(Zl,{size:14,strokeWidth:3,className:"rotate-180"}),e("arrange.tasks")]})]}),_&&c.jsxs("aside",{className:"w-72 shrink-0 nb-card overflow-auto flex flex-col gap-2",style:{padding:12},children:[c.jsxs("div",{className:"flex items-center justify-between",children:[c.jsx("h2",{className:"font-[family-name:var(--font-heading)] text-lg font-bold",children:e("arrange.tasks")}),c.jsx("button",{className:"nb-btn",style:{padding:"2px 6px"},onClick:()=>M(!1),type:"button","aria-label":e("arrange.collapse"),children:c.jsx(OL,{size:14,strokeWidth:2.5})})]}),v.tasks.length===0?c.jsxs("div",{className:"flex flex-col items-center justify-center gap-3 py-10 text-[var(--color-text-muted)]",children:[c.jsx(Xe,{size:22,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-xs text-center",children:e("arrange.planning")})]}):c.jsx("ul",{className:"flex flex-col gap-2",children:v.tasks.map((Y,D)=>c.jsxs("li",{className:"rounded-lg border-2 border-[var(--color-text)] p-2",style:{background:GS(Y.id,D)},children:[c.jsxs("div",{className:"flex items-center gap-2",children:[c.jsx("span",{className:"w-2.5 h-2.5 rounded-full inline-block shrink-0 border border-[var(--color-text)]",style:{background:FQ[Y.status]??"gray"}}),c.jsxs("span",{className:"font-bold text-xs text-[var(--color-text)]",children:["T",Y.id]}),c.jsxs("span",{className:"text-[11px] ml-auto font-[family-name:var(--font-mono)] text-[var(--color-text)]",children:[Y.cardSeqs.length," ",e("arrange.cardsCount")]})]}),c.jsx("p",{className:"text-xs text-[var(--color-text)] mt-1 leading-snug",children:Y.title})]},Y.id))})]})]}):c.jsx("section",{className:"nb-card",children:g?c.jsxs("div",{className:"flex items-center gap-3",children:[c.jsx(Xe,{size:18,strokeWidth:3,className:"animate-spin"}),c.jsx("p",{className:"text-sm font-bold",children:e("arrange.starting")})]}):c.jsx("p",{className:"text-[var(--color-text-muted)] text-sm",children:e("arrange.none")})}),R&&c.jsx(PQ,{card:R,status:kb(R.status,R.seq,$),onClose:()=>L(null)})]})}function YQ(){const e=Be();return c.jsxs("div",{className:"nb-card max-w-2xl mt-12",children:[c.jsx("h1",{className:"font-[family-name:var(--font-heading)] text-4xl font-bold mb-2",children:e("notFound.title")}),c.jsx("p",{className:"text-[var(--color-text-muted)] mb-6",children:e("notFound.body")}),c.jsx(vs,{to:"/",className:"nb-btn nb-btn-mint inline-flex",children:e("notFound.home")})]})}function QQ(){return c.jsx(nI,{children:c.jsx(BO,{children:c.jsxs(Cn,{element:c.jsx(eI,{}),children:[c.jsx(Cn,{index:!0,element:c.jsx(IO,{to:"/projects",replace:!0})}),c.jsx(Cn,{path:"/projects",element:c.jsx(jk,{})}),c.jsx(Cn,{path:"/projects/new",element:c.jsx(f2,{})}),c.jsx(Cn,{path:"/projects/:name",element:c.jsx(jk,{})}),c.jsx(Cn,{path:"/board",element:c.jsx(z4,{})}),c.jsx(Cn,{path:"/workers",element:c.jsx(Z4,{})}),c.jsx(Cn,{path:"/skills",element:c.jsx(g8,{})}),c.jsx(Cn,{path:"/prompts",element:c.jsx(k8,{})}),c.jsx(Cn,{path:"/system",element:c.jsx(j8,{})}),c.jsx(Cn,{path:"/processes",element:c.jsx(eq,{})}),c.jsx(Cn,{path:"/audit",element:c.jsx(iq,{})}),c.jsx(Cn,{path:"/chat",element:c.jsx(ME,{})}),c.jsx(Cn,{path:"/chat/:sessionId",element:c.jsx(ME,{})}),c.jsx(Cn,{path:"/memory",element:c.jsx(oq,{})}),c.jsx(Cn,{path:"/plugins",element:c.jsx(mq,{})}),c.jsx(Cn,{path:"/arrange",element:c.jsx(VQ,{})}),c.jsx(Cn,{path:"*",element:c.jsx(YQ,{})})]})})})}tI();const WQ=new _D({defaultOptions:{queries:{staleTime:3e4,refetchOnWindowFocus:!1}}}),UA=document.getElementById("root");if(!UA)throw new Error("#root not found");tD.createRoot(UA).render(c.jsx(j.StrictMode,{children:c.jsx(N3,{children:c.jsx(jD,{client:WQ,children:c.jsx(uR,{children:c.jsx(fI,{children:c.jsx(QQ,{})})})})})}));
|