@brainpilot/web 0.0.5 → 0.0.7
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/assets/index-DWOsU22G.css +1 -0
- package/dist/assets/index-j3rGyO6m.js +445 -0
- package/dist/index.html +2 -2
- package/package.json +6 -3
- package/src/__tests__/agentsReducer.test.ts +67 -0
- package/src/__tests__/api.test.ts +118 -0
- package/src/__tests__/chatScrollBehavior.test.ts +48 -0
- package/src/__tests__/chatScrollMemory.test.ts +49 -0
- package/src/__tests__/demoConversation.test.ts +96 -0
- package/src/__tests__/demoReset.test.ts +24 -0
- package/src/__tests__/internalToolStrip.test.ts +108 -0
- package/src/__tests__/runningToast.test.ts +29 -0
- package/src/__tests__/tokenUsage.test.ts +48 -0
- package/src/__tests__/toolDisplay.test.ts +55 -0
- package/src/__tests__/traceReducer.test.ts +62 -0
- package/src/components/chat/MessageStream.tsx +104 -56
- package/src/components/chat/PromptComposer.tsx +120 -29
- package/src/components/chat/chatScrollMemory.ts +49 -0
- package/src/components/demo/DemoView.tsx +98 -29
- package/src/components/demo/TraceNodeModal.tsx +6 -2
- package/src/components/demo/demoBundle.ts +7 -2
- package/src/components/demo/demoReset.ts +16 -0
- package/src/components/session/AgentNetwork.tsx +68 -75
- package/src/components/session/AgentTraceViews.tsx +35 -70
- package/src/components/session/AnalyticsTab.tsx +58 -224
- package/src/components/session/TraceGraphView.tsx +36 -30
- package/src/components/session/TraceNodeDetail.tsx +61 -24
- package/src/components/session/agentNetworkShared.ts +10 -0
- package/src/components/session/traceLayout.ts +32 -0
- package/src/components/settings/SettingsDialog.tsx +19 -1
- package/src/components/shell/DesktopShell.tsx +72 -17
- package/src/components/sidebar/SessionList.tsx +127 -0
- package/src/components/sidebar/Sidebar.tsx +94 -98
- package/src/contexts/SSEContext.tsx +90 -1
- package/src/contexts/SessionContext.tsx +397 -43
- package/src/contexts/agentsReducer.ts +49 -0
- package/src/contexts/messageGroups.ts +56 -0
- package/src/contexts/messageReducer.ts +4 -0
- package/src/contexts/runningToast.ts +33 -0
- package/src/contexts/traceReducer.ts +62 -0
- package/src/contexts/turnTimer.test.ts +97 -0
- package/src/contexts/turnTimer.ts +108 -0
- package/src/contexts/useTurnTimer.ts +104 -0
- package/src/contracts/backend.ts +53 -2
- package/src/i18n/messages/analytics.ts +16 -6
- package/src/i18n/messages/chat.ts +26 -4
- package/src/i18n/messages/contexts.ts +2 -0
- package/src/i18n/messages/network.ts +13 -9
- package/src/i18n/messages/profile.ts +4 -0
- package/src/i18n/messages/settings.ts +4 -0
- package/src/i18n/messages/shell.ts +2 -0
- package/src/i18n/messages/trace.ts +69 -17
- package/src/mocks/backend.ts +7 -0
- package/src/styles/global.css +289 -70
- package/src/utils/api.ts +105 -8
- package/src/utils/toolDisplay.ts +74 -0
- package/dist/assets/index-C-8G4D4j.js +0 -448
- package/dist/assets/index-C501m5OS.css +0 -1
|
@@ -1,448 +0,0 @@
|
|
|
1
|
-
var Jb=Object.defineProperty;var ev=(e,n,r)=>n in e?Jb(e,n,{enumerable:!0,configurable:!0,writable:!0,value:r}):e[n]=r;var iu=(e,n,r)=>ev(e,typeof n!="symbol"?n+"":n,r);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const a of document.querySelectorAll('link[rel="modulepreload"]'))s(a);new MutationObserver(a=>{for(const c of a)if(c.type==="childList")for(const u of c.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&s(u)}).observe(document,{childList:!0,subtree:!0});function r(a){const c={};return a.integrity&&(c.integrity=a.integrity),a.referrerPolicy&&(c.referrerPolicy=a.referrerPolicy),a.crossOrigin==="use-credentials"?c.credentials="include":a.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function s(a){if(a.ep)return;a.ep=!0;const c=r(a);fetch(a.href,c)}})();function wa(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var su={exports:{}},ra={},au={exports:{}},at={};/**
|
|
2
|
-
* @license React
|
|
3
|
-
* react.production.min.js
|
|
4
|
-
*
|
|
5
|
-
* Copyright (c) Facebook, Inc. and its 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 am;function tv(){if(am)return at;am=1;var e=Symbol.for("react.element"),n=Symbol.for("react.portal"),r=Symbol.for("react.fragment"),s=Symbol.for("react.strict_mode"),a=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),u=Symbol.for("react.context"),f=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),m=Symbol.for("react.memo"),g=Symbol.for("react.lazy"),y=Symbol.iterator;function v(R){return R===null||typeof R!="object"?null:(R=y&&R[y]||R["@@iterator"],typeof R=="function"?R:null)}var b={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},w=Object.assign,_={};function E(R,J,T){this.props=R,this.context=J,this.refs=_,this.updater=T||b}E.prototype.isReactComponent={},E.prototype.setState=function(R,J){if(typeof R!="object"&&typeof R!="function"&&R!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,R,J,"setState")},E.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function S(){}S.prototype=E.prototype;function O(R,J,T){this.props=R,this.context=J,this.refs=_,this.updater=T||b}var A=O.prototype=new S;A.constructor=O,w(A,E.prototype),A.isPureReactComponent=!0;var G=Array.isArray,P=Object.prototype.hasOwnProperty,M={current:null},W={key:!0,ref:!0,__self:!0,__source:!0};function ee(R,J,T){var X,re={},L=null,$=null;if(J!=null)for(X in J.ref!==void 0&&($=J.ref),J.key!==void 0&&(L=""+J.key),J)P.call(J,X)&&!W.hasOwnProperty(X)&&(re[X]=J[X]);var H=arguments.length-2;if(H===1)re.children=T;else if(1<H){for(var Q=Array(H),ge=0;ge<H;ge++)Q[ge]=arguments[ge+2];re.children=Q}if(R&&R.defaultProps)for(X in H=R.defaultProps,H)re[X]===void 0&&(re[X]=H[X]);return{$$typeof:e,type:R,key:L,ref:$,props:re,_owner:M.current}}function oe(R,J){return{$$typeof:e,type:R.type,key:J,ref:R.ref,props:R.props,_owner:R._owner}}function D(R){return typeof R=="object"&&R!==null&&R.$$typeof===e}function ce(R){var J={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(T){return J[T]})}var V=/\/+/g;function j(R,J){return typeof R=="object"&&R!==null&&R.key!=null?ce(""+R.key):J.toString(36)}function B(R,J,T,X,re){var L=typeof R;(L==="undefined"||L==="boolean")&&(R=null);var $=!1;if(R===null)$=!0;else switch(L){case"string":case"number":$=!0;break;case"object":switch(R.$$typeof){case e:case n:$=!0}}if($)return $=R,re=re($),R=X===""?"."+j($,0):X,G(re)?(T="",R!=null&&(T=R.replace(V,"$&/")+"/"),B(re,J,T,"",function(ge){return ge})):re!=null&&(D(re)&&(re=oe(re,T+(!re.key||$&&$.key===re.key?"":(""+re.key).replace(V,"$&/")+"/")+R)),J.push(re)),1;if($=0,X=X===""?".":X+":",G(R))for(var H=0;H<R.length;H++){L=R[H];var Q=X+j(L,H);$+=B(L,J,T,Q,re)}else if(Q=v(R),typeof Q=="function")for(R=Q.call(R),H=0;!(L=R.next()).done;)L=L.value,Q=X+j(L,H++),$+=B(L,J,T,Q,re);else if(L==="object")throw J=String(R),Error("Objects are not valid as a React child (found: "+(J==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":J)+"). If you meant to render a collection of children, use an array instead.");return $}function q(R,J,T){if(R==null)return R;var X=[],re=0;return B(R,X,"","",function(L){return J.call(T,L,re++)}),X}function Z(R){if(R._status===-1){var J=R._result;J=J(),J.then(function(T){(R._status===0||R._status===-1)&&(R._status=1,R._result=T)},function(T){(R._status===0||R._status===-1)&&(R._status=2,R._result=T)}),R._status===-1&&(R._status=0,R._result=J)}if(R._status===1)return R._result.default;throw R._result}var ne={current:null},K={transition:null},ue={ReactCurrentDispatcher:ne,ReactCurrentBatchConfig:K,ReactCurrentOwner:M};function C(){throw Error("act(...) is not supported in production builds of React.")}return at.Children={map:q,forEach:function(R,J,T){q(R,function(){J.apply(this,arguments)},T)},count:function(R){var J=0;return q(R,function(){J++}),J},toArray:function(R){return q(R,function(J){return J})||[]},only:function(R){if(!D(R))throw Error("React.Children.only expected to receive a single React element child.");return R}},at.Component=E,at.Fragment=r,at.Profiler=a,at.PureComponent=O,at.StrictMode=s,at.Suspense=p,at.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ue,at.act=C,at.cloneElement=function(R,J,T){if(R==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+R+".");var X=w({},R.props),re=R.key,L=R.ref,$=R._owner;if(J!=null){if(J.ref!==void 0&&(L=J.ref,$=M.current),J.key!==void 0&&(re=""+J.key),R.type&&R.type.defaultProps)var H=R.type.defaultProps;for(Q in J)P.call(J,Q)&&!W.hasOwnProperty(Q)&&(X[Q]=J[Q]===void 0&&H!==void 0?H[Q]:J[Q])}var Q=arguments.length-2;if(Q===1)X.children=T;else if(1<Q){H=Array(Q);for(var ge=0;ge<Q;ge++)H[ge]=arguments[ge+2];X.children=H}return{$$typeof:e,type:R.type,key:re,ref:L,props:X,_owner:$}},at.createContext=function(R){return R={$$typeof:u,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},R.Provider={$$typeof:c,_context:R},R.Consumer=R},at.createElement=ee,at.createFactory=function(R){var J=ee.bind(null,R);return J.type=R,J},at.createRef=function(){return{current:null}},at.forwardRef=function(R){return{$$typeof:f,render:R}},at.isValidElement=D,at.lazy=function(R){return{$$typeof:g,_payload:{_status:-1,_result:R},_init:Z}},at.memo=function(R,J){return{$$typeof:m,type:R,compare:J===void 0?null:J}},at.startTransition=function(R){var J=K.transition;K.transition={};try{R()}finally{K.transition=J}},at.unstable_act=C,at.useCallback=function(R,J){return ne.current.useCallback(R,J)},at.useContext=function(R){return ne.current.useContext(R)},at.useDebugValue=function(){},at.useDeferredValue=function(R){return ne.current.useDeferredValue(R)},at.useEffect=function(R,J){return ne.current.useEffect(R,J)},at.useId=function(){return ne.current.useId()},at.useImperativeHandle=function(R,J,T){return ne.current.useImperativeHandle(R,J,T)},at.useInsertionEffect=function(R,J){return ne.current.useInsertionEffect(R,J)},at.useLayoutEffect=function(R,J){return ne.current.useLayoutEffect(R,J)},at.useMemo=function(R,J){return ne.current.useMemo(R,J)},at.useReducer=function(R,J,T){return ne.current.useReducer(R,J,T)},at.useRef=function(R){return ne.current.useRef(R)},at.useState=function(R){return ne.current.useState(R)},at.useSyncExternalStore=function(R,J,T){return ne.current.useSyncExternalStore(R,J,T)},at.useTransition=function(){return ne.current.useTransition()},at.version="18.3.1",at}var om;function cd(){return om||(om=1,au.exports=tv()),au.exports}/**
|
|
10
|
-
* @license React
|
|
11
|
-
* react-jsx-runtime.production.min.js
|
|
12
|
-
*
|
|
13
|
-
* Copyright (c) Facebook, Inc. and its 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 lm;function nv(){if(lm)return ra;lm=1;var e=cd(),n=Symbol.for("react.element"),r=Symbol.for("react.fragment"),s=Object.prototype.hasOwnProperty,a=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function u(f,p,m){var g,y={},v=null,b=null;m!==void 0&&(v=""+m),p.key!==void 0&&(v=""+p.key),p.ref!==void 0&&(b=p.ref);for(g in p)s.call(p,g)&&!c.hasOwnProperty(g)&&(y[g]=p[g]);if(f&&f.defaultProps)for(g in p=f.defaultProps,p)y[g]===void 0&&(y[g]=p[g]);return{$$typeof:n,type:f,key:v,ref:b,props:y,_owner:a.current}}return ra.Fragment=r,ra.jsx=u,ra.jsxs=u,ra}var cm;function rv(){return cm||(cm=1,su.exports=nv()),su.exports}var l=rv(),N=cd();const iv=wa(N);var Fo={},ou={exports:{}},Nn={},lu={exports:{}},cu={};/**
|
|
18
|
-
* @license React
|
|
19
|
-
* scheduler.production.min.js
|
|
20
|
-
*
|
|
21
|
-
* Copyright (c) Facebook, Inc. and its 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 um;function sv(){return um||(um=1,(function(e){function n(K,ue){var C=K.length;K.push(ue);e:for(;0<C;){var R=C-1>>>1,J=K[R];if(0<a(J,ue))K[R]=ue,K[C]=J,C=R;else break e}}function r(K){return K.length===0?null:K[0]}function s(K){if(K.length===0)return null;var ue=K[0],C=K.pop();if(C!==ue){K[0]=C;e:for(var R=0,J=K.length,T=J>>>1;R<T;){var X=2*(R+1)-1,re=K[X],L=X+1,$=K[L];if(0>a(re,C))L<J&&0>a($,re)?(K[R]=$,K[L]=C,R=L):(K[R]=re,K[X]=C,R=X);else if(L<J&&0>a($,C))K[R]=$,K[L]=C,R=L;else break e}}return ue}function a(K,ue){var C=K.sortIndex-ue.sortIndex;return C!==0?C:K.id-ue.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var u=Date,f=u.now();e.unstable_now=function(){return u.now()-f}}var p=[],m=[],g=1,y=null,v=3,b=!1,w=!1,_=!1,E=typeof setTimeout=="function"?setTimeout:null,S=typeof clearTimeout=="function"?clearTimeout:null,O=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function A(K){for(var ue=r(m);ue!==null;){if(ue.callback===null)s(m);else if(ue.startTime<=K)s(m),ue.sortIndex=ue.expirationTime,n(p,ue);else break;ue=r(m)}}function G(K){if(_=!1,A(K),!w)if(r(p)!==null)w=!0,Z(P);else{var ue=r(m);ue!==null&&ne(G,ue.startTime-K)}}function P(K,ue){w=!1,_&&(_=!1,S(ee),ee=-1),b=!0;var C=v;try{for(A(ue),y=r(p);y!==null&&(!(y.expirationTime>ue)||K&&!ce());){var R=y.callback;if(typeof R=="function"){y.callback=null,v=y.priorityLevel;var J=R(y.expirationTime<=ue);ue=e.unstable_now(),typeof J=="function"?y.callback=J:y===r(p)&&s(p),A(ue)}else s(p);y=r(p)}if(y!==null)var T=!0;else{var X=r(m);X!==null&&ne(G,X.startTime-ue),T=!1}return T}finally{y=null,v=C,b=!1}}var M=!1,W=null,ee=-1,oe=5,D=-1;function ce(){return!(e.unstable_now()-D<oe)}function V(){if(W!==null){var K=e.unstable_now();D=K;var ue=!0;try{ue=W(!0,K)}finally{ue?j():(M=!1,W=null)}}else M=!1}var j;if(typeof O=="function")j=function(){O(V)};else if(typeof MessageChannel<"u"){var B=new MessageChannel,q=B.port2;B.port1.onmessage=V,j=function(){q.postMessage(null)}}else j=function(){E(V,0)};function Z(K){W=K,M||(M=!0,j())}function ne(K,ue){ee=E(function(){K(e.unstable_now())},ue)}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(K){K.callback=null},e.unstable_continueExecution=function(){w||b||(w=!0,Z(P))},e.unstable_forceFrameRate=function(K){0>K||125<K?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):oe=0<K?Math.floor(1e3/K):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return r(p)},e.unstable_next=function(K){switch(v){case 1:case 2:case 3:var ue=3;break;default:ue=v}var C=v;v=ue;try{return K()}finally{v=C}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(K,ue){switch(K){case 1:case 2:case 3:case 4:case 5:break;default:K=3}var C=v;v=K;try{return ue()}finally{v=C}},e.unstable_scheduleCallback=function(K,ue,C){var R=e.unstable_now();switch(typeof C=="object"&&C!==null?(C=C.delay,C=typeof C=="number"&&0<C?R+C:R):C=R,K){case 1:var J=-1;break;case 2:J=250;break;case 5:J=1073741823;break;case 4:J=1e4;break;default:J=5e3}return J=C+J,K={id:g++,callback:ue,priorityLevel:K,startTime:C,expirationTime:J,sortIndex:-1},C>R?(K.sortIndex=C,n(m,K),r(p)===null&&K===r(m)&&(_?(S(ee),ee=-1):_=!0,ne(G,C-R))):(K.sortIndex=J,n(p,K),w||b||(w=!0,Z(P))),K},e.unstable_shouldYield=ce,e.unstable_wrapCallback=function(K){var ue=v;return function(){var C=v;v=ue;try{return K.apply(this,arguments)}finally{v=C}}}})(cu)),cu}var dm;function av(){return dm||(dm=1,lu.exports=sv()),lu.exports}/**
|
|
26
|
-
* @license React
|
|
27
|
-
* react-dom.production.min.js
|
|
28
|
-
*
|
|
29
|
-
* Copyright (c) Facebook, Inc. and its 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 fm;function ov(){if(fm)return Nn;fm=1;var e=cd(),n=av();function r(t){for(var i="https://reactjs.org/docs/error-decoder.html?invariant="+t,o=1;o<arguments.length;o++)i+="&args[]="+encodeURIComponent(arguments[o]);return"Minified React error #"+t+"; visit "+i+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var s=new Set,a={};function c(t,i){u(t,i),u(t+"Capture",i)}function u(t,i){for(a[t]=i,t=0;t<i.length;t++)s.add(i[t])}var f=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),p=Object.prototype.hasOwnProperty,m=/^[: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]*$/,g={},y={};function v(t){return p.call(y,t)?!0:p.call(g,t)?!1:m.test(t)?y[t]=!0:(g[t]=!0,!1)}function b(t,i,o,d){if(o!==null&&o.type===0)return!1;switch(typeof i){case"function":case"symbol":return!0;case"boolean":return d?!1:o!==null?!o.acceptsBooleans:(t=t.toLowerCase().slice(0,5),t!=="data-"&&t!=="aria-");default:return!1}}function w(t,i,o,d){if(i===null||typeof i>"u"||b(t,i,o,d))return!0;if(d)return!1;if(o!==null)switch(o.type){case 3:return!i;case 4:return i===!1;case 5:return isNaN(i);case 6:return isNaN(i)||1>i}return!1}function _(t,i,o,d,h,x,k){this.acceptsBooleans=i===2||i===3||i===4,this.attributeName=d,this.attributeNamespace=h,this.mustUseProperty=o,this.propertyName=t,this.type=i,this.sanitizeURL=x,this.removeEmptyString=k}var E={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(t){E[t]=new _(t,0,!1,t,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(t){var i=t[0];E[i]=new _(i,1,!1,t[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(t){E[t]=new _(t,2,!1,t.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(t){E[t]=new _(t,2,!1,t,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(t){E[t]=new _(t,3,!1,t.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(t){E[t]=new _(t,3,!0,t,null,!1,!1)}),["capture","download"].forEach(function(t){E[t]=new _(t,4,!1,t,null,!1,!1)}),["cols","rows","size","span"].forEach(function(t){E[t]=new _(t,6,!1,t,null,!1,!1)}),["rowSpan","start"].forEach(function(t){E[t]=new _(t,5,!1,t.toLowerCase(),null,!1,!1)});var S=/[\-:]([a-z])/g;function O(t){return t[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(t){var i=t.replace(S,O);E[i]=new _(i,1,!1,t,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(t){var i=t.replace(S,O);E[i]=new _(i,1,!1,t,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(t){var i=t.replace(S,O);E[i]=new _(i,1,!1,t,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(t){E[t]=new _(t,1,!1,t.toLowerCase(),null,!1,!1)}),E.xlinkHref=new _("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(t){E[t]=new _(t,1,!1,t.toLowerCase(),null,!0,!0)});function A(t,i,o,d){var h=E.hasOwnProperty(i)?E[i]:null;(h!==null?h.type!==0:d||!(2<i.length)||i[0]!=="o"&&i[0]!=="O"||i[1]!=="n"&&i[1]!=="N")&&(w(i,o,h,d)&&(o=null),d||h===null?v(i)&&(o===null?t.removeAttribute(i):t.setAttribute(i,""+o)):h.mustUseProperty?t[h.propertyName]=o===null?h.type===3?!1:"":o:(i=h.attributeName,d=h.attributeNamespace,o===null?t.removeAttribute(i):(h=h.type,o=h===3||h===4&&o===!0?"":""+o,d?t.setAttributeNS(d,i,o):t.setAttribute(i,o))))}var G=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,P=Symbol.for("react.element"),M=Symbol.for("react.portal"),W=Symbol.for("react.fragment"),ee=Symbol.for("react.strict_mode"),oe=Symbol.for("react.profiler"),D=Symbol.for("react.provider"),ce=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),j=Symbol.for("react.suspense"),B=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),ne=Symbol.for("react.offscreen"),K=Symbol.iterator;function ue(t){return t===null||typeof t!="object"?null:(t=K&&t[K]||t["@@iterator"],typeof t=="function"?t:null)}var C=Object.assign,R;function J(t){if(R===void 0)try{throw Error()}catch(o){var i=o.stack.trim().match(/\n( *(at )?)/);R=i&&i[1]||""}return`
|
|
34
|
-
`+R+t}var T=!1;function X(t,i){if(!t||T)return"";T=!0;var o=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(i)if(i=function(){throw Error()},Object.defineProperty(i.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(i,[])}catch(ie){var d=ie}Reflect.construct(t,[],i)}else{try{i.call()}catch(ie){d=ie}t.call(i.prototype)}else{try{throw Error()}catch(ie){d=ie}t()}}catch(ie){if(ie&&d&&typeof ie.stack=="string"){for(var h=ie.stack.split(`
|
|
35
|
-
`),x=d.stack.split(`
|
|
36
|
-
`),k=h.length-1,I=x.length-1;1<=k&&0<=I&&h[k]!==x[I];)I--;for(;1<=k&&0<=I;k--,I--)if(h[k]!==x[I]){if(k!==1||I!==1)do if(k--,I--,0>I||h[k]!==x[I]){var z=`
|
|
37
|
-
`+h[k].replace(" at new "," at ");return t.displayName&&z.includes("<anonymous>")&&(z=z.replace("<anonymous>",t.displayName)),z}while(1<=k&&0<=I);break}}}finally{T=!1,Error.prepareStackTrace=o}return(t=t?t.displayName||t.name:"")?J(t):""}function re(t){switch(t.tag){case 5:return J(t.type);case 16:return J("Lazy");case 13:return J("Suspense");case 19:return J("SuspenseList");case 0:case 2:case 15:return t=X(t.type,!1),t;case 11:return t=X(t.type.render,!1),t;case 1:return t=X(t.type,!0),t;default:return""}}function L(t){if(t==null)return null;if(typeof t=="function")return t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case W:return"Fragment";case M:return"Portal";case oe:return"Profiler";case ee:return"StrictMode";case j:return"Suspense";case B:return"SuspenseList"}if(typeof t=="object")switch(t.$$typeof){case ce:return(t.displayName||"Context")+".Consumer";case D:return(t._context.displayName||"Context")+".Provider";case V:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case q:return i=t.displayName||null,i!==null?i:L(t.type)||"Memo";case Z:i=t._payload,t=t._init;try{return L(t(i))}catch{}}return null}function $(t){var i=t.type;switch(t.tag){case 24:return"Cache";case 9:return(i.displayName||"Context")+".Consumer";case 10:return(i._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return t=i.render,t=t.displayName||t.name||"",i.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 5:return i;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return L(i);case 8:return i===ee?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof i=="function")return i.displayName||i.name||null;if(typeof i=="string")return i}return null}function H(t){switch(typeof t){case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Q(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function ge(t){var i=Q(t)?"checked":"value",o=Object.getOwnPropertyDescriptor(t.constructor.prototype,i),d=""+t[i];if(!t.hasOwnProperty(i)&&typeof o<"u"&&typeof o.get=="function"&&typeof o.set=="function"){var h=o.get,x=o.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return h.call(this)},set:function(k){d=""+k,x.call(this,k)}}),Object.defineProperty(t,i,{enumerable:o.enumerable}),{getValue:function(){return d},setValue:function(k){d=""+k},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function Pe(t){t._valueTracker||(t._valueTracker=ge(t))}function fe(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var o=i.getValue(),d="";return t&&(d=Q(t)?t.checked?"true":"false":t.value),t=d,t!==o?(i.setValue(t),!0):!1}function ke(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function Ee(t,i){var o=i.checked;return C({},i,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:o??t._wrapperState.initialChecked})}function ve(t,i){var o=i.defaultValue==null?"":i.defaultValue,d=i.checked!=null?i.checked:i.defaultChecked;o=H(i.value!=null?i.value:o),t._wrapperState={initialChecked:d,initialValue:o,controlled:i.type==="checkbox"||i.type==="radio"?i.checked!=null:i.value!=null}}function Se(t,i){i=i.checked,i!=null&&A(t,"checked",i,!1)}function tt(t,i){Se(t,i);var o=H(i.value),d=i.type;if(o!=null)d==="number"?(o===0&&t.value===""||t.value!=o)&&(t.value=""+o):t.value!==""+o&&(t.value=""+o);else if(d==="submit"||d==="reset"){t.removeAttribute("value");return}i.hasOwnProperty("value")?se(t,i.type,o):i.hasOwnProperty("defaultValue")&&se(t,i.type,H(i.defaultValue)),i.checked==null&&i.defaultChecked!=null&&(t.defaultChecked=!!i.defaultChecked)}function ft(t,i,o){if(i.hasOwnProperty("value")||i.hasOwnProperty("defaultValue")){var d=i.type;if(!(d!=="submit"&&d!=="reset"||i.value!==void 0&&i.value!==null))return;i=""+t._wrapperState.initialValue,o||i===t.value||(t.value=i),t.defaultValue=i}o=t.name,o!==""&&(t.name=""),t.defaultChecked=!!t._wrapperState.initialChecked,o!==""&&(t.name=o)}function se(t,i,o){(i!=="number"||ke(t.ownerDocument)!==t)&&(o==null?t.defaultValue=""+t._wrapperState.initialValue:t.defaultValue!==""+o&&(t.defaultValue=""+o))}var je=Array.isArray;function le(t,i,o,d){if(t=t.options,i){i={};for(var h=0;h<o.length;h++)i["$"+o[h]]=!0;for(o=0;o<t.length;o++)h=i.hasOwnProperty("$"+t[o].value),t[o].selected!==h&&(t[o].selected=h),h&&d&&(t[o].defaultSelected=!0)}else{for(o=""+H(o),i=null,h=0;h<t.length;h++){if(t[h].value===o){t[h].selected=!0,d&&(t[h].defaultSelected=!0);return}i!==null||t[h].disabled||(i=t[h])}i!==null&&(i.selected=!0)}}function pe(t,i){if(i.dangerouslySetInnerHTML!=null)throw Error(r(91));return C({},i,{value:void 0,defaultValue:void 0,children:""+t._wrapperState.initialValue})}function ze(t,i){var o=i.value;if(o==null){if(o=i.children,i=i.defaultValue,o!=null){if(i!=null)throw Error(r(92));if(je(o)){if(1<o.length)throw Error(r(93));o=o[0]}i=o}i==null&&(i=""),o=i}t._wrapperState={initialValue:H(o)}}function st(t,i){var o=H(i.value),d=H(i.defaultValue);o!=null&&(o=""+o,o!==t.value&&(t.value=o),i.defaultValue==null&&t.defaultValue!==o&&(t.defaultValue=o)),d!=null&&(t.defaultValue=""+d)}function Et(t){var i=t.textContent;i===t._wrapperState.initialValue&&i!==""&&i!==null&&(t.value=i)}function ae(t){switch(t){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function xe(t,i){return t==null||t==="http://www.w3.org/1999/xhtml"?ae(i):t==="http://www.w3.org/2000/svg"&&i==="foreignObject"?"http://www.w3.org/1999/xhtml":t}var Be,Ze=(function(t){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(i,o,d,h){MSApp.execUnsafeLocalFunction(function(){return t(i,o,d,h)})}:t})(function(t,i){if(t.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in t)t.innerHTML=i;else{for(Be=Be||document.createElement("div"),Be.innerHTML="<svg>"+i.valueOf().toString()+"</svg>",i=Be.firstChild;t.firstChild;)t.removeChild(t.firstChild);for(;i.firstChild;)t.appendChild(i.firstChild)}});function lt(t,i){if(i){var o=t.firstChild;if(o&&o===t.lastChild&&o.nodeType===3){o.nodeValue=i;return}}t.textContent=i}var St={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Wt=["Webkit","ms","Moz","O"];Object.keys(St).forEach(function(t){Wt.forEach(function(i){i=i+t.charAt(0).toUpperCase()+t.substring(1),St[i]=St[t]})});function tn(t,i,o){return i==null||typeof i=="boolean"||i===""?"":o||typeof i!="number"||i===0||St.hasOwnProperty(t)&&St[t]?(""+i).trim():i+"px"}function vn(t,i){t=t.style;for(var o in i)if(i.hasOwnProperty(o)){var d=o.indexOf("--")===0,h=tn(o,i[o],d);o==="float"&&(o="cssFloat"),d?t.setProperty(o,h):t[o]=h}}var mr=C({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Vt(t,i){if(i){if(mr[t]&&(i.children!=null||i.dangerouslySetInnerHTML!=null))throw Error(r(137,t));if(i.dangerouslySetInnerHTML!=null){if(i.children!=null)throw Error(r(60));if(typeof i.dangerouslySetInnerHTML!="object"||!("__html"in i.dangerouslySetInnerHTML))throw Error(r(61))}if(i.style!=null&&typeof i.style!="object")throw Error(r(62))}}function Fn(t,i){if(t.indexOf("-")===-1)return typeof i.is=="string";switch(t){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 nn=null;function Ri(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var Ii=null,Tr=null,hr=null;function gr(t){if(t=$s(t)){if(typeof Ii!="function")throw Error(r(280));var i=t.stateNode;i&&(i=Za(i),Ii(t.stateNode,t.type,i))}}function F(t){Tr?hr?hr.push(t):hr=[t]:Tr=t}function de(){if(Tr){var t=Tr,i=hr;if(hr=Tr=null,gr(t),i)for(t=0;t<i.length;t++)gr(i[t])}}function Ce(t,i){return t(i)}function Ge(){}var Tt=!1;function Rt(t,i,o){if(Tt)return t(i,o);Tt=!0;try{return Ce(t,i,o)}finally{Tt=!1,(Tr!==null||hr!==null)&&(Ge(),de())}}function Re(t,i){var o=t.stateNode;if(o===null)return null;var d=Za(o);if(d===null)return null;o=d[i];e:switch(i){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(d=!d.disabled)||(t=t.type,d=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!d;break e;default:t=!1}if(t)return null;if(o&&typeof o!="function")throw Error(r(231,i,typeof o));return o}var Me=!1;if(f)try{var $e={};Object.defineProperty($e,"passive",{get:function(){Me=!0}}),window.addEventListener("test",$e,$e),window.removeEventListener("test",$e,$e)}catch{Me=!1}function $t(t,i,o,d,h,x,k,I,z){var ie=Array.prototype.slice.call(arguments,3);try{i.apply(o,ie)}catch(he){this.onError(he)}}var Nt=!1,ir=null,Ar=!1,ti=null,El={onError:function(t){Nt=!0,ir=t}};function _s(t,i,o,d,h,x,k,I,z){Nt=!1,ir=null,$t.apply(El,arguments)}function Sl(t,i,o,d,h,x,k,I,z){if(_s.apply(this,arguments),Nt){if(Nt){var ie=ir;Nt=!1,ir=null}else throw Error(r(198));Ar||(Ar=!0,ti=ie)}}function yr(t){var i=t,o=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(o=i.return),t=i.return;while(t)}return i.tag===3?o:null}function Ma(t){if(t.tag===13){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function ks(t){if(yr(t)!==t)throw Error(r(188))}function Oi(t){var i=t.alternate;if(!i){if(i=yr(t),i===null)throw Error(r(188));return i!==t?null:t}for(var o=t,d=i;;){var h=o.return;if(h===null)break;var x=h.alternate;if(x===null){if(d=h.return,d!==null){o=d;continue}break}if(h.child===x.child){for(x=h.child;x;){if(x===o)return ks(h),t;if(x===d)return ks(h),i;x=x.sibling}throw Error(r(188))}if(o.return!==d.return)o=h,d=x;else{for(var k=!1,I=h.child;I;){if(I===o){k=!0,o=h,d=x;break}if(I===d){k=!0,d=h,o=x;break}I=I.sibling}if(!k){for(I=x.child;I;){if(I===o){k=!0,o=x,d=h;break}if(I===d){k=!0,d=x,o=h;break}I=I.sibling}if(!k)throw Error(r(189))}}if(o.alternate!==d)throw Error(r(190))}if(o.tag!==3)throw Error(r(188));return o.stateNode.current===o?t:i}function Ra(t){return t=Oi(t),t!==null?Ia(t):null}function Ia(t){if(t.tag===5||t.tag===6)return t;for(t=t.child;t!==null;){var i=Ia(t);if(i!==null)return i;t=t.sibling}return null}var Oa=n.unstable_scheduleCallback,Xn=n.unstable_cancelCallback,ja=n.unstable_shouldYield,La=n.unstable_requestPaint,Ot=n.unstable_now,Nl=n.unstable_getCurrentPriorityLevel,Es=n.unstable_ImmediatePriority,ni=n.unstable_UserBlockingPriority,ji=n.unstable_NormalPriority,we=n.unstable_LowPriority,Ue=n.unstable_IdlePriority,nt=null,ct=null;function zt(t){if(ct&&typeof ct.onCommitFiberRoot=="function")try{ct.onCommitFiberRoot(nt,t,void 0,(t.current.flags&128)===128)}catch{}}var jt=Math.clz32?Math.clz32:pn,sr=Math.log,Li=Math.LN2;function pn(t){return t>>>=0,t===0?32:31-(sr(t)/Li|0)|0}var mn=64,ri=4194304;function Mr(t){switch(t&-t){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return t&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return t&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return t}}function ii(t,i){var o=t.pendingLanes;if(o===0)return 0;var d=0,h=t.suspendedLanes,x=t.pingedLanes,k=o&268435455;if(k!==0){var I=k&~h;I!==0?d=Mr(I):(x&=k,x!==0&&(d=Mr(x)))}else k=o&~h,k!==0?d=Mr(k):x!==0&&(d=Mr(x));if(d===0)return 0;if(i!==0&&i!==d&&(i&h)===0&&(h=d&-d,x=i&-i,h>=x||h===16&&(x&4194240)!==0))return i;if((d&4)!==0&&(d|=o&16),i=t.entangledLanes,i!==0)for(t=t.entanglements,i&=d;0<i;)o=31-jt(i),h=1<<o,d|=t[o],i&=~h;return d}function Cl(t,i){switch(t){case 1:case 2:case 4:return i+250;case 8:case 16:case 32:case 64: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 i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Tl(t,i){for(var o=t.suspendedLanes,d=t.pingedLanes,h=t.expirationTimes,x=t.pendingLanes;0<x;){var k=31-jt(x),I=1<<k,z=h[k];z===-1?((I&o)===0||(I&d)!==0)&&(h[k]=Cl(I,i)):z<=i&&(t.expiredLanes|=I),x&=~I}}function Ss(t){return t=t.pendingLanes&-1073741825,t!==0?t:t&1073741824?1073741824:0}function Da(){var t=mn;return mn<<=1,(mn&4194240)===0&&(mn=64),t}function Rr(t){for(var i=[],o=0;31>o;o++)i.push(t);return i}function Ir(t,i,o){t.pendingLanes|=i,i!==536870912&&(t.suspendedLanes=0,t.pingedLanes=0),t=t.eventTimes,i=31-jt(i),t[i]=o}function zn(t,i){var o=t.pendingLanes&~i;t.pendingLanes=i,t.suspendedLanes=0,t.pingedLanes=0,t.expiredLanes&=i,t.mutableReadLanes&=i,t.entangledLanes&=i,i=t.entanglements;var d=t.eventTimes;for(t=t.expirationTimes;0<o;){var h=31-jt(o),x=1<<h;i[h]=0,d[h]=-1,t[h]=-1,o&=~x}}function Ns(t,i){var o=t.entangledLanes|=i;for(t=t.entanglements;o;){var d=31-jt(o),h=1<<d;h&i|t[d]&i&&(t[d]|=i),o&=~h}}var mt=0;function Xe(t){return t&=-t,1<t?4<t?(t&268435455)!==0?16:536870912:4:1}var Cs,Bt,bt,si,ar,ai=!1,Or=[],Ne=null,Ie=null,We=null,dt=new Map,Pt=new Map,Xt=[],Al="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 submit".split(" ");function Pa(t,i){switch(t){case"focusin":case"focusout":Ne=null;break;case"dragenter":case"dragleave":Ie=null;break;case"mouseover":case"mouseout":We=null;break;case"pointerover":case"pointerout":dt.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":Pt.delete(i.pointerId)}}function Ts(t,i,o,d,h,x){return t===null||t.nativeEvent!==x?(t={blockedOn:i,domEventName:o,eventSystemFlags:d,nativeEvent:x,targetContainers:[h]},i!==null&&(i=$s(i),i!==null&&Bt(i)),t):(t.eventSystemFlags|=d,i=t.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),t)}function _x(t,i,o,d,h){switch(i){case"focusin":return Ne=Ts(Ne,t,i,o,d,h),!0;case"dragenter":return Ie=Ts(Ie,t,i,o,d,h),!0;case"mouseover":return We=Ts(We,t,i,o,d,h),!0;case"pointerover":var x=h.pointerId;return dt.set(x,Ts(dt.get(x)||null,t,i,o,d,h)),!0;case"gotpointercapture":return x=h.pointerId,Pt.set(x,Ts(Pt.get(x)||null,t,i,o,d,h)),!0}return!1}function Hd(t){var i=oi(t.target);if(i!==null){var o=yr(i);if(o!==null){if(i=o.tag,i===13){if(i=Ma(o),i!==null){t.blockedOn=i,ar(t.priority,function(){bt(o)});return}}else if(i===3&&o.stateNode.current.memoizedState.isDehydrated){t.blockedOn=o.tag===3?o.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Fa(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var o=Rl(t.domEventName,t.eventSystemFlags,i[0],t.nativeEvent);if(o===null){o=t.nativeEvent;var d=new o.constructor(o.type,o);nn=d,o.target.dispatchEvent(d),nn=null}else return i=$s(o),i!==null&&Bt(i),t.blockedOn=o,!1;i.shift()}return!0}function qd(t,i,o){Fa(t)&&o.delete(i)}function kx(){ai=!1,Ne!==null&&Fa(Ne)&&(Ne=null),Ie!==null&&Fa(Ie)&&(Ie=null),We!==null&&Fa(We)&&(We=null),dt.forEach(qd),Pt.forEach(qd)}function As(t,i){t.blockedOn===i&&(t.blockedOn=null,ai||(ai=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,kx)))}function Ms(t){function i(h){return As(h,t)}if(0<Or.length){As(Or[0],t);for(var o=1;o<Or.length;o++){var d=Or[o];d.blockedOn===t&&(d.blockedOn=null)}}for(Ne!==null&&As(Ne,t),Ie!==null&&As(Ie,t),We!==null&&As(We,t),dt.forEach(i),Pt.forEach(i),o=0;o<Xt.length;o++)d=Xt[o],d.blockedOn===t&&(d.blockedOn=null);for(;0<Xt.length&&(o=Xt[0],o.blockedOn===null);)Hd(o),o.blockedOn===null&&Xt.shift()}var Di=G.ReactCurrentBatchConfig,za=!0;function Ex(t,i,o,d){var h=mt,x=Di.transition;Di.transition=null;try{mt=1,Ml(t,i,o,d)}finally{mt=h,Di.transition=x}}function Sx(t,i,o,d){var h=mt,x=Di.transition;Di.transition=null;try{mt=4,Ml(t,i,o,d)}finally{mt=h,Di.transition=x}}function Ml(t,i,o,d){if(za){var h=Rl(t,i,o,d);if(h===null)Gl(t,i,d,Ba,o),Pa(t,d);else if(_x(h,t,i,o,d))d.stopPropagation();else if(Pa(t,d),i&4&&-1<Al.indexOf(t)){for(;h!==null;){var x=$s(h);if(x!==null&&Cs(x),x=Rl(t,i,o,d),x===null&&Gl(t,i,d,Ba,o),x===h)break;h=x}h!==null&&d.stopPropagation()}else Gl(t,i,d,null,o)}}var Ba=null;function Rl(t,i,o,d){if(Ba=null,t=Ri(d),t=oi(t),t!==null)if(i=yr(t),i===null)t=null;else if(o=i.tag,o===13){if(t=Ma(i),t!==null)return t;t=null}else if(o===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null);return Ba=t,null}function Kd(t){switch(t){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Nl()){case Es:return 1;case ni:return 4;case ji:case we:return 16;case Ue:return 536870912;default:return 16}default:return 16}}var jr=null,Il=null,Ua=null;function Wd(){if(Ua)return Ua;var t,i=Il,o=i.length,d,h="value"in jr?jr.value:jr.textContent,x=h.length;for(t=0;t<o&&i[t]===h[t];t++);var k=o-t;for(d=1;d<=k&&i[o-d]===h[x-d];d++);return Ua=h.slice(t,1<d?1-d:void 0)}function $a(t){var i=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&i===13&&(t=13)):t=i,t===10&&(t=13),32<=t||t===13?t:0}function Ha(){return!0}function Vd(){return!1}function Mn(t){function i(o,d,h,x,k){this._reactName=o,this._targetInst=h,this.type=d,this.nativeEvent=x,this.target=k,this.currentTarget=null;for(var I in t)t.hasOwnProperty(I)&&(o=t[I],this[I]=o?o(x):x[I]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?Ha:Vd,this.isPropagationStopped=Vd,this}return C(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var o=this.nativeEvent;o&&(o.preventDefault?o.preventDefault():typeof o.returnValue!="unknown"&&(o.returnValue=!1),this.isDefaultPrevented=Ha)},stopPropagation:function(){var o=this.nativeEvent;o&&(o.stopPropagation?o.stopPropagation():typeof o.cancelBubble!="unknown"&&(o.cancelBubble=!0),this.isPropagationStopped=Ha)},persist:function(){},isPersistent:Ha}),i}var Pi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ol=Mn(Pi),Rs=C({},Pi,{view:0,detail:0}),Nx=Mn(Rs),jl,Ll,Is,qa=C({},Rs,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Pl,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==Is&&(Is&&t.type==="mousemove"?(jl=t.screenX-Is.screenX,Ll=t.screenY-Is.screenY):Ll=jl=0,Is=t),jl)},movementY:function(t){return"movementY"in t?t.movementY:Ll}}),Gd=Mn(qa),Cx=C({},qa,{dataTransfer:0}),Tx=Mn(Cx),Ax=C({},Rs,{relatedTarget:0}),Dl=Mn(Ax),Mx=C({},Pi,{animationName:0,elapsedTime:0,pseudoElement:0}),Rx=Mn(Mx),Ix=C({},Pi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),Ox=Mn(Ix),jx=C({},Pi,{data:0}),Yd=Mn(jx),Lx={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Dx={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"},Px={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Fx(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=Px[t])?!!i[t]:!1}function Pl(){return Fx}var zx=C({},Rs,{key:function(t){if(t.key){var i=Lx[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=$a(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?Dx[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Pl,charCode:function(t){return t.type==="keypress"?$a(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?$a(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),Bx=Mn(zx),Ux=C({},qa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xd=Mn(Ux),$x=C({},Rs,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Pl}),Hx=Mn($x),qx=C({},Pi,{propertyName:0,elapsedTime:0,pseudoElement:0}),Kx=Mn(qx),Wx=C({},qa,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),Vx=Mn(Wx),Gx=[9,13,27,32],Fl=f&&"CompositionEvent"in window,Os=null;f&&"documentMode"in document&&(Os=document.documentMode);var Yx=f&&"TextEvent"in window&&!Os,Qd=f&&(!Fl||Os&&8<Os&&11>=Os),Zd=" ",Jd=!1;function ef(t,i){switch(t){case"keyup":return Gx.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function tf(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var Fi=!1;function Xx(t,i){switch(t){case"compositionend":return tf(i);case"keypress":return i.which!==32?null:(Jd=!0,Zd);case"textInput":return t=i.data,t===Zd&&Jd?null:t;default:return null}}function Qx(t,i){if(Fi)return t==="compositionend"||!Fl&&ef(t,i)?(t=Wd(),Ua=Il=jr=null,Fi=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(i.ctrlKey||i.altKey||i.metaKey)||i.ctrlKey&&i.altKey){if(i.char&&1<i.char.length)return i.char;if(i.which)return String.fromCharCode(i.which)}return null;case"compositionend":return Qd&&i.locale!=="ko"?null:i.data;default:return null}}var Zx={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 nf(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!Zx[t.type]:i==="textarea"}function rf(t,i,o,d){F(d),i=Ya(i,"onChange"),0<i.length&&(o=new Ol("onChange","change",null,o,d),t.push({event:o,listeners:i}))}var js=null,Ls=null;function Jx(t){_f(t,0)}function Ka(t){var i=Hi(t);if(fe(i))return t}function eb(t,i){if(t==="change")return i}var sf=!1;if(f){var zl;if(f){var Bl="oninput"in document;if(!Bl){var af=document.createElement("div");af.setAttribute("oninput","return;"),Bl=typeof af.oninput=="function"}zl=Bl}else zl=!1;sf=zl&&(!document.documentMode||9<document.documentMode)}function of(){js&&(js.detachEvent("onpropertychange",lf),Ls=js=null)}function lf(t){if(t.propertyName==="value"&&Ka(Ls)){var i=[];rf(i,Ls,t,Ri(t)),Rt(Jx,i)}}function tb(t,i,o){t==="focusin"?(of(),js=i,Ls=o,js.attachEvent("onpropertychange",lf)):t==="focusout"&&of()}function nb(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ka(Ls)}function rb(t,i){if(t==="click")return Ka(i)}function ib(t,i){if(t==="input"||t==="change")return Ka(i)}function sb(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Qn=typeof Object.is=="function"?Object.is:sb;function Ds(t,i){if(Qn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var o=Object.keys(t),d=Object.keys(i);if(o.length!==d.length)return!1;for(d=0;d<o.length;d++){var h=o[d];if(!p.call(i,h)||!Qn(t[h],i[h]))return!1}return!0}function cf(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function uf(t,i){var o=cf(t);t=0;for(var d;o;){if(o.nodeType===3){if(d=t+o.textContent.length,t<=i&&d>=i)return{node:o,offset:i-t};t=d}e:{for(;o;){if(o.nextSibling){o=o.nextSibling;break e}o=o.parentNode}o=void 0}o=cf(o)}}function df(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?df(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function ff(){for(var t=window,i=ke();i instanceof t.HTMLIFrameElement;){try{var o=typeof i.contentWindow.location.href=="string"}catch{o=!1}if(o)t=i.contentWindow;else break;i=ke(t.document)}return i}function Ul(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i&&(i==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||i==="textarea"||t.contentEditable==="true")}function ab(t){var i=ff(),o=t.focusedElem,d=t.selectionRange;if(i!==o&&o&&o.ownerDocument&&df(o.ownerDocument.documentElement,o)){if(d!==null&&Ul(o)){if(i=d.start,t=d.end,t===void 0&&(t=i),"selectionStart"in o)o.selectionStart=i,o.selectionEnd=Math.min(t,o.value.length);else if(t=(i=o.ownerDocument||document)&&i.defaultView||window,t.getSelection){t=t.getSelection();var h=o.textContent.length,x=Math.min(d.start,h);d=d.end===void 0?x:Math.min(d.end,h),!t.extend&&x>d&&(h=d,d=x,x=h),h=uf(o,x);var k=uf(o,d);h&&k&&(t.rangeCount!==1||t.anchorNode!==h.node||t.anchorOffset!==h.offset||t.focusNode!==k.node||t.focusOffset!==k.offset)&&(i=i.createRange(),i.setStart(h.node,h.offset),t.removeAllRanges(),x>d?(t.addRange(i),t.extend(k.node,k.offset)):(i.setEnd(k.node,k.offset),t.addRange(i)))}}for(i=[],t=o;t=t.parentNode;)t.nodeType===1&&i.push({element:t,left:t.scrollLeft,top:t.scrollTop});for(typeof o.focus=="function"&&o.focus(),o=0;o<i.length;o++)t=i[o],t.element.scrollLeft=t.left,t.element.scrollTop=t.top}}var ob=f&&"documentMode"in document&&11>=document.documentMode,zi=null,$l=null,Ps=null,Hl=!1;function pf(t,i,o){var d=o.window===o?o.document:o.nodeType===9?o:o.ownerDocument;Hl||zi==null||zi!==ke(d)||(d=zi,"selectionStart"in d&&Ul(d)?d={start:d.selectionStart,end:d.selectionEnd}:(d=(d.ownerDocument&&d.ownerDocument.defaultView||window).getSelection(),d={anchorNode:d.anchorNode,anchorOffset:d.anchorOffset,focusNode:d.focusNode,focusOffset:d.focusOffset}),Ps&&Ds(Ps,d)||(Ps=d,d=Ya($l,"onSelect"),0<d.length&&(i=new Ol("onSelect","select",null,i,o),t.push({event:i,listeners:d}),i.target=zi)))}function Wa(t,i){var o={};return o[t.toLowerCase()]=i.toLowerCase(),o["Webkit"+t]="webkit"+i,o["Moz"+t]="moz"+i,o}var Bi={animationend:Wa("Animation","AnimationEnd"),animationiteration:Wa("Animation","AnimationIteration"),animationstart:Wa("Animation","AnimationStart"),transitionend:Wa("Transition","TransitionEnd")},ql={},mf={};f&&(mf=document.createElement("div").style,"AnimationEvent"in window||(delete Bi.animationend.animation,delete Bi.animationiteration.animation,delete Bi.animationstart.animation),"TransitionEvent"in window||delete Bi.transitionend.transition);function Va(t){if(ql[t])return ql[t];if(!Bi[t])return t;var i=Bi[t],o;for(o in i)if(i.hasOwnProperty(o)&&o in mf)return ql[t]=i[o];return t}var hf=Va("animationend"),gf=Va("animationiteration"),yf=Va("animationstart"),xf=Va("transitionend"),bf=new Map,vf="abort auxClick 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(" ");function Lr(t,i){bf.set(t,i),c(i,[t])}for(var Kl=0;Kl<vf.length;Kl++){var Wl=vf[Kl],lb=Wl.toLowerCase(),cb=Wl[0].toUpperCase()+Wl.slice(1);Lr(lb,"on"+cb)}Lr(hf,"onAnimationEnd"),Lr(gf,"onAnimationIteration"),Lr(yf,"onAnimationStart"),Lr("dblclick","onDoubleClick"),Lr("focusin","onFocus"),Lr("focusout","onBlur"),Lr(xf,"onTransitionEnd"),u("onMouseEnter",["mouseout","mouseover"]),u("onMouseLeave",["mouseout","mouseover"]),u("onPointerEnter",["pointerout","pointerover"]),u("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Fs="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(" "),ub=new Set("cancel close invalid load scroll toggle".split(" ").concat(Fs));function wf(t,i,o){var d=t.type||"unknown-event";t.currentTarget=o,Sl(d,i,void 0,t),t.currentTarget=null}function _f(t,i){i=(i&4)!==0;for(var o=0;o<t.length;o++){var d=t[o],h=d.event;d=d.listeners;e:{var x=void 0;if(i)for(var k=d.length-1;0<=k;k--){var I=d[k],z=I.instance,ie=I.currentTarget;if(I=I.listener,z!==x&&h.isPropagationStopped())break e;wf(h,I,ie),x=z}else for(k=0;k<d.length;k++){if(I=d[k],z=I.instance,ie=I.currentTarget,I=I.listener,z!==x&&h.isPropagationStopped())break e;wf(h,I,ie),x=z}}}if(Ar)throw t=ti,Ar=!1,ti=null,t}function At(t,i){var o=i[ec];o===void 0&&(o=i[ec]=new Set);var d=t+"__bubble";o.has(d)||(kf(i,t,2,!1),o.add(d))}function Vl(t,i,o){var d=0;i&&(d|=4),kf(o,t,d,i)}var Ga="_reactListening"+Math.random().toString(36).slice(2);function zs(t){if(!t[Ga]){t[Ga]=!0,s.forEach(function(o){o!=="selectionchange"&&(ub.has(o)||Vl(o,!1,t),Vl(o,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Ga]||(i[Ga]=!0,Vl("selectionchange",!1,i))}}function kf(t,i,o,d){switch(Kd(i)){case 1:var h=Ex;break;case 4:h=Sx;break;default:h=Ml}o=h.bind(null,i,o,t),h=void 0,!Me||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),d?h!==void 0?t.addEventListener(i,o,{capture:!0,passive:h}):t.addEventListener(i,o,!0):h!==void 0?t.addEventListener(i,o,{passive:h}):t.addEventListener(i,o,!1)}function Gl(t,i,o,d,h){var x=d;if((i&1)===0&&(i&2)===0&&d!==null)e:for(;;){if(d===null)return;var k=d.tag;if(k===3||k===4){var I=d.stateNode.containerInfo;if(I===h||I.nodeType===8&&I.parentNode===h)break;if(k===4)for(k=d.return;k!==null;){var z=k.tag;if((z===3||z===4)&&(z=k.stateNode.containerInfo,z===h||z.nodeType===8&&z.parentNode===h))return;k=k.return}for(;I!==null;){if(k=oi(I),k===null)return;if(z=k.tag,z===5||z===6){d=x=k;continue e}I=I.parentNode}}d=d.return}Rt(function(){var ie=x,he=Ri(o),ye=[];e:{var me=bf.get(t);if(me!==void 0){var Te=Ol,Le=t;switch(t){case"keypress":if($a(o)===0)break e;case"keydown":case"keyup":Te=Bx;break;case"focusin":Le="focus",Te=Dl;break;case"focusout":Le="blur",Te=Dl;break;case"beforeblur":case"afterblur":Te=Dl;break;case"click":if(o.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Te=Gd;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Te=Tx;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Te=Hx;break;case hf:case gf:case yf:Te=Rx;break;case xf:Te=Kx;break;case"scroll":Te=Nx;break;case"wheel":Te=Vx;break;case"copy":case"cut":case"paste":Te=Ox;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Te=Xd}var De=(i&4)!==0,Ut=!De&&t==="scroll",Y=De?me!==null?me+"Capture":null:me;De=[];for(var U=ie,te;U!==null;){te=U;var _e=te.stateNode;if(te.tag===5&&_e!==null&&(te=_e,Y!==null&&(_e=Re(U,Y),_e!=null&&De.push(Bs(U,_e,te)))),Ut)break;U=U.return}0<De.length&&(me=new Te(me,Le,null,o,he),ye.push({event:me,listeners:De}))}}if((i&7)===0){e:{if(me=t==="mouseover"||t==="pointerover",Te=t==="mouseout"||t==="pointerout",me&&o!==nn&&(Le=o.relatedTarget||o.fromElement)&&(oi(Le)||Le[xr]))break e;if((Te||me)&&(me=he.window===he?he:(me=he.ownerDocument)?me.defaultView||me.parentWindow:window,Te?(Le=o.relatedTarget||o.toElement,Te=ie,Le=Le?oi(Le):null,Le!==null&&(Ut=yr(Le),Le!==Ut||Le.tag!==5&&Le.tag!==6)&&(Le=null)):(Te=null,Le=ie),Te!==Le)){if(De=Gd,_e="onMouseLeave",Y="onMouseEnter",U="mouse",(t==="pointerout"||t==="pointerover")&&(De=Xd,_e="onPointerLeave",Y="onPointerEnter",U="pointer"),Ut=Te==null?me:Hi(Te),te=Le==null?me:Hi(Le),me=new De(_e,U+"leave",Te,o,he),me.target=Ut,me.relatedTarget=te,_e=null,oi(he)===ie&&(De=new De(Y,U+"enter",Le,o,he),De.target=te,De.relatedTarget=Ut,_e=De),Ut=_e,Te&&Le)t:{for(De=Te,Y=Le,U=0,te=De;te;te=Ui(te))U++;for(te=0,_e=Y;_e;_e=Ui(_e))te++;for(;0<U-te;)De=Ui(De),U--;for(;0<te-U;)Y=Ui(Y),te--;for(;U--;){if(De===Y||Y!==null&&De===Y.alternate)break t;De=Ui(De),Y=Ui(Y)}De=null}else De=null;Te!==null&&Ef(ye,me,Te,De,!1),Le!==null&&Ut!==null&&Ef(ye,Ut,Le,De,!0)}}e:{if(me=ie?Hi(ie):window,Te=me.nodeName&&me.nodeName.toLowerCase(),Te==="select"||Te==="input"&&me.type==="file")var Fe=eb;else if(nf(me))if(sf)Fe=ib;else{Fe=nb;var He=tb}else(Te=me.nodeName)&&Te.toLowerCase()==="input"&&(me.type==="checkbox"||me.type==="radio")&&(Fe=rb);if(Fe&&(Fe=Fe(t,ie))){rf(ye,Fe,o,he);break e}He&&He(t,me,ie),t==="focusout"&&(He=me._wrapperState)&&He.controlled&&me.type==="number"&&se(me,"number",me.value)}switch(He=ie?Hi(ie):window,t){case"focusin":(nf(He)||He.contentEditable==="true")&&(zi=He,$l=ie,Ps=null);break;case"focusout":Ps=$l=zi=null;break;case"mousedown":Hl=!0;break;case"contextmenu":case"mouseup":case"dragend":Hl=!1,pf(ye,o,he);break;case"selectionchange":if(ob)break;case"keydown":case"keyup":pf(ye,o,he)}var qe;if(Fl)e:{switch(t){case"compositionstart":var Ye="onCompositionStart";break e;case"compositionend":Ye="onCompositionEnd";break e;case"compositionupdate":Ye="onCompositionUpdate";break e}Ye=void 0}else Fi?ef(t,o)&&(Ye="onCompositionEnd"):t==="keydown"&&o.keyCode===229&&(Ye="onCompositionStart");Ye&&(Qd&&o.locale!=="ko"&&(Fi||Ye!=="onCompositionStart"?Ye==="onCompositionEnd"&&Fi&&(qe=Wd()):(jr=he,Il="value"in jr?jr.value:jr.textContent,Fi=!0)),He=Ya(ie,Ye),0<He.length&&(Ye=new Yd(Ye,t,null,o,he),ye.push({event:Ye,listeners:He}),qe?Ye.data=qe:(qe=tf(o),qe!==null&&(Ye.data=qe)))),(qe=Yx?Xx(t,o):Qx(t,o))&&(ie=Ya(ie,"onBeforeInput"),0<ie.length&&(he=new Yd("onBeforeInput","beforeinput",null,o,he),ye.push({event:he,listeners:ie}),he.data=qe))}_f(ye,i)})}function Bs(t,i,o){return{instance:t,listener:i,currentTarget:o}}function Ya(t,i){for(var o=i+"Capture",d=[];t!==null;){var h=t,x=h.stateNode;h.tag===5&&x!==null&&(h=x,x=Re(t,o),x!=null&&d.unshift(Bs(t,x,h)),x=Re(t,i),x!=null&&d.push(Bs(t,x,h))),t=t.return}return d}function Ui(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5);return t||null}function Ef(t,i,o,d,h){for(var x=i._reactName,k=[];o!==null&&o!==d;){var I=o,z=I.alternate,ie=I.stateNode;if(z!==null&&z===d)break;I.tag===5&&ie!==null&&(I=ie,h?(z=Re(o,x),z!=null&&k.unshift(Bs(o,z,I))):h||(z=Re(o,x),z!=null&&k.push(Bs(o,z,I)))),o=o.return}k.length!==0&&t.push({event:i,listeners:k})}var db=/\r\n?/g,fb=/\u0000|\uFFFD/g;function Sf(t){return(typeof t=="string"?t:""+t).replace(db,`
|
|
38
|
-
`).replace(fb,"")}function Xa(t,i,o){if(i=Sf(i),Sf(t)!==i&&o)throw Error(r(425))}function Qa(){}var Yl=null,Xl=null;function Ql(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var Zl=typeof setTimeout=="function"?setTimeout:void 0,pb=typeof clearTimeout=="function"?clearTimeout:void 0,Nf=typeof Promise=="function"?Promise:void 0,mb=typeof queueMicrotask=="function"?queueMicrotask:typeof Nf<"u"?function(t){return Nf.resolve(null).then(t).catch(hb)}:Zl;function hb(t){setTimeout(function(){throw t})}function Jl(t,i){var o=i,d=0;do{var h=o.nextSibling;if(t.removeChild(o),h&&h.nodeType===8)if(o=h.data,o==="/$"){if(d===0){t.removeChild(h),Ms(i);return}d--}else o!=="$"&&o!=="$?"&&o!=="$!"||d++;o=h}while(o);Ms(i)}function Dr(t){for(;t!=null;t=t.nextSibling){var i=t.nodeType;if(i===1||i===3)break;if(i===8){if(i=t.data,i==="$"||i==="$!"||i==="$?")break;if(i==="/$")return null}}return t}function Cf(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var o=t.data;if(o==="$"||o==="$!"||o==="$?"){if(i===0)return t;i--}else o==="/$"&&i++}t=t.previousSibling}return null}var $i=Math.random().toString(36).slice(2),or="__reactFiber$"+$i,Us="__reactProps$"+$i,xr="__reactContainer$"+$i,ec="__reactEvents$"+$i,gb="__reactListeners$"+$i,yb="__reactHandles$"+$i;function oi(t){var i=t[or];if(i)return i;for(var o=t.parentNode;o;){if(i=o[xr]||o[or]){if(o=i.alternate,i.child!==null||o!==null&&o.child!==null)for(t=Cf(t);t!==null;){if(o=t[or])return o;t=Cf(t)}return i}t=o,o=t.parentNode}return null}function $s(t){return t=t[or]||t[xr],!t||t.tag!==5&&t.tag!==6&&t.tag!==13&&t.tag!==3?null:t}function Hi(t){if(t.tag===5||t.tag===6)return t.stateNode;throw Error(r(33))}function Za(t){return t[Us]||null}var tc=[],qi=-1;function Pr(t){return{current:t}}function Mt(t){0>qi||(t.current=tc[qi],tc[qi]=null,qi--)}function Ct(t,i){qi++,tc[qi]=t.current,t.current=i}var Fr={},on=Pr(Fr),wn=Pr(!1),li=Fr;function Ki(t,i){var o=t.type.contextTypes;if(!o)return Fr;var d=t.stateNode;if(d&&d.__reactInternalMemoizedUnmaskedChildContext===i)return d.__reactInternalMemoizedMaskedChildContext;var h={},x;for(x in o)h[x]=i[x];return d&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=i,t.__reactInternalMemoizedMaskedChildContext=h),h}function _n(t){return t=t.childContextTypes,t!=null}function Ja(){Mt(wn),Mt(on)}function Tf(t,i,o){if(on.current!==Fr)throw Error(r(168));Ct(on,i),Ct(wn,o)}function Af(t,i,o){var d=t.stateNode;if(i=i.childContextTypes,typeof d.getChildContext!="function")return o;d=d.getChildContext();for(var h in d)if(!(h in i))throw Error(r(108,$(t)||"Unknown",h));return C({},o,d)}function eo(t){return t=(t=t.stateNode)&&t.__reactInternalMemoizedMergedChildContext||Fr,li=on.current,Ct(on,t),Ct(wn,wn.current),!0}function Mf(t,i,o){var d=t.stateNode;if(!d)throw Error(r(169));o?(t=Af(t,i,li),d.__reactInternalMemoizedMergedChildContext=t,Mt(wn),Mt(on),Ct(on,t)):Mt(wn),Ct(wn,o)}var br=null,to=!1,nc=!1;function Rf(t){br===null?br=[t]:br.push(t)}function xb(t){to=!0,Rf(t)}function zr(){if(!nc&&br!==null){nc=!0;var t=0,i=mt;try{var o=br;for(mt=1;t<o.length;t++){var d=o[t];do d=d(!0);while(d!==null)}br=null,to=!1}catch(h){throw br!==null&&(br=br.slice(t+1)),Oa(Es,zr),h}finally{mt=i,nc=!1}}return null}var Wi=[],Vi=0,no=null,ro=0,Bn=[],Un=0,ci=null,vr=1,wr="";function ui(t,i){Wi[Vi++]=ro,Wi[Vi++]=no,no=t,ro=i}function If(t,i,o){Bn[Un++]=vr,Bn[Un++]=wr,Bn[Un++]=ci,ci=t;var d=vr;t=wr;var h=32-jt(d)-1;d&=~(1<<h),o+=1;var x=32-jt(i)+h;if(30<x){var k=h-h%5;x=(d&(1<<k)-1).toString(32),d>>=k,h-=k,vr=1<<32-jt(i)+h|o<<h|d,wr=x+t}else vr=1<<x|o<<h|d,wr=t}function rc(t){t.return!==null&&(ui(t,1),If(t,1,0))}function ic(t){for(;t===no;)no=Wi[--Vi],Wi[Vi]=null,ro=Wi[--Vi],Wi[Vi]=null;for(;t===ci;)ci=Bn[--Un],Bn[Un]=null,wr=Bn[--Un],Bn[Un]=null,vr=Bn[--Un],Bn[Un]=null}var Rn=null,In=null,It=!1,Zn=null;function Of(t,i){var o=Kn(5,null,null,0);o.elementType="DELETED",o.stateNode=i,o.return=t,i=t.deletions,i===null?(t.deletions=[o],t.flags|=16):i.push(o)}function jf(t,i){switch(t.tag){case 5:var o=t.type;return i=i.nodeType!==1||o.toLowerCase()!==i.nodeName.toLowerCase()?null:i,i!==null?(t.stateNode=i,Rn=t,In=Dr(i.firstChild),!0):!1;case 6:return i=t.pendingProps===""||i.nodeType!==3?null:i,i!==null?(t.stateNode=i,Rn=t,In=null,!0):!1;case 13:return i=i.nodeType!==8?null:i,i!==null?(o=ci!==null?{id:vr,overflow:wr}:null,t.memoizedState={dehydrated:i,treeContext:o,retryLane:1073741824},o=Kn(18,null,null,0),o.stateNode=i,o.return=t,t.child=o,Rn=t,In=null,!0):!1;default:return!1}}function sc(t){return(t.mode&1)!==0&&(t.flags&128)===0}function ac(t){if(It){var i=In;if(i){var o=i;if(!jf(t,i)){if(sc(t))throw Error(r(418));i=Dr(o.nextSibling);var d=Rn;i&&jf(t,i)?Of(d,o):(t.flags=t.flags&-4097|2,It=!1,Rn=t)}}else{if(sc(t))throw Error(r(418));t.flags=t.flags&-4097|2,It=!1,Rn=t}}}function Lf(t){for(t=t.return;t!==null&&t.tag!==5&&t.tag!==3&&t.tag!==13;)t=t.return;Rn=t}function io(t){if(t!==Rn)return!1;if(!It)return Lf(t),It=!0,!1;var i;if((i=t.tag!==3)&&!(i=t.tag!==5)&&(i=t.type,i=i!=="head"&&i!=="body"&&!Ql(t.type,t.memoizedProps)),i&&(i=In)){if(sc(t))throw Df(),Error(r(418));for(;i;)Of(t,i),i=Dr(i.nextSibling)}if(Lf(t),t.tag===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));e:{for(t=t.nextSibling,i=0;t;){if(t.nodeType===8){var o=t.data;if(o==="/$"){if(i===0){In=Dr(t.nextSibling);break e}i--}else o!=="$"&&o!=="$!"&&o!=="$?"||i++}t=t.nextSibling}In=null}}else In=Rn?Dr(t.stateNode.nextSibling):null;return!0}function Df(){for(var t=In;t;)t=Dr(t.nextSibling)}function Gi(){In=Rn=null,It=!1}function oc(t){Zn===null?Zn=[t]:Zn.push(t)}var bb=G.ReactCurrentBatchConfig;function Hs(t,i,o){if(t=o.ref,t!==null&&typeof t!="function"&&typeof t!="object"){if(o._owner){if(o=o._owner,o){if(o.tag!==1)throw Error(r(309));var d=o.stateNode}if(!d)throw Error(r(147,t));var h=d,x=""+t;return i!==null&&i.ref!==null&&typeof i.ref=="function"&&i.ref._stringRef===x?i.ref:(i=function(k){var I=h.refs;k===null?delete I[x]:I[x]=k},i._stringRef=x,i)}if(typeof t!="string")throw Error(r(284));if(!o._owner)throw Error(r(290,t))}return t}function so(t,i){throw t=Object.prototype.toString.call(i),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t))}function Pf(t){var i=t._init;return i(t._payload)}function Ff(t){function i(Y,U){if(t){var te=Y.deletions;te===null?(Y.deletions=[U],Y.flags|=16):te.push(U)}}function o(Y,U){if(!t)return null;for(;U!==null;)i(Y,U),U=U.sibling;return null}function d(Y,U){for(Y=new Map;U!==null;)U.key!==null?Y.set(U.key,U):Y.set(U.index,U),U=U.sibling;return Y}function h(Y,U){return Y=Vr(Y,U),Y.index=0,Y.sibling=null,Y}function x(Y,U,te){return Y.index=te,t?(te=Y.alternate,te!==null?(te=te.index,te<U?(Y.flags|=2,U):te):(Y.flags|=2,U)):(Y.flags|=1048576,U)}function k(Y){return t&&Y.alternate===null&&(Y.flags|=2),Y}function I(Y,U,te,_e){return U===null||U.tag!==6?(U=Zc(te,Y.mode,_e),U.return=Y,U):(U=h(U,te),U.return=Y,U)}function z(Y,U,te,_e){var Fe=te.type;return Fe===W?he(Y,U,te.props.children,_e,te.key):U!==null&&(U.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===Z&&Pf(Fe)===U.type)?(_e=h(U,te.props),_e.ref=Hs(Y,U,te),_e.return=Y,_e):(_e=Mo(te.type,te.key,te.props,null,Y.mode,_e),_e.ref=Hs(Y,U,te),_e.return=Y,_e)}function ie(Y,U,te,_e){return U===null||U.tag!==4||U.stateNode.containerInfo!==te.containerInfo||U.stateNode.implementation!==te.implementation?(U=Jc(te,Y.mode,_e),U.return=Y,U):(U=h(U,te.children||[]),U.return=Y,U)}function he(Y,U,te,_e,Fe){return U===null||U.tag!==7?(U=xi(te,Y.mode,_e,Fe),U.return=Y,U):(U=h(U,te),U.return=Y,U)}function ye(Y,U,te){if(typeof U=="string"&&U!==""||typeof U=="number")return U=Zc(""+U,Y.mode,te),U.return=Y,U;if(typeof U=="object"&&U!==null){switch(U.$$typeof){case P:return te=Mo(U.type,U.key,U.props,null,Y.mode,te),te.ref=Hs(Y,null,U),te.return=Y,te;case M:return U=Jc(U,Y.mode,te),U.return=Y,U;case Z:var _e=U._init;return ye(Y,_e(U._payload),te)}if(je(U)||ue(U))return U=xi(U,Y.mode,te,null),U.return=Y,U;so(Y,U)}return null}function me(Y,U,te,_e){var Fe=U!==null?U.key:null;if(typeof te=="string"&&te!==""||typeof te=="number")return Fe!==null?null:I(Y,U,""+te,_e);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case P:return te.key===Fe?z(Y,U,te,_e):null;case M:return te.key===Fe?ie(Y,U,te,_e):null;case Z:return Fe=te._init,me(Y,U,Fe(te._payload),_e)}if(je(te)||ue(te))return Fe!==null?null:he(Y,U,te,_e,null);so(Y,te)}return null}function Te(Y,U,te,_e,Fe){if(typeof _e=="string"&&_e!==""||typeof _e=="number")return Y=Y.get(te)||null,I(U,Y,""+_e,Fe);if(typeof _e=="object"&&_e!==null){switch(_e.$$typeof){case P:return Y=Y.get(_e.key===null?te:_e.key)||null,z(U,Y,_e,Fe);case M:return Y=Y.get(_e.key===null?te:_e.key)||null,ie(U,Y,_e,Fe);case Z:var He=_e._init;return Te(Y,U,te,He(_e._payload),Fe)}if(je(_e)||ue(_e))return Y=Y.get(te)||null,he(U,Y,_e,Fe,null);so(U,_e)}return null}function Le(Y,U,te,_e){for(var Fe=null,He=null,qe=U,Ye=U=0,Jt=null;qe!==null&&Ye<te.length;Ye++){qe.index>Ye?(Jt=qe,qe=null):Jt=qe.sibling;var gt=me(Y,qe,te[Ye],_e);if(gt===null){qe===null&&(qe=Jt);break}t&&qe&>.alternate===null&&i(Y,qe),U=x(gt,U,Ye),He===null?Fe=gt:He.sibling=gt,He=gt,qe=Jt}if(Ye===te.length)return o(Y,qe),It&&ui(Y,Ye),Fe;if(qe===null){for(;Ye<te.length;Ye++)qe=ye(Y,te[Ye],_e),qe!==null&&(U=x(qe,U,Ye),He===null?Fe=qe:He.sibling=qe,He=qe);return It&&ui(Y,Ye),Fe}for(qe=d(Y,qe);Ye<te.length;Ye++)Jt=Te(qe,Y,Ye,te[Ye],_e),Jt!==null&&(t&&Jt.alternate!==null&&qe.delete(Jt.key===null?Ye:Jt.key),U=x(Jt,U,Ye),He===null?Fe=Jt:He.sibling=Jt,He=Jt);return t&&qe.forEach(function(Gr){return i(Y,Gr)}),It&&ui(Y,Ye),Fe}function De(Y,U,te,_e){var Fe=ue(te);if(typeof Fe!="function")throw Error(r(150));if(te=Fe.call(te),te==null)throw Error(r(151));for(var He=Fe=null,qe=U,Ye=U=0,Jt=null,gt=te.next();qe!==null&&!gt.done;Ye++,gt=te.next()){qe.index>Ye?(Jt=qe,qe=null):Jt=qe.sibling;var Gr=me(Y,qe,gt.value,_e);if(Gr===null){qe===null&&(qe=Jt);break}t&&qe&&Gr.alternate===null&&i(Y,qe),U=x(Gr,U,Ye),He===null?Fe=Gr:He.sibling=Gr,He=Gr,qe=Jt}if(gt.done)return o(Y,qe),It&&ui(Y,Ye),Fe;if(qe===null){for(;!gt.done;Ye++,gt=te.next())gt=ye(Y,gt.value,_e),gt!==null&&(U=x(gt,U,Ye),He===null?Fe=gt:He.sibling=gt,He=gt);return It&&ui(Y,Ye),Fe}for(qe=d(Y,qe);!gt.done;Ye++,gt=te.next())gt=Te(qe,Y,Ye,gt.value,_e),gt!==null&&(t&>.alternate!==null&&qe.delete(gt.key===null?Ye:gt.key),U=x(gt,U,Ye),He===null?Fe=gt:He.sibling=gt,He=gt);return t&&qe.forEach(function(Zb){return i(Y,Zb)}),It&&ui(Y,Ye),Fe}function Ut(Y,U,te,_e){if(typeof te=="object"&&te!==null&&te.type===W&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case P:e:{for(var Fe=te.key,He=U;He!==null;){if(He.key===Fe){if(Fe=te.type,Fe===W){if(He.tag===7){o(Y,He.sibling),U=h(He,te.props.children),U.return=Y,Y=U;break e}}else if(He.elementType===Fe||typeof Fe=="object"&&Fe!==null&&Fe.$$typeof===Z&&Pf(Fe)===He.type){o(Y,He.sibling),U=h(He,te.props),U.ref=Hs(Y,He,te),U.return=Y,Y=U;break e}o(Y,He);break}else i(Y,He);He=He.sibling}te.type===W?(U=xi(te.props.children,Y.mode,_e,te.key),U.return=Y,Y=U):(_e=Mo(te.type,te.key,te.props,null,Y.mode,_e),_e.ref=Hs(Y,U,te),_e.return=Y,Y=_e)}return k(Y);case M:e:{for(He=te.key;U!==null;){if(U.key===He)if(U.tag===4&&U.stateNode.containerInfo===te.containerInfo&&U.stateNode.implementation===te.implementation){o(Y,U.sibling),U=h(U,te.children||[]),U.return=Y,Y=U;break e}else{o(Y,U);break}else i(Y,U);U=U.sibling}U=Jc(te,Y.mode,_e),U.return=Y,Y=U}return k(Y);case Z:return He=te._init,Ut(Y,U,He(te._payload),_e)}if(je(te))return Le(Y,U,te,_e);if(ue(te))return De(Y,U,te,_e);so(Y,te)}return typeof te=="string"&&te!==""||typeof te=="number"?(te=""+te,U!==null&&U.tag===6?(o(Y,U.sibling),U=h(U,te),U.return=Y,Y=U):(o(Y,U),U=Zc(te,Y.mode,_e),U.return=Y,Y=U),k(Y)):o(Y,U)}return Ut}var Yi=Ff(!0),zf=Ff(!1),ao=Pr(null),oo=null,Xi=null,lc=null;function cc(){lc=Xi=oo=null}function uc(t){var i=ao.current;Mt(ao),t._currentValue=i}function dc(t,i,o){for(;t!==null;){var d=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,d!==null&&(d.childLanes|=i)):d!==null&&(d.childLanes&i)!==i&&(d.childLanes|=i),t===o)break;t=t.return}}function Qi(t,i){oo=t,lc=Xi=null,t=t.dependencies,t!==null&&t.firstContext!==null&&((t.lanes&i)!==0&&(kn=!0),t.firstContext=null)}function $n(t){var i=t._currentValue;if(lc!==t)if(t={context:t,memoizedValue:i,next:null},Xi===null){if(oo===null)throw Error(r(308));Xi=t,oo.dependencies={lanes:0,firstContext:t}}else Xi=Xi.next=t;return i}var di=null;function fc(t){di===null?di=[t]:di.push(t)}function Bf(t,i,o,d){var h=i.interleaved;return h===null?(o.next=o,fc(i)):(o.next=h.next,h.next=o),i.interleaved=o,_r(t,d)}function _r(t,i){t.lanes|=i;var o=t.alternate;for(o!==null&&(o.lanes|=i),o=t,t=t.return;t!==null;)t.childLanes|=i,o=t.alternate,o!==null&&(o.childLanes|=i),o=t,t=t.return;return o.tag===3?o.stateNode:null}var Br=!1;function pc(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function Uf(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,effects:t.effects})}function kr(t,i){return{eventTime:t,lane:i,tag:0,payload:null,callback:null,next:null}}function Ur(t,i,o){var d=t.updateQueue;if(d===null)return null;if(d=d.shared,(ht&2)!==0){var h=d.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),d.pending=i,_r(t,o)}return h=d.interleaved,h===null?(i.next=i,fc(d)):(i.next=h.next,h.next=i),d.interleaved=i,_r(t,o)}function lo(t,i,o){if(i=i.updateQueue,i!==null&&(i=i.shared,(o&4194240)!==0)){var d=i.lanes;d&=t.pendingLanes,o|=d,i.lanes=o,Ns(t,o)}}function $f(t,i){var o=t.updateQueue,d=t.alternate;if(d!==null&&(d=d.updateQueue,o===d)){var h=null,x=null;if(o=o.firstBaseUpdate,o!==null){do{var k={eventTime:o.eventTime,lane:o.lane,tag:o.tag,payload:o.payload,callback:o.callback,next:null};x===null?h=x=k:x=x.next=k,o=o.next}while(o!==null);x===null?h=x=i:x=x.next=i}else h=x=i;o={baseState:d.baseState,firstBaseUpdate:h,lastBaseUpdate:x,shared:d.shared,effects:d.effects},t.updateQueue=o;return}t=o.lastBaseUpdate,t===null?o.firstBaseUpdate=i:t.next=i,o.lastBaseUpdate=i}function co(t,i,o,d){var h=t.updateQueue;Br=!1;var x=h.firstBaseUpdate,k=h.lastBaseUpdate,I=h.shared.pending;if(I!==null){h.shared.pending=null;var z=I,ie=z.next;z.next=null,k===null?x=ie:k.next=ie,k=z;var he=t.alternate;he!==null&&(he=he.updateQueue,I=he.lastBaseUpdate,I!==k&&(I===null?he.firstBaseUpdate=ie:I.next=ie,he.lastBaseUpdate=z))}if(x!==null){var ye=h.baseState;k=0,he=ie=z=null,I=x;do{var me=I.lane,Te=I.eventTime;if((d&me)===me){he!==null&&(he=he.next={eventTime:Te,lane:0,tag:I.tag,payload:I.payload,callback:I.callback,next:null});e:{var Le=t,De=I;switch(me=i,Te=o,De.tag){case 1:if(Le=De.payload,typeof Le=="function"){ye=Le.call(Te,ye,me);break e}ye=Le;break e;case 3:Le.flags=Le.flags&-65537|128;case 0:if(Le=De.payload,me=typeof Le=="function"?Le.call(Te,ye,me):Le,me==null)break e;ye=C({},ye,me);break e;case 2:Br=!0}}I.callback!==null&&I.lane!==0&&(t.flags|=64,me=h.effects,me===null?h.effects=[I]:me.push(I))}else Te={eventTime:Te,lane:me,tag:I.tag,payload:I.payload,callback:I.callback,next:null},he===null?(ie=he=Te,z=ye):he=he.next=Te,k|=me;if(I=I.next,I===null){if(I=h.shared.pending,I===null)break;me=I,I=me.next,me.next=null,h.lastBaseUpdate=me,h.shared.pending=null}}while(!0);if(he===null&&(z=ye),h.baseState=z,h.firstBaseUpdate=ie,h.lastBaseUpdate=he,i=h.shared.interleaved,i!==null){h=i;do k|=h.lane,h=h.next;while(h!==i)}else x===null&&(h.shared.lanes=0);mi|=k,t.lanes=k,t.memoizedState=ye}}function Hf(t,i,o){if(t=i.effects,i.effects=null,t!==null)for(i=0;i<t.length;i++){var d=t[i],h=d.callback;if(h!==null){if(d.callback=null,d=o,typeof h!="function")throw Error(r(191,h));h.call(d)}}}var qs={},lr=Pr(qs),Ks=Pr(qs),Ws=Pr(qs);function fi(t){if(t===qs)throw Error(r(174));return t}function mc(t,i){switch(Ct(Ws,i),Ct(Ks,t),Ct(lr,qs),t=i.nodeType,t){case 9:case 11:i=(i=i.documentElement)?i.namespaceURI:xe(null,"");break;default:t=t===8?i.parentNode:i,i=t.namespaceURI||null,t=t.tagName,i=xe(i,t)}Mt(lr),Ct(lr,i)}function Zi(){Mt(lr),Mt(Ks),Mt(Ws)}function qf(t){fi(Ws.current);var i=fi(lr.current),o=xe(i,t.type);i!==o&&(Ct(Ks,t),Ct(lr,o))}function hc(t){Ks.current===t&&(Mt(lr),Mt(Ks))}var Lt=Pr(0);function uo(t){for(var i=t;i!==null;){if(i.tag===13){var o=i.memoizedState;if(o!==null&&(o=o.dehydrated,o===null||o.data==="$?"||o.data==="$!"))return i}else if(i.tag===19&&i.memoizedProps.revealOrder!==void 0){if((i.flags&128)!==0)return i}else if(i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return null;i=i.return}i.sibling.return=i.return,i=i.sibling}return null}var gc=[];function yc(){for(var t=0;t<gc.length;t++)gc[t]._workInProgressVersionPrimary=null;gc.length=0}var fo=G.ReactCurrentDispatcher,xc=G.ReactCurrentBatchConfig,pi=0,Dt=null,Gt=null,Qt=null,po=!1,Vs=!1,Gs=0,vb=0;function ln(){throw Error(r(321))}function bc(t,i){if(i===null)return!1;for(var o=0;o<i.length&&o<t.length;o++)if(!Qn(t[o],i[o]))return!1;return!0}function vc(t,i,o,d,h,x){if(pi=x,Dt=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,fo.current=t===null||t.memoizedState===null?Eb:Sb,t=o(d,h),Vs){x=0;do{if(Vs=!1,Gs=0,25<=x)throw Error(r(301));x+=1,Qt=Gt=null,i.updateQueue=null,fo.current=Nb,t=o(d,h)}while(Vs)}if(fo.current=go,i=Gt!==null&&Gt.next!==null,pi=0,Qt=Gt=Dt=null,po=!1,i)throw Error(r(300));return t}function wc(){var t=Gs!==0;return Gs=0,t}function cr(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Qt===null?Dt.memoizedState=Qt=t:Qt=Qt.next=t,Qt}function Hn(){if(Gt===null){var t=Dt.alternate;t=t!==null?t.memoizedState:null}else t=Gt.next;var i=Qt===null?Dt.memoizedState:Qt.next;if(i!==null)Qt=i,Gt=t;else{if(t===null)throw Error(r(310));Gt=t,t={memoizedState:Gt.memoizedState,baseState:Gt.baseState,baseQueue:Gt.baseQueue,queue:Gt.queue,next:null},Qt===null?Dt.memoizedState=Qt=t:Qt=Qt.next=t}return Qt}function Ys(t,i){return typeof i=="function"?i(t):i}function _c(t){var i=Hn(),o=i.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=t;var d=Gt,h=d.baseQueue,x=o.pending;if(x!==null){if(h!==null){var k=h.next;h.next=x.next,x.next=k}d.baseQueue=h=x,o.pending=null}if(h!==null){x=h.next,d=d.baseState;var I=k=null,z=null,ie=x;do{var he=ie.lane;if((pi&he)===he)z!==null&&(z=z.next={lane:0,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null}),d=ie.hasEagerState?ie.eagerState:t(d,ie.action);else{var ye={lane:he,action:ie.action,hasEagerState:ie.hasEagerState,eagerState:ie.eagerState,next:null};z===null?(I=z=ye,k=d):z=z.next=ye,Dt.lanes|=he,mi|=he}ie=ie.next}while(ie!==null&&ie!==x);z===null?k=d:z.next=I,Qn(d,i.memoizedState)||(kn=!0),i.memoizedState=d,i.baseState=k,i.baseQueue=z,o.lastRenderedState=d}if(t=o.interleaved,t!==null){h=t;do x=h.lane,Dt.lanes|=x,mi|=x,h=h.next;while(h!==t)}else h===null&&(o.lanes=0);return[i.memoizedState,o.dispatch]}function kc(t){var i=Hn(),o=i.queue;if(o===null)throw Error(r(311));o.lastRenderedReducer=t;var d=o.dispatch,h=o.pending,x=i.memoizedState;if(h!==null){o.pending=null;var k=h=h.next;do x=t(x,k.action),k=k.next;while(k!==h);Qn(x,i.memoizedState)||(kn=!0),i.memoizedState=x,i.baseQueue===null&&(i.baseState=x),o.lastRenderedState=x}return[x,d]}function Kf(){}function Wf(t,i){var o=Dt,d=Hn(),h=i(),x=!Qn(d.memoizedState,h);if(x&&(d.memoizedState=h,kn=!0),d=d.queue,Ec(Yf.bind(null,o,d,t),[t]),d.getSnapshot!==i||x||Qt!==null&&Qt.memoizedState.tag&1){if(o.flags|=2048,Xs(9,Gf.bind(null,o,d,h,i),void 0,null),Zt===null)throw Error(r(349));(pi&30)!==0||Vf(o,i,h)}return h}function Vf(t,i,o){t.flags|=16384,t={getSnapshot:i,value:o},i=Dt.updateQueue,i===null?(i={lastEffect:null,stores:null},Dt.updateQueue=i,i.stores=[t]):(o=i.stores,o===null?i.stores=[t]:o.push(t))}function Gf(t,i,o,d){i.value=o,i.getSnapshot=d,Xf(i)&&Qf(t)}function Yf(t,i,o){return o(function(){Xf(i)&&Qf(t)})}function Xf(t){var i=t.getSnapshot;t=t.value;try{var o=i();return!Qn(t,o)}catch{return!0}}function Qf(t){var i=_r(t,1);i!==null&&nr(i,t,1,-1)}function Zf(t){var i=cr();return typeof t=="function"&&(t=t()),i.memoizedState=i.baseState=t,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:Ys,lastRenderedState:t},i.queue=t,t=t.dispatch=kb.bind(null,Dt,t),[i.memoizedState,t]}function Xs(t,i,o,d){return t={tag:t,create:i,destroy:o,deps:d,next:null},i=Dt.updateQueue,i===null?(i={lastEffect:null,stores:null},Dt.updateQueue=i,i.lastEffect=t.next=t):(o=i.lastEffect,o===null?i.lastEffect=t.next=t:(d=o.next,o.next=t,t.next=d,i.lastEffect=t)),t}function Jf(){return Hn().memoizedState}function mo(t,i,o,d){var h=cr();Dt.flags|=t,h.memoizedState=Xs(1|i,o,void 0,d===void 0?null:d)}function ho(t,i,o,d){var h=Hn();d=d===void 0?null:d;var x=void 0;if(Gt!==null){var k=Gt.memoizedState;if(x=k.destroy,d!==null&&bc(d,k.deps)){h.memoizedState=Xs(i,o,x,d);return}}Dt.flags|=t,h.memoizedState=Xs(1|i,o,x,d)}function ep(t,i){return mo(8390656,8,t,i)}function Ec(t,i){return ho(2048,8,t,i)}function tp(t,i){return ho(4,2,t,i)}function np(t,i){return ho(4,4,t,i)}function rp(t,i){if(typeof i=="function")return t=t(),i(t),function(){i(null)};if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function ip(t,i,o){return o=o!=null?o.concat([t]):null,ho(4,4,rp.bind(null,i,t),o)}function Sc(){}function sp(t,i){var o=Hn();i=i===void 0?null:i;var d=o.memoizedState;return d!==null&&i!==null&&bc(i,d[1])?d[0]:(o.memoizedState=[t,i],t)}function ap(t,i){var o=Hn();i=i===void 0?null:i;var d=o.memoizedState;return d!==null&&i!==null&&bc(i,d[1])?d[0]:(t=t(),o.memoizedState=[t,i],t)}function op(t,i,o){return(pi&21)===0?(t.baseState&&(t.baseState=!1,kn=!0),t.memoizedState=o):(Qn(o,i)||(o=Da(),Dt.lanes|=o,mi|=o,t.baseState=!0),i)}function wb(t,i){var o=mt;mt=o!==0&&4>o?o:4,t(!0);var d=xc.transition;xc.transition={};try{t(!1),i()}finally{mt=o,xc.transition=d}}function lp(){return Hn().memoizedState}function _b(t,i,o){var d=Kr(t);if(o={lane:d,action:o,hasEagerState:!1,eagerState:null,next:null},cp(t))up(i,o);else if(o=Bf(t,i,o,d),o!==null){var h=gn();nr(o,t,d,h),dp(o,i,d)}}function kb(t,i,o){var d=Kr(t),h={lane:d,action:o,hasEagerState:!1,eagerState:null,next:null};if(cp(t))up(i,h);else{var x=t.alternate;if(t.lanes===0&&(x===null||x.lanes===0)&&(x=i.lastRenderedReducer,x!==null))try{var k=i.lastRenderedState,I=x(k,o);if(h.hasEagerState=!0,h.eagerState=I,Qn(I,k)){var z=i.interleaved;z===null?(h.next=h,fc(i)):(h.next=z.next,z.next=h),i.interleaved=h;return}}catch{}finally{}o=Bf(t,i,h,d),o!==null&&(h=gn(),nr(o,t,d,h),dp(o,i,d))}}function cp(t){var i=t.alternate;return t===Dt||i!==null&&i===Dt}function up(t,i){Vs=po=!0;var o=t.pending;o===null?i.next=i:(i.next=o.next,o.next=i),t.pending=i}function dp(t,i,o){if((o&4194240)!==0){var d=i.lanes;d&=t.pendingLanes,o|=d,i.lanes=o,Ns(t,o)}}var go={readContext:$n,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useInsertionEffect:ln,useLayoutEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useMutableSource:ln,useSyncExternalStore:ln,useId:ln,unstable_isNewReconciler:!1},Eb={readContext:$n,useCallback:function(t,i){return cr().memoizedState=[t,i===void 0?null:i],t},useContext:$n,useEffect:ep,useImperativeHandle:function(t,i,o){return o=o!=null?o.concat([t]):null,mo(4194308,4,rp.bind(null,i,t),o)},useLayoutEffect:function(t,i){return mo(4194308,4,t,i)},useInsertionEffect:function(t,i){return mo(4,2,t,i)},useMemo:function(t,i){var o=cr();return i=i===void 0?null:i,t=t(),o.memoizedState=[t,i],t},useReducer:function(t,i,o){var d=cr();return i=o!==void 0?o(i):i,d.memoizedState=d.baseState=i,t={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:i},d.queue=t,t=t.dispatch=_b.bind(null,Dt,t),[d.memoizedState,t]},useRef:function(t){var i=cr();return t={current:t},i.memoizedState=t},useState:Zf,useDebugValue:Sc,useDeferredValue:function(t){return cr().memoizedState=t},useTransition:function(){var t=Zf(!1),i=t[0];return t=wb.bind(null,t[1]),cr().memoizedState=t,[i,t]},useMutableSource:function(){},useSyncExternalStore:function(t,i,o){var d=Dt,h=cr();if(It){if(o===void 0)throw Error(r(407));o=o()}else{if(o=i(),Zt===null)throw Error(r(349));(pi&30)!==0||Vf(d,i,o)}h.memoizedState=o;var x={value:o,getSnapshot:i};return h.queue=x,ep(Yf.bind(null,d,x,t),[t]),d.flags|=2048,Xs(9,Gf.bind(null,d,x,o,i),void 0,null),o},useId:function(){var t=cr(),i=Zt.identifierPrefix;if(It){var o=wr,d=vr;o=(d&~(1<<32-jt(d)-1)).toString(32)+o,i=":"+i+"R"+o,o=Gs++,0<o&&(i+="H"+o.toString(32)),i+=":"}else o=vb++,i=":"+i+"r"+o.toString(32)+":";return t.memoizedState=i},unstable_isNewReconciler:!1},Sb={readContext:$n,useCallback:sp,useContext:$n,useEffect:Ec,useImperativeHandle:ip,useInsertionEffect:tp,useLayoutEffect:np,useMemo:ap,useReducer:_c,useRef:Jf,useState:function(){return _c(Ys)},useDebugValue:Sc,useDeferredValue:function(t){var i=Hn();return op(i,Gt.memoizedState,t)},useTransition:function(){var t=_c(Ys)[0],i=Hn().memoizedState;return[t,i]},useMutableSource:Kf,useSyncExternalStore:Wf,useId:lp,unstable_isNewReconciler:!1},Nb={readContext:$n,useCallback:sp,useContext:$n,useEffect:Ec,useImperativeHandle:ip,useInsertionEffect:tp,useLayoutEffect:np,useMemo:ap,useReducer:kc,useRef:Jf,useState:function(){return kc(Ys)},useDebugValue:Sc,useDeferredValue:function(t){var i=Hn();return Gt===null?i.memoizedState=t:op(i,Gt.memoizedState,t)},useTransition:function(){var t=kc(Ys)[0],i=Hn().memoizedState;return[t,i]},useMutableSource:Kf,useSyncExternalStore:Wf,useId:lp,unstable_isNewReconciler:!1};function Jn(t,i){if(t&&t.defaultProps){i=C({},i),t=t.defaultProps;for(var o in t)i[o]===void 0&&(i[o]=t[o]);return i}return i}function Nc(t,i,o,d){i=t.memoizedState,o=o(d,i),o=o==null?i:C({},i,o),t.memoizedState=o,t.lanes===0&&(t.updateQueue.baseState=o)}var yo={isMounted:function(t){return(t=t._reactInternals)?yr(t)===t:!1},enqueueSetState:function(t,i,o){t=t._reactInternals;var d=gn(),h=Kr(t),x=kr(d,h);x.payload=i,o!=null&&(x.callback=o),i=Ur(t,x,h),i!==null&&(nr(i,t,h,d),lo(i,t,h))},enqueueReplaceState:function(t,i,o){t=t._reactInternals;var d=gn(),h=Kr(t),x=kr(d,h);x.tag=1,x.payload=i,o!=null&&(x.callback=o),i=Ur(t,x,h),i!==null&&(nr(i,t,h,d),lo(i,t,h))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var o=gn(),d=Kr(t),h=kr(o,d);h.tag=2,i!=null&&(h.callback=i),i=Ur(t,h,d),i!==null&&(nr(i,t,d,o),lo(i,t,d))}};function fp(t,i,o,d,h,x,k){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(d,x,k):i.prototype&&i.prototype.isPureReactComponent?!Ds(o,d)||!Ds(h,x):!0}function pp(t,i,o){var d=!1,h=Fr,x=i.contextType;return typeof x=="object"&&x!==null?x=$n(x):(h=_n(i)?li:on.current,d=i.contextTypes,x=(d=d!=null)?Ki(t,h):Fr),i=new i(o,x),t.memoizedState=i.state!==null&&i.state!==void 0?i.state:null,i.updater=yo,t.stateNode=i,i._reactInternals=t,d&&(t=t.stateNode,t.__reactInternalMemoizedUnmaskedChildContext=h,t.__reactInternalMemoizedMaskedChildContext=x),i}function mp(t,i,o,d){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(o,d),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(o,d),i.state!==t&&yo.enqueueReplaceState(i,i.state,null)}function Cc(t,i,o,d){var h=t.stateNode;h.props=o,h.state=t.memoizedState,h.refs={},pc(t);var x=i.contextType;typeof x=="object"&&x!==null?h.context=$n(x):(x=_n(i)?li:on.current,h.context=Ki(t,x)),h.state=t.memoizedState,x=i.getDerivedStateFromProps,typeof x=="function"&&(Nc(t,i,x,o),h.state=t.memoizedState),typeof i.getDerivedStateFromProps=="function"||typeof h.getSnapshotBeforeUpdate=="function"||typeof h.UNSAFE_componentWillMount!="function"&&typeof h.componentWillMount!="function"||(i=h.state,typeof h.componentWillMount=="function"&&h.componentWillMount(),typeof h.UNSAFE_componentWillMount=="function"&&h.UNSAFE_componentWillMount(),i!==h.state&&yo.enqueueReplaceState(h,h.state,null),co(t,o,h,d),h.state=t.memoizedState),typeof h.componentDidMount=="function"&&(t.flags|=4194308)}function Ji(t,i){try{var o="",d=i;do o+=re(d),d=d.return;while(d);var h=o}catch(x){h=`
|
|
39
|
-
Error generating stack: `+x.message+`
|
|
40
|
-
`+x.stack}return{value:t,source:i,stack:h,digest:null}}function Tc(t,i,o){return{value:t,source:null,stack:o??null,digest:i??null}}function Ac(t,i){try{console.error(i.value)}catch(o){setTimeout(function(){throw o})}}var Cb=typeof WeakMap=="function"?WeakMap:Map;function hp(t,i,o){o=kr(-1,o),o.tag=3,o.payload={element:null};var d=i.value;return o.callback=function(){Eo||(Eo=!0,qc=d),Ac(t,i)},o}function gp(t,i,o){o=kr(-1,o),o.tag=3;var d=t.type.getDerivedStateFromError;if(typeof d=="function"){var h=i.value;o.payload=function(){return d(h)},o.callback=function(){Ac(t,i)}}var x=t.stateNode;return x!==null&&typeof x.componentDidCatch=="function"&&(o.callback=function(){Ac(t,i),typeof d!="function"&&(Hr===null?Hr=new Set([this]):Hr.add(this));var k=i.stack;this.componentDidCatch(i.value,{componentStack:k!==null?k:""})}),o}function yp(t,i,o){var d=t.pingCache;if(d===null){d=t.pingCache=new Cb;var h=new Set;d.set(i,h)}else h=d.get(i),h===void 0&&(h=new Set,d.set(i,h));h.has(o)||(h.add(o),t=Ub.bind(null,t,i,o),i.then(t,t))}function xp(t){do{var i;if((i=t.tag===13)&&(i=t.memoizedState,i=i!==null?i.dehydrated!==null:!0),i)return t;t=t.return}while(t!==null);return null}function bp(t,i,o,d,h){return(t.mode&1)===0?(t===i?t.flags|=65536:(t.flags|=128,o.flags|=131072,o.flags&=-52805,o.tag===1&&(o.alternate===null?o.tag=17:(i=kr(-1,1),i.tag=2,Ur(o,i,1))),o.lanes|=1),t):(t.flags|=65536,t.lanes=h,t)}var Tb=G.ReactCurrentOwner,kn=!1;function hn(t,i,o,d){i.child=t===null?zf(i,null,o,d):Yi(i,t.child,o,d)}function vp(t,i,o,d,h){o=o.render;var x=i.ref;return Qi(i,h),d=vc(t,i,o,d,x,h),o=wc(),t!==null&&!kn?(i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~h,Er(t,i,h)):(It&&o&&rc(i),i.flags|=1,hn(t,i,d,h),i.child)}function wp(t,i,o,d,h){if(t===null){var x=o.type;return typeof x=="function"&&!Qc(x)&&x.defaultProps===void 0&&o.compare===null&&o.defaultProps===void 0?(i.tag=15,i.type=x,_p(t,i,x,d,h)):(t=Mo(o.type,null,d,i,i.mode,h),t.ref=i.ref,t.return=i,i.child=t)}if(x=t.child,(t.lanes&h)===0){var k=x.memoizedProps;if(o=o.compare,o=o!==null?o:Ds,o(k,d)&&t.ref===i.ref)return Er(t,i,h)}return i.flags|=1,t=Vr(x,d),t.ref=i.ref,t.return=i,i.child=t}function _p(t,i,o,d,h){if(t!==null){var x=t.memoizedProps;if(Ds(x,d)&&t.ref===i.ref)if(kn=!1,i.pendingProps=d=x,(t.lanes&h)!==0)(t.flags&131072)!==0&&(kn=!0);else return i.lanes=t.lanes,Er(t,i,h)}return Mc(t,i,o,d,h)}function kp(t,i,o){var d=i.pendingProps,h=d.children,x=t!==null?t.memoizedState:null;if(d.mode==="hidden")if((i.mode&1)===0)i.memoizedState={baseLanes:0,cachePool:null,transitions:null},Ct(ts,On),On|=o;else{if((o&1073741824)===0)return t=x!==null?x.baseLanes|o:o,i.lanes=i.childLanes=1073741824,i.memoizedState={baseLanes:t,cachePool:null,transitions:null},i.updateQueue=null,Ct(ts,On),On|=t,null;i.memoizedState={baseLanes:0,cachePool:null,transitions:null},d=x!==null?x.baseLanes:o,Ct(ts,On),On|=d}else x!==null?(d=x.baseLanes|o,i.memoizedState=null):d=o,Ct(ts,On),On|=d;return hn(t,i,h,o),i.child}function Ep(t,i){var o=i.ref;(t===null&&o!==null||t!==null&&t.ref!==o)&&(i.flags|=512,i.flags|=2097152)}function Mc(t,i,o,d,h){var x=_n(o)?li:on.current;return x=Ki(i,x),Qi(i,h),o=vc(t,i,o,d,x,h),d=wc(),t!==null&&!kn?(i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~h,Er(t,i,h)):(It&&d&&rc(i),i.flags|=1,hn(t,i,o,h),i.child)}function Sp(t,i,o,d,h){if(_n(o)){var x=!0;eo(i)}else x=!1;if(Qi(i,h),i.stateNode===null)bo(t,i),pp(i,o,d),Cc(i,o,d,h),d=!0;else if(t===null){var k=i.stateNode,I=i.memoizedProps;k.props=I;var z=k.context,ie=o.contextType;typeof ie=="object"&&ie!==null?ie=$n(ie):(ie=_n(o)?li:on.current,ie=Ki(i,ie));var he=o.getDerivedStateFromProps,ye=typeof he=="function"||typeof k.getSnapshotBeforeUpdate=="function";ye||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(I!==d||z!==ie)&&mp(i,k,d,ie),Br=!1;var me=i.memoizedState;k.state=me,co(i,d,k,h),z=i.memoizedState,I!==d||me!==z||wn.current||Br?(typeof he=="function"&&(Nc(i,o,he,d),z=i.memoizedState),(I=Br||fp(i,o,I,d,me,z,ie))?(ye||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(i.flags|=4194308)):(typeof k.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=d,i.memoizedState=z),k.props=d,k.state=z,k.context=ie,d=I):(typeof k.componentDidMount=="function"&&(i.flags|=4194308),d=!1)}else{k=i.stateNode,Uf(t,i),I=i.memoizedProps,ie=i.type===i.elementType?I:Jn(i.type,I),k.props=ie,ye=i.pendingProps,me=k.context,z=o.contextType,typeof z=="object"&&z!==null?z=$n(z):(z=_n(o)?li:on.current,z=Ki(i,z));var Te=o.getDerivedStateFromProps;(he=typeof Te=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(I!==ye||me!==z)&&mp(i,k,d,z),Br=!1,me=i.memoizedState,k.state=me,co(i,d,k,h);var Le=i.memoizedState;I!==ye||me!==Le||wn.current||Br?(typeof Te=="function"&&(Nc(i,o,Te,d),Le=i.memoizedState),(ie=Br||fp(i,o,ie,d,me,Le,z)||!1)?(he||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(d,Le,z),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(d,Le,z)),typeof k.componentDidUpdate=="function"&&(i.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof k.componentDidUpdate!="function"||I===t.memoizedProps&&me===t.memoizedState||(i.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&me===t.memoizedState||(i.flags|=1024),i.memoizedProps=d,i.memoizedState=Le),k.props=d,k.state=Le,k.context=z,d=ie):(typeof k.componentDidUpdate!="function"||I===t.memoizedProps&&me===t.memoizedState||(i.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||I===t.memoizedProps&&me===t.memoizedState||(i.flags|=1024),d=!1)}return Rc(t,i,o,d,x,h)}function Rc(t,i,o,d,h,x){Ep(t,i);var k=(i.flags&128)!==0;if(!d&&!k)return h&&Mf(i,o,!1),Er(t,i,x);d=i.stateNode,Tb.current=i;var I=k&&typeof o.getDerivedStateFromError!="function"?null:d.render();return i.flags|=1,t!==null&&k?(i.child=Yi(i,t.child,null,x),i.child=Yi(i,null,I,x)):hn(t,i,I,x),i.memoizedState=d.state,h&&Mf(i,o,!0),i.child}function Np(t){var i=t.stateNode;i.pendingContext?Tf(t,i.pendingContext,i.pendingContext!==i.context):i.context&&Tf(t,i.context,!1),mc(t,i.containerInfo)}function Cp(t,i,o,d,h){return Gi(),oc(h),i.flags|=256,hn(t,i,o,d),i.child}var Ic={dehydrated:null,treeContext:null,retryLane:0};function Oc(t){return{baseLanes:t,cachePool:null,transitions:null}}function Tp(t,i,o){var d=i.pendingProps,h=Lt.current,x=!1,k=(i.flags&128)!==0,I;if((I=k)||(I=t!==null&&t.memoizedState===null?!1:(h&2)!==0),I?(x=!0,i.flags&=-129):(t===null||t.memoizedState!==null)&&(h|=1),Ct(Lt,h&1),t===null)return ac(i),t=i.memoizedState,t!==null&&(t=t.dehydrated,t!==null)?((i.mode&1)===0?i.lanes=1:t.data==="$!"?i.lanes=8:i.lanes=1073741824,null):(k=d.children,t=d.fallback,x?(d=i.mode,x=i.child,k={mode:"hidden",children:k},(d&1)===0&&x!==null?(x.childLanes=0,x.pendingProps=k):x=Ro(k,d,0,null),t=xi(t,d,o,null),x.return=i,t.return=i,x.sibling=t,i.child=x,i.child.memoizedState=Oc(o),i.memoizedState=Ic,t):jc(i,k));if(h=t.memoizedState,h!==null&&(I=h.dehydrated,I!==null))return Ab(t,i,k,d,I,h,o);if(x){x=d.fallback,k=i.mode,h=t.child,I=h.sibling;var z={mode:"hidden",children:d.children};return(k&1)===0&&i.child!==h?(d=i.child,d.childLanes=0,d.pendingProps=z,i.deletions=null):(d=Vr(h,z),d.subtreeFlags=h.subtreeFlags&14680064),I!==null?x=Vr(I,x):(x=xi(x,k,o,null),x.flags|=2),x.return=i,d.return=i,d.sibling=x,i.child=d,d=x,x=i.child,k=t.child.memoizedState,k=k===null?Oc(o):{baseLanes:k.baseLanes|o,cachePool:null,transitions:k.transitions},x.memoizedState=k,x.childLanes=t.childLanes&~o,i.memoizedState=Ic,d}return x=t.child,t=x.sibling,d=Vr(x,{mode:"visible",children:d.children}),(i.mode&1)===0&&(d.lanes=o),d.return=i,d.sibling=null,t!==null&&(o=i.deletions,o===null?(i.deletions=[t],i.flags|=16):o.push(t)),i.child=d,i.memoizedState=null,d}function jc(t,i){return i=Ro({mode:"visible",children:i},t.mode,0,null),i.return=t,t.child=i}function xo(t,i,o,d){return d!==null&&oc(d),Yi(i,t.child,null,o),t=jc(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function Ab(t,i,o,d,h,x,k){if(o)return i.flags&256?(i.flags&=-257,d=Tc(Error(r(422))),xo(t,i,k,d)):i.memoizedState!==null?(i.child=t.child,i.flags|=128,null):(x=d.fallback,h=i.mode,d=Ro({mode:"visible",children:d.children},h,0,null),x=xi(x,h,k,null),x.flags|=2,d.return=i,x.return=i,d.sibling=x,i.child=d,(i.mode&1)!==0&&Yi(i,t.child,null,k),i.child.memoizedState=Oc(k),i.memoizedState=Ic,x);if((i.mode&1)===0)return xo(t,i,k,null);if(h.data==="$!"){if(d=h.nextSibling&&h.nextSibling.dataset,d)var I=d.dgst;return d=I,x=Error(r(419)),d=Tc(x,d,void 0),xo(t,i,k,d)}if(I=(k&t.childLanes)!==0,kn||I){if(d=Zt,d!==null){switch(k&-k){case 4:h=2;break;case 16:h=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:h=32;break;case 536870912:h=268435456;break;default:h=0}h=(h&(d.suspendedLanes|k))!==0?0:h,h!==0&&h!==x.retryLane&&(x.retryLane=h,_r(t,h),nr(d,t,h,-1))}return Xc(),d=Tc(Error(r(421))),xo(t,i,k,d)}return h.data==="$?"?(i.flags|=128,i.child=t.child,i=$b.bind(null,t),h._reactRetry=i,null):(t=x.treeContext,In=Dr(h.nextSibling),Rn=i,It=!0,Zn=null,t!==null&&(Bn[Un++]=vr,Bn[Un++]=wr,Bn[Un++]=ci,vr=t.id,wr=t.overflow,ci=i),i=jc(i,d.children),i.flags|=4096,i)}function Ap(t,i,o){t.lanes|=i;var d=t.alternate;d!==null&&(d.lanes|=i),dc(t.return,i,o)}function Lc(t,i,o,d,h){var x=t.memoizedState;x===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:d,tail:o,tailMode:h}:(x.isBackwards=i,x.rendering=null,x.renderingStartTime=0,x.last=d,x.tail=o,x.tailMode=h)}function Mp(t,i,o){var d=i.pendingProps,h=d.revealOrder,x=d.tail;if(hn(t,i,d.children,o),d=Lt.current,(d&2)!==0)d=d&1|2,i.flags|=128;else{if(t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&Ap(t,o,i);else if(t.tag===19)Ap(t,o,i);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===i)break e;for(;t.sibling===null;){if(t.return===null||t.return===i)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}d&=1}if(Ct(Lt,d),(i.mode&1)===0)i.memoizedState=null;else switch(h){case"forwards":for(o=i.child,h=null;o!==null;)t=o.alternate,t!==null&&uo(t)===null&&(h=o),o=o.sibling;o=h,o===null?(h=i.child,i.child=null):(h=o.sibling,o.sibling=null),Lc(i,!1,h,o,x);break;case"backwards":for(o=null,h=i.child,i.child=null;h!==null;){if(t=h.alternate,t!==null&&uo(t)===null){i.child=h;break}t=h.sibling,h.sibling=o,o=h,h=t}Lc(i,!0,o,null,x);break;case"together":Lc(i,!1,null,null,void 0);break;default:i.memoizedState=null}return i.child}function bo(t,i){(i.mode&1)===0&&t!==null&&(t.alternate=null,i.alternate=null,i.flags|=2)}function Er(t,i,o){if(t!==null&&(i.dependencies=t.dependencies),mi|=i.lanes,(o&i.childLanes)===0)return null;if(t!==null&&i.child!==t.child)throw Error(r(153));if(i.child!==null){for(t=i.child,o=Vr(t,t.pendingProps),i.child=o,o.return=i;t.sibling!==null;)t=t.sibling,o=o.sibling=Vr(t,t.pendingProps),o.return=i;o.sibling=null}return i.child}function Mb(t,i,o){switch(i.tag){case 3:Np(i),Gi();break;case 5:qf(i);break;case 1:_n(i.type)&&eo(i);break;case 4:mc(i,i.stateNode.containerInfo);break;case 10:var d=i.type._context,h=i.memoizedProps.value;Ct(ao,d._currentValue),d._currentValue=h;break;case 13:if(d=i.memoizedState,d!==null)return d.dehydrated!==null?(Ct(Lt,Lt.current&1),i.flags|=128,null):(o&i.child.childLanes)!==0?Tp(t,i,o):(Ct(Lt,Lt.current&1),t=Er(t,i,o),t!==null?t.sibling:null);Ct(Lt,Lt.current&1);break;case 19:if(d=(o&i.childLanes)!==0,(t.flags&128)!==0){if(d)return Mp(t,i,o);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),Ct(Lt,Lt.current),d)break;return null;case 22:case 23:return i.lanes=0,kp(t,i,o)}return Er(t,i,o)}var Rp,Dc,Ip,Op;Rp=function(t,i){for(var o=i.child;o!==null;){if(o.tag===5||o.tag===6)t.appendChild(o.stateNode);else if(o.tag!==4&&o.child!==null){o.child.return=o,o=o.child;continue}if(o===i)break;for(;o.sibling===null;){if(o.return===null||o.return===i)return;o=o.return}o.sibling.return=o.return,o=o.sibling}},Dc=function(){},Ip=function(t,i,o,d){var h=t.memoizedProps;if(h!==d){t=i.stateNode,fi(lr.current);var x=null;switch(o){case"input":h=Ee(t,h),d=Ee(t,d),x=[];break;case"select":h=C({},h,{value:void 0}),d=C({},d,{value:void 0}),x=[];break;case"textarea":h=pe(t,h),d=pe(t,d),x=[];break;default:typeof h.onClick!="function"&&typeof d.onClick=="function"&&(t.onclick=Qa)}Vt(o,d);var k;o=null;for(ie in h)if(!d.hasOwnProperty(ie)&&h.hasOwnProperty(ie)&&h[ie]!=null)if(ie==="style"){var I=h[ie];for(k in I)I.hasOwnProperty(k)&&(o||(o={}),o[k]="")}else ie!=="dangerouslySetInnerHTML"&&ie!=="children"&&ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&ie!=="autoFocus"&&(a.hasOwnProperty(ie)?x||(x=[]):(x=x||[]).push(ie,null));for(ie in d){var z=d[ie];if(I=h!=null?h[ie]:void 0,d.hasOwnProperty(ie)&&z!==I&&(z!=null||I!=null))if(ie==="style")if(I){for(k in I)!I.hasOwnProperty(k)||z&&z.hasOwnProperty(k)||(o||(o={}),o[k]="");for(k in z)z.hasOwnProperty(k)&&I[k]!==z[k]&&(o||(o={}),o[k]=z[k])}else o||(x||(x=[]),x.push(ie,o)),o=z;else ie==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,I=I?I.__html:void 0,z!=null&&I!==z&&(x=x||[]).push(ie,z)):ie==="children"?typeof z!="string"&&typeof z!="number"||(x=x||[]).push(ie,""+z):ie!=="suppressContentEditableWarning"&&ie!=="suppressHydrationWarning"&&(a.hasOwnProperty(ie)?(z!=null&&ie==="onScroll"&&At("scroll",t),x||I===z||(x=[])):(x=x||[]).push(ie,z))}o&&(x=x||[]).push("style",o);var ie=x;(i.updateQueue=ie)&&(i.flags|=4)}},Op=function(t,i,o,d){o!==d&&(i.flags|=4)};function Qs(t,i){if(!It)switch(t.tailMode){case"hidden":i=t.tail;for(var o=null;i!==null;)i.alternate!==null&&(o=i),i=i.sibling;o===null?t.tail=null:o.sibling=null;break;case"collapsed":o=t.tail;for(var d=null;o!==null;)o.alternate!==null&&(d=o),o=o.sibling;d===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:d.sibling=null}}function cn(t){var i=t.alternate!==null&&t.alternate.child===t.child,o=0,d=0;if(i)for(var h=t.child;h!==null;)o|=h.lanes|h.childLanes,d|=h.subtreeFlags&14680064,d|=h.flags&14680064,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)o|=h.lanes|h.childLanes,d|=h.subtreeFlags,d|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=d,t.childLanes=o,i}function Rb(t,i,o){var d=i.pendingProps;switch(ic(i),i.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return cn(i),null;case 1:return _n(i.type)&&Ja(),cn(i),null;case 3:return d=i.stateNode,Zi(),Mt(wn),Mt(on),yc(),d.pendingContext&&(d.context=d.pendingContext,d.pendingContext=null),(t===null||t.child===null)&&(io(i)?i.flags|=4:t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Zn!==null&&(Vc(Zn),Zn=null))),Dc(t,i),cn(i),null;case 5:hc(i);var h=fi(Ws.current);if(o=i.type,t!==null&&i.stateNode!=null)Ip(t,i,o,d,h),t.ref!==i.ref&&(i.flags|=512,i.flags|=2097152);else{if(!d){if(i.stateNode===null)throw Error(r(166));return cn(i),null}if(t=fi(lr.current),io(i)){d=i.stateNode,o=i.type;var x=i.memoizedProps;switch(d[or]=i,d[Us]=x,t=(i.mode&1)!==0,o){case"dialog":At("cancel",d),At("close",d);break;case"iframe":case"object":case"embed":At("load",d);break;case"video":case"audio":for(h=0;h<Fs.length;h++)At(Fs[h],d);break;case"source":At("error",d);break;case"img":case"image":case"link":At("error",d),At("load",d);break;case"details":At("toggle",d);break;case"input":ve(d,x),At("invalid",d);break;case"select":d._wrapperState={wasMultiple:!!x.multiple},At("invalid",d);break;case"textarea":ze(d,x),At("invalid",d)}Vt(o,x),h=null;for(var k in x)if(x.hasOwnProperty(k)){var I=x[k];k==="children"?typeof I=="string"?d.textContent!==I&&(x.suppressHydrationWarning!==!0&&Xa(d.textContent,I,t),h=["children",I]):typeof I=="number"&&d.textContent!==""+I&&(x.suppressHydrationWarning!==!0&&Xa(d.textContent,I,t),h=["children",""+I]):a.hasOwnProperty(k)&&I!=null&&k==="onScroll"&&At("scroll",d)}switch(o){case"input":Pe(d),ft(d,x,!0);break;case"textarea":Pe(d),Et(d);break;case"select":case"option":break;default:typeof x.onClick=="function"&&(d.onclick=Qa)}d=h,i.updateQueue=d,d!==null&&(i.flags|=4)}else{k=h.nodeType===9?h:h.ownerDocument,t==="http://www.w3.org/1999/xhtml"&&(t=ae(o)),t==="http://www.w3.org/1999/xhtml"?o==="script"?(t=k.createElement("div"),t.innerHTML="<script><\/script>",t=t.removeChild(t.firstChild)):typeof d.is=="string"?t=k.createElement(o,{is:d.is}):(t=k.createElement(o),o==="select"&&(k=t,d.multiple?k.multiple=!0:d.size&&(k.size=d.size))):t=k.createElementNS(t,o),t[or]=i,t[Us]=d,Rp(t,i,!1,!1),i.stateNode=t;e:{switch(k=Fn(o,d),o){case"dialog":At("cancel",t),At("close",t),h=d;break;case"iframe":case"object":case"embed":At("load",t),h=d;break;case"video":case"audio":for(h=0;h<Fs.length;h++)At(Fs[h],t);h=d;break;case"source":At("error",t),h=d;break;case"img":case"image":case"link":At("error",t),At("load",t),h=d;break;case"details":At("toggle",t),h=d;break;case"input":ve(t,d),h=Ee(t,d),At("invalid",t);break;case"option":h=d;break;case"select":t._wrapperState={wasMultiple:!!d.multiple},h=C({},d,{value:void 0}),At("invalid",t);break;case"textarea":ze(t,d),h=pe(t,d),At("invalid",t);break;default:h=d}Vt(o,h),I=h;for(x in I)if(I.hasOwnProperty(x)){var z=I[x];x==="style"?vn(t,z):x==="dangerouslySetInnerHTML"?(z=z?z.__html:void 0,z!=null&&Ze(t,z)):x==="children"?typeof z=="string"?(o!=="textarea"||z!=="")&<(t,z):typeof z=="number"&<(t,""+z):x!=="suppressContentEditableWarning"&&x!=="suppressHydrationWarning"&&x!=="autoFocus"&&(a.hasOwnProperty(x)?z!=null&&x==="onScroll"&&At("scroll",t):z!=null&&A(t,x,z,k))}switch(o){case"input":Pe(t),ft(t,d,!1);break;case"textarea":Pe(t),Et(t);break;case"option":d.value!=null&&t.setAttribute("value",""+H(d.value));break;case"select":t.multiple=!!d.multiple,x=d.value,x!=null?le(t,!!d.multiple,x,!1):d.defaultValue!=null&&le(t,!!d.multiple,d.defaultValue,!0);break;default:typeof h.onClick=="function"&&(t.onclick=Qa)}switch(o){case"button":case"input":case"select":case"textarea":d=!!d.autoFocus;break e;case"img":d=!0;break e;default:d=!1}}d&&(i.flags|=4)}i.ref!==null&&(i.flags|=512,i.flags|=2097152)}return cn(i),null;case 6:if(t&&i.stateNode!=null)Op(t,i,t.memoizedProps,d);else{if(typeof d!="string"&&i.stateNode===null)throw Error(r(166));if(o=fi(Ws.current),fi(lr.current),io(i)){if(d=i.stateNode,o=i.memoizedProps,d[or]=i,(x=d.nodeValue!==o)&&(t=Rn,t!==null))switch(t.tag){case 3:Xa(d.nodeValue,o,(t.mode&1)!==0);break;case 5:t.memoizedProps.suppressHydrationWarning!==!0&&Xa(d.nodeValue,o,(t.mode&1)!==0)}x&&(i.flags|=4)}else d=(o.nodeType===9?o:o.ownerDocument).createTextNode(d),d[or]=i,i.stateNode=d}return cn(i),null;case 13:if(Mt(Lt),d=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(It&&In!==null&&(i.mode&1)!==0&&(i.flags&128)===0)Df(),Gi(),i.flags|=98560,x=!1;else if(x=io(i),d!==null&&d.dehydrated!==null){if(t===null){if(!x)throw Error(r(318));if(x=i.memoizedState,x=x!==null?x.dehydrated:null,!x)throw Error(r(317));x[or]=i}else Gi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;cn(i),x=!1}else Zn!==null&&(Vc(Zn),Zn=null),x=!0;if(!x)return i.flags&65536?i:null}return(i.flags&128)!==0?(i.lanes=o,i):(d=d!==null,d!==(t!==null&&t.memoizedState!==null)&&d&&(i.child.flags|=8192,(i.mode&1)!==0&&(t===null||(Lt.current&1)!==0?Yt===0&&(Yt=3):Xc())),i.updateQueue!==null&&(i.flags|=4),cn(i),null);case 4:return Zi(),Dc(t,i),t===null&&zs(i.stateNode.containerInfo),cn(i),null;case 10:return uc(i.type._context),cn(i),null;case 17:return _n(i.type)&&Ja(),cn(i),null;case 19:if(Mt(Lt),x=i.memoizedState,x===null)return cn(i),null;if(d=(i.flags&128)!==0,k=x.rendering,k===null)if(d)Qs(x,!1);else{if(Yt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(k=uo(t),k!==null){for(i.flags|=128,Qs(x,!1),d=k.updateQueue,d!==null&&(i.updateQueue=d,i.flags|=4),i.subtreeFlags=0,d=o,o=i.child;o!==null;)x=o,t=d,x.flags&=14680066,k=x.alternate,k===null?(x.childLanes=0,x.lanes=t,x.child=null,x.subtreeFlags=0,x.memoizedProps=null,x.memoizedState=null,x.updateQueue=null,x.dependencies=null,x.stateNode=null):(x.childLanes=k.childLanes,x.lanes=k.lanes,x.child=k.child,x.subtreeFlags=0,x.deletions=null,x.memoizedProps=k.memoizedProps,x.memoizedState=k.memoizedState,x.updateQueue=k.updateQueue,x.type=k.type,t=k.dependencies,x.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),o=o.sibling;return Ct(Lt,Lt.current&1|2),i.child}t=t.sibling}x.tail!==null&&Ot()>ns&&(i.flags|=128,d=!0,Qs(x,!1),i.lanes=4194304)}else{if(!d)if(t=uo(k),t!==null){if(i.flags|=128,d=!0,o=t.updateQueue,o!==null&&(i.updateQueue=o,i.flags|=4),Qs(x,!0),x.tail===null&&x.tailMode==="hidden"&&!k.alternate&&!It)return cn(i),null}else 2*Ot()-x.renderingStartTime>ns&&o!==1073741824&&(i.flags|=128,d=!0,Qs(x,!1),i.lanes=4194304);x.isBackwards?(k.sibling=i.child,i.child=k):(o=x.last,o!==null?o.sibling=k:i.child=k,x.last=k)}return x.tail!==null?(i=x.tail,x.rendering=i,x.tail=i.sibling,x.renderingStartTime=Ot(),i.sibling=null,o=Lt.current,Ct(Lt,d?o&1|2:o&1),i):(cn(i),null);case 22:case 23:return Yc(),d=i.memoizedState!==null,t!==null&&t.memoizedState!==null!==d&&(i.flags|=8192),d&&(i.mode&1)!==0?(On&1073741824)!==0&&(cn(i),i.subtreeFlags&6&&(i.flags|=8192)):cn(i),null;case 24:return null;case 25:return null}throw Error(r(156,i.tag))}function Ib(t,i){switch(ic(i),i.tag){case 1:return _n(i.type)&&Ja(),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Zi(),Mt(wn),Mt(on),yc(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 5:return hc(i),null;case 13:if(Mt(Lt),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Gi()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return Mt(Lt),null;case 4:return Zi(),null;case 10:return uc(i.type._context),null;case 22:case 23:return Yc(),null;case 24:return null;default:return null}}var vo=!1,un=!1,Ob=typeof WeakSet=="function"?WeakSet:Set,Oe=null;function es(t,i){var o=t.ref;if(o!==null)if(typeof o=="function")try{o(null)}catch(d){Ft(t,i,d)}else o.current=null}function Pc(t,i,o){try{o()}catch(d){Ft(t,i,d)}}var jp=!1;function jb(t,i){if(Yl=za,t=ff(),Ul(t)){if("selectionStart"in t)var o={start:t.selectionStart,end:t.selectionEnd};else e:{o=(o=t.ownerDocument)&&o.defaultView||window;var d=o.getSelection&&o.getSelection();if(d&&d.rangeCount!==0){o=d.anchorNode;var h=d.anchorOffset,x=d.focusNode;d=d.focusOffset;try{o.nodeType,x.nodeType}catch{o=null;break e}var k=0,I=-1,z=-1,ie=0,he=0,ye=t,me=null;t:for(;;){for(var Te;ye!==o||h!==0&&ye.nodeType!==3||(I=k+h),ye!==x||d!==0&&ye.nodeType!==3||(z=k+d),ye.nodeType===3&&(k+=ye.nodeValue.length),(Te=ye.firstChild)!==null;)me=ye,ye=Te;for(;;){if(ye===t)break t;if(me===o&&++ie===h&&(I=k),me===x&&++he===d&&(z=k),(Te=ye.nextSibling)!==null)break;ye=me,me=ye.parentNode}ye=Te}o=I===-1||z===-1?null:{start:I,end:z}}else o=null}o=o||{start:0,end:0}}else o=null;for(Xl={focusedElem:t,selectionRange:o},za=!1,Oe=i;Oe!==null;)if(i=Oe,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Oe=t;else for(;Oe!==null;){i=Oe;try{var Le=i.alternate;if((i.flags&1024)!==0)switch(i.tag){case 0:case 11:case 15:break;case 1:if(Le!==null){var De=Le.memoizedProps,Ut=Le.memoizedState,Y=i.stateNode,U=Y.getSnapshotBeforeUpdate(i.elementType===i.type?De:Jn(i.type,De),Ut);Y.__reactInternalSnapshotBeforeUpdate=U}break;case 3:var te=i.stateNode.containerInfo;te.nodeType===1?te.textContent="":te.nodeType===9&&te.documentElement&&te.removeChild(te.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(r(163))}}catch(_e){Ft(i,i.return,_e)}if(t=i.sibling,t!==null){t.return=i.return,Oe=t;break}Oe=i.return}return Le=jp,jp=!1,Le}function Zs(t,i,o){var d=i.updateQueue;if(d=d!==null?d.lastEffect:null,d!==null){var h=d=d.next;do{if((h.tag&t)===t){var x=h.destroy;h.destroy=void 0,x!==void 0&&Pc(i,o,x)}h=h.next}while(h!==d)}}function wo(t,i){if(i=i.updateQueue,i=i!==null?i.lastEffect:null,i!==null){var o=i=i.next;do{if((o.tag&t)===t){var d=o.create;o.destroy=d()}o=o.next}while(o!==i)}}function Fc(t){var i=t.ref;if(i!==null){var o=t.stateNode;switch(t.tag){case 5:t=o;break;default:t=o}typeof i=="function"?i(t):i.current=t}}function Lp(t){var i=t.alternate;i!==null&&(t.alternate=null,Lp(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&(delete i[or],delete i[Us],delete i[ec],delete i[gb],delete i[yb])),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function Dp(t){return t.tag===5||t.tag===3||t.tag===4}function Pp(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Dp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function zc(t,i,o){var d=t.tag;if(d===5||d===6)t=t.stateNode,i?o.nodeType===8?o.parentNode.insertBefore(t,i):o.insertBefore(t,i):(o.nodeType===8?(i=o.parentNode,i.insertBefore(t,o)):(i=o,i.appendChild(t)),o=o._reactRootContainer,o!=null||i.onclick!==null||(i.onclick=Qa));else if(d!==4&&(t=t.child,t!==null))for(zc(t,i,o),t=t.sibling;t!==null;)zc(t,i,o),t=t.sibling}function Bc(t,i,o){var d=t.tag;if(d===5||d===6)t=t.stateNode,i?o.insertBefore(t,i):o.appendChild(t);else if(d!==4&&(t=t.child,t!==null))for(Bc(t,i,o),t=t.sibling;t!==null;)Bc(t,i,o),t=t.sibling}var rn=null,er=!1;function $r(t,i,o){for(o=o.child;o!==null;)Fp(t,i,o),o=o.sibling}function Fp(t,i,o){if(ct&&typeof ct.onCommitFiberUnmount=="function")try{ct.onCommitFiberUnmount(nt,o)}catch{}switch(o.tag){case 5:un||es(o,i);case 6:var d=rn,h=er;rn=null,$r(t,i,o),rn=d,er=h,rn!==null&&(er?(t=rn,o=o.stateNode,t.nodeType===8?t.parentNode.removeChild(o):t.removeChild(o)):rn.removeChild(o.stateNode));break;case 18:rn!==null&&(er?(t=rn,o=o.stateNode,t.nodeType===8?Jl(t.parentNode,o):t.nodeType===1&&Jl(t,o),Ms(t)):Jl(rn,o.stateNode));break;case 4:d=rn,h=er,rn=o.stateNode.containerInfo,er=!0,$r(t,i,o),rn=d,er=h;break;case 0:case 11:case 14:case 15:if(!un&&(d=o.updateQueue,d!==null&&(d=d.lastEffect,d!==null))){h=d=d.next;do{var x=h,k=x.destroy;x=x.tag,k!==void 0&&((x&2)!==0||(x&4)!==0)&&Pc(o,i,k),h=h.next}while(h!==d)}$r(t,i,o);break;case 1:if(!un&&(es(o,i),d=o.stateNode,typeof d.componentWillUnmount=="function"))try{d.props=o.memoizedProps,d.state=o.memoizedState,d.componentWillUnmount()}catch(I){Ft(o,i,I)}$r(t,i,o);break;case 21:$r(t,i,o);break;case 22:o.mode&1?(un=(d=un)||o.memoizedState!==null,$r(t,i,o),un=d):$r(t,i,o);break;default:$r(t,i,o)}}function zp(t){var i=t.updateQueue;if(i!==null){t.updateQueue=null;var o=t.stateNode;o===null&&(o=t.stateNode=new Ob),i.forEach(function(d){var h=Hb.bind(null,t,d);o.has(d)||(o.add(d),d.then(h,h))})}}function tr(t,i){var o=i.deletions;if(o!==null)for(var d=0;d<o.length;d++){var h=o[d];try{var x=t,k=i,I=k;e:for(;I!==null;){switch(I.tag){case 5:rn=I.stateNode,er=!1;break e;case 3:rn=I.stateNode.containerInfo,er=!0;break e;case 4:rn=I.stateNode.containerInfo,er=!0;break e}I=I.return}if(rn===null)throw Error(r(160));Fp(x,k,h),rn=null,er=!1;var z=h.alternate;z!==null&&(z.return=null),h.return=null}catch(ie){Ft(h,i,ie)}}if(i.subtreeFlags&12854)for(i=i.child;i!==null;)Bp(i,t),i=i.sibling}function Bp(t,i){var o=t.alternate,d=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:if(tr(i,t),ur(t),d&4){try{Zs(3,t,t.return),wo(3,t)}catch(De){Ft(t,t.return,De)}try{Zs(5,t,t.return)}catch(De){Ft(t,t.return,De)}}break;case 1:tr(i,t),ur(t),d&512&&o!==null&&es(o,o.return);break;case 5:if(tr(i,t),ur(t),d&512&&o!==null&&es(o,o.return),t.flags&32){var h=t.stateNode;try{lt(h,"")}catch(De){Ft(t,t.return,De)}}if(d&4&&(h=t.stateNode,h!=null)){var x=t.memoizedProps,k=o!==null?o.memoizedProps:x,I=t.type,z=t.updateQueue;if(t.updateQueue=null,z!==null)try{I==="input"&&x.type==="radio"&&x.name!=null&&Se(h,x),Fn(I,k);var ie=Fn(I,x);for(k=0;k<z.length;k+=2){var he=z[k],ye=z[k+1];he==="style"?vn(h,ye):he==="dangerouslySetInnerHTML"?Ze(h,ye):he==="children"?lt(h,ye):A(h,he,ye,ie)}switch(I){case"input":tt(h,x);break;case"textarea":st(h,x);break;case"select":var me=h._wrapperState.wasMultiple;h._wrapperState.wasMultiple=!!x.multiple;var Te=x.value;Te!=null?le(h,!!x.multiple,Te,!1):me!==!!x.multiple&&(x.defaultValue!=null?le(h,!!x.multiple,x.defaultValue,!0):le(h,!!x.multiple,x.multiple?[]:"",!1))}h[Us]=x}catch(De){Ft(t,t.return,De)}}break;case 6:if(tr(i,t),ur(t),d&4){if(t.stateNode===null)throw Error(r(162));h=t.stateNode,x=t.memoizedProps;try{h.nodeValue=x}catch(De){Ft(t,t.return,De)}}break;case 3:if(tr(i,t),ur(t),d&4&&o!==null&&o.memoizedState.isDehydrated)try{Ms(i.containerInfo)}catch(De){Ft(t,t.return,De)}break;case 4:tr(i,t),ur(t);break;case 13:tr(i,t),ur(t),h=t.child,h.flags&8192&&(x=h.memoizedState!==null,h.stateNode.isHidden=x,!x||h.alternate!==null&&h.alternate.memoizedState!==null||(Hc=Ot())),d&4&&zp(t);break;case 22:if(he=o!==null&&o.memoizedState!==null,t.mode&1?(un=(ie=un)||he,tr(i,t),un=ie):tr(i,t),ur(t),d&8192){if(ie=t.memoizedState!==null,(t.stateNode.isHidden=ie)&&!he&&(t.mode&1)!==0)for(Oe=t,he=t.child;he!==null;){for(ye=Oe=he;Oe!==null;){switch(me=Oe,Te=me.child,me.tag){case 0:case 11:case 14:case 15:Zs(4,me,me.return);break;case 1:es(me,me.return);var Le=me.stateNode;if(typeof Le.componentWillUnmount=="function"){d=me,o=me.return;try{i=d,Le.props=i.memoizedProps,Le.state=i.memoizedState,Le.componentWillUnmount()}catch(De){Ft(d,o,De)}}break;case 5:es(me,me.return);break;case 22:if(me.memoizedState!==null){Hp(ye);continue}}Te!==null?(Te.return=me,Oe=Te):Hp(ye)}he=he.sibling}e:for(he=null,ye=t;;){if(ye.tag===5){if(he===null){he=ye;try{h=ye.stateNode,ie?(x=h.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none"):(I=ye.stateNode,z=ye.memoizedProps.style,k=z!=null&&z.hasOwnProperty("display")?z.display:null,I.style.display=tn("display",k))}catch(De){Ft(t,t.return,De)}}}else if(ye.tag===6){if(he===null)try{ye.stateNode.nodeValue=ie?"":ye.memoizedProps}catch(De){Ft(t,t.return,De)}}else if((ye.tag!==22&&ye.tag!==23||ye.memoizedState===null||ye===t)&&ye.child!==null){ye.child.return=ye,ye=ye.child;continue}if(ye===t)break e;for(;ye.sibling===null;){if(ye.return===null||ye.return===t)break e;he===ye&&(he=null),ye=ye.return}he===ye&&(he=null),ye.sibling.return=ye.return,ye=ye.sibling}}break;case 19:tr(i,t),ur(t),d&4&&zp(t);break;case 21:break;default:tr(i,t),ur(t)}}function ur(t){var i=t.flags;if(i&2){try{e:{for(var o=t.return;o!==null;){if(Dp(o)){var d=o;break e}o=o.return}throw Error(r(160))}switch(d.tag){case 5:var h=d.stateNode;d.flags&32&&(lt(h,""),d.flags&=-33);var x=Pp(t);Bc(t,x,h);break;case 3:case 4:var k=d.stateNode.containerInfo,I=Pp(t);zc(t,I,k);break;default:throw Error(r(161))}}catch(z){Ft(t,t.return,z)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function Lb(t,i,o){Oe=t,Up(t)}function Up(t,i,o){for(var d=(t.mode&1)!==0;Oe!==null;){var h=Oe,x=h.child;if(h.tag===22&&d){var k=h.memoizedState!==null||vo;if(!k){var I=h.alternate,z=I!==null&&I.memoizedState!==null||un;I=vo;var ie=un;if(vo=k,(un=z)&&!ie)for(Oe=h;Oe!==null;)k=Oe,z=k.child,k.tag===22&&k.memoizedState!==null?qp(h):z!==null?(z.return=k,Oe=z):qp(h);for(;x!==null;)Oe=x,Up(x),x=x.sibling;Oe=h,vo=I,un=ie}$p(t)}else(h.subtreeFlags&8772)!==0&&x!==null?(x.return=h,Oe=x):$p(t)}}function $p(t){for(;Oe!==null;){var i=Oe;if((i.flags&8772)!==0){var o=i.alternate;try{if((i.flags&8772)!==0)switch(i.tag){case 0:case 11:case 15:un||wo(5,i);break;case 1:var d=i.stateNode;if(i.flags&4&&!un)if(o===null)d.componentDidMount();else{var h=i.elementType===i.type?o.memoizedProps:Jn(i.type,o.memoizedProps);d.componentDidUpdate(h,o.memoizedState,d.__reactInternalSnapshotBeforeUpdate)}var x=i.updateQueue;x!==null&&Hf(i,x,d);break;case 3:var k=i.updateQueue;if(k!==null){if(o=null,i.child!==null)switch(i.child.tag){case 5:o=i.child.stateNode;break;case 1:o=i.child.stateNode}Hf(i,k,o)}break;case 5:var I=i.stateNode;if(o===null&&i.flags&4){o=I;var z=i.memoizedProps;switch(i.type){case"button":case"input":case"select":case"textarea":z.autoFocus&&o.focus();break;case"img":z.src&&(o.src=z.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(i.memoizedState===null){var ie=i.alternate;if(ie!==null){var he=ie.memoizedState;if(he!==null){var ye=he.dehydrated;ye!==null&&Ms(ye)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(r(163))}un||i.flags&512&&Fc(i)}catch(me){Ft(i,i.return,me)}}if(i===t){Oe=null;break}if(o=i.sibling,o!==null){o.return=i.return,Oe=o;break}Oe=i.return}}function Hp(t){for(;Oe!==null;){var i=Oe;if(i===t){Oe=null;break}var o=i.sibling;if(o!==null){o.return=i.return,Oe=o;break}Oe=i.return}}function qp(t){for(;Oe!==null;){var i=Oe;try{switch(i.tag){case 0:case 11:case 15:var o=i.return;try{wo(4,i)}catch(z){Ft(i,o,z)}break;case 1:var d=i.stateNode;if(typeof d.componentDidMount=="function"){var h=i.return;try{d.componentDidMount()}catch(z){Ft(i,h,z)}}var x=i.return;try{Fc(i)}catch(z){Ft(i,x,z)}break;case 5:var k=i.return;try{Fc(i)}catch(z){Ft(i,k,z)}}}catch(z){Ft(i,i.return,z)}if(i===t){Oe=null;break}var I=i.sibling;if(I!==null){I.return=i.return,Oe=I;break}Oe=i.return}}var Db=Math.ceil,_o=G.ReactCurrentDispatcher,Uc=G.ReactCurrentOwner,qn=G.ReactCurrentBatchConfig,ht=0,Zt=null,Ht=null,sn=0,On=0,ts=Pr(0),Yt=0,Js=null,mi=0,ko=0,$c=0,ea=null,En=null,Hc=0,ns=1/0,Sr=null,Eo=!1,qc=null,Hr=null,So=!1,qr=null,No=0,ta=0,Kc=null,Co=-1,To=0;function gn(){return(ht&6)!==0?Ot():Co!==-1?Co:Co=Ot()}function Kr(t){return(t.mode&1)===0?1:(ht&2)!==0&&sn!==0?sn&-sn:bb.transition!==null?(To===0&&(To=Da()),To):(t=mt,t!==0||(t=window.event,t=t===void 0?16:Kd(t.type)),t)}function nr(t,i,o,d){if(50<ta)throw ta=0,Kc=null,Error(r(185));Ir(t,o,d),((ht&2)===0||t!==Zt)&&(t===Zt&&((ht&2)===0&&(ko|=o),Yt===4&&Wr(t,sn)),Sn(t,d),o===1&&ht===0&&(i.mode&1)===0&&(ns=Ot()+500,to&&zr()))}function Sn(t,i){var o=t.callbackNode;Tl(t,i);var d=ii(t,t===Zt?sn:0);if(d===0)o!==null&&Xn(o),t.callbackNode=null,t.callbackPriority=0;else if(i=d&-d,t.callbackPriority!==i){if(o!=null&&Xn(o),i===1)t.tag===0?xb(Wp.bind(null,t)):Rf(Wp.bind(null,t)),mb(function(){(ht&6)===0&&zr()}),o=null;else{switch(Xe(d)){case 1:o=Es;break;case 4:o=ni;break;case 16:o=ji;break;case 536870912:o=Ue;break;default:o=ji}o=em(o,Kp.bind(null,t))}t.callbackPriority=i,t.callbackNode=o}}function Kp(t,i){if(Co=-1,To=0,(ht&6)!==0)throw Error(r(327));var o=t.callbackNode;if(rs()&&t.callbackNode!==o)return null;var d=ii(t,t===Zt?sn:0);if(d===0)return null;if((d&30)!==0||(d&t.expiredLanes)!==0||i)i=Ao(t,d);else{i=d;var h=ht;ht|=2;var x=Gp();(Zt!==t||sn!==i)&&(Sr=null,ns=Ot()+500,gi(t,i));do try{zb();break}catch(I){Vp(t,I)}while(!0);cc(),_o.current=x,ht=h,Ht!==null?i=0:(Zt=null,sn=0,i=Yt)}if(i!==0){if(i===2&&(h=Ss(t),h!==0&&(d=h,i=Wc(t,h))),i===1)throw o=Js,gi(t,0),Wr(t,d),Sn(t,Ot()),o;if(i===6)Wr(t,d);else{if(h=t.current.alternate,(d&30)===0&&!Pb(h)&&(i=Ao(t,d),i===2&&(x=Ss(t),x!==0&&(d=x,i=Wc(t,x))),i===1))throw o=Js,gi(t,0),Wr(t,d),Sn(t,Ot()),o;switch(t.finishedWork=h,t.finishedLanes=d,i){case 0:case 1:throw Error(r(345));case 2:yi(t,En,Sr);break;case 3:if(Wr(t,d),(d&130023424)===d&&(i=Hc+500-Ot(),10<i)){if(ii(t,0)!==0)break;if(h=t.suspendedLanes,(h&d)!==d){gn(),t.pingedLanes|=t.suspendedLanes&h;break}t.timeoutHandle=Zl(yi.bind(null,t,En,Sr),i);break}yi(t,En,Sr);break;case 4:if(Wr(t,d),(d&4194240)===d)break;for(i=t.eventTimes,h=-1;0<d;){var k=31-jt(d);x=1<<k,k=i[k],k>h&&(h=k),d&=~x}if(d=h,d=Ot()-d,d=(120>d?120:480>d?480:1080>d?1080:1920>d?1920:3e3>d?3e3:4320>d?4320:1960*Db(d/1960))-d,10<d){t.timeoutHandle=Zl(yi.bind(null,t,En,Sr),d);break}yi(t,En,Sr);break;case 5:yi(t,En,Sr);break;default:throw Error(r(329))}}}return Sn(t,Ot()),t.callbackNode===o?Kp.bind(null,t):null}function Wc(t,i){var o=ea;return t.current.memoizedState.isDehydrated&&(gi(t,i).flags|=256),t=Ao(t,i),t!==2&&(i=En,En=o,i!==null&&Vc(i)),t}function Vc(t){En===null?En=t:En.push.apply(En,t)}function Pb(t){for(var i=t;;){if(i.flags&16384){var o=i.updateQueue;if(o!==null&&(o=o.stores,o!==null))for(var d=0;d<o.length;d++){var h=o[d],x=h.getSnapshot;h=h.value;try{if(!Qn(x(),h))return!1}catch{return!1}}}if(o=i.child,i.subtreeFlags&16384&&o!==null)o.return=i,i=o;else{if(i===t)break;for(;i.sibling===null;){if(i.return===null||i.return===t)return!0;i=i.return}i.sibling.return=i.return,i=i.sibling}}return!0}function Wr(t,i){for(i&=~$c,i&=~ko,t.suspendedLanes|=i,t.pingedLanes&=~i,t=t.expirationTimes;0<i;){var o=31-jt(i),d=1<<o;t[o]=-1,i&=~d}}function Wp(t){if((ht&6)!==0)throw Error(r(327));rs();var i=ii(t,0);if((i&1)===0)return Sn(t,Ot()),null;var o=Ao(t,i);if(t.tag!==0&&o===2){var d=Ss(t);d!==0&&(i=d,o=Wc(t,d))}if(o===1)throw o=Js,gi(t,0),Wr(t,i),Sn(t,Ot()),o;if(o===6)throw Error(r(345));return t.finishedWork=t.current.alternate,t.finishedLanes=i,yi(t,En,Sr),Sn(t,Ot()),null}function Gc(t,i){var o=ht;ht|=1;try{return t(i)}finally{ht=o,ht===0&&(ns=Ot()+500,to&&zr())}}function hi(t){qr!==null&&qr.tag===0&&(ht&6)===0&&rs();var i=ht;ht|=1;var o=qn.transition,d=mt;try{if(qn.transition=null,mt=1,t)return t()}finally{mt=d,qn.transition=o,ht=i,(ht&6)===0&&zr()}}function Yc(){On=ts.current,Mt(ts)}function gi(t,i){t.finishedWork=null,t.finishedLanes=0;var o=t.timeoutHandle;if(o!==-1&&(t.timeoutHandle=-1,pb(o)),Ht!==null)for(o=Ht.return;o!==null;){var d=o;switch(ic(d),d.tag){case 1:d=d.type.childContextTypes,d!=null&&Ja();break;case 3:Zi(),Mt(wn),Mt(on),yc();break;case 5:hc(d);break;case 4:Zi();break;case 13:Mt(Lt);break;case 19:Mt(Lt);break;case 10:uc(d.type._context);break;case 22:case 23:Yc()}o=o.return}if(Zt=t,Ht=t=Vr(t.current,null),sn=On=i,Yt=0,Js=null,$c=ko=mi=0,En=ea=null,di!==null){for(i=0;i<di.length;i++)if(o=di[i],d=o.interleaved,d!==null){o.interleaved=null;var h=d.next,x=o.pending;if(x!==null){var k=x.next;x.next=h,d.next=k}o.pending=d}di=null}return t}function Vp(t,i){do{var o=Ht;try{if(cc(),fo.current=go,po){for(var d=Dt.memoizedState;d!==null;){var h=d.queue;h!==null&&(h.pending=null),d=d.next}po=!1}if(pi=0,Qt=Gt=Dt=null,Vs=!1,Gs=0,Uc.current=null,o===null||o.return===null){Yt=1,Js=i,Ht=null;break}e:{var x=t,k=o.return,I=o,z=i;if(i=sn,I.flags|=32768,z!==null&&typeof z=="object"&&typeof z.then=="function"){var ie=z,he=I,ye=he.tag;if((he.mode&1)===0&&(ye===0||ye===11||ye===15)){var me=he.alternate;me?(he.updateQueue=me.updateQueue,he.memoizedState=me.memoizedState,he.lanes=me.lanes):(he.updateQueue=null,he.memoizedState=null)}var Te=xp(k);if(Te!==null){Te.flags&=-257,bp(Te,k,I,x,i),Te.mode&1&&yp(x,ie,i),i=Te,z=ie;var Le=i.updateQueue;if(Le===null){var De=new Set;De.add(z),i.updateQueue=De}else Le.add(z);break e}else{if((i&1)===0){yp(x,ie,i),Xc();break e}z=Error(r(426))}}else if(It&&I.mode&1){var Ut=xp(k);if(Ut!==null){(Ut.flags&65536)===0&&(Ut.flags|=256),bp(Ut,k,I,x,i),oc(Ji(z,I));break e}}x=z=Ji(z,I),Yt!==4&&(Yt=2),ea===null?ea=[x]:ea.push(x),x=k;do{switch(x.tag){case 3:x.flags|=65536,i&=-i,x.lanes|=i;var Y=hp(x,z,i);$f(x,Y);break e;case 1:I=z;var U=x.type,te=x.stateNode;if((x.flags&128)===0&&(typeof U.getDerivedStateFromError=="function"||te!==null&&typeof te.componentDidCatch=="function"&&(Hr===null||!Hr.has(te)))){x.flags|=65536,i&=-i,x.lanes|=i;var _e=gp(x,I,i);$f(x,_e);break e}}x=x.return}while(x!==null)}Xp(o)}catch(Fe){i=Fe,Ht===o&&o!==null&&(Ht=o=o.return);continue}break}while(!0)}function Gp(){var t=_o.current;return _o.current=go,t===null?go:t}function Xc(){(Yt===0||Yt===3||Yt===2)&&(Yt=4),Zt===null||(mi&268435455)===0&&(ko&268435455)===0||Wr(Zt,sn)}function Ao(t,i){var o=ht;ht|=2;var d=Gp();(Zt!==t||sn!==i)&&(Sr=null,gi(t,i));do try{Fb();break}catch(h){Vp(t,h)}while(!0);if(cc(),ht=o,_o.current=d,Ht!==null)throw Error(r(261));return Zt=null,sn=0,Yt}function Fb(){for(;Ht!==null;)Yp(Ht)}function zb(){for(;Ht!==null&&!ja();)Yp(Ht)}function Yp(t){var i=Jp(t.alternate,t,On);t.memoizedProps=t.pendingProps,i===null?Xp(t):Ht=i,Uc.current=null}function Xp(t){var i=t;do{var o=i.alternate;if(t=i.return,(i.flags&32768)===0){if(o=Rb(o,i,On),o!==null){Ht=o;return}}else{if(o=Ib(o,i),o!==null){o.flags&=32767,Ht=o;return}if(t!==null)t.flags|=32768,t.subtreeFlags=0,t.deletions=null;else{Yt=6,Ht=null;return}}if(i=i.sibling,i!==null){Ht=i;return}Ht=i=t}while(i!==null);Yt===0&&(Yt=5)}function yi(t,i,o){var d=mt,h=qn.transition;try{qn.transition=null,mt=1,Bb(t,i,o,d)}finally{qn.transition=h,mt=d}return null}function Bb(t,i,o,d){do rs();while(qr!==null);if((ht&6)!==0)throw Error(r(327));o=t.finishedWork;var h=t.finishedLanes;if(o===null)return null;if(t.finishedWork=null,t.finishedLanes=0,o===t.current)throw Error(r(177));t.callbackNode=null,t.callbackPriority=0;var x=o.lanes|o.childLanes;if(zn(t,x),t===Zt&&(Ht=Zt=null,sn=0),(o.subtreeFlags&2064)===0&&(o.flags&2064)===0||So||(So=!0,em(ji,function(){return rs(),null})),x=(o.flags&15990)!==0,(o.subtreeFlags&15990)!==0||x){x=qn.transition,qn.transition=null;var k=mt;mt=1;var I=ht;ht|=4,Uc.current=null,jb(t,o),Bp(o,t),ab(Xl),za=!!Yl,Xl=Yl=null,t.current=o,Lb(o),La(),ht=I,mt=k,qn.transition=x}else t.current=o;if(So&&(So=!1,qr=t,No=h),x=t.pendingLanes,x===0&&(Hr=null),zt(o.stateNode),Sn(t,Ot()),i!==null)for(d=t.onRecoverableError,o=0;o<i.length;o++)h=i[o],d(h.value,{componentStack:h.stack,digest:h.digest});if(Eo)throw Eo=!1,t=qc,qc=null,t;return(No&1)!==0&&t.tag!==0&&rs(),x=t.pendingLanes,(x&1)!==0?t===Kc?ta++:(ta=0,Kc=t):ta=0,zr(),null}function rs(){if(qr!==null){var t=Xe(No),i=qn.transition,o=mt;try{if(qn.transition=null,mt=16>t?16:t,qr===null)var d=!1;else{if(t=qr,qr=null,No=0,(ht&6)!==0)throw Error(r(331));var h=ht;for(ht|=4,Oe=t.current;Oe!==null;){var x=Oe,k=x.child;if((Oe.flags&16)!==0){var I=x.deletions;if(I!==null){for(var z=0;z<I.length;z++){var ie=I[z];for(Oe=ie;Oe!==null;){var he=Oe;switch(he.tag){case 0:case 11:case 15:Zs(8,he,x)}var ye=he.child;if(ye!==null)ye.return=he,Oe=ye;else for(;Oe!==null;){he=Oe;var me=he.sibling,Te=he.return;if(Lp(he),he===ie){Oe=null;break}if(me!==null){me.return=Te,Oe=me;break}Oe=Te}}}var Le=x.alternate;if(Le!==null){var De=Le.child;if(De!==null){Le.child=null;do{var Ut=De.sibling;De.sibling=null,De=Ut}while(De!==null)}}Oe=x}}if((x.subtreeFlags&2064)!==0&&k!==null)k.return=x,Oe=k;else e:for(;Oe!==null;){if(x=Oe,(x.flags&2048)!==0)switch(x.tag){case 0:case 11:case 15:Zs(9,x,x.return)}var Y=x.sibling;if(Y!==null){Y.return=x.return,Oe=Y;break e}Oe=x.return}}var U=t.current;for(Oe=U;Oe!==null;){k=Oe;var te=k.child;if((k.subtreeFlags&2064)!==0&&te!==null)te.return=k,Oe=te;else e:for(k=U;Oe!==null;){if(I=Oe,(I.flags&2048)!==0)try{switch(I.tag){case 0:case 11:case 15:wo(9,I)}}catch(Fe){Ft(I,I.return,Fe)}if(I===k){Oe=null;break e}var _e=I.sibling;if(_e!==null){_e.return=I.return,Oe=_e;break e}Oe=I.return}}if(ht=h,zr(),ct&&typeof ct.onPostCommitFiberRoot=="function")try{ct.onPostCommitFiberRoot(nt,t)}catch{}d=!0}return d}finally{mt=o,qn.transition=i}}return!1}function Qp(t,i,o){i=Ji(o,i),i=hp(t,i,1),t=Ur(t,i,1),i=gn(),t!==null&&(Ir(t,1,i),Sn(t,i))}function Ft(t,i,o){if(t.tag===3)Qp(t,t,o);else for(;i!==null;){if(i.tag===3){Qp(i,t,o);break}else if(i.tag===1){var d=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof d.componentDidCatch=="function"&&(Hr===null||!Hr.has(d))){t=Ji(o,t),t=gp(i,t,1),i=Ur(i,t,1),t=gn(),i!==null&&(Ir(i,1,t),Sn(i,t));break}}i=i.return}}function Ub(t,i,o){var d=t.pingCache;d!==null&&d.delete(i),i=gn(),t.pingedLanes|=t.suspendedLanes&o,Zt===t&&(sn&o)===o&&(Yt===4||Yt===3&&(sn&130023424)===sn&&500>Ot()-Hc?gi(t,0):$c|=o),Sn(t,i)}function Zp(t,i){i===0&&((t.mode&1)===0?i=1:(i=ri,ri<<=1,(ri&130023424)===0&&(ri=4194304)));var o=gn();t=_r(t,i),t!==null&&(Ir(t,i,o),Sn(t,o))}function $b(t){var i=t.memoizedState,o=0;i!==null&&(o=i.retryLane),Zp(t,o)}function Hb(t,i){var o=0;switch(t.tag){case 13:var d=t.stateNode,h=t.memoizedState;h!==null&&(o=h.retryLane);break;case 19:d=t.stateNode;break;default:throw Error(r(314))}d!==null&&d.delete(i),Zp(t,o)}var Jp;Jp=function(t,i,o){if(t!==null)if(t.memoizedProps!==i.pendingProps||wn.current)kn=!0;else{if((t.lanes&o)===0&&(i.flags&128)===0)return kn=!1,Mb(t,i,o);kn=(t.flags&131072)!==0}else kn=!1,It&&(i.flags&1048576)!==0&&If(i,ro,i.index);switch(i.lanes=0,i.tag){case 2:var d=i.type;bo(t,i),t=i.pendingProps;var h=Ki(i,on.current);Qi(i,o),h=vc(null,i,d,t,h,o);var x=wc();return i.flags|=1,typeof h=="object"&&h!==null&&typeof h.render=="function"&&h.$$typeof===void 0?(i.tag=1,i.memoizedState=null,i.updateQueue=null,_n(d)?(x=!0,eo(i)):x=!1,i.memoizedState=h.state!==null&&h.state!==void 0?h.state:null,pc(i),h.updater=yo,i.stateNode=h,h._reactInternals=i,Cc(i,d,t,o),i=Rc(null,i,d,!0,x,o)):(i.tag=0,It&&x&&rc(i),hn(null,i,h,o),i=i.child),i;case 16:d=i.elementType;e:{switch(bo(t,i),t=i.pendingProps,h=d._init,d=h(d._payload),i.type=d,h=i.tag=Kb(d),t=Jn(d,t),h){case 0:i=Mc(null,i,d,t,o);break e;case 1:i=Sp(null,i,d,t,o);break e;case 11:i=vp(null,i,d,t,o);break e;case 14:i=wp(null,i,d,Jn(d.type,t),o);break e}throw Error(r(306,d,""))}return i;case 0:return d=i.type,h=i.pendingProps,h=i.elementType===d?h:Jn(d,h),Mc(t,i,d,h,o);case 1:return d=i.type,h=i.pendingProps,h=i.elementType===d?h:Jn(d,h),Sp(t,i,d,h,o);case 3:e:{if(Np(i),t===null)throw Error(r(387));d=i.pendingProps,x=i.memoizedState,h=x.element,Uf(t,i),co(i,d,null,o);var k=i.memoizedState;if(d=k.element,x.isDehydrated)if(x={element:d,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},i.updateQueue.baseState=x,i.memoizedState=x,i.flags&256){h=Ji(Error(r(423)),i),i=Cp(t,i,d,o,h);break e}else if(d!==h){h=Ji(Error(r(424)),i),i=Cp(t,i,d,o,h);break e}else for(In=Dr(i.stateNode.containerInfo.firstChild),Rn=i,It=!0,Zn=null,o=zf(i,null,d,o),i.child=o;o;)o.flags=o.flags&-3|4096,o=o.sibling;else{if(Gi(),d===h){i=Er(t,i,o);break e}hn(t,i,d,o)}i=i.child}return i;case 5:return qf(i),t===null&&ac(i),d=i.type,h=i.pendingProps,x=t!==null?t.memoizedProps:null,k=h.children,Ql(d,h)?k=null:x!==null&&Ql(d,x)&&(i.flags|=32),Ep(t,i),hn(t,i,k,o),i.child;case 6:return t===null&&ac(i),null;case 13:return Tp(t,i,o);case 4:return mc(i,i.stateNode.containerInfo),d=i.pendingProps,t===null?i.child=Yi(i,null,d,o):hn(t,i,d,o),i.child;case 11:return d=i.type,h=i.pendingProps,h=i.elementType===d?h:Jn(d,h),vp(t,i,d,h,o);case 7:return hn(t,i,i.pendingProps,o),i.child;case 8:return hn(t,i,i.pendingProps.children,o),i.child;case 12:return hn(t,i,i.pendingProps.children,o),i.child;case 10:e:{if(d=i.type._context,h=i.pendingProps,x=i.memoizedProps,k=h.value,Ct(ao,d._currentValue),d._currentValue=k,x!==null)if(Qn(x.value,k)){if(x.children===h.children&&!wn.current){i=Er(t,i,o);break e}}else for(x=i.child,x!==null&&(x.return=i);x!==null;){var I=x.dependencies;if(I!==null){k=x.child;for(var z=I.firstContext;z!==null;){if(z.context===d){if(x.tag===1){z=kr(-1,o&-o),z.tag=2;var ie=x.updateQueue;if(ie!==null){ie=ie.shared;var he=ie.pending;he===null?z.next=z:(z.next=he.next,he.next=z),ie.pending=z}}x.lanes|=o,z=x.alternate,z!==null&&(z.lanes|=o),dc(x.return,o,i),I.lanes|=o;break}z=z.next}}else if(x.tag===10)k=x.type===i.type?null:x.child;else if(x.tag===18){if(k=x.return,k===null)throw Error(r(341));k.lanes|=o,I=k.alternate,I!==null&&(I.lanes|=o),dc(k,o,i),k=x.sibling}else k=x.child;if(k!==null)k.return=x;else for(k=x;k!==null;){if(k===i){k=null;break}if(x=k.sibling,x!==null){x.return=k.return,k=x;break}k=k.return}x=k}hn(t,i,h.children,o),i=i.child}return i;case 9:return h=i.type,d=i.pendingProps.children,Qi(i,o),h=$n(h),d=d(h),i.flags|=1,hn(t,i,d,o),i.child;case 14:return d=i.type,h=Jn(d,i.pendingProps),h=Jn(d.type,h),wp(t,i,d,h,o);case 15:return _p(t,i,i.type,i.pendingProps,o);case 17:return d=i.type,h=i.pendingProps,h=i.elementType===d?h:Jn(d,h),bo(t,i),i.tag=1,_n(d)?(t=!0,eo(i)):t=!1,Qi(i,o),pp(i,d,h),Cc(i,d,h,o),Rc(null,i,d,!0,t,o);case 19:return Mp(t,i,o);case 22:return kp(t,i,o)}throw Error(r(156,i.tag))};function em(t,i){return Oa(t,i)}function qb(t,i,o,d){this.tag=t,this.key=o,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=d,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Kn(t,i,o,d){return new qb(t,i,o,d)}function Qc(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Kb(t){if(typeof t=="function")return Qc(t)?1:0;if(t!=null){if(t=t.$$typeof,t===V)return 11;if(t===q)return 14}return 2}function Vr(t,i){var o=t.alternate;return o===null?(o=Kn(t.tag,i,t.key,t.mode),o.elementType=t.elementType,o.type=t.type,o.stateNode=t.stateNode,o.alternate=t,t.alternate=o):(o.pendingProps=i,o.type=t.type,o.flags=0,o.subtreeFlags=0,o.deletions=null),o.flags=t.flags&14680064,o.childLanes=t.childLanes,o.lanes=t.lanes,o.child=t.child,o.memoizedProps=t.memoizedProps,o.memoizedState=t.memoizedState,o.updateQueue=t.updateQueue,i=t.dependencies,o.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},o.sibling=t.sibling,o.index=t.index,o.ref=t.ref,o}function Mo(t,i,o,d,h,x){var k=2;if(d=t,typeof t=="function")Qc(t)&&(k=1);else if(typeof t=="string")k=5;else e:switch(t){case W:return xi(o.children,h,x,i);case ee:k=8,h|=8;break;case oe:return t=Kn(12,o,i,h|2),t.elementType=oe,t.lanes=x,t;case j:return t=Kn(13,o,i,h),t.elementType=j,t.lanes=x,t;case B:return t=Kn(19,o,i,h),t.elementType=B,t.lanes=x,t;case ne:return Ro(o,h,x,i);default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case D:k=10;break e;case ce:k=9;break e;case V:k=11;break e;case q:k=14;break e;case Z:k=16,d=null;break e}throw Error(r(130,t==null?t:typeof t,""))}return i=Kn(k,o,i,h),i.elementType=t,i.type=d,i.lanes=x,i}function xi(t,i,o,d){return t=Kn(7,t,d,i),t.lanes=o,t}function Ro(t,i,o,d){return t=Kn(22,t,d,i),t.elementType=ne,t.lanes=o,t.stateNode={isHidden:!1},t}function Zc(t,i,o){return t=Kn(6,t,null,i),t.lanes=o,t}function Jc(t,i,o){return i=Kn(4,t.children!==null?t.children:[],t.key,i),i.lanes=o,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}function Wb(t,i,o,d,h){this.tag=i,this.containerInfo=t,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Rr(0),this.expirationTimes=Rr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Rr(0),this.identifierPrefix=d,this.onRecoverableError=h,this.mutableSourceEagerHydrationData=null}function eu(t,i,o,d,h,x,k,I,z){return t=new Wb(t,i,o,I,z),i===1?(i=1,x===!0&&(i|=8)):i=0,x=Kn(3,null,null,i),t.current=x,x.stateNode=t,x.memoizedState={element:d,isDehydrated:o,cache:null,transitions:null,pendingSuspenseBoundaries:null},pc(x),t}function Vb(t,i,o){var d=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:M,key:d==null?null:""+d,children:t,containerInfo:i,implementation:o}}function tm(t){if(!t)return Fr;t=t._reactInternals;e:{if(yr(t)!==t||t.tag!==1)throw Error(r(170));var i=t;do{switch(i.tag){case 3:i=i.stateNode.context;break e;case 1:if(_n(i.type)){i=i.stateNode.__reactInternalMemoizedMergedChildContext;break e}}i=i.return}while(i!==null);throw Error(r(171))}if(t.tag===1){var o=t.type;if(_n(o))return Af(t,o,i)}return i}function nm(t,i,o,d,h,x,k,I,z){return t=eu(o,d,!0,t,h,x,k,I,z),t.context=tm(null),o=t.current,d=gn(),h=Kr(o),x=kr(d,h),x.callback=i??null,Ur(o,x,h),t.current.lanes=h,Ir(t,h,d),Sn(t,d),t}function Io(t,i,o,d){var h=i.current,x=gn(),k=Kr(h);return o=tm(o),i.context===null?i.context=o:i.pendingContext=o,i=kr(x,k),i.payload={element:t},d=d===void 0?null:d,d!==null&&(i.callback=d),t=Ur(h,i,k),t!==null&&(nr(t,h,k,x),lo(t,h,k)),k}function Oo(t){if(t=t.current,!t.child)return null;switch(t.child.tag){case 5:return t.child.stateNode;default:return t.child.stateNode}}function rm(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var o=t.retryLane;t.retryLane=o!==0&&o<i?o:i}}function tu(t,i){rm(t,i),(t=t.alternate)&&rm(t,i)}function Gb(){return null}var im=typeof reportError=="function"?reportError:function(t){console.error(t)};function nu(t){this._internalRoot=t}jo.prototype.render=nu.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(r(409));Io(t,i,null,null)},jo.prototype.unmount=nu.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;hi(function(){Io(null,t,null,null)}),i[xr]=null}};function jo(t){this._internalRoot=t}jo.prototype.unstable_scheduleHydration=function(t){if(t){var i=si();t={blockedOn:null,target:t,priority:i};for(var o=0;o<Xt.length&&i!==0&&i<Xt[o].priority;o++);Xt.splice(o,0,t),o===0&&Hd(t)}};function ru(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function Lo(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11&&(t.nodeType!==8||t.nodeValue!==" react-mount-point-unstable "))}function sm(){}function Yb(t,i,o,d,h){if(h){if(typeof d=="function"){var x=d;d=function(){var ie=Oo(k);x.call(ie)}}var k=nm(i,d,t,0,null,!1,!1,"",sm);return t._reactRootContainer=k,t[xr]=k.current,zs(t.nodeType===8?t.parentNode:t),hi(),k}for(;h=t.lastChild;)t.removeChild(h);if(typeof d=="function"){var I=d;d=function(){var ie=Oo(z);I.call(ie)}}var z=eu(t,0,!1,null,null,!1,!1,"",sm);return t._reactRootContainer=z,t[xr]=z.current,zs(t.nodeType===8?t.parentNode:t),hi(function(){Io(i,z,o,d)}),z}function Do(t,i,o,d,h){var x=o._reactRootContainer;if(x){var k=x;if(typeof h=="function"){var I=h;h=function(){var z=Oo(k);I.call(z)}}Io(i,k,t,h)}else k=Yb(o,i,t,h,d);return Oo(k)}Cs=function(t){switch(t.tag){case 3:var i=t.stateNode;if(i.current.memoizedState.isDehydrated){var o=Mr(i.pendingLanes);o!==0&&(Ns(i,o|1),Sn(i,Ot()),(ht&6)===0&&(ns=Ot()+500,zr()))}break;case 13:hi(function(){var d=_r(t,1);if(d!==null){var h=gn();nr(d,t,1,h)}}),tu(t,1)}},Bt=function(t){if(t.tag===13){var i=_r(t,134217728);if(i!==null){var o=gn();nr(i,t,134217728,o)}tu(t,134217728)}},bt=function(t){if(t.tag===13){var i=Kr(t),o=_r(t,i);if(o!==null){var d=gn();nr(o,t,i,d)}tu(t,i)}},si=function(){return mt},ar=function(t,i){var o=mt;try{return mt=t,i()}finally{mt=o}},Ii=function(t,i,o){switch(i){case"input":if(tt(t,o),i=o.name,o.type==="radio"&&i!=null){for(o=t;o.parentNode;)o=o.parentNode;for(o=o.querySelectorAll("input[name="+JSON.stringify(""+i)+'][type="radio"]'),i=0;i<o.length;i++){var d=o[i];if(d!==t&&d.form===t.form){var h=Za(d);if(!h)throw Error(r(90));fe(d),tt(d,h)}}}break;case"textarea":st(t,o);break;case"select":i=o.value,i!=null&&le(t,!!o.multiple,i,!1)}},Ce=Gc,Ge=hi;var Xb={usingClientEntryPoint:!1,Events:[$s,Hi,Za,F,de,Gc]},na={findFiberByHostInstance:oi,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Qb={bundleType:na.bundleType,version:na.version,rendererPackageName:na.rendererPackageName,rendererConfig:na.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:G.ReactCurrentDispatcher,findHostInstanceByFiber:function(t){return t=Ra(t),t===null?null:t.stateNode},findFiberByHostInstance:na.findFiberByHostInstance||Gb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Po=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Po.isDisabled&&Po.supportsFiber)try{nt=Po.inject(Qb),ct=Po}catch{}}return Nn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Xb,Nn.createPortal=function(t,i){var o=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!ru(i))throw Error(r(200));return Vb(t,i,null,o)},Nn.createRoot=function(t,i){if(!ru(t))throw Error(r(299));var o=!1,d="",h=im;return i!=null&&(i.unstable_strictMode===!0&&(o=!0),i.identifierPrefix!==void 0&&(d=i.identifierPrefix),i.onRecoverableError!==void 0&&(h=i.onRecoverableError)),i=eu(t,1,!1,null,null,o,!1,d,h),t[xr]=i.current,zs(t.nodeType===8?t.parentNode:t),new nu(i)},Nn.findDOMNode=function(t){if(t==null)return null;if(t.nodeType===1)return t;var i=t._reactInternals;if(i===void 0)throw typeof t.render=="function"?Error(r(188)):(t=Object.keys(t).join(","),Error(r(268,t)));return t=Ra(i),t=t===null?null:t.stateNode,t},Nn.flushSync=function(t){return hi(t)},Nn.hydrate=function(t,i,o){if(!Lo(i))throw Error(r(200));return Do(null,t,i,!0,o)},Nn.hydrateRoot=function(t,i,o){if(!ru(t))throw Error(r(405));var d=o!=null&&o.hydratedSources||null,h=!1,x="",k=im;if(o!=null&&(o.unstable_strictMode===!0&&(h=!0),o.identifierPrefix!==void 0&&(x=o.identifierPrefix),o.onRecoverableError!==void 0&&(k=o.onRecoverableError)),i=nm(i,null,t,1,o??null,h,!1,x,k),t[xr]=i.current,zs(t),d)for(t=0;t<d.length;t++)o=d[t],h=o._getVersion,h=h(o._source),i.mutableSourceEagerHydrationData==null?i.mutableSourceEagerHydrationData=[o,h]:i.mutableSourceEagerHydrationData.push(o,h);return new jo(i)},Nn.render=function(t,i,o){if(!Lo(i))throw Error(r(200));return Do(null,t,i,!1,o)},Nn.unmountComponentAtNode=function(t){if(!Lo(t))throw Error(r(40));return t._reactRootContainer?(hi(function(){Do(null,null,t,!1,function(){t._reactRootContainer=null,t[xr]=null})}),!0):!1},Nn.unstable_batchedUpdates=Gc,Nn.unstable_renderSubtreeIntoContainer=function(t,i,o,d){if(!Lo(o))throw Error(r(200));if(t==null||t._reactInternals===void 0)throw Error(r(38));return Do(t,i,o,!1,d)},Nn.version="18.3.1-next-f1338f8080-20240426",Nn}var pm;function Vh(){if(pm)return ou.exports;pm=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(n){console.error(n)}}return e(),ou.exports=ov(),ou.exports}var mm;function lv(){if(mm)return Fo;mm=1;var e=Vh();return Fo.createRoot=e.createRoot,Fo.hydrateRoot=e.hydrateRoot,Fo}var cv=lv();const uv=wa(cv);/**
|
|
41
|
-
* @license lucide-react v0.468.0 - ISC
|
|
42
|
-
*
|
|
43
|
-
* This source code is licensed under the ISC license.
|
|
44
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
45
|
-
*/const dv=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Gh=(...e)=>e.filter((n,r,s)=>!!n&&n.trim()!==""&&s.indexOf(n)===r).join(" ").trim();/**
|
|
46
|
-
* @license lucide-react v0.468.0 - ISC
|
|
47
|
-
*
|
|
48
|
-
* This source code is licensed under the ISC license.
|
|
49
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
50
|
-
*/var fv={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"};/**
|
|
51
|
-
* @license lucide-react v0.468.0 - ISC
|
|
52
|
-
*
|
|
53
|
-
* This source code is licensed under the ISC license.
|
|
54
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
55
|
-
*/const pv=N.forwardRef(({color:e="currentColor",size:n=24,strokeWidth:r=2,absoluteStrokeWidth:s,className:a="",children:c,iconNode:u,...f},p)=>N.createElement("svg",{ref:p,...fv,width:n,height:n,stroke:e,strokeWidth:s?Number(r)*24/Number(n):r,className:Gh("lucide",a),...f},[...u.map(([m,g])=>N.createElement(m,g)),...Array.isArray(c)?c:[c]]));/**
|
|
56
|
-
* @license lucide-react v0.468.0 - ISC
|
|
57
|
-
*
|
|
58
|
-
* This source code is licensed under the ISC license.
|
|
59
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
60
|
-
*/const Ae=(e,n)=>{const r=N.forwardRef(({className:s,...a},c)=>N.createElement(pv,{ref:c,iconNode:n,className:Gh(`lucide-${dv(e)}`,s),...a}));return r.displayName=`${e}`,r};/**
|
|
61
|
-
* @license lucide-react v0.468.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 $u=Ae("Activity",[["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"}]]);/**
|
|
66
|
-
* @license lucide-react v0.468.0 - ISC
|
|
67
|
-
*
|
|
68
|
-
* This source code is licensed under the ISC license.
|
|
69
|
-
* See the LICENSE file in the root directory of this source tree.
|
|
70
|
-
*/const Hu=Ae("ArrowRight",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]]);/**
|
|
71
|
-
* @license lucide-react v0.468.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 mv=Ae("ArrowUp",[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]]);/**
|
|
76
|
-
* @license lucide-react v0.468.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 hv=Ae("BookOpen",[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]]);/**
|
|
81
|
-
* @license lucide-react v0.468.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 ml=Ae("Bot",[["path",{d:"M12 8V4H8",key:"hb8ula"}],["rect",{width:"16",height:"12",x:"4",y:"8",rx:"2",key:"enze0r"}],["path",{d:"M2 14h2",key:"vft8re"}],["path",{d:"M20 14h2",key:"4cs60a"}],["path",{d:"M15 13v2",key:"1xurst"}],["path",{d:"M9 13v2",key:"rq6x2g"}]]);/**
|
|
86
|
-
* @license lucide-react v0.468.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 hm=Ae("Box",[["path",{d:"M21 8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16Z",key:"hh9hay"}],["path",{d:"m3.3 7 8.7 5 8.7-5",key:"g66t2b"}],["path",{d:"M12 22V12",key:"d0xqtd"}]]);/**
|
|
91
|
-
* @license lucide-react v0.468.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 gv=Ae("ChartColumn",[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]]);/**
|
|
96
|
-
* @license lucide-react v0.468.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 gs=Ae("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
|
|
101
|
-
* @license lucide-react v0.468.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 Yh=Ae("ChevronDown",[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]]);/**
|
|
106
|
-
* @license lucide-react v0.468.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 ud=Ae("ChevronRight",[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]]);/**
|
|
111
|
-
* @license lucide-react v0.468.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 yv=Ae("CircleCheck",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]]);/**
|
|
116
|
-
* @license lucide-react v0.468.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 xv=Ae("CircleHelp",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]]);/**
|
|
121
|
-
* @license lucide-react v0.468.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 bv=Ae("CircleX",[["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"}]]);/**
|
|
126
|
-
* @license lucide-react v0.468.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 Xh=Ae("Clock3",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16.5 12",key:"1aq6pp"}]]);/**
|
|
131
|
-
* @license lucide-react v0.468.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 vv=Ae("Copy",[["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"}]]);/**
|
|
136
|
-
* @license lucide-react v0.468.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 Qh=Ae("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
|
|
141
|
-
* @license lucide-react v0.468.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 Zh=Ae("EyeOff",[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]]);/**
|
|
146
|
-
* @license lucide-react v0.468.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 wv=Ae("Eye",[["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"}]]);/**
|
|
151
|
-
* @license lucide-react v0.468.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 Jh=Ae("FileImage",[["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"}],["circle",{cx:"10",cy:"12",r:"2",key:"737tya"}],["path",{d:"m20 17-1.296-1.296a2.41 2.41 0 0 0-3.408 0L9 22",key:"wt3hpn"}]]);/**
|
|
156
|
-
* @license lucide-react v0.468.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 ca=Ae("FileText",[["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"}]]);/**
|
|
161
|
-
* @license lucide-react v0.468.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 _v=Ae("FileUp",[["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:"M12 12v6",key:"3ahymv"}],["path",{d:"m15 15-3-3-3 3",key:"15xj92"}]]);/**
|
|
166
|
-
* @license lucide-react v0.468.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 dd=Ae("File",[["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"}]]);/**
|
|
171
|
-
* @license lucide-react v0.468.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 eg=Ae("Filter",[["polygon",{points:"22 3 2 3 10 12.46 10 19 14 21 14 12.46 22 3",key:"1yg77f"}]]);/**
|
|
176
|
-
* @license lucide-react v0.468.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 kv=Ae("FolderOpen",[["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"}]]);/**
|
|
181
|
-
* @license lucide-react v0.468.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 fd=Ae("Folder",[["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"}]]);/**
|
|
186
|
-
* @license lucide-react v0.468.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 ma=Ae("GitBranch",[["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"}]]);/**
|
|
191
|
-
* @license lucide-react v0.468.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 ys=Ae("Inbox",[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]]);/**
|
|
196
|
-
* @license lucide-react v0.468.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 Ev=Ae("Info",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]]);/**
|
|
201
|
-
* @license lucide-react v0.468.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 Sv=Ae("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
|
|
206
|
-
* @license lucide-react v0.468.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 tg=Ae("Maximize2",[["polyline",{points:"15 3 21 3 21 9",key:"mznyad"}],["polyline",{points:"9 21 3 21 3 15",key:"1avn1i"}],["line",{x1:"21",x2:"14",y1:"3",y2:"10",key:"ota7mn"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
211
|
-
* @license lucide-react v0.468.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 ng=Ae("MessageCircle",[["path",{d:"M7.9 20A9 9 0 1 0 4 16.1L2 22Z",key:"vv11sd"}]]);/**
|
|
216
|
-
* @license lucide-react v0.468.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 Nv=Ae("MessageSquarePlus",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}],["path",{d:"M12 7v6",key:"lw1j43"}],["path",{d:"M9 10h6",key:"9gxzsh"}]]);/**
|
|
221
|
-
* @license lucide-react v0.468.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 _a=Ae("MessageSquare",[["path",{d:"M21 15a2 2 0 0 1-2 2H7l-4 4V5a2 2 0 0 1 2-2h14a2 2 0 0 1 2 2z",key:"1lielz"}]]);/**
|
|
226
|
-
* @license lucide-react v0.468.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 Cv=Ae("Mic",[["path",{d:"M12 2a3 3 0 0 0-3 3v7a3 3 0 0 0 6 0V5a3 3 0 0 0-3-3Z",key:"131961"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["line",{x1:"12",x2:"12",y1:"19",y2:"22",key:"x3vr5v"}]]);/**
|
|
231
|
-
* @license lucide-react v0.468.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 Tv=Ae("Microscope",[["path",{d:"M6 18h8",key:"1borvv"}],["path",{d:"M3 22h18",key:"8prr45"}],["path",{d:"M14 22a7 7 0 1 0 0-14h-1",key:"1jwaiy"}],["path",{d:"M9 14h2",key:"197e7h"}],["path",{d:"M9 12a2 2 0 0 1-2-2V6h6v4a2 2 0 0 1-2 2Z",key:"1bmzmy"}],["path",{d:"M12 6V3a1 1 0 0 0-1-1H9a1 1 0 0 0-1 1v3",key:"1drr47"}]]);/**
|
|
236
|
-
* @license lucide-react v0.468.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 Av=Ae("Minimize2",[["polyline",{points:"4 14 10 14 10 20",key:"11kfnr"}],["polyline",{points:"20 10 14 10 14 4",key:"rlmsce"}],["line",{x1:"14",x2:"21",y1:"10",y2:"3",key:"o5lafz"}],["line",{x1:"3",x2:"10",y1:"21",y2:"14",key:"1atl0r"}]]);/**
|
|
241
|
-
* @license lucide-react v0.468.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 Mv=Ae("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
|
|
246
|
-
* @license lucide-react v0.468.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 Rv=Ae("MonitorPlay",[["path",{d:"M10 7.75a.75.75 0 0 1 1.142-.638l3.664 2.249a.75.75 0 0 1 0 1.278l-3.664 2.25a.75.75 0 0 1-1.142-.64z",key:"1pctta"}],["path",{d:"M12 17v4",key:"1riwvh"}],["path",{d:"M8 21h8",key:"1ev6f3"}],["rect",{x:"2",y:"3",width:"20",height:"14",rx:"2",key:"x3v2xh"}]]);/**
|
|
251
|
-
* @license lucide-react v0.468.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 pd=Ae("Network",[["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"}]]);/**
|
|
256
|
-
* @license lucide-react v0.468.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 Iv=Ae("OctagonAlert",[["path",{d:"M12 16h.01",key:"1drbdi"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M15.312 2a2 2 0 0 1 1.414.586l4.688 4.688A2 2 0 0 1 22 8.688v6.624a2 2 0 0 1-.586 1.414l-4.688 4.688a2 2 0 0 1-1.414.586H8.688a2 2 0 0 1-1.414-.586l-4.688-4.688A2 2 0 0 1 2 15.312V8.688a2 2 0 0 1 .586-1.414l4.688-4.688A2 2 0 0 1 8.688 2z",key:"1fd625"}]]);/**
|
|
261
|
-
* @license lucide-react v0.468.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 Ov=Ae("Package",[["path",{d:"M11 21.73a2 2 0 0 0 2 0l7-4A2 2 0 0 0 21 16V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73z",key:"1a0edw"}],["path",{d:"M12 22V12",key:"d0xqtd"}],["path",{d:"m3.3 7 7.703 4.734a2 2 0 0 0 1.994 0L20.7 7",key:"yx3hmr"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}]]);/**
|
|
266
|
-
* @license lucide-react v0.468.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 jv=Ae("PanelLeft",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}],["path",{d:"M9 3v18",key:"fh3hqa"}]]);/**
|
|
271
|
-
* @license lucide-react v0.468.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 Lv=Ae("Paperclip",[["path",{d:"M13.234 20.252 21 12.3",key:"1cbrk9"}],["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 0 2.828 2 2 0 0 0 2.828 0l8.414-8.586a4 4 0 0 0 0-5.656 4 4 0 0 0-5.656 0l-8.415 8.585a6 6 0 1 0 8.486 8.486",key:"1pkts6"}]]);/**
|
|
276
|
-
* @license lucide-react v0.468.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 rg=Ae("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
|
|
281
|
-
* @license lucide-react v0.468.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 qu=Ae("PenLine",[["path",{d:"M12 20h9",key:"t2du7b"}],["path",{d:"M16.376 3.622a1 1 0 0 1 3.002 3.002L7.368 18.635a2 2 0 0 1-.855.506l-2.872.838a.5.5 0 0 1-.62-.62l.838-2.872a2 2 0 0 1 .506-.854z",key:"1ykcvy"}]]);/**
|
|
286
|
-
* @license lucide-react v0.468.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 ig=Ae("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
|
|
291
|
-
* @license lucide-react v0.468.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 sg=Ae("Plug",[["path",{d:"M12 22v-5",key:"1ega77"}],["path",{d:"M9 8V2",key:"14iosj"}],["path",{d:"M15 8V2",key:"18g5xt"}],["path",{d:"M18 8v5a4 4 0 0 1-4 4h-4a4 4 0 0 1-4-4V8Z",key:"osxo6l"}]]);/**
|
|
296
|
-
* @license lucide-react v0.468.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 hl=Ae("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
|
|
301
|
-
* @license lucide-react v0.468.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 md=Ae("RefreshCw",[["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"}]]);/**
|
|
306
|
-
* @license lucide-react v0.468.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 ag=Ae("RotateCcw",[["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"}]]);/**
|
|
311
|
-
* @license lucide-react v0.468.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 Dv=Ae("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
|
|
316
|
-
* @license lucide-react v0.468.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 og=Ae("Search",[["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}],["path",{d:"m21 21-4.3-4.3",key:"1qie3q"}]]);/**
|
|
321
|
-
* @license lucide-react v0.468.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 lg=Ae("Send",[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]]);/**
|
|
326
|
-
* @license lucide-react v0.468.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 cg=Ae("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
|
|
331
|
-
* @license lucide-react v0.468.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 Pv=Ae("SkipBack",[["polygon",{points:"19 20 9 12 19 4 19 20",key:"o2sva"}],["line",{x1:"5",x2:"5",y1:"19",y2:"5",key:"1ocqjk"}]]);/**
|
|
336
|
-
* @license lucide-react v0.468.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 Fv=Ae("SkipForward",[["polygon",{points:"5 4 15 12 5 20 5 4",key:"16p6eg"}],["line",{x1:"19",x2:"19",y1:"5",y2:"19",key:"futhcm"}]]);/**
|
|
341
|
-
* @license lucide-react v0.468.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 zv=Ae("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
|
|
346
|
-
* @license lucide-react v0.468.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 Bv=Ae("Sparkles",[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]]);/**
|
|
351
|
-
* @license lucide-react v0.468.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 Uv=Ae("Square",[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]]);/**
|
|
356
|
-
* @license lucide-react v0.468.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 hd=Ae("Timer",[["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"}]]);/**
|
|
361
|
-
* @license lucide-react v0.468.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 gd=Ae("Trash2",[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]]);/**
|
|
366
|
-
* @license lucide-react v0.468.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 $v=Ae("TrendingUp",[["polyline",{points:"22 7 13.5 15.5 8.5 10.5 2 17",key:"126l90"}],["polyline",{points:"16 7 22 7 22 13",key:"kwv8wd"}]]);/**
|
|
371
|
-
* @license lucide-react v0.468.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 ka=Ae("TriangleAlert",[["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"}]]);/**
|
|
376
|
-
* @license lucide-react v0.468.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 gm=Ae("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
|
|
381
|
-
* @license lucide-react v0.468.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 Ku=Ae("UserRoundCog",[["path",{d:"M2 21a8 8 0 0 1 10.434-7.62",key:"1yezr2"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["circle",{cx:"18",cy:"18",r:"3",key:"1xkwt0"}],["path",{d:"m19.5 14.3-.4.9",key:"1eb35c"}],["path",{d:"m16.9 20.8-.4.9",key:"dfjc4z"}],["path",{d:"m21.7 19.5-.9-.4",key:"q4dx6b"}],["path",{d:"m15.2 16.9-.9-.4",key:"1r0w5f"}],["path",{d:"m21.7 16.5-.9.4",key:"1knoei"}],["path",{d:"m15.2 19.1-.9.4",key:"j188fs"}],["path",{d:"m19.5 21.7-.4-.9",key:"1tonu5"}],["path",{d:"m16.9 15.2-.4-.9",key:"699xu"}]]);/**
|
|
386
|
-
* @license lucide-react v0.468.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 Hv=Ae("UserRound",[["circle",{cx:"12",cy:"8",r:"5",key:"1hypcn"}],["path",{d:"M20 21a8 8 0 0 0-16 0",key:"rfgkzh"}]]);/**
|
|
391
|
-
* @license lucide-react v0.468.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 ug=Ae("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
|
|
396
|
-
* @license lucide-react v0.468.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 qv=Ae("Webhook",[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]]);/**
|
|
401
|
-
* @license lucide-react v0.468.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 ha=Ae("Wrench",[["path",{d:"M14.7 6.3a1 1 0 0 0 0 1.4l1.6 1.6a1 1 0 0 0 1.4 0l3.77-3.77a6 6 0 0 1-7.94 7.94l-6.91 6.91a2.12 2.12 0 0 1-3-3l6.91-6.91a6 6 0 0 1 7.94-7.94l-3.76 3.76z",key:"cbrjhi"}]]);/**
|
|
406
|
-
* @license lucide-react v0.468.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 Dn=Ae("X",[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]]);function it(e,n=""){return typeof e=="string"&&e.length>0?e:n}function vt(e){return typeof e=="string"&&e.length>0?e:void 0}function en(e,n=0){return typeof e=="number"&&Number.isFinite(e)?e:n}function ga(e){return typeof e=="number"&&Number.isFinite(e)?e:void 0}function nl(e){return typeof e=="string"&&e.length>0?e:new Date().toISOString()}function an(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:{}}function Kv(e){return e&&typeof e=="object"&&!Array.isArray(e)?e:void 0}function ym(e){if(!e||typeof e!="object"||Array.isArray(e))return;const n=Object.entries(e).filter(r=>typeof r[1]=="string");return n.length>0?Object.fromEntries(n):void 0}function uu(e){return Array.isArray(e)?e.filter(n=>typeof n=="string"):[]}function Wv(e){return e.replace(/_([a-z])/g,(n,r)=>r.toUpperCase())}function ya(e){return Array.isArray(e)?e.map(ya):!e||typeof e!="object"?e:Object.fromEntries(Object.entries(e).map(([n,r])=>[Wv(n),ya(r)]))}function Vv(e){const n=it(e.username,"user");return{id:it(e.id,n),username:n,createdAt:nl(e.createdAt??e.created_at)}}function du(e){return{id:it(e.id),name:it(e.name??e.sandbox_name,"default"),status:it(e.status,"stopped"),port:typeof e.port=="number"?e.port:null,userId:it(e.userId??e.user_id),createdAt:nl(e.createdAt??e.created_at),containerName:vt(e.containerName??e.container_name),hostApiUrl:vt(e.hostApiUrl??e.host_api_url)}}function Gv(e){const n=an(e),r=an(n.memory),s=an(n.cpu),a=an(n.pids),c=an(n.disk),u=n.gpu===null||n.gpu===void 0?null:an(n.gpu);return{sandboxId:it(n.sandboxId??n.sandbox_id),sandboxName:it(n.sandboxName??n.sandbox_name,"default"),status:it(n.status,"stopped"),memory:{usedBytes:en(r.usedBytes??r.used_bytes),limitBytes:en(r.limitBytes??r.limit_bytes),percent:en(r.percent)},cpu:{usedPercent:en(s.usedPercent??s.used_percent),quotaPercent:en(s.quotaPercent??s.quota_percent),onlineCpus:en(s.onlineCpus??s.online_cpus)},pids:{current:en(a.current),limit:typeof a.limit=="number"?a.limit:null},disk:{workspaceUsedBytes:en(c.workspaceUsedBytes??c.workspace_used_bytes),quotaBytes:en(c.quotaBytes??c.quota_bytes),percentOfQuota:en(c.percentOfQuota??c.percent_of_quota)},gpu:u?{name:vt(u.name),memoryUsedBytes:en(u.memoryUsedBytes??u.memory_used_bytes),memoryTotalBytes:en(u.memoryTotalBytes??u.memory_total_bytes),utilizationPercent:en(u.utilizationPercent??u.utilization_percent)}:null}}function Yv(e){const n=typeof e.modified=="string"?Number(e.modified):e.modified;return{name:it(e.name),type:e.type==="folder"||e.type==="symlink"?e.type:"file",size:en(e.size),modified:en(n),permissions:it(e.permissions,"")}}function Xv(e){const n=an(e);return{path:it(n.path),content:it(n.content),size:en(n.size)}}function zo(e){const n=it(e.id);return{id:n,title:it(e.title,n?`Session ${n.slice(0,8)}`:"Untitled session"),createdAt:nl(e.createdAt??e.created_at),updatedAt:nl(e.updatedAt??e.updated_at??e.createdAt??e.created_at)}}function xm(e){return{model:it(e.model),apiKey:it(e.apiKey??e.api_key),baseUrl:it(e.baseUrl??e.base_url)}}function Qv(e){return{...e.model!==void 0?{model:e.model}:{},...e.apiKey!==void 0?{api_key:e.apiKey}:{},...e.baseUrl!==void 0?{base_url:e.baseUrl}:{}}}function fu(e){const n=an(e);return{name:it(n.name),type:n.type==="stdio"||n.type==="sse"?n.type:"http",command:vt(n.command),args:Array.isArray(n.args)?n.args.filter(r=>typeof r=="string"):void 0,env:ym(n.env),url:vt(n.url),headers:ym(n.headers),timeout:ga(n.timeout)}}function bm(e){return Object.fromEntries(Object.entries(e).filter(([,n])=>n!==void 0&&n!==""))}function Zv(e){return!e||typeof e!="object"?{model:"",status:"unknown"}:{model:it(e.model),status:e.status||"unknown",latencyMs:ga(e.latencyMs??e.latency_ms),checkedAt:ga(e.checkedAt??e.checked_at),error:vt(e.error)}}function bi(e){const n=Array.isArray(e.modelHealth)?e.modelHealth:Array.isArray(e.model_health)?e.model_health:[];return{id:it(e.id),name:it(e.name),baseUrl:it(e.baseUrl??e.base_url),models:Array.isArray(e.models)?e.models:[],icon:it(e.icon,"circle"),iconColor:it(e.iconColor??e.icon_color,"#111111"),notes:it(e.notes),isActive:!!(e.isActive??e.is_active),apiKeyMasked:it(e.apiKeyMasked??e.api_key_masked),createdAt:en(e.createdAt??e.created_at),updatedAt:en(e.updatedAt??e.updated_at),healthStatus:e.healthStatus??e.health_status??"unknown",healthCheckedAt:ga(e.healthCheckedAt??e.health_checked_at),modelHealth:n.map(Zv)}}function Jv(e){return{name:e.name,base_url:e.baseUrl,api_key:e.apiKey,models:e.models,icon:e.icon,icon_color:e.iconColor,notes:e.notes}}function ew(e){return{...e.name!==void 0?{name:e.name}:{},...e.baseUrl!==void 0?{base_url:e.baseUrl}:{},...e.apiKey!==void 0?{api_key:e.apiKey}:{},...e.models!==void 0?{models:e.models}:{},...e.icon!==void 0?{icon:e.icon}:{},...e.iconColor!==void 0?{icon_color:e.iconColor}:{},...e.notes!==void 0?{notes:e.notes}:{}}}function tw(e){const n=an(e),r=Array.isArray(n.parents)?n.parents.map(f=>{const p=an(f);return{id:it(p.id),relation:vt(p.relation),explanation:vt(p.explanation),edgeType:vt(p.edgeType??p.edge_type)}}).filter(f=>f.id):[],s=Array.isArray(n.artifacts)?n.artifacts.map(f=>{const p=an(f);return{path:it(p.path),type:vt(p.type)}}).filter(f=>f.path):[],a=vt(n.description),c=an(n.timestamp),u=uu(n.parentIds??n.parent_ids);return{id:it(n.id??n.node_id),title:it(n.title,it(n.id??n.node_id,"Trace node")),type:it(n.type??n.node_type,"step"),nodeType:vt(n.nodeType??n.node_type),status:it(n.status,"done"),agent:vt(n.agent??n.agent_name),description:a,summary:vt(n.summary)??a,content:vt(n.content)??a,reason:vt(n.reason),context:vt(n.context),parents:r,artifacts:s,parentIds:u.length?u:r.map(f=>f.id),childIds:uu(n.childIds??n.child_ids),createdAt:vt(n.createdAt??n.created_at),updatedAt:vt(n.updatedAt??n.updated_at),timestamp:{createdAt:vt(c.createdAt??c.created_at),startedAt:vt(c.startedAt??c.started_at),completedAt:vt(c.completedAt??c.completed_at)},durationMs:ga(n.durationMs??n.duration_ms),errorMessage:vt(n.errorMessage??n.error_message),toolCalls:uu(n.toolCalls??n.tool_calls),metadata:Kv(n.metadata)}}function nw(e){const n=an(e),r=ya(n),s=r.runState??{},c=(Array.isArray(r.agents)?r.agents:[]).map(u=>{const f=an(u);return{name:it(f.name),status:it(f.status,"idle"),task:it(f.task,""),updatedAt:vt(f.updatedAt),alive:typeof f.alive=="boolean"?f.alive:void 0}});return{runState:{active:s.active===!0,runId:vt(s.runId)??null},agents:c,lastActivityTs:it(r.lastActivityTs,"")}}function rw(e){const n=an(e),r=an(n.meta),s=Array.isArray(n.nodes)?n.nodes.map(tw):[],a=new Map;for(const c of s)for(const u of c.parentIds){const f=a.get(u)??new Set;f.add(c.id),a.set(u,f)}return{meta:{...ya(r),sessionId:it(r.sessionId??r.session_id),userId:vt(r.userId??r.user_id),projectName:vt(r.projectName??r.project_name),currentFocus:vt(r.currentFocus??r.current_focus),createdAt:vt(r.createdAt??r.created_at)},nodes:s.map(c=>({...c,childIds:c.childIds.length?c.childIds:Array.from(a.get(c.id)??[])}))}}function iw(e){const n=an(e);return ya(n)}const dg=iw;let sw={username:"fy"};sw.username;const Je="/api";function et(e,n={}){return fetch(e,{credentials:"include",...n})}function rt(e=!0){return e?{"Content-Type":"application/json"}:{}}async function Wu(e){if((e.headers.get("content-type")||"").includes("application/json")){const s=await e.json().catch(()=>null);if(typeof(s==null?void 0:s.detail)=="string")return s.detail}return await e.text().catch(()=>"")||`Request failed (${e.status})`}async function ot(e){if(!e.ok)throw new Error(await Wu(e));if(e.status!==204)return await e.json()}function aw(e){return`${Je}/sessions/${encodeURIComponent(e)}/sse`}const Ve={async getVersion(){return ot(await et(`${Je}/version`))},auth:{async me(){const e=await ot(await et(`${Je}/auth/me`,{headers:rt()}));return Vv(e)}},sandbox:{async list(){return(await ot(await et(`${Je}/sandbox/list`,{headers:rt()}))).map(n=>du(n))},async create(e="default"){const n=await ot(await et(`${Je}/sandbox/create`,{method:"POST",headers:rt(),body:JSON.stringify({sandbox_name:e})}));return du(n)},async rebuild(e){const n=new URLSearchParams({sandbox_id:e}),r=await ot(await et(`${Je}/sandbox/rebuild?${n}`,{method:"POST",headers:rt()}));return du(r)},async destroy(e){await ot(await et(`${Je}/sandbox/${e}`,{method:"DELETE",headers:rt()}))},async stats(e){const n=await ot(await et(`${Je}/sandbox/${e}/stats`,{headers:rt()}));return Gv(n)},async logs(e,n=200){const r=new URLSearchParams({tail:String(n)});return(await ot(await et(`${Je}/sandbox/${e}/logs?${r}`,{headers:rt()}))).logs||""},async reloadConfig(e){const n=await et(`${Je}/sandbox/reload-config?sandbox_id=${e}`,{method:"POST",headers:rt()});if(!n.ok){const r=await n.json().catch(()=>({}));throw new Error(r.detail||`Reload failed (${n.status})`)}return ot(n)},async health(e){return ot(await et(`${Je}/sandbox/${e}/health`,{headers:rt()}))},async listFiles(e,n="/workspace"){const r=new URLSearchParams({path:n});return(await ot(await et(`${Je}/sandbox/${e}/files?${r}`,{headers:rt()}))).map(a=>Yv(a))},async readFile(e,n){const r=new URLSearchParams({path:n}),s=await ot(await et(`${Je}/sandbox/${e}/files/content?${r}`,{headers:rt()}));return Xv(s)},async readRawFile(e,n){const r=new URLSearchParams({path:n}),s=await et(`${Je}/sandbox/${e}/files/raw?${r}`,{headers:rt(!1)});if(!s.ok)throw new Error(await Wu(s));return s.blob()},async readFileBlob(e,n){return this.readRawFile(e,n)},async deleteFile(e,n){const r=new URLSearchParams({path:n}),s=await et(`${Je}/sandbox/${e}/files?${r}`,{method:"DELETE",headers:rt()});if(!s.ok)throw new Error(await Wu(s))}},sessions:{async list(){const e=await ot(await et(`${Je}/sessions`,{headers:rt()}));return(Array.isArray(e)?e:Array.isArray(e==null?void 0:e.sessions)?e.sessions:[]).map(r=>zo(r))},async get(e){const n=await ot(await et(`${Je}/sessions/${e}`,{headers:rt()}));return zo(n)},async create(e="New research session",n={}){const r=await ot(await et(`${Je}/sessions`,{method:"POST",headers:rt(),body:JSON.stringify({title:e,...n.providerId?{providerId:n.providerId}:{},...n.modelId?{modelId:n.modelId}:{}})}));return zo(r)},async update(e,n){const r=await ot(await et(`${Je}/sessions/${e}`,{method:"PUT",headers:rt(),body:JSON.stringify({title:n})}));return zo(r)},async remove(e){await ot(await et(`${Je}/sessions/${e}`,{method:"DELETE",headers:rt()}))},async interrupt(e){return ot(await et(`${Je}/sessions/${e}/messages`,{method:"POST",headers:{...rt(),"Content-Type":"application/json"},body:JSON.stringify({type:"interrupt",session_id:e})}))},async postMessage(e,n){return ot(await et(`${Je}/sessions/${e}/messages`,{method:"POST",headers:{...rt(),"Content-Type":"application/json"},body:JSON.stringify({type:n.type??"user_message",content:n.content,session_id:e,data:{uuid:n.uuid,timestamp:n.timestamp}})}))},async commands(e){return ot(await et(`${Je}/sessions/${e}/commands`,{headers:rt()}))},async respondToInput(e,n){return ot(await et(`${Je}/sessions/${e}/messages`,{method:"POST",headers:{...rt(),"Content-Type":"application/json"},body:JSON.stringify({type:"user_input_response",session_id:e,request_id:n.requestId,answer:n.answer})}))},async getTrace(e){const n=await ot(await et(`${Je}/sessions/${e}/trace`,{headers:rt()}));return rw(n)},async getEvents(e){const n=await et(`${Je}/sessions/${e}/events`,{headers:rt()});if(!n.ok)return[];if(!(n.headers.get("content-type")||"").includes("application/json"))return[];const s=await n.json().catch(()=>({}));return Array.isArray(s.events)?s.events:[]},async state(e){const n=await ot(await et(`${Je}/sessions/${e}/state`,{headers:rt()}));return nw(n)}},ui:{async promptSuggestions(){return[]}},settings:{async get(){const e=await ot(await et(`${Je}/settings`,{headers:rt()}));return xm(e)},async update(e){const n=await ot(await et(`${Je}/settings`,{method:"PUT",headers:rt(),body:JSON.stringify(Qv(e))}));return xm(n)},async resetConfig(){await ot(await et(`${Je}/settings/reset-config`,{method:"POST",headers:rt()}))}},mcpServers:{async list(){return(await ot(await et(`${Je}/mcp-servers`,{headers:rt()}))).map(fu)},async add(e,n){const r=await ot(await et(`${Je}/mcp-servers`,{method:"POST",headers:rt(),body:JSON.stringify({name:e,config:bm(n)})}));return fu(r)},async update(e,n){const r=await ot(await et(`${Je}/mcp-servers/${e}`,{method:"PUT",headers:rt(),body:JSON.stringify(bm(n))}));return fu(r)},async remove(e){await ot(await et(`${Je}/mcp-servers/${e}`,{method:"DELETE",headers:rt()}))}},providers:{async list(){return(await ot(await et(`${Je}/provider/profiles`,{headers:rt()}))).map(n=>bi(n))},async create(e){const n=await ot(await et(`${Je}/provider/profiles`,{method:"POST",headers:rt(),body:JSON.stringify(Jv(e))}));return bi(n)},async update(e,n){const r=await ot(await et(`${Je}/provider/profiles/${e}`,{method:"PUT",headers:rt(),body:JSON.stringify(ew(n))}));return bi(r)},async remove(e){await ot(await et(`${Je}/provider/profiles/${e}`,{method:"DELETE",headers:rt()}))},async getActive(){const e=await et(`${Je}/provider/profiles/active`,{headers:rt()});return e.status===204?null:bi(await ot(e))},async setActive(e){const n=await ot(await et(`${Je}/provider/profiles/active`,{method:"POST",headers:rt(),body:JSON.stringify({id:e})}));return bi(n)},async health(){return(await ot(await et(`${Je}/provider/profiles/health`,{headers:rt()}))).map(n=>bi(n))},async test(e){const n=await ot(await et(`${Je}/provider/profiles/${e}/test`,{method:"POST",headers:rt()}));return bi(n)}}},fg=N.createContext(null);function ow({children:e}){const[n,r]=N.useState(null),[s,a]=N.useState(!1);N.useEffect(()=>{let u=!1;async function f(){try{const p=await Ve.auth.me();u||(r(p),a(!0))}catch{if(u)return;r({id:"local",username:"local",createdAt:new Date(0).toISOString()}),a(!0)}}return f(),()=>{u=!0}},[]);const c=N.useMemo(()=>({user:n,isAuthReady:s}),[n,s]);return l.jsx(fg.Provider,{value:c,children:e})}function gl(){const e=N.useContext(fg);if(!e)throw new Error("useAuth must be used within AuthProvider");return e}function bn(e,n){return{"zh-CN":e,"en-US":n}}const lw=bn({"sidebar.newChat":"新对话","sidebar.plugins":"插件","sidebar.automations":"自动化","sidebar.demo":"Live Demo","sidebar.conversations":"对话","sidebar.search":"搜索对话","sidebar.loading":"加载中","sidebar.sessionCount":"{count} 个会话","sidebar.empty":"尚无会话","sidebar.settings":"设置","sidebar.aria.nav":"工作区导航","sidebar.aria.primary":"主导航","sidebar.aria.resize":"调整侧边栏宽度","sidebar.aria.expand":"展开侧边栏","sidebar.aria.collapse":"收起侧边栏","sidebar.aria.newConversation":"新建对话","sidebar.aria.saveTitle":"保存对话标题","sidebar.aria.cancelRename":"取消重命名","sidebar.aria.confirmDelete":"确认删除","sidebar.aria.cancelDelete":"取消删除","sidebar.aria.rename":"重命名对话","sidebar.aria.delete":"删除对话"},{"sidebar.newChat":"New chat","sidebar.plugins":"Plugins","sidebar.automations":"Automations","sidebar.demo":"Live Demo","sidebar.conversations":"Conversations","sidebar.search":"Search conversations","sidebar.loading":"Loading","sidebar.sessionCount":"{count} sessions","sidebar.empty":"No conversations yet","sidebar.settings":"Settings","sidebar.aria.nav":"Workspace navigation","sidebar.aria.primary":"Primary","sidebar.aria.resize":"Resize sidebar","sidebar.aria.expand":"Expand sidebar","sidebar.aria.collapse":"Collapse sidebar","sidebar.aria.newConversation":"New conversation","sidebar.aria.saveTitle":"Save session title","sidebar.aria.cancelRename":"Cancel rename","sidebar.aria.confirmDelete":"Confirm delete","sidebar.aria.cancelDelete":"Cancel delete","sidebar.aria.rename":"Rename session","sidebar.aria.delete":"Delete session"}),cw=bn({"sandbox.conn.disconnected":"断联","sandbox.conn.connected":"正常","sandbox.conn.connecting":"连接中","sandbox.conn.creating":"创建中","sandbox.status.creating":"正在创建沙盒","sandbox.status.rebuilding":"正在重建沙盒","sandbox.status.destroying":"正在删除沙盒","sandbox.status.missing":"尚未创建沙盒","sandbox.status.quotaExceeded":"沙盒磁盘配额已超限","sandbox.status.error":"沙盒状态异常","sandbox.status.running":"沙盒运行正常","sandbox.status.runningDisconnected":"沙盒运行中,消息流未连接","sandbox.status.fallback":"沙盒状态:{status}","sandbox.empty":"创建沙盒后,将在这里显示容器、端口、资源占用和文件工作区状态。","sandbox.label.name":"名称","sandbox.label.id":"ID","sandbox.label.container":"容器","sandbox.label.hostApi":"宿主 API","sandbox.label.port":"端口","sandbox.label.created":"创建于","sandbox.label.memory":"内存","sandbox.label.cpu":"CPU","sandbox.label.pids":"进程数","sandbox.label.disk":"磁盘","sandbox.label.health":"健康","sandbox.label.runtime":"运行时","sandbox.label.sse":"消息流","sandbox.label.checked":"检查于","sandbox.cpuUsed":"{percent}% 占用","sandbox.cpuQuota":"配额 {quota}% · {cpus} 核","sandbox.unlimited":"无限制","sandbox.health.checking":"检查中","sandbox.health.unknown":"未知","sandbox.health.online":"在线","sandbox.health.offline":"离线","sandbox.health.connected":"已连接","sandbox.logs.loading":"正在加载日志…","sandbox.logs.empty":"尚未加载沙盒日志。","sandbox.logs.failed":"加载沙盒详情失败。","sandbox.action.rebuild":"重建","sandbox.action.refresh":"刷新","sandbox.action.logs":"日志","sandbox.action.delete":"删除","sandbox.action.build":"创建","sandbox.aria.status":"沙盒状态","sandbox.overlay.timeout":"创建超时","sandbox.overlay.creating":"正在创建沙盒…","sandbox.overlay.rebuilding":"正在重建沙盒…","sandbox.overlay.preparing":"正在准备环境…","sandbox.overlay.title":"正在准备您的研究环境","sandbox.overlay.aria":"沙盒构建中"},{"sandbox.conn.disconnected":"Disconnected","sandbox.conn.connected":"Connected","sandbox.conn.connecting":"Connecting","sandbox.conn.creating":"Creating","sandbox.status.creating":"Creating sandbox","sandbox.status.rebuilding":"Rebuilding sandbox","sandbox.status.destroying":"Deleting sandbox","sandbox.status.missing":"No sandbox yet","sandbox.status.quotaExceeded":"Sandbox disk quota exceeded","sandbox.status.error":"Sandbox error","sandbox.status.running":"Sandbox running","sandbox.status.runningDisconnected":"Running — message stream disconnected","sandbox.status.fallback":"Sandbox status: {status}","sandbox.empty":"Once a sandbox is created, its container, port, resource usage and file workspace will appear here.","sandbox.label.name":"Name","sandbox.label.id":"ID","sandbox.label.container":"Container","sandbox.label.hostApi":"Host API","sandbox.label.port":"Port","sandbox.label.created":"Created","sandbox.label.memory":"Memory","sandbox.label.cpu":"CPU","sandbox.label.pids":"PIDs","sandbox.label.disk":"Disk","sandbox.label.health":"Health","sandbox.label.runtime":"Runtime","sandbox.label.sse":"SSE","sandbox.label.checked":"Checked","sandbox.cpuUsed":"{percent}% used","sandbox.cpuQuota":"quota {quota}% · {cpus} CPUs","sandbox.unlimited":"unlimited","sandbox.health.checking":"checking","sandbox.health.unknown":"unknown","sandbox.health.online":"online","sandbox.health.offline":"offline","sandbox.health.connected":"connected","sandbox.logs.loading":"Loading logs...","sandbox.logs.empty":"No sandbox logs loaded.","sandbox.logs.failed":"Failed to load sandbox details.","sandbox.action.rebuild":"Rebuild","sandbox.action.refresh":"Refresh","sandbox.action.logs":"Logs","sandbox.action.delete":"Delete","sandbox.action.build":"Build","sandbox.aria.status":"Sandbox status","sandbox.overlay.timeout":"Creation timed out","sandbox.overlay.creating":"Creating sandbox…","sandbox.overlay.rebuilding":"Rebuilding sandbox…","sandbox.overlay.preparing":"Preparing environment…","sandbox.overlay.title":"Preparing your research environment","sandbox.overlay.aria":"Sandbox building"}),uw=bn({"shell.aria.workspace":"科研工作区","shell.aria.toolbarActions":"工作区操作","shell.aria.activeSession":"当前会话","shell.sessionLabel":"会话","shell.defaultWorkspace":"BrainPilot 科研工作区","shell.aria.viewTabs":"工作区视图","shell.view.chat":"对话","shell.view.agents":"智能体","shell.view.trace":"轨迹","shell.aria.refreshMessages":"刷新消息","shell.terminal.minimize":"最小化终端","shell.terminal.open":"打开终端","shell.files.close":"关闭文件","shell.files.open":"打开文件","shell.bootstrapping":"正在载入工作区…"},{"shell.aria.workspace":"Research workspace","shell.aria.toolbarActions":"Workspace actions","shell.aria.activeSession":"Active session","shell.sessionLabel":"Session","shell.defaultWorkspace":"BrainPilot research workspace","shell.aria.viewTabs":"Workspace view","shell.view.chat":"Chat","shell.view.agents":"Agents","shell.view.trace":"Trace","shell.aria.refreshMessages":"Refresh messages","shell.terminal.minimize":"Minimize terminal","shell.terminal.open":"Open terminal","shell.files.close":"Close files","shell.files.open":"Open files","shell.bootstrapping":"Loading workspace…"}),dw=bn({"settings.aria.dialog":"设置","settings.eyebrow.workspace":"工作区","settings.title":"设置","settings.aria.close":"关闭设置","settings.aria.sections":"设置分区","settings.loading":"正在加载设置…","settings.loadFailed":"加载设置失败","settings.tab.account":"账户","settings.tab.providers":"服务商","settings.tab.mcp":"MCP","settings.tab.preferences":"偏好","settings.account.title":"账户","settings.account.username":"用户名","settings.account.userId":"用户 ID","settings.account.created":"创建于","settings.account.managedByHost":"身份与登录由托管层管理。","settings.providers.title":"服务商","settings.providers.desc":"服务商配置包含 API 接入设置和可供新会话使用的模型列表。","settings.providers.add":"添加服务商","settings.providers.noModelList":"无模型列表","settings.providers.statusTitle":"状态:{status}","settings.providers.edit":"编辑","settings.providers.test":"测试","settings.providers.use":"使用","settings.providers.remove":"移除","settings.providers.shared":"共享服务商","settings.providers.private":"私有服务商","settings.providers.tested":"已测试 “{name}”:{status}","settings.providers.testFailed":"测试失败","settings.providers.updated":"服务商已更新","settings.providers.added":"服务商已添加","settings.providers.activeSwitched":"已切换活动服务商为 “{name}”。新会话将使用该服务商。","settings.providers.saveFailed":"保存服务商失败","settings.providers.modelRequired":"至少需要配置一个模型","settings.mcp.title":"MCP 服务器","settings.mcp.desc":"MCP 服务器配置定义了智能体会话可用的外部工具。","settings.mcp.addServer":"添加服务器","settings.mcp.edit":"编辑","settings.mcp.remove":"移除","settings.mcp.updated":"MCP 服务器已更新","settings.mcp.added":"MCP 服务器已添加","settings.mcp.saveFailed":"保存 MCP 服务器失败","settings.prefs.title":"偏好设置","settings.prefs.theme":"主题","settings.prefs.themeLight":"浅色","settings.prefs.themeDark":"深色","settings.prefs.themeSystem":"跟随系统","settings.prefs.language":"语言","settings.prefs.confirmDangerous":"危险操作前确认","settings.prefs.notifyDone":"智能体任务完成时通知","settings.providerForm.editAria":"编辑服务商","settings.providerForm.addAria":"添加服务商","settings.providerForm.eyebrow":"服务商","settings.providerForm.editTitle":"编辑服务商","settings.providerForm.addTitle":"添加服务商","settings.providerForm.close":"关闭服务商表单","settings.providerForm.name":"服务商名称","settings.providerForm.baseUrl":"基础 URL","settings.providerForm.apiKey":"API 密钥","settings.providerForm.apiKeyKeep":"(留空则保持不变)","settings.providerForm.hideKey":"隐藏 API 密钥","settings.providerForm.showKey":"显示 API 密钥","settings.providerForm.notes":"备注","settings.providerForm.notesPlaceholder":"用途备注、计费或路由提示","settings.providerForm.models":"模型","settings.providerForm.addModel":"添加模型","settings.providerForm.removeModel":"移除模型","settings.providerForm.useColor":"使用颜色 {color}","settings.providerForm.color":"颜色","settings.providerForm.cancel":"取消","settings.providerForm.save":"保存服务商","settings.mcpForm.editAria":"编辑 MCP 服务器","settings.mcpForm.addAria":"添加 MCP 服务器","settings.mcpForm.eyebrow":"MCP 服务器","settings.mcpForm.editTitle":"编辑服务器","settings.mcpForm.addTitle":"添加服务器","settings.mcpForm.close":"关闭 MCP 服务器表单","settings.mcpForm.name":"名称","settings.mcpForm.transport":"传输方式","settings.mcpForm.transportAria":"MCP 传输方式","settings.mcpForm.command":"命令","settings.mcpForm.arguments":"参数","settings.mcpForm.url":"URL","settings.mcpForm.cancel":"取消","settings.mcpForm.save":"保存服务器"},{"settings.aria.dialog":"Settings","settings.eyebrow.workspace":"Workspace","settings.title":"Settings","settings.aria.close":"Close settings","settings.aria.sections":"Settings sections","settings.loading":"Loading settings...","settings.loadFailed":"Failed to load settings","settings.tab.account":"Account","settings.tab.providers":"Providers","settings.tab.mcp":"MCP","settings.tab.preferences":"Preferences","settings.account.title":"Account","settings.account.username":"Username","settings.account.userId":"User ID","settings.account.created":"Created","settings.account.managedByHost":"Identity and sign-in are managed by the hosting layer.","settings.providers.title":"Providers","settings.providers.desc":"Provider profiles contain both API provider settings and the model list available for new sessions.","settings.providers.add":"Add Provider","settings.providers.noModelList":"No model list","settings.providers.statusTitle":"Status: {status}","settings.providers.edit":"Edit","settings.providers.test":"Test","settings.providers.use":"Use","settings.providers.remove":"Remove","settings.providers.shared":"Shared Providers","settings.providers.private":"Private Providers","settings.providers.tested":'Tested "{name}": {status}',"settings.providers.testFailed":"Test failed","settings.providers.updated":"Provider updated","settings.providers.added":"Provider added","settings.providers.activeSwitched":'Active provider switched to "{name}". New sessions will use this provider.',"settings.providers.saveFailed":"Failed to save provider","settings.providers.modelRequired":"At least one model is required","settings.mcp.title":"MCP Servers","settings.mcp.desc":"MCP server profiles define external tools available to agent sessions.","settings.mcp.addServer":"Add Server","settings.mcp.edit":"Edit","settings.mcp.remove":"Remove","settings.mcp.updated":"MCP server updated","settings.mcp.added":"MCP server added","settings.mcp.saveFailed":"Failed to save MCP server","settings.prefs.title":"Preferences","settings.prefs.theme":"Theme","settings.prefs.themeLight":"Light","settings.prefs.themeDark":"Dark","settings.prefs.themeSystem":"System","settings.prefs.language":"Language","settings.prefs.confirmDangerous":"Confirm dangerous actions","settings.prefs.notifyDone":"Notify when agent work completes","settings.providerForm.editAria":"Edit provider","settings.providerForm.addAria":"Add provider","settings.providerForm.eyebrow":"Provider","settings.providerForm.editTitle":"Edit Provider","settings.providerForm.addTitle":"Add Provider","settings.providerForm.close":"Close provider form","settings.providerForm.name":"Provider name","settings.providerForm.baseUrl":"Base URL","settings.providerForm.apiKey":"API key","settings.providerForm.apiKeyKeep":"(leave blank to keep current)","settings.providerForm.hideKey":"Hide API key","settings.providerForm.showKey":"Show API key","settings.providerForm.notes":"Notes","settings.providerForm.notesPlaceholder":"Usage notes, billing, or routing hint","settings.providerForm.models":"Models","settings.providerForm.addModel":"Add model","settings.providerForm.removeModel":"Remove model","settings.providerForm.useColor":"Use color {color}","settings.providerForm.color":"Color","settings.providerForm.cancel":"Cancel","settings.providerForm.save":"Save Provider","settings.mcpForm.editAria":"Edit MCP server","settings.mcpForm.addAria":"Add MCP server","settings.mcpForm.eyebrow":"MCP Server","settings.mcpForm.editTitle":"Edit Server","settings.mcpForm.addTitle":"Add Server","settings.mcpForm.close":"Close MCP server form","settings.mcpForm.name":"Name","settings.mcpForm.transport":"Transport","settings.mcpForm.transportAria":"MCP transport","settings.mcpForm.command":"Command","settings.mcpForm.arguments":"Arguments","settings.mcpForm.url":"URL","settings.mcpForm.cancel":"Cancel","settings.mcpForm.save":"Save Server"}),fw=bn({"chat.generating":"正在生成...","chat.totalTime":"本轮对话用时 {time}","chat.streaming":"生成中","chat.toolPrefix":"工具:{name}","chat.thinkingSteps":"思考过程 · {count} 步","chat.toolCall":"调用工具:{name}","chat.thinking":"思考中…","chat.heading":"要在 BrainPilot 中研究什么?","chat.aria.messages":"对话消息","chat.messageCount":"{count} 条消息","chat.aria.expandThinking":"展开思考过程","chat.agentThinking":"智能体思考中","chat.aria.stop":"停止生成","chat.stop":"停止","chat.aria.newPrompt":"新的研究提问","chat.srAsk":"提出一个研究问题","chat.placeholder":"向 MAS 提问。输入 @ 使用插件或提及文件","chat.aria.attachContext":"添加上下文","chat.command":"命令","chat.modelPlaceholder":"模型","chat.aria.voice":"语音输入","chat.aria.attachFile":"添加文件","chat.aria.send":"发送消息","chat.copy":"复制","chat.copied":"已复制","chat.aria.copyMessage":"复制消息","chat.aria.suggested":"推荐研究任务","chat.noActiveProvider":"无活动服务商","chat.providerTitle":"服务商:{name}","chat.status.startSandbox":"请先启动 sandbox。","chat.status.preparing":"正在准备发送。","chat.status.connecting":"正在连接实时通道。","chat.error.saveModel":"保存模型选择失败:{msg}","chat.error.reloadConfig":"模型已保存,但容器热更新失败:{msg}","chat.system.info":"信息","chat.system.warning":"警告","chat.system.error":"错误","chat.system.fatal":"严重错误","chat.system.details":"技术详情","chat.ask.title":"需要你的输入","chat.ask.freeTextPlaceholder":"输入你的回答…","chat.ask.submit":"提交","chat.ask.answered":"已回答:{answer}","chat.ask.timeoutLeft":"剩余 {sec} 秒","chat.ask.timedOut":"已超时","chat.retry.title":"自动重试中","chat.retry.attempt":"第 {attempt}/{max} 次尝试","chat.retry.countdown":"{sec} 秒后重试","chat.retry.cancel":"取消","chat.retry.cancelled":"已取消重试"},{"chat.generating":"Generating...","chat.totalTime":"Total time: {time}","chat.streaming":"streaming","chat.toolPrefix":"Tool: {name}","chat.thinkingSteps":"Thinking · {count} steps","chat.toolCall":"Calling tool: {name}","chat.thinking":"Thinking…","chat.heading":"What would you like to research in BrainPilot?","chat.aria.messages":"Conversation messages","chat.messageCount":"{count} messages","chat.aria.expandThinking":"Expand thinking process","chat.agentThinking":"Agent is thinking","chat.aria.stop":"Stop generating","chat.stop":"stop","chat.aria.newPrompt":"New research prompt","chat.srAsk":"Ask a research question","chat.placeholder":"Ask MAS. Type @ to use plugins or mention files","chat.aria.attachContext":"Attach context","chat.command":"command","chat.modelPlaceholder":"Model","chat.aria.voice":"Voice input","chat.aria.attachFile":"Attach file","chat.aria.send":"Send message","chat.copy":"Copy","chat.copied":"Copied","chat.aria.copyMessage":"Copy message","chat.aria.suggested":"Suggested research tasks","chat.noActiveProvider":"No active provider","chat.providerTitle":"Provider: {name}","chat.status.startSandbox":"Please start the sandbox first.","chat.status.preparing":"Preparing to send.","chat.status.connecting":"Connecting to the live channel.","chat.error.saveModel":"Failed to save model selection: {msg}","chat.error.reloadConfig":"Model saved, but container hot-reload failed: {msg}","chat.system.info":"Info","chat.system.warning":"Warning","chat.system.error":"Error","chat.system.fatal":"Fatal error","chat.system.details":"Technical details","chat.ask.title":"Your input is needed","chat.ask.freeTextPlaceholder":"Type your answer…","chat.ask.submit":"Submit","chat.ask.answered":"Answered: {answer}","chat.ask.timeoutLeft":"{sec}s left","chat.ask.timedOut":"Timed out","chat.retry.title":"Auto-retrying","chat.retry.attempt":"Attempt {attempt}/{max}","chat.retry.countdown":"Retrying in {sec}s","chat.retry.cancel":"Cancel","chat.retry.cancelled":"Retry cancelled"}),pw=bn({"search.aria":"搜索对话","search.placeholder":"搜索对话","search.recent":"近期对话","search.empty":"没有找到匹配的对话"},{"search.aria":"Search conversations","search.placeholder":"Search conversations","search.recent":"Recent conversations","search.empty":"No matching conversations found"}),mw=bn({"quota.warning.title":"磁盘空间不足","quota.warning.close":"关闭","quota.warning.bodyPrefix":"当前沙盒磁盘使用已达 ","quota.warning.bodySuffix":",接近配额上限。","quota.warning.body2":"请及时清理不必要的文件,否则达到 100% 后沙盒将无法正常使用。","quota.warning.ack":"知道了","quota.critical.title":"磁盘配额已超限 — 请立即清理文件","quota.critical.unavailable":"沙盒已不可用","quota.critical.used":"已用 {used} / 限额 {limit}","quota.fm.loadFailed":"加载文件列表失败","quota.fm.confirmDelete":"确认删除 {name} 吗?","quota.fm.deleteFailed":"删除失败","quota.fm.delete":"删除","quota.fm.loading":"加载中…"},{"quota.warning.title":"Low disk space","quota.warning.close":"Close","quota.warning.bodyPrefix":"Sandbox disk usage has reached ","quota.warning.bodySuffix":", approaching the quota limit.","quota.warning.body2":"Please clean up unnecessary files promptly, otherwise the sandbox will stop working once it reaches 100%.","quota.warning.ack":"Got it","quota.critical.title":"Disk quota exceeded — clean up files now","quota.critical.unavailable":"Sandbox is no longer available","quota.critical.used":"Used {used} / Limit {limit}","quota.fm.loadFailed":"Failed to load file list","quota.fm.confirmDelete":"Delete {name}?","quota.fm.deleteFailed":"Delete failed","quota.fm.delete":"Delete","quota.fm.loading":"Loading…"}),hw=bn({"files.aria.sidebar":"工作区文件","files.aria.resizeSidebar":"调整文件栏宽度","files.eyebrow.workspace":"工作区","files.title":"文件","files.selectedCount":"已选 {count} 个","files.packing":"打包中","files.download":"下载","files.aria.clearSelection":"清除文件选择","files.aria.refresh":"刷新文件","files.aria.close":"关闭文件","files.live":"实时后端","files.offline":"沙盒离线","files.aria.tree":"文件树","files.selectForDownload":"选择 {name} 以下载","files.error.notRunning":"Sandbox 未运行,无法读取文件。","files.error.downloadFailed":"下载文件失败","files.error.refreshFailed":"刷新文件失败","files.error.previewFailed":"无法预览文件","files.error.loadPreviewFailed":"无法加载文件预览","files.preview.aria":"文件预览","files.preview.ariaResize":"调整预览宽度","files.preview.eyebrow":"预览","files.preview.downloading":"下载中","files.preview.download":"下载","files.preview.restore":"还原预览","files.preview.maximize":"最大化预览","files.preview.close":"关闭预览","files.preview.path":"路径","files.preview.size":"大小","files.preview.modified":"修改时间","files.preview.mode":"权限","files.preview.tooLarge":"该文件超过内嵌预览大小上限,可下载后查看。","files.preview.unreadable":"打包时无法读取该文件(可能路径无效或不在当前沙箱中)。","files.preview.loadingImage":"正在加载图片…","files.preview.loadingPdf":"正在加载 PDF…","files.preview.notPreviewable":"该文件类型可下载,但不支持内嵌预览。","files.preview.loading":"正在加载预览…"},{"files.aria.sidebar":"Workspace files","files.aria.resizeSidebar":"Resize files sidebar","files.eyebrow.workspace":"Workspace","files.title":"Files","files.selectedCount":"{count} selected","files.packing":"Packing","files.download":"Download","files.aria.clearSelection":"Clear file selection","files.aria.refresh":"Refresh files","files.aria.close":"Close files","files.live":"live backend","files.offline":"sandbox offline","files.aria.tree":"File tree","files.selectForDownload":"Select {name} for download","files.error.notRunning":"Sandbox is not running; cannot read files.","files.error.downloadFailed":"Failed to download file","files.error.refreshFailed":"Failed to refresh files","files.error.previewFailed":"Unable to preview file","files.error.loadPreviewFailed":"Unable to load file preview","files.preview.aria":"File preview","files.preview.ariaResize":"Resize file preview","files.preview.eyebrow":"Preview","files.preview.downloading":"Downloading","files.preview.download":"Download","files.preview.restore":"Restore preview","files.preview.maximize":"Maximize preview","files.preview.close":"Close preview","files.preview.path":"Path","files.preview.size":"Size","files.preview.modified":"Modified","files.preview.mode":"Mode","files.preview.tooLarge":"This file is larger than the inline preview limit; download it to view.","files.preview.unreadable":"This file could not be read when the demo was packaged (path invalid or not in the current sandbox).","files.preview.loadingImage":"Loading image...","files.preview.loadingPdf":"Loading PDF...","files.preview.notPreviewable":"This file type is available for download but is not previewed inline.","files.preview.loading":"Loading preview..."}),gw=bn({"trace.agents.eyebrow":"实时 Agent 网络","trace.agents.title":"Agents","trace.agents.emptyNoSession":"创建或选择会话后,这里会显示参与当前任务的 Agent 与它们之间的消息流。","trace.agents.emptyNoEvents":"当前会话还没有 Agent 状态事件。","trace.eyebrow":"推理轨迹","trace.title":"Trace","trace.loadFailed":"加载 Trace 失败","trace.aria.layoutDir":"Trace 布局方向","trace.aria.refreshControls":"Trace 刷新控制","trace.aria.refresh":"刷新 Trace","trace.autoRefreshTitle":"每 3 秒自动刷新 Trace","trace.live":"实时","trace.emptyNoSession":"创建或选择会话后,这里会显示任务分解和 Agent 协作轨迹。","trace.untitled":"未命名会话","trace.focus":"聚焦:{focus}","trace.nodes":"{visible}/{total} 个节点","trace.created":"创建于:{time}","trace.searchPlaceholder":"搜索标题、Agent、产物、工具…","trace.aria.clearSearch":"清除 Trace 搜索","trace.status":"状态","trace.aria.statusFilter":"Trace 状态筛选","trace.allStatus":"全部状态","trace.type":"类型","trace.aria.typeFilter":"Trace 类型筛选","trace.allTypes":"全部类型","trace.aria.graph":"Trace 图","trace.aria.zoomControls":"Trace 缩放控制","trace.aria.zoomOut":"缩小","trace.aria.zoomIn":"放大","trace.aria.resetZoom":"重置缩放","trace.noMatch":"没有节点匹配当前筛选条件。","trace.aria.playbackControls":"Trace 回放控制","trace.aria.pause":"暂停回放","trace.aria.play":"开始回放","trace.aria.playbackProgress":"回放进度","trace.status.done":"完成","trace.status.running":"进行中"},{"trace.agents.eyebrow":"Live agent network","trace.agents.title":"Agents","trace.agents.emptyNoSession":"Once you create or select a session, the agents involved in the current task and the message flow between them will appear here.","trace.agents.emptyNoEvents":"No agent status events in this session yet.","trace.eyebrow":"Reasoning trace","trace.title":"Trace","trace.loadFailed":"Failed to load trace","trace.aria.layoutDir":"Trace layout direction","trace.aria.refreshControls":"Trace refresh controls","trace.aria.refresh":"Refresh trace","trace.autoRefreshTitle":"Refresh trace automatically every 3 seconds","trace.live":"Live","trace.emptyNoSession":"Once you create or select a session, the task breakdown and agent collaboration trace will appear here.","trace.untitled":"Untitled session","trace.focus":"Focus: {focus}","trace.nodes":"{visible}/{total} nodes","trace.created":"Created: {time}","trace.searchPlaceholder":"Search title, agent, artifact, tool...","trace.aria.clearSearch":"Clear trace search","trace.status":"Status","trace.aria.statusFilter":"Trace status filter","trace.allStatus":"All status","trace.type":"Type","trace.aria.typeFilter":"Trace type filter","trace.allTypes":"All types","trace.aria.graph":"Trace graph","trace.aria.zoomControls":"Trace zoom controls","trace.aria.zoomOut":"Zoom out","trace.aria.zoomIn":"Zoom in","trace.aria.resetZoom":"Reset zoom","trace.noMatch":"No trace nodes match the current filters.","trace.aria.playbackControls":"Trace playback controls","trace.aria.pause":"Pause playback","trace.aria.play":"Play playback","trace.aria.playbackProgress":"Playback progress","trace.status.done":"done","trace.status.running":"running"}),yw=bn({"analytics.empty":"暂无数据。Agent 开始通信后这里会出现统计图表。","analytics.card.totalMessages":"消息总数","analytics.card.activeAgents":"活跃 Agent","analytics.card.runningNow":"{count} 个正在运行","analytics.card.avgLatency":"平均延迟","analytics.card.median":"中位数 {value}","analytics.card.noPairs":"暂无配对","analytics.card.errors":"错误","analytics.card.allClear":"一切正常","analytics.card.needsAttention":"需要关注","analytics.chart.volume":"消息量(最近一小时)","analytics.chart.load":"Agent 负载","analytics.chart.types":"消息类型","analytics.chart.latency":"响应延迟","analytics.chart.tokens":"Token 估算(已发送)","analytics.chart.heatmap":"活动热力图","analytics.table.agent":"Agent","analytics.table.msgs":"消息数","analytics.table.avgLen":"平均长度","analytics.table.tokens":"~Token","analytics.aria.volume":"消息量随时间变化","analytics.aria.load":"Agent 负载分布","analytics.aria.types":"消息类型分布","analytics.aria.latency":"响应延迟箱线图","analytics.aria.heatmap":"Agent 活动热力图","timeline.empty":"暂无消息。Agent 开始通信后这里会出现时间轴。","timeline.fit":"适应","timeline.filter.delegate":"委派","timeline.filter.result":"结果","timeline.filter.other":"其他","timeline.aria":"消息时间轴","overview.title":"会话概览","overview.agents":"Agent","overview.liveDormant":"{live} 在线 · {dormant} 休眠","overview.total":"共 {total} 个","overview.runningNow":"正在运行","overview.messages":"消息","overview.acrossLinks":"跨 {count} 条连接","overview.avgResponse":"平均响应","overview.median":"中位数 {value}","overview.lastActivity":"最近活动","overview.tipPrefix":"点击节点或消息链接查看详情,或切换到 ","overview.tipSuffix":" 获取更深入的洞察。"},{"analytics.empty":"No data yet. Charts will appear here once agents start communicating.","analytics.card.totalMessages":"Total messages","analytics.card.activeAgents":"Active agents","analytics.card.runningNow":"{count} running now","analytics.card.avgLatency":"Avg latency","analytics.card.median":"median {value}","analytics.card.noPairs":"no pairs yet","analytics.card.errors":"Errors","analytics.card.allClear":"all clear","analytics.card.needsAttention":"needs attention","analytics.chart.volume":"Message volume (last hour)","analytics.chart.load":"Agent load","analytics.chart.types":"Message types","analytics.chart.latency":"Response latency","analytics.chart.tokens":"Token estimate (sent)","analytics.chart.heatmap":"Activity heatmap","analytics.table.agent":"Agent","analytics.table.msgs":"Msgs","analytics.table.avgLen":"Avg len","analytics.table.tokens":"~Tokens","analytics.aria.volume":"Message volume over time","analytics.aria.load":"Agent load distribution","analytics.aria.types":"Message type distribution","analytics.aria.latency":"Response latency box plot","analytics.aria.heatmap":"Agent activity heatmap","timeline.empty":"No messages yet. A timeline will appear here once agents start communicating.","timeline.fit":"Fit","timeline.filter.delegate":"delegate","timeline.filter.result":"result","timeline.filter.other":"other","timeline.aria":"Message timeline","overview.title":"Session Overview","overview.agents":"Agents","overview.liveDormant":"{live} live · {dormant} dormant","overview.total":"{total} total","overview.runningNow":"Running now","overview.messages":"Messages","overview.acrossLinks":"across {count} links","overview.avgResponse":"Avg response","overview.median":"median {value}","overview.lastActivity":"Last activity","overview.tipPrefix":"Click a node or message link for details, or switch to ","overview.tipSuffix":" for deeper insights."}),xw=bn({"network.empty":"当前会话还没有 Agent 协作活动。发送一条消息开始任务后,这里会出现 Agent 节点和它们之间的消息流。","network.legend.running":"运行中","network.legend.live":"在线","network.legend.dormant":"休眠","network.legend.error":"错误","network.legend.delegate":"委派","network.legend.result":"结果","network.legend.counter":"{live}/{total} 在线 · {running} 运行中 · {edges} 条连线 · {msgs} 条消息","network.aria.legend":"网络图例","network.aria.viewport":"Agent 协作网络","network.aria.detail":"选中详情","network.aria.tabs":"Agent 面板视图","network.aria.edgeOne":"{from} 向 {to} 发送了 {count} 条消息","network.aria.edgeMany":"{from} 向 {to} 发送了 {count} 条消息","network.aria.node":"{name} agent({status})","network.status.running":"运行中","network.status.idle":"空闲","network.status.error":"错误","network.status.stopped":"已停止","network.status.live":"在线","network.status.dormant":"休眠","network.node.notSpawned":"尚未创建","network.tab.detail":"详情","network.tab.analytics":"分析","network.tab.timeline":"时间线","network.detail.dormant":"休眠","network.detail.notSpawned":"尚未创建","network.detail.notAlive":"未存活","network.detail.responsibility":"职责","network.detail.status":"状态","network.detail.state":"状态","network.detail.currentTask":"当前任务","network.detail.idleWaiting":"空闲 — 等待指令","network.detail.notSpawnedByPrincipal":"尚未由 Principal 创建","network.detail.updated":"更新于","network.detail.communication":"通信","network.detail.commCount":"{sent} 已发送 · {received} 已接收","network.detail.activityStats":"活动统计","network.detail.totalMessages":"消息总数","network.detail.pctOfSession":"(占会话 {pct}%)","network.detail.messageBreakdown":"消息构成","network.detail.breakdownValue":"{assistant} 回复 · {reasoning} 推理 · {tool} 工具","network.detail.toolCalls":"工具调用","network.detail.topTools":"常用工具","network.detail.contentVolume":"内容量","network.detail.volumeValue":"{chars} 字符 · 约 {tokens} tokens","network.detail.communicationPartners":"通信对象","network.detail.availableTools":"可用工具","network.detail.noMcpTools":"无 MCP 工具","network.detail.displayFilters":"显示筛选","network.detail.filtersNote":"仅影响该 Agent 在聊天视图中的显示,网络图不受影响。","network.detail.sent":"已发送({count})","network.detail.received":"已接收({count})","network.detail.noOutgoing":"暂无发出的消息。","network.detail.noIncoming":"暂无收到的消息。","network.edge.messages":"{count} 条消息","network.edge.last":"最近:{time}","network.edge.conversation":"对话","network.msg.fallback":"消息","network.msg.empty":"(空)","network.msg.more":"+ 还有 {count} 条","network.filter.ariaGroup":"已隐藏的事件类型","network.filter.hiding":"隐藏:","network.filter.nothing":"无","network.filter.stopHiding":"取消隐藏 {label}","network.filter.addRule":"添加隐藏规则","network.filter.addFilter":"添加筛选","network.filter.popoverHeader":"隐藏以下类型的事件:","network.filter.messages.label":"消息","network.filter.messages.description":"该 Agent 的文本回复","network.filter.tools.label":"工具调用","network.filter.tools.description":"工具调用与结果","network.filter.hooks.label":"钩子","network.filter.hooks.description":"系统诊断事件"},{"network.empty":"No agent collaboration activity in this session yet. Once you send a message to start a task, agent nodes and the message flow between them will appear here.","network.legend.running":"running","network.legend.live":"live","network.legend.dormant":"dormant","network.legend.error":"error","network.legend.delegate":"delegate","network.legend.result":"result","network.legend.counter":"{live}/{total} live · {running} running · {edges} edges · {msgs} msgs","network.aria.legend":"Network legend","network.aria.viewport":"Agent collaboration network","network.aria.detail":"Selection detail","network.aria.tabs":"Agent panel views","network.aria.edgeOne":"{from} sent {count} message to {to}","network.aria.edgeMany":"{from} sent {count} messages to {to}","network.aria.node":"{name} agent ({status})","network.status.running":"running","network.status.idle":"idle","network.status.error":"error","network.status.stopped":"stopped","network.status.live":"live","network.status.dormant":"dormant","network.node.notSpawned":"not yet spawned","network.tab.detail":"Detail","network.tab.analytics":"Analytics","network.tab.timeline":"Timeline","network.detail.dormant":"dormant","network.detail.notSpawned":"not yet spawned","network.detail.notAlive":"not alive","network.detail.responsibility":"Responsibility","network.detail.status":"Status","network.detail.state":"State","network.detail.currentTask":"Current task","network.detail.idleWaiting":"Idle — waiting for instructions","network.detail.notSpawnedByPrincipal":"Not yet spawned by Principal","network.detail.updated":"Updated","network.detail.communication":"Communication","network.detail.commCount":"{sent} sent · {received} received","network.detail.activityStats":"Activity Statistics","network.detail.totalMessages":"Total messages","network.detail.pctOfSession":"({pct}% of session)","network.detail.messageBreakdown":"Message breakdown","network.detail.breakdownValue":"{assistant} assistant · {reasoning} reasoning · {tool} tool","network.detail.toolCalls":"Tool calls","network.detail.topTools":"Top tools","network.detail.contentVolume":"Content volume","network.detail.volumeValue":"{chars} chars · ~{tokens} tokens","network.detail.communicationPartners":"Communication partners","network.detail.availableTools":"Available tools","network.detail.noMcpTools":"no MCP tools","network.detail.displayFilters":"Display filters","network.detail.filtersNote":"Affects this agent in the Chat view only. Network graph is unchanged.","network.detail.sent":"Sent ({count})","network.detail.received":"Received ({count})","network.detail.noOutgoing":"No outgoing messages.","network.detail.noIncoming":"No incoming messages.","network.edge.messages":"{count} messages","network.edge.last":"last: {time}","network.edge.conversation":"Conversation","network.msg.fallback":"msg","network.msg.empty":"(empty)","network.msg.more":"+ {count} more","network.filter.ariaGroup":"Hidden event types","network.filter.hiding":"Hiding:","network.filter.nothing":"nothing","network.filter.stopHiding":"Stop hiding {label}","network.filter.addRule":"Add a hide rule","network.filter.addFilter":"add filter","network.filter.popoverHeader":"Hide events of type:","network.filter.messages.label":"messages","network.filter.messages.description":"Text replies from this agent","network.filter.tools.label":"tool calls","network.filter.tools.description":"Tool invocations and results","network.filter.hooks.label":"hooks","network.filter.hooks.description":"System diagnostic events"}),bw=bn({"profile.principal.role":"协调者 · 决策者","profile.principal.desc":"统筹整个研究流程,分解用户目标,将子任务分派给专家 Agent,校验结果并回复用户。是唯一可以创建或销毁其他 Agent 的 Agent。","profile.librarian.role":"知识检索 · 文献综合","profile.librarian.desc":"检索论文、网络资源与知识库;将发现综合为背景笔记、概念解释,以及有证据支撑的假设,供其他 Agent 使用。","profile.trace.role":"内部 · 轨迹图记录器","profile.trace.desc":"内部系统 Agent。将推理步骤记录为会话轨迹图中的节点与边;从不直接回复用户。","profile.experimentalist.role":"实验设计 · 验证","profile.experimentalist.desc":"设计并执行实验以检验假设;控制变量、将测量操作化,并根据结果迭代。","profile.engineer.role":"实现 · 可复现性","profile.engineer.desc":"将科学意图转化为可运行的代码,管理环境、数据管线、统计计算与可视化,并保证可复现性。","profile.writer.role":"科学写作 · 报告","profile.writer.desc":"将研究发现转化为清晰、严谨的论文、文档与报告,并针对受众进行调整。","profile.user.role":"人类用户","profile.user.desc":"通过聊天提示驱动会话的人类研究者。","profile.default.role":"专家 · 领域 Agent","profile.default.desc":"由主研究员创建的自定义专家 Agent。默认工具集涵盖消息通信、轨迹记录与网络/文档查询。"},{"profile.principal.role":"Coordinator · Decision-maker","profile.principal.desc":"Oversees the entire research process, decomposes user goals, dispatches subtasks to expert agents, validates results and replies to the user. The only agent that can spawn or destroy other agents.","profile.librarian.role":"Knowledge search · Literature synthesis","profile.librarian.desc":"Searches papers, web sources and knowledge bases; synthesizes findings into background notes, concept explanations and evidence-grounded hypotheses for other agents.","profile.trace.role":"Internal · Graph-of-Trace recorder","profile.trace.desc":"Internal system agent. Records reasoning steps as nodes and edges in the session's Graph of Trace; never replies to the user directly.","profile.experimentalist.role":"Experiment design · Validation","profile.experimentalist.desc":"Designs and executes experiments to test hypotheses; controls variables, operationalizes measurements and iterates based on results.","profile.engineer.role":"Implementation · Reproducibility","profile.engineer.desc":"Translates scientific intent into working code, manages environments, data pipelines, statistical computation and visualization with reproducibility guarantees.","profile.writer.role":"Scientific writing · Reporting","profile.writer.desc":"Transforms research findings into clear, rigorous papers, documentation and reports tailored to the audience.","profile.user.role":"Human user","profile.user.desc":"The human researcher driving the session through chat prompts.","profile.default.role":"Expert · Domain agent","profile.default.desc":"A custom expert agent spawned by the principal. Default toolkit covers messaging, trace recording and web/document lookup."}),vw=bn({"ctx.session.loadFailed":"加载会话失败","ctx.session.updateFailed":"更新会话失败","ctx.session.deleteFailed":"删除会话失败","ctx.session.startSandbox":"请先启动 sandbox","ctx.session.createFailed":"创建会话失败","ctx.session.newSession":"新研究会话","ctx.session.noConnection":"实时连接尚未建立","ctx.session.sendFailed":"发送失败","ctx.session.interruptFailed":"中断失败","ctx.session.refreshFailed":"刷新消息失败","ctx.sandbox.loadFailed":"加载沙箱失败","ctx.sandbox.createFailed":"创建沙箱失败","ctx.sandbox.rebuildFailed":"重建沙箱失败","ctx.sandbox.deleteFailed":"删除沙箱失败","ctx.sandbox.reloadFailed":"热更新失败","ctx.sse.parseError":"无法解析 SSE 事件"},{"ctx.session.loadFailed":"Failed to load sessions","ctx.session.updateFailed":"Failed to update session","ctx.session.deleteFailed":"Failed to delete session","ctx.session.startSandbox":"Please start the sandbox first","ctx.session.createFailed":"Failed to create session","ctx.session.newSession":"New research session","ctx.session.noConnection":"Live connection not established yet","ctx.session.sendFailed":"Failed to send","ctx.session.interruptFailed":"Failed to interrupt","ctx.session.refreshFailed":"Failed to refresh messages","ctx.sandbox.loadFailed":"Failed to load sandbox","ctx.sandbox.createFailed":"Failed to create sandbox","ctx.sandbox.rebuildFailed":"Failed to rebuild sandbox","ctx.sandbox.deleteFailed":"Failed to delete sandbox","ctx.sandbox.reloadFailed":"Hot-reload failed","ctx.sse.parseError":"Unable to parse SSE event"}),ww=bn({"terminal.connectFailed":"终端连接失败","terminal.aria.drawer":"工作区终端","terminal.aria.resize":"调整终端高度","terminal.aria.newTab":"新建终端标签","terminal.aria.clear":"清空终端","terminal.aria.reconnect":"重新连接终端","terminal.aria.minimize":"最小化终端"},{"terminal.connectFailed":"Terminal connection failed","terminal.aria.drawer":"Workspace terminals","terminal.aria.resize":"Resize terminal","terminal.aria.newTab":"New terminal tab","terminal.aria.clear":"Clear terminal","terminal.aria.reconnect":"Reconnect terminal","terminal.aria.minimize":"Minimize terminal"}),_w=bn({"demo.title":"Live Demo","demo.eyebrow":"推理过程回放","demo.landing.heading":"生成或导入一个 Live Demo","demo.landing.subtitle":"把一次对话打包成可分享的回放,或导入他人分享的 demo。","demo.landing.fromSession.title":"从已有对话生成","demo.landing.fromSession.desc":"选择一个会话,打包对话、推理图与产出文件。","demo.landing.fromSession.empty":"暂无会话","demo.landing.import.title":"导入本地文件","demo.landing.import.desc":"打开一个 .json demo 文件进行离线回放。","demo.landing.import.button":"点击选择文件","demo.landing.import.dropHint":"或将 .json 文件拖到此处","demo.packing":"正在打包…","demo.exportButton":"导出 Live Demo","demo.reselect":"重新选择","demo.error.build":"生成 demo 失败","demo.error.parse":"无法读取该文件","demo.files.title":"产出文件","demo.files.empty":"本 demo 未包含文件","demo.files.skipped":"已跳过(过大)","demo.files.unreadable":"读取失败","demo.files.noSandbox":"打包时无运行中的沙箱,文件未嵌入","demo.files.none":"选择一个文件以预览","demo.tree.title":"文件树","demo.trace.title":"推理图","demo.conversation.title":"对话","demo.conversation.empty":"回放到此处尚无对话内容。","demo.transport.play":"播放","demo.transport.pause":"暂停","demo.transport.prev":"上一步","demo.transport.next":"下一步","demo.transport.restart":"重新开始","demo.transport.speed":"速度","demo.transport.step":"第 {index}/{total} 步","demo.node.modalClose":"关闭","demo.meta.exported":"导出于 {time}","demo.meta.steps":"{visible} / {total} 节点"},{"demo.title":"Live Demo","demo.eyebrow":"Reasoning replay","demo.landing.heading":"Generate or import a Live Demo","demo.landing.subtitle":"Package a conversation into a shareable replay, or import one shared with you.","demo.landing.fromSession.title":"Generate from a conversation","demo.landing.fromSession.desc":"Pick a session to package its conversation, reasoning graph, and produced files.","demo.landing.fromSession.empty":"No conversations yet","demo.landing.import.title":"Import a local file","demo.landing.import.desc":"Open a .json demo file for offline replay.","demo.landing.import.button":"Click to choose a file","demo.landing.import.dropHint":"or drag a .json file here","demo.packing":"Packing…","demo.exportButton":"Export Live Demo","demo.reselect":"Start over","demo.error.build":"Failed to generate demo","demo.error.parse":"Could not read that file","demo.files.title":"Produced files","demo.files.empty":"This demo contains no files","demo.files.skipped":"skipped (too large)","demo.files.unreadable":"unreadable","demo.files.noSandbox":"No running sandbox at pack time; files not embedded","demo.files.none":"Select a file to preview","demo.tree.title":"Files","demo.trace.title":"Reasoning graph","demo.conversation.title":"Conversation","demo.conversation.empty":"No conversation revealed at this point yet.","demo.transport.play":"Play","demo.transport.pause":"Pause","demo.transport.prev":"Previous step","demo.transport.next":"Next step","demo.transport.restart":"Restart","demo.transport.speed":"Speed","demo.transport.step":"Step {index}/{total}","demo.node.modalClose":"Close","demo.meta.exported":"Exported {time}","demo.meta.steps":"{visible} / {total} nodes"}),Vu="zh-CN",kw=[lw,cw,uw,dw,fw,pw,mw,hw,gw,yw,xw,bw,vw,ww,_w];function vm(e){return Object.assign({},...kw.map(n=>n[e]))}const pu={"zh-CN":vm("zh-CN"),"en-US":vm("en-US")};function pg(e,n,r){let a=(pu[e]??pu[Vu])[n]??pu[Vu][n];if(a===void 0)return n;if(r)for(const[c,u]of Object.entries(r))a=a.replace(new RegExp(`\\{${c}\\}`,"g"),String(u));return a}let mg=Vu;function Ew(e){mg=e}function Wn(e,n){return pg(mg,e,n)}const hg=N.createContext(null);function Sw({children:e}){return l.jsx(Nw,{children:e})}const wm={id:"local",name:"local",status:"running",port:null,userId:"local",createdAt:new Date(0).toISOString()};function Nw({children:e}){const n=N.useCallback(async()=>{},[]),r=N.useMemo(()=>({sandboxes:[wm],currentSandbox:wm,stats:null,status:"running",operation:"idle",error:null,logs:"",refresh:n,refreshStats:n,createSandbox:n,rebuildSandbox:n,destroySandbox:n,reloadConfig:n}),[n]);return l.jsx(hg.Provider,{value:r,children:e})}function Ti(){const e=N.useContext(hg);if(!e)throw new Error("useSandbox must be used within SandboxProvider");return e}const gg=N.createContext(null),Cw=3e3,Tw=3e4;function Aw({children:e}){const{isAuthReady:n}=gl(),{currentSandbox:r}=Ti(),s=N.useRef(new Map),a=N.useRef(new Map),[c,u]=N.useState(0),[f,p]=N.useState(new Map),m=N.useCallback((w,_)=>{p(E=>{const S=new Map(E);return S.set(w,_),S})},[]),g=N.useCallback(w=>{const _=s.current.get(w);if(_&&!_.manuallyClosed&&_.source.readyState!==EventSource.CLOSED)return;console.log(`[SSE] openConnection: ${w}`),m(w,"connecting");const E=new EventSource(aw(w)),S={source:E,reconnectAttempt:0,reconnectTimer:null,manuallyClosed:!1};s.current.set(w,S),E.onopen=()=>{S.reconnectAttempt=0,console.log(`[SSE] onopen: ${w}`),m(w,"open")},E.onmessage=O=>{try{const A=JSON.parse(O.data),G=dg(A);if(G.type==="PING"||G.type==="ping")return;console.log(`[SSE] onmessage: ${w} type=${G.type}`,G);const P=a.current.get(w)||[];P.push(G),a.current.set(w,P),u(M=>M+1)}catch{console.error(`[SSE] onmessage: ${w} 解析失败`,O.data);const A=a.current.get(w)||[];A.push({type:"error",sessionId:w,data:{error:{message:Wn("ctx.sse.parseError")}}}),a.current.set(w,A),u(G=>G+1)}},E.onerror=()=>{if(console.error(`[SSE] onerror: ${w}, reconnectAttempt=${S.reconnectAttempt+1}`),m(w,"error"),E.close(),S.manuallyClosed)return;S.reconnectAttempt+=1;const O=Math.min(Cw*Math.pow(2,S.reconnectAttempt-1),Tw);console.log(`[SSE] reconnect: ${w} in ${O}ms`),S.reconnectTimer=window.setTimeout(()=>{S.reconnectTimer=null,g(w)},O)}},[m]),y=N.useCallback(w=>{console.log(`[SSE] connectSession: ${w}, authReady=${n}, sandbox=${r==null?void 0:r.status}`),n&&(r==null?void 0:r.status)==="running"&&g(w)},[n,r==null?void 0:r.status,g]),v=N.useCallback(w=>{console.log(`[SSE] disconnectSession: ${w}`);const _=s.current.get(w);_&&(_.manuallyClosed=!0,_.reconnectTimer!==null&&(window.clearTimeout(_.reconnectTimer),_.reconnectTimer=null),_.source.close(),s.current.delete(w),m(w,"idle"))},[m]);N.useEffect(()=>()=>{for(const[,w]of s.current)w.manuallyClosed=!0,w.reconnectTimer!==null&&window.clearTimeout(w.reconnectTimer),w.source.close();s.current.clear()},[n,r==null?void 0:r.status]);const b=N.useMemo(()=>({connectSession:y,disconnectSession:v,queueRef:a,tick:c,connections:f}),[y,v,c,f]);return l.jsx(gg.Provider,{value:b,children:e})}function Mw(){const e=N.useContext(gg);if(!e)throw new Error("useSSE must be used within SSEProvider");return e}class Rw{constructor(){iu(this,"drafts",new Map);iu(this,"listeners",new Map)}get(n){return this.drafts.get(n)??""}set(n,r){if(this.drafts.get(n)===r)return;this.drafts.set(n,r);const s=this.listeners.get(n);s&&s.forEach(a=>a())}subscribe(n,r){let s=this.listeners.get(n);return s||(s=new Set,this.listeners.set(n,s)),s.add(r),()=>{const a=this.listeners.get(n);a&&(a.delete(r),a.size===0&&this.listeners.delete(n))}}delete(n){this.drafts.delete(n)}}const Qr=new Rw,yg=()=>{},Iw=e=>yg,Ow=()=>"";function xg(e){const n=N.useCallback(c=>e===null?yg:Qr.subscribe(e,c),[e]),r=N.useCallback(()=>e===null?"":Qr.get(e),[e]),s=N.useSyncExternalStore(e===null?Iw:n,e===null?Ow:r),a=N.useCallback(c=>{e!==null&&Qr.set(e,c)},[e]);return[s,a]}const jw=[{id:"spurious-dot",name:"Hide spurious single-dot messages",description:"Hides assistant text messages that contain only a single '.' character. These often appear when the model enters defensive thinking mode and emits minimal text before a tool call.",enabled:!0,test:(e,n)=>e.role!=="assistant"||e.kind!=="text"||e.streaming?!1:e.content.trim()==="."}];function Lw(e,n){const r=n.filter(s=>s.enabled);return r.length===0?e:e.filter(s=>!r.some(a=>a.test(s,e)))}function Zr(e,n=""){return typeof e=="string"&&e.length>0?e:n}function _i(e){return typeof e=="string"&&e.length>0?e:void 0}function mu(e,n){return typeof e=="number"&&Number.isFinite(e)?e:n}function Dw(e){const n=e,r=Zr(n.level,"info"),s=r==="warning"||r==="error"||r==="fatal"?r:"info",a=typeof n.recoverable=="boolean"?n.recoverable:s!=="fatal";return{level:s,message:Zr(n.message),details:_i(n.details),agent:_i(n.agent)??_i(n.agentName),recoverable:a,timestamp:_i(n.timestamp)}}function Pw(e){const n=e,r=Array.isArray(n.options)?n.options.filter(s=>typeof s=="string"):void 0;return{requestId:Zr(n.requestId??n.request_id),agent:Zr(n.agent??n.agentName,"principal"),question:Zr(n.question),options:r&&r.length>0?r:void 0,allowFreeText:typeof(n.allowFreeText??n.allow_free_text)=="boolean"?n.allowFreeText??n.allow_free_text:void 0,timeoutSec:typeof(n.timeoutSec??n.timeout_sec)=="number"?n.timeoutSec??n.timeout_sec:void 0}}function Fw(e){const n=e,r=n.autoRetry??n.data??n.value??n;return{attempt:mu(r.attempt,1),maxAttempts:mu(r.maxAttempts??r.max_attempts,1),delayMs:mu(r.delayMs??r.delay_ms,0),reason:_i(r.reason)??_i(n.message)}}function zw(e){const n=e;if(n.type!=="agent_status_update")return!1;const r=Zr(n.status??n.runStatus).toLowerCase();return r==="retrying"||r==="auto_retry"||r==="auto_retry_start"?!0:!!(n.autoRetry??n.auto_retry)}function Bw(e){const n=Dw(e),r=e;return{id:Zr(r.id??r.messageId)||`sysmsg-${Date.now()}-${Math.random().toString(36).slice(2,8)}`,role:"system",content:n.message,createdAt:n.timestamp??new Date().toISOString(),agent:n.agent,streaming:!1,kind:"system_message",systemMessage:n}}function Uw(e){const n=Pw(e);return{id:n.requestId?`ask-${n.requestId}`:ua(),role:"system",content:n.question,createdAt:new Date().toISOString(),agent:n.agent,streaming:!1,kind:"ask_user",askUser:n}}function $w(e){const n=Fw(e),r=e;return{id:`retry-${Zr(r.agentName,"agent")}-${n.attempt}-${Date.now()}`,role:"system",content:n.reason??`Retrying (attempt ${n.attempt}/${n.maxAttempts})`,createdAt:new Date().toISOString(),agent:_i(r.agentName),streaming:!1,kind:"auto_retry",autoRetry:n}}function Hw(e,n,r={}){if(r.answered||r.timedOut)return null;const s=n.trim();return!s||!e.requestId?null:{requestId:e.requestId,answer:s}}function qw(e){return e.delayMs>0?Math.ceil(e.delayMs/1e3):0}function ua(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,e=>{const n=Math.random()*16|0;return(e==="x"?n:n&3|8).toString(16)})}function Kw(e){const n=e[e.length-1];return(n==null?void 0:n.role)==="assistant"&&n.streaming?[...e.slice(0,-1),{...n,streaming:!1}]:e}function Ww(e){return e.sessionId||e.threadId}function _m(e,n){let r=!1;const s=e.map(a=>a.streaming&&(!n||a.agent===n)?(r=!0,{...a,streaming:!1}):a);return r?s:e}function Vw(e){const n=e.role==="user"||e.role==="system"||e.role==="tool"?e.role:"assistant";let r="text";return e.role==="reasoning"&&(r="thinking"),e.role==="tool"&&(r="tool"),e.error&&e.role==="system"&&(r="error"),(e.kind==="hook"||e.hookFamily&&e.role==="system")&&(r="hook"),{id:e.id,role:n==="tool"?"assistant":n,content:e.content??"",createdAt:new Date().toISOString(),agent:n==="user"?"user":e.agentName,streaming:!!e.unfinished,kind:r,toolResult:e.role==="tool"?e.content:void 0,toolCallId:e.toolCallId,reasoning:e.role==="reasoning"?e.content:void 0,hookFamily:e.hookFamily,hookPhase:e.hookPhase,hookLevel:e.hookLevel,hookData:e.hookData}}function Gu(e,n){const r=n.agentName;switch(n.type){case"MESSAGES_SNAPSHOT":{const s=Array.isArray(n.messages)?n.messages:[],a=[];for(const c of s)if(a.push(Vw(c)),Array.isArray(c.toolCalls))for(const u of c.toolCalls)a.push({id:u.id,role:"assistant",content:`Tool: ${u.name??"unknown"}`,createdAt:new Date().toISOString(),agent:c.agentName,streaming:!1,kind:"tool",toolName:u.name,toolInput:u.arguments??""});return a}case"TEXT_MESSAGE_START":{const s=n.messageId;if(!s||e.some(c=>c.id===s))return e;const a=n.role==="user"||n.role==="system"?n.role:"assistant";return[...e,{id:s,role:a,content:"",createdAt:new Date().toISOString(),agent:r,streaming:!0,kind:"text"}]}case"TEXT_MESSAGE_CONTENT":{const s=n.messageId;let a=typeof n.delta=="string"?n.delta:"";return!s||!a||(a=a.replace(/<!--NO-RENDER-->[\s\S]*?<!--\/NO-RENDER-->/g,""),!a)?e:e.map(c=>c.id===s?{...c,content:(c.content??"")+a}:c)}case"TEXT_MESSAGE_END":{const s=n.messageId;return s?e.filter(a=>!(a.id===s&&(a.content??"").trim()==="")).map(a=>a.id===s?{...a,streaming:!1}:a):e}case"TEXT_MESSAGE_CHUNK":{const s=n.messageId;if(!s||e.some(c=>c.id===s))return e;const a=n.role==="assistant"||n.role==="system"?n.role:"user";return[...e,{id:s,role:a,content:typeof n.delta=="string"?n.delta:"",createdAt:new Date().toISOString(),agent:a==="user"?"user":r,streaming:!1,kind:"text"}]}case"TOOL_CALL_START":{const s=n.toolCallId;return!s||e.some(a=>a.id===s)?e:[...e,{id:s,role:"assistant",content:`Tool: ${n.toolCallName??"unknown"}`,createdAt:new Date().toISOString(),agent:r,streaming:!0,kind:"tool",toolName:n.toolCallName,toolInput:""}]}case"TOOL_CALL_ARGS":{const s=n.toolCallId,a=typeof n.delta=="string"?n.delta:"";return!s||!a?e:e.map(c=>c.id===s?{...c,toolInput:(c.toolInput??"")+a}:c)}case"TOOL_CALL_END":{const s=n.toolCallId;return s?e.map(a=>a.id===s?{...a,streaming:!1}:a):e}case"TOOL_CALL_RESULT":{const s=n.messageId,a=typeof n.content=="string"?n.content:"";return!s||e.some(c=>c.id===s)?e:[...e,{id:s,role:"assistant",content:"Tool result",createdAt:new Date().toISOString(),agent:r,kind:"tool",toolResult:a}]}case"REASONING_MESSAGE_START":{const s=n.messageId;return!s||e.some(a=>a.id===s)?e:[...e,{id:s,role:"assistant",content:"",createdAt:new Date().toISOString(),agent:r,streaming:!0,kind:"thinking",reasoning:""}]}case"REASONING_MESSAGE_CONTENT":{const s=n.messageId,a=typeof n.delta=="string"?n.delta:"";return!s||!a?e:e.map(c=>c.id===s?{...c,content:(c.content??"")+a,reasoning:(c.reasoning??"")+a}:c)}case"REASONING_MESSAGE_END":{const s=n.messageId;return s?e.map(a=>a.id===s?{...a,streaming:!1}:a):e}case"RUN_ERROR":{const s=n.message??"Run error";return[..._m(e,n.agentName),{id:ua(),role:"system",content:String(s),createdAt:new Date().toISOString(),kind:"error"}]}case"system_message":return[...e,Bw(n)];case"user_input_request":{const s=Uw(n);return e.some(a=>a.id===s.id)?e:[...e,s]}case"user_input_response":{const s=n,a=String(s.requestId??s.request_id??""),c=String(s.answer??"");return a?e.map(u=>{var f;return u.kind==="ask_user"&&((f=u.askUser)==null?void 0:f.requestId)===a?{...u,askUser:{...u.askUser,answer:c}}:u}):e}case"agent_status_update":return zw(n)?[...e,$w(n)]:e;case"RUN_FINISHED":return _m(e,n.agentName);case"RUN_STARTED":case"REASONING_START":case"REASONING_END":return e;case"CUSTOM":{if(n.name==="hook_event"){const a=n.value??{},c=`hook-${n.timestamp??Date.now()}-${Math.random().toString(36).slice(2,8)}`;return[...e,{id:c,role:"system",content:a.message??"(hook event)",createdAt:new Date().toISOString(),agent:a.agent_name,streaming:!1,kind:"hook",hookFamily:a.hook,hookPhase:a.phase,hookLevel:a.level,hookData:a.data}]}return e}case"PING":default:return e}}const bg="__draft__",vg=N.createContext(null);function Gw({children:e}){const{isAuthReady:n}=gl(),{currentSandbox:r}=Ti(),{connectSession:s,disconnectSession:a,queueRef:c,tick:u,connections:f}=Mw(),[p,m]=N.useState([]),[g,y]=N.useState(null),[v,b]=N.useState(!1),w=N.useRef(!1);N.useEffect(()=>{w.current=v},[v]);const[_,E]=N.useState({}),[S,O]=N.useState(!1),[A,G]=N.useState(!1),[P,M]=N.useState(!1),[W,ee]=N.useState(null),[oe,D]=N.useState("chat"),[ce,V]=N.useState([]),[j,B]=N.useState({}),[q,Z]=N.useState(jw),ne=N.useMemo(()=>p.find(fe=>fe.id===g)??null,[g,p]),K=g?_[g]??[]:[],ue=g?f.get(g)==="open":!1,C=N.useCallback(async()=>{if(!n){m([]),y(null);return}O(!0),ee(null);try{const ke=[...await Ve.sessions.list()].sort((Ee,ve)=>ve.updatedAt.localeCompare(Ee.updatedAt));m(ke),y(Ee=>{var ve;return w.current?Ee:Ee??((ve=ke[0])==null?void 0:ve.id)??null})}catch(fe){ee(fe instanceof Error?fe.message:Wn("ctx.session.loadFailed"))}finally{O(!1)}},[n]);N.useEffect(()=>{C()},[C]),N.useEffect(()=>{if(!g)return;const fe=g;let ke=!1;async function Ee(){M(!0),ke||E(ve=>({...ve,[fe]:ve[fe]??[]})),M(!1)}return Ee(),()=>{ke=!0}},[g]);const R=N.useCallback(fe=>{console.log(`[SessionContext] selectSession: ${fe}`),b(!1),y(fe),D("chat"),s(fe)},[s]),J=N.useCallback(()=>{b(!0),y(null),D("chat")},[]),T=N.useCallback(async(fe,ke)=>{ee(null);try{const Ee=await Ve.sessions.update(fe,ke);m(ve=>[Ee,...ve.filter(Se=>Se.id!==fe)].sort((Se,tt)=>tt.updatedAt.localeCompare(Se.updatedAt)))}catch(Ee){throw ee(Ee instanceof Error?Ee.message:Wn("ctx.session.updateFailed")),Ee}},[]),X=N.useCallback(async fe=>{ee(null);try{await Ve.sessions.remove(fe),a(fe),m(ke=>{const Ee=ke.filter(ve=>ve.id!==fe);return y(ve=>{var Se;return ve===fe?((Se=Ee[0])==null?void 0:Se.id)??null:ve}),Ee}),E(ke=>{const Ee={...ke};return delete Ee[fe],Ee}),Qr.delete(fe)}catch(ke){throw ee(ke instanceof Error?ke.message:Wn("ctx.session.deleteFailed")),ke}},[a]),re=N.useCallback(async(fe="New research session",ke={})=>{if(!r||r.status!=="running")return ee(Wn("ctx.session.startSandbox")),null;O(!0),ee(null);try{const Ee=await Ve.sessions.create(fe,ke);return m(ve=>[Ee,...ve.filter(Se=>Se.id!==Ee.id)]),b(!1),y(Ee.id),E(ve=>({...ve,[Ee.id]:ve[Ee.id]??[]})),Ee}catch(Ee){throw ee(Ee instanceof Error?Ee.message:Wn("ctx.session.createFailed")),Ee}finally{O(!1)}},[r]);N.useEffect(()=>{p.length===0&&!S&&(r==null?void 0:r.status)==="running"&&!g&&!v&&J()},[p.length,S,r,g,v,J]);const L=N.useCallback(async(fe,ke={})=>{const Ee=fe.trim();if(console.log(`[SessionContext] sendPrompt: "${Ee.slice(0,40)}...", isConnected=${ue}, isDraft=${v}`),!!Ee){if(!ne&&!v){ee(Wn("ctx.session.noConnection"));return}if(ne&&!ue){ee(Wn("ctx.session.noConnection"));return}G(!0),ee(null);try{const ve=ne??await re(Ee.slice(0,48),ke);if(!ve)return;ne||(s(ve.id),Qr.delete(bg));const Se=new Date().toISOString(),tt=ua(),ft={id:tt,role:"user",content:Ee,createdAt:Se,agent:"user"};E(se=>({...se,[ve.id]:[...se[ve.id]??[],ft]})),console.log(`[SessionContext] posting message to ${ve.id}`),await Ve.sessions.postMessage(ve.id,{content:Ee,uuid:tt,timestamp:Se}),console.log("[SessionContext] postMessage success")}catch(ve){console.error("[SessionContext] sendPrompt error:",ve),ee(ve instanceof Error?ve.message:Wn("ctx.session.sendFailed"))}finally{G(!1)}}},[re,ne,ue,v,s]),$=N.useCallback(async()=>{if(!ne)return;const fe=ne.id;E(ke=>{const Ee=ke[fe]??[],ve={id:ua(),role:"system",content:"Task stopped by user",createdAt:new Date().toISOString(),kind:"status"};return{...ke,[fe]:[...Kw(Ee),ve]}}),V(ke=>ke.map(Ee=>({...Ee,status:"idle",task:""})));try{await Ve.sessions.interrupt(fe)}catch(ke){ee(ke instanceof Error?ke.message:Wn("ctx.session.interruptFailed"))}},[ne]),H=N.useCallback(async(fe,ke)=>{const Ee=ne==null?void 0:ne.id;if(!(!Ee||!fe)){E(ve=>{const Se=ve[Ee]??[];return{...ve,[Ee]:Se.map(tt=>{var ft;return tt.kind==="ask_user"&&((ft=tt.askUser)==null?void 0:ft.requestId)===fe?{...tt,askUser:{...tt.askUser,answer:ke}}:tt})}});try{await Ve.sessions.respondToInput(Ee,{requestId:fe,answer:ke})}catch(ve){ee(ve instanceof Error?ve.message:Wn("ctx.session.sendFailed"))}}},[ne]),Q=N.useCallback(async()=>{if(ne){console.log(`[SessionContext] refreshMessages: ${ne.id}`),M(!0),ee(null);try{a(ne.id),E(fe=>({...fe,[ne.id]:[]})),s(ne.id)}catch(fe){ee(fe instanceof Error?fe.message:Wn("ctx.session.refreshFailed"))}finally{M(!1)}}},[ne,a,s]);N.useEffect(()=>{if(!(ne!=null&&ne.id)){V([]);return}let fe=!1;return Ve.sessions.state(ne.id).then(ke=>{fe||V(ke.agents.map(Ee=>({...Ee,updatedAt:Ee.updatedAt||new Date().toISOString()})))}).catch(()=>{fe||V([])}),()=>{fe=!0}},[ne==null?void 0:ne.id]),N.useEffect(()=>{g&&s(g)},[g,s]),N.useEffect(()=>{var Ee;if(!g||!c.current)return;const fe=g,ke=c.current.get(fe)||[];if(ke.length!==0){c.current.set(fe,[]),console.log(`[SessionContext] draining queue: sid=${fe}, events=${ke.length}`);for(const ve of ke)if(ve.type==="CUSTOM"&&ve.name==="session_title"){const Se=(Ee=ve.value)==null?void 0:Ee.title;Se&&m(tt=>tt.map(ft=>ft.id===fe?{...ft,title:Se}:ft));continue}for(const ve of ke){if(ve.type==="CUSTOM"&&ve.name==="session_state"){const Se=ve.value??{},ft=(Array.isArray(Se.agents)?Se.agents:[]).map(se=>({name:String(se.name??""),status:String(se.status??"idle"),task:String(se.task??""),updatedAt:typeof se.updatedAt=="string"?se.updatedAt:new Date().toISOString(),alive:typeof se.alive=="boolean"?se.alive:void 0}));V(ft),B(se=>{let je=!1;const le={...se};for(const pe of ft)if(!se[pe.name]){je=!0;const st=pe.name==="trace";le[pe.name]={hideMessages:st,hideTools:st,hideHooks:!0}}return je?le:se}),Se.recovered===!0&&E(se=>{const je=se[fe]??[],le={id:ua(),role:"system",content:"⚠️ Session connection recovered. Agent states may have been reset due to a runtime restart.",createdAt:new Date().toISOString(),kind:"status"};return{...se,[fe]:[...je,le]}});continue}ve.type==="CUSTOM"&&ve.name}E(ve=>{let Se=ve[fe]??[];for(const tt of ke){const ft=Ww(tt);if(ft&&ft!==fe){Se=ve[ft]??[];const se=Gu(Se,tt);ve={...ve,[ft]:se},Se=ve[fe]??[];continue}Se=Gu(Se,tt)}return{...ve,[fe]:Se}})}},[g,u]);const ge=N.useCallback((fe,ke,Ee,ve)=>{B(Se=>{const tt=Se[fe]??{hideHooks:!0};return{...Se,[fe]:{hideMessages:ke,hideTools:Ee,hideHooks:ve??tt.hideHooks}}})},[]),Pe=N.useMemo(()=>({sessions:p,currentSession:ne,messages:K,isLoading:S,isSending:A,isRefreshingMessages:P,isConnected:ue,isDraft:v,error:W,currentView:oe,agents:ce,agentFilters:j,selectSession:R,createSession:re,startDraftSession:J,updateSessionTitle:T,deleteSession:X,sendPrompt:L,interruptCurrent:$,respondToInput:H,refreshSessions:C,refreshMessages:Q,setCurrentView:D,setAgentFilter:ge,messageFilters:q}),[p,ne,K,S,A,P,ue,v,W,oe,ce,j,R,re,J,T,X,L,$,H,C,Q,D,ge,q]);return l.jsx(vg.Provider,{value:Pe,children:e})}function Nr(){const e=N.useContext(vg);if(!e)throw new Error("useSessions must be used within SessionProvider");return e}const wg="new-ui-preferences",is={theme:"light",resolvedTheme:"light",language:"zh-CN",security:{confirmDangerousActions:!0,rememberSession:!0},notifications:{agentDone:!0,errors:!0}},_g=N.createContext(null);function Yw(){const e=localStorage.getItem(wg);if(!e)return is;try{const n=JSON.parse(e);return{...is,...n,security:{...is.security,...n.security},notifications:{...is.notifications,...n.notifications},resolvedTheme:is.resolvedTheme}}catch{return is}}function hu(e){return e==="system"?window.matchMedia("(prefers-color-scheme: dark)").matches?"dark":"light":e}function Xw({children:e}){const[n,r]=N.useState(()=>{const p=Yw();return{...p,resolvedTheme:hu(p.theme)}});N.useEffect(()=>{const p=document.documentElement;p.dataset.theme=n.resolvedTheme,p.lang=n.language,Ew(n.language),localStorage.setItem(wg,JSON.stringify({...n,resolvedTheme:void 0}))},[n]),N.useEffect(()=>{if(n.theme!=="system")return;const p=window.matchMedia("(prefers-color-scheme: dark)"),m=()=>r(g=>({...g,resolvedTheme:hu(g.theme)}));return p.addEventListener("change",m),()=>p.removeEventListener("change",m)},[n.theme]);const s=N.useCallback(p=>{r(m=>({...m,theme:p,resolvedTheme:hu(p)}))},[]),a=N.useCallback(p=>{r(m=>({...m,language:p}))},[]),c=N.useCallback(p=>{r(m=>({...m,security:p}))},[]),u=N.useCallback(p=>{r(m=>({...m,notifications:p}))},[]),f=N.useMemo(()=>({...n,setTheme:s,setLanguage:a,setSecurity:c,setNotifications:u}),[n,s,a,c,u]);return l.jsx(_g.Provider,{value:f,children:e})}function kg(){const e=N.useContext(_g);if(!e)throw new Error("usePreferences must be used within PreferencesProvider");return e}function yt(){const{language:e}=kg();return N.useCallback((n,r)=>pg(e,n,r),[e])}var Qw=Vh();function ms({value:e,options:n,onChange:r,ariaLabel:s,className:a="",disabled:c=!1,placeholder:u="Select",title:f}){const[p,m]=N.useState(!1),[g,y]=N.useState({}),[v,b]=N.useState("bottom"),w=N.useRef(null),_=N.useRef(null),E=N.useId(),S=n.findIndex(V=>V.value===e),O=S>=0?n[S]:null,A=S>=0?S:0,G=p&&n[A]?`${E}-${A}`:void 0,P=`custom-select ${p?"is-open":""} custom-select--${v} ${c?"is-disabled":""} ${a}`.trim(),M=N.useCallback(()=>{const V=w.current;if(!V)return;const j=V.getBoundingClientRect(),B=6,q=12,Z=Math.min(220,Math.max(44,n.length*34+8)),ne=window.innerHeight-j.bottom-q,K=j.top-q,ue=ne<Z&&K>ne?"top":"bottom",C=Math.max(j.width,Math.min(280,window.innerWidth-q*2)),R=Math.min(Math.max(q,j.right-C),window.innerWidth-C-q);b(ue),y({left:R,minWidth:j.width,width:C,...ue==="top"?{bottom:window.innerHeight-j.top+B,maxHeight:Math.max(120,K-B)}:{top:j.bottom+B,maxHeight:Math.max(120,ne-B)}})},[n.length]);N.useLayoutEffect(()=>{p&&M()},[p,M]),N.useEffect(()=>{if(!p)return;const V=B=>{var Z,ne;const q=B.target;!((Z=w.current)!=null&&Z.contains(q))&&!((ne=_.current)!=null&&ne.contains(q))&&m(!1)},j=()=>M();return document.addEventListener("pointerdown",V),window.addEventListener("resize",j),window.addEventListener("scroll",j,!0),()=>{document.removeEventListener("pointerdown",V),window.removeEventListener("resize",j),window.removeEventListener("scroll",j,!0)}},[p,M]);const W=N.useMemo(()=>n,[n]),ee=V=>{r(V),m(!1)},oe=V=>{if(W.length===0)return;const j=S>=0?(S+V+W.length)%W.length:0;r(W[j].value)},D=V=>{if(V.key==="Escape"){m(!1);return}if(V.key==="ArrowDown"){if(V.preventDefault(),!p){m(!0);return}oe(1);return}if(V.key==="ArrowUp"){if(V.preventDefault(),!p){m(!0);return}oe(-1);return}(V.key==="Enter"||V.key===" ")&&(V.preventDefault(),m(j=>!j))},ce=p?Qw.createPortal(l.jsx("div",{className:`custom-select__menu custom-select__menu--floating custom-select__menu--${v}`,id:E,ref:_,role:"listbox",style:g,children:W.map((V,j)=>{const B=V.value===e;return l.jsxs("button",{"aria-selected":B,className:`custom-select__option ${B?"is-selected":""}`.trim(),id:`${E}-${j}`,onClick:()=>ee(V.value),role:"option",type:"button",children:[l.jsxs("span",{className:"custom-select__option-label",children:[V.indicator?l.jsx("span",{className:"custom-select__option-indicator",children:V.indicator}):null,V.label]}),B?l.jsx(gs,{"aria-hidden":"true",size:14}):null]},V.value)})}),document.body):null;return l.jsxs("div",{className:P,ref:w,children:[l.jsxs("button",{"aria-activedescendant":G,"aria-controls":E,"aria-expanded":p,"aria-haspopup":"listbox","aria-label":s,className:"custom-select__trigger",disabled:c,onClick:()=>m(V=>!V),onKeyDown:D,title:f,type:"button",children:[l.jsxs("span",{className:`custom-select__value ${O?"":"is-placeholder"}`.trim(),children:[O!=null&&O.indicator?l.jsx("span",{className:"custom-select__value-indicator",children:O.indicator}):null,(O==null?void 0:O.label)??u]}),l.jsx(Yh,{"aria-hidden":"true",size:14})]}),ce]})}function xt({label:e,children:n,className:r="",variant:s="ghost",...a}){return l.jsx("button",{type:"button","aria-label":e,title:e,className:`icon-button icon-button--${s} ${r}`.trim(),...a,children:n})}function Zw({sessionId:e,placeholder:n,ariaLabel:r}){const[s,a]=xg(e),c=N.useRef(null),u=()=>{const p=c.current;p&&(p.style.height="auto",p.style.height=`${p.scrollHeight}px`)};N.useEffect(()=>{u()},[s]);const f=p=>{var m;p.key!=="Enter"||p.shiftKey||p.nativeEvent.isComposing||(p.preventDefault(),(m=p.currentTarget.form)==null||m.requestSubmit())};return l.jsxs(l.Fragment,{children:[l.jsx("label",{className:"sr-only",htmlFor:"prompt-input",children:r}),l.jsx("textarea",{ref:c,id:"prompt-input",rows:1,value:s,onChange:p=>{a(p.target.value),u()},onKeyDown:f,placeholder:n})]})}function Jw({sessionId:e,canSend:n,label:r}){const[s]=xg(e);return l.jsx(xt,{disabled:!n||!s.trim(),label:r,type:"submit",variant:"strong",children:l.jsx(mv,{size:18})})}function e_(e){return e.role==="user"||e.kind==="error"||e.kind==="status"||e.kind==="hook"||e.kind==="system_message"||e.kind==="ask_user"||e.kind==="auto_retry"||e.role==="assistant"&&(e.kind==="text"||e.kind===void 0)||e.role==="system"&&(e.kind==="text"||e.kind===void 0)}function t_(e,n){const r=[];let s=[];const a=u=>(n==null?void 0:n.has(u.agent??"principal"))??!1,c=()=>{s.length!==0&&(r.push({type:"activity",id:s[0].id,steps:s,streaming:s.some(u=>u.streaming||a(u))}),s=[])};for(const u of e)e_(u)?(c(),r.push({type:"single",message:u})):s.push(u);return c(),r}function n_(e,n){const r={};return(e[e.length-1]===""?[...e,""]:e).join((r.padRight?" ":"")+","+(r.padLeft===!1?"":" ")).trim()}const r_=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,i_=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,s_={};function km(e,n){return(s_.jsx?i_:r_).test(e)}const a_=/[ \t\n\f\r]/g;function o_(e){return typeof e=="object"?e.type==="text"?Em(e.value):!1:Em(e)}function Em(e){return e.replace(a_,"")===""}class Ea{constructor(n,r,s){this.normal=r,this.property=n,s&&(this.space=s)}}Ea.prototype.normal={};Ea.prototype.property={};Ea.prototype.space=void 0;function Eg(e,n){const r={},s={};for(const a of e)Object.assign(r,a.property),Object.assign(s,a.normal);return new Ea(r,s,n)}function Yu(e){return e.toLowerCase()}class An{constructor(n,r){this.attribute=r,this.property=n}}An.prototype.attribute="";An.prototype.booleanish=!1;An.prototype.boolean=!1;An.prototype.commaOrSpaceSeparated=!1;An.prototype.commaSeparated=!1;An.prototype.defined=!1;An.prototype.mustUseProperty=!1;An.prototype.number=!1;An.prototype.overloadedBoolean=!1;An.prototype.property="";An.prototype.spaceSeparated=!1;An.prototype.space=void 0;let l_=0;const Qe=Ai(),Kt=Ai(),Xu=Ai(),be=Ai(),_t=Ai(),Ei=Ai(),Ln=Ai();function Ai(){return 2**++l_}const Qu=Object.freeze(Object.defineProperty({__proto__:null,boolean:Qe,booleanish:Kt,commaOrSpaceSeparated:Ln,commaSeparated:Ei,number:be,overloadedBoolean:Xu,spaceSeparated:_t},Symbol.toStringTag,{value:"Module"})),gu=Object.keys(Qu);class yd extends An{constructor(n,r,s,a){let c=-1;if(super(n,r),Sm(this,"space",a),typeof s=="number")for(;++c<gu.length;){const u=gu[c];Sm(this,gu[c],(s&Qu[u])===Qu[u])}}}yd.prototype.defined=!0;function Sm(e,n,r){r&&(e[n]=r)}function vs(e){const n={},r={};for(const[s,a]of Object.entries(e.properties)){const c=new yd(s,e.transform(e.attributes||{},s),a,e.space);e.mustUseProperty&&e.mustUseProperty.includes(s)&&(c.mustUseProperty=!0),n[s]=c,r[Yu(s)]=s,r[Yu(c.attribute)]=s}return new Ea(n,r,e.space)}const Sg=vs({properties:{ariaActiveDescendant:null,ariaAtomic:Kt,ariaAutoComplete:null,ariaBusy:Kt,ariaChecked:Kt,ariaColCount:be,ariaColIndex:be,ariaColSpan:be,ariaControls:_t,ariaCurrent:null,ariaDescribedBy:_t,ariaDetails:null,ariaDisabled:Kt,ariaDropEffect:_t,ariaErrorMessage:null,ariaExpanded:Kt,ariaFlowTo:_t,ariaGrabbed:Kt,ariaHasPopup:null,ariaHidden:Kt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:_t,ariaLevel:be,ariaLive:null,ariaModal:Kt,ariaMultiLine:Kt,ariaMultiSelectable:Kt,ariaOrientation:null,ariaOwns:_t,ariaPlaceholder:null,ariaPosInSet:be,ariaPressed:Kt,ariaReadOnly:Kt,ariaRelevant:null,ariaRequired:Kt,ariaRoleDescription:_t,ariaRowCount:be,ariaRowIndex:be,ariaRowSpan:be,ariaSelected:Kt,ariaSetSize:be,ariaSort:null,ariaValueMax:be,ariaValueMin:be,ariaValueNow:be,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function Ng(e,n){return n in e?e[n]:n}function Cg(e,n){return Ng(e,n.toLowerCase())}const c_=vs({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:Ei,acceptCharset:_t,accessKey:_t,action:null,allow:null,allowFullScreen:Qe,allowPaymentRequest:Qe,allowUserMedia:Qe,alpha:Qe,alt:null,as:null,async:Qe,autoCapitalize:null,autoComplete:_t,autoFocus:Qe,autoPlay:Qe,blocking:_t,capture:null,charSet:null,checked:Qe,cite:null,className:_t,closedBy:null,colorSpace:null,cols:be,colSpan:be,command:null,commandFor:null,content:null,contentEditable:Kt,controls:Qe,controlsList:_t,coords:be|Ei,crossOrigin:null,data:null,dateTime:null,decoding:null,default:Qe,defer:Qe,dir:null,dirName:null,disabled:Qe,download:Xu,draggable:Kt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:Qe,formTarget:null,headers:_t,height:be,hidden:Xu,high:be,href:null,hrefLang:null,htmlFor:_t,httpEquiv:_t,id:null,imageSizes:null,imageSrcSet:null,inert:Qe,inputMode:null,integrity:null,is:null,isMap:Qe,itemId:null,itemProp:_t,itemRef:_t,itemScope:Qe,itemType:_t,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:Qe,low:be,manifest:null,max:null,maxLength:be,media:null,method:null,min:null,minLength:be,multiple:Qe,muted:Qe,name:null,nonce:null,noModule:Qe,noValidate:Qe,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:Qe,optimum:be,pattern:null,ping:_t,placeholder:null,playsInline:Qe,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:Qe,referrerPolicy:null,rel:_t,required:Qe,reversed:Qe,rows:be,rowSpan:be,sandbox:_t,scope:null,scoped:Qe,seamless:Qe,selected:Qe,shadowRootClonable:Qe,shadowRootCustomElementRegistry:Qe,shadowRootDelegatesFocus:Qe,shadowRootMode:null,shadowRootSerializable:Qe,shape:null,size:be,sizes:null,slot:null,span:be,spellCheck:Kt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:be,step:null,style:null,tabIndex:be,target:null,title:null,translate:null,type:null,typeMustMatch:Qe,useMap:null,value:Kt,width:be,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:_t,axis:null,background:null,bgColor:null,border:be,borderColor:null,bottomMargin:be,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:Qe,declare:Qe,event:null,face:null,frame:null,frameBorder:null,hSpace:be,leftMargin:be,link:null,longDesc:null,lowSrc:null,marginHeight:be,marginWidth:be,noResize:Qe,noHref:Qe,noShade:Qe,noWrap:Qe,object:null,profile:null,prompt:null,rev:null,rightMargin:be,rules:null,scheme:null,scrolling:Kt,standby:null,summary:null,text:null,topMargin:be,valueType:null,version:null,vAlign:null,vLink:null,vSpace:be,allowTransparency:null,autoCorrect:null,autoSave:null,credentialless:Qe,disablePictureInPicture:Qe,disableRemotePlayback:Qe,exportParts:Ei,part:_t,prefix:null,property:null,results:be,security:null,unselectable:null},space:"html",transform:Cg}),u_=vs({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",maskType:"mask-type",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:Ln,accentHeight:be,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:be,amplitude:be,arabicForm:null,ascent:be,attributeName:null,attributeType:null,azimuth:be,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:be,by:null,calcMode:null,capHeight:be,className:_t,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:be,diffuseConstant:be,direction:null,display:null,dur:null,divisor:be,dominantBaseline:null,download:Qe,dx:null,dy:null,edgeMode:null,editable:null,elevation:be,enableBackground:null,end:null,event:null,exponent:be,externalResourcesRequired:null,fill:null,fillOpacity:be,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:Ei,g2:Ei,glyphName:Ei,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:be,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:be,horizOriginX:be,horizOriginY:be,id:null,ideographic:be,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:be,k:be,k1:be,k2:be,k3:be,k4:be,kernelMatrix:Ln,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:be,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskType:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:be,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:be,overlineThickness:be,paintOrder:null,panose1:null,path:null,pathLength:be,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:_t,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:be,pointsAtY:be,pointsAtZ:be,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Ln,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Ln,rev:Ln,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Ln,requiredFeatures:Ln,requiredFonts:Ln,requiredFormats:Ln,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:be,specularExponent:be,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:be,strikethroughThickness:be,string:null,stroke:null,strokeDashArray:Ln,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:be,strokeOpacity:be,strokeWidth:null,style:null,surfaceScale:be,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Ln,tabIndex:be,tableValues:null,target:null,targetX:be,targetY:be,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Ln,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:be,underlineThickness:be,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:be,values:null,vAlphabetic:be,vMathematical:be,vectorEffect:null,vHanging:be,vIdeographic:be,version:null,vertAdvY:be,vertOriginX:be,vertOriginY:be,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:be,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:Ng}),Tg=vs({properties:{xLinkActuate:null,xLinkArcRole:null,xLinkHref:null,xLinkRole:null,xLinkShow:null,xLinkTitle:null,xLinkType:null},space:"xlink",transform(e,n){return"xlink:"+n.slice(5).toLowerCase()}}),Ag=vs({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:Cg}),Mg=vs({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),d_={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"},f_=/[A-Z]/g,Nm=/-[a-z]/g,p_=/^data[-\w.:]+$/i;function m_(e,n){const r=Yu(n);let s=n,a=An;if(r in e.normal)return e.property[e.normal[r]];if(r.length>4&&r.slice(0,4)==="data"&&p_.test(n)){if(n.charAt(4)==="-"){const c=n.slice(5).replace(Nm,g_);s="data"+c.charAt(0).toUpperCase()+c.slice(1)}else{const c=n.slice(4);if(!Nm.test(c)){let u=c.replace(f_,h_);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}a=yd}return new a(s,n)}function h_(e){return"-"+e.toLowerCase()}function g_(e){return e.charAt(1).toUpperCase()}const y_=Eg([Sg,c_,Tg,Ag,Mg],"html"),xd=Eg([Sg,u_,Tg,Ag,Mg],"svg");function x_(e){return e.join(" ").trim()}var ss={},yu,Cm;function b_(){if(Cm)return yu;Cm=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,r=/^\s*/,s=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,a=/^:\s*/,c=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,f=/^\s+|\s+$/g,p=`
|
|
411
|
-
`,m="/",g="*",y="",v="comment",b="declaration";function w(E,S){if(typeof E!="string")throw new TypeError("First argument must be a string");if(!E)return[];S=S||{};var O=1,A=1;function G(B){var q=B.match(n);q&&(O+=q.length);var Z=B.lastIndexOf(p);A=~Z?B.length-Z:A+B.length}function P(){var B={line:O,column:A};return function(q){return q.position=new M(B),oe(),q}}function M(B){this.start=B,this.end={line:O,column:A},this.source=S.source}M.prototype.content=E;function W(B){var q=new Error(S.source+":"+O+":"+A+": "+B);if(q.reason=B,q.filename=S.source,q.line=O,q.column=A,q.source=E,!S.silent)throw q}function ee(B){var q=B.exec(E);if(q){var Z=q[0];return G(Z),E=E.slice(Z.length),q}}function oe(){ee(r)}function D(B){var q;for(B=B||[];q=ce();)q!==!1&&B.push(q);return B}function ce(){var B=P();if(!(m!=E.charAt(0)||g!=E.charAt(1))){for(var q=2;y!=E.charAt(q)&&(g!=E.charAt(q)||m!=E.charAt(q+1));)++q;if(q+=2,y===E.charAt(q-1))return W("End of comment missing");var Z=E.slice(2,q-2);return A+=2,G(Z),E=E.slice(q),A+=2,B({type:v,comment:Z})}}function V(){var B=P(),q=ee(s);if(q){if(ce(),!ee(a))return W("property missing ':'");var Z=ee(c),ne=B({type:b,property:_(q[0].replace(e,y)),value:Z?_(Z[0].replace(e,y)):y});return ee(u),ne}}function j(){var B=[];D(B);for(var q;q=V();)q!==!1&&(B.push(q),D(B));return B}return oe(),j()}function _(E){return E?E.replace(f,y):y}return yu=w,yu}var Tm;function v_(){if(Tm)return ss;Tm=1;var e=ss&&ss.__importDefault||function(s){return s&&s.__esModule?s:{default:s}};Object.defineProperty(ss,"__esModule",{value:!0}),ss.default=r;const n=e(b_());function r(s,a){let c=null;if(!s||typeof s!="string")return c;const u=(0,n.default)(s),f=typeof a=="function";return u.forEach(p=>{if(p.type!=="declaration")return;const{property:m,value:g}=p;f?a(m,g,p):g&&(c=c||{},c[m]=g)}),c}return ss}var ia={},Am;function w_(){if(Am)return ia;Am=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,r=/^[^-]+$/,s=/^-(webkit|moz|ms|o|khtml)-/,a=/^-(ms)-/,c=function(m){return!m||r.test(m)||e.test(m)},u=function(m,g){return g.toUpperCase()},f=function(m,g){return"".concat(g,"-")},p=function(m,g){return g===void 0&&(g={}),c(m)?m:(m=m.toLowerCase(),g.reactCompat?m=m.replace(a,f):m=m.replace(s,f),m.replace(n,u))};return ia.camelCase=p,ia}var sa,Mm;function __(){if(Mm)return sa;Mm=1;var e=sa&&sa.__importDefault||function(a){return a&&a.__esModule?a:{default:a}},n=e(v_()),r=w_();function s(a,c){var u={};return!a||typeof a!="string"||(0,n.default)(a,function(f,p){f&&p&&(u[(0,r.camelCase)(f,c)]=p)}),u}return s.default=s,sa=s,sa}var k_=__();const E_=wa(k_),Rg=Ig("end"),bd=Ig("start");function Ig(e){return n;function n(r){const s=r&&r.position&&r.position[e]||{};if(typeof s.line=="number"&&s.line>0&&typeof s.column=="number"&&s.column>0)return{line:s.line,column:s.column,offset:typeof s.offset=="number"&&s.offset>-1?s.offset:void 0}}}function S_(e){const n=bd(e),r=Rg(e);if(n&&r)return{start:n,end:r}}function da(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?Rm(e.position):"start"in e||"end"in e?Rm(e):"line"in e||"column"in e?Zu(e):""}function Zu(e){return Im(e&&e.line)+":"+Im(e&&e.column)}function Rm(e){return Zu(e&&e.start)+"-"+Zu(e&&e.end)}function Im(e){return e&&typeof e=="number"?e:1}class fn extends Error{constructor(n,r,s){super(),typeof r=="string"&&(s=r,r=void 0);let a="",c={},u=!1;if(r&&("line"in r&&"column"in r?c={place:r}:"start"in r&&"end"in r?c={place:r}:"type"in r?c={ancestors:[r],place:r.position}:c={...r}),typeof n=="string"?a=n:!c.cause&&n&&(u=!0,a=n.message,c.cause=n),!c.ruleId&&!c.source&&typeof s=="string"){const p=s.indexOf(":");p===-1?c.ruleId=s:(c.source=s.slice(0,p),c.ruleId=s.slice(p+1))}if(!c.place&&c.ancestors&&c.ancestors){const p=c.ancestors[c.ancestors.length-1];p&&(c.place=p.position)}const f=c.place&&"start"in c.place?c.place.start:c.place;this.ancestors=c.ancestors||void 0,this.cause=c.cause||void 0,this.column=f?f.column:void 0,this.fatal=void 0,this.file="",this.message=a,this.line=f?f.line:void 0,this.name=da(c.place)||"1:1",this.place=c.place||void 0,this.reason=this.message,this.ruleId=c.ruleId||void 0,this.source=c.source||void 0,this.stack=u&&c.cause&&typeof c.cause.stack=="string"?c.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}fn.prototype.file="";fn.prototype.name="";fn.prototype.reason="";fn.prototype.message="";fn.prototype.stack="";fn.prototype.column=void 0;fn.prototype.line=void 0;fn.prototype.ancestors=void 0;fn.prototype.cause=void 0;fn.prototype.fatal=void 0;fn.prototype.place=void 0;fn.prototype.ruleId=void 0;fn.prototype.source=void 0;const vd={}.hasOwnProperty,N_=new Map,C_=/[A-Z]/g,T_=new Set(["table","tbody","thead","tfoot","tr"]),A_=new Set(["td","th"]),Og="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function M_(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const r=n.filePath||void 0;let s;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");s=F_(r,n.jsxDEV)}else{if(typeof n.jsx!="function")throw new TypeError("Expected `jsx` in production options");if(typeof n.jsxs!="function")throw new TypeError("Expected `jsxs` in production options");s=P_(r,n.jsx,n.jsxs)}const a={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:s,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:r,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?xd:y_,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},c=jg(a,e,void 0);return c&&typeof c!="string"?c:a.create(e,a.Fragment,{children:c||void 0},void 0)}function jg(e,n,r){if(n.type==="element")return R_(e,n,r);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return I_(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return j_(e,n,r);if(n.type==="mdxjsEsm")return O_(e,n);if(n.type==="root")return L_(e,n,r);if(n.type==="text")return D_(e,n)}function R_(e,n,r){const s=e.schema;let a=s;n.tagName.toLowerCase()==="svg"&&s.space==="html"&&(a=xd,e.schema=a),e.ancestors.push(n);const c=Dg(e,n.tagName,!1),u=z_(e,n);let f=_d(e,n);return T_.has(n.tagName)&&(f=f.filter(function(p){return typeof p=="string"?!o_(p):!0})),Lg(e,u,c,n),wd(u,f),e.ancestors.pop(),e.schema=s,e.create(n,c,u,r)}function I_(e,n){if(n.data&&n.data.estree&&e.evaluater){const s=n.data.estree.body[0];return s.type,e.evaluater.evaluateExpression(s.expression)}xa(e,n.position)}function O_(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);xa(e,n.position)}function j_(e,n,r){const s=e.schema;let a=s;n.name==="svg"&&s.space==="html"&&(a=xd,e.schema=a),e.ancestors.push(n);const c=n.name===null?e.Fragment:Dg(e,n.name,!0),u=B_(e,n),f=_d(e,n);return Lg(e,u,c,n),wd(u,f),e.ancestors.pop(),e.schema=s,e.create(n,c,u,r)}function L_(e,n,r){const s={};return wd(s,_d(e,n)),e.create(n,e.Fragment,s,r)}function D_(e,n){return n.value}function Lg(e,n,r,s){typeof r!="string"&&r!==e.Fragment&&e.passNode&&(n.node=s)}function wd(e,n){if(n.length>0){const r=n.length>1?n:n[0];r&&(e.children=r)}}function P_(e,n,r){return s;function s(a,c,u,f){const m=Array.isArray(u.children)?r:n;return f?m(c,u,f):m(c,u)}}function F_(e,n){return r;function r(s,a,c,u){const f=Array.isArray(c.children),p=bd(s);return n(a,c,u,f,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function z_(e,n){const r={};let s,a;for(a in n.properties)if(a!=="children"&&vd.call(n.properties,a)){const c=U_(e,a,n.properties[a]);if(c){const[u,f]=c;e.tableCellAlignToStyle&&u==="align"&&typeof f=="string"&&A_.has(n.tagName)?s=f:r[u]=f}}if(s){const c=r.style||(r.style={});c[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=s}return r}function B_(e,n){const r={};for(const s of n.attributes)if(s.type==="mdxJsxExpressionAttribute")if(s.data&&s.data.estree&&e.evaluater){const c=s.data.estree.body[0];c.type;const u=c.expression;u.type;const f=u.properties[0];f.type,Object.assign(r,e.evaluater.evaluateExpression(f.argument))}else xa(e,n.position);else{const a=s.name;let c;if(s.value&&typeof s.value=="object")if(s.value.data&&s.value.data.estree&&e.evaluater){const f=s.value.data.estree.body[0];f.type,c=e.evaluater.evaluateExpression(f.expression)}else xa(e,n.position);else c=s.value===null?!0:s.value;r[a]=c}return r}function _d(e,n){const r=[];let s=-1;const a=e.passKeys?new Map:N_;for(;++s<n.children.length;){const c=n.children[s];let u;if(e.passKeys){const p=c.type==="element"?c.tagName:c.type==="mdxJsxFlowElement"||c.type==="mdxJsxTextElement"?c.name:void 0;if(p){const m=a.get(p)||0;u=p+"-"+m,a.set(p,m+1)}}const f=jg(e,c,u);f!==void 0&&r.push(f)}return r}function U_(e,n,r){const s=m_(e.schema,n);if(!(r==null||typeof r=="number"&&Number.isNaN(r))){if(Array.isArray(r)&&(r=s.commaSeparated?n_(r):x_(r)),s.property==="style"){let a=typeof r=="object"?r:$_(e,String(r));return e.stylePropertyNameCase==="css"&&(a=H_(a)),["style",a]}return[e.elementAttributeNameCase==="react"&&s.space?d_[s.property]||s.property:s.attribute,r]}}function $_(e,n){try{return E_(n,{reactCompat:!0})}catch(r){if(e.ignoreInvalidStyle)return{};const s=r,a=new fn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:s,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Og+"#cannot-parse-style-attribute",a}}function Dg(e,n,r){let s;if(!r)s={type:"Literal",value:n};else if(n.includes(".")){const a=n.split(".");let c=-1,u;for(;++c<a.length;){const f=km(a[c])?{type:"Identifier",name:a[c]}:{type:"Literal",value:a[c]};u=u?{type:"MemberExpression",object:u,property:f,computed:!!(c&&f.type==="Literal"),optional:!1}:f}s=u}else s=km(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(s.type==="Literal"){const a=s.value;return vd.call(e.components,a)?e.components[a]:a}if(e.evaluater)return e.evaluater.evaluateExpression(s);xa(e)}function xa(e,n){const r=new fn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw r.file=e.filePath||void 0,r.url=Og+"#cannot-handle-mdx-estrees-without-createevaluater",r}function H_(e){const n={};let r;for(r in e)vd.call(e,r)&&(n[q_(r)]=e[r]);return n}function q_(e){let n=e.replace(C_,K_);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function K_(e){return"-"+e.toLowerCase()}const xu={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"]},W_={};function kd(e,n){const r=W_,s=typeof r.includeImageAlt=="boolean"?r.includeImageAlt:!0,a=typeof r.includeHtml=="boolean"?r.includeHtml:!0;return Pg(e,s,a)}function Pg(e,n,r){if(V_(e)){if("value"in e)return e.type==="html"&&!r?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return Om(e.children,n,r)}return Array.isArray(e)?Om(e,n,r):""}function Om(e,n,r){const s=[];let a=-1;for(;++a<e.length;)s[a]=Pg(e[a],n,r);return s.join("")}function V_(e){return!!(e&&typeof e=="object")}const jm=document.createElement("i");function Ed(e){const n="&"+e+";";jm.innerHTML=n;const r=jm.textContent;return r.charCodeAt(r.length-1)===59&&e!=="semi"||r===n?!1:r}function Pn(e,n,r,s){const a=e.length;let c=0,u;if(n<0?n=-n>a?0:a+n:n=n>a?a:n,r=r>0?r:0,s.length<1e4)u=Array.from(s),u.unshift(n,r),e.splice(...u);else for(r&&e.splice(n,r);c<s.length;)u=s.slice(c,c+1e4),u.unshift(n,0),e.splice(...u),c+=1e4,n+=1e4}function Yn(e,n){return e.length>0?(Pn(e,e.length,0,n),e):n}const Lm={}.hasOwnProperty;function Fg(e){const n={};let r=-1;for(;++r<e.length;)G_(n,e[r]);return n}function G_(e,n){let r;for(r in n){const a=(Lm.call(e,r)?e[r]:void 0)||(e[r]={}),c=n[r];let u;if(c)for(u in c){Lm.call(a,u)||(a[u]=[]);const f=c[u];Y_(a[u],Array.isArray(f)?f:f?[f]:[])}}}function Y_(e,n){let r=-1;const s=[];for(;++r<n.length;)(n[r].add==="after"?e:s).push(n[r]);Pn(e,0,0,s)}function zg(e,n){const r=Number.parseInt(e,n);return r<9||r===11||r>13&&r<32||r>126&&r<160||r>55295&&r<57344||r>64975&&r<65008||(r&65535)===65535||(r&65535)===65534||r>1114111?"�":String.fromCodePoint(r)}function rr(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const xn=ei(/[A-Za-z]/),dn=ei(/[\dA-Za-z]/),X_=ei(/[#-'*+\--9=?A-Z^-~]/);function rl(e){return e!==null&&(e<32||e===127)}const Ju=ei(/\d/),Q_=ei(/[\dA-Fa-f]/),Z_=ei(/[!-/:-@[-`{-~]/);function Ke(e){return e!==null&&e<-2}function kt(e){return e!==null&&(e<0||e===32)}function ut(e){return e===-2||e===-1||e===32}const yl=ei(new RegExp("\\p{P}|\\p{S}","u")),Ni=ei(/\s/);function ei(e){return n;function n(r){return r!==null&&r>-1&&e.test(String.fromCharCode(r))}}function ws(e){const n=[];let r=-1,s=0,a=0;for(;++r<e.length;){const c=e.charCodeAt(r);let u="";if(c===37&&dn(e.charCodeAt(r+1))&&dn(e.charCodeAt(r+2)))a=2;else if(c<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(c))||(u=String.fromCharCode(c));else if(c>55295&&c<57344){const f=e.charCodeAt(r+1);c<56320&&f>56319&&f<57344?(u=String.fromCharCode(c,f),a=1):u="�"}else u=String.fromCharCode(c);u&&(n.push(e.slice(s,r),encodeURIComponent(u)),s=r+a+1,u=""),a&&(r+=a,a=0)}return n.join("")+e.slice(s)}function pt(e,n,r,s){const a=s?s-1:Number.POSITIVE_INFINITY;let c=0;return u;function u(p){return ut(p)?(e.enter(r),f(p)):n(p)}function f(p){return ut(p)&&c++<a?(e.consume(p),f):(e.exit(r),n(p))}}const J_={tokenize:ek};function ek(e){const n=e.attempt(this.parser.constructs.contentInitial,s,a);let r;return n;function s(f){if(f===null){e.consume(f);return}return e.enter("lineEnding"),e.consume(f),e.exit("lineEnding"),pt(e,n,"linePrefix")}function a(f){return e.enter("paragraph"),c(f)}function c(f){const p=e.enter("chunkText",{contentType:"text",previous:r});return r&&(r.next=p),r=p,u(f)}function u(f){if(f===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(f);return}return Ke(f)?(e.consume(f),e.exit("chunkText"),c):(e.consume(f),u)}}const tk={tokenize:nk},Dm={tokenize:rk};function nk(e){const n=this,r=[];let s=0,a,c,u;return f;function f(A){if(s<r.length){const G=r[s];return n.containerState=G[1],e.attempt(G[0].continuation,p,m)(A)}return m(A)}function p(A){if(s++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,a&&O();const G=n.events.length;let P=G,M;for(;P--;)if(n.events[P][0]==="exit"&&n.events[P][1].type==="chunkFlow"){M=n.events[P][1].end;break}S(s);let W=G;for(;W<n.events.length;)n.events[W][1].end={...M},W++;return Pn(n.events,P+1,0,n.events.slice(G)),n.events.length=W,m(A)}return f(A)}function m(A){if(s===r.length){if(!a)return v(A);if(a.currentConstruct&&a.currentConstruct.concrete)return w(A);n.interrupt=!!(a.currentConstruct&&!a._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(Dm,g,y)(A)}function g(A){return a&&O(),S(s),v(A)}function y(A){return n.parser.lazy[n.now().line]=s!==r.length,u=n.now().offset,w(A)}function v(A){return n.containerState={},e.attempt(Dm,b,w)(A)}function b(A){return s++,r.push([n.currentConstruct,n.containerState]),v(A)}function w(A){if(A===null){a&&O(),S(0),e.consume(A);return}return a=a||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:a,contentType:"flow",previous:c}),_(A)}function _(A){if(A===null){E(e.exit("chunkFlow"),!0),S(0),e.consume(A);return}return Ke(A)?(e.consume(A),E(e.exit("chunkFlow")),s=0,n.interrupt=void 0,f):(e.consume(A),_)}function E(A,G){const P=n.sliceStream(A);if(G&&P.push(null),A.previous=c,c&&(c.next=A),c=A,a.defineSkip(A.start),a.write(P),n.parser.lazy[A.start.line]){let M=a.events.length;for(;M--;)if(a.events[M][1].start.offset<u&&(!a.events[M][1].end||a.events[M][1].end.offset>u))return;const W=n.events.length;let ee=W,oe,D;for(;ee--;)if(n.events[ee][0]==="exit"&&n.events[ee][1].type==="chunkFlow"){if(oe){D=n.events[ee][1].end;break}oe=!0}for(S(s),M=W;M<n.events.length;)n.events[M][1].end={...D},M++;Pn(n.events,ee+1,0,n.events.slice(W)),n.events.length=M}}function S(A){let G=r.length;for(;G-- >A;){const P=r[G];n.containerState=P[1],P[0].exit.call(n,e)}r.length=A}function O(){a.write([null]),c=void 0,a=void 0,n.containerState._closeFlow=void 0}}function rk(e,n,r){return pt(e,e.attempt(this.parser.constructs.document,n,r),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function xs(e){if(e===null||kt(e)||Ni(e))return 1;if(yl(e))return 2}function xl(e,n,r){const s=[];let a=-1;for(;++a<e.length;){const c=e[a].resolveAll;c&&!s.includes(c)&&(n=c(n,r),s.push(c))}return n}const ed={name:"attention",resolveAll:ik,tokenize:sk};function ik(e,n){let r=-1,s,a,c,u,f,p,m,g;for(;++r<e.length;)if(e[r][0]==="enter"&&e[r][1].type==="attentionSequence"&&e[r][1]._close){for(s=r;s--;)if(e[s][0]==="exit"&&e[s][1].type==="attentionSequence"&&e[s][1]._open&&n.sliceSerialize(e[s][1]).charCodeAt(0)===n.sliceSerialize(e[r][1]).charCodeAt(0)){if((e[s][1]._close||e[r][1]._open)&&(e[r][1].end.offset-e[r][1].start.offset)%3&&!((e[s][1].end.offset-e[s][1].start.offset+e[r][1].end.offset-e[r][1].start.offset)%3))continue;p=e[s][1].end.offset-e[s][1].start.offset>1&&e[r][1].end.offset-e[r][1].start.offset>1?2:1;const y={...e[s][1].end},v={...e[r][1].start};Pm(y,-p),Pm(v,p),u={type:p>1?"strongSequence":"emphasisSequence",start:y,end:{...e[s][1].end}},f={type:p>1?"strongSequence":"emphasisSequence",start:{...e[r][1].start},end:v},c={type:p>1?"strongText":"emphasisText",start:{...e[s][1].end},end:{...e[r][1].start}},a={type:p>1?"strong":"emphasis",start:{...u.start},end:{...f.end}},e[s][1].end={...u.start},e[r][1].start={...f.end},m=[],e[s][1].end.offset-e[s][1].start.offset&&(m=Yn(m,[["enter",e[s][1],n],["exit",e[s][1],n]])),m=Yn(m,[["enter",a,n],["enter",u,n],["exit",u,n],["enter",c,n]]),m=Yn(m,xl(n.parser.constructs.insideSpan.null,e.slice(s+1,r),n)),m=Yn(m,[["exit",c,n],["enter",f,n],["exit",f,n],["exit",a,n]]),e[r][1].end.offset-e[r][1].start.offset?(g=2,m=Yn(m,[["enter",e[r][1],n],["exit",e[r][1],n]])):g=0,Pn(e,s-1,r-s+3,m),r=s+m.length-g-2;break}}for(r=-1;++r<e.length;)e[r][1].type==="attentionSequence"&&(e[r][1].type="data");return e}function sk(e,n){const r=this.parser.constructs.attentionMarkers.null,s=this.previous,a=xs(s);let c;return u;function u(p){return c=p,e.enter("attentionSequence"),f(p)}function f(p){if(p===c)return e.consume(p),f;const m=e.exit("attentionSequence"),g=xs(p),y=!g||g===2&&a||r.includes(p),v=!a||a===2&&g||r.includes(s);return m._open=!!(c===42?y:y&&(a||!v)),m._close=!!(c===42?v:v&&(g||!y)),n(p)}}function Pm(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const ak={name:"autolink",tokenize:ok};function ok(e,n,r){let s=0;return a;function a(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),c}function c(b){return xn(b)?(e.consume(b),u):b===64?r(b):m(b)}function u(b){return b===43||b===45||b===46||dn(b)?(s=1,f(b)):m(b)}function f(b){return b===58?(e.consume(b),s=0,p):(b===43||b===45||b===46||dn(b))&&s++<32?(e.consume(b),f):(s=0,m(b))}function p(b){return b===62?(e.exit("autolinkProtocol"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):b===null||b===32||b===60||rl(b)?r(b):(e.consume(b),p)}function m(b){return b===64?(e.consume(b),g):X_(b)?(e.consume(b),m):r(b)}function g(b){return dn(b)?y(b):r(b)}function y(b){return b===46?(e.consume(b),s=0,g):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):v(b)}function v(b){if((b===45||dn(b))&&s++<63){const w=b===45?v:y;return e.consume(b),w}return r(b)}}const Sa={partial:!0,tokenize:lk};function lk(e,n,r){return s;function s(c){return ut(c)?pt(e,a,"linePrefix")(c):a(c)}function a(c){return c===null||Ke(c)?n(c):r(c)}}const Bg={continuation:{tokenize:uk},exit:dk,name:"blockQuote",tokenize:ck};function ck(e,n,r){const s=this;return a;function a(u){if(u===62){const f=s.containerState;return f.open||(e.enter("blockQuote",{_container:!0}),f.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),c}return r(u)}function c(u){return ut(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function uk(e,n,r){const s=this;return a;function a(u){return ut(u)?pt(e,c,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):c(u)}function c(u){return e.attempt(Bg,n,r)(u)}}function dk(e){e.exit("blockQuote")}const Ug={name:"characterEscape",tokenize:fk};function fk(e,n,r){return s;function s(c){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(c),e.exit("escapeMarker"),a}function a(c){return Z_(c)?(e.enter("characterEscapeValue"),e.consume(c),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):r(c)}}const $g={name:"characterReference",tokenize:pk};function pk(e,n,r){const s=this;let a=0,c,u;return f;function f(y){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),p}function p(y){return y===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(y),e.exit("characterReferenceMarkerNumeric"),m):(e.enter("characterReferenceValue"),c=31,u=dn,g(y))}function m(y){return y===88||y===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(y),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),c=6,u=Q_,g):(e.enter("characterReferenceValue"),c=7,u=Ju,g(y))}function g(y){if(y===59&&a){const v=e.exit("characterReferenceValue");return u===dn&&!Ed(s.sliceSerialize(v))?r(y):(e.enter("characterReferenceMarker"),e.consume(y),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(y)&&a++<c?(e.consume(y),g):r(y)}}const Fm={partial:!0,tokenize:hk},zm={concrete:!0,name:"codeFenced",tokenize:mk};function mk(e,n,r){const s=this,a={partial:!0,tokenize:P};let c=0,u=0,f;return p;function p(M){return m(M)}function m(M){const W=s.events[s.events.length-1];return c=W&&W[1].type==="linePrefix"?W[2].sliceSerialize(W[1],!0).length:0,f=M,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),g(M)}function g(M){return M===f?(u++,e.consume(M),g):u<3?r(M):(e.exit("codeFencedFenceSequence"),ut(M)?pt(e,y,"whitespace")(M):y(M))}function y(M){return M===null||Ke(M)?(e.exit("codeFencedFence"),s.interrupt?n(M):e.check(Fm,_,G)(M)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),v(M))}function v(M){return M===null||Ke(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),y(M)):ut(M)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),pt(e,b,"whitespace")(M)):M===96&&M===f?r(M):(e.consume(M),v)}function b(M){return M===null||Ke(M)?y(M):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),w(M))}function w(M){return M===null||Ke(M)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),y(M)):M===96&&M===f?r(M):(e.consume(M),w)}function _(M){return e.attempt(a,G,E)(M)}function E(M){return e.enter("lineEnding"),e.consume(M),e.exit("lineEnding"),S}function S(M){return c>0&&ut(M)?pt(e,O,"linePrefix",c+1)(M):O(M)}function O(M){return M===null||Ke(M)?e.check(Fm,_,G)(M):(e.enter("codeFlowValue"),A(M))}function A(M){return M===null||Ke(M)?(e.exit("codeFlowValue"),O(M)):(e.consume(M),A)}function G(M){return e.exit("codeFenced"),n(M)}function P(M,W,ee){let oe=0;return D;function D(q){return M.enter("lineEnding"),M.consume(q),M.exit("lineEnding"),ce}function ce(q){return M.enter("codeFencedFence"),ut(q)?pt(M,V,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(q):V(q)}function V(q){return q===f?(M.enter("codeFencedFenceSequence"),j(q)):ee(q)}function j(q){return q===f?(oe++,M.consume(q),j):oe>=u?(M.exit("codeFencedFenceSequence"),ut(q)?pt(M,B,"whitespace")(q):B(q)):ee(q)}function B(q){return q===null||Ke(q)?(M.exit("codeFencedFence"),W(q)):ee(q)}}}function hk(e,n,r){const s=this;return a;function a(u){return u===null?r(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c)}function c(u){return s.parser.lazy[s.now().line]?r(u):n(u)}}const bu={name:"codeIndented",tokenize:yk},gk={partial:!0,tokenize:xk};function yk(e,n,r){const s=this;return a;function a(m){return e.enter("codeIndented"),pt(e,c,"linePrefix",5)(m)}function c(m){const g=s.events[s.events.length-1];return g&&g[1].type==="linePrefix"&&g[2].sliceSerialize(g[1],!0).length>=4?u(m):r(m)}function u(m){return m===null?p(m):Ke(m)?e.attempt(gk,u,p)(m):(e.enter("codeFlowValue"),f(m))}function f(m){return m===null||Ke(m)?(e.exit("codeFlowValue"),u(m)):(e.consume(m),f)}function p(m){return e.exit("codeIndented"),n(m)}}function xk(e,n,r){const s=this;return a;function a(u){return s.parser.lazy[s.now().line]?r(u):Ke(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),a):pt(e,c,"linePrefix",5)(u)}function c(u){const f=s.events[s.events.length-1];return f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):Ke(u)?a(u):r(u)}}const bk={name:"codeText",previous:wk,resolve:vk,tokenize:_k};function vk(e){let n=e.length-4,r=3,s,a;if((e[r][1].type==="lineEnding"||e[r][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(s=r;++s<n;)if(e[s][1].type==="codeTextData"){e[r][1].type="codeTextPadding",e[n][1].type="codeTextPadding",r+=2,n-=2;break}}for(s=r-1,n++;++s<=n;)a===void 0?s!==n&&e[s][1].type!=="lineEnding"&&(a=s):(s===n||e[s][1].type==="lineEnding")&&(e[a][1].type="codeTextData",s!==a+2&&(e[a][1].end=e[s-1][1].end,e.splice(a+2,s-a-2),n-=s-a-2,s=a+2),a=void 0);return e}function wk(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function _k(e,n,r){let s=0,a,c;return u;function u(y){return e.enter("codeText"),e.enter("codeTextSequence"),f(y)}function f(y){return y===96?(e.consume(y),s++,f):(e.exit("codeTextSequence"),p(y))}function p(y){return y===null?r(y):y===32?(e.enter("space"),e.consume(y),e.exit("space"),p):y===96?(c=e.enter("codeTextSequence"),a=0,g(y)):Ke(y)?(e.enter("lineEnding"),e.consume(y),e.exit("lineEnding"),p):(e.enter("codeTextData"),m(y))}function m(y){return y===null||y===32||y===96||Ke(y)?(e.exit("codeTextData"),p(y)):(e.consume(y),m)}function g(y){return y===96?(e.consume(y),a++,g):a===s?(e.exit("codeTextSequence"),e.exit("codeText"),n(y)):(c.type="codeTextData",m(y))}}class kk{constructor(n){this.left=n?[...n]:[],this.right=[]}get(n){if(n<0||n>=this.left.length+this.right.length)throw new RangeError("Cannot access index `"+n+"` in a splice buffer of size `"+(this.left.length+this.right.length)+"`");return n<this.left.length?this.left[n]:this.right[this.right.length-n+this.left.length-1]}get length(){return this.left.length+this.right.length}shift(){return this.setCursor(0),this.right.pop()}slice(n,r){const s=r??Number.POSITIVE_INFINITY;return s<this.left.length?this.left.slice(n,s):n>this.left.length?this.right.slice(this.right.length-s+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-s+this.left.length).reverse())}splice(n,r,s){const a=r||0;this.setCursor(Math.trunc(n));const c=this.right.splice(this.right.length-a,Number.POSITIVE_INFINITY);return s&&aa(this.left,s),c.reverse()}pop(){return this.setCursor(Number.POSITIVE_INFINITY),this.left.pop()}push(n){this.setCursor(Number.POSITIVE_INFINITY),this.left.push(n)}pushMany(n){this.setCursor(Number.POSITIVE_INFINITY),aa(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),aa(this.right,n.reverse())}setCursor(n){if(!(n===this.left.length||n>this.left.length&&this.right.length===0||n<0&&this.left.length===0))if(n<this.left.length){const r=this.left.splice(n,Number.POSITIVE_INFINITY);aa(this.right,r.reverse())}else{const r=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);aa(this.left,r.reverse())}}}function aa(e,n){let r=0;if(n.length<1e4)e.push(...n);else for(;r<n.length;)e.push(...n.slice(r,r+1e4)),r+=1e4}function Hg(e){const n={};let r=-1,s,a,c,u,f,p,m;const g=new kk(e);for(;++r<g.length;){for(;r in n;)r=n[r];if(s=g.get(r),r&&s[1].type==="chunkFlow"&&g.get(r-1)[1].type==="listItemPrefix"&&(p=s[1]._tokenizer.events,c=0,c<p.length&&p[c][1].type==="lineEndingBlank"&&(c+=2),c<p.length&&p[c][1].type==="content"))for(;++c<p.length&&p[c][1].type!=="content";)p[c][1].type==="chunkText"&&(p[c][1]._isInFirstContentOfListItem=!0,c++);if(s[0]==="enter")s[1].contentType&&(Object.assign(n,Ek(g,r)),r=n[r],m=!0);else if(s[1]._container){for(c=r,a=void 0;c--;)if(u=g.get(c),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(a&&(g.get(a)[1].type="lineEndingBlank"),u[1].type="lineEnding",a=c);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;a&&(s[1].end={...g.get(a)[1].start},f=g.slice(a,r),f.unshift(s),g.splice(a,r-a+1,f))}}return Pn(e,0,Number.POSITIVE_INFINITY,g.slice(0)),!m}function Ek(e,n){const r=e.get(n)[1],s=e.get(n)[2];let a=n-1;const c=[];let u=r._tokenizer;u||(u=s.parser[r.contentType](r.start),r._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const f=u.events,p=[],m={};let g,y,v=-1,b=r,w=0,_=0;const E=[_];for(;b;){for(;e.get(++a)[1]!==b;);c.push(a),b._tokenizer||(g=s.sliceStream(b),b.next||g.push(null),y&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(g),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),y=b,b=b.next}for(b=r;++v<f.length;)f[v][0]==="exit"&&f[v-1][0]==="enter"&&f[v][1].type===f[v-1][1].type&&f[v][1].start.line!==f[v][1].end.line&&(_=v+1,E.push(_),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):E.pop(),v=E.length;v--;){const S=f.slice(E[v],E[v+1]),O=c.pop();p.push([O,O+S.length-1]),e.splice(O,2,S)}for(p.reverse(),v=-1;++v<p.length;)m[w+p[v][0]]=w+p[v][1],w+=p[v][1]-p[v][0]-1;return m}const Sk={resolve:Ck,tokenize:Tk},Nk={partial:!0,tokenize:Ak};function Ck(e){return Hg(e),e}function Tk(e,n){let r;return s;function s(f){return e.enter("content"),r=e.enter("chunkContent",{contentType:"content"}),a(f)}function a(f){return f===null?c(f):Ke(f)?e.check(Nk,u,c)(f):(e.consume(f),a)}function c(f){return e.exit("chunkContent"),e.exit("content"),n(f)}function u(f){return e.consume(f),e.exit("chunkContent"),r.next=e.enter("chunkContent",{contentType:"content",previous:r}),r=r.next,a}}function Ak(e,n,r){const s=this;return a;function a(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),pt(e,c,"linePrefix")}function c(u){if(u===null||Ke(u))return r(u);const f=s.events[s.events.length-1];return!s.parser.constructs.disable.null.includes("codeIndented")&&f&&f[1].type==="linePrefix"&&f[2].sliceSerialize(f[1],!0).length>=4?n(u):e.interrupt(s.parser.constructs.flow,r,n)(u)}}function qg(e,n,r,s,a,c,u,f,p){const m=p||Number.POSITIVE_INFINITY;let g=0;return y;function y(S){return S===60?(e.enter(s),e.enter(a),e.enter(c),e.consume(S),e.exit(c),v):S===null||S===32||S===41||rl(S)?r(S):(e.enter(s),e.enter(u),e.enter(f),e.enter("chunkString",{contentType:"string"}),_(S))}function v(S){return S===62?(e.enter(c),e.consume(S),e.exit(c),e.exit(a),e.exit(s),n):(e.enter(f),e.enter("chunkString",{contentType:"string"}),b(S))}function b(S){return S===62?(e.exit("chunkString"),e.exit(f),v(S)):S===null||S===60||Ke(S)?r(S):(e.consume(S),S===92?w:b)}function w(S){return S===60||S===62||S===92?(e.consume(S),b):b(S)}function _(S){return!g&&(S===null||S===41||kt(S))?(e.exit("chunkString"),e.exit(f),e.exit(u),e.exit(s),n(S)):g<m&&S===40?(e.consume(S),g++,_):S===41?(e.consume(S),g--,_):S===null||S===32||S===40||rl(S)?r(S):(e.consume(S),S===92?E:_)}function E(S){return S===40||S===41||S===92?(e.consume(S),_):_(S)}}function Kg(e,n,r,s,a,c){const u=this;let f=0,p;return m;function m(b){return e.enter(s),e.enter(a),e.consume(b),e.exit(a),e.enter(c),g}function g(b){return f>999||b===null||b===91||b===93&&!p||b===94&&!f&&"_hiddenFootnoteSupport"in u.parser.constructs?r(b):b===93?(e.exit(c),e.enter(a),e.consume(b),e.exit(a),e.exit(s),n):Ke(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),g):(e.enter("chunkString",{contentType:"string"}),y(b))}function y(b){return b===null||b===91||b===93||Ke(b)||f++>999?(e.exit("chunkString"),g(b)):(e.consume(b),p||(p=!ut(b)),b===92?v:y)}function v(b){return b===91||b===92||b===93?(e.consume(b),f++,y):y(b)}}function Wg(e,n,r,s,a,c){let u;return f;function f(v){return v===34||v===39||v===40?(e.enter(s),e.enter(a),e.consume(v),e.exit(a),u=v===40?41:v,p):r(v)}function p(v){return v===u?(e.enter(a),e.consume(v),e.exit(a),e.exit(s),n):(e.enter(c),m(v))}function m(v){return v===u?(e.exit(c),p(u)):v===null?r(v):Ke(v)?(e.enter("lineEnding"),e.consume(v),e.exit("lineEnding"),pt(e,m,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),g(v))}function g(v){return v===u||v===null||Ke(v)?(e.exit("chunkString"),m(v)):(e.consume(v),v===92?y:g)}function y(v){return v===u||v===92?(e.consume(v),g):g(v)}}function fa(e,n){let r;return s;function s(a){return Ke(a)?(e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),r=!0,s):ut(a)?pt(e,s,r?"linePrefix":"lineSuffix")(a):n(a)}}const Mk={name:"definition",tokenize:Ik},Rk={partial:!0,tokenize:Ok};function Ik(e,n,r){const s=this;let a;return c;function c(b){return e.enter("definition"),u(b)}function u(b){return Kg.call(s,e,f,r,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function f(b){return a=rr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),p):r(b)}function p(b){return kt(b)?fa(e,m)(b):m(b)}function m(b){return qg(e,g,r,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function g(b){return e.attempt(Rk,y,y)(b)}function y(b){return ut(b)?pt(e,v,"whitespace")(b):v(b)}function v(b){return b===null||Ke(b)?(e.exit("definition"),s.parser.defined.push(a),n(b)):r(b)}}function Ok(e,n,r){return s;function s(f){return kt(f)?fa(e,a)(f):r(f)}function a(f){return Wg(e,c,r,"definitionTitle","definitionTitleMarker","definitionTitleString")(f)}function c(f){return ut(f)?pt(e,u,"whitespace")(f):u(f)}function u(f){return f===null||Ke(f)?n(f):r(f)}}const jk={name:"hardBreakEscape",tokenize:Lk};function Lk(e,n,r){return s;function s(c){return e.enter("hardBreakEscape"),e.consume(c),a}function a(c){return Ke(c)?(e.exit("hardBreakEscape"),n(c)):r(c)}}const Dk={name:"headingAtx",resolve:Pk,tokenize:Fk};function Pk(e,n){let r=e.length-2,s=3,a,c;return e[s][1].type==="whitespace"&&(s+=2),r-2>s&&e[r][1].type==="whitespace"&&(r-=2),e[r][1].type==="atxHeadingSequence"&&(s===r-1||r-4>s&&e[r-2][1].type==="whitespace")&&(r-=s+1===r?2:4),r>s&&(a={type:"atxHeadingText",start:e[s][1].start,end:e[r][1].end},c={type:"chunkText",start:e[s][1].start,end:e[r][1].end,contentType:"text"},Pn(e,s,r-s+1,[["enter",a,n],["enter",c,n],["exit",c,n],["exit",a,n]])),e}function Fk(e,n,r){let s=0;return a;function a(g){return e.enter("atxHeading"),c(g)}function c(g){return e.enter("atxHeadingSequence"),u(g)}function u(g){return g===35&&s++<6?(e.consume(g),u):g===null||kt(g)?(e.exit("atxHeadingSequence"),f(g)):r(g)}function f(g){return g===35?(e.enter("atxHeadingSequence"),p(g)):g===null||Ke(g)?(e.exit("atxHeading"),n(g)):ut(g)?pt(e,f,"whitespace")(g):(e.enter("atxHeadingText"),m(g))}function p(g){return g===35?(e.consume(g),p):(e.exit("atxHeadingSequence"),f(g))}function m(g){return g===null||g===35||kt(g)?(e.exit("atxHeadingText"),f(g)):(e.consume(g),m)}}const zk=["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"],Bm=["pre","script","style","textarea"],Bk={concrete:!0,name:"htmlFlow",resolveTo:Hk,tokenize:qk},Uk={partial:!0,tokenize:Wk},$k={partial:!0,tokenize:Kk};function Hk(e){let n=e.length;for(;n--&&!(e[n][0]==="enter"&&e[n][1].type==="htmlFlow"););return n>1&&e[n-2][1].type==="linePrefix"&&(e[n][1].start=e[n-2][1].start,e[n+1][1].start=e[n-2][1].start,e.splice(n-2,2)),e}function qk(e,n,r){const s=this;let a,c,u,f,p;return m;function m(T){return g(T)}function g(T){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(T),y}function y(T){return T===33?(e.consume(T),v):T===47?(e.consume(T),c=!0,_):T===63?(e.consume(T),a=3,s.interrupt?n:C):xn(T)?(e.consume(T),u=String.fromCharCode(T),E):r(T)}function v(T){return T===45?(e.consume(T),a=2,b):T===91?(e.consume(T),a=5,f=0,w):xn(T)?(e.consume(T),a=4,s.interrupt?n:C):r(T)}function b(T){return T===45?(e.consume(T),s.interrupt?n:C):r(T)}function w(T){const X="CDATA[";return T===X.charCodeAt(f++)?(e.consume(T),f===X.length?s.interrupt?n:V:w):r(T)}function _(T){return xn(T)?(e.consume(T),u=String.fromCharCode(T),E):r(T)}function E(T){if(T===null||T===47||T===62||kt(T)){const X=T===47,re=u.toLowerCase();return!X&&!c&&Bm.includes(re)?(a=1,s.interrupt?n(T):V(T)):zk.includes(u.toLowerCase())?(a=6,X?(e.consume(T),S):s.interrupt?n(T):V(T)):(a=7,s.interrupt&&!s.parser.lazy[s.now().line]?r(T):c?O(T):A(T))}return T===45||dn(T)?(e.consume(T),u+=String.fromCharCode(T),E):r(T)}function S(T){return T===62?(e.consume(T),s.interrupt?n:V):r(T)}function O(T){return ut(T)?(e.consume(T),O):D(T)}function A(T){return T===47?(e.consume(T),D):T===58||T===95||xn(T)?(e.consume(T),G):ut(T)?(e.consume(T),A):D(T)}function G(T){return T===45||T===46||T===58||T===95||dn(T)?(e.consume(T),G):P(T)}function P(T){return T===61?(e.consume(T),M):ut(T)?(e.consume(T),P):A(T)}function M(T){return T===null||T===60||T===61||T===62||T===96?r(T):T===34||T===39?(e.consume(T),p=T,W):ut(T)?(e.consume(T),M):ee(T)}function W(T){return T===p?(e.consume(T),p=null,oe):T===null||Ke(T)?r(T):(e.consume(T),W)}function ee(T){return T===null||T===34||T===39||T===47||T===60||T===61||T===62||T===96||kt(T)?P(T):(e.consume(T),ee)}function oe(T){return T===47||T===62||ut(T)?A(T):r(T)}function D(T){return T===62?(e.consume(T),ce):r(T)}function ce(T){return T===null||Ke(T)?V(T):ut(T)?(e.consume(T),ce):r(T)}function V(T){return T===45&&a===2?(e.consume(T),Z):T===60&&a===1?(e.consume(T),ne):T===62&&a===4?(e.consume(T),R):T===63&&a===3?(e.consume(T),C):T===93&&a===5?(e.consume(T),ue):Ke(T)&&(a===6||a===7)?(e.exit("htmlFlowData"),e.check(Uk,J,j)(T)):T===null||Ke(T)?(e.exit("htmlFlowData"),j(T)):(e.consume(T),V)}function j(T){return e.check($k,B,J)(T)}function B(T){return e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),q}function q(T){return T===null||Ke(T)?j(T):(e.enter("htmlFlowData"),V(T))}function Z(T){return T===45?(e.consume(T),C):V(T)}function ne(T){return T===47?(e.consume(T),u="",K):V(T)}function K(T){if(T===62){const X=u.toLowerCase();return Bm.includes(X)?(e.consume(T),R):V(T)}return xn(T)&&u.length<8?(e.consume(T),u+=String.fromCharCode(T),K):V(T)}function ue(T){return T===93?(e.consume(T),C):V(T)}function C(T){return T===62?(e.consume(T),R):T===45&&a===2?(e.consume(T),C):V(T)}function R(T){return T===null||Ke(T)?(e.exit("htmlFlowData"),J(T)):(e.consume(T),R)}function J(T){return e.exit("htmlFlow"),n(T)}}function Kk(e,n,r){const s=this;return a;function a(u){return Ke(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),c):r(u)}function c(u){return s.parser.lazy[s.now().line]?r(u):n(u)}}function Wk(e,n,r){return s;function s(a){return e.enter("lineEnding"),e.consume(a),e.exit("lineEnding"),e.attempt(Sa,n,r)}}const Vk={name:"htmlText",tokenize:Gk};function Gk(e,n,r){const s=this;let a,c,u;return f;function f(C){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(C),p}function p(C){return C===33?(e.consume(C),m):C===47?(e.consume(C),P):C===63?(e.consume(C),A):xn(C)?(e.consume(C),ee):r(C)}function m(C){return C===45?(e.consume(C),g):C===91?(e.consume(C),c=0,w):xn(C)?(e.consume(C),O):r(C)}function g(C){return C===45?(e.consume(C),b):r(C)}function y(C){return C===null?r(C):C===45?(e.consume(C),v):Ke(C)?(u=y,ne(C)):(e.consume(C),y)}function v(C){return C===45?(e.consume(C),b):y(C)}function b(C){return C===62?Z(C):C===45?v(C):y(C)}function w(C){const R="CDATA[";return C===R.charCodeAt(c++)?(e.consume(C),c===R.length?_:w):r(C)}function _(C){return C===null?r(C):C===93?(e.consume(C),E):Ke(C)?(u=_,ne(C)):(e.consume(C),_)}function E(C){return C===93?(e.consume(C),S):_(C)}function S(C){return C===62?Z(C):C===93?(e.consume(C),S):_(C)}function O(C){return C===null||C===62?Z(C):Ke(C)?(u=O,ne(C)):(e.consume(C),O)}function A(C){return C===null?r(C):C===63?(e.consume(C),G):Ke(C)?(u=A,ne(C)):(e.consume(C),A)}function G(C){return C===62?Z(C):A(C)}function P(C){return xn(C)?(e.consume(C),M):r(C)}function M(C){return C===45||dn(C)?(e.consume(C),M):W(C)}function W(C){return Ke(C)?(u=W,ne(C)):ut(C)?(e.consume(C),W):Z(C)}function ee(C){return C===45||dn(C)?(e.consume(C),ee):C===47||C===62||kt(C)?oe(C):r(C)}function oe(C){return C===47?(e.consume(C),Z):C===58||C===95||xn(C)?(e.consume(C),D):Ke(C)?(u=oe,ne(C)):ut(C)?(e.consume(C),oe):Z(C)}function D(C){return C===45||C===46||C===58||C===95||dn(C)?(e.consume(C),D):ce(C)}function ce(C){return C===61?(e.consume(C),V):Ke(C)?(u=ce,ne(C)):ut(C)?(e.consume(C),ce):oe(C)}function V(C){return C===null||C===60||C===61||C===62||C===96?r(C):C===34||C===39?(e.consume(C),a=C,j):Ke(C)?(u=V,ne(C)):ut(C)?(e.consume(C),V):(e.consume(C),B)}function j(C){return C===a?(e.consume(C),a=void 0,q):C===null?r(C):Ke(C)?(u=j,ne(C)):(e.consume(C),j)}function B(C){return C===null||C===34||C===39||C===60||C===61||C===96?r(C):C===47||C===62||kt(C)?oe(C):(e.consume(C),B)}function q(C){return C===47||C===62||kt(C)?oe(C):r(C)}function Z(C){return C===62?(e.consume(C),e.exit("htmlTextData"),e.exit("htmlText"),n):r(C)}function ne(C){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(C),e.exit("lineEnding"),K}function K(C){return ut(C)?pt(e,ue,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(C):ue(C)}function ue(C){return e.enter("htmlTextData"),u(C)}}const Sd={name:"labelEnd",resolveAll:Zk,resolveTo:Jk,tokenize:e0},Yk={tokenize:t0},Xk={tokenize:n0},Qk={tokenize:r0};function Zk(e){let n=-1;const r=[];for(;++n<e.length;){const s=e[n][1];if(r.push(e[n]),s.type==="labelImage"||s.type==="labelLink"||s.type==="labelEnd"){const a=s.type==="labelImage"?4:2;s.type="data",n+=a}}return e.length!==r.length&&Pn(e,0,e.length,r),e}function Jk(e,n){let r=e.length,s=0,a,c,u,f;for(;r--;)if(a=e[r][1],c){if(a.type==="link"||a.type==="labelLink"&&a._inactive)break;e[r][0]==="enter"&&a.type==="labelLink"&&(a._inactive=!0)}else if(u){if(e[r][0]==="enter"&&(a.type==="labelImage"||a.type==="labelLink")&&!a._balanced&&(c=r,a.type!=="labelLink")){s=2;break}}else a.type==="labelEnd"&&(u=r);const p={type:e[c][1].type==="labelLink"?"link":"image",start:{...e[c][1].start},end:{...e[e.length-1][1].end}},m={type:"label",start:{...e[c][1].start},end:{...e[u][1].end}},g={type:"labelText",start:{...e[c+s+2][1].end},end:{...e[u-2][1].start}};return f=[["enter",p,n],["enter",m,n]],f=Yn(f,e.slice(c+1,c+s+3)),f=Yn(f,[["enter",g,n]]),f=Yn(f,xl(n.parser.constructs.insideSpan.null,e.slice(c+s+4,u-3),n)),f=Yn(f,[["exit",g,n],e[u-2],e[u-1],["exit",m,n]]),f=Yn(f,e.slice(u+1)),f=Yn(f,[["exit",p,n]]),Pn(e,c,e.length,f),e}function e0(e,n,r){const s=this;let a=s.events.length,c,u;for(;a--;)if((s.events[a][1].type==="labelImage"||s.events[a][1].type==="labelLink")&&!s.events[a][1]._balanced){c=s.events[a][1];break}return f;function f(v){return c?c._inactive?y(v):(u=s.parser.defined.includes(rr(s.sliceSerialize({start:c.end,end:s.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(v),e.exit("labelMarker"),e.exit("labelEnd"),p):r(v)}function p(v){return v===40?e.attempt(Yk,g,u?g:y)(v):v===91?e.attempt(Xk,g,u?m:y)(v):u?g(v):y(v)}function m(v){return e.attempt(Qk,g,y)(v)}function g(v){return n(v)}function y(v){return c._balanced=!0,r(v)}}function t0(e,n,r){return s;function s(y){return e.enter("resource"),e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),a}function a(y){return kt(y)?fa(e,c)(y):c(y)}function c(y){return y===41?g(y):qg(e,u,f,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(y)}function u(y){return kt(y)?fa(e,p)(y):g(y)}function f(y){return r(y)}function p(y){return y===34||y===39||y===40?Wg(e,m,r,"resourceTitle","resourceTitleMarker","resourceTitleString")(y):g(y)}function m(y){return kt(y)?fa(e,g)(y):g(y)}function g(y){return y===41?(e.enter("resourceMarker"),e.consume(y),e.exit("resourceMarker"),e.exit("resource"),n):r(y)}}function n0(e,n,r){const s=this;return a;function a(f){return Kg.call(s,e,c,u,"reference","referenceMarker","referenceString")(f)}function c(f){return s.parser.defined.includes(rr(s.sliceSerialize(s.events[s.events.length-1][1]).slice(1,-1)))?n(f):r(f)}function u(f){return r(f)}}function r0(e,n,r){return s;function s(c){return e.enter("reference"),e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),a}function a(c){return c===93?(e.enter("referenceMarker"),e.consume(c),e.exit("referenceMarker"),e.exit("reference"),n):r(c)}}const i0={name:"labelStartImage",resolveAll:Sd.resolveAll,tokenize:s0};function s0(e,n,r){const s=this;return a;function a(f){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(f),e.exit("labelImageMarker"),c}function c(f){return f===91?(e.enter("labelMarker"),e.consume(f),e.exit("labelMarker"),e.exit("labelImage"),u):r(f)}function u(f){return f===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(f):n(f)}}const a0={name:"labelStartLink",resolveAll:Sd.resolveAll,tokenize:o0};function o0(e,n,r){const s=this;return a;function a(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),c}function c(u){return u===94&&"_hiddenFootnoteSupport"in s.parser.constructs?r(u):n(u)}}const vu={name:"lineEnding",tokenize:l0};function l0(e,n){return r;function r(s){return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),pt(e,n,"linePrefix")}}const Jo={name:"thematicBreak",tokenize:c0};function c0(e,n,r){let s=0,a;return c;function c(m){return e.enter("thematicBreak"),u(m)}function u(m){return a=m,f(m)}function f(m){return m===a?(e.enter("thematicBreakSequence"),p(m)):s>=3&&(m===null||Ke(m))?(e.exit("thematicBreak"),n(m)):r(m)}function p(m){return m===a?(e.consume(m),s++,p):(e.exit("thematicBreakSequence"),ut(m)?pt(e,f,"whitespace")(m):f(m))}}const Cn={continuation:{tokenize:p0},exit:h0,name:"list",tokenize:f0},u0={partial:!0,tokenize:g0},d0={partial:!0,tokenize:m0};function f0(e,n,r){const s=this,a=s.events[s.events.length-1];let c=a&&a[1].type==="linePrefix"?a[2].sliceSerialize(a[1],!0).length:0,u=0;return f;function f(b){const w=s.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(w==="listUnordered"?!s.containerState.marker||b===s.containerState.marker:Ju(b)){if(s.containerState.type||(s.containerState.type=w,e.enter(w,{_container:!0})),w==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Jo,r,m)(b):m(b);if(!s.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(b)}return r(b)}function p(b){return Ju(b)&&++u<10?(e.consume(b),p):(!s.interrupt||u<2)&&(s.containerState.marker?b===s.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),m(b)):r(b)}function m(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),s.containerState.marker=s.containerState.marker||b,e.check(Sa,s.interrupt?r:g,e.attempt(u0,v,y))}function g(b){return s.containerState.initialBlankLine=!0,c++,v(b)}function y(b){return ut(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),v):r(b)}function v(b){return s.containerState.size=c+s.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function p0(e,n,r){const s=this;return s.containerState._closeFlow=void 0,e.check(Sa,a,c);function a(f){return s.containerState.furtherBlankLines=s.containerState.furtherBlankLines||s.containerState.initialBlankLine,pt(e,n,"listItemIndent",s.containerState.size+1)(f)}function c(f){return s.containerState.furtherBlankLines||!ut(f)?(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,u(f)):(s.containerState.furtherBlankLines=void 0,s.containerState.initialBlankLine=void 0,e.attempt(d0,n,u)(f))}function u(f){return s.containerState._closeFlow=!0,s.interrupt=void 0,pt(e,e.attempt(Cn,n,r),"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(f)}}function m0(e,n,r){const s=this;return pt(e,a,"listItemIndent",s.containerState.size+1);function a(c){const u=s.events[s.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===s.containerState.size?n(c):r(c)}}function h0(e){e.exit(this.containerState.type)}function g0(e,n,r){const s=this;return pt(e,a,"listItemPrefixWhitespace",s.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function a(c){const u=s.events[s.events.length-1];return!ut(c)&&u&&u[1].type==="listItemPrefixWhitespace"?n(c):r(c)}}const Um={name:"setextUnderline",resolveTo:y0,tokenize:x0};function y0(e,n){let r=e.length,s,a,c;for(;r--;)if(e[r][0]==="enter"){if(e[r][1].type==="content"){s=r;break}e[r][1].type==="paragraph"&&(a=r)}else e[r][1].type==="content"&&e.splice(r,1),!c&&e[r][1].type==="definition"&&(c=r);const u={type:"setextHeading",start:{...e[s][1].start},end:{...e[e.length-1][1].end}};return e[a][1].type="setextHeadingText",c?(e.splice(a,0,["enter",u,n]),e.splice(c+1,0,["exit",e[s][1],n]),e[s][1].end={...e[c][1].end}):e[s][1]=u,e.push(["exit",u,n]),e}function x0(e,n,r){const s=this;let a;return c;function c(m){let g=s.events.length,y;for(;g--;)if(s.events[g][1].type!=="lineEnding"&&s.events[g][1].type!=="linePrefix"&&s.events[g][1].type!=="content"){y=s.events[g][1].type==="paragraph";break}return!s.parser.lazy[s.now().line]&&(s.interrupt||y)?(e.enter("setextHeadingLine"),a=m,u(m)):r(m)}function u(m){return e.enter("setextHeadingLineSequence"),f(m)}function f(m){return m===a?(e.consume(m),f):(e.exit("setextHeadingLineSequence"),ut(m)?pt(e,p,"lineSuffix")(m):p(m))}function p(m){return m===null||Ke(m)?(e.exit("setextHeadingLine"),n(m)):r(m)}}const b0={tokenize:v0};function v0(e){const n=this,r=e.attempt(Sa,s,e.attempt(this.parser.constructs.flowInitial,a,pt(e,e.attempt(this.parser.constructs.flow,a,e.attempt(Sk,a)),"linePrefix")));return r;function s(c){if(c===null){e.consume(c);return}return e.enter("lineEndingBlank"),e.consume(c),e.exit("lineEndingBlank"),n.currentConstruct=void 0,r}function a(c){if(c===null){e.consume(c);return}return e.enter("lineEnding"),e.consume(c),e.exit("lineEnding"),n.currentConstruct=void 0,r}}const w0={resolveAll:Gg()},_0=Vg("string"),k0=Vg("text");function Vg(e){return{resolveAll:Gg(e==="text"?E0:void 0),tokenize:n};function n(r){const s=this,a=this.parser.constructs[e],c=r.attempt(a,u,f);return u;function u(g){return m(g)?c(g):f(g)}function f(g){if(g===null){r.consume(g);return}return r.enter("data"),r.consume(g),p}function p(g){return m(g)?(r.exit("data"),c(g)):(r.consume(g),p)}function m(g){if(g===null)return!0;const y=a[g];let v=-1;if(y)for(;++v<y.length;){const b=y[v];if(!b.previous||b.previous.call(s,s.previous))return!0}return!1}}}function Gg(e){return n;function n(r,s){let a=-1,c;for(;++a<=r.length;)c===void 0?r[a]&&r[a][1].type==="data"&&(c=a,a++):(!r[a]||r[a][1].type!=="data")&&(a!==c+2&&(r[c][1].end=r[a-1][1].end,r.splice(c+2,a-c-2),a=c+2),c=void 0);return e?e(r,s):r}}function E0(e,n){let r=0;for(;++r<=e.length;)if((r===e.length||e[r][1].type==="lineEnding")&&e[r-1][1].type==="data"){const s=e[r-1][1],a=n.sliceStream(s);let c=a.length,u=-1,f=0,p;for(;c--;){const m=a[c];if(typeof m=="string"){for(u=m.length;m.charCodeAt(u-1)===32;)f++,u--;if(u)break;u=-1}else if(m===-2)p=!0,f++;else if(m!==-1){c++;break}}if(n._contentTypeTextTrailing&&r===e.length&&(f=0),f){const m={type:r===e.length||p||f<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:c?u:s.start._bufferIndex+u,_index:s.start._index+c,line:s.end.line,column:s.end.column-f,offset:s.end.offset-f},end:{...s.end}};s.end={...m.start},s.start.offset===s.end.offset?Object.assign(s,m):(e.splice(r,0,["enter",m,n],["exit",m,n]),r+=2)}r++}return e}const S0={42:Cn,43:Cn,45:Cn,48:Cn,49:Cn,50:Cn,51:Cn,52:Cn,53:Cn,54:Cn,55:Cn,56:Cn,57:Cn,62:Bg},N0={91:Mk},C0={[-2]:bu,[-1]:bu,32:bu},T0={35:Dk,42:Jo,45:[Um,Jo],60:Bk,61:Um,95:Jo,96:zm,126:zm},A0={38:$g,92:Ug},M0={[-5]:vu,[-4]:vu,[-3]:vu,33:i0,38:$g,42:ed,60:[ak,Vk],91:a0,92:[jk,Ug],93:Sd,95:ed,96:bk},R0={null:[ed,w0]},I0={null:[42,95]},O0={null:[]},j0=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:I0,contentInitial:N0,disable:O0,document:S0,flow:T0,flowInitial:C0,insideSpan:R0,string:A0,text:M0},Symbol.toStringTag,{value:"Module"}));function L0(e,n,r){let s={_bufferIndex:-1,_index:0,line:r&&r.line||1,column:r&&r.column||1,offset:r&&r.offset||0};const a={},c=[];let u=[],f=[];const p={attempt:W(P),check:W(M),consume:O,enter:A,exit:G,interrupt:W(M,{interrupt:!0})},m={code:null,containerState:{},defineSkip:_,events:[],now:w,parser:e,previous:null,sliceSerialize:v,sliceStream:b,write:y};let g=n.tokenize.call(m,p);return n.resolveAll&&c.push(n),m;function y(ce){return u=Yn(u,ce),E(),u[u.length-1]!==null?[]:(ee(n,0),m.events=xl(c,m.events,m),m.events)}function v(ce,V){return P0(b(ce),V)}function b(ce){return D0(u,ce)}function w(){const{_bufferIndex:ce,_index:V,line:j,column:B,offset:q}=s;return{_bufferIndex:ce,_index:V,line:j,column:B,offset:q}}function _(ce){a[ce.line]=ce.column,D()}function E(){let ce;for(;s._index<u.length;){const V=u[s._index];if(typeof V=="string")for(ce=s._index,s._bufferIndex<0&&(s._bufferIndex=0);s._index===ce&&s._bufferIndex<V.length;)S(V.charCodeAt(s._bufferIndex));else S(V)}}function S(ce){g=g(ce)}function O(ce){Ke(ce)?(s.line++,s.column=1,s.offset+=ce===-3?2:1,D()):ce!==-1&&(s.column++,s.offset++),s._bufferIndex<0?s._index++:(s._bufferIndex++,s._bufferIndex===u[s._index].length&&(s._bufferIndex=-1,s._index++)),m.previous=ce}function A(ce,V){const j=V||{};return j.type=ce,j.start=w(),m.events.push(["enter",j,m]),f.push(j),j}function G(ce){const V=f.pop();return V.end=w(),m.events.push(["exit",V,m]),V}function P(ce,V){ee(ce,V.from)}function M(ce,V){V.restore()}function W(ce,V){return j;function j(B,q,Z){let ne,K,ue,C;return Array.isArray(B)?J(B):"tokenize"in B?J([B]):R(B);function R(L){return $;function $(H){const Q=H!==null&&L[H],ge=H!==null&&L.null,Pe=[...Array.isArray(Q)?Q:Q?[Q]:[],...Array.isArray(ge)?ge:ge?[ge]:[]];return J(Pe)(H)}}function J(L){return ne=L,K=0,L.length===0?Z:T(L[K])}function T(L){return $;function $(H){return C=oe(),ue=L,L.partial||(m.currentConstruct=L),L.name&&m.parser.constructs.disable.null.includes(L.name)?re():L.tokenize.call(V?Object.assign(Object.create(m),V):m,p,X,re)(H)}}function X(L){return ce(ue,C),q}function re(L){return C.restore(),++K<ne.length?T(ne[K]):Z}}}function ee(ce,V){ce.resolveAll&&!c.includes(ce)&&c.push(ce),ce.resolve&&Pn(m.events,V,m.events.length-V,ce.resolve(m.events.slice(V),m)),ce.resolveTo&&(m.events=ce.resolveTo(m.events,m))}function oe(){const ce=w(),V=m.previous,j=m.currentConstruct,B=m.events.length,q=Array.from(f);return{from:B,restore:Z};function Z(){s=ce,m.previous=V,m.currentConstruct=j,m.events.length=B,f=q,D()}}function D(){s.line in a&&s.column<2&&(s.column=a[s.line],s.offset+=a[s.line]-1)}}function D0(e,n){const r=n.start._index,s=n.start._bufferIndex,a=n.end._index,c=n.end._bufferIndex;let u;if(r===a)u=[e[r].slice(s,c)];else{if(u=e.slice(r,a),s>-1){const f=u[0];typeof f=="string"?u[0]=f.slice(s):u.shift()}c>0&&u.push(e[a].slice(0,c))}return u}function P0(e,n){let r=-1;const s=[];let a;for(;++r<e.length;){const c=e[r];let u;if(typeof c=="string")u=c;else switch(c){case-5:{u="\r";break}case-4:{u=`
|
|
412
|
-
`;break}case-3:{u=`\r
|
|
413
|
-
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&a)continue;u=" ";break}default:u=String.fromCharCode(c)}a=c===-2,s.push(u)}return s.join("")}function F0(e){const s={constructs:Fg([j0,...(e||{}).extensions||[]]),content:a(J_),defined:[],document:a(tk),flow:a(b0),lazy:{},string:a(_0),text:a(k0)};return s;function a(c){return u;function u(f){return L0(s,c,f)}}}function z0(e){for(;!Hg(e););return e}const $m=/[\0\t\n\r]/g;function B0(){let e=1,n="",r=!0,s;return a;function a(c,u,f){const p=[];let m,g,y,v,b;for(c=n+(typeof c=="string"?c.toString():new TextDecoder(u||void 0).decode(c)),y=0,n="",r&&(c.charCodeAt(0)===65279&&y++,r=void 0);y<c.length;){if($m.lastIndex=y,m=$m.exec(c),v=m&&m.index!==void 0?m.index:c.length,b=c.charCodeAt(v),!m){n=c.slice(y);break}if(b===10&&y===v&&s)p.push(-3),s=void 0;else switch(s&&(p.push(-5),s=void 0),y<v&&(p.push(c.slice(y,v)),e+=v-y),b){case 0:{p.push(65533),e++;break}case 9:{for(g=Math.ceil(e/4)*4,p.push(-2);e++<g;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:s=!0,e=1}y=v+1}return f&&(s&&p.push(-5),n&&p.push(n),p.push(null)),p}}const U0=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function $0(e){return e.replace(U0,H0)}function H0(e,n,r){if(n)return n;if(r.charCodeAt(0)===35){const a=r.charCodeAt(1),c=a===120||a===88;return zg(r.slice(c?2:1),c?16:10)}return Ed(r)||e}const Yg={}.hasOwnProperty;function q0(e,n,r){return n&&typeof n=="object"&&(r=n,n=void 0),K0(r)(z0(F0(r).document().write(B0()(e,n,!0))))}function K0(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:c(se),autolinkProtocol:oe,autolinkEmail:oe,atxHeading:c(ve),blockQuote:c(ge),characterEscape:oe,characterReference:oe,codeFenced:c(Pe),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:c(Pe,u),codeText:c(fe,u),codeTextData:oe,data:oe,codeFlowValue:oe,definition:c(ke),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:c(Ee),hardBreakEscape:c(Se),hardBreakTrailing:c(Se),htmlFlow:c(tt,u),htmlFlowData:oe,htmlText:c(tt,u),htmlTextData:oe,image:c(ft),label:u,link:c(se),listItem:c(le),listItemValue:v,listOrdered:c(je,y),listUnordered:c(je),paragraph:c(pe),reference:T,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:c(ve),strong:c(ze),thematicBreak:c(Et)},exit:{atxHeading:p(),atxHeadingSequence:P,autolink:p(),autolinkEmail:Q,autolinkProtocol:H,blockQuote:p(),characterEscapeValue:D,characterReferenceMarkerHexadecimal:re,characterReferenceMarkerNumeric:re,characterReferenceValue:L,characterReference:$,codeFenced:p(E),codeFencedFence:_,codeFencedFenceInfo:b,codeFencedFenceMeta:w,codeFlowValue:D,codeIndented:p(S),codeText:p(q),codeTextData:D,data:D,definition:p(),definitionDestinationString:G,definitionLabelString:O,definitionTitleString:A,emphasis:p(),hardBreakEscape:p(V),hardBreakTrailing:p(V),htmlFlow:p(j),htmlFlowData:D,htmlText:p(B),htmlTextData:D,image:p(ne),label:ue,labelText:K,lineEnding:ce,link:p(Z),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:X,resourceDestinationString:C,resourceTitleString:R,resource:J,setextHeading:p(ee),setextHeadingLineSequence:W,setextHeadingText:M,strong:p(),thematicBreak:p()}};Xg(n,(e||{}).mdastExtensions||[]);const r={};return s;function s(ae){let xe={type:"root",children:[]};const Be={stack:[xe],tokenStack:[],config:n,enter:f,exit:m,buffer:u,resume:g,data:r},Ze=[];let lt=-1;for(;++lt<ae.length;)if(ae[lt][1].type==="listOrdered"||ae[lt][1].type==="listUnordered")if(ae[lt][0]==="enter")Ze.push(lt);else{const St=Ze.pop();lt=a(ae,St,lt)}for(lt=-1;++lt<ae.length;){const St=n[ae[lt][0]];Yg.call(St,ae[lt][1].type)&&St[ae[lt][1].type].call(Object.assign({sliceSerialize:ae[lt][2].sliceSerialize},Be),ae[lt][1])}if(Be.tokenStack.length>0){const St=Be.tokenStack[Be.tokenStack.length-1];(St[1]||Hm).call(Be,void 0,St[0])}for(xe.position={start:Yr(ae.length>0?ae[0][1].start:{line:1,column:1,offset:0}),end:Yr(ae.length>0?ae[ae.length-2][1].end:{line:1,column:1,offset:0})},lt=-1;++lt<n.transforms.length;)xe=n.transforms[lt](xe)||xe;return xe}function a(ae,xe,Be){let Ze=xe-1,lt=-1,St=!1,Wt,tn,vn,mr;for(;++Ze<=Be;){const Vt=ae[Ze];switch(Vt[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Vt[0]==="enter"?lt++:lt--,mr=void 0;break}case"lineEndingBlank":{Vt[0]==="enter"&&(Wt&&!mr&&!lt&&!vn&&(vn=Ze),mr=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:mr=void 0}if(!lt&&Vt[0]==="enter"&&Vt[1].type==="listItemPrefix"||lt===-1&&Vt[0]==="exit"&&(Vt[1].type==="listUnordered"||Vt[1].type==="listOrdered")){if(Wt){let Fn=Ze;for(tn=void 0;Fn--;){const nn=ae[Fn];if(nn[1].type==="lineEnding"||nn[1].type==="lineEndingBlank"){if(nn[0]==="exit")continue;tn&&(ae[tn][1].type="lineEndingBlank",St=!0),nn[1].type="lineEnding",tn=Fn}else if(!(nn[1].type==="linePrefix"||nn[1].type==="blockQuotePrefix"||nn[1].type==="blockQuotePrefixWhitespace"||nn[1].type==="blockQuoteMarker"||nn[1].type==="listItemIndent"))break}vn&&(!tn||vn<tn)&&(Wt._spread=!0),Wt.end=Object.assign({},tn?ae[tn][1].start:Vt[1].end),ae.splice(tn||Ze,0,["exit",Wt,Vt[2]]),Ze++,Be++}if(Vt[1].type==="listItemPrefix"){const Fn={type:"listItem",_spread:!1,start:Object.assign({},Vt[1].start),end:void 0};Wt=Fn,ae.splice(Ze,0,["enter",Fn,Vt[2]]),Ze++,Be++,vn=void 0,mr=!0}}}return ae[xe][1]._spread=St,Be}function c(ae,xe){return Be;function Be(Ze){f.call(this,ae(Ze),Ze),xe&&xe.call(this,Ze)}}function u(){this.stack.push({type:"fragment",children:[]})}function f(ae,xe,Be){this.stack[this.stack.length-1].children.push(ae),this.stack.push(ae),this.tokenStack.push([xe,Be||void 0]),ae.position={start:Yr(xe.start),end:void 0}}function p(ae){return xe;function xe(Be){ae&&ae.call(this,Be),m.call(this,Be)}}function m(ae,xe){const Be=this.stack.pop(),Ze=this.tokenStack.pop();if(Ze)Ze[0].type!==ae.type&&(xe?xe.call(this,ae,Ze[0]):(Ze[1]||Hm).call(this,ae,Ze[0]));else throw new Error("Cannot close `"+ae.type+"` ("+da({start:ae.start,end:ae.end})+"): it’s not open");Be.position.end=Yr(ae.end)}function g(){return kd(this.stack.pop())}function y(){this.data.expectingFirstListItemValue=!0}function v(ae){if(this.data.expectingFirstListItemValue){const xe=this.stack[this.stack.length-2];xe.start=Number.parseInt(this.sliceSerialize(ae),10),this.data.expectingFirstListItemValue=void 0}}function b(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.lang=ae}function w(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.meta=ae}function _(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function E(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ae.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function S(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ae.replace(/(\r?\n|\r)$/g,"")}function O(ae){const xe=this.resume(),Be=this.stack[this.stack.length-1];Be.label=xe,Be.identifier=rr(this.sliceSerialize(ae)).toLowerCase()}function A(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ae}function G(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ae}function P(ae){const xe=this.stack[this.stack.length-1];if(!xe.depth){const Be=this.sliceSerialize(ae).length;xe.depth=Be}}function M(){this.data.setextHeadingSlurpLineEnding=!0}function W(ae){const xe=this.stack[this.stack.length-1];xe.depth=this.sliceSerialize(ae).codePointAt(0)===61?1:2}function ee(){this.data.setextHeadingSlurpLineEnding=void 0}function oe(ae){const Be=this.stack[this.stack.length-1].children;let Ze=Be[Be.length-1];(!Ze||Ze.type!=="text")&&(Ze=st(),Ze.position={start:Yr(ae.start),end:void 0},Be.push(Ze)),this.stack.push(Ze)}function D(ae){const xe=this.stack.pop();xe.value+=this.sliceSerialize(ae),xe.position.end=Yr(ae.end)}function ce(ae){const xe=this.stack[this.stack.length-1];if(this.data.atHardBreak){const Be=xe.children[xe.children.length-1];Be.position.end=Yr(ae.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(xe.type)&&(oe.call(this,ae),D.call(this,ae))}function V(){this.data.atHardBreak=!0}function j(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ae}function B(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ae}function q(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.value=ae}function Z(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=xe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function ne(){const ae=this.stack[this.stack.length-1];if(this.data.inReference){const xe=this.data.referenceType||"shortcut";ae.type+="Reference",ae.referenceType=xe,delete ae.url,delete ae.title}else delete ae.identifier,delete ae.label;this.data.referenceType=void 0}function K(ae){const xe=this.sliceSerialize(ae),Be=this.stack[this.stack.length-2];Be.label=$0(xe),Be.identifier=rr(xe).toLowerCase()}function ue(){const ae=this.stack[this.stack.length-1],xe=this.resume(),Be=this.stack[this.stack.length-1];if(this.data.inReference=!0,Be.type==="link"){const Ze=ae.children;Be.children=Ze}else Be.alt=xe}function C(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.url=ae}function R(){const ae=this.resume(),xe=this.stack[this.stack.length-1];xe.title=ae}function J(){this.data.inReference=void 0}function T(){this.data.referenceType="collapsed"}function X(ae){const xe=this.resume(),Be=this.stack[this.stack.length-1];Be.label=xe,Be.identifier=rr(this.sliceSerialize(ae)).toLowerCase(),this.data.referenceType="full"}function re(ae){this.data.characterReferenceType=ae.type}function L(ae){const xe=this.sliceSerialize(ae),Be=this.data.characterReferenceType;let Ze;Be?(Ze=zg(xe,Be==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):Ze=Ed(xe);const lt=this.stack[this.stack.length-1];lt.value+=Ze}function $(ae){const xe=this.stack.pop();xe.position.end=Yr(ae.end)}function H(ae){D.call(this,ae);const xe=this.stack[this.stack.length-1];xe.url=this.sliceSerialize(ae)}function Q(ae){D.call(this,ae);const xe=this.stack[this.stack.length-1];xe.url="mailto:"+this.sliceSerialize(ae)}function ge(){return{type:"blockquote",children:[]}}function Pe(){return{type:"code",lang:null,meta:null,value:""}}function fe(){return{type:"inlineCode",value:""}}function ke(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function Ee(){return{type:"emphasis",children:[]}}function ve(){return{type:"heading",depth:0,children:[]}}function Se(){return{type:"break"}}function tt(){return{type:"html",value:""}}function ft(){return{type:"image",title:null,url:"",alt:null}}function se(){return{type:"link",title:null,url:"",children:[]}}function je(ae){return{type:"list",ordered:ae.type==="listOrdered",start:null,spread:ae._spread,children:[]}}function le(ae){return{type:"listItem",spread:ae._spread,checked:null,children:[]}}function pe(){return{type:"paragraph",children:[]}}function ze(){return{type:"strong",children:[]}}function st(){return{type:"text",value:""}}function Et(){return{type:"thematicBreak"}}}function Yr(e){return{line:e.line,column:e.column,offset:e.offset}}function Xg(e,n){let r=-1;for(;++r<n.length;){const s=n[r];Array.isArray(s)?Xg(e,s):W0(e,s)}}function W0(e,n){let r;for(r in n)if(Yg.call(n,r))switch(r){case"canContainEols":{const s=n[r];s&&e[r].push(...s);break}case"transforms":{const s=n[r];s&&e[r].push(...s);break}case"enter":case"exit":{const s=n[r];s&&Object.assign(e[r],s);break}}}function Hm(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+da({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+da({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+da({start:n.start,end:n.end})+") is still open")}function V0(e){const n=this;n.parser=r;function r(s){return q0(s,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function G0(e,n){const r={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,r),e.applyData(n,r)}function Y0(e,n){const r={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,r),[e.applyData(n,r),{type:"text",value:`
|
|
414
|
-
`}]}function X0(e,n){const r=n.value?n.value+`
|
|
415
|
-
`:"",s={},a=n.lang?n.lang.split(/\s+/):[];a.length>0&&(s.className=["language-"+a[0]]);let c={type:"element",tagName:"code",properties:s,children:[{type:"text",value:r}]};return n.meta&&(c.data={meta:n.meta}),e.patch(n,c),c=e.applyData(n,c),c={type:"element",tagName:"pre",properties:{},children:[c]},e.patch(n,c),c}function Q0(e,n){const r={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function Z0(e,n){const r={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function J0(e,n){const r=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",s=String(n.identifier).toUpperCase(),a=ws(s.toLowerCase()),c=e.footnoteOrder.indexOf(s);let u,f=e.footnoteCounts.get(s);f===void 0?(f=0,e.footnoteOrder.push(s),u=e.footnoteOrder.length):u=c+1,f+=1,e.footnoteCounts.set(s,f);const p={type:"element",tagName:"a",properties:{href:"#"+r+"fn-"+a,id:r+"fnref-"+a+(f>1?"-"+f:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,p);const m={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(n,m),e.applyData(n,m)}function e1(e,n){const r={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function t1(e,n){if(e.options.allowDangerousHtml){const r={type:"raw",value:n.value};return e.patch(n,r),e.applyData(n,r)}}function Qg(e,n){const r=n.referenceType;let s="]";if(r==="collapsed"?s+="[]":r==="full"&&(s+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+s}];const a=e.all(n),c=a[0];c&&c.type==="text"?c.value="["+c.value:a.unshift({type:"text",value:"["});const u=a[a.length-1];return u&&u.type==="text"?u.value+=s:a.push({type:"text",value:s}),a}function n1(e,n){const r=String(n.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return Qg(e,n);const a={src:ws(s.url||""),alt:n.alt};s.title!==null&&s.title!==void 0&&(a.title=s.title);const c={type:"element",tagName:"img",properties:a,children:[]};return e.patch(n,c),e.applyData(n,c)}function r1(e,n){const r={src:ws(n.url)};n.alt!==null&&n.alt!==void 0&&(r.alt=n.alt),n.title!==null&&n.title!==void 0&&(r.title=n.title);const s={type:"element",tagName:"img",properties:r,children:[]};return e.patch(n,s),e.applyData(n,s)}function i1(e,n){const r={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,r);const s={type:"element",tagName:"code",properties:{},children:[r]};return e.patch(n,s),e.applyData(n,s)}function s1(e,n){const r=String(n.identifier).toUpperCase(),s=e.definitionById.get(r);if(!s)return Qg(e,n);const a={href:ws(s.url||"")};s.title!==null&&s.title!==void 0&&(a.title=s.title);const c={type:"element",tagName:"a",properties:a,children:e.all(n)};return e.patch(n,c),e.applyData(n,c)}function a1(e,n){const r={href:ws(n.url)};n.title!==null&&n.title!==void 0&&(r.title=n.title);const s={type:"element",tagName:"a",properties:r,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function o1(e,n,r){const s=e.all(n),a=r?l1(r):Zg(n),c={},u=[];if(typeof n.checked=="boolean"){const g=s[0];let y;g&&g.type==="element"&&g.tagName==="p"?y=g:(y={type:"element",tagName:"p",properties:{},children:[]},s.unshift(y)),y.children.length>0&&y.children.unshift({type:"text",value:" "}),y.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),c.className=["task-list-item"]}let f=-1;for(;++f<s.length;){const g=s[f];(a||f!==0||g.type!=="element"||g.tagName!=="p")&&u.push({type:"text",value:`
|
|
416
|
-
`}),g.type==="element"&&g.tagName==="p"&&!a?u.push(...g.children):u.push(g)}const p=s[s.length-1];p&&(a||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:`
|
|
417
|
-
`});const m={type:"element",tagName:"li",properties:c,children:u};return e.patch(n,m),e.applyData(n,m)}function l1(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const r=e.children;let s=-1;for(;!n&&++s<r.length;)n=Zg(r[s])}return n}function Zg(e){const n=e.spread;return n??e.children.length>1}function c1(e,n){const r={},s=e.all(n);let a=-1;for(typeof n.start=="number"&&n.start!==1&&(r.start=n.start);++a<s.length;){const u=s[a];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){r.className=["contains-task-list"];break}}const c={type:"element",tagName:n.ordered?"ol":"ul",properties:r,children:e.wrap(s,!0)};return e.patch(n,c),e.applyData(n,c)}function u1(e,n){const r={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function d1(e,n){const r={type:"root",children:e.wrap(e.all(n))};return e.patch(n,r),e.applyData(n,r)}function f1(e,n){const r={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function p1(e,n){const r=e.all(n),s=r.shift(),a=[];if(s){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([s],!0)};e.patch(n.children[0],u),a.push(u)}if(r.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(r,!0)},f=bd(n.children[1]),p=Rg(n.children[n.children.length-1]);f&&p&&(u.position={start:f,end:p}),a.push(u)}const c={type:"element",tagName:"table",properties:{},children:e.wrap(a,!0)};return e.patch(n,c),e.applyData(n,c)}function m1(e,n,r){const s=r?r.children:void 0,c=(s?s.indexOf(n):1)===0?"th":"td",u=r&&r.type==="table"?r.align:void 0,f=u?u.length:n.children.length;let p=-1;const m=[];for(;++p<f;){const y=n.children[p],v={},b=u?u[p]:void 0;b&&(v.align=b);let w={type:"element",tagName:c,properties:v,children:[]};y&&(w.children=e.all(y),e.patch(y,w),w=e.applyData(y,w)),m.push(w)}const g={type:"element",tagName:"tr",properties:{},children:e.wrap(m,!0)};return e.patch(n,g),e.applyData(n,g)}function h1(e,n){const r={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}const qm=9,Km=32;function g1(e){const n=String(e),r=/\r?\n|\r/g;let s=r.exec(n),a=0;const c=[];for(;s;)c.push(Wm(n.slice(a,s.index),a>0,!0),s[0]),a=s.index+s[0].length,s=r.exec(n);return c.push(Wm(n.slice(a),a>0,!1)),c.join("")}function Wm(e,n,r){let s=0,a=e.length;if(n){let c=e.codePointAt(s);for(;c===qm||c===Km;)s++,c=e.codePointAt(s)}if(r){let c=e.codePointAt(a-1);for(;c===qm||c===Km;)a--,c=e.codePointAt(a-1)}return a>s?e.slice(s,a):""}function y1(e,n){const r={type:"text",value:g1(String(n.value))};return e.patch(n,r),e.applyData(n,r)}function x1(e,n){const r={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,r),e.applyData(n,r)}const b1={blockquote:G0,break:Y0,code:X0,delete:Q0,emphasis:Z0,footnoteReference:J0,heading:e1,html:t1,imageReference:n1,image:r1,inlineCode:i1,linkReference:s1,link:a1,listItem:o1,list:c1,paragraph:u1,root:d1,strong:f1,table:p1,tableCell:h1,tableRow:m1,text:y1,thematicBreak:x1,toml:Bo,yaml:Bo,definition:Bo,footnoteDefinition:Bo};function Bo(){}const Jg=-1,bl=0,pa=1,il=2,Nd=3,Cd=4,Td=5,Ad=6,ey=7,ty=8,v1=typeof self=="object"?self:globalThis,Vm=(e,n)=>{switch(e){case"Function":case"SharedWorker":case"Worker":case"eval":case"setInterval":case"setTimeout":throw new TypeError("unable to deserialize "+e)}return new v1[e](n)},w1=(e,n)=>{const r=(a,c)=>(e.set(c,a),a),s=a=>{if(e.has(a))return e.get(a);const[c,u]=n[a];switch(c){case bl:case Jg:return r(u,a);case pa:{const f=r([],a);for(const p of u)f.push(s(p));return f}case il:{const f=r({},a);for(const[p,m]of u)f[s(p)]=s(m);return f}case Nd:return r(new Date(u),a);case Cd:{const{source:f,flags:p}=u;return r(new RegExp(f,p),a)}case Td:{const f=r(new Map,a);for(const[p,m]of u)f.set(s(p),s(m));return f}case Ad:{const f=r(new Set,a);for(const p of u)f.add(s(p));return f}case ey:{const{name:f,message:p}=u;return r(Vm(f,p),a)}case ty:return r(BigInt(u),a);case"BigInt":return r(Object(BigInt(u)),a);case"ArrayBuffer":return r(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:f}=new Uint8Array(u);return r(new DataView(f),u)}}return r(Vm(c,u),a)};return s},Gm=e=>w1(new Map,e)(0),as="",{toString:_1}={},{keys:k1}=Object,oa=e=>{const n=typeof e;if(n!=="object"||!e)return[bl,n];const r=_1.call(e).slice(8,-1);switch(r){case"Array":return[pa,as];case"Object":return[il,as];case"Date":return[Nd,as];case"RegExp":return[Cd,as];case"Map":return[Td,as];case"Set":return[Ad,as];case"DataView":return[pa,r]}return r.includes("Array")?[pa,r]:r.includes("Error")?[ey,r]:[il,r]},Uo=([e,n])=>e===bl&&(n==="function"||n==="symbol"),E1=(e,n,r,s)=>{const a=(u,f)=>{const p=s.push(u)-1;return r.set(f,p),p},c=u=>{if(r.has(u))return r.get(u);let[f,p]=oa(u);switch(f){case bl:{let g=u;switch(p){case"bigint":f=ty,g=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);g=null;break;case"undefined":return a([Jg],u)}return a([f,g],u)}case pa:{if(p){let v=u;return p==="DataView"?v=new Uint8Array(u.buffer):p==="ArrayBuffer"&&(v=new Uint8Array(u)),a([p,[...v]],u)}const g=[],y=a([f,g],u);for(const v of u)g.push(c(v));return y}case il:{if(p)switch(p){case"BigInt":return a([p,u.toString()],u);case"Boolean":case"Number":case"String":return a([p,u.valueOf()],u)}if(n&&"toJSON"in u)return c(u.toJSON());const g=[],y=a([f,g],u);for(const v of k1(u))(e||!Uo(oa(u[v])))&&g.push([c(v),c(u[v])]);return y}case Nd:return a([f,u.toISOString()],u);case Cd:{const{source:g,flags:y}=u;return a([f,{source:g,flags:y}],u)}case Td:{const g=[],y=a([f,g],u);for(const[v,b]of u)(e||!(Uo(oa(v))||Uo(oa(b))))&&g.push([c(v),c(b)]);return y}case Ad:{const g=[],y=a([f,g],u);for(const v of u)(e||!Uo(oa(v)))&&g.push(c(v));return y}}const{message:m}=u;return a([f,{name:p,message:m}],u)};return c},Ym=(e,{json:n,lossy:r}={})=>{const s=[];return E1(!(n||r),!!n,new Map,s)(e),s},sl=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?Gm(Ym(e,n)):structuredClone(e):(e,n)=>Gm(Ym(e,n));function S1(e,n){const r=[{type:"text",value:"↩"}];return n>1&&r.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),r}function N1(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function C1(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=e.options.footnoteBackContent||S1,s=e.options.footnoteBackLabel||N1,a=e.options.footnoteLabel||"Footnotes",c=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},f=[];let p=-1;for(;++p<e.footnoteOrder.length;){const m=e.footnoteById.get(e.footnoteOrder[p]);if(!m)continue;const g=e.all(m),y=String(m.identifier).toUpperCase(),v=ws(y.toLowerCase());let b=0;const w=[],_=e.footnoteCounts.get(y);for(;_!==void 0&&++b<=_;){w.length>0&&w.push({type:"text",value:" "});let O=typeof r=="string"?r:r(p,b);typeof O=="string"&&(O={type:"text",value:O}),w.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+v+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof s=="string"?s:s(p,b),className:["data-footnote-backref"]},children:Array.isArray(O)?O:[O]})}const E=g[g.length-1];if(E&&E.type==="element"&&E.tagName==="p"){const O=E.children[E.children.length-1];O&&O.type==="text"?O.value+=" ":E.children.push({type:"text",value:" "}),E.children.push(...w)}else g.push(...w);const S={type:"element",tagName:"li",properties:{id:n+"fn-"+v},children:e.wrap(g,!0)};e.patch(m,S),f.push(S)}if(f.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:c,properties:{...sl(u),id:"footnote-label"},children:[{type:"text",value:a}]},{type:"text",value:`
|
|
418
|
-
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(f,!0)},{type:"text",value:`
|
|
419
|
-
`}]}}const Na=(function(e){if(e==null)return R1;if(typeof e=="function")return vl(e);if(typeof e=="object")return Array.isArray(e)?T1(e):A1(e);if(typeof e=="string")return M1(e);throw new Error("Expected function, string, or object as test")});function T1(e){const n=[];let r=-1;for(;++r<e.length;)n[r]=Na(e[r]);return vl(s);function s(...a){let c=-1;for(;++c<n.length;)if(n[c].apply(this,a))return!0;return!1}}function A1(e){const n=e;return vl(r);function r(s){const a=s;let c;for(c in e)if(a[c]!==n[c])return!1;return!0}}function M1(e){return vl(n);function n(r){return r&&r.type===e}}function vl(e){return n;function n(r,s,a){return!!(I1(r)&&e.call(this,r,typeof s=="number"?s:void 0,a||void 0))}}function R1(){return!0}function I1(e){return e!==null&&typeof e=="object"&&"type"in e}const ny=[],O1=!0,td=!1,j1="skip";function ry(e,n,r,s){let a;typeof n=="function"&&typeof r!="function"?(s=r,r=n):a=n;const c=Na(a),u=s?-1:1;f(e,void 0,[])();function f(p,m,g){const y=p&&typeof p=="object"?p:{};if(typeof y.type=="string"){const b=typeof y.tagName=="string"?y.tagName:typeof y.name=="string"?y.name:void 0;Object.defineProperty(v,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return v;function v(){let b=ny,w,_,E;if((!n||c(p,m,g[g.length-1]||void 0))&&(b=L1(r(p,g)),b[0]===td))return b;if("children"in p&&p.children){const S=p;if(S.children&&b[0]!==j1)for(_=(s?S.children.length:-1)+u,E=g.concat(S);_>-1&&_<S.children.length;){const O=S.children[_];if(w=f(O,_,E)(),w[0]===td)return w;_=typeof w[1]=="number"?w[1]:_+u}}return b}}}function L1(e){return Array.isArray(e)?e:typeof e=="number"?[O1,e]:e==null?ny:[e]}function wl(e,n,r,s){let a,c,u;typeof n=="function"&&typeof r!="function"?(c=void 0,u=n,a=r):(c=n,u=r,a=s),ry(e,c,f,a);function f(p,m){const g=m[m.length-1],y=g?g.children.indexOf(p):void 0;return u(p,y,g)}}const nd={}.hasOwnProperty,D1={};function P1(e,n){const r=n||D1,s=new Map,a=new Map,c=new Map,u={...b1,...r.handlers},f={all:m,applyData:z1,definitionById:s,footnoteById:a,footnoteCounts:c,footnoteOrder:[],handlers:u,one:p,options:r,patch:F1,wrap:U1};return wl(e,function(g){if(g.type==="definition"||g.type==="footnoteDefinition"){const y=g.type==="definition"?s:a,v=String(g.identifier).toUpperCase();y.has(v)||y.set(v,g)}}),f;function p(g,y){const v=g.type,b=f.handlers[v];if(nd.call(f.handlers,v)&&b)return b(f,g,y);if(f.options.passThrough&&f.options.passThrough.includes(v)){if("children"in g){const{children:_,...E}=g,S=sl(E);return S.children=f.all(g),S}return sl(g)}return(f.options.unknownHandler||B1)(f,g,y)}function m(g){const y=[];if("children"in g){const v=g.children;let b=-1;for(;++b<v.length;){const w=f.one(v[b],g);if(w){if(b&&v[b-1].type==="break"&&(!Array.isArray(w)&&w.type==="text"&&(w.value=Xm(w.value)),!Array.isArray(w)&&w.type==="element")){const _=w.children[0];_&&_.type==="text"&&(_.value=Xm(_.value))}Array.isArray(w)?y.push(...w):y.push(w)}}}return y}}function F1(e,n){e.position&&(n.position=S_(e))}function z1(e,n){let r=n;if(e&&e.data){const s=e.data.hName,a=e.data.hChildren,c=e.data.hProperties;if(typeof s=="string")if(r.type==="element")r.tagName=s;else{const u="children"in r?r.children:[r];r={type:"element",tagName:s,properties:{},children:u}}r.type==="element"&&c&&Object.assign(r.properties,sl(c)),"children"in r&&r.children&&a!==null&&a!==void 0&&(r.children=a)}return r}function B1(e,n){const r=n.data||{},s="value"in n&&!(nd.call(r,"hProperties")||nd.call(r,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function U1(e,n){const r=[];let s=-1;for(n&&r.push({type:"text",value:`
|
|
420
|
-
`});++s<e.length;)s&&r.push({type:"text",value:`
|
|
421
|
-
`}),r.push(e[s]);return n&&e.length>0&&r.push({type:"text",value:`
|
|
422
|
-
`}),r}function Xm(e){let n=0,r=e.charCodeAt(n);for(;r===9||r===32;)n++,r=e.charCodeAt(n);return e.slice(n)}function Qm(e,n){const r=P1(e,n),s=r.one(e,void 0),a=C1(r),c=Array.isArray(s)?{type:"root",children:s}:s||{type:"root",children:[]};return a&&c.children.push({type:"text",value:`
|
|
423
|
-
`},a),c}function $1(e,n){return e&&"run"in e?async function(r,s){const a=Qm(r,{file:s,...n});await e.run(a,s)}:function(r,s){return Qm(r,{file:s,...e||n})}}function Zm(e){if(e)throw e}var wu,Jm;function H1(){if(Jm)return wu;Jm=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,r=Object.defineProperty,s=Object.getOwnPropertyDescriptor,a=function(m){return typeof Array.isArray=="function"?Array.isArray(m):n.call(m)==="[object Array]"},c=function(m){if(!m||n.call(m)!=="[object Object]")return!1;var g=e.call(m,"constructor"),y=m.constructor&&m.constructor.prototype&&e.call(m.constructor.prototype,"isPrototypeOf");if(m.constructor&&!g&&!y)return!1;var v;for(v in m);return typeof v>"u"||e.call(m,v)},u=function(m,g){r&&g.name==="__proto__"?r(m,g.name,{enumerable:!0,configurable:!0,value:g.newValue,writable:!0}):m[g.name]=g.newValue},f=function(m,g){if(g==="__proto__")if(e.call(m,g)){if(s)return s(m,g).value}else return;return m[g]};return wu=function p(){var m,g,y,v,b,w,_=arguments[0],E=1,S=arguments.length,O=!1;for(typeof _=="boolean"&&(O=_,_=arguments[1]||{},E=2),(_==null||typeof _!="object"&&typeof _!="function")&&(_={});E<S;++E)if(m=arguments[E],m!=null)for(g in m)y=f(_,g),v=f(m,g),_!==v&&(O&&v&&(c(v)||(b=a(v)))?(b?(b=!1,w=y&&a(y)?y:[]):w=y&&c(y)?y:{},u(_,{name:g,newValue:p(O,w,v)})):typeof v<"u"&&u(_,{name:g,newValue:v}));return _},wu}var q1=H1();const _u=wa(q1);function rd(e){if(typeof e!="object"||e===null)return!1;const n=Object.getPrototypeOf(e);return(n===null||n===Object.prototype||Object.getPrototypeOf(n)===null)&&!(Symbol.toStringTag in e)&&!(Symbol.iterator in e)}function K1(){const e=[],n={run:r,use:s};return n;function r(...a){let c=-1;const u=a.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);f(null,...a);function f(p,...m){const g=e[++c];let y=-1;if(p){u(p);return}for(;++y<a.length;)(m[y]===null||m[y]===void 0)&&(m[y]=a[y]);a=m,g?W1(g,f)(...m):u(null,...m)}}function s(a){if(typeof a!="function")throw new TypeError("Expected `middelware` to be a function, not "+a);return e.push(a),n}}function W1(e,n){let r;return s;function s(...u){const f=e.length>u.length;let p;f&&u.push(a);try{p=e.apply(this,u)}catch(m){const g=m;if(f&&r)throw g;return a(g)}f||(p&&p.then&&typeof p.then=="function"?p.then(c,a):p instanceof Error?a(p):c(p))}function a(u,...f){r||(r=!0,n(u,...f))}function c(u){a(null,u)}}const fr={basename:V1,dirname:G1,extname:Y1,join:X1,sep:"/"};function V1(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Ca(e);let r=0,s=-1,a=e.length,c;if(n===void 0||n.length===0||n.length>e.length){for(;a--;)if(e.codePointAt(a)===47){if(c){r=a+1;break}}else s<0&&(c=!0,s=a+1);return s<0?"":e.slice(r,s)}if(n===e)return"";let u=-1,f=n.length-1;for(;a--;)if(e.codePointAt(a)===47){if(c){r=a+1;break}}else u<0&&(c=!0,u=a+1),f>-1&&(e.codePointAt(a)===n.codePointAt(f--)?f<0&&(s=a):(f=-1,s=u));return r===s?s=u:s<0&&(s=e.length),e.slice(r,s)}function G1(e){if(Ca(e),e.length===0)return".";let n=-1,r=e.length,s;for(;--r;)if(e.codePointAt(r)===47){if(s){n=r;break}}else s||(s=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function Y1(e){Ca(e);let n=e.length,r=-1,s=0,a=-1,c=0,u;for(;n--;){const f=e.codePointAt(n);if(f===47){if(u){s=n+1;break}continue}r<0&&(u=!0,r=n+1),f===46?a<0?a=n:c!==1&&(c=1):a>-1&&(c=-1)}return a<0||r<0||c===0||c===1&&a===r-1&&a===s+1?"":e.slice(a,r)}function X1(...e){let n=-1,r;for(;++n<e.length;)Ca(e[n]),e[n]&&(r=r===void 0?e[n]:r+"/"+e[n]);return r===void 0?".":Q1(r)}function Q1(e){Ca(e);const n=e.codePointAt(0)===47;let r=Z1(e,!n);return r.length===0&&!n&&(r="."),r.length>0&&e.codePointAt(e.length-1)===47&&(r+="/"),n?"/"+r:r}function Z1(e,n){let r="",s=0,a=-1,c=0,u=-1,f,p;for(;++u<=e.length;){if(u<e.length)f=e.codePointAt(u);else{if(f===47)break;f=47}if(f===47){if(!(a===u-1||c===1))if(a!==u-1&&c===2){if(r.length<2||s!==2||r.codePointAt(r.length-1)!==46||r.codePointAt(r.length-2)!==46){if(r.length>2){if(p=r.lastIndexOf("/"),p!==r.length-1){p<0?(r="",s=0):(r=r.slice(0,p),s=r.length-1-r.lastIndexOf("/")),a=u,c=0;continue}}else if(r.length>0){r="",s=0,a=u,c=0;continue}}n&&(r=r.length>0?r+"/..":"..",s=2)}else r.length>0?r+="/"+e.slice(a+1,u):r=e.slice(a+1,u),s=u-a-1;a=u,c=0}else f===46&&c>-1?c++:c=-1}return r}function Ca(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const J1={cwd:eE};function eE(){return"/"}function id(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function tE(e){if(typeof e=="string")e=new URL(e);else if(!id(e)){const n=new TypeError('The "path" argument must be of type string or an instance of URL. Received `'+e+"`");throw n.code="ERR_INVALID_ARG_TYPE",n}if(e.protocol!=="file:"){const n=new TypeError("The URL must be of scheme file");throw n.code="ERR_INVALID_URL_SCHEME",n}return nE(e)}function nE(e){if(e.hostname!==""){const s=new TypeError('File URL host must be "localhost" or empty on darwin');throw s.code="ERR_INVALID_FILE_URL_HOST",s}const n=e.pathname;let r=-1;for(;++r<n.length;)if(n.codePointAt(r)===37&&n.codePointAt(r+1)===50){const s=n.codePointAt(r+2);if(s===70||s===102){const a=new TypeError("File URL path must not include encoded / characters");throw a.code="ERR_INVALID_FILE_URL_PATH",a}}return decodeURIComponent(n)}const ku=["history","path","basename","stem","extname","dirname"];class iy{constructor(n){let r;n?id(n)?r={path:n}:typeof n=="string"||rE(n)?r={value:n}:r=n:r={},this.cwd="cwd"in r?"":J1.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let s=-1;for(;++s<ku.length;){const c=ku[s];c in r&&r[c]!==void 0&&r[c]!==null&&(this[c]=c==="history"?[...r[c]]:r[c])}let a;for(a in r)ku.includes(a)||(this[a]=r[a])}get basename(){return typeof this.path=="string"?fr.basename(this.path):void 0}set basename(n){Su(n,"basename"),Eu(n,"basename"),this.path=fr.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?fr.dirname(this.path):void 0}set dirname(n){eh(this.basename,"dirname"),this.path=fr.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?fr.extname(this.path):void 0}set extname(n){if(Eu(n,"extname"),eh(this.dirname,"extname"),n){if(n.codePointAt(0)!==46)throw new Error("`extname` must start with `.`");if(n.includes(".",1))throw new Error("`extname` cannot contain multiple dots")}this.path=fr.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){id(n)&&(n=tE(n)),Su(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?fr.basename(this.path,this.extname):void 0}set stem(n){Su(n,"stem"),Eu(n,"stem"),this.path=fr.join(this.dirname||"",n+(this.extname||""))}fail(n,r,s){const a=this.message(n,r,s);throw a.fatal=!0,a}info(n,r,s){const a=this.message(n,r,s);return a.fatal=void 0,a}message(n,r,s){const a=new fn(n,r,s);return this.path&&(a.name=this.path+":"+a.name,a.file=this.path),a.fatal=!1,this.messages.push(a),a}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function Eu(e,n){if(e&&e.includes(fr.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+fr.sep+"`")}function Su(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function eh(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function rE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const iE=(function(e){const s=this.constructor.prototype,a=s[e],c=function(){return a.apply(c,arguments)};return Object.setPrototypeOf(c,s),c}),sE={}.hasOwnProperty;class Md extends iE{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=K1()}copy(){const n=new Md;let r=-1;for(;++r<this.attachers.length;){const s=this.attachers[r];n.use(...s)}return n.data(_u(!0,{},this.namespace)),n}data(n,r){return typeof n=="string"?arguments.length===2?(Tu("data",this.frozen),this.namespace[n]=r,this):sE.call(this.namespace,n)&&this.namespace[n]||void 0:n?(Tu("data",this.frozen),this.namespace=n,this):this.namespace}freeze(){if(this.frozen)return this;const n=this;for(;++this.freezeIndex<this.attachers.length;){const[r,...s]=this.attachers[this.freezeIndex];if(s[0]===!1)continue;s[0]===!0&&(s[0]=void 0);const a=r.call(n,...s);typeof a=="function"&&this.transformers.use(a)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const r=$o(n),s=this.parser||this.Parser;return Nu("parse",s),s(String(r),r)}process(n,r){const s=this;return this.freeze(),Nu("process",this.parser||this.Parser),Cu("process",this.compiler||this.Compiler),r?a(void 0,r):new Promise(a);function a(c,u){const f=$o(n),p=s.parse(f);s.run(p,f,function(g,y,v){if(g||!y||!v)return m(g);const b=y,w=s.stringify(b,v);lE(w)?v.value=w:v.result=w,m(g,v)});function m(g,y){g||!y?u(g):c?c(y):r(void 0,y)}}}processSync(n){let r=!1,s;return this.freeze(),Nu("processSync",this.parser||this.Parser),Cu("processSync",this.compiler||this.Compiler),this.process(n,a),nh("processSync","process",r),s;function a(c,u){r=!0,Zm(c),s=u}}run(n,r,s){th(n),this.freeze();const a=this.transformers;return!s&&typeof r=="function"&&(s=r,r=void 0),s?c(void 0,s):new Promise(c);function c(u,f){const p=$o(r);a.run(n,p,m);function m(g,y,v){const b=y||n;g?f(g):u?u(b):s(void 0,b,v)}}}runSync(n,r){let s=!1,a;return this.run(n,r,c),nh("runSync","run",s),a;function c(u,f){Zm(u),a=f,s=!0}}stringify(n,r){this.freeze();const s=$o(r),a=this.compiler||this.Compiler;return Cu("stringify",a),th(n),a(n,s)}use(n,...r){const s=this.attachers,a=this.namespace;if(Tu("use",this.frozen),n!=null)if(typeof n=="function")p(n,r);else if(typeof n=="object")Array.isArray(n)?f(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function c(m){if(typeof m=="function")p(m,[]);else if(typeof m=="object")if(Array.isArray(m)){const[g,...y]=m;p(g,y)}else u(m);else throw new TypeError("Expected usable value, not `"+m+"`")}function u(m){if(!("plugins"in m)&&!("settings"in m))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");f(m.plugins),m.settings&&(a.settings=_u(!0,a.settings,m.settings))}function f(m){let g=-1;if(m!=null)if(Array.isArray(m))for(;++g<m.length;){const y=m[g];c(y)}else throw new TypeError("Expected a list of plugins, not `"+m+"`")}function p(m,g){let y=-1,v=-1;for(;++y<s.length;)if(s[y][0]===m){v=y;break}if(v===-1)s.push([m,...g]);else if(g.length>0){let[b,...w]=g;const _=s[v][1];rd(_)&&rd(b)&&(b=_u(!0,_,b)),s[v]=[m,b,...w]}}}}const aE=new Md().freeze();function Nu(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function Cu(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function Tu(e,n){if(n)throw new Error("Cannot call `"+e+"` on a frozen processor.\nCreate a new processor first, by calling it: use `processor()` instead of `processor`.")}function th(e){if(!rd(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function nh(e,n,r){if(!r)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function $o(e){return oE(e)?e:new iy(e)}function oE(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function lE(e){return typeof e=="string"||cE(e)}function cE(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const uE="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",rh=[],ih={allowDangerousHtml:!0},dE=/^(https?|ircs?|mailto|xmpp)$/i,fE=[{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 pE(e){const n=mE(e),r=hE(e);return gE(n.runSync(n.parse(r),r),e)}function mE(e){const n=e.rehypePlugins||rh,r=e.remarkPlugins||rh,s=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...ih}:ih;return aE().use(V0).use(r).use($1,s).use(n)}function hE(e){const n=e.children||"",r=new iy;return typeof n=="string"&&(r.value=n),r}function gE(e,n){const r=n.allowedElements,s=n.allowElement,a=n.components,c=n.disallowedElements,u=n.skipHtml,f=n.unwrapDisallowed,p=n.urlTransform||yE;for(const g of fE)Object.hasOwn(n,g.from)&&(""+g.from+(g.to?"use `"+g.to+"` instead":"remove it")+uE+g.id,void 0);return wl(e,m),M_(e,{Fragment:l.Fragment,components:a,ignoreInvalidStyle:!0,jsx:l.jsx,jsxs:l.jsxs,passKeys:!0,passNode:!0});function m(g,y,v){if(g.type==="raw"&&v&&typeof y=="number")return u?v.children.splice(y,1):v.children[y]={type:"text",value:g.value},y;if(g.type==="element"){let b;for(b in xu)if(Object.hasOwn(xu,b)&&Object.hasOwn(g.properties,b)){const w=g.properties[b],_=xu[b];(_===null||_.includes(g.tagName))&&(g.properties[b]=p(String(w||""),b,g))}}if(g.type==="element"){let b=r?!r.includes(g.tagName):c?c.includes(g.tagName):!1;if(!b&&s&&typeof y=="number"&&(b=!s(g,y,v)),b&&v&&typeof y=="number")return f&&g.children?v.children.splice(y,1,...g.children):v.children.splice(y,1),y}}}function yE(e){const n=e.indexOf(":"),r=e.indexOf("?"),s=e.indexOf("#"),a=e.indexOf("/");return n===-1||a!==-1&&n>a||r!==-1&&n>r||s!==-1&&n>s||dE.test(e.slice(0,n))?e:""}function sh(e,n){const r=String(e);if(typeof n!="string")throw new TypeError("Expected character");let s=0,a=r.indexOf(n);for(;a!==-1;)s++,a=r.indexOf(n,a+n.length);return s}function xE(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function bE(e,n,r){const a=Na((r||{}).ignore||[]),c=vE(n);let u=-1;for(;++u<c.length;)ry(e,"text",f);function f(m,g){let y=-1,v;for(;++y<g.length;){const b=g[y],w=v?v.children:void 0;if(a(b,w?w.indexOf(b):void 0,v))return;v=b}if(v)return p(m,g)}function p(m,g){const y=g[g.length-1],v=c[u][0],b=c[u][1];let w=0;const E=y.children.indexOf(m);let S=!1,O=[];v.lastIndex=0;let A=v.exec(m.value);for(;A;){const G=A.index,P={index:A.index,input:A.input,stack:[...g,m]};let M=b(...A,P);if(typeof M=="string"&&(M=M.length>0?{type:"text",value:M}:void 0),M===!1?v.lastIndex=G+1:(w!==G&&O.push({type:"text",value:m.value.slice(w,G)}),Array.isArray(M)?O.push(...M):M&&O.push(M),w=G+A[0].length,S=!0),!v.global)break;A=v.exec(m.value)}return S?(w<m.value.length&&O.push({type:"text",value:m.value.slice(w)}),y.children.splice(E,1,...O)):O=[m],E+O.length}}function vE(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const r=!e[0]||Array.isArray(e[0])?e:[e];let s=-1;for(;++s<r.length;){const a=r[s];n.push([wE(a[0]),_E(a[1])])}return n}function wE(e){return typeof e=="string"?new RegExp(xE(e),"g"):e}function _E(e){return typeof e=="function"?e:function(){return e}}const Au="phrasing",Mu=["autolink","link","image","label"];function kE(){return{transforms:[ME],enter:{literalAutolink:SE,literalAutolinkEmail:Ru,literalAutolinkHttp:Ru,literalAutolinkWww:Ru},exit:{literalAutolink:AE,literalAutolinkEmail:TE,literalAutolinkHttp:NE,literalAutolinkWww:CE}}}function EE(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:Au,notInConstruct:Mu},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:Au,notInConstruct:Mu},{character:":",before:"[ps]",after:"\\/",inConstruct:Au,notInConstruct:Mu}]}}function SE(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function Ru(e){this.config.enter.autolinkProtocol.call(this,e)}function NE(e){this.config.exit.autolinkProtocol.call(this,e)}function CE(e){this.config.exit.data.call(this,e);const n=this.stack[this.stack.length-1];n.type,n.url="http://"+this.sliceSerialize(e)}function TE(e){this.config.exit.autolinkEmail.call(this,e)}function AE(e){this.exit(e)}function ME(e){bE(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,RE],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),IE]],{ignore:["link","linkReference"]})}function RE(e,n,r,s,a){let c="";if(!sy(a)||(/^w/i.test(n)&&(r=n+r,n="",c="http://"),!OE(r)))return!1;const u=jE(r+s);if(!u[0])return!1;const f={type:"link",title:null,url:c+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[f,{type:"text",value:u[1]}]:f}function IE(e,n,r,s){return!sy(s,!0)||/[-\d_]$/.test(r)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+r,children:[{type:"text",value:n+"@"+r}]}}function OE(e){const n=e.split(".");return!(n.length<2||n[n.length-1]&&(/_/.test(n[n.length-1])||!/[a-zA-Z\d]/.test(n[n.length-1]))||n[n.length-2]&&(/_/.test(n[n.length-2])||!/[a-zA-Z\d]/.test(n[n.length-2])))}function jE(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let r=n[0],s=r.indexOf(")");const a=sh(e,"(");let c=sh(e,")");for(;s!==-1&&a>c;)e+=r.slice(0,s+1),r=r.slice(s+1),s=r.indexOf(")"),c++;return[e,r]}function sy(e,n){const r=e.input.charCodeAt(e.index-1);return(e.index===0||Ni(r)||yl(r))&&(!n||r!==47)}ay.peek=HE;function LE(){this.buffer()}function DE(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function PE(){this.buffer()}function FE(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function zE(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=rr(this.sliceSerialize(e)).toLowerCase(),r.label=n}function BE(e){this.exit(e)}function UE(e){const n=this.resume(),r=this.stack[this.stack.length-1];r.type,r.identifier=rr(this.sliceSerialize(e)).toLowerCase(),r.label=n}function $E(e){this.exit(e)}function HE(){return"["}function ay(e,n,r,s){const a=r.createTracker(s);let c=a.move("[^");const u=r.enter("footnoteReference"),f=r.enter("reference");return c+=a.move(r.safe(r.associationId(e),{after:"]",before:c})),f(),u(),c+=a.move("]"),c}function qE(){return{enter:{gfmFootnoteCallString:LE,gfmFootnoteCall:DE,gfmFootnoteDefinitionLabelString:PE,gfmFootnoteDefinition:FE},exit:{gfmFootnoteCallString:zE,gfmFootnoteCall:BE,gfmFootnoteDefinitionLabelString:UE,gfmFootnoteDefinition:$E}}}function KE(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:r,footnoteReference:ay},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function r(s,a,c,u){const f=c.createTracker(u);let p=f.move("[^");const m=c.enter("footnoteDefinition"),g=c.enter("label");return p+=f.move(c.safe(c.associationId(s),{before:p,after:"]"})),g(),p+=f.move("]:"),s.children&&s.children.length>0&&(f.shift(4),p+=f.move((n?`
|
|
424
|
-
`:" ")+c.indentLines(c.containerFlow(s,f.current()),n?oy:WE))),m(),p}}function WE(e,n,r){return n===0?e:oy(e,n,r)}function oy(e,n,r){return(r?"":" ")+e}const VE=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];ly.peek=ZE;function GE(){return{canContainEols:["delete"],enter:{strikethrough:XE},exit:{strikethrough:QE}}}function YE(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:VE}],handlers:{delete:ly}}}function XE(e){this.enter({type:"delete",children:[]},e)}function QE(e){this.exit(e)}function ly(e,n,r,s){const a=r.createTracker(s),c=r.enter("strikethrough");let u=a.move("~~");return u+=r.containerPhrasing(e,{...a.current(),before:u,after:"~"}),u+=a.move("~~"),c(),u}function ZE(){return"~"}function JE(e){return e.length}function eS(e,n){const r=n||{},s=(r.align||[]).concat(),a=r.stringLength||JE,c=[],u=[],f=[],p=[];let m=0,g=-1;for(;++g<e.length;){const _=[],E=[];let S=-1;for(e[g].length>m&&(m=e[g].length);++S<e[g].length;){const O=tS(e[g][S]);if(r.alignDelimiters!==!1){const A=a(O);E[S]=A,(p[S]===void 0||A>p[S])&&(p[S]=A)}_.push(O)}u[g]=_,f[g]=E}let y=-1;if(typeof s=="object"&&"length"in s)for(;++y<m;)c[y]=ah(s[y]);else{const _=ah(s);for(;++y<m;)c[y]=_}y=-1;const v=[],b=[];for(;++y<m;){const _=c[y];let E="",S="";_===99?(E=":",S=":"):_===108?E=":":_===114&&(S=":");let O=r.alignDelimiters===!1?1:Math.max(1,p[y]-E.length-S.length);const A=E+"-".repeat(O)+S;r.alignDelimiters!==!1&&(O=E.length+O+S.length,O>p[y]&&(p[y]=O),b[y]=O),v[y]=A}u.splice(1,0,v),f.splice(1,0,b),g=-1;const w=[];for(;++g<u.length;){const _=u[g],E=f[g];y=-1;const S=[];for(;++y<m;){const O=_[y]||"";let A="",G="";if(r.alignDelimiters!==!1){const P=p[y]-(E[y]||0),M=c[y];M===114?A=" ".repeat(P):M===99?P%2?(A=" ".repeat(P/2+.5),G=" ".repeat(P/2-.5)):(A=" ".repeat(P/2),G=A):G=" ".repeat(P)}r.delimiterStart!==!1&&!y&&S.push("|"),r.padding!==!1&&!(r.alignDelimiters===!1&&O==="")&&(r.delimiterStart!==!1||y)&&S.push(" "),r.alignDelimiters!==!1&&S.push(A),S.push(O),r.alignDelimiters!==!1&&S.push(G),r.padding!==!1&&S.push(" "),(r.delimiterEnd!==!1||y!==m-1)&&S.push("|")}w.push(r.delimiterEnd===!1?S.join("").replace(/ +$/,""):S.join(""))}return w.join(`
|
|
425
|
-
`)}function tS(e){return e==null?"":String(e)}function ah(e){const n=typeof e=="string"?e.codePointAt(0):0;return n===67||n===99?99:n===76||n===108?108:n===82||n===114?114:0}function nS(e,n,r,s){const a=r.enter("blockquote"),c=r.createTracker(s);c.move("> "),c.shift(2);const u=r.indentLines(r.containerFlow(e,c.current()),rS);return a(),u}function rS(e,n,r){return">"+(r?"":" ")+e}function iS(e,n){return oh(e,n.inConstruct,!0)&&!oh(e,n.notInConstruct,!1)}function oh(e,n,r){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return r;let s=-1;for(;++s<n.length;)if(e.includes(n[s]))return!0;return!1}function lh(e,n,r,s){let a=-1;for(;++a<r.unsafe.length;)if(r.unsafe[a].character===`
|
|
426
|
-
`&&iS(r.stack,r.unsafe[a]))return/[ \t]/.test(s.before)?"":" ";return`\\
|
|
427
|
-
`}function sS(e,n){const r=String(e);let s=r.indexOf(n),a=s,c=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;s!==-1;)s===a?++c>u&&(u=c):c=1,a=s+n.length,s=r.indexOf(n,a);return u}function aS(e,n){return!!(n.options.fences===!1&&e.value&&!e.lang&&/[^ \r\n]/.test(e.value)&&!/^[\t ]*(?:[\r\n]|$)|(?:^|[\r\n])[\t ]*$/.test(e.value))}function oS(e){const n=e.options.fence||"`";if(n!=="`"&&n!=="~")throw new Error("Cannot serialize code with `"+n+"` for `options.fence`, expected `` ` `` or `~`");return n}function lS(e,n,r,s){const a=oS(r),c=e.value||"",u=a==="`"?"GraveAccent":"Tilde";if(aS(e,r)){const y=r.enter("codeIndented"),v=r.indentLines(c,cS);return y(),v}const f=r.createTracker(s),p=a.repeat(Math.max(sS(c,a)+1,3)),m=r.enter("codeFenced");let g=f.move(p);if(e.lang){const y=r.enter(`codeFencedLang${u}`);g+=f.move(r.safe(e.lang,{before:g,after:" ",encode:["`"],...f.current()})),y()}if(e.lang&&e.meta){const y=r.enter(`codeFencedMeta${u}`);g+=f.move(" "),g+=f.move(r.safe(e.meta,{before:g,after:`
|
|
428
|
-
`,encode:["`"],...f.current()})),y()}return g+=f.move(`
|
|
429
|
-
`),c&&(g+=f.move(c+`
|
|
430
|
-
`)),g+=f.move(p),m(),g}function cS(e,n,r){return(r?"":" ")+e}function Rd(e){const n=e.options.quote||'"';if(n!=='"'&&n!=="'")throw new Error("Cannot serialize title with `"+n+"` for `options.quote`, expected `\"`, or `'`");return n}function uS(e,n,r,s){const a=Rd(r),c=a==='"'?"Quote":"Apostrophe",u=r.enter("definition");let f=r.enter("label");const p=r.createTracker(s);let m=p.move("[");return m+=p.move(r.safe(r.associationId(e),{before:m,after:"]",...p.current()})),m+=p.move("]: "),f(),!e.url||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),m+=p.move("<"),m+=p.move(r.safe(e.url,{before:m,after:">",...p.current()})),m+=p.move(">")):(f=r.enter("destinationRaw"),m+=p.move(r.safe(e.url,{before:m,after:e.title?" ":`
|
|
431
|
-
`,...p.current()}))),f(),e.title&&(f=r.enter(`title${c}`),m+=p.move(" "+a),m+=p.move(r.safe(e.title,{before:m,after:a,...p.current()})),m+=p.move(a),f()),u(),m}function dS(e){const n=e.options.emphasis||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize emphasis with `"+n+"` for `options.emphasis`, expected `*`, or `_`");return n}function ba(e){return"&#x"+e.toString(16).toUpperCase()+";"}function al(e,n,r){const s=xs(e),a=xs(n);return s===void 0?a===void 0?r==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:a===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:s===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}}cy.peek=fS;function cy(e,n,r,s){const a=dS(r),c=r.enter("emphasis"),u=r.createTracker(s),f=u.move(a);let p=u.move(r.containerPhrasing(e,{after:a,before:f,...u.current()}));const m=p.charCodeAt(0),g=al(s.before.charCodeAt(s.before.length-1),m,a);g.inside&&(p=ba(m)+p.slice(1));const y=p.charCodeAt(p.length-1),v=al(s.after.charCodeAt(0),y,a);v.inside&&(p=p.slice(0,-1)+ba(y));const b=u.move(a);return c(),r.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},f+p+b}function fS(e,n,r){return r.options.emphasis||"*"}function pS(e,n){let r=!1;return wl(e,function(s){if("value"in s&&/\r?\n|\r/.test(s.value)||s.type==="break")return r=!0,td}),!!((!e.depth||e.depth<3)&&kd(e)&&(n.options.setext||r))}function mS(e,n,r,s){const a=Math.max(Math.min(6,e.depth||1),1),c=r.createTracker(s);if(pS(e,r)){const g=r.enter("headingSetext"),y=r.enter("phrasing"),v=r.containerPhrasing(e,{...c.current(),before:`
|
|
432
|
-
`,after:`
|
|
433
|
-
`});return y(),g(),v+`
|
|
434
|
-
`+(a===1?"=":"-").repeat(v.length-(Math.max(v.lastIndexOf("\r"),v.lastIndexOf(`
|
|
435
|
-
`))+1))}const u="#".repeat(a),f=r.enter("headingAtx"),p=r.enter("phrasing");c.move(u+" ");let m=r.containerPhrasing(e,{before:"# ",after:`
|
|
436
|
-
`,...c.current()});return/^[\t ]/.test(m)&&(m=ba(m.charCodeAt(0))+m.slice(1)),m=m?u+" "+m:u,r.options.closeAtx&&(m+=" "+u),p(),f(),m}uy.peek=hS;function uy(e){return e.value||""}function hS(){return"<"}dy.peek=gS;function dy(e,n,r,s){const a=Rd(r),c=a==='"'?"Quote":"Apostrophe",u=r.enter("image");let f=r.enter("label");const p=r.createTracker(s);let m=p.move("![");return m+=p.move(r.safe(e.alt,{before:m,after:"]",...p.current()})),m+=p.move("]("),f(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(f=r.enter("destinationLiteral"),m+=p.move("<"),m+=p.move(r.safe(e.url,{before:m,after:">",...p.current()})),m+=p.move(">")):(f=r.enter("destinationRaw"),m+=p.move(r.safe(e.url,{before:m,after:e.title?" ":")",...p.current()}))),f(),e.title&&(f=r.enter(`title${c}`),m+=p.move(" "+a),m+=p.move(r.safe(e.title,{before:m,after:a,...p.current()})),m+=p.move(a),f()),m+=p.move(")"),u(),m}function gS(){return"!"}fy.peek=yS;function fy(e,n,r,s){const a=e.referenceType,c=r.enter("imageReference");let u=r.enter("label");const f=r.createTracker(s);let p=f.move("![");const m=r.safe(e.alt,{before:p,after:"]",...f.current()});p+=f.move(m+"]["),u();const g=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:p,after:"]",...f.current()});return u(),r.stack=g,c(),a==="full"||!m||m!==y?p+=f.move(y+"]"):a==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function yS(){return"!"}py.peek=xS;function py(e,n,r){let s=e.value||"",a="`",c=-1;for(;new RegExp("(^|[^`])"+a+"([^`]|$)").test(s);)a+="`";for(/[^ \r\n]/.test(s)&&(/^[ \r\n]/.test(s)&&/[ \r\n]$/.test(s)||/^`|`$/.test(s))&&(s=" "+s+" ");++c<r.unsafe.length;){const u=r.unsafe[c],f=r.compilePattern(u);let p;if(u.atBreak)for(;p=f.exec(s);){let m=p.index;s.charCodeAt(m)===10&&s.charCodeAt(m-1)===13&&m--,s=s.slice(0,m)+" "+s.slice(p.index+1)}}return a+s+a}function xS(){return"`"}function my(e,n){const r=kd(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(r===e.url||"mailto:"+r===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}hy.peek=bS;function hy(e,n,r,s){const a=Rd(r),c=a==='"'?"Quote":"Apostrophe",u=r.createTracker(s);let f,p;if(my(e,r)){const g=r.stack;r.stack=[],f=r.enter("autolink");let y=u.move("<");return y+=u.move(r.containerPhrasing(e,{before:y,after:">",...u.current()})),y+=u.move(">"),f(),r.stack=g,y}f=r.enter("link"),p=r.enter("label");let m=u.move("[");return m+=u.move(r.containerPhrasing(e,{before:m,after:"](",...u.current()})),m+=u.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=r.enter("destinationLiteral"),m+=u.move("<"),m+=u.move(r.safe(e.url,{before:m,after:">",...u.current()})),m+=u.move(">")):(p=r.enter("destinationRaw"),m+=u.move(r.safe(e.url,{before:m,after:e.title?" ":")",...u.current()}))),p(),e.title&&(p=r.enter(`title${c}`),m+=u.move(" "+a),m+=u.move(r.safe(e.title,{before:m,after:a,...u.current()})),m+=u.move(a),p()),m+=u.move(")"),f(),m}function bS(e,n,r){return my(e,r)?"<":"["}gy.peek=vS;function gy(e,n,r,s){const a=e.referenceType,c=r.enter("linkReference");let u=r.enter("label");const f=r.createTracker(s);let p=f.move("[");const m=r.containerPhrasing(e,{before:p,after:"]",...f.current()});p+=f.move(m+"]["),u();const g=r.stack;r.stack=[],u=r.enter("reference");const y=r.safe(r.associationId(e),{before:p,after:"]",...f.current()});return u(),r.stack=g,c(),a==="full"||!m||m!==y?p+=f.move(y+"]"):a==="shortcut"?p=p.slice(0,-1):p+=f.move("]"),p}function vS(){return"["}function Id(e){const n=e.options.bullet||"*";if(n!=="*"&&n!=="+"&&n!=="-")throw new Error("Cannot serialize items with `"+n+"` for `options.bullet`, expected `*`, `+`, or `-`");return n}function wS(e){const n=Id(e),r=e.options.bulletOther;if(!r)return n==="*"?"-":"*";if(r!=="*"&&r!=="+"&&r!=="-")throw new Error("Cannot serialize items with `"+r+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(r===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+r+"`) to be different");return r}function _S(e){const n=e.options.bulletOrdered||".";if(n!=="."&&n!==")")throw new Error("Cannot serialize items with `"+n+"` for `options.bulletOrdered`, expected `.` or `)`");return n}function yy(e){const n=e.options.rule||"*";if(n!=="*"&&n!=="-"&&n!=="_")throw new Error("Cannot serialize rules with `"+n+"` for `options.rule`, expected `*`, `-`, or `_`");return n}function kS(e,n,r,s){const a=r.enter("list"),c=r.bulletCurrent;let u=e.ordered?_S(r):Id(r);const f=e.ordered?u==="."?")":".":wS(r);let p=n&&r.bulletLastUsed?u===r.bulletLastUsed:!1;if(!e.ordered){const g=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&g&&(!g.children||!g.children[0])&&r.stack[r.stack.length-1]==="list"&&r.stack[r.stack.length-2]==="listItem"&&r.stack[r.stack.length-3]==="list"&&r.stack[r.stack.length-4]==="listItem"&&r.indexStack[r.indexStack.length-1]===0&&r.indexStack[r.indexStack.length-2]===0&&r.indexStack[r.indexStack.length-3]===0&&(p=!0),yy(r)===u&&g){let y=-1;for(;++y<e.children.length;){const v=e.children[y];if(v&&v.type==="listItem"&&v.children&&v.children[0]&&v.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(u=f),r.bulletCurrent=u;const m=r.containerFlow(e,s);return r.bulletLastUsed=u,r.bulletCurrent=c,a(),m}function ES(e){const n=e.options.listItemIndent||"one";if(n!=="tab"&&n!=="one"&&n!=="mixed")throw new Error("Cannot serialize items with `"+n+"` for `options.listItemIndent`, expected `tab`, `one`, or `mixed`");return n}function SS(e,n,r,s){const a=ES(r);let c=r.bulletCurrent||Id(r);n&&n.type==="list"&&n.ordered&&(c=(typeof n.start=="number"&&n.start>-1?n.start:1)+(r.options.incrementListMarker===!1?0:n.children.indexOf(e))+c);let u=c.length+1;(a==="tab"||a==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const f=r.createTracker(s);f.move(c+" ".repeat(u-c.length)),f.shift(u);const p=r.enter("listItem"),m=r.indentLines(r.containerFlow(e,f.current()),g);return p(),m;function g(y,v,b){return v?(b?"":" ".repeat(u))+y:(b?c:c+" ".repeat(u-c.length))+y}}function NS(e,n,r,s){const a=r.enter("paragraph"),c=r.enter("phrasing"),u=r.containerPhrasing(e,s);return c(),a(),u}const CS=Na(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function TS(e,n,r,s){return(e.children.some(function(u){return CS(u)})?r.containerPhrasing:r.containerFlow).call(r,e,s)}function AS(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}xy.peek=MS;function xy(e,n,r,s){const a=AS(r),c=r.enter("strong"),u=r.createTracker(s),f=u.move(a+a);let p=u.move(r.containerPhrasing(e,{after:a,before:f,...u.current()}));const m=p.charCodeAt(0),g=al(s.before.charCodeAt(s.before.length-1),m,a);g.inside&&(p=ba(m)+p.slice(1));const y=p.charCodeAt(p.length-1),v=al(s.after.charCodeAt(0),y,a);v.inside&&(p=p.slice(0,-1)+ba(y));const b=u.move(a+a);return c(),r.attentionEncodeSurroundingInfo={after:v.outside,before:g.outside},f+p+b}function MS(e,n,r){return r.options.strong||"*"}function RS(e,n,r,s){return r.safe(e.value,s)}function IS(e){const n=e.options.ruleRepetition||3;if(n<3)throw new Error("Cannot serialize rules with repetition `"+n+"` for `options.ruleRepetition`, expected `3` or more");return n}function OS(e,n,r){const s=(yy(r)+(r.options.ruleSpaces?" ":"")).repeat(IS(r));return r.options.ruleSpaces?s.slice(0,-1):s}const by={blockquote:nS,break:lh,code:lS,definition:uS,emphasis:cy,hardBreak:lh,heading:mS,html:uy,image:dy,imageReference:fy,inlineCode:py,link:hy,linkReference:gy,list:kS,listItem:SS,paragraph:NS,root:TS,strong:xy,text:RS,thematicBreak:OS};function jS(){return{enter:{table:LS,tableData:ch,tableHeader:ch,tableRow:PS},exit:{codeText:FS,table:DS,tableData:Iu,tableHeader:Iu,tableRow:Iu}}}function LS(e){const n=e._align;this.enter({type:"table",align:n.map(function(r){return r==="none"?null:r}),children:[]},e),this.data.inTable=!0}function DS(e){this.exit(e),this.data.inTable=void 0}function PS(e){this.enter({type:"tableRow",children:[]},e)}function Iu(e){this.exit(e)}function ch(e){this.enter({type:"tableCell",children:[]},e)}function FS(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,zS));const r=this.stack[this.stack.length-1];r.type,r.value=n,this.exit(e)}function zS(e,n){return n==="|"?n:e}function BS(e){const n=e||{},r=n.tableCellPadding,s=n.tablePipeAlign,a=n.stringLength,c=r?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
437
|
-
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:v,table:u,tableCell:p,tableRow:f}};function u(b,w,_,E){return m(g(b,_,E),b.align)}function f(b,w,_,E){const S=y(b,_,E),O=m([S]);return O.slice(0,O.indexOf(`
|
|
438
|
-
`))}function p(b,w,_,E){const S=_.enter("tableCell"),O=_.enter("phrasing"),A=_.containerPhrasing(b,{...E,before:c,after:c});return O(),S(),A}function m(b,w){return eS(b,{align:w,alignDelimiters:s,padding:r,stringLength:a})}function g(b,w,_){const E=b.children;let S=-1;const O=[],A=w.enter("table");for(;++S<E.length;)O[S]=y(E[S],w,_);return A(),O}function y(b,w,_){const E=b.children;let S=-1;const O=[],A=w.enter("tableRow");for(;++S<E.length;)O[S]=p(E[S],b,w,_);return A(),O}function v(b,w,_){let E=by.inlineCode(b,w,_);return _.stack.includes("tableCell")&&(E=E.replace(/\|/g,"\\$&")),E}}function US(){return{exit:{taskListCheckValueChecked:uh,taskListCheckValueUnchecked:uh,paragraph:HS}}}function $S(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:qS}}}function uh(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function HS(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const r=this.stack[this.stack.length-1];r.type;const s=r.children[0];if(s&&s.type==="text"){const a=n.children;let c=-1,u;for(;++c<a.length;){const f=a[c];if(f.type==="paragraph"){u=f;break}}u===r&&(s.value=s.value.slice(1),s.value.length===0?r.children.shift():r.position&&s.position&&typeof s.position.start.offset=="number"&&(s.position.start.column++,s.position.start.offset++,r.position.start=Object.assign({},s.position.start)))}}this.exit(e)}function qS(e,n,r,s){const a=e.children[0],c=typeof e.checked=="boolean"&&a&&a.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",f=r.createTracker(s);c&&f.move(u);let p=by.listItem(e,n,r,{...s,...f.current()});return c&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,m)),p;function m(g){return g+u}}function KS(){return[kE(),qE(),GE(),jS(),US()]}function WS(e){return{extensions:[EE(),KE(e),YE(),BS(e),$S()]}}const VS={tokenize:JS,partial:!0},vy={tokenize:eN,partial:!0},wy={tokenize:tN,partial:!0},_y={tokenize:nN,partial:!0},GS={tokenize:rN,partial:!0},ky={name:"wwwAutolink",tokenize:QS,previous:Sy},Ey={name:"protocolAutolink",tokenize:ZS,previous:Ny},Cr={name:"emailAutolink",tokenize:XS,previous:Cy},pr={};function YS(){return{text:pr}}let vi=48;for(;vi<123;)pr[vi]=Cr,vi++,vi===58?vi=65:vi===91&&(vi=97);pr[43]=Cr;pr[45]=Cr;pr[46]=Cr;pr[95]=Cr;pr[72]=[Cr,Ey];pr[104]=[Cr,Ey];pr[87]=[Cr,ky];pr[119]=[Cr,ky];function XS(e,n,r){const s=this;let a,c;return u;function u(y){return!sd(y)||!Cy.call(s,s.previous)||Od(s.events)?r(y):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),f(y))}function f(y){return sd(y)?(e.consume(y),f):y===64?(e.consume(y),p):r(y)}function p(y){return y===46?e.check(GS,g,m)(y):y===45||y===95||dn(y)?(c=!0,e.consume(y),p):g(y)}function m(y){return e.consume(y),a=!0,p}function g(y){return c&&a&&xn(s.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(y)):r(y)}}function QS(e,n,r){const s=this;return a;function a(u){return u!==87&&u!==119||!Sy.call(s,s.previous)||Od(s.events)?r(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(VS,e.attempt(vy,e.attempt(wy,c),r),r)(u))}function c(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function ZS(e,n,r){const s=this;let a="",c=!1;return u;function u(y){return(y===72||y===104)&&Ny.call(s,s.previous)&&!Od(s.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),a+=String.fromCodePoint(y),e.consume(y),f):r(y)}function f(y){if(xn(y)&&a.length<5)return a+=String.fromCodePoint(y),e.consume(y),f;if(y===58){const v=a.toLowerCase();if(v==="http"||v==="https")return e.consume(y),p}return r(y)}function p(y){return y===47?(e.consume(y),c?m:(c=!0,p)):r(y)}function m(y){return y===null||rl(y)||kt(y)||Ni(y)||yl(y)?r(y):e.attempt(vy,e.attempt(wy,g),r)(y)}function g(y){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(y)}}function JS(e,n,r){let s=0;return a;function a(u){return(u===87||u===119)&&s<3?(s++,e.consume(u),a):u===46&&s===3?(e.consume(u),c):r(u)}function c(u){return u===null?r(u):n(u)}}function eN(e,n,r){let s,a,c;return u;function u(m){return m===46||m===95?e.check(_y,p,f)(m):m===null||kt(m)||Ni(m)||m!==45&&yl(m)?p(m):(c=!0,e.consume(m),u)}function f(m){return m===95?s=!0:(a=s,s=void 0),e.consume(m),u}function p(m){return a||s||!c?r(m):n(m)}}function tN(e,n){let r=0,s=0;return a;function a(u){return u===40?(r++,e.consume(u),a):u===41&&s<r?c(u):u===33||u===34||u===38||u===39||u===41||u===42||u===44||u===46||u===58||u===59||u===60||u===63||u===93||u===95||u===126?e.check(_y,n,c)(u):u===null||kt(u)||Ni(u)?n(u):(e.consume(u),a)}function c(u){return u===41&&s++,e.consume(u),a}}function nN(e,n,r){return s;function s(f){return f===33||f===34||f===39||f===41||f===42||f===44||f===46||f===58||f===59||f===63||f===95||f===126?(e.consume(f),s):f===38?(e.consume(f),c):f===93?(e.consume(f),a):f===60||f===null||kt(f)||Ni(f)?n(f):r(f)}function a(f){return f===null||f===40||f===91||kt(f)||Ni(f)?n(f):s(f)}function c(f){return xn(f)?u(f):r(f)}function u(f){return f===59?(e.consume(f),s):xn(f)?(e.consume(f),u):r(f)}}function rN(e,n,r){return s;function s(c){return e.consume(c),a}function a(c){return dn(c)?r(c):n(c)}}function Sy(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||kt(e)}function Ny(e){return!xn(e)}function Cy(e){return!(e===47||sd(e))}function sd(e){return e===43||e===45||e===46||e===95||dn(e)}function Od(e){let n=e.length,r=!1;for(;n--;){const s=e[n][1];if((s.type==="labelLink"||s.type==="labelImage")&&!s._balanced){r=!0;break}if(s._gfmAutolinkLiteralWalkedInto){r=!1;break}}return e.length>0&&!r&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),r}const iN={tokenize:fN,partial:!0};function sN(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:cN,continuation:{tokenize:uN},exit:dN}},text:{91:{name:"gfmFootnoteCall",tokenize:lN},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:aN,resolveTo:oN}}}}function aN(e,n,r){const s=this;let a=s.events.length;const c=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let u;for(;a--;){const p=s.events[a][1];if(p.type==="labelImage"){u=p;break}if(p.type==="gfmFootnoteCall"||p.type==="labelLink"||p.type==="label"||p.type==="image"||p.type==="link")break}return f;function f(p){if(!u||!u._balanced)return r(p);const m=rr(s.sliceSerialize({start:u.end,end:s.now()}));return m.codePointAt(0)!==94||!c.includes(m.slice(1))?r(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),n(p))}}function oN(e,n){let r=e.length;for(;r--;)if(e[r][1].type==="labelImage"&&e[r][0]==="enter"){e[r][1];break}e[r+1][1].type="data",e[r+3][1].type="gfmFootnoteCallLabelMarker";const s={type:"gfmFootnoteCall",start:Object.assign({},e[r+3][1].start),end:Object.assign({},e[e.length-1][1].end)},a={type:"gfmFootnoteCallMarker",start:Object.assign({},e[r+3][1].end),end:Object.assign({},e[r+3][1].end)};a.end.column++,a.end.offset++,a.end._bufferIndex++;const c={type:"gfmFootnoteCallString",start:Object.assign({},a.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},c.start),end:Object.assign({},c.end)},f=[e[r+1],e[r+2],["enter",s,n],e[r+3],e[r+4],["enter",a,n],["exit",a,n],["enter",c,n],["enter",u,n],["exit",u,n],["exit",c,n],e[e.length-2],e[e.length-1],["exit",s,n]];return e.splice(r,e.length-r+1,...f),e}function lN(e,n,r){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c=0,u;return f;function f(y){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),p}function p(y){return y!==94?r(y):(e.enter("gfmFootnoteCallMarker"),e.consume(y),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",m)}function m(y){if(c>999||y===93&&!u||y===null||y===91||kt(y))return r(y);if(y===93){e.exit("chunkString");const v=e.exit("gfmFootnoteCallString");return a.includes(rr(s.sliceSerialize(v)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(y),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):r(y)}return kt(y)||(u=!0),c++,e.consume(y),y===92?g:m}function g(y){return y===91||y===92||y===93?(e.consume(y),c++,m):m(y)}}function cN(e,n,r){const s=this,a=s.parser.gfmFootnotes||(s.parser.gfmFootnotes=[]);let c,u=0,f;return p;function p(w){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),m}function m(w){return w===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",g):r(w)}function g(w){if(u>999||w===93&&!f||w===null||w===91||kt(w))return r(w);if(w===93){e.exit("chunkString");const _=e.exit("gfmFootnoteDefinitionLabelString");return c=rr(s.sliceSerialize(_)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(w),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),v}return kt(w)||(f=!0),u++,e.consume(w),w===92?y:g}function y(w){return w===91||w===92||w===93?(e.consume(w),u++,g):g(w)}function v(w){return w===58?(e.enter("definitionMarker"),e.consume(w),e.exit("definitionMarker"),a.includes(c)||a.push(c),pt(e,b,"gfmFootnoteDefinitionWhitespace")):r(w)}function b(w){return n(w)}}function uN(e,n,r){return e.check(Sa,n,e.attempt(iN,n,r))}function dN(e){e.exit("gfmFootnoteDefinition")}function fN(e,n,r){const s=this;return pt(e,a,"gfmFootnoteDefinitionIndent",5);function a(c){const u=s.events[s.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(c):r(c)}}function pN(e){let r=(e||{}).singleTilde;const s={name:"strikethrough",tokenize:c,resolveAll:a};return r==null&&(r=!0),{text:{126:s},insideSpan:{null:[s]},attentionMarkers:{null:[126]}};function a(u,f){let p=-1;for(;++p<u.length;)if(u[p][0]==="enter"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._close){let m=p;for(;m--;)if(u[m][0]==="exit"&&u[m][1].type==="strikethroughSequenceTemporary"&&u[m][1]._open&&u[p][1].end.offset-u[p][1].start.offset===u[m][1].end.offset-u[m][1].start.offset){u[p][1].type="strikethroughSequence",u[m][1].type="strikethroughSequence";const g={type:"strikethrough",start:Object.assign({},u[m][1].start),end:Object.assign({},u[p][1].end)},y={type:"strikethroughText",start:Object.assign({},u[m][1].end),end:Object.assign({},u[p][1].start)},v=[["enter",g,f],["enter",u[m][1],f],["exit",u[m][1],f],["enter",y,f]],b=f.parser.constructs.insideSpan.null;b&&Pn(v,v.length,0,xl(b,u.slice(m+1,p),f)),Pn(v,v.length,0,[["exit",y,f],["enter",u[p][1],f],["exit",u[p][1],f],["exit",g,f]]),Pn(u,m-1,p-m+3,v),p=m+v.length-2;break}}for(p=-1;++p<u.length;)u[p][1].type==="strikethroughSequenceTemporary"&&(u[p][1].type="data");return u}function c(u,f,p){const m=this.previous,g=this.events;let y=0;return v;function v(w){return m===126&&g[g.length-1][1].type!=="characterEscape"?p(w):(u.enter("strikethroughSequenceTemporary"),b(w))}function b(w){const _=xs(m);if(w===126)return y>1?p(w):(u.consume(w),y++,b);if(y<2&&!r)return p(w);const E=u.exit("strikethroughSequenceTemporary"),S=xs(w);return E._open=!S||S===2&&!!_,E._close=!_||_===2&&!!S,f(w)}}}class mN{constructor(){this.map=[]}add(n,r,s){hN(this,n,r,s)}consume(n){if(this.map.sort(function(c,u){return c[0]-u[0]}),this.map.length===0)return;let r=this.map.length;const s=[];for(;r>0;)r-=1,s.push(n.slice(this.map[r][0]+this.map[r][1]),this.map[r][2]),n.length=this.map[r][0];s.push(n.slice()),n.length=0;let a=s.pop();for(;a;){for(const c of a)n.push(c);a=s.pop()}this.map.length=0}}function hN(e,n,r,s){let a=0;if(!(r===0&&s.length===0)){for(;a<e.map.length;){if(e.map[a][0]===n){e.map[a][1]+=r,e.map[a][2].push(...s);return}a+=1}e.map.push([n,r,s])}}function gN(e,n){let r=!1;const s=[];for(;n<e.length;){const a=e[n];if(r){if(a[0]==="enter")a[1].type==="tableContent"&&s.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(a[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const c=s.length-1;s[c]=s[c]==="left"?"center":"right"}}else if(a[1].type==="tableDelimiterRow")break}else a[0]==="enter"&&a[1].type==="tableDelimiterRow"&&(r=!0);n+=1}return s}function yN(){return{flow:{null:{name:"table",tokenize:xN,resolveAll:bN}}}}function xN(e,n,r){const s=this;let a=0,c=0,u;return f;function f(D){let ce=s.events.length-1;for(;ce>-1;){const B=s.events[ce][1].type;if(B==="lineEnding"||B==="linePrefix")ce--;else break}const V=ce>-1?s.events[ce][1].type:null,j=V==="tableHead"||V==="tableRow"?M:p;return j===M&&s.parser.lazy[s.now().line]?r(D):j(D)}function p(D){return e.enter("tableHead"),e.enter("tableRow"),m(D)}function m(D){return D===124||(u=!0,c+=1),g(D)}function g(D){return D===null?r(D):Ke(D)?c>1?(c=0,s.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),b):r(D):ut(D)?pt(e,g,"whitespace")(D):(c+=1,u&&(u=!1,a+=1),D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),u=!0,g):(e.enter("data"),y(D)))}function y(D){return D===null||D===124||kt(D)?(e.exit("data"),g(D)):(e.consume(D),D===92?v:y)}function v(D){return D===92||D===124?(e.consume(D),y):y(D)}function b(D){return s.interrupt=!1,s.parser.lazy[s.now().line]?r(D):(e.enter("tableDelimiterRow"),u=!1,ut(D)?pt(e,w,"linePrefix",s.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(D):w(D))}function w(D){return D===45||D===58?E(D):D===124?(u=!0,e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),_):P(D)}function _(D){return ut(D)?pt(e,E,"whitespace")(D):E(D)}function E(D){return D===58?(c+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),S):D===45?(c+=1,S(D)):D===null||Ke(D)?G(D):P(D)}function S(D){return D===45?(e.enter("tableDelimiterFiller"),O(D)):P(D)}function O(D){return D===45?(e.consume(D),O):D===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(D),e.exit("tableDelimiterMarker"),A):(e.exit("tableDelimiterFiller"),A(D))}function A(D){return ut(D)?pt(e,G,"whitespace")(D):G(D)}function G(D){return D===124?w(D):D===null||Ke(D)?!u||a!==c?P(D):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(D)):P(D)}function P(D){return r(D)}function M(D){return e.enter("tableRow"),W(D)}function W(D){return D===124?(e.enter("tableCellDivider"),e.consume(D),e.exit("tableCellDivider"),W):D===null||Ke(D)?(e.exit("tableRow"),n(D)):ut(D)?pt(e,W,"whitespace")(D):(e.enter("data"),ee(D))}function ee(D){return D===null||D===124||kt(D)?(e.exit("data"),W(D)):(e.consume(D),D===92?oe:ee)}function oe(D){return D===92||D===124?(e.consume(D),ee):ee(D)}}function bN(e,n){let r=-1,s=!0,a=0,c=[0,0,0,0],u=[0,0,0,0],f=!1,p=0,m,g,y;const v=new mN;for(;++r<e.length;){const b=e[r],w=b[1];b[0]==="enter"?w.type==="tableHead"?(f=!1,p!==0&&(dh(v,n,p,m,g),g=void 0,p=0),m={type:"table",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(r,0,[["enter",m,n]])):w.type==="tableRow"||w.type==="tableDelimiterRow"?(s=!0,y=void 0,c=[0,0,0,0],u=[0,r+1,0,0],f&&(f=!1,g={type:"tableBody",start:Object.assign({},w.start),end:Object.assign({},w.end)},v.add(r,0,[["enter",g,n]])),a=w.type==="tableDelimiterRow"?2:g?3:1):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")?(s=!1,u[2]===0&&(c[1]!==0&&(u[0]=u[1],y=Ho(v,n,c,a,void 0,y),c=[0,0,0,0]),u[2]=r)):w.type==="tableCellDivider"&&(s?s=!1:(c[1]!==0&&(u[0]=u[1],y=Ho(v,n,c,a,void 0,y)),c=u,u=[c[1],r,0,0])):w.type==="tableHead"?(f=!0,p=r):w.type==="tableRow"||w.type==="tableDelimiterRow"?(p=r,c[1]!==0?(u[0]=u[1],y=Ho(v,n,c,a,r,y)):u[1]!==0&&(y=Ho(v,n,u,a,r,y)),a=0):a&&(w.type==="data"||w.type==="tableDelimiterMarker"||w.type==="tableDelimiterFiller")&&(u[3]=r)}for(p!==0&&dh(v,n,p,m,g),v.consume(n.events),r=-1;++r<n.events.length;){const b=n.events[r];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=gN(n.events,r))}return e}function Ho(e,n,r,s,a,c){const u=s===1?"tableHeader":s===2?"tableDelimiter":"tableData",f="tableContent";r[0]!==0&&(c.end=Object.assign({},ds(n.events,r[0])),e.add(r[0],0,[["exit",c,n]]));const p=ds(n.events,r[1]);if(c={type:u,start:Object.assign({},p),end:Object.assign({},p)},e.add(r[1],0,[["enter",c,n]]),r[2]!==0){const m=ds(n.events,r[2]),g=ds(n.events,r[3]),y={type:f,start:Object.assign({},m),end:Object.assign({},g)};if(e.add(r[2],0,[["enter",y,n]]),s!==2){const v=n.events[r[2]],b=n.events[r[3]];if(v[1].end=Object.assign({},b[1].end),v[1].type="chunkText",v[1].contentType="text",r[3]>r[2]+1){const w=r[2]+1,_=r[3]-r[2]-1;e.add(w,_,[])}}e.add(r[3]+1,0,[["exit",y,n]])}return a!==void 0&&(c.end=Object.assign({},ds(n.events,a)),e.add(a,0,[["exit",c,n]]),c=void 0),c}function dh(e,n,r,s,a){const c=[],u=ds(n.events,r);a&&(a.end=Object.assign({},u),c.push(["exit",a,n])),s.end=Object.assign({},u),c.push(["exit",s,n]),e.add(r+1,0,c)}function ds(e,n){const r=e[n],s=r[0]==="enter"?"start":"end";return r[1][s]}const vN={name:"tasklistCheck",tokenize:_N};function wN(){return{text:{91:vN}}}function _N(e,n,r){const s=this;return a;function a(p){return s.previous!==null||!s._gfmTasklistFirstContentOfListItem?r(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),c)}function c(p){return kt(p)?(e.enter("taskListCheckValueUnchecked"),e.consume(p),e.exit("taskListCheckValueUnchecked"),u):p===88||p===120?(e.enter("taskListCheckValueChecked"),e.consume(p),e.exit("taskListCheckValueChecked"),u):r(p)}function u(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),f):r(p)}function f(p){return Ke(p)?n(p):ut(p)?e.check({tokenize:kN},n,r)(p):r(p)}}function kN(e,n,r){return pt(e,s,"whitespace");function s(a){return a===null?r(a):n(a)}}function EN(e){return Fg([YS(),sN(),pN(e),yN(),wN()])}const SN={};function NN(e){const n=this,r=e||SN,s=n.data(),a=s.micromarkExtensions||(s.micromarkExtensions=[]),c=s.fromMarkdownExtensions||(s.fromMarkdownExtensions=[]),u=s.toMarkdownExtensions||(s.toMarkdownExtensions=[]);a.push(EN(r)),c.push(KS()),u.push(WS(r))}const fh=(function(e,n,r){const s=Na(r);if(!e||!e.type||!e.children)throw new Error("Expected parent node");if(typeof n=="number"){if(n<0||n===Number.POSITIVE_INFINITY)throw new Error("Expected positive finite number as index")}else if(n=e.children.indexOf(n),n<0)throw new Error("Expected child node or index");for(;++n<e.children.length;)if(s(e.children[n],n,e))return e.children[n]}),Mi=(function(e){if(e==null)return AN;if(typeof e=="string")return TN(e);if(typeof e=="object")return CN(e);if(typeof e=="function")return jd(e);throw new Error("Expected function, string, or array as `test`")});function CN(e){const n=[];let r=-1;for(;++r<e.length;)n[r]=Mi(e[r]);return jd(s);function s(...a){let c=-1;for(;++c<n.length;)if(n[c].apply(this,a))return!0;return!1}}function TN(e){return jd(n);function n(r){return r.tagName===e}}function jd(e){return n;function n(r,s,a){return!!(MN(r)&&e.call(this,r,typeof s=="number"?s:void 0,a||void 0))}}function AN(e){return!!(e&&typeof e=="object"&&"type"in e&&e.type==="element"&&"tagName"in e&&typeof e.tagName=="string")}function MN(e){return e!==null&&typeof e=="object"&&"type"in e&&"tagName"in e}const ph=/\n/g,mh=/[\t ]+/g,ad=Mi("br"),hh=Mi(FN),RN=Mi("p"),gh=Mi("tr"),IN=Mi(["datalist","head","noembed","noframes","noscript","rp","script","style","template","title",PN,zN]),Ty=Mi(["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 ON(e,n){const r=n||{},s="children"in e?e.children:[],a=Ty(e),c=Ry(e,{whitespace:r.whitespace||"normal"}),u=[];(e.type==="text"||e.type==="comment")&&u.push(...My(e,{breakBefore:!0,breakAfter:!0}));let f=-1;for(;++f<s.length;)u.push(...Ay(s[f],e,{whitespace:c,breakBefore:f?void 0:a,breakAfter:f<s.length-1?ad(s[f+1]):a}));const p=[];let m;for(f=-1;++f<u.length;){const g=u[f];typeof g=="number"?m!==void 0&&g>m&&(m=g):g&&(m!==void 0&&m>-1&&p.push(`
|
|
439
|
-
`.repeat(m)||" "),m=-1,p.push(g))}return p.join("")}function Ay(e,n,r){return e.type==="element"?jN(e,n,r):e.type==="text"?r.whitespace==="normal"?My(e,r):LN(e):[]}function jN(e,n,r){const s=Ry(e,r),a=e.children||[];let c=-1,u=[];if(IN(e))return u;let f,p;for(ad(e)||gh(e)&&fh(n,e,gh)?p=`
|
|
440
|
-
`:RN(e)?(f=2,p=2):Ty(e)&&(f=1,p=1);++c<a.length;)u=u.concat(Ay(a[c],e,{whitespace:s,breakBefore:c?void 0:f,breakAfter:c<a.length-1?ad(a[c+1]):p}));return hh(e)&&fh(n,e,hh)&&u.push(" "),f&&u.unshift(f),p&&u.push(p),u}function My(e,n){const r=String(e.value),s=[],a=[];let c=0;for(;c<=r.length;){ph.lastIndex=c;const p=ph.exec(r),m=p&&"index"in p?p.index:r.length;s.push(DN(r.slice(c,m).replace(/[\u061C\u200E\u200F\u202A-\u202E\u2066-\u2069]/g,""),c===0?n.breakBefore:!0,m===r.length?n.breakAfter:!0)),c=m+1}let u=-1,f;for(;++u<s.length;)s[u].charCodeAt(s[u].length-1)===8203||u<s.length-1&&s[u+1].charCodeAt(0)===8203?(a.push(s[u]),f=void 0):s[u]?(typeof f=="number"&&a.push(f),a.push(s[u]),f=0):(u===0||u===s.length-1)&&a.push(0);return a}function LN(e){return[String(e.value)]}function DN(e,n,r){const s=[];let a=0,c;for(;a<e.length;){mh.lastIndex=a;const u=mh.exec(e);c=u?u.index:e.length,!a&&!c&&u&&!n&&s.push(""),a!==c&&s.push(e.slice(a,c)),a=u?c+u[0].length:c}return a!==c&&!r&&s.push(""),s.join(" ")}function Ry(e,n){if(e.type==="element"){const r=e.properties||{};switch(e.tagName){case"listing":case"plaintext":case"xmp":return"pre";case"nobr":return"nowrap";case"pre":return r.wrap?"pre-wrap":"pre";case"td":case"th":return r.noWrap?"nowrap":n.whitespace;case"textarea":return"pre-wrap"}}return n.whitespace}function PN(e){return!!(e.properties||{}).hidden}function FN(e){return e.tagName==="td"||e.tagName==="th"}function zN(e){return e.tagName==="dialog"&&!(e.properties||{}).open}function BN(e){const n=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",u="(?!struct)("+s+"|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},m={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},y={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(m,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0},b=n.optional(a)+e.IDENT_RE+"\\s*\\(",w=["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"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],E=["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"],S=["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"],G={type:_,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:E},P={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},M=[P,y,f,r,e.C_BLOCK_COMMENT_MODE,g,m],W={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:G,contains:M.concat([{begin:/\(/,end:/\)/,keywords:G,contains:M.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+u+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:G,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:G,relevance:0},{begin:b,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[m,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,m,g,f,{begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,m,g,f]}]},f,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:G,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(W,ee,P,M,[y,{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:G,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:G},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function UN(e){const n={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"]},r=BN(e),s=r.keywords;return s.type=[...s.type,...n.type],s.literal=[...s.literal,...n.literal],s.built_in=[...s.built_in,...n.built_in],s._hints=n._hints,r.name="Arduino",r.aliases=["ino"],r.supersetOf="cpp",r}function $N(e){const n=e.regex,r={},s={begin:/\$\{/,end:/\}/,contains:["self",{begin:/:-/,contains:[r]}]};Object.assign(r,{className:"variable",variants:[{begin:n.concat(/\$[\w\d#@][\w\d_]*/,"(?![\\w\\d])(?![$])")},s]});const a={className:"subst",begin:/\$\(/,end:/\)/,contains:[e.BACKSLASH_ESCAPE]},c=e.inherit(e.COMMENT(),{match:[/(^|\s)/,/#.*$/],scope:{2:"comment"}}),u={begin:/<<-?\s*(?=\w+)/,starts:{contains:[e.END_SAME_AS_BEGIN({begin:/(\w+)/,end:/(\w+)/,className:"string"})]}},f={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,r,a]};a.contains.push(f);const p={match:/\\"/},m={className:"string",begin:/'/,end:/'/},g={match:/\\'/},y={begin:/\$?\(\(/,end:/\)\)/,contains:[{begin:/\d+#[0-9a-f]+/,className:"number"},e.NUMBER_MODE,r]},v=["fish","bash","zsh","sh","csh","ksh","tcsh","dash","scsh"],b=e.SHEBANG({binary:`(${v.join("|")})`,relevance:10}),w={className:"function",begin:/\w[\w\d_]*\s*\(\s*\)\s*\{/,returnBegin:!0,contains:[e.inherit(e.TITLE_MODE,{begin:/\w[\w\d_]*/})],relevance:0},_=["if","then","else","elif","fi","time","for","while","until","in","do","done","case","esac","coproc","function","select"],E=["true","false"],S={match:/(\/[a-z._-]+)+/},O=["break","cd","continue","eval","exec","exit","export","getopts","hash","pwd","readonly","return","shift","test","times","trap","umask","unset"],A=["alias","bind","builtin","caller","command","declare","echo","enable","help","let","local","logout","mapfile","printf","read","readarray","source","sudo","type","typeset","ulimit","unalias"],G=["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"],P=["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:_,literal:E,built_in:[...O,...A,"set","shopt",...G,...P]},contains:[b,e.SHEBANG(),w,y,c,u,S,f,p,m,g,r]}}function HN(e){const n=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",u="("+s+"|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",f={className:"type",variants:[{begin:"\\b[a-z\\d_]*_t\\b"},{match:/\batomic_[a-z]{3,6}\b/}]},m={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},y={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(m,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0},b=n.optional(a)+e.IDENT_RE+"\\s*\\(",E={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"},S=[y,f,r,e.C_BLOCK_COMMENT_MODE,g,m],O={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:E,contains:S.concat([{begin:/\(/,end:/\)/,keywords:E,contains:S.concat(["self"]),relevance:0}]),relevance:0},A={begin:"("+u+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:E,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:E,relevance:0},{begin:b,returnBegin:!0,contains:[e.inherit(v,{className:"title.function"})],relevance:0},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,m,g,f,{begin:/\(/,end:/\)/,keywords:E,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,m,g,f]}]},f,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C",aliases:["h"],keywords:E,disableAutodetect:!0,illegal:"</",contains:[].concat(O,A,S,[y,{begin:e.IDENT_RE+"::",keywords:E},{className:"class",beginKeywords:"enum class struct union",end:/[{;:<>=]/,contains:[{beginKeywords:"final class struct"},e.TITLE_MODE]}]),exports:{preprocessor:y,strings:m,keywords:E}}}function qN(e){const n=e.regex,r=e.COMMENT("//","$",{contains:[{begin:/\\\n/}]}),s="decltype\\(auto\\)",a="[a-zA-Z_]\\w*::",u="(?!struct)("+s+"|"+n.optional(a)+"[a-zA-Z_]\\w*"+n.optional("<[^<>]+>")+")",f={className:"type",begin:"\\b[a-z\\d_]*_t\\b"},m={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},y={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(m,{className:"string"}),{className:"string",begin:/<.*?>/},r,e.C_BLOCK_COMMENT_MODE]},v={className:"title",begin:n.optional(a)+e.IDENT_RE,relevance:0},b=n.optional(a)+e.IDENT_RE+"\\s*\\(",w=["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"],_=["bool","char","char16_t","char32_t","char8_t","double","float","int","long","short","void","wchar_t","unsigned","signed","const","static"],E=["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"],S=["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"],G={type:_,keyword:w,literal:["NULL","false","nullopt","nullptr","true"],built_in:["_Pragma"],_type_hints:E},P={className:"function.dispatch",relevance:0,keywords:{_hint:S},begin:n.concat(/\b/,/(?!decltype)/,/(?!if)/,/(?!for)/,/(?!switch)/,/(?!while)/,e.IDENT_RE,n.lookahead(/(<[^<>]+>|)\s*\(/))},M=[P,y,f,r,e.C_BLOCK_COMMENT_MODE,g,m],W={variants:[{begin:/=/,end:/;/},{begin:/\(/,end:/\)/},{beginKeywords:"new throw return else",end:/;/}],keywords:G,contains:M.concat([{begin:/\(/,end:/\)/,keywords:G,contains:M.concat(["self"]),relevance:0}]),relevance:0},ee={className:"function",begin:"("+u+"[\\*&\\s]+)+"+b,returnBegin:!0,end:/[{;=]/,excludeEnd:!0,keywords:G,illegal:/[^\w\s\*&:<>.]/,contains:[{begin:s,keywords:G,relevance:0},{begin:b,returnBegin:!0,contains:[v],relevance:0},{begin:/::/,relevance:0},{begin:/:/,endsWithParent:!0,contains:[m,g]},{relevance:0,match:/,/},{className:"params",begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:[r,e.C_BLOCK_COMMENT_MODE,m,g,f,{begin:/\(/,end:/\)/,keywords:G,relevance:0,contains:["self",r,e.C_BLOCK_COMMENT_MODE,m,g,f]}]},f,r,e.C_BLOCK_COMMENT_MODE,y]};return{name:"C++",aliases:["cc","c++","h++","hpp","hh","hxx","cxx"],keywords:G,illegal:"</",classNameAliases:{"function.dispatch":"built_in"},contains:[].concat(W,ee,P,M,[y,{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:G,contains:["self",f]},{begin:e.IDENT_RE+"::",keywords:G},{match:[/\b(?:enum(?:\s+(?:class|struct))?|class|struct|union)/,/\s+/,/\w+/],className:{1:"keyword",3:"title.class"}}])}}function KN(e){const n=["bool","byte","char","decimal","delegate","double","dynamic","enum","float","int","long","nint","nuint","object","sbyte","short","string","ulong","uint","ushort"],r=["public","private","protected","static","internal","protected","abstract","async","extern","override","unsafe","virtual","new","sealed","partial"],s=["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"],c=["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"],u={keyword:a.concat(c),built_in:n,literal:s},f=e.inherit(e.TITLE_MODE,{begin:"[a-zA-Z](\\.?\\w)*"}),p={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},m={className:"string",begin:/"""("*)(?!")(.|\n)*?"""\1/,relevance:1},g={className:"string",begin:'@"',end:'"',contains:[{begin:'""'}]},y=e.inherit(g,{illegal:/\n/}),v={className:"subst",begin:/\{/,end:/\}/,keywords:u},b=e.inherit(v,{illegal:/\n/}),w={className:"string",begin:/\$"/,end:'"',illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},e.BACKSLASH_ESCAPE,b]},_={className:"string",begin:/\$@"/,end:'"',contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},v]},E=e.inherit(_,{illegal:/\n/,contains:[{begin:/\{\{/},{begin:/\}\}/},{begin:'""'},b]});v.contains=[_,w,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,e.C_BLOCK_COMMENT_MODE],b.contains=[E,w,y,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,p,e.inherit(e.C_BLOCK_COMMENT_MODE,{illegal:/\n/})];const S={variants:[m,_,w,g,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},O={begin:"<",end:">",contains:[{beginKeywords:"in out"},f]},A=e.IDENT_RE+"(<"+e.IDENT_RE+"(\\s*,\\s*"+e.IDENT_RE+")*>)?(\\[\\])?",G={begin:"@"+e.IDENT_RE,relevance:0};return{name:"C#",aliases:["cs","c#"],keywords:u,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"}},S,p,{beginKeywords:"class interface",relevance:0,end:/[{;=]/,illegal:/[^\s:,]/,contains:[{beginKeywords:"where class"},f,O,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"namespace",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},{beginKeywords:"record",relevance:0,end:/[{;=]/,illegal:/[^\s:]/,contains:[f,O,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:"("+A+"\\s+)+"+e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,end:/\s*[{;=]/,excludeEnd:!0,keywords:u,contains:[{beginKeywords:r.join(" "),relevance:0},{begin:e.IDENT_RE+"\\s*(<[^=]+>\\s*)?\\(",returnBegin:!0,contains:[e.TITLE_MODE,O],relevance:0},{match:/\(\)/},{className:"params",begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:u,relevance:0,contains:[S,p,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},G]}}const WN=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_-]*/}}),VN=["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"],GN=["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"],YN=[...VN,...GN],XN=["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(),QN=["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(),ZN=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),JN=["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 eC(e){const n=e.regex,r=WN(e),s={begin:/-(webkit|moz|ms|o)-(?=[a-z])/},a="and or not only",c=/@-?\w[\w]*(-\w+)*/,u="[a-zA-Z-][a-zA-Z0-9_-]*",f=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE];return{name:"CSS",case_insensitive:!0,illegal:/[=|'\$]/,keywords:{keyframePosition:"from to"},classNameAliases:{keyframePosition:"selector-tag"},contains:[r.BLOCK_COMMENT,s,r.CSS_NUMBER_MODE,{className:"selector-id",begin:/#[A-Za-z0-9_-]+/,relevance:0},{className:"selector-class",begin:"\\."+u,relevance:0},r.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",variants:[{begin:":("+QN.join("|")+")"},{begin:":(:)?("+ZN.join("|")+")"}]},r.CSS_VARIABLE,{className:"attribute",begin:"\\b("+JN.join("|")+")\\b"},{begin:/:/,end:/[;}{]/,contains:[r.BLOCK_COMMENT,r.HEXCOLOR,r.IMPORTANT,r.CSS_NUMBER_MODE,...f,{begin:/(url|data-uri)\(/,end:/\)/,relevance:0,keywords:{built_in:"url data-uri"},contains:[...f,{className:"string",begin:/[^)]/,endsWithParent:!0,excludeEnd:!0}]},r.FUNCTION_DISPATCH]},{begin:n.lookahead(/@/),end:"[{;]",relevance:0,illegal:/:/,contains:[{className:"keyword",begin:c},{begin:/\s/,endsWithParent:!0,excludeEnd:!0,relevance:0,keywords:{$pattern:/[a-z-]+/,keyword:a,attribute:XN.join(" ")},contains:[{begin:/[a-z-]+(?=:)/,className:"attribute"},...f,r.CSS_NUMBER_MODE]}]},{className:"selector-tag",begin:"\\b("+YN.join("|")+")\\b"}]}}function tC(e){const n=e.regex;return{name:"Diff",aliases:["patch"],contains:[{className:"meta",relevance:10,match:n.either(/^@@ +-\d+,\d+ +\+\d+,\d+ +@@/,/^\*\*\* +\d+,\d+ +\*\*\*\*$/,/^--- +\d+,\d+ +----$/)},{className:"comment",variants:[{begin:n.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 nC(e){const c={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:c,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:c,illegal:/["']/}]}]}}function rC(e){const n=e.regex,r=/[_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:n.concat(r,n.lookahead(/\s*:/)),relevance:0}],illegal:[/[;<']/,/BEGIN/]}}function iC(e){const n=e.regex,r={className:"number",relevance:0,variants:[{begin:/([+-]+)?[\d]+_[\d_]+/},{begin:e.NUMBER_RE}]},s=e.COMMENT();s.variants=[{begin:/;/,end:/$/},{begin:/#/,end:/$/}];const a={className:"variable",variants:[{begin:/\$[\w\d"][\w\d_]*/},{begin:/\$\{(.*?)\}/}]},c={className:"literal",begin:/\bon|off|true|false|yes|no\b/},u={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:"'''",end:"'''",relevance:10},{begin:'"""',end:'"""',relevance:10},{begin:'"',end:'"'},{begin:"'",end:"'"}]},f={begin:/\[/,end:/\]/,contains:[s,c,a,u,r,"self"],relevance:0},p=/[A-Za-z0-9_-]+/,m=/"(\\"|[^"])*"/,g=/'[^']*'/,y=n.either(p,m,g),v=n.concat(y,"(\\s*\\.\\s*",y,")*",n.lookahead(/\s*=\s*[^#\s]/));return{name:"TOML, also INI",aliases:["toml"],case_insensitive:!0,illegal:/\S/,contains:[s,{className:"section",begin:/\[+/,end:/\]+/},{begin:v,className:"attr",starts:{end:/$/,contains:[s,f,c,a,u,r]}}]}}var fs="[0-9](_*[0-9])*",qo=`\\.(${fs})`,Ko="[0-9a-fA-F](_*[0-9a-fA-F])*",yh={className:"number",variants:[{begin:`(\\b(${fs})((${qo})|\\.)?|(${qo}))[eE][+-]?(${fs})[fFdD]?\\b`},{begin:`\\b(${fs})((${qo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${qo})[fFdD]?\\b`},{begin:`\\b(${fs})[fFdD]\\b`},{begin:`\\b0[xX]((${Ko})\\.?|(${Ko})?\\.(${Ko}))[pP][+-]?(${fs})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Ko})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function Iy(e,n,r){return r===-1?"":e.replace(n,s=>Iy(e,n,r-1))}function sC(e){const n=e.regex,r="[À-ʸa-zA-Z_$][À-ʸa-zA-Z_$0-9]*",s=r+Iy("(?:<"+r+"~~~(?:\\s*,\\s*"+r+"~~~)*>)?",/~~~/g,2),p={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"]},m={className:"meta",begin:"@"+r,contains:[{begin:/\(/,end:/\)/,contains:["self"]}]},g={className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[e.C_BLOCK_COMMENT_MODE],endsParent:!0};return{name:"Java",aliases:["jsp"],keywords:p,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+/,r],className:{1:"keyword",3:"title.class"}},{match:/non-sealed/,scope:"keyword"},{begin:[n.concat(/(?!else)/,r),/\s+/,r,/\s+/,/=(?!=)/],className:{1:"type",3:"variable",5:"operator"}},{begin:[/record/,/\s+/,r],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:["(?:"+s+"\\s+)",e.UNDERSCORE_IDENT_RE,/\s*(?=\()/],className:{2:"title.function"},keywords:p,contains:[{className:"params",begin:/\(/,end:/\)/,keywords:p,relevance:0,contains:[m,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,yh,e.C_BLOCK_COMMENT_MODE]},e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE]},yh,m]}}const xh="[A-Za-z$_][0-9A-Za-z$_]*",aC=["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"],oC=["true","false","null","undefined","NaN","Infinity"],Oy=["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"],jy=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Ly=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],lC=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],cC=[].concat(Ly,Oy,jy);function uC(e){const n=e.regex,r=(K,{after:ue})=>{const C="</"+K[0].slice(1);return K.input.indexOf(C,ue)!==-1},s=xh,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,ue)=>{const C=K[0].length+K.index,R=K.input[C];if(R==="<"||R===","){ue.ignoreMatch();return}R===">"&&(r(K,{after:C})||ue.ignoreMatch());let J;const T=K.input.substring(C);if(J=T.match(/^\s*=/)){ue.ignoreMatch();return}if((J=T.match(/^\s+extends\s+/))&&J.index===0){ue.ignoreMatch();return}}},f={$pattern:xh,keyword:aC,literal:oC,built_in:cC,"variable.language":lC},p="[0-9](_?[0-9])*",m=`\\.(${p})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${g})((${m})|\\.)?|(${m}))[eE][+-]?(${p})\\b`},{begin:`\\b(${g})\\b((${m})\\b|\\.)?|(${m})\\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},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},O={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:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},A=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,w,_,E,{match:/\$\d+/},y];v.contains=A.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(A)});const G=[].concat(O,v.contains),P=G.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(G)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:P},W={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,n.concat(s,"(",n.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:n.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:{_:[...Oy,...jy]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},ce={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function V(K){return n.concat("(?!",K.join("|"),")")}const j={match:n.concat(/\b/,V([...Ly,"super","import"].map(K=>`${K}\\s*\\(`)),s,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},B={begin:n.concat(/\./,n.lookahead(n.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ne={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,w,_,E,O,{match:/\$\d+/},y,ee,{scope:"attr",match:s+n.lookahead(":"),relevance:0},ne,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:Z,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:f,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},B,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},j,ce,W,q,{match:/\$[(.]/}]}}function dC(e){const n={className:"attr",begin:/"(\\.|[^\\"\r\n])*"(?=\s*:)/,relevance:1.01},r={match:/[{}[\],:]/,className:"punctuation",relevance:0},s=["true","false","null"],a={scope:"literal",beginKeywords:s.join(" ")};return{name:"JSON",aliases:["jsonc"],keywords:{literal:s},contains:[n,r,e.QUOTE_STRING_MODE,a,e.C_NUMBER_MODE,e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE],illegal:"\\S"}}var ps="[0-9](_*[0-9])*",Wo=`\\.(${ps})`,Vo="[0-9a-fA-F](_*[0-9a-fA-F])*",fC={className:"number",variants:[{begin:`(\\b(${ps})((${Wo})|\\.)?|(${Wo}))[eE][+-]?(${ps})[fFdD]?\\b`},{begin:`\\b(${ps})((${Wo})[fFdD]?\\b|\\.([fFdD]\\b)?)`},{begin:`(${Wo})[fFdD]?\\b`},{begin:`\\b(${ps})[fFdD]\\b`},{begin:`\\b0[xX]((${Vo})\\.?|(${Vo})?\\.(${Vo}))[pP][+-]?(${ps})[fFdD]?\\b`},{begin:"\\b(0|[1-9](_*[0-9])*)[lL]?\\b"},{begin:`\\b0[xX](${Vo})[lL]?\\b`},{begin:"\\b0(_*[0-7])*[lL]?\\b"},{begin:"\\b0[bB][01](_*[01])*[lL]?\\b"}],relevance:0};function pC(e){const n={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"},r={className:"keyword",begin:/\b(break|continue|return|this)\b/,starts:{contains:[{className:"symbol",begin:/@\w+/}]}},s={className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"@"},a={className:"subst",begin:/\$\{/,end:/\}/,contains:[e.C_NUMBER_MODE]},c={className:"variable",begin:"\\$"+e.UNDERSCORE_IDENT_RE},u={className:"string",variants:[{begin:'"""',end:'"""(?=[^"])',contains:[c,a]},{begin:"'",end:"'",illegal:/\n/,contains:[e.BACKSLASH_ESCAPE]},{begin:'"',end:'"',illegal:/\n/,contains:[e.BACKSLASH_ESCAPE,c,a]}]};a.contains.push(u);const f={className:"meta",begin:"@(?:file|property|field|get|set|receiver|param|setparam|delegate)\\s*:(?:\\s*"+e.UNDERSCORE_IDENT_RE+")?"},p={className:"meta",begin:"@"+e.UNDERSCORE_IDENT_RE,contains:[{begin:/\(/,end:/\)/,contains:[e.inherit(u,{className:"string"}),"self"]}]},m=fC,g=e.COMMENT("/\\*","\\*/",{contains:[e.C_BLOCK_COMMENT_MODE]}),y={variants:[{className:"type",begin:e.UNDERSCORE_IDENT_RE},{begin:/\(/,end:/\)/,contains:[]}]},v=y;return v.variants[1].contains=[y],y.variants[1].contains=[v],{name:"Kotlin",aliases:["kt","kts"],keywords:n,contains:[e.COMMENT("/\\*\\*","\\*/",{relevance:0,contains:[{className:"doctag",begin:"@[A-Za-z]+"}]}),e.C_LINE_COMMENT_MODE,g,r,s,f,p,{className:"function",beginKeywords:"fun",end:"[(]|$",returnBegin:!0,excludeEnd:!0,keywords:n,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:n,relevance:0,contains:[{begin:/:/,end:/[=,\/]/,endsWithParent:!0,contains:[y,e.C_LINE_COMMENT_MODE,g],relevance:0},e.C_LINE_COMMENT_MODE,g,f,p,u,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},f,p]},u,{className:"meta",begin:"^#!/usr/bin/env",end:"$",illegal:`
|
|
441
|
-
`},m]}}const mC=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_-]*/}}),hC=["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"],gC=["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"],yC=[...hC,...gC],xC=["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(),Dy=["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(),Py=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),bC=["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(),vC=Dy.concat(Py).sort().reverse();function wC(e){const n=mC(e),r=vC,s="and or not only",a="[\\w-]+",c="("+a+"|@\\{"+a+"\\})",u=[],f=[],p=function(A){return{className:"string",begin:"~?"+A+".*?"+A}},m=function(A,G,P){return{className:A,begin:G,relevance:P}},g={$pattern:/[a-z-]+/,keyword:s,attribute:xC.join(" ")},y={begin:"\\(",end:"\\)",contains:f,keywords:g,relevance:0};f.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,p("'"),p('"'),n.CSS_NUMBER_MODE,{begin:"(url|data-uri)\\(",starts:{className:"string",end:"[\\)\\n]",excludeEnd:!0}},n.HEXCOLOR,y,m("variable","@@?"+a,10),m("variable","@\\{"+a+"\\}"),m("built_in","~?`[^`]*?`"),{className:"attribute",begin:a+"\\s*:",end:":",returnBegin:!0,excludeEnd:!0},n.IMPORTANT,{beginKeywords:"and not"},n.FUNCTION_DISPATCH);const v=f.concat({begin:/\{/,end:/\}/,contains:u}),b={beginKeywords:"when",endsWithParent:!0,contains:[{beginKeywords:"and not"}].concat(f)},w={begin:c+"\\s*:",returnBegin:!0,end:/[;}]/,relevance:0,contains:[{begin:/-(webkit|moz|ms|o)-/},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+bC.join("|")+")\\b",end:/(?=:)/,starts:{endsWithParent:!0,illegal:"[<=$]",relevance:0,contains:f}}]},_={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:f,relevance:0}},E={className:"variable",variants:[{begin:"@"+a+"\\s*:",relevance:15},{begin:"@"+a}],starts:{end:"[;}]",returnEnd:!0,contains:v}},S={variants:[{begin:"[\\.#:&\\[>]",end:"[;{}]"},{begin:c,end:/\{/}],returnBegin:!0,returnEnd:!0,illegal:`[<='$"]`,relevance:0,contains:[e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,b,m("keyword","all\\b"),m("variable","@\\{"+a+"\\}"),{begin:"\\b("+yC.join("|")+")\\b",className:"selector-tag"},n.CSS_NUMBER_MODE,m("selector-tag",c,0),m("selector-id","#"+c),m("selector-class","\\."+c,0),m("selector-tag","&",0),n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-pseudo",begin:":("+Dy.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+Py.join("|")+")"},{begin:/\(/,end:/\)/,relevance:0,contains:v},{begin:"!important"},n.FUNCTION_DISPATCH]},O={begin:a+`:(:)?(${r.join("|")})`,returnBegin:!0,contains:[S]};return u.push(e.C_LINE_COMMENT_MODE,e.C_BLOCK_COMMENT_MODE,_,E,O,w,S,b,n.FUNCTION_DISPATCH),{name:"Less",case_insensitive:!0,illegal:`[=>'/<($"]`,contains:u}}function _C(e){const n="\\[=*\\[",r="\\]=*\\]",s={begin:n,end:r,contains:["self"]},a=[e.COMMENT("--(?!"+n+")","$"),e.COMMENT("--"+n,r,{contains:[s],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:n,end:r,contains:[s],relevance:5}])}}function kC(e){const n={className:"variable",variants:[{begin:"\\$\\("+e.UNDERSCORE_IDENT_RE+"\\)",contains:[e.BACKSLASH_ESCAPE]},{begin:/\$[@%<?\^\+\*]/}]},r={className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,n]},s={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:[n,r]},a={begin:"^"+e.UNDERSCORE_IDENT_RE+"\\s*(?=[:+?]?=)"},c={className:"meta",begin:/^\.PHONY:/,end:/$/,keywords:{$pattern:/[\.\w]+/,keyword:".PHONY"}},u={className:"section",begin:/^[^\s]+:/,end:/$/,contains:[n]};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,n,r,s,a,c,u]}}function EC(e){const n=e.regex,r={begin:/<\/?[A-Za-z_]/,end:">",subLanguage:"xml",relevance:0},s={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}]},c={className:"bullet",begin:"^[ ]*([*+-]|(\\d+\\.))(?=\\s+)",end:"\\s+",excludeEnd:!0},u={begin:/^\[[^\n]+\]:/,returnBegin:!0,contains:[{className:"symbol",begin:/\[/,end:/\]/,excludeBegin:!0,excludeEnd:!0},{className:"link",begin:/:\s*/,end:/$/,excludeBegin:!0}]},f=/[A-Za-z][A-Za-z0-9+.-]*/,p={variants:[{begin:/\[.+?\]\[.*?\]/,relevance:0},{begin:/\[.+?\]\(((data|javascript|mailto):|(?:http|ftp)s?:\/\/).*?\)/,relevance:2},{begin:n.concat(/\[.+?\]\(/,f,/:\/\/.*?\)/),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}]},m={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}]},y=e.inherit(m,{contains:[]}),v=e.inherit(g,{contains:[]});m.contains.push(v),g.contains.push(y);let b=[r,p];return[m,g,y,v].forEach(S=>{S.contains=S.contains.concat(b)}),b=b.concat(m,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}]}]},r,c,m,g,{className:"quote",begin:"^>\\s+",contains:b,end:"$"},a,s,p,u,{scope:"literal",match:/&([a-zA-Z0-9]+|#[0-9]{1,7}|#[Xx][0-9a-fA-F]{1,6});/}]}}function SC(e){const n={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+"},r=/[a-zA-Z@][a-zA-Z0-9_]*/,f={"variable.language":["this","super"],$pattern:r,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"]},p={$pattern:r,keyword:["@interface","@class","@protocol","@implementation"]};return{name:"Objective-C",aliases:["mm","objc","obj-c","obj-c++","objective-c++"],keywords:f,illegal:"</",contains:[n,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:"("+p.keyword.join("|")+")\\b",end:/(\{|$)/,excludeEnd:!0,keywords:p,contains:[e.UNDERSCORE_TITLE_MODE]},{begin:"\\."+e.UNDERSCORE_IDENT_RE,relevance:0}]}}function NC(e){const n=e.regex,r=["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"],s=/[dualxmsipngr]{0,12}/,a={$pattern:/[\w.]+/,keyword:r.join(" ")},c={className:"subst",begin:"[$@]\\{",end:"\\}",keywords:a},u={begin:/->\{/,end:/\}/},f={scope:"attr",match:/\s+:\s*\w+(\s*\(.*?\))?/},p={scope:"variable",variants:[{begin:/\$\d/},{begin:n.concat(/[$%@](?!")(\^\w\b|#\w+(::\w+)*|\{\w+\}|\w+(::\w*)*)/,"(?![A-Za-z])(?![@$%])")},{begin:/[$%@](?!")[^\s\w{=]|\$=/,relevance:0}],contains:[f]},m={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,c,p],y=[/!/,/\//,/\|/,/\?/,/'/,/"/,/#/],v=(_,E,S="\\1")=>{const O=S==="\\1"?S:n.concat(S,E);return n.concat(n.concat("(?:",_,")"),E,/(?:\\.|[^\\\/])*?/,O,/(?:\\.|[^\\\/])*?/,S,s)},b=(_,E,S)=>n.concat(n.concat("(?:",_,")"),E,/(?:\\.|[^\\\/])*?/,S,s),w=[p,e.HASH_COMMENT_MODE,e.COMMENT(/^=\w/,/=cut/,{endsWithParent:!0}),u,{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}]},m,{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:v("s|tr|y",n.either(...y,{capture:!0}))},{begin:v("s|tr|y","\\(","\\)")},{begin:v("s|tr|y","\\[","\\]")},{begin:v("s|tr|y","\\{","\\}")}],relevance:2},{className:"regexp",variants:[{begin:/(m|qr)\/\//,relevance:0},{begin:b("(?:m|qr)?",/\//,/\//)},{begin:b("m|qr",n.either(...y,{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,f]},{className:"class",beginKeywords:"class",end:"[;{]",excludeEnd:!0,relevance:5,contains:[e.TITLE_MODE,f,m]},{begin:"-\\w\\b",relevance:0},{begin:"^__DATA__$",end:"^__END__$",subLanguage:"mojolicious",contains:[{begin:"^@@.*",end:"$",className:"comment"}]}];return c.contains=w,u.contains=w,{name:"Perl",aliases:["pl","pm"],keywords:a,contains:w}}function CC(e){const n=e.regex,r=/(?![A-Za-z0-9])(?![$])/,s=n.concat(/[a-zA-Z_\x7f-\xff][a-zA-Z0-9_\x7f-\xff]*/,r),a=n.concat(/(\\?[A-Z][a-z0-9_\x7f-\xff]+|\\?[A-Z]+(?=[A-Z][a-z0-9_\x7f-\xff])){1,}/,r),c=n.concat(/[A-Z]+/,r),u={scope:"variable",match:"\\$+"+s},f={scope:"meta",variants:[{begin:/<\?php/,relevance:10},{begin:/<\?=/},{begin:/<\?/,relevance:.1},{begin:/\?>/}]},p={scope:"subst",variants:[{begin:/\$\w+/},{begin:/\{\$/,end:/\}/}]},m=e.inherit(e.APOS_STRING_MODE,{illegal:null}),g=e.inherit(e.QUOTE_STRING_MODE,{illegal:null,contains:e.QUOTE_STRING_MODE.contains.concat(p)}),y={begin:/<<<[ \t]*(?:(\w+)|"(\w+)")\n/,end:/[ \t]*(\w+)\b/,contains:e.QUOTE_STRING_MODE.contains.concat(p),"on:begin":(B,q)=>{q.data._beginMatch=B[1]||B[2]},"on:end":(B,q)=>{q.data._beginMatch!==B[1]&&q.ignoreMatch()}},v=e.END_SAME_AS_BEGIN({begin:/<<<[ \t]*'(\w+)'\n/,end:/[ \t]*(\w+)\b/}),b=`[
|
|
442
|
-
]`,w={scope:"string",variants:[g,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},E=["false","null","true"],S=["__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"],O=["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"],G={keyword:S,literal:(B=>{const q=[];return B.forEach(Z=>{q.push(Z),Z.toLowerCase()===Z?q.push(Z.toUpperCase()):q.push(Z.toLowerCase())}),q})(E),built_in:O},P=B=>B.map(q=>q.replace(/\|\d+$/,"")),M={variants:[{match:[/new/,n.concat(b,"+"),n.concat("(?!",P(O).join("\\b|"),"\\b)"),a],scope:{1:"keyword",4:"title.class"}}]},W=n.concat(s,"\\b(?!\\()"),ee={variants:[{match:[n.concat(/::/,n.lookahead(/(?!class\b)/)),W],scope:{2:"variable.constant"}},{match:[/::/,/class/],scope:{2:"variable.language"}},{match:[a,n.concat(/::/,n.lookahead(/(?!class\b)/)),W],scope:{1:"title.class",3:"variable.constant"}},{match:[a,n.concat("::",n.lookahead(/(?!class\b)/))],scope:{1:"title.class"}},{match:[a,/::/,/class/],scope:{1:"title.class",3:"variable.language"}}]},oe={scope:"attr",match:n.concat(s,n.lookahead(":"),n.lookahead(/(?!::)/))},D={relevance:0,begin:/\(/,end:/\)/,keywords:G,contains:[oe,u,ee,e.C_BLOCK_COMMENT_MODE,w,_,M]},ce={relevance:0,match:[/\b/,n.concat("(?!fn\\b|function\\b|",P(S).join("\\b|"),"|",P(O).join("\\b|"),"\\b)"),s,n.concat(b,"*"),n.lookahead(/(?=\()/)],scope:{3:"title.function.invoke"},contains:[D]};D.contains.push(ce);const V=[oe,ee,e.C_BLOCK_COMMENT_MODE,w,_,M],j={begin:n.concat(/#\[\s*\\?/,n.either(a,c)),beginScope:"meta",end:/]/,endScope:"meta",keywords:{literal:E,keyword:["new","array"]},contains:[{begin:/\[/,end:/]/,keywords:{literal:E,keyword:["new","array"]},contains:["self",...V]},...V,{scope:"meta",variants:[{match:a},{match:c}]}]};return{case_insensitive:!1,keywords:G,contains:[j,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}]}},f,{scope:"variable.language",match:/\$this\b/},u,ce,ee,{match:[/const/,/\s/,s],scope:{1:"keyword",3:"variable.constant"}},M,{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:G,contains:["self",j,u,ee,e.C_BLOCK_COMMENT_MODE,w,_]}]},{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]},w,_]}}function TC(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 AC(e){return{name:"Plain text",aliases:["text","txt"],disableAutodetect:!0}}function MC(e){const n=e.regex,r=new RegExp("[\\p{XID_Start}_]\\p{XID_Continue}*","u"),s=["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"],f={$pattern:/[A-Za-z]\w+|__\w+__/,keyword:s,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"]},p={className:"meta",begin:/^(>>>|\.\.\.) /},m={className:"subst",begin:/\{/,end:/\}/,keywords:f,illegal:/#/},g={begin:/\{\{/,relevance:0},y={className:"string",contains:[e.BACKSLASH_ESCAPE],variants:[{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([uU]|[bB]|[rR]|[bB][rR]|[rR][bB])?"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,p],relevance:10},{begin:/([fF][rR]|[rR][fF]|[fF])'''/,end:/'''/,contains:[e.BACKSLASH_ESCAPE,p,g,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"""/,end:/"""/,contains:[e.BACKSLASH_ESCAPE,p,g,m]},{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,m]},{begin:/([fF][rR]|[rR][fF]|[fF])"/,end:/"/,contains:[e.BACKSLASH_ESCAPE,g,m]},e.APOS_STRING_MODE,e.QUOTE_STRING_MODE]},v="[0-9](_?[0-9])*",b=`(\\b(${v}))?\\.(${v})|\\b(${v})\\.`,w=`\\b|${s.join("|")}`,_={className:"number",relevance:0,variants:[{begin:`(\\b(${v})|(${b}))[eE][+-]?(${v})[jJ]?(?=${w})`},{begin:`(${b})[jJ]?`},{begin:`\\b([1-9](_?[0-9])*|0+(_?0)*)[lLjJ]?(?=${w})`},{begin:`\\b0[bB](_?[01])+[lL]?(?=${w})`},{begin:`\\b0[oO](_?[0-7])+[lL]?(?=${w})`},{begin:`\\b0[xX](_?[0-9a-fA-F])+[lL]?(?=${w})`},{begin:`\\b(${v})[jJ](?=${w})`}]},E={className:"comment",begin:n.lookahead(/# type:/),end:/$/,keywords:f,contains:[{begin:/# type:/},{begin:/#/,end:/\b\B/,endsWithParent:!0}]},S={className:"params",variants:[{className:"",begin:/\(\s*\)/,skip:!0},{begin:/\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:["self",p,_,y,e.HASH_COMMENT_MODE]}]};return m.contains=[y,_,p],{name:"Python",aliases:["py","gyp","ipython"],unicodeRegex:!0,keywords:f,illegal:/(<\/|\?)|=>/,contains:[p,_,{scope:"variable.language",match:/\bself\b/},{beginKeywords:"if",relevance:0},{match:/\bor\b/,scope:"keyword"},y,E,e.HASH_COMMENT_MODE,{match:[/\bdef/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[S]},{variants:[{match:[/\bclass/,/\s+/,r,/\s*/,/\(\s*/,r,/\s*\)/]},{match:[/\bclass/,/\s+/,r]}],scope:{1:"keyword",3:"title.class",6:"title.class.inherited"}},{className:"meta",begin:/^[\t ]*@/,end:/(?=#)|$/,contains:[_,S,y]}]}}function RC(e){return{aliases:["pycon"],contains:[{className:"meta.prompt",starts:{end:/ |$/,starts:{end:"$",subLanguage:"python"}},variants:[{begin:/^>>>(?=[ ]|$)/},{begin:/^\.\.\.(?=[ ]|$)/}]}]}}function IC(e){const n=e.regex,r=/(?:(?:[a-zA-Z]|\.[._a-zA-Z])[._a-zA-Z0-9]*)|\.(?!\d)/,s=n.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=/[=!<>:]=|\|\||&&|:::?|<-|<<-|->>|->|\|>|[-+*\/?!$&|:<=>@^~]|\*\*/,c=n.either(/[()]/,/[{}]/,/\[\[/,/[[\]]/,/\\/,/,/);return{name:"R",keywords:{$pattern:r,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:n.lookahead(n.either(/\n^#'\s*(?=@[a-zA-Z]+)/,/\n^(?!#')/)),endsParent:!0}},{scope:"doctag",begin:"@param",end:/$/,contains:[{scope:"variable",variants:[{match:r},{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,s]},{scope:{1:"operator",2:"number"},match:[/%[^%]*%/,s]},{scope:{1:"punctuation",2:"number"},match:[c,s]},{scope:{2:"number"},match:[/[^a-zA-Z0-9._]|^/,s]}]},{scope:{3:"operator"},match:[r,/\s+/,/<-/,/\s+/]},{scope:"operator",relevance:0,variants:[{match:a},{match:/%[^%]*%/}]},{scope:"punctuation",relevance:0,match:c},{begin:"`",end:"`",contains:[{begin:/\\./}]}]}}function OC(e){const n=e.regex,r="([a-zA-Z_]\\w*[!?=]?|[-+~]@|<<|>>|=~|===?|<=>|[<>]=?|\\*\\*|[-/+%^&*~`|]|\\[\\]=?)",s=n.either(/\b([A-Z]+[a-z0-9]+)+/,/\b([A-Z]+[a-z0-9]+)+[A-Z]+/),a=n.concat(s,/(::\w+)*/),u={"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"]},f={className:"doctag",begin:"@[A-Za-z]+"},p={begin:"#<",end:">"},m=[e.COMMENT("#","$",{contains:[f]}),e.COMMENT("^=begin","^=end",{contains:[f],relevance:10}),e.COMMENT("^__END__",e.MATCH_NOTHING_RE)],g={className:"subst",begin:/#\{/,end:/\}/,keywords:u},y={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:n.concat(/<<[-~]?'?/,n.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]})]}]},v="[1-9](_?[0-9])*|0",b="[0-9](_?[0-9])*",w={className:"number",relevance:0,variants:[{begin:`\\b(${v})(\\.(${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"}]},_={variants:[{match:/\(\)/},{className:"params",begin:/\(/,end:/(?=\))/,excludeBegin:!0,endsParent:!0,keywords:u}]},M=[y,{variants:[{match:[/class\s+/,a,/\s+<\s+/,a]},{match:[/\b(class|module)\s+/,a]}],scope:{2:"title.class",4:"title.class.inherited"},keywords:u},{match:[/(include|extend)\s+/,a],scope:{2:"title.class"},keywords:u},{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:s,scope:"title.class"},{match:[/def/,/\s+/,r],scope:{1:"keyword",3:"title.function"},contains:[_]},{begin:e.IDENT_RE+"::"},{className:"symbol",begin:e.UNDERSCORE_IDENT_RE+"(!|\\?)?:",relevance:0},{className:"symbol",begin:":(?!\\s)",contains:[y,{begin:r}],relevance:0},w,{className:"variable",begin:"(\\$\\W)|((\\$|@@?)(\\w+))(?=[^@$?])(?![A-Za-z])(?![@$?'])"},{className:"params",begin:/\|(?!=)/,end:/\|/,excludeBegin:!0,excludeEnd:!0,relevance:0,keywords:u},{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(p,m),relevance:0}].concat(p,m);g.contains=M,_.contains=M;const D=[{begin:/^\s*=>/,starts:{end:"$",contains:M}},{className:"meta.prompt",begin:"^("+"[>?]>"+"|"+"[\\w#]+\\(\\w+\\):\\d+:\\d+[>*]"+"|"+"(\\w+-)?\\d+\\.\\d+\\.\\d+(p\\d+)?[^\\d][^>]+>"+")(?=[ ])",starts:{end:"$",keywords:u,contains:M}}];return m.unshift(p),{name:"Ruby",aliases:["rb","gemspec","podspec","thor","irb"],keywords:u,illegal:/\/\*/,contains:[e.SHEBANG({binary:"ruby"})].concat(D).concat(m).concat(M)}}function jC(e){const n=e.regex,r=/(r#)?/,s=n.concat(r,e.UNDERSCORE_IDENT_RE),a=n.concat(r,e.IDENT_RE),c={className:"title.function.invoke",relevance:0,begin:n.concat(/\b/,/(?!let|for|while|if|else|match\b)/,a,n.lookahead(/\s*\(/))},u="([ui](8|16|32|64|128|size)|f(32|64))?",f=["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"],p=["true","false","Some","None","Ok","Err"],m=["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:f,literal:p,built_in:m},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_]+)"+u},{begin:"\\b0o([0-7_]+)"+u},{begin:"\\b0x([A-Fa-f0-9_]+)"+u},{begin:"\\b(\\d[\\d_]*(\\.[0-9_]+)?([eE][+-]?[0-9_]+)?)"+u}],relevance:0},{begin:[/fn/,/\s+/,s],className:{1:"keyword",3:"title.function"}},{className:"meta",begin:"#!?\\[",end:"\\]",contains:[{className:"string",begin:/"/,end:/"/,contains:[e.BACKSLASH_ESCAPE]}]},{begin:[/let/,/\s+/,/(?:mut\s+)?/,s],className:{1:"keyword",3:"keyword",4:"variable"}},{begin:[/for/,/\s+/,s,/\s+/,/in/],className:{1:"keyword",3:"variable",5:"keyword"}},{begin:[/type/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:[/(?:trait|enum|struct|union|impl|for)/,/\s+/,s],className:{1:"keyword",3:"title.class"}},{begin:e.IDENT_RE+"::",keywords:{keyword:"Self",built_in:m,type:g}},{className:"punctuation",begin:"->"},c]}}const LC=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_-]*/}}),DC=["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"],PC=["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"],FC=[...DC,...PC],zC=["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(),BC=["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(),UC=["after","backdrop","before","cue","cue-region","first-letter","first-line","grammar-error","marker","part","placeholder","selection","slotted","spelling-error"].sort().reverse(),$C=["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 HC(e){const n=LC(e),r=UC,s=BC,a="@[a-z-]+",c="and or not only",f={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,n.CSS_NUMBER_MODE,{className:"selector-id",begin:"#[A-Za-z0-9_-]+",relevance:0},{className:"selector-class",begin:"\\.[A-Za-z0-9_-]+",relevance:0},n.ATTRIBUTE_SELECTOR_MODE,{className:"selector-tag",begin:"\\b("+FC.join("|")+")\\b",relevance:0},{className:"selector-pseudo",begin:":("+s.join("|")+")"},{className:"selector-pseudo",begin:":(:)?("+r.join("|")+")"},f,{begin:/\(/,end:/\)/,contains:[n.CSS_NUMBER_MODE]},n.CSS_VARIABLE,{className:"attribute",begin:"\\b("+$C.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:[n.BLOCK_COMMENT,f,n.HEXCOLOR,n.CSS_NUMBER_MODE,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.IMPORTANT,n.FUNCTION_DISPATCH]},{begin:"@(page|font-face)",keywords:{$pattern:a,keyword:"@page @font-face"}},{begin:"@",end:"[{;]",returnBegin:!0,keywords:{$pattern:/[a-z-]+/,keyword:c,attribute:zC.join(" ")},contains:[{begin:a,className:"keyword"},{begin:/[a-z-]+(?=:)/,className:"attribute"},f,e.QUOTE_STRING_MODE,e.APOS_STRING_MODE,n.HEXCOLOR,n.CSS_NUMBER_MODE]},n.FUNCTION_DISPATCH]}}function qC(e){return{name:"Shell Session",aliases:["console","shellsession"],contains:[{className:"meta.prompt",begin:/^\s{0,3}[/~\w\d[\]()@-]*[>%$#][ ]?/,starts:{end:/[^\\](?=\s*$)/,subLanguage:"bash"}}]}}function KC(e){const n=e.regex,r=e.COMMENT("--","$"),s={scope:"string",variants:[{begin:/'/,end:/'/,contains:[{match:/''/}]}]},a={begin:/"/,end:/"/,contains:[{match:/""/}]},c=["true","false","unknown"],u=["double precision","large object","with timezone","without timezone"],f=["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"],p=["add","asc","collation","desc","final","first","last","view"],m=["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"],y=["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"],v=["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,w=[...m,...p].filter(P=>!g.includes(P)),_={scope:"variable",match:/@[a-z0-9][a-z0-9_]*/},E={scope:"operator",match:/[-+*/=%^~]|&&?|\|\|?|!=?|<(?:=>?|<|>)?|>[>=]?/,relevance:0},S={match:n.concat(/\b/,n.either(...b),/\s*\(/),relevance:0,keywords:{built_in:b}};function O(P){return n.concat(/\b/,n.either(...P.map(M=>M.replace(/\s+/,"\\s+"))),/\b/)}const A={scope:"keyword",match:O(v),relevance:0};function G(P,{exceptions:M,when:W}={}){const ee=W;return M=M||[],P.map(oe=>oe.match(/\|\d+$/)||M.includes(oe)?oe:ee(oe)?`${oe}|0`:oe)}return{name:"SQL",case_insensitive:!0,illegal:/[{}]|<\//,keywords:{$pattern:/\b[\w\.]+/,keyword:G(w,{when:P=>P.length<3}),literal:c,type:f,built_in:y},contains:[{scope:"type",match:O(u)},A,S,_,s,a,e.C_NUMBER_MODE,e.C_BLOCK_COMMENT_MODE,r,E]}}function Fy(e){return e?typeof e=="string"?e:e.source:null}function la(e){return wt("(?=",e,")")}function wt(...e){return e.map(r=>Fy(r)).join("")}function WC(e){const n=e[e.length-1];return typeof n=="object"&&n.constructor===Object?(e.splice(e.length-1,1),n):{}}function yn(...e){return"("+(WC(e).capture?"":"?:")+e.map(s=>Fy(s)).join("|")+")"}const Ld=e=>wt(/\b/,e,/\w$/.test(e)?/\b/:/\B/),VC=["Protocol","Type"].map(Ld),bh=["init","self"].map(Ld),GC=["Any","Self"],Ou=["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"],vh=["false","nil","true"],YC=["assignment","associativity","higherThan","left","lowerThan","none","right"],XC=["#colorLiteral","#column","#dsohandle","#else","#elseif","#endif","#error","#file","#fileID","#fileLiteral","#filePath","#function","#if","#imageLiteral","#keyPath","#line","#selector","#sourceLocation","#warning"],wh=["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"],zy=yn(/[/=\-+!*%<>&|^~?]/,/[\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]/),By=yn(zy,/[\u0300-\u036F]/,/[\u1DC0-\u1DFF]/,/[\u20D0-\u20FF]/,/[\uFE00-\uFE0F]/,/[\uFE20-\uFE2F]/),ju=wt(zy,By,"*"),Uy=yn(/[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]/),ol=yn(Uy,/\d/,/[\u0300-\u036F\u1DC0-\u1DFF\u20D0-\u20FF\uFE20-\uFE2F]/),dr=wt(Uy,ol,"*"),Go=wt(/[A-Z]/,ol,"*"),QC=["attached","autoclosure",wt(/convention\(/,yn("swift","block","c"),/\)/),"discardableResult","dynamicCallable","dynamicMemberLookup","escaping","freestanding","frozen","GKInspectable","IBAction","IBDesignable","IBInspectable","IBOutlet","IBSegueAction","inlinable","main","nonobjc","NSApplicationMain","NSCopying","NSManaged",wt(/objc\(/,dr,/\)/),"objc","objcMembers","propertyWrapper","requires_stored_property_inits","resultBuilder","Sendable","testable","UIApplicationMain","unchecked","unknown","usableFromInline","warn_unqualified_access"],ZC=["iOS","iOSApplicationExtension","macOS","macOSApplicationExtension","macCatalyst","macCatalystApplicationExtension","watchOS","watchOSApplicationExtension","tvOS","tvOSApplicationExtension","swift"];function JC(e){const n={match:/\s+/,relevance:0},r=e.COMMENT("/\\*","\\*/",{contains:["self"]}),s=[e.C_LINE_COMMENT_MODE,r],a={match:[/\./,yn(...VC,...bh)],className:{2:"keyword"}},c={match:wt(/\./,yn(...Ou)),relevance:0},u=Ou.filter(Se=>typeof Se=="string").concat(["_|0"]),f=Ou.filter(Se=>typeof Se!="string").concat(GC).map(Ld),p={variants:[{className:"keyword",match:yn(...f,...bh)}]},m={$pattern:yn(/\b\w+/,/#\w+/),keyword:u.concat(XC),literal:vh},g=[a,c,p],y={match:wt(/\./,yn(...wh)),relevance:0},v={className:"built_in",match:wt(/\b/,yn(...wh),/(?=\()/)},b=[y,v],w={match:/->/,relevance:0},_={className:"operator",relevance:0,variants:[{match:ju},{match:`\\.(\\.|${By})+`}]},E=[w,_],S="([0-9]_*)+",O="([0-9a-fA-F]_*)+",A={className:"number",relevance:0,variants:[{match:`\\b(${S})(\\.(${S}))?([eE][+-]?(${S}))?\\b`},{match:`\\b0x(${O})(\\.(${O}))?([pP][+-]?(${S}))?\\b`},{match:/\b0o([0-7]_*)+\b/},{match:/\b0b([01]_*)+\b/}]},G=(Se="")=>({className:"subst",variants:[{match:wt(/\\/,Se,/[0\\tnr"']/)},{match:wt(/\\/,Se,/u\{[0-9a-fA-F]{1,8}\}/)}]}),P=(Se="")=>({className:"subst",match:wt(/\\/,Se,/[\t ]*(?:[\r\n]|\r\n)/)}),M=(Se="")=>({className:"subst",label:"interpol",begin:wt(/\\/,Se,/\(/),end:/\)/}),W=(Se="")=>({begin:wt(Se,/"""/),end:wt(/"""/,Se),contains:[G(Se),P(Se),M(Se)]}),ee=(Se="")=>({begin:wt(Se,/"/),end:wt(/"/,Se),contains:[G(Se),M(Se)]}),oe={className:"string",variants:[W(),W("#"),W("##"),W("###"),ee(),ee("#"),ee("##"),ee("###")]},D=[e.BACKSLASH_ESCAPE,{begin:/\[/,end:/\]/,relevance:0,contains:[e.BACKSLASH_ESCAPE]}],ce={begin:/\/[^\s](?=[^/\n]*\/)/,end:/\//,contains:D},V=Se=>{const tt=wt(Se,/\//),ft=wt(/\//,Se);return{begin:tt,end:ft,contains:[...D,{scope:"comment",begin:`#(?!.*${ft})`,end:/$/}]}},j={scope:"regexp",variants:[V("###"),V("##"),V("#"),ce]},B={match:wt(/`/,dr,/`/)},q={className:"variable",match:/\$\d+/},Z={className:"variable",match:`\\$${ol}+`},ne=[B,q,Z],K={match:/(@|#(un)?)available/,scope:"keyword",starts:{contains:[{begin:/\(/,end:/\)/,keywords:ZC,contains:[...E,A,oe]}]}},ue={scope:"keyword",match:wt(/@/,yn(...QC),la(yn(/\(/,/\s+/)))},C={scope:"meta",match:wt(/@/,dr)},R=[K,ue,C],J={match:la(/\b[A-Z]/),relevance:0,contains:[{className:"type",match:wt(/(AV|CA|CF|CG|CI|CL|CM|CN|CT|MK|MP|MTK|MTL|NS|SCN|SK|UI|WK|XC)/,ol,"+")},{className:"type",match:Go,relevance:0},{match:/[?!]+/,relevance:0},{match:/\.\.\./,relevance:0},{match:wt(/\s+&\s+/,la(Go)),relevance:0}]},T={begin:/</,end:/>/,keywords:m,contains:[...s,...g,...R,w,J]};J.contains.push(T);const X={match:wt(dr,/\s*:/),keywords:"_|0",relevance:0},re={begin:/\(/,end:/\)/,relevance:0,keywords:m,contains:["self",X,...s,j,...g,...b,...E,A,oe,...ne,...R,J]},L={begin:/</,end:/>/,keywords:"repeat each",contains:[...s,J]},$={begin:yn(la(wt(dr,/\s*:/)),la(wt(dr,/\s+/,dr,/\s*:/))),end:/:/,relevance:0,contains:[{className:"keyword",match:/\b_\b/},{className:"params",match:dr}]},H={begin:/\(/,end:/\)/,keywords:m,contains:[$,...s,...g,...E,A,oe,...R,J,re],endsParent:!0,illegal:/["']/},Q={match:[/(func|macro)/,/\s+/,yn(B.match,dr,ju)],className:{1:"keyword",3:"title.function"},contains:[L,H,n],illegal:[/\[/,/%/]},ge={match:[/\b(?:subscript|init[?!]?)/,/\s*(?=[<(])/],className:{1:"keyword"},contains:[L,H,n],illegal:/\[|%/},Pe={match:[/operator/,/\s+/,ju],className:{1:"keyword",3:"title"}},fe={begin:[/precedencegroup/,/\s+/,Go],className:{1:"keyword",3:"title"},contains:[J],keywords:[...YC,...vh],end:/}/},ke={match:[/class\b/,/\s+/,/func\b/,/\s+/,/\b[A-Za-z_][A-Za-z0-9_]*\b/],scope:{1:"keyword",3:"keyword",5:"title.function"}},Ee={match:[/class\b/,/\s+/,/var\b/],scope:{1:"keyword",3:"keyword"}},ve={begin:[/(struct|protocol|class|extension|enum|actor)/,/\s+/,dr,/\s*/],beginScope:{1:"keyword",3:"title.class"},keywords:m,contains:[L,...g,{begin:/:/,end:/\{/,keywords:m,contains:[{scope:"title.class.inherited",match:Go},...g],relevance:0}]};for(const Se of oe.variants){const tt=Se.contains.find(se=>se.label==="interpol");tt.keywords=m;const ft=[...g,...b,...E,A,oe,...ne];tt.contains=[...ft,{begin:/\(/,end:/\)/,contains:["self",...ft]}]}return{name:"Swift",keywords:m,contains:[...s,Q,ge,ke,Ee,ve,Pe,fe,{beginKeywords:"import",end:/$/,contains:[...s],relevance:0},j,...g,...b,...E,A,oe,...ne,...R,J,re]}}const ll="[A-Za-z$_][0-9A-Za-z$_]*",$y=["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"],Hy=["true","false","null","undefined","NaN","Infinity"],qy=["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"],Ky=["Error","EvalError","InternalError","RangeError","ReferenceError","SyntaxError","TypeError","URIError"],Wy=["setInterval","setTimeout","clearInterval","clearTimeout","require","exports","eval","isFinite","isNaN","parseFloat","parseInt","decodeURI","decodeURIComponent","encodeURI","encodeURIComponent","escape","unescape"],Vy=["arguments","this","super","console","window","document","localStorage","sessionStorage","module","global"],Gy=[].concat(Wy,qy,Ky);function eT(e){const n=e.regex,r=(K,{after:ue})=>{const C="</"+K[0].slice(1);return K.input.indexOf(C,ue)!==-1},s=ll,a={begin:"<>",end:"</>"},c=/<[A-Za-z0-9\\._:-]+\s*\/>/,u={begin:/<[A-Za-z0-9\\._:-]+/,end:/\/[A-Za-z0-9\\._:-]+>|\/>/,isTrulyOpeningTag:(K,ue)=>{const C=K[0].length+K.index,R=K.input[C];if(R==="<"||R===","){ue.ignoreMatch();return}R===">"&&(r(K,{after:C})||ue.ignoreMatch());let J;const T=K.input.substring(C);if(J=T.match(/^\s*=/)){ue.ignoreMatch();return}if((J=T.match(/^\s+extends\s+/))&&J.index===0){ue.ignoreMatch();return}}},f={$pattern:ll,keyword:$y,literal:Hy,built_in:Gy,"variable.language":Vy},p="[0-9](_?[0-9])*",m=`\\.(${p})`,g="0|[1-9](_?[0-9])*|0[0-7]*[89][0-9]*",y={className:"number",variants:[{begin:`(\\b(${g})((${m})|\\.)?|(${m}))[eE][+-]?(${p})\\b`},{begin:`\\b(${g})\\b((${m})\\b|\\.)?|(${m})\\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},v={className:"subst",begin:"\\$\\{",end:"\\}",keywords:f,contains:[]},b={begin:".?html`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"xml"}},w={begin:".?css`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"css"}},_={begin:".?gql`",end:"",starts:{end:"`",returnEnd:!1,contains:[e.BACKSLASH_ESCAPE,v],subLanguage:"graphql"}},E={className:"string",begin:"`",end:"`",contains:[e.BACKSLASH_ESCAPE,v]},O={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:s+"(?=\\s*(-)|$)",endsParent:!0,relevance:0},{begin:/(?=[^\n])\s/,relevance:0}]}]}),e.C_BLOCK_COMMENT_MODE,e.C_LINE_COMMENT_MODE]},A=[e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,w,_,E,{match:/\$\d+/},y];v.contains=A.concat({begin:/\{/,end:/\}/,keywords:f,contains:["self"].concat(A)});const G=[].concat(O,v.contains),P=G.concat([{begin:/(\s*)\(/,end:/\)/,keywords:f,contains:["self"].concat(G)}]),M={className:"params",begin:/(\s*)\(/,end:/\)/,excludeBegin:!0,excludeEnd:!0,keywords:f,contains:P},W={variants:[{match:[/class/,/\s+/,s,/\s+/,/extends/,/\s+/,n.concat(s,"(",n.concat(/\./,s),")*")],scope:{1:"keyword",3:"title.class",5:"keyword",7:"title.class.inherited"}},{match:[/class/,/\s+/,s],scope:{1:"keyword",3:"title.class"}}]},ee={relevance:0,match:n.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:{_:[...qy,...Ky]}},oe={label:"use_strict",className:"meta",relevance:10,begin:/^\s*['"]use (strict|asm)['"]/},D={variants:[{match:[/function/,/\s+/,s,/(?=\s*\()/]},{match:[/function/,/\s*(?=\()/]}],className:{1:"keyword",3:"title.function"},label:"func.def",contains:[M],illegal:/%/},ce={relevance:0,match:/\b[A-Z][A-Z_0-9]+\b/,className:"variable.constant"};function V(K){return n.concat("(?!",K.join("|"),")")}const j={match:n.concat(/\b/,V([...Wy,"super","import"].map(K=>`${K}\\s*\\(`)),s,n.lookahead(/\s*\(/)),className:"title.function",relevance:0},B={begin:n.concat(/\./,n.lookahead(n.concat(s,/(?![0-9A-Za-z$_(])/))),end:s,excludeBegin:!0,keywords:"prototype",className:"property",relevance:0},q={match:[/get|set/,/\s+/,s,/(?=\()/],className:{1:"keyword",3:"title.function"},contains:[{begin:/\(\)/},M]},Z="(\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)|"+e.UNDERSCORE_IDENT_RE+")\\s*=>",ne={match:[/const|var|let/,/\s+/,s,/\s*/,/=\s*/,/(async\s*)?/,n.lookahead(Z)],keywords:"async",className:{1:"keyword",3:"title.function"},contains:[M]};return{name:"JavaScript",aliases:["js","jsx","mjs","cjs"],keywords:f,exports:{PARAMS_CONTAINS:P,CLASS_REFERENCE:ee},illegal:/#(?![$_A-z])/,contains:[e.SHEBANG({label:"shebang",binary:"node",relevance:5}),oe,e.APOS_STRING_MODE,e.QUOTE_STRING_MODE,b,w,_,E,O,{match:/\$\d+/},y,ee,{scope:"attr",match:s+n.lookahead(":"),relevance:0},ne,{begin:"("+e.RE_STARTERS_RE+"|\\b(case|return|throw)\\b)\\s*",keywords:"return throw case",relevance:0,contains:[O,e.REGEXP_MODE,{className:"function",begin:Z,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:f,contains:P}]}]},{begin:/,/,relevance:0},{match:/\s+/,relevance:0},{variants:[{begin:a.begin,end:a.end},{match:c},{begin:u.begin,"on:begin":u.isTrulyOpeningTag,end:u.end}],subLanguage:"xml",contains:[{begin:u.begin,end:u.end,skip:!0,contains:["self"]}]}]},D,{beginKeywords:"while if switch catch for"},{begin:"\\b(?!function)"+e.UNDERSCORE_IDENT_RE+"\\([^()]*(\\([^()]*(\\([^()]*\\)[^()]*)*\\)[^()]*)*\\)\\s*\\{",returnBegin:!0,label:"func.def",contains:[M,e.inherit(e.TITLE_MODE,{begin:s,className:"title.function"})]},{match:/\.\.\./,relevance:0},B,{match:"\\$"+s,relevance:0},{match:[/\bconstructor(?=\s*\()/],className:{1:"title.function"},contains:[M]},j,ce,W,q,{match:/\$[(.]/}]}}function tT(e){const n=e.regex,r=eT(e),s=ll,a=["any","void","number","boolean","string","object","never","symbol","bigint","unknown"],c={begin:[/namespace/,/\s+/,e.IDENT_RE],beginScope:{1:"keyword",3:"title.class"}},u={beginKeywords:"interface",end:/\{/,excludeEnd:!0,keywords:{keyword:"interface extends",built_in:a},contains:[r.exports.CLASS_REFERENCE]},f={className:"meta",relevance:10,begin:/^\s*['"]use strict['"]/},p=["type","interface","public","private","protected","implements","declare","abstract","readonly","enum","override","satisfies"],m={$pattern:ll,keyword:$y.concat(p),literal:Hy,built_in:Gy.concat(a),"variable.language":Vy},g={className:"meta",begin:"@"+s},y=(_,E,S)=>{const O=_.contains.findIndex(A=>A.label===E);if(O===-1)throw new Error("can not find mode to replace");_.contains.splice(O,1,S)};Object.assign(r.keywords,m),r.exports.PARAMS_CONTAINS.push(g);const v=r.contains.find(_=>_.scope==="attr"),b=Object.assign({},v,{match:n.concat(s,n.lookahead(/\s*\?:/))});r.exports.PARAMS_CONTAINS.push([r.exports.CLASS_REFERENCE,v,b]),r.contains=r.contains.concat([g,c,u,b]),y(r,"shebang",e.SHEBANG()),y(r,"use_strict",f);const w=r.contains.find(_=>_.label==="func.def");return w.relevance=0,Object.assign(r,{name:"TypeScript",aliases:["ts","tsx","mts","cts"]}),r}function nT(e){const n=e.regex,r={className:"string",begin:/"(""|[^/n])"C\b/},s={className:"string",begin:/"/,end:/"/,illegal:/\n/,contains:[{begin:/""/}]},a=/\d{1,2}\/\d{1,2}\/\d{4}/,c=/\d{4}-\d{1,2}-\d{1,2}/,u=/(\d|1[012])(:\d+){0,2} *(AM|PM)/,f=/\d{1,2}(:\d{1,2}){1,2}/,p={className:"literal",variants:[{begin:n.concat(/# */,n.either(c,a),/ *#/)},{begin:n.concat(/# */,f,/ *#/)},{begin:n.concat(/# */,u,/ *#/)},{begin:n.concat(/# */,n.either(c,a),/ +/,n.either(u,f),/ *#/)}]},m={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+:/},y=e.COMMENT(/'''/,/$/,{contains:[{className:"doctag",begin:/<\/?/,end:/>/}]}),v=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:[r,s,p,m,g,y,v,{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:[v]}]}}function rT(e){e.regex;const n=e.COMMENT(/\(;/,/;\)/);n.contains.push("self");const r=e.COMMENT(/;;/,/$/),s=["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"}},c={className:"variable",begin:/\$[\w_]+/},u={match:/(\((?!;)|\))+/,className:"punctuation",relevance:0},f={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/},p={match:/(i32|i64|f32|f64)(?!\.)/,className:"type"},m={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:s},contains:[r,n,{match:[/(?:offset|align)/,/\s*/,/=/],className:{1:"keyword",3:"operator"}},c,u,a,e.QUOTE_STRING_MODE,p,m,f]}}function iT(e){const n=e.regex,r=n.concat(/[\p{L}_]/u,n.optional(/[\p{L}0-9_.-]*:/u),/[\p{L}0-9_.-]*/u),s=/[\p{L}0-9._:-]+/u,a={className:"symbol",begin:/&[a-z]+;|&#[0-9]+;|&#x[a-f0-9]+;/},c={begin:/\s/,contains:[{className:"keyword",begin:/#?[a-z_][a-z1-9_-]+/,illegal:/\n/}]},u=e.inherit(c,{begin:/\(/,end:/\)/}),f=e.inherit(e.APOS_STRING_MODE,{className:"string"}),p=e.inherit(e.QUOTE_STRING_MODE,{className:"string"}),m={endsWithParent:!0,illegal:/</,relevance:0,contains:[{className:"attr",begin:s,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:[c,p,f,u,{begin:/\[/,end:/\]/,contains:[{className:"meta",begin:/<![a-z]/,end:/>/,contains:[c,u,p,f]}]}]},e.COMMENT(/<!--/,/-->/,{relevance:10}),{begin:/<!\[CDATA\[/,end:/\]\]>/,relevance:10},a,{className:"meta",end:/\?>/,variants:[{begin:/<\?xml/,relevance:10,contains:[p]},{begin:/<\?[a-z][a-z0-9]+/}]},{className:"tag",begin:/<style(?=\s|>)/,end:/>/,keywords:{name:"style"},contains:[m],starts:{end:/<\/style>/,returnEnd:!0,subLanguage:["css","xml"]}},{className:"tag",begin:/<script(?=\s|>)/,end:/>/,keywords:{name:"script"},contains:[m],starts:{end:/<\/script>/,returnEnd:!0,subLanguage:["javascript","handlebars","xml"]}},{className:"tag",begin:/<>|<\/>/},{className:"tag",begin:n.concat(/</,n.lookahead(n.concat(r,n.either(/\/>/,/>/,/\s/)))),end:/\/?>/,contains:[{className:"name",begin:r,relevance:0,starts:m}]},{className:"tag",begin:n.concat(/<\//,n.lookahead(n.concat(r,/>/))),contains:[{className:"name",begin:r,relevance:0},{begin:/>/,relevance:0,endsParent:!0}]}]}}function sT(e){const n="true false yes no null",r="[\\w#;/?:@&=+$,.~*'()[\\]]+",s={className:"attr",variants:[{begin:/[\w*@][\w*@ :()\./-]*:(?=[ \t]|$)/},{begin:/"[\w*@][\w*@ :()\./-]*":(?=[ \t]|$)/},{begin:/'[\w*@][\w*@ :()\./-]*':(?=[ \t]|$)/}]},a={className:"template-variable",variants:[{begin:/\{\{/,end:/\}\}/},{begin:/%\{/,end:/\}/}]},c={className:"string",relevance:0,begin:/'/,end:/'/,contains:[{match:/''/,scope:"char.escape",relevance:0}]},u={className:"string",relevance:0,variants:[{begin:/"/,end:/"/},{begin:/\S+/}],contains:[e.BACKSLASH_ESCAPE,a]},f=e.inherit(u,{variants:[{begin:/'/,end:/'/,contains:[{begin:/''/,relevance:0}]},{begin:/"/,end:/"/},{begin:/[^\s,{}[\]]+/}]}),v={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:n,relevance:0},w={begin:/\{/,end:/\}/,contains:[b],illegal:"\\n",relevance:0},_={begin:"\\[",end:"\\]",contains:[b],illegal:"\\n",relevance:0},E=[s,{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+!"+r},{className:"type",begin:"!<"+r+">"},{className:"type",begin:"!"+r},{className:"type",begin:"!!"+r},{className:"meta",begin:"&"+e.UNDERSCORE_IDENT_RE+"$"},{className:"meta",begin:"\\*"+e.UNDERSCORE_IDENT_RE+"$"},{className:"bullet",begin:"-(?=[ ]|$)",relevance:0},e.HASH_COMMENT_MODE,{beginKeywords:n,keywords:{literal:n}},v,{className:"number",begin:e.C_NUMBER_RE+"\\b",relevance:0},w,_,c,u],S=[...E];return S.pop(),S.push(f),b.contains=S,{name:"YAML",case_insensitive:!0,aliases:["yml"],contains:E}}const aT={arduino:UN,bash:$N,c:HN,cpp:qN,csharp:KN,css:eC,diff:tC,go:nC,graphql:rC,ini:iC,java:sC,javascript:uC,json:dC,kotlin:pC,less:wC,lua:_C,makefile:kC,markdown:EC,objectivec:SC,perl:NC,php:CC,"php-template":TC,plaintext:AC,python:MC,"python-repl":RC,r:IC,ruby:OC,rust:jC,scss:HC,shell:qC,sql:KC,swift:JC,typescript:tT,vbnet:nT,wasm:rT,xml:iT,yaml:sT};var Lu,_h;function oT(){if(_h)return Lu;_h=1;function e(F){return F instanceof Map?F.clear=F.delete=F.set=function(){throw new Error("map is read-only")}:F instanceof Set&&(F.add=F.clear=F.delete=function(){throw new Error("set is read-only")}),Object.freeze(F),Object.getOwnPropertyNames(F).forEach(de=>{const Ce=F[de],Ge=typeof Ce;(Ge==="object"||Ge==="function")&&!Object.isFrozen(Ce)&&e(Ce)}),F}class n{constructor(de){de.data===void 0&&(de.data={}),this.data=de.data,this.isMatchIgnored=!1}ignoreMatch(){this.isMatchIgnored=!0}}function r(F){return F.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">").replace(/"/g,""").replace(/'/g,"'")}function s(F,...de){const Ce=Object.create(null);for(const Ge in F)Ce[Ge]=F[Ge];return de.forEach(function(Ge){for(const Tt in Ge)Ce[Tt]=Ge[Tt]}),Ce}const a="</span>",c=F=>!!F.scope,u=(F,{prefix:de})=>{if(F.startsWith("language:"))return F.replace("language:","language-");if(F.includes(".")){const Ce=F.split(".");return[`${de}${Ce.shift()}`,...Ce.map((Ge,Tt)=>`${Ge}${"_".repeat(Tt+1)}`)].join(" ")}return`${de}${F}`};class f{constructor(de,Ce){this.buffer="",this.classPrefix=Ce.classPrefix,de.walk(this)}addText(de){this.buffer+=r(de)}openNode(de){if(!c(de))return;const Ce=u(de.scope,{prefix:this.classPrefix});this.span(Ce)}closeNode(de){c(de)&&(this.buffer+=a)}value(){return this.buffer}span(de){this.buffer+=`<span class="${de}">`}}const p=(F={})=>{const de={children:[]};return Object.assign(de,F),de};class m{constructor(){this.rootNode=p(),this.stack=[this.rootNode]}get top(){return this.stack[this.stack.length-1]}get root(){return this.rootNode}add(de){this.top.children.push(de)}openNode(de){const Ce=p({scope:de});this.add(Ce),this.stack.push(Ce)}closeNode(){if(this.stack.length>1)return this.stack.pop()}closeAllNodes(){for(;this.closeNode(););}toJSON(){return JSON.stringify(this.rootNode,null,4)}walk(de){return this.constructor._walk(de,this.rootNode)}static _walk(de,Ce){return typeof Ce=="string"?de.addText(Ce):Ce.children&&(de.openNode(Ce),Ce.children.forEach(Ge=>this._walk(de,Ge)),de.closeNode(Ce)),de}static _collapse(de){typeof de!="string"&&de.children&&(de.children.every(Ce=>typeof Ce=="string")?de.children=[de.children.join("")]:de.children.forEach(Ce=>{m._collapse(Ce)}))}}class g extends m{constructor(de){super(),this.options=de}addText(de){de!==""&&this.add(de)}startScope(de){this.openNode(de)}endScope(){this.closeNode()}__addSublanguage(de,Ce){const Ge=de.root;Ce&&(Ge.scope=`language:${Ce}`),this.add(Ge)}toHTML(){return new f(this,this.options).value()}finalize(){return this.closeAllNodes(),!0}}function y(F){return F?typeof F=="string"?F:F.source:null}function v(F){return _("(?=",F,")")}function b(F){return _("(?:",F,")*")}function w(F){return _("(?:",F,")?")}function _(...F){return F.map(Ce=>y(Ce)).join("")}function E(F){const de=F[F.length-1];return typeof de=="object"&&de.constructor===Object?(F.splice(F.length-1,1),de):{}}function S(...F){return"("+(E(F).capture?"":"?:")+F.map(Ge=>y(Ge)).join("|")+")"}function O(F){return new RegExp(F.toString()+"|").exec("").length-1}function A(F,de){const Ce=F&&F.exec(de);return Ce&&Ce.index===0}const G=/\[(?:[^\\\]]|\\.)*\]|\(\??|\\([1-9][0-9]*)|\\./;function P(F,{joinWith:de}){let Ce=0;return F.map(Ge=>{Ce+=1;const Tt=Ce;let Rt=y(Ge),Re="";for(;Rt.length>0;){const Me=G.exec(Rt);if(!Me){Re+=Rt;break}Re+=Rt.substring(0,Me.index),Rt=Rt.substring(Me.index+Me[0].length),Me[0][0]==="\\"&&Me[1]?Re+="\\"+String(Number(Me[1])+Tt):(Re+=Me[0],Me[0]==="("&&Ce++)}return Re}).map(Ge=>`(${Ge})`).join(de)}const M=/\b\B/,W="[a-zA-Z]\\w*",ee="[a-zA-Z_]\\w*",oe="\\b\\d+(\\.\\d+)?",D="(-?)(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)",ce="\\b(0b[01]+)",V="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|-|-=|/=|/|:|;|<<|<<=|<=|<|===|==|=|>>>=|>>=|>=|>>>|>>|>|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~",j=(F={})=>{const de=/^#![ ]*\//;return F.binary&&(F.begin=_(de,/.*\b/,F.binary,/\b.*/)),s({scope:"meta",begin:de,end:/$/,relevance:0,"on:begin":(Ce,Ge)=>{Ce.index!==0&&Ge.ignoreMatch()}},F)},B={begin:"\\\\[\\s\\S]",relevance:0},q={scope:"string",begin:"'",end:"'",illegal:"\\n",contains:[B]},Z={scope:"string",begin:'"',end:'"',illegal:"\\n",contains:[B]},ne={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/},K=function(F,de,Ce={}){const Ge=s({scope:"comment",begin:F,end:de,contains:[]},Ce);Ge.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 Tt=S("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 Ge.contains.push({begin:_(/[ ]+/,"(",Tt,/[.]?[:]?([.][ ]|[ ])/,"){3}")}),Ge},ue=K("//","$"),C=K("/\\*","\\*/"),R=K("#","$"),J={scope:"number",begin:oe,relevance:0},T={scope:"number",begin:D,relevance:0},X={scope:"number",begin:ce,relevance:0},re={scope:"regexp",begin:/\/(?=[^/\n]*\/)/,end:/\/[gimuy]*/,contains:[B,{begin:/\[/,end:/\]/,relevance:0,contains:[B]}]},L={scope:"title",begin:W,relevance:0},$={scope:"title",begin:ee,relevance:0},H={begin:"\\.\\s*"+ee,relevance:0};var ge=Object.freeze({__proto__:null,APOS_STRING_MODE:q,BACKSLASH_ESCAPE:B,BINARY_NUMBER_MODE:X,BINARY_NUMBER_RE:ce,COMMENT:K,C_BLOCK_COMMENT_MODE:C,C_LINE_COMMENT_MODE:ue,C_NUMBER_MODE:T,C_NUMBER_RE:D,END_SAME_AS_BEGIN:function(F){return Object.assign(F,{"on:begin":(de,Ce)=>{Ce.data._beginMatch=de[1]},"on:end":(de,Ce)=>{Ce.data._beginMatch!==de[1]&&Ce.ignoreMatch()}})},HASH_COMMENT_MODE:R,IDENT_RE:W,MATCH_NOTHING_RE:M,METHOD_GUARD:H,NUMBER_MODE:J,NUMBER_RE:oe,PHRASAL_WORDS_MODE:ne,QUOTE_STRING_MODE:Z,REGEXP_MODE:re,RE_STARTERS_RE:V,SHEBANG:j,TITLE_MODE:L,UNDERSCORE_IDENT_RE:ee,UNDERSCORE_TITLE_MODE:$});function Pe(F,de){F.input[F.index-1]==="."&&de.ignoreMatch()}function fe(F,de){F.className!==void 0&&(F.scope=F.className,delete F.className)}function ke(F,de){de&&F.beginKeywords&&(F.begin="\\b("+F.beginKeywords.split(" ").join("|")+")(?!\\.)(?=\\b|\\s)",F.__beforeBegin=Pe,F.keywords=F.keywords||F.beginKeywords,delete F.beginKeywords,F.relevance===void 0&&(F.relevance=0))}function Ee(F,de){Array.isArray(F.illegal)&&(F.illegal=S(...F.illegal))}function ve(F,de){if(F.match){if(F.begin||F.end)throw new Error("begin & end are not supported with match");F.begin=F.match,delete F.match}}function Se(F,de){F.relevance===void 0&&(F.relevance=1)}const tt=(F,de)=>{if(!F.beforeMatch)return;if(F.starts)throw new Error("beforeMatch cannot be used with starts");const Ce=Object.assign({},F);Object.keys(F).forEach(Ge=>{delete F[Ge]}),F.keywords=Ce.keywords,F.begin=_(Ce.beforeMatch,v(Ce.begin)),F.starts={relevance:0,contains:[Object.assign(Ce,{endsParent:!0})]},F.relevance=0,delete Ce.beforeMatch},ft=["of","and","for","in","not","or","if","then","parent","list","value"],se="keyword";function je(F,de,Ce=se){const Ge=Object.create(null);return typeof F=="string"?Tt(Ce,F.split(" ")):Array.isArray(F)?Tt(Ce,F):Object.keys(F).forEach(function(Rt){Object.assign(Ge,je(F[Rt],de,Rt))}),Ge;function Tt(Rt,Re){de&&(Re=Re.map(Me=>Me.toLowerCase())),Re.forEach(function(Me){const $e=Me.split("|");Ge[$e[0]]=[Rt,le($e[0],$e[1])]})}}function le(F,de){return de?Number(de):pe(F)?0:1}function pe(F){return ft.includes(F.toLowerCase())}const ze={},st=F=>{console.error(F)},Et=(F,...de)=>{console.log(`WARN: ${F}`,...de)},ae=(F,de)=>{ze[`${F}/${de}`]||(console.log(`Deprecated as of ${F}. ${de}`),ze[`${F}/${de}`]=!0)},xe=new Error;function Be(F,de,{key:Ce}){let Ge=0;const Tt=F[Ce],Rt={},Re={};for(let Me=1;Me<=de.length;Me++)Re[Me+Ge]=Tt[Me],Rt[Me+Ge]=!0,Ge+=O(de[Me-1]);F[Ce]=Re,F[Ce]._emit=Rt,F[Ce]._multi=!0}function Ze(F){if(Array.isArray(F.begin)){if(F.skip||F.excludeBegin||F.returnBegin)throw st("skip, excludeBegin, returnBegin not compatible with beginScope: {}"),xe;if(typeof F.beginScope!="object"||F.beginScope===null)throw st("beginScope must be object"),xe;Be(F,F.begin,{key:"beginScope"}),F.begin=P(F.begin,{joinWith:""})}}function lt(F){if(Array.isArray(F.end)){if(F.skip||F.excludeEnd||F.returnEnd)throw st("skip, excludeEnd, returnEnd not compatible with endScope: {}"),xe;if(typeof F.endScope!="object"||F.endScope===null)throw st("endScope must be object"),xe;Be(F,F.end,{key:"endScope"}),F.end=P(F.end,{joinWith:""})}}function St(F){F.scope&&typeof F.scope=="object"&&F.scope!==null&&(F.beginScope=F.scope,delete F.scope)}function Wt(F){St(F),typeof F.beginScope=="string"&&(F.beginScope={_wrap:F.beginScope}),typeof F.endScope=="string"&&(F.endScope={_wrap:F.endScope}),Ze(F),lt(F)}function tn(F){function de(Re,Me){return new RegExp(y(Re),"m"+(F.case_insensitive?"i":"")+(F.unicodeRegex?"u":"")+(Me?"g":""))}class Ce{constructor(){this.matchIndexes={},this.regexes=[],this.matchAt=1,this.position=0}addRule(Me,$e){$e.position=this.position++,this.matchIndexes[this.matchAt]=$e,this.regexes.push([$e,Me]),this.matchAt+=O(Me)+1}compile(){this.regexes.length===0&&(this.exec=()=>null);const Me=this.regexes.map($e=>$e[1]);this.matcherRe=de(P(Me,{joinWith:"|"}),!0),this.lastIndex=0}exec(Me){this.matcherRe.lastIndex=this.lastIndex;const $e=this.matcherRe.exec(Me);if(!$e)return null;const $t=$e.findIndex((ir,Ar)=>Ar>0&&ir!==void 0),Nt=this.matchIndexes[$t];return $e.splice(0,$t),Object.assign($e,Nt)}}class Ge{constructor(){this.rules=[],this.multiRegexes=[],this.count=0,this.lastIndex=0,this.regexIndex=0}getMatcher(Me){if(this.multiRegexes[Me])return this.multiRegexes[Me];const $e=new Ce;return this.rules.slice(Me).forEach(([$t,Nt])=>$e.addRule($t,Nt)),$e.compile(),this.multiRegexes[Me]=$e,$e}resumingScanAtSamePosition(){return this.regexIndex!==0}considerAll(){this.regexIndex=0}addRule(Me,$e){this.rules.push([Me,$e]),$e.type==="begin"&&this.count++}exec(Me){const $e=this.getMatcher(this.regexIndex);$e.lastIndex=this.lastIndex;let $t=$e.exec(Me);if(this.resumingScanAtSamePosition()&&!($t&&$t.index===this.lastIndex)){const Nt=this.getMatcher(0);Nt.lastIndex=this.lastIndex+1,$t=Nt.exec(Me)}return $t&&(this.regexIndex+=$t.position+1,this.regexIndex===this.count&&this.considerAll()),$t}}function Tt(Re){const Me=new Ge;return Re.contains.forEach($e=>Me.addRule($e.begin,{rule:$e,type:"begin"})),Re.terminatorEnd&&Me.addRule(Re.terminatorEnd,{type:"end"}),Re.illegal&&Me.addRule(Re.illegal,{type:"illegal"}),Me}function Rt(Re,Me){const $e=Re;if(Re.isCompiled)return $e;[fe,ve,Wt,tt].forEach(Nt=>Nt(Re,Me)),F.compilerExtensions.forEach(Nt=>Nt(Re,Me)),Re.__beforeBegin=null,[ke,Ee,Se].forEach(Nt=>Nt(Re,Me)),Re.isCompiled=!0;let $t=null;return typeof Re.keywords=="object"&&Re.keywords.$pattern&&(Re.keywords=Object.assign({},Re.keywords),$t=Re.keywords.$pattern,delete Re.keywords.$pattern),$t=$t||/\w+/,Re.keywords&&(Re.keywords=je(Re.keywords,F.case_insensitive)),$e.keywordPatternRe=de($t,!0),Me&&(Re.begin||(Re.begin=/\B|\b/),$e.beginRe=de($e.begin),!Re.end&&!Re.endsWithParent&&(Re.end=/\B|\b/),Re.end&&($e.endRe=de($e.end)),$e.terminatorEnd=y($e.end)||"",Re.endsWithParent&&Me.terminatorEnd&&($e.terminatorEnd+=(Re.end?"|":"")+Me.terminatorEnd)),Re.illegal&&($e.illegalRe=de(Re.illegal)),Re.contains||(Re.contains=[]),Re.contains=[].concat(...Re.contains.map(function(Nt){return mr(Nt==="self"?Re:Nt)})),Re.contains.forEach(function(Nt){Rt(Nt,$e)}),Re.starts&&Rt(Re.starts,Me),$e.matcher=Tt($e),$e}if(F.compilerExtensions||(F.compilerExtensions=[]),F.contains&&F.contains.includes("self"))throw new Error("ERR: contains `self` is not supported at the top-level of a language. See documentation.");return F.classNameAliases=s(F.classNameAliases||{}),Rt(F)}function vn(F){return F?F.endsWithParent||vn(F.starts):!1}function mr(F){return F.variants&&!F.cachedVariants&&(F.cachedVariants=F.variants.map(function(de){return s(F,{variants:null},de)})),F.cachedVariants?F.cachedVariants:vn(F)?s(F,{starts:F.starts?s(F.starts):null}):Object.isFrozen(F)?s(F):F}var Vt="11.11.1";class Fn extends Error{constructor(de,Ce){super(de),this.name="HTMLInjectionError",this.html=Ce}}const nn=r,Ri=s,Ii=Symbol("nomatch"),Tr=7,hr=function(F){const de=Object.create(null),Ce=Object.create(null),Ge=[];let Tt=!0;const Rt="Could not find the language '{}', did you forget to load/include a language module?",Re={disableAutodetect:!0,name:"Plain text",contains:[]};let Me={ignoreUnescapedHTML:!1,throwUnescapedHTML:!1,noHighlightRe:/^(no-?highlight)$/i,languageDetectRe:/\blang(?:uage)?-([\w-]+)\b/i,classPrefix:"hljs-",cssSelector:"pre code",languages:null,__emitter:g};function $e(we){return Me.noHighlightRe.test(we)}function $t(we){let Ue=we.className+" ";Ue+=we.parentNode?we.parentNode.className:"";const nt=Me.languageDetectRe.exec(Ue);if(nt){const ct=Xn(nt[1]);return ct||(Et(Rt.replace("{}",nt[1])),Et("Falling back to no-highlight mode for this block.",we)),ct?nt[1]:"no-highlight"}return Ue.split(/\s+/).find(ct=>$e(ct)||Xn(ct))}function Nt(we,Ue,nt){let ct="",zt="";typeof Ue=="object"?(ct=we,nt=Ue.ignoreIllegals,zt=Ue.language):(ae("10.7.0","highlight(lang, code, ...args) has been deprecated."),ae("10.7.0",`Please use highlight(code, options) instead.
|
|
443
|
-
https://github.com/highlightjs/highlight.js/issues/2277`),zt=we,ct=Ue),nt===void 0&&(nt=!0);const jt={code:ct,language:zt};ni("before:highlight",jt);const sr=jt.result?jt.result:ir(jt.language,jt.code,nt);return sr.code=jt.code,ni("after:highlight",sr),sr}function ir(we,Ue,nt,ct){const zt=Object.create(null);function jt(Ne,Ie){return Ne.keywords[Ie]}function sr(){if(!Xe.keywords){Bt.addText(bt);return}let Ne=0;Xe.keywordPatternRe.lastIndex=0;let Ie=Xe.keywordPatternRe.exec(bt),We="";for(;Ie;){We+=bt.substring(Ne,Ie.index);const dt=zn.case_insensitive?Ie[0].toLowerCase():Ie[0],Pt=jt(Xe,dt);if(Pt){const[Xt,Al]=Pt;if(Bt.addText(We),We="",zt[dt]=(zt[dt]||0)+1,zt[dt]<=Tr&&(si+=Al),Xt.startsWith("_"))We+=Ie[0];else{const Pa=zn.classNameAliases[Xt]||Xt;mn(Ie[0],Pa)}}else We+=Ie[0];Ne=Xe.keywordPatternRe.lastIndex,Ie=Xe.keywordPatternRe.exec(bt)}We+=bt.substring(Ne),Bt.addText(We)}function Li(){if(bt==="")return;let Ne=null;if(typeof Xe.subLanguage=="string"){if(!de[Xe.subLanguage]){Bt.addText(bt);return}Ne=ir(Xe.subLanguage,bt,!0,Cs[Xe.subLanguage]),Cs[Xe.subLanguage]=Ne._top}else Ne=ti(bt,Xe.subLanguage.length?Xe.subLanguage:null);Xe.relevance>0&&(si+=Ne.relevance),Bt.__addSublanguage(Ne._emitter,Ne.language)}function pn(){Xe.subLanguage!=null?Li():sr(),bt=""}function mn(Ne,Ie){Ne!==""&&(Bt.startScope(Ie),Bt.addText(Ne),Bt.endScope())}function ri(Ne,Ie){let We=1;const dt=Ie.length-1;for(;We<=dt;){if(!Ne._emit[We]){We++;continue}const Pt=zn.classNameAliases[Ne[We]]||Ne[We],Xt=Ie[We];Pt?mn(Xt,Pt):(bt=Xt,sr(),bt=""),We++}}function Mr(Ne,Ie){return Ne.scope&&typeof Ne.scope=="string"&&Bt.openNode(zn.classNameAliases[Ne.scope]||Ne.scope),Ne.beginScope&&(Ne.beginScope._wrap?(mn(bt,zn.classNameAliases[Ne.beginScope._wrap]||Ne.beginScope._wrap),bt=""):Ne.beginScope._multi&&(ri(Ne.beginScope,Ie),bt="")),Xe=Object.create(Ne,{parent:{value:Xe}}),Xe}function ii(Ne,Ie,We){let dt=A(Ne.endRe,We);if(dt){if(Ne["on:end"]){const Pt=new n(Ne);Ne["on:end"](Ie,Pt),Pt.isMatchIgnored&&(dt=!1)}if(dt){for(;Ne.endsParent&&Ne.parent;)Ne=Ne.parent;return Ne}}if(Ne.endsWithParent)return ii(Ne.parent,Ie,We)}function Cl(Ne){return Xe.matcher.regexIndex===0?(bt+=Ne[0],1):(Or=!0,0)}function Tl(Ne){const Ie=Ne[0],We=Ne.rule,dt=new n(We),Pt=[We.__beforeBegin,We["on:begin"]];for(const Xt of Pt)if(Xt&&(Xt(Ne,dt),dt.isMatchIgnored))return Cl(Ie);return We.skip?bt+=Ie:(We.excludeBegin&&(bt+=Ie),pn(),!We.returnBegin&&!We.excludeBegin&&(bt=Ie)),Mr(We,Ne),We.returnBegin?0:Ie.length}function Ss(Ne){const Ie=Ne[0],We=Ue.substring(Ne.index),dt=ii(Xe,Ne,We);if(!dt)return Ii;const Pt=Xe;Xe.endScope&&Xe.endScope._wrap?(pn(),mn(Ie,Xe.endScope._wrap)):Xe.endScope&&Xe.endScope._multi?(pn(),ri(Xe.endScope,Ne)):Pt.skip?bt+=Ie:(Pt.returnEnd||Pt.excludeEnd||(bt+=Ie),pn(),Pt.excludeEnd&&(bt=Ie));do Xe.scope&&Bt.closeNode(),!Xe.skip&&!Xe.subLanguage&&(si+=Xe.relevance),Xe=Xe.parent;while(Xe!==dt.parent);return dt.starts&&Mr(dt.starts,Ne),Pt.returnEnd?0:Ie.length}function Da(){const Ne=[];for(let Ie=Xe;Ie!==zn;Ie=Ie.parent)Ie.scope&&Ne.unshift(Ie.scope);Ne.forEach(Ie=>Bt.openNode(Ie))}let Rr={};function Ir(Ne,Ie){const We=Ie&&Ie[0];if(bt+=Ne,We==null)return pn(),0;if(Rr.type==="begin"&&Ie.type==="end"&&Rr.index===Ie.index&&We===""){if(bt+=Ue.slice(Ie.index,Ie.index+1),!Tt){const dt=new Error(`0 width match regex (${we})`);throw dt.languageName=we,dt.badRule=Rr.rule,dt}return 1}if(Rr=Ie,Ie.type==="begin")return Tl(Ie);if(Ie.type==="illegal"&&!nt){const dt=new Error('Illegal lexeme "'+We+'" for mode "'+(Xe.scope||"<unnamed>")+'"');throw dt.mode=Xe,dt}else if(Ie.type==="end"){const dt=Ss(Ie);if(dt!==Ii)return dt}if(Ie.type==="illegal"&&We==="")return bt+=`
|
|
444
|
-
`,1;if(ai>1e5&&ai>Ie.index*3)throw new Error("potential infinite loop, way more iterations than matches");return bt+=We,We.length}const zn=Xn(we);if(!zn)throw st(Rt.replace("{}",we)),new Error('Unknown language: "'+we+'"');const Ns=tn(zn);let mt="",Xe=ct||Ns;const Cs={},Bt=new Me.__emitter(Me);Da();let bt="",si=0,ar=0,ai=0,Or=!1;try{if(zn.__emitTokens)zn.__emitTokens(Ue,Bt);else{for(Xe.matcher.considerAll();;){ai++,Or?Or=!1:Xe.matcher.considerAll(),Xe.matcher.lastIndex=ar;const Ne=Xe.matcher.exec(Ue);if(!Ne)break;const Ie=Ue.substring(ar,Ne.index),We=Ir(Ie,Ne);ar=Ne.index+We}Ir(Ue.substring(ar))}return Bt.finalize(),mt=Bt.toHTML(),{language:we,value:mt,relevance:si,illegal:!1,_emitter:Bt,_top:Xe}}catch(Ne){if(Ne.message&&Ne.message.includes("Illegal"))return{language:we,value:nn(Ue),illegal:!0,relevance:0,_illegalBy:{message:Ne.message,index:ar,context:Ue.slice(ar-100,ar+100),mode:Ne.mode,resultSoFar:mt},_emitter:Bt};if(Tt)return{language:we,value:nn(Ue),illegal:!1,relevance:0,errorRaised:Ne,_emitter:Bt,_top:Xe};throw Ne}}function Ar(we){const Ue={value:nn(we),illegal:!1,relevance:0,_top:Re,_emitter:new Me.__emitter(Me)};return Ue._emitter.addText(we),Ue}function ti(we,Ue){Ue=Ue||Me.languages||Object.keys(de);const nt=Ar(we),ct=Ue.filter(Xn).filter(La).map(pn=>ir(pn,we,!1));ct.unshift(nt);const zt=ct.sort((pn,mn)=>{if(pn.relevance!==mn.relevance)return mn.relevance-pn.relevance;if(pn.language&&mn.language){if(Xn(pn.language).supersetOf===mn.language)return 1;if(Xn(mn.language).supersetOf===pn.language)return-1}return 0}),[jt,sr]=zt,Li=jt;return Li.secondBest=sr,Li}function El(we,Ue,nt){const ct=Ue&&Ce[Ue]||nt;we.classList.add("hljs"),we.classList.add(`language-${ct}`)}function _s(we){let Ue=null;const nt=$t(we);if($e(nt))return;if(ni("before:highlightElement",{el:we,language:nt}),we.dataset.highlighted){console.log("Element previously highlighted. To highlight again, first unset `dataset.highlighted`.",we);return}if(we.children.length>0&&(Me.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(we)),Me.throwUnescapedHTML))throw new Fn("One of your code blocks includes unescaped HTML.",we.innerHTML);Ue=we;const ct=Ue.textContent,zt=nt?Nt(ct,{language:nt,ignoreIllegals:!0}):ti(ct);we.innerHTML=zt.value,we.dataset.highlighted="yes",El(we,nt,zt.language),we.result={language:zt.language,re:zt.relevance,relevance:zt.relevance},zt.secondBest&&(we.secondBest={language:zt.secondBest.language,relevance:zt.secondBest.relevance}),ni("after:highlightElement",{el:we,result:zt,text:ct})}function Sl(we){Me=Ri(Me,we)}const yr=()=>{Oi(),ae("10.6.0","initHighlighting() deprecated. Use highlightAll() now.")};function Ma(){Oi(),ae("10.6.0","initHighlightingOnLoad() deprecated. Use highlightAll() now.")}let ks=!1;function Oi(){function we(){Oi()}if(document.readyState==="loading"){ks||window.addEventListener("DOMContentLoaded",we,!1),ks=!0;return}document.querySelectorAll(Me.cssSelector).forEach(_s)}function Ra(we,Ue){let nt=null;try{nt=Ue(F)}catch(ct){if(st("Language definition for '{}' could not be registered.".replace("{}",we)),Tt)st(ct);else throw ct;nt=Re}nt.name||(nt.name=we),de[we]=nt,nt.rawDefinition=Ue.bind(null,F),nt.aliases&&ja(nt.aliases,{languageName:we})}function Ia(we){delete de[we];for(const Ue of Object.keys(Ce))Ce[Ue]===we&&delete Ce[Ue]}function Oa(){return Object.keys(de)}function Xn(we){return we=(we||"").toLowerCase(),de[we]||de[Ce[we]]}function ja(we,{languageName:Ue}){typeof we=="string"&&(we=[we]),we.forEach(nt=>{Ce[nt.toLowerCase()]=Ue})}function La(we){const Ue=Xn(we);return Ue&&!Ue.disableAutodetect}function Ot(we){we["before:highlightBlock"]&&!we["before:highlightElement"]&&(we["before:highlightElement"]=Ue=>{we["before:highlightBlock"](Object.assign({block:Ue.el},Ue))}),we["after:highlightBlock"]&&!we["after:highlightElement"]&&(we["after:highlightElement"]=Ue=>{we["after:highlightBlock"](Object.assign({block:Ue.el},Ue))})}function Nl(we){Ot(we),Ge.push(we)}function Es(we){const Ue=Ge.indexOf(we);Ue!==-1&&Ge.splice(Ue,1)}function ni(we,Ue){const nt=we;Ge.forEach(function(ct){ct[nt]&&ct[nt](Ue)})}function ji(we){return ae("10.7.0","highlightBlock will be removed entirely in v12.0"),ae("10.7.0","Please use highlightElement now."),_s(we)}Object.assign(F,{highlight:Nt,highlightAuto:ti,highlightAll:Oi,highlightElement:_s,highlightBlock:ji,configure:Sl,initHighlighting:yr,initHighlightingOnLoad:Ma,registerLanguage:Ra,unregisterLanguage:Ia,listLanguages:Oa,getLanguage:Xn,registerAliases:ja,autoDetection:La,inherit:Ri,addPlugin:Nl,removePlugin:Es}),F.debugMode=function(){Tt=!1},F.safeMode=function(){Tt=!0},F.versionString=Vt,F.regex={concat:_,lookahead:v,either:S,optional:w,anyNumberOfTimes:b};for(const we in ge)typeof ge[we]=="object"&&e(ge[we]);return Object.assign(F,ge),F},gr=hr({});return gr.newInstance=()=>hr({}),Lu=gr,gr.HighlightJS=gr,gr.default=gr,Lu}var lT=oT();const cT=wa(lT),kh={},uT="hljs-";function dT(e){const n=cT.newInstance();return e&&c(e),{highlight:r,highlightAuto:s,listLanguages:a,register:c,registerAlias:u,registered:f};function r(p,m,g){const y=g||kh,v=typeof y.prefix=="string"?y.prefix:uT;if(!n.getLanguage(p))throw new Error("Unknown language: `"+p+"` is not registered");n.configure({__emitter:fT,classPrefix:v});const b=n.highlight(m,{ignoreIllegals:!0,language:p});if(b.errorRaised)throw new Error("Could not highlight with `Highlight.js`",{cause:b.errorRaised});const w=b._emitter.root,_=w.data;return _.language=b.language,_.relevance=b.relevance,w}function s(p,m){const y=(m||kh).subset||a();let v=-1,b=0,w;for(;++v<y.length;){const _=y[v];if(!n.getLanguage(_))continue;const E=r(_,p,m);E.data&&E.data.relevance!==void 0&&E.data.relevance>b&&(b=E.data.relevance,w=E)}return w||{type:"root",children:[],data:{language:void 0,relevance:b}}}function a(){return n.listLanguages()}function c(p,m){if(typeof p=="string")n.registerLanguage(p,m);else{let g;for(g in p)Object.hasOwn(p,g)&&n.registerLanguage(g,p[g])}}function u(p,m){if(typeof p=="string")n.registerAliases(typeof m=="string"?m:[...m],{languageName:p});else{let g;for(g in p)if(Object.hasOwn(p,g)){const y=p[g];n.registerAliases(typeof y=="string"?y:[...y],{languageName:g})}}}function f(p){return!!n.getLanguage(p)}}class fT{constructor(n){this.options=n,this.root={type:"root",children:[],data:{language:void 0,relevance:0}},this.stack=[this.root]}addText(n){if(n==="")return;const r=this.stack[this.stack.length-1],s=r.children[r.children.length-1];s&&s.type==="text"?s.value+=n:r.children.push({type:"text",value:n})}startScope(n){this.openNode(String(n))}endScope(){this.closeNode()}__addSublanguage(n,r){const s=this.stack[this.stack.length-1],a=n.root.children;r?s.children.push({type:"element",tagName:"span",properties:{className:[r]},children:a}):s.children.push(...a)}openNode(n){const r=this,s=n.split(".").map(function(u,f){return f?u+"_".repeat(f):r.options.classPrefix+u}),a=this.stack[this.stack.length-1],c={type:"element",tagName:"span",properties:{className:s},children:[]};a.children.push(c),this.stack.push(c)}closeNode(){this.stack.pop()}finalize(){}toHTML(){return""}}const pT={};function mT(e){const n=e||pT,r=n.aliases,s=n.detect||!1,a=n.languages||aT,c=n.plainText,u=n.prefix,f=n.subset;let p="hljs";const m=dT(a);if(r&&m.registerAlias(r),u){const g=u.indexOf("-");p=g===-1?u:u.slice(0,g)}return function(g,y){wl(g,"element",function(v,b,w){if(v.tagName!=="code"||!w||w.type!=="element"||w.tagName!=="pre")return;const _=hT(v);if(_===!1||!_&&!s||_&&c&&c.includes(_))return;Array.isArray(v.properties.className)||(v.properties.className=[]),v.properties.className.includes(p)||v.properties.className.unshift(p);const E=ON(v,{whitespace:"pre"});let S;try{S=_?m.highlight(_,E,{prefix:u}):m.highlightAuto(E,{prefix:u,subset:f})}catch(O){const A=O;if(_&&/Unknown language/.test(A.message)){y.message("Cannot highlight as `"+_+"`, it’s not registered",{ancestors:[w,v],cause:A,place:v.position,ruleId:"missing-language",source:"rehype-highlight"});return}throw A}!_&&S.data&&S.data.language&&v.properties.className.push("language-"+S.data.language),S.children.length>0&&(v.children=S.children)})}}function hT(e){const n=e.properties.className;let r=-1;if(!Array.isArray(n))return;let s;for(;++r<n.length;){const a=String(n[r]);if(a==="no-highlight"||a==="nohighlight")return!1;!s&&a.slice(0,5)==="lang-"&&(s=a.slice(5)),!s&&a.slice(0,9)==="language-"&&(s=a.slice(9))}return s}function gT({content:e}){return l.jsx("div",{className:"message-card__content",children:l.jsx(pE,{remarkPlugins:[NN],rehypePlugins:[mT],children:e})})}const cl=N.memo(gT);function yT({view:e}){const n=yt(),r=e.level,s=r==="fatal"?Iv:r==="error"?bv:r==="warning"?ka:Ev,a=r==="fatal"?"chat.system.fatal":r==="error"?"chat.system.error":r==="warning"?"chat.system.warning":"chat.system.info";return l.jsxs("div",{className:`system-message system-message--${r}${r==="fatal"?" system-message--emphasis":""}`,role:r==="error"||r==="fatal"?"alert":"status","data-testid":"system-message","data-level":r,children:[l.jsxs("div",{className:"system-message__head",children:[l.jsx(s,{size:15,className:"system-message__icon","aria-hidden":"true"}),l.jsx("span",{className:"system-message__label",children:n(a)}),e.agent?l.jsx("span",{className:"system-message__agent",children:e.agent}):null]}),l.jsx("p",{className:"system-message__text",children:e.message}),e.details?l.jsxs("details",{className:"system-message__details",children:[l.jsx("summary",{children:n("chat.system.details")}),l.jsx("pre",{children:e.details})]}):null]})}function xT({view:e,onSubmit:n}){const r=yt(),[s,a]=N.useState(""),c=e.answer!==void 0,u=N.useMemo(()=>typeof e.timeoutSec=="number"&&e.timeoutSec>0?Math.floor(e.timeoutSec):null,[e.timeoutSec]),[f,p]=N.useState(u);N.useEffect(()=>{if(c||u===null)return;p(u);const v=window.setInterval(()=>{p(b=>b===null?b:b<=1?(window.clearInterval(v),0):b-1)},1e3);return()=>window.clearInterval(v)},[c,u]);const m=f===0,g=c||m,y=v=>{const b=Hw(e,v,{answered:c,timedOut:m});b&&n(b.requestId,b.answer)};return c?l.jsxs("div",{className:"ask-user ask-user--answered","data-testid":"ask-user","data-request-id":e.requestId,children:[l.jsxs("div",{className:"ask-user__head",children:[l.jsx(yv,{size:15,className:"ask-user__icon","aria-hidden":"true"}),l.jsx("span",{className:"ask-user__title",children:e.agent})]}),l.jsx("p",{className:"ask-user__question",children:e.question}),l.jsx("p",{className:"ask-user__answer",children:r("chat.ask.answered",{answer:e.answer??""})})]}):l.jsxs("div",{className:"ask-user","data-testid":"ask-user","data-request-id":e.requestId,children:[l.jsxs("div",{className:"ask-user__head",children:[l.jsx(xv,{size:15,className:"ask-user__icon","aria-hidden":"true"}),l.jsx("span",{className:"ask-user__title",children:r("chat.ask.title")}),l.jsx("span",{className:"ask-user__agent",children:e.agent}),f!==null?l.jsx("span",{className:"ask-user__timer",children:m?r("chat.ask.timedOut"):r("chat.ask.timeoutLeft",{sec:f})}):null]}),l.jsx("p",{className:"ask-user__question",children:e.question}),e.options&&e.options.length>0?l.jsx("div",{className:"ask-user__options",children:e.options.map(v=>l.jsx("button",{type:"button",className:"ask-user__option",disabled:g,onClick:()=>y(v),children:v},v))}):null,e.allowFreeText||!e.options||e.options.length===0?l.jsxs("form",{className:"ask-user__free",onSubmit:v=>{v.preventDefault(),y(s)},children:[l.jsx("input",{className:"ask-user__input",type:"text",value:s,disabled:g,placeholder:r("chat.ask.freeTextPlaceholder"),onChange:v=>a(v.target.value),"aria-label":e.question}),l.jsx("button",{type:"submit",className:"ask-user__submit",disabled:g||s.trim()==="",children:r("chat.ask.submit")})]}):null]})}function bT({view:e,onCancel:n}){const r=yt(),s=e.cancelled===!0,a=N.useMemo(()=>qw(e),[e]),[c,u]=N.useState(a);return N.useEffect(()=>{if(s||a<=0)return;u(a);const f=window.setInterval(()=>{u(p=>p<=1?(window.clearInterval(f),0):p-1)},1e3);return()=>window.clearInterval(f)},[s,a]),l.jsxs("div",{className:`auto-retry${s?" auto-retry--cancelled":""}`,role:"status","data-testid":"auto-retry",children:[l.jsx(Dv,{size:14,className:"auto-retry__icon","aria-hidden":"true"}),l.jsxs("div",{className:"auto-retry__body",children:[l.jsx("span",{className:"auto-retry__title",children:r("chat.retry.title")}),l.jsx("span",{className:"auto-retry__attempt",children:r("chat.retry.attempt",{attempt:e.attempt,max:e.maxAttempts})}),s?l.jsx("span",{className:"auto-retry__status",children:r("chat.retry.cancelled")}):c>0?l.jsx("span",{className:"auto-retry__countdown",children:r("chat.retry.countdown",{sec:c})}):null]}),s?null:l.jsxs("button",{type:"button",className:"auto-retry__cancel",onClick:n,"aria-label":r("chat.retry.cancel"),children:[l.jsx(Dn,{size:13,"aria-hidden":"true"}),r("chat.retry.cancel")]})]})}function vT(e){return!(e.role==="user"||e.kind==="error"||e.kind==="hook"||e.kind==="status")}function wT(e){return e.agent||(e.role==="system"?"system":"principal")}function Eh(e){e<0&&(e=0);const n=e/1e3;if(n<60)return`${n.toFixed(1)}s`;const r=Math.floor(n/60),s=Math.floor(n%60);return`${r}m ${String(s).padStart(2,"0")}s`}function _T({messages:e,autoScroll:n=!1,showToolbarCount:r=!0,showTiming:s=!1,className:a,ariaLabel:c,onAskUserSubmit:u,onRetryCancel:f,runningAgents:p}){const m=yt(),[g,y]=N.useState(null),v=N.useRef(null),b=N.useRef(!0),w=N.useMemo(()=>t_(e,p),[e,p]),_=N.useMemo(()=>{const j=new Set;let B=null;for(const q of w)if(q.type==="single"&&vT(q.message)){const Z=wT(q.message);B===Z&&j.add(q.message.id),B=Z}else B=null;return j},[w]),E=N.useMemo(()=>{for(let j=e.length-1;j>=0;j--){const B=e[j];if(B.streaming&&B.role!=="user")return B.id}return null},[e]),S=N.useRef(new Map),[,O]=N.useState(0),A=E!==null;N.useEffect(()=>{if(!s)return;const j=S.current;for(const B of e){if(B.role==="user"||B.kind==="hook")continue;const q=B.createdAt?Date.parse(B.createdAt):NaN,Z=j.get(B.id);Z?Z.end===null&&!B.streaming&&(Z.end=Date.now()):j.set(B.id,{start:Number.isNaN(q)?Date.now():q,end:B.streaming?null:Date.now()})}},[e,s]),N.useEffect(()=>{if(!s||!A)return;const j=window.setInterval(()=>O(B=>B+1),1e3);return()=>window.clearInterval(j)},[s,A]);const G=N.useMemo(()=>{if(!s||A)return null;let j=1/0,B=-1/0;for(const q of e){const Z=S.current.get(q.id);!Z||Z.end===null||(Z.start<j&&(j=Z.start),Z.end>B&&(B=Z.end))}return j===1/0||B<=j?null:B-j},[e,s,A]),P=j=>{if(!s)return null;const B=S.current.get(j.id);if(!B)return null;const q=B.end??Date.now();return Eh(q-B.start)};N.useEffect(()=>{if(!n)return;const j=v.current;!j||!b.current||(j.scrollTop=j.scrollHeight)},[e,n]);const M=()=>{const j=v.current;if(!j)return;const B=j.scrollHeight-j.scrollTop-j.clientHeight;b.current=B<24},W=async(j,B)=>{const q=()=>{y(j),setTimeout(()=>y(Z=>Z===j?null:Z),2e3)};try{if(navigator.clipboard&&window.isSecureContext){await navigator.clipboard.writeText(B),q();return}}catch{}try{const Z=document.createElement("textarea");Z.value=B,Z.style.position="fixed",Z.style.top="0",Z.style.left="0",Z.style.width="1px",Z.style.height="1px",Z.style.padding="0",Z.style.border="none",Z.style.outline="none",Z.style.boxShadow="none",Z.style.background="transparent",Z.setAttribute("readonly",""),document.body.appendChild(Z),Z.select(),Z.setSelectionRange(0,B.length);const ne=document.execCommand("copy");document.body.removeChild(Z),ne&&q()}catch{}},ee=j=>{const B=g===j.id;return l.jsx("button",{className:`message-card__copy ${B?"is-copied":""}`,onClick:q=>{q.stopPropagation(),W(j.id,j.content||"")},title:m(B?"chat.copied":"chat.copy"),"aria-label":m(B?"chat.copied":"chat.aria.copyMessage"),type:"button",children:B?l.jsx(gs,{size:12}):l.jsx(vv,{size:12})})},oe=(j,B,q=!1)=>{const Z=j,ne=Z.charAt(0).toUpperCase()||"·";return q?l.jsx("div",{className:"message-avatar message-avatar--ghost","aria-hidden":"true"}):l.jsx("div",{className:`message-avatar ${B?"message-avatar--expert":""}`,"aria-hidden":"true",title:Z,children:ne})},D=(j,B=!1)=>{if(j.kind==="system_message"&&j.systemMessage)return l.jsx(yT,{view:j.systemMessage},j.id);if(j.kind==="ask_user"&&j.askUser)return l.jsx(xT,{view:j.askUser,onSubmit:(C,R)=>u==null?void 0:u(C,R)},j.id);if(j.kind==="auto_retry"&&j.autoRetry)return l.jsx(bT,{view:j.autoRetry,onCancel:()=>f==null?void 0:f()},j.id);if(j.kind==="hook"){const C=j.hookLevel==="error"?"❌":j.hookLevel==="warning"?"⚠️":j.hookLevel==="debug"?"·":"🪝";return l.jsx("div",{className:`message-hook message-hook--${j.hookLevel??"info"}`,children:l.jsxs("details",{children:[l.jsxs("summary",{children:[l.jsxs("span",{className:"message-hook__label",children:[C," hook · ",j.hookFamily??"?"," · ",j.hookPhase??"?",j.agent?` · ${j.agent}`:""]}),l.jsx("span",{className:"message-hook__text",children:j.content})]}),j.hookData&&Object.keys(j.hookData).length>0?l.jsx("pre",{children:JSON.stringify(j.hookData,null,2)}):null]})},j.id)}if(j.role==="user")return l.jsxs("div",{className:"message-row message-row--user",children:[l.jsx("div",{className:"message-bubble",children:j.content||(j.streaming?m("chat.generating"):"")}),l.jsx("div",{className:"message-row__user-actions",children:ee(j)})]},j.id);const q=j.role==="assistant"&&!!j.agent&&j.agent!=="principal",Z=j.agent||(j.role==="system"?"system":"principal"),ne=j.id===E,K=P(j),ue=j.kind==="error"?l.jsx("p",{className:"message-card__content--plain message-row__error",children:j.content||(j.streaming?m("chat.generating"):"")}):l.jsx(cl,{content:j.content||(j.streaming?m("chat.generating"):"")});return l.jsxs("div",{className:`message-row message-row--${j.role} ${q?"message-row--expert":""} ${B?"message-row--continuation":""} ${ne?"message-row--live":""}`,children:[oe(Z,q,B),l.jsxs("div",{className:"message-row__body",children:[B?null:l.jsxs("div",{className:"message-row__head",children:[l.jsx("span",{className:`message-row__name ${q?"message-row__name--expert":""}`,children:Z}),K?l.jsxs("span",{className:"message-row__timer",children:["· ",K]}):null,j.streaming?l.jsx("span",{className:"message-row__streaming",children:m("chat.streaming")}):null,ee(j)]}),ue]})]},j.id)},ce=j=>{const B=!!j.agent&&j.agent!=="principal";return j.kind==="tool"?l.jsx("div",{className:"activity-step",children:l.jsxs("details",{children:[l.jsxs("summary",{children:[B?l.jsx("span",{className:"message-card__agent-badge",children:j.agent}):null,j.content||m("chat.toolPrefix",{name:j.toolName||"tool"})]}),j.toolInput!==void 0&&j.toolInput!==""?l.jsx("pre",{children:JSON.stringify(j.toolInput,null,2)}):null,j.toolResult!==void 0?l.jsx("pre",{children:JSON.stringify(j.toolResult,null,2)}):null]})},j.id):j.kind==="thinking"?l.jsx("div",{className:"activity-step",children:l.jsx("p",{className:"message-card__content--plain",children:j.reasoning||j.content})},j.id):l.jsxs("div",{className:"activity-step",children:[B?l.jsx("span",{className:"message-card__agent-badge",children:j.agent}):null,l.jsx(cl,{content:j.content||(j.streaming?m("chat.generating"):"")})]},j.id)},V=(j,B)=>{if(!B)return m("chat.thinkingSteps",{count:j.length});const q=j[j.length-1];if((q==null?void 0:q.kind)==="tool")return m("chat.toolCall",{name:q.toolName||"tool"});const Z=((q==null?void 0:q.reasoning)||(q==null?void 0:q.content)||"").trim();return Z?Z.length>80?`${Z.slice(0,80)}…`:Z:m("chat.thinking")};return l.jsxs("div",{className:`message-stack ${a??""}`,"aria-label":c??m("chat.aria.messages"),onScroll:M,ref:v,children:[r?l.jsx("div",{className:"message-stack__toolbar",children:l.jsx("span",{children:m("chat.messageCount",{count:e.length})})}):null,w.map(j=>j.type==="single"?D(j.message,_.has(j.message.id)):l.jsx("div",{className:"activity-block",children:l.jsxs("details",{children:[l.jsxs("summary",{className:"activity-summary","aria-label":m("chat.aria.expandThinking"),children:[j.streaming?l.jsx("span",{className:"activity-summary__dot"}):null,l.jsx(Yh,{size:14,className:"activity-summary__chevron","aria-hidden":"true"}),l.jsx("span",{className:"activity-summary__subtitle",children:V(j.steps,j.streaming)})]}),l.jsx("div",{className:"activity-steps",children:j.steps.map(ce)})]})},j.id)),G!==null?l.jsx("div",{className:"message-stack__total",role:"status",children:m("chat.totalTime",{time:Eh(G)})}):null]})}const Yy=N.memo(_T);function kT(){var L,$;const e=yt(),[n,r]=N.useState([]),[s,a]=N.useState(null),[c,u]=N.useState(""),f=["/compact","/context","/cost"],[p,m]=N.useState(f),[g,y]=N.useState(!1),v=N.useRef(null),b=N.useRef(null),[w,_]=N.useState(null),{status:E,currentSandbox:S,reloadConfig:O}=Ti(),[A,G]=N.useState(null),{currentSession:P,messages:M,isSending:W,error:ee,sendPrompt:oe,isConnected:D,isDraft:ce,agents:V,agentFilters:j,interruptCurrent:B,respondToInput:q,messageFilters:Z}=Nr(),ne=E==="running"&&!W&&(D||ce),K=N.useMemo(()=>{const H=M.filter(Q=>{if(Q.role==="user")return!0;const ge=Q.agent||"principal",Pe=j[ge];return Pe?!(Pe.hideMessages&&Q.kind!=="tool"&&Q.kind!=="hook"||Pe.hideTools&&Q.kind==="tool"||Pe.hideHooks&&Q.kind==="hook"):!0});return Lw(H,Z)},[M,j,Z]),ue=K.length>0,C=V.some(H=>H.status==="running"),R=((L=K[K.length-1])==null?void 0:L.role)==="assistant"&&(($=K[K.length-1])==null?void 0:$.streaming),J=N.useMemo(()=>new Set(V.filter(H=>H.status==="running").map(H=>H.name)),[V]);N.useEffect(()=>{let H=!1;return Ve.ui.promptSuggestions().then(Q=>{H||r(Q)}),()=>{H=!0}},[]),N.useEffect(()=>{let H=!1;if(!P){m(f);return}return Ve.sessions.commands(P.id).then(Q=>{H||Q.commands.length>0&&m(Q.commands)}).catch(()=>{H||m(f)}),()=>{H=!0}},[P==null?void 0:P.id]),N.useEffect(()=>{const H=Q=>{v.current&&!v.current.contains(Q.target)&&y(!1)};return document.addEventListener("mousedown",H),()=>document.removeEventListener("mousedown",H)},[]),N.useLayoutEffect(()=>{if(!g||!v.current||!b.current)return;const H=v.current.getBoundingClientRect(),Q=b.current.getBoundingClientRect();_({top:H.top-Q.height-6,left:H.left})},[g]),N.useEffect(()=>{if(!g)return;const H=()=>y(!1);return window.addEventListener("resize",H),()=>{window.removeEventListener("resize",H)}},[g]),N.useEffect(()=>{let H=!1;const Q=async()=>{try{const[ge,Pe,fe]=await Promise.all([Ve.providers.getActive(),Ve.settings.get(),Ve.providers.health().catch(()=>[])]);if(H)return;let ke=ge;if(ke&&fe.length>0){const Ee=ke.id,ve=fe.find(Se=>Se.id===Ee);ve&&(ke={...ke,healthStatus:ve.healthStatus,healthCheckedAt:ve.healthCheckedAt,modelHealth:ve.modelHealth})}a(ke),u(Ee=>Ee&&(ke!=null&&ke.models.includes(Ee))?Ee:Pe.model&&(ke!=null&&ke.models.includes(Pe.model))?Pe.model:(ke==null?void 0:ke.models[0])??"")}catch{H||(a(null),u(""))}};return Q(),window.addEventListener("provider-profiles-updated",Q),()=>{H=!0,window.removeEventListener("provider-profiles-updated",Q)}},[]),N.useEffect(()=>{const H=async()=>{try{const[ge,Pe]=await Promise.all([Ve.providers.getActive(),Ve.providers.health().catch(()=>[])]);let fe=ge;if(fe&&Pe.length>0){const ke=fe.id,Ee=Pe.find(ve=>ve.id===ke);Ee&&(fe={...fe,healthStatus:Ee.healthStatus,healthCheckedAt:Ee.healthCheckedAt,modelHealth:Ee.modelHealth})}a(fe),u(ke=>ke&&(fe!=null&&fe.models.includes(ke))?ke:(fe==null?void 0:fe.models[0])??"")}catch{}},Q=window.setInterval(()=>void H(),3e4);return()=>window.clearInterval(Q)},[]);const T=(P==null?void 0:P.id)??(ce?bg:null),X=async H=>{if(H.preventDefault(),!T)return;const Q=Qr.get(T).trim();!Q||!ne||(Qr.set(T,""),await oe(Q,{providerId:s==null?void 0:s.id,modelId:c||void 0}))},re=H=>{T&&Qr.set(T,H)};return l.jsx("section",{className:`prompt-home ${ue?"prompt-home--active":""}`,"aria-labelledby":"prompt-heading",children:l.jsxs("div",{className:"prompt-home__inner",children:[ue?null:l.jsx("h1",{id:"prompt-heading",children:(P==null?void 0:P.title)??e("chat.heading")}),ue?l.jsx(Yy,{messages:K,autoScroll:!0,showTiming:!0,runningAgents:J,onAskUserSubmit:(H,Q)=>void q(H,Q),onRetryCancel:()=>void B()}):null,C||R?l.jsxs("div",{className:"agent-running-toast",role:"status","aria-live":"polite",children:[l.jsx("span",{className:"agent-running-toast__dot"}),l.jsx("span",{className:"agent-running-toast__label",children:e("chat.agentThinking")}),l.jsxs("button",{className:"agent-running-toast__stop",type:"button",onClick:()=>void B(),"aria-label":e("chat.aria.stop"),title:e("chat.aria.stop"),children:[l.jsx(Uv,{size:10,fill:"currentColor"}),l.jsx("span",{children:e("chat.stop")})]})]}):null,l.jsxs("form",{className:"composer","aria-label":e("chat.aria.newPrompt"),onSubmit:X,children:[l.jsx(Zw,{sessionId:T,placeholder:e("chat.placeholder"),ariaLabel:e("chat.srAsk")}),l.jsxs("div",{className:"composer__toolbar",children:[l.jsxs("div",{className:"composer__tools",children:[l.jsx(xt,{label:e("chat.aria.attachContext"),children:l.jsx(hl,{size:18})}),p.length>0&&l.jsxs("div",{className:"command-picker",ref:v,children:[l.jsx(xt,{label:e("chat.command"),onClick:()=>y(H=>!H),className:`command-trigger ${g?"is-active":""}`,children:l.jsx("span",{children:e("chat.command")})}),g&&l.jsx("div",{className:"command-picker__menu",ref:b,style:w?{top:w.top,left:w.left}:{top:-9999,left:-9999},children:p.map(H=>l.jsx("button",{className:"command-picker__option",type:"button",onClick:()=>{re(H),y(!1)},children:H},H))})]})]}),l.jsxs("div",{className:"composer__send-tools",children:[l.jsx(ms,{ariaLabel:e("chat.modelPlaceholder"),className:"model-select",disabled:!S||!s||s.models.length===0,onChange:async H=>{u(H),G(null);try{await Ve.settings.update({model:H})}catch(Q){const ge=Q instanceof Error?Q.message:String(Q);console.error("Failed to save model selection",Q),G(e("chat.error.saveModel",{msg:ge}));return}try{await O()}catch(Q){const ge=Q instanceof Error?Q.message:String(Q);console.error("Failed to reload config after model change",Q),G(e("chat.error.reloadConfig",{msg:ge}))}},options:(s==null?void 0:s.models.map(H=>{var Pe;const Q=(Pe=s.modelHealth)==null?void 0:Pe.find(fe=>fe.model===H),ge=(Q==null?void 0:Q.status)??"unknown";return{value:H,label:H,indicator:l.jsx("span",{className:`model-status-dot model-status-dot--${ge}`,title:(Q==null?void 0:Q.error)??ge})}}))??[],placeholder:e("chat.modelPlaceholder"),title:s?e("chat.providerTitle",{name:s.name}):e("chat.noActiveProvider"),value:c}),l.jsx(xt,{label:e("chat.aria.voice"),children:l.jsx(Cv,{size:17})}),l.jsx(xt,{label:e("chat.aria.attachFile"),children:l.jsx(Lv,{size:17})}),l.jsx(Jw,{sessionId:T,canSend:ne,label:e("chat.aria.send")})]})]})]}),ee?l.jsx("p",{className:"composer-status composer-status--error",children:ee}):null,A?l.jsx("p",{className:"composer-status composer-status--error",children:A}):null,ne?null:l.jsx("p",{className:"composer-status",children:e(E!=="running"?"chat.status.startSandbox":D?"chat.status.preparing":"chat.status.connecting")}),!ue&&n.length>0?l.jsx("div",{className:"suggestions","aria-label":e("chat.aria.suggested"),children:n.map(H=>l.jsxs("button",{className:"suggestion-row",onClick:()=>re(H),type:"button",children:[l.jsx(ml,{size:15}),l.jsx("span",{children:H})]},H))}):null]})})}function ET(e){return e.replace(/[\\/:*?"<>|]+/g,"-")}function ul(e,n){const r=URL.createObjectURL(e),s=document.createElement("a");s.href=r,s.download=ET(n),document.body.appendChild(s),s.click(),s.remove(),window.setTimeout(()=>URL.revokeObjectURL(r),1e3)}const Dd=1024*1024,Du=50*Dd;function Ta(e){return/\.(png|jpg|jpeg|gif|webp|svg)$/i.test(e)?"image":/\.pdf$/i.test(e)?"pdf":/\.(md|txt|py|yaml|yml|csv|json|ts|tsx|js|jsx|css|html|xml|toml|ini|log)$/i.test(e)?"text":"download"}function _l(e){return/\.(md|markdown)$/i.test(e)}function ST(e){var s;const n=((s=e.split(".").pop())==null?void 0:s.toLowerCase())??"";return{py:"python",ts:"typescript",tsx:"typescript",js:"javascript",jsx:"javascript",json:"json",yaml:"yaml",yml:"yaml",css:"css",html:"xml",xml:"xml",toml:"ini",ini:"ini"}[n]??"plaintext"}function Xy(e){if(e===0)return"-";const n=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1),s=e/1024**r;return`${s>=10?s.toFixed(0):s.toFixed(1)} ${n[r]}`}function NT(e){return e?new Intl.DateTimeFormat("en",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}).format(new Date(e*1e3)):"-"}function CT(e){var s;const n=((s=e.split(".").pop())==null?void 0:s.toLowerCase())??"";return{png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",gif:"image/gif",webp:"image/webp",svg:"image/svg+xml",pdf:"application/pdf",md:"text/markdown",markdown:"text/markdown",txt:"text/plain",csv:"text/csv",json:"application/json",yaml:"text/yaml",yml:"text/yaml",py:"text/x-python",ts:"text/typescript",tsx:"text/typescript",js:"text/javascript",jsx:"text/javascript",css:"text/css",html:"text/html",xml:"application/xml",toml:"text/plain",ini:"text/plain",log:"text/plain"}[n]??"application/octet-stream"}const TT=2e5;function AT(e){let n=0;const r=e.match(/`+/g);if(r)for(const s of r)n=Math.max(n,s.length);return"`".repeat(Math.max(3,n+1))}function Sh({text:e,onDownload:n,isDownloading:r,t:s}){return l.jsxs("div",{className:"file-preview__notice",children:[l.jsx("p",{children:e}),n?l.jsx("button",{className:"file-preview__download",disabled:r,onClick:()=>n(),type:"button",children:s(r?"files.preview.downloading":"files.preview.download")}):null]})}function Qy({name:e,source:n,renderMarkdown:r,error:s,t:a,onDownload:c,isDownloading:u}){if(n.kind==="tooLarge")return l.jsx(Sh,{text:a("files.preview.tooLarge"),onDownload:c,isDownloading:u,t:a});if(n.kind==="unreadable")return l.jsxs("p",{className:"file-preview__notice",children:[a("files.preview.unreadable"),n.detail?l.jsxs("small",{className:"file-preview__notice-detail",children:[" · ",n.detail]}):null]});if(n.kind==="image")return l.jsx("div",{className:"file-preview__media",children:s?l.jsx("p",{children:s}):n.blobUrl?l.jsx("img",{alt:e,src:n.blobUrl}):l.jsx("p",{children:a("files.preview.loadingImage")})});if(n.kind==="pdf")return l.jsx("div",{className:"file-preview__media",children:s?l.jsx("p",{children:s}):n.blobUrl?l.jsx("iframe",{src:n.blobUrl,title:e}):l.jsx("p",{children:a("files.preview.loadingPdf")})});if(n.kind==="download")return l.jsx(Sh,{text:a("files.preview.notPreviewable"),onDownload:c,isDownloading:u,t:a});if(r&&_l(e))return l.jsx("div",{className:"file-preview__markdown",children:l.jsx(cl,{content:n.text})});const f=ST(e);if(f!=="plaintext"&&n.text.length<=TT){const p=AT(n.text);return l.jsx("div",{className:"file-preview__markdown file-preview__code",children:l.jsx(cl,{content:`${p}${f}
|
|
445
|
-
${n.text}
|
|
446
|
-
${p}`})})}return l.jsx("pre",{className:"file-preview__content",children:l.jsx("code",{children:n.text})})}function Zy(e){return e?new Date(e).toLocaleString():"-"}function Jy(e){return e==="done"||e==="completed"?"trace.status.done":e==="in_progress"?"trace.status.running":null}function va(e){return e==="completed"?"done":e}function hs(e){return e.nodeType||e.type||"step"}function MT(e,n=26){if(!e)return"";let r=0,s=0;for(const a of e){if(r+=a.charCodeAt(0)>127?2:1,r>n)return e.slice(0,s)+"…";s++}return e}function RT(e){return e===void 0?"-":e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`}const ex={necessitated_by:"needed by",used:"used",produced:"produced",comparison_with:"compared with"},IT={data:"data",code:"code",text:"text",image:"image",figure:"figure",result:"result",doc:"doc",config:"config",dir:"dir",model:"model",log:"log",report:"report",paper:"paper"};function OT(e,n){const r=new Map(e.map(_=>[_.id,_])),s=new Map,a=_=>{if(s.has(_.id))return s.get(_.id);if(_.parentIds.length===0)return s.set(_.id,0),0;const E=1+Math.max(..._.parentIds.map(S=>{const O=r.get(S);return O?a(O):0}));return s.set(_.id,E),E},c=new Map;for(const _ of e){const E=a(_);c.set(E,[...c.get(E)??[],_])}const u=n==="LR"?200:214,f=72,p=n==="LR"?300:170,m=n==="LR"?140:260,g=Math.max(1,...Array.from(c.values()).map(_=>_.length)),y=n==="LR"?62:80,v=e.map(_=>{const E=a(_),S=c.get(E)??[],O=S.findIndex(W=>W.id===_.id),A=(g-S.length)*m/2,G=y+A+O*m,P=n==="LR"?72+E*p:G,M=n==="LR"?G:62+E*p;return{node:_,x:P,y:M}}),b=Math.max(220,...v.map(_=>_.x+u)),w=Math.max(180,...v.map(_=>_.y+f));return{positioned:v,byId:new Map(v.map(_=>[_.node.id,_])),nodeWidth:u,nodeHeight:f,width:Math.max(720,b+96),height:Math.max(360,w+76)}}function tx({nodes:e,direction:n,selectedNodeId:r,onSelectNode:s,zoom:a,onZoomChange:c,fitToken:u,emptyLabel:f,zoomLabels:p}){const[m,g]=N.useState(new Map),y=N.useRef(null),v=N.useRef(null),b=N.useRef(null),w=N.useRef({isDragging:!1,startX:0,startY:0,scrollLeft:0,scrollTop:0,hasPanned:!1}),_=N.useMemo(()=>OT(e,n),[n,e]),E=N.useMemo(()=>{if(m.size===0)return _;const P=_.positioned.map(W=>{const ee=m.get(W.node.id);return ee?{...W,x:W.x+ee.dx,y:W.y+ee.dy}:W}),M=new Map(P.map(W=>[W.node.id,W]));return{..._,positioned:P,byId:M}},[_,m]);v.current=E;const S=Math.round(a*100),O=()=>c(Math.min(2,Number((a+.1).toFixed(2)))),A=()=>c(Math.max(.05,Number((a-.1).toFixed(2)))),G=()=>c(1);return N.useEffect(()=>{if(u===void 0||!y.current)return;const P=v.current;if(!P||P.positioned.length===0)return;const M=y.current,W=80,ee=P.positioned.map(R=>R.x),oe=P.positioned.map(R=>R.y),D=Math.min(...ee)-W,ce=Math.min(...oe)-W,V=Math.max(...ee.map(R=>R+P.nodeWidth))+W,j=Math.max(...oe.map(R=>R+P.nodeHeight))+W,B=V-D,q=j-ce,Z=M.clientWidth,ne=M.clientHeight,K=Math.min(Z/B,ne/q,1.5),ue=Math.max(.05,Number(K.toFixed(2)));Math.abs(ue-a)>.06&&c(ue);const C=Math.abs(ue-a)>.06?ue:a;requestAnimationFrame(()=>{if(!y.current)return;const R=y.current,J=(D+V)/2*C-Z/2,T=(ce+j)/2*C-ne/2;R.scrollTo({left:Math.max(0,J),top:Math.max(0,T),behavior:"smooth"})})},[u]),N.useEffect(()=>{const P=W=>{if(!b.current)return;const{nodeId:ee,startClientX:oe,startClientY:D,startDx:ce,startDy:V}=b.current,j=ce+(W.clientX-oe)/a,B=V+(W.clientY-D)/a;g(q=>{const Z=new Map(q);return Z.set(ee,{dx:j,dy:B}),Z})},M=()=>{b.current=null};return window.addEventListener("mousemove",P),window.addEventListener("mouseup",M),()=>{window.removeEventListener("mousemove",P),window.removeEventListener("mouseup",M)}},[a]),e.length===0?l.jsx("p",{className:"trace-empty",children:f??""}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"trace-zoom-controls","aria-label":p==null?void 0:p.controls,children:[l.jsx("button",{disabled:a<=.05,onClick:A,type:"button","aria-label":p==null?void 0:p.zoomOut,children:l.jsx(Mv,{size:13})}),l.jsxs("span",{children:[S,"%"]}),l.jsx("button",{disabled:a>=2,onClick:O,type:"button","aria-label":p==null?void 0:p.zoomIn,children:l.jsx(hl,{size:13})}),l.jsx("button",{disabled:a===1,onClick:G,type:"button","aria-label":p==null?void 0:p.reset,children:l.jsx(ag,{size:11})})]}),l.jsx("div",{ref:y,className:"trace-map__viewport",onMouseDown:P=>{const M=P.currentTarget;w.current={isDragging:!0,startX:P.clientX,startY:P.clientY,scrollLeft:M.scrollLeft,scrollTop:M.scrollTop,hasPanned:!1}},onMouseMove:P=>{if(!w.current.isDragging)return;const M=P.clientX-w.current.startX,W=P.clientY-w.current.startY;(Math.abs(M)>3||Math.abs(W)>3)&&(w.current.hasPanned=!0);const ee=P.currentTarget;ee.scrollLeft=w.current.scrollLeft-M,ee.scrollTop=w.current.scrollTop-W},onMouseUp:()=>{w.current.isDragging=!1},onMouseLeave:()=>{w.current.isDragging=!1},onWheel:P=>{if(P.preventDefault(),P.deltaY===0)return;const M=P.deltaY>0?-.1:.1;c(Math.max(.05,Math.min(2,Number((a+M).toFixed(2)))))},children:l.jsxs("svg",{height:E.height*a,viewBox:`0 0 ${E.width} ${E.height}`,width:E.width*a,role:"img",children:[l.jsx("defs",{children:l.jsx("marker",{id:"trace-arrow",markerHeight:"8",markerWidth:"8",orient:"auto",refX:"7",refY:"4",children:l.jsx("path",{d:"M 0 0 L 8 4 L 0 8 z"})})}),E.positioned.flatMap(({node:P})=>P.parents.map(M=>{const W=E.byId.get(M.id),ee=E.byId.get(P.id);if(!W||!ee)return null;const oe=n==="LR",D=W.x+(oe?E.nodeWidth:E.nodeWidth/2),ce=W.y+(oe?E.nodeHeight/2:E.nodeHeight),V=ee.x+(oe?0:E.nodeWidth/2),j=ee.y+(oe?E.nodeHeight/2:0),B=oe?`M ${D} ${ce} C ${D+54} ${ce}, ${V-54} ${j}, ${V} ${j}`:`M ${D} ${ce} C ${D} ${ce+42}, ${V} ${j-42}, ${V} ${j}`,q=(D+V)/2,Z=(ce+j)/2,ne=M.relation?ex[M.relation]||M.relation:"",K=Math.max(48,ne.length*5.5+10);return l.jsxs("g",{className:`trace-edge trace-edge--${M.relation||"necessitated_by"}`,children:[l.jsx("path",{d:B}),M.relation?l.jsxs("g",{className:"trace-edge-label",children:[l.jsx("rect",{x:q-K/2,y:Z-14,width:K,height:13,rx:4}),l.jsx("text",{x:q,y:Z-7,children:ne})]}):null]},`${M.id}-${P.id}`)})),E.positioned.map(({node:P,x:M,y:W})=>{var ee;return l.jsxs("g",{className:`trace-map-node trace-map-node--${hs(P)} trace-map-node--${va(P.status)} ${r===P.id?"is-selected":""} ${((ee=b.current)==null?void 0:ee.nodeId)===P.id?"is-dragging":""}`,onMouseDown:oe=>{oe.stopPropagation();const D=m.get(P.id)||{dx:0,dy:0};b.current={nodeId:P.id,startClientX:oe.clientX,startClientY:oe.clientY,startDx:D.dx,startDy:D.dy}},onClick:()=>{w.current.hasPanned||b.current||s(P.id)},style:{transform:`translate(${M}px, ${W}px)`},children:[l.jsx("rect",{height:E.nodeHeight,rx:"8",width:E.nodeWidth}),l.jsx("circle",{className:`trace-node__dot--${va(P.status)}`,cx:"16",cy:"24",r:"4"}),l.jsx("text",{className:"trace-map-node__title",x:"28",y:"26",children:MT(P.title)}),l.jsx("text",{className:"trace-map-node__meta",x:"28",y:"44",children:P.agent||hs(P)}),l.jsx("text",{className:"trace-map-node__kind",x:"28",y:"58",children:hs(P)})]},P.id)})]})})]})}const nx="neuro-demo-bundle",jT=1,Nh=2*1024*1024,Ch=25*1024*1024;function LT(e){if(!e||typeof e!="object")return!1;const n=e;return n.format===nx&&typeof n.version=="number"&&typeof n.session=="object"&&n.session!==null&&typeof n.trace=="object"&&n.trace!==null&&Array.isArray(n.files)}function DT(e){return e.startsWith("/workspace")?e:`/workspace/${e.replace(/^\/+/,"").replace(/^\.\//,"")}`}async function PT(e){const n=new Uint8Array(await e.arrayBuffer());let r="";const s=32768;for(let a=0;a<n.length;a+=s)r+=String.fromCharCode(...n.subarray(a,a+s));return btoa(r)}function Th(e){return new TextEncoder().encode(e).length}async function FT(e,n,r,s){const a=[];let c=0,u=0;for(const f of n){u+=1,r==null||r(`packing ${u}/${n.length}: ${f.split("/").pop()??f}`);const p=DT(f),m=p.split("/").pop()??p,g=CT(m),y=Ta(m)==="text";if(!e){a.push({path:f,mime:g,encoding:y?"utf8":"base64",size:0,truncated:!0,reason:"unreadable",detail:s});continue}try{if(y){const v=await Ve.sandbox.readFile(e,p),b=v.size??Th(v.content),w=Th(v.content);if(b>Nh||c+w>Ch){a.push({path:f,mime:g,encoding:"utf8",size:b,truncated:!0,reason:"tooLarge"});continue}c+=w,a.push({path:f,mime:g,encoding:"utf8",size:b,truncated:!1,data:v.content})}else{const v=await Ve.sandbox.readRawFile(e,p),b=v.size;if(b>Nh){a.push({path:f,mime:g,encoding:"base64",size:b,truncated:!0,reason:"tooLarge"});continue}const w=await PT(v);if(c+w.length>Ch){a.push({path:f,mime:g,encoding:"base64",size:b,truncated:!0,reason:"tooLarge"});continue}c+=w.length,a.push({path:f,mime:g,encoding:"base64",size:b,truncated:!1,data:w})}}catch(v){a.push({path:f,mime:g,encoding:y?"utf8":"base64",size:0,truncated:!0,reason:"unreadable",detail:v instanceof Error?v.message:String(v)})}}return a}async function zT(e){const{session:n,sandboxId:r,fallbackMessages:s,filesUnavailableDetail:a,onProgress:c}=e;c==null||c("reading reasoning trace…");const u=await Ve.sessions.getTrace(n.id);let f;try{f=(await Ve.getVersion()).version}catch{f=void 0}let p=[];try{p=(await Ve.sessions.state(n.id)).agents}catch{p=[]}c==null||c("reading conversation timeline…");let m="timestamped",g=await Ve.sessions.getEvents(n.id),y;(!g||g.length===0)&&(m="ordered",g=void 0,y=s??[]);const v=new Set,b=[];for(const _ of u.nodes)for(const E of _.artifacts??[])!E.path||E.type==="dir"||v.has(E.path)||(v.add(E.path),b.push(E.path));const w=await FT(r,b,c,a);return c==null||c("assembling bundle…"),{format:nx,version:jT,exportedAt:new Date().toISOString(),appVersion:f,timeline:m,session:{id:n.id,title:n.title,createdAt:n.createdAt,updatedAt:n.updatedAt},events:m==="timestamped"?g:void 0,messages:m==="ordered"?y:void 0,trace:u,agents:p,files:w}}function BT(e){let n;try{n=JSON.parse(e)}catch{throw new Error("Invalid JSON file.")}if(!LT(n))throw new Error("Not a valid live-demo bundle.");return n}const UT=6,Xr=new Map;function rx(e,n){return n?`${e}::${n}`:e}function $T(e,n){const r=rx(e,n),s=Xr.get(r);return s?(Xr.delete(r),Xr.set(r,s),s):null}function HT(e,n,r){const s=rx(e,n);for(Xr.delete(s),Xr.set(s,r);Xr.size>UT;){const a=Xr.keys().next().value;if(a===void 0)break;Xr.delete(a)}}function qT(e){const n={children:[]};for(const r of e){const a=r.replace(/^\/+/,"").split("/").filter(Boolean);let c=n,u="";a.forEach((f,p)=>{u=u?`${u}/${f}`:f;const m=p===a.length-1;let g=c.children.find(y=>y.name===f);g||(g={name:f,path:m?r:u,isDir:!m,children:[]},c.children.push(g)),m||(g.isDir=!0),c=g})}return ix(n),n.children}function ix(e){e.children.sort((n,r)=>n.isDir!==r.isDir?n.isDir?-1:1:n.name.localeCompare(r.name)),e.children.forEach(ix)}function KT(e){const n=Ta(e);return n==="image"?l.jsx(Jh,{size:14}):n==="text"?l.jsx(ca,{size:14}):l.jsx(dd,{size:14})}function WT({files:e,highlightedPaths:n,activePath:r,onSelect:s,emptyLabel:a,skippedLabel:c,unreadableLabel:u}){const f=N.useMemo(()=>qT(e.map(w=>w.path)),[e]),p=N.useMemo(()=>new Set(e.filter(w=>w.truncated).map(w=>w.path)),[e]),m=N.useMemo(()=>new Set(e.filter(w=>w.reason==="unreadable").map(w=>w.path)),[e]),[g,y]=N.useState(()=>new Set);if(e.length===0)return l.jsx("p",{className:"demo-panel__empty",children:a});const v=w=>{y(_=>{const E=new Set(_);return E.has(w)?E.delete(w):E.add(w),E})},b=(w,_)=>{const E=8+_*14;if(w.isDir){const P=!g.has(w.path);return l.jsxs("div",{className:"demo-tree-node",children:[l.jsxs("button",{className:"demo-tree-row demo-tree-row--dir",style:{paddingLeft:E},onClick:()=>v(w.path),type:"button",children:[l.jsx("span",{className:`demo-tree-chevron ${P?"is-open":""}`,children:l.jsx(ud,{size:13})}),l.jsx(fd,{size:14}),l.jsx("span",{className:"demo-tree-name",children:w.name})]}),P?w.children.map(M=>b(M,_+1)):null]},w.path||w.name)}const S=p.has(w.path),O=m.has(w.path),A=n.has(w.path),G=r===w.path;return l.jsx("div",{className:"demo-tree-node",children:l.jsxs("button",{className:`demo-tree-row ${G?"is-active":""} ${A?"is-produced":""} ${S?"is-skipped":""}`,style:{paddingLeft:E+13},disabled:S&&!O,onClick:()=>s(w.path),title:w.path,type:"button",children:[KT(w.name),l.jsx("span",{className:"demo-tree-name",children:w.name}),O?l.jsx("small",{className:"demo-tree-skip",children:u}):S?l.jsx("small",{className:"demo-tree-skip",children:c}):null]})},w.path)};return l.jsx("div",{className:"demo-file-tree",children:f.map(w=>b(w,0))})}function sx({node:e,onSelectNode:n,onSelectArtifact:r,activeArtifactPath:s,t:a}){var u;if(!e)return l.jsx("p",{children:"No trace node selected."});const c=Jy(e.status);return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"trace-detail__title",children:[l.jsx(ma,{size:17}),l.jsx("h3",{children:e.title}),l.jsx("span",{className:`trace-detail__status trace-detail__status--${va(e.status)}`,children:c?a(c):e.status})]}),l.jsxs("div",{className:"trace-detail__badges",children:[l.jsx("span",{children:e.id}),l.jsx("span",{children:hs(e)}),l.jsx("span",{children:e.agent||"agent unknown"})]}),l.jsx("p",{children:e.summary||e.description||e.content||"No summary recorded."}),e.reason?l.jsxs("section",{className:"trace-detail__section",children:[l.jsxs("h4",{children:[l.jsx(Hu,{size:13})," Reason"]}),l.jsx("p",{children:e.reason})]}):null,e.context?l.jsxs("section",{className:"trace-detail__section",children:[l.jsxs("h4",{children:[l.jsx(ca,{size:13})," Context"]}),l.jsx("p",{children:e.context})]}):null,l.jsxs("div",{className:"trace-detail__metrics",children:[l.jsxs("span",{children:[l.jsx(hd,{size:13})," ",RT(e.durationMs)]}),l.jsxs("span",{children:[l.jsx(ha,{size:13})," ",e.toolCalls.length," tools"]}),l.jsxs("span",{children:[l.jsx(hm,{size:13})," ",e.artifacts.length," artifacts"]})]}),e.parents.length>0?l.jsxs("section",{className:"trace-detail__section",children:[l.jsxs("h4",{children:[l.jsx(ma,{size:13})," Dependencies"]}),l.jsx("div",{className:"trace-relation-list",children:e.parents.map(f=>l.jsxs("button",{onClick:()=>n(f.id),type:"button",children:[l.jsx("strong",{children:f.id}),l.jsxs("span",{children:[ex[f.relation||""]||f.relation||"parent",f.edgeType?` · ${f.edgeType}`:""]}),f.explanation?l.jsx("small",{children:f.explanation}):null]},f.id))})]}):null,e.toolCalls.length>0?l.jsxs("section",{className:"trace-detail__section",children:[l.jsxs("h4",{children:[l.jsx(ha,{size:13})," Tool Calls"]}),l.jsx("div",{className:"trace-chip-list",children:e.toolCalls.map(f=>l.jsx("span",{children:f},f))})]}):null,e.errorMessage?l.jsxs("section",{className:"trace-detail__section trace-detail__section--error",children:[l.jsxs("h4",{children:[l.jsx(ka,{size:13})," Error"]}),l.jsx("p",{children:e.errorMessage})]}):null,e.artifacts.length>0?l.jsxs("section",{className:"trace-detail__section",children:[l.jsxs("h4",{children:[l.jsx(hm,{size:13})," Artifacts"]}),l.jsx("div",{className:"trace-artifact-list",children:e.artifacts.map(f=>{const p=IT[f.type||""]||f.type||"file",m=f.path.split("/").pop()||f.path;return r?l.jsxs("button",{type:"button",className:`trace-artifact-row ${s===f.path?"is-active":""}`,title:f.path,onClick:()=>r(f.path),children:[l.jsx(ca,{size:13}),l.jsx("span",{children:m}),l.jsx("small",{children:p})]},`${f.path}-${f.type||""}`):l.jsxs("div",{title:f.path,children:[l.jsx(ca,{size:13}),l.jsx("span",{children:m}),l.jsx("small",{children:p})]},`${f.path}-${f.type||""}`)})})]}):null,l.jsxs("section",{className:"trace-detail__section",children:[l.jsxs("h4",{children:[l.jsx(Xh,{size:13})," Timeline"]}),l.jsxs("dl",{children:[l.jsxs("div",{children:[l.jsx("dt",{children:"Created"}),l.jsx("dd",{children:Zy(((u=e.timestamp)==null?void 0:u.createdAt)||e.createdAt)})]}),l.jsxs("div",{children:[l.jsx("dt",{children:"Children"}),l.jsx("dd",{children:e.childIds.join(", ")||"-"})]})]})]})]})}function VT({node:e,onClose:n,onSelectNode:r,onSelectArtifact:s,activeArtifactPath:a,closeLabel:c,t:u}){return N.useEffect(()=>{if(!e)return;const f=p=>{p.key==="Escape"&&n()};return document.addEventListener("keydown",f),()=>document.removeEventListener("keydown",f)},[e,n]),e?l.jsx("div",{className:"trace-node-modal",onMouseDown:n,role:"presentation",children:l.jsxs("section",{className:"trace-node-modal__panel",onMouseDown:f=>f.stopPropagation(),role:"dialog","aria-modal":"true","aria-label":e.title,children:[l.jsxs("div",{className:"trace-node-modal__head",children:[l.jsxs("span",{className:"trace-node-modal__eyebrow",children:[l.jsx(ma,{size:13,style:{marginRight:5,verticalAlign:"-2px"}}),e.id]}),l.jsx(xt,{label:c,onClick:n,children:l.jsx(Dn,{size:16})})]}),l.jsx("div",{className:"trace-node-modal__body trace-detail",children:l.jsx(sx,{node:e,onSelectNode:r,onSelectArtifact:f=>{s(f),n()},activeArtifactPath:a,t:u})})]})}):null}const Ah=60,GT=8e3,YT=[1,2,4,8];function XT(e,n){const r=atob(e),s=new Uint8Array(r.length);for(let a=0;a<r.length;a+=1)s[a]=r.charCodeAt(a);return new Blob([s],{type:n})}function el(e){return e.split("/").pop()||e}function QT(e){var r,s;return e.role==="user"?!!((r=e.content)!=null&&r.trim()):!(e.kind==="text"||e.kind===void 0)||!((s=e.content)!=null&&s.trim())?!1:e.agent===void 0||e.agent==="principal"}const ZT=/report|summary|总结|conclusion|readme/i;function Mh(e){if(e.length===0)return null;const n=e.filter(c=>!c.truncated),r=n.length>0?n:e,s=r.find(c=>ZT.test(el(c.path)));if(s)return s.path;const a=r.find(c=>_l(c.path));return a?a.path:r[0].path}function JT(){var je;const e=yt(),{sessions:n,currentSession:r,messages:s}=Nr(),{currentSandbox:a}=Ti(),[c,u]=N.useState(null),[f,p]=N.useState(!1),[m,g]=N.useState(""),[y,v]=N.useState(null),[b,w]=N.useState(!1),[_,E]=N.useState(0),[S,O]=N.useState(!1),[A,G]=N.useState(1),[P,M]=N.useState(1),[W,ee]=N.useState(null),[oe,D]=N.useState(null),[ce,V]=N.useState(null),j=N.useRef(null),B=N.useRef(new Map),q=N.useMemo(()=>{B.current.forEach(pe=>pe.objectUrl&&URL.revokeObjectURL(pe.objectUrl));const le=new Map;for(const pe of(c==null?void 0:c.files)??[]){if(pe.truncated||pe.data===void 0){le.set(pe.path,{source:pe.reason==="unreadable"?{kind:"unreadable",detail:pe.detail}:{kind:"tooLarge"}});continue}const ze=Ta(el(pe.path));if(ze==="text")le.set(pe.path,{source:{kind:"text",text:pe.data}});else if(ze==="image"||ze==="pdf"){const st=URL.createObjectURL(XT(pe.data,pe.mime));le.set(pe.path,{source:{kind:ze,blobUrl:st},objectUrl:st})}else le.set(pe.path,{source:{kind:"download"}})}return B.current=le,le},[c]);N.useEffect(()=>()=>{B.current.forEach(le=>le.objectUrl&&URL.revokeObjectURL(le.objectUrl))},[]);const Z=(c==null?void 0:c.trace.nodes)??[],ne=N.useMemo(()=>{if(!c)return{t0:0,t1:1,sorted:[],nodeMs:[],ordered:[]};if(c.timeline==="timestamped"){let st=0;const Et=[...c.events??[]].map(St=>{const Wt=dg(St),tn=Wt._ts?Date.parse(String(Wt._ts)):NaN,vn=Number.isFinite(tn)?tn:st;return st=vn,{ev:Wt,ms:vn}}).sort((St,Wt)=>St.ms-Wt.ms),ae=Et.map(St=>St.ms).filter(Number.isFinite),xe=ae.length?Math.min(...ae):0,Be=ae.length?Math.max(...ae):1,Ze=Be>xe?Be-xe:1,lt=Z.map((St,Wt)=>Z.length<=1?Be:xe+Wt/(Z.length-1)*Ze);return{t0:xe,t1:Be>xe?Be:xe+1,sorted:Et,nodeMs:lt,ordered:[]}}const le=c.messages??[],pe=Math.max(1,le.length-1,Z.length-1),ze=Z.map((st,Et)=>Z.length<=1?0:Et/(Z.length-1)*pe);return{t0:0,t1:pe,sorted:[],nodeMs:ze,ordered:le}},[c,Z]);N.useEffect(()=>{c&&(E(ne.t1),O(!1),ee(null),V(null),D(Mh(c.files)))},[c]),N.useEffect(()=>{if(!S||!c)return;const pe=(ne.t1-ne.t0)*Ah/GT*A,ze=window.setInterval(()=>{E(st=>{const Et=st+pe;return Et>=ne.t1?(O(!1),ne.t1):Et})},Ah);return()=>window.clearInterval(ze)},[S,c,ne,A]);const K=N.useMemo(()=>{if(!c)return[];if(c.timeline==="timestamped"){let pe=[];for(const{ev:ze,ms:st}of ne.sorted){if(st>_)break;pe=Gu(pe,ze)}return pe}const le=Math.max(0,Math.min(ne.ordered.length,Math.floor(_)+1));return ne.ordered.slice(0,le)},[c,ne,_]),ue=N.useMemo(()=>K.filter(QT),[K]),C=N.useMemo(()=>{const le=ne.nodeMs.filter(st=>st<=_).length,pe=Z.slice(0,le),ze=new Set(pe.map(st=>st.id));return pe.map(st=>({...st,parentIds:st.parentIds.filter(Et=>ze.has(Et)),parents:st.parents.filter(Et=>ze.has(Et.id)),childIds:st.childIds.filter(Et=>ze.has(Et))}))},[Z,ne,_]),R=N.useMemo(()=>C.length===0?null:C.find(le=>le.id===W)??C[C.length-1],[C,W]),J=N.useMemo(()=>new Set(((R==null?void 0:R.artifacts)??[]).map(le=>le.path)),[R]),T=N.useMemo(()=>{var le;if(oe)return oe;for(let pe=C.length-1;pe>=0;pe-=1){const ze=(le=C[pe].artifacts)==null?void 0:le[0];if(ze!=null&&ze.path)return ze.path}return Mh((c==null?void 0:c.files)??[])},[C,oe,c]),X=(c==null?void 0:c.files.find(le=>le.path===T))??null,re=T?((je=q.get(T))==null?void 0:je.source)??{kind:"tooLarge"}:null,L=N.useMemo(()=>ce?Z.find(le=>le.id===ce)??null:null,[ce,Z]),$=C.length,H=()=>{c&&(_>=ne.t1&&E(ne.t0),D(null),O(le=>!le))},Q=()=>{O(!1),D(null),E(ne.t0)},ge=le=>{O(!1),D(null),le<0?E(ne.t0):E(ne.nodeMs[le]??ne.t1);const pe=Z[Math.max(0,Math.min(le,Z.length-1))];pe&&ee(pe.id)},Pe=()=>{$>=Z.length||ge($)},fe=()=>{if($<=1){E(ne.t0),O(!1),D(null);return}ge($-2)},ke=le=>{O(!1),D(null),E(le)},Ee=le=>{D(le)},ve=le=>{ee(le),V(le)},Se=async(le,pe,ze)=>{const st=$T(le,ze);if(st){v(null),u(st);return}const Et=a&&a.status==="running"?a:null;p(!0),v(null),g(e("demo.packing"));try{const ae=await zT({session:{id:le,title:pe,createdAt:(r==null?void 0:r.id)===le?r.createdAt:void 0,updatedAt:ze??((r==null?void 0:r.id)===le?r.updatedAt:void 0)},sandboxId:Et==null?void 0:Et.id,filesUnavailableDetail:Et?void 0:e("demo.files.noSandbox"),fallbackMessages:(r==null?void 0:r.id)===le?s:void 0,onProgress:g});HT(le,ze,ae),u(ae)}catch(ae){v(ae instanceof Error?ae.message:e("demo.error.build"))}finally{p(!1),g("")}},tt=async le=>{p(!0),v(null);try{const pe=BT(await le.text());u(pe)}catch(pe){v(pe instanceof Error?pe.message:e("demo.error.parse"))}finally{p(!1)}},ft=le=>{var ze;if(le.preventDefault(),w(!1),f)return;const pe=(ze=le.dataTransfer.files)==null?void 0:ze[0];pe&&tt(pe)},se=()=>{if(!c)return;const le=new Blob([JSON.stringify(c)],{type:"application/json"});ul(le,`${c.session.title||"session"}-demo.json`)};return c?l.jsxs("main",{className:"demo-view","aria-label":e("demo.title"),children:[l.jsxs("header",{className:"demo-header",children:[l.jsxs("div",{className:"demo-header__title",children:[l.jsx("span",{className:"workspace-panel__eyebrow",children:e("demo.eyebrow")}),l.jsx("h1",{children:c.session.title}),l.jsx("span",{className:"demo-header__meta",children:e("demo.meta.exported",{time:new Date(c.exportedAt).toLocaleString()})})]}),l.jsxs("div",{className:"demo-header__actions",children:[l.jsxs("button",{className:"demo-export",onClick:se,type:"button",children:[l.jsx(gm,{size:14}),l.jsx("span",{children:e("demo.exportButton")})]}),l.jsx("button",{className:"demo-reselect",onClick:()=>u(null),type:"button",children:e("demo.reselect")})]})]}),l.jsxs("div",{className:"demo-layout",children:[l.jsxs("section",{className:"demo-panel demo-panel--chat",children:[l.jsx("header",{className:"demo-panel__head",children:l.jsx("h2",{children:e("demo.conversation.title")})}),ue.length===0?l.jsx("p",{className:"demo-panel__empty",children:e("demo.conversation.empty")}):l.jsx(Yy,{messages:ue,showToolbarCount:!1,className:"demo-message-stream"})]}),l.jsxs("section",{className:"demo-panel demo-panel--preview",children:[l.jsxs("header",{className:"demo-panel__head demo-preview-head",children:[l.jsx("h2",{children:e("demo.files.title")}),X?l.jsxs("span",{className:"demo-preview-name",title:X.path,children:[el(X.path),X.truncated?l.jsxs("small",{children:[" · ",e("demo.files.skipped")]}):null]}):null]}),l.jsx("div",{className:"demo-preview-body",children:re&&X?l.jsx(Qy,{name:el(X.path),source:re,renderMarkdown:_l(X.path),t:e}):l.jsx("p",{className:"demo-panel__empty",children:c.files.length===0?e("demo.files.empty"):e("demo.files.none")})})]}),l.jsxs("div",{className:"demo-right",children:[l.jsxs("section",{className:"demo-panel demo-panel--trace",children:[l.jsx("header",{className:"demo-panel__head",children:l.jsx("h2",{children:e("demo.trace.title")})}),l.jsx("div",{className:"demo-trace-map",children:l.jsx(tx,{nodes:C,direction:"LR",selectedNodeId:(R==null?void 0:R.id)??null,onSelectNode:ve,zoom:P,onZoomChange:M,fitToken:C.length})}),l.jsxs("div",{className:"demo-transport",children:[l.jsx(xt,{label:e("demo.transport.prev"),onClick:fe,disabled:$<=1,children:l.jsx(Pv,{size:14})}),l.jsx(xt,{label:e(S?"demo.transport.pause":"demo.transport.play"),onClick:H,children:S?l.jsx(rg,{size:15}):l.jsx(ig,{size:15})}),l.jsx(xt,{label:e("demo.transport.next"),onClick:Pe,disabled:$>=Z.length,children:l.jsx(Fv,{size:14})}),l.jsx(xt,{label:e("demo.transport.restart"),onClick:Q,children:l.jsx(ag,{size:13})}),l.jsx("input",{className:"demo-transport__slider",type:"range",min:ne.t0,max:ne.t1,step:(ne.t1-ne.t0)/1e3||1,value:_,onChange:le=>ke(Number(le.target.value)),"aria-label":e("demo.transport.play")}),l.jsx("span",{className:"demo-transport__step",children:e("demo.transport.step",{index:$,total:Z.length})}),l.jsx("div",{className:"demo-transport__speeds","aria-label":e("demo.transport.speed"),children:YT.map(le=>l.jsxs("button",{className:A===le?"is-active":"",onClick:()=>G(le),type:"button",children:[le,"×"]},le))})]})]}),l.jsxs("section",{className:"demo-panel demo-panel--tree",children:[l.jsx("header",{className:"demo-panel__head",children:l.jsx("h2",{children:e("demo.tree.title")})}),l.jsx("div",{className:"demo-tree-body",children:l.jsx(WT,{files:c.files,highlightedPaths:J,activePath:T,onSelect:Ee,emptyLabel:e("demo.files.empty"),skippedLabel:e("demo.files.skipped"),unreadableLabel:e("demo.files.unreadable")})})]})]})]}),l.jsx(VT,{node:L,onClose:()=>V(null),onSelectNode:le=>{ee(le),V(le)},onSelectArtifact:Ee,activeArtifactPath:T,closeLabel:e("demo.node.modalClose"),t:e})]}):l.jsx("main",{className:"demo-view","aria-label":e("demo.title"),children:l.jsxs("div",{className:"demo-landing",children:[l.jsxs("header",{className:"demo-landing__header",children:[l.jsx("span",{className:"workspace-panel__eyebrow",children:e("demo.eyebrow")}),l.jsx("h1",{children:e("demo.landing.heading")}),l.jsx("p",{children:e("demo.landing.subtitle")})]}),y?l.jsx("p",{className:"demo-landing__error",children:y}):null,l.jsxs("div",{className:"demo-landing__cards",children:[l.jsxs("section",{className:"demo-card",children:[l.jsxs("div",{className:"demo-card__head",children:[l.jsx(_a,{size:16}),l.jsx("h2",{children:e("demo.landing.fromSession.title")})]}),l.jsx("p",{children:e("demo.landing.fromSession.desc")}),l.jsx("div",{className:"demo-card__sessions",children:n.length===0?l.jsx("p",{className:"demo-card__empty",children:e("demo.landing.fromSession.empty")}):n.map(le=>l.jsxs("button",{className:"demo-session-row",disabled:f,onClick:()=>void Se(le.id,le.title,le.updatedAt),type:"button",children:[l.jsx("span",{children:le.title}),l.jsx("small",{children:new Date(le.updatedAt).toLocaleDateString()})]},le.id))})]}),l.jsxs("section",{className:"demo-card",children:[l.jsxs("div",{className:"demo-card__head",children:[l.jsx(_v,{size:16}),l.jsx("h2",{children:e("demo.landing.import.title")})]}),l.jsx("p",{children:e("demo.landing.import.desc")}),l.jsxs("button",{className:`demo-dropzone ${b?"is-dragover":""}`,disabled:f,onClick:()=>{var le;return(le=j.current)==null?void 0:le.click()},onDragOver:le=>{le.preventDefault(),f||w(!0)},onDragLeave:()=>w(!1),onDrop:ft,type:"button",children:[l.jsx(gm,{size:20,className:"demo-dropzone__icon"}),l.jsx("span",{className:"demo-dropzone__primary",children:e("demo.landing.import.button")}),l.jsx("span",{className:"demo-dropzone__hint",children:e("demo.landing.import.dropHint")})]}),l.jsx("input",{ref:j,type:"file",accept:"application/json,.json",style:{display:"none"},onChange:le=>{var ze;const pe=(ze=le.target.files)==null?void 0:ze[0];pe&&tt(pe),le.target.value=""}})]})]}),f?l.jsx("p",{className:"demo-landing__progress",children:m||e("demo.packing")}):null]})})}const eA=new TextEncoder;let Pu=null;function tA(){if(Pu)return Pu;const e=new Uint32Array(256);for(let n=0;n<256;n+=1){let r=n;for(let s=0;s<8;s+=1)r=r&1?3988292384^r>>>1:r>>>1;e[n]=r>>>0}return Pu=e,e}function nA(e){const n=tA();let r=4294967295;for(const s of e)r=n[(r^s)&255]^r>>>8;return(r^4294967295)>>>0}function rA(e=new Date){const n=Math.max(1980,e.getFullYear()),r=e.getHours()<<11|e.getMinutes()<<5|Math.floor(e.getSeconds()/2),s=n-1980<<9|e.getMonth()+1<<5|e.getDate();return{dosTime:r,dosDate:s}}function Yo(e){const n=new Uint8Array(e.length);return n.set(e),n.buffer}function iA(e){const n=[],r=[];let s=0;const{dosTime:a,dosDate:c}=rA();for(const g of e){const y=g.path.replace(/^\/+/,""),v=eA.encode(y),b=g.data,w=nA(b),_=y.endsWith("/"),E=new Uint8Array(30+v.length),S=new DataView(E.buffer);S.setUint32(0,67324752,!0),S.setUint16(4,20,!0),S.setUint16(6,2048,!0),S.setUint16(8,0,!0),S.setUint16(10,a,!0),S.setUint16(12,c,!0),S.setUint32(14,w,!0),S.setUint32(18,b.length,!0),S.setUint32(22,b.length,!0),S.setUint16(26,v.length,!0),S.setUint16(28,0,!0),E.set(v,30),n.push(Yo(E),Yo(b));const O=new Uint8Array(46+v.length),A=new DataView(O.buffer);A.setUint32(0,33639248,!0),A.setUint16(4,20,!0),A.setUint16(6,20,!0),A.setUint16(8,2048,!0),A.setUint16(10,0,!0),A.setUint16(12,a,!0),A.setUint16(14,c,!0),A.setUint32(16,w,!0),A.setUint32(20,b.length,!0),A.setUint32(24,b.length,!0),A.setUint16(28,v.length,!0),A.setUint16(30,0,!0),A.setUint16(32,0,!0),A.setUint16(34,0,!0),A.setUint16(36,0,!0),A.setUint32(38,_?16:0,!0),A.setUint32(42,s,!0),O.set(v,46),r.push(O),s+=E.length+b.length}const u=r.reduce((g,y)=>g+y.length,0),f=s;n.push(...r.map(Yo));const p=new Uint8Array(22),m=new DataView(p.buffer);return m.setUint32(0,101010256,!0),m.setUint16(4,0,!0),m.setUint16(6,0,!0),m.setUint16(8,e.length,!0),m.setUint16(10,e.length,!0),m.setUint32(12,u,!0),m.setUint32(16,f,!0),m.setUint16(20,0,!0),n.push(Yo(p)),new Blob(n,{type:"application/zip"})}const ax=320,sA=680,Rh=360,aA=900,oA=560,lA={name:"workspace",path:"/workspace",type:"folder",size:0,modified:0,permissions:""};function Ih(e,n){return`${e.replace(/\/$/,"")}/${n}`}function cA(e){return e.split("/").filter(Boolean).pop()||"download"}function Oh(e){return e==="/workspace"?"workspace":e.startsWith("/workspace/")?e.slice(11):e.replace(/^\/+/,"")}function uA(e){return[...e].sort((n,r)=>n.length-r.length).filter((n,r,s)=>!s.slice(0,r).some(a=>n.startsWith(`${a}/`)))}function dA({node:e}){return e.type==="folder"||e.type==="symlink"?l.jsx(fd,{size:16}):/\.(md|txt|py|yaml|yml|csv|json|ts|tsx|js|jsx)$/i.test(e.name)?l.jsx(ca,{size:16}):/\.(svg|png|jpg|jpeg|gif|webp)$/i.test(e.name)?l.jsx(Jh,{size:16}):l.jsx(dd,{size:16})}function jh(e){return[...e].sort((n,r)=>{const s=n.type==="folder"||n.type==="symlink",a=r.type==="folder"||r.type==="symlink";return s!==a?s?-1:1:n.name.localeCompare(r.name)})}function od(e,n,r){var s;return e.path===n?r(e):{...e,children:(s=e.children)==null?void 0:s.map(a=>od(a,n,r))}}function tl(e,n){if(!n)return null;if(e.path===n)return e;for(const r of e.children??[]){const s=tl(r,n);if(s)return s}return null}function fA({isOpen:e,onClose:n,onResize:r,onResizeEnd:s,onResizeStart:a,width:c}){const{currentSandbox:u}=Ti(),{currentSession:f}=Nr(),p=(f==null?void 0:f.id)??null,m=yt(),[g,y]=N.useState(lA),[v,b]=N.useState(()=>new Set(["/workspace"])),[w,_]=N.useState(null),[E,S]=N.useState(null),[O,A]=N.useState(()=>new Set),[G,P]=N.useState(!1),[M,W]=N.useState(!1),[ee,oe]=N.useState(null),[D,ce]=N.useState(!1),V=N.useRef(null),j=N.useCallback(async $=>{if(!u||u.status!=="running"||!p){oe(m("files.error.notRunning"));return}oe(null);const Q=(await Ve.sandbox.listFiles(p,$)).map(ge=>({...ge,path:Ih($,ge.name)}));y(ge=>od(ge,$,Pe=>({...Pe,children:Q,loaded:!0})))},[u,p]);N.useEffect(()=>{e&&(u==null?void 0:u.status)==="running"&&j("/workspace"),(!e||(u==null?void 0:u.status)!=="running")&&(A(new Set),_(null),S(null),ce(!1))},[u==null?void 0:u.status,e,j]),N.useEffect(()=>{const $=Q=>{if(!V.current)return;const ge=V.current.pointerX-Q.clientX,Pe=Math.max(ax,Math.min(sA,V.current.width+ge));r(Pe)},H=()=>{V.current&&(V.current=null,s())};return window.addEventListener("pointermove",$),window.addEventListener("pointerup",H),()=>{window.removeEventListener("pointermove",$),window.removeEventListener("pointerup",H)}},[r,s]);const B=N.useMemo(()=>tl(g,w),[w,g]),q=(B==null?void 0:B.type)==="file"?B:null,Z=O.size,ne=N.useCallback($=>tl(g,$),[g]),K=N.useCallback(async $=>{if(!p)throw new Error("No active sandbox");const H=tl(g,$);if(H!=null&&H.loaded&&H.children)return H.children;const Q=await Ve.sandbox.listFiles(p,$),ge=jh(Q.map(Pe=>({...Pe,path:Ih($,Pe.name)})));return y(Pe=>od(Pe,$,fe=>({...fe,children:ge,loaded:!0}))),ge},[p,g]),ue=N.useCallback(async($,H)=>{if(!p)throw new Error("No active sandbox");if($.type==="folder"||$.type==="symlink"){const ge=jh(await K($.path));if(ge.length===0){H.push({path:`${Oh($.path)}/`,data:new Uint8Array});return}for(const Pe of ge)await ue(Pe,H);return}const Q=await Ve.sandbox.readRawFile(p,$.path);H.push({path:Oh($.path),data:new Uint8Array(await Q.arrayBuffer())})},[p,K]),C=N.useCallback($=>{A(H=>{const Q=new Set(H);return Q.has($)?Q.delete($):Q.add($),Q})},[]),R=N.useCallback(()=>{A(new Set)},[]),J=N.useCallback(async $=>{if(!p||M)return;const H=uA($);if(H.length){W(!0),oe(null);try{const Q=H.map(fe=>{const ke=ne(fe);if(!ke)throw new Error(`Cannot find ${fe}`);return ke});if(Q.length===1&&Q[0].type==="file"){const fe=await Ve.sandbox.readRawFile(p,Q[0].path);ul(fe,Q[0].name);return}const ge=[];for(const fe of Q)await ue(fe,ge);const Pe=Q.length===1?`${cA(Q[0].path)}.zip`:"workspace-files.zip";ul(iA(ge),Pe)}catch(Q){oe(Q instanceof Error?Q.message:m("files.error.downloadFailed"))}finally{W(!1)}}},[ue,p,ne,M]),T=async()=>{P(!0);try{const $=Array.from(v);for(const H of $.length?$:["/workspace"])await j(H)}catch($){oe($ instanceof Error?$.message:m("files.error.refreshFailed"))}finally{P(!1)}},X=async $=>{b(H=>{const Q=new Set(H);return Q.has($.path)?Q.delete($.path):Q.add($.path),Q}),$.loaded||await j($.path)},re=async $=>{if(_($.path),S(null),!!p&&!(Ta($.name)!=="text"||$.size>Dd))try{S(await Ve.sandbox.readFile(p,$.path))}catch(H){S({path:$.path,content:H instanceof Error?H.message:m("files.error.previewFailed"),size:$.size})}},L=($,H=0)=>{var ke;const Q=$.type==="folder"||$.type==="symlink",ge=v.has($.path),Pe=w===$.path,fe=O.has($.path);return l.jsxs("div",{className:"file-node",children:[l.jsxs("div",{className:`file-row ${Pe?"is-selected":""} ${fe?"is-download-selected":""}`,children:[l.jsxs("label",{className:"file-row__check",style:{marginLeft:10+H*16},children:[l.jsx("span",{className:"sr-only",children:m("files.selectForDownload",{name:$.name})}),l.jsx("input",{checked:fe,disabled:M,onChange:()=>C($.path),type:"checkbox"})]}),l.jsxs("button",{className:"file-row__open",onClick:()=>{Q?X($):re($)},type:"button",children:[l.jsx("span",{className:`file-row__chevron ${Q&&ge?"is-expanded":""}`,children:Q?l.jsx(ud,{size:14}):null}),l.jsx(dA,{node:$}),l.jsx("span",{className:"file-row__name",children:$.name}),l.jsx("span",{className:"file-row__size",children:Xy($.size)})]})]}),Q&&ge?(ke=$.children)==null?void 0:ke.map(Ee=>L(Ee,H+1)):null]},$.path)};return l.jsxs(l.Fragment,{children:[l.jsxs("aside",{"aria-hidden":!e,"aria-label":m("files.aria.sidebar"),className:`file-sidebar ${e?"is-open":""}`,children:[l.jsx("div",{"aria-label":m("files.aria.resizeSidebar"),className:"file-sidebar__resize-handle",onPointerDown:$=>{V.current={pointerX:$.clientX,width:c},a()},role:"separator"}),l.jsxs("header",{className:"file-sidebar__header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"file-sidebar__eyebrow",children:m("files.eyebrow.workspace")}),l.jsx("h2",{children:m("files.title")})]}),l.jsxs("div",{className:"file-sidebar__actions",children:[Z>0?l.jsxs("div",{className:"file-sidebar__selection-actions",children:[l.jsx("span",{children:m("files.selectedCount",{count:Z})}),l.jsxs("button",{className:"file-sidebar__download-selected",disabled:!u||M,onClick:()=>void J(Array.from(O)),type:"button",children:[l.jsx(Ov,{size:14}),l.jsx("span",{children:m(M?"files.packing":"files.download")})]}),l.jsx(xt,{disabled:M,label:m("files.aria.clearSelection"),onClick:R,children:l.jsx(Dn,{size:14})})]}):null,l.jsx(xt,{className:G?"is-active":"",label:m("files.aria.refresh"),onClick:()=>void T(),children:l.jsx(md,{size:15})}),l.jsx(xt,{label:m("files.aria.close"),onClick:n,children:l.jsx(Dn,{size:15})})]})]}),l.jsxs("div",{className:"file-sidebar__path",children:[l.jsx("span",{children:"/workspace"}),l.jsx("small",{children:(u==null?void 0:u.status)==="running"?m("files.live"):m("files.offline")})]}),ee?l.jsx("p",{className:"file-sidebar__empty",children:ee}):null,l.jsx("div",{className:"file-sidebar__tree","aria-label":m("files.aria.tree"),children:L(g)})]}),l.jsx(pA,{content:E,file:e?q:null,isMaximized:D,onClose:()=>{_(null),S(null),ce(!1)},sandboxId:p,onToggleMaximize:()=>ce($=>!$)})]})}function pA({file:e,content:n,isMaximized:r,onClose:s,sandboxId:a,onToggleMaximize:c}){const u=yt(),[f,p]=N.useState(oA),[m,g]=N.useState(!1),[y,v]=N.useState(null),[b,w]=N.useState(null),[_,E]=N.useState(!1),S=N.useRef(null),O=e?Ta(e.name):"download";if(N.useEffect(()=>{if(!e||!a||O!=="image"&&O!=="pdf"||e.size>Du){v(null),w(null);return}let P=null,M=!1;return v(null),w(null),Ve.sandbox.readRawFile(a,e.path).then(W=>{M||(P=URL.createObjectURL(W),v(P))}).catch(W=>{M||w(W instanceof Error?W.message:u("files.error.loadPreviewFailed"))}),()=>{M=!0,P&&URL.revokeObjectURL(P)}},[e==null?void 0:e.path,O,a]),N.useEffect(()=>{const P=W=>{if(!S.current)return;const ee=window.innerWidth-ax-80,oe=Math.max(Rh,Math.min(aA,ee)),D=S.current.pointerX-W.clientX,ce=Math.max(Rh,Math.min(oe,S.current.width+D));p(ce)},M=()=>{S.current=null,g(!1)};return window.addEventListener("pointermove",P),window.addEventListener("pointerup",M),()=>{window.removeEventListener("pointermove",P),window.removeEventListener("pointerup",M)}},[]),!e)return null;const A=O==="image"?e.size>Du?{kind:"tooLarge"}:{kind:"image",blobUrl:y??void 0}:O==="pdf"?e.size>Du?{kind:"tooLarge"}:{kind:"pdf",blobUrl:y??void 0}:O==="download"?{kind:"download"}:e.size>Dd?{kind:"tooLarge"}:{kind:"text",text:(n==null?void 0:n.content)??u("files.preview.loading")},G=async()=>{if(a){E(!0);try{const P=await Ve.sandbox.readRawFile(a,e.path);ul(P,e.name)}finally{E(!1)}}};return l.jsxs("section",{"aria-label":u("files.preview.aria"),className:`file-preview-panel is-open ${r?"is-maximized":""} ${m?"is-resizing":""}`,style:{"--preview-panel-width":`${f}px`},children:[l.jsx("div",{"aria-label":u("files.preview.ariaResize"),className:"file-preview-panel__resize-handle",onPointerDown:P=>{r||(S.current={pointerX:P.clientX,width:f},g(!0))},role:"separator"}),l.jsxs("div",{className:"file-preview__header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"file-sidebar__eyebrow",children:u("files.preview.eyebrow")}),l.jsx("h3",{children:e.name})]}),l.jsxs("div",{className:"file-preview__actions",children:[l.jsxs("button",{className:"file-preview__download",disabled:!a||_,onClick:()=>void G(),type:"button",children:[l.jsx(Qh,{size:14}),l.jsx("span",{children:u(_?"files.preview.downloading":"files.preview.download")})]}),l.jsx(xt,{label:u(r?"files.preview.restore":"files.preview.maximize"),onClick:c,children:r?l.jsx(Av,{size:15}):l.jsx(tg,{size:15})}),l.jsx(xt,{label:u("files.preview.close"),onClick:s,children:l.jsx(Dn,{size:15})})]})]}),l.jsxs("dl",{className:"file-preview__meta",children:[l.jsxs("div",{children:[l.jsx("dt",{children:u("files.preview.path")}),l.jsx("dd",{children:e.path})]}),l.jsxs("div",{children:[l.jsx("dt",{children:u("files.preview.size")}),l.jsx("dd",{children:Xy(e.size)})]}),l.jsxs("div",{children:[l.jsx("dt",{children:u("files.preview.modified")}),l.jsx("dd",{children:NT(e.modified)})]}),l.jsxs("div",{children:[l.jsx("dt",{children:u("files.preview.mode")}),l.jsx("dd",{children:e.permissions||"-"})]})]}),l.jsx(Qy,{name:e.name,source:A,renderMarkdown:_l(e.name),error:b,t:u,onDownload:a?()=>void G():void 0,isDownloading:_})]})}function mA({isOpen:e,onClose:n}){const{sessions:r,selectSession:s}=Nr(),a=yt(),[c,u]=N.useState(""),f=N.useRef(null);N.useEffect(()=>{if(!e){u("");return}const m=window.setTimeout(()=>{var y;return(y=f.current)==null?void 0:y.focus()},0),g=y=>{y.key==="Escape"&&n()};return window.addEventListener("keydown",g),()=>{window.clearTimeout(m),window.removeEventListener("keydown",g)}},[e,n]);const p=N.useMemo(()=>{const m=c.trim().toLowerCase();return m?r.filter(g=>g.title.toLowerCase().includes(m)):r},[c,r]);return e?l.jsx("div",{className:"search-modal",role:"presentation",onMouseDown:n,children:l.jsxs("section",{"aria-label":a("search.aria"),"aria-modal":"true",className:"search-dialog",onMouseDown:m=>m.stopPropagation(),role:"dialog",children:[l.jsx("label",{className:"sr-only",htmlFor:"conversation-search",children:a("search.placeholder")}),l.jsx("input",{id:"conversation-search",ref:f,autoComplete:"off",className:"search-dialog__input",onChange:m=>u(m.target.value),placeholder:a("search.placeholder"),type:"search",value:c}),l.jsxs("div",{className:"search-dialog__body",children:[l.jsx("p",{className:"search-dialog__heading",children:a("search.recent")}),p.length>0?l.jsx("div",{className:"search-results",role:"listbox",children:p.map((m,g)=>l.jsxs("button",{className:`search-result ${g===0?"is-highlighted":""}`,onClick:()=>{s(m.id),n()},type:"button",children:[l.jsx(ng,{size:18}),l.jsx("span",{className:"search-result__title",children:m.title})]},m.id))}):l.jsx("p",{className:"search-dialog__empty",children:a("search.empty")})]})]})}):null}const hA=[{id:"account",labelKey:"settings.tab.account",icon:Hv},{id:"providers",labelKey:"settings.tab.providers",icon:zv},{id:"mcp",labelKey:"settings.tab.mcp",icon:sg},{id:"preferences",labelKey:"settings.tab.preferences",icon:cg}],Xo={name:"",baseUrl:"https://api.anthropic.com",apiKey:"",apiKeyMasked:"",models:["claude-opus-4-6"],iconColor:"#111111",notes:""},Qo={name:"",type:"stdio",command:"",args:"",url:""},gA=["#111111","#16a34a","#2563eb","#7c3aed","#f59e0b","#d92d20","#64748b"],yA="provider-profiles-updated";function xA(e){return e.split(",").map(n=>n.trim()).filter(Boolean)}function bA({isOpen:e,onClose:n}){var ft;const{user:r}=gl(),s=kg(),a=yt(),[c,u]=N.useState("account"),[f,p]=N.useState([]),[m,g]=N.useState([]),[y,v]=N.useState(Xo),[b,w]=N.useState(null),[_,E]=N.useState(!1),[S,O]=N.useState(!1),[A,G]=N.useState(Qo),[P,M]=N.useState(null),[W,ee]=N.useState(!1),[oe,D]=N.useState(!1),[ce,V]=N.useState(null),[j,B]=N.useState(null),[q,Z]=N.useState(null),[ne,K]=N.useState(null),ue=(se,je)=>{const le=new Map(je.map(pe=>[pe.id,pe]));return se.map(pe=>{const ze=le.get(pe.id);return ze?{...pe,healthStatus:ze.healthStatus,healthCheckedAt:ze.healthCheckedAt,modelHealth:ze.modelHealth}:pe})},C=async()=>{D(!0),B(null);try{const[se,je,le]=await Promise.all([Ve.providers.list(),Ve.mcpServers.list(),Ve.providers.health().catch(()=>[])]);p(ue(se,le)),g(je)}catch(se){B(se instanceof Error?se.message:a("settings.loadFailed"))}finally{D(!1)}},R=async()=>{try{const[se,je,le]=await Promise.all([Ve.providers.list(),Ve.mcpServers.list(),Ve.providers.health().catch(()=>[])]);p(ue(se,le)),g(je)}catch{}},J=async se=>{K(se);try{const je=await Ve.providers.test(se);p(le=>le.map(pe=>pe.id===se?{...pe,healthStatus:je.healthStatus,healthCheckedAt:je.healthCheckedAt,modelHealth:je.modelHealth}:pe)),V(a("settings.providers.tested",{name:je.name,status:je.healthStatus}))}catch(je){B(je instanceof Error?je.message:a("settings.providers.testFailed"))}finally{K(null)}};if(N.useEffect(()=>{e&&(C(),Ve.getVersion().then(se=>Z(se.version)).catch(()=>Z(null)))},[e]),N.useEffect(()=>{if(!e||c!=="providers")return;const se=window.setInterval(()=>void R(),3e4);return()=>window.clearInterval(se)},[e,c]),!e)return null;const T=()=>{window.dispatchEvent(new Event(yA))},X=()=>{w(null),v(Xo),O(!1),E(!0)},re=()=>{w(null),v(Xo),O(!1),E(!1)},L=async se=>{se.preventDefault(),B(null);const je=y.models.map(le=>le.trim()).filter(Boolean);if(!je.length){B(a("settings.providers.modelRequired"));return}try{const le=b?await Ve.providers.update(b,{name:y.name,baseUrl:y.baseUrl,...y.apiKey?{apiKey:y.apiKey}:{},models:je,iconColor:y.iconColor,notes:y.notes}):await Ve.providers.create({name:y.name,baseUrl:y.baseUrl,apiKey:y.apiKey,models:je,iconColor:y.iconColor,notes:y.notes});p(pe=>[le,...pe.filter(ze=>ze.id!==le.id)]),v(Xo),w(null),O(!1),E(!1),V(a(b?"settings.providers.updated":"settings.providers.added")),T()}catch(le){B(le instanceof Error?le.message:a("settings.providers.saveFailed"))}},$=se=>{w(se.id),v({name:se.name,baseUrl:se.baseUrl,apiKey:"",apiKeyMasked:se.apiKeyMasked||"",models:se.models.length?se.models:[""],iconColor:se.iconColor||"#111111",notes:se.notes}),O(!1),E(!0)},H=async se=>{const je=await Ve.providers.setActive(se);p(le=>le.map(pe=>({...pe,isActive:pe.id===je.id}))),V(a("settings.providers.activeSwitched",{name:je.name})),T()},Q=async se=>{await Ve.providers.remove(se),p(je=>je.filter(le=>le.id!==se)),T()},ge=(se,je)=>{v(le=>({...le,models:le.models.map((pe,ze)=>ze===se?je:pe)}))},Pe=()=>{v(se=>({...se,models:[...se.models,""]}))},fe=se=>{v(je=>({...je,models:je.models.filter((le,pe)=>pe!==se)}))},ke=()=>{M(null),G(Qo),ee(!0)},Ee=()=>{M(null),G(Qo),ee(!1)},ve=async se=>{se.preventDefault(),B(null);try{const je=A.type==="stdio"?{type:"stdio",command:A.command,args:xA(A.args)}:{type:A.type,url:A.url},le=P?await Ve.mcpServers.update(P,je):await Ve.mcpServers.add(A.name,je);g(pe=>[le,...pe.filter(ze=>ze.name!==le.name)]),G(Qo),M(null),ee(!1),V(a(P?"settings.mcp.updated":"settings.mcp.added"))}catch(je){B(je instanceof Error?je.message:a("settings.mcp.saveFailed"))}},Se=se=>{M(se.name),G({name:se.name,type:se.type,command:se.command||"",args:(se.args||[]).join(", "),url:se.url||""}),ee(!0)},tt=async se=>{await Ve.mcpServers.remove(se),g(je=>je.filter(le=>le.name!==se))};return l.jsxs("div",{className:"settings-modal",role:"dialog","aria-label":a("settings.aria.dialog"),children:[l.jsx("div",{className:"settings-modal__backdrop",onClick:n}),l.jsxs("section",{className:"settings-modal__panel",children:[l.jsxs("header",{className:"settings-modal__header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"settings-modal__eyebrow",children:a("settings.eyebrow.workspace")}),l.jsx("h2",{children:a("settings.title")})]}),l.jsx(xt,{label:a("settings.aria.close"),onClick:n,children:l.jsx(Dn,{size:16})})]}),l.jsxs("div",{className:"settings-modal__body",children:[l.jsx("nav",{className:"settings-tabs","aria-label":a("settings.aria.sections"),children:hA.map(se=>{const je=se.icon;return l.jsxs("button",{className:c===se.id?"is-active":"",onClick:()=>u(se.id),type:"button",children:[l.jsx(je,{size:15}),l.jsx("span",{children:a(se.labelKey)})]},se.id)})}),l.jsxs("div",{className:"settings-content",children:[oe?l.jsx("p",{className:"settings-note",children:a("settings.loading")}):null,j?l.jsx("p",{className:"settings-note settings-note--error",children:j}):null,ce?l.jsx("p",{className:"settings-note",children:ce}):null,c==="account"?l.jsxs("section",{className:"settings-section",children:[l.jsx("h3",{children:a("settings.account.title")}),l.jsxs("dl",{className:"settings-kv",children:[l.jsxs("div",{children:[l.jsx("dt",{children:a("settings.account.username")}),l.jsx("dd",{children:(r==null?void 0:r.username)||"-"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:a("settings.account.userId")}),l.jsx("dd",{children:(r==null?void 0:r.id)||"-"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:a("settings.account.created")}),l.jsx("dd",{children:r!=null&&r.createdAt?new Date(r.createdAt).toLocaleString():"-"})]})]}),l.jsx("p",{className:"settings-note",children:a("settings.account.managedByHost")}),q?l.jsx("span",{className:"settings-version",children:q}):null]}):null,c==="providers"?l.jsxs("section",{className:"settings-section",children:[l.jsxs("div",{className:"settings-section__header",children:[l.jsxs("div",{children:[l.jsx("h3",{children:a("settings.providers.title")}),l.jsx("p",{children:a("settings.providers.desc")})]}),l.jsxs("div",{className:"provider-header-actions",children:[f.find(se=>se.isActive)?l.jsxs("span",{className:"provider-active-pill",children:[l.jsx(gs,{size:13}),(ft=f.find(se=>se.isActive))==null?void 0:ft.name]}):null,l.jsx("button",{className:"settings-button",onClick:X,type:"button",children:a("settings.providers.add")})]})]}),(()=>{const se=f.filter(pe=>pe.id.startsWith("shared_")),je=f.filter(pe=>!pe.id.startsWith("shared_")),le=pe=>l.jsxs("article",{className:"settings-list-item",children:[l.jsxs("div",{children:[l.jsxs("strong",{children:[l.jsx("span",{className:"provider-color-dot",style:{backgroundColor:pe.iconColor}}),pe.name,l.jsx("span",{className:`provider-health-dot provider-health-dot--${pe.healthStatus}`,title:a("settings.providers.statusTitle",{status:pe.healthStatus})})]}),l.jsx("span",{children:pe.baseUrl}),l.jsxs("small",{children:[pe.models.join(", ")||a("settings.providers.noModelList")," · ",pe.apiKeyMasked]}),l.jsx("div",{className:"provider-model-health-row",children:pe.modelHealth.map(ze=>l.jsxs("span",{className:`provider-model-pill provider-model-pill--${ze.status}`,title:ze.error||ze.status,children:[l.jsx("span",{className:`model-status-dot model-status-dot--${ze.status}`}),ze.model,ze.latencyMs!==void 0?` (${ze.latencyMs}ms)`:null]},ze.model))})]}),l.jsxs("div",{className:"settings-list-item__actions provider-actions",children:[l.jsx("button",{onClick:()=>$(pe),type:"button",children:a("settings.providers.edit")}),l.jsx("button",{disabled:ne===pe.id,onClick:()=>void J(pe.id),type:"button",children:ne===pe.id?l.jsx(Sv,{size:14,className:"spin"}):a("settings.providers.test")}),l.jsx("button",{disabled:pe.isActive,onClick:()=>void H(pe.id),type:"button",children:pe.isActive?l.jsx(gs,{size:14}):a("settings.providers.use")}),l.jsx("button",{disabled:pe.isActive,onClick:()=>void Q(pe.id),type:"button",children:a("settings.providers.remove")})]})]},pe.id);return l.jsxs(l.Fragment,{children:[se.length>0?l.jsxs("div",{className:"provider-group",children:[l.jsx("h4",{className:"provider-group-title",children:a("settings.providers.shared")}),l.jsx("div",{className:"settings-list",children:se.map(le)})]}):null,je.length>0?l.jsxs("div",{className:"provider-group",children:[l.jsx("h4",{className:"provider-group-title",children:a("settings.providers.private")}),l.jsx("div",{className:"settings-list",children:je.map(le)})]}):null]})})()]}):null,c==="mcp"?l.jsxs("section",{className:"settings-section",children:[l.jsxs("div",{className:"settings-section__header",children:[l.jsxs("div",{children:[l.jsx("h3",{children:a("settings.mcp.title")}),l.jsx("p",{children:a("settings.mcp.desc")})]}),l.jsx("button",{className:"settings-button",onClick:ke,type:"button",children:a("settings.mcp.addServer")})]}),l.jsx("div",{className:"settings-list",children:m.map(se=>l.jsxs("article",{className:"settings-list-item",children:[l.jsxs("div",{children:[l.jsx("strong",{children:se.name}),l.jsx("span",{children:se.type==="stdio"?[se.command,...se.args||[]].filter(Boolean).join(" "):se.url}),l.jsx("small",{children:se.type})]}),l.jsxs("div",{className:"settings-list-item__actions mcp-actions",children:[l.jsx("button",{onClick:()=>Se(se),type:"button",children:a("settings.mcp.edit")}),l.jsx("button",{onClick:()=>void tt(se.name),type:"button",children:a("settings.mcp.remove")})]})]},se.name))})]}):null,c==="preferences"?l.jsxs("section",{className:"settings-section",children:[l.jsx("h3",{children:a("settings.prefs.title")}),l.jsxs("div",{className:"settings-field",children:[l.jsx("span",{children:a("settings.prefs.theme")}),l.jsx(ms,{ariaLabel:a("settings.prefs.theme"),onChange:se=>s.setTheme(se),options:[{label:a("settings.prefs.themeLight"),value:"light"},{label:a("settings.prefs.themeDark"),value:"dark"},{label:a("settings.prefs.themeSystem"),value:"system"}],value:s.theme})]}),l.jsxs("div",{className:"settings-field",children:[l.jsx("span",{children:a("settings.prefs.language")}),l.jsx(ms,{ariaLabel:a("settings.prefs.language"),onChange:se=>s.setLanguage(se),options:[{label:"简体中文",value:"zh-CN"},{label:"English",value:"en-US"}],value:s.language})]}),l.jsxs("label",{className:"settings-check",children:[l.jsx("input",{checked:s.security.confirmDangerousActions,onChange:se=>s.setSecurity({...s.security,confirmDangerousActions:se.target.checked}),type:"checkbox"}),l.jsx("span",{children:a("settings.prefs.confirmDangerous")})]}),l.jsxs("label",{className:"settings-check",children:[l.jsx("input",{checked:s.notifications.agentDone,onChange:se=>s.setNotifications({...s.notifications,agentDone:se.target.checked}),type:"checkbox"}),l.jsx("span",{children:a("settings.prefs.notifyDone")})]})]}):null]})]})]}),_?l.jsxs("div",{className:"provider-form-modal",role:"dialog","aria-label":a(b?"settings.providerForm.editAria":"settings.providerForm.addAria"),children:[l.jsx("div",{className:"provider-form-modal__backdrop",onClick:re}),l.jsxs("form",{className:"provider-form provider-form--modal",onSubmit:L,children:[l.jsxs("header",{className:"provider-form-modal__header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"settings-modal__eyebrow",children:a("settings.providerForm.eyebrow")}),l.jsx("h3",{children:a(b?"settings.providerForm.editTitle":"settings.providerForm.addTitle")})]}),l.jsx(xt,{label:a("settings.providerForm.close"),onClick:re,children:l.jsx(Dn,{size:15})})]}),l.jsxs("div",{className:"provider-form__grid",children:[l.jsxs("label",{children:[l.jsx("span",{children:a("settings.providerForm.name")}),l.jsx("input",{placeholder:"Anthropic",required:!0,value:y.name,onChange:se=>v({...y,name:se.target.value})})]}),l.jsxs("label",{children:[l.jsx("span",{children:a("settings.providerForm.baseUrl")}),l.jsx("input",{placeholder:"https://api.anthropic.com",required:!0,value:y.baseUrl,onChange:se=>v({...y,baseUrl:se.target.value})})]}),l.jsxs("label",{className:"provider-form__key",children:[l.jsxs("span",{children:[a("settings.providerForm.apiKey")," ",b?a("settings.providerForm.apiKeyKeep"):""]}),l.jsx("input",{placeholder:b?y.apiKeyMasked||"****":"",required:!b,type:S?"text":"password",value:y.apiKey,onChange:se=>v({...y,apiKey:se.target.value})}),l.jsx("button",{"aria-label":a(S?"settings.providerForm.hideKey":"settings.providerForm.showKey"),onClick:()=>O(se=>!se),type:"button",children:S?l.jsx(Zh,{size:15}):l.jsx(wv,{size:15})})]}),l.jsxs("label",{children:[l.jsx("span",{children:a("settings.providerForm.notes")}),l.jsx("input",{placeholder:a("settings.providerForm.notesPlaceholder"),value:y.notes,onChange:se=>v({...y,notes:se.target.value})})]})]}),l.jsxs("div",{className:"provider-form__models",children:[l.jsxs("div",{className:"provider-form__models-header",children:[l.jsx("span",{children:a("settings.providerForm.models")}),l.jsxs("button",{onClick:Pe,type:"button",children:[l.jsx(hl,{size:13}),a("settings.providerForm.addModel")]})]}),l.jsx("div",{className:"provider-model-list",children:y.models.map((se,je)=>l.jsxs("label",{className:"provider-model-row",children:[l.jsx("input",{placeholder:"claude-sonnet-4-6",value:se,onChange:le=>ge(je,le.target.value)}),l.jsx("button",{"aria-label":a("settings.providerForm.removeModel"),disabled:y.models.length<=1,onClick:()=>fe(je),type:"button",children:l.jsx(gd,{size:14})})]},`${je}-${y.models.length}`))})]}),l.jsx("div",{className:"provider-form__appearance",children:l.jsxs("div",{children:[l.jsx("span",{children:a("settings.providerForm.color")}),l.jsx("div",{className:"provider-color-row",children:gA.map(se=>l.jsx("button",{"aria-label":a("settings.providerForm.useColor",{color:se}),className:y.iconColor===se?"is-selected":"",onClick:()=>v({...y,iconColor:se}),style:{backgroundColor:se},type:"button"},se))})]})}),l.jsxs("div",{className:"settings-actions provider-form-modal__actions",children:[l.jsx("button",{className:"settings-button settings-button--ghost",onClick:re,type:"button",children:a("settings.providerForm.cancel")}),l.jsx("button",{className:"settings-button",type:"submit",children:a(b?"settings.providerForm.save":"settings.providerForm.addTitle")})]})]})]}):null,W?l.jsxs("div",{className:"provider-form-modal",role:"dialog","aria-label":a(P?"settings.mcpForm.editAria":"settings.mcpForm.addAria"),children:[l.jsx("div",{className:"provider-form-modal__backdrop",onClick:Ee}),l.jsxs("form",{className:"provider-form provider-form--modal mcp-form--modal",onSubmit:ve,children:[l.jsxs("header",{className:"provider-form-modal__header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"settings-modal__eyebrow",children:a("settings.mcpForm.eyebrow")}),l.jsx("h3",{children:a(P?"settings.mcpForm.editTitle":"settings.mcpForm.addTitle")})]}),l.jsx(xt,{label:a("settings.mcpForm.close"),onClick:Ee,children:l.jsx(Dn,{size:15})})]}),l.jsxs("div",{className:"provider-form__grid",children:[l.jsxs("label",{children:[l.jsx("span",{children:a("settings.mcpForm.name")}),l.jsx("input",{disabled:!!P,placeholder:"filesystem",required:!0,value:A.name,onChange:se=>G({...A,name:se.target.value})})]}),l.jsxs("div",{className:"provider-form__field",children:[l.jsx("span",{children:a("settings.mcpForm.transport")}),l.jsx(ms,{ariaLabel:a("settings.mcpForm.transportAria"),onChange:se=>G({...A,type:se}),options:[{label:"stdio",value:"stdio"},{label:"http",value:"http"},{label:"sse",value:"sse"}],value:A.type})]}),A.type==="stdio"?l.jsxs(l.Fragment,{children:[l.jsxs("label",{children:[l.jsx("span",{children:a("settings.mcpForm.command")}),l.jsx("input",{placeholder:"npx",required:!0,value:A.command,onChange:se=>G({...A,command:se.target.value})})]}),l.jsxs("label",{children:[l.jsx("span",{children:a("settings.mcpForm.arguments")}),l.jsx("input",{placeholder:"-y, @modelcontextprotocol/server-filesystem, /workspace",value:A.args,onChange:se=>G({...A,args:se.target.value})})]})]}):l.jsxs("label",{className:"mcp-form__wide",children:[l.jsx("span",{children:a("settings.mcpForm.url")}),l.jsx("input",{placeholder:"https://example.com/mcp",required:!0,value:A.url,onChange:se=>G({...A,url:se.target.value})})]})]}),l.jsxs("div",{className:"settings-actions provider-form-modal__actions",children:[l.jsx("button",{className:"settings-button settings-button--ghost",onClick:Ee,type:"button",children:a("settings.mcpForm.cancel")}),l.jsx("button",{className:"settings-button",type:"submit",children:a(P?"settings.mcpForm.save":"settings.mcpForm.addTitle")})]})]})]}):null]})}const vA={principal:{displayName:"Principal Investigator",role:"profile.principal.role",description:"profile.principal.desc",accent:"info",defaultTools:["send_message","create_agent","destroy_agent","record_trace","search_web","fetch_url"]},librarian:{displayName:"Librarian",role:"profile.librarian.role",description:"profile.librarian.desc",accent:"info",defaultTools:["send_message","record_trace","search_web","fetch_url"]},trace:{displayName:"Trace Agent",role:"profile.trace.role",description:"profile.trace.desc",accent:"neutral",defaultTools:["create_trace_node","update_trace_node","add_trace_relation","get_trace_graph","read_session_history","Read"]},experimentalist:{displayName:"Experimentalist",role:"profile.experimentalist.role",description:"profile.experimentalist.desc",accent:"success",defaultTools:["Read","Write","Grep","Bash","send_message"]},engineer:{displayName:"Engineer",role:"profile.engineer.role",description:"profile.engineer.desc",accent:"success",defaultTools:["Read","Write","Grep","Bash","send_message"]},writer:{displayName:"Writer",role:"profile.writer.role",description:"profile.writer.desc",accent:"warning",defaultTools:["Read","Write","Grep","Bash","send_message"]},user:{displayName:"You",role:"profile.user.role",description:"profile.user.desc",accent:"neutral",defaultTools:[]}},wA={displayName:"Custom Agent",role:"profile.default.role",description:"profile.default.desc",accent:"neutral",defaultTools:["send_message","record_trace","search_web","fetch_url"]};function Pd(e){return vA[e]??wA}const Fu=["principal","librarian","trace","experimentalist","engineer","writer"];function _A(e){if(e&&typeof e=="object"&&!Array.isArray(e))return e;if(typeof e!="string"||!e.trim())return null;try{const n=JSON.parse(e);return n&&typeof n=="object"&&!Array.isArray(n)?n:null}catch{return null}}function kA(e){return e?e==="send_message"?!0:e.endsWith("__send_message")||e.endsWith(":send_message"):!1}function Fd(e){if(e.kind!=="tool"||!kA(e.toolName))return null;const n=_A(e.toolInput);if(!n)return null;const r=e.agent||"principal",s=typeof n.to=="string"&&n.to?n.to:"principal";if(r===s||r==="trace"||s==="trace")return null;const a=typeof n.content=="string"?n.content:"",c=typeof n.type=="string"&&n.type?n.type:typeof n.msg_type=="string"?n.msg_type:void 0;return{id:e.id,from:r,to:s,content:a,msgType:c,timestamp:e.createdAt,streaming:e.streaming}}function EA(e){const n=new Map;for(const r of e){const s=Fd(r);if(!s)continue;const a=`${s.from}->${s.to}`,c=n.get(a)??{key:a,from:s.from,to:s.to,messages:[],lastTimestamp:s.timestamp};c.messages.push(s),s.timestamp>c.lastTimestamp&&(c.lastTimestamp=s.timestamp),n.set(a,c)}for(const r of n.values())r.messages.sort((s,a)=>s.timestamp.localeCompare(a.timestamp));return Array.from(n.values())}function SA(e,n){let r=0,s=0;for(const a of n)a.from===e&&(r+=a.messages.length),a.to===e&&(s+=a.messages.length);return{sent:r,received:s}}function zd(e){const n=e.toLowerCase();return n==="principal"||n==="user"?Ku:n.includes("librari")?hv:n.includes("data")||n.includes("analy")?gv:n.includes("trace")?ma:n.includes("experiment")?Tv:n.includes("engineer")?ha:n.includes("writer")?qu:n.includes("idea")||n.includes("creat")?Bv:ml}function Bd(e){switch(Pd(e).accent){case"info":return"var(--color-info)";case"success":return"var(--color-success)";case"warning":return"var(--color-warning)";case"danger":return"var(--color-danger)";default:return"var(--color-text-subtle)"}}function bs(e,n){const r=new Date(e).getTime();if(!Number.isFinite(r))return"";const s=n-r;return s<1e3?"just now":s<6e4?`${Math.floor(s/1e3)}s ago`:s<36e5?`${Math.floor(s/6e4)}m ago`:new Date(e).toLocaleTimeString()}function Ci(e){return e?e.includes("delegate")||e.includes("request")?"delegate":e.includes("result")||e.includes("reply")||e.includes("response")?"result":"neutral":"neutral"}function dl(e){return e==="running"||e==="in_progress"?"running":e==="error"||e==="failed"?"error":e==="stopped"||e==="destroyed"?"stopped":"idle"}const ki=e=>{const n=new Date(e).getTime();return Number.isFinite(n)?n:0};function Aa(e){return e.map(n=>Fd(n)).filter(n=>n!==null)}function NA(e,n,r=36e5,s=30){const a=n-r,c=r/s,u=new Array(s).fill(0);for(const f of Aa(e)){const p=ki(f.timestamp);if(p<a||p>n)continue;const m=Math.min(s-1,Math.floor((p-a)/c));u[m]+=1}return u.map((f,p)=>({time:a+p*c,count:f}))}function CA(e){const n=new Map,r=a=>{let c=n.get(a);return c||(c={name:a,sent:0,received:0,total:0},n.set(a,c)),c};for(const a of e)r(a.from).sent+=a.messages.length,r(a.to).received+=a.messages.length;const s=Array.from(n.values());return s.forEach(a=>a.total=a.sent+a.received),s.sort((a,c)=>c.total-a.total),s}function TA(e){const n={delegate:0,result:0,other:0};for(const r of Aa(e)){const s=Ci(r.msgType);s==="delegate"?n.delegate+=1:s==="result"?n.result+=1:n.other+=1}return n}function ox(e){const n=Aa(e).sort((a,c)=>ki(a.timestamp)-ki(c.timestamp)),r=[],s=new Set;return n.forEach(a=>{if(Ci(a.msgType)!=="delegate")return;const c=ki(a.timestamp);for(let u=0;u<n.length;u++){if(s.has(u))continue;const f=n[u];if(Ci(f.msgType)!=="result"||f.from!==a.to)continue;const p=ki(f.timestamp);if(!(p<=c)){s.add(u),r.push(p-c);break}}}),r}function lx(e){if(e.length===0)return null;const n=[...e].sort((a,c)=>a-c),r=a=>{const c=(n.length-1)*a,u=Math.floor(c),f=Math.ceil(c);return u===f?n[u]:n[u]+(n[f]-n[u])*(c-u)},s=n.reduce((a,c)=>a+c,0)/n.length;return{count:n.length,min:n[0],q1:r(.25),median:r(.5),q3:r(.75),max:n[n.length-1],mean:s}}function AA(e){const n=new Map;for(const s of Aa(e)){const a=n.get(s.from)??{chars:0,msgs:0};a.chars+=s.content.length,a.msgs+=1,n.set(s.from,a)}const r=Array.from(n.entries()).map(([s,{chars:a,msgs:c}])=>({name:s,sentMsgs:c,avgLen:c?Math.round(a/c):0,tokens:Math.ceil(a/4)}));return r.sort((s,a)=>a.tokens-s.tokens),r}function MA(e,n,r,s=20){const a=Aa(e),c=a.map(b=>ki(b.timestamp)).filter(b=>b>0),u=c.length?Math.min(...c):r,p=Math.max(1,r-u)/s,m=n.filter(b=>a.some(w=>w.from===b||w.to===b)),g=new Map(m.map((b,w)=>[b,w])),y=m.map(()=>new Array(s).fill(0));let v=0;for(const b of a){const w=ki(b.timestamp),_=Math.min(s-1,Math.max(0,Math.floor((w-u)/p)));for(const E of[b.from,b.to]){const S=g.get(E);S!==void 0&&(y[S][_]+=1,y[S][_]>v&&(v=y[S][_]))}}return{agents:m,buckets:s,bucketMs:p,startMs:u,counts:y,max:v}}function RA(e){return e.filter(n=>n.kind==="error").length}function Si(e){return Number.isFinite(e)?e<1e3?`${Math.round(e)}ms`:e<6e4?`${(e/1e3).toFixed(1)}s`:`${(e/6e4).toFixed(1)}m`:"—"}function IA(e,n,r){const s=n.filter(_=>_.agent===e);let a=0,c=0,u=0,f=0,p=0;for(const _ of s)_.role==="assistant"?a++:_.role==="system"&&f++,_.kind==="thinking"?c++:_.kind==="tool"&&u++,p+=(_.content||"").length;const m={};let g=0;for(const _ of s)_.kind==="tool"&&_.toolName&&(g++,m[_.toolName]=(m[_.toolName]||0)+1);const y=Object.entries(m).map(([_,E])=>({name:_,count:E})).sort((_,E)=>E.count-_.count).slice(0,3);let v=0,b=0;const w=new Set;for(const _ of r)_.from===e&&(v+=_.messages.length,w.add(_.to)),_.to===e&&(b+=_.messages.length,w.add(_.from));return{name:e,assistantMessages:a,reasoningMessages:c,toolMessages:u,systemMessages:f,totalMessages:s.length,totalChars:p,estimatedTokens:Math.ceil(p/4),toolCalls:g,toolCallsByName:m,topTools:y,sentMessages:v,receivedMessages:b,communicationPartners:Array.from(w).sort()}}function OA(e,n){const r=new Set;for(const a of e)a.agent&&r.add(a.agent);for(const a of n)r.add(a.from),r.add(a.to);const s=new Map;for(const a of r)s.set(a,IA(a,e,n));return s}function jA(e,n){let r=0,s=0,a=0;for(const c of n.values())r+=c.totalMessages,s+=c.toolCalls,a+=c.estimatedTokens;return{messagePercent:r>0?e.totalMessages/r*100:0,toolCallPercent:s>0?e.toolCalls/s*100:0,tokenPercent:a>0?e.estimatedTokens/a*100:0}}const zu=240,os=12;function LA(e,n){return e.length<=n?e:`${e.slice(0,n-1)}…`}function DA({data:e,now:n,anchor:r,container:s}){const a=zd(e.name),c=Pd(e.name),u=e.isLive?dl(e.status):"dormant",p=r.left+r.width+os+zu>s.width?"left":"right",m=p==="right"?r.left+r.width+os:Math.max(os,r.left-os-zu),g=r.top+r.height/2,y=Math.min(Math.max(os,g),s.height-os);return l.jsxs("div",{className:`agent-network__tooltip agent-network__tooltip--${p}`,role:"tooltip",style:{left:m,top:y,width:zu},children:[l.jsxs("div",{className:"agent-network__tooltip-head",children:[l.jsx("span",{className:"agent-network__tooltip-avatar",style:{"--agent-accent":PA(c.accent)},children:l.jsx(a,{size:14})}),l.jsxs("div",{className:"agent-network__tooltip-id",children:[l.jsx("strong",{children:e.name}),l.jsx("span",{children:c.role})]})]}),l.jsx("div",{className:"agent-network__tooltip-row",children:l.jsxs("span",{className:`agent-network__tooltip-status agent-network__tooltip-status--${u}`,children:[l.jsx("i",{className:`agent-network__tooltip-dot agent-network__tooltip-dot--${u}`}),e.isLive?e.status:"dormant"]})}),e.isLive?l.jsx("p",{className:"agent-network__tooltip-task",children:e.task?LA(e.task,60):"Idle — waiting for instructions"}):l.jsx("p",{className:"agent-network__tooltip-task agent-network__tooltip-task--dormant",children:"Not yet spawned by Principal"}),e.isLive&&e.updatedAt?l.jsxs("p",{className:"agent-network__tooltip-meta",children:["Updated ",bs(e.updatedAt,n)]}):null,l.jsxs("div",{className:"agent-network__tooltip-counts",children:[l.jsxs("span",{children:[l.jsx(lg,{size:11})," Sent ",e.sent]}),l.jsxs("span",{children:[l.jsx(ys,{size:11})," Received ",e.received]})]})]})}function PA(e){switch(e){case"info":return"var(--color-info)";case"success":return"var(--color-success)";case"warning":return"var(--color-warning)";case"danger":return"var(--color-danger)";default:return"var(--color-text-subtle)"}}function FA({agents:e,edges:n,messages:r,totalNodes:s,liveCount:a,now:c}){const u=yt(),f=n.reduce((v,b)=>v+b.messages.length,0),p=Math.max(0,s-a),m=e.filter(v=>v.status==="running"||v.status==="in_progress").length,g=n.reduce((v,b)=>b.lastTimestamp>v?b.lastTimestamp:v,""),y=lx(ox(r));return l.jsxs("div",{className:"agent-network__overview",children:[l.jsxs("header",{className:"agent-network__overview-head",children:[l.jsx("span",{className:"agent-network__overview-icon",children:l.jsx(pd,{size:16})}),l.jsx("h3",{children:u("overview.title")})]}),l.jsxs("dl",{className:"agent-network__overview-stats",children:[l.jsxs("div",{children:[l.jsxs("dt",{children:[l.jsx(ug,{size:13})," ",u("overview.agents")]}),l.jsxs("dd",{children:[u("overview.liveDormant",{live:a,dormant:p}),l.jsx("span",{className:"agent-network__overview-sub",children:u("overview.total",{total:s})})]})]}),l.jsxs("div",{children:[l.jsxs("dt",{children:[l.jsx($u,{size:13})," ",u("overview.runningNow")]}),l.jsx("dd",{children:m})]}),l.jsxs("div",{children:[l.jsxs("dt",{children:[l.jsx(ys,{size:13})," ",u("overview.messages")]}),l.jsxs("dd",{children:[f,l.jsx("span",{className:"agent-network__overview-sub",children:u("overview.acrossLinks",{count:n.length})})]})]}),l.jsxs("div",{children:[l.jsxs("dt",{children:[l.jsx(hd,{size:13})," ",u("overview.avgResponse")]}),l.jsxs("dd",{children:[y?Si(y.mean):"—",y?l.jsx("span",{className:"agent-network__overview-sub",children:u("overview.median",{value:Si(y.median)})}):null]})]}),l.jsxs("div",{children:[l.jsxs("dt",{children:[l.jsx($u,{size:13})," ",u("overview.lastActivity")]}),l.jsx("dd",{children:g?bs(g,c):"—"})]})]}),l.jsxs("p",{className:"agent-network__overview-tip",children:[u("overview.tipPrefix"),l.jsx("strong",{children:u("network.tab.analytics")})," / ",l.jsx("strong",{children:u("network.tab.timeline")}),u("overview.tipSuffix")]})]})}function zA({agents:e,messages:n,edges:r,now:s}){const a=yt(),c=N.useMemo(()=>NA(n,s),[n,s]),u=N.useMemo(()=>CA(r),[r]),f=N.useMemo(()=>TA(n),[n]),p=N.useMemo(()=>lx(ox(n)),[n]),m=N.useMemo(()=>AA(n),[n]),g=N.useMemo(()=>MA(n,e.map(_=>_.name),s),[n,e,s]),y=N.useMemo(()=>RA(n),[n]),v=r.reduce((_,E)=>_+E.messages.length,0),b=e.length,w=e.filter(_=>_.status==="running"||_.status==="in_progress").length;return v===0?l.jsxs("div",{className:"agent-analytics__empty",children:[l.jsx(ys,{size:20}),l.jsx("p",{children:a("analytics.empty")})]}):l.jsxs("div",{className:"agent-analytics",children:[l.jsxs("div",{className:"agent-analytics__cards",children:[l.jsxs("div",{className:"agent-analytics__card",children:[l.jsxs("span",{className:"agent-analytics__card-label",children:[l.jsx(ys,{size:12})," ",a("analytics.card.totalMessages")]}),l.jsx("span",{className:"agent-analytics__card-value",children:v}),l.jsx(BA,{values:c.map(_=>_.count)})]}),l.jsxs("div",{className:"agent-analytics__card",children:[l.jsxs("span",{className:"agent-analytics__card-label",children:[l.jsx(ug,{size:12})," ",a("analytics.card.activeAgents")]}),l.jsx("span",{className:"agent-analytics__card-value",children:b}),l.jsx("span",{className:"agent-analytics__card-sub",children:a("analytics.card.runningNow",{count:w})})]}),l.jsxs("div",{className:"agent-analytics__card",children:[l.jsxs("span",{className:"agent-analytics__card-label",children:[l.jsx(hd,{size:12})," ",a("analytics.card.avgLatency")]}),l.jsx("span",{className:"agent-analytics__card-value",children:p?Si(p.mean):"—"}),l.jsx("span",{className:"agent-analytics__card-sub",children:p?a("analytics.card.median",{value:Si(p.median)}):a("analytics.card.noPairs")})]}),l.jsxs("div",{className:`agent-analytics__card ${y>0?"agent-analytics__card--danger":"agent-analytics__card--ok"}`,children:[l.jsxs("span",{className:"agent-analytics__card-label",children:[l.jsx(ka,{size:12})," ",a("analytics.card.errors")]}),l.jsx("span",{className:"agent-analytics__card-value",children:y}),l.jsx("span",{className:"agent-analytics__card-sub",children:a(y===0?"analytics.card.allClear":"analytics.card.needsAttention")})]})]}),l.jsxs("section",{className:"agent-analytics__chart",children:[l.jsxs("h4",{className:"agent-analytics__chart-title",children:[l.jsx($v,{size:13})," ",a("analytics.chart.volume")]}),l.jsx(UA,{values:c.map(_=>_.count)})]}),l.jsxs("section",{className:"agent-analytics__chart",children:[l.jsx("h4",{className:"agent-analytics__chart-title",children:a("analytics.chart.load")}),l.jsx($A,{rows:u})]}),l.jsxs("section",{className:"agent-analytics__chart",children:[l.jsx("h4",{className:"agent-analytics__chart-title",children:a("analytics.chart.types")}),l.jsx(HA,{dist:f})]}),p?l.jsxs("section",{className:"agent-analytics__chart",children:[l.jsx("h4",{className:"agent-analytics__chart-title",children:a("analytics.chart.latency")}),l.jsx(qA,{stats:p})]}):null,l.jsxs("section",{className:"agent-analytics__chart",children:[l.jsx("h4",{className:"agent-analytics__chart-title",children:a("analytics.chart.tokens")}),l.jsxs("table",{className:"agent-analytics__table",children:[l.jsx("thead",{children:l.jsxs("tr",{children:[l.jsx("th",{children:a("analytics.table.agent")}),l.jsx("th",{children:a("analytics.table.msgs")}),l.jsx("th",{children:a("analytics.table.avgLen")}),l.jsx("th",{children:a("analytics.table.tokens")})]})}),l.jsx("tbody",{children:m.map(_=>l.jsxs("tr",{children:[l.jsx("td",{children:_.name}),l.jsx("td",{children:_.sentMsgs}),l.jsx("td",{children:_.avgLen}),l.jsx("td",{children:_.tokens.toLocaleString()})]},_.name))})]})]}),g.agents.length>0?l.jsxs("section",{className:"agent-analytics__chart",children:[l.jsx("h4",{className:"agent-analytics__chart-title",children:a("analytics.chart.heatmap")}),l.jsx(KA,{heatmap:g})]}):null]})}function BA({values:e}){if(e.length===0)return null;const s=Math.max(1,...e),a=e.length>1?200/(e.length-1):200,c=e.map((u,f)=>`${f*a},${28-u/s*26-1}`).join(" ");return l.jsx("svg",{className:"agent-analytics__sparkline",viewBox:"0 0 200 28",preserveAspectRatio:"none","aria-hidden":"true",children:l.jsx("polyline",{points:c,fill:"none",stroke:"var(--color-info)",strokeWidth:"1.5"})})}function UA({values:e}){const n=yt(),r=320,s=110,a=6,c=Math.max(1,...e),u=e.length>1?(r-a*2)/(e.length-1):r,p=e.map((g,y)=>({x:a+y*u,y:s-a-g/c*(s-a*2)})).map(g=>`${g.x},${g.y}`).join(" "),m=`${a},${s-a} ${p} ${a+(e.length-1)*u},${s-a}`;return l.jsxs("svg",{className:"agent-analytics__svg",viewBox:`0 0 ${r} ${s}`,role:"img","aria-label":n("analytics.aria.volume"),children:[l.jsx("polygon",{points:m,fill:"color-mix(in srgb, var(--color-info) 16%, transparent)",stroke:"none"}),l.jsx("polyline",{points:p,fill:"none",stroke:"var(--color-info)",strokeWidth:"1.75",strokeLinejoin:"round"})]})}function $A({rows:e}){const n=yt();if(e.length===0)return l.jsx("p",{className:"agent-analytics__hint",children:"No traffic yet."});const r=Math.max(1,...e.map(p=>p.total)),s=22,a=96,c=320,u=c-a-36,f=e.length*s+4;return l.jsx("svg",{className:"agent-analytics__svg",viewBox:`0 0 ${c} ${f}`,role:"img","aria-label":n("analytics.aria.load"),children:e.map((p,m)=>{const g=m*s+4,y=p.total/r*u;return l.jsxs("g",{children:[l.jsx("text",{x:0,y:g+11,className:"agent-analytics__bar-label",children:p.name.length>12?`${p.name.slice(0,11)}…`:p.name}),l.jsx("rect",{x:a,y:g+2,width:Math.max(2,y),height:s-8,rx:2,fill:Bd(p.name),opacity:.85}),l.jsx("text",{x:a+y+6,y:g+11,className:"agent-analytics__bar-value",children:p.total})]},p.name)})})}function HA({dist:e}){const n=yt(),r=[{key:"delegate",value:e.delegate,color:"var(--color-info)"},{key:"result",value:e.result,color:"var(--color-success)"},{key:"other",value:e.other,color:"var(--color-text-subtle)"}].filter(m=>m.value>0),s=r.reduce((m,g)=>m+g.value,0);if(s===0)return l.jsx("p",{className:"agent-analytics__hint",children:"No typed messages."});const a=55,c=55,u=48;let f=-Math.PI/2;const p=r.map(m=>{const g=m.value/s,y=f,v=f+g*Math.PI*2;f=v;const b=a+u*Math.cos(y),w=c+u*Math.sin(y),_=a+u*Math.cos(v),E=c+u*Math.sin(v),S=v-y>Math.PI?1:0;return{d:r.length===1?`M ${a-u} ${c} a ${u} ${u} 0 1 0 ${u*2} 0 a ${u} ${u} 0 1 0 ${-u*2} 0`:`M ${a} ${c} L ${b} ${w} A ${u} ${u} 0 ${S} 1 ${_} ${E} Z`,color:m.color,key:m.key}});return l.jsxs("div",{className:"agent-analytics__pie-wrap",children:[l.jsxs("svg",{className:"agent-analytics__pie",viewBox:"0 0 110 110",role:"img","aria-label":n("analytics.aria.types"),children:[p.map(m=>l.jsx("path",{d:m.d,fill:m.color,stroke:"var(--color-surface)",strokeWidth:"1"},m.key)),l.jsx("circle",{cx:a,cy:c,r:22,fill:"var(--color-surface-raised)"}),l.jsx("text",{x:a,y:c+4,textAnchor:"middle",className:"agent-analytics__pie-total",children:s})]}),l.jsx("ul",{className:"agent-analytics__legend",children:r.map(m=>l.jsxs("li",{children:[l.jsx("i",{style:{background:m.color}})," ",m.key," (",m.value,")"]},m.key))})]})}function qA({stats:e}){const n=yt(),r=320,s=56,a=14,c=Math.max(1,e.max-e.min),u=p=>a+(p-e.min)/c*(r-a*2),f=s/2;return l.jsxs("div",{children:[l.jsxs("svg",{className:"agent-analytics__svg",viewBox:`0 0 ${r} ${s}`,role:"img","aria-label":n("analytics.aria.latency"),children:[l.jsx("line",{x1:u(e.min),x2:u(e.max),y1:f,y2:f,stroke:"var(--color-border-strong)",strokeWidth:"1.5"}),l.jsx("line",{x1:u(e.min),x2:u(e.min),y1:f-8,y2:f+8,stroke:"var(--color-border-strong)"}),l.jsx("line",{x1:u(e.max),x2:u(e.max),y1:f-8,y2:f+8,stroke:"var(--color-border-strong)"}),l.jsx("rect",{x:u(e.q1),y:f-12,width:Math.max(2,u(e.q3)-u(e.q1)),height:24,rx:3,fill:"color-mix(in srgb, var(--color-info) 20%, transparent)",stroke:"var(--color-info)"}),l.jsx("line",{x1:u(e.median),x2:u(e.median),y1:f-12,y2:f+12,stroke:"var(--color-info)",strokeWidth:"2"})]}),l.jsxs("div",{className:"agent-analytics__boxplot-legend",children:[l.jsxs("span",{children:["min ",Si(e.min)]}),l.jsxs("span",{children:["med ",Si(e.median)]}),l.jsxs("span",{children:["max ",Si(e.max)]})]})]})}function KA({heatmap:e}){const n=yt(),r=14,s=2,a=90,c=a+e.buckets*(r+s),u=e.agents.length*(r+s)+2;return l.jsx("svg",{className:"agent-analytics__svg",viewBox:`0 0 ${c} ${u}`,role:"img","aria-label":n("analytics.aria.heatmap"),children:e.agents.map((f,p)=>l.jsxs("g",{children:[l.jsx("text",{x:0,y:p*(r+s)+r-2,className:"agent-analytics__bar-label",children:f.length>11?`${f.slice(0,10)}…`:f}),e.counts[p].map((m,g)=>{const y=e.max>0?m/e.max:0;return l.jsx("rect",{x:a+g*(r+s),y:p*(r+s),width:r,height:r,rx:2,fill:m===0?"var(--color-surface-soft)":`color-mix(in srgb, var(--color-info) ${Math.round(15+y*75)}%, transparent)`,children:l.jsx("title",{children:`${f} · bucket ${g+1}: ${m} msg`})},g)})]},f))})}function WA(e,n){if(e.match(/^[a-z]+:\/\//i))return e;if(e.match(/^\/\//))return window.location.protocol+e;if(e.match(/^[a-z]+:/i))return e;const r=document.implementation.createHTMLDocument(),s=r.createElement("base"),a=r.createElement("a");return r.head.appendChild(s),r.body.appendChild(a),n&&(s.href=n),a.href=e,a.href}const VA=(()=>{let e=0;const n=()=>`0000${(Math.random()*36**4<<0).toString(36)}`.slice(-4);return()=>(e+=1,`u${n()}${e}`)})();function Jr(e){const n=[];for(let r=0,s=e.length;r<s;r++)n.push(e[r]);return n}let ls=null;function cx(e={}){return ls||(e.includeStyleProperties?(ls=e.includeStyleProperties,ls):(ls=Jr(window.getComputedStyle(document.documentElement)),ls))}function fl(e,n){const s=(e.ownerDocument.defaultView||window).getComputedStyle(e).getPropertyValue(n);return s?parseFloat(s.replace("px","")):0}function GA(e){const n=fl(e,"border-left-width"),r=fl(e,"border-right-width");return e.clientWidth+n+r}function YA(e){const n=fl(e,"border-top-width"),r=fl(e,"border-bottom-width");return e.clientHeight+n+r}function ux(e,n={}){const r=n.width||GA(e),s=n.height||YA(e);return{width:r,height:s}}function XA(){let e,n;try{n=process}catch{}const r=n&&n.env?n.env.devicePixelRatio:null;return r&&(e=parseInt(r,10),Number.isNaN(e)&&(e=1)),e||window.devicePixelRatio||1}const jn=16384;function QA(e){(e.width>jn||e.height>jn)&&(e.width>jn&&e.height>jn?e.width>e.height?(e.height*=jn/e.width,e.width=jn):(e.width*=jn/e.height,e.height=jn):e.width>jn?(e.height*=jn/e.width,e.width=jn):(e.width*=jn/e.height,e.height=jn))}function pl(e){return new Promise((n,r)=>{const s=new Image;s.onload=()=>{s.decode().then(()=>{requestAnimationFrame(()=>n(s))})},s.onerror=r,s.crossOrigin="anonymous",s.decoding="async",s.src=e})}async function ZA(e){return Promise.resolve().then(()=>new XMLSerializer().serializeToString(e)).then(encodeURIComponent).then(n=>`data:image/svg+xml;charset=utf-8,${n}`)}async function JA(e,n,r){const s="http://www.w3.org/2000/svg",a=document.createElementNS(s,"svg"),c=document.createElementNS(s,"foreignObject");return a.setAttribute("width",`${n}`),a.setAttribute("height",`${r}`),a.setAttribute("viewBox",`0 0 ${n} ${r}`),c.setAttribute("width","100%"),c.setAttribute("height","100%"),c.setAttribute("x","0"),c.setAttribute("y","0"),c.setAttribute("externalResourcesRequired","true"),a.appendChild(c),c.appendChild(e),ZA(a)}const Tn=(e,n)=>{if(e instanceof n)return!0;const r=Object.getPrototypeOf(e);return r===null?!1:r.constructor.name===n.name||Tn(r,n)};function eM(e){const n=e.getPropertyValue("content");return`${e.cssText} content: '${n.replace(/'|"/g,"")}';`}function tM(e,n){return cx(n).map(r=>{const s=e.getPropertyValue(r),a=e.getPropertyPriority(r);return`${r}: ${s}${a?" !important":""};`}).join(" ")}function nM(e,n,r,s){const a=`.${e}:${n}`,c=r.cssText?eM(r):tM(r,s);return document.createTextNode(`${a}{${c}}`)}function Lh(e,n,r,s){const a=window.getComputedStyle(e,r),c=a.getPropertyValue("content");if(c===""||c==="none")return;const u=VA();try{n.className=`${n.className} ${u}`}catch{return}const f=document.createElement("style");f.appendChild(nM(u,r,a,s)),n.appendChild(f)}function rM(e,n,r){Lh(e,n,":before",r),Lh(e,n,":after",r)}const Dh="application/font-woff",Ph="image/jpeg",iM={woff:Dh,woff2:Dh,ttf:"application/font-truetype",eot:"application/vnd.ms-fontobject",png:"image/png",jpg:Ph,jpeg:Ph,gif:"image/gif",tiff:"image/tiff",svg:"image/svg+xml",webp:"image/webp"};function sM(e){const n=/\.([^./]*?)$/g.exec(e);return n?n[1]:""}function Ud(e){const n=sM(e).toLowerCase();return iM[n]||""}function aM(e){return e.split(/,/)[1]}function ld(e){return e.search(/^(data:)/)!==-1}function oM(e,n){return`data:${n};base64,${e}`}async function dx(e,n,r){const s=await fetch(e,n);if(s.status===404)throw new Error(`Resource "${s.url}" not found`);const a=await s.blob();return new Promise((c,u)=>{const f=new FileReader;f.onerror=u,f.onloadend=()=>{try{c(r({res:s,result:f.result}))}catch(p){u(p)}},f.readAsDataURL(a)})}const Bu={};function lM(e,n,r){let s=e.replace(/\?.*/,"");return r&&(s=e),/ttf|otf|eot|woff2?/i.test(s)&&(s=s.replace(/.*\//,"")),n?`[${n}]${s}`:s}async function $d(e,n,r){const s=lM(e,n,r.includeQueryParams);if(Bu[s]!=null)return Bu[s];r.cacheBust&&(e+=(/\?/.test(e)?"&":"?")+new Date().getTime());let a;try{const c=await dx(e,r.fetchRequestInit,({res:u,result:f})=>(n||(n=u.headers.get("Content-Type")||""),aM(f)));a=oM(c,n)}catch(c){a=r.imagePlaceholder||"";let u=`Failed to fetch resource: ${e}`;c&&(u=typeof c=="string"?c:c.message),u&&console.warn(u)}return Bu[s]=a,a}async function cM(e){const n=e.toDataURL();return n==="data:,"?e.cloneNode(!1):pl(n)}async function uM(e,n){if(e.currentSrc){const c=document.createElement("canvas"),u=c.getContext("2d");c.width=e.clientWidth,c.height=e.clientHeight,u==null||u.drawImage(e,0,0,c.width,c.height);const f=c.toDataURL();return pl(f)}const r=e.poster,s=Ud(r),a=await $d(r,s,n);return pl(a)}async function dM(e,n){var r;try{if(!((r=e==null?void 0:e.contentDocument)===null||r===void 0)&&r.body)return await kl(e.contentDocument.body,n,!0)}catch{}return e.cloneNode(!1)}async function fM(e,n){return Tn(e,HTMLCanvasElement)?cM(e):Tn(e,HTMLVideoElement)?uM(e,n):Tn(e,HTMLIFrameElement)?dM(e,n):e.cloneNode(fx(e))}const pM=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SLOT",fx=e=>e.tagName!=null&&e.tagName.toUpperCase()==="SVG";async function mM(e,n,r){var s,a;if(fx(n))return n;let c=[];return pM(e)&&e.assignedNodes?c=Jr(e.assignedNodes()):Tn(e,HTMLIFrameElement)&&(!((s=e.contentDocument)===null||s===void 0)&&s.body)?c=Jr(e.contentDocument.body.childNodes):c=Jr(((a=e.shadowRoot)!==null&&a!==void 0?a:e).childNodes),c.length===0||Tn(e,HTMLVideoElement)||await c.reduce((u,f)=>u.then(()=>kl(f,r)).then(p=>{p&&n.appendChild(p)}),Promise.resolve()),n}function hM(e,n,r){const s=n.style;if(!s)return;const a=window.getComputedStyle(e);a.cssText?(s.cssText=a.cssText,s.transformOrigin=a.transformOrigin):cx(r).forEach(c=>{let u=a.getPropertyValue(c);c==="font-size"&&u.endsWith("px")&&(u=`${Math.floor(parseFloat(u.substring(0,u.length-2)))-.1}px`),Tn(e,HTMLIFrameElement)&&c==="display"&&u==="inline"&&(u="block"),c==="d"&&n.getAttribute("d")&&(u=`path(${n.getAttribute("d")})`),s.setProperty(c,u,a.getPropertyPriority(c))})}function gM(e,n){Tn(e,HTMLTextAreaElement)&&(n.innerHTML=e.value),Tn(e,HTMLInputElement)&&n.setAttribute("value",e.value)}function yM(e,n){if(Tn(e,HTMLSelectElement)){const s=Array.from(n.children).find(a=>e.value===a.getAttribute("value"));s&&s.setAttribute("selected","")}}function xM(e,n,r){return Tn(n,Element)&&(hM(e,n,r),rM(e,n,r),gM(e,n),yM(e,n)),n}async function bM(e,n){const r=e.querySelectorAll?e.querySelectorAll("use"):[];if(r.length===0)return e;const s={};for(let c=0;c<r.length;c++){const f=r[c].getAttribute("xlink:href");if(f){const p=e.querySelector(f),m=document.querySelector(f);!p&&m&&!s[f]&&(s[f]=await kl(m,n,!0))}}const a=Object.values(s);if(a.length){const c="http://www.w3.org/1999/xhtml",u=document.createElementNS(c,"svg");u.setAttribute("xmlns",c),u.style.position="absolute",u.style.width="0",u.style.height="0",u.style.overflow="hidden",u.style.display="none";const f=document.createElementNS(c,"defs");u.appendChild(f);for(let p=0;p<a.length;p++)f.appendChild(a[p]);e.appendChild(u)}return e}async function kl(e,n,r){return!r&&n.filter&&!n.filter(e)?null:Promise.resolve(e).then(s=>fM(s,n)).then(s=>mM(e,s,n)).then(s=>xM(e,s,n)).then(s=>bM(s,n))}const px=/url\((['"]?)([^'"]+?)\1\)/g,vM=/url\([^)]+\)\s*format\((["']?)([^"']+)\1\)/g,wM=/src:\s*(?:url\([^)]+\)\s*format\([^)]+\)[,;]\s*)+/g;function _M(e){const n=e.replace(/([.*+?^${}()|\[\]\/\\])/g,"\\$1");return new RegExp(`(url\\(['"]?)(${n})(['"]?\\))`,"g")}function kM(e){const n=[];return e.replace(px,(r,s,a)=>(n.push(a),r)),n.filter(r=>!ld(r))}async function EM(e,n,r,s,a){try{const c=r?WA(n,r):n,u=Ud(n);let f;return a||(f=await $d(c,u,s)),e.replace(_M(n),`$1${f}$3`)}catch{}return e}function SM(e,{preferredFontFormat:n}){return n?e.replace(wM,r=>{for(;;){const[s,,a]=vM.exec(r)||[];if(!a)return"";if(a===n)return`src: ${s};`}}):e}function mx(e){return e.search(px)!==-1}async function hx(e,n,r){if(!mx(e))return e;const s=SM(e,r);return kM(s).reduce((c,u)=>c.then(f=>EM(f,u,n,r)),Promise.resolve(s))}async function cs(e,n,r){var s;const a=(s=n.style)===null||s===void 0?void 0:s.getPropertyValue(e);if(a){const c=await hx(a,null,r);return n.style.setProperty(e,c,n.style.getPropertyPriority(e)),!0}return!1}async function NM(e,n){await cs("background",e,n)||await cs("background-image",e,n),await cs("mask",e,n)||await cs("-webkit-mask",e,n)||await cs("mask-image",e,n)||await cs("-webkit-mask-image",e,n)}async function CM(e,n){const r=Tn(e,HTMLImageElement);if(!(r&&!ld(e.src))&&!(Tn(e,SVGImageElement)&&!ld(e.href.baseVal)))return;const s=r?e.src:e.href.baseVal,a=await $d(s,Ud(s),n);await new Promise((c,u)=>{e.onload=c,e.onerror=n.onImageErrorHandler?(...p)=>{try{c(n.onImageErrorHandler(...p))}catch(m){u(m)}}:u;const f=e;f.decode&&(f.decode=c),f.loading==="lazy"&&(f.loading="eager"),r?(e.srcset="",e.src=a):e.href.baseVal=a})}async function TM(e,n){const s=Jr(e.childNodes).map(a=>gx(a,n));await Promise.all(s).then(()=>e)}async function gx(e,n){Tn(e,Element)&&(await NM(e,n),await CM(e,n),await TM(e,n))}function AM(e,n){const{style:r}=e;n.backgroundColor&&(r.backgroundColor=n.backgroundColor),n.width&&(r.width=`${n.width}px`),n.height&&(r.height=`${n.height}px`);const s=n.style;return s!=null&&Object.keys(s).forEach(a=>{r[a]=s[a]}),e}const Fh={};async function zh(e){let n=Fh[e];if(n!=null)return n;const s=await(await fetch(e)).text();return n={url:e,cssText:s},Fh[e]=n,n}async function Bh(e,n){let r=e.cssText;const s=/url\(["']?([^"')]+)["']?\)/g,c=(r.match(/url\([^)]+\)/g)||[]).map(async u=>{let f=u.replace(s,"$1");return f.startsWith("https://")||(f=new URL(f,e.url).href),dx(f,n.fetchRequestInit,({result:p})=>(r=r.replace(u,`url(${p})`),[u,p]))});return Promise.all(c).then(()=>r)}function Uh(e){if(e==null)return[];const n=[],r=/(\/\*[\s\S]*?\*\/)/gi;let s=e.replace(r,"");const a=new RegExp("((@.*?keyframes [\\s\\S]*?){([\\s\\S]*?}\\s*?)})","gi");for(;;){const p=a.exec(s);if(p===null)break;n.push(p[0])}s=s.replace(a,"");const c=/@import[\s\S]*?url\([^)]*\)[\s\S]*?;/gi,u="((\\s*?(?:\\/\\*[\\s\\S]*?\\*\\/)?\\s*?@media[\\s\\S]*?){([\\s\\S]*?)}\\s*?})|(([\\s\\S]*?){([\\s\\S]*?)})",f=new RegExp(u,"gi");for(;;){let p=c.exec(s);if(p===null){if(p=f.exec(s),p===null)break;c.lastIndex=f.lastIndex}else f.lastIndex=c.lastIndex;n.push(p[0])}return n}async function MM(e,n){const r=[],s=[];return e.forEach(a=>{if("cssRules"in a)try{Jr(a.cssRules||[]).forEach((c,u)=>{if(c.type===CSSRule.IMPORT_RULE){let f=u+1;const p=c.href,m=zh(p).then(g=>Bh(g,n)).then(g=>Uh(g).forEach(y=>{try{a.insertRule(y,y.startsWith("@import")?f+=1:a.cssRules.length)}catch(v){console.error("Error inserting rule from remote css",{rule:y,error:v})}})).catch(g=>{console.error("Error loading remote css",g.toString())});s.push(m)}})}catch(c){const u=e.find(f=>f.href==null)||document.styleSheets[0];a.href!=null&&s.push(zh(a.href).then(f=>Bh(f,n)).then(f=>Uh(f).forEach(p=>{u.insertRule(p,u.cssRules.length)})).catch(f=>{console.error("Error loading remote stylesheet",f)})),console.error("Error inlining remote css file",c)}}),Promise.all(s).then(()=>(e.forEach(a=>{if("cssRules"in a)try{Jr(a.cssRules||[]).forEach(c=>{r.push(c)})}catch(c){console.error(`Error while reading CSS rules from ${a.href}`,c)}}),r))}function RM(e){return e.filter(n=>n.type===CSSRule.FONT_FACE_RULE).filter(n=>mx(n.style.getPropertyValue("src")))}async function IM(e,n){if(e.ownerDocument==null)throw new Error("Provided element is not within a Document");const r=Jr(e.ownerDocument.styleSheets),s=await MM(r,n);return RM(s)}function yx(e){return e.trim().replace(/["']/g,"")}function OM(e){const n=new Set;function r(s){(s.style.fontFamily||getComputedStyle(s).fontFamily).split(",").forEach(c=>{n.add(yx(c))}),Array.from(s.children).forEach(c=>{c instanceof HTMLElement&&r(c)})}return r(e),n}async function jM(e,n){const r=await IM(e,n),s=OM(e);return(await Promise.all(r.filter(c=>s.has(yx(c.style.fontFamily))).map(c=>{const u=c.parentStyleSheet?c.parentStyleSheet.href:null;return hx(c.cssText,u,n)}))).join(`
|
|
447
|
-
`)}async function LM(e,n){const r=n.fontEmbedCSS!=null?n.fontEmbedCSS:n.skipFonts?null:await jM(e,n);if(r){const s=document.createElement("style"),a=document.createTextNode(r);s.appendChild(a),e.firstChild?e.insertBefore(s,e.firstChild):e.appendChild(s)}}async function DM(e,n={}){const{width:r,height:s}=ux(e,n),a=await kl(e,n,!0);return await LM(a,n),await gx(a,n),AM(a,n),await JA(a,r,s)}async function PM(e,n={}){const{width:r,height:s}=ux(e,n),a=await DM(e,n),c=await pl(a),u=document.createElement("canvas"),f=u.getContext("2d"),p=n.pixelRatio||XA(),m=n.canvasWidth||r,g=n.canvasHeight||s;return u.width=m*p,u.height=g*p,n.skipAutoScale||QA(u),u.style.width=`${m}`,u.style.height=`${g}`,n.backgroundColor&&(f.fillStyle=n.backgroundColor,f.fillRect(0,0,u.width,u.height)),f.drawImage(c,0,0,u.width,u.height),u}async function FM(e,n={}){return(await PM(e,n)).toDataURL()}const wi=36,$h=88,us=28,Hh=6;function zM({messages:e,now:n,onSelectMessage:r}){const s=yt(),a=N.useRef(null),[c,u]=N.useState(1),[f,p]=N.useState(0),[m,g]=N.useState(!1),[y,v]=N.useState(!1),[b,w]=N.useState(!1),[_,E]=N.useState(null),S=N.useRef(null),O=N.useMemo(()=>{const X=[];for(const re of e){const L=Fd(re);if(!L)continue;const $=new Date(L.timestamp).getTime();Number.isFinite($)&&X.push({id:L.id,agent:L.from,to:L.to,ts:$,kind:Ci(L.msgType),content:L.content})}return X.sort((re,L)=>re.ts-L.ts)},[e]),A=N.useMemo(()=>{const X=new Map;for(const L of O)X.has(L.agent)||X.set(L.agent,L.ts);const re=Array.from(X.keys());return re.sort((L,$)=>L==="principal"?-1:$==="principal"?1:(X.get(L)??0)-(X.get($)??0)),re},[O]),G=N.useMemo(()=>{if(O.length===0)return{start:n-6e4,end:n};const X=O[0].ts,re=Math.max(n,O[O.length-1].ts);return{start:X,end:re===X?X+6e4:re}},[O,n]);if(O.length===0)return l.jsxs("div",{className:"agent-timeline__empty",children:[l.jsx(ys,{size:20}),l.jsx("p",{children:s("timeline.empty")})]});const M=760*c,W=$h+M,ee=us+A.length*wi+8,oe=G.end-G.start,D=X=>$h+f+(X-G.start)/oe*M,ce=X=>A.indexOf(X),V=X=>us+ce(X)*wi+wi/2,j=X=>X==="delegate"&&m||X==="result"&&y||X==="neutral"&&b,B=Array.from({length:Hh+1},(X,re)=>{const L=G.start+oe*re/Hh;return{ts:L,x:D(L)}}),q=X=>{const re=new Date(X);return oe<6e4?`${re.getSeconds()}s`:oe<36e5?`${re.getHours()}:${String(re.getMinutes()).padStart(2,"0")}`:re.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"})},Z=[],ne=new Set;for(const X of O){if(X.kind!=="delegate")continue;const re=O.find(L=>L.kind==="result"&&L.agent===X.to&&L.ts>X.ts&&!ne.has(L.id));re&&(ne.add(re.id),Z.push({id:`${X.id}->${re.id}`,x1:D(X.ts),y1:V(X.agent),x2:D(re.ts),y2:V(re.agent)}))}const K=X=>{X.preventDefault();const re=X.deltaY<0?1.15:1/1.15;u(L=>Math.min(8,Math.max(1,L*re)))},ue=X=>{S.current={startX:X.clientX,startPan:f}},C=X=>{S.current&&p(S.current.startPan+(X.clientX-S.current.startX))},R=()=>{S.current=null},J=()=>{u(1),p(0)},T=async()=>{if(a.current)try{const X=await FM(a.current,{backgroundColor:getComputedStyle(document.documentElement).getPropertyValue("--color-surface").trim()||"#ffffff",pixelRatio:2}),re=document.createElement("a");re.download=`agent-timeline-${Date.now()}.png`,re.href=X,re.click()}catch{}};return l.jsxs("div",{className:"agent-timeline",children:[l.jsxs("div",{className:"agent-timeline__controls",children:[l.jsxs("button",{type:"button",className:"agent-timeline__btn",onClick:J,children:[l.jsx(tg,{size:12})," ",s("timeline.fit")]}),l.jsxs("span",{className:"agent-timeline__filters",children:[l.jsx(eg,{size:12}),l.jsx(Uu,{label:s("timeline.filter.delegate"),active:!m,onClick:()=>g(X=>!X),dotClass:"delegate"}),l.jsx(Uu,{label:s("timeline.filter.result"),active:!y,onClick:()=>v(X=>!X),dotClass:"result"}),l.jsx(Uu,{label:s("timeline.filter.other"),active:!b,onClick:()=>w(X=>!X),dotClass:"neutral"})]}),l.jsxs("button",{type:"button",className:"agent-timeline__btn",onClick:T,children:[l.jsx(Qh,{size:12})," PNG"]})]}),l.jsx("div",{className:"agent-timeline__scroll",ref:a,onWheel:K,onMouseDown:ue,onMouseMove:C,onMouseUp:R,onMouseLeave:()=>{R(),E(null)},children:l.jsxs("svg",{className:"agent-timeline__svg",width:W,height:ee,viewBox:`0 0 ${W} ${ee}`,role:"img","aria-label":s("timeline.aria"),children:[A.map((X,re)=>l.jsxs("g",{children:[l.jsx("rect",{x:0,y:us+re*wi,width:W,height:wi,className:re%2===0?"agent-timeline__lane agent-timeline__lane--even":"agent-timeline__lane agent-timeline__lane--odd"}),l.jsx("text",{x:6,y:us+re*wi+wi/2+4,className:"agent-timeline__lane-label",children:X.length>11?`${X.slice(0,10)}…`:X})]},X)),B.map((X,re)=>l.jsxs("g",{children:[l.jsx("line",{x1:X.x,x2:X.x,y1:us-6,y2:ee-4,className:"agent-timeline__tick"}),l.jsx("text",{x:X.x,y:14,textAnchor:"middle",className:"agent-timeline__tick-label",children:q(X.ts)})]},re)),l.jsx("line",{x1:D(n),x2:D(n),y1:us-6,y2:ee-4,className:"agent-timeline__now"}),Z.map(X=>{const re=Math.min(X.y1,X.y2)-10;return l.jsx("path",{className:"agent-timeline__arc",d:`M ${X.x1} ${X.y1} Q ${(X.x1+X.x2)/2} ${re} ${X.x2} ${X.y2}`,fill:"none"},X.id)}),O.map(X=>j(X.kind)?null:l.jsx("circle",{className:`agent-timeline__dot agent-timeline__dot--${X.kind}`,cx:D(X.ts),cy:V(X.agent),r:5,onClick:()=>r(X.agent),onMouseEnter:()=>E(X),onMouseLeave:()=>E(re=>(re==null?void 0:re.id)===X.id?null:re),children:l.jsx("title",{children:`${X.agent} → ${X.to}
|
|
448
|
-
${X.content.slice(0,100)}`})},X.id))]})}),_?l.jsxs("div",{className:"agent-timeline__hint-card",children:[l.jsxs("strong",{children:[_.agent," → ",_.to]}),l.jsx("span",{className:`agent-timeline__hint-type agent-timeline__hint-type--${_.kind}`,children:_.kind}),l.jsx("p",{children:_.content?`${_.content.slice(0,120)}${_.content.length>120?"…":""}`:"(empty)"})]}):null]})}function Uu({label:e,active:n,onClick:r,dotClass:s}){return l.jsxs("button",{type:"button",className:`agent-timeline__filter ${n?"is-active":""}`,"aria-pressed":n,onClick:r,children:[l.jsx("i",{className:`agent-timeline__filter-dot agent-timeline__dot--${s}`}),e]})}const xx="agent-network-active-tab";function BM(){try{const e=localStorage.getItem(xx);if(e==="detail"||e==="analytics"||e==="timeline")return e}catch{}return"detail"}const UM=5e3;function bx(e){return`network.status.${e}`}const Vn=760,Gn=480,qt=30;function $M(e){const n=Vn/2,r=Gn/2;if(e.length===0)return[];const s=e.indexOf("principal"),a=s>=0?e[s]:null,c=a?e.filter(w=>w!==a):[...e],u=[];a&&u.push({name:a,x:n,y:r});const f=c.length;if(f===0)return a||u.push({name:e[0],x:n,y:r}),u;if(f<=6||!a){const w=Math.min(Vn,Gn)*.34,_=-Math.PI/2;return c.forEach((E,S)=>{const O=_+S*2*Math.PI/f;u.push({name:E,x:n+w*Math.cos(O),y:r+w*Math.sin(O)})}),u}const p=Math.ceil(f/2),m=f-p,g=Math.min(Vn,Gn)*.22,y=Math.min(Vn,Gn)*.4,v=-Math.PI/2,b=-Math.PI/2+Math.PI/m;return c.slice(0,p).forEach((w,_)=>{const E=v+_*2*Math.PI/p;u.push({name:w,x:n+g*Math.cos(E),y:r+g*Math.sin(E)})}),c.slice(p).forEach((w,_)=>{const E=b+_*2*Math.PI/m;u.push({name:w,x:n+y*Math.cos(E),y:r+y*Math.sin(E)})}),u}function HM(e,n,r){const s=n.x-e.x,a=n.y-e.y,c=Math.sqrt(s*s+a*a)||1,u=s/c,f=a/c,p=e.x+u*qt,m=e.y+f*qt,g=n.x-u*(qt+4),y=n.y-f*(qt+4),v=(p+g)/2,b=(m+y)/2,w=-f*r,_=u*r;return{d:`M ${p} ${m} Q ${v+w} ${b+_} ${g} ${y}`,midX:v+w*.6,midY:b+_*.6}}function qM({agents:e,messages:n,agentFilters:r,onSetAgentFilter:s}){const a=yt(),[c,u]=N.useState(null),[f,p]=N.useState(null),[m,g]=N.useState(BM);N.useEffect(()=>{try{localStorage.setItem(xx,m)}catch{}},[m]);const y=L=>{u({kind:"node",id:L}),g("detail")},v=L=>{u({kind:"edge",key:L}),g("detail")},[b,w]=N.useState(null),_=N.useRef(null),E=N.useRef(null),S=N.useRef(null),O=()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null),S.current!==null&&(window.clearTimeout(S.current),S.current=null)},A=(L,$)=>{S.current!==null&&(window.clearTimeout(S.current),S.current=null),E.current!==null&&window.clearTimeout(E.current),E.current=window.setTimeout(()=>{const H=_.current;if(!H)return;const Q=$.getBoundingClientRect(),ge=H.getBoundingClientRect();w({name:L,anchor:{left:Q.left-ge.left,top:Q.top-ge.top,width:Q.width,height:Q.height}})},300)},G=()=>{E.current!==null&&(window.clearTimeout(E.current),E.current=null),S.current!==null&&window.clearTimeout(S.current),S.current=window.setTimeout(()=>w(null),200)};N.useEffect(()=>O,[]);const P=N.useMemo(()=>EA(n),[n]),M=N.useMemo(()=>new Set(e.map(L=>L.name)),[e]),W=N.useMemo(()=>{const L=new Set;Fu.forEach(ge=>L.add(ge)),e.forEach(ge=>L.add(ge.name)),P.forEach(ge=>{L.add(ge.from),L.add(ge.to)});const $=new Set(Fu),H=Fu.filter(ge=>L.has(ge)),Q=Array.from(L).filter(ge=>!$.has(ge)).sort();return[...H,...Q]},[e,P]),ee=N.useMemo(()=>$M(W),[W]),oe=N.useMemo(()=>{const L=new Map;return ee.forEach($=>L.set($.name,$)),L},[ee]),D=N.useMemo(()=>{const L=new Map;return e.forEach($=>L.set($.name,$)),L},[e]),ce=N.useMemo(()=>{const L=new Set;return P.map($=>{const H=`${$.to}->${$.from}`,Q=L.has(H)?-22:P.some(ge=>ge.key===H)?22:0;return L.add($.key),{edge:$,bend:Q}}).map(({edge:$,bend:H})=>{const Q=oe.get($.from),ge=oe.get($.to);if(!Q||!ge)return null;const Pe=HM(Q,ge,H);return{edge:$,geometry:Pe}}).filter($=>$!==null)},[P,oe]),V=Date.now(),j=P.reduce((L,$)=>L+$.messages.length,0),B=e.length,q=e.filter(L=>dl(L.status)==="running").length,[,Z]=N.useState(0),ne=m!=="detail"||q>0;N.useEffect(()=>{if(!ne)return;const L=window.setInterval(()=>Z($=>$+1),5e3);return()=>window.clearInterval(L)},[ne]);const K=N.useMemo(()=>!c||c.kind!=="node"?null:D.get(c.id)??{name:c.id,status:"idle",task:""},[c,D]),ue=N.useMemo(()=>!c||c.kind!=="edge"?null:P.find(L=>L.key===c.key)??null,[c,P]),C=N.useMemo(()=>{if(!K)return{sent:[],received:[]};const L=[],$=[];return P.forEach(H=>{H.messages.forEach(Q=>{Q.from===K.name&&L.push(Q),Q.to===K.name&&$.push(Q)})}),L.sort((H,Q)=>Q.timestamp.localeCompare(H.timestamp)),$.sort((H,Q)=>Q.timestamp.localeCompare(H.timestamp)),{sent:L,received:$}},[K,P]),R=N.useMemo(()=>OA(n,P),[n,P]),J=N.useMemo(()=>K?R.get(K.name)??null:null,[K,R]),T=N.useMemo(()=>J?jA(J,R):null,[J,R]);if(W.length===0)return l.jsx("div",{className:"agent-network agent-network--empty",children:l.jsxs("div",{className:"agent-network__empty-state",children:[l.jsx(pd,{size:28}),l.jsx("p",{children:a("network.empty")})]})});const X=oe.get("principal"),re=b?(()=>{const L=D.get(b.name),$=M.has(b.name),H=SA(b.name,P);return{name:b.name,isLive:$,status:(L==null?void 0:L.status)??"idle",task:(L==null?void 0:L.task)??"",updatedAt:L==null?void 0:L.updatedAt,sent:H.sent,received:H.received}})():null;return l.jsxs("div",{className:"agent-network",children:[l.jsxs("div",{className:"agent-network__viewport-shell",children:[l.jsxs("div",{className:"agent-network__legend","aria-label":a("network.aria.legend"),children:[l.jsxs("span",{className:"agent-network__legend-item",children:[l.jsx("i",{className:"agent-network__legend-dot agent-network__legend-dot--running"})," ",a("network.legend.running")]}),l.jsxs("span",{className:"agent-network__legend-item",children:[l.jsx("i",{className:"agent-network__legend-dot agent-network__legend-dot--idle"})," ",a("network.legend.live")]}),l.jsxs("span",{className:"agent-network__legend-item",children:[l.jsx("i",{className:"agent-network__legend-dot agent-network__legend-dot--dormant"})," ",a("network.legend.dormant")]}),l.jsxs("span",{className:"agent-network__legend-item",children:[l.jsx("i",{className:"agent-network__legend-dot agent-network__legend-dot--error"})," ",a("network.legend.error")]}),l.jsx("span",{className:"agent-network__legend-divider","aria-hidden":"true"}),l.jsxs("span",{className:"agent-network__legend-item",children:[l.jsx("i",{className:"agent-network__legend-line agent-network__legend-line--delegate"})," ",a("network.legend.delegate")]}),l.jsxs("span",{className:"agent-network__legend-item",children:[l.jsx("i",{className:"agent-network__legend-line agent-network__legend-line--result"})," ",a("network.legend.result")]}),l.jsx("span",{className:"agent-network__legend-counter",children:a("network.legend.counter",{live:B,total:W.length,running:q,edges:P.length,msgs:j})})]}),l.jsxs("div",{className:"agent-network__viewport","aria-label":a("network.aria.viewport"),ref:_,children:[l.jsxs("svg",{className:"agent-network__svg",preserveAspectRatio:"xMidYMid meet",role:"img",viewBox:`0 0 ${Vn} ${Gn}`,children:[l.jsxs("defs",{children:[l.jsx("pattern",{id:"agent-net-grid",width:"32",height:"32",patternUnits:"userSpaceOnUse",children:l.jsx("path",{className:"agent-network__grid-line",d:"M 32 0 L 0 0 0 32",fill:"none"})}),l.jsx("pattern",{id:"agent-net-grid-major",width:"160",height:"160",patternUnits:"userSpaceOnUse",children:l.jsx("path",{className:"agent-network__grid-line agent-network__grid-line--major",d:"M 160 0 L 0 0 0 160",fill:"none"})}),l.jsxs("radialGradient",{id:"agent-net-glow",cx:"50%",cy:"50%",r:"60%",children:[l.jsx("stop",{offset:"0%",className:"agent-network__glow-stop-inner"}),l.jsx("stop",{offset:"55%",className:"agent-network__glow-stop-mid"}),l.jsx("stop",{offset:"100%",className:"agent-network__glow-stop-outer"})]}),l.jsx("marker",{id:"agent-net-arrow-neutral",markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3",children:l.jsx("path",{d:"M 0 0 L 6 3 L 0 6 z"})}),l.jsx("marker",{id:"agent-net-arrow-delegate",markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3",children:l.jsx("path",{d:"M 0 0 L 6 3 L 0 6 z"})}),l.jsx("marker",{id:"agent-net-arrow-result",markerHeight:"6",markerWidth:"6",orient:"auto",refX:"5",refY:"3",children:l.jsx("path",{d:"M 0 0 L 6 3 L 0 6 z"})})]}),l.jsx("rect",{className:"agent-network__bg-hit",fill:"transparent",height:Gn,onClick:()=>u(null),width:Vn}),l.jsxs("g",{className:"agent-network__backdrop","aria-hidden":"true",children:[l.jsx("rect",{width:Vn,height:Gn,fill:"url(#agent-net-grid)"}),l.jsx("rect",{width:Vn,height:Gn,fill:"url(#agent-net-grid-major)"}),l.jsx("rect",{width:Vn,height:Gn,fill:"url(#agent-net-glow)"}),X?l.jsxs(l.Fragment,{children:[l.jsx("circle",{className:"agent-network__guide-ring",cx:X.x,cy:X.y,r:Math.min(Vn,Gn)*.22}),l.jsx("circle",{className:"agent-network__guide-ring",cx:X.x,cy:X.y,r:Math.min(Vn,Gn)*.34}),l.jsx("circle",{className:"agent-network__guide-ring agent-network__guide-ring--outer",cx:X.x,cy:X.y,r:Math.min(Vn,Gn)*.4})]}):null]}),l.jsx("g",{className:"agent-network__scaffold","aria-hidden":"true",children:(()=>{const L=oe.get("principal");return L?ee.filter($=>$.name!=="principal"&&$.name!=="user").map($=>{const H=$.x-L.x,Q=$.y-L.y,ge=Math.sqrt(H*H+Q*Q)||1,Pe=H/ge,fe=Q/ge,ke=L.x+Pe*qt,Ee=L.y+fe*qt,ve=$.x-Pe*qt,Se=$.y-fe*qt,tt=M.has($.name);return l.jsx("line",{className:`agent-network__scaffold-line ${tt?"agent-network__scaffold-line--live":"agent-network__scaffold-line--dormant"}`,x1:ke,y1:Ee,x2:ve,y2:Se},`scaffold-${$.name}`)}):null})()}),l.jsx("g",{className:"agent-network__edges",children:ce.map(({edge:L,geometry:$})=>{const H=new Date(L.lastTimestamp).getTime(),Q=Number.isFinite(H)&&V-H<UM,ge=L.messages[L.messages.length-1],Pe=Ci(ge==null?void 0:ge.msgType),fe=L.messages.length,ke=fe<=1?1.5:fe<=5?2:2.5,Ee=(c==null?void 0:c.kind)==="edge"&&c.key===L.key,ve=f===L.key;return l.jsxs("g",{"aria-label":a(fe===1?"network.aria.edgeOne":"network.aria.edgeMany",{from:L.from,count:fe,to:L.to}),className:["agent-network__edge",`agent-network__edge--${Pe}`,Q?"agent-network__edge--active":"",Ee?"is-selected":"",ve?"is-hover":""].filter(Boolean).join(" "),onClick:Se=>{Se.stopPropagation(),v(L.key)},onKeyDown:Se=>{(Se.key==="Enter"||Se.key===" ")&&(Se.preventDefault(),v(L.key))},onMouseEnter:()=>p(L.key),onMouseLeave:()=>p(Se=>Se===L.key?null:Se),role:"button",tabIndex:0,children:[l.jsx("path",{className:"agent-network__edge-hitbox",d:$.d}),l.jsx("path",{className:"agent-network__edge-line",d:$.d,markerEnd:`url(#agent-net-arrow-${Pe})`,style:{strokeWidth:ke}}),fe>1?l.jsxs("g",{className:"agent-network__edge-badge",transform:`translate(${$.midX} ${$.midY})`,children:[l.jsx("circle",{r:"9"}),l.jsx("text",{dy:"3",textAnchor:"middle",children:fe})]}):null]},L.key)})}),l.jsx("g",{className:"agent-network__nodes",children:ee.map(L=>{const $=D.get(L.name),H=M.has(L.name),Q=$?dl($.status):"idle",ge=H?"live":"dormant",Pe=(c==null?void 0:c.kind)==="node"&&c.id===L.name,fe=zd(L.name),ke=Bd(L.name),Ee=L.name==="principal";return l.jsxs("g",{"aria-label":a("network.aria.node",{name:L.name,status:a(H?bx(Q):"network.status.dormant")}),className:["agent-network__node",`agent-network__node--${Q}`,`agent-network__node--${ge}`,Ee?"agent-network__node--principal":"",Pe?"is-selected":""].filter(Boolean).join(" "),onClick:ve=>{ve.stopPropagation(),y(L.name)},onKeyDown:ve=>{(ve.key==="Enter"||ve.key===" ")&&(ve.preventDefault(),y(L.name))},onMouseEnter:ve=>A(L.name,ve.currentTarget),onMouseLeave:G,role:"button",style:{"--agent-accent":ke},tabIndex:0,transform:`translate(${L.x} ${L.y})`,children:[Q==="running"&&H?l.jsx("circle",{className:"agent-network__node-pulse",r:qt+6}):null,l.jsx("circle",{className:"agent-network__node-ring",r:qt}),l.jsx("circle",{className:"agent-network__node-disc",r:qt-6}),H?null:l.jsx("g",{className:"agent-network__node-badge agent-network__node-badge--dormant",children:l.jsx("circle",{cx:qt-6,cy:-qt+6,r:"5"})}),Q==="running"&&H?l.jsx("g",{className:"agent-network__node-badge agent-network__node-badge--running",children:l.jsx("circle",{cx:qt-6,cy:-qt+6,r:"5"})}):null,Q==="error"&&H?l.jsx("g",{className:"agent-network__node-badge agent-network__node-badge--error",children:l.jsx("circle",{cx:qt-6,cy:-qt+6,r:"5"})}):null,l.jsx("foreignObject",{x:-12,y:-12,width:24,height:24,children:l.jsx("div",{className:"agent-network__node-icon",children:l.jsx(fe,{size:18})})}),l.jsx("text",{className:"agent-network__node-label",textAnchor:"middle",y:qt+18,children:L.name}),$!=null&&$.task?l.jsx("text",{className:"agent-network__node-sublabel",textAnchor:"middle",y:qt+32,children:$.task.length>32?`${$.task.slice(0,30)}…`:$.task}):H?null:l.jsx("text",{className:"agent-network__node-sublabel agent-network__node-sublabel--dormant",textAnchor:"middle",y:qt+32,children:a("network.node.notSpawned")})]},L.name)})})]}),re&&b&&_.current?l.jsx(DA,{data:re,now:V,anchor:b.anchor,container:{width:_.current.clientWidth,height:_.current.clientHeight}}):null]})]}),l.jsxs("aside",{className:"agent-network__detail","aria-label":a("network.aria.detail"),children:[l.jsx("div",{className:"agent-network__tabs",role:"tablist","aria-label":a("network.aria.tabs"),children:["detail","analytics","timeline"].map(L=>l.jsx("button",{role:"tab",type:"button","aria-selected":m===L,className:`agent-network__tab ${m===L?"agent-network__tab--active":""}`,onClick:()=>g(L),onKeyDown:$=>{const H=["detail","analytics","timeline"],Q=H.indexOf(m);$.key==="ArrowRight"?($.preventDefault(),g(H[(Q+1)%H.length])):$.key==="ArrowLeft"&&($.preventDefault(),g(H[(Q-1+H.length)%H.length]))},children:a(L==="detail"?"network.tab.detail":L==="analytics"?"network.tab.analytics":"network.tab.timeline")},L))}),l.jsx("div",{className:"agent-network__tabpanel",role:"tabpanel",children:m==="detail"?ue?l.jsx(WM,{edge:ue,now:V}):K?l.jsx(KM,{agent:K,isLive:M.has(K.name),filter:r[K.name]??{hideMessages:!1,hideTools:!1,hideHooks:!0},now:V,onFilterChange:s,received:C.received,sent:C.sent,activity:J,activityPercentages:T}):l.jsx(FA,{agents:e,edges:P,messages:n,totalNodes:W.length,liveCount:B,now:V}):m==="analytics"?l.jsx(zA,{agents:e,messages:n,edges:P,now:V}):l.jsx(zM,{messages:n,now:V,onSelectMessage:L=>y(L)})})]})]})}function KM({agent:e,isLive:n,filter:r,now:s,onFilterChange:a,sent:c,received:u,activity:f,activityPercentages:p}){const m=zd(e.name),g=dl(e.status),y=Pd(e.name),v=n?"live":"dormant",b=yt(),w=b(n?bx(g):"network.status.dormant");return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:"agent-network__detail-title",children:[l.jsx("span",{className:`agent-network__detail-avatar agent-network__detail-avatar--${g} agent-network__detail-avatar--${v}`,style:{"--agent-accent":Bd(e.name)},children:l.jsx(m,{size:16})}),l.jsx("h3",{children:e.name}),l.jsx("span",{className:`agent-network__status-pill agent-network__status-pill--${n?g:"dormant"}`,children:w})]}),l.jsxs("div",{className:"agent-network__detail-badges",children:[l.jsx("span",{children:b(y.role)}),n?null:l.jsx("span",{children:b("network.detail.notSpawned")}),e.alive===!1?l.jsx("span",{children:b("network.detail.notAlive")}):null]}),l.jsxs("section",{className:"agent-network__detail-section",children:[l.jsxs("h4",{children:[l.jsx(ml,{size:13})," ",b("network.detail.responsibility")]}),l.jsx("p",{className:"agent-network__detail-text",children:b(y.description)})]}),l.jsxs("section",{className:"agent-network__detail-section",children:[l.jsxs("h4",{children:[l.jsx($u,{size:13})," ",b("network.detail.status")]}),l.jsxs("dl",{className:"agent-network__keyvals",children:[l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.state")}),l.jsx("dd",{children:l.jsx("span",{className:`agent-network__status-pill agent-network__status-pill--${n?g:"dormant"}`,children:w})})]}),l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.currentTask")}),l.jsx("dd",{className:"agent-network__keyvals-wrap",children:n?e.task||b("network.detail.idleWaiting"):b("network.detail.notSpawnedByPrincipal")})]}),l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.updated")}),l.jsx("dd",{children:e.updatedAt?bs(e.updatedAt,s):"—"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.communication")}),l.jsx("dd",{children:b("network.detail.commCount",{sent:c.length,received:u.length})})]})]})]}),f&&p?l.jsxs("section",{className:"agent-network__detail-section",children:[l.jsxs("h4",{children:[l.jsx(_a,{size:13})," ",b("network.detail.activityStats")]}),l.jsxs("dl",{className:"agent-network__keyvals",children:[l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.totalMessages")}),l.jsxs("dd",{children:[f.totalMessages,l.jsx("span",{style:{fontSize:11,opacity:.7,marginLeft:6},children:b("network.detail.pctOfSession",{pct:p.messagePercent.toFixed(1)})})]})]}),l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.messageBreakdown")}),l.jsx("dd",{className:"agent-network__keyvals-wrap",children:b("network.detail.breakdownValue",{assistant:f.assistantMessages,reasoning:f.reasoningMessages,tool:f.toolMessages})})]}),l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.toolCalls")}),l.jsxs("dd",{children:[f.toolCalls,f.toolCalls>0&&l.jsx("span",{style:{fontSize:11,opacity:.7,marginLeft:6},children:b("network.detail.pctOfSession",{pct:p.toolCallPercent.toFixed(1)})})]})]}),f.topTools.length>0&&l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.topTools")}),l.jsx("dd",{className:"agent-network__keyvals-wrap",children:f.topTools.map((_,E)=>l.jsxs("span",{children:[_.name," (",_.count,")",E<f.topTools.length-1?" · ":""]},_.name))})]}),l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.contentVolume")}),l.jsxs("dd",{children:[b("network.detail.volumeValue",{chars:f.totalChars.toLocaleString(),tokens:f.estimatedTokens.toLocaleString()}),l.jsx("span",{style:{fontSize:11,opacity:.7,marginLeft:6},children:b("network.detail.pctOfSession",{pct:p.tokenPercent.toFixed(1)})})]})]}),f.communicationPartners.length>0&&l.jsxs("div",{children:[l.jsx("dt",{children:b("network.detail.communicationPartners")}),l.jsx("dd",{className:"agent-network__keyvals-wrap",children:f.communicationPartners.join(", ")})]})]})]}):null,l.jsxs("section",{className:"agent-network__detail-section",children:[l.jsxs("h4",{children:[l.jsx(ha,{size:13})," ",b("network.detail.availableTools")]}),l.jsx("ul",{className:"agent-network__tool-list",children:y.defaultTools.length===0?l.jsx("li",{className:"agent-network__tool-chip",children:b("network.detail.noMcpTools")}):y.defaultTools.map(_=>l.jsx("li",{className:"agent-network__tool-chip",children:_},_))})]}),l.jsxs("section",{className:"agent-network__detail-section",children:[l.jsxs("h4",{children:[l.jsx(eg,{size:13})," ",b("network.detail.displayFilters")]}),l.jsx(XM,{agentName:e.name,filter:r,onChange:a}),l.jsx("p",{className:"agent-network__detail-text",style:{fontSize:11},children:b("network.detail.filtersNote")})]}),l.jsxs("section",{className:"agent-network__detail-section",children:[l.jsxs("h4",{children:[l.jsx(lg,{size:13})," ",b("network.detail.sent",{count:c.length})]}),l.jsx(qh,{items:c,now:s,dirField:"to",emptyText:b("network.detail.noOutgoing")})]}),l.jsxs("section",{className:"agent-network__detail-section",children:[l.jsxs("h4",{children:[l.jsx(ys,{size:13})," ",b("network.detail.received",{count:u.length})]}),l.jsx(qh,{items:u,now:s,dirField:"from",emptyText:b("network.detail.noIncoming")})]})]})}function WM({edge:e,now:n}){const r=yt();return l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:"agent-network__detail-title",children:[l.jsx("span",{className:"agent-network__detail-avatar",children:l.jsx(Hu,{size:16})}),l.jsxs("h3",{children:[e.from," ",l.jsx(Hu,{size:14,className:"agent-network__detail-arrow"})," ",e.to]})]}),l.jsxs("div",{className:"agent-network__detail-badges",children:[l.jsx("span",{children:r("network.edge.messages",{count:e.messages.length})}),l.jsx("span",{children:r("network.edge.last",{time:bs(e.lastTimestamp,n)})})]}),l.jsxs("section",{className:"agent-network__detail-section",children:[l.jsxs("h4",{children:[l.jsx(_a,{size:13})," ",r("network.edge.conversation")]}),l.jsx("ol",{className:"agent-network__msg-list agent-network__msg-list--ordered",children:e.messages.map(s=>l.jsxs("li",{className:`agent-network__msg agent-network__msg--${Ci(s.msgType)}`,children:[l.jsxs("header",{className:"agent-network__msg-head",children:[l.jsx("span",{className:"agent-network__msg-type",children:s.msgType??r("network.msg.fallback")}),l.jsx("time",{children:bs(s.timestamp,n)})]}),l.jsx("p",{children:s.content||l.jsx("em",{children:r("network.msg.empty")})})]},s.id))})]})]})}function qh({items:e,now:n,dirField:r,emptyText:s}){const a=yt();return e.length===0?l.jsx("p",{className:"agent-network__detail-text",children:s}):l.jsxs("ul",{className:"agent-network__msg-list",children:[e.slice(0,20).map(c=>l.jsxs("li",{className:`agent-network__msg agent-network__msg--${Ci(c.msgType)}`,children:[l.jsxs("header",{className:"agent-network__msg-head",children:[l.jsx("span",{className:"agent-network__msg-route",children:l.jsx("strong",{children:c[r]})}),l.jsx("span",{className:"agent-network__msg-type",children:c.msgType??a("network.msg.fallback")}),l.jsx("time",{children:bs(c.timestamp,n)})]}),l.jsx("p",{children:c.content?c.content.length>200?`${c.content.slice(0,198)}…`:c.content:l.jsx("em",{children:a("network.msg.empty")})})]},c.id)),e.length>20?l.jsx("li",{className:"agent-network__msg",children:a("network.msg.more",{count:e.length-20})}):null]})}const VM=["messages","tools","hooks"],Kh={messages:{labelKey:"network.filter.messages.label",descriptionKey:"network.filter.messages.description",Icon:_a},tools:{labelKey:"network.filter.tools.label",descriptionKey:"network.filter.tools.description",Icon:ha},hooks:{labelKey:"network.filter.hooks.label",descriptionKey:"network.filter.hooks.description",Icon:qv}};function GM(e){const n=[];return e.hideMessages&&n.push("messages"),e.hideTools&&n.push("tools"),e.hideHooks&&n.push("hooks"),n}function YM(e,n,r){return n==="messages"?{...e,hideMessages:r}:n==="tools"?{...e,hideTools:r}:{...e,hideHooks:r}}function XM({agentName:e,filter:n,onChange:r}){const s=yt(),[a,c]=N.useState(!1),u=N.useRef(null),f=N.useRef(null),p=GM(n),m=VM.filter(y=>!p.includes(y));N.useEffect(()=>{a&&m.length===0&&c(!1)},[a,m.length]),N.useEffect(()=>{if(!a)return;const y=b=>{var _,E;const w=b.target;w&&((_=u.current)!=null&&_.contains(w)||(E=f.current)!=null&&E.contains(w)||c(!1))},v=b=>{var w;b.key==="Escape"&&(c(!1),(w=f.current)==null||w.focus())};return document.addEventListener("pointerdown",y,!0),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",y,!0),document.removeEventListener("keydown",v)}},[a]);const g=(y,v)=>{const b=YM(n,y,v);r(e,b.hideMessages,b.hideTools,b.hideHooks)};return l.jsx("div",{className:"filter-chips",role:"group","aria-label":s("network.filter.ariaGroup"),children:l.jsxs("div",{className:"filter-chips__row",children:[l.jsxs("span",{className:"filter-chips__label",children:[l.jsx(Zh,{size:12,"aria-hidden":"true"})," ",s("network.filter.hiding")]}),p.length===0?l.jsx("span",{className:"filter-chips__empty",children:s("network.filter.nothing")}):p.map(y=>{const v=Kh[y],b=v.Icon,w=s(v.labelKey);return l.jsxs("span",{className:"filter-chips__chip",children:[l.jsx(b,{size:11,"aria-hidden":"true"}),l.jsx("span",{children:w}),l.jsx("button",{"aria-label":s("network.filter.stopHiding",{label:w}),className:"filter-chips__chip-remove",onClick:()=>g(y,!1),type:"button",children:l.jsx(Dn,{size:10,"aria-hidden":"true"})})]},y)}),l.jsxs("span",{className:"filter-chips__add",children:[l.jsxs("button",{"aria-expanded":a,"aria-haspopup":"menu","aria-label":s("network.filter.addRule"),className:"filter-chips__add-trigger",disabled:m.length===0,onClick:()=>c(y=>!y),ref:f,type:"button",children:[l.jsx(hl,{size:11,"aria-hidden":"true"}),l.jsx("span",{children:s("network.filter.addFilter")})]}),a&&m.length>0?l.jsxs("div",{className:"filter-chips__popover",ref:u,role:"menu",children:[l.jsx("div",{className:"filter-chips__popover-header",children:s("network.filter.popoverHeader")}),m.map(y=>{const v=Kh[y],b=v.Icon;return l.jsxs("button",{className:"filter-chips__popover-item",onClick:()=>{var w;g(y,!0),c(!1),(w=f.current)==null||w.focus()},role:"menuitem",type:"button",children:[l.jsx(b,{size:14,"aria-hidden":"true"}),l.jsx("span",{className:"filter-chips__popover-item-label",children:s(v.labelKey)}),l.jsx("small",{children:s(v.descriptionKey)})]},y)})]}):null]})]})})}function QM(){const{agents:e,currentSession:n,agentFilters:r,setAgentFilter:s,messages:a}=Nr(),c=yt();return l.jsx("section",{className:"workspace-panel","aria-labelledby":"agents-panel-heading",children:l.jsxs("div",{className:"workspace-panel__inner workspace-panel__inner--trace",children:[l.jsxs("header",{className:"workspace-panel__header",children:[l.jsxs("div",{children:[l.jsxs("span",{className:"workspace-panel__eyebrow",children:[l.jsx(pd,{size:11,style:{marginRight:4,verticalAlign:"-1px"}}),c("trace.agents.eyebrow")]}),l.jsx("h2",{id:"agents-panel-heading",children:c("trace.agents.title")})]}),l.jsx(Ku,{size:18})]}),n?l.jsx(qM,{agents:e,agentFilters:r,messages:a,onSetAgentFilter:s}):l.jsx("p",{className:"workspace-panel__empty",children:c("trace.agents.emptyNoSession")}),n&&e.length===0?l.jsx("p",{className:"workspace-panel__empty",children:c("trace.agents.emptyNoEvents")}):null]})})}function ZM(){const{currentSession:e}=Nr(),n=yt(),[r,s]=N.useState(null),[a,c]=N.useState(null),[u,f]=N.useState(""),[p,m]=N.useState("all"),[g,y]=N.useState("all"),[v,b]=N.useState("LR"),[w,_]=N.useState(1),[E,S]=N.useState(!0),[O,A]=N.useState(!1),[G,P]=N.useState(null),[M,W]=N.useState(0),[ee,oe]=N.useState(!1),[D,ce]=N.useState(0),V=N.useRef(!1),j=N.useRef(0),B=(r==null?void 0:r.nodes)??[],q=N.useMemo(()=>B.slice(0,M),[B,M]),Z=N.useMemo(()=>{const re=u.trim().toLowerCase();return q.filter(L=>{const $=va(L.status),H=hs(L),Q=p==="all"||$===p,ge=g==="all"||H===g,Pe=[L.id,L.title,L.description,L.summary,L.reason,L.context,L.agent,H,...L.toolCalls,...L.artifacts.map(fe=>fe.path)].filter(Boolean).join(" ").toLowerCase();return Q&&ge&&(!re||Pe.includes(re))})},[u,p,q,g]),ne=N.useMemo(()=>new Set(Z.map(re=>re.id)),[Z]),K=N.useMemo(()=>Z.map(re=>({...re,parentIds:re.parentIds.filter(L=>ne.has(L)),parents:re.parents.filter(L=>ne.has(L.id)),childIds:re.childIds.filter(L=>ne.has(L))})),[Z,ne]),ue=N.useMemo(()=>Array.from(new Set(((r==null?void 0:r.nodes)??[]).map(re=>va(re.status)).filter(Boolean))).sort(),[r==null?void 0:r.nodes]),C=N.useMemo(()=>Array.from(new Set(((r==null?void 0:r.nodes)??[]).map(hs).filter(Boolean))).sort(),[r==null?void 0:r.nodes]),R=N.useMemo(()=>!r||K.length===0?null:K.find(re=>re.id===a)??K[0]??null,[a,r,K]),J=async(re=!1)=>{if(!e){s(null),c(null);return}re||A(!0),P(null);try{const L=await Ve.sessions.getTrace(e.id);s(L),re||(j.current=L.nodes.length,V.current||W(L.nodes.length)),c($=>{var H;return $&&L.nodes.some(Q=>Q.id===$)?$:((H=L.nodes[0])==null?void 0:H.id)??null})}catch(L){re||(s(null),P(L instanceof Error?L.message:n("trace.loadFailed")))}finally{re||A(!1)}};N.useEffect(()=>{J()},[e==null?void 0:e.id]),N.useEffect(()=>{if(!e||!E)return;const re=window.setInterval(()=>void J(!0),3e3);return()=>window.clearInterval(re)},[e==null?void 0:e.id,E]),N.useEffect(()=>{a&&K.length>0&&!ne.has(a)&&c(K[0].id)},[a,ne,K]),N.useEffect(()=>{W(B.length),j.current=B.length,V.current=!1,oe(!1)},[e==null?void 0:e.id]),N.useEffect(()=>{if(B.length===0){W(0),j.current=0;return}V.current||(B.length>j.current?(M>=j.current||j.current===0)&&W(B.length):B.length<M&&W(B.length)),j.current=B.length},[B.length,M]),N.useEffect(()=>{if(!ee||B.length===0)return;const re=window.setInterval(()=>{W(L=>L>=B.length?(oe(!1),L):L+1),ce(L=>L+1)},800);return()=>window.clearInterval(re)},[ee,B.length]);const T=()=>{B.length!==0&&(M>=B.length&&W(0),V.current=!1,oe(re=>!re))},X=re=>{oe(!1),V.current=!0,W(re)};return l.jsx("section",{className:"workspace-panel","aria-labelledby":"trace-panel-heading",children:l.jsxs("div",{className:"workspace-panel__inner workspace-panel__inner--trace",children:[l.jsxs("header",{className:"workspace-panel__header trace-header",children:[l.jsxs("div",{children:[l.jsx("span",{className:"workspace-panel__eyebrow",children:n("trace.eyebrow")}),l.jsx("h2",{id:"trace-panel-heading",children:n("trace.title")})]}),l.jsxs("div",{className:"trace-toolbar",children:[l.jsxs("div",{className:"trace-segmented","aria-label":n("trace.aria.layoutDir"),children:[l.jsx("button",{className:v==="LR"?"is-active":"",onClick:()=>b("LR"),type:"button",children:"LR"}),l.jsx("button",{className:v==="TB"?"is-active":"",onClick:()=>b("TB"),type:"button",children:"TB"})]}),l.jsxs("div",{className:"trace-refresh-group","aria-label":n("trace.aria.refreshControls"),children:[l.jsx(xt,{className:O?"is-active":"",disabled:!e,label:n("trace.aria.refresh"),onClick:()=>void J(),children:l.jsx(md,{size:15})}),l.jsxs("button",{"aria-pressed":E,className:`trace-live-toggle ${E?"is-active":""}`,disabled:!e,onClick:()=>S(re=>!re),title:n("trace.autoRefreshTitle"),type:"button",children:[l.jsx("span",{"aria-hidden":"true"}),n("trace.live")]})]})]})]}),G?l.jsx("p",{className:"workspace-panel__empty workspace-panel__empty--error",children:G}):null,e?null:l.jsx("p",{className:"workspace-panel__empty",children:n("trace.emptyNoSession")}),r?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"trace-meta",children:[l.jsx("span",{children:r.meta.projectName||(e==null?void 0:e.title)||n("trace.untitled")}),l.jsx("span",{children:n("trace.focus",{focus:String(r.meta.currentFocus||"-")})}),l.jsx("span",{children:n("trace.nodes",{visible:K.length,total:r.nodes.length})}),l.jsx("span",{children:n("trace.created",{time:Zy(r.meta.createdAt)})})]}),l.jsxs("div",{className:"trace-controls",children:[l.jsxs("label",{className:"trace-search",children:[l.jsx(og,{size:14}),l.jsx("input",{placeholder:n("trace.searchPlaceholder"),value:u,onChange:re=>f(re.target.value)}),u?l.jsx("button",{"aria-label":n("trace.aria.clearSearch"),onClick:()=>f(""),type:"button",children:l.jsx(Dn,{size:13})}):null]}),l.jsxs("div",{className:"trace-control",children:[l.jsx("span",{children:n("trace.status")}),l.jsx(ms,{ariaLabel:n("trace.aria.statusFilter"),className:"trace-control__select",onChange:m,options:[{label:n("trace.allStatus"),value:"all"},...ue.map(re=>{const L=Jy(re);return{label:L?n(L):re,value:re}})],value:p})]}),l.jsxs("div",{className:"trace-control",children:[l.jsx("span",{children:n("trace.type")}),l.jsx(ms,{ariaLabel:n("trace.aria.typeFilter"),className:"trace-control__select",onChange:y,options:[{label:n("trace.allTypes"),value:"all"},...C.map(re=>({label:re,value:re}))],value:g})]})]}),l.jsxs("div",{className:"trace-layout",children:[l.jsxs("div",{className:"trace-map","aria-label":n("trace.aria.graph"),children:[l.jsx(tx,{nodes:K,direction:v,selectedNodeId:(R==null?void 0:R.id)??null,onSelectNode:c,zoom:w,onZoomChange:_,fitToken:D,emptyLabel:n("trace.noMatch"),zoomLabels:{controls:n("trace.aria.zoomControls"),zoomIn:n("trace.aria.zoomIn"),zoomOut:n("trace.aria.zoomOut"),reset:n("trace.aria.resetZoom")}}),B.length>0?l.jsxs("div",{className:"trace-playback-bar","aria-label":n("trace.aria.playbackControls"),children:[l.jsx("button",{"aria-label":n(ee?"trace.aria.pause":"trace.aria.play"),className:"trace-playback-bar__button",onClick:T,type:"button",children:ee?l.jsx(rg,{size:14}):l.jsx(ig,{size:14})}),l.jsx("input",{"aria-label":n("trace.aria.playbackProgress"),className:"trace-playback-bar__slider",max:B.length,min:0,onChange:re=>X(Number(re.target.value)),type:"range",value:M}),l.jsxs("span",{className:"trace-playback-bar__count",children:[M," / ",B.length]})]}):null]}),l.jsx("article",{className:"trace-detail",children:l.jsx(sx,{node:R,onSelectNode:c,t:n})})]})]}):null]})})}function JM(e,n){if(n)return"sandbox.overlay.timeout";switch(e){case"creating":return"sandbox.overlay.creating";case"rebuilding":return"sandbox.overlay.rebuilding";default:return"sandbox.overlay.preparing"}}const e2=3e4,t2=2500;function n2({operation:e,error:n,onDismiss:r}){const s=yt(),[a,c]=N.useState(!1);return N.useEffect(()=>{c(!1);const u=window.setTimeout(()=>{c(!0)},e2);return()=>window.clearTimeout(u)},[e]),N.useEffect(()=>{if(!a)return;const u=window.setTimeout(()=>{r()},t2);return()=>window.clearTimeout(u)},[a,r]),l.jsx("div",{className:"sandbox-building-overlay",role:"dialog","aria-live":"polite","aria-label":s("sandbox.overlay.aria"),children:l.jsxs("div",{className:"sandbox-building-panel",children:[a?null:l.jsxs("div",{className:"sandbox-building__spinner","aria-hidden":"true",children:[l.jsx("span",{}),l.jsx("span",{}),l.jsx("span",{})]}),l.jsx("h2",{className:"sandbox-building__title",children:s("sandbox.overlay.title")}),l.jsx("p",{className:`sandbox-building__status ${a?"is-timeout":""}`,children:s(JM(e,a))}),n?l.jsx("p",{className:"sandbox-building__error",children:n}):null]})})}const r2={disconnected:"sandbox.conn.disconnected",connected:"sandbox.conn.connected",connecting:"sandbox.conn.connecting",creating:"sandbox.conn.creating"};function Zo(e){if(!e)return"-";const n=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1),s=e/1024**r;return`${s>=10?s.toFixed(0):s.toFixed(1)} ${n[r]}`}function i2(e,n){return e==="running"&&n?"connected":e==="running"&&!n?"connecting":e==="creating"||e==="rebuilding"?"creating":e==="loading"?"connecting":"disconnected"}function s2(e,n){switch(e){case"creating":return{key:"sandbox.status.creating"};case"rebuilding":return{key:"sandbox.status.rebuilding"};case"destroying":return{key:"sandbox.status.destroying"};case"missing":return{key:"sandbox.status.missing"};case"quota_exceeded":return{key:"sandbox.status.quotaExceeded"};case"error":return{key:"sandbox.status.error"};case"running":return{key:n?"sandbox.status.running":"sandbox.status.runningDisconnected"};default:return{key:"sandbox.status.fallback",vars:{status:e}}}}function a2(){const[e,n]=N.useState(!1),[r,s]=N.useState(""),[a,c]=N.useState(null),[u,f]=N.useState(!1),p=N.useRef(null),{currentSandbox:m,stats:g,status:y,operation:v,error:b,createSandbox:w,rebuildSandbox:_,destroySandbox:E,refresh:S}=Ti(),{isConnected:O}=Nr(),A=yt(),G=v==="idle"?y:v,P=i2(G,O),M=v!=="idle"&&v!=="loading",W=!!m,ee=async()=>{};return N.useEffect(()=>{const oe=ce=>{!p.current||p.current.contains(ce.target)||n(!1)},D=ce=>{ce.key==="Escape"&&n(!1)};return document.addEventListener("pointerdown",oe),document.addEventListener("keydown",D),()=>{document.removeEventListener("pointerdown",oe),document.removeEventListener("keydown",D)}},[]),N.useEffect(()=>{!e||!m||ee()},[m==null?void 0:m.id,e]),l.jsxs("div",{className:"sandbox-status",ref:p,children:[l.jsxs("button",{"aria-controls":"sandbox-status-popover","aria-expanded":e,className:`sandbox-status__trigger sandbox-status__trigger--${P}`,onClick:()=>n(oe=>!oe),type:"button",children:[l.jsx("span",{className:"sandbox-status__dot","aria-hidden":"true"}),l.jsx("span",{children:"Sandbox"})]}),l.jsxs("div",{"aria-label":A("sandbox.aria.status"),className:`sandbox-status__popover ${e?"is-open":""}`,id:"sandbox-status-popover",role:"dialog",children:[l.jsxs("div",{className:"sandbox-status__header",children:[l.jsx("span",{className:"sandbox-status__eyebrow",children:"Sandbox"}),l.jsx("strong",{children:A(r2[P])})]}),l.jsx("p",{className:`sandbox-status__notice ${M?"is-loading":""}`,children:(()=>{const oe=s2(G,O);return A(oe.key,oe.vars)})()}),b?l.jsx("p",{className:"sandbox-status__empty",children:b}):null,W?l.jsxs(l.Fragment,{children:[l.jsxs("dl",{className:"sandbox-status__grid",children:[l.jsxs("div",{children:[l.jsx("dt",{children:A("sandbox.label.name")}),l.jsx("dd",{children:m.name})]}),l.jsxs("div",{children:[l.jsx("dt",{children:A("sandbox.label.id")}),l.jsx("dd",{children:m.id})]}),l.jsxs("div",{children:[l.jsx("dt",{children:A("sandbox.label.container")}),l.jsx("dd",{children:m.containerName||"-"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:A("sandbox.label.hostApi")}),l.jsx("dd",{children:m.hostApiUrl||"-"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:A("sandbox.label.port")}),l.jsx("dd",{children:m.port??"-"})]}),l.jsxs("div",{children:[l.jsx("dt",{children:A("sandbox.label.created")}),l.jsx("dd",{children:new Date(m.createdAt).toLocaleString()})]})]}),l.jsxs("div",{className:"sandbox-status__metrics",children:[l.jsxs("div",{children:[l.jsx("span",{children:A("sandbox.label.memory")}),l.jsxs("strong",{children:[Zo(g==null?void 0:g.memory.usedBytes)," / ",Zo(g==null?void 0:g.memory.limitBytes)]}),l.jsxs("small",{children:[(g==null?void 0:g.memory.percent)??0,"%"]})]}),l.jsxs("div",{children:[l.jsx("span",{children:A("sandbox.label.cpu")}),l.jsx("strong",{children:A("sandbox.cpuUsed",{percent:(g==null?void 0:g.cpu.usedPercent)??0})}),l.jsx("small",{children:A("sandbox.cpuQuota",{quota:(g==null?void 0:g.cpu.quotaPercent)??0,cpus:(g==null?void 0:g.cpu.onlineCpus)??0})})]}),l.jsxs("div",{children:[l.jsx("span",{children:A("sandbox.label.pids")}),l.jsxs("strong",{children:[(g==null?void 0:g.pids.current)??0," / ",(g==null?void 0:g.pids.limit)??A("sandbox.unlimited")]})]}),l.jsxs("div",{children:[l.jsx("span",{children:A("sandbox.label.disk")}),l.jsxs("strong",{children:[Zo(g==null?void 0:g.disk.workspaceUsedBytes)," / ",Zo(g==null?void 0:g.disk.quotaBytes)]}),l.jsxs("small",{children:[(g==null?void 0:g.disk.percentOfQuota)??0,"%"]})]})]}),l.jsxs("div",{className:"sandbox-status__health",children:[l.jsxs("div",{children:[l.jsx("span",{children:A("sandbox.label.health")}),l.jsx("strong",{children:String((a==null?void 0:a.status)??A(u?"sandbox.health.checking":"sandbox.health.unknown"))})]}),l.jsxs("div",{children:[l.jsx("span",{children:A("sandbox.label.runtime")}),l.jsx("strong",{children:(a==null?void 0:a.agent_runtime)===!1?A("sandbox.health.offline"):a!=null&&a.agent_runtime?A("sandbox.health.online"):"-"})]}),l.jsxs("div",{children:[l.jsx("span",{children:A("sandbox.label.sse")}),l.jsx("strong",{children:A(O?"sandbox.health.connected":"sandbox.health.offline")})]}),l.jsxs("div",{children:[l.jsx("span",{children:A("sandbox.label.checked")}),l.jsx("strong",{children:a!=null&&a.checked_at?new Date(String(a.checked_at)).toLocaleTimeString():"-"})]})]}),l.jsx("pre",{className:"sandbox-status__logs",children:u?A("sandbox.logs.loading"):r||A("sandbox.logs.empty")})]}):l.jsx("p",{className:"sandbox-status__empty",children:A("sandbox.empty")}),l.jsx("div",{className:"sandbox-status__actions",children:W?l.jsxs(l.Fragment,{children:[l.jsx("button",{disabled:M,onClick:()=>void _(),type:"button",children:A("sandbox.action.rebuild")}),l.jsx("button",{disabled:M,onClick:()=>void S(),type:"button",children:A("sandbox.action.refresh")}),l.jsx("button",{disabled:u,onClick:()=>void ee(),type:"button",children:A("sandbox.action.logs")}),l.jsx("button",{className:"sandbox-status__danger-action",disabled:M,onClick:()=>void E(),type:"button",children:A("sandbox.action.delete")})]}):l.jsx("button",{disabled:M,onClick:()=>void w(),type:"button",children:A("sandbox.action.build")})})]})]})}function o2({isCollapsed:e,activePage:n,onOpenDemo:r,onGoWorkspace:s,onOpenSettings:a,onOpenSearch:c,onResizeStart:u,onToggle:f}){const{sessions:p,currentSession:m,isLoading:g,startDraftSession:y,selectSession:v,updateSessionTitle:b,deleteSession:w}=Nr(),_=yt(),[E,S]=N.useState(null),[O,A]=N.useState(""),[G,P]=N.useState(null),M=async W=>{if(W.preventDefault(),!E||!O.trim()){S(null);return}await b(E,O.trim()),S(null)};return l.jsxs("aside",{className:"sidebar","aria-label":_("sidebar.aria.nav"),children:[l.jsx("div",{"aria-label":_("sidebar.aria.resize"),className:"sidebar__resize-handle",onPointerDown:W=>{W.preventDefault(),u(W.clientX)},role:"separator"}),l.jsx("div",{className:"sidebar__topbar",children:l.jsx(xt,{"aria-expanded":!e,label:_(e?"sidebar.aria.expand":"sidebar.aria.collapse"),onClick:f,children:l.jsx(jv,{size:16})})}),l.jsxs("nav",{className:"sidebar__nav","aria-label":_("sidebar.aria.primary"),children:[l.jsxs("button",{className:"nav-item nav-item--strong",onClick:()=>{s(),y()},type:"button",children:[l.jsx(qu,{size:16}),l.jsx("span",{children:_("sidebar.newChat")})]}),l.jsxs("button",{className:"nav-item",type:"button",children:[l.jsx(sg,{size:16}),l.jsx("span",{children:_("sidebar.plugins")})]}),l.jsxs("button",{className:"nav-item",type:"button",children:[l.jsx(Xh,{size:16}),l.jsx("span",{children:_("sidebar.automations")})]}),l.jsxs("button",{className:`nav-item ${n==="demo"?"is-active":""}`,onClick:r,type:"button",children:[l.jsx(Rv,{size:16}),l.jsx("span",{children:_("sidebar.demo")})]})]}),l.jsxs("section",{className:"sidebar-section sidebar-section--conversations","aria-labelledby":"conversations-heading",children:[l.jsxs("div",{className:"section-heading",children:[l.jsx("h2",{id:"conversations-heading",children:_("sidebar.conversations")}),l.jsx("div",{className:"section-heading__actions",children:l.jsx(xt,{label:_("sidebar.aria.newConversation"),onClick:()=>{s(),y()},children:l.jsx(Nv,{size:13})})})]}),l.jsxs("div",{className:"conversation-stack",children:[l.jsxs("button",{className:"conversation-search-trigger",onClick:c,type:"button",children:[l.jsx(og,{size:14}),l.jsx("span",{children:_("sidebar.search")})]}),l.jsx("p",{className:"muted-label",children:g?_("sidebar.loading"):_("sidebar.sessionCount",{count:p.length})}),p.length===0&&!g?l.jsx("p",{className:"sidebar-empty",children:_("sidebar.empty")}):null,p.map(W=>{const ee=E===W.id,oe=G===W.id;return l.jsx("div",{className:`conversation-item ${(m==null?void 0:m.id)===W.id?"is-active":""}`,children:ee?l.jsxs("form",{className:"conversation-edit",onSubmit:M,children:[l.jsx("input",{autoFocus:!0,onChange:D=>A(D.target.value),value:O}),l.jsx(xt,{label:_("sidebar.aria.saveTitle"),type:"submit",children:l.jsx(gs,{size:14})}),l.jsx(xt,{label:_("sidebar.aria.cancelRename"),onClick:()=>S(null),children:l.jsx(Dn,{size:14})})]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"conversation-row",onClick:()=>{s(),v(W.id)},type:"button",children:[l.jsx(ng,{size:16}),l.jsx("span",{children:W.title}),l.jsx("small",{children:new Date(W.updatedAt).toLocaleDateString()})]}),l.jsx("div",{className:"conversation-actions",children:oe?l.jsxs(l.Fragment,{children:[l.jsx(xt,{label:_("sidebar.aria.confirmDelete"),onClick:()=>void w(W.id),children:l.jsx(gs,{size:14})}),l.jsx(xt,{label:_("sidebar.aria.cancelDelete"),onClick:()=>P(null),children:l.jsx(Dn,{size:14})})]}):l.jsxs(l.Fragment,{children:[l.jsx(xt,{label:_("sidebar.aria.rename"),onClick:()=>{S(W.id),A(W.title)},children:l.jsx(qu,{size:14})}),l.jsx(xt,{label:_("sidebar.aria.delete"),onClick:()=>P(W.id),children:l.jsx(gd,{size:14})})]})})]})},W.id)})]})]}),l.jsx("div",{className:"sidebar__footer",children:l.jsxs("button",{className:"nav-item",onClick:a,type:"button",children:[l.jsx(cg,{size:16}),l.jsx("span",{children:_("sidebar.settings")})]})})]})}function l2({isOpen:e,onClose:n,percentOfQuota:r}){const s=yt();return N.useEffect(()=>{if(!e)return;const a=c=>{c.key==="Escape"&&n()};return document.addEventListener("keydown",a),()=>document.removeEventListener("keydown",a)},[e,n]),e?l.jsx("div",{className:"quota-warning-modal",onClick:n,role:"presentation",children:l.jsxs("section",{className:"quota-warning-dialog",onClick:a=>a.stopPropagation(),role:"dialog","aria-modal":"true","aria-labelledby":"quota-warning-title",children:[l.jsxs("div",{className:"quota-warning-dialog__header",children:[l.jsxs("h2",{id:"quota-warning-title",children:[l.jsx(ka,{size:16,style:{marginRight:8,verticalAlign:"-2px",color:"var(--color-warning)"}}),s("quota.warning.title")]}),l.jsx(xt,{label:s("quota.warning.close"),onClick:n,children:l.jsx(Dn,{size:16})})]}),l.jsxs("div",{className:"quota-warning-dialog__body",children:[l.jsxs("p",{children:[s("quota.warning.bodyPrefix"),l.jsxs("strong",{children:[r.toFixed(0),"%"]}),s("quota.warning.bodySuffix")]}),l.jsx("p",{style:{marginTop:8},children:s("quota.warning.body2")})]}),l.jsx("div",{className:"quota-warning-dialog__actions",children:l.jsx("button",{onClick:n,type:"button",children:s("quota.warning.ack")})})]})}):null}const c2={name:"workspace",path:"/workspace",type:"folder",size:0,modified:0,permissions:""};function u2(e,n){return`${e.replace(/\/$/,"")}/${n}`}function d2(e){if(e===0)return"-";const n=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1),s=e/1024**r;return`${s>=10?s.toFixed(0):s.toFixed(1)} ${n[r]}`}function f2({sandboxId:e}){const n=yt(),[r,s]=N.useState({...c2}),[a,c]=N.useState(new Set(["/workspace"])),[u,f]=N.useState(new Set),[p,m]=N.useState(null),[g,y]=N.useState(!1),v=N.useCallback(async E=>{y(!0),m(null);try{const O=(await Ve.sandbox.listFiles(e,E)).map(A=>({...A,path:u2(E,A.name)}));s(A=>vx(A,E,O))}catch(S){m(S instanceof Error?S.message:n("quota.fm.loadFailed"))}finally{y(!1)}},[e,n]);N.useEffect(()=>{v("/workspace")},[v]);const b=N.useCallback(E=>{c(S=>{const O=new Set(S);return O.has(E.path)?O.delete(E.path):(O.add(E.path),E.loaded||v(E.path)),O})},[v]),w=N.useCallback(async E=>{if(window.confirm(n("quota.fm.confirmDelete",{name:E.name}))){f(S=>{const O=new Set(S);return O.add(E.path),O}),m(null);try{await Ve.sandbox.deleteFile(e,E.path),s(S=>wx(S,E.path)),c(S=>{const O=new Set(S);return O.delete(E.path),O})}catch(S){m(S instanceof Error?S.message:n("quota.fm.deleteFailed"))}finally{f(S=>{const O=new Set(S);return O.delete(E.path),O})}}},[e,n]),_=(E,S=0)=>{var P;const O=E.type==="folder",A=a.has(E.path),G=u.has(E.path);return l.jsxs("div",{className:"file-node",children:[l.jsxs("div",{className:"file-row file-row--deletable",children:[l.jsxs("button",{className:"file-row__open",onClick:()=>{O&&b(E)},style:{marginLeft:S*16},type:"button",children:[l.jsx("span",{className:`file-row__chevron ${O&&A?"is-expanded":""}`,children:O?l.jsx(ud,{size:14}):null}),O?l.jsx(fd,{size:14}):l.jsx(dd,{size:14}),l.jsx("span",{className:"file-row__name",children:E.name}),l.jsx("span",{className:"file-row__size",children:d2(E.size)})]}),l.jsx("button",{className:"file-row__delete",disabled:G,onClick:()=>void w(E),title:n("quota.fm.delete"),type:"button",children:l.jsx(gd,{size:14})})]}),O&&A?(P=E.children)==null?void 0:P.map(M=>_(M,S+1)):null]},E.path)};return l.jsxs("div",{children:[p?l.jsx("p",{className:"quota-file-manager__error",children:p}):null,g&&r.children==null?l.jsx("p",{className:"file-sidebar__empty",children:n("quota.fm.loading")}):l.jsx("div",{className:"file-sidebar__tree",children:_(r)})]})}function vx(e,n,r){return e.path===n?{...e,children:[...r],loaded:!0}:e.children?{...e,children:e.children.map(s=>vx(s,n,r))}:e}function wx(e,n){if(e.children){const r=e.children.filter(s=>s.path!==n).map(s=>wx(s,n));return{...e,children:r}}return e}function Wh(e){if(e===0)return"0 B";const n=["B","KB","MB","GB"],r=Math.min(Math.floor(Math.log(e)/Math.log(1024)),n.length-1),s=e/1024**r;return`${s>=10?s.toFixed(0):s.toFixed(1)} ${n[r]}`}function p2({isOpen:e,sandboxId:n,workspaceUsedBytes:r,quotaBytes:s,percentOfQuota:a}){const c=yt();return e?l.jsx("div",{className:"quota-critical-modal",role:"presentation",children:l.jsxs("section",{className:"quota-critical-dialog",role:"dialog","aria-modal":"true","aria-labelledby":"quota-critical-title",children:[l.jsx("div",{className:"quota-critical-dialog__header",children:l.jsxs("h2",{id:"quota-critical-title",children:[l.jsx(ka,{size:16,style:{marginRight:8,verticalAlign:"-2px"}}),c("quota.critical.title")]})}),l.jsx("div",{className:"quota-critical-dialog__body",children:n?l.jsx(f2,{sandboxId:n}):l.jsx("p",{className:"file-sidebar__empty",children:c("quota.critical.unavailable")})}),l.jsxs("div",{className:"quota-critical-dialog__footer",children:[l.jsx("span",{children:c("quota.critical.used",{used:Wh(r),limit:Wh(s)})}),l.jsxs("span",{style:{color:"var(--color-danger)",fontWeight:600},children:[a.toFixed(0),"%"]})]})]})}):null}const m2=220,h2=420;function g2(){const{isAuthReady:e}=gl(),{currentSandbox:n,operation:r,error:s,stats:a}=Ti(),{currentSession:c,currentView:u,messages:f,isRefreshingMessages:p,refreshMessages:m,setCurrentView:g}=Nr(),y=yt(),[v,b]=N.useState(!1),[w,_]=N.useState("workspace"),[E,S]=N.useState(268),[O,A]=N.useState(!1),[G,P]=N.useState(!1),[M,W]=N.useState(!1),[ee,oe]=N.useState(!1),[D,ce]=N.useState(420),[V,j]=N.useState(!1),[B,q]=N.useState(!1),[Z,ne]=N.useState(!1),K=N.useRef(!1),ue=N.useRef(null);N.useEffect(()=>{(r==="creating"||r==="rebuilding")&&q(!1)},[r]),N.useEffect(()=>{const R=(a==null?void 0:a.disk.percentOfQuota)??0;R>=90&&R<100&&!K.current&&(K.current=!0,ne(!0))},[a]);const C=a?a.disk.percentOfQuota>=100:!1;return N.useEffect(()=>{const R=T=>{if(!ue.current)return;const X=T.clientX-ue.current.pointerX,re=Math.max(m2,Math.min(h2,ue.current.width+X));S(re)},J=()=>{ue.current&&(ue.current=null,A(!1))};return window.addEventListener("pointermove",R),window.addEventListener("pointerup",J),()=>{window.removeEventListener("pointermove",R),window.removeEventListener("pointerup",J)}},[]),e?l.jsxs("div",{className:`desktop-shell ${v?"desktop-shell--sidebar-collapsed":""} ${O?"desktop-shell--resizing-sidebar":""}`,style:{"--active-sidebar-width":`${E}px`},children:[l.jsx(o2,{isCollapsed:v,activePage:w,onOpenDemo:()=>_("demo"),onGoWorkspace:()=>_("workspace"),onOpenSettings:()=>W(!0),onOpenSearch:()=>P(!0),onResizeStart:R=>{v||(ue.current={pointerX:R,width:E},A(!0))},onToggle:()=>b(R=>!R)}),w==="demo"?l.jsx(JT,{}):l.jsxs("main",{className:`workspace ${ee?"workspace--files-open":""} ${V?"workspace--resizing-files":""}`,style:{"--active-file-sidebar-width":`${D}px`},"aria-label":y("shell.aria.workspace"),children:[l.jsxs("header",{className:"workspace-toolbar","aria-label":y("shell.aria.toolbarActions"),children:[l.jsxs("div",{className:"session-title","aria-label":y("shell.aria.activeSession"),children:[l.jsx("span",{className:"session-title__label",children:y("shell.sessionLabel")}),c!=null&&c.id?l.jsx("span",{className:"session-title__id",children:c.id.slice(0,8)}):null,f.length===0?l.jsx("span",{className:"session-title__name",children:(c==null?void 0:c.title)||y("shell.defaultWorkspace")}):null]}),l.jsxs("div",{className:"workspace-toolbar__actions",children:[l.jsxs("div",{className:"workspace-view-tabs",role:"tablist","aria-label":y("shell.aria.viewTabs"),children:[l.jsxs("button",{"aria-selected":u==="chat",className:u==="chat"?"is-active":"",onClick:()=>g("chat"),role:"tab",type:"button",children:[l.jsx(_a,{size:14}),l.jsx("span",{children:y("shell.view.chat")})]}),l.jsxs("button",{"aria-selected":u==="agents",className:u==="agents"?"is-active":"",onClick:()=>g("agents"),role:"tab",type:"button",children:[l.jsx(ml,{size:14}),l.jsx("span",{children:y("shell.view.agents")})]}),l.jsxs("button",{"aria-selected":u==="trace",className:u==="trace"?"is-active":"",onClick:()=>g("trace"),role:"tab",type:"button",children:[l.jsx(ma,{size:14}),l.jsx("span",{children:y("shell.view.trace")})]})]}),u==="chat"?l.jsx(xt,{className:p?"is-active":"",label:y("shell.aria.refreshMessages"),onClick:()=>void m(),children:l.jsx(md,{size:14})}):null,l.jsx(a2,{}),l.jsx(xt,{"aria-pressed":ee,className:ee?"is-active":"",label:y(ee?"shell.files.close":"shell.files.open"),onClick:()=>oe(R=>!R),children:l.jsx(kv,{size:16})})]})]}),u==="chat"?l.jsx(kT,{}):null,u==="agents"?l.jsx(QM,{}):null,u==="trace"?l.jsx(ZM,{}):null,l.jsx(fA,{isOpen:ee,onClose:()=>oe(!1),onResize:ce,onResizeEnd:()=>j(!1),onResizeStart:()=>j(!0),width:D})]}),l.jsx(mA,{isOpen:G,onClose:()=>P(!1)}),l.jsx(bA,{isOpen:M,onClose:()=>W(!1)}),!B&&(r==="creating"||r==="rebuilding")?l.jsx(n2,{operation:r,error:s,onDismiss:()=>q(!0)}):null,l.jsx(l2,{isOpen:Z,onClose:()=>ne(!1),percentOfQuota:(a==null?void 0:a.disk.percentOfQuota)??0}),l.jsx(p2,{isOpen:C,sandboxId:(n==null?void 0:n.id)??null,workspaceUsedBytes:(a==null?void 0:a.disk.workspaceUsedBytes)??0,quotaBytes:(a==null?void 0:a.disk.quotaBytes)??0,percentOfQuota:(a==null?void 0:a.disk.percentOfQuota)??0})]}):l.jsxs("div",{className:"app-bootstrapping",role:"status","aria-live":"polite",children:[l.jsx("span",{className:"sandbox-status__eyebrow",children:"BrainPilot"}),l.jsx("p",{children:y("shell.bootstrapping")})]})}function y2({children:e}){return l.jsx(Xw,{children:l.jsx(ow,{children:l.jsx(Sw,{children:l.jsx(Aw,{children:l.jsx(Gw,{children:e})})})})})}function x2(){return l.jsx(y2,{children:l.jsx(g2,{})})}uv.createRoot(document.getElementById("root")).render(l.jsx(iv.StrictMode,{children:l.jsx(x2,{})}));
|