@origintrail-official/dkg-node-ui 10.0.22 → 10.0.24
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -0
- package/dist/chat-graph-delta-subjects.d.ts +38 -0
- package/dist/chat-graph-delta-subjects.d.ts.map +1 -0
- package/dist/chat-graph-delta-subjects.js +57 -0
- package/dist/chat-graph-delta-subjects.js.map +1 -0
- package/dist/chat-history-rows.d.ts +59 -0
- package/dist/chat-history-rows.d.ts.map +1 -0
- package/dist/chat-history-rows.js +152 -0
- package/dist/chat-history-rows.js.map +1 -0
- package/dist/chat-literals.d.ts +34 -0
- package/dist/chat-literals.d.ts.map +1 -0
- package/dist/chat-literals.js +141 -0
- package/dist/chat-literals.js.map +1 -0
- package/dist/chat-memory.d.ts +1 -17
- package/dist/chat-memory.d.ts.map +1 -1
- package/dist/chat-memory.js +56 -226
- package/dist/chat-memory.js.map +1 -1
- package/dist/chat-vocabulary.d.ts +12 -0
- package/dist/chat-vocabulary.d.ts.map +1 -0
- package/dist/chat-vocabulary.js +13 -0
- package/dist/chat-vocabulary.js.map +1 -0
- package/dist-ui/assets/{3d-force-graph-DbVwxMKf.js → 3d-force-graph-DvzZZzFn.js} +1 -1
- package/dist-ui/assets/{ActivityFeed-Bfg6fmQQ.js → ActivityFeed-B5QxV1dk.js} +2 -2
- package/dist-ui/assets/{AgentHub-DyF5Pa70.js → AgentHub-BO9jGbJl.js} +1 -1
- package/dist-ui/assets/{AgentProfilePage-BPrSuKjV.js → AgentProfilePage-DJJTn1WD.js} +1 -1
- package/dist-ui/assets/{ApproveWalletsModal-Dd_tHLRP.js → ApproveWalletsModal-C2Tu29tB.js} +3 -3
- package/dist-ui/assets/{ContextGraphPrimitives-BXormriD.js → ContextGraphPrimitives-BqlTIZHy.js} +1 -1
- package/dist-ui/assets/{ConvictionDetailView-BsPTd17P.js → ConvictionDetailView-J-DAKHtP.js} +2 -2
- package/dist-ui/assets/MemoryLayerView-BOxI-_TF.js +2 -0
- package/dist-ui/assets/{MemoryStackView-BbUJ2uiM.js → MemoryStackView-BTyZZKNm.js} +1 -1
- package/dist-ui/assets/{Network-BKvJttOu.js → Network-DV9K48MH.js} +1 -1
- package/dist-ui/assets/{OnChainProvenanceCard-BV9-G1cT.js → OnChainProvenanceCard-jxk66g53.js} +1 -1
- package/dist-ui/assets/{Operations-LAhUQsnj.js → Operations-CNB1BMYg.js} +1 -1
- package/dist-ui/assets/{ProjectView-0zCSblAV.js → ProjectView-BP4vNSXI.js} +30 -30
- package/dist-ui/assets/{PublishingConviction-CF6352oT.js → PublishingConviction-DbP1i3v0.js} +2 -2
- package/dist-ui/assets/{Settings-runaZqPv.js → Settings-I6g3MQCV.js} +1 -1
- package/dist-ui/assets/{browserWalletTransaction-CBgx0i4w.js → browserWalletTransaction-CXv612Pn.js} +3 -3
- package/dist-ui/assets/{ccip-BM07w5uU.js → ccip-DY93ay8e.js} +1 -1
- package/dist-ui/assets/index-CIt7zWgM.css +1 -0
- package/dist-ui/assets/{index-CfVUpsfM.js → index-CumB6j2m.js} +3 -3
- package/dist-ui/assets/index-DW3dBcQk.js +1175 -0
- package/dist-ui/assets/{jsonld-32FQRO67-DBZOBQji.js → jsonld-32FQRO67-DKLfQ_nD.js} +2 -2
- package/dist-ui/assets/{jsonld-DOX7dKpf.js → jsonld-BgpgXlDQ.js} +1 -1
- package/dist-ui/assets/{renderer-3d-2EVDZII7-CVCpAmwB.js → renderer-3d-2EVDZII7-BCmzI8Ii.js} +2 -2
- package/dist-ui/assets/{shikiHighlighter-CzU2U2Tx.js → shikiHighlighter-BXl6qMQO.js} +4 -4
- package/dist-ui/assets/{useEntityOnChainReceipt-BvWQ6qdT.js → useEntityOnChainReceipt-CUGQNIsP.js} +1 -1
- package/dist-ui/assets/{useProjectActivity-Cxr4QGX1.js → useProjectActivity-BOgGdtS7.js} +1 -1
- package/dist-ui/index.html +2 -2
- package/package.json +4 -4
- package/dist-ui/assets/MemoryLayerView-CloJeM33.js +0 -2
- package/dist-ui/assets/index-MQh8C4aJ.js +0 -1175
- package/dist-ui/assets/index-xKO-U_eV.css +0 -1
|
@@ -0,0 +1,1175 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/html-pp8916En.js","assets/javascript-wDzz0qaB.js","assets/css-CLj8gQPS.js","assets/Operations-CNB1BMYg.js","assets/string-DtUow4KV.js","assets/Settings-I6g3MQCV.js","assets/browserWalletTransaction-CXv612Pn.js","assets/AgentProfilePage-DJJTn1WD.js","assets/ActivityFeed-B5QxV1dk.js","assets/useProjectActivity-BOgGdtS7.js","assets/PublishingConviction-DbP1i3v0.js","assets/ContextGraphPrimitives-BqlTIZHy.js","assets/ApproveWalletsModal-C2Tu29tB.js","assets/ConvictionDetailView-J-DAKHtP.js","assets/ProjectView-BP4vNSXI.js","assets/truncate-BaiMkAOo.js","assets/useEntityOnChainReceipt-CUGQNIsP.js","assets/MemoryLayerView-BOxI-_TF.js","assets/MemoryStackView-BTyZZKNm.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var X2=Object.defineProperty;var Z2=(e,n,a)=>n in e?X2(e,n,{enumerable:!0,configurable:!0,writable:!0,value:a}):e[n]=a;var Ut=(e,n,a)=>Z2(e,typeof n!="symbol"?n+"":n,a);(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const o of document.querySelectorAll('link[rel="modulepreload"]'))r(o);new MutationObserver(o=>{for(const s of o)if(s.type==="childList")for(const u of s.addedNodes)u.tagName==="LINK"&&u.rel==="modulepreload"&&r(u)}).observe(document,{childList:!0,subtree:!0});function a(o){const s={};return o.integrity&&(s.integrity=o.integrity),o.referrerPolicy&&(s.referrerPolicy=o.referrerPolicy),o.crossOrigin==="use-credentials"?s.credentials="include":o.crossOrigin==="anonymous"?s.credentials="omit":s.credentials="same-origin",s}function r(o){if(o.ep)return;o.ep=!0;const s=a(o);fetch(o.href,s)}})();var d8=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Po(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}function f8(e){if(Object.prototype.hasOwnProperty.call(e,"__esModule"))return e;var n=e.default;if(typeof n=="function"){var a=function r(){return this instanceof r?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};a.prototype=n.prototype}else a={};return Object.defineProperty(a,"__esModule",{value:!0}),Object.keys(e).forEach(function(r){var o=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(a,r,o.get?o:{enumerable:!0,get:function(){return e[r]}})}),a}var Ef={exports:{}},so={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react-jsx-runtime.production.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var Kv;function J2(){if(Kv)return so;Kv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.fragment");function a(r,o,s){var u=null;if(s!==void 0&&(u=""+s),o.key!==void 0&&(u=""+o.key),"key"in o){s={};for(var d in o)d!=="key"&&(s[d]=o[d])}else s=o;return o=s.ref,{$$typeof:e,type:r,key:u,ref:o!==void 0?o:null,props:s}}return so.Fragment=n,so.jsx=a,so.jsxs=a,so}var Qv;function eC(){return Qv||(Qv=1,Ef.exports=J2()),Ef.exports}var m=eC(),Af={exports:{}},Oe={};/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react.production.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Xv;function tC(){if(Xv)return Oe;Xv=1;var e=Symbol.for("react.transitional.element"),n=Symbol.for("react.portal"),a=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),o=Symbol.for("react.profiler"),s=Symbol.for("react.consumer"),u=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),f=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.for("react.activity"),x=Symbol.iterator;function b(L){return L===null||typeof L!="object"?null:(L=x&&L[x]||L["@@iterator"],typeof L=="function"?L:null)}var k={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,j={};function E(L,X,N){this.props=L,this.context=X,this.refs=j,this.updater=N||k}E.prototype.isReactComponent={},E.prototype.setState=function(L,X){if(typeof L!="object"&&typeof L!="function"&&L!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,L,X,"setState")},E.prototype.forceUpdate=function(L){this.updater.enqueueForceUpdate(this,L,"forceUpdate")};function _(){}_.prototype=E.prototype;function R(L,X,N){this.props=L,this.context=X,this.refs=j,this.updater=N||k}var F=R.prototype=new _;F.constructor=R,C(F,E.prototype),F.isPureReactComponent=!0;var U=Array.isArray;function D(){}var W={H:null,A:null,T:null,S:null},Q=Object.prototype.hasOwnProperty;function M(L,X,N){var ue=N.ref;return{$$typeof:e,type:L,key:X,ref:ue!==void 0?ue:null,props:N}}function T(L,X){return M(L.type,X,L.props)}function q(L){return typeof L=="object"&&L!==null&&L.$$typeof===e}function V(L){var X={"=":"=0",":":"=2"};return"$"+L.replace(/[=:]/g,function(N){return X[N]})}var ae=/\/+/g;function P(L,X){return typeof L=="object"&&L!==null&&L.key!=null?V(""+L.key):X.toString(36)}function K(L){switch(L.status){case"fulfilled":return L.value;case"rejected":throw L.reason;default:switch(typeof L.status=="string"?L.then(D,D):(L.status="pending",L.then(function(X){L.status==="pending"&&(L.status="fulfilled",L.value=X)},function(X){L.status==="pending"&&(L.status="rejected",L.reason=X)})),L.status){case"fulfilled":return L.value;case"rejected":throw L.reason}}throw L}function B(L,X,N,ue,pe){var he=typeof L;(he==="undefined"||he==="boolean")&&(L=null);var Ee=!1;if(L===null)Ee=!0;else switch(he){case"bigint":case"string":case"number":Ee=!0;break;case"object":switch(L.$$typeof){case e:case n:Ee=!0;break;case y:return Ee=L._init,B(Ee(L._payload),X,N,ue,pe)}}if(Ee)return pe=pe(L),Ee=ue===""?"."+P(L,0):ue,U(pe)?(N="",Ee!=null&&(N=Ee.replace(ae,"$&/")+"/"),B(pe,X,N,"",function(et){return et})):pe!=null&&(q(pe)&&(pe=T(pe,N+(pe.key==null||L&&L.key===pe.key?"":(""+pe.key).replace(ae,"$&/")+"/")+Ee)),X.push(pe)),1;Ee=0;var Ue=ue===""?".":ue+":";if(U(L))for(var Ne=0;Ne<L.length;Ne++)ue=L[Ne],he=Ue+P(ue,Ne),Ee+=B(ue,X,N,he,pe);else if(Ne=b(L),typeof Ne=="function")for(L=Ne.call(L),Ne=0;!(ue=L.next()).done;)ue=ue.value,he=Ue+P(ue,Ne++),Ee+=B(ue,X,N,he,pe);else if(he==="object"){if(typeof L.then=="function")return B(K(L),X,N,ue,pe);throw X=String(L),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(L).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Ee}function Z(L,X,N){if(L==null)return L;var ue=[],pe=0;return B(L,ue,"","",function(he){return X.call(N,he,pe++)}),ue}function ie(L){if(L._status===-1){var X=L._result;X=X(),X.then(function(N){(L._status===0||L._status===-1)&&(L._status=1,L._result=N)},function(N){(L._status===0||L._status===-1)&&(L._status=2,L._result=N)}),L._status===-1&&(L._status=0,L._result=X)}if(L._status===1)return L._result.default;throw L._result}var G=typeof reportError=="function"?reportError:function(L){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L),error:L});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",L);return}console.error(L)},O={map:Z,forEach:function(L,X,N){Z(L,function(){X.apply(this,arguments)},N)},count:function(L){var X=0;return Z(L,function(){X++}),X},toArray:function(L){return Z(L,function(X){return X})||[]},only:function(L){if(!q(L))throw Error("React.Children.only expected to receive a single React element child.");return L}};return Oe.Activity=g,Oe.Children=O,Oe.Component=E,Oe.Fragment=a,Oe.Profiler=o,Oe.PureComponent=R,Oe.StrictMode=r,Oe.Suspense=p,Oe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=W,Oe.__COMPILER_RUNTIME={__proto__:null,c:function(L){return W.H.useMemoCache(L)}},Oe.cache=function(L){return function(){return L.apply(null,arguments)}},Oe.cacheSignal=function(){return null},Oe.cloneElement=function(L,X,N){if(L==null)throw Error("The argument must be a React element, but you passed "+L+".");var ue=C({},L.props),pe=L.key;if(X!=null)for(he in X.key!==void 0&&(pe=""+X.key),X)!Q.call(X,he)||he==="key"||he==="__self"||he==="__source"||he==="ref"&&X.ref===void 0||(ue[he]=X[he]);var he=arguments.length-2;if(he===1)ue.children=N;else if(1<he){for(var Ee=Array(he),Ue=0;Ue<he;Ue++)Ee[Ue]=arguments[Ue+2];ue.children=Ee}return M(L.type,pe,ue)},Oe.createContext=function(L){return L={$$typeof:u,_currentValue:L,_currentValue2:L,_threadCount:0,Provider:null,Consumer:null},L.Provider=L,L.Consumer={$$typeof:s,_context:L},L},Oe.createElement=function(L,X,N){var ue,pe={},he=null;if(X!=null)for(ue in X.key!==void 0&&(he=""+X.key),X)Q.call(X,ue)&&ue!=="key"&&ue!=="__self"&&ue!=="__source"&&(pe[ue]=X[ue]);var Ee=arguments.length-2;if(Ee===1)pe.children=N;else if(1<Ee){for(var Ue=Array(Ee),Ne=0;Ne<Ee;Ne++)Ue[Ne]=arguments[Ne+2];pe.children=Ue}if(L&&L.defaultProps)for(ue in Ee=L.defaultProps,Ee)pe[ue]===void 0&&(pe[ue]=Ee[ue]);return M(L,he,pe)},Oe.createRef=function(){return{current:null}},Oe.forwardRef=function(L){return{$$typeof:d,render:L}},Oe.isValidElement=q,Oe.lazy=function(L){return{$$typeof:y,_payload:{_status:-1,_result:L},_init:ie}},Oe.memo=function(L,X){return{$$typeof:f,type:L,compare:X===void 0?null:X}},Oe.startTransition=function(L){var X=W.T,N={};W.T=N;try{var ue=L(),pe=W.S;pe!==null&&pe(N,ue),typeof ue=="object"&&ue!==null&&typeof ue.then=="function"&&ue.then(D,G)}catch(he){G(he)}finally{X!==null&&N.types!==null&&(X.types=N.types),W.T=X}},Oe.unstable_useCacheRefresh=function(){return W.H.useCacheRefresh()},Oe.use=function(L){return W.H.use(L)},Oe.useActionState=function(L,X,N){return W.H.useActionState(L,X,N)},Oe.useCallback=function(L,X){return W.H.useCallback(L,X)},Oe.useContext=function(L){return W.H.useContext(L)},Oe.useDebugValue=function(){},Oe.useDeferredValue=function(L,X){return W.H.useDeferredValue(L,X)},Oe.useEffect=function(L,X){return W.H.useEffect(L,X)},Oe.useEffectEvent=function(L){return W.H.useEffectEvent(L)},Oe.useId=function(){return W.H.useId()},Oe.useImperativeHandle=function(L,X,N){return W.H.useImperativeHandle(L,X,N)},Oe.useInsertionEffect=function(L,X){return W.H.useInsertionEffect(L,X)},Oe.useLayoutEffect=function(L,X){return W.H.useLayoutEffect(L,X)},Oe.useMemo=function(L,X){return W.H.useMemo(L,X)},Oe.useOptimistic=function(L,X){return W.H.useOptimistic(L,X)},Oe.useReducer=function(L,X,N){return W.H.useReducer(L,X,N)},Oe.useRef=function(L){return W.H.useRef(L)},Oe.useState=function(L){return W.H.useState(L)},Oe.useSyncExternalStore=function(L,X,N){return W.H.useSyncExternalStore(L,X,N)},Oe.useTransition=function(){return W.H.useTransition()},Oe.version="19.2.4",Oe}var Zv;function uh(){return Zv||(Zv=1,Af.exports=tC()),Af.exports}var S=uh();const mn=Po(S);var jf={exports:{}},co={},Tf={exports:{}},Nf={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var Jv;function nC(){return Jv||(Jv=1,(function(e){function n(B,Z){var ie=B.length;B.push(Z);e:for(;0<ie;){var G=ie-1>>>1,O=B[G];if(0<o(O,Z))B[G]=Z,B[ie]=O,ie=G;else break e}}function a(B){return B.length===0?null:B[0]}function r(B){if(B.length===0)return null;var Z=B[0],ie=B.pop();if(ie!==Z){B[0]=ie;e:for(var G=0,O=B.length,L=O>>>1;G<L;){var X=2*(G+1)-1,N=B[X],ue=X+1,pe=B[ue];if(0>o(N,ie))ue<O&&0>o(pe,N)?(B[G]=pe,B[ue]=ie,G=ue):(B[G]=N,B[X]=ie,G=X);else if(ue<O&&0>o(pe,ie))B[G]=pe,B[ue]=ie,G=ue;else break e}}return Z}function o(B,Z){var ie=B.sortIndex-Z.sortIndex;return ie!==0?ie:B.id-Z.id}if(e.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var s=performance;e.unstable_now=function(){return s.now()}}else{var u=Date,d=u.now();e.unstable_now=function(){return u.now()-d}}var p=[],f=[],y=1,g=null,x=3,b=!1,k=!1,C=!1,j=!1,E=typeof setTimeout=="function"?setTimeout:null,_=typeof clearTimeout=="function"?clearTimeout:null,R=typeof setImmediate<"u"?setImmediate:null;function F(B){for(var Z=a(f);Z!==null;){if(Z.callback===null)r(f);else if(Z.startTime<=B)r(f),Z.sortIndex=Z.expirationTime,n(p,Z);else break;Z=a(f)}}function U(B){if(C=!1,F(B),!k)if(a(p)!==null)k=!0,D||(D=!0,V());else{var Z=a(f);Z!==null&&K(U,Z.startTime-B)}}var D=!1,W=-1,Q=5,M=-1;function T(){return j?!0:!(e.unstable_now()-M<Q)}function q(){if(j=!1,D){var B=e.unstable_now();M=B;var Z=!0;try{e:{k=!1,C&&(C=!1,_(W),W=-1),b=!0;var ie=x;try{t:{for(F(B),g=a(p);g!==null&&!(g.expirationTime>B&&T());){var G=g.callback;if(typeof G=="function"){g.callback=null,x=g.priorityLevel;var O=G(g.expirationTime<=B);if(B=e.unstable_now(),typeof O=="function"){g.callback=O,F(B),Z=!0;break t}g===a(p)&&r(p),F(B)}else r(p);g=a(p)}if(g!==null)Z=!0;else{var L=a(f);L!==null&&K(U,L.startTime-B),Z=!1}}break e}finally{g=null,x=ie,b=!1}Z=void 0}}finally{Z?V():D=!1}}}var V;if(typeof R=="function")V=function(){R(q)};else if(typeof MessageChannel<"u"){var ae=new MessageChannel,P=ae.port2;ae.port1.onmessage=q,V=function(){P.postMessage(null)}}else V=function(){E(q,0)};function K(B,Z){W=E(function(){B(e.unstable_now())},Z)}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(B){B.callback=null},e.unstable_forceFrameRate=function(B){0>B||125<B?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<B?Math.floor(1e3/B):5},e.unstable_getCurrentPriorityLevel=function(){return x},e.unstable_next=function(B){switch(x){case 1:case 2:case 3:var Z=3;break;default:Z=x}var ie=x;x=Z;try{return B()}finally{x=ie}},e.unstable_requestPaint=function(){j=!0},e.unstable_runWithPriority=function(B,Z){switch(B){case 1:case 2:case 3:case 4:case 5:break;default:B=3}var ie=x;x=B;try{return Z()}finally{x=ie}},e.unstable_scheduleCallback=function(B,Z,ie){var G=e.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?G+ie:G):ie=G,B){case 1:var O=-1;break;case 2:O=250;break;case 5:O=1073741823;break;case 4:O=1e4;break;default:O=5e3}return O=ie+O,B={id:y++,callback:Z,priorityLevel:B,startTime:ie,expirationTime:O,sortIndex:-1},ie>G?(B.sortIndex=ie,n(f,B),a(p)===null&&B===a(f)&&(C?(_(W),W=-1):C=!0,K(U,ie-G))):(B.sortIndex=O,n(p,B),k||b||(k=!0,D||(D=!0,V()))),B},e.unstable_shouldYield=T,e.unstable_wrapCallback=function(B){var Z=x;return function(){var ie=x;x=Z;try{return B.apply(this,arguments)}finally{x=ie}}}})(Nf)),Nf}var e0;function aC(){return e0||(e0=1,Tf.exports=nC()),Tf.exports}var Rf={exports:{}},ln={};/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var t0;function iC(){if(t0)return ln;t0=1;var e=uh();function n(p){var f="https://react.dev/errors/"+p;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var y=2;y<arguments.length;y++)f+="&args[]="+encodeURIComponent(arguments[y])}return"Minified React error #"+p+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function a(){}var r={d:{f:a,r:function(){throw Error(n(522))},D:a,C:a,L:a,m:a,X:a,S:a,M:a},p:0,findDOMNode:null},o=Symbol.for("react.portal");function s(p,f,y){var g=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:o,key:g==null?null:""+g,children:p,containerInfo:f,implementation:y}}var u=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function d(p,f){if(p==="font")return"";if(typeof f=="string")return f==="use-credentials"?f:""}return ln.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,ln.createPortal=function(p,f){var y=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!f||f.nodeType!==1&&f.nodeType!==9&&f.nodeType!==11)throw Error(n(299));return s(p,f,null,y)},ln.flushSync=function(p){var f=u.T,y=r.p;try{if(u.T=null,r.p=2,p)return p()}finally{u.T=f,r.p=y,r.d.f()}},ln.preconnect=function(p,f){typeof p=="string"&&(f?(f=f.crossOrigin,f=typeof f=="string"?f==="use-credentials"?f:"":void 0):f=null,r.d.C(p,f))},ln.prefetchDNS=function(p){typeof p=="string"&&r.d.D(p)},ln.preinit=function(p,f){if(typeof p=="string"&&f&&typeof f.as=="string"){var y=f.as,g=d(y,f.crossOrigin),x=typeof f.integrity=="string"?f.integrity:void 0,b=typeof f.fetchPriority=="string"?f.fetchPriority:void 0;y==="style"?r.d.S(p,typeof f.precedence=="string"?f.precedence:void 0,{crossOrigin:g,integrity:x,fetchPriority:b}):y==="script"&&r.d.X(p,{crossOrigin:g,integrity:x,fetchPriority:b,nonce:typeof f.nonce=="string"?f.nonce:void 0})}},ln.preinitModule=function(p,f){if(typeof p=="string")if(typeof f=="object"&&f!==null){if(f.as==null||f.as==="script"){var y=d(f.as,f.crossOrigin);r.d.M(p,{crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0})}}else f==null&&r.d.M(p)},ln.preload=function(p,f){if(typeof p=="string"&&typeof f=="object"&&f!==null&&typeof f.as=="string"){var y=f.as,g=d(y,f.crossOrigin);r.d.L(p,y,{crossOrigin:g,integrity:typeof f.integrity=="string"?f.integrity:void 0,nonce:typeof f.nonce=="string"?f.nonce:void 0,type:typeof f.type=="string"?f.type:void 0,fetchPriority:typeof f.fetchPriority=="string"?f.fetchPriority:void 0,referrerPolicy:typeof f.referrerPolicy=="string"?f.referrerPolicy:void 0,imageSrcSet:typeof f.imageSrcSet=="string"?f.imageSrcSet:void 0,imageSizes:typeof f.imageSizes=="string"?f.imageSizes:void 0,media:typeof f.media=="string"?f.media:void 0})}},ln.preloadModule=function(p,f){if(typeof p=="string")if(f){var y=d(f.as,f.crossOrigin);r.d.m(p,{as:typeof f.as=="string"&&f.as!=="script"?f.as:void 0,crossOrigin:y,integrity:typeof f.integrity=="string"?f.integrity:void 0})}else r.d.m(p)},ln.requestFormReset=function(p){r.d.r(p)},ln.unstable_batchedUpdates=function(p,f){return p(f)},ln.useFormState=function(p,f,y){return u.H.useFormState(p,f,y)},ln.useFormStatus=function(){return u.H.useHostTransitionStatus()},ln.version="19.2.4",ln}var n0;function Ux(){if(n0)return Rf.exports;n0=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(),Rf.exports=iC(),Rf.exports}/**
|
|
35
|
+
* @license React
|
|
36
|
+
* react-dom-client.production.js
|
|
37
|
+
*
|
|
38
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
39
|
+
*
|
|
40
|
+
* This source code is licensed under the MIT license found in the
|
|
41
|
+
* LICENSE file in the root directory of this source tree.
|
|
42
|
+
*/var a0;function rC(){if(a0)return co;a0=1;var e=aC(),n=uh(),a=Ux();function r(t){var i="https://react.dev/errors/"+t;if(1<arguments.length){i+="?args[]="+encodeURIComponent(arguments[1]);for(var l=2;l<arguments.length;l++)i+="&args[]="+encodeURIComponent(arguments[l])}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."}function o(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function s(t){var i=t,l=t;if(t.alternate)for(;i.return;)i=i.return;else{t=i;do i=t,(i.flags&4098)!==0&&(l=i.return),t=i.return;while(t)}return i.tag===3?l:null}function u(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 d(t){if(t.tag===31){var i=t.memoizedState;if(i===null&&(t=t.alternate,t!==null&&(i=t.memoizedState)),i!==null)return i.dehydrated}return null}function p(t){if(s(t)!==t)throw Error(r(188))}function f(t){var i=t.alternate;if(!i){if(i=s(t),i===null)throw Error(r(188));return i!==t?null:t}for(var l=t,c=i;;){var h=l.return;if(h===null)break;var v=h.alternate;if(v===null){if(c=h.return,c!==null){l=c;continue}break}if(h.child===v.child){for(v=h.child;v;){if(v===l)return p(h),t;if(v===c)return p(h),i;v=v.sibling}throw Error(r(188))}if(l.return!==c.return)l=h,c=v;else{for(var w=!1,A=h.child;A;){if(A===l){w=!0,l=h,c=v;break}if(A===c){w=!0,c=h,l=v;break}A=A.sibling}if(!w){for(A=v.child;A;){if(A===l){w=!0,l=v,c=h;break}if(A===c){w=!0,c=v,l=h;break}A=A.sibling}if(!w)throw Error(r(189))}}if(l.alternate!==c)throw Error(r(190))}if(l.tag!==3)throw Error(r(188));return l.stateNode.current===l?t:i}function y(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t;for(t=t.child;t!==null;){if(i=y(t),i!==null)return i;t=t.sibling}return null}var g=Object.assign,x=Symbol.for("react.element"),b=Symbol.for("react.transitional.element"),k=Symbol.for("react.portal"),C=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),_=Symbol.for("react.consumer"),R=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),U=Symbol.for("react.suspense"),D=Symbol.for("react.suspense_list"),W=Symbol.for("react.memo"),Q=Symbol.for("react.lazy"),M=Symbol.for("react.activity"),T=Symbol.for("react.memo_cache_sentinel"),q=Symbol.iterator;function V(t){return t===null||typeof t!="object"?null:(t=q&&t[q]||t["@@iterator"],typeof t=="function"?t:null)}var ae=Symbol.for("react.client.reference");function P(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===ae?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case C:return"Fragment";case E:return"Profiler";case j:return"StrictMode";case U:return"Suspense";case D:return"SuspenseList";case M:return"Activity"}if(typeof t=="object")switch(t.$$typeof){case k:return"Portal";case R:return t.displayName||"Context";case _:return(t._context.displayName||"Context")+".Consumer";case F:var i=t.render;return t=t.displayName,t||(t=i.displayName||i.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case W:return i=t.displayName||null,i!==null?i:P(t.type)||"Memo";case Q:i=t._payload,t=t._init;try{return P(t(i))}catch{}}return null}var K=Array.isArray,B=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=a.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ie={pending:!1,data:null,method:null,action:null},G=[],O=-1;function L(t){return{current:t}}function X(t){0>O||(t.current=G[O],G[O]=null,O--)}function N(t,i){O++,G[O]=t.current,t.current=i}var ue=L(null),pe=L(null),he=L(null),Ee=L(null);function Ue(t,i){switch(N(he,i),N(pe,t),N(ue,null),i.nodeType){case 9:case 11:t=(t=i.documentElement)&&(t=t.namespaceURI)?vv(t):0;break;default:if(t=i.tagName,i=i.namespaceURI)i=vv(i),t=xv(i,t);else switch(t){case"svg":t=1;break;case"math":t=2;break;default:t=0}}X(ue),N(ue,t)}function Ne(){X(ue),X(pe),X(he)}function et(t){t.memoizedState!==null&&N(Ee,t);var i=ue.current,l=xv(i,t.type);i!==l&&(N(pe,t),N(ue,l))}function Ot(t){pe.current===t&&(X(ue),X(pe)),Ee.current===t&&(X(Ee),io._currentValue=ie)}var xt,bt;function yt(t){if(xt===void 0)try{throw Error()}catch(l){var i=l.stack.trim().match(/\n( *(at )?)/);xt=i&&i[1]||"",bt=-1<l.stack.indexOf(`
|
|
43
|
+
at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
44
|
+
`+xt+t+bt}var Zt=!1;function Pe(t,i){if(!t||Zt)return"";Zt=!0;var l=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var c={DetermineComponentFrameRoot:function(){try{if(i){var ce=function(){throw Error()};if(Object.defineProperty(ce.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ce,[])}catch(ne){var te=ne}Reflect.construct(t,[],ce)}else{try{ce.call()}catch(ne){te=ne}t.call(ce.prototype)}}else{try{throw Error()}catch(ne){te=ne}(ce=t())&&typeof ce.catch=="function"&&ce.catch(function(){})}}catch(ne){if(ne&&te&&typeof ne.stack=="string")return[ne.stack,te.stack]}return[null,null]}};c.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var h=Object.getOwnPropertyDescriptor(c.DetermineComponentFrameRoot,"name");h&&h.configurable&&Object.defineProperty(c.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var v=c.DetermineComponentFrameRoot(),w=v[0],A=v[1];if(w&&A){var z=w.split(`
|
|
45
|
+
`),ee=A.split(`
|
|
46
|
+
`);for(h=c=0;c<z.length&&!z[c].includes("DetermineComponentFrameRoot");)c++;for(;h<ee.length&&!ee[h].includes("DetermineComponentFrameRoot");)h++;if(c===z.length||h===ee.length)for(c=z.length-1,h=ee.length-1;1<=c&&0<=h&&z[c]!==ee[h];)h--;for(;1<=c&&0<=h;c--,h--)if(z[c]!==ee[h]){if(c!==1||h!==1)do if(c--,h--,0>h||z[c]!==ee[h]){var re=`
|
|
47
|
+
`+z[c].replace(" at new "," at ");return t.displayName&&re.includes("<anonymous>")&&(re=re.replace("<anonymous>",t.displayName)),re}while(1<=c&&0<=h);break}}}finally{Zt=!1,Error.prepareStackTrace=l}return(l=t?t.displayName||t.name:"")?yt(l):""}function pt(t,i){switch(t.tag){case 26:case 27:case 5:return yt(t.type);case 16:return yt("Lazy");case 13:return t.child!==i&&i!==null?yt("Suspense Fallback"):yt("Suspense");case 19:return yt("SuspenseList");case 0:case 15:return Pe(t.type,!1);case 11:return Pe(t.type.render,!1);case 1:return Pe(t.type,!0);case 31:return yt("Activity");default:return""}}function Dt(t){try{var i="",l=null;do i+=pt(t,l),l=t,t=t.return;while(t);return i}catch(c){return`
|
|
48
|
+
Error generating stack: `+c.message+`
|
|
49
|
+
`+c.stack}}var Nt=Object.prototype.hasOwnProperty,ge=e.unstable_scheduleCallback,Mt=e.unstable_cancelCallback,Fn=e.unstable_shouldYield,yn=e.unstable_requestPaint,it=e.unstable_now,fe=e.unstable_getCurrentPriorityLevel,H=e.unstable_ImmediatePriority,le=e.unstable_UserBlockingPriority,me=e.unstable_NormalPriority,ye=e.unstable_LowPriority,I=e.unstable_IdlePriority,Te=e.log,at=e.unstable_setDisableYieldValue,Ie=null,Xe=null;function Ve(t){if(typeof Te=="function"&&at(t),Xe&&typeof Xe.setStrictMode=="function")try{Xe.setStrictMode(Ie,t)}catch{}}var Se=Math.clz32?Math.clz32:ja,Vt=Math.log,rt=Math.LN2;function ja(t){return t>>>=0,t===0?32:31-(Vt(t)/rt|0)|0}var ti=256,Ii=262144,gr=4194304;function Ta(t){var i=t&42;if(i!==0)return i;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:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return t}}function yr(t,i,l){var c=t.pendingLanes;if(c===0)return 0;var h=0,v=t.suspendedLanes,w=t.pingedLanes;t=t.warmLanes;var A=c&134217727;return A!==0?(c=A&~v,c!==0?h=Ta(c):(w&=A,w!==0?h=Ta(w):l||(l=A&~t,l!==0&&(h=Ta(l))))):(A=c&~v,A!==0?h=Ta(A):w!==0?h=Ta(w):l||(l=c&~t,l!==0&&(h=Ta(l)))),h===0?0:i!==0&&i!==h&&(i&v)===0&&(v=h&-h,l=i&-i,v>=l||v===32&&(l&4194048)!==0)?i:h}function Pi(t,i){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&i)===0}function hu(t,i){switch(t){case 1:case 2:case 4:case 8:case 64:return i+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return i+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function Vo(){var t=gr;return gr<<=1,(gr&62914560)===0&&(gr=4194304),t}function vl(t){for(var i=[],l=0;31>l;l++)i.push(t);return i}function Ui(t,i){t.pendingLanes|=i,i!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function mu(t,i,l,c,h,v){var w=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var A=t.entanglements,z=t.expirationTimes,ee=t.hiddenUpdates;for(l=w&~l;0<l;){var re=31-Se(l),ce=1<<re;A[re]=0,z[re]=-1;var te=ee[re];if(te!==null)for(ee[re]=null,re=0;re<te.length;re++){var ne=te[re];ne!==null&&(ne.lane&=-536870913)}l&=~ce}c!==0&&Wo(t,c,0),v!==0&&h===0&&t.tag!==0&&(t.suspendedLanes|=v&~(w&~i))}function Wo(t,i,l){t.pendingLanes|=i,t.suspendedLanes&=~i;var c=31-Se(i);t.entangledLanes|=i,t.entanglements[c]=t.entanglements[c]|1073741824|l&261930}function se(t,i){var l=t.entangledLanes|=i;for(t=t.entanglements;l;){var c=31-Se(l),h=1<<c;h&i|t[c]&i&&(t[c]|=i),l&=~h}}function ve(t,i){var l=i&-i;return l=(l&42)!==0?1:ke(l),(l&(t.suspendedLanes|i))!==0?0:l}function ke(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function De(t){return t&=-t,2<t?8<t?(t&134217727)!==0?32:268435456:8:2}function Ye(){var t=Z.p;return t!==0?t:(t=window.event,t===void 0?32:$v(t.type))}function lt(t,i){var l=Z.p;try{return Z.p=t,i()}finally{Z.p=l}}var Re=Math.random().toString(36).slice(2),we="__reactFiber$"+Re,_e="__reactProps$"+Re,rn="__reactContainer$"+Re,Na="__reactEvents$"+Re,xl="__reactListeners$"+Re,Yo="__reactHandles$"+Re,ni="__reactResources$"+Re,ha="__reactMarker$"+Re;function vr(t){delete t[we],delete t[_e],delete t[Na],delete t[xl],delete t[Yo]}function Ra(t){var i=t[we];if(i)return i;for(var l=t.parentNode;l;){if(i=l[rn]||l[we]){if(l=i.alternate,i.child!==null||l!==null&&l.child!==null)for(t=Av(t);t!==null;){if(l=t[we])return l;t=Av(t)}return i}t=l,l=t.parentNode}return null}function Wt(t){if(t=t[we]||t[rn]){var i=t.tag;if(i===5||i===6||i===13||i===31||i===26||i===27||i===3)return t}return null}function cn(t){var i=t.tag;if(i===5||i===26||i===27||i===6)return t.stateNode;throw Error(r(33))}function Gn(t){var i=t[ni];return i||(i=t[ni]={hoistableStyles:new Map,hoistableScripts:new Map}),i}function At(t){t[ha]=!0}var vn=new Set,ma={};function un(t,i){Vn(t,i),Vn(t+"Capture",i)}function Vn(t,i){for(ma[t]=i,t=0;t<i.length;t++)vn.add(i[t])}var ai=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),bl={},Ko={};function gu(t){return Nt.call(Ko,t)?!0:Nt.call(bl,t)?!1:ai.test(t)?Ko[t]=!0:(bl[t]=!0,!1)}function dn(t,i,l){if(gu(i))if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(i);return;case"boolean":var c=i.toLowerCase().slice(0,5);if(c!=="data-"&&c!=="aria-"){t.removeAttribute(i);return}}t.setAttribute(i,""+l)}}function Bi(t,i,l){if(l===null)t.removeAttribute(i);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(i);return}t.setAttribute(i,""+l)}}function xn(t,i,l,c){if(c===null)t.removeAttribute(l);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}t.setAttributeNS(i,l,""+c)}}function Be(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return t;default:return""}}function Ft(t){var i=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(i==="checkbox"||i==="radio")}function _a(t,i,l){var c=Object.getOwnPropertyDescriptor(t.constructor.prototype,i);if(!t.hasOwnProperty(i)&&typeof c<"u"&&typeof c.get=="function"&&typeof c.set=="function"){var h=c.get,v=c.set;return Object.defineProperty(t,i,{configurable:!0,get:function(){return h.call(this)},set:function(w){l=""+w,v.call(this,w)}}),Object.defineProperty(t,i,{enumerable:c.enumerable}),{getValue:function(){return l},setValue:function(w){l=""+w},stopTracking:function(){t._valueTracker=null,delete t[i]}}}}function yu(t){if(!t._valueTracker){var i=Ft(t)?"checked":"value";t._valueTracker=_a(t,i,""+t[i])}}function dm(t){if(!t)return!1;var i=t._valueTracker;if(!i)return!0;var l=i.getValue(),c="";return t&&(c=Ft(t)?t.checked?"true":"false":t.value),t=c,t!==l?(i.setValue(t),!0):!1}function Qo(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}}var GS=/[\n"\\]/g;function Wn(t){return t.replace(GS,function(i){return"\\"+i.charCodeAt(0).toString(16)+" "})}function vu(t,i,l,c,h,v,w,A){t.name="",w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"?t.type=w:t.removeAttribute("type"),i!=null?w==="number"?(i===0&&t.value===""||t.value!=i)&&(t.value=""+Be(i)):t.value!==""+Be(i)&&(t.value=""+Be(i)):w!=="submit"&&w!=="reset"||t.removeAttribute("value"),i!=null?xu(t,w,Be(i)):l!=null?xu(t,w,Be(l)):c!=null&&t.removeAttribute("value"),h==null&&v!=null&&(t.defaultChecked=!!v),h!=null&&(t.checked=h&&typeof h!="function"&&typeof h!="symbol"),A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?t.name=""+Be(A):t.removeAttribute("name")}function fm(t,i,l,c,h,v,w,A){if(v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"&&(t.type=v),i!=null||l!=null){if(!(v!=="submit"&&v!=="reset"||i!=null)){yu(t);return}l=l!=null?""+Be(l):"",i=i!=null?""+Be(i):l,A||i===t.value||(t.value=i),t.defaultValue=i}c=c??h,c=typeof c!="function"&&typeof c!="symbol"&&!!c,t.checked=A?t.checked:!!c,t.defaultChecked=!!c,w!=null&&typeof w!="function"&&typeof w!="symbol"&&typeof w!="boolean"&&(t.name=w),yu(t)}function xu(t,i,l){i==="number"&&Qo(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function xr(t,i,l,c){if(t=t.options,i){i={};for(var h=0;h<l.length;h++)i["$"+l[h]]=!0;for(l=0;l<t.length;l++)h=i.hasOwnProperty("$"+t[l].value),t[l].selected!==h&&(t[l].selected=h),h&&c&&(t[l].defaultSelected=!0)}else{for(l=""+Be(l),i=null,h=0;h<t.length;h++){if(t[h].value===l){t[h].selected=!0,c&&(t[h].defaultSelected=!0);return}i!==null||t[h].disabled||(i=t[h])}i!==null&&(i.selected=!0)}}function pm(t,i,l){if(i!=null&&(i=""+Be(i),i!==t.value&&(t.value=i),l==null)){t.defaultValue!==i&&(t.defaultValue=i);return}t.defaultValue=l!=null?""+Be(l):""}function hm(t,i,l,c){if(i==null){if(c!=null){if(l!=null)throw Error(r(92));if(K(c)){if(1<c.length)throw Error(r(93));c=c[0]}l=c}l==null&&(l=""),i=l}l=Be(i),t.defaultValue=l,c=t.textContent,c===l&&c!==""&&c!==null&&(t.value=c),yu(t)}function br(t,i){if(i){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=i;return}}t.textContent=i}var VS=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function mm(t,i,l){var c=i.indexOf("--")===0;l==null||typeof l=="boolean"||l===""?c?t.setProperty(i,""):i==="float"?t.cssFloat="":t[i]="":c?t.setProperty(i,l):typeof l!="number"||l===0||VS.has(i)?i==="float"?t.cssFloat=l:t[i]=(""+l).trim():t[i]=l+"px"}function gm(t,i,l){if(i!=null&&typeof i!="object")throw Error(r(62));if(t=t.style,l!=null){for(var c in l)!l.hasOwnProperty(c)||i!=null&&i.hasOwnProperty(c)||(c.indexOf("--")===0?t.setProperty(c,""):c==="float"?t.cssFloat="":t[c]="");for(var h in i)c=i[h],i.hasOwnProperty(h)&&l[h]!==c&&mm(t,h,c)}else for(var v in i)i.hasOwnProperty(v)&&mm(t,v,i[v])}function bu(t){if(t.indexOf("-")===-1)return!1;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 WS=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),YS=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Xo(t){return YS.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Oa(){}var wu=null;function Su(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}var wr=null,Sr=null;function ym(t){var i=Wt(t);if(i&&(t=i.stateNode)){var l=t[_e]||null;e:switch(t=i.stateNode,i.type){case"input":if(vu(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),i=l.name,l.type==="radio"&&i!=null){for(l=t;l.parentNode;)l=l.parentNode;for(l=l.querySelectorAll('input[name="'+Wn(""+i)+'"][type="radio"]'),i=0;i<l.length;i++){var c=l[i];if(c!==t&&c.form===t.form){var h=c[_e]||null;if(!h)throw Error(r(90));vu(c,h.value,h.defaultValue,h.defaultValue,h.checked,h.defaultChecked,h.type,h.name)}}for(i=0;i<l.length;i++)c=l[i],c.form===t.form&&dm(c)}break e;case"textarea":pm(t,l.value,l.defaultValue);break e;case"select":i=l.value,i!=null&&xr(t,!!l.multiple,i,!1)}}}var ku=!1;function vm(t,i,l){if(ku)return t(i,l);ku=!0;try{var c=t(i);return c}finally{if(ku=!1,(wr!==null||Sr!==null)&&(Ps(),wr&&(i=wr,t=Sr,Sr=wr=null,ym(i),t)))for(i=0;i<t.length;i++)ym(t[i])}}function wl(t,i){var l=t.stateNode;if(l===null)return null;var c=l[_e]||null;if(c===null)return null;l=c[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":(c=!c.disabled)||(t=t.type,c=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!c;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error(r(231,i,typeof l));return l}var Da=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Cu=!1;if(Da)try{var Sl={};Object.defineProperty(Sl,"passive",{get:function(){Cu=!0}}),window.addEventListener("test",Sl,Sl),window.removeEventListener("test",Sl,Sl)}catch{Cu=!1}var ii=null,Eu=null,Zo=null;function xm(){if(Zo)return Zo;var t,i=Eu,l=i.length,c,h="value"in ii?ii.value:ii.textContent,v=h.length;for(t=0;t<l&&i[t]===h[t];t++);var w=l-t;for(c=1;c<=w&&i[l-c]===h[v-c];c++);return Zo=h.slice(t,1<c?1-c:void 0)}function Jo(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 es(){return!0}function bm(){return!1}function bn(t){function i(l,c,h,v,w){this._reactName=l,this._targetInst=h,this.type=c,this.nativeEvent=v,this.target=w,this.currentTarget=null;for(var A in t)t.hasOwnProperty(A)&&(l=t[A],this[A]=l?l(v):v[A]);return this.isDefaultPrevented=(v.defaultPrevented!=null?v.defaultPrevented:v.returnValue===!1)?es:bm,this.isPropagationStopped=bm,this}return g(i.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=es)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=es)},persist:function(){},isPersistent:es}),i}var Hi={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},ts=bn(Hi),kl=g({},Hi,{view:0,detail:0}),KS=bn(kl),Au,ju,Cl,ns=g({},kl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Nu,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!==Cl&&(Cl&&t.type==="mousemove"?(Au=t.screenX-Cl.screenX,ju=t.screenY-Cl.screenY):ju=Au=0,Cl=t),Au)},movementY:function(t){return"movementY"in t?t.movementY:ju}}),wm=bn(ns),QS=g({},ns,{dataTransfer:0}),XS=bn(QS),ZS=g({},kl,{relatedTarget:0}),Tu=bn(ZS),JS=g({},Hi,{animationName:0,elapsedTime:0,pseudoElement:0}),ek=bn(JS),tk=g({},Hi,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),nk=bn(tk),ak=g({},Hi,{data:0}),Sm=bn(ak),ik={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},rk={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"},lk={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ok(t){var i=this.nativeEvent;return i.getModifierState?i.getModifierState(t):(t=lk[t])?!!i[t]:!1}function Nu(){return ok}var sk=g({},kl,{key:function(t){if(t.key){var i=ik[t.key]||t.key;if(i!=="Unidentified")return i}return t.type==="keypress"?(t=Jo(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?rk[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Nu,charCode:function(t){return t.type==="keypress"?Jo(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Jo(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),ck=bn(sk),uk=g({},ns,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),km=bn(uk),dk=g({},kl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Nu}),fk=bn(dk),pk=g({},Hi,{propertyName:0,elapsedTime:0,pseudoElement:0}),hk=bn(pk),mk=g({},ns,{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}),gk=bn(mk),yk=g({},Hi,{newState:0,oldState:0}),vk=bn(yk),xk=[9,13,27,32],Ru=Da&&"CompositionEvent"in window,El=null;Da&&"documentMode"in document&&(El=document.documentMode);var bk=Da&&"TextEvent"in window&&!El,Cm=Da&&(!Ru||El&&8<El&&11>=El),Em=" ",Am=!1;function jm(t,i){switch(t){case"keyup":return xk.indexOf(i.keyCode)!==-1;case"keydown":return i.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Tm(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}var kr=!1;function wk(t,i){switch(t){case"compositionend":return Tm(i);case"keypress":return i.which!==32?null:(Am=!0,Em);case"textInput":return t=i.data,t===Em&&Am?null:t;default:return null}}function Sk(t,i){if(kr)return t==="compositionend"||!Ru&&jm(t,i)?(t=xm(),Zo=Eu=ii=null,kr=!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 Cm&&i.locale!=="ko"?null:i.data;default:return null}}var kk={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 Nm(t){var i=t&&t.nodeName&&t.nodeName.toLowerCase();return i==="input"?!!kk[t.type]:i==="textarea"}function Rm(t,i,l,c){wr?Sr?Sr.push(c):Sr=[c]:wr=c,i=Gs(i,"onChange"),0<i.length&&(l=new ts("onChange","change",null,l,c),t.push({event:l,listeners:i}))}var Al=null,jl=null;function Ck(t){fv(t,0)}function as(t){var i=cn(t);if(dm(i))return t}function _m(t,i){if(t==="change")return i}var Om=!1;if(Da){var _u;if(Da){var Ou="oninput"in document;if(!Ou){var Dm=document.createElement("div");Dm.setAttribute("oninput","return;"),Ou=typeof Dm.oninput=="function"}_u=Ou}else _u=!1;Om=_u&&(!document.documentMode||9<document.documentMode)}function Mm(){Al&&(Al.detachEvent("onpropertychange",Lm),jl=Al=null)}function Lm(t){if(t.propertyName==="value"&&as(jl)){var i=[];Rm(i,jl,t,Su(t)),vm(Ck,i)}}function Ek(t,i,l){t==="focusin"?(Mm(),Al=i,jl=l,Al.attachEvent("onpropertychange",Lm)):t==="focusout"&&Mm()}function Ak(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return as(jl)}function jk(t,i){if(t==="click")return as(i)}function Tk(t,i){if(t==="input"||t==="change")return as(i)}function Nk(t,i){return t===i&&(t!==0||1/t===1/i)||t!==t&&i!==i}var Nn=typeof Object.is=="function"?Object.is:Nk;function Tl(t,i){if(Nn(t,i))return!0;if(typeof t!="object"||t===null||typeof i!="object"||i===null)return!1;var l=Object.keys(t),c=Object.keys(i);if(l.length!==c.length)return!1;for(c=0;c<l.length;c++){var h=l[c];if(!Nt.call(i,h)||!Nn(t[h],i[h]))return!1}return!0}function zm(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Im(t,i){var l=zm(t);t=0;for(var c;l;){if(l.nodeType===3){if(c=t+l.textContent.length,t<=i&&c>=i)return{node:l,offset:i-t};t=c}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=zm(l)}}function Pm(t,i){return t&&i?t===i?!0:t&&t.nodeType===3?!1:i&&i.nodeType===3?Pm(t,i.parentNode):"contains"in t?t.contains(i):t.compareDocumentPosition?!!(t.compareDocumentPosition(i)&16):!1:!1}function Um(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var i=Qo(t.document);i instanceof t.HTMLIFrameElement;){try{var l=typeof i.contentWindow.location.href=="string"}catch{l=!1}if(l)t=i.contentWindow;else break;i=Qo(t.document)}return i}function Du(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")}var Rk=Da&&"documentMode"in document&&11>=document.documentMode,Cr=null,Mu=null,Nl=null,Lu=!1;function Bm(t,i,l){var c=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;Lu||Cr==null||Cr!==Qo(c)||(c=Cr,"selectionStart"in c&&Du(c)?c={start:c.selectionStart,end:c.selectionEnd}:(c=(c.ownerDocument&&c.ownerDocument.defaultView||window).getSelection(),c={anchorNode:c.anchorNode,anchorOffset:c.anchorOffset,focusNode:c.focusNode,focusOffset:c.focusOffset}),Nl&&Tl(Nl,c)||(Nl=c,c=Gs(Mu,"onSelect"),0<c.length&&(i=new ts("onSelect","select",null,i,l),t.push({event:i,listeners:c}),i.target=Cr)))}function $i(t,i){var l={};return l[t.toLowerCase()]=i.toLowerCase(),l["Webkit"+t]="webkit"+i,l["Moz"+t]="moz"+i,l}var Er={animationend:$i("Animation","AnimationEnd"),animationiteration:$i("Animation","AnimationIteration"),animationstart:$i("Animation","AnimationStart"),transitionrun:$i("Transition","TransitionRun"),transitionstart:$i("Transition","TransitionStart"),transitioncancel:$i("Transition","TransitionCancel"),transitionend:$i("Transition","TransitionEnd")},zu={},Hm={};Da&&(Hm=document.createElement("div").style,"AnimationEvent"in window||(delete Er.animationend.animation,delete Er.animationiteration.animation,delete Er.animationstart.animation),"TransitionEvent"in window||delete Er.transitionend.transition);function qi(t){if(zu[t])return zu[t];if(!Er[t])return t;var i=Er[t],l;for(l in i)if(i.hasOwnProperty(l)&&l in Hm)return zu[t]=i[l];return t}var $m=qi("animationend"),qm=qi("animationiteration"),Fm=qi("animationstart"),_k=qi("transitionrun"),Ok=qi("transitionstart"),Dk=qi("transitioncancel"),Gm=qi("transitionend"),Vm=new Map,Iu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Iu.push("scrollEnd");function la(t,i){Vm.set(t,i),un(i,[t])}var is=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var i=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(i))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},Yn=[],Ar=0,Pu=0;function rs(){for(var t=Ar,i=Pu=Ar=0;i<t;){var l=Yn[i];Yn[i++]=null;var c=Yn[i];Yn[i++]=null;var h=Yn[i];Yn[i++]=null;var v=Yn[i];if(Yn[i++]=null,c!==null&&h!==null){var w=c.pending;w===null?h.next=h:(h.next=w.next,w.next=h),c.pending=h}v!==0&&Wm(l,h,v)}}function ls(t,i,l,c){Yn[Ar++]=t,Yn[Ar++]=i,Yn[Ar++]=l,Yn[Ar++]=c,Pu|=c,t.lanes|=c,t=t.alternate,t!==null&&(t.lanes|=c)}function Uu(t,i,l,c){return ls(t,i,l,c),os(t)}function Fi(t,i){return ls(t,null,null,i),os(t)}function Wm(t,i,l){t.lanes|=l;var c=t.alternate;c!==null&&(c.lanes|=l);for(var h=!1,v=t.return;v!==null;)v.childLanes|=l,c=v.alternate,c!==null&&(c.childLanes|=l),v.tag===22&&(t=v.stateNode,t===null||t._visibility&1||(h=!0)),t=v,v=v.return;return t.tag===3?(v=t.stateNode,h&&i!==null&&(h=31-Se(l),t=v.hiddenUpdates,c=t[h],c===null?t[h]=[i]:c.push(i),i.lane=l|536870912),v):null}function os(t){if(50<Xl)throw Xl=0,Yd=null,Error(r(185));for(var i=t.return;i!==null;)t=i,i=t.return;return t.tag===3?t.stateNode:null}var jr={};function Mk(t,i,l,c){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=i,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=c,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Rn(t,i,l,c){return new Mk(t,i,l,c)}function Bu(t){return t=t.prototype,!(!t||!t.isReactComponent)}function Ma(t,i){var l=t.alternate;return l===null?(l=Rn(t.tag,i,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l.alternate=t,t.alternate=l):(l.pendingProps=i,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,i=t.dependencies,l.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l}function Ym(t,i){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=i,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,i=l.dependencies,t.dependencies=i===null?null:{lanes:i.lanes,firstContext:i.firstContext}),t}function ss(t,i,l,c,h,v){var w=0;if(c=t,typeof t=="function")Bu(t)&&(w=1);else if(typeof t=="string")w=U2(t,l,ue.current)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case M:return t=Rn(31,l,i,h),t.elementType=M,t.lanes=v,t;case C:return Gi(l.children,h,v,i);case j:w=8,h|=24;break;case E:return t=Rn(12,l,i,h|2),t.elementType=E,t.lanes=v,t;case U:return t=Rn(13,l,i,h),t.elementType=U,t.lanes=v,t;case D:return t=Rn(19,l,i,h),t.elementType=D,t.lanes=v,t;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case R:w=10;break e;case _:w=9;break e;case F:w=11;break e;case W:w=14;break e;case Q:w=16,c=null;break e}w=29,l=Error(r(130,t===null?"null":typeof t,"")),c=null}return i=Rn(w,l,i,h),i.elementType=t,i.type=c,i.lanes=v,i}function Gi(t,i,l,c){return t=Rn(7,t,c,i),t.lanes=l,t}function Hu(t,i,l){return t=Rn(6,t,null,i),t.lanes=l,t}function Km(t){var i=Rn(18,null,null,0);return i.stateNode=t,i}function $u(t,i,l){return i=Rn(4,t.children!==null?t.children:[],t.key,i),i.lanes=l,i.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},i}var Qm=new WeakMap;function Kn(t,i){if(typeof t=="object"&&t!==null){var l=Qm.get(t);return l!==void 0?l:(i={value:t,source:i,stack:Dt(i)},Qm.set(t,i),i)}return{value:t,source:i,stack:Dt(i)}}var Tr=[],Nr=0,cs=null,Rl=0,Qn=[],Xn=0,ri=null,ga=1,ya="";function La(t,i){Tr[Nr++]=Rl,Tr[Nr++]=cs,cs=t,Rl=i}function Xm(t,i,l){Qn[Xn++]=ga,Qn[Xn++]=ya,Qn[Xn++]=ri,ri=t;var c=ga;t=ya;var h=32-Se(c)-1;c&=~(1<<h),l+=1;var v=32-Se(i)+h;if(30<v){var w=h-h%5;v=(c&(1<<w)-1).toString(32),c>>=w,h-=w,ga=1<<32-Se(i)+h|l<<h|c,ya=v+t}else ga=1<<v|l<<h|c,ya=t}function qu(t){t.return!==null&&(La(t,1),Xm(t,1,0))}function Fu(t){for(;t===cs;)cs=Tr[--Nr],Tr[Nr]=null,Rl=Tr[--Nr],Tr[Nr]=null;for(;t===ri;)ri=Qn[--Xn],Qn[Xn]=null,ya=Qn[--Xn],Qn[Xn]=null,ga=Qn[--Xn],Qn[Xn]=null}function Zm(t,i){Qn[Xn++]=ga,Qn[Xn++]=ya,Qn[Xn++]=ri,ga=i.id,ya=i.overflow,ri=t}var Jt=null,wt=null,We=!1,li=null,Zn=!1,Gu=Error(r(519));function oi(t){var i=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw _l(Kn(i,t)),Gu}function Jm(t){var i=t.stateNode,l=t.type,c=t.memoizedProps;switch(i[we]=t,i[_e]=c,l){case"dialog":$e("cancel",i),$e("close",i);break;case"iframe":case"object":case"embed":$e("load",i);break;case"video":case"audio":for(l=0;l<Jl.length;l++)$e(Jl[l],i);break;case"source":$e("error",i);break;case"img":case"image":case"link":$e("error",i),$e("load",i);break;case"details":$e("toggle",i);break;case"input":$e("invalid",i),fm(i,c.value,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name,!0);break;case"select":$e("invalid",i);break;case"textarea":$e("invalid",i),hm(i,c.value,c.defaultValue,c.children)}l=c.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||i.textContent===""+l||c.suppressHydrationWarning===!0||gv(i.textContent,l)?(c.popover!=null&&($e("beforetoggle",i),$e("toggle",i)),c.onScroll!=null&&$e("scroll",i),c.onScrollEnd!=null&&$e("scrollend",i),c.onClick!=null&&(i.onclick=Oa),i=!0):i=!1,i||oi(t,!0)}function eg(t){for(Jt=t.return;Jt;)switch(Jt.tag){case 5:case 31:case 13:Zn=!1;return;case 27:case 3:Zn=!0;return;default:Jt=Jt.return}}function Rr(t){if(t!==Jt)return!1;if(!We)return eg(t),We=!0,!1;var i=t.tag,l;if((l=i!==3&&i!==27)&&((l=i===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||uf(t.type,t.memoizedProps)),l=!l),l&&wt&&oi(t),eg(t),i===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));wt=Ev(t)}else if(i===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(317));wt=Ev(t)}else i===27?(i=wt,wi(t.type)?(t=mf,mf=null,wt=t):wt=i):wt=Jt?ea(t.stateNode.nextSibling):null;return!0}function Vi(){wt=Jt=null,We=!1}function Vu(){var t=li;return t!==null&&(Cn===null?Cn=t:Cn.push.apply(Cn,t),li=null),t}function _l(t){li===null?li=[t]:li.push(t)}var Wu=L(null),Wi=null,za=null;function si(t,i,l){N(Wu,i._currentValue),i._currentValue=l}function Ia(t){t._currentValue=Wu.current,X(Wu)}function Yu(t,i,l){for(;t!==null;){var c=t.alternate;if((t.childLanes&i)!==i?(t.childLanes|=i,c!==null&&(c.childLanes|=i)):c!==null&&(c.childLanes&i)!==i&&(c.childLanes|=i),t===l)break;t=t.return}}function Ku(t,i,l,c){var h=t.child;for(h!==null&&(h.return=t);h!==null;){var v=h.dependencies;if(v!==null){var w=h.child;v=v.firstContext;e:for(;v!==null;){var A=v;v=h;for(var z=0;z<i.length;z++)if(A.context===i[z]){v.lanes|=l,A=v.alternate,A!==null&&(A.lanes|=l),Yu(v.return,l,t),c||(w=null);break e}v=A.next}}else if(h.tag===18){if(w=h.return,w===null)throw Error(r(341));w.lanes|=l,v=w.alternate,v!==null&&(v.lanes|=l),Yu(w,l,t),w=null}else w=h.child;if(w!==null)w.return=h;else for(w=h;w!==null;){if(w===t){w=null;break}if(h=w.sibling,h!==null){h.return=w.return,w=h;break}w=w.return}h=w}}function _r(t,i,l,c){t=null;for(var h=i,v=!1;h!==null;){if(!v){if((h.flags&524288)!==0)v=!0;else if((h.flags&262144)!==0)break}if(h.tag===10){var w=h.alternate;if(w===null)throw Error(r(387));if(w=w.memoizedProps,w!==null){var A=h.type;Nn(h.pendingProps.value,w.value)||(t!==null?t.push(A):t=[A])}}else if(h===Ee.current){if(w=h.alternate,w===null)throw Error(r(387));w.memoizedState.memoizedState!==h.memoizedState.memoizedState&&(t!==null?t.push(io):t=[io])}h=h.return}t!==null&&Ku(i,t,l,c),i.flags|=262144}function us(t){for(t=t.firstContext;t!==null;){if(!Nn(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Yi(t){Wi=t,za=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function en(t){return tg(Wi,t)}function ds(t,i){return Wi===null&&Yi(t),tg(t,i)}function tg(t,i){var l=i._currentValue;if(i={context:i,memoizedValue:l,next:null},za===null){if(t===null)throw Error(r(308));za=i,t.dependencies={lanes:0,firstContext:i},t.flags|=524288}else za=za.next=i;return l}var Lk=typeof AbortController<"u"?AbortController:function(){var t=[],i=this.signal={aborted:!1,addEventListener:function(l,c){t.push(c)}};this.abort=function(){i.aborted=!0,t.forEach(function(l){return l()})}},zk=e.unstable_scheduleCallback,Ik=e.unstable_NormalPriority,Lt={$$typeof:R,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Qu(){return{controller:new Lk,data:new Map,refCount:0}}function Ol(t){t.refCount--,t.refCount===0&&zk(Ik,function(){t.controller.abort()})}var Dl=null,Xu=0,Or=0,Dr=null;function Pk(t,i){if(Dl===null){var l=Dl=[];Xu=0,Or=ef(),Dr={status:"pending",value:void 0,then:function(c){l.push(c)}}}return Xu++,i.then(ng,ng),i}function ng(){if(--Xu===0&&Dl!==null){Dr!==null&&(Dr.status="fulfilled");var t=Dl;Dl=null,Or=0,Dr=null;for(var i=0;i<t.length;i++)(0,t[i])()}}function Uk(t,i){var l=[],c={status:"pending",value:null,reason:null,then:function(h){l.push(h)}};return t.then(function(){c.status="fulfilled",c.value=i;for(var h=0;h<l.length;h++)(0,l[h])(i)},function(h){for(c.status="rejected",c.reason=h,h=0;h<l.length;h++)(0,l[h])(void 0)}),c}var ag=B.S;B.S=function(t,i){By=it(),typeof i=="object"&&i!==null&&typeof i.then=="function"&&Pk(t,i),ag!==null&&ag(t,i)};var Ki=L(null);function Zu(){var t=Ki.current;return t!==null?t:ht.pooledCache}function fs(t,i){i===null?N(Ki,Ki.current):N(Ki,i.pool)}function ig(){var t=Zu();return t===null?null:{parent:Lt._currentValue,pool:t}}var Mr=Error(r(460)),Ju=Error(r(474)),ps=Error(r(542)),hs={then:function(){}};function rg(t){return t=t.status,t==="fulfilled"||t==="rejected"}function lg(t,i,l){switch(l=t[l],l===void 0?t.push(i):l!==i&&(i.then(Oa,Oa),i=l),i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,sg(t),t;default:if(typeof i.status=="string")i.then(Oa,Oa);else{if(t=ht,t!==null&&100<t.shellSuspendCounter)throw Error(r(482));t=i,t.status="pending",t.then(function(c){if(i.status==="pending"){var h=i;h.status="fulfilled",h.value=c}},function(c){if(i.status==="pending"){var h=i;h.status="rejected",h.reason=c}})}switch(i.status){case"fulfilled":return i.value;case"rejected":throw t=i.reason,sg(t),t}throw Xi=i,Mr}}function Qi(t){try{var i=t._init;return i(t._payload)}catch(l){throw l!==null&&typeof l=="object"&&typeof l.then=="function"?(Xi=l,Mr):l}}var Xi=null;function og(){if(Xi===null)throw Error(r(459));var t=Xi;return Xi=null,t}function sg(t){if(t===Mr||t===ps)throw Error(r(483))}var Lr=null,Ml=0;function ms(t){var i=Ml;return Ml+=1,Lr===null&&(Lr=[]),lg(Lr,t,i)}function Ll(t,i){i=i.props.ref,t.ref=i!==void 0?i:null}function gs(t,i){throw i.$$typeof===x?Error(r(525)):(t=Object.prototype.toString.call(i),Error(r(31,t==="[object Object]"?"object with keys {"+Object.keys(i).join(", ")+"}":t)))}function cg(t){function i(Y,$){if(t){var J=Y.deletions;J===null?(Y.deletions=[$],Y.flags|=16):J.push($)}}function l(Y,$){if(!t)return null;for(;$!==null;)i(Y,$),$=$.sibling;return null}function c(Y){for(var $=new Map;Y!==null;)Y.key!==null?$.set(Y.key,Y):$.set(Y.index,Y),Y=Y.sibling;return $}function h(Y,$){return Y=Ma(Y,$),Y.index=0,Y.sibling=null,Y}function v(Y,$,J){return Y.index=J,t?(J=Y.alternate,J!==null?(J=J.index,J<$?(Y.flags|=67108866,$):J):(Y.flags|=67108866,$)):(Y.flags|=1048576,$)}function w(Y){return t&&Y.alternate===null&&(Y.flags|=67108866),Y}function A(Y,$,J,oe){return $===null||$.tag!==6?($=Hu(J,Y.mode,oe),$.return=Y,$):($=h($,J),$.return=Y,$)}function z(Y,$,J,oe){var Ce=J.type;return Ce===C?re(Y,$,J.props.children,oe,J.key):$!==null&&($.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===Q&&Qi(Ce)===$.type)?($=h($,J.props),Ll($,J),$.return=Y,$):($=ss(J.type,J.key,J.props,null,Y.mode,oe),Ll($,J),$.return=Y,$)}function ee(Y,$,J,oe){return $===null||$.tag!==4||$.stateNode.containerInfo!==J.containerInfo||$.stateNode.implementation!==J.implementation?($=$u(J,Y.mode,oe),$.return=Y,$):($=h($,J.children||[]),$.return=Y,$)}function re(Y,$,J,oe,Ce){return $===null||$.tag!==7?($=Gi(J,Y.mode,oe,Ce),$.return=Y,$):($=h($,J),$.return=Y,$)}function ce(Y,$,J){if(typeof $=="string"&&$!==""||typeof $=="number"||typeof $=="bigint")return $=Hu(""+$,Y.mode,J),$.return=Y,$;if(typeof $=="object"&&$!==null){switch($.$$typeof){case b:return J=ss($.type,$.key,$.props,null,Y.mode,J),Ll(J,$),J.return=Y,J;case k:return $=$u($,Y.mode,J),$.return=Y,$;case Q:return $=Qi($),ce(Y,$,J)}if(K($)||V($))return $=Gi($,Y.mode,J,null),$.return=Y,$;if(typeof $.then=="function")return ce(Y,ms($),J);if($.$$typeof===R)return ce(Y,ds(Y,$),J);gs(Y,$)}return null}function te(Y,$,J,oe){var Ce=$!==null?$.key:null;if(typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint")return Ce!==null?null:A(Y,$,""+J,oe);if(typeof J=="object"&&J!==null){switch(J.$$typeof){case b:return J.key===Ce?z(Y,$,J,oe):null;case k:return J.key===Ce?ee(Y,$,J,oe):null;case Q:return J=Qi(J),te(Y,$,J,oe)}if(K(J)||V(J))return Ce!==null?null:re(Y,$,J,oe,null);if(typeof J.then=="function")return te(Y,$,ms(J),oe);if(J.$$typeof===R)return te(Y,$,ds(Y,J),oe);gs(Y,J)}return null}function ne(Y,$,J,oe,Ce){if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Y=Y.get(J)||null,A($,Y,""+oe,Ce);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case b:return Y=Y.get(oe.key===null?J:oe.key)||null,z($,Y,oe,Ce);case k:return Y=Y.get(oe.key===null?J:oe.key)||null,ee($,Y,oe,Ce);case Q:return oe=Qi(oe),ne(Y,$,J,oe,Ce)}if(K(oe)||V(oe))return Y=Y.get(J)||null,re($,Y,oe,Ce,null);if(typeof oe.then=="function")return ne(Y,$,J,ms(oe),Ce);if(oe.$$typeof===R)return ne(Y,$,J,ds($,oe),Ce);gs($,oe)}return null}function xe(Y,$,J,oe){for(var Ce=null,Ze=null,be=$,Le=$=0,Ge=null;be!==null&&Le<J.length;Le++){be.index>Le?(Ge=be,be=null):Ge=be.sibling;var Je=te(Y,be,J[Le],oe);if(Je===null){be===null&&(be=Ge);break}t&&be&&Je.alternate===null&&i(Y,be),$=v(Je,$,Le),Ze===null?Ce=Je:Ze.sibling=Je,Ze=Je,be=Ge}if(Le===J.length)return l(Y,be),We&&La(Y,Le),Ce;if(be===null){for(;Le<J.length;Le++)be=ce(Y,J[Le],oe),be!==null&&($=v(be,$,Le),Ze===null?Ce=be:Ze.sibling=be,Ze=be);return We&&La(Y,Le),Ce}for(be=c(be);Le<J.length;Le++)Ge=ne(be,Y,Le,J[Le],oe),Ge!==null&&(t&&Ge.alternate!==null&&be.delete(Ge.key===null?Le:Ge.key),$=v(Ge,$,Le),Ze===null?Ce=Ge:Ze.sibling=Ge,Ze=Ge);return t&&be.forEach(function(Ai){return i(Y,Ai)}),We&&La(Y,Le),Ce}function je(Y,$,J,oe){if(J==null)throw Error(r(151));for(var Ce=null,Ze=null,be=$,Le=$=0,Ge=null,Je=J.next();be!==null&&!Je.done;Le++,Je=J.next()){be.index>Le?(Ge=be,be=null):Ge=be.sibling;var Ai=te(Y,be,Je.value,oe);if(Ai===null){be===null&&(be=Ge);break}t&&be&&Ai.alternate===null&&i(Y,be),$=v(Ai,$,Le),Ze===null?Ce=Ai:Ze.sibling=Ai,Ze=Ai,be=Ge}if(Je.done)return l(Y,be),We&&La(Y,Le),Ce;if(be===null){for(;!Je.done;Le++,Je=J.next())Je=ce(Y,Je.value,oe),Je!==null&&($=v(Je,$,Le),Ze===null?Ce=Je:Ze.sibling=Je,Ze=Je);return We&&La(Y,Le),Ce}for(be=c(be);!Je.done;Le++,Je=J.next())Je=ne(be,Y,Le,Je.value,oe),Je!==null&&(t&&Je.alternate!==null&&be.delete(Je.key===null?Le:Je.key),$=v(Je,$,Le),Ze===null?Ce=Je:Ze.sibling=Je,Ze=Je);return t&&be.forEach(function(Q2){return i(Y,Q2)}),We&&La(Y,Le),Ce}function dt(Y,$,J,oe){if(typeof J=="object"&&J!==null&&J.type===C&&J.key===null&&(J=J.props.children),typeof J=="object"&&J!==null){switch(J.$$typeof){case b:e:{for(var Ce=J.key;$!==null;){if($.key===Ce){if(Ce=J.type,Ce===C){if($.tag===7){l(Y,$.sibling),oe=h($,J.props.children),oe.return=Y,Y=oe;break e}}else if($.elementType===Ce||typeof Ce=="object"&&Ce!==null&&Ce.$$typeof===Q&&Qi(Ce)===$.type){l(Y,$.sibling),oe=h($,J.props),Ll(oe,J),oe.return=Y,Y=oe;break e}l(Y,$);break}else i(Y,$);$=$.sibling}J.type===C?(oe=Gi(J.props.children,Y.mode,oe,J.key),oe.return=Y,Y=oe):(oe=ss(J.type,J.key,J.props,null,Y.mode,oe),Ll(oe,J),oe.return=Y,Y=oe)}return w(Y);case k:e:{for(Ce=J.key;$!==null;){if($.key===Ce)if($.tag===4&&$.stateNode.containerInfo===J.containerInfo&&$.stateNode.implementation===J.implementation){l(Y,$.sibling),oe=h($,J.children||[]),oe.return=Y,Y=oe;break e}else{l(Y,$);break}else i(Y,$);$=$.sibling}oe=$u(J,Y.mode,oe),oe.return=Y,Y=oe}return w(Y);case Q:return J=Qi(J),dt(Y,$,J,oe)}if(K(J))return xe(Y,$,J,oe);if(V(J)){if(Ce=V(J),typeof Ce!="function")throw Error(r(150));return J=Ce.call(J),je(Y,$,J,oe)}if(typeof J.then=="function")return dt(Y,$,ms(J),oe);if(J.$$typeof===R)return dt(Y,$,ds(Y,J),oe);gs(Y,J)}return typeof J=="string"&&J!==""||typeof J=="number"||typeof J=="bigint"?(J=""+J,$!==null&&$.tag===6?(l(Y,$.sibling),oe=h($,J),oe.return=Y,Y=oe):(l(Y,$),oe=Hu(J,Y.mode,oe),oe.return=Y,Y=oe),w(Y)):l(Y,$)}return function(Y,$,J,oe){try{Ml=0;var Ce=dt(Y,$,J,oe);return Lr=null,Ce}catch(be){if(be===Mr||be===ps)throw be;var Ze=Rn(29,be,null,Y.mode);return Ze.lanes=oe,Ze.return=Y,Ze}finally{}}}var Zi=cg(!0),ug=cg(!1),ci=!1;function ed(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function td(t,i){t=t.updateQueue,i.updateQueue===t&&(i.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function ui(t){return{lane:t,tag:0,payload:null,callback:null,next:null}}function di(t,i,l){var c=t.updateQueue;if(c===null)return null;if(c=c.shared,(tt&2)!==0){var h=c.pending;return h===null?i.next=i:(i.next=h.next,h.next=i),c.pending=i,i=os(t),Wm(t,null,l),i}return ls(t,c,i,l),os(t)}function zl(t,i,l){if(i=i.updateQueue,i!==null&&(i=i.shared,(l&4194048)!==0)){var c=i.lanes;c&=t.pendingLanes,l|=c,i.lanes=l,se(t,l)}}function nd(t,i){var l=t.updateQueue,c=t.alternate;if(c!==null&&(c=c.updateQueue,l===c)){var h=null,v=null;if(l=l.firstBaseUpdate,l!==null){do{var w={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};v===null?h=v=w:v=v.next=w,l=l.next}while(l!==null);v===null?h=v=i:v=v.next=i}else h=v=i;l={baseState:c.baseState,firstBaseUpdate:h,lastBaseUpdate:v,shared:c.shared,callbacks:c.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=i:t.next=i,l.lastBaseUpdate=i}var ad=!1;function Il(){if(ad){var t=Dr;if(t!==null)throw t}}function Pl(t,i,l,c){ad=!1;var h=t.updateQueue;ci=!1;var v=h.firstBaseUpdate,w=h.lastBaseUpdate,A=h.shared.pending;if(A!==null){h.shared.pending=null;var z=A,ee=z.next;z.next=null,w===null?v=ee:w.next=ee,w=z;var re=t.alternate;re!==null&&(re=re.updateQueue,A=re.lastBaseUpdate,A!==w&&(A===null?re.firstBaseUpdate=ee:A.next=ee,re.lastBaseUpdate=z))}if(v!==null){var ce=h.baseState;w=0,re=ee=z=null,A=v;do{var te=A.lane&-536870913,ne=te!==A.lane;if(ne?(Fe&te)===te:(c&te)===te){te!==0&&te===Or&&(ad=!0),re!==null&&(re=re.next={lane:0,tag:A.tag,payload:A.payload,callback:null,next:null});e:{var xe=t,je=A;te=i;var dt=l;switch(je.tag){case 1:if(xe=je.payload,typeof xe=="function"){ce=xe.call(dt,ce,te);break e}ce=xe;break e;case 3:xe.flags=xe.flags&-65537|128;case 0:if(xe=je.payload,te=typeof xe=="function"?xe.call(dt,ce,te):xe,te==null)break e;ce=g({},ce,te);break e;case 2:ci=!0}}te=A.callback,te!==null&&(t.flags|=64,ne&&(t.flags|=8192),ne=h.callbacks,ne===null?h.callbacks=[te]:ne.push(te))}else ne={lane:te,tag:A.tag,payload:A.payload,callback:A.callback,next:null},re===null?(ee=re=ne,z=ce):re=re.next=ne,w|=te;if(A=A.next,A===null){if(A=h.shared.pending,A===null)break;ne=A,A=ne.next,ne.next=null,h.lastBaseUpdate=ne,h.shared.pending=null}}while(!0);re===null&&(z=ce),h.baseState=z,h.firstBaseUpdate=ee,h.lastBaseUpdate=re,v===null&&(h.shared.lanes=0),gi|=w,t.lanes=w,t.memoizedState=ce}}function dg(t,i){if(typeof t!="function")throw Error(r(191,t));t.call(i)}function fg(t,i){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)dg(l[t],i)}var zr=L(null),ys=L(0);function pg(t,i){t=Va,N(ys,t),N(zr,i),Va=t|i.baseLanes}function id(){N(ys,Va),N(zr,zr.current)}function rd(){Va=ys.current,X(zr),X(ys)}var _n=L(null),Jn=null;function fi(t){var i=t.alternate;N(Rt,Rt.current&1),N(_n,t),Jn===null&&(i===null||zr.current!==null||i.memoizedState!==null)&&(Jn=t)}function ld(t){N(Rt,Rt.current),N(_n,t),Jn===null&&(Jn=t)}function hg(t){t.tag===22?(N(Rt,Rt.current),N(_n,t),Jn===null&&(Jn=t)):pi()}function pi(){N(Rt,Rt.current),N(_n,_n.current)}function On(t){X(_n),Jn===t&&(Jn=null),X(Rt)}var Rt=L(0);function vs(t){for(var i=t;i!==null;){if(i.tag===13){var l=i.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||pf(l)||hf(l)))return i}else if(i.tag===19&&(i.memoizedProps.revealOrder==="forwards"||i.memoizedProps.revealOrder==="backwards"||i.memoizedProps.revealOrder==="unstable_legacy-backwards"||i.memoizedProps.revealOrder==="together")){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 Pa=0,Me=null,ct=null,zt=null,xs=!1,Ir=!1,Ji=!1,bs=0,Ul=0,Pr=null,Bk=0;function jt(){throw Error(r(321))}function od(t,i){if(i===null)return!1;for(var l=0;l<i.length&&l<t.length;l++)if(!Nn(t[l],i[l]))return!1;return!0}function sd(t,i,l,c,h,v){return Pa=v,Me=i,i.memoizedState=null,i.updateQueue=null,i.lanes=0,B.H=t===null||t.memoizedState===null?Xg:kd,Ji=!1,v=l(c,h),Ji=!1,Ir&&(v=gg(i,l,c,h)),mg(t),v}function mg(t){B.H=$l;var i=ct!==null&&ct.next!==null;if(Pa=0,zt=ct=Me=null,xs=!1,Ul=0,Pr=null,i)throw Error(r(300));t===null||It||(t=t.dependencies,t!==null&&us(t)&&(It=!0))}function gg(t,i,l,c){Me=t;var h=0;do{if(Ir&&(Pr=null),Ul=0,Ir=!1,25<=h)throw Error(r(301));if(h+=1,zt=ct=null,t.updateQueue!=null){var v=t.updateQueue;v.lastEffect=null,v.events=null,v.stores=null,v.memoCache!=null&&(v.memoCache.index=0)}B.H=Zg,v=i(l,c)}while(Ir);return v}function Hk(){var t=B.H,i=t.useState()[0];return i=typeof i.then=="function"?Bl(i):i,t=t.useState()[0],(ct!==null?ct.memoizedState:null)!==t&&(Me.flags|=1024),i}function cd(){var t=bs!==0;return bs=0,t}function ud(t,i,l){i.updateQueue=t.updateQueue,i.flags&=-2053,t.lanes&=~l}function dd(t){if(xs){for(t=t.memoizedState;t!==null;){var i=t.queue;i!==null&&(i.pending=null),t=t.next}xs=!1}Pa=0,zt=ct=Me=null,Ir=!1,Ul=bs=0,Pr=null}function fn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return zt===null?Me.memoizedState=zt=t:zt=zt.next=t,zt}function _t(){if(ct===null){var t=Me.alternate;t=t!==null?t.memoizedState:null}else t=ct.next;var i=zt===null?Me.memoizedState:zt.next;if(i!==null)zt=i,ct=t;else{if(t===null)throw Me.alternate===null?Error(r(467)):Error(r(310));ct=t,t={memoizedState:ct.memoizedState,baseState:ct.baseState,baseQueue:ct.baseQueue,queue:ct.queue,next:null},zt===null?Me.memoizedState=zt=t:zt=zt.next=t}return zt}function ws(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Bl(t){var i=Ul;return Ul+=1,Pr===null&&(Pr=[]),t=lg(Pr,t,i),i=Me,(zt===null?i.memoizedState:zt.next)===null&&(i=i.alternate,B.H=i===null||i.memoizedState===null?Xg:kd),t}function Ss(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Bl(t);if(t.$$typeof===R)return en(t)}throw Error(r(438,String(t)))}function fd(t){var i=null,l=Me.updateQueue;if(l!==null&&(i=l.memoCache),i==null){var c=Me.alternate;c!==null&&(c=c.updateQueue,c!==null&&(c=c.memoCache,c!=null&&(i={data:c.data.map(function(h){return h.slice()}),index:0})))}if(i==null&&(i={data:[],index:0}),l===null&&(l=ws(),Me.updateQueue=l),l.memoCache=i,l=i.data[i.index],l===void 0)for(l=i.data[i.index]=Array(t),c=0;c<t;c++)l[c]=T;return i.index++,l}function Ua(t,i){return typeof i=="function"?i(t):i}function ks(t){var i=_t();return pd(i,ct,t)}function pd(t,i,l){var c=t.queue;if(c===null)throw Error(r(311));c.lastRenderedReducer=l;var h=t.baseQueue,v=c.pending;if(v!==null){if(h!==null){var w=h.next;h.next=v.next,v.next=w}i.baseQueue=h=v,c.pending=null}if(v=t.baseState,h===null)t.memoizedState=v;else{i=h.next;var A=w=null,z=null,ee=i,re=!1;do{var ce=ee.lane&-536870913;if(ce!==ee.lane?(Fe&ce)===ce:(Pa&ce)===ce){var te=ee.revertLane;if(te===0)z!==null&&(z=z.next={lane:0,revertLane:0,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null}),ce===Or&&(re=!0);else if((Pa&te)===te){ee=ee.next,te===Or&&(re=!0);continue}else ce={lane:0,revertLane:ee.revertLane,gesture:null,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},z===null?(A=z=ce,w=v):z=z.next=ce,Me.lanes|=te,gi|=te;ce=ee.action,Ji&&l(v,ce),v=ee.hasEagerState?ee.eagerState:l(v,ce)}else te={lane:ce,revertLane:ee.revertLane,gesture:ee.gesture,action:ee.action,hasEagerState:ee.hasEagerState,eagerState:ee.eagerState,next:null},z===null?(A=z=te,w=v):z=z.next=te,Me.lanes|=ce,gi|=ce;ee=ee.next}while(ee!==null&&ee!==i);if(z===null?w=v:z.next=A,!Nn(v,t.memoizedState)&&(It=!0,re&&(l=Dr,l!==null)))throw l;t.memoizedState=v,t.baseState=w,t.baseQueue=z,c.lastRenderedState=v}return h===null&&(c.lanes=0),[t.memoizedState,c.dispatch]}function hd(t){var i=_t(),l=i.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=t;var c=l.dispatch,h=l.pending,v=i.memoizedState;if(h!==null){l.pending=null;var w=h=h.next;do v=t(v,w.action),w=w.next;while(w!==h);Nn(v,i.memoizedState)||(It=!0),i.memoizedState=v,i.baseQueue===null&&(i.baseState=v),l.lastRenderedState=v}return[v,c]}function yg(t,i,l){var c=Me,h=_t(),v=We;if(v){if(l===void 0)throw Error(r(407));l=l()}else l=i();var w=!Nn((ct||h).memoizedState,l);if(w&&(h.memoizedState=l,It=!0),h=h.queue,yd(bg.bind(null,c,h,t),[t]),h.getSnapshot!==i||w||zt!==null&&zt.memoizedState.tag&1){if(c.flags|=2048,Ur(9,{destroy:void 0},xg.bind(null,c,h,l,i),null),ht===null)throw Error(r(349));v||(Pa&127)!==0||vg(c,i,l)}return l}function vg(t,i,l){t.flags|=16384,t={getSnapshot:i,value:l},i=Me.updateQueue,i===null?(i=ws(),Me.updateQueue=i,i.stores=[t]):(l=i.stores,l===null?i.stores=[t]:l.push(t))}function xg(t,i,l,c){i.value=l,i.getSnapshot=c,wg(i)&&Sg(t)}function bg(t,i,l){return l(function(){wg(i)&&Sg(t)})}function wg(t){var i=t.getSnapshot;t=t.value;try{var l=i();return!Nn(t,l)}catch{return!0}}function Sg(t){var i=Fi(t,2);i!==null&&En(i,t,2)}function md(t){var i=fn();if(typeof t=="function"){var l=t;if(t=l(),Ji){Ve(!0);try{l()}finally{Ve(!1)}}}return i.memoizedState=i.baseState=t,i.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:t},i}function kg(t,i,l,c){return t.baseState=l,pd(t,ct,typeof c=="function"?c:Ua)}function $k(t,i,l,c,h){if(As(t))throw Error(r(485));if(t=i.action,t!==null){var v={payload:h,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(w){v.listeners.push(w)}};B.T!==null?l(!0):v.isTransition=!1,c(v),l=i.pending,l===null?(v.next=i.pending=v,Cg(i,v)):(v.next=l.next,i.pending=l.next=v)}}function Cg(t,i){var l=i.action,c=i.payload,h=t.state;if(i.isTransition){var v=B.T,w={};B.T=w;try{var A=l(h,c),z=B.S;z!==null&&z(w,A),Eg(t,i,A)}catch(ee){gd(t,i,ee)}finally{v!==null&&w.types!==null&&(v.types=w.types),B.T=v}}else try{v=l(h,c),Eg(t,i,v)}catch(ee){gd(t,i,ee)}}function Eg(t,i,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?l.then(function(c){Ag(t,i,c)},function(c){return gd(t,i,c)}):Ag(t,i,l)}function Ag(t,i,l){i.status="fulfilled",i.value=l,jg(i),t.state=l,i=t.pending,i!==null&&(l=i.next,l===i?t.pending=null:(l=l.next,i.next=l,Cg(t,l)))}function gd(t,i,l){var c=t.pending;if(t.pending=null,c!==null){c=c.next;do i.status="rejected",i.reason=l,jg(i),i=i.next;while(i!==c)}t.action=null}function jg(t){t=t.listeners;for(var i=0;i<t.length;i++)(0,t[i])()}function Tg(t,i){return i}function Ng(t,i){if(We){var l=ht.formState;if(l!==null){e:{var c=Me;if(We){if(wt){t:{for(var h=wt,v=Zn;h.nodeType!==8;){if(!v){h=null;break t}if(h=ea(h.nextSibling),h===null){h=null;break t}}v=h.data,h=v==="F!"||v==="F"?h:null}if(h){wt=ea(h.nextSibling),c=h.data==="F!";break e}}oi(c)}c=!1}c&&(i=l[0])}}return l=fn(),l.memoizedState=l.baseState=i,c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Tg,lastRenderedState:i},l.queue=c,l=Yg.bind(null,Me,c),c.dispatch=l,c=md(!1),v=Sd.bind(null,Me,!1,c.queue),c=fn(),h={state:i,dispatch:null,action:t,pending:null},c.queue=h,l=$k.bind(null,Me,h,v,l),h.dispatch=l,c.memoizedState=t,[i,l,!1]}function Rg(t){var i=_t();return _g(i,ct,t)}function _g(t,i,l){if(i=pd(t,i,Tg)[0],t=ks(Ua)[0],typeof i=="object"&&i!==null&&typeof i.then=="function")try{var c=Bl(i)}catch(w){throw w===Mr?ps:w}else c=i;i=_t();var h=i.queue,v=h.dispatch;return l!==i.memoizedState&&(Me.flags|=2048,Ur(9,{destroy:void 0},qk.bind(null,h,l),null)),[c,v,t]}function qk(t,i){t.action=i}function Og(t){var i=_t(),l=ct;if(l!==null)return _g(i,l,t);_t(),i=i.memoizedState,l=_t();var c=l.queue.dispatch;return l.memoizedState=t,[i,c,!1]}function Ur(t,i,l,c){return t={tag:t,create:l,deps:c,inst:i,next:null},i=Me.updateQueue,i===null&&(i=ws(),Me.updateQueue=i),l=i.lastEffect,l===null?i.lastEffect=t.next=t:(c=l.next,l.next=t,t.next=c,i.lastEffect=t),t}function Dg(){return _t().memoizedState}function Cs(t,i,l,c){var h=fn();Me.flags|=t,h.memoizedState=Ur(1|i,{destroy:void 0},l,c===void 0?null:c)}function Es(t,i,l,c){var h=_t();c=c===void 0?null:c;var v=h.memoizedState.inst;ct!==null&&c!==null&&od(c,ct.memoizedState.deps)?h.memoizedState=Ur(i,v,l,c):(Me.flags|=t,h.memoizedState=Ur(1|i,v,l,c))}function Mg(t,i){Cs(8390656,8,t,i)}function yd(t,i){Es(2048,8,t,i)}function Fk(t){Me.flags|=4;var i=Me.updateQueue;if(i===null)i=ws(),Me.updateQueue=i,i.events=[t];else{var l=i.events;l===null?i.events=[t]:l.push(t)}}function Lg(t){var i=_t().memoizedState;return Fk({ref:i,nextImpl:t}),function(){if((tt&2)!==0)throw Error(r(440));return i.impl.apply(void 0,arguments)}}function zg(t,i){return Es(4,2,t,i)}function Ig(t,i){return Es(4,4,t,i)}function Pg(t,i){if(typeof i=="function"){t=t();var l=i(t);return function(){typeof l=="function"?l():i(null)}}if(i!=null)return t=t(),i.current=t,function(){i.current=null}}function Ug(t,i,l){l=l!=null?l.concat([t]):null,Es(4,4,Pg.bind(null,i,t),l)}function vd(){}function Bg(t,i){var l=_t();i=i===void 0?null:i;var c=l.memoizedState;return i!==null&&od(i,c[1])?c[0]:(l.memoizedState=[t,i],t)}function Hg(t,i){var l=_t();i=i===void 0?null:i;var c=l.memoizedState;if(i!==null&&od(i,c[1]))return c[0];if(c=t(),Ji){Ve(!0);try{t()}finally{Ve(!1)}}return l.memoizedState=[c,i],c}function xd(t,i,l){return l===void 0||(Pa&1073741824)!==0&&(Fe&261930)===0?t.memoizedState=i:(t.memoizedState=l,t=$y(),Me.lanes|=t,gi|=t,l)}function $g(t,i,l,c){return Nn(l,i)?l:zr.current!==null?(t=xd(t,l,c),Nn(t,i)||(It=!0),t):(Pa&42)===0||(Pa&1073741824)!==0&&(Fe&261930)===0?(It=!0,t.memoizedState=l):(t=$y(),Me.lanes|=t,gi|=t,i)}function qg(t,i,l,c,h){var v=Z.p;Z.p=v!==0&&8>v?v:8;var w=B.T,A={};B.T=A,Sd(t,!1,i,l);try{var z=h(),ee=B.S;if(ee!==null&&ee(A,z),z!==null&&typeof z=="object"&&typeof z.then=="function"){var re=Uk(z,c);Hl(t,i,re,Ln(t))}else Hl(t,i,c,Ln(t))}catch(ce){Hl(t,i,{then:function(){},status:"rejected",reason:ce},Ln())}finally{Z.p=v,w!==null&&A.types!==null&&(w.types=A.types),B.T=w}}function Gk(){}function bd(t,i,l,c){if(t.tag!==5)throw Error(r(476));var h=Fg(t).queue;qg(t,h,i,ie,l===null?Gk:function(){return Gg(t),l(c)})}function Fg(t){var i=t.memoizedState;if(i!==null)return i;i={memoizedState:ie,baseState:ie,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:ie},next:null};var l={};return i.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ua,lastRenderedState:l},next:null},t.memoizedState=i,t=t.alternate,t!==null&&(t.memoizedState=i),i}function Gg(t){var i=Fg(t);i.next===null&&(i=t.alternate.memoizedState),Hl(t,i.next.queue,{},Ln())}function wd(){return en(io)}function Vg(){return _t().memoizedState}function Wg(){return _t().memoizedState}function Vk(t){for(var i=t.return;i!==null;){switch(i.tag){case 24:case 3:var l=Ln();t=ui(l);var c=di(i,t,l);c!==null&&(En(c,i,l),zl(c,i,l)),i={cache:Qu()},t.payload=i;return}i=i.return}}function Wk(t,i,l){var c=Ln();l={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},As(t)?Kg(i,l):(l=Uu(t,i,l,c),l!==null&&(En(l,t,c),Qg(l,i,c)))}function Yg(t,i,l){var c=Ln();Hl(t,i,l,c)}function Hl(t,i,l,c){var h={lane:c,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(As(t))Kg(i,h);else{var v=t.alternate;if(t.lanes===0&&(v===null||v.lanes===0)&&(v=i.lastRenderedReducer,v!==null))try{var w=i.lastRenderedState,A=v(w,l);if(h.hasEagerState=!0,h.eagerState=A,Nn(A,w))return ls(t,i,h,0),ht===null&&rs(),!1}catch{}finally{}if(l=Uu(t,i,h,c),l!==null)return En(l,t,c),Qg(l,i,c),!0}return!1}function Sd(t,i,l,c){if(c={lane:2,revertLane:ef(),gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},As(t)){if(i)throw Error(r(479))}else i=Uu(t,l,c,2),i!==null&&En(i,t,2)}function As(t){var i=t.alternate;return t===Me||i!==null&&i===Me}function Kg(t,i){Ir=xs=!0;var l=t.pending;l===null?i.next=i:(i.next=l.next,l.next=i),t.pending=i}function Qg(t,i,l){if((l&4194048)!==0){var c=i.lanes;c&=t.pendingLanes,l|=c,i.lanes=l,se(t,l)}}var $l={readContext:en,use:Ss,useCallback:jt,useContext:jt,useEffect:jt,useImperativeHandle:jt,useLayoutEffect:jt,useInsertionEffect:jt,useMemo:jt,useReducer:jt,useRef:jt,useState:jt,useDebugValue:jt,useDeferredValue:jt,useTransition:jt,useSyncExternalStore:jt,useId:jt,useHostTransitionStatus:jt,useFormState:jt,useActionState:jt,useOptimistic:jt,useMemoCache:jt,useCacheRefresh:jt};$l.useEffectEvent=jt;var Xg={readContext:en,use:Ss,useCallback:function(t,i){return fn().memoizedState=[t,i===void 0?null:i],t},useContext:en,useEffect:Mg,useImperativeHandle:function(t,i,l){l=l!=null?l.concat([t]):null,Cs(4194308,4,Pg.bind(null,i,t),l)},useLayoutEffect:function(t,i){return Cs(4194308,4,t,i)},useInsertionEffect:function(t,i){Cs(4,2,t,i)},useMemo:function(t,i){var l=fn();i=i===void 0?null:i;var c=t();if(Ji){Ve(!0);try{t()}finally{Ve(!1)}}return l.memoizedState=[c,i],c},useReducer:function(t,i,l){var c=fn();if(l!==void 0){var h=l(i);if(Ji){Ve(!0);try{l(i)}finally{Ve(!1)}}}else h=i;return c.memoizedState=c.baseState=h,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:h},c.queue=t,t=t.dispatch=Wk.bind(null,Me,t),[c.memoizedState,t]},useRef:function(t){var i=fn();return t={current:t},i.memoizedState=t},useState:function(t){t=md(t);var i=t.queue,l=Yg.bind(null,Me,i);return i.dispatch=l,[t.memoizedState,l]},useDebugValue:vd,useDeferredValue:function(t,i){var l=fn();return xd(l,t,i)},useTransition:function(){var t=md(!1);return t=qg.bind(null,Me,t.queue,!0,!1),fn().memoizedState=t,[!1,t]},useSyncExternalStore:function(t,i,l){var c=Me,h=fn();if(We){if(l===void 0)throw Error(r(407));l=l()}else{if(l=i(),ht===null)throw Error(r(349));(Fe&127)!==0||vg(c,i,l)}h.memoizedState=l;var v={value:l,getSnapshot:i};return h.queue=v,Mg(bg.bind(null,c,v,t),[t]),c.flags|=2048,Ur(9,{destroy:void 0},xg.bind(null,c,v,l,i),null),l},useId:function(){var t=fn(),i=ht.identifierPrefix;if(We){var l=ya,c=ga;l=(c&~(1<<32-Se(c)-1)).toString(32)+l,i="_"+i+"R_"+l,l=bs++,0<l&&(i+="H"+l.toString(32)),i+="_"}else l=Bk++,i="_"+i+"r_"+l.toString(32)+"_";return t.memoizedState=i},useHostTransitionStatus:wd,useFormState:Ng,useActionState:Ng,useOptimistic:function(t){var i=fn();i.memoizedState=i.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return i.queue=l,i=Sd.bind(null,Me,!0,l),l.dispatch=i,[t,i]},useMemoCache:fd,useCacheRefresh:function(){return fn().memoizedState=Vk.bind(null,Me)},useEffectEvent:function(t){var i=fn(),l={impl:t};return i.memoizedState=l,function(){if((tt&2)!==0)throw Error(r(440));return l.impl.apply(void 0,arguments)}}},kd={readContext:en,use:Ss,useCallback:Bg,useContext:en,useEffect:yd,useImperativeHandle:Ug,useInsertionEffect:zg,useLayoutEffect:Ig,useMemo:Hg,useReducer:ks,useRef:Dg,useState:function(){return ks(Ua)},useDebugValue:vd,useDeferredValue:function(t,i){var l=_t();return $g(l,ct.memoizedState,t,i)},useTransition:function(){var t=ks(Ua)[0],i=_t().memoizedState;return[typeof t=="boolean"?t:Bl(t),i]},useSyncExternalStore:yg,useId:Vg,useHostTransitionStatus:wd,useFormState:Rg,useActionState:Rg,useOptimistic:function(t,i){var l=_t();return kg(l,ct,t,i)},useMemoCache:fd,useCacheRefresh:Wg};kd.useEffectEvent=Lg;var Zg={readContext:en,use:Ss,useCallback:Bg,useContext:en,useEffect:yd,useImperativeHandle:Ug,useInsertionEffect:zg,useLayoutEffect:Ig,useMemo:Hg,useReducer:hd,useRef:Dg,useState:function(){return hd(Ua)},useDebugValue:vd,useDeferredValue:function(t,i){var l=_t();return ct===null?xd(l,t,i):$g(l,ct.memoizedState,t,i)},useTransition:function(){var t=hd(Ua)[0],i=_t().memoizedState;return[typeof t=="boolean"?t:Bl(t),i]},useSyncExternalStore:yg,useId:Vg,useHostTransitionStatus:wd,useFormState:Og,useActionState:Og,useOptimistic:function(t,i){var l=_t();return ct!==null?kg(l,ct,t,i):(l.baseState=t,[t,l.queue.dispatch])},useMemoCache:fd,useCacheRefresh:Wg};Zg.useEffectEvent=Lg;function Cd(t,i,l,c){i=t.memoizedState,l=l(c,i),l=l==null?i:g({},i,l),t.memoizedState=l,t.lanes===0&&(t.updateQueue.baseState=l)}var Ed={enqueueSetState:function(t,i,l){t=t._reactInternals;var c=Ln(),h=ui(c);h.payload=i,l!=null&&(h.callback=l),i=di(t,h,c),i!==null&&(En(i,t,c),zl(i,t,c))},enqueueReplaceState:function(t,i,l){t=t._reactInternals;var c=Ln(),h=ui(c);h.tag=1,h.payload=i,l!=null&&(h.callback=l),i=di(t,h,c),i!==null&&(En(i,t,c),zl(i,t,c))},enqueueForceUpdate:function(t,i){t=t._reactInternals;var l=Ln(),c=ui(l);c.tag=2,i!=null&&(c.callback=i),i=di(t,c,l),i!==null&&(En(i,t,l),zl(i,t,l))}};function Jg(t,i,l,c,h,v,w){return t=t.stateNode,typeof t.shouldComponentUpdate=="function"?t.shouldComponentUpdate(c,v,w):i.prototype&&i.prototype.isPureReactComponent?!Tl(l,c)||!Tl(h,v):!0}function ey(t,i,l,c){t=i.state,typeof i.componentWillReceiveProps=="function"&&i.componentWillReceiveProps(l,c),typeof i.UNSAFE_componentWillReceiveProps=="function"&&i.UNSAFE_componentWillReceiveProps(l,c),i.state!==t&&Ed.enqueueReplaceState(i,i.state,null)}function er(t,i){var l=i;if("ref"in i){l={};for(var c in i)c!=="ref"&&(l[c]=i[c])}if(t=t.defaultProps){l===i&&(l=g({},l));for(var h in t)l[h]===void 0&&(l[h]=t[h])}return l}function ty(t){is(t)}function ny(t){console.error(t)}function ay(t){is(t)}function js(t,i){try{var l=t.onUncaughtError;l(i.value,{componentStack:i.stack})}catch(c){setTimeout(function(){throw c})}}function iy(t,i,l){try{var c=t.onCaughtError;c(l.value,{componentStack:l.stack,errorBoundary:i.tag===1?i.stateNode:null})}catch(h){setTimeout(function(){throw h})}}function Ad(t,i,l){return l=ui(l),l.tag=3,l.payload={element:null},l.callback=function(){js(t,i)},l}function ry(t){return t=ui(t),t.tag=3,t}function ly(t,i,l,c){var h=l.type.getDerivedStateFromError;if(typeof h=="function"){var v=c.value;t.payload=function(){return h(v)},t.callback=function(){iy(i,l,c)}}var w=l.stateNode;w!==null&&typeof w.componentDidCatch=="function"&&(t.callback=function(){iy(i,l,c),typeof h!="function"&&(yi===null?yi=new Set([this]):yi.add(this));var A=c.stack;this.componentDidCatch(c.value,{componentStack:A!==null?A:""})})}function Yk(t,i,l,c,h){if(l.flags|=32768,c!==null&&typeof c=="object"&&typeof c.then=="function"){if(i=l.alternate,i!==null&&_r(i,l,h,!0),l=_n.current,l!==null){switch(l.tag){case 31:case 13:return Jn===null?Us():l.alternate===null&&Tt===0&&(Tt=3),l.flags&=-257,l.flags|=65536,l.lanes=h,c===hs?l.flags|=16384:(i=l.updateQueue,i===null?l.updateQueue=new Set([c]):i.add(c),Xd(t,c,h)),!1;case 22:return l.flags|=65536,c===hs?l.flags|=16384:(i=l.updateQueue,i===null?(i={transitions:null,markerInstances:null,retryQueue:new Set([c])},l.updateQueue=i):(l=i.retryQueue,l===null?i.retryQueue=new Set([c]):l.add(c)),Xd(t,c,h)),!1}throw Error(r(435,l.tag))}return Xd(t,c,h),Us(),!1}if(We)return i=_n.current,i!==null?((i.flags&65536)===0&&(i.flags|=256),i.flags|=65536,i.lanes=h,c!==Gu&&(t=Error(r(422),{cause:c}),_l(Kn(t,l)))):(c!==Gu&&(i=Error(r(423),{cause:c}),_l(Kn(i,l))),t=t.current.alternate,t.flags|=65536,h&=-h,t.lanes|=h,c=Kn(c,l),h=Ad(t.stateNode,c,h),nd(t,h),Tt!==4&&(Tt=2)),!1;var v=Error(r(520),{cause:c});if(v=Kn(v,l),Ql===null?Ql=[v]:Ql.push(v),Tt!==4&&(Tt=2),i===null)return!0;c=Kn(c,l),l=i;do{switch(l.tag){case 3:return l.flags|=65536,t=h&-h,l.lanes|=t,t=Ad(l.stateNode,c,t),nd(l,t),!1;case 1:if(i=l.type,v=l.stateNode,(l.flags&128)===0&&(typeof i.getDerivedStateFromError=="function"||v!==null&&typeof v.componentDidCatch=="function"&&(yi===null||!yi.has(v))))return l.flags|=65536,h&=-h,l.lanes|=h,h=ry(h),ly(h,t,l,c),nd(l,h),!1}l=l.return}while(l!==null);return!1}var jd=Error(r(461)),It=!1;function tn(t,i,l,c){i.child=t===null?ug(i,null,l,c):Zi(i,t.child,l,c)}function oy(t,i,l,c,h){l=l.render;var v=i.ref;if("ref"in c){var w={};for(var A in c)A!=="ref"&&(w[A]=c[A])}else w=c;return Yi(i),c=sd(t,i,l,w,v,h),A=cd(),t!==null&&!It?(ud(t,i,h),Ba(t,i,h)):(We&&A&&qu(i),i.flags|=1,tn(t,i,c,h),i.child)}function sy(t,i,l,c,h){if(t===null){var v=l.type;return typeof v=="function"&&!Bu(v)&&v.defaultProps===void 0&&l.compare===null?(i.tag=15,i.type=v,cy(t,i,v,c,h)):(t=ss(l.type,null,c,i,i.mode,h),t.ref=i.ref,t.return=i,i.child=t)}if(v=t.child,!Ld(t,h)){var w=v.memoizedProps;if(l=l.compare,l=l!==null?l:Tl,l(w,c)&&t.ref===i.ref)return Ba(t,i,h)}return i.flags|=1,t=Ma(v,c),t.ref=i.ref,t.return=i,i.child=t}function cy(t,i,l,c,h){if(t!==null){var v=t.memoizedProps;if(Tl(v,c)&&t.ref===i.ref)if(It=!1,i.pendingProps=c=v,Ld(t,h))(t.flags&131072)!==0&&(It=!0);else return i.lanes=t.lanes,Ba(t,i,h)}return Td(t,i,l,c,h)}function uy(t,i,l,c){var h=c.children,v=t!==null?t.memoizedState:null;if(t===null&&i.stateNode===null&&(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),c.mode==="hidden"){if((i.flags&128)!==0){if(v=v!==null?v.baseLanes|l:l,t!==null){for(c=i.child=t.child,h=0;c!==null;)h=h|c.lanes|c.childLanes,c=c.sibling;c=h&~v}else c=0,i.child=null;return dy(t,i,v,l,c)}if((l&536870912)!==0)i.memoizedState={baseLanes:0,cachePool:null},t!==null&&fs(i,v!==null?v.cachePool:null),v!==null?pg(i,v):id(),hg(i);else return c=i.lanes=536870912,dy(t,i,v!==null?v.baseLanes|l:l,l,c)}else v!==null?(fs(i,v.cachePool),pg(i,v),pi(),i.memoizedState=null):(t!==null&&fs(i,null),id(),pi());return tn(t,i,h,l),i.child}function ql(t,i){return t!==null&&t.tag===22||i.stateNode!==null||(i.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),i.sibling}function dy(t,i,l,c,h){var v=Zu();return v=v===null?null:{parent:Lt._currentValue,pool:v},i.memoizedState={baseLanes:l,cachePool:v},t!==null&&fs(i,null),id(),hg(i),t!==null&&_r(t,i,c,!0),i.childLanes=h,null}function Ts(t,i){return i=Rs({mode:i.mode,children:i.children},t.mode),i.ref=t.ref,t.child=i,i.return=t,i}function fy(t,i,l){return Zi(i,t.child,null,l),t=Ts(i,i.pendingProps),t.flags|=2,On(i),i.memoizedState=null,t}function Kk(t,i,l){var c=i.pendingProps,h=(i.flags&128)!==0;if(i.flags&=-129,t===null){if(We){if(c.mode==="hidden")return t=Ts(i,c),i.lanes=536870912,ql(null,t);if(ld(i),(t=wt)?(t=Cv(t,Zn),t=t!==null&&t.data==="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ri!==null?{id:ga,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},l=Km(t),l.return=i,i.child=l,Jt=i,wt=null)):t=null,t===null)throw oi(i);return i.lanes=536870912,null}return Ts(i,c)}var v=t.memoizedState;if(v!==null){var w=v.dehydrated;if(ld(i),h)if(i.flags&256)i.flags&=-257,i=fy(t,i,l);else if(i.memoizedState!==null)i.child=t.child,i.flags|=128,i=null;else throw Error(r(558));else if(It||_r(t,i,l,!1),h=(l&t.childLanes)!==0,It||h){if(c=ht,c!==null&&(w=ve(c,l),w!==0&&w!==v.retryLane))throw v.retryLane=w,Fi(t,w),En(c,t,w),jd;Us(),i=fy(t,i,l)}else t=v.treeContext,wt=ea(w.nextSibling),Jt=i,We=!0,li=null,Zn=!1,t!==null&&Zm(i,t),i=Ts(i,c),i.flags|=4096;return i}return t=Ma(t.child,{mode:c.mode,children:c.children}),t.ref=i.ref,i.child=t,t.return=i,t}function Ns(t,i){var l=i.ref;if(l===null)t!==null&&t.ref!==null&&(i.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error(r(284));(t===null||t.ref!==l)&&(i.flags|=4194816)}}function Td(t,i,l,c,h){return Yi(i),l=sd(t,i,l,c,void 0,h),c=cd(),t!==null&&!It?(ud(t,i,h),Ba(t,i,h)):(We&&c&&qu(i),i.flags|=1,tn(t,i,l,h),i.child)}function py(t,i,l,c,h,v){return Yi(i),i.updateQueue=null,l=gg(i,c,l,h),mg(t),c=cd(),t!==null&&!It?(ud(t,i,v),Ba(t,i,v)):(We&&c&&qu(i),i.flags|=1,tn(t,i,l,v),i.child)}function hy(t,i,l,c,h){if(Yi(i),i.stateNode===null){var v=jr,w=l.contextType;typeof w=="object"&&w!==null&&(v=en(w)),v=new l(c,v),i.memoizedState=v.state!==null&&v.state!==void 0?v.state:null,v.updater=Ed,i.stateNode=v,v._reactInternals=i,v=i.stateNode,v.props=c,v.state=i.memoizedState,v.refs={},ed(i),w=l.contextType,v.context=typeof w=="object"&&w!==null?en(w):jr,v.state=i.memoizedState,w=l.getDerivedStateFromProps,typeof w=="function"&&(Cd(i,l,w,c),v.state=i.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof v.getSnapshotBeforeUpdate=="function"||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(w=v.state,typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount(),w!==v.state&&Ed.enqueueReplaceState(v,v.state,null),Pl(i,c,v,h),Il(),v.state=i.memoizedState),typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!0}else if(t===null){v=i.stateNode;var A=i.memoizedProps,z=er(l,A);v.props=z;var ee=v.context,re=l.contextType;w=jr,typeof re=="object"&&re!==null&&(w=en(re));var ce=l.getDerivedStateFromProps;re=typeof ce=="function"||typeof v.getSnapshotBeforeUpdate=="function",A=i.pendingProps!==A,re||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(A||ee!==w)&&ey(i,v,c,w),ci=!1;var te=i.memoizedState;v.state=te,Pl(i,c,v,h),Il(),ee=i.memoizedState,A||te!==ee||ci?(typeof ce=="function"&&(Cd(i,l,ce,c),ee=i.memoizedState),(z=ci||Jg(i,l,z,c,te,ee,w))?(re||typeof v.UNSAFE_componentWillMount!="function"&&typeof v.componentWillMount!="function"||(typeof v.componentWillMount=="function"&&v.componentWillMount(),typeof v.UNSAFE_componentWillMount=="function"&&v.UNSAFE_componentWillMount()),typeof v.componentDidMount=="function"&&(i.flags|=4194308)):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),i.memoizedProps=c,i.memoizedState=ee),v.props=c,v.state=ee,v.context=w,c=z):(typeof v.componentDidMount=="function"&&(i.flags|=4194308),c=!1)}else{v=i.stateNode,td(t,i),w=i.memoizedProps,re=er(l,w),v.props=re,ce=i.pendingProps,te=v.context,ee=l.contextType,z=jr,typeof ee=="object"&&ee!==null&&(z=en(ee)),A=l.getDerivedStateFromProps,(ee=typeof A=="function"||typeof v.getSnapshotBeforeUpdate=="function")||typeof v.UNSAFE_componentWillReceiveProps!="function"&&typeof v.componentWillReceiveProps!="function"||(w!==ce||te!==z)&&ey(i,v,c,z),ci=!1,te=i.memoizedState,v.state=te,Pl(i,c,v,h),Il();var ne=i.memoizedState;w!==ce||te!==ne||ci||t!==null&&t.dependencies!==null&&us(t.dependencies)?(typeof A=="function"&&(Cd(i,l,A,c),ne=i.memoizedState),(re=ci||Jg(i,l,re,c,te,ne,z)||t!==null&&t.dependencies!==null&&us(t.dependencies))?(ee||typeof v.UNSAFE_componentWillUpdate!="function"&&typeof v.componentWillUpdate!="function"||(typeof v.componentWillUpdate=="function"&&v.componentWillUpdate(c,ne,z),typeof v.UNSAFE_componentWillUpdate=="function"&&v.UNSAFE_componentWillUpdate(c,ne,z)),typeof v.componentDidUpdate=="function"&&(i.flags|=4),typeof v.getSnapshotBeforeUpdate=="function"&&(i.flags|=1024)):(typeof v.componentDidUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(i.flags|=1024),i.memoizedProps=c,i.memoizedState=ne),v.props=c,v.state=ne,v.context=z,c=re):(typeof v.componentDidUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(i.flags|=4),typeof v.getSnapshotBeforeUpdate!="function"||w===t.memoizedProps&&te===t.memoizedState||(i.flags|=1024),c=!1)}return v=c,Ns(t,i),c=(i.flags&128)!==0,v||c?(v=i.stateNode,l=c&&typeof l.getDerivedStateFromError!="function"?null:v.render(),i.flags|=1,t!==null&&c?(i.child=Zi(i,t.child,null,h),i.child=Zi(i,null,l,h)):tn(t,i,l,h),i.memoizedState=v.state,t=i.child):t=Ba(t,i,h),t}function my(t,i,l,c){return Vi(),i.flags|=256,tn(t,i,l,c),i.child}var Nd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Rd(t){return{baseLanes:t,cachePool:ig()}}function _d(t,i,l){return t=t!==null?t.childLanes&~l:0,i&&(t|=Mn),t}function gy(t,i,l){var c=i.pendingProps,h=!1,v=(i.flags&128)!==0,w;if((w=v)||(w=t!==null&&t.memoizedState===null?!1:(Rt.current&2)!==0),w&&(h=!0,i.flags&=-129),w=(i.flags&32)!==0,i.flags&=-33,t===null){if(We){if(h?fi(i):pi(),(t=wt)?(t=Cv(t,Zn),t=t!==null&&t.data!=="&"?t:null,t!==null&&(i.memoizedState={dehydrated:t,treeContext:ri!==null?{id:ga,overflow:ya}:null,retryLane:536870912,hydrationErrors:null},l=Km(t),l.return=i,i.child=l,Jt=i,wt=null)):t=null,t===null)throw oi(i);return hf(t)?i.lanes=32:i.lanes=536870912,null}var A=c.children;return c=c.fallback,h?(pi(),h=i.mode,A=Rs({mode:"hidden",children:A},h),c=Gi(c,h,l,null),A.return=i,c.return=i,A.sibling=c,i.child=A,c=i.child,c.memoizedState=Rd(l),c.childLanes=_d(t,w,l),i.memoizedState=Nd,ql(null,c)):(fi(i),Od(i,A))}var z=t.memoizedState;if(z!==null&&(A=z.dehydrated,A!==null)){if(v)i.flags&256?(fi(i),i.flags&=-257,i=Dd(t,i,l)):i.memoizedState!==null?(pi(),i.child=t.child,i.flags|=128,i=null):(pi(),A=c.fallback,h=i.mode,c=Rs({mode:"visible",children:c.children},h),A=Gi(A,h,l,null),A.flags|=2,c.return=i,A.return=i,c.sibling=A,i.child=c,Zi(i,t.child,null,l),c=i.child,c.memoizedState=Rd(l),c.childLanes=_d(t,w,l),i.memoizedState=Nd,i=ql(null,c));else if(fi(i),hf(A)){if(w=A.nextSibling&&A.nextSibling.dataset,w)var ee=w.dgst;w=ee,c=Error(r(419)),c.stack="",c.digest=w,_l({value:c,source:null,stack:null}),i=Dd(t,i,l)}else if(It||_r(t,i,l,!1),w=(l&t.childLanes)!==0,It||w){if(w=ht,w!==null&&(c=ve(w,l),c!==0&&c!==z.retryLane))throw z.retryLane=c,Fi(t,c),En(w,t,c),jd;pf(A)||Us(),i=Dd(t,i,l)}else pf(A)?(i.flags|=192,i.child=t.child,i=null):(t=z.treeContext,wt=ea(A.nextSibling),Jt=i,We=!0,li=null,Zn=!1,t!==null&&Zm(i,t),i=Od(i,c.children),i.flags|=4096);return i}return h?(pi(),A=c.fallback,h=i.mode,z=t.child,ee=z.sibling,c=Ma(z,{mode:"hidden",children:c.children}),c.subtreeFlags=z.subtreeFlags&65011712,ee!==null?A=Ma(ee,A):(A=Gi(A,h,l,null),A.flags|=2),A.return=i,c.return=i,c.sibling=A,i.child=c,ql(null,c),c=i.child,A=t.child.memoizedState,A===null?A=Rd(l):(h=A.cachePool,h!==null?(z=Lt._currentValue,h=h.parent!==z?{parent:z,pool:z}:h):h=ig(),A={baseLanes:A.baseLanes|l,cachePool:h}),c.memoizedState=A,c.childLanes=_d(t,w,l),i.memoizedState=Nd,ql(t.child,c)):(fi(i),l=t.child,t=l.sibling,l=Ma(l,{mode:"visible",children:c.children}),l.return=i,l.sibling=null,t!==null&&(w=i.deletions,w===null?(i.deletions=[t],i.flags|=16):w.push(t)),i.child=l,i.memoizedState=null,l)}function Od(t,i){return i=Rs({mode:"visible",children:i},t.mode),i.return=t,t.child=i}function Rs(t,i){return t=Rn(22,t,null,i),t.lanes=0,t}function Dd(t,i,l){return Zi(i,t.child,null,l),t=Od(i,i.pendingProps.children),t.flags|=2,i.memoizedState=null,t}function yy(t,i,l){t.lanes|=i;var c=t.alternate;c!==null&&(c.lanes|=i),Yu(t.return,i,l)}function Md(t,i,l,c,h,v){var w=t.memoizedState;w===null?t.memoizedState={isBackwards:i,rendering:null,renderingStartTime:0,last:c,tail:l,tailMode:h,treeForkCount:v}:(w.isBackwards=i,w.rendering=null,w.renderingStartTime=0,w.last=c,w.tail=l,w.tailMode=h,w.treeForkCount=v)}function vy(t,i,l){var c=i.pendingProps,h=c.revealOrder,v=c.tail;c=c.children;var w=Rt.current,A=(w&2)!==0;if(A?(w=w&1|2,i.flags|=128):w&=1,N(Rt,w),tn(t,i,c,l),c=We?Rl:0,!A&&t!==null&&(t.flags&128)!==0)e:for(t=i.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&yy(t,l,i);else if(t.tag===19)yy(t,l,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}switch(h){case"forwards":for(l=i.child,h=null;l!==null;)t=l.alternate,t!==null&&vs(t)===null&&(h=l),l=l.sibling;l=h,l===null?(h=i.child,i.child=null):(h=l.sibling,l.sibling=null),Md(i,!1,h,l,v,c);break;case"backwards":case"unstable_legacy-backwards":for(l=null,h=i.child,i.child=null;h!==null;){if(t=h.alternate,t!==null&&vs(t)===null){i.child=h;break}t=h.sibling,h.sibling=l,l=h,h=t}Md(i,!0,l,null,v,c);break;case"together":Md(i,!1,null,null,void 0,c);break;default:i.memoizedState=null}return i.child}function Ba(t,i,l){if(t!==null&&(i.dependencies=t.dependencies),gi|=i.lanes,(l&i.childLanes)===0)if(t!==null){if(_r(t,i,l,!1),(l&i.childLanes)===0)return null}else return null;if(t!==null&&i.child!==t.child)throw Error(r(153));if(i.child!==null){for(t=i.child,l=Ma(t,t.pendingProps),i.child=l,l.return=i;t.sibling!==null;)t=t.sibling,l=l.sibling=Ma(t,t.pendingProps),l.return=i;l.sibling=null}return i.child}function Ld(t,i){return(t.lanes&i)!==0?!0:(t=t.dependencies,!!(t!==null&&us(t)))}function Qk(t,i,l){switch(i.tag){case 3:Ue(i,i.stateNode.containerInfo),si(i,Lt,t.memoizedState.cache),Vi();break;case 27:case 5:et(i);break;case 4:Ue(i,i.stateNode.containerInfo);break;case 10:si(i,i.type,i.memoizedProps.value);break;case 31:if(i.memoizedState!==null)return i.flags|=128,ld(i),null;break;case 13:var c=i.memoizedState;if(c!==null)return c.dehydrated!==null?(fi(i),i.flags|=128,null):(l&i.child.childLanes)!==0?gy(t,i,l):(fi(i),t=Ba(t,i,l),t!==null?t.sibling:null);fi(i);break;case 19:var h=(t.flags&128)!==0;if(c=(l&i.childLanes)!==0,c||(_r(t,i,l,!1),c=(l&i.childLanes)!==0),h){if(c)return vy(t,i,l);i.flags|=128}if(h=i.memoizedState,h!==null&&(h.rendering=null,h.tail=null,h.lastEffect=null),N(Rt,Rt.current),c)break;return null;case 22:return i.lanes=0,uy(t,i,l,i.pendingProps);case 24:si(i,Lt,t.memoizedState.cache)}return Ba(t,i,l)}function xy(t,i,l){if(t!==null)if(t.memoizedProps!==i.pendingProps)It=!0;else{if(!Ld(t,l)&&(i.flags&128)===0)return It=!1,Qk(t,i,l);It=(t.flags&131072)!==0}else It=!1,We&&(i.flags&1048576)!==0&&Xm(i,Rl,i.index);switch(i.lanes=0,i.tag){case 16:e:{var c=i.pendingProps;if(t=Qi(i.elementType),i.type=t,typeof t=="function")Bu(t)?(c=er(t,c),i.tag=1,i=hy(null,i,t,c,l)):(i.tag=0,i=Td(null,i,t,c,l));else{if(t!=null){var h=t.$$typeof;if(h===F){i.tag=11,i=oy(null,i,t,c,l);break e}else if(h===W){i.tag=14,i=sy(null,i,t,c,l);break e}}throw i=P(t)||t,Error(r(306,i,""))}}return i;case 0:return Td(t,i,i.type,i.pendingProps,l);case 1:return c=i.type,h=er(c,i.pendingProps),hy(t,i,c,h,l);case 3:e:{if(Ue(i,i.stateNode.containerInfo),t===null)throw Error(r(387));c=i.pendingProps;var v=i.memoizedState;h=v.element,td(t,i),Pl(i,c,null,l);var w=i.memoizedState;if(c=w.cache,si(i,Lt,c),c!==v.cache&&Ku(i,[Lt],l,!0),Il(),c=w.element,v.isDehydrated)if(v={element:c,isDehydrated:!1,cache:w.cache},i.updateQueue.baseState=v,i.memoizedState=v,i.flags&256){i=my(t,i,c,l);break e}else if(c!==h){h=Kn(Error(r(424)),i),_l(h),i=my(t,i,c,l);break e}else{switch(t=i.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(wt=ea(t.firstChild),Jt=i,We=!0,li=null,Zn=!0,l=ug(i,null,c,l),i.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Vi(),c===h){i=Ba(t,i,l);break e}tn(t,i,c,l)}i=i.child}return i;case 26:return Ns(t,i),t===null?(l=Rv(i.type,null,i.pendingProps,null))?i.memoizedState=l:We||(l=i.type,t=i.pendingProps,c=Vs(he.current).createElement(l),c[we]=i,c[_e]=t,nn(c,l,t),At(c),i.stateNode=c):i.memoizedState=Rv(i.type,t.memoizedProps,i.pendingProps,t.memoizedState),null;case 27:return et(i),t===null&&We&&(c=i.stateNode=jv(i.type,i.pendingProps,he.current),Jt=i,Zn=!0,h=wt,wi(i.type)?(mf=h,wt=ea(c.firstChild)):wt=h),tn(t,i,i.pendingProps.children,l),Ns(t,i),t===null&&(i.flags|=4194304),i.child;case 5:return t===null&&We&&((h=c=wt)&&(c=A2(c,i.type,i.pendingProps,Zn),c!==null?(i.stateNode=c,Jt=i,wt=ea(c.firstChild),Zn=!1,h=!0):h=!1),h||oi(i)),et(i),h=i.type,v=i.pendingProps,w=t!==null?t.memoizedProps:null,c=v.children,uf(h,v)?c=null:w!==null&&uf(h,w)&&(i.flags|=32),i.memoizedState!==null&&(h=sd(t,i,Hk,null,null,l),io._currentValue=h),Ns(t,i),tn(t,i,c,l),i.child;case 6:return t===null&&We&&((t=l=wt)&&(l=j2(l,i.pendingProps,Zn),l!==null?(i.stateNode=l,Jt=i,wt=null,t=!0):t=!1),t||oi(i)),null;case 13:return gy(t,i,l);case 4:return Ue(i,i.stateNode.containerInfo),c=i.pendingProps,t===null?i.child=Zi(i,null,c,l):tn(t,i,c,l),i.child;case 11:return oy(t,i,i.type,i.pendingProps,l);case 7:return tn(t,i,i.pendingProps,l),i.child;case 8:return tn(t,i,i.pendingProps.children,l),i.child;case 12:return tn(t,i,i.pendingProps.children,l),i.child;case 10:return c=i.pendingProps,si(i,i.type,c.value),tn(t,i,c.children,l),i.child;case 9:return h=i.type._context,c=i.pendingProps.children,Yi(i),h=en(h),c=c(h),i.flags|=1,tn(t,i,c,l),i.child;case 14:return sy(t,i,i.type,i.pendingProps,l);case 15:return cy(t,i,i.type,i.pendingProps,l);case 19:return vy(t,i,l);case 31:return Kk(t,i,l);case 22:return uy(t,i,l,i.pendingProps);case 24:return Yi(i),c=en(Lt),t===null?(h=Zu(),h===null&&(h=ht,v=Qu(),h.pooledCache=v,v.refCount++,v!==null&&(h.pooledCacheLanes|=l),h=v),i.memoizedState={parent:c,cache:h},ed(i),si(i,Lt,h)):((t.lanes&l)!==0&&(td(t,i),Pl(i,null,null,l),Il()),h=t.memoizedState,v=i.memoizedState,h.parent!==c?(h={parent:c,cache:c},i.memoizedState=h,i.lanes===0&&(i.memoizedState=i.updateQueue.baseState=h),si(i,Lt,c)):(c=v.cache,si(i,Lt,c),c!==h.cache&&Ku(i,[Lt],l,!0))),tn(t,i,i.pendingProps.children,l),i.child;case 29:throw i.pendingProps}throw Error(r(156,i.tag))}function Ha(t){t.flags|=4}function zd(t,i,l,c,h){if((i=(t.mode&32)!==0)&&(i=!1),i){if(t.flags|=16777216,(h&335544128)===h)if(t.stateNode.complete)t.flags|=8192;else if(Vy())t.flags|=8192;else throw Xi=hs,Ju}else t.flags&=-16777217}function by(t,i){if(i.type!=="stylesheet"||(i.state.loading&4)!==0)t.flags&=-16777217;else if(t.flags|=16777216,!Lv(i))if(Vy())t.flags|=8192;else throw Xi=hs,Ju}function _s(t,i){i!==null&&(t.flags|=4),t.flags&16384&&(i=t.tag!==22?Vo():536870912,t.lanes|=i,qr|=i)}function Fl(t,i){if(!We)switch(t.tailMode){case"hidden":i=t.tail;for(var l=null;i!==null;)i.alternate!==null&&(l=i),i=i.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var c=null;l!==null;)l.alternate!==null&&(c=l),l=l.sibling;c===null?i||t.tail===null?t.tail=null:t.tail.sibling=null:c.sibling=null}}function St(t){var i=t.alternate!==null&&t.alternate.child===t.child,l=0,c=0;if(i)for(var h=t.child;h!==null;)l|=h.lanes|h.childLanes,c|=h.subtreeFlags&65011712,c|=h.flags&65011712,h.return=t,h=h.sibling;else for(h=t.child;h!==null;)l|=h.lanes|h.childLanes,c|=h.subtreeFlags,c|=h.flags,h.return=t,h=h.sibling;return t.subtreeFlags|=c,t.childLanes=l,i}function Xk(t,i,l){var c=i.pendingProps;switch(Fu(i),i.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return St(i),null;case 1:return St(i),null;case 3:return l=i.stateNode,c=null,t!==null&&(c=t.memoizedState.cache),i.memoizedState.cache!==c&&(i.flags|=2048),Ia(Lt),Ne(),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Rr(i)?Ha(i):t===null||t.memoizedState.isDehydrated&&(i.flags&256)===0||(i.flags|=1024,Vu())),St(i),null;case 26:var h=i.type,v=i.memoizedState;return t===null?(Ha(i),v!==null?(St(i),by(i,v)):(St(i),zd(i,h,null,c,l))):v?v!==t.memoizedState?(Ha(i),St(i),by(i,v)):(St(i),i.flags&=-16777217):(t=t.memoizedProps,t!==c&&Ha(i),St(i),zd(i,h,t,c,l)),null;case 27:if(Ot(i),l=he.current,h=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==c&&Ha(i);else{if(!c){if(i.stateNode===null)throw Error(r(166));return St(i),null}t=ue.current,Rr(i)?Jm(i):(t=jv(h,c,l),i.stateNode=t,Ha(i))}return St(i),null;case 5:if(Ot(i),h=i.type,t!==null&&i.stateNode!=null)t.memoizedProps!==c&&Ha(i);else{if(!c){if(i.stateNode===null)throw Error(r(166));return St(i),null}if(v=ue.current,Rr(i))Jm(i);else{var w=Vs(he.current);switch(v){case 1:v=w.createElementNS("http://www.w3.org/2000/svg",h);break;case 2:v=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;default:switch(h){case"svg":v=w.createElementNS("http://www.w3.org/2000/svg",h);break;case"math":v=w.createElementNS("http://www.w3.org/1998/Math/MathML",h);break;case"script":v=w.createElement("div"),v.innerHTML="<script><\/script>",v=v.removeChild(v.firstChild);break;case"select":v=typeof c.is=="string"?w.createElement("select",{is:c.is}):w.createElement("select"),c.multiple?v.multiple=!0:c.size&&(v.size=c.size);break;default:v=typeof c.is=="string"?w.createElement(h,{is:c.is}):w.createElement(h)}}v[we]=i,v[_e]=c;e:for(w=i.child;w!==null;){if(w.tag===5||w.tag===6)v.appendChild(w.stateNode);else if(w.tag!==4&&w.tag!==27&&w.child!==null){w.child.return=w,w=w.child;continue}if(w===i)break e;for(;w.sibling===null;){if(w.return===null||w.return===i)break e;w=w.return}w.sibling.return=w.return,w=w.sibling}i.stateNode=v;e:switch(nn(v,h,c),h){case"button":case"input":case"select":case"textarea":c=!!c.autoFocus;break e;case"img":c=!0;break e;default:c=!1}c&&Ha(i)}}return St(i),zd(i,i.type,t===null?null:t.memoizedProps,i.pendingProps,l),null;case 6:if(t&&i.stateNode!=null)t.memoizedProps!==c&&Ha(i);else{if(typeof c!="string"&&i.stateNode===null)throw Error(r(166));if(t=he.current,Rr(i)){if(t=i.stateNode,l=i.memoizedProps,c=null,h=Jt,h!==null)switch(h.tag){case 27:case 5:c=h.memoizedProps}t[we]=i,t=!!(t.nodeValue===l||c!==null&&c.suppressHydrationWarning===!0||gv(t.nodeValue,l)),t||oi(i,!0)}else t=Vs(t).createTextNode(c),t[we]=i,i.stateNode=t}return St(i),null;case 31:if(l=i.memoizedState,t===null||t.memoizedState!==null){if(c=Rr(i),l!==null){if(t===null){if(!c)throw Error(r(318));if(t=i.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error(r(557));t[we]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;St(i),t=!1}else l=Vu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return i.flags&256?(On(i),i):(On(i),null);if((i.flags&128)!==0)throw Error(r(558))}return St(i),null;case 13:if(c=i.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(h=Rr(i),c!==null&&c.dehydrated!==null){if(t===null){if(!h)throw Error(r(318));if(h=i.memoizedState,h=h!==null?h.dehydrated:null,!h)throw Error(r(317));h[we]=i}else Vi(),(i.flags&128)===0&&(i.memoizedState=null),i.flags|=4;St(i),h=!1}else h=Vu(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=h),h=!0;if(!h)return i.flags&256?(On(i),i):(On(i),null)}return On(i),(i.flags&128)!==0?(i.lanes=l,i):(l=c!==null,t=t!==null&&t.memoizedState!==null,l&&(c=i.child,h=null,c.alternate!==null&&c.alternate.memoizedState!==null&&c.alternate.memoizedState.cachePool!==null&&(h=c.alternate.memoizedState.cachePool.pool),v=null,c.memoizedState!==null&&c.memoizedState.cachePool!==null&&(v=c.memoizedState.cachePool.pool),v!==h&&(c.flags|=2048)),l!==t&&l&&(i.child.flags|=8192),_s(i,i.updateQueue),St(i),null);case 4:return Ne(),t===null&&rf(i.stateNode.containerInfo),St(i),null;case 10:return Ia(i.type),St(i),null;case 19:if(X(Rt),c=i.memoizedState,c===null)return St(i),null;if(h=(i.flags&128)!==0,v=c.rendering,v===null)if(h)Fl(c,!1);else{if(Tt!==0||t!==null&&(t.flags&128)!==0)for(t=i.child;t!==null;){if(v=vs(t),v!==null){for(i.flags|=128,Fl(c,!1),t=v.updateQueue,i.updateQueue=t,_s(i,t),i.subtreeFlags=0,t=l,l=i.child;l!==null;)Ym(l,t),l=l.sibling;return N(Rt,Rt.current&1|2),We&&La(i,c.treeForkCount),i.child}t=t.sibling}c.tail!==null&&it()>zs&&(i.flags|=128,h=!0,Fl(c,!1),i.lanes=4194304)}else{if(!h)if(t=vs(v),t!==null){if(i.flags|=128,h=!0,t=t.updateQueue,i.updateQueue=t,_s(i,t),Fl(c,!0),c.tail===null&&c.tailMode==="hidden"&&!v.alternate&&!We)return St(i),null}else 2*it()-c.renderingStartTime>zs&&l!==536870912&&(i.flags|=128,h=!0,Fl(c,!1),i.lanes=4194304);c.isBackwards?(v.sibling=i.child,i.child=v):(t=c.last,t!==null?t.sibling=v:i.child=v,c.last=v)}return c.tail!==null?(t=c.tail,c.rendering=t,c.tail=t.sibling,c.renderingStartTime=it(),t.sibling=null,l=Rt.current,N(Rt,h?l&1|2:l&1),We&&La(i,c.treeForkCount),t):(St(i),null);case 22:case 23:return On(i),rd(),c=i.memoizedState!==null,t!==null?t.memoizedState!==null!==c&&(i.flags|=8192):c&&(i.flags|=8192),c?(l&536870912)!==0&&(i.flags&128)===0&&(St(i),i.subtreeFlags&6&&(i.flags|=8192)):St(i),l=i.updateQueue,l!==null&&_s(i,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),c=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(c=i.memoizedState.cachePool.pool),c!==l&&(i.flags|=2048),t!==null&&X(Ki),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),i.memoizedState.cache!==l&&(i.flags|=2048),Ia(Lt),St(i),null;case 25:return null;case 30:return null}throw Error(r(156,i.tag))}function Zk(t,i){switch(Fu(i),i.tag){case 1:return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 3:return Ia(Lt),Ne(),t=i.flags,(t&65536)!==0&&(t&128)===0?(i.flags=t&-65537|128,i):null;case 26:case 27:case 5:return Ot(i),null;case 31:if(i.memoizedState!==null){if(On(i),i.alternate===null)throw Error(r(340));Vi()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 13:if(On(i),t=i.memoizedState,t!==null&&t.dehydrated!==null){if(i.alternate===null)throw Error(r(340));Vi()}return t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 19:return X(Rt),null;case 4:return Ne(),null;case 10:return Ia(i.type),null;case 22:case 23:return On(i),rd(),t!==null&&X(Ki),t=i.flags,t&65536?(i.flags=t&-65537|128,i):null;case 24:return Ia(Lt),null;case 25:return null;default:return null}}function wy(t,i){switch(Fu(i),i.tag){case 3:Ia(Lt),Ne();break;case 26:case 27:case 5:Ot(i);break;case 4:Ne();break;case 31:i.memoizedState!==null&&On(i);break;case 13:On(i);break;case 19:X(Rt);break;case 10:Ia(i.type);break;case 22:case 23:On(i),rd(),t!==null&&X(Ki);break;case 24:Ia(Lt)}}function Gl(t,i){try{var l=i.updateQueue,c=l!==null?l.lastEffect:null;if(c!==null){var h=c.next;l=h;do{if((l.tag&t)===t){c=void 0;var v=l.create,w=l.inst;c=v(),w.destroy=c}l=l.next}while(l!==h)}}catch(A){st(i,i.return,A)}}function hi(t,i,l){try{var c=i.updateQueue,h=c!==null?c.lastEffect:null;if(h!==null){var v=h.next;c=v;do{if((c.tag&t)===t){var w=c.inst,A=w.destroy;if(A!==void 0){w.destroy=void 0,h=i;var z=l,ee=A;try{ee()}catch(re){st(h,z,re)}}}c=c.next}while(c!==v)}}catch(re){st(i,i.return,re)}}function Sy(t){var i=t.updateQueue;if(i!==null){var l=t.stateNode;try{fg(i,l)}catch(c){st(t,t.return,c)}}}function ky(t,i,l){l.props=er(t.type,t.memoizedProps),l.state=t.memoizedState;try{l.componentWillUnmount()}catch(c){st(t,i,c)}}function Vl(t,i){try{var l=t.ref;if(l!==null){switch(t.tag){case 26:case 27:case 5:var c=t.stateNode;break;case 30:c=t.stateNode;break;default:c=t.stateNode}typeof l=="function"?t.refCleanup=l(c):l.current=c}}catch(h){st(t,i,h)}}function va(t,i){var l=t.ref,c=t.refCleanup;if(l!==null)if(typeof c=="function")try{c()}catch(h){st(t,i,h)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{l(null)}catch(h){st(t,i,h)}else l.current=null}function Cy(t){var i=t.type,l=t.memoizedProps,c=t.stateNode;try{e:switch(i){case"button":case"input":case"select":case"textarea":l.autoFocus&&c.focus();break e;case"img":l.src?c.src=l.src:l.srcSet&&(c.srcset=l.srcSet)}}catch(h){st(t,t.return,h)}}function Id(t,i,l){try{var c=t.stateNode;b2(c,t.type,l,i),c[_e]=i}catch(h){st(t,t.return,h)}}function Ey(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&wi(t.type)||t.tag===4}function Pd(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||Ey(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.tag===27&&wi(t.type)||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 Ud(t,i,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,i?(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,i):(i=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,i.appendChild(t),l=l._reactRootContainer,l!=null||i.onclick!==null||(i.onclick=Oa));else if(c!==4&&(c===27&&wi(t.type)&&(l=t.stateNode,i=null),t=t.child,t!==null))for(Ud(t,i,l),t=t.sibling;t!==null;)Ud(t,i,l),t=t.sibling}function Os(t,i,l){var c=t.tag;if(c===5||c===6)t=t.stateNode,i?l.insertBefore(t,i):l.appendChild(t);else if(c!==4&&(c===27&&wi(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(Os(t,i,l),t=t.sibling;t!==null;)Os(t,i,l),t=t.sibling}function Ay(t){var i=t.stateNode,l=t.memoizedProps;try{for(var c=t.type,h=i.attributes;h.length;)i.removeAttributeNode(h[0]);nn(i,c,l),i[we]=t,i[_e]=l}catch(v){st(t,t.return,v)}}var $a=!1,Pt=!1,Bd=!1,jy=typeof WeakSet=="function"?WeakSet:Set,Yt=null;function Jk(t,i){if(t=t.containerInfo,sf=Js,t=Um(t),Du(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var c=l.getSelection&&l.getSelection();if(c&&c.rangeCount!==0){l=c.anchorNode;var h=c.anchorOffset,v=c.focusNode;c=c.focusOffset;try{l.nodeType,v.nodeType}catch{l=null;break e}var w=0,A=-1,z=-1,ee=0,re=0,ce=t,te=null;t:for(;;){for(var ne;ce!==l||h!==0&&ce.nodeType!==3||(A=w+h),ce!==v||c!==0&&ce.nodeType!==3||(z=w+c),ce.nodeType===3&&(w+=ce.nodeValue.length),(ne=ce.firstChild)!==null;)te=ce,ce=ne;for(;;){if(ce===t)break t;if(te===l&&++ee===h&&(A=w),te===v&&++re===c&&(z=w),(ne=ce.nextSibling)!==null)break;ce=te,te=ce.parentNode}ce=ne}l=A===-1||z===-1?null:{start:A,end:z}}else l=null}l=l||{start:0,end:0}}else l=null;for(cf={focusedElem:t,selectionRange:l},Js=!1,Yt=i;Yt!==null;)if(i=Yt,t=i.child,(i.subtreeFlags&1028)!==0&&t!==null)t.return=i,Yt=t;else for(;Yt!==null;){switch(i=Yt,v=i.alternate,t=i.flags,i.tag){case 0:if((t&4)!==0&&(t=i.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)h=t[l],h.ref.impl=h.nextImpl;break;case 11:case 15:break;case 1:if((t&1024)!==0&&v!==null){t=void 0,l=i,h=v.memoizedProps,v=v.memoizedState,c=l.stateNode;try{var xe=er(l.type,h);t=c.getSnapshotBeforeUpdate(xe,v),c.__reactInternalSnapshotBeforeUpdate=t}catch(je){st(l,l.return,je)}}break;case 3:if((t&1024)!==0){if(t=i.stateNode.containerInfo,l=t.nodeType,l===9)ff(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":ff(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((t&1024)!==0)throw Error(r(163))}if(t=i.sibling,t!==null){t.return=i.return,Yt=t;break}Yt=i.return}}function Ty(t,i,l){var c=l.flags;switch(l.tag){case 0:case 11:case 15:Fa(t,l),c&4&&Gl(5,l);break;case 1:if(Fa(t,l),c&4)if(t=l.stateNode,i===null)try{t.componentDidMount()}catch(w){st(l,l.return,w)}else{var h=er(l.type,i.memoizedProps);i=i.memoizedState;try{t.componentDidUpdate(h,i,t.__reactInternalSnapshotBeforeUpdate)}catch(w){st(l,l.return,w)}}c&64&&Sy(l),c&512&&Vl(l,l.return);break;case 3:if(Fa(t,l),c&64&&(t=l.updateQueue,t!==null)){if(i=null,l.child!==null)switch(l.child.tag){case 27:case 5:i=l.child.stateNode;break;case 1:i=l.child.stateNode}try{fg(t,i)}catch(w){st(l,l.return,w)}}break;case 27:i===null&&c&4&&Ay(l);case 26:case 5:Fa(t,l),i===null&&c&4&&Cy(l),c&512&&Vl(l,l.return);break;case 12:Fa(t,l);break;case 31:Fa(t,l),c&4&&_y(t,l);break;case 13:Fa(t,l),c&4&&Oy(t,l),c&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(l=s2.bind(null,l),T2(t,l))));break;case 22:if(c=l.memoizedState!==null||$a,!c){i=i!==null&&i.memoizedState!==null||Pt,h=$a;var v=Pt;$a=c,(Pt=i)&&!v?Ga(t,l,(l.subtreeFlags&8772)!==0):Fa(t,l),$a=h,Pt=v}break;case 30:break;default:Fa(t,l)}}function Ny(t){var i=t.alternate;i!==null&&(t.alternate=null,Ny(i)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(i=t.stateNode,i!==null&&vr(i)),t.stateNode=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}var Ct=null,wn=!1;function qa(t,i,l){for(l=l.child;l!==null;)Ry(t,i,l),l=l.sibling}function Ry(t,i,l){if(Xe&&typeof Xe.onCommitFiberUnmount=="function")try{Xe.onCommitFiberUnmount(Ie,l)}catch{}switch(l.tag){case 26:Pt||va(l,i),qa(t,i,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(l=l.stateNode,l.parentNode.removeChild(l));break;case 27:Pt||va(l,i);var c=Ct,h=wn;wi(l.type)&&(Ct=l.stateNode,wn=!1),qa(t,i,l),to(l.stateNode),Ct=c,wn=h;break;case 5:Pt||va(l,i);case 6:if(c=Ct,h=wn,Ct=null,qa(t,i,l),Ct=c,wn=h,Ct!==null)if(wn)try{(Ct.nodeType===9?Ct.body:Ct.nodeName==="HTML"?Ct.ownerDocument.body:Ct).removeChild(l.stateNode)}catch(v){st(l,i,v)}else try{Ct.removeChild(l.stateNode)}catch(v){st(l,i,v)}break;case 18:Ct!==null&&(wn?(t=Ct,Sv(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),Xr(t)):Sv(Ct,l.stateNode));break;case 4:c=Ct,h=wn,Ct=l.stateNode.containerInfo,wn=!0,qa(t,i,l),Ct=c,wn=h;break;case 0:case 11:case 14:case 15:hi(2,l,i),Pt||hi(4,l,i),qa(t,i,l);break;case 1:Pt||(va(l,i),c=l.stateNode,typeof c.componentWillUnmount=="function"&&ky(l,i,c)),qa(t,i,l);break;case 21:qa(t,i,l);break;case 22:Pt=(c=Pt)||l.memoizedState!==null,qa(t,i,l),Pt=c;break;default:qa(t,i,l)}}function _y(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{Xr(t)}catch(l){st(i,i.return,l)}}}function Oy(t,i){if(i.memoizedState===null&&(t=i.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{Xr(t)}catch(l){st(i,i.return,l)}}function e2(t){switch(t.tag){case 31:case 13:case 19:var i=t.stateNode;return i===null&&(i=t.stateNode=new jy),i;case 22:return t=t.stateNode,i=t._retryCache,i===null&&(i=t._retryCache=new jy),i;default:throw Error(r(435,t.tag))}}function Ds(t,i){var l=e2(t);i.forEach(function(c){if(!l.has(c)){l.add(c);var h=c2.bind(null,t,c);c.then(h,h)}})}function Sn(t,i){var l=i.deletions;if(l!==null)for(var c=0;c<l.length;c++){var h=l[c],v=t,w=i,A=w;e:for(;A!==null;){switch(A.tag){case 27:if(wi(A.type)){Ct=A.stateNode,wn=!1;break e}break;case 5:Ct=A.stateNode,wn=!1;break e;case 3:case 4:Ct=A.stateNode.containerInfo,wn=!0;break e}A=A.return}if(Ct===null)throw Error(r(160));Ry(v,w,h),Ct=null,wn=!1,v=h.alternate,v!==null&&(v.return=null),h.return=null}if(i.subtreeFlags&13886)for(i=i.child;i!==null;)Dy(i,t),i=i.sibling}var oa=null;function Dy(t,i){var l=t.alternate,c=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Sn(i,t),kn(t),c&4&&(hi(3,t,t.return),Gl(3,t),hi(5,t,t.return));break;case 1:Sn(i,t),kn(t),c&512&&(Pt||l===null||va(l,l.return)),c&64&&$a&&(t=t.updateQueue,t!==null&&(c=t.callbacks,c!==null&&(l=t.shared.hiddenCallbacks,t.shared.hiddenCallbacks=l===null?c:l.concat(c))));break;case 26:var h=oa;if(Sn(i,t),kn(t),c&512&&(Pt||l===null||va(l,l.return)),c&4){var v=l!==null?l.memoizedState:null;if(c=t.memoizedState,l===null)if(c===null)if(t.stateNode===null){e:{c=t.type,l=t.memoizedProps,h=h.ownerDocument||h;t:switch(c){case"title":v=h.getElementsByTagName("title")[0],(!v||v[ha]||v[we]||v.namespaceURI==="http://www.w3.org/2000/svg"||v.hasAttribute("itemprop"))&&(v=h.createElement(c),h.head.insertBefore(v,h.querySelector("head > title"))),nn(v,c,l),v[we]=t,At(v),c=v;break e;case"link":var w=Dv("link","href",h).get(c+(l.href||""));if(w){for(var A=0;A<w.length;A++)if(v=w[A],v.getAttribute("href")===(l.href==null||l.href===""?null:l.href)&&v.getAttribute("rel")===(l.rel==null?null:l.rel)&&v.getAttribute("title")===(l.title==null?null:l.title)&&v.getAttribute("crossorigin")===(l.crossOrigin==null?null:l.crossOrigin)){w.splice(A,1);break t}}v=h.createElement(c),nn(v,c,l),h.head.appendChild(v);break;case"meta":if(w=Dv("meta","content",h).get(c+(l.content||""))){for(A=0;A<w.length;A++)if(v=w[A],v.getAttribute("content")===(l.content==null?null:""+l.content)&&v.getAttribute("name")===(l.name==null?null:l.name)&&v.getAttribute("property")===(l.property==null?null:l.property)&&v.getAttribute("http-equiv")===(l.httpEquiv==null?null:l.httpEquiv)&&v.getAttribute("charset")===(l.charSet==null?null:l.charSet)){w.splice(A,1);break t}}v=h.createElement(c),nn(v,c,l),h.head.appendChild(v);break;default:throw Error(r(468,c))}v[we]=t,At(v),c=v}t.stateNode=c}else Mv(h,t.type,t.stateNode);else t.stateNode=Ov(h,c,t.memoizedProps);else v!==c?(v===null?l.stateNode!==null&&(l=l.stateNode,l.parentNode.removeChild(l)):v.count--,c===null?Mv(h,t.type,t.stateNode):Ov(h,c,t.memoizedProps)):c===null&&t.stateNode!==null&&Id(t,t.memoizedProps,l.memoizedProps)}break;case 27:Sn(i,t),kn(t),c&512&&(Pt||l===null||va(l,l.return)),l!==null&&c&4&&Id(t,t.memoizedProps,l.memoizedProps);break;case 5:if(Sn(i,t),kn(t),c&512&&(Pt||l===null||va(l,l.return)),t.flags&32){h=t.stateNode;try{br(h,"")}catch(xe){st(t,t.return,xe)}}c&4&&t.stateNode!=null&&(h=t.memoizedProps,Id(t,h,l!==null?l.memoizedProps:h)),c&1024&&(Bd=!0);break;case 6:if(Sn(i,t),kn(t),c&4){if(t.stateNode===null)throw Error(r(162));c=t.memoizedProps,l=t.stateNode;try{l.nodeValue=c}catch(xe){st(t,t.return,xe)}}break;case 3:if(Ks=null,h=oa,oa=Ws(i.containerInfo),Sn(i,t),oa=h,kn(t),c&4&&l!==null&&l.memoizedState.isDehydrated)try{Xr(i.containerInfo)}catch(xe){st(t,t.return,xe)}Bd&&(Bd=!1,My(t));break;case 4:c=oa,oa=Ws(t.stateNode.containerInfo),Sn(i,t),kn(t),oa=c;break;case 12:Sn(i,t),kn(t);break;case 31:Sn(i,t),kn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Ds(t,c)));break;case 13:Sn(i,t),kn(t),t.child.flags&8192&&t.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Ls=it()),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Ds(t,c)));break;case 22:h=t.memoizedState!==null;var z=l!==null&&l.memoizedState!==null,ee=$a,re=Pt;if($a=ee||h,Pt=re||z,Sn(i,t),Pt=re,$a=ee,kn(t),c&8192)e:for(i=t.stateNode,i._visibility=h?i._visibility&-2:i._visibility|1,h&&(l===null||z||$a||Pt||tr(t)),l=null,i=t;;){if(i.tag===5||i.tag===26){if(l===null){z=l=i;try{if(v=z.stateNode,h)w=v.style,typeof w.setProperty=="function"?w.setProperty("display","none","important"):w.display="none";else{A=z.stateNode;var ce=z.memoizedProps.style,te=ce!=null&&ce.hasOwnProperty("display")?ce.display:null;A.style.display=te==null||typeof te=="boolean"?"":(""+te).trim()}}catch(xe){st(z,z.return,xe)}}}else if(i.tag===6){if(l===null){z=i;try{z.stateNode.nodeValue=h?"":z.memoizedProps}catch(xe){st(z,z.return,xe)}}}else if(i.tag===18){if(l===null){z=i;try{var ne=z.stateNode;h?kv(ne,!0):kv(z.stateNode,!1)}catch(xe){st(z,z.return,xe)}}}else if((i.tag!==22&&i.tag!==23||i.memoizedState===null||i===t)&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===t)break e;for(;i.sibling===null;){if(i.return===null||i.return===t)break e;l===i&&(l=null),i=i.return}l===i&&(l=null),i.sibling.return=i.return,i=i.sibling}c&4&&(c=t.updateQueue,c!==null&&(l=c.retryQueue,l!==null&&(c.retryQueue=null,Ds(t,l))));break;case 19:Sn(i,t),kn(t),c&4&&(c=t.updateQueue,c!==null&&(t.updateQueue=null,Ds(t,c)));break;case 30:break;case 21:break;default:Sn(i,t),kn(t)}}function kn(t){var i=t.flags;if(i&2){try{for(var l,c=t.return;c!==null;){if(Ey(c)){l=c;break}c=c.return}if(l==null)throw Error(r(160));switch(l.tag){case 27:var h=l.stateNode,v=Pd(t);Os(t,v,h);break;case 5:var w=l.stateNode;l.flags&32&&(br(w,""),l.flags&=-33);var A=Pd(t);Os(t,A,w);break;case 3:case 4:var z=l.stateNode.containerInfo,ee=Pd(t);Ud(t,ee,z);break;default:throw Error(r(161))}}catch(re){st(t,t.return,re)}t.flags&=-3}i&4096&&(t.flags&=-4097)}function My(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var i=t;My(i),i.tag===5&&i.flags&1024&&i.stateNode.reset(),t=t.sibling}}function Fa(t,i){if(i.subtreeFlags&8772)for(i=i.child;i!==null;)Ty(t,i.alternate,i),i=i.sibling}function tr(t){for(t=t.child;t!==null;){var i=t;switch(i.tag){case 0:case 11:case 14:case 15:hi(4,i,i.return),tr(i);break;case 1:va(i,i.return);var l=i.stateNode;typeof l.componentWillUnmount=="function"&&ky(i,i.return,l),tr(i);break;case 27:to(i.stateNode);case 26:case 5:va(i,i.return),tr(i);break;case 22:i.memoizedState===null&&tr(i);break;case 30:tr(i);break;default:tr(i)}t=t.sibling}}function Ga(t,i,l){for(l=l&&(i.subtreeFlags&8772)!==0,i=i.child;i!==null;){var c=i.alternate,h=t,v=i,w=v.flags;switch(v.tag){case 0:case 11:case 15:Ga(h,v,l),Gl(4,v);break;case 1:if(Ga(h,v,l),c=v,h=c.stateNode,typeof h.componentDidMount=="function")try{h.componentDidMount()}catch(ee){st(c,c.return,ee)}if(c=v,h=c.updateQueue,h!==null){var A=c.stateNode;try{var z=h.shared.hiddenCallbacks;if(z!==null)for(h.shared.hiddenCallbacks=null,h=0;h<z.length;h++)dg(z[h],A)}catch(ee){st(c,c.return,ee)}}l&&w&64&&Sy(v),Vl(v,v.return);break;case 27:Ay(v);case 26:case 5:Ga(h,v,l),l&&c===null&&w&4&&Cy(v),Vl(v,v.return);break;case 12:Ga(h,v,l);break;case 31:Ga(h,v,l),l&&w&4&&_y(h,v);break;case 13:Ga(h,v,l),l&&w&4&&Oy(h,v);break;case 22:v.memoizedState===null&&Ga(h,v,l),Vl(v,v.return);break;case 30:break;default:Ga(h,v,l)}i=i.sibling}}function Hd(t,i){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,i.memoizedState!==null&&i.memoizedState.cachePool!==null&&(t=i.memoizedState.cachePool.pool),t!==l&&(t!=null&&t.refCount++,l!=null&&Ol(l))}function $d(t,i){t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Ol(t))}function sa(t,i,l,c){if(i.subtreeFlags&10256)for(i=i.child;i!==null;)Ly(t,i,l,c),i=i.sibling}function Ly(t,i,l,c){var h=i.flags;switch(i.tag){case 0:case 11:case 15:sa(t,i,l,c),h&2048&&Gl(9,i);break;case 1:sa(t,i,l,c);break;case 3:sa(t,i,l,c),h&2048&&(t=null,i.alternate!==null&&(t=i.alternate.memoizedState.cache),i=i.memoizedState.cache,i!==t&&(i.refCount++,t!=null&&Ol(t)));break;case 12:if(h&2048){sa(t,i,l,c),t=i.stateNode;try{var v=i.memoizedProps,w=v.id,A=v.onPostCommit;typeof A=="function"&&A(w,i.alternate===null?"mount":"update",t.passiveEffectDuration,-0)}catch(z){st(i,i.return,z)}}else sa(t,i,l,c);break;case 31:sa(t,i,l,c);break;case 13:sa(t,i,l,c);break;case 23:break;case 22:v=i.stateNode,w=i.alternate,i.memoizedState!==null?v._visibility&2?sa(t,i,l,c):Wl(t,i):v._visibility&2?sa(t,i,l,c):(v._visibility|=2,Br(t,i,l,c,(i.subtreeFlags&10256)!==0||!1)),h&2048&&Hd(w,i);break;case 24:sa(t,i,l,c),h&2048&&$d(i.alternate,i);break;default:sa(t,i,l,c)}}function Br(t,i,l,c,h){for(h=h&&((i.subtreeFlags&10256)!==0||!1),i=i.child;i!==null;){var v=t,w=i,A=l,z=c,ee=w.flags;switch(w.tag){case 0:case 11:case 15:Br(v,w,A,z,h),Gl(8,w);break;case 23:break;case 22:var re=w.stateNode;w.memoizedState!==null?re._visibility&2?Br(v,w,A,z,h):Wl(v,w):(re._visibility|=2,Br(v,w,A,z,h)),h&&ee&2048&&Hd(w.alternate,w);break;case 24:Br(v,w,A,z,h),h&&ee&2048&&$d(w.alternate,w);break;default:Br(v,w,A,z,h)}i=i.sibling}}function Wl(t,i){if(i.subtreeFlags&10256)for(i=i.child;i!==null;){var l=t,c=i,h=c.flags;switch(c.tag){case 22:Wl(l,c),h&2048&&Hd(c.alternate,c);break;case 24:Wl(l,c),h&2048&&$d(c.alternate,c);break;default:Wl(l,c)}i=i.sibling}}var Yl=8192;function Hr(t,i,l){if(t.subtreeFlags&Yl)for(t=t.child;t!==null;)zy(t,i,l),t=t.sibling}function zy(t,i,l){switch(t.tag){case 26:Hr(t,i,l),t.flags&Yl&&t.memoizedState!==null&&B2(l,oa,t.memoizedState,t.memoizedProps);break;case 5:Hr(t,i,l);break;case 3:case 4:var c=oa;oa=Ws(t.stateNode.containerInfo),Hr(t,i,l),oa=c;break;case 22:t.memoizedState===null&&(c=t.alternate,c!==null&&c.memoizedState!==null?(c=Yl,Yl=16777216,Hr(t,i,l),Yl=c):Hr(t,i,l));break;default:Hr(t,i,l)}}function Iy(t){var i=t.alternate;if(i!==null&&(t=i.child,t!==null)){i.child=null;do i=t.sibling,t.sibling=null,t=i;while(t!==null)}}function Kl(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var c=i[l];Yt=c,Uy(c,t)}Iy(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Py(t),t=t.sibling}function Py(t){switch(t.tag){case 0:case 11:case 15:Kl(t),t.flags&2048&&hi(9,t,t.return);break;case 3:Kl(t);break;case 12:Kl(t);break;case 22:var i=t.stateNode;t.memoizedState!==null&&i._visibility&2&&(t.return===null||t.return.tag!==13)?(i._visibility&=-3,Ms(t)):Kl(t);break;default:Kl(t)}}function Ms(t){var i=t.deletions;if((t.flags&16)!==0){if(i!==null)for(var l=0;l<i.length;l++){var c=i[l];Yt=c,Uy(c,t)}Iy(t)}for(t=t.child;t!==null;){switch(i=t,i.tag){case 0:case 11:case 15:hi(8,i,i.return),Ms(i);break;case 22:l=i.stateNode,l._visibility&2&&(l._visibility&=-3,Ms(i));break;default:Ms(i)}t=t.sibling}}function Uy(t,i){for(;Yt!==null;){var l=Yt;switch(l.tag){case 0:case 11:case 15:hi(8,l,i);break;case 23:case 22:if(l.memoizedState!==null&&l.memoizedState.cachePool!==null){var c=l.memoizedState.cachePool.pool;c!=null&&c.refCount++}break;case 24:Ol(l.memoizedState.cache)}if(c=l.child,c!==null)c.return=l,Yt=c;else e:for(l=t;Yt!==null;){c=Yt;var h=c.sibling,v=c.return;if(Ny(c),c===l){Yt=null;break e}if(h!==null){h.return=v,Yt=h;break e}Yt=v}}}var t2={getCacheForType:function(t){var i=en(Lt),l=i.data.get(t);return l===void 0&&(l=t(),i.data.set(t,l)),l},cacheSignal:function(){return en(Lt).controller.signal}},n2=typeof WeakMap=="function"?WeakMap:Map,tt=0,ht=null,He=null,Fe=0,ot=0,Dn=null,mi=!1,$r=!1,qd=!1,Va=0,Tt=0,gi=0,nr=0,Fd=0,Mn=0,qr=0,Ql=null,Cn=null,Gd=!1,Ls=0,By=0,zs=1/0,Is=null,yi=null,Gt=0,vi=null,Fr=null,Wa=0,Vd=0,Wd=null,Hy=null,Xl=0,Yd=null;function Ln(){return(tt&2)!==0&&Fe!==0?Fe&-Fe:B.T!==null?ef():Ye()}function $y(){if(Mn===0)if((Fe&536870912)===0||We){var t=Ii;Ii<<=1,(Ii&3932160)===0&&(Ii=262144),Mn=t}else Mn=536870912;return t=_n.current,t!==null&&(t.flags|=32),Mn}function En(t,i,l){(t===ht&&(ot===2||ot===9)||t.cancelPendingCommit!==null)&&(Gr(t,0),xi(t,Fe,Mn,!1)),Ui(t,l),((tt&2)===0||t!==ht)&&(t===ht&&((tt&2)===0&&(nr|=l),Tt===4&&xi(t,Fe,Mn,!1)),xa(t))}function qy(t,i,l){if((tt&6)!==0)throw Error(r(327));var c=!l&&(i&127)===0&&(i&t.expiredLanes)===0||Pi(t,i),h=c?r2(t,i):Qd(t,i,!0),v=c;do{if(h===0){$r&&!c&&xi(t,i,0,!1);break}else{if(l=t.current.alternate,v&&!a2(l)){h=Qd(t,i,!1),v=!1;continue}if(h===2){if(v=i,t.errorRecoveryDisabledLanes&v)var w=0;else w=t.pendingLanes&-536870913,w=w!==0?w:w&536870912?536870912:0;if(w!==0){i=w;e:{var A=t;h=Ql;var z=A.current.memoizedState.isDehydrated;if(z&&(Gr(A,w).flags|=256),w=Qd(A,w,!1),w!==2){if(qd&&!z){A.errorRecoveryDisabledLanes|=v,nr|=v,h=4;break e}v=Cn,Cn=h,v!==null&&(Cn===null?Cn=v:Cn.push.apply(Cn,v))}h=w}if(v=!1,h!==2)continue}}if(h===1){Gr(t,0),xi(t,i,0,!0);break}e:{switch(c=t,v=h,v){case 0:case 1:throw Error(r(345));case 4:if((i&4194048)!==i)break;case 6:xi(c,i,Mn,!mi);break e;case 2:Cn=null;break;case 3:case 5:break;default:throw Error(r(329))}if((i&62914560)===i&&(h=Ls+300-it(),10<h)){if(xi(c,i,Mn,!mi),yr(c,0,!0)!==0)break e;Wa=i,c.timeoutHandle=bv(Fy.bind(null,c,l,Cn,Is,Gd,i,Mn,nr,qr,mi,v,"Throttled",-0,0),h);break e}Fy(c,l,Cn,Is,Gd,i,Mn,nr,qr,mi,v,null,-0,0)}}break}while(!0);xa(t)}function Fy(t,i,l,c,h,v,w,A,z,ee,re,ce,te,ne){if(t.timeoutHandle=-1,ce=i.subtreeFlags,ce&8192||(ce&16785408)===16785408){ce={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Oa},zy(i,v,ce);var xe=(v&62914560)===v?Ls-it():(v&4194048)===v?By-it():0;if(xe=H2(ce,xe),xe!==null){Wa=v,t.cancelPendingCommit=xe(Zy.bind(null,t,i,v,l,c,h,w,A,z,re,ce,null,te,ne)),xi(t,v,w,!ee);return}}Zy(t,i,v,l,c,h,w,A,z)}function a2(t){for(var i=t;;){var l=i.tag;if((l===0||l===11||l===15)&&i.flags&16384&&(l=i.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var c=0;c<l.length;c++){var h=l[c],v=h.getSnapshot;h=h.value;try{if(!Nn(v(),h))return!1}catch{return!1}}if(l=i.child,i.subtreeFlags&16384&&l!==null)l.return=i,i=l;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 xi(t,i,l,c){i&=~Fd,i&=~nr,t.suspendedLanes|=i,t.pingedLanes&=~i,c&&(t.warmLanes|=i),c=t.expirationTimes;for(var h=i;0<h;){var v=31-Se(h),w=1<<v;c[v]=-1,h&=~w}l!==0&&Wo(t,l,i)}function Ps(){return(tt&6)===0?(Zl(0),!1):!0}function Kd(){if(He!==null){if(ot===0)var t=He.return;else t=He,za=Wi=null,dd(t),Lr=null,Ml=0,t=He;for(;t!==null;)wy(t.alternate,t),t=t.return;He=null}}function Gr(t,i){var l=t.timeoutHandle;l!==-1&&(t.timeoutHandle=-1,k2(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Wa=0,Kd(),ht=t,He=l=Ma(t.current,null),Fe=i,ot=0,Dn=null,mi=!1,$r=Pi(t,i),qd=!1,qr=Mn=Fd=nr=gi=Tt=0,Cn=Ql=null,Gd=!1,(i&8)!==0&&(i|=i&32);var c=t.entangledLanes;if(c!==0)for(t=t.entanglements,c&=i;0<c;){var h=31-Se(c),v=1<<h;i|=t[h],c&=~v}return Va=i,rs(),l}function Gy(t,i){Me=null,B.H=$l,i===Mr||i===ps?(i=og(),ot=3):i===Ju?(i=og(),ot=4):ot=i===jd?8:i!==null&&typeof i=="object"&&typeof i.then=="function"?6:1,Dn=i,He===null&&(Tt=1,js(t,Kn(i,t.current)))}function Vy(){var t=_n.current;return t===null?!0:(Fe&4194048)===Fe?Jn===null:(Fe&62914560)===Fe||(Fe&536870912)!==0?t===Jn:!1}function Wy(){var t=B.H;return B.H=$l,t===null?$l:t}function Yy(){var t=B.A;return B.A=t2,t}function Us(){Tt=4,mi||(Fe&4194048)!==Fe&&_n.current!==null||($r=!0),(gi&134217727)===0&&(nr&134217727)===0||ht===null||xi(ht,Fe,Mn,!1)}function Qd(t,i,l){var c=tt;tt|=2;var h=Wy(),v=Yy();(ht!==t||Fe!==i)&&(Is=null,Gr(t,i)),i=!1;var w=Tt;e:do try{if(ot!==0&&He!==null){var A=He,z=Dn;switch(ot){case 8:Kd(),w=6;break e;case 3:case 2:case 9:case 6:_n.current===null&&(i=!0);var ee=ot;if(ot=0,Dn=null,Vr(t,A,z,ee),l&&$r){w=0;break e}break;default:ee=ot,ot=0,Dn=null,Vr(t,A,z,ee)}}i2(),w=Tt;break}catch(re){Gy(t,re)}while(!0);return i&&t.shellSuspendCounter++,za=Wi=null,tt=c,B.H=h,B.A=v,He===null&&(ht=null,Fe=0,rs()),w}function i2(){for(;He!==null;)Ky(He)}function r2(t,i){var l=tt;tt|=2;var c=Wy(),h=Yy();ht!==t||Fe!==i?(Is=null,zs=it()+500,Gr(t,i)):$r=Pi(t,i);e:do try{if(ot!==0&&He!==null){i=He;var v=Dn;t:switch(ot){case 1:ot=0,Dn=null,Vr(t,i,v,1);break;case 2:case 9:if(rg(v)){ot=0,Dn=null,Qy(i);break}i=function(){ot!==2&&ot!==9||ht!==t||(ot=7),xa(t)},v.then(i,i);break e;case 3:ot=7;break e;case 4:ot=5;break e;case 7:rg(v)?(ot=0,Dn=null,Qy(i)):(ot=0,Dn=null,Vr(t,i,v,7));break;case 5:var w=null;switch(He.tag){case 26:w=He.memoizedState;case 5:case 27:var A=He;if(w?Lv(w):A.stateNode.complete){ot=0,Dn=null;var z=A.sibling;if(z!==null)He=z;else{var ee=A.return;ee!==null?(He=ee,Bs(ee)):He=null}break t}}ot=0,Dn=null,Vr(t,i,v,5);break;case 6:ot=0,Dn=null,Vr(t,i,v,6);break;case 8:Kd(),Tt=6;break e;default:throw Error(r(462))}}l2();break}catch(re){Gy(t,re)}while(!0);return za=Wi=null,B.H=c,B.A=h,tt=l,He!==null?0:(ht=null,Fe=0,rs(),Tt)}function l2(){for(;He!==null&&!Fn();)Ky(He)}function Ky(t){var i=xy(t.alternate,t,Va);t.memoizedProps=t.pendingProps,i===null?Bs(t):He=i}function Qy(t){var i=t,l=i.alternate;switch(i.tag){case 15:case 0:i=py(l,i,i.pendingProps,i.type,void 0,Fe);break;case 11:i=py(l,i,i.pendingProps,i.type.render,i.ref,Fe);break;case 5:dd(i);default:wy(l,i),i=He=Ym(i,Va),i=xy(l,i,Va)}t.memoizedProps=t.pendingProps,i===null?Bs(t):He=i}function Vr(t,i,l,c){za=Wi=null,dd(i),Lr=null,Ml=0;var h=i.return;try{if(Yk(t,h,i,l,Fe)){Tt=1,js(t,Kn(l,t.current)),He=null;return}}catch(v){if(h!==null)throw He=h,v;Tt=1,js(t,Kn(l,t.current)),He=null;return}i.flags&32768?(We||c===1?t=!0:$r||(Fe&536870912)!==0?t=!1:(mi=t=!0,(c===2||c===9||c===3||c===6)&&(c=_n.current,c!==null&&c.tag===13&&(c.flags|=16384))),Xy(i,t)):Bs(i)}function Bs(t){var i=t;do{if((i.flags&32768)!==0){Xy(i,mi);return}t=i.return;var l=Xk(i.alternate,i,Va);if(l!==null){He=l;return}if(i=i.sibling,i!==null){He=i;return}He=i=t}while(i!==null);Tt===0&&(Tt=5)}function Xy(t,i){do{var l=Zk(t.alternate,t);if(l!==null){l.flags&=32767,He=l;return}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!i&&(t=t.sibling,t!==null)){He=t;return}He=t=l}while(t!==null);Tt=6,He=null}function Zy(t,i,l,c,h,v,w,A,z){t.cancelPendingCommit=null;do Hs();while(Gt!==0);if((tt&6)!==0)throw Error(r(327));if(i!==null){if(i===t.current)throw Error(r(177));if(v=i.lanes|i.childLanes,v|=Pu,mu(t,l,v,w,A,z),t===ht&&(He=ht=null,Fe=0),Fr=i,vi=t,Wa=l,Vd=v,Wd=h,Hy=c,(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?(t.callbackNode=null,t.callbackPriority=0,u2(me,function(){return av(),null})):(t.callbackNode=null,t.callbackPriority=0),c=(i.flags&13878)!==0,(i.subtreeFlags&13878)!==0||c){c=B.T,B.T=null,h=Z.p,Z.p=2,w=tt,tt|=4;try{Jk(t,i,l)}finally{tt=w,Z.p=h,B.T=c}}Gt=1,Jy(),ev(),tv()}}function Jy(){if(Gt===1){Gt=0;var t=vi,i=Fr,l=(i.flags&13878)!==0;if((i.subtreeFlags&13878)!==0||l){l=B.T,B.T=null;var c=Z.p;Z.p=2;var h=tt;tt|=4;try{Dy(i,t);var v=cf,w=Um(t.containerInfo),A=v.focusedElem,z=v.selectionRange;if(w!==A&&A&&A.ownerDocument&&Pm(A.ownerDocument.documentElement,A)){if(z!==null&&Du(A)){var ee=z.start,re=z.end;if(re===void 0&&(re=ee),"selectionStart"in A)A.selectionStart=ee,A.selectionEnd=Math.min(re,A.value.length);else{var ce=A.ownerDocument||document,te=ce&&ce.defaultView||window;if(te.getSelection){var ne=te.getSelection(),xe=A.textContent.length,je=Math.min(z.start,xe),dt=z.end===void 0?je:Math.min(z.end,xe);!ne.extend&&je>dt&&(w=dt,dt=je,je=w);var Y=Im(A,je),$=Im(A,dt);if(Y&&$&&(ne.rangeCount!==1||ne.anchorNode!==Y.node||ne.anchorOffset!==Y.offset||ne.focusNode!==$.node||ne.focusOffset!==$.offset)){var J=ce.createRange();J.setStart(Y.node,Y.offset),ne.removeAllRanges(),je>dt?(ne.addRange(J),ne.extend($.node,$.offset)):(J.setEnd($.node,$.offset),ne.addRange(J))}}}}for(ce=[],ne=A;ne=ne.parentNode;)ne.nodeType===1&&ce.push({element:ne,left:ne.scrollLeft,top:ne.scrollTop});for(typeof A.focus=="function"&&A.focus(),A=0;A<ce.length;A++){var oe=ce[A];oe.element.scrollLeft=oe.left,oe.element.scrollTop=oe.top}}Js=!!sf,cf=sf=null}finally{tt=h,Z.p=c,B.T=l}}t.current=i,Gt=2}}function ev(){if(Gt===2){Gt=0;var t=vi,i=Fr,l=(i.flags&8772)!==0;if((i.subtreeFlags&8772)!==0||l){l=B.T,B.T=null;var c=Z.p;Z.p=2;var h=tt;tt|=4;try{Ty(t,i.alternate,i)}finally{tt=h,Z.p=c,B.T=l}}Gt=3}}function tv(){if(Gt===4||Gt===3){Gt=0,yn();var t=vi,i=Fr,l=Wa,c=Hy;(i.subtreeFlags&10256)!==0||(i.flags&10256)!==0?Gt=5:(Gt=0,Fr=vi=null,nv(t,t.pendingLanes));var h=t.pendingLanes;if(h===0&&(yi=null),De(l),i=i.stateNode,Xe&&typeof Xe.onCommitFiberRoot=="function")try{Xe.onCommitFiberRoot(Ie,i,void 0,(i.current.flags&128)===128)}catch{}if(c!==null){i=B.T,h=Z.p,Z.p=2,B.T=null;try{for(var v=t.onRecoverableError,w=0;w<c.length;w++){var A=c[w];v(A.value,{componentStack:A.stack})}}finally{B.T=i,Z.p=h}}(Wa&3)!==0&&Hs(),xa(t),h=t.pendingLanes,(l&261930)!==0&&(h&42)!==0?t===Yd?Xl++:(Xl=0,Yd=t):Xl=0,Zl(0)}}function nv(t,i){(t.pooledCacheLanes&=i)===0&&(i=t.pooledCache,i!=null&&(t.pooledCache=null,Ol(i)))}function Hs(){return Jy(),ev(),tv(),av()}function av(){if(Gt!==5)return!1;var t=vi,i=Vd;Vd=0;var l=De(Wa),c=B.T,h=Z.p;try{Z.p=32>l?32:l,B.T=null,l=Wd,Wd=null;var v=vi,w=Wa;if(Gt=0,Fr=vi=null,Wa=0,(tt&6)!==0)throw Error(r(331));var A=tt;if(tt|=4,Py(v.current),Ly(v,v.current,w,l),tt=A,Zl(0,!1),Xe&&typeof Xe.onPostCommitFiberRoot=="function")try{Xe.onPostCommitFiberRoot(Ie,v)}catch{}return!0}finally{Z.p=h,B.T=c,nv(t,i)}}function iv(t,i,l){i=Kn(l,i),i=Ad(t.stateNode,i,2),t=di(t,i,2),t!==null&&(Ui(t,2),xa(t))}function st(t,i,l){if(t.tag===3)iv(t,t,l);else for(;i!==null;){if(i.tag===3){iv(i,t,l);break}else if(i.tag===1){var c=i.stateNode;if(typeof i.type.getDerivedStateFromError=="function"||typeof c.componentDidCatch=="function"&&(yi===null||!yi.has(c))){t=Kn(l,t),l=ry(2),c=di(i,l,2),c!==null&&(ly(l,c,i,t),Ui(c,2),xa(c));break}}i=i.return}}function Xd(t,i,l){var c=t.pingCache;if(c===null){c=t.pingCache=new n2;var h=new Set;c.set(i,h)}else h=c.get(i),h===void 0&&(h=new Set,c.set(i,h));h.has(l)||(qd=!0,h.add(l),t=o2.bind(null,t,i,l),i.then(t,t))}function o2(t,i,l){var c=t.pingCache;c!==null&&c.delete(i),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,ht===t&&(Fe&l)===l&&(Tt===4||Tt===3&&(Fe&62914560)===Fe&&300>it()-Ls?(tt&2)===0&&Gr(t,0):Fd|=l,qr===Fe&&(qr=0)),xa(t)}function rv(t,i){i===0&&(i=Vo()),t=Fi(t,i),t!==null&&(Ui(t,i),xa(t))}function s2(t){var i=t.memoizedState,l=0;i!==null&&(l=i.retryLane),rv(t,l)}function c2(t,i){var l=0;switch(t.tag){case 31:case 13:var c=t.stateNode,h=t.memoizedState;h!==null&&(l=h.retryLane);break;case 19:c=t.stateNode;break;case 22:c=t.stateNode._retryCache;break;default:throw Error(r(314))}c!==null&&c.delete(i),rv(t,l)}function u2(t,i){return ge(t,i)}var $s=null,Wr=null,Zd=!1,qs=!1,Jd=!1,bi=0;function xa(t){t!==Wr&&t.next===null&&(Wr===null?$s=Wr=t:Wr=Wr.next=t),qs=!0,Zd||(Zd=!0,f2())}function Zl(t,i){if(!Jd&&qs){Jd=!0;do for(var l=!1,c=$s;c!==null;){if(t!==0){var h=c.pendingLanes;if(h===0)var v=0;else{var w=c.suspendedLanes,A=c.pingedLanes;v=(1<<31-Se(42|t)+1)-1,v&=h&~(w&~A),v=v&201326741?v&201326741|1:v?v|2:0}v!==0&&(l=!0,cv(c,v))}else v=Fe,v=yr(c,c===ht?v:0,c.cancelPendingCommit!==null||c.timeoutHandle!==-1),(v&3)===0||Pi(c,v)||(l=!0,cv(c,v));c=c.next}while(l);Jd=!1}}function d2(){lv()}function lv(){qs=Zd=!1;var t=0;bi!==0&&S2()&&(t=bi);for(var i=it(),l=null,c=$s;c!==null;){var h=c.next,v=ov(c,i);v===0?(c.next=null,l===null?$s=h:l.next=h,h===null&&(Wr=l)):(l=c,(t!==0||(v&3)!==0)&&(qs=!0)),c=h}Gt!==0&&Gt!==5||Zl(t),bi!==0&&(bi=0)}function ov(t,i){for(var l=t.suspendedLanes,c=t.pingedLanes,h=t.expirationTimes,v=t.pendingLanes&-62914561;0<v;){var w=31-Se(v),A=1<<w,z=h[w];z===-1?((A&l)===0||(A&c)!==0)&&(h[w]=hu(A,i)):z<=i&&(t.expiredLanes|=A),v&=~A}if(i=ht,l=Fe,l=yr(t,t===i?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c=t.callbackNode,l===0||t===i&&(ot===2||ot===9)||t.cancelPendingCommit!==null)return c!==null&&c!==null&&Mt(c),t.callbackNode=null,t.callbackPriority=0;if((l&3)===0||Pi(t,l)){if(i=l&-l,i===t.callbackPriority)return i;switch(c!==null&&Mt(c),De(l)){case 2:case 8:l=le;break;case 32:l=me;break;case 268435456:l=I;break;default:l=me}return c=sv.bind(null,t),l=ge(l,c),t.callbackPriority=i,t.callbackNode=l,i}return c!==null&&c!==null&&Mt(c),t.callbackPriority=2,t.callbackNode=null,2}function sv(t,i){if(Gt!==0&&Gt!==5)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Hs()&&t.callbackNode!==l)return null;var c=Fe;return c=yr(t,t===ht?c:0,t.cancelPendingCommit!==null||t.timeoutHandle!==-1),c===0?null:(qy(t,c,i),ov(t,it()),t.callbackNode!=null&&t.callbackNode===l?sv.bind(null,t):null)}function cv(t,i){if(Hs())return null;qy(t,i,!0)}function f2(){C2(function(){(tt&6)!==0?ge(H,d2):lv()})}function ef(){if(bi===0){var t=Or;t===0&&(t=ti,ti<<=1,(ti&261888)===0&&(ti=256)),bi=t}return bi}function uv(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:Xo(""+t)}function dv(t,i){var l=i.ownerDocument.createElement("input");return l.name=i.name,l.value=i.value,t.id&&l.setAttribute("form",t.id),i.parentNode.insertBefore(l,i),t=new FormData(t),l.parentNode.removeChild(l),t}function p2(t,i,l,c,h){if(i==="submit"&&l&&l.stateNode===h){var v=uv((h[_e]||null).action),w=c.submitter;w&&(i=(i=w[_e]||null)?uv(i.formAction):w.getAttribute("formAction"),i!==null&&(v=i,w=null));var A=new ts("action","action",null,c,h);t.push({event:A,listeners:[{instance:null,listener:function(){if(c.defaultPrevented){if(bi!==0){var z=w?dv(h,w):new FormData(h);bd(l,{pending:!0,data:z,method:h.method,action:v},null,z)}}else typeof v=="function"&&(A.preventDefault(),z=w?dv(h,w):new FormData(h),bd(l,{pending:!0,data:z,method:h.method,action:v},v,z))},currentTarget:h}]})}}for(var tf=0;tf<Iu.length;tf++){var nf=Iu[tf],h2=nf.toLowerCase(),m2=nf[0].toUpperCase()+nf.slice(1);la(h2,"on"+m2)}la($m,"onAnimationEnd"),la(qm,"onAnimationIteration"),la(Fm,"onAnimationStart"),la("dblclick","onDoubleClick"),la("focusin","onFocus"),la("focusout","onBlur"),la(_k,"onTransitionRun"),la(Ok,"onTransitionStart"),la(Dk,"onTransitionCancel"),la(Gm,"onTransitionEnd"),Vn("onMouseEnter",["mouseout","mouseover"]),Vn("onMouseLeave",["mouseout","mouseover"]),Vn("onPointerEnter",["pointerout","pointerover"]),Vn("onPointerLeave",["pointerout","pointerover"]),un("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),un("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),un("onBeforeInput",["compositionend","keypress","textInput","paste"]),un("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),un("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Jl="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(" "),g2=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Jl));function fv(t,i){i=(i&4)!==0;for(var l=0;l<t.length;l++){var c=t[l],h=c.event;c=c.listeners;e:{var v=void 0;if(i)for(var w=c.length-1;0<=w;w--){var A=c[w],z=A.instance,ee=A.currentTarget;if(A=A.listener,z!==v&&h.isPropagationStopped())break e;v=A,h.currentTarget=ee;try{v(h)}catch(re){is(re)}h.currentTarget=null,v=z}else for(w=0;w<c.length;w++){if(A=c[w],z=A.instance,ee=A.currentTarget,A=A.listener,z!==v&&h.isPropagationStopped())break e;v=A,h.currentTarget=ee;try{v(h)}catch(re){is(re)}h.currentTarget=null,v=z}}}}function $e(t,i){var l=i[Na];l===void 0&&(l=i[Na]=new Set);var c=t+"__bubble";l.has(c)||(pv(i,t,2,!1),l.add(c))}function af(t,i,l){var c=0;i&&(c|=4),pv(l,t,c,i)}var Fs="_reactListening"+Math.random().toString(36).slice(2);function rf(t){if(!t[Fs]){t[Fs]=!0,vn.forEach(function(l){l!=="selectionchange"&&(g2.has(l)||af(l,!1,t),af(l,!0,t))});var i=t.nodeType===9?t:t.ownerDocument;i===null||i[Fs]||(i[Fs]=!0,af("selectionchange",!1,i))}}function pv(t,i,l,c){switch($v(i)){case 2:var h=F2;break;case 8:h=G2;break;default:h=bf}l=h.bind(null,i,l,t),h=void 0,!Cu||i!=="touchstart"&&i!=="touchmove"&&i!=="wheel"||(h=!0),c?h!==void 0?t.addEventListener(i,l,{capture:!0,passive:h}):t.addEventListener(i,l,!0):h!==void 0?t.addEventListener(i,l,{passive:h}):t.addEventListener(i,l,!1)}function lf(t,i,l,c,h){var v=c;if((i&1)===0&&(i&2)===0&&c!==null)e:for(;;){if(c===null)return;var w=c.tag;if(w===3||w===4){var A=c.stateNode.containerInfo;if(A===h)break;if(w===4)for(w=c.return;w!==null;){var z=w.tag;if((z===3||z===4)&&w.stateNode.containerInfo===h)return;w=w.return}for(;A!==null;){if(w=Ra(A),w===null)return;if(z=w.tag,z===5||z===6||z===26||z===27){c=v=w;continue e}A=A.parentNode}}c=c.return}vm(function(){var ee=v,re=Su(l),ce=[];e:{var te=Vm.get(t);if(te!==void 0){var ne=ts,xe=t;switch(t){case"keypress":if(Jo(l)===0)break e;case"keydown":case"keyup":ne=ck;break;case"focusin":xe="focus",ne=Tu;break;case"focusout":xe="blur",ne=Tu;break;case"beforeblur":case"afterblur":ne=Tu;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":ne=wm;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":ne=XS;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":ne=fk;break;case $m:case qm:case Fm:ne=ek;break;case Gm:ne=hk;break;case"scroll":case"scrollend":ne=KS;break;case"wheel":ne=gk;break;case"copy":case"cut":case"paste":ne=nk;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":ne=km;break;case"toggle":case"beforetoggle":ne=vk}var je=(i&4)!==0,dt=!je&&(t==="scroll"||t==="scrollend"),Y=je?te!==null?te+"Capture":null:te;je=[];for(var $=ee,J;$!==null;){var oe=$;if(J=oe.stateNode,oe=oe.tag,oe!==5&&oe!==26&&oe!==27||J===null||Y===null||(oe=wl($,Y),oe!=null&&je.push(eo($,oe,J))),dt)break;$=$.return}0<je.length&&(te=new ne(te,xe,null,l,re),ce.push({event:te,listeners:je}))}}if((i&7)===0){e:{if(te=t==="mouseover"||t==="pointerover",ne=t==="mouseout"||t==="pointerout",te&&l!==wu&&(xe=l.relatedTarget||l.fromElement)&&(Ra(xe)||xe[rn]))break e;if((ne||te)&&(te=re.window===re?re:(te=re.ownerDocument)?te.defaultView||te.parentWindow:window,ne?(xe=l.relatedTarget||l.toElement,ne=ee,xe=xe?Ra(xe):null,xe!==null&&(dt=s(xe),je=xe.tag,xe!==dt||je!==5&&je!==27&&je!==6)&&(xe=null)):(ne=null,xe=ee),ne!==xe)){if(je=wm,oe="onMouseLeave",Y="onMouseEnter",$="mouse",(t==="pointerout"||t==="pointerover")&&(je=km,oe="onPointerLeave",Y="onPointerEnter",$="pointer"),dt=ne==null?te:cn(ne),J=xe==null?te:cn(xe),te=new je(oe,$+"leave",ne,l,re),te.target=dt,te.relatedTarget=J,oe=null,Ra(re)===ee&&(je=new je(Y,$+"enter",xe,l,re),je.target=J,je.relatedTarget=dt,oe=je),dt=oe,ne&&xe)t:{for(je=y2,Y=ne,$=xe,J=0,oe=Y;oe;oe=je(oe))J++;oe=0;for(var Ce=$;Ce;Ce=je(Ce))oe++;for(;0<J-oe;)Y=je(Y),J--;for(;0<oe-J;)$=je($),oe--;for(;J--;){if(Y===$||$!==null&&Y===$.alternate){je=Y;break t}Y=je(Y),$=je($)}je=null}else je=null;ne!==null&&hv(ce,te,ne,je,!1),xe!==null&&dt!==null&&hv(ce,dt,xe,je,!0)}}e:{if(te=ee?cn(ee):window,ne=te.nodeName&&te.nodeName.toLowerCase(),ne==="select"||ne==="input"&&te.type==="file")var Ze=_m;else if(Nm(te))if(Om)Ze=Tk;else{Ze=Ak;var be=Ek}else ne=te.nodeName,!ne||ne.toLowerCase()!=="input"||te.type!=="checkbox"&&te.type!=="radio"?ee&&bu(ee.elementType)&&(Ze=_m):Ze=jk;if(Ze&&(Ze=Ze(t,ee))){Rm(ce,Ze,l,re);break e}be&&be(t,te,ee),t==="focusout"&&ee&&te.type==="number"&&ee.memoizedProps.value!=null&&xu(te,"number",te.value)}switch(be=ee?cn(ee):window,t){case"focusin":(Nm(be)||be.contentEditable==="true")&&(Cr=be,Mu=ee,Nl=null);break;case"focusout":Nl=Mu=Cr=null;break;case"mousedown":Lu=!0;break;case"contextmenu":case"mouseup":case"dragend":Lu=!1,Bm(ce,l,re);break;case"selectionchange":if(Rk)break;case"keydown":case"keyup":Bm(ce,l,re)}var Le;if(Ru)e:{switch(t){case"compositionstart":var Ge="onCompositionStart";break e;case"compositionend":Ge="onCompositionEnd";break e;case"compositionupdate":Ge="onCompositionUpdate";break e}Ge=void 0}else kr?jm(t,l)&&(Ge="onCompositionEnd"):t==="keydown"&&l.keyCode===229&&(Ge="onCompositionStart");Ge&&(Cm&&l.locale!=="ko"&&(kr||Ge!=="onCompositionStart"?Ge==="onCompositionEnd"&&kr&&(Le=xm()):(ii=re,Eu="value"in ii?ii.value:ii.textContent,kr=!0)),be=Gs(ee,Ge),0<be.length&&(Ge=new Sm(Ge,t,null,l,re),ce.push({event:Ge,listeners:be}),Le?Ge.data=Le:(Le=Tm(l),Le!==null&&(Ge.data=Le)))),(Le=bk?wk(t,l):Sk(t,l))&&(Ge=Gs(ee,"onBeforeInput"),0<Ge.length&&(be=new Sm("onBeforeInput","beforeinput",null,l,re),ce.push({event:be,listeners:Ge}),be.data=Le)),p2(ce,t,ee,l,re)}fv(ce,i)})}function eo(t,i,l){return{instance:t,listener:i,currentTarget:l}}function Gs(t,i){for(var l=i+"Capture",c=[];t!==null;){var h=t,v=h.stateNode;if(h=h.tag,h!==5&&h!==26&&h!==27||v===null||(h=wl(t,l),h!=null&&c.unshift(eo(t,h,v)),h=wl(t,i),h!=null&&c.push(eo(t,h,v))),t.tag===3)return c;t=t.return}return[]}function y2(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function hv(t,i,l,c,h){for(var v=i._reactName,w=[];l!==null&&l!==c;){var A=l,z=A.alternate,ee=A.stateNode;if(A=A.tag,z!==null&&z===c)break;A!==5&&A!==26&&A!==27||ee===null||(z=ee,h?(ee=wl(l,v),ee!=null&&w.unshift(eo(l,ee,z))):h||(ee=wl(l,v),ee!=null&&w.push(eo(l,ee,z)))),l=l.return}w.length!==0&&t.push({event:i,listeners:w})}var v2=/\r\n?/g,x2=/\u0000|\uFFFD/g;function mv(t){return(typeof t=="string"?t:""+t).replace(v2,`
|
|
50
|
+
`).replace(x2,"")}function gv(t,i){return i=mv(i),mv(t)===i}function ut(t,i,l,c,h,v){switch(l){case"children":typeof c=="string"?i==="body"||i==="textarea"&&c===""||br(t,c):(typeof c=="number"||typeof c=="bigint")&&i!=="body"&&br(t,""+c);break;case"className":Bi(t,"class",c);break;case"tabIndex":Bi(t,"tabindex",c);break;case"dir":case"role":case"viewBox":case"width":case"height":Bi(t,l,c);break;case"style":gm(t,c,v);break;case"data":if(i!=="object"){Bi(t,"data",c);break}case"src":case"href":if(c===""&&(i!=="a"||l!=="href")){t.removeAttribute(l);break}if(c==null||typeof c=="function"||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Xo(""+c),t.setAttribute(l,c);break;case"action":case"formAction":if(typeof c=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof v=="function"&&(l==="formAction"?(i!=="input"&&ut(t,i,"name",h.name,h,null),ut(t,i,"formEncType",h.formEncType,h,null),ut(t,i,"formMethod",h.formMethod,h,null),ut(t,i,"formTarget",h.formTarget,h,null)):(ut(t,i,"encType",h.encType,h,null),ut(t,i,"method",h.method,h,null),ut(t,i,"target",h.target,h,null)));if(c==null||typeof c=="symbol"||typeof c=="boolean"){t.removeAttribute(l);break}c=Xo(""+c),t.setAttribute(l,c);break;case"onClick":c!=null&&(t.onclick=Oa);break;case"onScroll":c!=null&&$e("scroll",t);break;case"onScrollEnd":c!=null&&$e("scrollend",t);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"multiple":t.multiple=c&&typeof c!="function"&&typeof c!="symbol";break;case"muted":t.muted=c&&typeof c!="function"&&typeof c!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(c==null||typeof c=="function"||typeof c=="boolean"||typeof c=="symbol"){t.removeAttribute("xlink:href");break}l=Xo(""+c),t.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""+c):t.removeAttribute(l);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":c&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":c===!0?t.setAttribute(l,""):c!==!1&&c!=null&&typeof c!="function"&&typeof c!="symbol"?t.setAttribute(l,c):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":c!=null&&typeof c!="function"&&typeof c!="symbol"&&!isNaN(c)&&1<=c?t.setAttribute(l,c):t.removeAttribute(l);break;case"rowSpan":case"start":c==null||typeof c=="function"||typeof c=="symbol"||isNaN(c)?t.removeAttribute(l):t.setAttribute(l,c);break;case"popover":$e("beforetoggle",t),$e("toggle",t),dn(t,"popover",c);break;case"xlinkActuate":xn(t,"http://www.w3.org/1999/xlink","xlink:actuate",c);break;case"xlinkArcrole":xn(t,"http://www.w3.org/1999/xlink","xlink:arcrole",c);break;case"xlinkRole":xn(t,"http://www.w3.org/1999/xlink","xlink:role",c);break;case"xlinkShow":xn(t,"http://www.w3.org/1999/xlink","xlink:show",c);break;case"xlinkTitle":xn(t,"http://www.w3.org/1999/xlink","xlink:title",c);break;case"xlinkType":xn(t,"http://www.w3.org/1999/xlink","xlink:type",c);break;case"xmlBase":xn(t,"http://www.w3.org/XML/1998/namespace","xml:base",c);break;case"xmlLang":xn(t,"http://www.w3.org/XML/1998/namespace","xml:lang",c);break;case"xmlSpace":xn(t,"http://www.w3.org/XML/1998/namespace","xml:space",c);break;case"is":dn(t,"is",c);break;case"innerText":case"textContent":break;default:(!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N")&&(l=WS.get(l)||l,dn(t,l,c))}}function of(t,i,l,c,h,v){switch(l){case"style":gm(t,c,v);break;case"dangerouslySetInnerHTML":if(c!=null){if(typeof c!="object"||!("__html"in c))throw Error(r(61));if(l=c.__html,l!=null){if(h.children!=null)throw Error(r(60));t.innerHTML=l}}break;case"children":typeof c=="string"?br(t,c):(typeof c=="number"||typeof c=="bigint")&&br(t,""+c);break;case"onScroll":c!=null&&$e("scroll",t);break;case"onScrollEnd":c!=null&&$e("scrollend",t);break;case"onClick":c!=null&&(t.onclick=Oa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ma.hasOwnProperty(l))e:{if(l[0]==="o"&&l[1]==="n"&&(h=l.endsWith("Capture"),i=l.slice(2,h?l.length-7:void 0),v=t[_e]||null,v=v!=null?v[l]:null,typeof v=="function"&&t.removeEventListener(i,v,h),typeof c=="function")){typeof v!="function"&&v!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(i,c,h);break e}l in t?t[l]=c:c===!0?t.setAttribute(l,""):dn(t,l,c)}}}function nn(t,i,l){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":$e("error",t),$e("load",t);var c=!1,h=!1,v;for(v in l)if(l.hasOwnProperty(v)){var w=l[v];if(w!=null)switch(v){case"src":c=!0;break;case"srcSet":h=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:ut(t,i,v,w,l,null)}}h&&ut(t,i,"srcSet",l.srcSet,l,null),c&&ut(t,i,"src",l.src,l,null);return;case"input":$e("invalid",t);var A=v=w=h=null,z=null,ee=null;for(c in l)if(l.hasOwnProperty(c)){var re=l[c];if(re!=null)switch(c){case"name":h=re;break;case"type":w=re;break;case"checked":z=re;break;case"defaultChecked":ee=re;break;case"value":v=re;break;case"defaultValue":A=re;break;case"children":case"dangerouslySetInnerHTML":if(re!=null)throw Error(r(137,i));break;default:ut(t,i,c,re,l,null)}}fm(t,v,A,z,ee,w,h,!1);return;case"select":$e("invalid",t),c=w=v=null;for(h in l)if(l.hasOwnProperty(h)&&(A=l[h],A!=null))switch(h){case"value":v=A;break;case"defaultValue":w=A;break;case"multiple":c=A;default:ut(t,i,h,A,l,null)}i=v,l=w,t.multiple=!!c,i!=null?xr(t,!!c,i,!1):l!=null&&xr(t,!!c,l,!0);return;case"textarea":$e("invalid",t),v=h=c=null;for(w in l)if(l.hasOwnProperty(w)&&(A=l[w],A!=null))switch(w){case"value":c=A;break;case"defaultValue":h=A;break;case"children":v=A;break;case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(91));break;default:ut(t,i,w,A,l,null)}hm(t,c,h,v);return;case"option":for(z in l)if(l.hasOwnProperty(z)&&(c=l[z],c!=null))switch(z){case"selected":t.selected=c&&typeof c!="function"&&typeof c!="symbol";break;default:ut(t,i,z,c,l,null)}return;case"dialog":$e("beforetoggle",t),$e("toggle",t),$e("cancel",t),$e("close",t);break;case"iframe":case"object":$e("load",t);break;case"video":case"audio":for(c=0;c<Jl.length;c++)$e(Jl[c],t);break;case"image":$e("error",t),$e("load",t);break;case"details":$e("toggle",t);break;case"embed":case"source":case"link":$e("error",t),$e("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ee in l)if(l.hasOwnProperty(ee)&&(c=l[ee],c!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,i));default:ut(t,i,ee,c,l,null)}return;default:if(bu(i)){for(re in l)l.hasOwnProperty(re)&&(c=l[re],c!==void 0&&of(t,i,re,c,l,void 0));return}}for(A in l)l.hasOwnProperty(A)&&(c=l[A],c!=null&&ut(t,i,A,c,l,null))}function b2(t,i,l,c){switch(i){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var h=null,v=null,w=null,A=null,z=null,ee=null,re=null;for(ne in l){var ce=l[ne];if(l.hasOwnProperty(ne)&&ce!=null)switch(ne){case"checked":break;case"value":break;case"defaultValue":z=ce;default:c.hasOwnProperty(ne)||ut(t,i,ne,null,c,ce)}}for(var te in c){var ne=c[te];if(ce=l[te],c.hasOwnProperty(te)&&(ne!=null||ce!=null))switch(te){case"type":v=ne;break;case"name":h=ne;break;case"checked":ee=ne;break;case"defaultChecked":re=ne;break;case"value":w=ne;break;case"defaultValue":A=ne;break;case"children":case"dangerouslySetInnerHTML":if(ne!=null)throw Error(r(137,i));break;default:ne!==ce&&ut(t,i,te,ne,c,ce)}}vu(t,w,A,z,ee,re,v,h);return;case"select":ne=w=A=te=null;for(v in l)if(z=l[v],l.hasOwnProperty(v)&&z!=null)switch(v){case"value":break;case"multiple":ne=z;default:c.hasOwnProperty(v)||ut(t,i,v,null,c,z)}for(h in c)if(v=c[h],z=l[h],c.hasOwnProperty(h)&&(v!=null||z!=null))switch(h){case"value":te=v;break;case"defaultValue":A=v;break;case"multiple":w=v;default:v!==z&&ut(t,i,h,v,c,z)}i=A,l=w,c=ne,te!=null?xr(t,!!l,te,!1):!!c!=!!l&&(i!=null?xr(t,!!l,i,!0):xr(t,!!l,l?[]:"",!1));return;case"textarea":ne=te=null;for(A in l)if(h=l[A],l.hasOwnProperty(A)&&h!=null&&!c.hasOwnProperty(A))switch(A){case"value":break;case"children":break;default:ut(t,i,A,null,c,h)}for(w in c)if(h=c[w],v=l[w],c.hasOwnProperty(w)&&(h!=null||v!=null))switch(w){case"value":te=h;break;case"defaultValue":ne=h;break;case"children":break;case"dangerouslySetInnerHTML":if(h!=null)throw Error(r(91));break;default:h!==v&&ut(t,i,w,h,c,v)}pm(t,te,ne);return;case"option":for(var xe in l)if(te=l[xe],l.hasOwnProperty(xe)&&te!=null&&!c.hasOwnProperty(xe))switch(xe){case"selected":t.selected=!1;break;default:ut(t,i,xe,null,c,te)}for(z in c)if(te=c[z],ne=l[z],c.hasOwnProperty(z)&&te!==ne&&(te!=null||ne!=null))switch(z){case"selected":t.selected=te&&typeof te!="function"&&typeof te!="symbol";break;default:ut(t,i,z,te,c,ne)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var je in l)te=l[je],l.hasOwnProperty(je)&&te!=null&&!c.hasOwnProperty(je)&&ut(t,i,je,null,c,te);for(ee in c)if(te=c[ee],ne=l[ee],c.hasOwnProperty(ee)&&te!==ne&&(te!=null||ne!=null))switch(ee){case"children":case"dangerouslySetInnerHTML":if(te!=null)throw Error(r(137,i));break;default:ut(t,i,ee,te,c,ne)}return;default:if(bu(i)){for(var dt in l)te=l[dt],l.hasOwnProperty(dt)&&te!==void 0&&!c.hasOwnProperty(dt)&&of(t,i,dt,void 0,c,te);for(re in c)te=c[re],ne=l[re],!c.hasOwnProperty(re)||te===ne||te===void 0&&ne===void 0||of(t,i,re,te,c,ne);return}}for(var Y in l)te=l[Y],l.hasOwnProperty(Y)&&te!=null&&!c.hasOwnProperty(Y)&&ut(t,i,Y,null,c,te);for(ce in c)te=c[ce],ne=l[ce],!c.hasOwnProperty(ce)||te===ne||te==null&&ne==null||ut(t,i,ce,te,c,ne)}function yv(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function w2(){if(typeof performance.getEntriesByType=="function"){for(var t=0,i=0,l=performance.getEntriesByType("resource"),c=0;c<l.length;c++){var h=l[c],v=h.transferSize,w=h.initiatorType,A=h.duration;if(v&&A&&yv(w)){for(w=0,A=h.responseEnd,c+=1;c<l.length;c++){var z=l[c],ee=z.startTime;if(ee>A)break;var re=z.transferSize,ce=z.initiatorType;re&&yv(ce)&&(z=z.responseEnd,w+=re*(z<A?1:(A-ee)/(z-ee)))}if(--c,i+=8*(v+w)/(h.duration/1e3),t++,10<t)break}}if(0<t)return i/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}var sf=null,cf=null;function Vs(t){return t.nodeType===9?t:t.ownerDocument}function vv(t){switch(t){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function xv(t,i){if(t===0)switch(i){case"svg":return 1;case"math":return 2;default:return 0}return t===1&&i==="foreignObject"?0:t}function uf(t,i){return t==="textarea"||t==="noscript"||typeof i.children=="string"||typeof i.children=="number"||typeof i.children=="bigint"||typeof i.dangerouslySetInnerHTML=="object"&&i.dangerouslySetInnerHTML!==null&&i.dangerouslySetInnerHTML.__html!=null}var df=null;function S2(){var t=window.event;return t&&t.type==="popstate"?t===df?!1:(df=t,!0):(df=null,!1)}var bv=typeof setTimeout=="function"?setTimeout:void 0,k2=typeof clearTimeout=="function"?clearTimeout:void 0,wv=typeof Promise=="function"?Promise:void 0,C2=typeof queueMicrotask=="function"?queueMicrotask:typeof wv<"u"?function(t){return wv.resolve(null).then(t).catch(E2)}:bv;function E2(t){setTimeout(function(){throw t})}function wi(t){return t==="head"}function Sv(t,i){var l=i,c=0;do{var h=l.nextSibling;if(t.removeChild(l),h&&h.nodeType===8)if(l=h.data,l==="/$"||l==="/&"){if(c===0){t.removeChild(h),Xr(i);return}c--}else if(l==="$"||l==="$?"||l==="$~"||l==="$!"||l==="&")c++;else if(l==="html")to(t.ownerDocument.documentElement);else if(l==="head"){l=t.ownerDocument.head,to(l);for(var v=l.firstChild;v;){var w=v.nextSibling,A=v.nodeName;v[ha]||A==="SCRIPT"||A==="STYLE"||A==="LINK"&&v.rel.toLowerCase()==="stylesheet"||l.removeChild(v),v=w}}else l==="body"&&to(t.ownerDocument.body);l=h}while(l);Xr(i)}function kv(t,i){var l=t;t=0;do{var c=l.nextSibling;if(l.nodeType===1?i?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(i?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),c&&c.nodeType===8)if(l=c.data,l==="/$"){if(t===0)break;t--}else l!=="$"&&l!=="$?"&&l!=="$~"&&l!=="$!"||t++;l=c}while(l)}function ff(t){var i=t.firstChild;for(i&&i.nodeType===10&&(i=i.nextSibling);i;){var l=i;switch(i=i.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":ff(l),vr(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function A2(t,i,l,c){for(;t.nodeType===1;){var h=l;if(t.nodeName.toLowerCase()!==i.toLowerCase()){if(!c&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(c){if(!t[ha])switch(i){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(v=t.getAttribute("rel"),v==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(v!==h.rel||t.getAttribute("href")!==(h.href==null||h.href===""?null:h.href)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin)||t.getAttribute("title")!==(h.title==null?null:h.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(v=t.getAttribute("src"),(v!==(h.src==null?null:h.src)||t.getAttribute("type")!==(h.type==null?null:h.type)||t.getAttribute("crossorigin")!==(h.crossOrigin==null?null:h.crossOrigin))&&v&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(i==="input"&&t.type==="hidden"){var v=h.name==null?null:""+h.name;if(h.type==="hidden"&&t.getAttribute("name")===v)return t}else return t;if(t=ea(t.nextSibling),t===null)break}return null}function j2(t,i,l){if(i==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=ea(t.nextSibling),t===null))return null;return t}function Cv(t,i){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!i||(t=ea(t.nextSibling),t===null))return null;return t}function pf(t){return t.data==="$?"||t.data==="$~"}function hf(t){return t.data==="$!"||t.data==="$?"&&t.ownerDocument.readyState!=="loading"}function T2(t,i){var l=t.ownerDocument;if(t.data==="$~")t._reactRetry=i;else if(t.data!=="$?"||l.readyState!=="loading")i();else{var c=function(){i(),l.removeEventListener("DOMContentLoaded",c)};l.addEventListener("DOMContentLoaded",c),t._reactRetry=c}}function ea(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==="$?"||i==="$~"||i==="&"||i==="F!"||i==="F")break;if(i==="/$"||i==="/&")return null}}return t}var mf=null;function Ev(t){t=t.nextSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="/$"||l==="/&"){if(i===0)return ea(t.nextSibling);i--}else l!=="$"&&l!=="$!"&&l!=="$?"&&l!=="$~"&&l!=="&"||i++}t=t.nextSibling}return null}function Av(t){t=t.previousSibling;for(var i=0;t;){if(t.nodeType===8){var l=t.data;if(l==="$"||l==="$!"||l==="$?"||l==="$~"||l==="&"){if(i===0)return t;i--}else l!=="/$"&&l!=="/&"||i++}t=t.previousSibling}return null}function jv(t,i,l){switch(i=Vs(l),t){case"html":if(t=i.documentElement,!t)throw Error(r(452));return t;case"head":if(t=i.head,!t)throw Error(r(453));return t;case"body":if(t=i.body,!t)throw Error(r(454));return t;default:throw Error(r(451))}}function to(t){for(var i=t.attributes;i.length;)t.removeAttributeNode(i[0]);vr(t)}var ta=new Map,Tv=new Set;function Ws(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}var Ya=Z.d;Z.d={f:N2,r:R2,D:_2,C:O2,L:D2,m:M2,X:z2,S:L2,M:I2};function N2(){var t=Ya.f(),i=Ps();return t||i}function R2(t){var i=Wt(t);i!==null&&i.tag===5&&i.type==="form"?Gg(i):Ya.r(t)}var Yr=typeof document>"u"?null:document;function Nv(t,i,l){var c=Yr;if(c&&typeof i=="string"&&i){var h=Wn(i);h='link[rel="'+t+'"][href="'+h+'"]',typeof l=="string"&&(h+='[crossorigin="'+l+'"]'),Tv.has(h)||(Tv.add(h),t={rel:t,crossOrigin:l,href:i},c.querySelector(h)===null&&(i=c.createElement("link"),nn(i,"link",t),At(i),c.head.appendChild(i)))}}function _2(t){Ya.D(t),Nv("dns-prefetch",t,null)}function O2(t,i){Ya.C(t,i),Nv("preconnect",t,i)}function D2(t,i,l){Ya.L(t,i,l);var c=Yr;if(c&&t&&i){var h='link[rel="preload"][as="'+Wn(i)+'"]';i==="image"&&l&&l.imageSrcSet?(h+='[imagesrcset="'+Wn(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(h+='[imagesizes="'+Wn(l.imageSizes)+'"]')):h+='[href="'+Wn(t)+'"]';var v=h;switch(i){case"style":v=Kr(t);break;case"script":v=Qr(t)}ta.has(v)||(t=g({rel:"preload",href:i==="image"&&l&&l.imageSrcSet?void 0:t,as:i},l),ta.set(v,t),c.querySelector(h)!==null||i==="style"&&c.querySelector(no(v))||i==="script"&&c.querySelector(ao(v))||(i=c.createElement("link"),nn(i,"link",t),At(i),c.head.appendChild(i)))}}function M2(t,i){Ya.m(t,i);var l=Yr;if(l&&t){var c=i&&typeof i.as=="string"?i.as:"script",h='link[rel="modulepreload"][as="'+Wn(c)+'"][href="'+Wn(t)+'"]',v=h;switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":v=Qr(t)}if(!ta.has(v)&&(t=g({rel:"modulepreload",href:t},i),ta.set(v,t),l.querySelector(h)===null)){switch(c){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(ao(v)))return}c=l.createElement("link"),nn(c,"link",t),At(c),l.head.appendChild(c)}}}function L2(t,i,l){Ya.S(t,i,l);var c=Yr;if(c&&t){var h=Gn(c).hoistableStyles,v=Kr(t);i=i||"default";var w=h.get(v);if(!w){var A={loading:0,preload:null};if(w=c.querySelector(no(v)))A.loading=5;else{t=g({rel:"stylesheet",href:t,"data-precedence":i},l),(l=ta.get(v))&&gf(t,l);var z=w=c.createElement("link");At(z),nn(z,"link",t),z._p=new Promise(function(ee,re){z.onload=ee,z.onerror=re}),z.addEventListener("load",function(){A.loading|=1}),z.addEventListener("error",function(){A.loading|=2}),A.loading|=4,Ys(w,i,c)}w={type:"stylesheet",instance:w,count:1,state:A},h.set(v,w)}}}function z2(t,i){Ya.X(t,i);var l=Yr;if(l&&t){var c=Gn(l).hoistableScripts,h=Qr(t),v=c.get(h);v||(v=l.querySelector(ao(h)),v||(t=g({src:t,async:!0},i),(i=ta.get(h))&&yf(t,i),v=l.createElement("script"),At(v),nn(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(h,v))}}function I2(t,i){Ya.M(t,i);var l=Yr;if(l&&t){var c=Gn(l).hoistableScripts,h=Qr(t),v=c.get(h);v||(v=l.querySelector(ao(h)),v||(t=g({src:t,async:!0,type:"module"},i),(i=ta.get(h))&&yf(t,i),v=l.createElement("script"),At(v),nn(v,"link",t),l.head.appendChild(v)),v={type:"script",instance:v,count:1,state:null},c.set(h,v))}}function Rv(t,i,l,c){var h=(h=he.current)?Ws(h):null;if(!h)throw Error(r(446));switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(i=Kr(l.href),l=Gn(h).hoistableStyles,c=l.get(i),c||(c={type:"style",instance:null,count:0,state:null},l.set(i,c)),c):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=Kr(l.href);var v=Gn(h).hoistableStyles,w=v.get(t);if(w||(h=h.ownerDocument||h,w={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},v.set(t,w),(v=h.querySelector(no(t)))&&!v._p&&(w.instance=v,w.state.loading=5),ta.has(t)||(l={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy},ta.set(t,l),v||P2(h,t,l,w.state))),i&&c===null)throw Error(r(528,""));return w}if(i&&c!==null)throw Error(r(529,""));return null;case"script":return i=l.async,l=l.src,typeof l=="string"&&i&&typeof i!="function"&&typeof i!="symbol"?(i=Qr(l),l=Gn(h).hoistableScripts,c=l.get(i),c||(c={type:"script",instance:null,count:0,state:null},l.set(i,c)),c):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,t))}}function Kr(t){return'href="'+Wn(t)+'"'}function no(t){return'link[rel="stylesheet"]['+t+"]"}function _v(t){return g({},t,{"data-precedence":t.precedence,precedence:null})}function P2(t,i,l,c){t.querySelector('link[rel="preload"][as="style"]['+i+"]")?c.loading=1:(i=t.createElement("link"),c.preload=i,i.addEventListener("load",function(){return c.loading|=1}),i.addEventListener("error",function(){return c.loading|=2}),nn(i,"link",l),At(i),t.head.appendChild(i))}function Qr(t){return'[src="'+Wn(t)+'"]'}function ao(t){return"script[async]"+t}function Ov(t,i,l){if(i.count++,i.instance===null)switch(i.type){case"style":var c=t.querySelector('style[data-href~="'+Wn(l.href)+'"]');if(c)return i.instance=c,At(c),c;var h=g({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return c=(t.ownerDocument||t).createElement("style"),At(c),nn(c,"style",h),Ys(c,l.precedence,t),i.instance=c;case"stylesheet":h=Kr(l.href);var v=t.querySelector(no(h));if(v)return i.state.loading|=4,i.instance=v,At(v),v;c=_v(l),(h=ta.get(h))&&gf(c,h),v=(t.ownerDocument||t).createElement("link"),At(v);var w=v;return w._p=new Promise(function(A,z){w.onload=A,w.onerror=z}),nn(v,"link",c),i.state.loading|=4,Ys(v,l.precedence,t),i.instance=v;case"script":return v=Qr(l.src),(h=t.querySelector(ao(v)))?(i.instance=h,At(h),h):(c=l,(h=ta.get(v))&&(c=g({},l),yf(c,h)),t=t.ownerDocument||t,h=t.createElement("script"),At(h),nn(h,"link",c),t.head.appendChild(h),i.instance=h);case"void":return null;default:throw Error(r(443,i.type))}else i.type==="stylesheet"&&(i.state.loading&4)===0&&(c=i.instance,i.state.loading|=4,Ys(c,l.precedence,t));return i.instance}function Ys(t,i,l){for(var c=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),h=c.length?c[c.length-1]:null,v=h,w=0;w<c.length;w++){var A=c[w];if(A.dataset.precedence===i)v=A;else if(v!==h)break}v?v.parentNode.insertBefore(t,v.nextSibling):(i=l.nodeType===9?l.head:l,i.insertBefore(t,i.firstChild))}function gf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.title==null&&(t.title=i.title)}function yf(t,i){t.crossOrigin==null&&(t.crossOrigin=i.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=i.referrerPolicy),t.integrity==null&&(t.integrity=i.integrity)}var Ks=null;function Dv(t,i,l){if(Ks===null){var c=new Map,h=Ks=new Map;h.set(l,c)}else h=Ks,c=h.get(l),c||(c=new Map,h.set(l,c));if(c.has(t))return c;for(c.set(t,null),l=l.getElementsByTagName(t),h=0;h<l.length;h++){var v=l[h];if(!(v[ha]||v[we]||t==="link"&&v.getAttribute("rel")==="stylesheet")&&v.namespaceURI!=="http://www.w3.org/2000/svg"){var w=v.getAttribute(i)||"";w=t+w;var A=c.get(w);A?A.push(v):c.set(w,[v])}}return c}function Mv(t,i,l){t=t.ownerDocument||t,t.head.insertBefore(l,i==="title"?t.querySelector("head > title"):null)}function U2(t,i,l){if(l===1||i.itemProp!=null)return!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof i.precedence!="string"||typeof i.href!="string"||i.href==="")break;return!0;case"link":if(typeof i.rel!="string"||typeof i.href!="string"||i.href===""||i.onLoad||i.onError)break;switch(i.rel){case"stylesheet":return t=i.disabled,typeof i.precedence=="string"&&t==null;default:return!0}case"script":if(i.async&&typeof i.async!="function"&&typeof i.async!="symbol"&&!i.onLoad&&!i.onError&&i.src&&typeof i.src=="string")return!0}return!1}function Lv(t){return!(t.type==="stylesheet"&&(t.state.loading&3)===0)}function B2(t,i,l,c){if(l.type==="stylesheet"&&(typeof c.media!="string"||matchMedia(c.media).matches!==!1)&&(l.state.loading&4)===0){if(l.instance===null){var h=Kr(c.href),v=i.querySelector(no(h));if(v){i=v._p,i!==null&&typeof i=="object"&&typeof i.then=="function"&&(t.count++,t=Qs.bind(t),i.then(t,t)),l.state.loading|=4,l.instance=v,At(v);return}v=i.ownerDocument||i,c=_v(c),(h=ta.get(h))&&gf(c,h),v=v.createElement("link"),At(v);var w=v;w._p=new Promise(function(A,z){w.onload=A,w.onerror=z}),nn(v,"link",c),l.instance=v}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,i),(i=l.state.preload)&&(l.state.loading&3)===0&&(t.count++,l=Qs.bind(t),i.addEventListener("load",l),i.addEventListener("error",l))}}var vf=0;function H2(t,i){return t.stylesheets&&t.count===0&&Zs(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var c=setTimeout(function(){if(t.stylesheets&&Zs(t,t.stylesheets),t.unsuspend){var v=t.unsuspend;t.unsuspend=null,v()}},6e4+i);0<t.imgBytes&&vf===0&&(vf=62500*w2());var h=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&Zs(t,t.stylesheets),t.unsuspend)){var v=t.unsuspend;t.unsuspend=null,v()}},(t.imgBytes>vf?50:800)+i);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(c),clearTimeout(h)}}:null}function Qs(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Zs(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}var Xs=null;function Zs(t,i){t.stylesheets=null,t.unsuspend!==null&&(t.count++,Xs=new Map,i.forEach($2,t),Xs=null,Qs.call(t))}function $2(t,i){if(!(i.state.loading&4)){var l=Xs.get(t);if(l)var c=l.get(null);else{l=new Map,Xs.set(t,l);for(var h=t.querySelectorAll("link[data-precedence],style[data-precedence]"),v=0;v<h.length;v++){var w=h[v];(w.nodeName==="LINK"||w.getAttribute("media")!=="not all")&&(l.set(w.dataset.precedence,w),c=w)}c&&l.set(null,c)}h=i.instance,w=h.getAttribute("data-precedence"),v=l.get(w)||c,v===c&&l.set(null,h),l.set(w,h),this.count++,c=Qs.bind(this),h.addEventListener("load",c),h.addEventListener("error",c),v?v.parentNode.insertBefore(h,v.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(h,t.firstChild)),i.state.loading|=4}}var io={$$typeof:R,Provider:null,Consumer:null,_currentValue:ie,_currentValue2:ie,_threadCount:0};function q2(t,i,l,c,h,v,w,A,z){this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=vl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=vl(0),this.hiddenUpdates=vl(null),this.identifierPrefix=c,this.onUncaughtError=h,this.onCaughtError=v,this.onRecoverableError=w,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=z,this.incompleteTransitions=new Map}function zv(t,i,l,c,h,v,w,A,z,ee,re,ce){return t=new q2(t,i,l,w,z,ee,re,ce,A),i=1,v===!0&&(i|=24),v=Rn(3,null,null,i),t.current=v,v.stateNode=t,i=Qu(),i.refCount++,t.pooledCache=i,i.refCount++,v.memoizedState={element:c,isDehydrated:l,cache:i},ed(v),t}function Iv(t){return t?(t=jr,t):jr}function Pv(t,i,l,c,h,v){h=Iv(h),c.context===null?c.context=h:c.pendingContext=h,c=ui(i),c.payload={element:l},v=v===void 0?null:v,v!==null&&(c.callback=v),l=di(t,c,i),l!==null&&(En(l,t,i),zl(l,t,i))}function Uv(t,i){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<i?l:i}}function xf(t,i){Uv(t,i),(t=t.alternate)&&Uv(t,i)}function Bv(t){if(t.tag===13||t.tag===31){var i=Fi(t,67108864);i!==null&&En(i,t,67108864),xf(t,67108864)}}function Hv(t){if(t.tag===13||t.tag===31){var i=Ln();i=ke(i);var l=Fi(t,i);l!==null&&En(l,t,i),xf(t,i)}}var Js=!0;function F2(t,i,l,c){var h=B.T;B.T=null;var v=Z.p;try{Z.p=2,bf(t,i,l,c)}finally{Z.p=v,B.T=h}}function G2(t,i,l,c){var h=B.T;B.T=null;var v=Z.p;try{Z.p=8,bf(t,i,l,c)}finally{Z.p=v,B.T=h}}function bf(t,i,l,c){if(Js){var h=wf(c);if(h===null)lf(t,i,c,ec,l),qv(t,c);else if(W2(h,t,i,l,c))c.stopPropagation();else if(qv(t,c),i&4&&-1<V2.indexOf(t)){for(;h!==null;){var v=Wt(h);if(v!==null)switch(v.tag){case 3:if(v=v.stateNode,v.current.memoizedState.isDehydrated){var w=Ta(v.pendingLanes);if(w!==0){var A=v;for(A.pendingLanes|=2,A.entangledLanes|=2;w;){var z=1<<31-Se(w);A.entanglements[1]|=z,w&=~z}xa(v),(tt&6)===0&&(zs=it()+500,Zl(0))}}break;case 31:case 13:A=Fi(v,2),A!==null&&En(A,v,2),Ps(),xf(v,2)}if(v=wf(c),v===null&&lf(t,i,c,ec,l),v===h)break;h=v}h!==null&&c.stopPropagation()}else lf(t,i,c,null,l)}}function wf(t){return t=Su(t),Sf(t)}var ec=null;function Sf(t){if(ec=null,t=Ra(t),t!==null){var i=s(t);if(i===null)t=null;else{var l=i.tag;if(l===13){if(t=u(i),t!==null)return t;t=null}else if(l===31){if(t=d(i),t!==null)return t;t=null}else if(l===3){if(i.stateNode.current.memoizedState.isDehydrated)return i.tag===3?i.stateNode.containerInfo:null;t=null}else i!==t&&(t=null)}}return ec=t,null}function $v(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(fe()){case H:return 2;case le:return 8;case me:case ye:return 32;case I:return 268435456;default:return 32}default:return 32}}var kf=!1,Si=null,ki=null,Ci=null,ro=new Map,lo=new Map,Ei=[],V2="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function qv(t,i){switch(t){case"focusin":case"focusout":Si=null;break;case"dragenter":case"dragleave":ki=null;break;case"mouseover":case"mouseout":Ci=null;break;case"pointerover":case"pointerout":ro.delete(i.pointerId);break;case"gotpointercapture":case"lostpointercapture":lo.delete(i.pointerId)}}function oo(t,i,l,c,h,v){return t===null||t.nativeEvent!==v?(t={blockedOn:i,domEventName:l,eventSystemFlags:c,nativeEvent:v,targetContainers:[h]},i!==null&&(i=Wt(i),i!==null&&Bv(i)),t):(t.eventSystemFlags|=c,i=t.targetContainers,h!==null&&i.indexOf(h)===-1&&i.push(h),t)}function W2(t,i,l,c,h){switch(i){case"focusin":return Si=oo(Si,t,i,l,c,h),!0;case"dragenter":return ki=oo(ki,t,i,l,c,h),!0;case"mouseover":return Ci=oo(Ci,t,i,l,c,h),!0;case"pointerover":var v=h.pointerId;return ro.set(v,oo(ro.get(v)||null,t,i,l,c,h)),!0;case"gotpointercapture":return v=h.pointerId,lo.set(v,oo(lo.get(v)||null,t,i,l,c,h)),!0}return!1}function Fv(t){var i=Ra(t.target);if(i!==null){var l=s(i);if(l!==null){if(i=l.tag,i===13){if(i=u(l),i!==null){t.blockedOn=i,lt(t.priority,function(){Hv(l)});return}}else if(i===31){if(i=d(l),i!==null){t.blockedOn=i,lt(t.priority,function(){Hv(l)});return}}else if(i===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function tc(t){if(t.blockedOn!==null)return!1;for(var i=t.targetContainers;0<i.length;){var l=wf(t.nativeEvent);if(l===null){l=t.nativeEvent;var c=new l.constructor(l.type,l);wu=c,l.target.dispatchEvent(c),wu=null}else return i=Wt(l),i!==null&&Bv(i),t.blockedOn=l,!1;i.shift()}return!0}function Gv(t,i,l){tc(t)&&l.delete(i)}function Y2(){kf=!1,Si!==null&&tc(Si)&&(Si=null),ki!==null&&tc(ki)&&(ki=null),Ci!==null&&tc(Ci)&&(Ci=null),ro.forEach(Gv),lo.forEach(Gv)}function nc(t,i){t.blockedOn===i&&(t.blockedOn=null,kf||(kf=!0,e.unstable_scheduleCallback(e.unstable_NormalPriority,Y2)))}var ac=null;function Vv(t){ac!==t&&(ac=t,e.unstable_scheduleCallback(e.unstable_NormalPriority,function(){ac===t&&(ac=null);for(var i=0;i<t.length;i+=3){var l=t[i],c=t[i+1],h=t[i+2];if(typeof c!="function"){if(Sf(c||l)===null)continue;break}var v=Wt(l);v!==null&&(t.splice(i,3),i-=3,bd(v,{pending:!0,data:h,method:l.method,action:c},c,h))}}))}function Xr(t){function i(z){return nc(z,t)}Si!==null&&nc(Si,t),ki!==null&&nc(ki,t),Ci!==null&&nc(Ci,t),ro.forEach(i),lo.forEach(i);for(var l=0;l<Ei.length;l++){var c=Ei[l];c.blockedOn===t&&(c.blockedOn=null)}for(;0<Ei.length&&(l=Ei[0],l.blockedOn===null);)Fv(l),l.blockedOn===null&&Ei.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(c=0;c<l.length;c+=3){var h=l[c],v=l[c+1],w=h[_e]||null;if(typeof v=="function")w||Vv(l);else if(w){var A=null;if(v&&v.hasAttribute("formAction")){if(h=v,w=v[_e]||null)A=w.formAction;else if(Sf(h)!==null)continue}else A=w.action;typeof A=="function"?l[c+1]=A:(l.splice(c,3),c-=3),Vv(l)}}}function Wv(){function t(v){v.canIntercept&&v.info==="react-transition"&&v.intercept({handler:function(){return new Promise(function(w){return h=w})},focusReset:"manual",scroll:"manual"})}function i(){h!==null&&(h(),h=null),c||setTimeout(l,20)}function l(){if(!c&&!navigation.transition){var v=navigation.currentEntry;v&&v.url!=null&&navigation.navigate(v.url,{state:v.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var c=!1,h=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",i),navigation.addEventListener("navigateerror",i),setTimeout(l,100),function(){c=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",i),navigation.removeEventListener("navigateerror",i),h!==null&&(h(),h=null)}}}function Cf(t){this._internalRoot=t}ic.prototype.render=Cf.prototype.render=function(t){var i=this._internalRoot;if(i===null)throw Error(r(409));var l=i.current,c=Ln();Pv(l,c,t,i,null,null)},ic.prototype.unmount=Cf.prototype.unmount=function(){var t=this._internalRoot;if(t!==null){this._internalRoot=null;var i=t.containerInfo;Pv(t.current,2,null,t,null,null),Ps(),i[rn]=null}};function ic(t){this._internalRoot=t}ic.prototype.unstable_scheduleHydration=function(t){if(t){var i=Ye();t={blockedOn:null,target:t,priority:i};for(var l=0;l<Ei.length&&i!==0&&i<Ei[l].priority;l++);Ei.splice(l,0,t),l===0&&Fv(t)}};var Yv=n.version;if(Yv!=="19.2.4")throw Error(r(527,Yv,"19.2.4"));Z.findDOMNode=function(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=f(i),t=t!==null?y(t):null,t=t===null?null:t.stateNode,t};var K2={bundleType:0,version:"19.2.4",rendererPackageName:"react-dom",currentDispatcherRef:B,reconcilerVersion:"19.2.4"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var rc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!rc.isDisabled&&rc.supportsFiber)try{Ie=rc.inject(K2),Xe=rc}catch{}}return co.createRoot=function(t,i){if(!o(t))throw Error(r(299));var l=!1,c="",h=ty,v=ny,w=ay;return i!=null&&(i.unstable_strictMode===!0&&(l=!0),i.identifierPrefix!==void 0&&(c=i.identifierPrefix),i.onUncaughtError!==void 0&&(h=i.onUncaughtError),i.onCaughtError!==void 0&&(v=i.onCaughtError),i.onRecoverableError!==void 0&&(w=i.onRecoverableError)),i=zv(t,1,!1,null,null,l,c,null,h,v,w,Wv),t[rn]=i.current,rf(t),new Cf(i)},co.hydrateRoot=function(t,i,l){if(!o(t))throw Error(r(299));var c=!1,h="",v=ty,w=ny,A=ay,z=null;return l!=null&&(l.unstable_strictMode===!0&&(c=!0),l.identifierPrefix!==void 0&&(h=l.identifierPrefix),l.onUncaughtError!==void 0&&(v=l.onUncaughtError),l.onCaughtError!==void 0&&(w=l.onCaughtError),l.onRecoverableError!==void 0&&(A=l.onRecoverableError),l.formState!==void 0&&(z=l.formState)),i=zv(t,1,!0,i,l??null,c,h,z,v,w,A,Wv),i.context=Iv(null),l=i.current,c=Ln(),c=ke(c),h=ui(c),h.callback=null,di(l,h,c),l=c,i.current.lanes=l,Ui(i,l),xa(i),t[rn]=i.current,rf(t),new ic(i)},co.version="19.2.4",co}var i0;function lC(){if(i0)return jf.exports;i0=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(),jf.exports=rC(),jf.exports}var oC=lC();/**
|
|
51
|
+
* react-router v7.17.0
|
|
52
|
+
*
|
|
53
|
+
* Copyright (c) Remix Software Inc.
|
|
54
|
+
*
|
|
55
|
+
* This source code is licensed under the MIT license found in the
|
|
56
|
+
* LICENSE.md file in the root directory of this source tree.
|
|
57
|
+
*
|
|
58
|
+
* @license MIT
|
|
59
|
+
*/var r0="popstate";function l0(e){return typeof e=="object"&&e!=null&&"pathname"in e&&"search"in e&&"hash"in e&&"state"in e&&"key"in e}function sC(e={}){function n(r,o){var f;let s=(f=o.state)==null?void 0:f.masked,{pathname:u,search:d,hash:p}=s||r.location;return Op("",{pathname:u,search:d,hash:p},o.state&&o.state.usr||null,o.state&&o.state.key||"default",s?{pathname:r.location.pathname,search:r.location.search,hash:r.location.hash}:void 0)}function a(r,o){return typeof o=="string"?o:_o(o)}return uC(n,a,null,e)}function Et(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function fa(e,n){if(!e){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function cC(){return Math.random().toString(36).substring(2,10)}function o0(e,n){return{usr:e.state,key:e.key,idx:n,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function Op(e,n,a=null,r,o){return{pathname:typeof e=="string"?e:e.pathname,search:"",hash:"",...typeof n=="string"?cl(n):n,state:a,key:n&&n.key||r||cC(),mask:o}}function _o({pathname:e="/",search:n="",hash:a=""}){return n&&n!=="?"&&(e+=n.charAt(0)==="?"?n:"?"+n),a&&a!=="#"&&(e+=a.charAt(0)==="#"?a:"#"+a),e}function cl(e){let n={};if(e){let a=e.indexOf("#");a>=0&&(n.hash=e.substring(a),e=e.substring(0,a));let r=e.indexOf("?");r>=0&&(n.search=e.substring(r),e=e.substring(0,r)),e&&(n.pathname=e)}return n}function uC(e,n,a,r={}){let{window:o=document.defaultView,v5Compat:s=!1}=r,u=o.history,d="POP",p=null,f=y();f==null&&(f=0,u.replaceState({...u.state,idx:f},""));function y(){return(u.state||{idx:null}).idx}function g(){d="POP";let j=y(),E=j==null?null:j-f;f=j,p&&p({action:d,location:C.location,delta:E})}function x(j,E){d="PUSH";let _=l0(j)?j:Op(C.location,j,E);f=y()+1;let R=o0(_,f),F=C.createHref(_.mask||_);try{u.pushState(R,"",F)}catch(U){if(U instanceof DOMException&&U.name==="DataCloneError")throw U;o.location.assign(F)}s&&p&&p({action:d,location:C.location,delta:1})}function b(j,E){d="REPLACE";let _=l0(j)?j:Op(C.location,j,E);f=y();let R=o0(_,f),F=C.createHref(_.mask||_);u.replaceState(R,"",F),s&&p&&p({action:d,location:C.location,delta:0})}function k(j){return dC(o,j)}let C={get action(){return d},get location(){return e(o,u)},listen(j){if(p)throw new Error("A history only accepts one active listener");return o.addEventListener(r0,g),p=j,()=>{o.removeEventListener(r0,g),p=null}},createHref(j){return n(o,j)},createURL:k,encodeLocation(j){let E=k(j);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:x,replace:b,go(j){return u.go(j)}};return C}function dC(e,n,a=!1){let r="http://localhost";e&&(r=e.location.origin!=="null"?e.location.origin:e.location.href),Et(r,"No window.location.(origin|href) available to create URL");let o=typeof n=="string"?n:_o(n);return o=o.replace(/ $/,"%20"),!a&&o.startsWith("//")&&(o=r+o),new URL(o,r)}function Bx(e,n,a="/"){return fC(e,n,a,!1)}function fC(e,n,a,r,o){let s=typeof n=="string"?cl(n):n,u=Za(s.pathname||"/",a);if(u==null)return null;let d=pC(e),p=null,f=EC(u);for(let y=0;p==null&&y<d.length;++y)p=kC(d[y],f,r);return p}function pC(e){let n=Hx(e);return hC(n),n}function Hx(e,n=[],a=[],r="",o=!1){let s=(u,d,p=o,f)=>{let y={relativePath:f===void 0?u.path||"":f,caseSensitive:u.caseSensitive===!0,childrenIndex:d,route:u};if(y.relativePath.startsWith("/")){if(!y.relativePath.startsWith(r)&&p)return;Et(y.relativePath.startsWith(r),`Absolute route path "${y.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),y.relativePath=y.relativePath.slice(r.length)}let g=ua([r,y.relativePath]),x=a.concat(y);u.children&&u.children.length>0&&(Et(u.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${g}".`),Hx(u.children,n,x,g,p)),!(u.path==null&&!u.index)&&n.push({path:g,score:wC(g,u.index),routesMeta:x})};return e.forEach((u,d)=>{var p;if(u.path===""||!((p=u.path)!=null&&p.includes("?")))s(u,d);else for(let f of $x(u.path))s(u,d,!0,f)}),n}function $x(e){let n=e.split("/");if(n.length===0)return[];let[a,...r]=n,o=a.endsWith("?"),s=a.replace(/\?$/,"");if(r.length===0)return o?[s,""]:[s];let u=$x(r.join("/")),d=[];return d.push(...u.map(p=>p===""?s:[s,p].join("/"))),o&&d.push(...u),d.map(p=>e.startsWith("/")&&p===""?"/":p)}function hC(e){e.sort((n,a)=>n.score!==a.score?a.score-n.score:SC(n.routesMeta.map(r=>r.childrenIndex),a.routesMeta.map(r=>r.childrenIndex)))}var mC=/^:[\w-]+$/,gC=3,yC=2,vC=1,xC=10,bC=-2,s0=e=>e==="*";function wC(e,n){let a=e.split("/"),r=a.length;return a.some(s0)&&(r+=bC),n&&(r+=yC),a.filter(o=>!s0(o)).reduce((o,s)=>o+(mC.test(s)?gC:s===""?vC:xC),r)}function SC(e,n){return e.length===n.length&&e.slice(0,-1).every((r,o)=>r===n[o])?e[e.length-1]-n[n.length-1]:0}function kC(e,n,a=!1){let{routesMeta:r}=e,o={},s="/",u=[];for(let d=0;d<r.length;++d){let p=r[d],f=d===r.length-1,y=s==="/"?n:n.slice(s.length)||"/",g=Rc({path:p.relativePath,caseSensitive:p.caseSensitive,end:f},y),x=p.route;if(!g&&f&&a&&!r[r.length-1].route.index&&(g=Rc({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},y)),!g)return null;Object.assign(o,g.params),u.push({params:o,pathname:ua([s,g.pathname]),pathnameBase:NC(ua([s,g.pathnameBase])),route:x}),g.pathnameBase!=="/"&&(s=ua([s,g.pathnameBase]))}return u}function Rc(e,n){typeof e=="string"&&(e={path:e,caseSensitive:!1,end:!0});let[a,r]=CC(e.path,e.caseSensitive,e.end),o=n.match(a);if(!o)return null;let s=o[0],u=s.replace(/(.)\/+$/,"$1"),d=o.slice(1);return{params:r.reduce((f,{paramName:y,isOptional:g},x)=>{if(y==="*"){let k=d[x]||"";u=s.slice(0,s.length-k.length).replace(/(.)\/+$/,"$1")}const b=d[x];return g&&!b?f[y]=void 0:f[y]=(b||"").replace(/%2F/g,"/"),f},{}),pathname:s,pathnameBase:u,pattern:e}}function CC(e,n=!1,a=!0){fa(e==="*"||!e.endsWith("*")||e.endsWith("/*"),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,"/*")}".`);let r=[],o="^"+e.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(u,d,p,f,y)=>{if(r.push({paramName:d,isOptional:p!=null}),p){let g=y.charAt(f+u.length);return g&&g!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return e.endsWith("*")?(r.push({paramName:"*"}),o+=e==="*"||e==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):a?o+="\\/*$":e!==""&&e!=="/"&&(o+="(?:(?=\\/|$))"),[new RegExp(o,n?void 0:"i"),r]}function EC(e){try{return e.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return fa(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${n}).`),e}}function Za(e,n){if(n==="/")return e;if(!e.toLowerCase().startsWith(n.toLowerCase()))return null;let a=n.endsWith("/")?n.length-1:n.length,r=e.charAt(a);return r&&r!=="/"?null:e.slice(a)||"/"}var AC=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i;function jC(e,n="/"){let{pathname:a,search:r="",hash:o=""}=typeof e=="string"?cl(e):e,s;return a?(a=qx(a),a.startsWith("/")?s=c0(a.substring(1),"/"):s=c0(a,n)):s=n,{pathname:s,search:RC(r),hash:_C(o)}}function c0(e,n){let a=_c(n).split("/");return e.split("/").forEach(o=>{o===".."?a.length>1&&a.pop():o!=="."&&a.push(o)}),a.length>1?a.join("/"):"/"}function _f(e,n,a,r){return`Cannot include a '${e}' character in a manually specified \`to.${n}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${a}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function TC(e){return e.filter((n,a)=>a===0||n.route.path&&n.route.path.length>0)}function dh(e){let n=TC(e);return n.map((a,r)=>r===n.length-1?a.pathname:a.pathnameBase)}function eu(e,n,a,r=!1){let o;typeof e=="string"?o=cl(e):(o={...e},Et(!o.pathname||!o.pathname.includes("?"),_f("?","pathname","search",o)),Et(!o.pathname||!o.pathname.includes("#"),_f("#","pathname","hash",o)),Et(!o.search||!o.search.includes("#"),_f("#","search","hash",o)));let s=e===""||o.pathname==="",u=s?"/":o.pathname,d;if(u==null)d=a;else{let g=n.length-1;if(!r&&u.startsWith("..")){let x=u.split("/");for(;x[0]==="..";)x.shift(),g-=1;o.pathname=x.join("/")}d=g>=0?n[g]:"/"}let p=jC(o,d),f=u&&u!=="/"&&u.endsWith("/"),y=(s||u===".")&&a.endsWith("/");return!p.pathname.endsWith("/")&&(f||y)&&(p.pathname+="/"),p}var qx=e=>e.replace(/\/\/+/g,"/"),ua=e=>qx(e.join("/")),_c=e=>e.replace(/\/+$/,""),NC=e=>_c(e).replace(/^\/*/,"/"),RC=e=>!e||e==="?"?"":e.startsWith("?")?e:"?"+e,_C=e=>!e||e==="#"?"":e.startsWith("#")?e:"#"+e,OC=class{constructor(e,n,a,r=!1){this.status=e,this.statusText=n||"",this.internal=r,a instanceof Error?(this.data=a.toString(),this.error=a):this.data=a}};function DC(e){return e!=null&&typeof e.status=="number"&&typeof e.statusText=="string"&&typeof e.internal=="boolean"&&"data"in e}function MC(e){let n=e.map(a=>a.route.path).filter(Boolean);return ua(n)||"/"}var Fx=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function Gx(e,n){let a=e;if(typeof a!="string"||!AC.test(a))return{absoluteURL:void 0,isExternal:!1,to:a};let r=a,o=!1;if(Fx)try{let s=new URL(window.location.href),u=a.startsWith("//")?new URL(s.protocol+a):new URL(a),d=Za(u.pathname,n);u.origin===s.origin&&d!=null?a=d+u.search+u.hash:o=!0}catch{fa(!1,`<Link to="${a}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:o,to:a}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var Vx=["POST","PUT","PATCH","DELETE"];new Set(Vx);var LC=["GET",...Vx];new Set(LC);var ul=S.createContext(null);ul.displayName="DataRouter";var tu=S.createContext(null);tu.displayName="DataRouterState";var Wx=S.createContext(!1);function zC(){return S.useContext(Wx)}var Yx=S.createContext({isTransitioning:!1});Yx.displayName="ViewTransition";var IC=S.createContext(new Map);IC.displayName="Fetchers";var PC=S.createContext(null);PC.displayName="Await";var qn=S.createContext(null);qn.displayName="Navigation";var Uo=S.createContext(null);Uo.displayName="Location";var Ea=S.createContext({outlet:null,matches:[],isDataRoute:!1});Ea.displayName="Route";var fh=S.createContext(null);fh.displayName="RouteError";var Kx="REACT_ROUTER_ERROR",UC="REDIRECT",BC="ROUTE_ERROR_RESPONSE";function HC(e){if(e.startsWith(`${Kx}:${UC}:{`))try{let n=JSON.parse(e.slice(28));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.location=="string"&&typeof n.reloadDocument=="boolean"&&typeof n.replace=="boolean")return n}catch{}}function $C(e){if(e.startsWith(`${Kx}:${BC}:{`))try{let n=JSON.parse(e.slice(40));if(typeof n=="object"&&n&&typeof n.status=="number"&&typeof n.statusText=="string")return new OC(n.status,n.statusText,n.data)}catch{}}function qC(e,{relative:n}={}){Et(dl(),"useHref() may be used only in the context of a <Router> component.");let{basename:a,navigator:r}=S.useContext(qn),{hash:o,pathname:s,search:u}=Bo(e,{relative:n}),d=s;return a!=="/"&&(d=s==="/"?a:ua([a,s])),r.createHref({pathname:d,search:u,hash:o})}function dl(){return S.useContext(Uo)!=null}function pa(){return Et(dl(),"useLocation() may be used only in the context of a <Router> component."),S.useContext(Uo).location}var Qx="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function Xx(e){S.useContext(qn).static||S.useLayoutEffect(e)}function ph(){let{isDataRoute:e}=S.useContext(Ea);return e?nE():FC()}function FC(){Et(dl(),"useNavigate() may be used only in the context of a <Router> component.");let e=S.useContext(ul),{basename:n,navigator:a}=S.useContext(qn),{matches:r}=S.useContext(Ea),{pathname:o}=pa(),s=JSON.stringify(dh(r)),u=S.useRef(!1);return Xx(()=>{u.current=!0}),S.useCallback((p,f={})=>{if(fa(u.current,Qx),!u.current)return;if(typeof p=="number"){a.go(p);return}let y=eu(p,JSON.parse(s),o,f.relative==="path");e==null&&n!=="/"&&(y.pathname=y.pathname==="/"?n:ua([n,y.pathname])),(f.replace?a.replace:a.push)(y,f.state,f)},[n,a,s,o,e])}S.createContext(null);function Bo(e,{relative:n}={}){let{matches:a}=S.useContext(Ea),{pathname:r}=pa(),o=JSON.stringify(dh(a));return S.useMemo(()=>eu(e,JSON.parse(o),r,n==="path"),[e,o,r,n])}function GC(e,n){return Zx(e,n)}function Zx(e,n,a){var j;Et(dl(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:r}=S.useContext(qn),{matches:o}=S.useContext(Ea),s=o[o.length-1],u=s?s.params:{},d=s?s.pathname:"/",p=s?s.pathnameBase:"/",f=s&&s.route;{let E=f&&f.path||"";eb(d,!f||E.endsWith("*")||E.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${d}" (under <Route path="${E}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
|
|
60
|
+
|
|
61
|
+
Please change the parent <Route path="${E}"> to <Route path="${E==="/"?"*":`${E}/*`}">.`)}let y=pa(),g;if(n){let E=typeof n=="string"?cl(n):n;Et(p==="/"||((j=E.pathname)==null?void 0:j.startsWith(p)),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${E.pathname}" was given in the \`location\` prop.`),g=E}else g=y;let x=g.pathname||"/",b=x;if(p!=="/"){let E=p.replace(/^\//,"").split("/");b="/"+x.replace(/^\//,"").split("/").slice(E.length).join("/")}let k=a&&a.state.matches.length?a.state.matches.map(E=>Object.assign(E,{route:a.manifest[E.route.id]||E.route})):Bx(e,{pathname:b});fa(f||k!=null,`No routes matched location "${g.pathname}${g.search}${g.hash}" `),fa(k==null||k[k.length-1].route.element!==void 0||k[k.length-1].route.Component!==void 0||k[k.length-1].route.lazy!==void 0,`Matched leaf route at location "${g.pathname}${g.search}${g.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let C=QC(k&&k.map(E=>Object.assign({},E,{params:Object.assign({},u,E.params),pathname:ua([p,r.encodeLocation?r.encodeLocation(E.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathname]),pathnameBase:E.pathnameBase==="/"?p:ua([p,r.encodeLocation?r.encodeLocation(E.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:E.pathnameBase])})),o,a);return n&&C?S.createElement(Uo.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...g},navigationType:"POP"}},C):C}function VC(){let e=tE(),n=DC(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),a=e instanceof Error?e.stack:null,r="rgba(200,200,200, 0.5)",o={padding:"0.5rem",backgroundColor:r},s={padding:"2px 4px",backgroundColor:r},u=null;return console.error("Error handled by React Router default ErrorBoundary:",e),u=S.createElement(S.Fragment,null,S.createElement("p",null,"💿 Hey developer 👋"),S.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",S.createElement("code",{style:s},"ErrorBoundary")," or"," ",S.createElement("code",{style:s},"errorElement")," prop on your route.")),S.createElement(S.Fragment,null,S.createElement("h2",null,"Unexpected Application Error!"),S.createElement("h3",{style:{fontStyle:"italic"}},n),a?S.createElement("pre",{style:o},a):null,u)}var WC=S.createElement(VC,null),Jx=class extends S.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,n){return n.location!==e.location||n.revalidation!=="idle"&&e.revalidation==="idle"?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error!==void 0?e.error:n.error,location:n.location,revalidation:e.revalidation||n.revalidation}}componentDidCatch(e,n){this.props.onError?this.props.onError(e,n):console.error("React Router caught the following error during render",e)}render(){let e=this.state.error;if(this.context&&typeof e=="object"&&e&&"digest"in e&&typeof e.digest=="string"){const a=$C(e.digest);a&&(e=a)}let n=e!==void 0?S.createElement(Ea.Provider,{value:this.props.routeContext},S.createElement(fh.Provider,{value:e,children:this.props.component})):this.props.children;return this.context?S.createElement(YC,{error:e},n):n}};Jx.contextType=Wx;var Of=new WeakMap;function YC({children:e,error:n}){let{basename:a}=S.useContext(qn);if(typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){let r=HC(n.digest);if(r){let o=Of.get(n);if(o)throw o;let s=Gx(r.location,a);if(Fx&&!Of.get(n))if(s.isExternal||r.reloadDocument)window.location.href=s.absoluteURL||s.to;else{const u=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(s.to,{replace:r.replace}));throw Of.set(n,u),u}return S.createElement("meta",{httpEquiv:"refresh",content:`0;url=${s.absoluteURL||s.to}`})}}return e}function KC({routeContext:e,match:n,children:a}){let r=S.useContext(ul);return r&&r.static&&r.staticContext&&(n.route.errorElement||n.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=n.route.id),S.createElement(Ea.Provider,{value:e},a)}function QC(e,n=[],a){let r=a==null?void 0:a.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(n.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let o=e,s=r==null?void 0:r.errors;if(s!=null){let y=o.findIndex(g=>g.route.id&&(s==null?void 0:s[g.route.id])!==void 0);Et(y>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(s).join(",")}`),o=o.slice(0,Math.min(o.length,y+1))}let u=!1,d=-1;if(a&&r){u=r.renderFallback;for(let y=0;y<o.length;y++){let g=o[y];if((g.route.HydrateFallback||g.route.hydrateFallbackElement)&&(d=y),g.route.id){let{loaderData:x,errors:b}=r,k=g.route.loader&&!x.hasOwnProperty(g.route.id)&&(!b||b[g.route.id]===void 0);if(g.route.lazy||k){a.isStatic&&(u=!0),d>=0?o=o.slice(0,d+1):o=[o[0]];break}}}}let p=a==null?void 0:a.onError,f=r&&p?(y,g)=>{var x,b;p(y,{location:r.location,params:((b=(x=r.matches)==null?void 0:x[0])==null?void 0:b.params)??{},pattern:MC(r.matches),errorInfo:g})}:void 0;return o.reduceRight((y,g,x)=>{let b,k=!1,C=null,j=null;r&&(b=s&&g.route.id?s[g.route.id]:void 0,C=g.route.errorElement||WC,u&&(d<0&&x===0?(eb("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),k=!0,j=null):d===x&&(k=!0,j=g.route.hydrateFallbackElement||null)));let E=n.concat(o.slice(0,x+1)),_=()=>{let R;return b?R=C:k?R=j:g.route.Component?R=S.createElement(g.route.Component,null):g.route.element?R=g.route.element:R=y,S.createElement(KC,{match:g,routeContext:{outlet:y,matches:E,isDataRoute:r!=null},children:R})};return r&&(g.route.ErrorBoundary||g.route.errorElement||x===0)?S.createElement(Jx,{location:r.location,revalidation:r.revalidation,component:C,error:b,children:_(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:f}):_()},null)}function hh(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function XC(e){let n=S.useContext(ul);return Et(n,hh(e)),n}function ZC(e){let n=S.useContext(tu);return Et(n,hh(e)),n}function JC(e){let n=S.useContext(Ea);return Et(n,hh(e)),n}function mh(e){let n=JC(e),a=n.matches[n.matches.length-1];return Et(a.route.id,`${e} can only be used on routes that contain a unique "id"`),a.route.id}function eE(){return mh("useRouteId")}function tE(){var r;let e=S.useContext(fh),n=ZC("useRouteError"),a=mh("useRouteError");return e!==void 0?e:(r=n.errors)==null?void 0:r[a]}function nE(){let{router:e}=XC("useNavigate"),n=mh("useNavigate"),a=S.useRef(!1);return Xx(()=>{a.current=!0}),S.useCallback(async(o,s={})=>{fa(a.current,Qx),a.current&&(typeof o=="number"?await e.navigate(o):await e.navigate(o,{fromRouteId:n,...s}))},[e,n])}var u0={};function eb(e,n,a){!n&&!u0[e]&&(u0[e]=!0,fa(!1,a))}S.memo(aE);function aE({routes:e,manifest:n,future:a,state:r,isStatic:o,onError:s}){return Zx(e,void 0,{manifest:n,state:r,isStatic:o,onError:s})}function So({to:e,replace:n,state:a,relative:r}){Et(dl(),"<Navigate> may be used only in the context of a <Router> component.");let{static:o}=S.useContext(qn);fa(!o,"<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.");let{matches:s}=S.useContext(Ea),{pathname:u}=pa(),d=ph(),p=eu(e,dh(s),u,r==="path"),f=JSON.stringify(p);return S.useEffect(()=>{d(JSON.parse(f),{replace:n,state:a,relative:r})},[d,f,r,n,a]),null}function Ni(e){Et(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function iE({basename:e="/",children:n=null,location:a,navigationType:r="POP",navigator:o,static:s=!1,useTransitions:u}){Et(!dl(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let d=e.replace(/^\/*/,"/"),p=S.useMemo(()=>({basename:d,navigator:o,static:s,useTransitions:u,future:{}}),[d,o,s,u]);typeof a=="string"&&(a=cl(a));let{pathname:f="/",search:y="",hash:g="",state:x=null,key:b="default",mask:k}=a,C=S.useMemo(()=>{let j=Za(f,d);return j==null?null:{location:{pathname:j,search:y,hash:g,state:x,key:b,mask:k},navigationType:r}},[d,f,y,g,x,b,r,k]);return fa(C!=null,`<Router basename="${d}"> is not able to match the URL "${f}${y}${g}" because it does not start with the basename, so the <Router> won't render anything.`),C==null?null:S.createElement(qn.Provider,{value:p},S.createElement(Uo.Provider,{children:n,value:C}))}function rE({children:e,location:n}){return GC(Dp(e),n)}function Dp(e,n=[]){let a=[];return S.Children.forEach(e,(r,o)=>{if(!S.isValidElement(r))return;let s=[...n,o];if(r.type===S.Fragment){a.push.apply(a,Dp(r.props.children,s));return}Et(r.type===Ni,`[${typeof r.type=="string"?r.type:r.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),Et(!r.props.index||!r.props.children,"An index route cannot have child routes.");let u={id:r.props.id||s.join("-"),caseSensitive:r.props.caseSensitive,element:r.props.element,Component:r.props.Component,index:r.props.index,path:r.props.path,middleware:r.props.middleware,loader:r.props.loader,action:r.props.action,hydrateFallbackElement:r.props.hydrateFallbackElement,HydrateFallback:r.props.HydrateFallback,errorElement:r.props.errorElement,ErrorBoundary:r.props.ErrorBoundary,hasErrorBoundary:r.props.hasErrorBoundary===!0||r.props.ErrorBoundary!=null||r.props.errorElement!=null,shouldRevalidate:r.props.shouldRevalidate,handle:r.props.handle,lazy:r.props.lazy};r.props.children&&(u.children=Dp(r.props.children,s)),a.push(u)}),a}var wc="get",Sc="application/x-www-form-urlencoded";function nu(e){return typeof HTMLElement<"u"&&e instanceof HTMLElement}function lE(e){return nu(e)&&e.tagName.toLowerCase()==="button"}function oE(e){return nu(e)&&e.tagName.toLowerCase()==="form"}function sE(e){return nu(e)&&e.tagName.toLowerCase()==="input"}function cE(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function uE(e,n){return e.button===0&&(!n||n==="_self")&&!cE(e)}var lc=null;function dE(){if(lc===null)try{new FormData(document.createElement("form"),0),lc=!1}catch{lc=!0}return lc}var fE=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Df(e){return e!=null&&!fE.has(e)?(fa(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Sc}"`),null):e}function pE(e,n){let a,r,o,s,u;if(oE(e)){let d=e.getAttribute("action");r=d?Za(d,n):null,a=e.getAttribute("method")||wc,o=Df(e.getAttribute("enctype"))||Sc,s=new FormData(e)}else if(lE(e)||sE(e)&&(e.type==="submit"||e.type==="image")){let d=e.form;if(d==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=e.getAttribute("formaction")||d.getAttribute("action");if(r=p?Za(p,n):null,a=e.getAttribute("formmethod")||d.getAttribute("method")||wc,o=Df(e.getAttribute("formenctype"))||Df(d.getAttribute("enctype"))||Sc,s=new FormData(d,e),!dE()){let{name:f,type:y,value:g}=e;if(y==="image"){let x=f?`${f}.`:"";s.append(`${x}x`,"0"),s.append(`${x}y`,"0")}else f&&s.append(f,g)}}else{if(nu(e))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');a=wc,r=null,o=Sc,u=e}return s&&o==="text/plain"&&(u=s,s=void 0),{action:r,method:a.toLowerCase(),encType:o,formData:s,body:u}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function gh(e,n){if(e===!1||e===null||typeof e>"u")throw new Error(n)}function tb(e,n,a,r){let o=typeof e=="string"?new URL(e,typeof window>"u"?"server://singlefetch/":window.location.origin):e;return a?o.pathname.endsWith("/")?o.pathname=`${o.pathname}_.${r}`:o.pathname=`${o.pathname}.${r}`:o.pathname==="/"?o.pathname=`_root.${r}`:n&&Za(o.pathname,n)==="/"?o.pathname=`${_c(n)}/_root.${r}`:o.pathname=`${_c(o.pathname)}.${r}`,o}async function hE(e,n){if(e.id in n)return n[e.id];try{let a=await import(e.module);return n[e.id]=a,a}catch(a){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(a),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function mE(e){return e==null?!1:e.href==null?e.rel==="preload"&&typeof e.imageSrcSet=="string"&&typeof e.imageSizes=="string":typeof e.rel=="string"&&typeof e.href=="string"}async function gE(e,n,a){let r=await Promise.all(e.map(async o=>{let s=n.routes[o.route.id];if(s){let u=await hE(s,a);return u.links?u.links():[]}return[]}));return bE(r.flat(1).filter(mE).filter(o=>o.rel==="stylesheet"||o.rel==="preload").map(o=>o.rel==="stylesheet"?{...o,rel:"prefetch",as:"style"}:{...o,rel:"prefetch"}))}function d0(e,n,a,r,o,s){let u=(p,f)=>a[f]?p.route.id!==a[f].route.id:!0,d=(p,f)=>{var y;return a[f].pathname!==p.pathname||((y=a[f].route.path)==null?void 0:y.endsWith("*"))&&a[f].params["*"]!==p.params["*"]};return s==="assets"?n.filter((p,f)=>u(p,f)||d(p,f)):s==="data"?n.filter((p,f)=>{var g;let y=r.routes[p.route.id];if(!y||!y.hasLoader)return!1;if(u(p,f)||d(p,f))return!0;if(p.route.shouldRevalidate){let x=p.route.shouldRevalidate({currentUrl:new URL(o.pathname+o.search+o.hash,window.origin),currentParams:((g=a[0])==null?void 0:g.params)||{},nextUrl:new URL(e,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof x=="boolean")return x}return!0}):[]}function yE(e,n,{includeHydrateFallback:a}={}){return vE(e.map(r=>{let o=n.routes[r.route.id];if(!o)return[];let s=[o.module];return o.clientActionModule&&(s=s.concat(o.clientActionModule)),o.clientLoaderModule&&(s=s.concat(o.clientLoaderModule)),a&&o.hydrateFallbackModule&&(s=s.concat(o.hydrateFallbackModule)),o.imports&&(s=s.concat(o.imports)),s}).flat(1))}function vE(e){return[...new Set(e)]}function xE(e){let n={},a=Object.keys(e).sort();for(let r of a)n[r]=e[r];return n}function bE(e,n){let a=new Set;return new Set(n),e.reduce((r,o)=>{let s=JSON.stringify(xE(o));return a.has(s)||(a.add(s),r.push({key:s,link:o})),r},[])}function yh(){let e=S.useContext(ul);return gh(e,"You must render this element inside a <DataRouterContext.Provider> element"),e}function wE(){let e=S.useContext(tu);return gh(e,"You must render this element inside a <DataRouterStateContext.Provider> element"),e}var vh=S.createContext(void 0);vh.displayName="FrameworkContext";function xh(){let e=S.useContext(vh);return gh(e,"You must render this element inside a <HydratedRouter> element"),e}function SE(e,n){let a=S.useContext(vh),[r,o]=S.useState(!1),[s,u]=S.useState(!1),{onFocus:d,onBlur:p,onMouseEnter:f,onMouseLeave:y,onTouchStart:g}=n,x=S.useRef(null);S.useEffect(()=>{if(e==="render"&&u(!0),e==="viewport"){let C=E=>{E.forEach(_=>{u(_.isIntersecting)})},j=new IntersectionObserver(C,{threshold:.5});return x.current&&j.observe(x.current),()=>{j.disconnect()}}},[e]),S.useEffect(()=>{if(r){let C=setTimeout(()=>{u(!0)},100);return()=>{clearTimeout(C)}}},[r]);let b=()=>{o(!0)},k=()=>{o(!1),u(!1)};return a?e!=="intent"?[s,x,{}]:[s,x,{onFocus:uo(d,b),onBlur:uo(p,k),onMouseEnter:uo(f,b),onMouseLeave:uo(y,k),onTouchStart:uo(g,b)}]:[!1,x,{}]}function uo(e,n){return a=>{e&&e(a),a.defaultPrevented||n(a)}}function kE({page:e,...n}){let a=zC(),{router:r}=yh(),o=S.useMemo(()=>Bx(r.routes,e,r.basename),[r.routes,e,r.basename]);return o?a?S.createElement(EE,{page:e,matches:o,...n}):S.createElement(AE,{page:e,matches:o,...n}):null}function CE(e){let{manifest:n,routeModules:a}=xh(),[r,o]=S.useState([]);return S.useEffect(()=>{let s=!1;return gE(e,n,a).then(u=>{s||o(u)}),()=>{s=!0}},[e,n,a]),r}function EE({page:e,matches:n,...a}){let r=pa(),{future:o}=xh(),{basename:s}=yh(),u=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let d=tb(e,s,o.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,f=[];for(let y of n)typeof y.route.shouldRevalidate=="function"?p=!0:f.push(y.route.id);return p&&f.length>0&&d.searchParams.set("_routes",f.join(",")),[d.pathname+d.search]},[s,o.v8_trailingSlashAwareDataRequests,e,r,n]);return S.createElement(S.Fragment,null,u.map(d=>S.createElement("link",{key:d,rel:"prefetch",as:"fetch",href:d,...a})))}function AE({page:e,matches:n,...a}){let r=pa(),{future:o,manifest:s,routeModules:u}=xh(),{basename:d}=yh(),{loaderData:p,matches:f}=wE(),y=S.useMemo(()=>d0(e,n,f,s,r,"data"),[e,n,f,s,r]),g=S.useMemo(()=>d0(e,n,f,s,r,"assets"),[e,n,f,s,r]),x=S.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let C=new Set,j=!1;if(n.forEach(_=>{var F;let R=s.routes[_.route.id];!R||!R.hasLoader||(!y.some(U=>U.route.id===_.route.id)&&_.route.id in p&&((F=u[_.route.id])!=null&&F.shouldRevalidate)||R.hasClientLoader?j=!0:C.add(_.route.id))}),C.size===0)return[];let E=tb(e,d,o.v8_trailingSlashAwareDataRequests,"data");return j&&C.size>0&&E.searchParams.set("_routes",n.filter(_=>C.has(_.route.id)).map(_=>_.route.id).join(",")),[E.pathname+E.search]},[d,o.v8_trailingSlashAwareDataRequests,p,r,s,y,n,e,u]),b=S.useMemo(()=>yE(g,s),[g,s]),k=CE(g);return S.createElement(S.Fragment,null,x.map(C=>S.createElement("link",{key:C,rel:"prefetch",as:"fetch",href:C,...a})),b.map(C=>S.createElement("link",{key:C,rel:"modulepreload",href:C,...a})),k.map(({key:C,link:j})=>S.createElement("link",{key:C,nonce:a.nonce,...j,crossOrigin:j.crossOrigin??a.crossOrigin})))}function jE(...e){return n=>{e.forEach(a=>{typeof a=="function"?a(n):a!=null&&(a.current=n)})}}var TE=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{TE&&(window.__reactRouterVersion="7.17.0")}catch{}function NE({basename:e,children:n,useTransitions:a,window:r}){let o=S.useRef();o.current==null&&(o.current=sC({window:r,v5Compat:!0}));let s=o.current,[u,d]=S.useState({action:s.action,location:s.location}),p=S.useCallback(f=>{a===!1?d(f):S.startTransition(()=>d(f))},[a]);return S.useLayoutEffect(()=>s.listen(p),[s,p]),S.createElement(iE,{basename:e,children:n,location:u.location,navigationType:u.action,navigator:s,useTransitions:a})}var nb=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,ab=S.forwardRef(function({onClick:n,discover:a="render",prefetch:r="none",relative:o,reloadDocument:s,replace:u,mask:d,state:p,target:f,to:y,preventScrollReset:g,viewTransition:x,defaultShouldRevalidate:b,...k},C){let{basename:j,navigator:E,useTransitions:_}=S.useContext(qn),R=typeof y=="string"&&nb.test(y),F=Gx(y,j);y=F.to;let U=qC(y,{relative:o}),D=pa(),W=null;if(d){let K=eu(d,[],D.mask?D.mask.pathname:"/",!0);j!=="/"&&(K.pathname=K.pathname==="/"?j:ua([j,K.pathname])),W=E.createHref(K)}let[Q,M,T]=SE(r,k),q=DE(y,{replace:u,mask:d,state:p,target:f,preventScrollReset:g,relative:o,viewTransition:x,defaultShouldRevalidate:b,useTransitions:_});function V(K){n&&n(K),K.defaultPrevented||q(K)}let ae=!(F.isExternal||s),P=S.createElement("a",{...k,...T,href:(ae?W:void 0)||F.absoluteURL||U,onClick:ae?V:n,ref:jE(C,M),target:f,"data-discover":!R&&a==="render"?"true":void 0});return Q&&!R?S.createElement(S.Fragment,null,P,S.createElement(kE,{page:U})):P});ab.displayName="Link";var RE=S.forwardRef(function({"aria-current":n="page",caseSensitive:a=!1,className:r="",end:o=!1,style:s,to:u,viewTransition:d,children:p,...f},y){let g=Bo(u,{relative:f.relative}),x=pa(),b=S.useContext(tu),{navigator:k,basename:C}=S.useContext(qn),j=b!=null&&PE(g)&&d===!0,E=k.encodeLocation?k.encodeLocation(g).pathname:g.pathname,_=x.pathname,R=b&&b.navigation&&b.navigation.location?b.navigation.location.pathname:null;a||(_=_.toLowerCase(),R=R?R.toLowerCase():null,E=E.toLowerCase()),R&&C&&(R=Za(R,C)||R);const F=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let U=_===E||!o&&_.startsWith(E)&&_.charAt(F)==="/",D=R!=null&&(R===E||!o&&R.startsWith(E)&&R.charAt(E.length)==="/"),W={isActive:U,isPending:D,isTransitioning:j},Q=U?n:void 0,M;typeof r=="function"?M=r(W):M=[r,U?"active":null,D?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let T=typeof s=="function"?s(W):s;return S.createElement(ab,{...f,"aria-current":Q,className:M,ref:y,style:T,to:u,viewTransition:d},typeof p=="function"?p(W):p)});RE.displayName="NavLink";var _E=S.forwardRef(({discover:e="render",fetcherKey:n,navigate:a,reloadDocument:r,replace:o,state:s,method:u=wc,action:d,onSubmit:p,relative:f,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:x,...b},k)=>{let{useTransitions:C}=S.useContext(qn),j=zE(),E=IE(d,{relative:f}),_=u.toLowerCase()==="get"?"get":"post",R=typeof d=="string"&&nb.test(d),F=U=>{if(p&&p(U),U.defaultPrevented)return;U.preventDefault();let D=U.nativeEvent.submitter,W=(D==null?void 0:D.getAttribute("formmethod"))||u,Q=()=>j(D||U.currentTarget,{fetcherKey:n,method:W,navigate:a,replace:o,state:s,relative:f,preventScrollReset:y,viewTransition:g,defaultShouldRevalidate:x});C&&a!==!1?S.startTransition(()=>Q()):Q()};return S.createElement("form",{ref:k,method:_,action:E,onSubmit:r?p:F,...b,"data-discover":!R&&e==="render"?"true":void 0})});_E.displayName="Form";function OE(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function ib(e){let n=S.useContext(ul);return Et(n,OE(e)),n}function DE(e,{target:n,replace:a,mask:r,state:o,preventScrollReset:s,relative:u,viewTransition:d,defaultShouldRevalidate:p,useTransitions:f}={}){let y=ph(),g=pa(),x=Bo(e,{relative:u});return S.useCallback(b=>{if(uE(b,n)){b.preventDefault();let k=a!==void 0?a:_o(g)===_o(x),C=()=>y(e,{replace:k,mask:r,state:o,preventScrollReset:s,relative:u,viewTransition:d,defaultShouldRevalidate:p});f?S.startTransition(()=>C()):C()}},[g,y,x,a,r,o,n,e,s,u,d,p,f])}var ME=0,LE=()=>`__${String(++ME)}__`;function zE(){let{router:e}=ib("useSubmit"),{basename:n}=S.useContext(qn),a=eE(),r=e.fetch,o=e.navigate;return S.useCallback(async(s,u={})=>{let{action:d,method:p,encType:f,formData:y,body:g}=pE(s,n);if(u.navigate===!1){let x=u.fetcherKey||LE();await r(x,a,u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||p,formEncType:u.encType||f,flushSync:u.flushSync})}else await o(u.action||d,{defaultShouldRevalidate:u.defaultShouldRevalidate,preventScrollReset:u.preventScrollReset,formData:y,body:g,formMethod:u.method||p,formEncType:u.encType||f,replace:u.replace,state:u.state,fromRouteId:a,flushSync:u.flushSync,viewTransition:u.viewTransition})},[r,o,n,a])}function IE(e,{relative:n}={}){let{basename:a}=S.useContext(qn),r=S.useContext(Ea);Et(r,"useFormAction must be used inside a RouteContext");let[o]=r.matches.slice(-1),s={...Bo(e||".",{relative:n})},u=pa();if(e==null){s.search=u.search;let d=new URLSearchParams(s.search),p=d.getAll("index");if(p.some(y=>y==="")){d.delete("index"),p.filter(g=>g).forEach(g=>d.append("index",g));let y=d.toString();s.search=y?`?${y}`:""}}return(!e||e===".")&&o.route.index&&(s.search=s.search?s.search.replace(/^\?/,"?index&"):"?index"),a!=="/"&&(s.pathname=s.pathname==="/"?a:ua([a,s.pathname])),_o(s)}function PE(e,{relative:n}={}){let a=S.useContext(Yx);Et(a!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=ib("useViewTransitionState"),o=Bo(e,{relative:n});if(!a.isTransitioning)return!1;let s=Za(a.currentLocation.pathname,r)||a.currentLocation.pathname,u=Za(a.nextLocation.pathname,r)||a.nextLocation.pathname;return Rc(o.pathname,u)!=null||Rc(o.pathname,s)!=null}var UE=Ux();const BE="modulepreload",HE=function(e){return"/ui/"+e},f0={},nt=function(n,a,r){let o=Promise.resolve();if(a&&a.length>0){let u=function(f){return Promise.all(f.map(y=>Promise.resolve(y).then(g=>({status:"fulfilled",value:g}),g=>({status:"rejected",reason:g}))))};document.getElementsByTagName("link");const d=document.querySelector("meta[property=csp-nonce]"),p=(d==null?void 0:d.nonce)||(d==null?void 0:d.getAttribute("nonce"));o=u(a.map(f=>{if(f=HE(f),f in f0)return;f0[f]=!0;const y=f.endsWith(".css"),g=y?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${f}"]${g}`))return;const x=document.createElement("link");if(x.rel=y?"stylesheet":BE,y||(x.as="script"),x.crossOrigin="",x.href=f,p&&x.setAttribute("nonce",p),document.head.appendChild(x),y)return new Promise((b,k)=>{x.addEventListener("load",b),x.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${f}`)))})}))}function s(u){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=u,window.dispatchEvent(d),!d.defaultPrevented)throw u}return o.then(u=>{for(const d of u||[])d.status==="rejected"&&s(d.reason);return n().catch(s)})},p0=e=>{let n;const a=new Set,r=(f,y)=>{const g=typeof f=="function"?f(n):f;if(!Object.is(g,n)){const x=n;n=y??(typeof g!="object"||g===null)?g:Object.assign({},n,g),a.forEach(b=>b(n,x))}},o=()=>n,d={setState:r,getState:o,getInitialState:()=>p,subscribe:f=>(a.add(f),()=>a.delete(f))},p=n=e(r,o,d);return d},$E=(e=>e?p0(e):p0),qE=e=>e;function FE(e,n=qE){const a=mn.useSyncExternalStore(e.subscribe,mn.useCallback(()=>n(e.getState()),[e,n]),mn.useCallback(()=>n(e.getInitialState()),[e,n]));return mn.useDebugValue(a),a}const h0=e=>{const n=$E(e),a=r=>FE(n,r);return Object.assign(a,n),a},ur=(e=>e?h0(e):h0),rb="dkg-layout",GE=260,ba={leftCollapsed:!1,rightCollapsed:!1,bottomCollapsed:!0,leftSectionMyProjectsOpen:!0,leftSectionIntegrationsOpen:!1,leftWidth:240,rightWidth:360,bottomHeight:GE},lb=140,ob=400,sb=200,cb=500,ub=120,Oc=600,VE=240;function WE(e,n){if(typeof document>"u")return n;const a=getComputedStyle(document.documentElement).getPropertyValue(e).trim(),r=parseFloat(a);return Number.isFinite(r)?r:n}function Dc(){const e=WE("--header-h",44),n=typeof window<"u"&&window.innerHeight?window.innerHeight:0;if(!n)return Oc;const a=n-e-VE;return Math.max(0,Math.min(Oc,a))}function kc(e,n,a){return Math.max(n,Math.min(a,e))}function Mf(e,n,a,r){return typeof e!="number"||!Number.isFinite(e)?n:kc(e,a,r)}function YE(){try{const e=localStorage.getItem(rb);if(!e)return ba;const n=JSON.parse(e);return{leftCollapsed:typeof n.leftCollapsed=="boolean"?n.leftCollapsed:ba.leftCollapsed,rightCollapsed:typeof n.rightCollapsed=="boolean"?n.rightCollapsed:ba.rightCollapsed,bottomCollapsed:typeof n.bottomCollapsed=="boolean"?n.bottomCollapsed:ba.bottomCollapsed,leftSectionMyProjectsOpen:typeof n.leftSectionMyProjectsOpen=="boolean"?n.leftSectionMyProjectsOpen:ba.leftSectionMyProjectsOpen,leftSectionIntegrationsOpen:typeof n.leftSectionIntegrationsOpen=="boolean"?n.leftSectionIntegrationsOpen:ba.leftSectionIntegrationsOpen,leftWidth:Mf(n.leftWidth,ba.leftWidth,lb,ob),rightWidth:Mf(n.rightWidth,ba.rightWidth,sb,cb),bottomHeight:Mf(n.bottomHeight,ba.bottomHeight,ub,Oc)}}catch{return ba}}let oc=null;function Ka(e){oc&&clearTimeout(oc),oc=setTimeout(()=>{oc=null;try{localStorage.setItem(rb,JSON.stringify(e))}catch{}},150)}function Qa(e){return{leftCollapsed:e.leftCollapsed,rightCollapsed:e.rightCollapsed,bottomCollapsed:e.bottomCollapsed,leftSectionMyProjectsOpen:e.leftSectionMyProjectsOpen,leftSectionIntegrationsOpen:e.leftSectionIntegrationsOpen,leftWidth:e.leftWidth,rightWidth:e.rightWidth,bottomHeight:e.bottomHeight}}const ji=YE(),Bn=ur((e,n)=>({leftCollapsed:ji.leftCollapsed,rightCollapsed:ji.rightCollapsed,bottomCollapsed:ji.bottomCollapsed,bottomMaximised:!1,leftSectionMyProjectsOpen:ji.leftSectionMyProjectsOpen,leftSectionIntegrationsOpen:ji.leftSectionIntegrationsOpen,theme:localStorage.getItem("dkg-theme")||"dark",leftWidth:ji.leftWidth,rightWidth:ji.rightWidth,bottomHeight:ji.bottomHeight,toggleLeft:()=>{e(a=>({leftCollapsed:!a.leftCollapsed})),Ka(Qa(n()))},toggleRight:()=>{e(a=>({rightCollapsed:!a.rightCollapsed})),Ka(Qa(n()))},toggleBottom:()=>{e(a=>({bottomCollapsed:!a.bottomCollapsed,bottomMaximised:!1})),Ka(Qa(n()))},toggleBottomMaximised:()=>{e(a=>({bottomMaximised:!a.bottomMaximised,bottomCollapsed:!1})),Ka(Qa(n()))},toggleLeftSectionMyProjects:()=>{e(a=>({leftSectionMyProjectsOpen:!a.leftSectionMyProjectsOpen})),Ka(Qa(n()))},toggleLeftSectionIntegrations:()=>{e(a=>({leftSectionIntegrationsOpen:!a.leftSectionIntegrationsOpen})),Ka(Qa(n()))},setTheme:a=>{localStorage.setItem("dkg-theme",a),e({theme:a})},setLeftWidth:a=>{e({leftWidth:kc(a,lb,ob)}),Ka(Qa(n()))},setRightWidth:a=>{e({rightWidth:kc(a,sb,cb)}),Ka(Qa(n()))},setBottomHeight:a=>{const r=Math.min(ub,Dc());e({bottomHeight:kc(a,r,Oc)}),Ka(Qa(n()))}})),bh=ur(e=>({agents:[],activeAgentName:null,nodeStatus:null,setAgents:n=>e({agents:n}),setActiveAgent:n=>e({activeAgentName:n}),setNodeStatus:n=>e({nodeStatus:n})})),KE=[{id:"dashboard",label:"Dashboard",closable:!1}],gn=ur((e,n)=>({tabs:KE,activeTabId:"dashboard",openTab:a=>{const{tabs:r}=n();r.find(o=>o.id===a.id)?e({activeTabId:a.id}):e({tabs:[...r,a],activeTabId:a.id})},closeTab:a=>{var d;const{tabs:r,activeTabId:o}=n(),s=r.filter(p=>p.id!==a);if(s.length===0)return;const u=o===a?((d=s[Math.max(0,r.findIndex(p=>p.id===a)-1)])==null?void 0:d.id)??s[0].id:o;e({tabs:s,activeTabId:u})},setActiveTab:a=>e({activeTabId:a})})),Mc="dkg.apiToken",QE="/api/agent/identity";let wh;const Mp=new Set;function db(){if(!(typeof window>"u"))try{return window.sessionStorage.getItem(Mc)||void 0}catch{return}}function Sh(){if(!(typeof window>"u"))return window.__DKG_TOKEN__||void 0}function fb(){return wh??db()}function dr(){return Sh()??fb()}function XE(){return Sh()!==void 0}function ZE(){const e=dr();return e!==void 0&&(e===Sh()||e===db())}function JE(e){const n=e.trim();if(!n||typeof window>"u")return!1;wh=n;try{return window.sessionStorage.setItem(Mc,n),!0}catch{try{window.sessionStorage.removeItem(Mc)}catch{}for(const a of Mp)try{a()}catch{}return!1}}function eA(){if(wh=void 0,!(typeof window>"u"))try{window.sessionStorage.removeItem(Mc)}catch{}}function tA(e){return Mp.add(e),()=>{Mp.delete(e)}}async function nA(e=fetch){const n=dr();try{const a=await e(QE,{headers:n?{Authorization:`Bearer ${n}`}:{},cache:"no-store"});return a.status===401?"required":a.ok?"accepted":"unknown"}catch{return"unknown"}}const ra="";function $t(){const e=dr();return e?{Authorization:`Bearer ${e}`}:{}}class an extends Error{constructor(a,r,o){super(r??`HTTP ${a}`);Ut(this,"status");Ut(this,"body");this.status=a,this.body=o}}async function kh(e,n={},a=1e4){try{return await fetch(e,{...n,signal:AbortSignal.timeout(a)})}catch(r){throw r instanceof Error&&r.name==="TimeoutError"?new Error(`Request timed out after ${Math.round(a/1e3)}s`):r}}const pb=24e4;class hb extends Error{constructor(a){super(a);Ut(this,"outcomeUnknown",!0);this.name="OutcomeUnknownError"}}async function mb(e,n,a){const r=new AbortController,o=setTimeout(()=>r.abort(),pb);try{const s=await fetch(`${ra}${e}`,{...n,signal:r.signal});if(!s.ok){const u=await s.json().catch(()=>({})),d=(u==null?void 0:u.error)??`HTTP ${s.status}`;throw new an(s.status,d,u)}return await s.json()}catch(s){throw r.signal.aborted&&!(s instanceof an)?new hb(a):s}finally{clearTimeout(o)}}function gb(e,n,a){return mb(e,{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify(n)},a)}async function Qe(e){const n=await fetch(`${ra}${e}`,{headers:$t()});if(!n.ok){const a=await n.json().catch(()=>({})),r=(a==null?void 0:a.error)??`HTTP ${n.status}`;throw new an(n.status,r,a)}return n.json()}async function fl(e){const n=await fetch(`${ra}${e}`,{headers:$t()});if(!n.ok){const a=await n.json().catch(()=>({})),r=(a==null?void 0:a.error)??`HTTP ${n.status}`;throw new an(n.status,r,a)}return n.json()}async function yb(e,n){const a=await kh(`${ra}${e}`,{headers:$t()},n);if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new an(a.status,o,r)}return a.json()}async function Xt(e,n){const a=await fetch(`${ra}${e}`,{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify(n)});if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new an(a.status,o,r)}return a.json()}async function Ch(e,n){const a=await fetch(`${ra}${e}`,{method:"PUT",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify(n)});if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}async function aA(e){const n=await fetch(`${ra}${e}`,{method:"DELETE",headers:$t()});if(!n.ok){const a=await n.json().catch(()=>({})),r=(a==null?void 0:a.error)??`HTTP ${n.status}`;throw new an(n.status,r,a)}return n.json()}class m0{constructor(n,a=()=>!0){Ut(this,"maxEntries");Ut(this,"shouldAdmit");Ut(this,"entries",new Map);if(this.maxEntries=n,this.shouldAdmit=a,!Number.isSafeInteger(n)||n<1)throw new RangeError("maxEntries must be a positive safe integer")}get size(){return this.entries.size}has(n){return this.entries.has(n)}get(n){if(!this.entries.has(n))return;const a=this.entries.get(n);return this.entries.delete(n),this.entries.set(n,a),a}delete(n){return this.entries.delete(n)}clear(){this.entries.clear()}set(n,a){if(!this.shouldAdmit(n)||(this.entries.delete(n),this.entries.set(n,a),this.entries.size<=this.maxEntries))return;const r=this.entries.keys().next();r.done||this.entries.delete(r.value)}}const iA=256,Lp=64*1024,rA=4,lA=2*1024*1024;function oA(){return{small:new m0(iA,e=>e.length<=Lp),large:new m0(rA,e=>e.length>Lp&&e.length<=lA)}}class sA{constructor(){Ut(this,"tiers",oA())}tierFor(n){return n.length<=Lp?"small":"large"}get(n){return this.tiers[this.tierFor(n)].get(n)}set(n,a){const r=this.tierFor(n);r==="large"&&!a.largeCacheable||this.tiers[r].set(n,a)}}function cA(e){return e>=48&&e<=57||e>=65&&e<=70||e>=97&&e<=102}function zp(e){return e<=1114111&&!(e>=55296&&e<=57343)}function Ht(e,n){if(n<0||n>=e.length)return null;const a=e.charCodeAt(n);if(a!==92){const d=e.codePointAt(n);return d===void 0||!zp(d)?null:{codePoint:d,rawWidth:d>65535?2:1}}const r=e[n+1];if(r!=="u"&&r!=="U")return{codePoint:a,rawWidth:1};const o=r==="u"?4:8,s=n+2+o;if(s>e.length)return null;let u=0;for(let d=n+2;d<s;d++){const p=e.charCodeAt(d);if(!cA(p))return null;u=u*16+Number.parseInt(e[d],16)}return zp(u)?{codePoint:u,rawWidth:2+o}:null}function vb(e){return e>=65&&e<=90||e>=97&&e<=122||e>=192&&e<=214||e>=216&&e<=246||e>=248&&e<=767||e>=880&&e<=893||e>=895&&e<=8191||e>=8204&&e<=8205||e>=8304&&e<=8591||e>=11264&&e<=12271||e>=12289&&e<=55295||e>=63744&&e<=64975||e>=65008&&e<=65533||e>=65536&&e<=983039}function au(e){return e===95||vb(e)}function uA(e){return au(e)||e===45||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}function pl(e,n,a){const r=Ht(e,n);return r&&a(r.codePoint)?r.rawWidth:0}function xb(e,n){return pl(e,n,vb)}function dA(e,n){return pl(e,n,au)}function Lc(e,n){return pl(e,n,uA)}function Ip(e,n){return pl(e,n,a=>a>=48&&a<=57)}function fA(e){return au(e)||e>=48&&e<=57}function pA(e){return au(e)||e>=48&&e<=57||e===183||e>=768&&e<=879||e>=8255&&e<=8256}function hA(e,n){return pl(e,n,fA)}function g0(e,n){return pl(e,n,pA)}function mA(e,n){const a=Ht(e,n);if(!a||a.codePoint!==63&&a.codePoint!==36)return null;let r=n+a.rawWidth;const o=hA(e,r);if(!o)return null;r+=o;let s=g0(e,r);for(;s;)r+=s,s=g0(e,r);return r}function gA(e,n,a){const r=Ht(e,n);return(r==null?void 0:r.codePoint)===a?r.rawWidth:0}function yA(e,n){const a=Ht(e,n);if(!a||a.codePoint!==34&&a.codePoint!==39)return null;const r=a.codePoint,o=a.rawWidth>1,s=g=>{if(o)return gA(e,g,r);const x=e.codePointAt(g);return x===r?x>65535?2:1:0};let u=n+a.rawWidth;const d=s(u),p=d?s(u+d):0,f=d>0&&p>0;f&&(u+=d+p);let y=!1;for(;u<e.length;){if(!o&&e.charCodeAt(u)===92){if(e[u+1]==="u"||e[u+1]==="U"){const E=Ht(e,u);E||(y=!0),u+=(E==null?void 0:E.rawWidth)??1;continue}const j=e.codePointAt(u+1);u+=1+(j!==void 0&&j>65535?2:1);continue}const g=Ht(e,u);if(!g){y=!0,u++;continue}if(g.codePoint===92){const j=Ht(e,u+g.rawWidth);u+=g.rawWidth+((j==null?void 0:j.rawWidth)??0);continue}const x=s(u);if(!x){u+=g.rawWidth;continue}if(!f)return{end:u+x,closed:!0,malformedUchar:y};const b=u+x,k=s(b),C=k?s(b+k):0;if(k&&C)return{end:b+k+C,closed:!0,malformedUchar:y};u+=g.rawWidth}return{end:e.length,closed:!1,malformedUchar:y}}function y0(e){return e>32&&e!==60&&e!==62&&e!==34&&e!==123&&e!==125&&e!==124&&e!==94&&e!==96&&e!==92}function vA(e,n,a){let r=n;if(!a){let s=null,u=n;for(;r<e.length;){const d=e.charCodeAt(r);if(d===62)return{end:r+1,logicalValue:s===null?e.slice(n,r):[...s,e.slice(u,r)].join("")};if(d===92){const f=Ht(e,r);if(!f||e[r+1]!=="u"&&e[r+1]!=="U")return null;s??(s=[]),s.push(e.slice(u,r),String.fromCodePoint(f.codePoint)),r+=f.rawWidth,u=r;continue}const p=e.codePointAt(r);if(p===void 0||!zp(p)||!y0(p))return null;r+=p>65535?2:1}return null}const o=[];for(;r<e.length;){const s=Ht(e,r);if(!s)return null;if(s.codePoint===62)return{end:r+s.rawWidth,logicalValue:o.join("")};if(!y0(s.codePoint))return null;o.push(String.fromCodePoint(s.codePoint)),r+=s.rawWidth}return null}function xA(e,n){const a=Ht(e,n);return!a||a.codePoint!==60?null:vA(e,n+a.rawWidth,a.rawWidth>1)}function Oo(e,n,a){const r=Ht(e,n);return(r==null?void 0:r.codePoint)===a?r.rawWidth:0}function v0(e,n){const a=Ht(e,n);return a&&(a.codePoint>=48&&a.codePoint<=57||a.codePoint>=65&&a.codePoint<=70||a.codePoint>=97&&a.codePoint<=102)?a.rawWidth:0}function bb(e,n){const a=Ht(e,n);if(!a)return 0;if(a.codePoint===37){const s=v0(e,n+a.rawWidth);if(!s)return 0;const u=v0(e,n+a.rawWidth+s);return u?a.rawWidth+s+u:0}if(a.codePoint!==92)return 0;const r=Ht(e,n+a.rawWidth);if(!r)return 0;const o=String.fromCodePoint(r.codePoint);return"_~.-!$&'()*+,;=/?#@%".includes(o)?a.rawWidth+r.rawWidth:0}function bA(e,n){return dA(e,n)||Ip(e,n)||Oo(e,n,58)||bb(e,n)}function wA(e,n){return Lc(e,n)||Oo(e,n,58)||bb(e,n)}function x0(e,n){let a=n,r=bA(e,a);if(!r)return a;a+=r;let o=a;for(;a<e.length;){if(r=wA(e,a),r){a+=r,o=a;continue}const s=Oo(e,a,46);if(s){a+=s;continue}break}return o}function SA(e,n){const a=xb(e,n);if(!a)return;let r=n+a,o=r;for(;r<e.length;){const u=Lc(e,r);if(u){r+=u,o=r;continue}const d=Oo(e,r,46);if(d){r+=d;continue}break}const s=Oo(e,r,58);return s&&r===o?{end:r+s}:void 0}function kA(e){return/\s/u.test(String.fromCodePoint(e))}function Lf(e,n,a){for(let r=n;r<a;r++)e[r]=" "}function CA(e,n,a){const r=[];let o=n;for(;o<a;){const s=Ht(e,o);if(!s||o+s.rawWidth>a)return null;r.push(String.fromCodePoint(s.codePoint)),o+=s.rawWidth}return r.join("")}function zf(e,n){let a=n,r=0,o=Ip(e,a);for(;o>0;)a+=o,r++,o=Ip(e,a);return{end:a,count:r}}function EA(e,n){let a=n;const r=Ht(e,a);((r==null?void 0:r.codePoint)===43||(r==null?void 0:r.codePoint)===45)&&(a+=r.rawWidth);const o=zf(e,a);a=o.end;const s=a,u=Ht(e,a);let d=0,p=!1;if((u==null?void 0:u.codePoint)===46){p=!0;const y=zf(e,a+u.rawWidth);a=y.end,d=y.count}if(o.count===0&&d===0)return null;const f=Ht(e,a);if((f==null?void 0:f.codePoint)===69||(f==null?void 0:f.codePoint)===101){let y=a+f.rawWidth;const g=Ht(e,y);((g==null?void 0:g.codePoint)===43||(g==null?void 0:g.codePoint)===45)&&(y+=g.rawWidth);const x=zf(e,y);if(x.count>0)return x.end}return p&&d===0?o.count>0?s:null:a}function fo(e,n,a,r,o=CA(n,a,r)){if(o===null)return null;const s={raw:n.slice(a,r),logicalValue:o,start:a,end:r};return e==="word"?{kind:e,...s,upper:o.toUpperCase()}:{kind:e,...s}}function AA(e){return e?e.kind==="variable"||e.kind==="prefixed-name"||e.kind==="number"||e.kind==="iri"||e.kind==="string"?!0:e.kind==="word"?e.upper==="TRUE"||e.upper==="FALSE":e.logicalValue===")":!1}function jA(e,n){return!(n[n.length-1]==="("&&AA(e[e.length-1]))}function TA(e,n){if(n==="("||n==="{"){e.push(n);return}const a=n===")"?"(":n==="}"?"{":void 0;a!==void 0&&e[e.length-1]===a&&e.pop()}function NA(e){var r;const n=[];let a=0;for(;a<e.length;){const o=e[a];if((o==null?void 0:o.kind)!=="word")break;if(o.upper==="BASE"&&((r=e[a+1])==null?void 0:r.kind)==="iri"){a+=2;continue}if(o.upper!=="PREFIX")break;const s=e[a+1],u=e[a+2];if((s==null?void 0:s.kind)!=="prefixed-name"||o.end===s.start||(u==null?void 0:u.kind)!=="iri"||s.logicalValue.indexOf(":")!==s.logicalValue.length-1)break;n.push(s.logicalValue.slice(0,-1)),a+=3}return{endTokenIndex:a,declaredPrefixes:n}}function b0(e){const n=e.split(""),a=[],r=[],o=[];let s=!1,u=0;for(;u<e.length;){const f=Ht(e,u);if(!f)return null;if(kA(f.codePoint)){a.push(String.fromCodePoint(f.codePoint)),u+=f.rawWidth;continue}if(f.codePoint===35){const k=u;u+=f.rawWidth;const C=u;for(;u<e.length&&e[u]!==`
|
|
62
|
+
`&&e[u]!=="\r";)u++;a.push(String.fromCodePoint(f.codePoint),e.slice(C,u)),Lf(n,k,u);continue}if(f.codePoint===34||f.codePoint===39){const k=u,C=yA(e,k);if(!C){a.push(String.fromCodePoint(f.codePoint)),u+=f.rawWidth;continue}if(C.malformedUchar)return null;u=C.end,a.push(e.slice(k,u)),Lf(n,k,u),r.push({kind:"string",raw:e.slice(k,u),start:k,end:u}),C.closed||(s=!0);continue}if(f.codePoint===60&&jA(r,o)){const k=xA(e,u);if(k!==null){const C=u;u=k.end,a.push(e.slice(C,u)),Lf(n,C,u),r.push({kind:"iri",raw:e.slice(C,u),logicalValue:k.logicalValue,start:C,end:u});continue}}if(f.codePoint===63||f.codePoint===36){const k=mA(e,u);if(k!==null){const C=u;u=k;const j=fo("variable",e,C,u);if(!j)return null;r.push(j),a.push(j.logicalValue);continue}}const y=EA(e,u);if(y!==null){const k=u;u=y;const C=fo("number",e,k,u);if(!C)return null;r.push(C),a.push(C.logicalValue);continue}if(f.codePoint===58){const k=u;u=x0(e,u+f.rawWidth);const C=fo("prefixed-name",e,k,u);if(!C)return null;r.push(C),a.push(C.logicalValue);continue}const g=xb(e,u);if(g){const k=u,C=SA(e,u);let j;if(C)j="prefixed-name",u=x0(e,C.end);else{j="word",u+=g;let _=Lc(e,u);for(;_;)u+=_,_=Lc(e,u)}const E=fo(j,e,k,u);if(!E)return null;r.push(E),a.push(E.logicalValue);continue}const x=u;u+=f.rawWidth;const b=fo("symbol",e,x,u,String.fromCodePoint(f.codePoint));if(!b)return null;r.push(b),a.push(b.logicalValue),TA(o,b.logicalValue)}const d=n.join(""),p=new Set;for(const f of r)f.kind==="word"&&p.add(f.upper);return{masked:d,materialized:a.join(""),tokens:r,unterminated:s,wordTokens:p,prologue:NA(r)}}function w0(e){return{status:"malformed-uchar",source:e,masked:" ".repeat(e.length),materialized:e,tokens:[],unterminated:!1,wordTokens:new Set,prologue:{endTokenIndex:0,declaredPrefixes:[]}}}function RA(e,n){return e.unterminated!==n.unterminated||e.tokens.length!==n.tokens.length?!1:e.tokens.every((a,r)=>{const o=n.tokens[r];return(o==null?void 0:o.kind)!==a.kind?!1:a.kind==="string"?o.raw===a.raw:o.kind==="string"?!1:o.logicalValue===a.logicalValue})}function _A(e){const n=b0(e);if(n===null)return w0(e);if(n.materialized!==e){const a=b0(n.materialized);if(a===null||a.materialized!==n.materialized||!RA(n,a))return w0(e)}return{status:"valid",source:e,masked:n.masked,materialized:n.materialized,tokens:n.tokens,unterminated:n.unterminated,wordTokens:new Set(n.wordTokens),prologue:n.prologue}}function If(e,n,a){const r=[],o=Array(e.length).fill(-1),s=[],u=[];let d=0,p=!0;for(let f=0;f<e.length;f++){r.push(d);const y=e[f];if(y.kind!=="symbol")continue;if(y.logicalValue===n){u.push(f),d++;continue}if(y.logicalValue!==a)continue;const g=u.pop();g===void 0?p=!1:(o[g]=f,o[f]=g,s.push({openingTokenIndex:g,closingTokenIndex:f,depth:r[g]})),d--}return Object.freeze({depthBefore:Object.freeze(r),matchingTokenIndexes:Object.freeze(o),ranges:Object.freeze(s.sort((f,y)=>f.openingTokenIndex-y.openingTokenIndex)),balanced:p&&u.length===0&&d===0})}function OA(e){const{tokens:n}=e,a=If(n,"{","}"),r=If(n,"(",")"),o=If(n,"[","]");return Object.freeze({braces:a,parentheses:r,brackets:o,balanced:a.balanced&&r.balanced&&o.balanced})}function S0(e,n,a=0,r=e.depthBefore.length){const o=[];for(let s=a;s<r;s++)e.depthBefore[s]===n&&o.push(s);return o}function wb(e){return(e==null?void 0:e.kind)==="iri"?e.logicalValue:null}function DA(e){const n=new Map;for(let a=0;a+2<e.prologue.endTokenIndex;a++){const r=e.tokens[a],o=e.tokens[a+1],s=e.tokens[a+2];if((r==null?void 0:r.kind)!=="word"||r.upper!=="PREFIX"||(o==null?void 0:o.kind)!=="prefixed-name"||!o.logicalValue.endsWith(":"))continue;const u=wb(s);u!==null&&n.set(o.logicalValue.slice(0,-1),u),a+=2}return n}function MA(e,n){const{tokens:a}=e,r=[];let o=-1;for(const f of S0(n.braces,0)){const y=a[f];if((y==null?void 0:y.kind)==="word"&&y.upper==="WHERE"){const g=a[f+1];if((g==null?void 0:g.kind)!=="symbol"||g.logicalValue!=="{")return null;o=f+1;break}(y==null?void 0:y.kind)==="symbol"&&y.logicalValue==="{"&&r.push(f)}const s=o>=0?o:n.braces.balanced?r.at(-1)??-1:-1;if(s<0)return null;const u=n.braces.matchingTokenIndexes[s]??-1;if(u<0)return null;const d=n.braces.depthBefore[s]+1,p=S0(n.braces,d,s+1,u).some(f=>{const y=a[f];return(y==null?void 0:y.kind)==="word"&&y.upper==="UNION"});return{openStart:a[s].start,openEnd:a[s].end,close:a[u].start,hasUnion:p,openingTokenIndex:s,closingTokenIndex:u}}function k0(e,n,a){const r=[],o=new Set;for(let s=n;s<a;s++){const u=e.tokens[s];if((u==null?void 0:u.kind)!=="variable")continue;const d=u.logicalValue.slice(1);o.has(d)||(o.add(d),r.push({source:u.raw,logicalName:d}))}return r}function LA(e){const n=OA(e),a=MA(e,n),r=e.tokens[e.prologue.endTokenIndex],o=DA(e),s=n.braces.depthBefore,u=[],d=[],p=new Set;let f=!1;for(let y=0;y<e.tokens.length;y++){const g=e.tokens[y];if(g.kind!=="word"||(g.upper==="FROM"&&(f=!0),g.upper!=="GRAPH"))continue;const x=e.tokens[y+1];if((x==null?void 0:x.kind)==="variable"){const k={source:x.raw,logicalName:x.logicalValue.slice(1)};u.push({kind:"variable",variable:k,keywordTokenIndex:y,targetTokenIndex:y+1,braceDepth:s[y]}),p.has(k.logicalName)||(p.add(k.logicalName),d.push(k));continue}const b=wb(x);if(b!==null){u.push({kind:"iri",iri:b,keywordTokenIndex:y,targetTokenIndex:y+1,braceDepth:s[y]});continue}if((x==null?void 0:x.kind)==="prefixed-name"){const k=x.logicalValue.indexOf(":"),C=o.get(x.logicalValue.slice(0,k));if(k>=0&&C!==void 0){u.push({kind:"iri",iri:`${C}${x.logicalValue.slice(k+1)}`,keywordTokenIndex:y,targetTokenIndex:y+1,braceDepth:s[y]});continue}}u.push({kind:"invalid",keywordTokenIndex:y,targetTokenIndex:y+1,braceDepth:s[y]})}return{source:e.source,prepared:e,structure:n,operation:(r==null?void 0:r.kind)==="word"?r.upper:null,where:a,queryVariables:k0(e,0,e.tokens.length),whereVariables:a?k0(e,a.openingTokenIndex+1,a.closingTokenIndex):[],prefixes:o,hasDatasetClause:f,hasGraphClause:u.length>0,graphTargets:u,graphVariables:d}}const zA=["SELECT","CONSTRUCT","ASK","DESCRIBE"],Sb=["INSERT","DELETE","LOAD","CLEAR","DROP","CREATE","COPY","MOVE","ADD"],IA=[...Sb,"WITH"],C0=new sA,PA=new Set(Sb),UA=new Set(IA),BA=new Set(zA);function HA(e){const{operation:n}=e;return n===null?"UNKNOWN":kb(n)||Cb(n)?n:"UNKNOWN"}function kb(e){return BA.has(e)}function Cb(e){return UA.has(e)}function $A(e){return kb(e)?{kind:"read",form:e}:Cb(e)?{kind:"update"}:{kind:"unknown"}}function Pf(e){return{operation:$A(e.form),mutatingKeyword:e.mutatingKeyword}}function E0(e){if(e.status!=="valid")return Object.freeze({facts:Object.freeze({form:"UNKNOWN",mutatingKeyword:null}),largeCacheable:!1});const n=LA(e),a=HA(n),r=e.tokens.find(o=>o.kind==="word"&&PA.has(o.upper));return Object.freeze({facts:Object.freeze({form:a,mutatingKeyword:(r==null?void 0:r.kind)==="word"?r.raw:null}),largeCacheable:a!=="UNKNOWN"&&!e.unterminated&&n.structure.balanced})}function qA(e){if(typeof e!="string")return Pf(E0(e).facts);const n=C0.get(e);if(n)return Pf(n.facts);const a=E0(_A(e));return C0.set(e,a),Pf(a.facts)}function FA(e){return qA(e).operation}const A0=(e,n,a)=>{const r=new URLSearchParams;n&&r.set("key",n),a!=null&&a.extended&&r.set("extended","1");const o=r.toString();return fl(`/api/pca/${encodeURIComponent(e)}${o?`?${o}`:""}`).then(s=>a!=null&&a.extended?{...s,extendedRequested:!0}:s)},p8=e=>Xt("/api/pca",{tokens:e.tokens,primaryNode:e.primaryNode}),h8=(e,n)=>Xt(`/api/pca/${encodeURIComponent(e)}/agent`,{agent:n}),m8=(e,n)=>aA(`/api/pca/${encodeURIComponent(e)}/agent/${encodeURIComponent(n)}`),g8=(e,n)=>Xt(`/api/pca/${encodeURIComponent(e)}/funds`,{tokens:n}),y8=e=>Xt(`/api/pca/${encodeURIComponent(e)}/settle`,{}),v8=e=>fl(`/api/pca/${encodeURIComponent(e)}/agents`),x8=e=>fl(`/api/pca/agent/${encodeURIComponent(e)}`),b8=e=>fl("/api/pca/mine?hydrate=1"),w8=e=>fl(`/api/pca/designatable-nodes${e!=null&&e.fresh?"?fresh=1":""}`),GA=()=>fl("/api/pca/contracts");function Eb(e){var a;if(!(e instanceof an))return!1;const n=(a=e.body)==null?void 0:a.code;return typeof n=="string"&&(n.startsWith("RPC_")||n==="TIMEOUT")}function S8(e){return e instanceof an&&e.status===503&&!Eb(e)}function k8(e){if(!(e instanceof an)||e.status!==503)return!1;const n=e.body;return(n==null?void 0:n.code)==="PCA_LOOKUP_READ_FAILED"||(n==null?void 0:n.error)==="PCA_LOOKUP_READ_FAILED"}const VA=["PrimaryNodeNotInShardingTable","PrimaryNodeUnchanged","PrimaryNodeChangeRateLimited","ZeroPrimaryNode","InvalidAmount","ZeroAgentAddress","TokenTransferFailed","NotAccountOwner","AgentAlreadyRegistered","AgentNotRegistered","AgentCapReached","AccountExpired","AccountAlreadyFullySettled","UnknownAccount"];function C8(e,n={}){if(!(e instanceof an))return null;const a=e.status,r=e.body??{},o=typeof r.error=="string"&&r.error.length>0?r.error:e.message,s=n.accountId?`PCA #${n.accountId}`:"this Publisher Conviction Account",u=r.existingAccountId!=null?String(r.existingAccountId):void 0;if(Eb(e))return{code:"ServerError",status:a,message:"The chain RPC is temporarily unavailable — try again."};if(a===503)return{code:"FEATURE_UNAVAILABLE",status:a,message:"Publisher Conviction Accounts aren't available on this network."};const d=VA.find(p=>new RegExp(`\\b${p}\\b`).test(o));if(d){let p;switch(d){case"InvalidAmount":p="Enter a TRAC amount greater than 0.";break;case"PrimaryNodeNotInShardingTable":p="That primary node isn't a staked node in the sharding table.";break;case"ZeroPrimaryNode":p="Choose a staked node as the primary node.";break;case"PrimaryNodeUnchanged":p="That's already this account's primary node.";break;case"PrimaryNodeChangeRateLimited":p="The primary node was changed too recently — try again later.";break;case"ZeroAgentAddress":p="Enter a valid operational wallet address.";break;case"TokenTransferFailed":p="The TRAC transfer failed — check the owner wallet's TRAC balance and allowance.";break;case"NotAccountOwner":p=`This node isn't the owner of ${s}, so it can't manage it.`;break;case"UnknownAccount":p=`${s} doesn't exist.`;break;case"AgentAlreadyRegistered":p=u?`This operational wallet is already an approved publishing wallet on PCA #${u} — deregister it there first.`:"This operational wallet is already approved on another PCA — deregister it there first.";break;case"AgentNotRegistered":p=`This operational wallet isn't an approved publishing wallet on ${s}.`;break;case"AgentCapReached":p=`${s} already has the maximum 100 approved publishing wallets.`;break;case"AccountExpired":p=`${s} has expired.`;break;case"AccountAlreadyFullySettled":p=`${s} is already fully settled.`;break;default:p=o}return{code:d,status:a,message:p,...u?{existingAccountId:u}:{}}}return a===404?{code:"UnknownAccount",status:a,message:`${s} doesn't exist.`}:a===403?{code:"NotAccountOwner",status:a,message:`This node isn't the owner of ${s}, so it can't manage it.`}:a===400?{code:"BadRequest",status:a,message:o}:a===409?{code:"Conflict",status:a,message:o}:a>=500?{code:"ServerError",status:a,message:"Something went wrong talking to the chain — try again."}:{code:"Unknown",status:a,message:o}}const j0="did:dkg:context-graph:",Ab=6e4;function Eh(e){return`${e} got no response within ${pb/6e4} minutes. The outcome is unknown: the node keeps working after the page stops waiting, so it may still complete. Check the Knowledge Asset's history before retrying.`}function jb(e){const n=e.trim();return n.startsWith(j0)?n.slice(j0.length):n}class zc extends Error{constructor(a,r={}){super(a);Ut(this,"status");Ut(this,"code");Ut(this,"source");Ut(this,"details");Ut(this,"correlationId");Ut(this,"timeoutMs");Ut(this,"target");Ut(this,"route");Ut(this,"integrationId");Ut(this,"retryable");Ut(this,"text");Ut(this,"timedOut");this.name="LocalAgentApiError",Object.assign(this,r)}}const WA=()=>Qe("/api/status"),E8=()=>Qe("/api/settings/retention"),A8=e=>Ch("/api/settings/retention",{retentionDays:e}),j8=()=>Qe("/api/settings/telemetry"),T8=e=>Ch("/api/settings/telemetry",{enabled:e}),YA=()=>Qe("/api/connections"),KA=(e,n=1e4)=>kh(`${ra}/api/connect`,{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify({multiaddr:e})},n).then(async a=>{if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}),QA=(e,n=2e4)=>kh(`${ra}/api/connect`,{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify({peerId:e})},n).then(async a=>{if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}),Tb=()=>Qe("/api/agents"),XA=()=>Qe("/api/metrics"),N8=(e,n,a=300)=>Qe(`/api/metrics/history?from=${e}&to=${n}&maxPoints=${a}`),ZA=(e={})=>{const n=new URLSearchParams({...e,phases:"1"}).toString();return Qe(`/api/operations?${n}`)},R8=e=>Qe(`/api/operations/${e}`),_8=e=>{const n=e?`?periodMs=${e}`:"";return Qe(`/api/error-hotspots${n}`)},O8=(e={})=>{const n=new URLSearchParams;e.phase&&n.set("phase",e.phase),e.operationName&&n.set("operationName",e.operationName),e.periodMs&&n.set("periodMs",String(e.periodMs)),e.q&&n.set("q",e.q),e.limit&&n.set("limit",String(e.limit));const a=n.toString();return Qe(`/api/failed-operations${a?"?"+a:""}`)},D8=e=>Qe(`/api/replication/summary${e?`?periodMs=${e}`:""}`),M8=e=>Qe(`/api/replication/per-cg${e?`?periodMs=${e}`:""}`),L8=(e={})=>{const n=new URLSearchParams;e.periodMs&&n.set("periodMs",String(e.periodMs)),e.bucketMs&&n.set("bucketMs",String(e.bucketMs)),e.cg&&n.set("cg",e.cg);const a=n.toString();return Qe(`/api/replication/timeline${a?"?"+a:""}`)},z8=()=>Qe("/api/replication/cursors"),I8=(e,n=100)=>Qe(`/api/replication/events?cg=${encodeURIComponent(e)}&limit=${n}`),P8=e=>Qe(`/api/success-rates?periodMs=${e}`),U8=(e,n)=>{const a=`periodMs=${e}${n?`&bucketMs=${n}`:""}`;return Qe(`/api/per-type-stats?${a}`)},JA=(e={})=>{const n=new URLSearchParams;e.lines&&n.set("lines",String(e.lines)),e.q&&n.set("q",e.q);const a=n.toString();return Qe(`/api/node-log${a?"?"+a:""}`)};async function Ah(){return{contextGraphs:((await yb("/api/context-graph/list",Ab)).contextGraphs??[]).filter(a=>!a.isSystem)}}const iu=()=>Qe("/api/agent/identity");async function ej(e,n,a,r){const o=new AbortController,s=setTimeout(()=>o.abort(),3e4);try{const u=await fetch(`${ra}/api/context-graph/create`,{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify({id:e,name:n,description:a,...r!=null&&r.register?{register:!0}:{},...r!=null&&r.allowedAgents?{allowedAgents:r.allowedAgents}:{},...(r==null?void 0:r.accessPolicy)!==void 0?{accessPolicy:r.accessPolicy}:{},...(r==null?void 0:r.publishPolicy)!==void 0?{publishPolicy:r.publishPolicy}:{}}),signal:o.signal});if(!u.ok){const d=await u.json().catch(()=>({}));throw new Error((d==null?void 0:d.error)??`HTTP ${u.status}`)}return u.json()}catch(u){throw u.name==="AbortError"?new Error("Creating project is taking longer than expected — it may still complete in the background. Refresh the page in a moment."):u}finally{clearTimeout(s)}}const B8=(e,n)=>Xt(`/api/context-graph/${encodeURIComponent(e)}/remove-participant`,{agentAddress:n}),tj=e=>Qe(`/api/context-graph/${encodeURIComponent(e)}/participants`),nj=e=>Xt(`/api/context-graph/${encodeURIComponent(e)}/sign-join`,{}),aj=(e,n)=>Xt(`/api/context-graph/${encodeURIComponent(e)}/request-join`,n),H8=e=>Qe(`/api/context-graph/${encodeURIComponent(e)}/join-requests`),ij=(e,n)=>Xt(`/api/context-graph/${encodeURIComponent(e)}/approve-join`,{agentAddress:n}),rj=(e,n)=>Xt(`/api/context-graph/${encodeURIComponent(e)}/reject-join`,{agentAddress:n}),lj={md:"text/markdown",markdown:"text/markdown",txt:"text/plain",csv:"text/csv",json:"application/json",xml:"application/xml",yaml:"text/yaml",yml:"text/yaml",pdf:"application/pdf",docx:"application/vnd.openxmlformats-officedocument.wordprocessingml.document",doc:"application/msword",xlsx:"application/vnd.openxmlformats-officedocument.spreadsheetml.sheet",pptx:"application/vnd.openxmlformats-officedocument.presentationml.presentation",epub:"application/epub+zip",ttl:"text/turtle",rdf:"application/rdf+xml",owl:"application/rdf+xml",html:"text/html",htm:"text/html",py:"text/x-python",ts:"text/typescript",js:"text/javascript",tsx:"text/typescript",jsx:"text/javascript",java:"text/x-java",go:"text/x-go",rs:"text/x-rust",c:"text/x-c",cpp:"text/x-c++",h:"text/x-c",png:"image/png",jpg:"image/jpeg",jpeg:"image/jpeg",webp:"image/webp"};function oj(e){var a;if(e.type&&e.type!=="application/octet-stream")return e.type;const n=((a=e.name.split(".").pop())==null?void 0:a.toLowerCase())??"";return lj[n]}async function sj(e,n,a,r){const o=new FormData;o.append("file",a),o.append("contextGraphId",n);const s=oj(a);return s&&o.append("contentType",s),mb(`/api/knowledge-assets/${encodeURIComponent(e)}/wm/import-file`,{method:"POST",headers:$t(),body:o},Eh(`Importing "${a.name}" into "${e}"`))}function cj(e,n){var d;const a=e&&typeof e=="object"&&!Array.isArray(e)?e:{},r=a.result??a.results,o=r&&typeof r=="object"&&!Array.isArray(r)?r:{};if(o.type==="boolean"&&typeof o.value=="boolean")return{result:{type:"boolean",value:o.value}};if(o.type==="quads"&&Array.isArray(o.quads))return{result:{type:"quads",quads:o.quads}};if(o.type==="bindings"&&Array.isArray(o.bindings))return{result:{type:"bindings",bindings:o.bindings}};const s=FA(n),u=Array.isArray(o.bindings)?o.bindings:[];if(s.kind==="read"&&s.form==="ASK"){const p=(d=u[0])==null?void 0:d.result,f=p&&typeof p=="object"&&!Array.isArray(p)?p.value:p;return{result:{type:"boolean",value:String(f).toLowerCase()==="true"}}}return s.kind==="read"&&(s.form==="CONSTRUCT"||s.form==="DESCRIBE")?{result:{type:"quads",quads:Array.isArray(o.quads)?o.quads:[]}}:{result:{type:"bindings",bindings:u}}}const Uf=new Map;function Ic(e){const n=JSON.stringify(e),a=Uf.get(n);if(a)return a;const r=(async()=>{const o=await fetch(`${ra}/api/query`,{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:n});if(!o.ok){const s=await o.json().catch(()=>({})),u=(s==null?void 0:s.error)??`HTTP ${o.status}`;throw new an(o.status,u,s)}return cj(await o.json(),String(e.sparql??""))})().finally(()=>{Uf.delete(n)});return Uf.set(n,r),r}const jh=(e,n={})=>Ic({sparql:e,...n});async function $8(e){var s;const a=`SELECT ?name ?ual WHERE {
|
|
63
|
+
GRAPH <${`did:dkg:context-graph:${e}/_meta`}> {
|
|
64
|
+
?lc <http://dkg.io/ontology/assertionName> ?name ;
|
|
65
|
+
<http://dkg.io/ontology/reservedUal> ?ual .
|
|
66
|
+
}
|
|
67
|
+
}`,r=await jh(a,{contextGraphId:e}),o={};for(const u of((s=r==null?void 0:r.result)==null?void 0:s.bindings)??[]){const d=Uc(u.name),p=Uc(u.ual);d&&p&&!o[d]&&(o[d]=p)}return o}const q8=(e,n)=>Xt("/api/profile/query-catalog/write",{contextGraphId:e,quads:n}),F8=e=>Xt("/api/profile/query-catalog/read",{contextGraphId:e}),uj=new Set(["clearAfter","publishEpochs","publisherNodeIdentityIdOverride"]),dj=e=>{if(typeof e=="string"&&/^\d+$/.test(e))return e;throw new Error("publisherNodeIdentityIdOverride must be passed as a decimal string")},fj=(e,n=[])=>{if(!e)return;const a=Object.keys(e).filter(s=>!uj.has(s)&&!n.includes(s));if(a.length>0)throw new Error(`Unsupported finalized publish option(s): ${a.join(", ")}`);const r={};e.clearAfter!==void 0&&(r.clearSharedMemoryAfter=e.clearAfter),e.publishEpochs!==void 0&&(r.publishEpochs=e.publishEpochs);const o=e.publisherNodeIdentityIdOverride;return o!==void 0&&(r.publisherNodeIdentityIdOverride=dj(o)),Object.keys(r).length>0?r:void 0};function pj(e){const n=e;if(Array.isArray(n.entities))throw Object.assign(new Error("Knowledge Assets are shared atomically; root-entity selection is not supported"),{code:"KA_ATOMIC_SHARE_REQUIRED"});if(n.entities!==void 0&&n.entities!=="all")throw Object.assign(new Error("Knowledge Assets are shared atomically; omit entities to share the complete asset"),{code:"KA_ATOMIC_SHARE_REQUIRED"});if(n.skipSeal===!0)throw Object.assign(new Error("Knowledge Assets are always sealed before sharing"),{code:"UNSEALED_SHARE_BLOCKED"});if(n.skipSeal!==void 0&&n.skipSeal!==!1)throw new TypeError("skipSeal must be false or omitted");if(n.awaitCuratorAck!==void 0&&typeof n.awaitCuratorAck!="boolean")throw new TypeError("awaitCuratorAck must be a boolean when supplied");return{...n.subGraphName?{subGraphName:n.subGraphName}:{},awaitCuratorAck:n.awaitCuratorAck??!0}}const hj=(e,n,a={})=>{const r=pj(a);return gb(`/api/knowledge-assets/${encodeURIComponent(n)}/swm/share`,{contextGraphId:jb(e),...r.subGraphName?{subGraphName:r.subGraphName}:{},awaitCuratorAck:r.awaitCuratorAck},Eh(`Sharing "${n}"`))},mj=(e,n,a={})=>{const r=fj(a,["subGraphName"]);return gb(`/api/knowledge-assets/${encodeURIComponent(n)}/vm/publish`,{contextGraphId:jb(e),...a.subGraphName?{subGraphName:a.subGraphName}:{},...r?{options:r}:{}},Eh(`Publishing "${n}"`))};async function G8(e,n){let a=0,r=0,o;const s=[],u=[];let d=null,p=0n,f=0n,y=0n,g=0n,x,b=!0,k=!0;for(const j of n)try{const E=await mj(e,j.name,j.subGraph?{subGraphName:j.subGraph}:{});a+=1,E.contextGraphError&&(r+=1,o===void 0&&(o=E.contextGraphError));const _=E;(!d||_.status==="confirmed"&&_.txHash&&!_.contextGraphError)&&(d=_);const R=_.convictionCostCovered;if(R)try{p+=BigInt(R.baseCost),f+=BigInt(R.discountedCost),y+=BigInt(R.drawnFromEpoch),g+=BigInt(R.drawnFromTopUp),x?(R.accountId!==x.accountId&&(b=!1),R.epoch!==x.epoch&&(k=!1)):x=R}catch{}}catch(E){const _=(E==null?void 0:E.message)??"publish failed",R={name:j.name,...j.subGraph?{subGraph:j.subGraph}:{},error:_};E instanceof hb?u.push(R):s.push(R)}const C=x?{...b&&x.accountId?{accountId:x.accountId}:{},...k&&x.epoch!=null?{epoch:x.epoch}:{},baseCost:p.toString(),discountedCost:f.toString(),drawnFromEpoch:y.toString(),drawnFromTopUp:g.toString()}:void 0;return{published:a,total:n.length,partial:r,partialError:o,failures:s,...u.length>0?{outcomeUnknown:u}:{},sample:d,convictionCostCovered:C}}function V8(e){var a;const n=((a=e.outcomeUnknown)==null?void 0:a.length)??0;if(n!==0)return`${n} knowledge asset${n===1?"":"s"}: publish outcome unknown — the node may still publish ${n===1?"it":"them"}. Check the history before publishing again.`}async function W8(e,n="wm",a={}){var _,R,F,U,D,W;const r=a.includeQueryCatalog??!1,o=(Q,M)=>Q!=="meta"||r&&M.startsWith("query-catalog-");if(n==="swm"){const Q=`did:dkg:context-graph:${e}/_meta`,M=`did:dkg:context-graph:${e}/`,T=`urn:dkg:assertion:${e}:`,V=`SELECT ?g ?vm WHERE {
|
|
68
|
+
GRAPH <${Q}> {
|
|
69
|
+
?g <http://dkg.io/ontology/memoryLayer> "SWM"
|
|
70
|
+
OPTIONAL { ?g <http://dkg.io/ontology/vmCurrentAssertion> ?vm }
|
|
71
|
+
}
|
|
72
|
+
${r?"":'FILTER(!CONTAINS(STR(?g), "/meta/assertion/"))'}
|
|
73
|
+
}`,ae=await jh(V,{contextGraphId:e}),P=((_=ae==null?void 0:ae.result)==null?void 0:_.bindings)??[],K=new Set,B=[];for(const G of P){const O=typeof G.g=="string"?G.g:(R=G.g)==null?void 0:R.value;if(!O)continue;const L=typeof G.vm=="string"?G.vm:(F=G.vm)==null?void 0:F.value;let X,N;if(O.startsWith(M)){const pe=O.slice(M.length).split("/");if(pe.length===3&&pe[0]==="assertion")N=pe[2];else if(pe.length===4&&pe[1]==="assertion")X=pe[0],N=pe[3];else continue}else if(O.startsWith(T)){const pe=O.slice(T.length);let he=/^(0x[0-9a-fA-F]{40}):(.+)$/.exec(pe);he?N=he[2]:(he=/^([^:]+):(0x[0-9a-fA-F]{40}):(.+)$/.exec(pe),he&&(X=he[1],N=he[3]))}else continue;if(!N||!o(X,N))continue;const ue=`${X??""} ${N}`;B.push({key:ue,name:N,subGraph:X,g:O}),L&&K.add(ue)}const Z=new Set,ie=[];for(const G of B)K.has(G.key)||Z.has(G.key)||(Z.add(G.key),ie.push({name:G.name,graphUri:G.g,subGraph:G.subGraph}));return ie}const s=`did:dkg:context-graph:${e}/_meta`,u=`did:dkg:context-graph:${e}/`,d=r?"":'FILTER(!CONTAINS(STR(?g), "/meta/assertion/"))',p=`SELECT ?g WHERE {
|
|
74
|
+
GRAPH <${s}> { ?g <http://dkg.io/ontology/memoryLayer> "WM" }
|
|
75
|
+
${d}
|
|
76
|
+
}`,f=`SELECT ?g (COUNT(*) AS ?cnt) WHERE {
|
|
77
|
+
GRAPH <${s}> {
|
|
78
|
+
?g <http://dkg.io/ontology/memoryLayer> "WM" ;
|
|
79
|
+
<http://dkg.io/ontology/assertionGraph> ?dg
|
|
80
|
+
}
|
|
81
|
+
GRAPH ?dg { ?s ?p ?o }
|
|
82
|
+
${d}
|
|
83
|
+
} GROUP BY ?g`,[y,g]=await Promise.all([Ic({sparql:p,contextGraphId:e,includeContextGraphPartitions:!0}),Ic({sparql:f,contextGraphId:e,includeContextGraphPartitions:!0}).catch(()=>null)]),x=((U=y==null?void 0:y.result)==null?void 0:U.bindings)??[],b=new Map;for(const Q of((D=g==null?void 0:g.result)==null?void 0:D.bindings)??[]){const M=Uc(Q.g),T=Uc(Q.cnt),q=typeof T=="string"?T.match(/^"?(\d+)/):null,V=q?parseInt(q[1],10):NaN;M&&Number.isFinite(V)&&b.set(M,V)}const k=[],C=new Set,j=`urn:dkg:assertion:${e}:`,E=[...x].sort((Q,M)=>{var V,ae;const T=(typeof Q.g=="string"?Q.g:(V=Q.g)==null?void 0:V.value)??"",q=(typeof M.g=="string"?M.g:(ae=M.g)==null?void 0:ae.value)??"";return(T.startsWith(u)?0:1)-(q.startsWith(u)?0:1)});for(const Q of E){const M=typeof Q.g=="string"?Q.g:(W=Q.g)==null?void 0:W.value;if(!M)continue;let T,q;if(M.startsWith(u)){const P=M.slice(u.length).split("/");if(P.length===3&&P[0]==="assertion")q=P[2];else if(P.length===4&&P[1]==="assertion")T=P[0],q=P[3];else continue}else if(M.startsWith(j)){const P=M.slice(j.length);let K=/^(0x[0-9a-fA-F]{40}):(.+)$/.exec(P);K?q=K[2]:(K=/^([^:]+):(0x[0-9a-fA-F]{40}):(.+)$/.exec(P),K&&(T=K[1],q=K[3]))}else continue;if(!q||!o(T,q))continue;const V=`${T??""}\0${q}`;if(C.has(V))continue;C.add(V);const ae=b.get(M);k.push({name:q,graphUri:M,tripleCount:ae,subGraph:T})}return k}const Y8=(e,n,a,r)=>{if(Array.isArray(a))throw Object.assign(new Error("Knowledge Assets are shared atomically; root-entity selection is not supported"),{code:"KA_ATOMIC_SHARE_REQUIRED"});if(typeof a=="string"&&a!=="all")throw Object.assign(new Error("Knowledge Assets are shared atomically; omit entities to share the complete asset"),{code:"KA_ATOMIC_SHARE_REQUIRED"});const o=a===void 0||typeof a=="string"?{subGraphName:r}:{...a,subGraphName:a.subGraphName??r};return hj(e,n,o)};function K8(e,n){return n.promotedCount>0?{kind:"success",promotedCount:n.promotedCount,message:`Shared the complete Knowledge Asset ${e} to Shared Working Memory (${n.promotedCount} triple${n.promotedCount===1?"":"s"}).`}:{kind:"noop",message:`${e} was not newly shared. Its complete Knowledge Asset may already be in Shared Working Memory, or its content is still being committed — refresh and try again.`}}function Q8(e,n){if(n instanceof an&&n.status===413){const a=n.body;if((a==null?void 0:a.code)==="SWM_GOSSIP_PAYLOAD_TOO_LARGE")return{kind:"payload-too-large",actualBytes:typeof a.actualBytes=="number"?a.actualBytes:void 0,limitBytes:typeof a.limitBytes=="number"?a.limitBytes:void 0,message:`${e} is too large to share atomically. Split its content into smaller Knowledge Assets before sharing.`}}if(n instanceof an&&n.status===409){const a=n.body;if((a==null?void 0:a.code)==="ASSERTION_NOT_PERSISTED"){const r=typeof a.expectedTripleCount=="number"?a.expectedTripleCount:void 0;return{kind:"not-persisted",expectedTripleCount:r,message:r?`${e} was imported with ${r} extracted triple${r===1?"":"s"} but the data graph is empty. Re-import the source file (or re-write the assertion) before promoting.`:`${e}'s data graph is empty but its extraction metadata says it should hold content. Re-import the source file before promoting.`}}}return null}const X8=(e,n,a)=>{const r=new URLSearchParams({contextGraphId:n});return a&&r.set("subGraphName",a),Qe(`/api/knowledge-assets/${encodeURIComponent(e)}/wm/extraction-status?${r}`)};function gj(e,n){const a=e.startsWith("sha256:")||e.startsWith("keccak256:")?e:`sha256:${e}`,r=n?`?contentType=${encodeURIComponent(n)}`:"";return`${ra}/api/file/${encodeURIComponent(a)}${r}`}const Z8="binding incomplete";function J8(e){const n="Published on-chain, but linking it into the context graph did not complete, so context-graph views may be incomplete.";return e?`${n} (${e})`:n}const yj=(e=20)=>Qe(`/api/memory/sessions?limit=${e}`),vj=(e,n={})=>{const a=new URLSearchParams;n.limit&&Number.isInteger(n.limit)&&n.limit>0&&a.set("limit",String(n.limit)),(n.order==="desc"||n.order==="asc")&&a.set("order",n.order);const r=a.toString();return Qe(`/api/memory/sessions/${encodeURIComponent(e)}${r?`?${r}`:""}`)};function Nb(e,n){var a,r,o;return{text:e,correlationId:(n==null?void 0:n.correlationId)??crypto.randomUUID(),...n!=null&&n.identity?{identity:n.identity}:{},...n!=null&&n.sessionId?{sessionId:n.sessionId}:{},...n!=null&&n.profile?{profile:n.profile}:{},...n!=null&&n.persistUserMessage?{persistUserMessage:n.persistUserMessage}:{},...(a=n==null?void 0:n.attachments)!=null&&a.length?{attachmentRefs:n.attachments}:{},...(r=n==null?void 0:n.attachmentImportResults)!=null&&r.length?{attachmentImportResults:n.attachmentImportResults}:{},...(o=n==null?void 0:n.contextEntries)!=null&&o.length?{contextEntries:n.contextEntries}:{},...n!=null&&n.contextGraphId?{contextGraphId:n.contextGraphId}:{}}}async function xj(e,n={}){var g;const a=await fetch("/api/openclaw-channel/stream",{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...$t()},body:JSON.stringify(Nb(e,n)),signal:n.signal});if(!a.ok){const x=await a.json().catch(()=>({}));throw Do(x,`Request failed (${a.status})`,a.status)}const r=(a.headers.get("content-type")??"").toLowerCase();if(!a.body||!r.includes("text/event-stream")){const x=await a.json();return(g=n.onEvent)==null||g.call(n,{type:"final",...x}),x}const o=a.body.getReader(),s=new TextDecoder;let u="",d,p;const f=x=>{var b;(b=n.onEvent)==null||b.call(n,x),x.type==="error"?p=Do(x,x.error||"Stream failed"):x.type==="final"&&(d={text:x.text,correlationId:x.correlationId,...x.sessionId?{sessionId:x.sessionId}:{},...x.turnId?{turnId:x.turnId}:{}})},y=x=>{let b=u.indexOf(`
|
|
84
|
+
`);for(;b!==-1;){const k=u.slice(0,b).trim();if(u=u.slice(b+1),b=u.indexOf(`
|
|
85
|
+
`),!k.startsWith("data:"))continue;const C=k.slice(5).trim();if(C){try{f(JSON.parse(C))}catch{}if(p)return}}if(x&&u.trim().startsWith("data:")){const k=u.trim().slice(5).trim();if(!k)return;try{f(JSON.parse(k))}catch{}u=""}};for(;;){const{done:x,value:b}=await o.read();if(x||(u+=s.decode(b,{stream:!0}),y(!1),p))break;if(d)return o.cancel().catch(()=>{}),d}if(u+=s.decode(),y(!0),p)throw p;if(!d)throw new Error("Stream ended without final payload");return d}const bj=()=>Qe("/api/openclaw-channel/health");async function Rb(e,n,a={}){var b;const r=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",Accept:"text/event-stream",...$t()},body:JSON.stringify(Nb(n,a)),signal:a.signal});if(!r.ok){const k=await r.json().catch(()=>({}));throw Do(k,`Request failed (${r.status})`,r.status)}const o=(r.headers.get("content-type")??"").toLowerCase();if(!r.body||!o.includes("text/event-stream")){const k=await r.json();return(b=a.onEvent)==null||b.call(a,{type:"final",...k}),k}const s=r.body.getReader(),u=new TextDecoder;let d="",p,f;const y=k=>k.type==="delta"?{type:"text_delta",delta:k.text??""}:k,g=k=>{var C;(C=a.onEvent)==null||C.call(a,k),k.type==="error"?f=Do(k,k.error||"Stream failed"):k.type==="final"&&(p={text:k.text,correlationId:k.correlationId,...k.sessionId?{sessionId:k.sessionId}:{},...k.turnId?{turnId:k.turnId}:{}})},x=k=>{let C=d.indexOf(`
|
|
86
|
+
`);for(;C!==-1;){const j=d.slice(0,C).trim();if(d=d.slice(C+1),C=d.indexOf(`
|
|
87
|
+
`),!j.startsWith("data:"))continue;const E=j.slice(5).trim();if(E){try{g(y(JSON.parse(E)))}catch{}if(f)return}}if(k&&d.trim().startsWith("data:")){const j=d.trim().slice(5).trim();if(!j)return;try{g(y(JSON.parse(j)))}catch{}d=""}};for(;;){const{done:k,value:C}=await s.read();if(k||(d+=u.decode(C,{stream:!0}),x(!1),f))break;if(p)return s.cancel().catch(()=>{}),p}if(d+=u.decode(),x(!0),f)throw f;if(!p)throw new Error("Stream ended without final payload");return p}const wj=(e,n={})=>Rb("/api/hermes-channel/stream",e,n),Sj=()=>Qe("/api/hermes-channel/health"),kj=(e,n={})=>Rb("/api/prime-agent-channel/stream",e,n),Cj=()=>Qe("/api/prime-agent-channel/health");function Ej(e){return{...e,detected:typeof e.detected=="boolean"?e.detected:e.ready===!0}}const Aj=async()=>Ej(await Qe("/api/local-llm/health"));async function jj(e,n){const a=(n==null?void 0:n.correlationId)??crypto.randomUUID(),r=await fetch("/api/local-llm/chat",{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify({message:e,sessionId:"local-llm:dkg-ui",...n!=null&&n.contextGraphId?{contextGraphId:n.contextGraphId}:{}}),signal:n==null?void 0:n.signal});if(!r.ok){const s=await r.json().catch(()=>({}));throw Do(s,`Request failed (${r.status})`,r.status)}return{...await r.json(),correlationId:a,turnId:a}}async function Tj(e,n={}){var r;const a=await jj(e,n);return(r=n.onEvent)==null||r.call(n,{type:"final",...a}),a}const Nj=()=>Xt("/api/local-llm/session/clear",{});function Rj(e,n){if(!e||typeof e!="object"||Array.isArray(e))return n;const a=e,r=typeof a.error=="string"&&a.error.trim()?a.error.trim():n;if(a.details===void 0||a.details===null)return r;const o=typeof a.details=="string"?a.details.trim():JSON.stringify(a.details);return!o||o===r?r:`${r}: ${o}`}function Do(e,n,a){if(!e||typeof e!="object"||Array.isArray(e))return new zc(n,{status:a});const r=e,o=Rj(r,n),s=f=>{const y=r[f];return typeof y=="string"&&y.trim()?y.trim():void 0},u=f=>{const y=r[f];return typeof y=="number"&&Number.isFinite(y)?y:void 0},d=f=>{const y=r[f];return typeof y=="boolean"?y:void 0},p=typeof r.text=="string"&&r.text.trim()?r.text:void 0;return new zc(o,{status:a,code:s("code"),source:s("source"),details:s("details"),correlationId:s("correlationId"),timeoutMs:u("timeoutMs"),target:s("target"),route:s("route"),integrationId:s("integrationId"),retryable:d("retryable"),text:p,timedOut:d("timedOut")})}const ru={"local-llm":{connectSupported:!1,chatSupported:!0,defaultSessionId:()=>"local-llm:dkg-ui",resolveChatContext:()=>({}),fetchHealth:Aj,isVisible:({health:e})=>e===null||e.configured!==!1||e.detected===!0,streamChat:Tj},openclaw:{connectSupported:!0,chatSupported:!0,defaultSessionId:({integrationId:e})=>`${e}:dkg-ui`,resolveChatContext:({integrationId:e,sessionId:n})=>{if(!n)return{};const a=`${e}:dkg-ui:`;if(!n.startsWith(a))return{};const r=n.slice(a.length).trim();return r?{identity:r}:{}},fetchHealth:bj,streamChat:xj},hermes:{connectSupported:!0,chatSupported:!0,defaultSessionId:({integrationId:e,record:n,health:a})=>Lj(e,n,a),resolveChatContext:({sessionId:e,profile:n})=>({...e?{sessionId:e}:{},...n?{profile:n}:{}}),fetchHealth:Sj,streamChat:wj},"prime-agent":{connectSupported:!0,chatSupported:!0,defaultSessionId:({record:e,health:n})=>Ij(e,n),resolveChatContext:({sessionId:e,liveSession:n})=>{if(!n)return{};if(e&&n.sessionId!==e)throw new Error("Prime Agent live session does not match the selected conversation");return{sessionId:n.rawSessionId}},fetchHealth:Cj,streamChat:kj}};function rr(e){var a,r;const n=e.trim().toLowerCase();return((r=(a=ru[n])==null?void 0:a.defaultSessionId)==null?void 0:r.call(a,{integrationId:n}))??null}function _j(e,n){return n!=null&&n.trim()?n.trim():rr(e)}async function Oj(e,n=50){const a=r=>{if(r.turnId)return`urn:dkg:chat:turn:${encodeURIComponent(r.turnId)}:${encodeURIComponent(r.author)}`;const o=`${e}
|
|
88
|
+
${r.author}
|
|
89
|
+
${r.ts}
|
|
90
|
+
${r.text}`;let s=2166136261;for(let u=0;u<o.length;u+=1)s^=o.charCodeAt(u),s=Math.imul(s,16777619);return`urn:dkg:chat:session:${encodeURIComponent(e)}:message:${(s>>>0).toString(16)}`};try{return[...(await vj(e,{limit:n,order:"desc"})).messages].reverse().map(o=>({uri:o.uri||a(o),text:o.text,author:o.author,ts:o.ts,turnId:o.turnId,persistStatus:o.persistStatus,failureReason:o.failureReason,attachmentRefs:o.attachmentRefs,toolCalls:o.toolCalls}))}catch(r){if(r instanceof an&&r.status===404)return[];throw r}}function Dj(e){var n,a,r;return!!((n=e.transport)!=null&&n.bridgeUrl||(a=e.transport)!=null&&a.gatewayUrl||(r=e.transport)!=null&&r.healthUrl)}function Pc(...e){for(const n of e)if(typeof n=="string"&&n.trim())return n.trim();return null}function Mj(e){return e.trim().toLowerCase().replace(/[^a-z0-9._-]+/g,"-").replace(/^-+|-+$/g,"")||Th(e)}function Th(e){let n=2166136261;for(let a=0;a<e.length;a+=1)n^=e.charCodeAt(a),n=Math.imul(n,16777619);return(n>>>0).toString(36)}function Lj(e,n,a){const r=(n==null?void 0:n.metadata)??{},o=Pc(a==null?void 0:a.profile,r.profileName,r.profile),s=Pc(r.hermesHome),u=s?null:zj(n),d=[o?`profile-${Mj(o)}`:null,s?`home-${Th(s)}`:null,u].filter(p=>p!=null);return d.length?`${e}:dkg-ui:${d.join(":")}`:`${e}:dkg-ui`}function zj(e){const n=e==null?void 0:e.transport;if(!n)return null;const a=[n.kind,n.bridgeUrl,n.gatewayUrl,n.healthUrl].filter(r=>typeof r=="string"&&r.trim().length>0);return a.length?`transport-${Th(a.join("|"))}`:null}function Ij(e,n){var a,r,o;return Pc((a=e==null?void 0:e.metadata)==null?void 0:a.activeMemorySessionId,(o=(r=n==null?void 0:n.sessions)==null?void 0:r[0])==null?void 0:o.memorySessionId)??void 0}function Pj(e){return e?typeof e=="string"?e:[e.provider,e.mode,e.status].filter(Boolean).join(" / ")||null:null}function Uj(e,n){if(e==="degraded")return!0;const a=String((n==null?void 0:n.status)??"").toLowerCase(),r=n==null?void 0:n.memory;return a.includes("degraded")||a.includes("conflict")||typeof r=="object"&&r!=null&&r.conflict===!0}function _b(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function T0(e){if(!_b(e))return-1;let n=e.ok===!1?100:0;return e.profile&&(n+=10),e.memory&&(n+=10),e.status&&(n+=10),e.error&&(n+=10),e.ok===!0&&(n+=1),n}function Bj(e){if(e.target==="bridge")return{target:"bridge",details:e.bridge};if(e.target==="gateway")return{target:"gateway",details:e.gateway};const n=T0(e.bridge),a=T0(e.gateway);return n<0&&a<0?{}:n>=a?{target:"bridge",details:e.bridge}:{target:"gateway",details:e.gateway}}function Hj(e){if(!e)return null;const{target:n,details:a}=Bj(e);if(!_b(a))return e;const r=typeof a.ok=="boolean"?a.ok:void 0;return{...a,...e,ok:e.ok===!1?!1:r??e.ok,target:e.target??n,profile:e.profile??a.profile,memory:e.memory??a.memory,status:e.status??a.status,error:e.error??a.error}}function $j(e,n){if(String(e.id??"").toLowerCase()!=="hermes")return null;const a=n==null?void 0:n.profile,r=a?`profile ${a}`:"the configured profile",o=Pj(n==null?void 0:n.memory),s=typeof(n==null?void 0:n.memory)=="object"&&n.memory!=null?n.memory:null;return(s==null?void 0:s.conflict)===!0||String((n==null?void 0:n.status)??"").toLowerCase().includes("conflict")?`${e.name} ${r} has a memory provider conflict${o?` (${o})`:""}.`:n!=null&&n.ok?`${e.name} ${r} is connected${o?` with ${o} memory`:""}.`:n!=null&&n.status?`${e.name} ${r} reports ${n.status}${o?` (${o})`:""}.`:null}async function Nh(e){var W,Q,M,T,q,V,ae,P,K,B,Z,ie,G,O,L,X,N;const n=String(e.id??"").toLowerCase(),a=ru[n],r=((W=e.capabilities)==null?void 0:W.localChat)===!0&&(a==null?void 0:a.chatSupported)===!0,o=r&&((Q=e.capabilities)==null?void 0:Q.chatAttachments)===!0,s=((M=e.capabilities)==null?void 0:M.connectFromUi)===!0&&(a==null?void 0:a.connectSupported)===!0,u=e.enabled===!0,d=(T=e.runtime)==null?void 0:T.status,p=u&&r&&(a!=null&&a.fetchHealth)?Hj(await a.fetchHealth().catch(()=>null)):null;if(((q=a==null?void 0:a.isVisible)==null?void 0:q.call(a,{health:p}))===!1)return null;const f=Uj(d,p),y=(p==null?void 0:p.ok)===!0&&!f,g=y,b=u&&r&&(n==="local-llm"&&u&&r||y||d==="connecting"||d==="degraded"||((V=e.runtime)==null?void 0:V.ready)===!0||Dj(e)),k=$j(e,p),C=(ae=a==null?void 0:a.defaultSessionId)==null?void 0:ae.call(a,{integrationId:n,record:e,health:p}),j=n==="prime-agent"&&(p==null?void 0:p.busy)===!0&&p.clientConnected===!1,E=n==="prime-agent"&&Array.isArray(p==null?void 0:p.sessions)?p.sessions.filter(ue=>typeof(ue==null?void 0:ue.rawSessionId)=="string"&&ue.rawSessionId.trim()&&typeof ue.memorySessionId=="string"&&ue.memorySessionId.trim()).map(ue=>({...ue,sessionId:ue.memorySessionId.trim(),rawSessionId:ue.rawSessionId.trim()})):void 0,_=n==="hermes"?Pc(p==null?void 0:p.profile,(P=e.metadata)==null?void 0:P.profileName,(K=e.metadata)==null?void 0:K.profile)??void 0:void 0;let R,F,U;b&&f?(R="degraded",F="Degraded",U=k??(p==null?void 0:p.error)??((B=e.runtime)==null?void 0:B.lastError)??`${e.name} is attached to this node, but one capability is degraded.`):b&&((Z=e.runtime)==null?void 0:Z.status)==="connecting"?(R="connecting",F="Connecting",U=((ie=e.runtime)==null?void 0:ie.lastError)??`${e.name} is registered and still starting up.`):g?(R="chat_ready",F=j?"Still working":p!=null&&p.busy?"Working":"Chat ready",U=j?`${e.name} is still working after the browser stream disconnected. Wait for it to finish before sending another message.`:p!=null&&p.busy?`${e.name} is working on the current turn.`:`${e.name} is connected to this node and ready for chat.`):b?(R="bridge_offline",F="Bridge offline",U=k??(p==null?void 0:p.error)??((G=e.runtime)==null?void 0:G.lastError)??`${e.name} is attached to this node, but it is not responding right now.`):a?(R="available",F=s?"Ready to connect":"Awaiting chat bridge",U=u?`${e.name} is registered, but this panel is waiting for the framework chat bridge.`:((O=e.runtime)==null?void 0:O.lastError)??`Use the node-served skill plus ${e.name} onboarding to attach an existing local agent.`):(R="coming_soon",F=u?"Registered, panel pending":"Next integration",U=u?`${e.name} is registered on the node, but the right-panel chat bridge is not wired yet.`:"The local-agent registry is in place so this framework can plug into the same side-panel flow next.");const D=g?"Connected":R==="connecting"?"Connecting":R==="degraded"?"Degraded":b?"Unavailable":s?"Ready to connect":"Coming next";return{id:n,name:e.name,framework:e.name,description:e.description,defaultSessionId:C,profile:_,chatSupported:r,chatAttachments:o,connectSupported:s,configured:u,detected:u||(p==null?void 0:p.detected)===!0||y,persistentChat:b,chatReady:y,bridgeOnline:g,bridgeStatusLabel:D,status:R,statusLabel:F,detail:U,error:y?void 0:(p==null?void 0:p.error)??((L=e.runtime)==null?void 0:L.lastError)??void 0,target:p==null?void 0:p.target,source:u||a?"live":"planned",...typeof((X=e.metadata)==null?void 0:X.sessionCount)=="number"?{sessionCount:e.metadata.sessionCount}:{},...typeof((N=e.metadata)==null?void 0:N.activeSessionId)=="string"?{activeSessionId:e.metadata.activeSessionId}:{},...E!=null&&E.length?{liveSessions:E}:{},...typeof(p==null?void 0:p.busy)=="boolean"?{busy:p.busy}:{}}}async function lu(){const e=await Qe("/api/local-agent-integrations"),a=(await Promise.all((e.integrations??[]).map(Nh))).filter(r=>r!==null);return a.sort((r,o)=>{const s=r.id==="openclaw"?0:1,u=o.id==="openclaw"?0:1;return s!==u?s-u:r.persistentChat!==o.persistentChat?r.persistentChat?-1:1:r.name.localeCompare(o.name)}),{integrations:a}}async function qj(e){const n=e.trim().toLowerCase(),a=ru[n];if(!(a!=null&&a.connectSupported))throw new Error(`${e} local connect is not available yet.`);const r=await Xt("/api/local-agent-integrations/connect",{id:n,metadata:{source:"node-ui"}}),o=r.integration?await Nh(r.integration):(await lu()).integrations.find(s=>s.id===n);if(!o)throw new Error(`Missing local agent integration: ${n}`);return{integration:o,notice:r.notice}}async function Fj(e){const n=e.trim().toLowerCase();await Ch(`/api/local-agent-integrations/${encodeURIComponent(n)}`,{enabled:!1,runtime:{status:"disconnected",ready:!1,lastError:null}})}async function Gj(e){const n=e.trim().toLowerCase(),a=await Xt(`/api/local-agent-integrations/${encodeURIComponent(n)}/refresh`,{}),r=a.integration?await Nh(a.integration):(await lu()).integrations.find(o=>o.id===n);if(!r)throw new Error(`Missing local agent integration: ${n}`);return{integration:r,notice:a.notice}}async function N0(e,n=50,a={}){if(e.trim().toLowerCase()==="local-llm")return[];const r=_j(e,a.sessionId);return r?Oj(r,n):[]}async function Vj(e){var a;const n=(a=e.sessionId)==null?void 0:a.trim();if(!n)throw new Error("Missing Hermes session id");return Xt("/api/hermes-channel/persist-turn",{sessionId:n,userMessage:e.userMessage,assistantReply:e.assistantReply??"",correlationId:e.correlationId,attachmentRefs:e.attachments,persistenceState:"failed",failureReason:e.failureReason,contextGraphId:e.contextGraphId,profile:e.profile,metadata:{source:"node-ui-failed-turn"}})}async function Wj(e,n){if(e.trim().toLowerCase()==="hermes")return Vj(n);throw new Error(`${e} local chat persistence is not available yet.`)}async function Yj(e,n,a={}){const r=e.trim().toLowerCase(),o=ru[r];if(o!=null&&o.streamChat){const{sessionId:s,liveSession:u,profile:d,...p}=a,f=(y,g)=>{var x;return{...p,...(x=o.resolveChatContext)==null?void 0:x.call(o,{integrationId:r,sessionId:y,liveSession:g,profile:d})}};try{return await o.streamChat(n,f(s,u))}catch(y){if(r==="prime-agent"&&u&&y instanceof zc&&y.code==="PRIME_AGENT_NO_SESSION")return o.streamChat(n,f());throw y}}throw new Error(`${e} local chat is not available yet.`)}function Uc(e){if(e!=null){if(typeof e=="object"&&"value"in e)return String(e.value);if(typeof e=="string"){let n=e;const a=n.match(/^(".*")\^\^<[^>]+>$/);a&&(n=a[1]);const r=n.match(/^(".*")@[a-z-]+$/i);return r&&(n=r[1]),n.startsWith('"')&&n.endsWith('"')?n.slice(1,-1).replace(/\\"/g,'"').replace(/\\n/g,`
|
|
91
|
+
`).replace(/\\r/g,"\r").replace(/\\t/g," "):e}return String(e)}}const Kj=()=>Qe("/api/economics"),Ob=()=>Qe("/api/wallets/balances"),e9=()=>Xt("/api/shutdown",{}),Qj=(e,n)=>Xt("/api/subscribe",{contextGraphId:e,syncMode:(n==null?void 0:n.syncMode)??"on-demand"}),Xj=()=>Qe("/api/notifications"),Db=e=>Xt("/api/notifications/read",e?{ids:e}:{}),Zj=e=>yb(`/api/sub-graph/list?contextGraphId=${encodeURIComponent(e)}`,Ab),Jj={name:"my-dkg-node",networkName:"DKG Mainnet",connectedPeers:12,synced:!0,version:"10.0.0-rc"},eT={total_kcs:1842,confirmed_kcs:1623,tentative_kcs:219},tT={agents:[{name:"my-dkg-node",peerId:"QmYourNode123",connectionStatus:"self"},{name:"research-agent",peerId:"QmResearch456",connectionStatus:"connected",lastSeen:Date.now()},{name:"data-curator",peerId:"QmCurator789",connectionStatus:"connected",lastSeen:Date.now()-6e4},{name:"pharma-bot",peerId:"QmPharma012",connectionStatus:"discovered",lastSeen:Date.now()-3e5}]},nT={contextGraphs:[{id:"cg:pharma-drug-interactions",name:"Pharma Drug Interactions",description:"Drug interaction knowledge graph for clinical decision support",assetCount:227,agentCount:3,callerInvolved:!0,curator:"did:dkg:agent:0x1111111111111111111111111111111111111111"},{id:"cg:climate-science",name:"Climate Science",description:"Climate research data and projections",assetCount:45,agentCount:2,callerInvolved:!0,curator:"did:dkg:agent:0x1111111111111111111111111111111111111111"},{id:"cg:supply-chain-eu",name:"EU Supply Chain",description:"European supply chain provenance tracking",assetCount:89,agentCount:1,callerInvolved:!0,curator:"did:dkg:agent:0x5555555555555555555555555555555555555555"}]},aT={"cg:pharma-drug-interactions":{contextGraphId:"cg:pharma-drug-interactions",allowedAgents:["0x2222222222222222222222222222222222222222","0x3333333333333333333333333333333333333333"]},"cg:climate-science":{contextGraphId:"cg:climate-science",allowedAgents:["0x4444444444444444444444444444444444444444"]},"cg:supply-chain-eu":{contextGraphId:"cg:supply-chain-eu",allowedAgents:[]}},iT={operations:[{id:"op-1",name:"publish",status:"completed",startedAt:Date.now()-12e4},{id:"op-2",name:"query",status:"completed",startedAt:Date.now()-3e5},{id:"op-3",name:"publish",status:"completed",startedAt:Date.now()-6e5},{id:"op-4",name:"chat",status:"completed",startedAt:Date.now()-9e5},{id:"op-5",name:"sync",status:"failed",startedAt:Date.now()-18e5},{id:"op-6",name:"publish",status:"completed",startedAt:Date.now()-36e5}],total:6},rT={periods:[{label:"24h",publishCount:3,successCount:3,totalGasEth:7e-4,totalTrac:9.1,avgGasEth:23e-5,avgTrac:3.03},{label:"7d",publishCount:14,successCount:12,totalGasEth:.0034,totalTrac:42.5,avgGasEth:24e-5,avgTrac:3.04},{label:"30d",publishCount:47,successCount:43,totalGasEth:.012,totalTrac:156.8,avgGasEth:26e-5,avgTrac:3.34}]},lT={agentAddress:"0x1111111111111111111111111111111111111111",agentDid:"did:dkg:agent:0x1111111111111111111111111111111111111111",name:"mock-node-agent",framework:"mock",peerId:"QmMockNodeAgentPeer000000000000000000000000",nodeIdentityId:"mock-node-identity"},oT={wallets:["0xA1b2C3d4E5f60718293a4B5c6D7e8F9012345678","0xB2c3D4e5F60718293a4B5c6D7e8F90123456789a","0xC3d4E5f60718293a4B5c6D7e8F90123456789aB1"],balances:[{address:"0xA1b2C3d4E5f60718293a4B5c6D7e8F9012345678",eth:"0.842",trac:"1250.50",symbol:"TRAC"},{address:"0xB2c3D4e5F60718293a4B5c6D7e8F90123456789a",eth:"0.310",trac:"480.00",symbol:"TRAC"},{address:"0xC3d4E5f60718293a4B5c6D7e8F90123456789aB1",eth:"0.005",trac:"0.00",symbol:"TRAC"}],chainId:"8453",rpcUrl:"https://mock.rpc",symbol:"TRAC"},sT={notifications:[{type:"join_request",id:101,ts:Date.now()-12e4,read:0,contextGraphId:"cg:pharma-drug-interactions",meta:{contextGraphName:"Pharma Drug Interactions",agentAddress:"0xab12cd34ef56ab78cd90ab12cd34ef56ab78cd90",agentName:"research-agent"}},{type:"assertion_activity",id:"activity:cg:pharma-drug-interactions:promoted:29812",ts:Date.now()-3e5,read:0,contextGraphId:"cg:pharma-drug-interactions",meta:{contextGraphName:"Pharma Drug Interactions",kind:"promoted",count:3,actorAgentDid:"did:dkg:agent:0xdana00000000000000000000000000000000dana",actorAgentName:"Dana",soleAuthor:!0}},{type:"join_approved",id:102,ts:Date.now()-9e5,read:1,contextGraphId:"cg:climate-arctic",meta:{contextGraphName:"Arctic Climate",agentAddress:"0x0000000000000000000000000000000000000001"}}],badgeCount:2},cT={lines:["[2026-04-11 10:30:01] INFO Node started on port 8900","[2026-04-11 10:30:02] INFO Connected to DKG mainnet","[2026-04-11 10:30:03] INFO Discovered 12 peers","[2026-04-11 10:30:05] INFO Syncing context graph cg:pharma-drug-interactions","[2026-04-11 10:30:08] INFO Sync complete: 227 assets, 3 agents","[2026-04-11 10:30:15] INFO Agent research-agent connected via libp2p","[2026-04-11 10:31:00] INFO Publish operation started: warfarin-aspirin-001","[2026-04-11 10:31:12] INFO Triple store updated: +34 triples","[2026-04-11 10:31:15] INFO Publish complete: warfarin-aspirin-001 → Verifiable Memory","[2026-04-11 10:32:00] DEBUG SPARQL query executed in 23ms (42 results)","[2026-04-11 10:33:00] INFO Gossip: received 3 proposals from data-curator","[2026-04-11 10:34:00] INFO SWM cleanup: 0 expired triples removed","[2026-04-11 10:35:00] INFO Heartbeat: 12 peers, 1842 KAs, memory 245MB"],totalSize:13},uT={sessions:[{session:"sess-abc123",messages:[{author:"user",text:"What drug interactions should I know about warfarin?",ts:"2026-04-11T10:00:00Z"},{author:"assistant",text:"Warfarin has significant interactions with aspirin, NSAIDs, and several antibiotics. The most critical ones involve...",ts:"2026-04-11T10:00:05Z"}]},{session:"sess-def456",messages:[{author:"user",text:"Summarize the latest climate data for Arctic ice",ts:"2026-04-10T14:00:00Z"},{author:"assistant",text:"Based on the latest projections in the verifiable memory...",ts:"2026-04-10T14:00:03Z"}]}]},dT={"cg:pharma-drug-interactions":{contextGraphId:"cg:pharma-drug-interactions",subGraphs:[{name:"interactions",uri:"did:dkg:context-graph:cg:pharma-drug-interactions/interactions",description:"Pairwise drug interaction records",createdBy:"did:dkg:agent:0x1111111111111111111111111111111111111111",createdAt:"2026-04-02T09:15:00Z",entityCount:148,tripleCount:1721},{name:"contraindications",uri:"did:dkg:context-graph:cg:pharma-drug-interactions/contraindications",createdBy:"did:dkg:agent:0x2222222222222222222222222222222222222222",createdAt:"2026-04-05T16:40:00Z",entityCount:79,tripleCount:604}]},"cg:climate-science":{contextGraphId:"cg:climate-science",subGraphs:[{name:"arctic-ice",uri:"did:dkg:context-graph:cg:climate-science/arctic-ice",description:"Sea-ice extent projections",createdBy:"did:dkg:agent:0x3333333333333333333333333333333333333333",createdAt:"2026-04-11T08:05:00Z",entityCount:32,tripleCount:410}]}};function zn(e,n=50){return new Promise(a=>setTimeout(()=>a(e),n))}const In={fetchStatus:()=>zn(Jj),fetchMetrics:()=>zn(eT),fetchAgents:()=>zn(tT),fetchContextGraphs:()=>zn(nT),fetchOperationsWithPhases:()=>zn(iT),fetchEconomics:()=>zn(rT),fetchWalletsBalances:()=>zn(oT),fetchCurrentAgent:()=>zn(lT),listParticipants:e=>zn(aT[e]??{contextGraphId:e,allowedAgents:[]}),fetchSubGraphs:e=>zn(dT[e]??{contextGraphId:e,subGraphs:[]}),fetchNotificationsFeed:()=>zn(sT),fetchNodeLog:()=>zn(cT),fetchMemorySessions:()=>zn(uT)};let Xa=null,po=null;const fT=5e3,R0=2,pT=250,Pp=new Set;function _0(){return Xa===!0}function hT(e){return Pp.add(e),e(Xa===!0),()=>{Pp.delete(e)}}function mT(){const e=dr();return e?{Authorization:`Bearer ${e}`}:{}}function gT(e){return new Promise(n=>setTimeout(n,e))}async function yT(){for(let e=1;e<=R0;e+=1){try{const n=await fetch("/api/status",{cache:"no-store",headers:mT(),signal:AbortSignal.timeout(fT)});if(n.ok||n.status===401)return!1}catch{}e<R0&&await gT(pT)}return!0}async function Mb(){if(Xa!==null)return Xa;if(po)return po;po=(async()=>(Xa=await yT(),typeof window<"u"&&(window.__DKG_USING_MOCKS__=Xa,Xa&&console.warn("[dkg-ui] /api/status unreachable (timeout/5xx/network) — falling back to demo (mock) data. The UI is NOT showing live node state.")),Pp.forEach(e=>e(Xa)),Xa))();try{return await po}finally{po=null}}async function Pn(e,n){return await Mb()?n():e()}const Hn={fetchStatus:()=>Pn(WA,In.fetchStatus),fetchMetrics:()=>Pn(XA,In.fetchMetrics),fetchAgents:()=>Pn(Tb,In.fetchAgents),fetchContextGraphs:()=>Pn(Ah,In.fetchContextGraphs),fetchOperationsWithPhases:e=>Pn(()=>ZA(e),In.fetchOperationsWithPhases),fetchEconomics:()=>Pn(Kj,In.fetchEconomics),fetchWalletsBalances:()=>Pn(Ob,In.fetchWalletsBalances),fetchCurrentAgent:()=>Pn(iu,In.fetchCurrentAgent),listParticipants:e=>Pn(()=>tj(e),()=>In.listParticipants(e)),fetchSubGraphs:e=>Pn(()=>Zj(e),()=>In.fetchSubGraphs(e)),fetchNotificationsFeed:()=>Pn(Xj,In.fetchNotificationsFeed),fetchNodeLog:e=>Pn(()=>JA(e),In.fetchNodeLog),fetchMemorySessions:e=>Pn(()=>yj(e),In.fetchMemorySessions),markNotificationsRead:Db,executeQuery:jh},vT=6e4;let Di={data:null,loading:!0,error:null},Sa=null,Co=null,ko=0,Oi="";const Bc=new Set;function lr(){const e=dr();return e?`Bearer ${e}`:""}function Cc(e){Oi=e,Di={data:null,loading:!0,error:null}}function Bf(){const e=lr();return e!==Oi&&Cc(e),Di}function Ec(){for(const e of Bc)e()}function Hf(e){Di=e,Ec()}function Hc(){const e=ko,n=lr();if((Sa==null?void 0:Sa.authKey)===n)return Sa.promise;n!==Oi?(Cc(n),Ec()):Hf({...Di,loading:!0,error:null});const a=Hn.fetchCurrentAgent().then(r=>{if(e===ko){if(n!==lr()){const o=lr(),s=Oi!==o||Di.loading;Oi!==o&&(Cc(o),Ec()),s&&Hc();return}Hf({data:r,loading:!1,error:null})}}).catch(r=>{if(e===ko){if(n!==lr()){const o=lr(),s=Oi!==o||Di.loading;Oi!==o&&(Cc(o),Ec()),s&&Hc();return}Hf({data:Di.data,loading:!1,error:r instanceof Error?r.message:"Failed to load current agent"})}}).finally(()=>{e===ko&&(Sa==null?void 0:Sa.promise)===a&&(Sa=null)});return Sa={authKey:n,promise:a},a}function xT(){Hc(),!Co&&(Co=setInterval(()=>{Hc()},vT))}function bT(){Bc.size>0||!Co||(clearInterval(Co),Co=null,ko+=1,Sa=null,Di={data:null,loading:!0,error:null},Oi=lr())}function Rh(){const[e,n]=S.useState(Bf);return S.useEffect(()=>{const a=()=>n(Bf());return Bc.add(a),n(Bf()),xT(),()=>{Bc.delete(a),bT()}},[]),e}const ca=ur(e=>({contextGraphs:[],loading:!1,activeProjectId:null,setContextGraphs:n=>e({contextGraphs:n}),setLoading:n=>e({loading:n}),setActiveProject:n=>e({activeProjectId:n})})),nl=new Set;let Kt=null,Ac=null;const wT=350;function O0(e){return e==="wm"||e==="swm"||e==="vm"}function ST(e){const n=e.layers;return Array.isArray(n)?n.filter(O0):O0(e.layer)?[e.layer]:[]}function kT(e,n,a){if(!n||e.contextGraphId!==n)return!1;if(!a||a.length===0)return!0;const r=ST(e);return r.length===0?!0:a.some(o=>r.includes(o))}function Lb(){if(Kt)return;const e=dr(),n=e?`/api/events?token=${encodeURIComponent(e)}`:"/api/events";Kt=new EventSource(n);const a=r=>o=>{let s={};try{s=JSON.parse(o.data)}catch{}const u={type:r,data:s};for(const d of nl)try{d(u)}catch{}};Kt.addEventListener("join_request",a("join_request")),Kt.addEventListener("join_approved",a("join_approved")),Kt.addEventListener("join_rejected",a("join_rejected")),Kt.addEventListener("project_synced",a("project_synced")),Kt.addEventListener("memory_graph_changed",a("memory_graph_changed")),Kt.addEventListener("notification",a("notification")),Kt.addEventListener("connected",a("connected")),Kt.onerror=()=>{Kt==null||Kt.close(),Kt=null,nl.size>0&&(Ac=setTimeout(Lb,3e3))}}function CT(){Ac&&(clearTimeout(Ac),Ac=null),Kt==null||Kt.close(),Kt=null}function ET(e){return nl.add(e),nl.size===1&&Lb(),()=>{nl.delete(e),nl.size===0&&CT()}}function hl(e){const n=S.useRef(e);n.current=e,S.useEffect(()=>ET(a=>n.current(a)),[])}function AT(e,n,a={}){var p;const r=S.useRef(n),o=S.useRef(null);r.current=n;const s=a.debounceMs??wT,u=S.useMemo(()=>a.layers??[],[(p=a.layers)==null?void 0:p.join("|")]),d=S.useCallback(()=>{o.current&&(clearTimeout(o.current),o.current=null)},[]);hl(S.useCallback(f=>{f.type==="memory_graph_changed"&&kT(f.data,e,u)&&(d(),o.current=setTimeout(()=>{o.current=null,r.current(f.data)},s))},[d,e,s,u])),S.useEffect(()=>d,[d])}function Ho(e,n,a={}){const r=S.useRef(e);r.current=e;const o=S.useRef(a);o.current=a,S.useEffect(()=>{if(n<=0)return;let s=null,u=!1;const d=()=>{s||u||(s=setInterval(()=>r.current(),n))},p=()=>{s&&(clearInterval(s),s=null)},f=()=>{if(document.hidden){p();return}r.current(),d()};return o.current.runImmediately!==!1&&!document.hidden&&r.current(),document.hidden||d(),document.addEventListener("visibilitychange",f),()=>{u=!0,document.removeEventListener("visibilitychange",f),p()}},[n])}const jT="No pending join request found";function TT(e){const n=[];for(const a of e)a.type==="join_request"&&n.push({id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,agentAddress:a.meta.agentAddress,agentName:a.meta.agentName,ts:a.ts,read:a.read===1});return n.sort((a,r)=>r.ts-a.ts),n}function NT(e){const n=[];for(const a of e)a.type==="assertion_activity"?n.push({kind:"digest",id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,event:a.meta.kind,count:a.meta.count,...a.meta.soleAuthor&&a.meta.actorAgentDid?{actorAgentDid:a.meta.actorAgentDid,actorAgentName:a.meta.actorAgentName}:{},...a.meta.bySelf?{bySelf:!0}:{},ts:a.ts,read:a.read===1}):a.type==="join_approved"||a.type==="join_rejected"?n.push({kind:a.type,id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,ts:a.ts,read:a.read===1}):a.type==="pca_cost_covered"&&n.push({kind:"pca_cost_covered",id:a.id,cgId:a.contextGraphId,contextGraphName:a.meta.contextGraphName,covered:a.meta,publisherAddress:a.meta.publisherAddress,ts:a.ts,read:a.read===1});return n.sort((a,r)=>r.ts-a.ts),n}function D0(e){return e.filter(n=>n.type!=="join_request"&&n.read===0).map(n=>n.id)}function M0(e){const n=e instanceof Error?e.message:String(e);if(n.includes(jT))return{ok:!0,alreadyHandled:!0};const a=/context graph creator|manage (invitations|join requests)|curator/i.test(n);return{ok:!1,error:n,roleError:a}}function RT(){const[e,n]=S.useState(null),[a,r]=S.useState("loading"),[o,s]=S.useState(!1),u=S.useRef(!1),d=S.useCallback(()=>{Hn.fetchNotificationsFeed().then(R=>{u.current=!0,n(R),s(!1),r(R.scopeUnknown?"identity-pending":"ready")}).catch(()=>{u.current?s(!0):r("error")})},[]);Ho(d,6e4);const p=S.useRef(null),f=S.useCallback(()=>{p.current&&clearTimeout(p.current),p.current=setTimeout(()=>{p.current=null,d()},400)},[d]);S.useEffect(()=>()=>{p.current&&clearTimeout(p.current)},[]),hl(S.useCallback(R=>{R.type==="notification"&&f()},[f]));const y=S.useMemo(()=>TT((e==null?void 0:e.notifications)??[]),[e]),g=S.useMemo(()=>NT((e==null?void 0:e.notifications)??[]),[e]),x=(e==null?void 0:e.badgeCount)??0,b=S.useMemo(()=>D0((e==null?void 0:e.notifications)??[]).length>0,[e]),k=S.useCallback(R=>{R.length!==0&&(n(F=>{if(!F)return F;const U=new Set(R.map(String));return{...F,notifications:F.notifications.map(D=>U.has(String(D.id))?{...D,read:1}:D)}}),Db(R).then(d).catch(()=>{}))},[d]),C=S.useCallback(()=>{k(D0((e==null?void 0:e.notifications)??[]))},[e,k]),j=S.useCallback(async(R,F)=>{try{return await ij(R,F),d(),{ok:!0}}catch(U){const D=M0(U);return D.ok&&D.alreadyHandled&&d(),D}},[d]),E=S.useCallback(async(R,F)=>{try{return await rj(R,F),d(),{ok:!0}}catch(U){const D=M0(U);return D.ok&&D.alreadyHandled&&d(),D}},[d]),_=S.useCallback(()=>{s(!1),r(u.current?"ready":"loading"),d()},[d]);return{joinRequests:y,activity:g,unread:x,hasInformationalUnread:b,status:a,refreshError:o,partialActivityError:!1,approve:j,deny:E,markSeen:k,markAllInformationalSeen:C,retry:_}}const _T="dkg-pca",OT=150;function DT(e){return[String(e.chainId).toLowerCase(),e.nft.toLowerCase(),e.token.toLowerCase()].join(":")}function Ri(e){return e?`${_T}:${e}`:null}const $f={trackedIds:[],createPending:null,topUpPending:{}};function Eo(e){return typeof e=="string"&&/^\d+$/.test(e)}function MT(e){if(!Array.isArray(e))return[];const n=new Set,a=[];for(const r of e)Eo(r)&&!n.has(r)&&(n.add(r),a.push(r));return a}function LT(e){if(e==null||typeof e!="object")return null;const n=e;return typeof n.ownerEoa!="string"||n.ownerEoa.length===0||typeof n.submittedAt!="number"||!Number.isFinite(n.submittedAt)?null:{ownerEoa:n.ownerEoa,submittedAt:n.submittedAt,...typeof n.txHash=="string"&&n.txHash.length>0?{txHash:n.txHash}:{}}}function zT(e){if(e==null||typeof e!="object")return{};const n={};for(const[a,r]of Object.entries(e)){if(!Eo(a)||r==null||typeof r!="object")continue;const o=r;o.accountId===a&&(typeof o.ownerEoa!="string"||o.ownerEoa.length===0||typeof o.txHash!="string"||o.txHash.length===0||typeof o.submittedAt!="number"||!Number.isFinite(o.submittedAt)||(n[a]={accountId:a,ownerEoa:o.ownerEoa,txHash:o.txHash,submittedAt:o.submittedAt,...typeof o.tokens=="string"?{tokens:o.tokens}:{},...typeof o.previousTopUpBufferTrac=="string"?{previousTopUpBufferTrac:o.previousTopUpBufferTrac}:{}}))}return n}function zb(e){const n=Ri(e);if(!n)return{...$f};try{const a=localStorage.getItem(n);if(!a)return{...$f};const r=JSON.parse(a);return{trackedIds:MT(r.trackedIds),createPending:LT(r.createPending),topUpPending:zT(r.topUpPending)}}catch{return{...$f}}}let Ca=null;function sc(e,n){e&&(Ca&&clearTimeout(Ca),Ca=setTimeout(()=>{Ca=null;try{localStorage.setItem(e,JSON.stringify(n))}catch{}},OT))}function qf(e,n){if(Ca&&(clearTimeout(Ca),Ca=null),!e)return!1;try{return localStorage.setItem(e,JSON.stringify(n)),!0}catch{return!1}}function ar(e){return{trackedIds:e.trackedIds,createPending:e.createPending,topUpPending:e.topUpPending}}const cc=zb(null),Up=ur((e,n)=>({scopeKey:null,trackedIds:cc.trackedIds,createPending:cc.createPending,topUpPending:cc.topUpPending,createPendingPersisted:cc.createPending!=null,setScope:a=>{if(n().scopeKey===a)return;Ca&&(clearTimeout(Ca),Ca=null);const r=zb(a);e({scopeKey:a,trackedIds:r.trackedIds,createPending:r.createPending,topUpPending:r.topUpPending,createPendingPersisted:r.createPending!=null})},trackAccount:a=>{Eo(a)&&(e(r=>r.trackedIds.includes(a)?r:{trackedIds:[...r.trackedIds,a]}),sc(Ri(n().scopeKey),ar(n())))},untrackAccount:a=>{e(r=>r.trackedIds.includes(a)?{trackedIds:r.trackedIds.filter(o=>o!==a)}:r),sc(Ri(n().scopeKey),ar(n()))},isTracked:a=>n().trackedIds.includes(a),setCreatePending:a=>{e({createPending:a});const r=qf(Ri(n().scopeKey),ar(n()));return e({createPendingPersisted:r}),r},clearCreatePending:()=>{e({createPending:null,createPendingPersisted:!1}),sc(Ri(n().scopeKey),ar(n()))},setTopUpPending:a=>{Eo(a.accountId)&&(e(r=>({topUpPending:{...r.topUpPending,[a.accountId]:a}})),qf(Ri(n().scopeKey),ar(n())))},clearTopUpPending:a=>{e(r=>{if(!r.topUpPending[a])return r;const o={...r.topUpPending};return delete o[a],{topUpPending:o}}),sc(Ri(n().scopeKey),ar(n()))},finishCreate:a=>{e(r=>({createPending:null,createPendingPersisted:!1,trackedIds:Eo(a)&&!r.trackedIds.includes(a)?[...r.trackedIds,a]:r.trackedIds})),qf(Ri(n().scopeKey),ar(n()))}}));function Ff(e){if(!e)return!1;try{return BigInt(e)>0n}catch{return!1}}function Ib(e,n=Math.floor(Date.now()/1e3)){const{expiresAtTimestamp:a}=e;return typeof a=="number"&&a>0&&n>=a}function Pb(e,n){return Ib(e,n)||!!e.fullySwept}function _h(e){return Ff(e.topUpBuffer)?!0:e.remainingAllowance!==void 0?Ff(e.remainingAllowance):e.extendedRequested?null:Ff(e.baseEpochAllowance)}function IT(e){return _h(e)===!0}function PT(e){return e.remainingAllowance!==void 0&&_h(e)===!1}const Ub=90,Bb=10080*60;function UT(e,n=Math.floor(Date.now()/1e3)){const{expiresAtTimestamp:a,fullySwept:r,agentCount:o}=e,s=typeof a=="number"&&a>0;return Ib(e,n)?"expired":r?"swept":PT(e)?"insolvent":typeof o=="number"&&o>=Ub?"cap-near":s&&a-n<=Bb?"expiring":"healthy"}function BT(e,n){return!Pb(e,n)&&IT(e)}function HT(e){return(e==null?void 0:e.adapterSupported)===!1?null:(e==null?void 0:e.registered)??null}function $T(e,n){var u;const a=HT(e.probedKey);if(a===null)return{outcome:"inconclusive",registered:null,adapterUnsupported:((u=e.probedKey)==null?void 0:u.adapterSupported)===!1};if(a===!1)return{outcome:"unregistered",registered:!1};const r=Pb(e,n),o=_h(e);if(o===null)return{outcome:"inconclusive",registered:null,adapterUnsupported:!1};const s=o;return!r&&s?{outcome:"covers",registered:!0}:{outcome:"uncovered",registered:!0,dead:r,hasBudget:s}}const L0=(e,n)=>!!e&&!!n&&e.toLowerCase()===n.toLowerCase();async function qT(e,n){const a={accountId:e,snapshot:null,error:null,notFound:!1,classification:"unknown",ownerIsPrimaryWallet:!1,health:null,walletProbes:[],approvedCount:0,walletCount:n.length,probesInconclusive:!1};let r;try{r=await A0(e,void 0,{extended:!0})}catch(f){return{...a,error:f,notFound:f instanceof an&&f.status===404}}const o=await Promise.all(n.map(f=>A0(e,f,{extended:!0}).then(y=>({wallet:f,registered:$T(y).registered})).catch(()=>({wallet:f,registered:null})))),s=o.filter(f=>f.registered===!0).length,u=o.some(f=>f.registered===null),p=n.some(f=>L0(f,r.owner))?"owned":s>0?"approved":"unknown";return{accountId:e,snapshot:r,error:null,notFound:!1,classification:p,ownerIsPrimaryWallet:L0(n[0],r.owner),health:UT(r),walletProbes:o,approvedCount:s,walletCount:n.length,probesInconclusive:u}}const al=new Map;function z0(e){for(const n of e.subs)n()}async function $c(e){const n=++e.seq;if(e.ids.length===0){if(n!==e.seq)return;e.data={wallets:[],walletsError:!1,accounts:[]},e.error=null,e.loading=!1,z0(e);return}try{const a=await Ob().catch(()=>null),r=(a==null?void 0:a.wallets)??[],o=!a||!!a.error,s=await Promise.all(e.ids.map(u=>qT(u,r)));if(n!==e.seq)return;e.data={wallets:r,walletsError:o,accounts:s},e.error=null}catch(a){if(n!==e.seq)return;e.error=(a==null?void 0:a.message)??"Failed to resolve PCAs."}finally{n===e.seq&&(e.loading=!1,z0(e))}}function Gf(e){e.timer||e.intervalMs<=0||typeof document<"u"&&document.hidden||(e.timer=setInterval(()=>$c(e),e.intervalMs))}function Vf(e){e.timer&&(clearInterval(e.timer),e.timer=null)}function FT(e,n,a,r){let o=al.get(e);const s=!o;if(o||(o={ids:n,data:null,loading:!0,error:null,subs:new Set,timer:null,intervalMs:a,onVisibility:null,seq:0},al.set(e,o)),o.subs.add(r),s){const u=o,d=()=>{typeof document>"u"||(document.hidden?Vf(u):($c(u),Gf(u)))};o.onVisibility=d,typeof document<"u"&&document.addEventListener("visibilitychange",d),$c(o),Gf(o)}else a<o.intervalMs&&(o.intervalMs=a,Vf(o),Gf(o));return()=>{const u=al.get(e);u&&(u.subs.delete(r),u.subs.size===0&&(Vf(u),u.onVisibility&&typeof document<"u"&&document.removeEventListener("visibilitychange",u.onVisibility),al.delete(e)))}}const GT=[];function Hb(e=3e4,n=[]){var C,j,E;const a=Up(_=>_.trackedIds),r=n.join(","),o=S.useMemo(()=>[...a,...n.filter(_=>!a.includes(_))],[a.join(","),r]),s=o.join(","),[,u]=S.useReducer(_=>_+1,0);S.useEffect(()=>FT(s,o,e,u),[s,e]);const d=al.get(s),p=((C=d==null?void 0:d.data)==null?void 0:C.accounts)??GT,f=d?d.loading:!0,y=(d==null?void 0:d.error)??null,{bestCoveringDiscountBps:g,covered:x}=S.useMemo(()=>{let _=null;for(const R of p){if(!R.snapshot||R.approvedCount<=0||!BT(R.snapshot))continue;const F=R.snapshot.discountBps;typeof F=="number"&&(_==null||F>_)&&(_=F)}return{bestCoveringDiscountBps:_,covered:_!=null}},[p]),b=((j=d==null?void 0:d.data)==null?void 0:j.wallets)??[],k=((E=d==null?void 0:d.data)==null?void 0:E.walletsError)??!1;return{accounts:p,wallets:b,walletsError:k,walletsInconclusive:k&&b.length===0,loading:f,error:y,refresh:()=>{const _=al.get(s);_&&$c(_)},bestCoveringDiscountBps:g,covered:x}}let Wf=null;function $b(){const e=Up(a=>a.scopeKey),n=Up(a=>a.setScope);S.useEffect(()=>{e||Wf||(Wf=GA().then(a=>{n(DT(a))}).catch(()=>{}).finally(()=>{Wf=null}))},[e,n])}function VT(){$b();const{accounts:e}=Hb(3e4);return S.useMemo(()=>{const n=[],a=Math.floor(Date.now()/1e3);for(const r of e){const o=r.snapshot;if(!o)continue;const s=r.accountId,u=typeof o.expiresAtTimestamp=="number"&&o.expiresAtTimestamp>0,d=u&&a>=o.expiresAtTimestamp;d?n.push({id:`pca-${s}-expired`,accountId:s,kind:"expired",severity:"danger",title:`PCA #${s} has expired`,message:"Publishes no longer get its discount. Create a replacement account to keep saving."}):u&&o.expiresAtTimestamp-a<=Bb&&n.push({id:`pca-${s}-expiring`,accountId:s,kind:"expiring",severity:"warn",title:`PCA #${s} is expiring soon`,message:"Top-up can’t extend the lock period — plan a replacement before it expires."}),o.fullySwept&&n.push({id:`pca-${s}-swept`,accountId:s,kind:"swept",severity:"warn",title:`PCA #${s} is fully swept`,message:"Its epoch budgets have been swept to the staker reward pool."}),typeof o.agentCount=="number"&&o.agentCount>=Ub&&n.push({id:`pca-${s}-cap`,accountId:s,kind:"cap-near",severity:"warn",title:`PCA #${s} is near the 100-wallet cap`,message:"Deregister unused wallets to make room before approving more."}),r.classification==="owned"&&r.approvedCount===0&&!r.probesInconclusive&&!d&&n.push({id:`pca-${s}-fallthrough`,accountId:s,kind:"fallthrough",severity:"warn",title:`PCA #${s} discounts nothing yet`,message:"Publishes from this node pay the direct cost until you approve this node’s operational wallets."})}return n},[e])}function Mo(e,n=new Date){if(e==null||e==="")return"";const a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return"";if(a.toDateString()===n.toDateString())return a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"});const o=new Date(n);if(o.setDate(n.getDate()-1),a.toDateString()===o.toDateString())return`Yesterday ${a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`;const s=n.getTime()-a.getTime();return s>=0&&s<10080*60*1e3?`${a.toLocaleDateString(void 0,{weekday:"short"})} ${a.toLocaleTimeString(void 0,{hour:"numeric",minute:"2-digit"})}`:a.toLocaleString(void 0,{year:"numeric",month:"short",day:"numeric",hour:"numeric",minute:"2-digit"})}/**
|
|
92
|
+
* @license lucide-react v1.14.0 - ISC
|
|
93
|
+
*
|
|
94
|
+
* This source code is licensed under the ISC license.
|
|
95
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
96
|
+
*/const qb=(...e)=>e.filter((n,a,r)=>!!n&&n.trim()!==""&&r.indexOf(n)===a).join(" ").trim();/**
|
|
97
|
+
* @license lucide-react v1.14.0 - ISC
|
|
98
|
+
*
|
|
99
|
+
* This source code is licensed under the ISC license.
|
|
100
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
101
|
+
*/const WT=e=>e.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase();/**
|
|
102
|
+
* @license lucide-react v1.14.0 - ISC
|
|
103
|
+
*
|
|
104
|
+
* This source code is licensed under the ISC license.
|
|
105
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
106
|
+
*/const YT=e=>e.replace(/^([A-Z])|[\s-_]+(\w)/g,(n,a,r)=>r?r.toUpperCase():a.toLowerCase());/**
|
|
107
|
+
* @license lucide-react v1.14.0 - ISC
|
|
108
|
+
*
|
|
109
|
+
* This source code is licensed under the ISC license.
|
|
110
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
111
|
+
*/const I0=e=>{const n=YT(e);return n.charAt(0).toUpperCase()+n.slice(1)};/**
|
|
112
|
+
* @license lucide-react v1.14.0 - ISC
|
|
113
|
+
*
|
|
114
|
+
* This source code is licensed under the ISC license.
|
|
115
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
116
|
+
*/var Yf={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"};/**
|
|
117
|
+
* @license lucide-react v1.14.0 - ISC
|
|
118
|
+
*
|
|
119
|
+
* This source code is licensed under the ISC license.
|
|
120
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
121
|
+
*/const KT=e=>{for(const n in e)if(n.startsWith("aria-")||n==="role"||n==="title")return!0;return!1},QT=S.createContext({}),XT=()=>S.useContext(QT),ZT=S.forwardRef(({color:e,size:n,strokeWidth:a,absoluteStrokeWidth:r,className:o="",children:s,iconNode:u,...d},p)=>{const{size:f=24,strokeWidth:y=2,absoluteStrokeWidth:g=!1,color:x="currentColor",className:b=""}=XT()??{},k=r??g?Number(a??y)*24/Number(n??f):a??y;return S.createElement("svg",{ref:p,...Yf,width:n??f??Yf.width,height:n??f??Yf.height,stroke:e??x,strokeWidth:k,className:qb("lucide",b,o),...!s&&!KT(d)&&{"aria-hidden":"true"},...d},[...u.map(([C,j])=>S.createElement(C,j)),...Array.isArray(s)?s:[s]])});/**
|
|
122
|
+
* @license lucide-react v1.14.0 - ISC
|
|
123
|
+
*
|
|
124
|
+
* This source code is licensed under the ISC license.
|
|
125
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
126
|
+
*/const qt=(e,n)=>{const a=S.forwardRef(({className:r,...o},s)=>S.createElement(ZT,{ref:s,iconNode:n,className:qb(`lucide-${WT(I0(e))}`,`lucide-${e}`,r),...o}));return a.displayName=I0(e),a};/**
|
|
127
|
+
* @license lucide-react v1.14.0 - ISC
|
|
128
|
+
*
|
|
129
|
+
* This source code is licensed under the ISC license.
|
|
130
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
131
|
+
*/const JT=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],eN=qt("arrow-down",JT);/**
|
|
132
|
+
* @license lucide-react v1.14.0 - ISC
|
|
133
|
+
*
|
|
134
|
+
* This source code is licensed under the ISC license.
|
|
135
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
136
|
+
*/const tN=[["path",{d:"m5 12 7-7 7 7",key:"hav0vg"}],["path",{d:"M12 19V5",key:"x0mq9r"}]],nN=qt("arrow-up",tN);/**
|
|
137
|
+
* @license lucide-react v1.14.0 - ISC
|
|
138
|
+
*
|
|
139
|
+
* This source code is licensed under the ISC license.
|
|
140
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
141
|
+
*/const aN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M4.929 4.929 19.07 19.071",key:"196cmz"}]],iN=qt("ban",aN);/**
|
|
142
|
+
* @license lucide-react v1.14.0 - ISC
|
|
143
|
+
*
|
|
144
|
+
* This source code is licensed under the ISC license.
|
|
145
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
146
|
+
*/const rN=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],lN=qt("check",rN);/**
|
|
147
|
+
* @license lucide-react v1.14.0 - ISC
|
|
148
|
+
*
|
|
149
|
+
* This source code is licensed under the ISC license.
|
|
150
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
151
|
+
*/const oN=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],sN=qt("chevron-down",oN);/**
|
|
152
|
+
* @license lucide-react v1.14.0 - ISC
|
|
153
|
+
*
|
|
154
|
+
* This source code is licensed under the ISC license.
|
|
155
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
156
|
+
*/const cN=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],Bp=qt("chevron-right",cN);/**
|
|
157
|
+
* @license lucide-react v1.14.0 - ISC
|
|
158
|
+
*
|
|
159
|
+
* This source code is licensed under the ISC license.
|
|
160
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
161
|
+
*/const uN=[["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"}]],dN=qt("copy",uN);/**
|
|
162
|
+
* @license lucide-react v1.14.0 - ISC
|
|
163
|
+
*
|
|
164
|
+
* This source code is licensed under the ISC license.
|
|
165
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
166
|
+
*/const fN=[["circle",{cx:"12",cy:"12",r:"1",key:"41hilf"}],["circle",{cx:"19",cy:"12",r:"1",key:"1wjl8i"}],["circle",{cx:"5",cy:"12",r:"1",key:"1pcz8c"}]],pN=qt("ellipsis",fN);/**
|
|
167
|
+
* @license lucide-react v1.14.0 - ISC
|
|
168
|
+
*
|
|
169
|
+
* This source code is licensed under the ISC license.
|
|
170
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
171
|
+
*/const hN=[["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"}]],mN=qt("folder",hN);/**
|
|
172
|
+
* @license lucide-react v1.14.0 - ISC
|
|
173
|
+
*
|
|
174
|
+
* This source code is licensed under the ISC license.
|
|
175
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
176
|
+
*/const gN=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],yN=qt("globe",gN);/**
|
|
177
|
+
* @license lucide-react v1.14.0 - ISC
|
|
178
|
+
*
|
|
179
|
+
* This source code is licensed under the ISC license.
|
|
180
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
181
|
+
*/const vN=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],xN=qt("loader-circle",vN);/**
|
|
182
|
+
* @license lucide-react v1.14.0 - ISC
|
|
183
|
+
*
|
|
184
|
+
* This source code is licensed under the ISC license.
|
|
185
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
186
|
+
*/const bN=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],wN=qt("lock",bN);/**
|
|
187
|
+
* @license lucide-react v1.14.0 - ISC
|
|
188
|
+
*
|
|
189
|
+
* This source code is licensed under the ISC license.
|
|
190
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
191
|
+
*/const SN=[["path",{d:"m16 6-8.414 8.586a2 2 0 0 0 2.829 2.829l8.414-8.586a4 4 0 1 0-5.657-5.657l-8.379 8.551a6 6 0 1 0 8.485 8.485l8.379-8.551",key:"1miecu"}]],kN=qt("paperclip",SN);/**
|
|
192
|
+
* @license lucide-react v1.14.0 - ISC
|
|
193
|
+
*
|
|
194
|
+
* This source code is licensed under the ISC license.
|
|
195
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
196
|
+
*/const CN=[["circle",{cx:"18",cy:"5",r:"3",key:"gq8acd"}],["circle",{cx:"6",cy:"12",r:"3",key:"w7nqdw"}],["circle",{cx:"18",cy:"19",r:"3",key:"1xt0gg"}],["line",{x1:"8.59",x2:"15.42",y1:"13.51",y2:"17.49",key:"47mynk"}],["line",{x1:"15.41",x2:"8.59",y1:"6.51",y2:"10.49",key:"1n3mei"}]],P0=qt("share-2",CN);/**
|
|
197
|
+
* @license lucide-react v1.14.0 - ISC
|
|
198
|
+
*
|
|
199
|
+
* This source code is licensed under the ISC license.
|
|
200
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
201
|
+
*/const EN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],AN=qt("square",EN);/**
|
|
202
|
+
* @license lucide-react v1.14.0 - ISC
|
|
203
|
+
*
|
|
204
|
+
* This source code is licensed under the ISC license.
|
|
205
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
206
|
+
*/const jN=[["path",{d:"M16 7h6v6",key:"box55l"}],["path",{d:"m22 7-8.5 8.5-5-5L2 17",key:"1t1m79"}]],TN=qt("trending-up",jN);/**
|
|
207
|
+
* @license lucide-react v1.14.0 - ISC
|
|
208
|
+
*
|
|
209
|
+
* This source code is licensed under the ISC license.
|
|
210
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
211
|
+
*/const NN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],RN=qt("upload",NN);/**
|
|
212
|
+
* @license lucide-react v1.14.0 - ISC
|
|
213
|
+
*
|
|
214
|
+
* This source code is licensed under the ISC license.
|
|
215
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
216
|
+
*/const _N=[["path",{d:"M18 21a8 8 0 0 0-16 0",key:"3ypg7q"}],["circle",{cx:"10",cy:"8",r:"5",key:"o932ke"}],["path",{d:"M22 20c0-3.37-2-6.5-4-8a5 5 0 0 0-.45-8.3",key:"10s06x"}]],ON=qt("users-round",_N);/**
|
|
217
|
+
* @license lucide-react v1.14.0 - ISC
|
|
218
|
+
*
|
|
219
|
+
* This source code is licensed under the ISC license.
|
|
220
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
221
|
+
*/const DN=[["path",{d:"M19 7V4a1 1 0 0 0-1-1H5a2 2 0 0 0 0 4h15a1 1 0 0 1 1 1v4h-3a2 2 0 0 0 0 4h3a1 1 0 0 0 1-1v-2a1 1 0 0 0-1-1",key:"18etb6"}],["path",{d:"M3 5v14a2 2 0 0 0 2 2h15a1 1 0 0 0 1-1v-4",key:"xoc0q4"}]],MN=qt("wallet",DN);/**
|
|
222
|
+
* @license lucide-react v1.14.0 - ISC
|
|
223
|
+
*
|
|
224
|
+
* This source code is licensed under the ISC license.
|
|
225
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
226
|
+
*/const LN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],zN=qt("x",LN),Kf={1:"ETH",8453:"ETH",84532:"ETH",11155111:"ETH",31337:"ETH",100:"xDAI",10200:"xDAI",2043:"NEURO",20430:"NEURO"};function Fb(e){var r;if(e==null)return"ETH";const n=String(e);if(Kf[n])return Kf[n];const a=(r=n.match(/(\d+)\s*$/))==null?void 0:r[1];return a&&Kf[a]||"ETH"}const Qf="—";function IN(e,n=2){if(e==null)return Qf;let a;if(typeof e=="number")a=e;else{const s=String(e).trim();if(!/^[+-]?(\d+\.?\d*|\.\d+)([eE][+-]?\d+)?$/.test(s))return Qf;a=Number(s)}if(!Number.isFinite(a))return Qf;const r=Math.abs(a),o=r>0&&r<10?n:0;return new Intl.NumberFormat("en-US",{minimumFractionDigits:0,maximumFractionDigits:o}).format(a)}function PN(e,n=2){if(e==null||e==="")return"—";let a;try{a=BigInt(e)}catch{return"—"}const r=a<0n;r&&(a=-a);const o=10n**18n,s=a/o,u=(a%o+o).toString().slice(1).slice(0,n);return IN(`${r?"-":""}${s}.${u||"0"}`,n)}const UN=new Set(["84532","11155111","31337","10200","20430"]);function t9(e){if(e==null)return!1;const n=String(e),a=n.includes(":")?n.split(":").pop():n;return UN.has(a)}function n9(e,n=Math.floor(Date.now()/1e3)){if(!e||e<=0)return"Expiry unknown";const a=e-n,r=Math.round(Math.abs(a)/86400);return a<=0?r===0?"Expired today":`Expired ~${r} day${r===1?"":"s"} ago`:`Expires in ~${r} day${r===1?"":"s"}`}function Gb(e){if(!e)return null;let n,a;try{n=BigInt(e.baseCost),a=BigInt(e.discountedCost)}catch{return null}return n<=0n||a<0n||a>=n?null:Number(((n-a)*10000n+n/2n)/n)}function a9({convictionCostCovered:e,className:n=""}){const a=Gb(e);if(e==null||a==null)return null;const r=(a/100).toFixed(a%100===0?0:1),o=e.accountId?`via PCA #${e.accountId}`:"across multiple PCAs";return m.jsxs("span",{className:["badge","badge-success","v10-pca-discount-applied",n].filter(Boolean).join(" "),"data-testid":"pca-discount-badge",role:"status",children:[m.jsx("span",{"aria-hidden":"true",children:"◉ "}),"Discount applied — −",r,"% ",o]})}const qc=new Map,Hp=new Set;let U0=!1;function BN(){const e=[...qc.values()];for(const n of Hp)n(e)}function HN(e){const n=e.detail;qc.has(n.info.uuid)||(qc.set(n.info.uuid,n),BN())}function $N(){U0||typeof window>"u"||(U0=!0,window.addEventListener("eip6963:announceProvider",HN),window.dispatchEvent(new Event("eip6963:requestProvider")))}function qN(e){return Hp.add(e),e([...qc.values()]),()=>{Hp.delete(e)}}function Oh(e){var r;if(typeof e=="number")return e;const n=(r=String(e).match(/(\d+)\s*$/))==null?void 0:r[1],a=n?Number(n):NaN;if(!Number.isFinite(a))throw new Error(`Unrecognized chainId: ${e}`);return a}function FN(e){return`0x${Oh(e).toString(16)}`}const Dh="dkg-node-ui:wallet-provider-rdns";function GN(e){var n;try{(n=globalThis.localStorage)==null||n.setItem(Dh,e)}catch{}}function VN(){var e;try{return((e=globalThis.localStorage)==null?void 0:e.getItem(Dh))??null}catch{return null}}function B0(){var e;try{(e=globalThis.localStorage)==null||e.removeItem(Dh)}catch{}}function WN(e){return(e.walletRpcUrls??[]).filter(n=>/^https?:\/\//i.test(n))}async function YN(e,n){const a=FN(n.chainId);try{await e.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})}catch(r){if((r==null?void 0:r.code)!==4902)throw r;const o=Fb(n.chainId),s=WN(n);if(s.length===0)throw new Error("Wallet does not know this chain and the node did not provide wallet-public RPC URLs. Add the network in your wallet, then try again.");await e.request({method:"wallet_addEthereumChain",params:[{chainId:a,chainName:`chain-${Oh(n.chainId)}`,nativeCurrency:{name:o,symbol:o,decimals:18},rpcUrls:s}]}),await e.request({method:"wallet_switchEthereumChain",params:[{chainId:a}]})}}const Vb=new Set(["app.phantom"]),KN=300;function QN(e){return e.filter(n=>!Vb.has(n.info.rdns))}function XN(e,n){if(!n)return null;const a=e.filter(r=>r.info.rdns===n);return a.length===1?a[0]:null}function i9(e){return e.address!=null&&e.expectedChainId!=null&&e.chainId!==e.expectedChainId}let uc=!1,dc=null,H0=!1;const r9=ur((e,n)=>{function a(o){o.on&&(o.on("accountsChanged",(...s)=>{const u=s[0],d=(u==null?void 0:u[0])??null;if(d===null){n().disconnect();return}e({address:d})}),o.on("chainChanged",(...s)=>{e({chainId:parseInt(s[0],16)})}),o.on("disconnect",()=>n().disconnect()))}async function r(o){const s=o.provider;try{const u=await s.request({method:"eth_accounts"});if(u.length===0){B0();return}const d=await s.request({method:"eth_chainId"});a(s),e({provider:s,providerInfo:o.info,address:u[0],chainId:parseInt(d,16)})}catch(u){console.warn("[wallet] silent reconnect failed",u)}}return{discovered:[],unsupported:[],provider:null,providerInfo:null,address:null,chainId:null,expectedChainId:null,bootstrap:null,setBootstrap(o){e({bootstrap:o,expectedChainId:Oh(o.chainId)})},initWallet(){if(typeof window>"u"||($N(),H0))return;H0=!0;const o=VN();qN(s=>{e({discovered:QN(s),unsupported:s.filter(u=>Vb.has(u.info.rdns))}),!(!o||uc)&&(dc&&clearTimeout(dc),dc=setTimeout(()=>{if(dc=null,uc)return;const u=XN(n().discovered,o);u&&(uc=!0,r(u))},KN))})},async connect(o){const s=o.provider,u=await s.request({method:"eth_requestAccounts"}),d=await s.request({method:"eth_chainId"});a(s),e({provider:s,providerInfo:o.info,address:u[0]??null,chainId:parseInt(d,16)}),GN(o.info.rdns),uc=!1},disconnect(){e({provider:null,providerInfo:null,address:null,chainId:null}),B0()},async switchToExpectedChain(){const{provider:o,bootstrap:s}=n();if(!o)throw new Error("Wallet not connected.");if(!s)throw new Error("Chain not bootstrapped.");await YN(o,s)}}});function Mh(e,n){return e&&e.trim()?e:n.length>20?`${n.slice(0,16)}…`:n}function $0(e){return e.length>12?`${e.slice(0,6)}…${e.slice(-4)}`:e}function ZN({item:e,onApprove:n,onDeny:a,onOpen:r}){var y;const[o,s]=S.useState({kind:"idle"}),u=Mh(e.contextGraphName,e.cgId),d=((y=e.agentName)==null?void 0:y.trim())||$0(e.agentAddress),p=async g=>{s({kind:"working",action:g});const b=await(g==="approve"?n:a)(e.cgId,e.agentAddress);if(b.ok){const k=b.alreadyHandled?"Already handled":g==="approve"?`Approved — ${d} can now access ${u}`:`Request from ${d} declined`;s({kind:"done",label:k})}else{const k=b.roleError?`You're no longer the curator of ${u}`:g==="approve"?"Couldn’t approve":"Couldn’t deny";s({kind:"error",action:g,message:k})}};if(o.kind==="done")return m.jsxs("div",{className:"v10-notif-row v10-notif-row-terminal",role:"status","aria-live":"polite",children:[m.jsx("span",{className:"v10-notif-glyph","aria-hidden":"true",children:"✓"}),m.jsx("span",{className:"v10-notif-terminal-text",children:o.label})]});const f=o.kind==="working";return m.jsxs("div",{className:"v10-notif-row v10-notif-row-join",children:[m.jsx("span",{className:"v10-notif-glyph v10-notif-glyph-join","aria-hidden":"true",children:"🔑"}),m.jsxs("div",{className:"v10-notif-row-body",children:[m.jsx("div",{className:"v10-notif-row-title",children:"Join request"}),m.jsxs("div",{className:"v10-notif-row-detail",children:[m.jsx("span",{className:"v10-notif-actor",children:d})," wants to join"," ",m.jsx("button",{type:"button",className:"v10-notif-cg-link",onClick:()=>r(e.cgId),title:`Open ${u}`,children:u})]}),m.jsxs("div",{className:"v10-notif-row-sub",children:[m.jsx("span",{className:"v10-notif-addr",title:e.agentAddress,children:$0(e.agentAddress)}),m.jsx("span",{className:"v10-notif-dot",children:"·"}),m.jsx("span",{className:"v10-notif-time",title:new Date(e.ts).toLocaleString(),children:Mo(e.ts)})]}),o.kind==="error"&&m.jsxs("div",{className:"v10-notif-row-error",role:"status","aria-live":"polite",children:[o.message," ",m.jsx("button",{type:"button",className:"v10-notif-retry",onClick:()=>p(o.action),children:"Retry"})]}),m.jsx("span",{className:"v10-sr-only",role:"status","aria-live":"polite",children:f?o.action==="approve"?"Approving…":"Denying…":""})]}),m.jsx("div",{className:"v10-notif-row-actions",children:o.kind==="confirming-deny"?m.jsxs("span",{className:"v10-notif-deny-confirm",role:"group","aria-label":"Confirm deny",onKeyDown:g=>{g.key==="Escape"&&(g.stopPropagation(),s({kind:"idle"}))},onBlur:g=>{g.currentTarget.contains(g.relatedTarget)||s({kind:"idle"})},children:[m.jsx("span",{className:"v10-notif-deny-confirm-label",children:"Deny?"}),m.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-deny",onClick:()=>p("deny"),"aria-label":`Confirm deny join request from ${d} for ${u}`,children:"Yes"}),m.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-ghost",onClick:()=>s({kind:"idle"}),autoFocus:!0,children:"Cancel"})]}):m.jsxs(m.Fragment,{children:[m.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-approve",onClick:()=>p("approve"),disabled:f,"aria-label":`Approve join request from ${d} for ${u}`,children:f&&o.action==="approve"?"…":"Approve"}),m.jsx("button",{type:"button",className:"v10-notif-btn v10-notif-btn-ghost",onClick:()=>s({kind:"confirming-deny"}),disabled:f,"aria-label":`Deny join request from ${d} for ${u}`,children:f&&o.action==="deny"?"…":"Deny"})]})})]})}const JN={created:"+",promoted:"⇡",published:"◉"};function eR(e,n,a){const r=n,o=r===1?"assertion":"assertions";return e==="created"?a?`${a} added ${r} ${o}`:`${r} new ${o} added`:e==="promoted"?a?`${a} promoted ${r} ${o}`:`${r} ${o} promoted`:a?`${a} published ${r} ${o} to Verifiable Memory`:`${r} ${o} published to Verifiable Memory`}function tR({item:e,onOpen:n}){var d;const a=Mh(e.contextGraphName,e.cgId),r=e.bySelf?"You":((d=e.actorAgentName)==null?void 0:d.trim())||void 0,o=eR(e.event,e.count,r),s=Mo(e.ts),u=`${o} in ${a}${s?`, ${s}`:""}. Open ${a} recent activity.`;return m.jsxs("button",{type:"button",className:`v10-notif-row v10-notif-row-activity v10-notif-activity-${e.event}${e.bySelf?" v10-notif-by-self":""}${e.read?"":" v10-notif-unread"}`,onClick:()=>n(e.cgId),title:`Open ${a} · recent activity`,"aria-label":u,children:[m.jsx("span",{className:`v10-notif-glyph v10-notif-glyph-${e.event}`,"aria-hidden":"true",children:JN[e.event]}),m.jsx("span",{className:"v10-notif-row-body","aria-hidden":"true",children:m.jsxs("span",{className:"v10-notif-row-detail",children:[o," in ",m.jsx("span",{className:"v10-notif-cg-name",children:a})]})}),m.jsx("span",{className:"v10-notif-time","aria-hidden":"true",title:new Date(e.ts).toLocaleString(),children:s})]})}function nR({item:e,onOpen:n}){const a=Mh(e.contextGraphName,e.cgId),r=e.kind==="join_approved",o=m.jsxs(m.Fragment,{children:[m.jsx("span",{className:`v10-notif-glyph ${r?"v10-notif-glyph-approved":"v10-notif-glyph-rejected"}`,"aria-hidden":"true",children:r?"✓":"✕"}),m.jsxs("span",{className:"v10-notif-row-body",children:[m.jsx("span",{className:"v10-notif-row-title",children:r?"Request approved":"Request declined"}),m.jsx("span",{className:"v10-notif-row-detail",children:r?m.jsxs(m.Fragment,{children:["You can now access ",m.jsx("span",{className:"v10-notif-cg-name",children:a})]}):m.jsxs(m.Fragment,{children:["Your request to join ",m.jsx("span",{className:"v10-notif-cg-name",children:a})," wasn’t approved"]})})]}),m.jsx("span",{className:"v10-notif-time",title:new Date(e.ts).toLocaleString(),children:Mo(e.ts)})]});if(r){const s=Mo(e.ts);return m.jsx("button",{type:"button",className:`v10-notif-row v10-notif-row-confirm v10-notif-confirm-approved${e.read?"":" v10-notif-unread"}`,onClick:()=>n(e.cgId),title:`Open ${a}`,"aria-label":`Request approved: you can now access ${a}${s?`, ${s}`:""}. Open ${a}.`,children:o})}return m.jsx("div",{className:`v10-notif-row v10-notif-row-confirm v10-notif-confirm-rejected${e.read?"":" v10-notif-unread"}`,"aria-disabled":"true",children:o})}function aR({item:e}){var f;const n=Gb(e.covered),a=n!=null?(n/100).toFixed(n%100===0?0:1):null;let r=null;try{const y=BigInt(e.covered.baseCost),g=BigInt(e.covered.discountedCost);y>0n&&g>=0n&&g<y&&(r=PN((y-g).toString()))}catch{r=null}const o=`PCA #${e.covered.accountId}`,s=(f=e.contextGraphName)!=null&&f.trim()?` in ${e.contextGraphName.trim()}`:"",u=a!=null?"Publishing discount applied":"Publishing fee covered",d=a!=null?`−${a}% via ${o}${r?` · saved ${r} TRAC`:""}${s}`:`via ${o}${s}`,p=Mo(e.ts);return m.jsxs("div",{className:`v10-notif-row v10-notif-row-confirm v10-notif-pca-discount${e.read?"":" v10-notif-unread"}`,role:"status","aria-label":`${u}, ${d}${p?`, ${p}`:""}.`,children:[m.jsx("span",{className:"v10-notif-glyph v10-notif-glyph-approved","aria-hidden":"true",children:"◉"}),m.jsxs("span",{className:"v10-notif-row-body","aria-hidden":"true",children:[m.jsx("span",{className:"v10-notif-row-title",children:u}),m.jsx("span",{className:"v10-notif-row-detail",children:d})]}),m.jsx("span",{className:"v10-notif-time","aria-hidden":"true",title:new Date(e.ts).toLocaleString(),children:p})]})}function iR({feed:e,onOpenContextGraph:n,pcaAlerts:a=[],onOpenPca:r,id:o,paneRef:s}){const{joinRequests:u,activity:d,status:p,refreshError:f,partialActivityError:y,hasInformationalUnread:g,approve:x,deny:b,markSeen:k,markAllInformationalSeen:C}=e,j=(U,D)=>{k([D]),n(U)},E=u.length>0,_=d.length>0,R=a.length>0,F=!E&&!_&&!R;return m.jsxs("div",{className:"v10-notif-pane",role:"region","aria-label":"Notifications",id:o,ref:s,tabIndex:-1,children:[m.jsxs("div",{className:"v10-notif-pane-titlebar",children:[m.jsx("div",{className:"v10-notif-pane-title",children:"Notifications"}),g&&m.jsx("button",{type:"button",className:"v10-notif-pane-markread",onClick:C,title:"Mark informational notifications as read",children:"Mark all read"})]}),m.jsxs("div",{className:"v10-notif-pane-body",children:[R&&m.jsxs("section",{className:"v10-notif-section v10-notif-section-pca","aria-label":"Publisher Conviction",children:[m.jsxs("div",{className:"v10-notif-section-head",children:[m.jsx("span",{className:"v10-notif-section-label",children:"Publisher Conviction"}),m.jsx("span",{className:"v10-notif-section-count",children:a.length})]}),m.jsx("div",{className:"v10-notif-section-rows",children:a.map(U=>m.jsxs("div",{className:"v10-pca-alert-row","data-severity":U.severity,"data-testid":"pca-bell-alert",role:U.severity==="danger"?"alert":"status",children:[m.jsx("div",{className:"v10-pca-alert-title",children:U.title}),m.jsx("div",{className:"v10-pca-alert-msg",children:U.message}),r&&m.jsxs("button",{type:"button",className:"v10-pca-alert-action",onClick:()=>r(U.accountId),children:["Manage PCA #",U.accountId]})]},U.id))})]}),p==="identity-pending"?m.jsx("div",{className:"v10-notif-pane-state",role:"status",children:"Verifying access…"}):p==="loading"&&F?m.jsx("div",{className:"v10-notif-pane-state",role:"status",children:"Loading notifications…"}):p==="error"&&F?m.jsxs("div",{className:"v10-notif-pane-error",role:"status","aria-live":"polite",children:["Couldn’t load notifications."," ",m.jsx("button",{type:"button",className:"v10-notif-retry",onClick:e.retry,children:"Retry"})]}):F?m.jsxs("div",{className:"v10-notif-pane-empty",role:"status",children:[m.jsx("div",{className:"v10-notif-pane-empty-lead",children:"You’re all caught up."}),m.jsx("div",{className:"v10-notif-pane-empty-sub",children:"Join requests, approvals, and new activity in your context graphs will show up here."})]}):m.jsxs(m.Fragment,{children:[f&&m.jsxs("div",{className:"v10-notif-pane-error v10-notif-pane-error-inline",role:"status","aria-live":"polite",children:["Couldn’t refresh notifications."," ",m.jsx("button",{type:"button",className:"v10-notif-retry",onClick:e.retry,children:"Retry"})]}),E&&m.jsxs("section",{className:"v10-notif-section v10-notif-section-action","aria-label":"Needs your action",children:[m.jsxs("div",{className:"v10-notif-section-head",children:[m.jsx("span",{className:"v10-notif-section-label",children:"Needs your action"}),m.jsx("span",{className:"v10-notif-section-count",children:u.length})]}),m.jsx("div",{className:"v10-notif-section-rows",children:u.map(U=>m.jsx(ZN,{item:U,onApprove:x,onDeny:b,onOpen:n},U.id))})]}),m.jsxs("section",{className:"v10-notif-section v10-notif-section-activity","aria-label":"Activity",children:[m.jsx("div",{className:"v10-notif-section-head",children:m.jsx("span",{className:"v10-notif-section-label",children:"Activity"})}),y&&m.jsx("div",{className:"v10-notif-pane-error v10-notif-pane-error-inline",role:"status","aria-live":"polite",children:"Recent activity couldn’t load."}),_?m.jsx("div",{className:"v10-notif-section-rows",children:d.map(U=>U.kind==="digest"?m.jsx(tR,{item:U,onOpen:D=>j(D,U.id)},U.id):U.kind==="pca_cost_covered"?m.jsx(aR,{item:U},U.id):m.jsx(nR,{item:U,onOpen:D=>j(D,U.id)},U.id))}):!y&&m.jsx("div",{className:"v10-notif-section-empty",children:"No recent activity."})]})]})]})]})}const rR=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M18 8A6 6 0 0 0 6 8c0 7-3 9-3 9h18s-3-2-3-9"}),m.jsx("path",{d:"M13.73 21a2 2 0 0 1-3.46 0"})]}),q0="v10-notifications-pane";function lR(){const e=RT(),n=VT(),[a,r]=S.useState(!1),o=S.useRef(null),s=S.useRef(null),u=ca(b=>b.setActiveProject),{openTab:d}=gn(),p=S.useRef(null),f=S.useCallback((b=!1)=>{var k;r(!1),b&&((k=s.current)==null||k.focus())},[]);S.useEffect(()=>{if(!a)return;const b=k=>{o.current&&!o.current.contains(k.target)&&f()};return document.addEventListener("mousedown",b),()=>document.removeEventListener("mousedown",b)},[a,f]),S.useEffect(()=>{if(!a)return;const b=p.current;if(!b)return;const k=b.querySelector(".v10-notif-section-action .v10-notif-btn-approve"),C=b.querySelector(".v10-notif-section-rows button, .v10-notif-section-rows a[href]"),j=b.querySelector('button:not(.v10-notif-pane-markread), [href], [tabindex]:not([tabindex="-1"])');(k??C??j??b).focus()},[a]);const y=S.useCallback(b=>{u(b),d({id:`project:${b}`,label:b.slice(0,16),closable:!0}),f()},[u,d,f]),g=S.useCallback(b=>{d({id:`conviction:${b}`,label:`PCA #${b}`,closable:!0}),f()},[d,f]),x=e.unread+n.length;return m.jsxs("div",{className:"v10-header-notif-wrap",ref:o,onKeyDown:a?b=>{b.key==="Escape"&&(b.stopPropagation(),f(!0))}:void 0,children:[m.jsxs("button",{ref:s,className:"v10-header-icon-btn",onClick:()=>r(b=>!b),title:x>0?`Notifications (${x} unread)`:"Notifications","aria-label":x>0?`Notifications, ${x} unread`:"Notifications","aria-haspopup":"dialog","aria-expanded":a,"aria-controls":a?q0:void 0,children:[rR,x>0&&m.jsx("span",{className:"v10-header-notif-badge",children:x})]}),a&&m.jsx(iR,{id:q0,paneRef:p,feed:e,onOpenContextGraph:y,pcaAlerts:n,onOpenPca:g})]})}function oR(e,n,a,r,o){const s=[e?"Synced with the network":"Syncing with the network",`${n} peer${n===1?"":"s"} (${a} direct, ${r} relayed)`];return o>0&&s.push(`Uptime ${sR(o)}`),s.join(`
|
|
227
|
+
`)}function sR(e){const n=Math.max(0,Math.floor(e/1e3)),a=Math.floor(n/86400),r=Math.floor(n%86400/3600),o=Math.floor(n%3600/60),s=[];return a>0&&s.push(`${a}d`),(r>0||a>0)&&s.push(`${r}h`),s.push(`${o}m`),s.join(" ")}const cR=m.jsx("span",{className:"v10-header-ot-wordmark",children:m.jsxs("svg",{width:"60",height:"13",viewBox:"0 0 180 40",fill:"none",xmlns:"http://www.w3.org/2000/svg","aria-hidden":!0,children:[m.jsx("path",{d:"M55.0428 28.0111C59.7903 28.0111 62.6388 24.531 62.6388 20.3908C62.6388 16.2806 59.7903 12.8005 55.0428 12.8005C50.325 12.8005 47.4766 16.2806 47.4766 20.3908C47.4766 24.531 50.325 28.0111 55.0428 28.0111ZM55.0428 24.621C52.6988 24.621 51.3932 22.6709 51.3932 20.3908C51.3932 18.1407 52.6988 16.1906 55.0428 16.1906C57.3869 16.1906 58.7221 18.1407 58.7221 20.3908C58.7221 22.6709 57.3869 24.621 55.0428 24.621Z",fill:"currentColor"}),m.jsx("path",{d:"M65.4344 27.6511H69.2027V18.0807C69.8258 17.1507 71.4874 16.4606 72.7336 16.4606C73.149 16.4606 73.5051 16.4906 73.7721 16.5507V12.8305C71.9918 12.8305 70.2115 13.8505 69.2027 15.1406V13.1605H65.4344V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M77.9959 11.0304C79.2421 11.0304 80.251 10.0104 80.251 8.75031C80.251 7.49026 79.2421 6.47021 77.9959 6.47021C76.7794 6.47021 75.7409 7.49026 75.7409 8.75031C75.7409 10.0104 76.7794 11.0304 77.9959 11.0304ZM76.1266 27.6511H79.8949V13.1605H76.1266V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M83.3347 31.3713C85.115 32.9614 87.0437 33.5314 89.5064 33.5314C93.0373 33.5314 97.2507 32.1813 97.2507 26.6611V13.1605H93.4527V15.0206C92.2955 13.5505 90.7526 12.8005 89.0317 12.8005C85.4117 12.8005 82.7116 15.4406 82.7116 20.1808C82.7116 25.011 85.4414 27.5611 89.0317 27.5611C90.7823 27.5611 92.3252 26.7211 93.4527 25.281V26.7511C93.4527 29.6012 91.3164 30.4113 89.5064 30.4113C87.6964 30.4113 86.1832 29.9012 85.026 28.6112L83.3347 31.3713ZM93.4527 22.5209C92.8296 23.4509 91.4647 24.171 90.2185 24.171C88.0822 24.171 86.5986 22.6709 86.5986 20.1808C86.5986 17.6907 88.0822 16.1906 90.2185 16.1906C91.4647 16.1906 92.8296 16.8807 93.4527 17.8407V22.5209Z",fill:"currentColor"}),m.jsx("path",{d:"M102.857 11.0304C104.104 11.0304 105.113 10.0104 105.113 8.75031C105.113 7.49026 104.104 6.47021 102.857 6.47021C101.641 6.47021 100.602 7.49026 100.602 8.75031C100.602 10.0104 101.641 11.0304 102.857 11.0304ZM100.988 27.6511H104.756V13.1605H100.988V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M118.166 27.6511H121.934V17.4207C121.934 14.6006 120.421 12.8005 117.276 12.8005C114.932 12.8005 113.181 13.9405 112.261 15.0506V13.1605H108.493V27.6511H112.261V17.9007C112.884 17.0307 114.042 16.1906 115.525 16.1906C117.127 16.1906 118.166 16.8807 118.166 18.8908V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M130.483 28.0111C132.055 28.0111 133.064 27.5911 133.628 27.0811L132.827 24.201C132.619 24.411 132.085 24.621 131.521 24.621C130.69 24.621 130.216 23.931 130.216 23.0309V16.4906H133.123V13.1605H130.216V9.20033H126.418V13.1605H124.044V16.4906H126.418V24.051C126.418 26.6311 127.842 28.0111 130.483 28.0111Z",fill:"currentColor"}),m.jsx("path",{d:"M135.702 27.6511H139.47V18.0807C140.093 17.1507 141.755 16.4606 143.001 16.4606C143.416 16.4606 143.772 16.4906 144.039 16.5507V12.8305C142.259 12.8305 140.479 13.8505 139.47 15.1406V13.1605H135.702V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M156.245 27.6511H160.043V13.1605H156.245V15.0206C155.117 13.5505 153.515 12.8005 151.824 12.8005C148.174 12.8005 145.474 15.6806 145.474 20.4208C145.474 25.251 148.204 28.0111 151.824 28.0111C153.545 28.0111 155.117 27.2311 156.245 25.8211V27.6511ZM156.245 22.9709C155.592 23.931 154.257 24.621 152.981 24.621C150.845 24.621 149.361 22.9109 149.361 20.4208C149.361 17.9007 150.845 16.2206 152.981 16.2206C154.257 16.2206 155.592 16.9107 156.245 17.8707V22.9709Z",fill:"currentColor"}),m.jsx("path",{d:"M165.649 11.0304C166.895 11.0304 167.904 10.0104 167.904 8.75031C167.904 7.49026 166.895 6.47021 165.649 6.47021C164.432 6.47021 163.394 7.49026 163.394 8.75031C163.394 10.0104 164.432 11.0304 165.649 11.0304ZM163.78 27.6511H167.548V13.1605H163.78V27.6511Z",fill:"currentColor"}),m.jsx("path",{d:"M175.32 28.0111C176.863 28.0111 177.871 27.5911 178.435 27.0811L177.634 24.201C177.456 24.411 176.922 24.621 176.358 24.621C175.527 24.621 175.053 23.931 175.053 23.0309V7.64026H171.284V24.051C171.284 26.6311 172.679 28.0111 175.32 28.0111Z",fill:"currentColor"}),m.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M19.781 9.94781C14.2903 9.94781 9.8385 14.4484 9.8385 20.0008C9.8385 25.5525 14.2903 30.0531 19.781 30.0531C22.833 30.0531 25.5632 28.6622 27.3869 26.4736L34.9141 32.8796C31.2855 37.2341 25.8532 40.0016 19.781 40.0016C8.85592 40.0016 0 31.0467 0 20.0008C0 8.95432 8.85592 0 19.781 0V9.94781ZM36.8737 30.0724L28.3719 25.0628C28.662 24.5606 28.9105 24.0308 29.112 23.4781L38.3464 26.9194C37.9453 28.0192 37.4508 29.0732 36.8737 30.0724ZM29.7216 20.0007H39.5609C39.5609 18.8159 39.4583 17.6554 39.2628 16.5272L29.5719 18.2549C29.6701 18.822 29.7216 19.4053 29.7216 20.0007ZM34.988 7.20831L27.425 13.5712C27.0546 13.1215 26.646 12.7054 26.2045 12.3272L32.5596 4.73338C33.4381 5.4858 34.251 6.31374 34.988 7.20831Z",fill:"currentColor"})]})}),uR=m.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("circle",{cx:"12",cy:"12",r:"5"}),m.jsx("line",{x1:"12",y1:"1",x2:"12",y2:"3"}),m.jsx("line",{x1:"12",y1:"21",x2:"12",y2:"23"}),m.jsx("line",{x1:"4.22",y1:"4.22",x2:"5.64",y2:"5.64"}),m.jsx("line",{x1:"18.36",y1:"18.36",x2:"19.78",y2:"19.78"}),m.jsx("line",{x1:"1",y1:"12",x2:"3",y2:"12"}),m.jsx("line",{x1:"21",y1:"12",x2:"23",y2:"12"}),m.jsx("line",{x1:"4.22",y1:"19.78",x2:"5.64",y2:"18.36"}),m.jsx("line",{x1:"18.36",y1:"5.64",x2:"19.78",y2:"4.22"})]}),dR=m.jsx("svg",{width:"14",height:"14",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:m.jsx("path",{d:"M21 12.79A9 9 0 1 1 11.21 3 7 7 0 0 0 21 12.79z"})}),fR=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),m.jsx("line",{x1:"9",y1:"3",x2:"9",y2:"21"})]}),pR=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("rect",{x:"3",y:"3",width:"18",height:"18",rx:"2"}),m.jsx("line",{x1:"15",y1:"3",x2:"15",y2:"21"})]}),hR=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("circle",{cx:"12",cy:"12",r:"3"}),m.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09a1.65 1.65 0 0 0-1-1.51 1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09a1.65 1.65 0 0 0 1.51-1 1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),mR=m.jsx("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:m.jsx("polyline",{points:"22 12 18 12 15 21 9 3 6 12 2 12"})}),gR=m.jsxs("svg",{width:"15",height:"15",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round",children:[m.jsx("path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.78 4.78 4 4 0 0 1-6.74 0 4 4 0 0 1-4.78-4.78 4 4 0 0 1 0-6.75z"}),m.jsx("line",{x1:"15",y1:"9",x2:"9",y2:"15"}),m.jsx("circle",{cx:"9.5",cy:"9.5",r:".5"}),m.jsx("circle",{cx:"14.5",cy:"14.5",r:".5"})]});function yR(){var j,E;const{theme:e,setTheme:n,leftCollapsed:a,toggleLeft:r,rightCollapsed:o,toggleRight:s}=Bn(),u=bh(_=>_.nodeStatus),d=Rh().data,{openTab:p}=gn(),f=(u==null?void 0:u.connectedPeers)??(u==null?void 0:u.peerCount)??0,y=((j=u==null?void 0:u.connections)==null?void 0:j.direct)??0,g=((E=u==null?void 0:u.connections)==null?void 0:E.relayed)??0,x=(u==null?void 0:u.uptimeMs)??0,k=u!=null&&(u==null?void 0:u.synced)!==!1,C=oR(k,f,y,g,x);return m.jsxs("header",{className:"v10-header",children:[m.jsxs("div",{className:"v10-header-logo",children:[m.jsxs("span",{className:"v10-header-logo-text",children:["DKG ",m.jsx("span",{className:"v10-header-logo-version",children:"v10"})]}),m.jsxs("div",{className:"v10-header-logo-ot","aria-label":"Powered by OriginTrail",children:[m.jsx("span",{className:"v10-header-logo-ot-by",children:"powered by"}),cR]})]}),m.jsx("button",{className:`v10-header-icon-btn ${a?"":"active-toggle"}`,onClick:r,title:"Toggle sidebar",children:fR}),m.jsx("div",{className:"v10-header-sep"}),m.jsxs("div",{className:"v10-header-agent-switcher",title:d?`${d.agentDid}
|
|
228
|
+
${d.agentAddress}`:void 0,children:[m.jsx("span",{className:"v10-header-agent-dot"}),m.jsx("span",{className:"v10-header-agent-name",children:(d!=null&&d.name&&d.name!=="**"?d.name:null)||(u==null?void 0:u.name)||"Agent"}),(d==null?void 0:d.agentAddress)&&m.jsxs("span",{className:"v10-header-agent-addr",children:[d.agentAddress.slice(0,6),"…",d.agentAddress.slice(-4)]})]}),m.jsx("div",{className:"v10-header-spacer"}),m.jsxs("div",{className:"v10-header-meta",title:C,children:[m.jsx("span",{className:`v10-header-status-dot ${k?"online":"offline"}`}),m.jsx("span",{children:k?"synced":"syncing"}),m.jsx("span",{className:"v10-header-meta-sep",children:"·"}),m.jsxs("span",{children:[f," peer",f!==1?"s":""]})]}),m.jsxs("div",{className:"v10-header-actions",children:[m.jsx(lR,{}),m.jsx("button",{className:"v10-header-icon-btn",onClick:()=>p({id:"operations",label:"Observability",closable:!0}),title:"Observability",children:mR}),m.jsx("button",{className:"v10-header-icon-btn","data-testid":"pca-launch-btn",onClick:()=>p({id:"conviction",label:"Publisher Conviction",closable:!0}),title:"Publisher Conviction - publishing discounts",children:gR}),m.jsx("button",{className:"v10-header-icon-btn",onClick:()=>p({id:"settings",label:"Settings",closable:!0}),title:"Settings",children:hR}),m.jsx("button",{className:"v10-header-icon-btn",onClick:()=>n(e==="dark"?"light":"dark"),title:e==="dark"?"Switch to light mode":"Switch to dark mode",children:e==="dark"?uR:dR}),m.jsx("button",{className:`v10-header-icon-btn ${o?"":"active-toggle"}`,onClick:s,title:"Toggle agent panel",children:pR})]})]})}function vR(){const e=localStorage.getItem("dkg-journey-stage");return e==="1"?1:e==="2"?2:0}const Lh=ur((e,n)=>({stage:vR(),setStage:a=>{localStorage.setItem("dkg-journey-stage",String(a)),e({stage:a})},advance:()=>{const a=Math.min(n().stage+1,2);localStorage.setItem("dkg-journey-stage",String(a)),e({stage:a})}})),xR=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
229
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
230
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
231
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
232
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
233
|
+
@prefix schema: <http://schema.org/> .
|
|
234
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
235
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
236
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
237
|
+
@prefix bibo: <http://purl.org/ontology/bibo/> .
|
|
238
|
+
@prefix fabio: <http://purl.org/spar/fabio/> .
|
|
239
|
+
@prefix cito: <http://purl.org/spar/cito/> .
|
|
240
|
+
@prefix frbr: <http://purl.org/vocab/frbr/core#> .
|
|
241
|
+
|
|
242
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
243
|
+
@prefix dkg: <http://dkg.io/ontology/> .
|
|
244
|
+
@prefix : <http://dkg.io/ontology/book-research/> .
|
|
245
|
+
|
|
246
|
+
<http://dkg.io/ontology/book-research/>
|
|
247
|
+
a owl:Ontology ;
|
|
248
|
+
dcterms:title "DKG Book Research Project Ontology (v1)" ;
|
|
249
|
+
dcterms:description """Starter ontology for projects that research and
|
|
250
|
+
write books, papers, or long-form non-fiction. Built on schema.org +
|
|
251
|
+
BIBO + the SPAR family (FaBiO, CiTO) + FRBR + SKOS so it composes with
|
|
252
|
+
existing scholarly publishing infrastructure.""" ;
|
|
253
|
+
owl:versionInfo "1.0.0" ;
|
|
254
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
255
|
+
owl:imports
|
|
256
|
+
<http://schema.org/> , <http://purl.org/dc/terms/> ,
|
|
257
|
+
<http://www.w3.org/ns/prov#> , <http://xmlns.com/foaf/0.1/> ,
|
|
258
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
259
|
+
<http://purl.org/ontology/bibo/> ,
|
|
260
|
+
<http://purl.org/spar/fabio/> ,
|
|
261
|
+
<http://purl.org/spar/cito/> ,
|
|
262
|
+
<http://purl.org/vocab/frbr/core#> .
|
|
263
|
+
|
|
264
|
+
# ─── Universal annotation predicates (shared across all starters) ───
|
|
265
|
+
chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
266
|
+
chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
|
|
267
|
+
chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range owl:Thing .
|
|
268
|
+
chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range owl:Thing .
|
|
269
|
+
chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Finding .
|
|
270
|
+
chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
|
|
271
|
+
|
|
272
|
+
# ─── Universal annotation entities ──────────────────────────────────
|
|
273
|
+
:Concept rdfs:subClassOf skos:Concept .
|
|
274
|
+
:Topic rdfs:subClassOf skos:Concept .
|
|
275
|
+
:Question rdfs:subClassOf schema:Question .
|
|
276
|
+
:Finding rdfs:subClassOf prov:Entity .
|
|
277
|
+
|
|
278
|
+
# ─── Book-research specific ─────────────────────────────────────────
|
|
279
|
+
|
|
280
|
+
:Hypothesis a owl:Class ;
|
|
281
|
+
rdfs:label "Hypothesis" ;
|
|
282
|
+
rdfs:comment "A claim under investigation. Supersedes when refuted; promotes to a Finding when supported." ;
|
|
283
|
+
rdfs:subClassOf prov:Entity .
|
|
284
|
+
|
|
285
|
+
:Argument a owl:Class ;
|
|
286
|
+
rdfs:label "Argument" ;
|
|
287
|
+
rdfs:comment "A reasoned position taken on a Hypothesis or other entity." ;
|
|
288
|
+
rdfs:subClassOf prov:Entity .
|
|
289
|
+
|
|
290
|
+
:Counterexample a owl:Class ;
|
|
291
|
+
rdfs:label "Counterexample" ;
|
|
292
|
+
rdfs:comment "Evidence that refutes a Hypothesis or Argument." ;
|
|
293
|
+
rdfs:subClassOf prov:Entity .
|
|
294
|
+
|
|
295
|
+
:Quote a owl:Class ;
|
|
296
|
+
rdfs:label "Quote" ;
|
|
297
|
+
rdfs:comment "Verbatim passage extracted from a source. Subclass of bibo:Quote so it composes with bibliographic tools." ;
|
|
298
|
+
rdfs:subClassOf bibo:Quote .
|
|
299
|
+
|
|
300
|
+
:supports a owl:ObjectProperty ;
|
|
301
|
+
rdfs:label "supports" ;
|
|
302
|
+
rdfs:comment "An Argument or Quote supports a Hypothesis." ;
|
|
303
|
+
rdfs:subPropertyOf cito:agreesWith .
|
|
304
|
+
|
|
305
|
+
:refutes a owl:ObjectProperty ;
|
|
306
|
+
rdfs:label "refutes" ;
|
|
307
|
+
rdfs:comment "An Argument, Counterexample, or Quote refutes a Hypothesis." ;
|
|
308
|
+
rdfs:subPropertyOf cito:disagreesWith .
|
|
309
|
+
|
|
310
|
+
:cites a owl:ObjectProperty ;
|
|
311
|
+
rdfs:label "cites" ;
|
|
312
|
+
rdfs:subPropertyOf cito:cites ;
|
|
313
|
+
rdfs:range bibo:Document .
|
|
314
|
+
|
|
315
|
+
# ─── URI patterns ───────────────────────────────────────────────────
|
|
316
|
+
:UriPattern rdfs:label "URI minting pattern" .
|
|
317
|
+
|
|
318
|
+
:concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
|
|
319
|
+
:topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
|
|
320
|
+
:question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
|
|
321
|
+
:finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
|
|
322
|
+
:hypothesis-pattern a :UriPattern ; skos:notation "urn:dkg:hypothesis:<slug>" .
|
|
323
|
+
:argument-pattern a :UriPattern ; skos:notation "urn:dkg:argument:<slug>" .
|
|
324
|
+
:quote-pattern a :UriPattern ; skos:notation "urn:dkg:quote:<slug>" .
|
|
325
|
+
:citation-pattern a :UriPattern ; skos:notation "urn:dkg:citation:<slug>" ;
|
|
326
|
+
skos:definition "Bibliographic citation; aligned with bibo:Document via cito:cites." .
|
|
327
|
+
|
|
328
|
+
:slug-normalisation a skos:Note ;
|
|
329
|
+
skos:definition "Lowercase → ASCII-fold → strip stopwords (the/a/an/of/for/and/or/to/in/on/with) → hyphenate → ≤60 chars. Apply BEFORE comparing free-text recall results (\`dkg_memory_search\`) to decide reuse-vs-mint." .
|
|
330
|
+
`,bR=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
331
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
332
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
333
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
334
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
335
|
+
@prefix schema: <http://schema.org/> .
|
|
336
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
337
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
338
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
339
|
+
@prefix doap: <http://usefulinc.com/ns/doap#> .
|
|
340
|
+
|
|
341
|
+
# DKG project namespaces — v1 ontology for any "coding project"
|
|
342
|
+
# context graph. Imports widely-adopted Linked Data vocabs first;
|
|
343
|
+
# only declares extensions for genuinely net-new concepts.
|
|
344
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
345
|
+
@prefix code: <http://dkg.io/ontology/code/> .
|
|
346
|
+
@prefix github: <http://dkg.io/ontology/github/> .
|
|
347
|
+
@prefix decisions: <http://dkg.io/ontology/decisions/> .
|
|
348
|
+
@prefix tasks: <http://dkg.io/ontology/tasks/> .
|
|
349
|
+
@prefix agent: <http://dkg.io/ontology/agent/> .
|
|
350
|
+
@prefix dkg: <http://dkg.io/ontology/> .
|
|
351
|
+
|
|
352
|
+
@prefix : <http://dkg.io/ontology/coding-project/> .
|
|
353
|
+
|
|
354
|
+
# ─── Ontology header ────────────────────────────────────────────────
|
|
355
|
+
<http://dkg.io/ontology/coding-project/>
|
|
356
|
+
a owl:Ontology ;
|
|
357
|
+
dcterms:title "DKG Coding Project Ontology (v1)" ;
|
|
358
|
+
dcterms:description """The starter ontology for any DKG context graph that
|
|
359
|
+
represents a software project — its decisions, tasks, code structure, GitHub
|
|
360
|
+
activity, agents, and chat. Designed to be \`owl:imports\`-ed by per-project
|
|
361
|
+
ontologies, which add their own extensions on top.
|
|
362
|
+
|
|
363
|
+
Every predicate is either reused from a globally-adopted vocabulary
|
|
364
|
+
(schema.org, DCTerms, PROV-O, FOAF, SKOS, DOAP) or declared here as a
|
|
365
|
+
project-specific extension. Companion document \`agent-guide.md\` translates
|
|
366
|
+
this formal model into operational instructions for AI coding agents.""" ;
|
|
367
|
+
dcterms:creator "branarakic" ;
|
|
368
|
+
owl:versionInfo "1.0.0" ;
|
|
369
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
370
|
+
owl:imports
|
|
371
|
+
<http://schema.org/> ,
|
|
372
|
+
<http://purl.org/dc/terms/> ,
|
|
373
|
+
<http://www.w3.org/ns/prov#> ,
|
|
374
|
+
<http://xmlns.com/foaf/0.1/> ,
|
|
375
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
376
|
+
<http://usefulinc.com/ns/doap#> .
|
|
377
|
+
|
|
378
|
+
# ─── Section 1 — Universal annotation primitives ────────────────────
|
|
379
|
+
# Predicates expressing what each chat turn was ABOUT — written into
|
|
380
|
+
# the project's \`chat\` sub-graph by the capture-chat hook (and later
|
|
381
|
+
# read by \`dkg_query\` / \`dkg_memory_search\`). These predicates apply
|
|
382
|
+
# to ANY project type, not just coding.
|
|
383
|
+
|
|
384
|
+
chat:topic
|
|
385
|
+
a owl:DatatypeProperty ;
|
|
386
|
+
rdfs:label "topic" ;
|
|
387
|
+
rdfs:comment "Free-text topical bucket the chat turn lives under. Multiple per turn; emit liberally. Renderer can use these to cluster the activity feed." ;
|
|
388
|
+
rdfs:domain chat:Turn ;
|
|
389
|
+
rdfs:range xsd:string .
|
|
390
|
+
|
|
391
|
+
chat:mentions
|
|
392
|
+
a owl:ObjectProperty ;
|
|
393
|
+
rdfs:label "mentions" ;
|
|
394
|
+
rdfs:comment "An entity the chat turn referenced. The most common edge in the graph. To find existing entities to reuse before minting fresh URIs, use \`dkg_memory_search\` (free-text recall across WM/SWM/VM)." ;
|
|
395
|
+
rdfs:domain chat:Turn ;
|
|
396
|
+
rdfs:range owl:Thing ;
|
|
397
|
+
rdfs:subPropertyOf schema:mentions .
|
|
398
|
+
|
|
399
|
+
chat:examines
|
|
400
|
+
a owl:ObjectProperty ;
|
|
401
|
+
rdfs:label "examines" ;
|
|
402
|
+
rdfs:comment "Entity the chat turn walked through in detail (vs just mentioning in passing). Implies the agent or operator is ANALYSING the entity, not merely citing it." ;
|
|
403
|
+
rdfs:domain chat:Turn ;
|
|
404
|
+
rdfs:range owl:Thing .
|
|
405
|
+
|
|
406
|
+
chat:proposes
|
|
407
|
+
a owl:ObjectProperty ;
|
|
408
|
+
rdfs:label "proposes" ;
|
|
409
|
+
rdfs:comment "An idea/decision/task the chat turn put forward. Often points at a freshly-minted Decision or Task entity created in the same write batch." ;
|
|
410
|
+
rdfs:domain chat:Turn ;
|
|
411
|
+
rdfs:range owl:Thing .
|
|
412
|
+
|
|
413
|
+
chat:concludes
|
|
414
|
+
a owl:ObjectProperty ;
|
|
415
|
+
rdfs:label "concludes" ;
|
|
416
|
+
rdfs:comment "A Finding entity the chat turn produced — a claim worth preserving as a first-class node, separate from the turn body." ;
|
|
417
|
+
rdfs:domain chat:Turn ;
|
|
418
|
+
rdfs:range :Finding .
|
|
419
|
+
|
|
420
|
+
chat:asks
|
|
421
|
+
a owl:ObjectProperty ;
|
|
422
|
+
rdfs:label "asks" ;
|
|
423
|
+
rdfs:comment "A Question entity the chat turn left open. Tracking these lets a future query surface 'what did we never resolve?'." ;
|
|
424
|
+
rdfs:domain chat:Turn ;
|
|
425
|
+
rdfs:range :Question .
|
|
426
|
+
|
|
427
|
+
# ─── Section 2 — Universal annotation entity classes ────────────────
|
|
428
|
+
|
|
429
|
+
:Concept
|
|
430
|
+
a owl:Class ;
|
|
431
|
+
rdfs:label "Concept" ;
|
|
432
|
+
rdfs:comment "A free-text concept emerging from chat that doesn't fit into a more specific class. Aligned with skos:Concept so it composes with any knowledge organisation system." ;
|
|
433
|
+
rdfs:subClassOf skos:Concept .
|
|
434
|
+
|
|
435
|
+
:Topic
|
|
436
|
+
a owl:Class ;
|
|
437
|
+
rdfs:label "Topic" ;
|
|
438
|
+
rdfs:comment "A broad topical bucket grouping related concepts/turns/entities. URI pattern: urn:dkg:topic:<slug>." ;
|
|
439
|
+
rdfs:subClassOf skos:Concept .
|
|
440
|
+
|
|
441
|
+
:Question
|
|
442
|
+
a owl:Class ;
|
|
443
|
+
rdfs:label "Question" ;
|
|
444
|
+
rdfs:comment "An open question raised in chat that hasn't been answered yet. URI pattern: urn:dkg:question:<slug>. Resolved by linking a chat:Turn or :Finding via :answers." ;
|
|
445
|
+
rdfs:subClassOf schema:Question .
|
|
446
|
+
|
|
447
|
+
:Finding
|
|
448
|
+
a owl:Class ;
|
|
449
|
+
rdfs:label "Finding" ;
|
|
450
|
+
rdfs:comment "A claim or observation worth preserving as a first-class entity, separate from the chat turn that produced it. URI pattern: urn:dkg:finding:<slug>. Findings can be cited by future Decisions, Tasks, and chat turns." ;
|
|
451
|
+
rdfs:subClassOf prov:Entity .
|
|
452
|
+
|
|
453
|
+
:answers
|
|
454
|
+
a owl:ObjectProperty ;
|
|
455
|
+
rdfs:label "answers" ;
|
|
456
|
+
rdfs:comment "Links a Finding (or chat turn) to the Question it resolves." ;
|
|
457
|
+
rdfs:domain owl:Thing ;
|
|
458
|
+
rdfs:range :Question .
|
|
459
|
+
|
|
460
|
+
:supersedes
|
|
461
|
+
a owl:ObjectProperty ;
|
|
462
|
+
rdfs:label "supersedes" ;
|
|
463
|
+
rdfs:comment "This entity replaces an older one (e.g. a revised Finding supersedes an earlier one)." ;
|
|
464
|
+
rdfs:range owl:Thing ;
|
|
465
|
+
owl:inverseOf prov:wasRevisionOf .
|
|
466
|
+
|
|
467
|
+
# ─── Section 3 — Coding-project-specific classes ────────────────────
|
|
468
|
+
# Formalises the predicates already used informally in
|
|
469
|
+
# scripts/lib/ontology.mjs, anchoring them in PROV-O and schema.org.
|
|
470
|
+
|
|
471
|
+
decisions:Decision
|
|
472
|
+
a owl:Class ;
|
|
473
|
+
rdfs:label "Decision" ;
|
|
474
|
+
rdfs:comment "An architectural decision the project made — context, outcome, consequences. Modelled as a prov:Activity because it represents a deliberate act of choosing." ;
|
|
475
|
+
rdfs:subClassOf prov:Activity, schema:Action .
|
|
476
|
+
|
|
477
|
+
decisions:context
|
|
478
|
+
a owl:DatatypeProperty ;
|
|
479
|
+
rdfs:label "context" ;
|
|
480
|
+
rdfs:domain decisions:Decision ;
|
|
481
|
+
rdfs:range xsd:string ;
|
|
482
|
+
rdfs:comment "Why this decision was being made — problem, constraints, alternatives considered." .
|
|
483
|
+
|
|
484
|
+
decisions:outcome
|
|
485
|
+
a owl:DatatypeProperty ;
|
|
486
|
+
rdfs:label "outcome" ;
|
|
487
|
+
rdfs:domain decisions:Decision ;
|
|
488
|
+
rdfs:range xsd:string ;
|
|
489
|
+
rdfs:comment "The chosen direction — the decision itself, in one paragraph." .
|
|
490
|
+
|
|
491
|
+
decisions:consequences
|
|
492
|
+
a owl:DatatypeProperty ;
|
|
493
|
+
rdfs:label "consequences" ;
|
|
494
|
+
rdfs:domain decisions:Decision ;
|
|
495
|
+
rdfs:range xsd:string ;
|
|
496
|
+
rdfs:comment "What this implies going forward — trade-offs, follow-ups." .
|
|
497
|
+
|
|
498
|
+
decisions:status
|
|
499
|
+
a owl:DatatypeProperty ;
|
|
500
|
+
rdfs:label "status" ;
|
|
501
|
+
rdfs:domain decisions:Decision ;
|
|
502
|
+
rdfs:range xsd:string ;
|
|
503
|
+
rdfs:comment "One of: proposed | accepted | rejected | superseded." .
|
|
504
|
+
|
|
505
|
+
tasks:Task
|
|
506
|
+
a owl:Class ;
|
|
507
|
+
rdfs:label "Task" ;
|
|
508
|
+
rdfs:comment "A piece of planned or in-flight work on the project." ;
|
|
509
|
+
rdfs:subClassOf schema:Action .
|
|
510
|
+
|
|
511
|
+
tasks:status
|
|
512
|
+
a owl:DatatypeProperty ;
|
|
513
|
+
rdfs:label "status" ;
|
|
514
|
+
rdfs:domain tasks:Task ;
|
|
515
|
+
rdfs:range xsd:string ;
|
|
516
|
+
rdfs:comment "One of: todo | in_progress | blocked | done | cancelled." .
|
|
517
|
+
|
|
518
|
+
tasks:priority
|
|
519
|
+
a owl:DatatypeProperty ;
|
|
520
|
+
rdfs:label "priority" ;
|
|
521
|
+
rdfs:domain tasks:Task ;
|
|
522
|
+
rdfs:range xsd:string ;
|
|
523
|
+
rdfs:comment "One of: p0 | p1 | p2 | p3." .
|
|
524
|
+
|
|
525
|
+
tasks:relatedDecision
|
|
526
|
+
a owl:ObjectProperty ;
|
|
527
|
+
rdfs:label "related decision" ;
|
|
528
|
+
rdfs:domain tasks:Task ;
|
|
529
|
+
rdfs:range decisions:Decision ;
|
|
530
|
+
rdfs:comment "The Decision this task implements or follows from." .
|
|
531
|
+
|
|
532
|
+
tasks:dependsOn
|
|
533
|
+
a owl:ObjectProperty ;
|
|
534
|
+
rdfs:label "depends on" ;
|
|
535
|
+
rdfs:domain tasks:Task ;
|
|
536
|
+
rdfs:range tasks:Task .
|
|
537
|
+
|
|
538
|
+
tasks:touches
|
|
539
|
+
a owl:ObjectProperty ;
|
|
540
|
+
rdfs:label "touches" ;
|
|
541
|
+
rdfs:domain tasks:Task ;
|
|
542
|
+
rdfs:range owl:Thing ;
|
|
543
|
+
rdfs:comment "A code:File or code:Package this task edits." .
|
|
544
|
+
|
|
545
|
+
# Code structure — aligned with schema:SoftwareSourceCode + DOAP.
|
|
546
|
+
|
|
547
|
+
code:Package
|
|
548
|
+
a owl:Class ;
|
|
549
|
+
rdfs:label "Package" ;
|
|
550
|
+
rdfs:subClassOf doap:Project, schema:SoftwareApplication .
|
|
551
|
+
|
|
552
|
+
code:File
|
|
553
|
+
a owl:Class ;
|
|
554
|
+
rdfs:label "Source file" ;
|
|
555
|
+
rdfs:subClassOf schema:SoftwareSourceCode .
|
|
556
|
+
|
|
557
|
+
code:Function a owl:Class ; rdfs:label "Function" .
|
|
558
|
+
code:Class a owl:Class ; rdfs:label "Class" .
|
|
559
|
+
code:Interface a owl:Class ; rdfs:label "Interface" .
|
|
560
|
+
|
|
561
|
+
# GitHub — minimal aliasing onto schema.org where sensible.
|
|
562
|
+
|
|
563
|
+
github:Repository
|
|
564
|
+
a owl:Class ;
|
|
565
|
+
rdfs:label "GitHub repository" ;
|
|
566
|
+
rdfs:subClassOf schema:SoftwareSourceCode, doap:Project .
|
|
567
|
+
|
|
568
|
+
github:PullRequest
|
|
569
|
+
a owl:Class ;
|
|
570
|
+
rdfs:label "Pull request" ;
|
|
571
|
+
rdfs:subClassOf schema:CreativeWork .
|
|
572
|
+
|
|
573
|
+
github:Issue
|
|
574
|
+
a owl:Class ;
|
|
575
|
+
rdfs:label "GitHub issue" ;
|
|
576
|
+
rdfs:subClassOf schema:Question, schema:CreativeWork .
|
|
577
|
+
|
|
578
|
+
# ─── Section 4 — Chat sub-graph classes ─────────────────────────────
|
|
579
|
+
|
|
580
|
+
chat:Session
|
|
581
|
+
a owl:Class ;
|
|
582
|
+
rdfs:label "Chat session" ;
|
|
583
|
+
rdfs:comment "One conversation between an operator and their coding assistant (Cursor window, Claude Code thread, etc.)." ;
|
|
584
|
+
rdfs:subClassOf schema:Conversation .
|
|
585
|
+
|
|
586
|
+
chat:Turn
|
|
587
|
+
a owl:Class ;
|
|
588
|
+
rdfs:label "Chat turn" ;
|
|
589
|
+
rdfs:comment "One user-prompt + assistant-response pair within a Session. Carries provenance via prov:wasAttributedTo." ;
|
|
590
|
+
rdfs:subClassOf schema:Message, prov:Entity .
|
|
591
|
+
|
|
592
|
+
chat:userPrompt a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
593
|
+
chat:assistantResponse a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
594
|
+
chat:turnIndex a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:integer .
|
|
595
|
+
chat:inSession a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range chat:Session .
|
|
596
|
+
chat:speakerTool a owl:DatatypeProperty ; rdfs:range xsd:string ;
|
|
597
|
+
rdfs:comment "Identifier of the coding assistant that produced the turn (e.g. 'cursor', 'claude-code')." .
|
|
598
|
+
chat:privacy a owl:DatatypeProperty ; rdfs:domain chat:Session ; rdfs:range xsd:string ;
|
|
599
|
+
rdfs:comment "One of: private | team | public. Controls auto-promote behaviour of the capture hook." .
|
|
600
|
+
|
|
601
|
+
# ─── Section 5 — Agent identity ─────────────────────────────────────
|
|
602
|
+
|
|
603
|
+
agent:Agent
|
|
604
|
+
a owl:Class ;
|
|
605
|
+
rdfs:label "Agent" ;
|
|
606
|
+
rdfs:subClassOf prov:Agent, foaf:Agent .
|
|
607
|
+
|
|
608
|
+
agent:HumanAgent rdfs:subClassOf agent:Agent, foaf:Person .
|
|
609
|
+
agent:AIAgent rdfs:subClassOf agent:Agent, schema:SoftwareApplication .
|
|
610
|
+
|
|
611
|
+
agent:framework
|
|
612
|
+
a owl:DatatypeProperty ;
|
|
613
|
+
rdfs:label "framework" ;
|
|
614
|
+
rdfs:domain agent:AIAgent ;
|
|
615
|
+
rdfs:range xsd:string ;
|
|
616
|
+
rdfs:comment "Name of the agent runtime — 'cursor', 'claude-code', 'openclaw', 'hermes', etc." .
|
|
617
|
+
|
|
618
|
+
agent:operator
|
|
619
|
+
a owl:ObjectProperty ;
|
|
620
|
+
rdfs:label "operator" ;
|
|
621
|
+
rdfs:domain agent:AIAgent ;
|
|
622
|
+
rdfs:range agent:HumanAgent ;
|
|
623
|
+
rdfs:comment "The human operator who runs and is responsible for this AI agent." .
|
|
624
|
+
|
|
625
|
+
# ─── Section 6 — URI minting conventions (machine-readable) ─────────
|
|
626
|
+
# These are encoded as SKOS notes so an agent reading the ontology can
|
|
627
|
+
# pull them out programmatically. The agent guide repeats them in
|
|
628
|
+
# prose for human readability.
|
|
629
|
+
|
|
630
|
+
:UriPattern
|
|
631
|
+
a owl:Class ;
|
|
632
|
+
rdfs:label "URI minting pattern" ;
|
|
633
|
+
rdfs:comment "Documents the URI shape the agent should produce when minting a new entity of a given type." .
|
|
634
|
+
|
|
635
|
+
:concept-pattern a :UriPattern ;
|
|
636
|
+
skos:notation "urn:dkg:concept:<slug>" ;
|
|
637
|
+
skos:definition "Free-text concept; aligned with skos:Concept." .
|
|
638
|
+
:topic-pattern a :UriPattern ;
|
|
639
|
+
skos:notation "urn:dkg:topic:<slug>" ;
|
|
640
|
+
skos:definition "Broad topical bucket grouping related entities." .
|
|
641
|
+
:question-pattern a :UriPattern ;
|
|
642
|
+
skos:notation "urn:dkg:question:<slug>" ;
|
|
643
|
+
skos:definition "An open question awaiting an answer." .
|
|
644
|
+
:finding-pattern a :UriPattern ;
|
|
645
|
+
skos:notation "urn:dkg:finding:<slug>" ;
|
|
646
|
+
skos:definition "A claim or observation worth preserving as a first-class node." .
|
|
647
|
+
:decision-pattern a :UriPattern ;
|
|
648
|
+
skos:notation "urn:dkg:decision:<slug>" ;
|
|
649
|
+
skos:definition "An architectural decision (coding-project specific)." .
|
|
650
|
+
:task-pattern a :UriPattern ;
|
|
651
|
+
skos:notation "urn:dkg:task:<slug>" ;
|
|
652
|
+
skos:definition "A piece of planned or in-flight work (coding-project specific)." .
|
|
653
|
+
|
|
654
|
+
# ─── Section 7 — Slug normalisation rule (deterministic) ────────────
|
|
655
|
+
|
|
656
|
+
:slug-normalisation a skos:Note ;
|
|
657
|
+
skos:prefLabel "slug normalisation" ;
|
|
658
|
+
skos:definition """To compute the canonical slug from a free-text label:
|
|
659
|
+
1. Lowercase.
|
|
660
|
+
2. Apply Unicode NFKD then strip combining marks (ASCII fold).
|
|
661
|
+
3. Strip common stopwords (the / a / an / of / for / and / or / to / in / on / with).
|
|
662
|
+
4. Replace any run of non-[a-z0-9] with a single hyphen.
|
|
663
|
+
5. Trim leading/trailing hyphens.
|
|
664
|
+
6. Truncate to 60 characters max.
|
|
665
|
+
|
|
666
|
+
Example: "the Tree-Sitter library", "Tree sitter", "TREE_SITTER" all
|
|
667
|
+
normalise to "tree-sitter". Always apply this BEFORE comparing free-text
|
|
668
|
+
recall results (\`dkg_memory_search\`) in the look-before-mint protocol.""" .
|
|
669
|
+
`,wR=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
670
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
671
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
672
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
673
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
674
|
+
@prefix schema: <http://schema.org/> .
|
|
675
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
676
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
677
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
678
|
+
@prefix bibo: <http://purl.org/ontology/bibo/> .
|
|
679
|
+
|
|
680
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
681
|
+
@prefix : <http://dkg.io/ontology/narrative-writing/> .
|
|
682
|
+
|
|
683
|
+
<http://dkg.io/ontology/narrative-writing/>
|
|
684
|
+
a owl:Ontology ;
|
|
685
|
+
dcterms:title "DKG Narrative Writing Project Ontology (v1)" ;
|
|
686
|
+
dcterms:description """Starter for fiction or narrative non-fiction
|
|
687
|
+
projects: novels, screenplays, biographies. Tracks Characters, Scenes,
|
|
688
|
+
Plot Points, Themes, and the relationships between them.""" ;
|
|
689
|
+
owl:versionInfo "1.0.0" ;
|
|
690
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
691
|
+
owl:imports
|
|
692
|
+
<http://schema.org/> , <http://purl.org/dc/terms/> ,
|
|
693
|
+
<http://xmlns.com/foaf/0.1/> ,
|
|
694
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
695
|
+
<http://purl.org/ontology/bibo/> .
|
|
696
|
+
|
|
697
|
+
# ─── Universal annotation predicates ────────────────────────────────
|
|
698
|
+
chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
699
|
+
chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
|
|
700
|
+
chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
701
|
+
chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
702
|
+
chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Finding .
|
|
703
|
+
chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
|
|
704
|
+
|
|
705
|
+
# ─── Universal annotation entities ──────────────────────────────────
|
|
706
|
+
:Concept rdfs:subClassOf skos:Concept .
|
|
707
|
+
:Topic rdfs:subClassOf skos:Concept .
|
|
708
|
+
:Question rdfs:subClassOf schema:Question .
|
|
709
|
+
:Finding rdfs:subClassOf prov:Entity .
|
|
710
|
+
|
|
711
|
+
# ─── Narrative-writing-specific ─────────────────────────────────────
|
|
712
|
+
|
|
713
|
+
:Character a owl:Class ;
|
|
714
|
+
rdfs:label "Character" ;
|
|
715
|
+
rdfs:comment "A character in the narrative — fictional or historical." ;
|
|
716
|
+
rdfs:subClassOf foaf:Person, schema:Person .
|
|
717
|
+
|
|
718
|
+
:Scene a owl:Class ;
|
|
719
|
+
rdfs:label "Scene" ;
|
|
720
|
+
rdfs:comment "A discrete unit of narrative action — a single place/time/event in the story." ;
|
|
721
|
+
rdfs:subClassOf schema:Event .
|
|
722
|
+
|
|
723
|
+
:PlotPoint a owl:Class ;
|
|
724
|
+
rdfs:label "Plot point" ;
|
|
725
|
+
rdfs:comment "A structural moment in the narrative arc (inciting incident, climax, resolution, etc.)." .
|
|
726
|
+
|
|
727
|
+
:Theme a owl:Class ;
|
|
728
|
+
rdfs:label "Theme" ;
|
|
729
|
+
rdfs:comment "A unifying idea explored across the narrative." ;
|
|
730
|
+
rdfs:subClassOf skos:Concept .
|
|
731
|
+
|
|
732
|
+
:Setting a owl:Class ;
|
|
733
|
+
rdfs:label "Setting" ;
|
|
734
|
+
rdfs:comment "A place + time context within which Scenes occur." .
|
|
735
|
+
|
|
736
|
+
:appearsIn a owl:ObjectProperty ;
|
|
737
|
+
rdfs:label "appears in" ;
|
|
738
|
+
rdfs:domain :Character ;
|
|
739
|
+
rdfs:range :Scene .
|
|
740
|
+
|
|
741
|
+
:setIn a owl:ObjectProperty ;
|
|
742
|
+
rdfs:label "set in" ;
|
|
743
|
+
rdfs:domain :Scene ;
|
|
744
|
+
rdfs:range :Setting .
|
|
745
|
+
|
|
746
|
+
:develops a owl:ObjectProperty ;
|
|
747
|
+
rdfs:label "develops" ;
|
|
748
|
+
rdfs:comment "A Scene or PlotPoint develops a Theme or a Character arc." ;
|
|
749
|
+
rdfs:range owl:Thing .
|
|
750
|
+
|
|
751
|
+
:precedes a owl:ObjectProperty ;
|
|
752
|
+
rdfs:label "precedes" ;
|
|
753
|
+
rdfs:domain :Scene ;
|
|
754
|
+
rdfs:range :Scene .
|
|
755
|
+
|
|
756
|
+
# ─── URI patterns ───────────────────────────────────────────────────
|
|
757
|
+
:UriPattern rdfs:label "URI minting pattern" .
|
|
758
|
+
|
|
759
|
+
:concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
|
|
760
|
+
:topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
|
|
761
|
+
:question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
|
|
762
|
+
:character-pattern a :UriPattern ; skos:notation "urn:dkg:character:<slug>" .
|
|
763
|
+
:scene-pattern a :UriPattern ; skos:notation "urn:dkg:scene:<slug>" .
|
|
764
|
+
:plotpoint-pattern a :UriPattern ; skos:notation "urn:dkg:plotpoint:<slug>" .
|
|
765
|
+
:theme-pattern a :UriPattern ; skos:notation "urn:dkg:theme:<slug>" .
|
|
766
|
+
:setting-pattern a :UriPattern ; skos:notation "urn:dkg:setting:<slug>" .
|
|
767
|
+
|
|
768
|
+
:slug-normalisation a skos:Note ;
|
|
769
|
+
skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
|
|
770
|
+
`,SR=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
771
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
772
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
773
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
774
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
775
|
+
@prefix schema: <http://schema.org/> .
|
|
776
|
+
@prefix foaf: <http://xmlns.com/foaf/0.1/> .
|
|
777
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
778
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
779
|
+
@prefix time: <http://www.w3.org/2006/time#> .
|
|
780
|
+
|
|
781
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
782
|
+
@prefix : <http://dkg.io/ontology/pkm/> .
|
|
783
|
+
|
|
784
|
+
<http://dkg.io/ontology/pkm/>
|
|
785
|
+
a owl:Ontology ;
|
|
786
|
+
dcterms:title "DKG Personal Knowledge Management Ontology (v1)" ;
|
|
787
|
+
dcterms:description """Starter for personal/team knowledge gardens.
|
|
788
|
+
Notes, highlights, questions, insights — the daily-driver vocabulary
|
|
789
|
+
of an Obsidian/Roam-style PKM workflow, but graph-native and shareable
|
|
790
|
+
with teammates' agents.""" ;
|
|
791
|
+
owl:versionInfo "1.0.0" ;
|
|
792
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
793
|
+
owl:imports
|
|
794
|
+
<http://schema.org/> , <http://purl.org/dc/terms/> ,
|
|
795
|
+
<http://xmlns.com/foaf/0.1/> ,
|
|
796
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
797
|
+
<http://www.w3.org/2006/time#> .
|
|
798
|
+
|
|
799
|
+
# ─── Universal annotation predicates ────────────────────────────────
|
|
800
|
+
chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
801
|
+
chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
|
|
802
|
+
chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
803
|
+
chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
804
|
+
chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Insight .
|
|
805
|
+
chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
|
|
806
|
+
|
|
807
|
+
# ─── Universal annotation entities ──────────────────────────────────
|
|
808
|
+
:Concept rdfs:subClassOf skos:Concept .
|
|
809
|
+
:Topic rdfs:subClassOf skos:Concept .
|
|
810
|
+
:Question rdfs:subClassOf schema:Question .
|
|
811
|
+
:Finding rdfs:subClassOf prov:Entity .
|
|
812
|
+
|
|
813
|
+
# ─── PKM-specific ────────────────────────────────────────────────────
|
|
814
|
+
|
|
815
|
+
:Note a owl:Class ;
|
|
816
|
+
rdfs:label "Note" ;
|
|
817
|
+
rdfs:comment "An atomic note — a single self-contained thought worth capturing. The fundamental unit of a PKM graph." ;
|
|
818
|
+
rdfs:subClassOf schema:CreativeWork .
|
|
819
|
+
|
|
820
|
+
:Highlight a owl:Class ;
|
|
821
|
+
rdfs:label "Highlight" ;
|
|
822
|
+
rdfs:comment "A passage of text marked as significant from a source (article, book, transcript). Carries provenance back to the source." ;
|
|
823
|
+
rdfs:subClassOf schema:Quotation .
|
|
824
|
+
|
|
825
|
+
:Insight a owl:Class ;
|
|
826
|
+
rdfs:label "Insight" ;
|
|
827
|
+
rdfs:comment "A connection or realisation that synthesises across multiple Notes/Highlights. Promotes from a chat turn via chat:concludes." ;
|
|
828
|
+
rdfs:subClassOf prov:Entity .
|
|
829
|
+
|
|
830
|
+
:relatedTo a owl:ObjectProperty ;
|
|
831
|
+
rdfs:label "related to" ;
|
|
832
|
+
rdfs:subPropertyOf skos:related .
|
|
833
|
+
|
|
834
|
+
:references a owl:ObjectProperty ;
|
|
835
|
+
rdfs:label "references" ;
|
|
836
|
+
rdfs:subPropertyOf dcterms:references .
|
|
837
|
+
|
|
838
|
+
:source a owl:ObjectProperty ;
|
|
839
|
+
rdfs:label "source" ;
|
|
840
|
+
rdfs:domain :Highlight ;
|
|
841
|
+
rdfs:range schema:CreativeWork ;
|
|
842
|
+
rdfs:comment "Where a Highlight was extracted from." ;
|
|
843
|
+
rdfs:subPropertyOf dcterms:source .
|
|
844
|
+
|
|
845
|
+
# ─── URI patterns ───────────────────────────────────────────────────
|
|
846
|
+
:UriPattern rdfs:label "URI minting pattern" .
|
|
847
|
+
|
|
848
|
+
:concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
|
|
849
|
+
:topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
|
|
850
|
+
:question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
|
|
851
|
+
:finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
|
|
852
|
+
:note-pattern a :UriPattern ; skos:notation "urn:dkg:note:<slug>" .
|
|
853
|
+
:highlight-pattern a :UriPattern ; skos:notation "urn:dkg:highlight:<slug>" .
|
|
854
|
+
:insight-pattern a :UriPattern ; skos:notation "urn:dkg:insight:<slug>" .
|
|
855
|
+
|
|
856
|
+
:slug-normalisation a skos:Note ;
|
|
857
|
+
skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
|
|
858
|
+
`,kR=`@prefix owl: <http://www.w3.org/2002/07/owl#> .
|
|
859
|
+
@prefix rdf: <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
|
|
860
|
+
@prefix rdfs: <http://www.w3.org/2000/01/rdf-schema#> .
|
|
861
|
+
@prefix xsd: <http://www.w3.org/2001/XMLSchema#> .
|
|
862
|
+
@prefix dcterms: <http://purl.org/dc/terms/> .
|
|
863
|
+
@prefix schema: <http://schema.org/> .
|
|
864
|
+
@prefix prov: <http://www.w3.org/ns/prov#> .
|
|
865
|
+
@prefix skos: <http://www.w3.org/2004/02/skos/core#> .
|
|
866
|
+
@prefix dcat: <http://www.w3.org/ns/dcat#> .
|
|
867
|
+
@prefix fabio: <http://purl.org/spar/fabio/> .
|
|
868
|
+
@prefix time: <http://www.w3.org/2006/time#> .
|
|
869
|
+
|
|
870
|
+
@prefix chat: <http://dkg.io/ontology/chat/> .
|
|
871
|
+
@prefix : <http://dkg.io/ontology/scientific-research/> .
|
|
872
|
+
|
|
873
|
+
<http://dkg.io/ontology/scientific-research/>
|
|
874
|
+
a owl:Ontology ;
|
|
875
|
+
dcterms:title "DKG Scientific Research Project Ontology (v1)" ;
|
|
876
|
+
dcterms:description """Starter for empirical scientific research:
|
|
877
|
+
hypotheses → experiments → results → reproducibility chains. Composes
|
|
878
|
+
with FaBiO for scholarly works, DCAT for datasets, PROV-O for
|
|
879
|
+
provenance, OWL Time for sequencing.""" ;
|
|
880
|
+
owl:versionInfo "1.0.0" ;
|
|
881
|
+
dcterms:created "2026-04-18"^^xsd:date ;
|
|
882
|
+
owl:imports
|
|
883
|
+
<http://schema.org/> , <http://purl.org/dc/terms/> ,
|
|
884
|
+
<http://www.w3.org/ns/prov#> ,
|
|
885
|
+
<http://www.w3.org/2004/02/skos/core#> ,
|
|
886
|
+
<http://www.w3.org/ns/dcat#> ,
|
|
887
|
+
<http://purl.org/spar/fabio/> ,
|
|
888
|
+
<http://www.w3.org/2006/time#> .
|
|
889
|
+
|
|
890
|
+
# ─── Universal annotation predicates ────────────────────────────────
|
|
891
|
+
chat:topic a owl:DatatypeProperty ; rdfs:domain chat:Turn ; rdfs:range xsd:string .
|
|
892
|
+
chat:mentions a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:subPropertyOf schema:mentions .
|
|
893
|
+
chat:examines a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
894
|
+
chat:proposes a owl:ObjectProperty ; rdfs:domain chat:Turn .
|
|
895
|
+
chat:concludes a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Result .
|
|
896
|
+
chat:asks a owl:ObjectProperty ; rdfs:domain chat:Turn ; rdfs:range :Question .
|
|
897
|
+
|
|
898
|
+
# ─── Universal annotation entities ──────────────────────────────────
|
|
899
|
+
:Concept rdfs:subClassOf skos:Concept .
|
|
900
|
+
:Topic rdfs:subClassOf skos:Concept .
|
|
901
|
+
:Question rdfs:subClassOf schema:Question .
|
|
902
|
+
:Finding rdfs:subClassOf prov:Entity .
|
|
903
|
+
|
|
904
|
+
# ─── Scientific-research-specific ───────────────────────────────────
|
|
905
|
+
|
|
906
|
+
:Hypothesis a owl:Class ;
|
|
907
|
+
rdfs:label "Hypothesis" ;
|
|
908
|
+
rdfs:comment "A testable claim. Linked to Experiments via :testedBy and to Results via :supportedBy / :refutedBy." ;
|
|
909
|
+
rdfs:subClassOf prov:Entity .
|
|
910
|
+
|
|
911
|
+
:Experiment a owl:Class ;
|
|
912
|
+
rdfs:label "Experiment" ;
|
|
913
|
+
rdfs:comment "A defined procedure executed to test a Hypothesis. Subclass of prov:Activity for full provenance." ;
|
|
914
|
+
rdfs:subClassOf prov:Activity .
|
|
915
|
+
|
|
916
|
+
:Method a owl:Class ;
|
|
917
|
+
rdfs:label "Method" ;
|
|
918
|
+
rdfs:comment "A reusable methodology applied within Experiments." ;
|
|
919
|
+
rdfs:subClassOf prov:Plan .
|
|
920
|
+
|
|
921
|
+
:Result a owl:Class ;
|
|
922
|
+
rdfs:label "Result" ;
|
|
923
|
+
rdfs:comment "An outcome produced by an Experiment — quantitative or qualitative." ;
|
|
924
|
+
rdfs:subClassOf prov:Entity .
|
|
925
|
+
|
|
926
|
+
:Dataset a owl:Class ;
|
|
927
|
+
rdfs:label "Dataset" ;
|
|
928
|
+
rdfs:comment "An input or output dataset for an Experiment. Aligned with DCAT." ;
|
|
929
|
+
rdfs:subClassOf dcat:Dataset .
|
|
930
|
+
|
|
931
|
+
:testedBy a owl:ObjectProperty ;
|
|
932
|
+
rdfs:label "tested by" ;
|
|
933
|
+
rdfs:domain :Hypothesis ;
|
|
934
|
+
rdfs:range :Experiment .
|
|
935
|
+
|
|
936
|
+
:supportedBy a owl:ObjectProperty ;
|
|
937
|
+
rdfs:label "supported by" ;
|
|
938
|
+
rdfs:domain :Hypothesis ;
|
|
939
|
+
rdfs:range :Result .
|
|
940
|
+
|
|
941
|
+
:refutedBy a owl:ObjectProperty ;
|
|
942
|
+
rdfs:label "refuted by" ;
|
|
943
|
+
rdfs:domain :Hypothesis ;
|
|
944
|
+
rdfs:range :Result .
|
|
945
|
+
|
|
946
|
+
:usesDataset a owl:ObjectProperty ;
|
|
947
|
+
rdfs:label "uses dataset" ;
|
|
948
|
+
rdfs:domain :Experiment ;
|
|
949
|
+
rdfs:range :Dataset .
|
|
950
|
+
|
|
951
|
+
:reproducedBy a owl:ObjectProperty ;
|
|
952
|
+
rdfs:label "reproduced by" ;
|
|
953
|
+
rdfs:domain :Experiment ;
|
|
954
|
+
rdfs:range :Experiment ;
|
|
955
|
+
rdfs:comment "An Experiment that successfully reproduced this one's Results." .
|
|
956
|
+
|
|
957
|
+
# ─── URI patterns ───────────────────────────────────────────────────
|
|
958
|
+
:UriPattern rdfs:label "URI minting pattern" .
|
|
959
|
+
|
|
960
|
+
:concept-pattern a :UriPattern ; skos:notation "urn:dkg:concept:<slug>" .
|
|
961
|
+
:topic-pattern a :UriPattern ; skos:notation "urn:dkg:topic:<slug>" .
|
|
962
|
+
:question-pattern a :UriPattern ; skos:notation "urn:dkg:question:<slug>" .
|
|
963
|
+
:finding-pattern a :UriPattern ; skos:notation "urn:dkg:finding:<slug>" .
|
|
964
|
+
:hypothesis-pattern a :UriPattern ; skos:notation "urn:dkg:hypothesis:<slug>" .
|
|
965
|
+
:experiment-pattern a :UriPattern ; skos:notation "urn:dkg:experiment:<slug>" .
|
|
966
|
+
:method-pattern a :UriPattern ; skos:notation "urn:dkg:method:<slug>" .
|
|
967
|
+
:result-pattern a :UriPattern ; skos:notation "urn:dkg:result:<slug>" .
|
|
968
|
+
:dataset-pattern a :UriPattern ; skos:notation "urn:dkg:dataset:<slug>" .
|
|
969
|
+
|
|
970
|
+
:slug-normalisation a skos:Note ;
|
|
971
|
+
skos:definition "Lowercase → ASCII-fold → strip stopwords → hyphenate → ≤60 chars." .
|
|
972
|
+
`,CR=`# Book-research agent guide
|
|
973
|
+
|
|
974
|
+
This starter ships an RDF ontology for **book-research projects** —
|
|
975
|
+
research notebooks anchored in scholarly sources (citations, quotes,
|
|
976
|
+
arguments, hypotheses). The formal schema lives in \`ontology.ttl\`
|
|
977
|
+
alongside this guide.
|
|
978
|
+
|
|
979
|
+
For V10 MCP tool usage, see
|
|
980
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
981
|
+
The tool surface to use against this ontology:
|
|
982
|
+
|
|
983
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
984
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
985
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
986
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
987
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
988
|
+
|
|
989
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
990
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
991
|
+
`,ER=`# Coding-project agent guide
|
|
992
|
+
|
|
993
|
+
This starter ships an RDF ontology for **coding projects** —
|
|
994
|
+
shared project memory for AI coding agents (decisions, tasks, code
|
|
995
|
+
references, GitHub activity, chat turns). The formal schema lives in
|
|
996
|
+
\`ontology.ttl\` alongside this guide.
|
|
997
|
+
|
|
998
|
+
For V10 MCP tool usage, see
|
|
999
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
1000
|
+
The tool surface to use against this ontology:
|
|
1001
|
+
|
|
1002
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
1003
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
1004
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
1005
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
1006
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
1007
|
+
|
|
1008
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
1009
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
1010
|
+
`,AR=`# Narrative-writing agent guide
|
|
1011
|
+
|
|
1012
|
+
This starter ships an RDF ontology for **narrative-writing projects** —
|
|
1013
|
+
the structural elements of long-form narrative (Characters, Scenes,
|
|
1014
|
+
PlotPoints, Themes, Settings) and their relationships. The formal
|
|
1015
|
+
schema lives in \`ontology.ttl\` alongside this guide.
|
|
1016
|
+
|
|
1017
|
+
For V10 MCP tool usage, see
|
|
1018
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
1019
|
+
The tool surface to use against this ontology:
|
|
1020
|
+
|
|
1021
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
1022
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
1023
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
1024
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
1025
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
1026
|
+
|
|
1027
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
1028
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
1029
|
+
`,jR=`# PKM agent guide
|
|
1030
|
+
|
|
1031
|
+
This starter ships an RDF ontology for **PKM (Personal Knowledge
|
|
1032
|
+
Management) projects** — Notes, Highlights, Insights, and the links
|
|
1033
|
+
that grow a knowledge garden organically. The formal schema lives in
|
|
1034
|
+
\`ontology.ttl\` alongside this guide.
|
|
1035
|
+
|
|
1036
|
+
For V10 MCP tool usage, see
|
|
1037
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
1038
|
+
The tool surface to use against this ontology:
|
|
1039
|
+
|
|
1040
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
1041
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
1042
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
1043
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
1044
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
1045
|
+
|
|
1046
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
1047
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
1048
|
+
`,TR=`# Scientific-research agent guide
|
|
1049
|
+
|
|
1050
|
+
This starter ships an RDF ontology for **scientific-research projects** —
|
|
1051
|
+
the empirical research arc (Hypotheses → Experiments → Results →
|
|
1052
|
+
Reproducibility chains), anchored in PROV-O and FaBiO so the graph
|
|
1053
|
+
composes with existing scholarly publishing infrastructure. The formal
|
|
1054
|
+
schema lives in \`ontology.ttl\` alongside this guide.
|
|
1055
|
+
|
|
1056
|
+
For V10 MCP tool usage, see
|
|
1057
|
+
[\`packages/cli/skills/dkg-node/SKILL.md\`](../../../../cli/skills/dkg-node/SKILL.md).
|
|
1058
|
+
The tool surface to use against this ontology:
|
|
1059
|
+
|
|
1060
|
+
- \`dkg_knowledge_asset_create\` + \`dkg_knowledge_asset_write\` — populate (WM)
|
|
1061
|
+
- \`dkg_knowledge_asset_finalize\` — seal the draft (the "git commit")
|
|
1062
|
+
- \`dkg_knowledge_asset_share\` — share with peers (SWM)
|
|
1063
|
+
- \`dkg_knowledge_asset_publish\` — mint on chain (VM); returns the asset's UAL
|
|
1064
|
+
- \`dkg_query\` — SPARQL read; \`dkg_memory_search\` — free-text recall
|
|
1065
|
+
|
|
1066
|
+
The longer per-domain agent-guide walkthrough format will return when
|
|
1067
|
+
the V10 ontology endpoint and per-project annotation workflow stabilise.
|
|
1068
|
+
`,NR=/^[a-zA-Z][a-zA-Z0-9+.-]*:[^\s<>"{}|\\^`\x00-\x20]+$/;function RR(e){return e?NR.test(e):!1}function zh(e){return e.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/\t/g,"\\t")}function l9(e){return`"${zh(e)}"`}const ft={rdf:"http://www.w3.org/1999/02/22-rdf-syntax-ns#",rdfs:"http://www.w3.org/2000/01/rdf-schema#",schema:"http://schema.org/",dcterms:"http://purl.org/dc/terms/",xsd:"http://www.w3.org/2001/XMLSchema#",prov:"http://www.w3.org/ns/prov#",owl:"http://www.w3.org/2002/07/owl#"};function _i(e){if(!RR(e))throw new Error(`Invalid /wm/write IRI object: ${e}`);return e}function na(e){return`"${zh(e)}"`}function fc(e,n){return`"${zh(e)}"^^<${_i(n)}>`}function _R({contextGraphId:e,starterSlug:n,ttl:a,guide:r,nowIso:o=new Date().toISOString()}){if(!e)throw new Error("contextGraphId is required");if(!n)throw new Error("starterSlug is required");const s=_i(`urn:dkg:project:${e}:ontology`),u=_i(`${s}:agent-guide`),d=[{subject:s,predicate:ft.rdf+"type",object:_i(ft.owl+"Ontology")},{subject:s,predicate:ft.rdf+"type",object:_i(ft.prov+"Entity")},{subject:s,predicate:ft.rdfs+"label",object:na(`Project ontology — ${e}`)},{subject:s,predicate:ft.schema+"name",object:na(`Project ontology — ${e}`)},{subject:s,predicate:ft.dcterms+"title",object:na(`Project ontology — ${e}`)},{subject:s,predicate:ft.dcterms+"description",object:na(`The active ontology for context graph ${e}, derived from the '${n}' starter.`)},{subject:s,predicate:ft.dcterms+"created",object:fc(o,ft.xsd+"dateTime")},{subject:s,predicate:ft.dcterms+"modified",object:fc(o,ft.xsd+"dateTime")},{subject:s,predicate:ft.dcterms+"source",object:na(n)},{subject:s,predicate:ft.schema+"encodingFormat",object:na("text/turtle")},{subject:s,predicate:ft.schema+"text",object:na(a)},{subject:s,predicate:ft.dcterms+"references",object:_i(u)},{subject:u,predicate:ft.rdf+"type",object:_i(ft.schema+"DigitalDocument")},{subject:u,predicate:ft.rdfs+"label",object:na(`Agent guide — ${e} ontology`)},{subject:u,predicate:ft.schema+"name",object:na(`Agent guide — ${e} ontology`)},{subject:u,predicate:ft.dcterms+"title",object:na(`Agent guide — ${e} ontology`)},{subject:u,predicate:ft.dcterms+"created",object:fc(o,ft.xsd+"dateTime")},{subject:u,predicate:ft.dcterms+"modified",object:fc(o,ft.xsd+"dateTime")},{subject:u,predicate:ft.schema+"encodingFormat",object:na("text/markdown")},{subject:u,predicate:ft.schema+"text",object:na(r)},{subject:u,predicate:ft.schema+"about",object:_i(s)}];return{ontologyUri:s,guideUri:u,quads:d}}async function pc(e,n){const a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify(n)});if(!a.ok){const r=await a.json().catch(()=>({})),o=(r==null?void 0:r.error)??`HTTP ${a.status}`;throw new Error(o)}return a.json()}const OR=Object.assign({"../../../../mcp-dkg/templates/ontologies/book-research/ontology.ttl":xR,"../../../../mcp-dkg/templates/ontologies/coding-project/ontology.ttl":bR,"../../../../mcp-dkg/templates/ontologies/narrative-writing/ontology.ttl":wR,"../../../../mcp-dkg/templates/ontologies/pkm/ontology.ttl":SR,"../../../../mcp-dkg/templates/ontologies/scientific-research/ontology.ttl":kR}),DR=Object.assign({"../../../../mcp-dkg/templates/ontologies/book-research/agent-guide.md":CR,"../../../../mcp-dkg/templates/ontologies/coding-project/agent-guide.md":ER,"../../../../mcp-dkg/templates/ontologies/narrative-writing/agent-guide.md":AR,"../../../../mcp-dkg/templates/ontologies/pkm/agent-guide.md":jR,"../../../../mcp-dkg/templates/ontologies/scientific-research/agent-guide.md":TR});function MR(){const e={};for(const[n,a]of Object.entries(OR)){const r=n.match(/ontologies\/([^/]+)\/ontology\.ttl$/);if(!r)continue;const o=r[1];e[o]={ttl:a,guide:""}}for(const[n,a]of Object.entries(DR)){const r=n.match(/ontologies\/([^/]+)\/agent-guide\.md$/);if(!r)continue;const o=r[1];e[o]&&(e[o].guide=a)}return e}const Ih=MR(),LR=[{slug:"coding-project",displayName:"Coding project",description:"Software projects: decisions, tasks, code, GitHub. The v1 reference ontology."},{slug:"book-research",displayName:"Book / paper research",description:"Long-form non-fiction: hypotheses, arguments, citations, quotes. Built on BIBO + SPAR."},{slug:"pkm",displayName:"Personal knowledge management",description:"Notes, highlights, insights — daily-driver PKM workflow. Composes with SKOS."},{slug:"scientific-research",displayName:"Scientific research",description:"Empirical research: hypotheses → experiments → results → reproducibility. Built on PROV-O + DCAT + FaBiO."},{slug:"narrative-writing",displayName:"Narrative writing",description:"Fiction or narrative non-fiction: characters, scenes, plot points, themes."}];function zR(){return LR.filter(e=>Ih[e.slug])}function IR(e){return Ih[e]??null}async function PR(e,n){const a=IR(n);if(!a)throw new Error(`Unknown ontology starter '${n}'. Available: ${Object.keys(Ih).join(", ")}`);if(!a.ttl||!a.guide)throw new Error(`Starter '${n}' is missing ontology.ttl or agent-guide.md.`);await pc("/api/sub-graph/create",{contextGraphId:e,subGraphName:"meta"}).catch(d=>{if(!String((d==null?void 0:d.message)??d).includes("already exists"))throw d});const{ontologyUri:r,guideUri:o,quads:s}=_R({contextGraphId:e,starterSlug:n,ttl:a.ttl,guide:a.guide});await pc("/api/knowledge-assets/project-ontology/wm/discard",{contextGraphId:e,subGraphName:"meta"}).catch(d=>{const p=String((d==null?void 0:d.message)??d);if(!/404|not found/i.test(p))throw d}),await pc("/api/knowledge-assets/project-ontology/wm/write",{contextGraphId:e,subGraphName:"meta",quads:s});const u=await pc("/api/knowledge-assets/project-ontology/swm/share",{contextGraphId:e,subGraphName:"meta"});if(!u.swmShared||!u.sealed||!u.publishReady)throw new Error("Project ontology atomic share did not reach Shared Working Memory");return{ontologyUri:r,guideUri:o,tripleCount:s.length}}async function Ph(e,n){const a=await fetch(e,{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify(n)}),r=await a.text();let o;if(r)try{o=JSON.parse(r)}catch{o={raw:r}}if(!a.ok){const s=(o==null?void 0:o.error)??`HTTP ${a.status}`;throw new Error(typeof s=="string"?s:JSON.stringify(s))}return o}function UR(e,n={}){return Ph(`/api/context-graph/${encodeURIComponent(e)}/manifest/publish`,n)}function BR(e,n){return Ph(`/api/context-graph/${encodeURIComponent(e)}/manifest/plan-install`,n)}function HR(e,n){return Ph(`/api/context-graph/${encodeURIComponent(e)}/manifest/install`,n)}const F0="dkg.wireWorkspace.parentDir",G0="dkg.wireWorkspace.nickname",V0="dkg.wireWorkspace.tools",Xf=[{value:"cursor",label:"Cursor",description:"Wires .cursor/mcp.json + hooks + rules into the workspace."},{value:"claude-code",label:"Claude Code",description:"Merges hooks into ~/.claude/settings.json. Requires Claude Code installed."},{value:"both",label:"Both Cursor and Claude Code",description:"Wires both tools so either can operate on this project."},{value:"cursor",label:"Codex (coming soon)",description:"Codex CLI integration isn't shipped yet — pick another tool for now.",disabled:!0,comingSoon:!0}];function $R(e,n){const a=n.split("/"),r=a[a.length-1]??"";return r||(e??"project").toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function qR(e){if(!e)return"";const n=e.hostname.replace(/\.local$/,"").replace(/-/g," ");return`${e.username} @ ${n}`}function W0(e){return e==="both"?["cursor","claude-code"]:[e]}function Wb({contextGraphId:e,projectName:n,defaultAgentNickname:a,onDone:r,onCancel:o,variant:s}){var ae;const u=S.useMemo(()=>$R(n,e),[n,e]),[d,p]=S.useState(null),[f,y]=S.useState(null),[g,x]=S.useState(""),[b,k]=S.useState(""),[C,j]=S.useState("cursor"),[E,_]=S.useState(!1),[R,F]=S.useState(null),[U,D]=S.useState(null),[W,Q]=S.useState(null);S.useEffect(()=>{let P=!1;return(async()=>{try{const[K,B]=await Promise.all([fetch("/api/host/info",{headers:$t()}).then(G=>G.ok?G.json():null),iu().catch(()=>null)]);if(P)return;if(K){p(K);const G=typeof window<"u"&&window.localStorage.getItem(F0)||K.defaultWorkspaceParent;x(`${G}/${u}`)}B&&y(B);const Z=typeof window<"u"&&window.localStorage.getItem(G0);a?k(a):Z?k(Z):K&&k(qR(K));const ie=typeof window<"u"&&window.localStorage.getItem(V0);ie&&(ie==="cursor"||ie==="claude-code"||ie==="both")&&j(ie)}catch(K){P||console.warn("[WireWorkspacePanel] host info / identity fetch failed:",K)}})(),()=>{P=!0}},[u,a]);function M(P){typeof window>"u"||(window.localStorage.setItem(F0,P),b&&window.localStorage.setItem(G0,b),window.localStorage.setItem(V0,C))}async function T(){_(!0),F(null);try{const P=g.trim();if(!P||P.startsWith("~"))throw new Error("Workspace path must be an absolute path (start with `/`). The daemon will create the directory if it does not exist.");const K=await BR(e,{workspaceRoot:P,agentNickname:b.trim(),tools:W0(C)});D(K);const B=P.lastIndexOf("/");B>0&&M(P.slice(0,B))}catch(P){F((P==null?void 0:P.message)||"Preview failed")}finally{_(!1)}}async function q(){_(!0),F(null);try{const P=g.trim(),K=await HR(e,{workspaceRoot:P,agentNickname:b.trim(),tools:W0(C)});Q(K)}catch(P){F((P==null?void 0:P.message)||"Install failed")}finally{_(!1)}}if(W)return m.jsxs("div",{children:[m.jsxs("div",{style:{padding:"12px 14px",borderRadius:8,marginBottom:14,fontSize:12,background:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.25)",color:"var(--accent-green)"},children:[m.jsx("div",{style:{fontWeight:600,marginBottom:6},children:"Workspace wired."}),"Open ",m.jsx("code",{style:{fontFamily:"var(--font-mono)"},children:g})," in ",C==="claude-code"?"Claude Code":C==="both"?"Cursor or Claude Code":"Cursor",". On the first chat, your agent will see the project ontology",s==="join"?", tasks, and decisions":" you publish via the canonical assertion-write flow","."]}),m.jsx("div",{style:{fontSize:11,color:"var(--text-secondary)",marginBottom:8},children:"Files written:"}),m.jsxs("pre",{style:{fontSize:10,fontFamily:"var(--font-mono)",maxHeight:200,overflow:"auto",padding:10,borderRadius:6,background:"var(--bg-secondary)",border:"1px solid var(--border-primary)",margin:0},children:[W.written.map(P=>`${P.action.padEnd(9)} ${P.absPath} (${P.bytesWritten.toLocaleString()} bytes)`).join(`
|
|
1069
|
+
`),W.skipped.length?`
|
|
1070
|
+
|
|
1071
|
+
Skipped:
|
|
1072
|
+
`+W.skipped.map(P=>` - ${P}`).join(`
|
|
1073
|
+
`):"",W.warnings.length?`
|
|
1074
|
+
|
|
1075
|
+
Warnings:
|
|
1076
|
+
`+W.warnings.map(P=>` - ${P}`).join(`
|
|
1077
|
+
`):""]}),m.jsx("div",{style:{display:"flex",justifyContent:"flex-end",marginTop:14},children:m.jsx("button",{className:"v10-modal-btn primary",onClick:r,children:"Done"})})]});if(U)return m.jsxs("div",{children:[R&&m.jsx("div",{className:"v10-modal-error",style:{marginBottom:12},children:R}),m.jsx("div",{style:{marginBottom:10,fontSize:11,color:"var(--text-secondary)"},children:"Review the install plan. Files are only written when you click Install."}),m.jsx("pre",{style:{fontSize:10,fontFamily:"var(--font-mono)",maxHeight:320,overflow:"auto",padding:12,borderRadius:6,background:"var(--bg-secondary)",border:"1px solid var(--border-primary)",margin:0,whiteSpace:"pre-wrap"},children:U.markdown}),m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:14,gap:10},children:[m.jsx("button",{className:"v10-modal-btn",onClick:()=>{D(null),F(null)},disabled:E,children:"← Back"}),m.jsxs("div",{style:{display:"flex",gap:8},children:[m.jsx("button",{className:"v10-modal-btn",onClick:r,disabled:E,children:"Skip for now"}),m.jsx("button",{className:"v10-modal-btn primary",onClick:q,disabled:E,children:E?"Installing…":"Install"})]})]})]});const V=((ae=Xf.find(P=>P.value===C&&!P.disabled))==null?void 0:ae.description)??Xf[0].description;return m.jsxs("div",{children:[m.jsxs("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:14,fontSize:12,background:"rgba(59, 130, 246, 0.08)",border:"1px solid rgba(59, 130, 246, 0.25)",color:"var(--accent-primary, #3b82f6)"},children:[m.jsx("div",{style:{fontWeight:600,marginBottom:4},children:s==="create"?"Wire your local workspace":"Wire this project locally"}),s==="create"?"Choose a directory for the new project and which coding tool you want it wired for. The daemon will populate the workspace with the right config files so your agent can join the project from turn one.":"Choose a local directory for this project and which coding tool you want it wired for. The daemon will populate the workspace with the right config files so your agent can collaborate on this project."]}),R&&m.jsx("div",{className:"v10-modal-error",style:{marginBottom:12},children:R}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Workspace path"}),m.jsx("input",{className:"v10-form-input",type:"text",value:g,onChange:P=>x(P.target.value),placeholder:d?`${d.defaultWorkspaceParent}/${u}`:"/Users/you/code/project",spellCheck:!1,style:{fontFamily:"var(--font-mono)",fontSize:12}}),m.jsxs("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:["Absolute path. Created if it doesn't exist. Daemon writes only inside this dir (plus optionally ",m.jsx("code",{children:"~/.claude/settings.json"})," if Claude Code is selected).",d&&m.jsxs(m.Fragment,{children:[" Defaulted from your ",m.jsx("code",{children:"$HOME"})," = ",m.jsx("code",{children:d.homedir}),"."]})]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Coding tool to wire"}),m.jsx("select",{className:"v10-form-select",value:C,onChange:P=>j(P.target.value),children:Xf.map((P,K)=>m.jsx("option",{value:P.disabled?"__disabled__":P.value,disabled:P.disabled,children:P.label},`${P.label}-${K}`))}),m.jsx("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:V})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Your agent identity"}),m.jsx("input",{className:"v10-form-input",type:"text",value:f?`urn:dkg:agent:${f.agentAddress.toLowerCase()}`:"fetching…",disabled:!0,spellCheck:!1,style:{fontFamily:"var(--font-mono)",fontSize:11,opacity:.75}}),m.jsxs("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:["Cryptographic URI derived from this node's wallet address. Same on every project on this machine. Attribution (",m.jsx("code",{children:"prov:wasAttributedTo"}),") on every chat turn uses this URI."]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Nickname for this agent"}),m.jsx("input",{className:"v10-form-input",type:"text",value:b,onChange:P=>k(P.target.value),placeholder:"e.g. Alice on laptop 1",spellCheck:!1,maxLength:80}),m.jsx("div",{style:{fontSize:10,color:"var(--text-tertiary)",marginTop:4},children:"Free-form human label rendered as the agent's name in chips, lists, and rdfs:label triples. Doesn't affect attribution — only changes how you appear to others."})]}),m.jsxs("div",{style:{display:"flex",justifyContent:"space-between",alignItems:"center",marginTop:14,gap:10},children:[o?m.jsx("button",{className:"v10-modal-btn",onClick:o,disabled:E,children:"Cancel"}):m.jsx("button",{className:"v10-modal-btn",onClick:r,disabled:E,children:"Skip for now"}),m.jsx("button",{className:"v10-modal-btn primary",onClick:T,disabled:E||!g.trim()||!b.trim(),children:E?"Loading preview…":"Preview install"})]})]})}const Y0='button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), iframe, [tabindex]:not([tabindex="-1"])';function Fc(e,n){const a=S.useRef(null),r=S.useRef(null);S.useEffect(()=>{if(e)return r.current=document.activeElement??null,queueMicrotask(()=>{const s=a.current;if(!s)return;const u=s.querySelector(Y0),p=s.querySelector("[autofocus]")??u;p?p.focus():(s.hasAttribute("tabindex")||s.setAttribute("tabindex","-1"),s.focus())}),()=>{var s,u;(u=(s=r.current)==null?void 0:s.focus)==null||u.call(s)}},[e]),S.useEffect(()=>{if(!e)return;const s=u=>{if(u.key==="Escape"){u.stopPropagation(),n();return}if(u.key!=="Tab")return;const d=a.current;if(!d)return;const p=Array.from(d.querySelectorAll(Y0)).filter(x=>x.offsetParent!==null||x===document.activeElement);if(p.length===0){u.preventDefault(),d.hasAttribute("tabindex")||d.setAttribute("tabindex","-1"),d.focus();return}const f=p[0],y=p[p.length-1],g=document.activeElement;if(g===d){u.preventDefault(),(u.shiftKey?y:f).focus();return}u.shiftKey&&g===f?(u.preventDefault(),y.focus()):!u.shiftKey&&g===y&&(u.preventDefault(),f.focus())};return window.addEventListener("keydown",s),()=>window.removeEventListener("keydown",s)},[e,n]);const o=S.useCallback(s=>{s.target===s.currentTarget&&n()},[n]);return{dialogRef:a,onBackdropClick:o}}const ll=80,FR=/<\/?[a-z][^>]*>/i,GR=/[\u0000-\u0008\u000B\u000C\u000E-\u001F\u007F]/g,VR=/[a-z0-9]/i;function WR(e){let n="",a=0;for(;a<e.length;){if(e.charCodeAt(a)===60){const o=e.charCodeAt(a+1);if(o>=65&&o<=90||o>=97&&o<=122||o===47){const u=e.indexOf(">",a+1);if(u===-1)break;a=u+1;continue}}n+=e[a],a+=1}return n}function Yb(e){if(typeof e!="string")return"";let n=WR(e);return n=n.replace(/[<>]/g,""),n=n.replace(GR,""),n=n.replace(/\s+/g," "),n=n.trim(),n.length>ll&&(n=n.slice(0,ll)),n}function K0(e){const n=Yb(e);return n?VR.test(n)?FR.test(e)?"HTML tags are not allowed in the name — they have been stripped automatically.":/[<>]/.test(e)?"Angle brackets (< or >) are not allowed in the name — they and any text consumed by an unclosed tag have been stripped automatically.":e.length>ll?`Name was trimmed to ${ll} characters (was ${e.length}).`:null:"Name must contain at least one letter or digit.":"Enter a name with at least one letter or digit."}function Q0(e){return e.toLowerCase().replace(/[^a-z0-9]+/g,"-").replace(/^-|-$/g,"")}function YR({open:e,onClose:n}){var it,fe;const[a,r]=S.useState(""),[o,s]=S.useState(""),[u,d]=S.useState("curated"),[p,f]=S.useState("curator-only"),[y,g]=S.useState(!1),[x,b]=S.useState("community"),k=zR(),[C,j]=S.useState(((it=k[0])==null?void 0:it.slug)??"coding-project"),[E,_]=S.useState(!1),[R,F]=S.useState("off"),[U,D]=S.useState("7d"),[W,Q]=S.useState("100k"),[M,T]=S.useState(!1),[q,V]=S.useState(""),[ae,P]=S.useState(null),[K,B]=S.useState(null),[Z,ie]=S.useState(null),[G,O]=S.useState(null),[L,X]=S.useState(""),[N,ue]=S.useState(!0),[pe,he]=S.useState(!1),{setContextGraphs:Ee,contextGraphs:Ue,setActiveProject:Ne}=ca(),{openTab:et}=gn(),{setStage:Ot,stage:xt}=Lh(),bt=()=>{ue(!0),he(!1),iu().then(H=>{ie(H.agentAddress),he(!1)}).catch(()=>{ie(null),he(!0)}).finally(()=>ue(!1))};S.useEffect(()=>{e&&(B(null),bt())},[e]);const yt=Fc(e&&!G,n),Zt=Fc(e&&!!G,()=>{O(null),X(""),B(null),r(""),s(""),n()});if(!e)return null;const Pe=Yb(a),pt=Q0(Pe),Dt=Z&&pt?`${Z}/${pt}`:pt?`<agent-address>/${pt}`:"",Nt=a?K0(a):null,ge=H=>{r(H)},Mt=async()=>{const H=Pe;if(!H||Nt)return;T(!0),P(null),B(null),V(y?"Registering context graph on the network…":"Creating context graph locally…");const le=Q0(H);if(!Z){P("Agent identity is still loading. Please wait a moment and try again."),T(!1);return}const me=`${Z}/${le}`;try{const ye=setTimeout(()=>V(y?"On-chain registration in progress — this can take up to 30s…":"Setting up local context graph…"),5e3),I=u==="curated"?1:0,Te=p==="curator-only"?0:1,at=u==="curated"?{accessPolicy:I,publishPolicy:Te,allowedAgents:Z?[Z]:[],register:y}:{accessPolicy:I,publishPolicy:Te,register:y},Ie=await ej(me,H,o.trim()||void 0,at);if(clearTimeout(ye),y&&Ie.registered===!1){const Se=`On-chain registration failed: ${Ie.registerError??"unknown error"}. Project is created locally and usable for everything except Verifiable Memory publishing. Retry registration from the project's Settings when ready.`;console.warn("[CreateProjectModal]",Se),B(Se)}if(x==="community"||x==="agent")try{V(`Installing '${C}' ontology…`),await PR(Ie.created,C)}catch(Se){console.warn("[CreateProjectModal] ontology install failed:",Se),V(`Context graph created, but ontology install failed: ${(Se==null?void 0:Se.message)??Se}`)}let Xe=!0;try{V("Publishing context graph manifest…"),await UR(Ie.created,{})}catch(Se){Xe=!1,console.warn("[CreateProjectModal] manifest publish failed:",Se),V(`Context graph created, but manifest publish failed: ${(Se==null?void 0:Se.message)??Se}`)}V("Refreshing context graph list…");const{contextGraphs:Ve}=await Ah();Ee(Ve??[]),Ne(Ie.created),et({id:`project:${Ie.created}`,label:H,closable:!0}),xt<2&&Ot(2),Xe?(X(H),O(Ie.created),V("")):setTimeout(()=>{r(""),s(""),V(""),n()},2500)}catch(ye){const I=(ye==null?void 0:ye.message)||"Failed to create context graph";I.includes("already exists")||I.includes("409")?P("A context graph with this ID already exists. Try a different name."):(I.includes("taking longer"),P(I)),V("")}finally{T(!1)}},Fn=Ue.length===0;function yn(){O(null),X(""),B(null),r(""),s(""),n()}return G?m.jsx("div",{className:"v10-modal-overlay",onClick:Zt.onBackdropClick,role:"presentation",children:m.jsxs("div",{className:"v10-modal-box",ref:Zt.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-wire-modal-title",children:[m.jsx("button",{type:"button",className:"v10-modal-close",onClick:yn,"aria-label":"Close wire workspace dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4},children:"×"}),m.jsxs("div",{className:"v10-modal-header",children:[m.jsxs("div",{id:"dkg-wire-modal-title",className:"v10-modal-title",children:["Wire workspace for ",L]}),m.jsx("div",{className:"v10-modal-subtitle",children:"Context graph created. Now wire a local workspace so you can plan it from your own Cursor."})]}),m.jsxs("div",{className:"v10-modal-body",children:[K&&m.jsx("div",{className:"v10-modal-warning",children:K}),m.jsx(Wb,{contextGraphId:G,projectName:L,variant:"create",onDone:yn})]})]})}):m.jsx("div",{className:"v10-modal-overlay",onClick:yt.onBackdropClick,role:"presentation",children:m.jsxs("div",{className:"v10-modal-box",ref:yt.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-create-cg-title","aria-describedby":"dkg-create-cg-subtitle",children:[m.jsx("button",{type:"button",className:"v10-modal-close",onClick:n,"aria-label":"Close create context graph dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4,zIndex:1},children:"×"}),m.jsxs("div",{className:"v10-modal-header",children:[m.jsx("div",{id:"dkg-create-cg-title",className:"v10-modal-title",children:"Create New Context Graph"}),m.jsx("div",{id:"dkg-create-cg-subtitle",className:"v10-modal-subtitle",children:"A context graph gives your agent structured memory — a place to draft, share, and publish knowledge."})]}),m.jsxs("div",{className:"v10-modal-body",children:[ae&&m.jsx("div",{className:"v10-modal-error",children:ae}),K&&m.jsx("div",{className:"v10-modal-warning",children:K}),Fn&&m.jsxs("div",{className:"v10-modal-tip",children:[m.jsx("div",{className:"v10-modal-tip-title",children:"First context graph tip"}),"This is your agent's first memory space. Consider importing any existing knowledge your agent has — notes, documents, conversation logs — so it can build on what it already knows."]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",htmlFor:"dkg-cg-name",children:"Context Graph Name"}),m.jsx("input",{id:"dkg-cg-name",name:"dkg-cg-name",className:"v10-form-input",type:"text",placeholder:"e.g. Pharma Drug Interactions",value:a,onChange:H=>ge(H.target.value),autoFocus:!0,maxLength:ll,"aria-invalid":Nt?"true":"false","aria-describedby":"dkg-cg-name-help",autoComplete:"off",spellCheck:!0}),m.jsx("div",{id:"dkg-cg-name-help",style:{marginTop:4,fontSize:11,color:Nt?"var(--red, #f87171)":"var(--text-tertiary)",fontFamily:"var(--font-mono)"},children:Nt||(Dt?`ID: did:dkg:context-graph:${Dt}`:`${a.length}/${ll} characters`)})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",htmlFor:"dkg-cg-description",children:"Description"}),m.jsx("textarea",{id:"dkg-cg-description",name:"dkg-cg-description",className:"v10-form-textarea",placeholder:"What should your agent remember? Describe the domain, goals, or context...",value:o,onChange:H=>s(H.target.value),"aria-label":"Context graph description"})]}),m.jsx("div",{className:"v10-form-divider"}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Sharing"}),m.jsxs("div",{className:"v10-form-radio-group",children:[m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:u==="curated",onChange:()=>d("curated")}),"Invite-only — only invited agents can read and subscribe"]}),m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:u==="public",onChange:()=>d("public")}),"Open — publicly discoverable; anyone can subscribe"]})]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Contribution"}),m.jsxs("div",{className:"v10-form-radio-group",children:[m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:p==="curator-only",onChange:()=>f("curator-only")}),"Curators-only — only the curator may publish to Verifiable Memory"]}),m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:p==="open",onChange:()=>f("open")}),"Open — any wallet may publish to Verifiable Memory (not just members)"]})]}),u==="curated"&&p==="open"&&m.jsxs("div",{style:{marginTop:6,fontSize:11,color:"var(--text-tertiary)"},children:["Note: an invite-only sharing graph with open contribution still lets ",m.jsx("em",{children:"any"})," wallet publish to Verifiable Memory — the on-chain publish check is not gated by the allowlist. See SPEC_CG_MEMORY_MODEL §2.5."]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"On-chain registration"}),m.jsxs("label",{className:"v10-form-radio",style:{display:"flex",alignItems:"flex-start",gap:8},children:[m.jsx("input",{type:"checkbox",checked:y,onChange:H=>g(H.target.checked),style:{marginTop:3}}),m.jsxs("span",{children:["Register on chain now (required for Verifiable Memory publishing)",m.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",marginTop:4},children:"Off by default — the project is created locally and can be registered later from its Settings tab when your wallet is funded and a working RPC is configured."})]})]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",children:"Ontology"}),m.jsxs("div",{className:"v10-form-radio-group",children:[m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:x==="community",onChange:()=>b("community")}),"Choose a starter — install one of the bundled context-graph-type ontologies"]}),x==="community"&&m.jsxs("div",{style:{marginLeft:24,marginTop:4,marginBottom:8},children:[m.jsx("select",{className:"v10-form-select",value:C,onChange:H=>j(H.target.value),children:k.map(H=>m.jsx("option",{value:H.slug,children:H.displayName},H.slug))}),m.jsx("div",{style:{marginTop:6,fontSize:11,color:"var(--text-tertiary)"},children:(fe=k.find(H=>H.slug===C))==null?void 0:fe.description})]}),m.jsxs("label",{className:"v10-form-radio",children:[m.jsx("input",{type:"radio",checked:x==="agent",onChange:()=>b("agent")}),"Let agent decide — defaults to the closest starter (v1)"]}),x==="agent"&&m.jsxs("div",{className:"v10-form-radio-desc",style:{marginLeft:24,marginTop:4,marginBottom:8},children:["v1 installs the ",m.jsx("code",{children:C})," starter as a sensible default. A future release will have the agent draft a context-graph-specific ontology by extending the closest starter from the context graph description."]}),m.jsxs("label",{className:"v10-form-radio",style:{opacity:.5},children:[m.jsx("input",{type:"radio",checked:x==="upload",onChange:()=>b("upload"),disabled:!0}),"Upload an ontology file (.ttl, .owl, .rdf) ",m.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]})]})]}),m.jsxs("div",{className:"v10-form-advanced-toggle",onClick:()=>_(!E),children:[m.jsx("span",{className:`v10-form-adv-chevron ${E?"open":""}`,children:"▸"}),m.jsx("span",{children:"Advanced settings"})]}),E&&m.jsxs("div",{className:"v10-form-advanced-body",style:{opacity:.5,pointerEvents:"none"},children:[m.jsxs("div",{className:"v10-form-group",children:[m.jsxs("label",{className:"v10-form-label",children:["Consensus Quorum ",m.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]}),m.jsxs("select",{className:"v10-form-select",value:R,disabled:!0,children:[m.jsx("option",{value:"off",children:"Off — no consensus verification required"}),m.jsx("option",{value:"2of3",children:"2 of 3 — lightweight consensus"}),m.jsx("option",{value:"3of5",children:"3 of 5 — standard consensus (recommended for teams)"}),m.jsx("option",{value:"custom",children:"Custom — set your own M of N"})]})]}),m.jsxs("div",{className:"v10-form-group",children:[m.jsxs("label",{className:"v10-form-label",children:["SWM TTL ",m.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]}),m.jsxs("select",{className:"v10-form-select",value:U,disabled:!0,children:[m.jsx("option",{value:"7d",children:"7 days (default)"}),m.jsx("option",{value:"1h",children:"1 hour"}),m.jsx("option",{value:"1d",children:"1 day"}),m.jsx("option",{value:"30d",children:"30 days"})]})]}),m.jsxs("div",{className:"v10-form-group",style:{marginBottom:0},children:[m.jsxs("label",{className:"v10-form-label",children:["SWM Size Cap ",m.jsx("span",{style:{fontSize:10,fontWeight:400,color:"var(--text-tertiary)"},children:"(coming soon)"})]}),m.jsxs("select",{className:"v10-form-select",value:W,disabled:!0,children:[m.jsx("option",{value:"100k",children:"100K triples (default)"}),m.jsx("option",{value:"10k",children:"10K triples"}),m.jsx("option",{value:"1m",children:"1M triples"})]})]})]})]}),m.jsxs("div",{className:"v10-modal-footer",children:[m.jsx("button",{className:"v10-modal-btn",onClick:n,children:"Cancel"}),pe&&m.jsx("button",{className:"v10-modal-btn",onClick:bt,disabled:N,children:N?"Retrying…":"Retry Loading Agent"}),m.jsx("button",{className:"v10-modal-btn primary",onClick:Mt,disabled:!a.trim()||!!K0(a)||M||!Z||N,children:M?q||"Creating…":Z?"Create Context Graph":pe?"Agent unavailable":"Loading agent…"})]})]})})}function Uh(e){return{agentDid:e.agentDid,peerId:e.peerId}}function Gc(e){if(!(e!=null&&e.trim()))return"unknown";const n=e.trim().replace(/^["']|["']$/g,"").toLowerCase();return n==="private"?"private":n==="public"?"public":"unknown"}function Mi(e){let n=e.trim().replace(/^["']|["']$/g,"");n.startsWith("<")&&n.endsWith(">")&&(n=n.slice(1,-1));const a="did:dkg:agent:";if(n.length>=a.length&&n.slice(0,a.length).toLowerCase()===a.toLowerCase()){const o=n.slice(a.length),s=/^(0x[a-fA-F0-9]{40})$/i.exec(o);return s?`${a}${s[1].toLowerCase()}`:`${a}${o}`}return/^0x[a-fA-F0-9]{40}$/.exec(n)?`${a}${n.toLowerCase()}`:n.toLowerCase()}function ou(e,n){var a,r;return e.callerInvolved===!0?!0:e.callerInvolved===!1||!((a=n==null?void 0:n.agentDid)!=null&&a.trim())?!1:!!((r=e.curator)!=null&&r.trim()&&Mi(e.curator)===Mi(n.agentDid))}function KR(e,n,a){const r=e.filter(o=>ou(o,n));if(a&&!r.some(o=>o.id===a)){const o=e.find(s=>s.id===a);if(o)return[o,...r]}return r}function QR(e,n){return!(ou(e,n)||Gc(e.accessPolicy)!=="public")}function XR(e){return e.subscribed===!0||e.synced===!0?"project":"catalogue"}function ZR(e){return e.alreadyMember===!0||e.autoApproved===!0||e.status==="approved"||e.status==="already-member"}const X0=/^(?:Qm[1-9A-HJ-NP-Za-km-z]{44}|12D3Koo[1-9A-HJ-NP-Za-km-z]{45,53})$/;function JR(e){var b;const n=e.trim().replace(/\\n/g,`
|
|
1078
|
+
`),a=n.split(`
|
|
1079
|
+
`).map(k=>k.trim()).filter(Boolean),r=a[0]??"",o=a.slice(1).join(" ").trim(),s=n.match(/(?:^|\s)(\/(?:ip4|ip6|dns|dns4|dns6|dnsaddr)\/\S+)/),u=((b=s==null?void 0:s[1])==null?void 0:b.replace(/\s+/g,""))??null,d=o.replace(/\s+/g,""),p=d.startsWith("/")?d:u;let f=null;if(p){const k=p.match(/\/p2p\/([^/]+)$/);k&&X0.test(k[1])&&(f=k[1])}else for(const k of[o,...a.slice(1)]){const C=k.trim();if(X0.test(C)){f=C;break}}let y=r;u&&y.includes(u)&&(y=y.replace(u,"")),y=y.replace(/\s*@\s*$/,"").trim();const x=(a.length>1||o.length>0)&&f===null&&p===null;return{cgId:y,curatorPeerId:f,legacyMultiaddr:p,hasUnparsedExtra:x}}function e4(e,n){return!e.hasUnparsedExtra&&n.some(a=>a.id===e.cgId&&Gc(a.accessPolicy)==="public")}function Z0(e,n){const a=JR(e);return e4(a,n)?{kind:"publicSubscribe",invite:a,validationError:e1(a,{allowBareContextGraphId:!0}),idleLabel:"Subscribe",sendingLabel:"Subscribing…"}:{kind:"privateJoin",invite:a,validationError:e1(a),idleLabel:"Request to Join",sendingLabel:"Sending request…"}}async function J0(e){if(e.curatorPeerId){await QA(e.curatorPeerId).catch(()=>{});return}e.legacyMultiaddr&&(console.warn("[DKG] This invite uses a legacy multiaddr (deprecated). Ask the curator to regenerate using the current Share Context Graph modal — V10 invites carry a peer id and resolve via DHT, so they survive relay rotations."),await KA(e.legacyMultiaddr).catch(()=>{}))}function e1(e,n={}){if(!e.cgId)return"Missing context graph ID";if(e.hasUnparsedExtra)return"Invite contains a second line that is not a valid peer ID (12D3Koo…) or multiaddr (/ip4/…). Check for typos.";if(!e.curatorPeerId&&!e.legacyMultiaddr&&!n.allowBareContextGraphId)return"This invite is missing the curator peer id. Ask the curator to regenerate the invite from the Share Context Graph dialog.";if(e.legacyMultiaddr){if(!e.legacyMultiaddr.startsWith("/"))return"Invalid curator multiaddr";if(!e.legacyMultiaddr.includes("/p2p/"))return"Curator multiaddr is missing peer ID"}return null}function t4(e){if(e instanceof an&&e.status===502){const n=n4(e.body);if(n.length===0)return"Request signed, but we couldn't deliver it to any reachable curator. Try again in a moment once your node has discovered more peers, or ask the curator for an updated invite.";const a=n.join("; "),r=n.some(a4),o=r?"Curator rejected this join request.":"Couldn't deliver this join request to the curator.",s=i4(a,r);return s?`${o} Reason: ${a}. ${s}`:`${o} Reason: ${a}.`}return e instanceof Error&&e.message?e.message:"Failed to send join request"}function n4(e){if(!e||typeof e!="object")return[];const n=e.errors;return Array.isArray(n)?n.filter(a=>typeof a=="string"&&a.length>0):[]}function a4(e){const n=e.replace(/^[^:]+:\s*/,"").trim();return!(!n||/^dial failed\b/i.test(n)||/^not curator$/i.test(n))}function i4(e,n){return n?/scope mismatch/i.test(e)?"This usually means your daemon's network config has a stale ContextGraphsHub address — pull the latest release (or `git pull && pnpm install && pnpm run build:runtime`) and try again.":/unknown CG/i.test(e)?"The curator doesn't recognise this context graph id — double-check the invite, or ask the curator to share an updated one.":null:/not curator/i.test(e)?"Your node reached other peers, but none of them curate this context graph. Make sure the curator's daemon is online and the invite carries the right curator peer id.":null}function r4({open:e,onClose:n,initialContextGraphId:a}){const[r,o]=S.useState(a??""),[s,u]=S.useState("idle"),[d,p]=S.useState(null),[f,y]=S.useState(null),[g,x]=S.useState(!1),[b,k]=S.useState(null),[C,j]=S.useState(""),{contextGraphs:E,setContextGraphs:_,setActiveProject:R}=ca(),{openTab:F}=gn();S.useEffect(()=>{a&&o(a)},[a]),S.useEffect(()=>{e||(o(a??""),p(null),u("idle"),y(null),x(!1))},[e,a]);const U=S.useCallback(ie=>{R(ie.id),F({id:`project:${ie.id}`,label:ie.name||ie.id,closable:!0})},[R,F]),D=S.useCallback(async(ie,G)=>{const{contextGraphs:O}=await Ah(),L=O??[];_(L);const X=L.find(N=>N.id===ie)??G;return X&&U(X),X},[_,U]),W=S.useCallback(async ie=>{u("approved");try{const G=await D(ie);G&&(j(G.name??ie),k(ie))}catch{}},[D]),Q=S.useCallback(ie=>{var O;if(!(!f||ie.type!=="join_approved"&&ie.type!=="join_rejected"||((O=ie.data)==null?void 0:O.contextGraphId)!==f)){if(ie.type==="join_rejected"){u("rejected");return}W(f)}},[f,W]);hl(Q);const M=Fc(e&&!b,n),T=Fc(e&&!!b,()=>{k(null),j(""),n()});if(!e)return null;const q=async()=>{const ie=Z0(r,E);if(ie.validationError){p(ie.validationError);return}const{cgId:G,curatorPeerId:O}=ie.invite;if(p(null),ie.kind==="publicSubscribe"){u("sending");try{const X=E.find(N=>N.id===G);await J0(ie.invite),await Qj(G,{syncMode:g?"always-on":"on-demand"}),await D(G,X),n()}catch(X){p(X instanceof Error?X.message:"Could not subscribe to this public context graph."),u("idle")}return}const L=E.find(X=>X.id===G);if(L){U(L),n();return}u("sending");try{await J0(ie.invite);const X=await nj(G),N=await iu().then(pe=>pe.name).catch(()=>{}),ue=await aj(G,{delegation:X.delegation,agentName:N,curatorPeerId:O??void 0});if(y(G),ZR(ue)){await W(G);return}u("pending")}catch(X){p(t4(X)),u("idle")}};function V(){k(null),j(""),n()}if(b)return m.jsx("div",{className:"v10-modal-overlay",onClick:T.onBackdropClick,role:"presentation",children:m.jsxs("div",{className:"v10-modal-box",ref:T.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-join-wire-title",children:[m.jsx("button",{type:"button",className:"v10-modal-close",onClick:V,"aria-label":"Close wire workspace dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4,zIndex:1},children:"×"}),m.jsxs("div",{className:"v10-modal-header",children:[m.jsxs("div",{id:"dkg-join-wire-title",className:"v10-modal-title",children:["Wire workspace for ",C]}),m.jsx("div",{className:"v10-modal-subtitle",children:"Curator approved. Now wire a local workspace so this Cursor can collaborate on the context graph."})]}),m.jsx("div",{className:"v10-modal-body",children:m.jsx(Wb,{contextGraphId:b,projectName:C,variant:"join",onDone:V})})]})});const ae=s==="sending",P=s==="pending",K=s==="approved",B=s==="rejected",Z=Z0(r,E);return m.jsx("div",{className:"v10-modal-overlay",onClick:M.onBackdropClick,role:"presentation",children:m.jsxs("div",{className:"v10-modal-box",ref:M.dialogRef,role:"dialog","aria-modal":"true","aria-labelledby":"dkg-join-cg-title","aria-describedby":"dkg-join-cg-subtitle",children:[m.jsx("button",{type:"button",className:"v10-modal-close",onClick:n,"aria-label":"Close join context graph dialog",title:"Close (Esc)",style:{position:"absolute",top:12,right:12,background:"none",border:"none",color:"var(--text-tertiary)",cursor:"pointer",fontSize:18,lineHeight:1,padding:4,zIndex:1},children:"×"}),m.jsxs("div",{className:"v10-modal-header",children:[m.jsx("div",{id:"dkg-join-cg-title",className:"v10-modal-title",children:"Join a Context Graph"}),m.jsx("div",{id:"dkg-join-cg-subtitle",className:"v10-modal-subtitle",children:"Enter a discovered public Context Graph ID to subscribe, or paste a curator invite for a private graph."})]}),m.jsxs("div",{className:"v10-modal-body",children:[d&&m.jsx("div",{className:"v10-modal-error",children:d}),P&&m.jsx("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12,background:"rgba(59, 130, 246, 0.08)",border:"1px solid rgba(59, 130, 246, 0.25)",color:"var(--accent-primary, #3b82f6)"},children:"Join request sent. Waiting for the curator to approve — this modal will move forward automatically once they do."}),K&&m.jsx("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12,background:"rgba(34, 197, 94, 0.08)",border:"1px solid rgba(34, 197, 94, 0.25)",color:"var(--accent-green)"},children:"Approved! Loading context graph…"}),B&&m.jsx("div",{style:{padding:"10px 14px",borderRadius:8,marginBottom:16,fontSize:12,background:"rgba(245, 158, 11, 0.08)",border:"1px solid rgba(245, 158, 11, 0.25)",color:"var(--accent-warning, #f59e0b)"},children:"The curator declined this join request."}),m.jsxs("div",{className:"v10-form-group",children:[m.jsx("label",{className:"v10-form-label",htmlFor:"dkg-cg-invite",children:"Context Graph ID or Invite Code"}),m.jsx("textarea",{id:"dkg-cg-invite",name:"dkg-cg-invite",className:"v10-form-textarea",placeholder:`Public: paste a Context Graph ID
|
|
1080
|
+
|
|
1081
|
+
Private: paste the curator invite
|
|
1082
|
+
my-context-graph-abc123
|
|
1083
|
+
12D3KooW...`,value:r,onChange:ie=>o(ie.target.value),autoFocus:!0,rows:3,disabled:ae||P||K,style:{fontFamily:"var(--font-mono)",fontSize:11},"aria-label":"Context graph invite code",autoComplete:"off",spellCheck:!1})]}),Z.kind==="publicSubscribe"&&m.jsxs("label",{style:{display:"flex",alignItems:"flex-start",gap:8,fontSize:12,color:"var(--text-secondary)",cursor:ae?"default":"pointer"},children:[m.jsx("input",{type:"checkbox",checked:g,onChange:ie=>x(ie.target.checked),disabled:ae,"aria-label":"Keep this Context Graph synchronized after restart"}),m.jsxs("span",{children:["Keep synchronized after restart",m.jsx("span",{style:{display:"block",color:"var(--text-tertiary)",marginTop:2},children:"Off by default. This node otherwise syncs the graph only when you open it."})]})]})]}),m.jsxs("div",{className:"v10-modal-footer",children:[m.jsx("button",{className:"v10-modal-btn",onClick:n,children:P||K?"Close":"Cancel"}),m.jsx("button",{className:"v10-modal-btn primary",onClick:q,disabled:!r.trim()||ae||P||K,children:ae?Z.sendingLabel:P?"Awaiting approval…":K?"Approved":Z.idleLabel})]})]})})}const Kb="v10:hiddenProjectIds",$p="v10:hidden-projects-change";function Zf(){try{const e=localStorage.getItem(Kb);if(!e)return new Set;const n=JSON.parse(e);return new Set(Array.isArray(n)?n:[])}catch{return new Set}}function t1(e){try{localStorage.setItem(Kb,JSON.stringify([...e])),window.dispatchEvent(new Event($p))}catch{}}function Qb(){const[e,n]=S.useState(()=>Zf());S.useEffect(()=>{const o=()=>n(Zf());return window.addEventListener($p,o),window.addEventListener("storage",o),()=>{window.removeEventListener($p,o),window.removeEventListener("storage",o)}},[]);const a=S.useCallback(o=>{const s=new Set(Zf());s.add(o),t1(s)},[]),r=S.useCallback(()=>{t1(new Set)},[]);return{hidden:e,hide:a,unhideAll:r}}function n1({cg:e,isActive:n,onSelect:a,onHide:r}){return m.jsx("div",{className:"v10-tree-section",children:m.jsxs("div",{className:`v10-tree-section-header ${n?"active":""}`,onClick:a,children:[m.jsx("span",{className:"v10-tree-project-dot"}),m.jsx("span",{className:"v10-tree-section-label",children:e.name||e.id.slice(0,16)}),m.jsx("button",{type:"button",className:"v10-tree-hide-btn",title:"Hide this context graph from the sidebar (reversible)",onClick:o=>{o.stopPropagation(),r()},children:"×"})]})})}function l4({cg:e,isBrowsing:n,onBrowse:a,onSubscribe:r,onHide:o}){const s=e.name||e.id.slice(0,16);return m.jsx("div",{className:"v10-tree-section",children:m.jsxs("div",{className:`v10-tree-section-header catalogue ${n?"active":""}`,children:[m.jsx("span",{className:"v10-tree-project-dot"}),m.jsx("span",{className:"v10-tree-section-label",children:s}),m.jsx("button",{type:"button",className:"v10-tree-catalogue-btn","aria-label":`Browse ${s}`,onClick:a,children:"Browse"}),m.jsx("button",{type:"button",className:"v10-tree-catalogue-btn primary","aria-label":`Subscribe to ${s}`,onClick:r,children:"Subscribe"}),m.jsx("button",{type:"button",className:"v10-tree-hide-btn",title:"Hide this context graph from the sidebar (reversible)",onClick:o,children:"×"})]})})}function o4(e){switch(e){case"chat_ready":return"var(--accent-green, #22c55e)";case"connecting":return"var(--accent-yellow, #eab308)";case"degraded":case"bridge_offline":return"var(--accent-orange, #f97316)";case"available":case"coming_soon":default:return"var(--text-tertiary, #6b7280)"}}function s4(){const[e,n]=S.useState([]),[a,r]=S.useState(null),o=S.useCallback(()=>{lu().then(s=>{n(s.integrations),r(null)}).catch(s=>r(s.message))},[]);return Ho(o,3e4),m.jsxs("div",{className:"v10-tree-items",style:{display:"block"},children:[m.jsx("div",{style:{fontSize:11,fontWeight:600,color:"var(--text-tertiary)",textTransform:"uppercase",letterSpacing:.5,padding:"6px 12px 2px 24px"},children:"Agents"}),a&&m.jsx("div",{style:{fontSize:11,color:"var(--accent-orange, #f97316)",padding:"4px 12px 4px 24px"},children:a}),!a&&e.length===0&&m.jsx("div",{style:{fontSize:11,color:"var(--text-tertiary)",padding:"4px 12px 4px 24px",fontStyle:"italic"},children:"No agents detected."}),e.map(s=>m.jsxs("div",{className:"v10-tree-item",title:s.detail,style:{cursor:"default"},children:[m.jsx("span",{"aria-label":s.statusLabel,style:{width:7,height:7,borderRadius:"50%",background:o4(s.status),flexShrink:0}}),m.jsx("span",{className:"v10-tree-item-label",children:s.name}),m.jsx("span",{style:{fontSize:11,color:"var(--text-tertiary)",marginLeft:4},children:s.statusLabel})]},s.id))]})}function c4(){const e=Bn(G=>G.leftSectionMyProjectsOpen),n=Bn(G=>G.leftSectionIntegrationsOpen),a=Bn(G=>G.toggleLeftSectionMyProjects),r=Bn(G=>G.toggleLeftSectionIntegrations),o=S.useId(),s=S.useId(),{openTab:u,activeTabId:d,setActiveTab:p}=gn(),{contextGraphs:f,setContextGraphs:y,setLoading:g,activeProjectId:x,setActiveProject:b}=ca(),k=Lh(G=>G.stage),[C,j]=S.useState("explorer"),{hidden:E,hide:_,unhideAll:R}=Qb(),F=Rh().data,U=F?Uh(F):null,D=f.filter(G=>!E.has(G.id)),W=D.filter(G=>ou(G,U)),Q=D.filter(G=>QR(G,U)),M=f.length-D.length,[T,q]=S.useState(!1),[V,ae]=S.useState(!1),[P,K]=S.useState(),B=S.useCallback(G=>{K(G),ae(!0)},[]),Z=S.useCallback(()=>{ae(!1),K(void 0)},[]),ie=S.useCallback(()=>{g(!0),Hn.fetchContextGraphs().then(({contextGraphs:G})=>y(G??[])).catch(()=>{}).finally(()=>g(!1))},[y,g]);return Ho(ie,6e4),hl(S.useCallback(G=>{(G.type==="join_approved"||G.type==="project_synced")&&ie()},[ie])),m.jsxs("div",{className:"v10-panel-left",children:[m.jsxs("div",{style:{display:"flex",gap:4,padding:"8px 8px 4px"},children:[m.jsx("button",{className:"v10-new-project-btn",onClick:()=>q(!0),children:"+ New Context Graph"}),m.jsx("button",{className:"v10-new-project-btn",onClick:()=>B(),children:"↗ Join Context Graph"})]}),m.jsxs("div",{className:"v10-tree-header",children:[m.jsx("button",{className:`v10-tree-mode-btn ${C==="explorer"?"active":""}`,onClick:()=>j("explorer"),children:"Context Graphs"}),m.jsx("button",{className:`v10-tree-mode-btn ${C==="oracle"?"active":""}`,onClick:()=>j("oracle"),children:"Context Oracle"})]}),C==="explorer"&&m.jsxs("div",{className:"v10-tree-content",children:[m.jsxs("div",{className:`v10-tree-dashboard ${d==="dashboard"?"active":""}`,onClick:()=>{p("dashboard"),b(null)},children:[m.jsx("span",{children:"▦"})," Dashboard"]}),f.length===0&&k<=1&&m.jsxs("div",{className:"v10-journey-empty-card",children:[m.jsx("div",{className:"v10-jec-title",children:"No context graphs yet"}),m.jsx("div",{className:"v10-jec-hint",children:k===0?"Connect an agent to get started.":"Create your first context graph to give your agent structured memory."}),k===1&&m.jsx("button",{className:"v10-new-project-btn",style:{margin:0},onClick:()=>q(!0),children:"+ Create First Context Graph"})]}),(f.length>0||k>=2)&&m.jsxs("div",{className:"v10-peer-group",children:[m.jsxs("button",{type:"button",className:"v10-peer-group-header","aria-expanded":e,"aria-controls":o,onClick:a,children:[m.jsx(Bp,{size:14,className:`v10-peer-group-chevron ${e?"expanded":""}`,"aria-hidden":"true"}),m.jsx("span",{className:"v10-peer-group-label",children:"My Context Graphs"})]}),e&&m.jsx("div",{id:o,className:"v10-peer-group-body",children:W.length===0?m.jsx("div",{className:"v10-tree-item",style:{cursor:"default",color:"var(--text-tertiary)",fontStyle:"italic"},children:m.jsx("span",{className:"v10-tree-item-label",children:"No context graphs in this view yet."})}):W.map(G=>m.jsx(n1,{cg:G,isActive:x===G.id,onSelect:()=>{b(G.id),u({id:`project:${G.id}`,label:G.name||G.id.slice(0,16),closable:!0})},onHide:()=>{_(G.id),x===G.id&&b(null)}},G.id))})]}),M>0&&m.jsxs("button",{type:"button",className:"v10-tree-show-hidden",onClick:R,title:"Restore all context graphs dismissed from the sidebar",children:["↺ Show ",M," hidden context graph",M!==1?"s":""]}),k>=1&&m.jsxs("div",{className:"v10-peer-group",children:[m.jsxs("button",{type:"button",className:"v10-peer-group-header","aria-expanded":n,"aria-controls":s,onClick:r,children:[m.jsx(Bp,{size:14,className:`v10-peer-group-chevron ${n?"expanded":""}`,"aria-hidden":"true"}),m.jsx("span",{className:"v10-peer-group-label",children:"Integrations"})]}),n&&m.jsx("div",{id:s,className:"v10-peer-group-body",children:m.jsx(s4,{})})]})]}),C==="oracle"&&m.jsxs("div",{className:"v10-tree-content",children:[Q.length>0&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"v10-tree-group-label",children:"Context Oracle"}),Q.map(G=>{const O=()=>{_(G.id),x===G.id&&b(null)};return XR(G)==="catalogue"?m.jsx(l4,{cg:G,isBrowsing:d===`project:${G.id}`,onBrowse:()=>{b(null),u({id:`project:${G.id}`,label:G.name||G.id.slice(0,16),closable:!0})},onSubscribe:()=>B(G.id),onHide:O},G.id):m.jsx(n1,{cg:G,isActive:x===G.id,onSelect:()=>{b(G.id),u({id:`project:${G.id}`,label:G.name||G.id.slice(0,16),closable:!0})},onHide:O},G.id)})]}),Q.length===0&&m.jsxs("p",{style:{fontSize:12,color:"var(--text-tertiary)",padding:"20px 12px",textAlign:"center",lineHeight:1.5},children:["No discovered public Context Graphs yet. Public graphs appear here as soon as your node discovers them; use ",m.jsx("strong",{children:"Join Context Graph"})," to subscribe by ID."]}),M>0&&m.jsxs("button",{type:"button",className:"v10-tree-show-hidden",onClick:R,title:"Restore all context graphs dismissed from the sidebar",children:["↺ Show ",M," hidden context graph",M!==1?"s":""]})]}),m.jsx(YR,{open:T,onClose:()=>q(!1)}),m.jsx(r4,{open:V,onClose:Z,initialContextGraphId:P})]})}const u4=[/failed to fetch dynamically imported module/i,/error loading dynamically imported module/i,/importing a module script failed/i,/loading (?:css )?chunk [^ ]+ failed/i];function Xb(e,n=0){if(!(!(e instanceof Error)||n>4))return e.name==="ChunkLoadError"||e.code==="CSS_CHUNK_LOAD_FAILED"||u4.some(a=>a.test(e.message))?e:Xb(e.cause,n+1)}function d4(){return m.jsxs("div",{className:"lazy-spinner",role:"alert",children:[m.jsx("p",{children:"This view could not be opened. Reload the page to try again."}),m.jsx("button",{type:"button",onClick:()=>window.location.reload(),children:"Reload page"})]})}function Ja(e,n){function a(s){return m.jsx(d4,{})}const r=mn.lazy(async()=>{try{return{default:await e()}}catch(s){const u=Xb(s);if(!u)throw s;return console.error("Failed to load a lazy view chunk.",u),{default:a}}});function o(s){const u=typeof n=="function"?n(s):n;return m.jsx(S.Suspense,{fallback:m.jsxs("div",{className:"lazy-spinner",children:["Loading ",u,"..."]}),children:m.jsx(r,{...s})})}return o}const Zb="__dkg_401_reloaded";function f4(){try{return window.sessionStorage.getItem(Zb)==="1"}catch{return!0}}function p4(){try{return window.sessionStorage.setItem(Zb,"1"),!0}catch{return!1}}function Jf(e,n=[],a=0){const[r,o]=S.useState(null),[s,u]=S.useState(!0),[d,p]=S.useState(null),f=S.useRef(!0),y=S.useCallback(async()=>{try{const g=await e();f.current&&(o(g),p(null))}catch(g){if(f.current){if((g==null?void 0:g.status)===401){const x=dr()!==void 0;if(x&&ZE()&&!f4()&&p4()){window.location.reload();return}p(x?"Authentication expired — please refresh the page.":"API token required — enter it at the top of the page.");return}p(g.message)}}finally{f.current&&u(!1)}},n);return S.useEffect(()=>{f.current=!0,u(!0),y();let g=null;const x=()=>{a<=0||g||(g=setInterval(y,a))},b=()=>{g&&(clearInterval(g),g=null)},k=()=>{typeof document>"u"||(document.hidden?b():(y(),x()))};return(typeof document>"u"||!document.hidden)&&x(),typeof document<"u"&&document.addEventListener("visibilitychange",k),()=>{f.current=!1,b(),typeof document<"u"&&document.removeEventListener("visibilitychange",k)}},[y,a]),{data:r,loading:s,error:d,refresh:y}}function o9(e){return e==null?"—":e<1024?`${e} B`:e<1048576?`${(e/1024).toFixed(1)} KB`:e<1073741824?`${(e/1048576).toFixed(1)} MB`:`${(e/1073741824).toFixed(2)} GB`}function a1(e){if(e==null)return"—";if(e<1e3)return`${Math.round(e)}ms`;if(e<6e4)return`${(e/1e3).toFixed(1)}s`;if(e<36e5)return`${Math.floor(e/6e4)}m ${Math.floor(e%6e4/1e3)}s`;const n=Math.floor(e/36e5),a=Math.floor(e%36e5/6e4);return`${n}h ${a}m`}function h4(e,n=new Date){if(e==null||e==="")return"—";const a=e instanceof Date?e:new Date(e);if(Number.isNaN(a.getTime()))return"—";if(a.toDateString()===n.toDateString())return a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit",second:"2-digit"});const r=new Date(n);if(r.setDate(n.getDate()-1),a.toDateString()===r.toDateString())return`Yesterday ${a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`;const o=n.getTime()-a.getTime();return o>=0&&o<10080*60*1e3?`${a.toLocaleDateString(void 0,{weekday:"short"})} ${a.toLocaleTimeString(void 0,{hour:"2-digit",minute:"2-digit"})}`:a.toLocaleString(void 0,{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"})}function i1(e,n=8){return e?e.length<=n*2?e:e.slice(0,n)+"..."+e.slice(-4):"—"}function m4(){const e=ca(g=>g.contextGraphs),n=ca(g=>g.setContextGraphs),{hidden:a}=Qb(),[r,o]=S.useState(null),[s,u]=S.useState(!0),[d,p]=S.useState(()=>e.length===0),f=S.useCallback(()=>{Hn.fetchContextGraphs().then(({contextGraphs:g})=>n(g??[])).catch(()=>{}).finally(()=>p(!1))},[n]);return S.useEffect(()=>{f();const g=setInterval(f,6e4);return()=>clearInterval(g)},[f]),hl(S.useCallback(g=>{g.type!=="join_approved"&&g.type!=="join_rejected"&&g.type!=="project_synced"||f()},[f])),S.useEffect(()=>{let g=!0;return u(!0),Hn.fetchCurrentAgent().then(x=>{g&&o(Uh(x))}).catch(()=>{}).finally(()=>{g&&u(!1)}),()=>{g=!1}},[e]),{myCgs:S.useMemo(()=>e.filter(g=>!a.has(g.id)).filter(g=>ou(g,r)),[e,a,r]),identity:r,identityLoading:s,cgsLoading:d}}const Jb=["http://schema.org/name","http://www.w3.org/2000/01/rdf-schema#label","http://purl.org/dc/terms/title","http://purl.org/dc/elements/1.1/title","http://xmlns.com/foaf/0.1/name"];function g4(e={}){const n={predicates:[...e.extraPredicates??[],...Jb]};return e.minZoomForLabels!==void 0&&(n.minZoomForLabels=e.minZoomForLabels),n}function ew(e){if(!e)return"";const n=e.match(/^"([\s\S]*)"(?:\^\^<[^>]+>)?(?:@[A-Za-z0-9-]+)?$/);if(!n)return e;try{return JSON.parse(`"${n[1]}"`)}catch{return n[1]}}const r1="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",y4="http://dkg.io/ontology/profile/QueryCatalog";function hc(e){if(e!=null)return typeof e=="string"?e:typeof e=="object"&&"value"in e?String(e.value):String(e)}function jc(e){const n=Qt(e);return!n||n.startsWith('"')||/\s/.test(n)?!1:n.startsWith("_:")?!0:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(n)}function Qt(e){const n=e.trim();return n.startsWith('"')?n:n.startsWith("<")&&n.endsWith(">")?n.slice(1,-1):n}function il(e){if(!e)return"—";if(e.startsWith('"'))return ew(e);const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(n,a);return r>=0?e.slice(r+1):e}function v4(e){const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=e.lastIndexOf(":"),o=Math.max(n,a,r),s=o>=0?e.slice(o+1):e;try{return decodeURIComponent(s)}catch{return s}}function x4(e){const n=v4(e).trim();return n?(/^[0-9a-f-]{16,}$/i.test(n)?n.replace(/-/g,"").slice(0,12):n).replace(/[_-]+/g," ").trim():""}function b4(e,n){return e===n&&/^urn:dkg:extraction:[^\s]+$/i.test(n)}function w4(e,n){return e===n&&jc(n)}function S4(e){const n=x4(e.uri),a=e.types.map(il).find(r=>r&&r!=="Thing"&&r!=="Entity");return/^urn:dkg:extraction:[^\s]+$/i.test(e.uri)?n?`Extraction ${n}`:"Extraction":a?n&&n!==a?`${a} ${n}`:a:n||il(e.uri)}function k4(e){for(const a of Jb){const r=e.properties.get(a),o=r==null?void 0:r.find(s=>s.trim().length>0);if(o)return o}const n=il(e.uri);return e.label&&(e.label!==n||!w4(e.label,e.uri))&&!b4(e.label,e.uri)?e.label:S4(e)}const tw=5e4,Ao=2e4,nw=2e4;function l1(e,n){const a=`did:dkg:context-graph:${e}`,r=n==="wm"?`(
|
|
1084
|
+
STRSTARTS(STR(?g), "${a}/meta/assertion/") ||
|
|
1085
|
+
STRSTARTS(STR(?g), "${a}/meta/_working_memory/")
|
|
1086
|
+
)`:`STRSTARTS(STR(?g), "${a}/meta/_shared_memory/")`;return`SELECT ?s ?p ?o ?g WHERE {
|
|
1087
|
+
GRAPH ?g {
|
|
1088
|
+
?catalog a <${y4}> .
|
|
1089
|
+
?s ?p ?o
|
|
1090
|
+
}
|
|
1091
|
+
FILTER(${r})
|
|
1092
|
+
} LIMIT ${Ao}`}function C4(e){const n=`did:dkg:context-graph:${e}`;return`SELECT ?s ?p ?o ?g WHERE {
|
|
1093
|
+
GRAPH ?g { ?s ?p ?o }
|
|
1094
|
+
FILTER(
|
|
1095
|
+
STRSTARTS(STR(?g), "${n}/") &&
|
|
1096
|
+
(CONTAINS(STR(?g), "/assertion/") || CONTAINS(STR(?g), "/_working_memory/")) &&
|
|
1097
|
+
STR(?g) != "${n}/meta" &&
|
|
1098
|
+
!CONTAINS(STR(?g), "/meta/") &&
|
|
1099
|
+
!STRENDS(STR(?g), "/_meta")
|
|
1100
|
+
)
|
|
1101
|
+
} LIMIT ${tw}`}function E4(e){const n=`did:dkg:context-graph:${e}`;return`SELECT ?s ?p ?o ?g WHERE {
|
|
1102
|
+
GRAPH ?g { ?s ?p ?o }
|
|
1103
|
+
FILTER(
|
|
1104
|
+
STRSTARTS(STR(?g), "${n}") &&
|
|
1105
|
+
(STRENDS(STR(?g), "/_shared_memory") || CONTAINS(STR(?g), "/_shared_memory/")) &&
|
|
1106
|
+
STR(?g) != "${n}/meta/_shared_memory" &&
|
|
1107
|
+
!CONTAINS(STR(?g), "/meta/") &&
|
|
1108
|
+
!CONTAINS(STR(?g), "/_shared_memory/staging/") &&
|
|
1109
|
+
?p != <http://dkg.io/ontology/workspaceOwner>
|
|
1110
|
+
)
|
|
1111
|
+
} LIMIT ${Ao}`}function A4(e){const n=`did:dkg:context-graph:${e}`;return`SELECT ?s ?p ?o ?g WHERE {
|
|
1112
|
+
GRAPH ?g { ?s ?p ?o }
|
|
1113
|
+
FILTER(
|
|
1114
|
+
STRSTARTS(STR(?g), "${n}") &&
|
|
1115
|
+
!CONTAINS(STR(?g), "/assertion/") &&
|
|
1116
|
+
!CONTAINS(STR(?g), "/_working_memory") &&
|
|
1117
|
+
!CONTAINS(STR(?g), "/_shared_memory") &&
|
|
1118
|
+
!CONTAINS(STR(?g), "_verifiable_memory_meta") &&
|
|
1119
|
+
!STRENDS(STR(?g), "/_meta") &&
|
|
1120
|
+
STR(?g) != "${n}/meta" &&
|
|
1121
|
+
!CONTAINS(STR(?g), "/meta/") &&
|
|
1122
|
+
!CONTAINS(STR(?g), "/_private") &&
|
|
1123
|
+
!CONTAINS(STR(?g), "/_rules")
|
|
1124
|
+
)
|
|
1125
|
+
} LIMIT ${nw}`}function j4(e,n){const a=`did:dkg:context-graph:${n}/`;if(!e.startsWith(a))return;const r=e.slice(a.length),o=r.indexOf("/"),s=o>=0?r.slice(0,o):r;if(!(!s||s.startsWith("_")||s==="assertion"||s==="meta"))return s}const o1={wm:"loading",swm:"loading",vm:"loading"},T4={wm:"error",swm:"error",vm:"error"};async function ho(e,n,a){var r,o;try{const{layerLimit:s,...u}=a??{},d={sparql:e,contextGraphId:n,...u},p=await Ic(d),f=((r=p==null?void 0:p.result)==null?void 0:r.bindings)??((o=p==null?void 0:p.results)==null?void 0:o.bindings)??[],y=typeof s=="number"&&f.length>=s;return{triples:f.map(x=>{const b=hc(x.g);return{subject:hc(x.s)??"",predicate:hc(x.p)??"",object:hc(x.o)??"",subGraph:b?j4(b,n):void 0}}).filter(x=>x.subject&&x.predicate&&x.object),ok:!0,truncated:y}}catch{return{triples:[],ok:!1,truncated:!1}}}function N4(e){var p;const n=new Map,a=new Map,r=new Map,o=new Map,s=new Map;function u(f,y,g){let x=o.get(f);x||(x=new Map,o.set(f,x));let b=x.get(y);if(b||(b=new Set,x.set(y,b)),b.has(g))return!1;b.add(g);let k=s.get(f);return k||(k={working:0,shared:0,verified:0},s.set(f,k)),k[y]++,!0}function d(f){const y=Qt(f);let g=n.get(y);return g||(g={uri:y,label:il(y),types:[],trustLevel:"working",layers:new Set,subGraphs:new Set,properties:new Map,connections:[],tripleCount:0},n.set(y,g)),g}for(const f of e){const y=d(f.subject);if(y.layers.add(f.layer),f.subGraph&&y.subGraphs.add(f.subGraph),f.predicate===r1){const g=Qt(f.object);y.types.includes(g)||y.types.push(g)}else if(jc(f.object)){const g=Qt(f.object),x=d(g);x.layers.add(f.layer),f.subGraph&&x.subGraphs.add(f.subGraph);const b=a.get(y.uri)??new Set,k=`${f.predicate}\0${g}`;b.has(k)||(b.add(k),a.set(y.uri,b),y.connections.push({predicate:f.predicate,targetUri:g,targetLabel:il(g)}))}else{const g=r.get(y.uri)??new Set,x=`${f.predicate}\0${f.object}`;if(!g.has(x)){g.add(x),r.set(y.uri,g);const b=y.properties.get(f.predicate)??[];b.push(ew(f.object)),y.properties.set(f.predicate,b)}}}for(const f of n.values())f.label=k4(f),f.layers.has("verified")?f.trustLevel="verified":f.layers.has("shared")?f.trustLevel="shared":f.trustLevel="working";for(const f of e){const y=Qt(f.subject),g=n.get(y);if(g&&g.trustLevel!==f.layer)continue;const x=jc(f.object)?Qt(f.object):f.object,b=jc(f.object);if(b){const C=n.get(x);if(C&&C.trustLevel!==f.layer)continue}const k=`${y}\0${f.predicate}\0${x}`;if(g&&u(g.uri,f.layer,k),f.predicate===r1){if(x!==y){const C=n.get(x);C&&u(C.uri,f.layer,k)}}else if(b&&x!==y){const C=n.get(x);C&&u(C.uri,f.layer,k)}}for(const f of n.values()){const y=s.get(f.uri);f.tripleCount=y?y[f.trustLevel]:0}for(const f of n.values())for(const y of f.connections)y.targetLabel=((p=n.get(y.targetUri))==null?void 0:p.label)??il(y.targetUri);return n}const R4=N4;function _4(e){return e.types.length>0||e.properties.size>0||e.connections.length>0}function O4(e,n){const a=(n==null?void 0:n.signalErrors)??!1,r=(n==null?void 0:n.includeQueryCatalog)??!1,[o,s]=S.useState([]),[u,d]=S.useState(!0),[p,f]=S.useState(null),[y,g]=S.useState(!1),[x,b]=S.useState(o1),k=S.useRef(0),C=S.useCallback(async()=>{if(!e)return;const U=++k.current;d(!0),f(null),g(!1),b(o1);try{const D={includeContextGraphPartitions:!0},W={triples:[],ok:!0,truncated:!1},[Q,M,T,q,V]=await Promise.all([ho(C4(e),e,{...D,layerLimit:tw}),ho(E4(e),e,{...D,layerLimit:Ao}),ho(A4(e),e,{...D,layerLimit:nw}),r?ho(l1(e,"wm"),e,{...D,layerLimit:Ao}):Promise.resolve(W),r?ho(l1(e,"swm"),e,{...D,layerLimit:Ao}):Promise.resolve(W)]);if(U!==k.current)return;const ae=[...Q.triples.map(G=>({...G,layer:"working"})),...q.triples.map(G=>({...G,layer:"working"})),...M.triples.map(G=>({...G,layer:"shared"})),...V.triples.map(G=>({...G,layer:"shared"})),...T.triples.map(G=>({...G,layer:"verified"}))],P=Q.ok&&q.ok,K=M.ok&&V.ok;s(ae),b({wm:P?"ok":"error",swm:K?"ok":"error",vm:T.ok?"ok":"error"});const B=[{ok:P,truncated:Q.truncated||q.truncated},{ok:K,truncated:M.truncated||V.truncated},T],Z=B.filter(G=>!G.ok).length,ie=B.some(G=>G.truncated);g(Z>0&&Z<3||ie),f(a&&Z===3?"Failed to load memory data":null)}catch(D){U===k.current&&(f(D.message??"Failed to load memory data"),b(T4))}finally{U===k.current&&d(!1)}},[e,r,a]);AT(e,C),S.useEffect(()=>{C()},[C]);const j=S.useMemo(()=>R4(o),[o]),E=S.useMemo(()=>[...j.values()].filter(_4).sort((U,D)=>{const W={verified:0,shared:1,working:2},Q=W[U.trustLevel]-W[D.trustLevel];if(Q!==0)return Q;const M=U.tripleCount??0,T=D.tripleCount??0;return T!==M?T-M:U.label.localeCompare(D.label)}),[j]),_=S.useMemo(()=>{const U=new Set;return o.filter(D=>{const W=`${D.subject}|${D.predicate}|${D.object}`;return U.has(W)?!1:(U.add(W),!0)}).map(({subject:D,predicate:W,object:Q,subGraph:M})=>({subject:D,predicate:W,object:Q,subGraph:M}))},[o]),R=S.useMemo(()=>{const U=new Map;for(const[D,W]of j)U.set(D,W.trustLevel);return U},[j]),F=S.useMemo(()=>{let U=0,D=0,W=0;for(const Q of E)Q.trustLevel==="verified"?W++:Q.trustLevel==="shared"?D++:U++;return{wm:U,swm:D,vm:W,total:E.length}},[E]);return{entities:j,entityList:E,allTriples:o,graphTriples:_,trustMap:R,counts:F,loading:u,error:p,partial:y,layerStatus:x,refresh:C}}const $o="http://dkg.io/viz/",aw=`${$o}OnChainAnchor`,iw=`${$o}AgentIdentity`,rw=`${$o}anchoredIn`,lw=`${$o}signedBy`,ow=`${$o}consensus`,s1="http://www.w3.org/1999/02/22-rdf-syntax-ns#type",c1="http://schema.org/name",u1="http://schema.org/description";function mo(e){if(e!=null)return typeof e=="string"?e.startsWith('"')?e.replace(/^"/,"").replace(/"(\^\^<[^>]*>)?$/,""):e:typeof e=="object"&&e!==null&&"value"in e?String(e.value):String(e)}function D4(e){const n=e.opId.slice(0,10);try{const r=new Date(e.publishedAt).toISOString().slice(11,16);return`anchor ${n} · ${r}UTC`}catch{return`anchor ${n}`}}function M4(e){if(e.startsWith("did:dkg:agent:")){const n=e.slice(14);return n.startsWith("0x")?n.slice(0,6)+"…"+n.slice(-4):n.slice(0,6)+"…"+n.slice(-6)}return e.length>18?e.slice(0,8)+"…"+e.slice(-6):e}function L4(e){return`PREFIX dkg: <http://dkg.io/ontology/>
|
|
1126
|
+
PREFIX prov: <http://www.w3.org/ns/prov#>
|
|
1127
|
+
SELECT ?op ?root ?agent ?publishedAt ?g WHERE {
|
|
1128
|
+
GRAPH ?g {
|
|
1129
|
+
?op a dkg:WorkspaceOperation ;
|
|
1130
|
+
dkg:rootEntity ?root ;
|
|
1131
|
+
dkg:publishedAt ?publishedAt ;
|
|
1132
|
+
prov:wasAttributedTo ?agent .
|
|
1133
|
+
}
|
|
1134
|
+
FILTER(
|
|
1135
|
+
STRSTARTS(STR(?g), "${`did:dkg:context-graph:${e}/`}") &&
|
|
1136
|
+
CONTAINS(STR(?g), "_shared_memory_meta")
|
|
1137
|
+
)
|
|
1138
|
+
} ORDER BY ?publishedAt LIMIT 2000`}function z4(e,n){const a=`did:dkg:context-graph:${n}/`;if(!e.startsWith(a))return;const r=e.slice(a.length),o=r.indexOf("/");if(o<0)return;const s=r.slice(0,o);if(!(!s||s.startsWith("_")))return s}function I4(e){const n=e.lastIndexOf(":");return n>=0?e.slice(n+1):e}function P4(e,n){const a=[],r=new Set;for(const o of e){const s=n?o.roots.filter(d=>n.has(d)):o.roots;if(s.length===0)continue;const u=`urn:dkg:viz:anchor:${o.opId}`;a.push({subject:u,predicate:s1,object:aw,subGraph:o.subGraph}),a.push({subject:u,predicate:c1,object:`"${D4(o)}"`,subGraph:o.subGraph}),a.push({subject:u,predicate:u1,object:`"Published ${o.roots.length} KA${o.roots.length===1?"":"s"} · ${new Date(o.publishedAt).toISOString()}"`,subGraph:o.subGraph});for(const d of s)a.push({subject:d,predicate:rw,object:u,subGraph:o.subGraph}),a.push({subject:d,predicate:ow,object:`"${o.agents.length}-of-${o.agents.length}"`,subGraph:o.subGraph});for(const d of o.agents){const p=d.startsWith("did:")||d.startsWith("12D3")?d:`did:dkg:agent:${d}`,f=`urn:dkg:viz:agent:${encodeURIComponent(p)}`;a.push({subject:u,predicate:lw,object:f,subGraph:o.subGraph}),r.has(f)||(r.add(f),a.push({subject:f,predicate:s1,object:iw,subGraph:o.subGraph}),a.push({subject:f,predicate:c1,object:`"${M4(p)}"`,subGraph:o.subGraph}),a.push({subject:f,predicate:u1,object:`"${p}"`,subGraph:o.subGraph}))}}return a}function s9(e,n){const[a,r]=S.useState([]),[o,s]=S.useState(!1),[u,d]=S.useState(null),p=S.useRef(0);S.useEffect(()=>{if(!e){r([]),s(!1);return}const x=++p.current;s(!0),d(null),(async()=>{var b;try{const k=await fetch("/api/query",{method:"POST",headers:{"Content-Type":"application/json",...$t()},body:JSON.stringify({sparql:L4(e)})});if(!k.ok)throw new Error(`SPARQL query failed: ${k.status}`);const C=await k.json(),j=((b=C==null?void 0:C.result)==null?void 0:b.bindings)??[],E=new Map;for(const _ of j){const R=mo(_.op),F=mo(_.root),U=mo(_.agent),D=mo(_.publishedAt),W=mo(_.g);if(!R||!F||!U||!D)continue;let Q=E.get(R);Q||(Q={opId:I4(R),opUri:R,agents:[],roots:[],publishedAt:D,subGraph:W?z4(W,e):void 0},E.set(R,Q)),Q.roots.includes(F)||Q.roots.push(F),Q.agents.includes(U)||Q.agents.push(U)}if(x!==p.current)return;r([...E.values()].sort((_,R)=>R.publishedAt.localeCompare(_.publishedAt)))}catch(k){if(x!==p.current)return;d((k==null?void 0:k.message)??"Failed to load anchors"),r([])}finally{x===p.current&&s(!1)}})()},[e]);const f=S.useMemo(()=>{if(!n)return null;const x=[];if(n instanceof Set)for(const b of n)x.push(b);else for(const b of n)x.push(b);return x.sort(),x.join("|")},[n]),y=S.useMemo(()=>f==null?null:new Set(f.length===0?[]:f.split("|")),[f]),g=S.useMemo(()=>P4(a,y),[a,y]);return{anchors:a,decorationTriples:g,loading:o,error:u}}const sw={wm:{icon:"◇",color:"#64748b",title:"Working Memory",desc:"Private agent scratchpad — ephemeral, fast local storage",trustLabel:"Working",trustLevel:"working"},swm:{icon:"◈",color:"#f59e0b",title:"Shared Working Memory",desc:"Team workspace — shared proposals, TTL-bounded",trustLabel:"Shared",trustLevel:"shared"},vm:{icon:"◉",color:"#22c55e",title:"Verifiable Memory",desc:"Endorsed, published, on-chain knowledge",trustLabel:"Verifiable",trustLevel:"verified"}};function c9(e,n=2){const a=e==="working"?"wm":e==="shared"?"swm":e==="verified"?"vm":e,r=n!==1;return a==="vm"?r?"Knowledge Assets":"Knowledge Asset":r?"Entities":"Entity"}const u9={label:"Stored triples (data + provenance)",tooltip:"Publication adds provenance to the data. Raw triple counts can change between memory layers without losing entities."};function d9(e){return e.activeSubGraph?!1:e.activeLayer==="swm"}const f9={verified:"#22c55e",shared:"#f59e0b",working:"#64748b"},Zr={Person:{icon:"👤",group:"People"},SoftwareApplication:{icon:"💻",group:"Software"},SoftwareSourceCode:{icon:"📦",group:"Code"},Organization:{icon:"🏢",group:"Organizations"},Event:{icon:"📅",group:"Events"},ChooseAction:{icon:"⚡",group:"Decisions"},DefinedTerm:{icon:"📘",group:"Concepts"},CreativeWork:{icon:"📄",group:"Documents"},Product:{icon:"🪙",group:"Products"},ConversationTurn:{icon:"💬",group:"Conversations"},Thing:{icon:"◆",group:"Other"},Package:{icon:"📦",group:"Packages"},File:{icon:"📄",group:"Files"},Class:{icon:"🔷",group:"Classes"},Interface:{icon:"🔶",group:"Interfaces"},Function:{icon:"ƒ",group:"Functions"},TypeAlias:{icon:"🏷️",group:"Types"},Enum:{icon:"🔢",group:"Enums"},ExternalModule:{icon:"🌐",group:"External Modules"}},U4="http://www.w3.org/ns/prov#wasAttributedTo",ml="http://dkg.io/ontology/agent/",B4=ml+"createdBy",H4=ml+"promotedBy",$4=ml+"publishedBy",q4=ml+"createdAt",F4=ml+"promotedAt",G4=ml+"publishedAt";function V4(e){for(const n of e.connections)if(n.predicate===U4)return n.targetUri;return null}function p9(e,n){const a=n==="created"?B4:n==="promoted"?H4:$4;for(const r of e.connections)if(r.predicate===a)return r.targetUri;return V4(e)}function h9(e,n){const a=n==="created"?q4:n==="promoted"?F4:G4,r=e.properties.get(a);return(r==null?void 0:r[0])??null}function d1(e){const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(n,a);return r>=0?e.slice(r+1):e}function m9(e){const n=e.lastIndexOf("#"),a=e.lastIndexOf("/"),r=Math.max(n,a);return(r>=0?e.slice(r+1):e).replace(/([a-z])([A-Z])/g,"$1 $2").replace(/_/g," ")}function g9(e,n){var o,s;if(n)for(const u of e.types){const d=n.forType(u),p=d1(u),f=d.label??p;if(d.icon||d.color||d.label)return{icon:d.icon??((o=Zr[p])==null?void 0:o.icon)??Zr.Thing.icon,group:d.label??((s=Zr[p])==null?void 0:s.group)??Zr.Thing.group,color:d.color,type:f}}const a=e.types[0]?d1(e.types[0]):"Entity";return{...Zr[a]??Zr.Thing,type:a}}const jn="http://dkg.io/ontology/code/",W4={[jn+"Package"]:"#a855f7",[jn+"File"]:"#3b82f6",[jn+"Class"]:"#22c55e",[jn+"Interface"]:"#06b6d4",[jn+"Function"]:"#f59e0b",[jn+"TypeAlias"]:"#ec4899",[jn+"Enum"]:"#ef4444",[jn+"ExternalModule"]:"#64748b",[aw]:"#f5a524",[iw]:"#c084fc"},Y4={[jn+"imports"]:"#60a5fa",[jn+"contains"]:"#a855f7",[jn+"definedIn"]:"#3b82f6",[jn+"exports"]:"#f59e0b",[jn+"extends"]:"#22c55e",[jn+"implements"]:"#06b6d4",[rw]:"#f5a524",[lw]:"#c084fc",[ow]:"#22c55e"};function K4(e){return{"https://schema.org/":e,"http://www.w3.org/ns/prov#":e,"http://xmlns.com/foaf/0.1/":e,"http://purl.org/dc/terms/":e}}function y9(e,n){const{color:a}=sw[e],r=e==="vm";return{labelMode:"humanized",renderer:"2d",labels:g4({minZoomForLabels:r?.2:.3}),style:{classColors:W4,predicateColors:Y4,namespaceColors:K4(a),...n&&Object.keys(n).length>0?{nodeColors:n}:{},defaultNodeColor:a,defaultEdgeColor:r?"#4ade80":"#64748b",edgeWidth:r?1.8:1.2,fontSize:r?12:11,gradient:!0,gradientIntensity:r?.65:.4},hexagon:{baseSize:r?13:11,minSize:r?8:7,maxSize:r?42:28,scaleWithDegree:!0},focus:{maxNodes:3e3,hops:999}}}function v9(e){const n=["http://schema.org/description","http://schema.org/text"];for(const a of n){const r=e.properties.get(a);if(r!=null&&r[0])return r[0]}return null}function x9(e,n,a=2){const r=d=>Qt(d.subject),o=d=>Qt(d.object),s=new Set([e]);let u=new Set([e]);for(let d=0;d<a;d++){const p=new Set;for(const f of n){const y=r(f),g=o(f);u.has(y)&&!s.has(g)&&p.add(g),u.has(g)&&!s.has(y)&&p.add(y)}for(const f of p)s.add(f);if(u=p,u.size===0)break}return n.filter(d=>s.has(r(d))&&s.has(o(d)))}function b9(e,n){const a=n.lastIndexOf("/"),r=n.lastIndexOf("#"),o=n.lastIndexOf(":"),s=Math.max(a,r,o),u=s>=0?n.slice(s+1):n,d=(()=>{try{return decodeURIComponent(u)}catch{return u}})();if(/^urn:dkg:extraction:[^\s]+$/i.test(n)){const p=d.replace(/-/g,"").replace(/_+/g," ").slice(0,12).trim();return p?`Extraction ${p}`:"Extraction"}return d||n}function Bh(e){const n=e.trim();return!n||n.startsWith('"')?!1:n.startsWith("_:")||n.startsWith("<")&&n.endsWith(">")?!0:/\s/.test(n)?!1:/^[A-Za-z][A-Za-z0-9+.-]*:/.test(n)}function w9(e,n){return!n.isRoot&&e.subGraph===n.slug?!0:e.subGraph?!1:n.scopedUris.has(e.subject)?!0:n.requireResourceObject?Bh(e.object)&&n.scopedUris.has(e.object):n.scopedUris.has(e.object)}function cw(e,n){const a=n.get(Qt(e.subject));return a!==void 0&&a.trustLevel!==e.layer}function uw(e,n){if(!Bh(e.object))return!1;const a=n.get(Qt(e.object));return a!==void 0&&a.trustLevel!==e.layer}function dw(e,n){return cw(e,n)||uw(e,n)}function fw(e,n){return cw(e,n)&&uw(e,n)}function Q4(e,n){const a=new Set,r=[];for(const o of e){if(fw(o,n))continue;const s=`${Qt(o.subject)}|${o.predicate}|${Qt(o.object)}`;a.has(s)||(a.add(s),r.push(o))}return r}function S9(e){return S.useMemo(()=>{const n=Q4(e.allTriples,e.entities);return{triples:n,total:n.length}},[e.allTriples,e.entities])}function X4(e){return S.useMemo(()=>{const n=new Set,a=new Set,r=new Set,o=new Set;let s=0,u=0,d=0,p=0;for(const f of e.allTriples){const y=`${Qt(f.subject)}|${f.predicate}|${Qt(f.object)}`;!fw(f,e.entities)&&!o.has(y)&&(o.add(y),p++),dw(f,e.entities)||(f.layer==="working"&&!n.has(y)?(n.add(y),s++):f.layer==="shared"&&!a.has(y)?(a.add(y),u++):f.layer==="verified"&&!r.has(y)&&(r.add(y),d++))}return{wm:s,swm:u,vm:d,canonical:p}},[e.allTriples,e.entities])}function k9(e,n){const a=sw[n].trustLevel;return S.useMemo(()=>{const r=new Set,o=[];for(const s of e.allTriples){if(s.layer!==a||dw(s,e.entities))continue;const u=`${Qt(s.subject)}|${s.predicate}|${Qt(s.object)}`;r.has(u)||(r.add(u),o.push(s))}return o},[e.allTriples,e.entities,a])}const Z4="http://www.w3.org/1999/02/22-rdf-syntax-ns#type";function J4(e){const n=e.trim();return(n.startsWith("<")&&n.endsWith(">")?n.slice(1,-1):n)===Z4}function C9(e,n,a){const r=[],o=a==null?void 0:a.focalSubjects;for(const s of e){const u=Qt(s.subject);!n.has(u)&&!(o!=null&&o.has(u))||Bh(s.object)&&!J4(s.predicate)&&!n.has(Qt(s.object))||r.push(s)}return r}const E9="http://dkg.io/ontology/sourceContentType",A9="http://dkg.io/ontology/markdownForm",j9="http://dkg.io/ontology/sourceFile",T9="http://dkg.io/ontology/size";function N9(e){const n=e.replace(/^"|"$/g,"").replace(/^"(.+)"(?:@\w+|\^\^.+)?$/,"$1"),a=new Date(n);return Number.isFinite(a.getTime())?a.toLocaleString(void 0,{month:"short",day:"numeric",year:"numeric",hour:"numeric",minute:"2-digit"}):n}function R9(e){const[n,a]=e.split("-"),r=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],o=Math.max(0,Math.min(11,parseInt(a,10)-1));return`${r[o]} ${n}`}function _9(e,n){const a=e.properties.get(n),r=a==null?void 0:a[0];if(!r)return null;const o=r.replace(/^"|"$/g,"").replace(/^"(.+)"(?:@\w+|\^\^.+)?$/,"$1"),s=Date.parse(o);return Number.isNaN(s)?null:s}function O9(e){const n=Date.now()-e;if(n<0)return"just now";const a=Math.floor(n/1e3);if(a<45)return"just now";const r=Math.floor(a/60);if(r<60)return`${r}m ago`;const o=Math.floor(r/60);if(o<24)return`${o}h ago`;const s=Math.floor(o/24);return s<30?`${s}d ago`:new Date(e).toISOString().slice(0,10)}function e3(e,n=6){if(e==null||e==="")return"—";const a=typeof e=="number"?e:parseFloat(String(e));if(!Number.isFinite(a))return"—";if(a===0)return"0";const o=a.toFixed(n).replace(/\.?0+$/,"");return a>0&&Number(o)===0?`< ${1/Math.pow(10,n)}`:o}function t3(e){if(!(e==null||e===""))return`Exact balance: ${e} (full precision from chain)`}function n3(e){if(e==null)return"—";const n=e/100;return`${n%1===0?n.toFixed(0):n.toFixed(1)}%`}function a3(){$b();const e=bh(s=>{var u;return(u=s.nodeStatus)==null?void 0:u.nodeRole}),n=gn(s=>s.openTab),{covered:a,bestCoveringDiscountBps:r,walletsInconclusive:o}=Hb();return m.jsxs("div",{className:"v10-ws-pca",children:[m.jsx("span",{className:"v10-ws-pca-label",children:"Publishing discount"}),m.jsx("span",{className:"v10-ws-pca-value","data-covered":a,children:o?"Couldn’t verify your wallets — retry":a?`${n3(r)} discount`:"None — publishing at the direct cost"}),m.jsxs("button",{type:"button",className:"v10-ws-pca-cta",onClick:()=>n({id:"conviction",label:"Publisher Conviction",closable:!0}),children:[e==="edge"?"Get added to a PCA":"Set up PCA"," ->"]})]})}function i3(e){const n=e.sizePartial&&!e.sizeApprox,a=e.sizeApprox&&!e.triplesUnknown?"~":"",r=n?"+":"",o=e.triplesUnknown?"Knowledge Assets (summary)":e.sizeApprox?"entities / KA · approx.":n?"entities loaded":"entities / Knowledge Assets",s=e.triplesUnknown?"Live entity count unavailable — showing the published Knowledge-Asset summary (not the full WM/SWM/VM entity total)":e.sizeApprox?"Some context graphs reported only their Knowledge-Asset summary — this total mixes summary and live counts and is approximate":void 0;return{entityValue:`${a}${e.entities.total.toLocaleString()}${r}`,entityLabel:o,entityTitle:s,tripleValue:e.triplesUnknown?"—":`${e.sizePartial||e.sizeApprox?"~":""}${e.triples.total.toLocaleString()}`,tripleLabel:n?"triples preview":"triples",showLayerBars:!e.triplesUnknown&&!e.sizeApprox}}const r3="Context graphs you created or joined — scoped knowledge domains with configurable access (private, curated and peer-shared, or public) where agents build and collaborate on shared context with verifiable provenance.",qp=[{key:"wm",label:"Working Memory",short:"WM",color:"var(--layer-working)",desc:"Private agent drafts — free, self-attested, persists locally."},{key:"swm",label:"Shared Working Memory",short:"SWM",color:"var(--layer-shared)",desc:"Team proposals — free, gossip-replicated across context-graph peers."},{key:"vm",label:"Verifiable Memory",short:"VM",color:"var(--layer-verified)",desc:"On-chain knowledge — permanent, verifiable, requires TRAC to publish."}],mc={1:"Ethereum",8453:"Base",84532:"Base Sepolia",100:"Gnosis",10200:"Chiado",2043:"NeuroWeb",20430:"NeuroWeb Testnet"};function ep(e){var o;const n=Fb(e);if(e==null)return{name:"Unknown chain",gas:n};const a=String(e);if(mc[a])return{name:mc[a],gas:n};const r=(o=a.match(/(\d+)\s*$/))==null?void 0:o[1];return r&&mc[r]?{name:mc[r],gas:n}:{name:r?`Chain ${r}`:`Chain ${a}`,gas:n}}function tp(e){return e<1e3?String(e):e<1e6?`${(e/1e3).toFixed(e<1e4?1:0)}k`.replace(".0",""):`${(e/1e6).toFixed(1)}M`.replace(".0","")}function np({label:e,value:n,sub:a,accentColor:r,children:o,icon:s,className:u}){return m.jsxs("div",{className:`stat-card v10-anim-mount${u?` ${u}`:""}`,children:[r&&m.jsx("div",{className:"accent",style:{background:r}}),m.jsxs("div",{className:"stat-label",children:[s,e]}),n!=null&&n!==""&&m.jsx("div",{className:"stat-value",children:n}),o,a!=null&&a!==""&&m.jsx("div",{className:"stat-sub",children:a})]})}function f1({counts:e}){const n=e.wm+e.swm+e.vm,a=qp.map(r=>`${r.short} ${e[r.key]}`).join(" · ");return m.jsx("div",{className:"v10-layerbar","aria-label":a,children:n===0?m.jsx("span",{className:"v10-layerbar-empty"}):qp.map(r=>{const o=e[r.key]/n*100;return o<=0?null:m.jsx("span",{className:"v10-layerbar-seg",title:`${r.label} (${e[r.key]}) — ${r.desc}`,style:{width:`${o}%`,background:r.color}},r.key)})})}function l3(){return m.jsx("div",{className:"v10-layer-legend",children:qp.map(e=>m.jsxs("span",{className:"v10-layer-legend-item",title:`${e.label} — ${e.desc}`,children:[m.jsx("span",{className:"v10-layer-legend-dot",style:{background:e.color}}),e.short]},e.key))})}function o3({curator:e,joined:n,refreshing:a}){const r=e+n,o=`Curator ${e} · Joined ${n}`,s="var(--accent-green)",u="var(--text-secondary)";return m.jsxs("div",{className:`v10-cg-rolesplit${a?" is-refreshing":""}`,title:a?"Refreshing — agent identity is being re-checked":void 0,"aria-busy":a||void 0,children:[m.jsx("div",{className:"v10-layerbar","aria-label":o,children:r===0?m.jsx("span",{className:"v10-layerbar-empty"}):m.jsxs(m.Fragment,{children:[e>0&&m.jsx("span",{className:"v10-layerbar-seg",title:`Curator (${e}) — context graphs you created and curate`,style:{width:`${e/r*100}%`,background:s}}),n>0&&m.jsx("span",{className:"v10-layerbar-seg",title:`Joined (${n}) — context graphs you joined as a member`,style:{width:`${n/r*100}%`,background:u}})]})}),m.jsxs("div",{className:"v10-layer-legend",children:[m.jsxs("span",{className:"v10-layer-legend-item",title:"Curator — context graphs you created and curate",children:[m.jsx("span",{className:"v10-layer-legend-dot",style:{background:s}}),"Curator ",e]}),m.jsxs("span",{className:"v10-layer-legend-item",title:"Joined — context graphs you joined as a member",children:[m.jsx("span",{className:"v10-layer-legend-dot",style:{background:u}}),"Joined ",n]})]})]})}function s3({cg:e,identity:n,onReport:a,onOpen:r}){var W,Q;const o=O4(e.id,{signalErrors:!0}),[s,u]=S.useState(null),[d,p]=S.useState(!1),f=s===null&&!d,y=S.useRef(!0),g=S.useRef(0),x=S.useCallback(()=>{const M=++g.current;Hn.listParticipants(e.id).then(T=>{y.current&&M===g.current&&(u((T.allowedAgents??[]).map(Mi)),p(!1))}).catch(()=>{y.current&&M===g.current&&(u(null),p(!0))})},[e.id]);S.useEffect(()=>{y.current=!0,u(null),p(!1),x();const M=setInterval(x,3e4);return()=>{y.current=!1,clearInterval(M)}},[x]),hl(S.useCallback(M=>{var q,V;if(M.type!=="join_approved"&&M.type!=="join_rejected"&&M.type!=="project_synced")return;const T=((q=M.data)==null?void 0:q.contextGraphId)??((V=M.data)==null?void 0:V.projectId);T&&T!==e.id||x()},[e.id,x]));const b=Gc(e.accessPolicy)==="public",k=S.useMemo(()=>{var V;if(b)return null;const M=(V=e.curator)==null?void 0:V.trim(),T=M?Mi(M):null;if(s===null)return d&&T?[T]:null;const q=new Set(s);return T&&q.add(T),[...q]},[s,d,e.curator,b]),C=Number.isFinite(e.assetCount??e.assets)?e.assetCount??e.assets:0,j=S.useMemo(()=>{if(o.error)return{wm:0,swm:0,vm:0,total:C};const M=new Set(o.allTriples.map(T=>T.subject)).size;return{wm:o.counts.wm,swm:o.counts.swm,vm:o.counts.vm,total:M}},[o.error,o.allTriples,o.counts.wm,o.counts.swm,o.counts.vm,C]),E=X4(o),_=S.useMemo(()=>({wm:E.wm,swm:E.swm,vm:E.vm,total:E.canonical}),[E]),R=[o.loading?1:0,o.error?1:0,o.partial?1:0,f?1:0,d?1:0,b?1:0,j.wm,j.swm,j.vm,j.total,_.wm,_.swm,_.vm,_.total,k?k.slice().sort().join(","):"∅"].join("|");S.useEffect(()=>{a(e.id,{entities:j,triples:_,agents:k??[],sizeLoading:o.loading,sizeError:!!o.error||o.partial,sizeFallback:!!o.error,agentsLoading:f,agentsError:d,agentsUnknown:b,sig:R})},[e.id,R]);const F=Gc(e.accessPolicy),U=F==="private"?"Curated":F==="public"?"Public":"Unknown",D=!!((W=e.curator)!=null&&W.trim()&&((Q=n==null?void 0:n.agentDid)!=null&&Q.trim())&&Mi(e.curator)===Mi(n.agentDid));return m.jsxs("button",{className:"v10-cg-row",onClick:()=>r(e),children:[m.jsx("span",{className:"v10-cg-cell v10-cg-name",children:e.name||e.id.slice(0,16)}),m.jsx("span",{className:"v10-cg-cell v10-cg-type",title:`${U} context graph`,"aria-label":`${U} context graph`,children:F==="private"?m.jsx(wN,{size:13,"aria-hidden":"true"}):F==="public"?m.jsx(yN,{size:13,"aria-hidden":"true"}):m.jsx("span",{className:"v10-cg-dim",children:"—"})}),m.jsx("span",{className:"v10-cg-cell v10-cg-size",children:o.loading?m.jsx("span",{className:"v10-stat-loading",children:"loading…"}):o.error?m.jsxs("span",{title:"Live entity count unavailable — showing the published Knowledge-Asset summary, not the full WM/SWM/VM entity total",children:[tp(j.total)," ",m.jsx("span",{className:"v10-cg-dim",children:"KA (summary)"})," · ",m.jsx("span",{className:"v10-cg-dim",children:"— triples"})]}):o.partial?m.jsxs("span",{title:"Loaded preview only — some memory layers are capped or unavailable; total triples may increase or decrease as layers load",children:[j.total.toLocaleString(),"+ ",m.jsx("span",{className:"v10-cg-dim",children:"entities"})," · ~",_.total.toLocaleString()," ",m.jsx("span",{className:"v10-cg-dim",children:"triples · loaded preview"})]}):m.jsxs(m.Fragment,{children:[tp(j.total)," ",m.jsx("span",{className:"v10-cg-dim",children:"entities"})," · ",tp(_.total)," ",m.jsx("span",{className:"v10-cg-dim",children:"triples"})]})}),m.jsx("span",{className:"v10-cg-cell v10-cg-agents",children:k===null?m.jsx("span",{className:"v10-cg-dim",children:"—"}):d?m.jsxs("span",{title:"Participant list unavailable — curator-only lower bound",children:["~",k.length]}):k.length}),m.jsx("span",{className:"v10-cg-cell v10-cg-role",children:m.jsx("span",{className:`v10-cg-badge v10-cg-badge-${D?"curator":"joined"}`,children:D?"CURATOR":"JOINED"})})]})}const p1={wm:0,swm:0,vm:0,total:0};function c3(){var W,Q;const{data:e}=Jf(Hn.fetchStatus,[],1e4),{data:n}=Jf(Hn.fetchEconomics,[],6e4),{data:a,loading:r,error:o}=Jf(Hn.fetchWalletsBalances,[],3e4),{openTab:s}=gn(),{setActiveProject:u}=ca(),{myCgs:d,identity:p,identityLoading:f,cgsLoading:y}=m4(),g=(f||y)&&d.length===0,[x,b]=S.useState({}),k=S.useCallback((M,T)=>{b(q=>{var V;return((V=q[M])==null?void 0:V.sig)===T.sig?q:{...q,[M]:T}})},[]);S.useEffect(()=>{const M=new Set(d.map(T=>T.id));b(T=>{const q=Object.keys(T);if(q.every(ae=>M.has(ae)))return T;const V={};for(const ae of q)M.has(ae)&&(V[ae]=T[ae]);return V})},[d]);const C=S.useMemo(()=>{const M={...p1},T={...p1},q=new Set;let V=!1,ae=!1,P=!1,K=!1,B=!1;for(const ie of d){const G=x[ie.id];if(!G){V=!0,ae=!0;continue}G.sizeLoading&&(V=!0),G.agentsLoading&&(ae=!0),G.sizeError&&(P=!0),G.sizeFallback&&(B=!0),(G.agentsError||G.agentsUnknown)&&(K=!0);for(const O of["wm","swm","vm","total"])M[O]+=G.entities[O],T[O]+=G.triples[O];for(const O of G.agents)q.add(O)}const Z=d.length>0;return{entities:M,triples:T,agentCount:q.size,sizeLoading:Z&&V,agentsLoading:Z&&ae,sizePartial:P,agentsPartial:K,triplesUnknown:Z&&P&&T.total===0,sizeApprox:Z&&B,hasCgs:Z}},[d,x]),j=i3(C),E=S.useMemo(()=>{var V,ae;const M=(V=p==null?void 0:p.agentDid)!=null&&V.trim()?Mi(p.agentDid):null;let T=0,q=0;for(const P of d)!!(M&&((ae=P.curator)!=null&&ae.trim())&&Mi(P.curator)===M)?T++:q++;return{curator:T,joined:q}},[d,p]),_=[{label:"24h",display:"Last 24h"},{label:"7d",display:"Last 7d"},{label:"30d",display:"Last 30d"}],R=M=>{if(M==null||typeof M=="string"&&M.trim()==="")return"—";const T=Number(M);return isFinite(T)?T.toLocaleString(void 0,{maximumFractionDigits:T>=1e3?0:2}):String(M)},F=_.map(M=>{var q;const T=(q=n==null?void 0:n.periods)==null?void 0:q.find(V=>V.label===M.label);return{display:M.display,publishes:T?String(T.publishCount):"—",trac:T?R(T.totalTrac):"—"}});a!=null&&a.symbol;const U=(a==null?void 0:a.balances)??[],D=M=>M.length>12?`${M.slice(0,6)}…${M.slice(-4)}`:M;return m.jsxs("div",{className:"v10-dashboard",children:[m.jsxs("div",{className:"v10-dash-header",children:[m.jsx("h1",{className:"v10-dash-title",children:"Dashboard"}),m.jsxs("p",{className:"v10-dash-subtitle",children:[(e==null?void 0:e.name)||"DKG Node"," · ",(e==null?void 0:e.networkName)||"network",(a==null?void 0:a.chainId)!=null?` · ${ep(a.chainId).name}`:""]})]}),m.jsxs("div",{className:"v10-dash-stats v10-dash-stats-3",children:[m.jsx(np,{label:"My Context Graphs",className:"v10-stat-tight",icon:m.jsx(P0,{size:13,"aria-hidden":!0}),value:g?m.jsx("span",{className:"v10-stat-loading",children:"loading…"}):d.length,accentColor:"var(--accent-blue)",sub:r3,children:C.hasCgs&&!g?m.jsx(o3,{curator:E.curator,joined:E.joined,refreshing:f}):null}),m.jsxs(np,{label:"Context Graph Size",icon:m.jsx(TN,{size:13,"aria-hidden":!0}),className:"v10-stat-tight",accentColor:"var(--accent-green)",children:[C.hasCgs?C.sizeLoading?m.jsx("div",{className:"v10-stat-loading",children:"loading…"}):m.jsxs("div",{className:"v10-cg-size-detail",children:[m.jsxs("div",{className:"v10-cg-size-metric",children:[m.jsxs("div",{className:"v10-cg-size-num",children:[m.jsx("span",{className:"v10-cg-size-big",children:j.entityValue}),m.jsx("span",{className:"v10-cg-dim",title:j.entityTitle,children:j.entityLabel})]}),j.showLayerBars?m.jsx(f1,{counts:C.entities}):null]}),m.jsxs("div",{className:"v10-cg-size-metric",children:[m.jsxs("div",{className:"v10-cg-size-num",children:[m.jsx("span",{className:"v10-cg-size-big",children:j.tripleValue}),m.jsx("span",{className:"v10-cg-dim",children:j.tripleLabel})]}),j.showLayerBars?m.jsx(f1,{counts:C.triples}):null]}),m.jsx(l3,{})]}):m.jsx("div",{className:"v10-stat-empty",children:"—"}),m.jsx("div",{className:"stat-sub",children:C.hasCgs?C.sizePartial?"Partial preview — some memory layers are capped or unavailable. Context graphs may contain more entities; triple totals may increase or decrease as layers load.":"Totals across all your context graphs, summed over Working, Shared Working & Verifiable Memory. Knowledge Assets are entities that have been published to Verifiable Memory.":"No context graphs yet."})]}),m.jsx(np,{label:"Collaborating Agents",icon:m.jsx(ON,{size:13,"aria-hidden":!0}),value:C.hasCgs?C.agentsLoading?m.jsx("span",{className:"v10-stat-loading",children:"loading…"}):C.agentsPartial?`~${C.agentCount}`:C.agentCount:m.jsx("span",{className:"v10-stat-empty",children:"—"}),sub:C.hasCgs?C.agentsPartial?"Some context graphs could not report agents; count is partial.":"Unique agents — your own and others' — allow-listed and collaborating across your context graphs.":"No context graphs yet.",accentColor:"var(--purple)"})]}),m.jsxs("div",{className:"v10-dash-grid v10-dash-grid-2",children:[m.jsxs("div",{className:"v10-dash-section v10-dash-section-wide v10-anim-mount",children:[m.jsxs("div",{className:"v10-dash-section-header",children:[m.jsxs("div",{className:"v10-dash-section-title",children:[m.jsx(P0,{size:13,"aria-hidden":!0}),m.jsx("h3",{children:"My Context Graphs"})]}),m.jsx("span",{className:"v10-dash-section-badge",children:d.length})]}),g?m.jsx("p",{className:"v10-cg-empty",children:"Loading context graphs…"}):d.length===0?m.jsx("p",{className:"v10-cg-empty",children:"No context graphs yet — create or join one from the sidebar."}):m.jsxs(m.Fragment,{children:[m.jsxs("div",{className:"v10-cg-colhead",children:[m.jsx("span",{className:"v10-cg-cell v10-cg-name",children:"Name"}),m.jsx("span",{className:"v10-cg-cell v10-cg-type",children:"Type"}),m.jsx("span",{className:"v10-cg-cell v10-cg-size",children:"Size"}),m.jsx("span",{className:"v10-cg-cell v10-cg-agents",title:"Agents allow-listed with access to this context graph",children:"Agents"}),m.jsx("span",{className:"v10-cg-cell v10-cg-role",children:"Role"})]}),m.jsx("div",{className:"v10-cg-list",children:d.map(M=>m.jsx(s3,{cg:M,identity:p,onReport:k,onOpen:T=>{u(T.id),s({id:`project:${T.id}`,label:T.name||T.id.slice(0,12),closable:!0})}},M.id))})]})]}),m.jsxs("div",{className:"v10-dash-section v10-anim-mount",children:[m.jsx("div",{className:"v10-dash-section-header",children:m.jsxs("div",{className:"v10-dash-section-title",children:[m.jsx(MN,{size:13,"aria-hidden":!0}),m.jsx("h3",{children:"Wallets and Spending"})]})}),(a==null?void 0:a.chainId)!=null?m.jsxs("div",{className:"v10-ws-chain-row",children:[m.jsx("span",{className:"v10-ws-chain-label",children:"Chain"}),m.jsx("span",{className:"v10-ws-chain-value",children:ep(a.chainId).name})]}):null,m.jsx("div",{className:"v10-ws-subhead",children:"Node wallets"}),r&&!a?m.jsx("p",{className:"v10-cg-empty",children:"Loading wallets…"}):U.length>0?m.jsxs("div",{className:"v10-ws-wtable",children:[m.jsxs("div",{className:"v10-ws-wrow v10-ws-whead",children:[m.jsx("span",{children:"Wallet"}),m.jsx("span",{children:"TRAC"}),m.jsxs("span",{children:["Gas (",ep(a==null?void 0:a.chainId).gas,")"]})]}),U.map(M=>m.jsxs("div",{className:"v10-ws-wrow",children:[m.jsx("span",{className:"v10-ws-addr",title:M.address,children:D(M.address)}),m.jsx("span",{className:"v10-ws-bal",children:R(M.trac)}),m.jsx("span",{className:"v10-ws-bal-sec",title:t3(M.eth),children:e3(M.eth)})]},M.address))]}):(((W=a==null?void 0:a.wallets)==null?void 0:W.length)??0)>0?m.jsx("ul",{className:"v10-ws-wallets",children:((a==null?void 0:a.wallets)??[]).map(M=>m.jsxs("li",{className:"v10-ws-wallet",children:[m.jsx("span",{className:"v10-ws-addr",title:M,children:D(M)}),m.jsx("span",{className:"v10-cg-dim",children:"—"})]},M))}):a!=null&&a.error||o?m.jsx("p",{className:"v10-cg-empty",children:"Wallet balances unavailable."}):m.jsx("p",{className:"v10-cg-empty",children:"No node wallets found."}),(a!=null&&a.error||o)&&(U.length>0||(((Q=a==null?void 0:a.wallets)==null?void 0:Q.length)??0)>0)?m.jsx("p",{className:"v10-ws-note",children:"Balances may be stale — the chain/RPC reported an error."}):null,m.jsx("div",{className:"v10-ws-subhead",children:"Spending"}),m.jsxs("div",{className:"v10-ws-spend",children:[m.jsxs("div",{className:"v10-ws-spend-head",children:[m.jsx("span",{children:"Period"}),m.jsx("span",{title:"Publishes to Verifiable Memory that spent TRAC on-chain. Free SWM/local/testnet publishes are not counted (they don't burn TRAC).",children:"Publishes to VM"}),m.jsx("span",{children:"TRAC"})]}),F.map(M=>m.jsxs("div",{className:"v10-ws-spend-row",children:[m.jsx("span",{className:"v10-cg-dim",children:M.display}),m.jsx("span",{className:"v10-ws-spend-val",children:M.publishes}),m.jsx("span",{className:"v10-ws-spend-val",children:M.trac})]},M.display))]}),m.jsx(a3,{})]})]})]})}const Hh="context-graph-primer",u3={id:Hh,label:"What is a Context Graph?",closable:!0},d3=[{title:"Memory layers",body:"Working Memory is private staging, Shared Working Memory is the collaborative review layer, and Verifiable Memory is the published on-chain layer. Counts show where entities live now."},{title:"Subgraphs",body:"Subgraphs organize the same Context Graph by topic or source. They cut across memory layers, so a subgraph can contain Working, Shared Working, and Verifiable Memory at the same time."},{title:"Entities and Knowledge Assets",body:"Working Memory and Shared Working Memory contain entities. When published, an assertion/triple bundle is anchored as a Knowledge Asset in Verifiable Memory, giving included entities on-chain provenance."},{title:"Assertions",body:"Assertions are batches of triples that explain how entities entered or moved through the Context Graph. They are useful for reviewing provenance and lifecycle state."},{title:"Roles",body:"A curator controls access and publication policy. A participant can collaborate inside the Context Graph according to that policy."}];function f3(){const e=gn(a=>a.closeTab),n=mn.useCallback(()=>e(Hh),[e]);return mn.useEffect(()=>{const a=r=>{r.key==="Escape"&&(r.preventDefault(),n())};return window.addEventListener("keydown",a),()=>window.removeEventListener("keydown",a)},[n]),m.jsxs("div",{className:"v10-primer-view",children:[m.jsxs("header",{className:"v10-primer-header",children:[m.jsx("button",{type:"button",className:"v10-primer-back",onClick:n,"aria-label":"Close primer and return to the previous tab",children:"← Back"}),m.jsx("p",{className:"v10-primer-kicker",children:"Context Graph Primer"}),m.jsx("h1",{children:"What is a Context Graph?"}),m.jsx("p",{children:"A Context Graph is a shared knowledge workspace where agents stage, review, organize, and publish structured memory."})]}),m.jsxs("section",{className:"v10-primer-pipeline","aria-label":"Context Graph pipeline",children:[m.jsx("span",{className:"wm",children:"Working Memory"}),m.jsx("span",{className:"connector","aria-hidden":"true"}),m.jsx("span",{className:"swm",children:"Shared Working Memory"}),m.jsx("span",{className:"connector","aria-hidden":"true"}),m.jsx("span",{className:"vm",children:"Verifiable Memory"})]}),m.jsx("div",{className:"v10-primer-sections",children:d3.map(a=>m.jsxs("section",{className:"v10-primer-section",children:[m.jsx("h2",{children:a.title}),m.jsx("p",{children:a.body})]},a.title))})]})}const $h="doc:";function D9(e,n,a){return`${$h}${e}|${n}|${a}`}function M9(e,n,a){return e?{ref:e,contentType:"text/markdown"}:n?{ref:n,contentType:a}:{ref:void 0,contentType:a}}function p3(e){const n=e.slice($h.length),a=n.indexOf("|"),r=n.lastIndexOf("|");return a<0?{docRef:n,contentType:""}:{docRef:n.slice(a+1,r),contentType:n.slice(r+1)}}function h3(e,n){const a=n||{};return(e[e.length-1]===""?[...e,""]:e).join((a.padRight?" ":"")+","+(a.padLeft===!1?"":" ")).trim()}const m3=/^[$_\p{ID_Start}][$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,g3=/^[$_\p{ID_Start}][-$_\u{200C}\u{200D}\p{ID_Continue}]*$/u,y3={};function h1(e,n){return(y3.jsx?g3:m3).test(e)}const v3=/[ \t\n\f\r]/g;function x3(e){return typeof e=="object"?e.type==="text"?m1(e.value):!1:m1(e)}function m1(e){return e.replace(v3,"")===""}class qo{constructor(n,a,r){this.normal=a,this.property=n,r&&(this.space=r)}}qo.prototype.normal={};qo.prototype.property={};qo.prototype.space=void 0;function pw(e,n){const a={},r={};for(const o of e)Object.assign(a,o.property),Object.assign(r,o.normal);return new qo(a,r,n)}function Fp(e){return e.toLowerCase()}class Tn{constructor(n,a){this.attribute=a,this.property=n}}Tn.prototype.attribute="";Tn.prototype.booleanish=!1;Tn.prototype.boolean=!1;Tn.prototype.commaOrSpaceSeparated=!1;Tn.prototype.commaSeparated=!1;Tn.prototype.defined=!1;Tn.prototype.mustUseProperty=!1;Tn.prototype.number=!1;Tn.prototype.overloadedBoolean=!1;Tn.prototype.property="";Tn.prototype.spaceSeparated=!1;Tn.prototype.space=void 0;let b3=0;const ze=fr(),Bt=fr(),Gp=fr(),de=fr(),vt=fr(),rl=fr(),Un=fr();function fr(){return 2**++b3}const Vp=Object.freeze(Object.defineProperty({__proto__:null,boolean:ze,booleanish:Bt,commaOrSpaceSeparated:Un,commaSeparated:rl,number:de,overloadedBoolean:Gp,spaceSeparated:vt},Symbol.toStringTag,{value:"Module"})),ap=Object.keys(Vp);class qh extends Tn{constructor(n,a,r,o){let s=-1;if(super(n,a),g1(this,"space",o),typeof r=="number")for(;++s<ap.length;){const u=ap[s];g1(this,ap[s],(r&Vp[u])===Vp[u])}}}qh.prototype.defined=!0;function g1(e,n,a){a&&(e[n]=a)}function gl(e){const n={},a={};for(const[r,o]of Object.entries(e.properties)){const s=new qh(r,e.transform(e.attributes||{},r),o,e.space);e.mustUseProperty&&e.mustUseProperty.includes(r)&&(s.mustUseProperty=!0),n[r]=s,a[Fp(r)]=r,a[Fp(s.attribute)]=r}return new qo(n,a,e.space)}const hw=gl({properties:{ariaActiveDescendant:null,ariaAtomic:Bt,ariaAutoComplete:null,ariaBusy:Bt,ariaChecked:Bt,ariaColCount:de,ariaColIndex:de,ariaColSpan:de,ariaControls:vt,ariaCurrent:null,ariaDescribedBy:vt,ariaDetails:null,ariaDisabled:Bt,ariaDropEffect:vt,ariaErrorMessage:null,ariaExpanded:Bt,ariaFlowTo:vt,ariaGrabbed:Bt,ariaHasPopup:null,ariaHidden:Bt,ariaInvalid:null,ariaKeyShortcuts:null,ariaLabel:null,ariaLabelledBy:vt,ariaLevel:de,ariaLive:null,ariaModal:Bt,ariaMultiLine:Bt,ariaMultiSelectable:Bt,ariaOrientation:null,ariaOwns:vt,ariaPlaceholder:null,ariaPosInSet:de,ariaPressed:Bt,ariaReadOnly:Bt,ariaRelevant:null,ariaRequired:Bt,ariaRoleDescription:vt,ariaRowCount:de,ariaRowIndex:de,ariaRowSpan:de,ariaSelected:Bt,ariaSetSize:de,ariaSort:null,ariaValueMax:de,ariaValueMin:de,ariaValueNow:de,ariaValueText:null,role:null},transform(e,n){return n==="role"?n:"aria-"+n.slice(4).toLowerCase()}});function mw(e,n){return n in e?e[n]:n}function gw(e,n){return mw(e,n.toLowerCase())}const w3=gl({attributes:{acceptcharset:"accept-charset",classname:"class",htmlfor:"for",httpequiv:"http-equiv"},mustUseProperty:["checked","multiple","muted","selected"],properties:{abbr:null,accept:rl,acceptCharset:vt,accessKey:vt,action:null,allow:null,allowFullScreen:ze,allowPaymentRequest:ze,allowUserMedia:ze,alt:null,as:null,async:ze,autoCapitalize:null,autoComplete:vt,autoFocus:ze,autoPlay:ze,blocking:vt,capture:null,charSet:null,checked:ze,cite:null,className:vt,cols:de,colSpan:null,content:null,contentEditable:Bt,controls:ze,controlsList:vt,coords:de|rl,crossOrigin:null,data:null,dateTime:null,decoding:null,default:ze,defer:ze,dir:null,dirName:null,disabled:ze,download:Gp,draggable:Bt,encType:null,enterKeyHint:null,fetchPriority:null,form:null,formAction:null,formEncType:null,formMethod:null,formNoValidate:ze,formTarget:null,headers:vt,height:de,hidden:Gp,high:de,href:null,hrefLang:null,htmlFor:vt,httpEquiv:vt,id:null,imageSizes:null,imageSrcSet:null,inert:ze,inputMode:null,integrity:null,is:null,isMap:ze,itemId:null,itemProp:vt,itemRef:vt,itemScope:ze,itemType:vt,kind:null,label:null,lang:null,language:null,list:null,loading:null,loop:ze,low:de,manifest:null,max:null,maxLength:de,media:null,method:null,min:null,minLength:de,multiple:ze,muted:ze,name:null,nonce:null,noModule:ze,noValidate:ze,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:ze,optimum:de,pattern:null,ping:vt,placeholder:null,playsInline:ze,popover:null,popoverTarget:null,popoverTargetAction:null,poster:null,preload:null,readOnly:ze,referrerPolicy:null,rel:vt,required:ze,reversed:ze,rows:de,rowSpan:de,sandbox:vt,scope:null,scoped:ze,seamless:ze,selected:ze,shadowRootClonable:ze,shadowRootDelegatesFocus:ze,shadowRootMode:null,shape:null,size:de,sizes:null,slot:null,span:de,spellCheck:Bt,src:null,srcDoc:null,srcLang:null,srcSet:null,start:de,step:null,style:null,tabIndex:de,target:null,title:null,translate:null,type:null,typeMustMatch:ze,useMap:null,value:Bt,width:de,wrap:null,writingSuggestions:null,align:null,aLink:null,archive:vt,axis:null,background:null,bgColor:null,border:de,borderColor:null,bottomMargin:de,cellPadding:null,cellSpacing:null,char:null,charOff:null,classId:null,clear:null,code:null,codeBase:null,codeType:null,color:null,compact:ze,declare:ze,event:null,face:null,frame:null,frameBorder:null,hSpace:de,leftMargin:de,link:null,longDesc:null,lowSrc:null,marginHeight:de,marginWidth:de,noResize:ze,noHref:ze,noShade:ze,noWrap:ze,object:null,profile:null,prompt:null,rev:null,rightMargin:de,rules:null,scheme:null,scrolling:Bt,standby:null,summary:null,text:null,topMargin:de,valueType:null,version:null,vAlign:null,vLink:null,vSpace:de,allowTransparency:null,autoCorrect:null,autoSave:null,disablePictureInPicture:ze,disableRemotePlayback:ze,prefix:null,property:null,results:de,security:null,unselectable:null},space:"html",transform:gw}),S3=gl({attributes:{accentHeight:"accent-height",alignmentBaseline:"alignment-baseline",arabicForm:"arabic-form",baselineShift:"baseline-shift",capHeight:"cap-height",className:"class",clipPath:"clip-path",clipRule:"clip-rule",colorInterpolation:"color-interpolation",colorInterpolationFilters:"color-interpolation-filters",colorProfile:"color-profile",colorRendering:"color-rendering",crossOrigin:"crossorigin",dataType:"datatype",dominantBaseline:"dominant-baseline",enableBackground:"enable-background",fillOpacity:"fill-opacity",fillRule:"fill-rule",floodColor:"flood-color",floodOpacity:"flood-opacity",fontFamily:"font-family",fontSize:"font-size",fontSizeAdjust:"font-size-adjust",fontStretch:"font-stretch",fontStyle:"font-style",fontVariant:"font-variant",fontWeight:"font-weight",glyphName:"glyph-name",glyphOrientationHorizontal:"glyph-orientation-horizontal",glyphOrientationVertical:"glyph-orientation-vertical",hrefLang:"hreflang",horizAdvX:"horiz-adv-x",horizOriginX:"horiz-origin-x",horizOriginY:"horiz-origin-y",imageRendering:"image-rendering",letterSpacing:"letter-spacing",lightingColor:"lighting-color",markerEnd:"marker-end",markerMid:"marker-mid",markerStart:"marker-start",navDown:"nav-down",navDownLeft:"nav-down-left",navDownRight:"nav-down-right",navLeft:"nav-left",navNext:"nav-next",navPrev:"nav-prev",navRight:"nav-right",navUp:"nav-up",navUpLeft:"nav-up-left",navUpRight:"nav-up-right",onAbort:"onabort",onActivate:"onactivate",onAfterPrint:"onafterprint",onBeforePrint:"onbeforeprint",onBegin:"onbegin",onCancel:"oncancel",onCanPlay:"oncanplay",onCanPlayThrough:"oncanplaythrough",onChange:"onchange",onClick:"onclick",onClose:"onclose",onCopy:"oncopy",onCueChange:"oncuechange",onCut:"oncut",onDblClick:"ondblclick",onDrag:"ondrag",onDragEnd:"ondragend",onDragEnter:"ondragenter",onDragExit:"ondragexit",onDragLeave:"ondragleave",onDragOver:"ondragover",onDragStart:"ondragstart",onDrop:"ondrop",onDurationChange:"ondurationchange",onEmptied:"onemptied",onEnd:"onend",onEnded:"onended",onError:"onerror",onFocus:"onfocus",onFocusIn:"onfocusin",onFocusOut:"onfocusout",onHashChange:"onhashchange",onInput:"oninput",onInvalid:"oninvalid",onKeyDown:"onkeydown",onKeyPress:"onkeypress",onKeyUp:"onkeyup",onLoad:"onload",onLoadedData:"onloadeddata",onLoadedMetadata:"onloadedmetadata",onLoadStart:"onloadstart",onMessage:"onmessage",onMouseDown:"onmousedown",onMouseEnter:"onmouseenter",onMouseLeave:"onmouseleave",onMouseMove:"onmousemove",onMouseOut:"onmouseout",onMouseOver:"onmouseover",onMouseUp:"onmouseup",onMouseWheel:"onmousewheel",onOffline:"onoffline",onOnline:"ononline",onPageHide:"onpagehide",onPageShow:"onpageshow",onPaste:"onpaste",onPause:"onpause",onPlay:"onplay",onPlaying:"onplaying",onPopState:"onpopstate",onProgress:"onprogress",onRateChange:"onratechange",onRepeat:"onrepeat",onReset:"onreset",onResize:"onresize",onScroll:"onscroll",onSeeked:"onseeked",onSeeking:"onseeking",onSelect:"onselect",onShow:"onshow",onStalled:"onstalled",onStorage:"onstorage",onSubmit:"onsubmit",onSuspend:"onsuspend",onTimeUpdate:"ontimeupdate",onToggle:"ontoggle",onUnload:"onunload",onVolumeChange:"onvolumechange",onWaiting:"onwaiting",onZoom:"onzoom",overlinePosition:"overline-position",overlineThickness:"overline-thickness",paintOrder:"paint-order",panose1:"panose-1",pointerEvents:"pointer-events",referrerPolicy:"referrerpolicy",renderingIntent:"rendering-intent",shapeRendering:"shape-rendering",stopColor:"stop-color",stopOpacity:"stop-opacity",strikethroughPosition:"strikethrough-position",strikethroughThickness:"strikethrough-thickness",strokeDashArray:"stroke-dasharray",strokeDashOffset:"stroke-dashoffset",strokeLineCap:"stroke-linecap",strokeLineJoin:"stroke-linejoin",strokeMiterLimit:"stroke-miterlimit",strokeOpacity:"stroke-opacity",strokeWidth:"stroke-width",tabIndex:"tabindex",textAnchor:"text-anchor",textDecoration:"text-decoration",textRendering:"text-rendering",transformOrigin:"transform-origin",typeOf:"typeof",underlinePosition:"underline-position",underlineThickness:"underline-thickness",unicodeBidi:"unicode-bidi",unicodeRange:"unicode-range",unitsPerEm:"units-per-em",vAlphabetic:"v-alphabetic",vHanging:"v-hanging",vIdeographic:"v-ideographic",vMathematical:"v-mathematical",vectorEffect:"vector-effect",vertAdvY:"vert-adv-y",vertOriginX:"vert-origin-x",vertOriginY:"vert-origin-y",wordSpacing:"word-spacing",writingMode:"writing-mode",xHeight:"x-height",playbackOrder:"playbackorder",timelineBegin:"timelinebegin"},properties:{about:Un,accentHeight:de,accumulate:null,additive:null,alignmentBaseline:null,alphabetic:de,amplitude:de,arabicForm:null,ascent:de,attributeName:null,attributeType:null,azimuth:de,bandwidth:null,baselineShift:null,baseFrequency:null,baseProfile:null,bbox:null,begin:null,bias:de,by:null,calcMode:null,capHeight:de,className:vt,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:de,diffuseConstant:de,direction:null,display:null,dur:null,divisor:de,dominantBaseline:null,download:ze,dx:null,dy:null,edgeMode:null,editable:null,elevation:de,enableBackground:null,end:null,event:null,exponent:de,externalResourcesRequired:null,fill:null,fillOpacity:de,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:rl,g2:rl,glyphName:rl,glyphOrientationHorizontal:null,glyphOrientationVertical:null,glyphRef:null,gradientTransform:null,gradientUnits:null,handler:null,hanging:de,hatchContentUnits:null,hatchUnits:null,height:null,href:null,hrefLang:null,horizAdvX:de,horizOriginX:de,horizOriginY:de,id:null,ideographic:de,imageRendering:null,initialVisibility:null,in:null,in2:null,intercept:de,k:de,k1:de,k2:de,k3:de,k4:de,kernelMatrix:Un,kernelUnitLength:null,keyPoints:null,keySplines:null,keyTimes:null,kerning:null,lang:null,lengthAdjust:null,letterSpacing:null,lightingColor:null,limitingConeAngle:de,local:null,markerEnd:null,markerMid:null,markerStart:null,markerHeight:null,markerUnits:null,markerWidth:null,mask:null,maskContentUnits:null,maskUnits:null,mathematical:null,max:null,media:null,mediaCharacterEncoding:null,mediaContentEncodings:null,mediaSize:de,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:de,overlineThickness:de,paintOrder:null,panose1:null,path:null,pathLength:de,patternContentUnits:null,patternTransform:null,patternUnits:null,phase:null,ping:vt,pitch:null,playbackOrder:null,pointerEvents:null,points:null,pointsAtX:de,pointsAtY:de,pointsAtZ:de,preserveAlpha:null,preserveAspectRatio:null,primitiveUnits:null,propagate:null,property:Un,r:null,radius:null,referrerPolicy:null,refX:null,refY:null,rel:Un,rev:Un,renderingIntent:null,repeatCount:null,repeatDur:null,requiredExtensions:Un,requiredFeatures:Un,requiredFonts:Un,requiredFormats:Un,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:de,specularExponent:de,spreadMethod:null,spacing:null,startOffset:null,stdDeviation:null,stemh:null,stemv:null,stitchTiles:null,stopColor:null,stopOpacity:null,strikethroughPosition:de,strikethroughThickness:de,string:null,stroke:null,strokeDashArray:Un,strokeDashOffset:null,strokeLineCap:null,strokeLineJoin:null,strokeMiterLimit:de,strokeOpacity:de,strokeWidth:null,style:null,surfaceScale:de,syncBehavior:null,syncBehaviorDefault:null,syncMaster:null,syncTolerance:null,syncToleranceDefault:null,systemLanguage:Un,tabIndex:de,tableValues:null,target:null,targetX:de,targetY:de,textAnchor:null,textDecoration:null,textRendering:null,textLength:null,timelineBegin:null,title:null,transformBehavior:null,type:null,typeOf:Un,to:null,transform:null,transformOrigin:null,u1:null,u2:null,underlinePosition:de,underlineThickness:de,unicode:null,unicodeBidi:null,unicodeRange:null,unitsPerEm:de,values:null,vAlphabetic:de,vMathematical:de,vectorEffect:null,vHanging:de,vIdeographic:de,version:null,vertAdvY:de,vertOriginX:de,vertOriginY:de,viewBox:null,viewTarget:null,visibility:null,width:null,widths:null,wordSpacing:null,writingMode:null,x:null,x1:null,x2:null,xChannelSelector:null,xHeight:de,y:null,y1:null,y2:null,yChannelSelector:null,z:null,zoomAndPan:null},space:"svg",transform:mw}),yw=gl({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()}}),vw=gl({attributes:{xmlnsxlink:"xmlns:xlink"},properties:{xmlnsXLink:null,xmlns:null},space:"xmlns",transform:gw}),xw=gl({properties:{xmlBase:null,xmlLang:null,xmlSpace:null},space:"xml",transform(e,n){return"xml:"+n.slice(3).toLowerCase()}}),k3={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"},C3=/[A-Z]/g,y1=/-[a-z]/g,E3=/^data[-\w.:]+$/i;function A3(e,n){const a=Fp(n);let r=n,o=Tn;if(a in e.normal)return e.property[e.normal[a]];if(a.length>4&&a.slice(0,4)==="data"&&E3.test(n)){if(n.charAt(4)==="-"){const s=n.slice(5).replace(y1,T3);r="data"+s.charAt(0).toUpperCase()+s.slice(1)}else{const s=n.slice(4);if(!y1.test(s)){let u=s.replace(C3,j3);u.charAt(0)!=="-"&&(u="-"+u),n="data"+u}}o=qh}return new o(r,n)}function j3(e){return"-"+e.toLowerCase()}function T3(e){return e.charAt(1).toUpperCase()}const N3=pw([hw,w3,yw,vw,xw],"html"),Fh=pw([hw,S3,yw,vw,xw],"svg");function R3(e){return e.join(" ").trim()}var Jr={},ip,v1;function _3(){if(v1)return ip;v1=1;var e=/\/\*[^*]*\*+([^/*][^*]*\*+)*\//g,n=/\n/g,a=/^\s*/,r=/^(\*?[-#/*\\\w]+(\[[0-9a-z_-]+\])?)\s*/,o=/^:\s*/,s=/^((?:'(?:\\'|.)*?'|"(?:\\"|.)*?"|\([^)]*?\)|[^};])+)/,u=/^[;\s]*/,d=/^\s+|\s+$/g,p=`
|
|
1139
|
+
`,f="/",y="*",g="",x="comment",b="declaration";function k(j,E){if(typeof j!="string")throw new TypeError("First argument must be a string");if(!j)return[];E=E||{};var _=1,R=1;function F(P){var K=P.match(n);K&&(_+=K.length);var B=P.lastIndexOf(p);R=~B?P.length-B:R+P.length}function U(){var P={line:_,column:R};return function(K){return K.position=new D(P),M(),K}}function D(P){this.start=P,this.end={line:_,column:R},this.source=E.source}D.prototype.content=j;function W(P){var K=new Error(E.source+":"+_+":"+R+": "+P);if(K.reason=P,K.filename=E.source,K.line=_,K.column=R,K.source=j,!E.silent)throw K}function Q(P){var K=P.exec(j);if(K){var B=K[0];return F(B),j=j.slice(B.length),K}}function M(){Q(a)}function T(P){var K;for(P=P||[];K=q();)K!==!1&&P.push(K);return P}function q(){var P=U();if(!(f!=j.charAt(0)||y!=j.charAt(1))){for(var K=2;g!=j.charAt(K)&&(y!=j.charAt(K)||f!=j.charAt(K+1));)++K;if(K+=2,g===j.charAt(K-1))return W("End of comment missing");var B=j.slice(2,K-2);return R+=2,F(B),j=j.slice(K),R+=2,P({type:x,comment:B})}}function V(){var P=U(),K=Q(r);if(K){if(q(),!Q(o))return W("property missing ':'");var B=Q(s),Z=P({type:b,property:C(K[0].replace(e,g)),value:B?C(B[0].replace(e,g)):g});return Q(u),Z}}function ae(){var P=[];T(P);for(var K;K=V();)K!==!1&&(P.push(K),T(P));return P}return M(),ae()}function C(j){return j?j.replace(d,g):g}return ip=k,ip}var x1;function O3(){if(x1)return Jr;x1=1;var e=Jr&&Jr.__importDefault||function(r){return r&&r.__esModule?r:{default:r}};Object.defineProperty(Jr,"__esModule",{value:!0}),Jr.default=a;const n=e(_3());function a(r,o){let s=null;if(!r||typeof r!="string")return s;const u=(0,n.default)(r),d=typeof o=="function";return u.forEach(p=>{if(p.type!=="declaration")return;const{property:f,value:y}=p;d?o(f,y,p):y&&(s=s||{},s[f]=y)}),s}return Jr}var go={},b1;function D3(){if(b1)return go;b1=1,Object.defineProperty(go,"__esModule",{value:!0}),go.camelCase=void 0;var e=/^--[a-zA-Z0-9_-]+$/,n=/-([a-z])/g,a=/^[^-]+$/,r=/^-(webkit|moz|ms|o|khtml)-/,o=/^-(ms)-/,s=function(f){return!f||a.test(f)||e.test(f)},u=function(f,y){return y.toUpperCase()},d=function(f,y){return"".concat(y,"-")},p=function(f,y){return y===void 0&&(y={}),s(f)?f:(f=f.toLowerCase(),y.reactCompat?f=f.replace(o,d):f=f.replace(r,d),f.replace(n,u))};return go.camelCase=p,go}var yo,w1;function M3(){if(w1)return yo;w1=1;var e=yo&&yo.__importDefault||function(o){return o&&o.__esModule?o:{default:o}},n=e(O3()),a=D3();function r(o,s){var u={};return!o||typeof o!="string"||(0,n.default)(o,function(d,p){d&&p&&(u[(0,a.camelCase)(d,s)]=p)}),u}return r.default=r,yo=r,yo}var L3=M3();const z3=Po(L3),bw=ww("end"),Gh=ww("start");function ww(e){return n;function n(a){const r=a&&a.position&&a.position[e]||{};if(typeof r.line=="number"&&r.line>0&&typeof r.column=="number"&&r.column>0)return{line:r.line,column:r.column,offset:typeof r.offset=="number"&&r.offset>-1?r.offset:void 0}}}function I3(e){const n=Gh(e),a=bw(e);if(n&&a)return{start:n,end:a}}function jo(e){return!e||typeof e!="object"?"":"position"in e||"type"in e?S1(e.position):"start"in e||"end"in e?S1(e):"line"in e||"column"in e?Wp(e):""}function Wp(e){return k1(e&&e.line)+":"+k1(e&&e.column)}function S1(e){return Wp(e&&e.start)+"-"+Wp(e&&e.end)}function k1(e){return e&&typeof e=="number"?e:1}class sn extends Error{constructor(n,a,r){super(),typeof a=="string"&&(r=a,a=void 0);let o="",s={},u=!1;if(a&&("line"in a&&"column"in a?s={place:a}:"start"in a&&"end"in a?s={place:a}:"type"in a?s={ancestors:[a],place:a.position}:s={...a}),typeof n=="string"?o=n:!s.cause&&n&&(u=!0,o=n.message,s.cause=n),!s.ruleId&&!s.source&&typeof r=="string"){const p=r.indexOf(":");p===-1?s.ruleId=r:(s.source=r.slice(0,p),s.ruleId=r.slice(p+1))}if(!s.place&&s.ancestors&&s.ancestors){const p=s.ancestors[s.ancestors.length-1];p&&(s.place=p.position)}const d=s.place&&"start"in s.place?s.place.start:s.place;this.ancestors=s.ancestors||void 0,this.cause=s.cause||void 0,this.column=d?d.column:void 0,this.fatal=void 0,this.file="",this.message=o,this.line=d?d.line:void 0,this.name=jo(s.place)||"1:1",this.place=s.place||void 0,this.reason=this.message,this.ruleId=s.ruleId||void 0,this.source=s.source||void 0,this.stack=u&&s.cause&&typeof s.cause.stack=="string"?s.cause.stack:"",this.actual=void 0,this.expected=void 0,this.note=void 0,this.url=void 0}}sn.prototype.file="";sn.prototype.name="";sn.prototype.reason="";sn.prototype.message="";sn.prototype.stack="";sn.prototype.column=void 0;sn.prototype.line=void 0;sn.prototype.ancestors=void 0;sn.prototype.cause=void 0;sn.prototype.fatal=void 0;sn.prototype.place=void 0;sn.prototype.ruleId=void 0;sn.prototype.source=void 0;const Vh={}.hasOwnProperty,P3=new Map,U3=/[A-Z]/g,B3=new Set(["table","tbody","thead","tfoot","tr"]),H3=new Set(["td","th"]),Sw="https://github.com/syntax-tree/hast-util-to-jsx-runtime";function $3(e,n){if(!n||n.Fragment===void 0)throw new TypeError("Expected `Fragment` in options");const a=n.filePath||void 0;let r;if(n.development){if(typeof n.jsxDEV!="function")throw new TypeError("Expected `jsxDEV` in options when `development: true`");r=Q3(a,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");r=K3(a,n.jsx,n.jsxs)}const o={Fragment:n.Fragment,ancestors:[],components:n.components||{},create:r,elementAttributeNameCase:n.elementAttributeNameCase||"react",evaluater:n.createEvaluater?n.createEvaluater():void 0,filePath:a,ignoreInvalidStyle:n.ignoreInvalidStyle||!1,passKeys:n.passKeys!==!1,passNode:n.passNode||!1,schema:n.space==="svg"?Fh:N3,stylePropertyNameCase:n.stylePropertyNameCase||"dom",tableCellAlignToStyle:n.tableCellAlignToStyle!==!1},s=kw(o,e,void 0);return s&&typeof s!="string"?s:o.create(e,o.Fragment,{children:s||void 0},void 0)}function kw(e,n,a){if(n.type==="element")return q3(e,n,a);if(n.type==="mdxFlowExpression"||n.type==="mdxTextExpression")return F3(e,n);if(n.type==="mdxJsxFlowElement"||n.type==="mdxJsxTextElement")return V3(e,n,a);if(n.type==="mdxjsEsm")return G3(e,n);if(n.type==="root")return W3(e,n,a);if(n.type==="text")return Y3(e,n)}function q3(e,n,a){const r=e.schema;let o=r;n.tagName.toLowerCase()==="svg"&&r.space==="html"&&(o=Fh,e.schema=o),e.ancestors.push(n);const s=Ew(e,n.tagName,!1),u=X3(e,n);let d=Yh(e,n);return B3.has(n.tagName)&&(d=d.filter(function(p){return typeof p=="string"?!x3(p):!0})),Cw(e,u,s,n),Wh(u,d),e.ancestors.pop(),e.schema=r,e.create(n,s,u,a)}function F3(e,n){if(n.data&&n.data.estree&&e.evaluater){const r=n.data.estree.body[0];return r.type,e.evaluater.evaluateExpression(r.expression)}Lo(e,n.position)}function G3(e,n){if(n.data&&n.data.estree&&e.evaluater)return e.evaluater.evaluateProgram(n.data.estree);Lo(e,n.position)}function V3(e,n,a){const r=e.schema;let o=r;n.name==="svg"&&r.space==="html"&&(o=Fh,e.schema=o),e.ancestors.push(n);const s=n.name===null?e.Fragment:Ew(e,n.name,!0),u=Z3(e,n),d=Yh(e,n);return Cw(e,u,s,n),Wh(u,d),e.ancestors.pop(),e.schema=r,e.create(n,s,u,a)}function W3(e,n,a){const r={};return Wh(r,Yh(e,n)),e.create(n,e.Fragment,r,a)}function Y3(e,n){return n.value}function Cw(e,n,a,r){typeof a!="string"&&a!==e.Fragment&&e.passNode&&(n.node=r)}function Wh(e,n){if(n.length>0){const a=n.length>1?n:n[0];a&&(e.children=a)}}function K3(e,n,a){return r;function r(o,s,u,d){const f=Array.isArray(u.children)?a:n;return d?f(s,u,d):f(s,u)}}function Q3(e,n){return a;function a(r,o,s,u){const d=Array.isArray(s.children),p=Gh(r);return n(o,s,u,d,{columnNumber:p?p.column-1:void 0,fileName:e,lineNumber:p?p.line:void 0},void 0)}}function X3(e,n){const a={};let r,o;for(o in n.properties)if(o!=="children"&&Vh.call(n.properties,o)){const s=J3(e,o,n.properties[o]);if(s){const[u,d]=s;e.tableCellAlignToStyle&&u==="align"&&typeof d=="string"&&H3.has(n.tagName)?r=d:a[u]=d}}if(r){const s=a.style||(a.style={});s[e.stylePropertyNameCase==="css"?"text-align":"textAlign"]=r}return a}function Z3(e,n){const a={};for(const r of n.attributes)if(r.type==="mdxJsxExpressionAttribute")if(r.data&&r.data.estree&&e.evaluater){const s=r.data.estree.body[0];s.type;const u=s.expression;u.type;const d=u.properties[0];d.type,Object.assign(a,e.evaluater.evaluateExpression(d.argument))}else Lo(e,n.position);else{const o=r.name;let s;if(r.value&&typeof r.value=="object")if(r.value.data&&r.value.data.estree&&e.evaluater){const d=r.value.data.estree.body[0];d.type,s=e.evaluater.evaluateExpression(d.expression)}else Lo(e,n.position);else s=r.value===null?!0:r.value;a[o]=s}return a}function Yh(e,n){const a=[];let r=-1;const o=e.passKeys?new Map:P3;for(;++r<n.children.length;){const s=n.children[r];let u;if(e.passKeys){const p=s.type==="element"?s.tagName:s.type==="mdxJsxFlowElement"||s.type==="mdxJsxTextElement"?s.name:void 0;if(p){const f=o.get(p)||0;u=p+"-"+f,o.set(p,f+1)}}const d=kw(e,s,u);d!==void 0&&a.push(d)}return a}function J3(e,n,a){const r=A3(e.schema,n);if(!(a==null||typeof a=="number"&&Number.isNaN(a))){if(Array.isArray(a)&&(a=r.commaSeparated?h3(a):R3(a)),r.property==="style"){let o=typeof a=="object"?a:e_(e,String(a));return e.stylePropertyNameCase==="css"&&(o=t_(o)),["style",o]}return[e.elementAttributeNameCase==="react"&&r.space?k3[r.property]||r.property:r.attribute,a]}}function e_(e,n){try{return z3(n,{reactCompat:!0})}catch(a){if(e.ignoreInvalidStyle)return{};const r=a,o=new sn("Cannot parse `style` attribute",{ancestors:e.ancestors,cause:r,ruleId:"style",source:"hast-util-to-jsx-runtime"});throw o.file=e.filePath||void 0,o.url=Sw+"#cannot-parse-style-attribute",o}}function Ew(e,n,a){let r;if(!a)r={type:"Literal",value:n};else if(n.includes(".")){const o=n.split(".");let s=-1,u;for(;++s<o.length;){const d=h1(o[s])?{type:"Identifier",name:o[s]}:{type:"Literal",value:o[s]};u=u?{type:"MemberExpression",object:u,property:d,computed:!!(s&&d.type==="Literal"),optional:!1}:d}r=u}else r=h1(n)&&!/^[a-z]/.test(n)?{type:"Identifier",name:n}:{type:"Literal",value:n};if(r.type==="Literal"){const o=r.value;return Vh.call(e.components,o)?e.components[o]:o}if(e.evaluater)return e.evaluater.evaluateExpression(r);Lo(e)}function Lo(e,n){const a=new sn("Cannot handle MDX estrees without `createEvaluater`",{ancestors:e.ancestors,place:n,ruleId:"mdx-estree",source:"hast-util-to-jsx-runtime"});throw a.file=e.filePath||void 0,a.url=Sw+"#cannot-handle-mdx-estrees-without-createevaluater",a}function t_(e){const n={};let a;for(a in e)Vh.call(e,a)&&(n[n_(a)]=e[a]);return n}function n_(e){let n=e.replace(U3,a_);return n.slice(0,3)==="ms-"&&(n="-"+n),n}function a_(e){return"-"+e.toLowerCase()}const rp={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"]},i_={};function Kh(e,n){const a=i_,r=typeof a.includeImageAlt=="boolean"?a.includeImageAlt:!0,o=typeof a.includeHtml=="boolean"?a.includeHtml:!0;return Aw(e,r,o)}function Aw(e,n,a){if(r_(e)){if("value"in e)return e.type==="html"&&!a?"":e.value;if(n&&"alt"in e&&e.alt)return e.alt;if("children"in e)return C1(e.children,n,a)}return Array.isArray(e)?C1(e,n,a):""}function C1(e,n,a){const r=[];let o=-1;for(;++o<e.length;)r[o]=Aw(e[o],n,a);return r.join("")}function r_(e){return!!(e&&typeof e=="object")}const E1=document.createElement("i");function Qh(e){const n="&"+e+";";E1.innerHTML=n;const a=E1.textContent;return a.charCodeAt(a.length-1)===59&&e!=="semi"||a===n?!1:a}function $n(e,n,a,r){const o=e.length;let s=0,u;if(n<0?n=-n>o?0:o+n:n=n>o?o:n,a=a>0?a:0,r.length<1e4)u=Array.from(r),u.unshift(n,a),e.splice(...u);else for(a&&e.splice(n,a);s<r.length;)u=r.slice(s,s+1e4),u.unshift(n,0),e.splice(...u),s+=1e4,n+=1e4}function aa(e,n){return e.length>0?($n(e,e.length,0,n),e):n}const A1={}.hasOwnProperty;function jw(e){const n={};let a=-1;for(;++a<e.length;)l_(n,e[a]);return n}function l_(e,n){let a;for(a in n){const o=(A1.call(e,a)?e[a]:void 0)||(e[a]={}),s=n[a];let u;if(s)for(u in s){A1.call(o,u)||(o[u]=[]);const d=s[u];o_(o[u],Array.isArray(d)?d:d?[d]:[])}}}function o_(e,n){let a=-1;const r=[];for(;++a<n.length;)(n[a].add==="after"?e:r).push(n[a]);$n(e,0,0,r)}function Tw(e,n){const a=Number.parseInt(e,n);return a<9||a===11||a>13&&a<32||a>126&&a<160||a>55295&&a<57344||a>64975&&a<65008||(a&65535)===65535||(a&65535)===65534||a>1114111?"�":String.fromCodePoint(a)}function da(e){return e.replace(/[\t\n\r ]+/g," ").replace(/^ | $/g,"").toLowerCase().toUpperCase()}const hn=Li(/[A-Za-z]/),on=Li(/[\dA-Za-z]/),s_=Li(/[#-'*+\--9=?A-Z^-~]/);function Vc(e){return e!==null&&(e<32||e===127)}const Yp=Li(/\d/),c_=Li(/[\dA-Fa-f]/),u_=Li(/[!-/:-@[-`{-~]/);function Ae(e){return e!==null&&e<-2}function gt(e){return e!==null&&(e<0||e===32)}function qe(e){return e===-2||e===-1||e===32}const su=Li(new RegExp("\\p{P}|\\p{S}","u")),cr=Li(/\s/);function Li(e){return n;function n(a){return a!==null&&a>-1&&e.test(String.fromCharCode(a))}}function yl(e){const n=[];let a=-1,r=0,o=0;for(;++a<e.length;){const s=e.charCodeAt(a);let u="";if(s===37&&on(e.charCodeAt(a+1))&&on(e.charCodeAt(a+2)))o=2;else if(s<128)/[!#$&-;=?-Z_a-z~]/.test(String.fromCharCode(s))||(u=String.fromCharCode(s));else if(s>55295&&s<57344){const d=e.charCodeAt(a+1);s<56320&&d>56319&&d<57344?(u=String.fromCharCode(s,d),o=1):u="�"}else u=String.fromCharCode(s);u&&(n.push(e.slice(r,a),encodeURIComponent(u)),r=a+o+1,u=""),o&&(a+=o,o=0)}return n.join("")+e.slice(r)}function Ke(e,n,a,r){const o=r?r-1:Number.POSITIVE_INFINITY;let s=0;return u;function u(p){return qe(p)?(e.enter(a),d(p)):n(p)}function d(p){return qe(p)&&s++<o?(e.consume(p),d):(e.exit(a),n(p))}}const d_={tokenize:f_};function f_(e){const n=e.attempt(this.parser.constructs.contentInitial,r,o);let a;return n;function r(d){if(d===null){e.consume(d);return}return e.enter("lineEnding"),e.consume(d),e.exit("lineEnding"),Ke(e,n,"linePrefix")}function o(d){return e.enter("paragraph"),s(d)}function s(d){const p=e.enter("chunkText",{contentType:"text",previous:a});return a&&(a.next=p),a=p,u(d)}function u(d){if(d===null){e.exit("chunkText"),e.exit("paragraph"),e.consume(d);return}return Ae(d)?(e.consume(d),e.exit("chunkText"),s):(e.consume(d),u)}}const p_={tokenize:h_},j1={tokenize:m_};function h_(e){const n=this,a=[];let r=0,o,s,u;return d;function d(R){if(r<a.length){const F=a[r];return n.containerState=F[1],e.attempt(F[0].continuation,p,f)(R)}return f(R)}function p(R){if(r++,n.containerState._closeFlow){n.containerState._closeFlow=void 0,o&&_();const F=n.events.length;let U=F,D;for(;U--;)if(n.events[U][0]==="exit"&&n.events[U][1].type==="chunkFlow"){D=n.events[U][1].end;break}E(r);let W=F;for(;W<n.events.length;)n.events[W][1].end={...D},W++;return $n(n.events,U+1,0,n.events.slice(F)),n.events.length=W,f(R)}return d(R)}function f(R){if(r===a.length){if(!o)return x(R);if(o.currentConstruct&&o.currentConstruct.concrete)return k(R);n.interrupt=!!(o.currentConstruct&&!o._gfmTableDynamicInterruptHack)}return n.containerState={},e.check(j1,y,g)(R)}function y(R){return o&&_(),E(r),x(R)}function g(R){return n.parser.lazy[n.now().line]=r!==a.length,u=n.now().offset,k(R)}function x(R){return n.containerState={},e.attempt(j1,b,k)(R)}function b(R){return r++,a.push([n.currentConstruct,n.containerState]),x(R)}function k(R){if(R===null){o&&_(),E(0),e.consume(R);return}return o=o||n.parser.flow(n.now()),e.enter("chunkFlow",{_tokenizer:o,contentType:"flow",previous:s}),C(R)}function C(R){if(R===null){j(e.exit("chunkFlow"),!0),E(0),e.consume(R);return}return Ae(R)?(e.consume(R),j(e.exit("chunkFlow")),r=0,n.interrupt=void 0,d):(e.consume(R),C)}function j(R,F){const U=n.sliceStream(R);if(F&&U.push(null),R.previous=s,s&&(s.next=R),s=R,o.defineSkip(R.start),o.write(U),n.parser.lazy[R.start.line]){let D=o.events.length;for(;D--;)if(o.events[D][1].start.offset<u&&(!o.events[D][1].end||o.events[D][1].end.offset>u))return;const W=n.events.length;let Q=W,M,T;for(;Q--;)if(n.events[Q][0]==="exit"&&n.events[Q][1].type==="chunkFlow"){if(M){T=n.events[Q][1].end;break}M=!0}for(E(r),D=W;D<n.events.length;)n.events[D][1].end={...T},D++;$n(n.events,Q+1,0,n.events.slice(W)),n.events.length=D}}function E(R){let F=a.length;for(;F-- >R;){const U=a[F];n.containerState=U[1],U[0].exit.call(n,e)}a.length=R}function _(){o.write([null]),s=void 0,o=void 0,n.containerState._closeFlow=void 0}}function m_(e,n,a){return Ke(e,e.attempt(this.parser.constructs.document,n,a),"linePrefix",this.parser.constructs.disable.null.includes("codeIndented")?void 0:4)}function ol(e){if(e===null||gt(e)||cr(e))return 1;if(su(e))return 2}function cu(e,n,a){const r=[];let o=-1;for(;++o<e.length;){const s=e[o].resolveAll;s&&!r.includes(s)&&(n=s(n,a),r.push(s))}return n}const Kp={name:"attention",resolveAll:g_,tokenize:y_};function g_(e,n){let a=-1,r,o,s,u,d,p,f,y;for(;++a<e.length;)if(e[a][0]==="enter"&&e[a][1].type==="attentionSequence"&&e[a][1]._close){for(r=a;r--;)if(e[r][0]==="exit"&&e[r][1].type==="attentionSequence"&&e[r][1]._open&&n.sliceSerialize(e[r][1]).charCodeAt(0)===n.sliceSerialize(e[a][1]).charCodeAt(0)){if((e[r][1]._close||e[a][1]._open)&&(e[a][1].end.offset-e[a][1].start.offset)%3&&!((e[r][1].end.offset-e[r][1].start.offset+e[a][1].end.offset-e[a][1].start.offset)%3))continue;p=e[r][1].end.offset-e[r][1].start.offset>1&&e[a][1].end.offset-e[a][1].start.offset>1?2:1;const g={...e[r][1].end},x={...e[a][1].start};T1(g,-p),T1(x,p),u={type:p>1?"strongSequence":"emphasisSequence",start:g,end:{...e[r][1].end}},d={type:p>1?"strongSequence":"emphasisSequence",start:{...e[a][1].start},end:x},s={type:p>1?"strongText":"emphasisText",start:{...e[r][1].end},end:{...e[a][1].start}},o={type:p>1?"strong":"emphasis",start:{...u.start},end:{...d.end}},e[r][1].end={...u.start},e[a][1].start={...d.end},f=[],e[r][1].end.offset-e[r][1].start.offset&&(f=aa(f,[["enter",e[r][1],n],["exit",e[r][1],n]])),f=aa(f,[["enter",o,n],["enter",u,n],["exit",u,n],["enter",s,n]]),f=aa(f,cu(n.parser.constructs.insideSpan.null,e.slice(r+1,a),n)),f=aa(f,[["exit",s,n],["enter",d,n],["exit",d,n],["exit",o,n]]),e[a][1].end.offset-e[a][1].start.offset?(y=2,f=aa(f,[["enter",e[a][1],n],["exit",e[a][1],n]])):y=0,$n(e,r-1,a-r+3,f),a=r+f.length-y-2;break}}for(a=-1;++a<e.length;)e[a][1].type==="attentionSequence"&&(e[a][1].type="data");return e}function y_(e,n){const a=this.parser.constructs.attentionMarkers.null,r=this.previous,o=ol(r);let s;return u;function u(p){return s=p,e.enter("attentionSequence"),d(p)}function d(p){if(p===s)return e.consume(p),d;const f=e.exit("attentionSequence"),y=ol(p),g=!y||y===2&&o||a.includes(p),x=!o||o===2&&y||a.includes(r);return f._open=!!(s===42?g:g&&(o||!x)),f._close=!!(s===42?x:x&&(y||!g)),n(p)}}function T1(e,n){e.column+=n,e.offset+=n,e._bufferIndex+=n}const v_={name:"autolink",tokenize:x_};function x_(e,n,a){let r=0;return o;function o(b){return e.enter("autolink"),e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.enter("autolinkProtocol"),s}function s(b){return hn(b)?(e.consume(b),u):b===64?a(b):f(b)}function u(b){return b===43||b===45||b===46||on(b)?(r=1,d(b)):f(b)}function d(b){return b===58?(e.consume(b),r=0,p):(b===43||b===45||b===46||on(b))&&r++<32?(e.consume(b),d):(r=0,f(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||Vc(b)?a(b):(e.consume(b),p)}function f(b){return b===64?(e.consume(b),y):s_(b)?(e.consume(b),f):a(b)}function y(b){return on(b)?g(b):a(b)}function g(b){return b===46?(e.consume(b),r=0,y):b===62?(e.exit("autolinkProtocol").type="autolinkEmail",e.enter("autolinkMarker"),e.consume(b),e.exit("autolinkMarker"),e.exit("autolink"),n):x(b)}function x(b){if((b===45||on(b))&&r++<63){const k=b===45?x:g;return e.consume(b),k}return a(b)}}const Fo={partial:!0,tokenize:b_};function b_(e,n,a){return r;function r(s){return qe(s)?Ke(e,o,"linePrefix")(s):o(s)}function o(s){return s===null||Ae(s)?n(s):a(s)}}const Nw={continuation:{tokenize:S_},exit:k_,name:"blockQuote",tokenize:w_};function w_(e,n,a){const r=this;return o;function o(u){if(u===62){const d=r.containerState;return d.open||(e.enter("blockQuote",{_container:!0}),d.open=!0),e.enter("blockQuotePrefix"),e.enter("blockQuoteMarker"),e.consume(u),e.exit("blockQuoteMarker"),s}return a(u)}function s(u){return qe(u)?(e.enter("blockQuotePrefixWhitespace"),e.consume(u),e.exit("blockQuotePrefixWhitespace"),e.exit("blockQuotePrefix"),n):(e.exit("blockQuotePrefix"),n(u))}}function S_(e,n,a){const r=this;return o;function o(u){return qe(u)?Ke(e,s,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(u):s(u)}function s(u){return e.attempt(Nw,n,a)(u)}}function k_(e){e.exit("blockQuote")}const Rw={name:"characterEscape",tokenize:C_};function C_(e,n,a){return r;function r(s){return e.enter("characterEscape"),e.enter("escapeMarker"),e.consume(s),e.exit("escapeMarker"),o}function o(s){return u_(s)?(e.enter("characterEscapeValue"),e.consume(s),e.exit("characterEscapeValue"),e.exit("characterEscape"),n):a(s)}}const _w={name:"characterReference",tokenize:E_};function E_(e,n,a){const r=this;let o=0,s,u;return d;function d(g){return e.enter("characterReference"),e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),p}function p(g){return g===35?(e.enter("characterReferenceMarkerNumeric"),e.consume(g),e.exit("characterReferenceMarkerNumeric"),f):(e.enter("characterReferenceValue"),s=31,u=on,y(g))}function f(g){return g===88||g===120?(e.enter("characterReferenceMarkerHexadecimal"),e.consume(g),e.exit("characterReferenceMarkerHexadecimal"),e.enter("characterReferenceValue"),s=6,u=c_,y):(e.enter("characterReferenceValue"),s=7,u=Yp,y(g))}function y(g){if(g===59&&o){const x=e.exit("characterReferenceValue");return u===on&&!Qh(r.sliceSerialize(x))?a(g):(e.enter("characterReferenceMarker"),e.consume(g),e.exit("characterReferenceMarker"),e.exit("characterReference"),n)}return u(g)&&o++<s?(e.consume(g),y):a(g)}}const N1={partial:!0,tokenize:j_},R1={concrete:!0,name:"codeFenced",tokenize:A_};function A_(e,n,a){const r=this,o={partial:!0,tokenize:U};let s=0,u=0,d;return p;function p(D){return f(D)}function f(D){const W=r.events[r.events.length-1];return s=W&&W[1].type==="linePrefix"?W[2].sliceSerialize(W[1],!0).length:0,d=D,e.enter("codeFenced"),e.enter("codeFencedFence"),e.enter("codeFencedFenceSequence"),y(D)}function y(D){return D===d?(u++,e.consume(D),y):u<3?a(D):(e.exit("codeFencedFenceSequence"),qe(D)?Ke(e,g,"whitespace")(D):g(D))}function g(D){return D===null||Ae(D)?(e.exit("codeFencedFence"),r.interrupt?n(D):e.check(N1,C,F)(D)):(e.enter("codeFencedFenceInfo"),e.enter("chunkString",{contentType:"string"}),x(D))}function x(D){return D===null||Ae(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),g(D)):qe(D)?(e.exit("chunkString"),e.exit("codeFencedFenceInfo"),Ke(e,b,"whitespace")(D)):D===96&&D===d?a(D):(e.consume(D),x)}function b(D){return D===null||Ae(D)?g(D):(e.enter("codeFencedFenceMeta"),e.enter("chunkString",{contentType:"string"}),k(D))}function k(D){return D===null||Ae(D)?(e.exit("chunkString"),e.exit("codeFencedFenceMeta"),g(D)):D===96&&D===d?a(D):(e.consume(D),k)}function C(D){return e.attempt(o,F,j)(D)}function j(D){return e.enter("lineEnding"),e.consume(D),e.exit("lineEnding"),E}function E(D){return s>0&&qe(D)?Ke(e,_,"linePrefix",s+1)(D):_(D)}function _(D){return D===null||Ae(D)?e.check(N1,C,F)(D):(e.enter("codeFlowValue"),R(D))}function R(D){return D===null||Ae(D)?(e.exit("codeFlowValue"),_(D)):(e.consume(D),R)}function F(D){return e.exit("codeFenced"),n(D)}function U(D,W,Q){let M=0;return T;function T(K){return D.enter("lineEnding"),D.consume(K),D.exit("lineEnding"),q}function q(K){return D.enter("codeFencedFence"),qe(K)?Ke(D,V,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(K):V(K)}function V(K){return K===d?(D.enter("codeFencedFenceSequence"),ae(K)):Q(K)}function ae(K){return K===d?(M++,D.consume(K),ae):M>=u?(D.exit("codeFencedFenceSequence"),qe(K)?Ke(D,P,"whitespace")(K):P(K)):Q(K)}function P(K){return K===null||Ae(K)?(D.exit("codeFencedFence"),W(K)):Q(K)}}}function j_(e,n,a){const r=this;return o;function o(u){return u===null?a(u):(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s)}function s(u){return r.parser.lazy[r.now().line]?a(u):n(u)}}const lp={name:"codeIndented",tokenize:N_},T_={partial:!0,tokenize:R_};function N_(e,n,a){const r=this;return o;function o(f){return e.enter("codeIndented"),Ke(e,s,"linePrefix",5)(f)}function s(f){const y=r.events[r.events.length-1];return y&&y[1].type==="linePrefix"&&y[2].sliceSerialize(y[1],!0).length>=4?u(f):a(f)}function u(f){return f===null?p(f):Ae(f)?e.attempt(T_,u,p)(f):(e.enter("codeFlowValue"),d(f))}function d(f){return f===null||Ae(f)?(e.exit("codeFlowValue"),u(f)):(e.consume(f),d)}function p(f){return e.exit("codeIndented"),n(f)}}function R_(e,n,a){const r=this;return o;function o(u){return r.parser.lazy[r.now().line]?a(u):Ae(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),o):Ke(e,s,"linePrefix",5)(u)}function s(u){const d=r.events[r.events.length-1];return d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(u):Ae(u)?o(u):a(u)}}const __={name:"codeText",previous:D_,resolve:O_,tokenize:M_};function O_(e){let n=e.length-4,a=3,r,o;if((e[a][1].type==="lineEnding"||e[a][1].type==="space")&&(e[n][1].type==="lineEnding"||e[n][1].type==="space")){for(r=a;++r<n;)if(e[r][1].type==="codeTextData"){e[a][1].type="codeTextPadding",e[n][1].type="codeTextPadding",a+=2,n-=2;break}}for(r=a-1,n++;++r<=n;)o===void 0?r!==n&&e[r][1].type!=="lineEnding"&&(o=r):(r===n||e[r][1].type==="lineEnding")&&(e[o][1].type="codeTextData",r!==o+2&&(e[o][1].end=e[r-1][1].end,e.splice(o+2,r-o-2),n-=r-o-2,r=o+2),o=void 0);return e}function D_(e){return e!==96||this.events[this.events.length-1][1].type==="characterEscape"}function M_(e,n,a){let r=0,o,s;return u;function u(g){return e.enter("codeText"),e.enter("codeTextSequence"),d(g)}function d(g){return g===96?(e.consume(g),r++,d):(e.exit("codeTextSequence"),p(g))}function p(g){return g===null?a(g):g===32?(e.enter("space"),e.consume(g),e.exit("space"),p):g===96?(s=e.enter("codeTextSequence"),o=0,y(g)):Ae(g)?(e.enter("lineEnding"),e.consume(g),e.exit("lineEnding"),p):(e.enter("codeTextData"),f(g))}function f(g){return g===null||g===32||g===96||Ae(g)?(e.exit("codeTextData"),p(g)):(e.consume(g),f)}function y(g){return g===96?(e.consume(g),o++,y):o===r?(e.exit("codeTextSequence"),e.exit("codeText"),n(g)):(s.type="codeTextData",f(g))}}class L_{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,a){const r=a??Number.POSITIVE_INFINITY;return r<this.left.length?this.left.slice(n,r):n>this.left.length?this.right.slice(this.right.length-r+this.left.length,this.right.length-n+this.left.length).reverse():this.left.slice(n).concat(this.right.slice(this.right.length-r+this.left.length).reverse())}splice(n,a,r){const o=a||0;this.setCursor(Math.trunc(n));const s=this.right.splice(this.right.length-o,Number.POSITIVE_INFINITY);return r&&vo(this.left,r),s.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),vo(this.left,n)}unshift(n){this.setCursor(0),this.right.push(n)}unshiftMany(n){this.setCursor(0),vo(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 a=this.left.splice(n,Number.POSITIVE_INFINITY);vo(this.right,a.reverse())}else{const a=this.right.splice(this.left.length+this.right.length-n,Number.POSITIVE_INFINITY);vo(this.left,a.reverse())}}}function vo(e,n){let a=0;if(n.length<1e4)e.push(...n);else for(;a<n.length;)e.push(...n.slice(a,a+1e4)),a+=1e4}function Ow(e){const n={};let a=-1,r,o,s,u,d,p,f;const y=new L_(e);for(;++a<y.length;){for(;a in n;)a=n[a];if(r=y.get(a),a&&r[1].type==="chunkFlow"&&y.get(a-1)[1].type==="listItemPrefix"&&(p=r[1]._tokenizer.events,s=0,s<p.length&&p[s][1].type==="lineEndingBlank"&&(s+=2),s<p.length&&p[s][1].type==="content"))for(;++s<p.length&&p[s][1].type!=="content";)p[s][1].type==="chunkText"&&(p[s][1]._isInFirstContentOfListItem=!0,s++);if(r[0]==="enter")r[1].contentType&&(Object.assign(n,z_(y,a)),a=n[a],f=!0);else if(r[1]._container){for(s=a,o=void 0;s--;)if(u=y.get(s),u[1].type==="lineEnding"||u[1].type==="lineEndingBlank")u[0]==="enter"&&(o&&(y.get(o)[1].type="lineEndingBlank"),u[1].type="lineEnding",o=s);else if(!(u[1].type==="linePrefix"||u[1].type==="listItemIndent"))break;o&&(r[1].end={...y.get(o)[1].start},d=y.slice(o,a),d.unshift(r),y.splice(o,a-o+1,d))}}return $n(e,0,Number.POSITIVE_INFINITY,y.slice(0)),!f}function z_(e,n){const a=e.get(n)[1],r=e.get(n)[2];let o=n-1;const s=[];let u=a._tokenizer;u||(u=r.parser[a.contentType](a.start),a._contentTypeTextTrailing&&(u._contentTypeTextTrailing=!0));const d=u.events,p=[],f={};let y,g,x=-1,b=a,k=0,C=0;const j=[C];for(;b;){for(;e.get(++o)[1]!==b;);s.push(o),b._tokenizer||(y=r.sliceStream(b),b.next||y.push(null),g&&u.defineSkip(b.start),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=!0),u.write(y),b._isInFirstContentOfListItem&&(u._gfmTasklistFirstContentOfListItem=void 0)),g=b,b=b.next}for(b=a;++x<d.length;)d[x][0]==="exit"&&d[x-1][0]==="enter"&&d[x][1].type===d[x-1][1].type&&d[x][1].start.line!==d[x][1].end.line&&(C=x+1,j.push(C),b._tokenizer=void 0,b.previous=void 0,b=b.next);for(u.events=[],b?(b._tokenizer=void 0,b.previous=void 0):j.pop(),x=j.length;x--;){const E=d.slice(j[x],j[x+1]),_=s.pop();p.push([_,_+E.length-1]),e.splice(_,2,E)}for(p.reverse(),x=-1;++x<p.length;)f[k+p[x][0]]=k+p[x][1],k+=p[x][1]-p[x][0]-1;return f}const I_={resolve:U_,tokenize:B_},P_={partial:!0,tokenize:H_};function U_(e){return Ow(e),e}function B_(e,n){let a;return r;function r(d){return e.enter("content"),a=e.enter("chunkContent",{contentType:"content"}),o(d)}function o(d){return d===null?s(d):Ae(d)?e.check(P_,u,s)(d):(e.consume(d),o)}function s(d){return e.exit("chunkContent"),e.exit("content"),n(d)}function u(d){return e.consume(d),e.exit("chunkContent"),a.next=e.enter("chunkContent",{contentType:"content",previous:a}),a=a.next,o}}function H_(e,n,a){const r=this;return o;function o(u){return e.exit("chunkContent"),e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),Ke(e,s,"linePrefix")}function s(u){if(u===null||Ae(u))return a(u);const d=r.events[r.events.length-1];return!r.parser.constructs.disable.null.includes("codeIndented")&&d&&d[1].type==="linePrefix"&&d[2].sliceSerialize(d[1],!0).length>=4?n(u):e.interrupt(r.parser.constructs.flow,a,n)(u)}}function Dw(e,n,a,r,o,s,u,d,p){const f=p||Number.POSITIVE_INFINITY;let y=0;return g;function g(E){return E===60?(e.enter(r),e.enter(o),e.enter(s),e.consume(E),e.exit(s),x):E===null||E===32||E===41||Vc(E)?a(E):(e.enter(r),e.enter(u),e.enter(d),e.enter("chunkString",{contentType:"string"}),C(E))}function x(E){return E===62?(e.enter(s),e.consume(E),e.exit(s),e.exit(o),e.exit(r),n):(e.enter(d),e.enter("chunkString",{contentType:"string"}),b(E))}function b(E){return E===62?(e.exit("chunkString"),e.exit(d),x(E)):E===null||E===60||Ae(E)?a(E):(e.consume(E),E===92?k:b)}function k(E){return E===60||E===62||E===92?(e.consume(E),b):b(E)}function C(E){return!y&&(E===null||E===41||gt(E))?(e.exit("chunkString"),e.exit(d),e.exit(u),e.exit(r),n(E)):y<f&&E===40?(e.consume(E),y++,C):E===41?(e.consume(E),y--,C):E===null||E===32||E===40||Vc(E)?a(E):(e.consume(E),E===92?j:C)}function j(E){return E===40||E===41||E===92?(e.consume(E),C):C(E)}}function Mw(e,n,a,r,o,s){const u=this;let d=0,p;return f;function f(b){return e.enter(r),e.enter(o),e.consume(b),e.exit(o),e.enter(s),y}function y(b){return d>999||b===null||b===91||b===93&&!p||b===94&&!d&&"_hiddenFootnoteSupport"in u.parser.constructs?a(b):b===93?(e.exit(s),e.enter(o),e.consume(b),e.exit(o),e.exit(r),n):Ae(b)?(e.enter("lineEnding"),e.consume(b),e.exit("lineEnding"),y):(e.enter("chunkString",{contentType:"string"}),g(b))}function g(b){return b===null||b===91||b===93||Ae(b)||d++>999?(e.exit("chunkString"),y(b)):(e.consume(b),p||(p=!qe(b)),b===92?x:g)}function x(b){return b===91||b===92||b===93?(e.consume(b),d++,g):g(b)}}function Lw(e,n,a,r,o,s){let u;return d;function d(x){return x===34||x===39||x===40?(e.enter(r),e.enter(o),e.consume(x),e.exit(o),u=x===40?41:x,p):a(x)}function p(x){return x===u?(e.enter(o),e.consume(x),e.exit(o),e.exit(r),n):(e.enter(s),f(x))}function f(x){return x===u?(e.exit(s),p(u)):x===null?a(x):Ae(x)?(e.enter("lineEnding"),e.consume(x),e.exit("lineEnding"),Ke(e,f,"linePrefix")):(e.enter("chunkString",{contentType:"string"}),y(x))}function y(x){return x===u||x===null||Ae(x)?(e.exit("chunkString"),f(x)):(e.consume(x),x===92?g:y)}function g(x){return x===u||x===92?(e.consume(x),y):y(x)}}function To(e,n){let a;return r;function r(o){return Ae(o)?(e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),a=!0,r):qe(o)?Ke(e,r,a?"linePrefix":"lineSuffix")(o):n(o)}}const $_={name:"definition",tokenize:F_},q_={partial:!0,tokenize:G_};function F_(e,n,a){const r=this;let o;return s;function s(b){return e.enter("definition"),u(b)}function u(b){return Mw.call(r,e,d,a,"definitionLabel","definitionLabelMarker","definitionLabelString")(b)}function d(b){return o=da(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)),b===58?(e.enter("definitionMarker"),e.consume(b),e.exit("definitionMarker"),p):a(b)}function p(b){return gt(b)?To(e,f)(b):f(b)}function f(b){return Dw(e,y,a,"definitionDestination","definitionDestinationLiteral","definitionDestinationLiteralMarker","definitionDestinationRaw","definitionDestinationString")(b)}function y(b){return e.attempt(q_,g,g)(b)}function g(b){return qe(b)?Ke(e,x,"whitespace")(b):x(b)}function x(b){return b===null||Ae(b)?(e.exit("definition"),r.parser.defined.push(o),n(b)):a(b)}}function G_(e,n,a){return r;function r(d){return gt(d)?To(e,o)(d):a(d)}function o(d){return Lw(e,s,a,"definitionTitle","definitionTitleMarker","definitionTitleString")(d)}function s(d){return qe(d)?Ke(e,u,"whitespace")(d):u(d)}function u(d){return d===null||Ae(d)?n(d):a(d)}}const V_={name:"hardBreakEscape",tokenize:W_};function W_(e,n,a){return r;function r(s){return e.enter("hardBreakEscape"),e.consume(s),o}function o(s){return Ae(s)?(e.exit("hardBreakEscape"),n(s)):a(s)}}const Y_={name:"headingAtx",resolve:K_,tokenize:Q_};function K_(e,n){let a=e.length-2,r=3,o,s;return e[r][1].type==="whitespace"&&(r+=2),a-2>r&&e[a][1].type==="whitespace"&&(a-=2),e[a][1].type==="atxHeadingSequence"&&(r===a-1||a-4>r&&e[a-2][1].type==="whitespace")&&(a-=r+1===a?2:4),a>r&&(o={type:"atxHeadingText",start:e[r][1].start,end:e[a][1].end},s={type:"chunkText",start:e[r][1].start,end:e[a][1].end,contentType:"text"},$n(e,r,a-r+1,[["enter",o,n],["enter",s,n],["exit",s,n],["exit",o,n]])),e}function Q_(e,n,a){let r=0;return o;function o(y){return e.enter("atxHeading"),s(y)}function s(y){return e.enter("atxHeadingSequence"),u(y)}function u(y){return y===35&&r++<6?(e.consume(y),u):y===null||gt(y)?(e.exit("atxHeadingSequence"),d(y)):a(y)}function d(y){return y===35?(e.enter("atxHeadingSequence"),p(y)):y===null||Ae(y)?(e.exit("atxHeading"),n(y)):qe(y)?Ke(e,d,"whitespace")(y):(e.enter("atxHeadingText"),f(y))}function p(y){return y===35?(e.consume(y),p):(e.exit("atxHeadingSequence"),d(y))}function f(y){return y===null||y===35||gt(y)?(e.exit("atxHeadingText"),d(y)):(e.consume(y),f)}}const X_=["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"],_1=["pre","script","style","textarea"],Z_={concrete:!0,name:"htmlFlow",resolveTo:tO,tokenize:nO},J_={partial:!0,tokenize:iO},eO={partial:!0,tokenize:aO};function tO(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 nO(e,n,a){const r=this;let o,s,u,d,p;return f;function f(N){return y(N)}function y(N){return e.enter("htmlFlow"),e.enter("htmlFlowData"),e.consume(N),g}function g(N){return N===33?(e.consume(N),x):N===47?(e.consume(N),s=!0,C):N===63?(e.consume(N),o=3,r.interrupt?n:O):hn(N)?(e.consume(N),u=String.fromCharCode(N),j):a(N)}function x(N){return N===45?(e.consume(N),o=2,b):N===91?(e.consume(N),o=5,d=0,k):hn(N)?(e.consume(N),o=4,r.interrupt?n:O):a(N)}function b(N){return N===45?(e.consume(N),r.interrupt?n:O):a(N)}function k(N){const ue="CDATA[";return N===ue.charCodeAt(d++)?(e.consume(N),d===ue.length?r.interrupt?n:V:k):a(N)}function C(N){return hn(N)?(e.consume(N),u=String.fromCharCode(N),j):a(N)}function j(N){if(N===null||N===47||N===62||gt(N)){const ue=N===47,pe=u.toLowerCase();return!ue&&!s&&_1.includes(pe)?(o=1,r.interrupt?n(N):V(N)):X_.includes(u.toLowerCase())?(o=6,ue?(e.consume(N),E):r.interrupt?n(N):V(N)):(o=7,r.interrupt&&!r.parser.lazy[r.now().line]?a(N):s?_(N):R(N))}return N===45||on(N)?(e.consume(N),u+=String.fromCharCode(N),j):a(N)}function E(N){return N===62?(e.consume(N),r.interrupt?n:V):a(N)}function _(N){return qe(N)?(e.consume(N),_):T(N)}function R(N){return N===47?(e.consume(N),T):N===58||N===95||hn(N)?(e.consume(N),F):qe(N)?(e.consume(N),R):T(N)}function F(N){return N===45||N===46||N===58||N===95||on(N)?(e.consume(N),F):U(N)}function U(N){return N===61?(e.consume(N),D):qe(N)?(e.consume(N),U):R(N)}function D(N){return N===null||N===60||N===61||N===62||N===96?a(N):N===34||N===39?(e.consume(N),p=N,W):qe(N)?(e.consume(N),D):Q(N)}function W(N){return N===p?(e.consume(N),p=null,M):N===null||Ae(N)?a(N):(e.consume(N),W)}function Q(N){return N===null||N===34||N===39||N===47||N===60||N===61||N===62||N===96||gt(N)?U(N):(e.consume(N),Q)}function M(N){return N===47||N===62||qe(N)?R(N):a(N)}function T(N){return N===62?(e.consume(N),q):a(N)}function q(N){return N===null||Ae(N)?V(N):qe(N)?(e.consume(N),q):a(N)}function V(N){return N===45&&o===2?(e.consume(N),B):N===60&&o===1?(e.consume(N),Z):N===62&&o===4?(e.consume(N),L):N===63&&o===3?(e.consume(N),O):N===93&&o===5?(e.consume(N),G):Ae(N)&&(o===6||o===7)?(e.exit("htmlFlowData"),e.check(J_,X,ae)(N)):N===null||Ae(N)?(e.exit("htmlFlowData"),ae(N)):(e.consume(N),V)}function ae(N){return e.check(eO,P,X)(N)}function P(N){return e.enter("lineEnding"),e.consume(N),e.exit("lineEnding"),K}function K(N){return N===null||Ae(N)?ae(N):(e.enter("htmlFlowData"),V(N))}function B(N){return N===45?(e.consume(N),O):V(N)}function Z(N){return N===47?(e.consume(N),u="",ie):V(N)}function ie(N){if(N===62){const ue=u.toLowerCase();return _1.includes(ue)?(e.consume(N),L):V(N)}return hn(N)&&u.length<8?(e.consume(N),u+=String.fromCharCode(N),ie):V(N)}function G(N){return N===93?(e.consume(N),O):V(N)}function O(N){return N===62?(e.consume(N),L):N===45&&o===2?(e.consume(N),O):V(N)}function L(N){return N===null||Ae(N)?(e.exit("htmlFlowData"),X(N)):(e.consume(N),L)}function X(N){return e.exit("htmlFlow"),n(N)}}function aO(e,n,a){const r=this;return o;function o(u){return Ae(u)?(e.enter("lineEnding"),e.consume(u),e.exit("lineEnding"),s):a(u)}function s(u){return r.parser.lazy[r.now().line]?a(u):n(u)}}function iO(e,n,a){return r;function r(o){return e.enter("lineEnding"),e.consume(o),e.exit("lineEnding"),e.attempt(Fo,n,a)}}const rO={name:"htmlText",tokenize:lO};function lO(e,n,a){const r=this;let o,s,u;return d;function d(O){return e.enter("htmlText"),e.enter("htmlTextData"),e.consume(O),p}function p(O){return O===33?(e.consume(O),f):O===47?(e.consume(O),U):O===63?(e.consume(O),R):hn(O)?(e.consume(O),Q):a(O)}function f(O){return O===45?(e.consume(O),y):O===91?(e.consume(O),s=0,k):hn(O)?(e.consume(O),_):a(O)}function y(O){return O===45?(e.consume(O),b):a(O)}function g(O){return O===null?a(O):O===45?(e.consume(O),x):Ae(O)?(u=g,Z(O)):(e.consume(O),g)}function x(O){return O===45?(e.consume(O),b):g(O)}function b(O){return O===62?B(O):O===45?x(O):g(O)}function k(O){const L="CDATA[";return O===L.charCodeAt(s++)?(e.consume(O),s===L.length?C:k):a(O)}function C(O){return O===null?a(O):O===93?(e.consume(O),j):Ae(O)?(u=C,Z(O)):(e.consume(O),C)}function j(O){return O===93?(e.consume(O),E):C(O)}function E(O){return O===62?B(O):O===93?(e.consume(O),E):C(O)}function _(O){return O===null||O===62?B(O):Ae(O)?(u=_,Z(O)):(e.consume(O),_)}function R(O){return O===null?a(O):O===63?(e.consume(O),F):Ae(O)?(u=R,Z(O)):(e.consume(O),R)}function F(O){return O===62?B(O):R(O)}function U(O){return hn(O)?(e.consume(O),D):a(O)}function D(O){return O===45||on(O)?(e.consume(O),D):W(O)}function W(O){return Ae(O)?(u=W,Z(O)):qe(O)?(e.consume(O),W):B(O)}function Q(O){return O===45||on(O)?(e.consume(O),Q):O===47||O===62||gt(O)?M(O):a(O)}function M(O){return O===47?(e.consume(O),B):O===58||O===95||hn(O)?(e.consume(O),T):Ae(O)?(u=M,Z(O)):qe(O)?(e.consume(O),M):B(O)}function T(O){return O===45||O===46||O===58||O===95||on(O)?(e.consume(O),T):q(O)}function q(O){return O===61?(e.consume(O),V):Ae(O)?(u=q,Z(O)):qe(O)?(e.consume(O),q):M(O)}function V(O){return O===null||O===60||O===61||O===62||O===96?a(O):O===34||O===39?(e.consume(O),o=O,ae):Ae(O)?(u=V,Z(O)):qe(O)?(e.consume(O),V):(e.consume(O),P)}function ae(O){return O===o?(e.consume(O),o=void 0,K):O===null?a(O):Ae(O)?(u=ae,Z(O)):(e.consume(O),ae)}function P(O){return O===null||O===34||O===39||O===60||O===61||O===96?a(O):O===47||O===62||gt(O)?M(O):(e.consume(O),P)}function K(O){return O===47||O===62||gt(O)?M(O):a(O)}function B(O){return O===62?(e.consume(O),e.exit("htmlTextData"),e.exit("htmlText"),n):a(O)}function Z(O){return e.exit("htmlTextData"),e.enter("lineEnding"),e.consume(O),e.exit("lineEnding"),ie}function ie(O){return qe(O)?Ke(e,G,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(O):G(O)}function G(O){return e.enter("htmlTextData"),u(O)}}const Xh={name:"labelEnd",resolveAll:uO,resolveTo:dO,tokenize:fO},oO={tokenize:pO},sO={tokenize:hO},cO={tokenize:mO};function uO(e){let n=-1;const a=[];for(;++n<e.length;){const r=e[n][1];if(a.push(e[n]),r.type==="labelImage"||r.type==="labelLink"||r.type==="labelEnd"){const o=r.type==="labelImage"?4:2;r.type="data",n+=o}}return e.length!==a.length&&$n(e,0,e.length,a),e}function dO(e,n){let a=e.length,r=0,o,s,u,d;for(;a--;)if(o=e[a][1],s){if(o.type==="link"||o.type==="labelLink"&&o._inactive)break;e[a][0]==="enter"&&o.type==="labelLink"&&(o._inactive=!0)}else if(u){if(e[a][0]==="enter"&&(o.type==="labelImage"||o.type==="labelLink")&&!o._balanced&&(s=a,o.type!=="labelLink")){r=2;break}}else o.type==="labelEnd"&&(u=a);const p={type:e[s][1].type==="labelLink"?"link":"image",start:{...e[s][1].start},end:{...e[e.length-1][1].end}},f={type:"label",start:{...e[s][1].start},end:{...e[u][1].end}},y={type:"labelText",start:{...e[s+r+2][1].end},end:{...e[u-2][1].start}};return d=[["enter",p,n],["enter",f,n]],d=aa(d,e.slice(s+1,s+r+3)),d=aa(d,[["enter",y,n]]),d=aa(d,cu(n.parser.constructs.insideSpan.null,e.slice(s+r+4,u-3),n)),d=aa(d,[["exit",y,n],e[u-2],e[u-1],["exit",f,n]]),d=aa(d,e.slice(u+1)),d=aa(d,[["exit",p,n]]),$n(e,s,e.length,d),e}function fO(e,n,a){const r=this;let o=r.events.length,s,u;for(;o--;)if((r.events[o][1].type==="labelImage"||r.events[o][1].type==="labelLink")&&!r.events[o][1]._balanced){s=r.events[o][1];break}return d;function d(x){return s?s._inactive?g(x):(u=r.parser.defined.includes(da(r.sliceSerialize({start:s.end,end:r.now()}))),e.enter("labelEnd"),e.enter("labelMarker"),e.consume(x),e.exit("labelMarker"),e.exit("labelEnd"),p):a(x)}function p(x){return x===40?e.attempt(oO,y,u?y:g)(x):x===91?e.attempt(sO,y,u?f:g)(x):u?y(x):g(x)}function f(x){return e.attempt(cO,y,g)(x)}function y(x){return n(x)}function g(x){return s._balanced=!0,a(x)}}function pO(e,n,a){return r;function r(g){return e.enter("resource"),e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),o}function o(g){return gt(g)?To(e,s)(g):s(g)}function s(g){return g===41?y(g):Dw(e,u,d,"resourceDestination","resourceDestinationLiteral","resourceDestinationLiteralMarker","resourceDestinationRaw","resourceDestinationString",32)(g)}function u(g){return gt(g)?To(e,p)(g):y(g)}function d(g){return a(g)}function p(g){return g===34||g===39||g===40?Lw(e,f,a,"resourceTitle","resourceTitleMarker","resourceTitleString")(g):y(g)}function f(g){return gt(g)?To(e,y)(g):y(g)}function y(g){return g===41?(e.enter("resourceMarker"),e.consume(g),e.exit("resourceMarker"),e.exit("resource"),n):a(g)}}function hO(e,n,a){const r=this;return o;function o(d){return Mw.call(r,e,s,u,"reference","referenceMarker","referenceString")(d)}function s(d){return r.parser.defined.includes(da(r.sliceSerialize(r.events[r.events.length-1][1]).slice(1,-1)))?n(d):a(d)}function u(d){return a(d)}}function mO(e,n,a){return r;function r(s){return e.enter("reference"),e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),o}function o(s){return s===93?(e.enter("referenceMarker"),e.consume(s),e.exit("referenceMarker"),e.exit("reference"),n):a(s)}}const gO={name:"labelStartImage",resolveAll:Xh.resolveAll,tokenize:yO};function yO(e,n,a){const r=this;return o;function o(d){return e.enter("labelImage"),e.enter("labelImageMarker"),e.consume(d),e.exit("labelImageMarker"),s}function s(d){return d===91?(e.enter("labelMarker"),e.consume(d),e.exit("labelMarker"),e.exit("labelImage"),u):a(d)}function u(d){return d===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(d):n(d)}}const vO={name:"labelStartLink",resolveAll:Xh.resolveAll,tokenize:xO};function xO(e,n,a){const r=this;return o;function o(u){return e.enter("labelLink"),e.enter("labelMarker"),e.consume(u),e.exit("labelMarker"),e.exit("labelLink"),s}function s(u){return u===94&&"_hiddenFootnoteSupport"in r.parser.constructs?a(u):n(u)}}const op={name:"lineEnding",tokenize:bO};function bO(e,n){return a;function a(r){return e.enter("lineEnding"),e.consume(r),e.exit("lineEnding"),Ke(e,n,"linePrefix")}}const Tc={name:"thematicBreak",tokenize:wO};function wO(e,n,a){let r=0,o;return s;function s(f){return e.enter("thematicBreak"),u(f)}function u(f){return o=f,d(f)}function d(f){return f===o?(e.enter("thematicBreakSequence"),p(f)):r>=3&&(f===null||Ae(f))?(e.exit("thematicBreak"),n(f)):a(f)}function p(f){return f===o?(e.consume(f),r++,p):(e.exit("thematicBreakSequence"),qe(f)?Ke(e,d,"whitespace")(f):d(f))}}const An={continuation:{tokenize:EO},exit:jO,name:"list",tokenize:CO},SO={partial:!0,tokenize:TO},kO={partial:!0,tokenize:AO};function CO(e,n,a){const r=this,o=r.events[r.events.length-1];let s=o&&o[1].type==="linePrefix"?o[2].sliceSerialize(o[1],!0).length:0,u=0;return d;function d(b){const k=r.containerState.type||(b===42||b===43||b===45?"listUnordered":"listOrdered");if(k==="listUnordered"?!r.containerState.marker||b===r.containerState.marker:Yp(b)){if(r.containerState.type||(r.containerState.type=k,e.enter(k,{_container:!0})),k==="listUnordered")return e.enter("listItemPrefix"),b===42||b===45?e.check(Tc,a,f)(b):f(b);if(!r.interrupt||b===49)return e.enter("listItemPrefix"),e.enter("listItemValue"),p(b)}return a(b)}function p(b){return Yp(b)&&++u<10?(e.consume(b),p):(!r.interrupt||u<2)&&(r.containerState.marker?b===r.containerState.marker:b===41||b===46)?(e.exit("listItemValue"),f(b)):a(b)}function f(b){return e.enter("listItemMarker"),e.consume(b),e.exit("listItemMarker"),r.containerState.marker=r.containerState.marker||b,e.check(Fo,r.interrupt?a:y,e.attempt(SO,x,g))}function y(b){return r.containerState.initialBlankLine=!0,s++,x(b)}function g(b){return qe(b)?(e.enter("listItemPrefixWhitespace"),e.consume(b),e.exit("listItemPrefixWhitespace"),x):a(b)}function x(b){return r.containerState.size=s+r.sliceSerialize(e.exit("listItemPrefix"),!0).length,n(b)}}function EO(e,n,a){const r=this;return r.containerState._closeFlow=void 0,e.check(Fo,o,s);function o(d){return r.containerState.furtherBlankLines=r.containerState.furtherBlankLines||r.containerState.initialBlankLine,Ke(e,n,"listItemIndent",r.containerState.size+1)(d)}function s(d){return r.containerState.furtherBlankLines||!qe(d)?(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,u(d)):(r.containerState.furtherBlankLines=void 0,r.containerState.initialBlankLine=void 0,e.attempt(kO,n,u)(d))}function u(d){return r.containerState._closeFlow=!0,r.interrupt=void 0,Ke(e,e.attempt(An,n,a),"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(d)}}function AO(e,n,a){const r=this;return Ke(e,o,"listItemIndent",r.containerState.size+1);function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="listItemIndent"&&u[2].sliceSerialize(u[1],!0).length===r.containerState.size?n(s):a(s)}}function jO(e){e.exit(this.containerState.type)}function TO(e,n,a){const r=this;return Ke(e,o,"listItemPrefixWhitespace",r.parser.constructs.disable.null.includes("codeIndented")?void 0:5);function o(s){const u=r.events[r.events.length-1];return!qe(s)&&u&&u[1].type==="listItemPrefixWhitespace"?n(s):a(s)}}const O1={name:"setextUnderline",resolveTo:NO,tokenize:RO};function NO(e,n){let a=e.length,r,o,s;for(;a--;)if(e[a][0]==="enter"){if(e[a][1].type==="content"){r=a;break}e[a][1].type==="paragraph"&&(o=a)}else e[a][1].type==="content"&&e.splice(a,1),!s&&e[a][1].type==="definition"&&(s=a);const u={type:"setextHeading",start:{...e[r][1].start},end:{...e[e.length-1][1].end}};return e[o][1].type="setextHeadingText",s?(e.splice(o,0,["enter",u,n]),e.splice(s+1,0,["exit",e[r][1],n]),e[r][1].end={...e[s][1].end}):e[r][1]=u,e.push(["exit",u,n]),e}function RO(e,n,a){const r=this;let o;return s;function s(f){let y=r.events.length,g;for(;y--;)if(r.events[y][1].type!=="lineEnding"&&r.events[y][1].type!=="linePrefix"&&r.events[y][1].type!=="content"){g=r.events[y][1].type==="paragraph";break}return!r.parser.lazy[r.now().line]&&(r.interrupt||g)?(e.enter("setextHeadingLine"),o=f,u(f)):a(f)}function u(f){return e.enter("setextHeadingLineSequence"),d(f)}function d(f){return f===o?(e.consume(f),d):(e.exit("setextHeadingLineSequence"),qe(f)?Ke(e,p,"lineSuffix")(f):p(f))}function p(f){return f===null||Ae(f)?(e.exit("setextHeadingLine"),n(f)):a(f)}}const _O={tokenize:OO};function OO(e){const n=this,a=e.attempt(Fo,r,e.attempt(this.parser.constructs.flowInitial,o,Ke(e,e.attempt(this.parser.constructs.flow,o,e.attempt(I_,o)),"linePrefix")));return a;function r(s){if(s===null){e.consume(s);return}return e.enter("lineEndingBlank"),e.consume(s),e.exit("lineEndingBlank"),n.currentConstruct=void 0,a}function o(s){if(s===null){e.consume(s);return}return e.enter("lineEnding"),e.consume(s),e.exit("lineEnding"),n.currentConstruct=void 0,a}}const DO={resolveAll:Iw()},MO=zw("string"),LO=zw("text");function zw(e){return{resolveAll:Iw(e==="text"?zO:void 0),tokenize:n};function n(a){const r=this,o=this.parser.constructs[e],s=a.attempt(o,u,d);return u;function u(y){return f(y)?s(y):d(y)}function d(y){if(y===null){a.consume(y);return}return a.enter("data"),a.consume(y),p}function p(y){return f(y)?(a.exit("data"),s(y)):(a.consume(y),p)}function f(y){if(y===null)return!0;const g=o[y];let x=-1;if(g)for(;++x<g.length;){const b=g[x];if(!b.previous||b.previous.call(r,r.previous))return!0}return!1}}}function Iw(e){return n;function n(a,r){let o=-1,s;for(;++o<=a.length;)s===void 0?a[o]&&a[o][1].type==="data"&&(s=o,o++):(!a[o]||a[o][1].type!=="data")&&(o!==s+2&&(a[s][1].end=a[o-1][1].end,a.splice(s+2,o-s-2),o=s+2),s=void 0);return e?e(a,r):a}}function zO(e,n){let a=0;for(;++a<=e.length;)if((a===e.length||e[a][1].type==="lineEnding")&&e[a-1][1].type==="data"){const r=e[a-1][1],o=n.sliceStream(r);let s=o.length,u=-1,d=0,p;for(;s--;){const f=o[s];if(typeof f=="string"){for(u=f.length;f.charCodeAt(u-1)===32;)d++,u--;if(u)break;u=-1}else if(f===-2)p=!0,d++;else if(f!==-1){s++;break}}if(n._contentTypeTextTrailing&&a===e.length&&(d=0),d){const f={type:a===e.length||p||d<2?"lineSuffix":"hardBreakTrailing",start:{_bufferIndex:s?u:r.start._bufferIndex+u,_index:r.start._index+s,line:r.end.line,column:r.end.column-d,offset:r.end.offset-d},end:{...r.end}};r.end={...f.start},r.start.offset===r.end.offset?Object.assign(r,f):(e.splice(a,0,["enter",f,n],["exit",f,n]),a+=2)}a++}return e}const IO={42:An,43:An,45:An,48:An,49:An,50:An,51:An,52:An,53:An,54:An,55:An,56:An,57:An,62:Nw},PO={91:$_},UO={[-2]:lp,[-1]:lp,32:lp},BO={35:Y_,42:Tc,45:[O1,Tc],60:Z_,61:O1,95:Tc,96:R1,126:R1},HO={38:_w,92:Rw},$O={[-5]:op,[-4]:op,[-3]:op,33:gO,38:_w,42:Kp,60:[v_,rO],91:vO,92:[V_,Rw],93:Xh,95:Kp,96:__},qO={null:[Kp,DO]},FO={null:[42,95]},GO={null:[]},VO=Object.freeze(Object.defineProperty({__proto__:null,attentionMarkers:FO,contentInitial:PO,disable:GO,document:IO,flow:BO,flowInitial:UO,insideSpan:qO,string:HO,text:$O},Symbol.toStringTag,{value:"Module"}));function WO(e,n,a){let r={_bufferIndex:-1,_index:0,line:a&&a.line||1,column:a&&a.column||1,offset:a&&a.offset||0};const o={},s=[];let u=[],d=[];const p={attempt:W(U),check:W(D),consume:_,enter:R,exit:F,interrupt:W(D,{interrupt:!0})},f={code:null,containerState:{},defineSkip:C,events:[],now:k,parser:e,previous:null,sliceSerialize:x,sliceStream:b,write:g};let y=n.tokenize.call(f,p);return n.resolveAll&&s.push(n),f;function g(q){return u=aa(u,q),j(),u[u.length-1]!==null?[]:(Q(n,0),f.events=cu(s,f.events,f),f.events)}function x(q,V){return KO(b(q),V)}function b(q){return YO(u,q)}function k(){const{_bufferIndex:q,_index:V,line:ae,column:P,offset:K}=r;return{_bufferIndex:q,_index:V,line:ae,column:P,offset:K}}function C(q){o[q.line]=q.column,T()}function j(){let q;for(;r._index<u.length;){const V=u[r._index];if(typeof V=="string")for(q=r._index,r._bufferIndex<0&&(r._bufferIndex=0);r._index===q&&r._bufferIndex<V.length;)E(V.charCodeAt(r._bufferIndex));else E(V)}}function E(q){y=y(q)}function _(q){Ae(q)?(r.line++,r.column=1,r.offset+=q===-3?2:1,T()):q!==-1&&(r.column++,r.offset++),r._bufferIndex<0?r._index++:(r._bufferIndex++,r._bufferIndex===u[r._index].length&&(r._bufferIndex=-1,r._index++)),f.previous=q}function R(q,V){const ae=V||{};return ae.type=q,ae.start=k(),f.events.push(["enter",ae,f]),d.push(ae),ae}function F(q){const V=d.pop();return V.end=k(),f.events.push(["exit",V,f]),V}function U(q,V){Q(q,V.from)}function D(q,V){V.restore()}function W(q,V){return ae;function ae(P,K,B){let Z,ie,G,O;return Array.isArray(P)?X(P):"tokenize"in P?X([P]):L(P);function L(he){return Ee;function Ee(Ue){const Ne=Ue!==null&&he[Ue],et=Ue!==null&&he.null,Ot=[...Array.isArray(Ne)?Ne:Ne?[Ne]:[],...Array.isArray(et)?et:et?[et]:[]];return X(Ot)(Ue)}}function X(he){return Z=he,ie=0,he.length===0?B:N(he[ie])}function N(he){return Ee;function Ee(Ue){return O=M(),G=he,he.partial||(f.currentConstruct=he),he.name&&f.parser.constructs.disable.null.includes(he.name)?pe():he.tokenize.call(V?Object.assign(Object.create(f),V):f,p,ue,pe)(Ue)}}function ue(he){return q(G,O),K}function pe(he){return O.restore(),++ie<Z.length?N(Z[ie]):B}}}function Q(q,V){q.resolveAll&&!s.includes(q)&&s.push(q),q.resolve&&$n(f.events,V,f.events.length-V,q.resolve(f.events.slice(V),f)),q.resolveTo&&(f.events=q.resolveTo(f.events,f))}function M(){const q=k(),V=f.previous,ae=f.currentConstruct,P=f.events.length,K=Array.from(d);return{from:P,restore:B};function B(){r=q,f.previous=V,f.currentConstruct=ae,f.events.length=P,d=K,T()}}function T(){r.line in o&&r.column<2&&(r.column=o[r.line],r.offset+=o[r.line]-1)}}function YO(e,n){const a=n.start._index,r=n.start._bufferIndex,o=n.end._index,s=n.end._bufferIndex;let u;if(a===o)u=[e[a].slice(r,s)];else{if(u=e.slice(a,o),r>-1){const d=u[0];typeof d=="string"?u[0]=d.slice(r):u.shift()}s>0&&u.push(e[o].slice(0,s))}return u}function KO(e,n){let a=-1;const r=[];let o;for(;++a<e.length;){const s=e[a];let u;if(typeof s=="string")u=s;else switch(s){case-5:{u="\r";break}case-4:{u=`
|
|
1140
|
+
`;break}case-3:{u=`\r
|
|
1141
|
+
`;break}case-2:{u=n?" ":" ";break}case-1:{if(!n&&o)continue;u=" ";break}default:u=String.fromCharCode(s)}o=s===-2,r.push(u)}return r.join("")}function QO(e){const r={constructs:jw([VO,...(e||{}).extensions||[]]),content:o(d_),defined:[],document:o(p_),flow:o(_O),lazy:{},string:o(MO),text:o(LO)};return r;function o(s){return u;function u(d){return WO(r,s,d)}}}function XO(e){for(;!Ow(e););return e}const D1=/[\0\t\n\r]/g;function ZO(){let e=1,n="",a=!0,r;return o;function o(s,u,d){const p=[];let f,y,g,x,b;for(s=n+(typeof s=="string"?s.toString():new TextDecoder(u||void 0).decode(s)),g=0,n="",a&&(s.charCodeAt(0)===65279&&g++,a=void 0);g<s.length;){if(D1.lastIndex=g,f=D1.exec(s),x=f&&f.index!==void 0?f.index:s.length,b=s.charCodeAt(x),!f){n=s.slice(g);break}if(b===10&&g===x&&r)p.push(-3),r=void 0;else switch(r&&(p.push(-5),r=void 0),g<x&&(p.push(s.slice(g,x)),e+=x-g),b){case 0:{p.push(65533),e++;break}case 9:{for(y=Math.ceil(e/4)*4,p.push(-2);e++<y;)p.push(-1);break}case 10:{p.push(-4),e=1;break}default:r=!0,e=1}g=x+1}return d&&(r&&p.push(-5),n&&p.push(n),p.push(null)),p}}const JO=/\\([!-/:-@[-`{-~])|&(#(?:\d{1,7}|x[\da-f]{1,6})|[\da-z]{1,31});/gi;function eD(e){return e.replace(JO,tD)}function tD(e,n,a){if(n)return n;if(a.charCodeAt(0)===35){const o=a.charCodeAt(1),s=o===120||o===88;return Tw(a.slice(s?2:1),s?16:10)}return Qh(a)||e}const Pw={}.hasOwnProperty;function nD(e,n,a){return n&&typeof n=="object"&&(a=n,n=void 0),aD(a)(XO(QO(a).document().write(ZO()(e,n,!0))))}function aD(e){const n={transforms:[],canContainEols:["emphasis","fragment","heading","paragraph","strong"],enter:{autolink:s(Nt),autolinkProtocol:M,autolinkEmail:M,atxHeading:s(Zt),blockQuote:s(et),characterEscape:M,characterReference:M,codeFenced:s(Ot),codeFencedFenceInfo:u,codeFencedFenceMeta:u,codeIndented:s(Ot,u),codeText:s(xt,u),codeTextData:M,data:M,codeFlowValue:M,definition:s(bt),definitionDestinationString:u,definitionLabelString:u,definitionTitleString:u,emphasis:s(yt),hardBreakEscape:s(Pe),hardBreakTrailing:s(Pe),htmlFlow:s(pt,u),htmlFlowData:M,htmlText:s(pt,u),htmlTextData:M,image:s(Dt),label:u,link:s(Nt),listItem:s(Mt),listItemValue:x,listOrdered:s(ge,g),listUnordered:s(ge),paragraph:s(Fn),reference:N,referenceString:u,resourceDestinationString:u,resourceTitleString:u,setextHeading:s(Zt),strong:s(yn),thematicBreak:s(fe)},exit:{atxHeading:p(),atxHeadingSequence:U,autolink:p(),autolinkEmail:Ne,autolinkProtocol:Ue,blockQuote:p(),characterEscapeValue:T,characterReferenceMarkerHexadecimal:pe,characterReferenceMarkerNumeric:pe,characterReferenceValue:he,characterReference:Ee,codeFenced:p(j),codeFencedFence:C,codeFencedFenceInfo:b,codeFencedFenceMeta:k,codeFlowValue:T,codeIndented:p(E),codeText:p(K),codeTextData:T,data:T,definition:p(),definitionDestinationString:F,definitionLabelString:_,definitionTitleString:R,emphasis:p(),hardBreakEscape:p(V),hardBreakTrailing:p(V),htmlFlow:p(ae),htmlFlowData:T,htmlText:p(P),htmlTextData:T,image:p(Z),label:G,labelText:ie,lineEnding:q,link:p(B),listItem:p(),listOrdered:p(),listUnordered:p(),paragraph:p(),referenceString:ue,resourceDestinationString:O,resourceTitleString:L,resource:X,setextHeading:p(Q),setextHeadingLineSequence:W,setextHeadingText:D,strong:p(),thematicBreak:p()}};Uw(n,(e||{}).mdastExtensions||[]);const a={};return r;function r(H){let le={type:"root",children:[]};const me={stack:[le],tokenStack:[],config:n,enter:d,exit:f,buffer:u,resume:y,data:a},ye=[];let I=-1;for(;++I<H.length;)if(H[I][1].type==="listOrdered"||H[I][1].type==="listUnordered")if(H[I][0]==="enter")ye.push(I);else{const Te=ye.pop();I=o(H,Te,I)}for(I=-1;++I<H.length;){const Te=n[H[I][0]];Pw.call(Te,H[I][1].type)&&Te[H[I][1].type].call(Object.assign({sliceSerialize:H[I][2].sliceSerialize},me),H[I][1])}if(me.tokenStack.length>0){const Te=me.tokenStack[me.tokenStack.length-1];(Te[1]||M1).call(me,void 0,Te[0])}for(le.position={start:Ti(H.length>0?H[0][1].start:{line:1,column:1,offset:0}),end:Ti(H.length>0?H[H.length-2][1].end:{line:1,column:1,offset:0})},I=-1;++I<n.transforms.length;)le=n.transforms[I](le)||le;return le}function o(H,le,me){let ye=le-1,I=-1,Te=!1,at,Ie,Xe,Ve;for(;++ye<=me;){const Se=H[ye];switch(Se[1].type){case"listUnordered":case"listOrdered":case"blockQuote":{Se[0]==="enter"?I++:I--,Ve=void 0;break}case"lineEndingBlank":{Se[0]==="enter"&&(at&&!Ve&&!I&&!Xe&&(Xe=ye),Ve=void 0);break}case"linePrefix":case"listItemValue":case"listItemMarker":case"listItemPrefix":case"listItemPrefixWhitespace":break;default:Ve=void 0}if(!I&&Se[0]==="enter"&&Se[1].type==="listItemPrefix"||I===-1&&Se[0]==="exit"&&(Se[1].type==="listUnordered"||Se[1].type==="listOrdered")){if(at){let Vt=ye;for(Ie=void 0;Vt--;){const rt=H[Vt];if(rt[1].type==="lineEnding"||rt[1].type==="lineEndingBlank"){if(rt[0]==="exit")continue;Ie&&(H[Ie][1].type="lineEndingBlank",Te=!0),rt[1].type="lineEnding",Ie=Vt}else if(!(rt[1].type==="linePrefix"||rt[1].type==="blockQuotePrefix"||rt[1].type==="blockQuotePrefixWhitespace"||rt[1].type==="blockQuoteMarker"||rt[1].type==="listItemIndent"))break}Xe&&(!Ie||Xe<Ie)&&(at._spread=!0),at.end=Object.assign({},Ie?H[Ie][1].start:Se[1].end),H.splice(Ie||ye,0,["exit",at,Se[2]]),ye++,me++}if(Se[1].type==="listItemPrefix"){const Vt={type:"listItem",_spread:!1,start:Object.assign({},Se[1].start),end:void 0};at=Vt,H.splice(ye,0,["enter",Vt,Se[2]]),ye++,me++,Xe=void 0,Ve=!0}}}return H[le][1]._spread=Te,me}function s(H,le){return me;function me(ye){d.call(this,H(ye),ye),le&&le.call(this,ye)}}function u(){this.stack.push({type:"fragment",children:[]})}function d(H,le,me){this.stack[this.stack.length-1].children.push(H),this.stack.push(H),this.tokenStack.push([le,me||void 0]),H.position={start:Ti(le.start),end:void 0}}function p(H){return le;function le(me){H&&H.call(this,me),f.call(this,me)}}function f(H,le){const me=this.stack.pop(),ye=this.tokenStack.pop();if(ye)ye[0].type!==H.type&&(le?le.call(this,H,ye[0]):(ye[1]||M1).call(this,H,ye[0]));else throw new Error("Cannot close `"+H.type+"` ("+jo({start:H.start,end:H.end})+"): it’s not open");me.position.end=Ti(H.end)}function y(){return Kh(this.stack.pop())}function g(){this.data.expectingFirstListItemValue=!0}function x(H){if(this.data.expectingFirstListItemValue){const le=this.stack[this.stack.length-2];le.start=Number.parseInt(this.sliceSerialize(H),10),this.data.expectingFirstListItemValue=void 0}}function b(){const H=this.resume(),le=this.stack[this.stack.length-1];le.lang=H}function k(){const H=this.resume(),le=this.stack[this.stack.length-1];le.meta=H}function C(){this.data.flowCodeInside||(this.buffer(),this.data.flowCodeInside=!0)}function j(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H.replace(/^(\r?\n|\r)|(\r?\n|\r)$/g,""),this.data.flowCodeInside=void 0}function E(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H.replace(/(\r?\n|\r)$/g,"")}function _(H){const le=this.resume(),me=this.stack[this.stack.length-1];me.label=le,me.identifier=da(this.sliceSerialize(H)).toLowerCase()}function R(){const H=this.resume(),le=this.stack[this.stack.length-1];le.title=H}function F(){const H=this.resume(),le=this.stack[this.stack.length-1];le.url=H}function U(H){const le=this.stack[this.stack.length-1];if(!le.depth){const me=this.sliceSerialize(H).length;le.depth=me}}function D(){this.data.setextHeadingSlurpLineEnding=!0}function W(H){const le=this.stack[this.stack.length-1];le.depth=this.sliceSerialize(H).codePointAt(0)===61?1:2}function Q(){this.data.setextHeadingSlurpLineEnding=void 0}function M(H){const me=this.stack[this.stack.length-1].children;let ye=me[me.length-1];(!ye||ye.type!=="text")&&(ye=it(),ye.position={start:Ti(H.start),end:void 0},me.push(ye)),this.stack.push(ye)}function T(H){const le=this.stack.pop();le.value+=this.sliceSerialize(H),le.position.end=Ti(H.end)}function q(H){const le=this.stack[this.stack.length-1];if(this.data.atHardBreak){const me=le.children[le.children.length-1];me.position.end=Ti(H.end),this.data.atHardBreak=void 0;return}!this.data.setextHeadingSlurpLineEnding&&n.canContainEols.includes(le.type)&&(M.call(this,H),T.call(this,H))}function V(){this.data.atHardBreak=!0}function ae(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H}function P(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H}function K(){const H=this.resume(),le=this.stack[this.stack.length-1];le.value=H}function B(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=le,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function Z(){const H=this.stack[this.stack.length-1];if(this.data.inReference){const le=this.data.referenceType||"shortcut";H.type+="Reference",H.referenceType=le,delete H.url,delete H.title}else delete H.identifier,delete H.label;this.data.referenceType=void 0}function ie(H){const le=this.sliceSerialize(H),me=this.stack[this.stack.length-2];me.label=eD(le),me.identifier=da(le).toLowerCase()}function G(){const H=this.stack[this.stack.length-1],le=this.resume(),me=this.stack[this.stack.length-1];if(this.data.inReference=!0,me.type==="link"){const ye=H.children;me.children=ye}else me.alt=le}function O(){const H=this.resume(),le=this.stack[this.stack.length-1];le.url=H}function L(){const H=this.resume(),le=this.stack[this.stack.length-1];le.title=H}function X(){this.data.inReference=void 0}function N(){this.data.referenceType="collapsed"}function ue(H){const le=this.resume(),me=this.stack[this.stack.length-1];me.label=le,me.identifier=da(this.sliceSerialize(H)).toLowerCase(),this.data.referenceType="full"}function pe(H){this.data.characterReferenceType=H.type}function he(H){const le=this.sliceSerialize(H),me=this.data.characterReferenceType;let ye;me?(ye=Tw(le,me==="characterReferenceMarkerNumeric"?10:16),this.data.characterReferenceType=void 0):ye=Qh(le);const I=this.stack[this.stack.length-1];I.value+=ye}function Ee(H){const le=this.stack.pop();le.position.end=Ti(H.end)}function Ue(H){T.call(this,H);const le=this.stack[this.stack.length-1];le.url=this.sliceSerialize(H)}function Ne(H){T.call(this,H);const le=this.stack[this.stack.length-1];le.url="mailto:"+this.sliceSerialize(H)}function et(){return{type:"blockquote",children:[]}}function Ot(){return{type:"code",lang:null,meta:null,value:""}}function xt(){return{type:"inlineCode",value:""}}function bt(){return{type:"definition",identifier:"",label:null,title:null,url:""}}function yt(){return{type:"emphasis",children:[]}}function Zt(){return{type:"heading",depth:0,children:[]}}function Pe(){return{type:"break"}}function pt(){return{type:"html",value:""}}function Dt(){return{type:"image",title:null,url:"",alt:null}}function Nt(){return{type:"link",title:null,url:"",children:[]}}function ge(H){return{type:"list",ordered:H.type==="listOrdered",start:null,spread:H._spread,children:[]}}function Mt(H){return{type:"listItem",spread:H._spread,checked:null,children:[]}}function Fn(){return{type:"paragraph",children:[]}}function yn(){return{type:"strong",children:[]}}function it(){return{type:"text",value:""}}function fe(){return{type:"thematicBreak"}}}function Ti(e){return{line:e.line,column:e.column,offset:e.offset}}function Uw(e,n){let a=-1;for(;++a<n.length;){const r=n[a];Array.isArray(r)?Uw(e,r):iD(e,r)}}function iD(e,n){let a;for(a in n)if(Pw.call(n,a))switch(a){case"canContainEols":{const r=n[a];r&&e[a].push(...r);break}case"transforms":{const r=n[a];r&&e[a].push(...r);break}case"enter":case"exit":{const r=n[a];r&&Object.assign(e[a],r);break}}}function M1(e,n){throw e?new Error("Cannot close `"+e.type+"` ("+jo({start:e.start,end:e.end})+"): a different token (`"+n.type+"`, "+jo({start:n.start,end:n.end})+") is open"):new Error("Cannot close document, a token (`"+n.type+"`, "+jo({start:n.start,end:n.end})+") is still open")}function rD(e){const n=this;n.parser=a;function a(r){return nD(r,{...n.data("settings"),...e,extensions:n.data("micromarkExtensions")||[],mdastExtensions:n.data("fromMarkdownExtensions")||[]})}}function lD(e,n){const a={type:"element",tagName:"blockquote",properties:{},children:e.wrap(e.all(n),!0)};return e.patch(n,a),e.applyData(n,a)}function oD(e,n){const a={type:"element",tagName:"br",properties:{},children:[]};return e.patch(n,a),[e.applyData(n,a),{type:"text",value:`
|
|
1142
|
+
`}]}function sD(e,n){const a=n.value?n.value+`
|
|
1143
|
+
`:"",r={},o=n.lang?n.lang.split(/\s+/):[];o.length>0&&(r.className=["language-"+o[0]]);let s={type:"element",tagName:"code",properties:r,children:[{type:"text",value:a}]};return n.meta&&(s.data={meta:n.meta}),e.patch(n,s),s=e.applyData(n,s),s={type:"element",tagName:"pre",properties:{},children:[s]},e.patch(n,s),s}function cD(e,n){const a={type:"element",tagName:"del",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function uD(e,n){const a={type:"element",tagName:"em",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function dD(e,n){const a=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",r=String(n.identifier).toUpperCase(),o=yl(r.toLowerCase()),s=e.footnoteOrder.indexOf(r);let u,d=e.footnoteCounts.get(r);d===void 0?(d=0,e.footnoteOrder.push(r),u=e.footnoteOrder.length):u=s+1,d+=1,e.footnoteCounts.set(r,d);const p={type:"element",tagName:"a",properties:{href:"#"+a+"fn-"+o,id:a+"fnref-"+o+(d>1?"-"+d:""),dataFootnoteRef:!0,ariaDescribedBy:["footnote-label"]},children:[{type:"text",value:String(u)}]};e.patch(n,p);const f={type:"element",tagName:"sup",properties:{},children:[p]};return e.patch(n,f),e.applyData(n,f)}function fD(e,n){const a={type:"element",tagName:"h"+n.depth,properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function pD(e,n){if(e.options.allowDangerousHtml){const a={type:"raw",value:n.value};return e.patch(n,a),e.applyData(n,a)}}function Bw(e,n){const a=n.referenceType;let r="]";if(a==="collapsed"?r+="[]":a==="full"&&(r+="["+(n.label||n.identifier)+"]"),n.type==="imageReference")return[{type:"text",value:"!["+n.alt+r}];const o=e.all(n),s=o[0];s&&s.type==="text"?s.value="["+s.value:o.unshift({type:"text",value:"["});const u=o[o.length-1];return u&&u.type==="text"?u.value+=r:o.push({type:"text",value:r}),o}function hD(e,n){const a=String(n.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Bw(e,n);const o={src:yl(r.url||""),alt:n.alt};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"img",properties:o,children:[]};return e.patch(n,s),e.applyData(n,s)}function mD(e,n){const a={src:yl(n.url)};n.alt!==null&&n.alt!==void 0&&(a.alt=n.alt),n.title!==null&&n.title!==void 0&&(a.title=n.title);const r={type:"element",tagName:"img",properties:a,children:[]};return e.patch(n,r),e.applyData(n,r)}function gD(e,n){const a={type:"text",value:n.value.replace(/\r?\n|\r/g," ")};e.patch(n,a);const r={type:"element",tagName:"code",properties:{},children:[a]};return e.patch(n,r),e.applyData(n,r)}function yD(e,n){const a=String(n.identifier).toUpperCase(),r=e.definitionById.get(a);if(!r)return Bw(e,n);const o={href:yl(r.url||"")};r.title!==null&&r.title!==void 0&&(o.title=r.title);const s={type:"element",tagName:"a",properties:o,children:e.all(n)};return e.patch(n,s),e.applyData(n,s)}function vD(e,n){const a={href:yl(n.url)};n.title!==null&&n.title!==void 0&&(a.title=n.title);const r={type:"element",tagName:"a",properties:a,children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function xD(e,n,a){const r=e.all(n),o=a?bD(a):Hw(n),s={},u=[];if(typeof n.checked=="boolean"){const y=r[0];let g;y&&y.type==="element"&&y.tagName==="p"?g=y:(g={type:"element",tagName:"p",properties:{},children:[]},r.unshift(g)),g.children.length>0&&g.children.unshift({type:"text",value:" "}),g.children.unshift({type:"element",tagName:"input",properties:{type:"checkbox",checked:n.checked,disabled:!0},children:[]}),s.className=["task-list-item"]}let d=-1;for(;++d<r.length;){const y=r[d];(o||d!==0||y.type!=="element"||y.tagName!=="p")&&u.push({type:"text",value:`
|
|
1144
|
+
`}),y.type==="element"&&y.tagName==="p"&&!o?u.push(...y.children):u.push(y)}const p=r[r.length-1];p&&(o||p.type!=="element"||p.tagName!=="p")&&u.push({type:"text",value:`
|
|
1145
|
+
`});const f={type:"element",tagName:"li",properties:s,children:u};return e.patch(n,f),e.applyData(n,f)}function bD(e){let n=!1;if(e.type==="list"){n=e.spread||!1;const a=e.children;let r=-1;for(;!n&&++r<a.length;)n=Hw(a[r])}return n}function Hw(e){const n=e.spread;return n??e.children.length>1}function wD(e,n){const a={},r=e.all(n);let o=-1;for(typeof n.start=="number"&&n.start!==1&&(a.start=n.start);++o<r.length;){const u=r[o];if(u.type==="element"&&u.tagName==="li"&&u.properties&&Array.isArray(u.properties.className)&&u.properties.className.includes("task-list-item")){a.className=["contains-task-list"];break}}const s={type:"element",tagName:n.ordered?"ol":"ul",properties:a,children:e.wrap(r,!0)};return e.patch(n,s),e.applyData(n,s)}function SD(e,n){const a={type:"element",tagName:"p",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function kD(e,n){const a={type:"root",children:e.wrap(e.all(n))};return e.patch(n,a),e.applyData(n,a)}function CD(e,n){const a={type:"element",tagName:"strong",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}function ED(e,n){const a=e.all(n),r=a.shift(),o=[];if(r){const u={type:"element",tagName:"thead",properties:{},children:e.wrap([r],!0)};e.patch(n.children[0],u),o.push(u)}if(a.length>0){const u={type:"element",tagName:"tbody",properties:{},children:e.wrap(a,!0)},d=Gh(n.children[1]),p=bw(n.children[n.children.length-1]);d&&p&&(u.position={start:d,end:p}),o.push(u)}const s={type:"element",tagName:"table",properties:{},children:e.wrap(o,!0)};return e.patch(n,s),e.applyData(n,s)}function AD(e,n,a){const r=a?a.children:void 0,s=(r?r.indexOf(n):1)===0?"th":"td",u=a&&a.type==="table"?a.align:void 0,d=u?u.length:n.children.length;let p=-1;const f=[];for(;++p<d;){const g=n.children[p],x={},b=u?u[p]:void 0;b&&(x.align=b);let k={type:"element",tagName:s,properties:x,children:[]};g&&(k.children=e.all(g),e.patch(g,k),k=e.applyData(g,k)),f.push(k)}const y={type:"element",tagName:"tr",properties:{},children:e.wrap(f,!0)};return e.patch(n,y),e.applyData(n,y)}function jD(e,n){const a={type:"element",tagName:"td",properties:{},children:e.all(n)};return e.patch(n,a),e.applyData(n,a)}const L1=9,z1=32;function TD(e){const n=String(e),a=/\r?\n|\r/g;let r=a.exec(n),o=0;const s=[];for(;r;)s.push(I1(n.slice(o,r.index),o>0,!0),r[0]),o=r.index+r[0].length,r=a.exec(n);return s.push(I1(n.slice(o),o>0,!1)),s.join("")}function I1(e,n,a){let r=0,o=e.length;if(n){let s=e.codePointAt(r);for(;s===L1||s===z1;)r++,s=e.codePointAt(r)}if(a){let s=e.codePointAt(o-1);for(;s===L1||s===z1;)o--,s=e.codePointAt(o-1)}return o>r?e.slice(r,o):""}function ND(e,n){const a={type:"text",value:TD(String(n.value))};return e.patch(n,a),e.applyData(n,a)}function RD(e,n){const a={type:"element",tagName:"hr",properties:{},children:[]};return e.patch(n,a),e.applyData(n,a)}const _D={blockquote:lD,break:oD,code:sD,delete:cD,emphasis:uD,footnoteReference:dD,heading:fD,html:pD,imageReference:hD,image:mD,inlineCode:gD,linkReference:yD,link:vD,listItem:xD,list:wD,paragraph:SD,root:kD,strong:CD,table:ED,tableCell:jD,tableRow:AD,text:ND,thematicBreak:RD,toml:gc,yaml:gc,definition:gc,footnoteDefinition:gc};function gc(){}const $w=-1,uu=0,No=1,Wc=2,Zh=3,Jh=4,em=5,tm=6,qw=7,Fw=8,OD=typeof self=="object"?self:globalThis,P1=(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 OD[e](n)},DD=(e,n)=>{const a=(o,s)=>(e.set(s,o),o),r=o=>{if(e.has(o))return e.get(o);const[s,u]=n[o];switch(s){case uu:case $w:return a(u,o);case No:{const d=a([],o);for(const p of u)d.push(r(p));return d}case Wc:{const d=a({},o);for(const[p,f]of u)d[r(p)]=r(f);return d}case Zh:return a(new Date(u),o);case Jh:{const{source:d,flags:p}=u;return a(new RegExp(d,p),o)}case em:{const d=a(new Map,o);for(const[p,f]of u)d.set(r(p),r(f));return d}case tm:{const d=a(new Set,o);for(const p of u)d.add(r(p));return d}case qw:{const{name:d,message:p}=u;return a(P1(d,p),o)}case Fw:return a(BigInt(u),o);case"BigInt":return a(Object(BigInt(u)),o);case"ArrayBuffer":return a(new Uint8Array(u).buffer,u);case"DataView":{const{buffer:d}=new Uint8Array(u);return a(new DataView(d),u)}}return a(P1(s,u),o)};return r},U1=e=>DD(new Map,e)(0),el="",{toString:MD}={},{keys:LD}=Object,xo=e=>{const n=typeof e;if(n!=="object"||!e)return[uu,n];const a=MD.call(e).slice(8,-1);switch(a){case"Array":return[No,el];case"Object":return[Wc,el];case"Date":return[Zh,el];case"RegExp":return[Jh,el];case"Map":return[em,el];case"Set":return[tm,el];case"DataView":return[No,a]}return a.includes("Array")?[No,a]:a.includes("Error")?[qw,a]:[Wc,a]},yc=([e,n])=>e===uu&&(n==="function"||n==="symbol"),zD=(e,n,a,r)=>{const o=(u,d)=>{const p=r.push(u)-1;return a.set(d,p),p},s=u=>{if(a.has(u))return a.get(u);let[d,p]=xo(u);switch(d){case uu:{let y=u;switch(p){case"bigint":d=Fw,y=u.toString();break;case"function":case"symbol":if(e)throw new TypeError("unable to serialize "+p);y=null;break;case"undefined":return o([$w],u)}return o([d,y],u)}case No:{if(p){let x=u;return p==="DataView"?x=new Uint8Array(u.buffer):p==="ArrayBuffer"&&(x=new Uint8Array(u)),o([p,[...x]],u)}const y=[],g=o([d,y],u);for(const x of u)y.push(s(x));return g}case Wc:{if(p)switch(p){case"BigInt":return o([p,u.toString()],u);case"Boolean":case"Number":case"String":return o([p,u.valueOf()],u)}if(n&&"toJSON"in u)return s(u.toJSON());const y=[],g=o([d,y],u);for(const x of LD(u))(e||!yc(xo(u[x])))&&y.push([s(x),s(u[x])]);return g}case Zh:return o([d,u.toISOString()],u);case Jh:{const{source:y,flags:g}=u;return o([d,{source:y,flags:g}],u)}case em:{const y=[],g=o([d,y],u);for(const[x,b]of u)(e||!(yc(xo(x))||yc(xo(b))))&&y.push([s(x),s(b)]);return g}case tm:{const y=[],g=o([d,y],u);for(const x of u)(e||!yc(xo(x)))&&y.push(s(x));return g}}const{message:f}=u;return o([d,{name:p,message:f}],u)};return s},B1=(e,{json:n,lossy:a}={})=>{const r=[];return zD(!(n||a),!!n,new Map,r)(e),r},Yc=typeof structuredClone=="function"?(e,n)=>n&&("json"in n||"lossy"in n)?U1(B1(e,n)):structuredClone(e):(e,n)=>U1(B1(e,n));function ID(e,n){const a=[{type:"text",value:"↩"}];return n>1&&a.push({type:"element",tagName:"sup",properties:{},children:[{type:"text",value:String(n)}]}),a}function PD(e,n){return"Back to reference "+(e+1)+(n>1?"-"+n:"")}function UD(e){const n=typeof e.options.clobberPrefix=="string"?e.options.clobberPrefix:"user-content-",a=e.options.footnoteBackContent||ID,r=e.options.footnoteBackLabel||PD,o=e.options.footnoteLabel||"Footnotes",s=e.options.footnoteLabelTagName||"h2",u=e.options.footnoteLabelProperties||{className:["sr-only"]},d=[];let p=-1;for(;++p<e.footnoteOrder.length;){const f=e.footnoteById.get(e.footnoteOrder[p]);if(!f)continue;const y=e.all(f),g=String(f.identifier).toUpperCase(),x=yl(g.toLowerCase());let b=0;const k=[],C=e.footnoteCounts.get(g);for(;C!==void 0&&++b<=C;){k.length>0&&k.push({type:"text",value:" "});let _=typeof a=="string"?a:a(p,b);typeof _=="string"&&(_={type:"text",value:_}),k.push({type:"element",tagName:"a",properties:{href:"#"+n+"fnref-"+x+(b>1?"-"+b:""),dataFootnoteBackref:"",ariaLabel:typeof r=="string"?r:r(p,b),className:["data-footnote-backref"]},children:Array.isArray(_)?_:[_]})}const j=y[y.length-1];if(j&&j.type==="element"&&j.tagName==="p"){const _=j.children[j.children.length-1];_&&_.type==="text"?_.value+=" ":j.children.push({type:"text",value:" "}),j.children.push(...k)}else y.push(...k);const E={type:"element",tagName:"li",properties:{id:n+"fn-"+x},children:e.wrap(y,!0)};e.patch(f,E),d.push(E)}if(d.length!==0)return{type:"element",tagName:"section",properties:{dataFootnotes:!0,className:["footnotes"]},children:[{type:"element",tagName:s,properties:{...Yc(u),id:"footnote-label"},children:[{type:"text",value:o}]},{type:"text",value:`
|
|
1146
|
+
`},{type:"element",tagName:"ol",properties:{},children:e.wrap(d,!0)},{type:"text",value:`
|
|
1147
|
+
`}]}}const du=(function(e){if(e==null)return qD;if(typeof e=="function")return fu(e);if(typeof e=="object")return Array.isArray(e)?BD(e):HD(e);if(typeof e=="string")return $D(e);throw new Error("Expected function, string, or object as test")});function BD(e){const n=[];let a=-1;for(;++a<e.length;)n[a]=du(e[a]);return fu(r);function r(...o){let s=-1;for(;++s<n.length;)if(n[s].apply(this,o))return!0;return!1}}function HD(e){const n=e;return fu(a);function a(r){const o=r;let s;for(s in e)if(o[s]!==n[s])return!1;return!0}}function $D(e){return fu(n);function n(a){return a&&a.type===e}}function fu(e){return n;function n(a,r,o){return!!(FD(a)&&e.call(this,a,typeof r=="number"?r:void 0,o||void 0))}}function qD(){return!0}function FD(e){return e!==null&&typeof e=="object"&&"type"in e}const Gw=[],GD=!0,Qp=!1,VD="skip";function Vw(e,n,a,r){let o;typeof n=="function"&&typeof a!="function"?(r=a,a=n):o=n;const s=du(o),u=r?-1:1;d(e,void 0,[])();function d(p,f,y){const g=p&&typeof p=="object"?p:{};if(typeof g.type=="string"){const b=typeof g.tagName=="string"?g.tagName:typeof g.name=="string"?g.name:void 0;Object.defineProperty(x,"name",{value:"node ("+(p.type+(b?"<"+b+">":""))+")"})}return x;function x(){let b=Gw,k,C,j;if((!n||s(p,f,y[y.length-1]||void 0))&&(b=WD(a(p,y)),b[0]===Qp))return b;if("children"in p&&p.children){const E=p;if(E.children&&b[0]!==VD)for(C=(r?E.children.length:-1)+u,j=y.concat(E);C>-1&&C<E.children.length;){const _=E.children[C];if(k=d(_,C,j)(),k[0]===Qp)return k;C=typeof k[1]=="number"?k[1]:C+u}}return b}}}function WD(e){return Array.isArray(e)?e:typeof e=="number"?[GD,e]:e==null?Gw:[e]}function nm(e,n,a,r){let o,s,u;typeof n=="function"&&typeof a!="function"?(s=void 0,u=n,o=a):(s=n,u=a,o=r),Vw(e,s,d,o);function d(p,f){const y=f[f.length-1],g=y?y.children.indexOf(p):void 0;return u(p,g,y)}}const Xp={}.hasOwnProperty,YD={};function KD(e,n){const a=n||YD,r=new Map,o=new Map,s=new Map,u={..._D,...a.handlers},d={all:f,applyData:XD,definitionById:r,footnoteById:o,footnoteCounts:s,footnoteOrder:[],handlers:u,one:p,options:a,patch:QD,wrap:JD};return nm(e,function(y){if(y.type==="definition"||y.type==="footnoteDefinition"){const g=y.type==="definition"?r:o,x=String(y.identifier).toUpperCase();g.has(x)||g.set(x,y)}}),d;function p(y,g){const x=y.type,b=d.handlers[x];if(Xp.call(d.handlers,x)&&b)return b(d,y,g);if(d.options.passThrough&&d.options.passThrough.includes(x)){if("children"in y){const{children:C,...j}=y,E=Yc(j);return E.children=d.all(y),E}return Yc(y)}return(d.options.unknownHandler||ZD)(d,y,g)}function f(y){const g=[];if("children"in y){const x=y.children;let b=-1;for(;++b<x.length;){const k=d.one(x[b],y);if(k){if(b&&x[b-1].type==="break"&&(!Array.isArray(k)&&k.type==="text"&&(k.value=H1(k.value)),!Array.isArray(k)&&k.type==="element")){const C=k.children[0];C&&C.type==="text"&&(C.value=H1(C.value))}Array.isArray(k)?g.push(...k):g.push(k)}}}return g}}function QD(e,n){e.position&&(n.position=I3(e))}function XD(e,n){let a=n;if(e&&e.data){const r=e.data.hName,o=e.data.hChildren,s=e.data.hProperties;if(typeof r=="string")if(a.type==="element")a.tagName=r;else{const u="children"in a?a.children:[a];a={type:"element",tagName:r,properties:{},children:u}}a.type==="element"&&s&&Object.assign(a.properties,Yc(s)),"children"in a&&a.children&&o!==null&&o!==void 0&&(a.children=o)}return a}function ZD(e,n){const a=n.data||{},r="value"in n&&!(Xp.call(a,"hProperties")||Xp.call(a,"hChildren"))?{type:"text",value:n.value}:{type:"element",tagName:"div",properties:{},children:e.all(n)};return e.patch(n,r),e.applyData(n,r)}function JD(e,n){const a=[];let r=-1;for(n&&a.push({type:"text",value:`
|
|
1148
|
+
`});++r<e.length;)r&&a.push({type:"text",value:`
|
|
1149
|
+
`}),a.push(e[r]);return n&&e.length>0&&a.push({type:"text",value:`
|
|
1150
|
+
`}),a}function H1(e){let n=0,a=e.charCodeAt(n);for(;a===9||a===32;)n++,a=e.charCodeAt(n);return e.slice(n)}function $1(e,n){const a=KD(e,n),r=a.one(e,void 0),o=UD(a),s=Array.isArray(r)?{type:"root",children:r}:r||{type:"root",children:[]};return o&&s.children.push({type:"text",value:`
|
|
1151
|
+
`},o),s}function eM(e,n){return e&&"run"in e?async function(a,r){const o=$1(a,{file:r,...n});await e.run(o,r)}:function(a,r){return $1(a,{file:r,...e||n})}}function q1(e){if(e)throw e}var sp,F1;function tM(){if(F1)return sp;F1=1;var e=Object.prototype.hasOwnProperty,n=Object.prototype.toString,a=Object.defineProperty,r=Object.getOwnPropertyDescriptor,o=function(f){return typeof Array.isArray=="function"?Array.isArray(f):n.call(f)==="[object Array]"},s=function(f){if(!f||n.call(f)!=="[object Object]")return!1;var y=e.call(f,"constructor"),g=f.constructor&&f.constructor.prototype&&e.call(f.constructor.prototype,"isPrototypeOf");if(f.constructor&&!y&&!g)return!1;var x;for(x in f);return typeof x>"u"||e.call(f,x)},u=function(f,y){a&&y.name==="__proto__"?a(f,y.name,{enumerable:!0,configurable:!0,value:y.newValue,writable:!0}):f[y.name]=y.newValue},d=function(f,y){if(y==="__proto__")if(e.call(f,y)){if(r)return r(f,y).value}else return;return f[y]};return sp=function p(){var f,y,g,x,b,k,C=arguments[0],j=1,E=arguments.length,_=!1;for(typeof C=="boolean"&&(_=C,C=arguments[1]||{},j=2),(C==null||typeof C!="object"&&typeof C!="function")&&(C={});j<E;++j)if(f=arguments[j],f!=null)for(y in f)g=d(C,y),x=d(f,y),C!==x&&(_&&x&&(s(x)||(b=o(x)))?(b?(b=!1,k=g&&o(g)?g:[]):k=g&&s(g)?g:{},u(C,{name:y,newValue:p(_,k,x)})):typeof x<"u"&&u(C,{name:y,newValue:x}));return C},sp}var nM=tM();const cp=Po(nM);function Zp(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 aM(){const e=[],n={run:a,use:r};return n;function a(...o){let s=-1;const u=o.pop();if(typeof u!="function")throw new TypeError("Expected function as last argument, not "+u);d(null,...o);function d(p,...f){const y=e[++s];let g=-1;if(p){u(p);return}for(;++g<o.length;)(f[g]===null||f[g]===void 0)&&(f[g]=o[g]);o=f,y?iM(y,d)(...f):u(null,...f)}}function r(o){if(typeof o!="function")throw new TypeError("Expected `middelware` to be a function, not "+o);return e.push(o),n}}function iM(e,n){let a;return r;function r(...u){const d=e.length>u.length;let p;d&&u.push(o);try{p=e.apply(this,u)}catch(f){const y=f;if(d&&a)throw y;return o(y)}d||(p&&p.then&&typeof p.then=="function"?p.then(s,o):p instanceof Error?o(p):s(p))}function o(u,...d){a||(a=!0,n(u,...d))}function s(u){o(null,u)}}const ka={basename:rM,dirname:lM,extname:oM,join:sM,sep:"/"};function rM(e,n){if(n!==void 0&&typeof n!="string")throw new TypeError('"ext" argument must be a string');Go(e);let a=0,r=-1,o=e.length,s;if(n===void 0||n.length===0||n.length>e.length){for(;o--;)if(e.codePointAt(o)===47){if(s){a=o+1;break}}else r<0&&(s=!0,r=o+1);return r<0?"":e.slice(a,r)}if(n===e)return"";let u=-1,d=n.length-1;for(;o--;)if(e.codePointAt(o)===47){if(s){a=o+1;break}}else u<0&&(s=!0,u=o+1),d>-1&&(e.codePointAt(o)===n.codePointAt(d--)?d<0&&(r=o):(d=-1,r=u));return a===r?r=u:r<0&&(r=e.length),e.slice(a,r)}function lM(e){if(Go(e),e.length===0)return".";let n=-1,a=e.length,r;for(;--a;)if(e.codePointAt(a)===47){if(r){n=a;break}}else r||(r=!0);return n<0?e.codePointAt(0)===47?"/":".":n===1&&e.codePointAt(0)===47?"//":e.slice(0,n)}function oM(e){Go(e);let n=e.length,a=-1,r=0,o=-1,s=0,u;for(;n--;){const d=e.codePointAt(n);if(d===47){if(u){r=n+1;break}continue}a<0&&(u=!0,a=n+1),d===46?o<0?o=n:s!==1&&(s=1):o>-1&&(s=-1)}return o<0||a<0||s===0||s===1&&o===a-1&&o===r+1?"":e.slice(o,a)}function sM(...e){let n=-1,a;for(;++n<e.length;)Go(e[n]),e[n]&&(a=a===void 0?e[n]:a+"/"+e[n]);return a===void 0?".":cM(a)}function cM(e){Go(e);const n=e.codePointAt(0)===47;let a=uM(e,!n);return a.length===0&&!n&&(a="."),a.length>0&&e.codePointAt(e.length-1)===47&&(a+="/"),n?"/"+a:a}function uM(e,n){let a="",r=0,o=-1,s=0,u=-1,d,p;for(;++u<=e.length;){if(u<e.length)d=e.codePointAt(u);else{if(d===47)break;d=47}if(d===47){if(!(o===u-1||s===1))if(o!==u-1&&s===2){if(a.length<2||r!==2||a.codePointAt(a.length-1)!==46||a.codePointAt(a.length-2)!==46){if(a.length>2){if(p=a.lastIndexOf("/"),p!==a.length-1){p<0?(a="",r=0):(a=a.slice(0,p),r=a.length-1-a.lastIndexOf("/")),o=u,s=0;continue}}else if(a.length>0){a="",r=0,o=u,s=0;continue}}n&&(a=a.length>0?a+"/..":"..",r=2)}else a.length>0?a+="/"+e.slice(o+1,u):a=e.slice(o+1,u),r=u-o-1;o=u,s=0}else d===46&&s>-1?s++:s=-1}return a}function Go(e){if(typeof e!="string")throw new TypeError("Path must be a string. Received "+JSON.stringify(e))}const dM={cwd:fM};function fM(){return"/"}function Jp(e){return!!(e!==null&&typeof e=="object"&&"href"in e&&e.href&&"protocol"in e&&e.protocol&&e.auth===void 0)}function pM(e){if(typeof e=="string")e=new URL(e);else if(!Jp(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 hM(e)}function hM(e){if(e.hostname!==""){const r=new TypeError('File URL host must be "localhost" or empty on darwin');throw r.code="ERR_INVALID_FILE_URL_HOST",r}const n=e.pathname;let a=-1;for(;++a<n.length;)if(n.codePointAt(a)===37&&n.codePointAt(a+1)===50){const r=n.codePointAt(a+2);if(r===70||r===102){const o=new TypeError("File URL path must not include encoded / characters");throw o.code="ERR_INVALID_FILE_URL_PATH",o}}return decodeURIComponent(n)}const up=["history","path","basename","stem","extname","dirname"];class Ww{constructor(n){let a;n?Jp(n)?a={path:n}:typeof n=="string"||mM(n)?a={value:n}:a=n:a={},this.cwd="cwd"in a?"":dM.cwd(),this.data={},this.history=[],this.messages=[],this.value,this.map,this.result,this.stored;let r=-1;for(;++r<up.length;){const s=up[r];s in a&&a[s]!==void 0&&a[s]!==null&&(this[s]=s==="history"?[...a[s]]:a[s])}let o;for(o in a)up.includes(o)||(this[o]=a[o])}get basename(){return typeof this.path=="string"?ka.basename(this.path):void 0}set basename(n){fp(n,"basename"),dp(n,"basename"),this.path=ka.join(this.dirname||"",n)}get dirname(){return typeof this.path=="string"?ka.dirname(this.path):void 0}set dirname(n){G1(this.basename,"dirname"),this.path=ka.join(n||"",this.basename)}get extname(){return typeof this.path=="string"?ka.extname(this.path):void 0}set extname(n){if(dp(n,"extname"),G1(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=ka.join(this.dirname,this.stem+(n||""))}get path(){return this.history[this.history.length-1]}set path(n){Jp(n)&&(n=pM(n)),fp(n,"path"),this.path!==n&&this.history.push(n)}get stem(){return typeof this.path=="string"?ka.basename(this.path,this.extname):void 0}set stem(n){fp(n,"stem"),dp(n,"stem"),this.path=ka.join(this.dirname||"",n+(this.extname||""))}fail(n,a,r){const o=this.message(n,a,r);throw o.fatal=!0,o}info(n,a,r){const o=this.message(n,a,r);return o.fatal=void 0,o}message(n,a,r){const o=new sn(n,a,r);return this.path&&(o.name=this.path+":"+o.name,o.file=this.path),o.fatal=!1,this.messages.push(o),o}toString(n){return this.value===void 0?"":typeof this.value=="string"?this.value:new TextDecoder(n||void 0).decode(this.value)}}function dp(e,n){if(e&&e.includes(ka.sep))throw new Error("`"+n+"` cannot be a path: did not expect `"+ka.sep+"`")}function fp(e,n){if(!e)throw new Error("`"+n+"` cannot be empty")}function G1(e,n){if(!e)throw new Error("Setting `"+n+"` requires `path` to be set too")}function mM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const gM=(function(e){const r=this.constructor.prototype,o=r[e],s=function(){return o.apply(s,arguments)};return Object.setPrototypeOf(s,r),s}),yM={}.hasOwnProperty;class am extends gM{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=aM()}copy(){const n=new am;let a=-1;for(;++a<this.attachers.length;){const r=this.attachers[a];n.use(...r)}return n.data(cp(!0,{},this.namespace)),n}data(n,a){return typeof n=="string"?arguments.length===2?(mp("data",this.frozen),this.namespace[n]=a,this):yM.call(this.namespace,n)&&this.namespace[n]||void 0:n?(mp("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[a,...r]=this.attachers[this.freezeIndex];if(r[0]===!1)continue;r[0]===!0&&(r[0]=void 0);const o=a.call(n,...r);typeof o=="function"&&this.transformers.use(o)}return this.frozen=!0,this.freezeIndex=Number.POSITIVE_INFINITY,this}parse(n){this.freeze();const a=vc(n),r=this.parser||this.Parser;return pp("parse",r),r(String(a),a)}process(n,a){const r=this;return this.freeze(),pp("process",this.parser||this.Parser),hp("process",this.compiler||this.Compiler),a?o(void 0,a):new Promise(o);function o(s,u){const d=vc(n),p=r.parse(d);r.run(p,d,function(y,g,x){if(y||!g||!x)return f(y);const b=g,k=r.stringify(b,x);bM(k)?x.value=k:x.result=k,f(y,x)});function f(y,g){y||!g?u(y):s?s(g):a(void 0,g)}}}processSync(n){let a=!1,r;return this.freeze(),pp("processSync",this.parser||this.Parser),hp("processSync",this.compiler||this.Compiler),this.process(n,o),W1("processSync","process",a),r;function o(s,u){a=!0,q1(s),r=u}}run(n,a,r){V1(n),this.freeze();const o=this.transformers;return!r&&typeof a=="function"&&(r=a,a=void 0),r?s(void 0,r):new Promise(s);function s(u,d){const p=vc(a);o.run(n,p,f);function f(y,g,x){const b=g||n;y?d(y):u?u(b):r(void 0,b,x)}}}runSync(n,a){let r=!1,o;return this.run(n,a,s),W1("runSync","run",r),o;function s(u,d){q1(u),o=d,r=!0}}stringify(n,a){this.freeze();const r=vc(a),o=this.compiler||this.Compiler;return hp("stringify",o),V1(n),o(n,r)}use(n,...a){const r=this.attachers,o=this.namespace;if(mp("use",this.frozen),n!=null)if(typeof n=="function")p(n,a);else if(typeof n=="object")Array.isArray(n)?d(n):u(n);else throw new TypeError("Expected usable value, not `"+n+"`");return this;function s(f){if(typeof f=="function")p(f,[]);else if(typeof f=="object")if(Array.isArray(f)){const[y,...g]=f;p(y,g)}else u(f);else throw new TypeError("Expected usable value, not `"+f+"`")}function u(f){if(!("plugins"in f)&&!("settings"in f))throw new Error("Expected usable value but received an empty preset, which is probably a mistake: presets typically come with `plugins` and sometimes with `settings`, but this has neither");d(f.plugins),f.settings&&(o.settings=cp(!0,o.settings,f.settings))}function d(f){let y=-1;if(f!=null)if(Array.isArray(f))for(;++y<f.length;){const g=f[y];s(g)}else throw new TypeError("Expected a list of plugins, not `"+f+"`")}function p(f,y){let g=-1,x=-1;for(;++g<r.length;)if(r[g][0]===f){x=g;break}if(x===-1)r.push([f,...y]);else if(y.length>0){let[b,...k]=y;const C=r[x][1];Zp(C)&&Zp(b)&&(b=cp(!0,C,b)),r[x]=[f,b,...k]}}}}const vM=new am().freeze();function pp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `parser`")}function hp(e,n){if(typeof n!="function")throw new TypeError("Cannot `"+e+"` without `compiler`")}function mp(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 V1(e){if(!Zp(e)||typeof e.type!="string")throw new TypeError("Expected node, got `"+e+"`")}function W1(e,n,a){if(!a)throw new Error("`"+e+"` finished async. Use `"+n+"` instead")}function vc(e){return xM(e)?e:new Ww(e)}function xM(e){return!!(e&&typeof e=="object"&&"message"in e&&"messages"in e)}function bM(e){return typeof e=="string"||wM(e)}function wM(e){return!!(e&&typeof e=="object"&&"byteLength"in e&&"byteOffset"in e)}const SM="https://github.com/remarkjs/react-markdown/blob/main/changelog.md",Y1=[],K1={allowDangerousHtml:!0},kM=/^(https?|ircs?|mailto|xmpp)$/i,CM=[{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 EM(e){const n=AM(e),a=jM(e);return TM(n.runSync(n.parse(a),a),e)}function AM(e){const n=e.rehypePlugins||Y1,a=e.remarkPlugins||Y1,r=e.remarkRehypeOptions?{...e.remarkRehypeOptions,...K1}:K1;return vM().use(rD).use(a).use(eM,r).use(n)}function jM(e){const n=e.children||"",a=new Ww;return typeof n=="string"&&(a.value=n),a}function TM(e,n){const a=n.allowedElements,r=n.allowElement,o=n.components,s=n.disallowedElements,u=n.skipHtml,d=n.unwrapDisallowed,p=n.urlTransform||NM;for(const y of CM)Object.hasOwn(n,y.from)&&(""+y.from+(y.to?"use `"+y.to+"` instead":"remove it")+SM+y.id,void 0);return nm(e,f),$3(e,{Fragment:m.Fragment,components:o,ignoreInvalidStyle:!0,jsx:m.jsx,jsxs:m.jsxs,passKeys:!0,passNode:!0});function f(y,g,x){if(y.type==="raw"&&x&&typeof g=="number")return u?x.children.splice(g,1):x.children[g]={type:"text",value:y.value},g;if(y.type==="element"){let b;for(b in rp)if(Object.hasOwn(rp,b)&&Object.hasOwn(y.properties,b)){const k=y.properties[b],C=rp[b];(C===null||C.includes(y.tagName))&&(y.properties[b]=p(String(k||""),b,y))}}if(y.type==="element"){let b=a?!a.includes(y.tagName):s?s.includes(y.tagName):!1;if(!b&&r&&typeof g=="number"&&(b=!r(y,g,x)),b&&x&&typeof g=="number")return d&&y.children?x.children.splice(g,1,...y.children):x.children.splice(g,1),g}}}function NM(e){const n=e.indexOf(":"),a=e.indexOf("?"),r=e.indexOf("#"),o=e.indexOf("/");return n===-1||o!==-1&&n>o||a!==-1&&n>a||r!==-1&&n>r||kM.test(e.slice(0,n))?e:""}function Q1(e,n){const a=String(e);if(typeof n!="string")throw new TypeError("Expected character");let r=0,o=a.indexOf(n);for(;o!==-1;)r++,o=a.indexOf(n,o+n.length);return r}function RM(e){if(typeof e!="string")throw new TypeError("Expected a string");return e.replace(/[|\\{}()[\]^$+*?.]/g,"\\$&").replace(/-/g,"\\x2d")}function Yw(e,n,a){const o=du((a||{}).ignore||[]),s=_M(n);let u=-1;for(;++u<s.length;)Vw(e,"text",d);function d(f,y){let g=-1,x;for(;++g<y.length;){const b=y[g],k=x?x.children:void 0;if(o(b,k?k.indexOf(b):void 0,x))return;x=b}if(x)return p(f,y)}function p(f,y){const g=y[y.length-1],x=s[u][0],b=s[u][1];let k=0;const j=g.children.indexOf(f);let E=!1,_=[];x.lastIndex=0;let R=x.exec(f.value);for(;R;){const F=R.index,U={index:R.index,input:R.input,stack:[...y,f]};let D=b(...R,U);if(typeof D=="string"&&(D=D.length>0?{type:"text",value:D}:void 0),D===!1?x.lastIndex=F+1:(k!==F&&_.push({type:"text",value:f.value.slice(k,F)}),Array.isArray(D)?_.push(...D):D&&_.push(D),k=F+R[0].length,E=!0),!x.global)break;R=x.exec(f.value)}return E?(k<f.value.length&&_.push({type:"text",value:f.value.slice(k)}),g.children.splice(j,1,..._)):_=[f],j+_.length}}function _M(e){const n=[];if(!Array.isArray(e))throw new TypeError("Expected find and replace tuple or list of tuples");const a=!e[0]||Array.isArray(e[0])?e:[e];let r=-1;for(;++r<a.length;){const o=a[r];n.push([OM(o[0]),DM(o[1])])}return n}function OM(e){return typeof e=="string"?new RegExp(RM(e),"g"):e}function DM(e){return typeof e=="function"?e:function(){return e}}const gp="phrasing",yp=["autolink","link","image","label"];function MM(){return{transforms:[HM],enter:{literalAutolink:zM,literalAutolinkEmail:vp,literalAutolinkHttp:vp,literalAutolinkWww:vp},exit:{literalAutolink:BM,literalAutolinkEmail:UM,literalAutolinkHttp:IM,literalAutolinkWww:PM}}}function LM(){return{unsafe:[{character:"@",before:"[+\\-.\\w]",after:"[\\-.\\w]",inConstruct:gp,notInConstruct:yp},{character:".",before:"[Ww]",after:"[\\-.\\w]",inConstruct:gp,notInConstruct:yp},{character:":",before:"[ps]",after:"\\/",inConstruct:gp,notInConstruct:yp}]}}function zM(e){this.enter({type:"link",title:null,url:"",children:[]},e)}function vp(e){this.config.enter.autolinkProtocol.call(this,e)}function IM(e){this.config.exit.autolinkProtocol.call(this,e)}function PM(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 UM(e){this.config.exit.autolinkEmail.call(this,e)}function BM(e){this.exit(e)}function HM(e){Yw(e,[[/(https?:\/\/|www(?=\.))([-.\w]+)([^ \t\r\n]*)/gi,$M],[new RegExp("(?<=^|\\s|\\p{P}|\\p{S})([-.\\w+]+)@([-\\w]+(?:\\.[-\\w]+)+)","gu"),qM]],{ignore:["link","linkReference"]})}function $M(e,n,a,r,o){let s="";if(!Kw(o)||(/^w/i.test(n)&&(a=n+a,n="",s="http://"),!FM(a)))return!1;const u=GM(a+r);if(!u[0])return!1;const d={type:"link",title:null,url:s+n+u[0],children:[{type:"text",value:n+u[0]}]};return u[1]?[d,{type:"text",value:u[1]}]:d}function qM(e,n,a,r){return!Kw(r,!0)||/[-\d_]$/.test(a)?!1:{type:"link",title:null,url:"mailto:"+n+"@"+a,children:[{type:"text",value:n+"@"+a}]}}function FM(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 GM(e){const n=/[!"&'),.:;<>?\]}]+$/.exec(e);if(!n)return[e,void 0];e=e.slice(0,n.index);let a=n[0],r=a.indexOf(")");const o=Q1(e,"(");let s=Q1(e,")");for(;r!==-1&&o>s;)e+=a.slice(0,r+1),a=a.slice(r+1),r=a.indexOf(")"),s++;return[e,a]}function Kw(e,n){const a=e.input.charCodeAt(e.index-1);return(e.index===0||cr(a)||su(a))&&(!n||a!==47)}Qw.peek=e6;function VM(){this.buffer()}function WM(e){this.enter({type:"footnoteReference",identifier:"",label:""},e)}function YM(){this.buffer()}function KM(e){this.enter({type:"footnoteDefinition",identifier:"",label:"",children:[]},e)}function QM(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=da(this.sliceSerialize(e)).toLowerCase(),a.label=n}function XM(e){this.exit(e)}function ZM(e){const n=this.resume(),a=this.stack[this.stack.length-1];a.type,a.identifier=da(this.sliceSerialize(e)).toLowerCase(),a.label=n}function JM(e){this.exit(e)}function e6(){return"["}function Qw(e,n,a,r){const o=a.createTracker(r);let s=o.move("[^");const u=a.enter("footnoteReference"),d=a.enter("reference");return s+=o.move(a.safe(a.associationId(e),{after:"]",before:s})),d(),u(),s+=o.move("]"),s}function t6(){return{enter:{gfmFootnoteCallString:VM,gfmFootnoteCall:WM,gfmFootnoteDefinitionLabelString:YM,gfmFootnoteDefinition:KM},exit:{gfmFootnoteCallString:QM,gfmFootnoteCall:XM,gfmFootnoteDefinitionLabelString:ZM,gfmFootnoteDefinition:JM}}}function n6(e){let n=!1;return e&&e.firstLineBlank&&(n=!0),{handlers:{footnoteDefinition:a,footnoteReference:Qw},unsafe:[{character:"[",inConstruct:["label","phrasing","reference"]}]};function a(r,o,s,u){const d=s.createTracker(u);let p=d.move("[^");const f=s.enter("footnoteDefinition"),y=s.enter("label");return p+=d.move(s.safe(s.associationId(r),{before:p,after:"]"})),y(),p+=d.move("]:"),r.children&&r.children.length>0&&(d.shift(4),p+=d.move((n?`
|
|
1152
|
+
`:" ")+s.indentLines(s.containerFlow(r,d.current()),n?Xw:a6))),f(),p}}function a6(e,n,a){return n===0?e:Xw(e,n,a)}function Xw(e,n,a){return(a?"":" ")+e}const i6=["autolink","destinationLiteral","destinationRaw","reference","titleQuote","titleApostrophe"];Zw.peek=c6;function r6(){return{canContainEols:["delete"],enter:{strikethrough:o6},exit:{strikethrough:s6}}}function l6(){return{unsafe:[{character:"~",inConstruct:"phrasing",notInConstruct:i6}],handlers:{delete:Zw}}}function o6(e){this.enter({type:"delete",children:[]},e)}function s6(e){this.exit(e)}function Zw(e,n,a,r){const o=a.createTracker(r),s=a.enter("strikethrough");let u=o.move("~~");return u+=a.containerPhrasing(e,{...o.current(),before:u,after:"~"}),u+=o.move("~~"),s(),u}function c6(){return"~"}function u6(e){return e.length}function d6(e,n){const a=n||{},r=(a.align||[]).concat(),o=a.stringLength||u6,s=[],u=[],d=[],p=[];let f=0,y=-1;for(;++y<e.length;){const C=[],j=[];let E=-1;for(e[y].length>f&&(f=e[y].length);++E<e[y].length;){const _=f6(e[y][E]);if(a.alignDelimiters!==!1){const R=o(_);j[E]=R,(p[E]===void 0||R>p[E])&&(p[E]=R)}C.push(_)}u[y]=C,d[y]=j}let g=-1;if(typeof r=="object"&&"length"in r)for(;++g<f;)s[g]=X1(r[g]);else{const C=X1(r);for(;++g<f;)s[g]=C}g=-1;const x=[],b=[];for(;++g<f;){const C=s[g];let j="",E="";C===99?(j=":",E=":"):C===108?j=":":C===114&&(E=":");let _=a.alignDelimiters===!1?1:Math.max(1,p[g]-j.length-E.length);const R=j+"-".repeat(_)+E;a.alignDelimiters!==!1&&(_=j.length+_+E.length,_>p[g]&&(p[g]=_),b[g]=_),x[g]=R}u.splice(1,0,x),d.splice(1,0,b),y=-1;const k=[];for(;++y<u.length;){const C=u[y],j=d[y];g=-1;const E=[];for(;++g<f;){const _=C[g]||"";let R="",F="";if(a.alignDelimiters!==!1){const U=p[g]-(j[g]||0),D=s[g];D===114?R=" ".repeat(U):D===99?U%2?(R=" ".repeat(U/2+.5),F=" ".repeat(U/2-.5)):(R=" ".repeat(U/2),F=R):F=" ".repeat(U)}a.delimiterStart!==!1&&!g&&E.push("|"),a.padding!==!1&&!(a.alignDelimiters===!1&&_==="")&&(a.delimiterStart!==!1||g)&&E.push(" "),a.alignDelimiters!==!1&&E.push(R),E.push(_),a.alignDelimiters!==!1&&E.push(F),a.padding!==!1&&E.push(" "),(a.delimiterEnd!==!1||g!==f-1)&&E.push("|")}k.push(a.delimiterEnd===!1?E.join("").replace(/ +$/,""):E.join(""))}return k.join(`
|
|
1153
|
+
`)}function f6(e){return e==null?"":String(e)}function X1(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 p6(e,n,a,r){const o=a.enter("blockquote"),s=a.createTracker(r);s.move("> "),s.shift(2);const u=a.indentLines(a.containerFlow(e,s.current()),h6);return o(),u}function h6(e,n,a){return">"+(a?"":" ")+e}function m6(e,n){return Z1(e,n.inConstruct,!0)&&!Z1(e,n.notInConstruct,!1)}function Z1(e,n,a){if(typeof n=="string"&&(n=[n]),!n||n.length===0)return a;let r=-1;for(;++r<n.length;)if(e.includes(n[r]))return!0;return!1}function J1(e,n,a,r){let o=-1;for(;++o<a.unsafe.length;)if(a.unsafe[o].character===`
|
|
1154
|
+
`&&m6(a.stack,a.unsafe[o]))return/[ \t]/.test(r.before)?"":" ";return`\\
|
|
1155
|
+
`}function g6(e,n){const a=String(e);let r=a.indexOf(n),o=r,s=0,u=0;if(typeof n!="string")throw new TypeError("Expected substring");for(;r!==-1;)r===o?++s>u&&(u=s):s=1,o=r+n.length,r=a.indexOf(n,o);return u}function y6(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 v6(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 x6(e,n,a,r){const o=v6(a),s=e.value||"",u=o==="`"?"GraveAccent":"Tilde";if(y6(e,a)){const g=a.enter("codeIndented"),x=a.indentLines(s,b6);return g(),x}const d=a.createTracker(r),p=o.repeat(Math.max(g6(s,o)+1,3)),f=a.enter("codeFenced");let y=d.move(p);if(e.lang){const g=a.enter(`codeFencedLang${u}`);y+=d.move(a.safe(e.lang,{before:y,after:" ",encode:["`"],...d.current()})),g()}if(e.lang&&e.meta){const g=a.enter(`codeFencedMeta${u}`);y+=d.move(" "),y+=d.move(a.safe(e.meta,{before:y,after:`
|
|
1156
|
+
`,encode:["`"],...d.current()})),g()}return y+=d.move(`
|
|
1157
|
+
`),s&&(y+=d.move(s+`
|
|
1158
|
+
`)),y+=d.move(p),f(),y}function b6(e,n,a){return(a?"":" ")+e}function im(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 w6(e,n,a,r){const o=im(a),s=o==='"'?"Quote":"Apostrophe",u=a.enter("definition");let d=a.enter("label");const p=a.createTracker(r);let f=p.move("[");return f+=p.move(a.safe(a.associationId(e),{before:f,after:"]",...p.current()})),f+=p.move("]: "),d(),!e.url||/[\0- \u007F]/.test(e.url)?(d=a.enter("destinationLiteral"),f+=p.move("<"),f+=p.move(a.safe(e.url,{before:f,after:">",...p.current()})),f+=p.move(">")):(d=a.enter("destinationRaw"),f+=p.move(a.safe(e.url,{before:f,after:e.title?" ":`
|
|
1159
|
+
`,...p.current()}))),d(),e.title&&(d=a.enter(`title${s}`),f+=p.move(" "+o),f+=p.move(a.safe(e.title,{before:f,after:o,...p.current()})),f+=p.move(o),d()),u(),f}function S6(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 zo(e){return"&#x"+e.toString(16).toUpperCase()+";"}function Kc(e,n,a){const r=ol(e),o=ol(n);return r===void 0?o===void 0?a==="_"?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!0}:r===1?o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!0}:{inside:!1,outside:!1}:o===void 0?{inside:!1,outside:!1}:o===1?{inside:!0,outside:!1}:{inside:!1,outside:!1}}Jw.peek=k6;function Jw(e,n,a,r){const o=S6(a),s=a.enter("emphasis"),u=a.createTracker(r),d=u.move(o);let p=u.move(a.containerPhrasing(e,{after:o,before:d,...u.current()}));const f=p.charCodeAt(0),y=Kc(r.before.charCodeAt(r.before.length-1),f,o);y.inside&&(p=zo(f)+p.slice(1));const g=p.charCodeAt(p.length-1),x=Kc(r.after.charCodeAt(0),g,o);x.inside&&(p=p.slice(0,-1)+zo(g));const b=u.move(o);return s(),a.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},d+p+b}function k6(e,n,a){return a.options.emphasis||"*"}function C6(e,n){let a=!1;return nm(e,function(r){if("value"in r&&/\r?\n|\r/.test(r.value)||r.type==="break")return a=!0,Qp}),!!((!e.depth||e.depth<3)&&Kh(e)&&(n.options.setext||a))}function E6(e,n,a,r){const o=Math.max(Math.min(6,e.depth||1),1),s=a.createTracker(r);if(C6(e,a)){const y=a.enter("headingSetext"),g=a.enter("phrasing"),x=a.containerPhrasing(e,{...s.current(),before:`
|
|
1160
|
+
`,after:`
|
|
1161
|
+
`});return g(),y(),x+`
|
|
1162
|
+
`+(o===1?"=":"-").repeat(x.length-(Math.max(x.lastIndexOf("\r"),x.lastIndexOf(`
|
|
1163
|
+
`))+1))}const u="#".repeat(o),d=a.enter("headingAtx"),p=a.enter("phrasing");s.move(u+" ");let f=a.containerPhrasing(e,{before:"# ",after:`
|
|
1164
|
+
`,...s.current()});return/^[\t ]/.test(f)&&(f=zo(f.charCodeAt(0))+f.slice(1)),f=f?u+" "+f:u,a.options.closeAtx&&(f+=" "+u),p(),d(),f}eS.peek=A6;function eS(e){return e.value||""}function A6(){return"<"}tS.peek=j6;function tS(e,n,a,r){const o=im(a),s=o==='"'?"Quote":"Apostrophe",u=a.enter("image");let d=a.enter("label");const p=a.createTracker(r);let f=p.move("![");return f+=p.move(a.safe(e.alt,{before:f,after:"]",...p.current()})),f+=p.move("]("),d(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(d=a.enter("destinationLiteral"),f+=p.move("<"),f+=p.move(a.safe(e.url,{before:f,after:">",...p.current()})),f+=p.move(">")):(d=a.enter("destinationRaw"),f+=p.move(a.safe(e.url,{before:f,after:e.title?" ":")",...p.current()}))),d(),e.title&&(d=a.enter(`title${s}`),f+=p.move(" "+o),f+=p.move(a.safe(e.title,{before:f,after:o,...p.current()})),f+=p.move(o),d()),f+=p.move(")"),u(),f}function j6(){return"!"}nS.peek=T6;function nS(e,n,a,r){const o=e.referenceType,s=a.enter("imageReference");let u=a.enter("label");const d=a.createTracker(r);let p=d.move("![");const f=a.safe(e.alt,{before:p,after:"]",...d.current()});p+=d.move(f+"]["),u();const y=a.stack;a.stack=[],u=a.enter("reference");const g=a.safe(a.associationId(e),{before:p,after:"]",...d.current()});return u(),a.stack=y,s(),o==="full"||!f||f!==g?p+=d.move(g+"]"):o==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function T6(){return"!"}aS.peek=N6;function aS(e,n,a){let r=e.value||"",o="`",s=-1;for(;new RegExp("(^|[^`])"+o+"([^`]|$)").test(r);)o+="`";for(/[^ \r\n]/.test(r)&&(/^[ \r\n]/.test(r)&&/[ \r\n]$/.test(r)||/^`|`$/.test(r))&&(r=" "+r+" ");++s<a.unsafe.length;){const u=a.unsafe[s],d=a.compilePattern(u);let p;if(u.atBreak)for(;p=d.exec(r);){let f=p.index;r.charCodeAt(f)===10&&r.charCodeAt(f-1)===13&&f--,r=r.slice(0,f)+" "+r.slice(p.index+1)}}return o+r+o}function N6(){return"`"}function iS(e,n){const a=Kh(e);return!!(!n.options.resourceLink&&e.url&&!e.title&&e.children&&e.children.length===1&&e.children[0].type==="text"&&(a===e.url||"mailto:"+a===e.url)&&/^[a-z][a-z+.-]+:/i.test(e.url)&&!/[\0- <>\u007F]/.test(e.url))}rS.peek=R6;function rS(e,n,a,r){const o=im(a),s=o==='"'?"Quote":"Apostrophe",u=a.createTracker(r);let d,p;if(iS(e,a)){const y=a.stack;a.stack=[],d=a.enter("autolink");let g=u.move("<");return g+=u.move(a.containerPhrasing(e,{before:g,after:">",...u.current()})),g+=u.move(">"),d(),a.stack=y,g}d=a.enter("link"),p=a.enter("label");let f=u.move("[");return f+=u.move(a.containerPhrasing(e,{before:f,after:"](",...u.current()})),f+=u.move("]("),p(),!e.url&&e.title||/[\0- \u007F]/.test(e.url)?(p=a.enter("destinationLiteral"),f+=u.move("<"),f+=u.move(a.safe(e.url,{before:f,after:">",...u.current()})),f+=u.move(">")):(p=a.enter("destinationRaw"),f+=u.move(a.safe(e.url,{before:f,after:e.title?" ":")",...u.current()}))),p(),e.title&&(p=a.enter(`title${s}`),f+=u.move(" "+o),f+=u.move(a.safe(e.title,{before:f,after:o,...u.current()})),f+=u.move(o),p()),f+=u.move(")"),d(),f}function R6(e,n,a){return iS(e,a)?"<":"["}lS.peek=_6;function lS(e,n,a,r){const o=e.referenceType,s=a.enter("linkReference");let u=a.enter("label");const d=a.createTracker(r);let p=d.move("[");const f=a.containerPhrasing(e,{before:p,after:"]",...d.current()});p+=d.move(f+"]["),u();const y=a.stack;a.stack=[],u=a.enter("reference");const g=a.safe(a.associationId(e),{before:p,after:"]",...d.current()});return u(),a.stack=y,s(),o==="full"||!f||f!==g?p+=d.move(g+"]"):o==="shortcut"?p=p.slice(0,-1):p+=d.move("]"),p}function _6(){return"["}function rm(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 O6(e){const n=rm(e),a=e.options.bulletOther;if(!a)return n==="*"?"-":"*";if(a!=="*"&&a!=="+"&&a!=="-")throw new Error("Cannot serialize items with `"+a+"` for `options.bulletOther`, expected `*`, `+`, or `-`");if(a===n)throw new Error("Expected `bullet` (`"+n+"`) and `bulletOther` (`"+a+"`) to be different");return a}function D6(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 oS(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 M6(e,n,a,r){const o=a.enter("list"),s=a.bulletCurrent;let u=e.ordered?D6(a):rm(a);const d=e.ordered?u==="."?")":".":O6(a);let p=n&&a.bulletLastUsed?u===a.bulletLastUsed:!1;if(!e.ordered){const y=e.children?e.children[0]:void 0;if((u==="*"||u==="-")&&y&&(!y.children||!y.children[0])&&a.stack[a.stack.length-1]==="list"&&a.stack[a.stack.length-2]==="listItem"&&a.stack[a.stack.length-3]==="list"&&a.stack[a.stack.length-4]==="listItem"&&a.indexStack[a.indexStack.length-1]===0&&a.indexStack[a.indexStack.length-2]===0&&a.indexStack[a.indexStack.length-3]===0&&(p=!0),oS(a)===u&&y){let g=-1;for(;++g<e.children.length;){const x=e.children[g];if(x&&x.type==="listItem"&&x.children&&x.children[0]&&x.children[0].type==="thematicBreak"){p=!0;break}}}}p&&(u=d),a.bulletCurrent=u;const f=a.containerFlow(e,r);return a.bulletLastUsed=u,a.bulletCurrent=s,o(),f}function L6(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 z6(e,n,a,r){const o=L6(a);let s=a.bulletCurrent||rm(a);n&&n.type==="list"&&n.ordered&&(s=(typeof n.start=="number"&&n.start>-1?n.start:1)+(a.options.incrementListMarker===!1?0:n.children.indexOf(e))+s);let u=s.length+1;(o==="tab"||o==="mixed"&&(n&&n.type==="list"&&n.spread||e.spread))&&(u=Math.ceil(u/4)*4);const d=a.createTracker(r);d.move(s+" ".repeat(u-s.length)),d.shift(u);const p=a.enter("listItem"),f=a.indentLines(a.containerFlow(e,d.current()),y);return p(),f;function y(g,x,b){return x?(b?"":" ".repeat(u))+g:(b?s:s+" ".repeat(u-s.length))+g}}function I6(e,n,a,r){const o=a.enter("paragraph"),s=a.enter("phrasing"),u=a.containerPhrasing(e,r);return s(),o(),u}const P6=du(["break","delete","emphasis","footnote","footnoteReference","image","imageReference","inlineCode","inlineMath","link","linkReference","mdxJsxTextElement","mdxTextExpression","strong","text","textDirective"]);function U6(e,n,a,r){return(e.children.some(function(u){return P6(u)})?a.containerPhrasing:a.containerFlow).call(a,e,r)}function B6(e){const n=e.options.strong||"*";if(n!=="*"&&n!=="_")throw new Error("Cannot serialize strong with `"+n+"` for `options.strong`, expected `*`, or `_`");return n}sS.peek=H6;function sS(e,n,a,r){const o=B6(a),s=a.enter("strong"),u=a.createTracker(r),d=u.move(o+o);let p=u.move(a.containerPhrasing(e,{after:o,before:d,...u.current()}));const f=p.charCodeAt(0),y=Kc(r.before.charCodeAt(r.before.length-1),f,o);y.inside&&(p=zo(f)+p.slice(1));const g=p.charCodeAt(p.length-1),x=Kc(r.after.charCodeAt(0),g,o);x.inside&&(p=p.slice(0,-1)+zo(g));const b=u.move(o+o);return s(),a.attentionEncodeSurroundingInfo={after:x.outside,before:y.outside},d+p+b}function H6(e,n,a){return a.options.strong||"*"}function $6(e,n,a,r){return a.safe(e.value,r)}function q6(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 F6(e,n,a){const r=(oS(a)+(a.options.ruleSpaces?" ":"")).repeat(q6(a));return a.options.ruleSpaces?r.slice(0,-1):r}const cS={blockquote:p6,break:J1,code:x6,definition:w6,emphasis:Jw,hardBreak:J1,heading:E6,html:eS,image:tS,imageReference:nS,inlineCode:aS,link:rS,linkReference:lS,list:M6,listItem:z6,paragraph:I6,root:U6,strong:sS,text:$6,thematicBreak:F6};function G6(){return{enter:{table:V6,tableData:ex,tableHeader:ex,tableRow:Y6},exit:{codeText:K6,table:W6,tableData:xp,tableHeader:xp,tableRow:xp}}}function V6(e){const n=e._align;this.enter({type:"table",align:n.map(function(a){return a==="none"?null:a}),children:[]},e),this.data.inTable=!0}function W6(e){this.exit(e),this.data.inTable=void 0}function Y6(e){this.enter({type:"tableRow",children:[]},e)}function xp(e){this.exit(e)}function ex(e){this.enter({type:"tableCell",children:[]},e)}function K6(e){let n=this.resume();this.data.inTable&&(n=n.replace(/\\([\\|])/g,Q6));const a=this.stack[this.stack.length-1];a.type,a.value=n,this.exit(e)}function Q6(e,n){return n==="|"?n:e}function X6(e){const n=e||{},a=n.tableCellPadding,r=n.tablePipeAlign,o=n.stringLength,s=a?" ":"|";return{unsafe:[{character:"\r",inConstruct:"tableCell"},{character:`
|
|
1165
|
+
`,inConstruct:"tableCell"},{atBreak:!0,character:"|",after:"[ :-]"},{character:"|",inConstruct:"tableCell"},{atBreak:!0,character:":",after:"-"},{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{inlineCode:x,table:u,tableCell:p,tableRow:d}};function u(b,k,C,j){return f(y(b,C,j),b.align)}function d(b,k,C,j){const E=g(b,C,j),_=f([E]);return _.slice(0,_.indexOf(`
|
|
1166
|
+
`))}function p(b,k,C,j){const E=C.enter("tableCell"),_=C.enter("phrasing"),R=C.containerPhrasing(b,{...j,before:s,after:s});return _(),E(),R}function f(b,k){return d6(b,{align:k,alignDelimiters:r,padding:a,stringLength:o})}function y(b,k,C){const j=b.children;let E=-1;const _=[],R=k.enter("table");for(;++E<j.length;)_[E]=g(j[E],k,C);return R(),_}function g(b,k,C){const j=b.children;let E=-1;const _=[],R=k.enter("tableRow");for(;++E<j.length;)_[E]=p(j[E],b,k,C);return R(),_}function x(b,k,C){let j=cS.inlineCode(b,k,C);return C.stack.includes("tableCell")&&(j=j.replace(/\|/g,"\\$&")),j}}function Z6(){return{exit:{taskListCheckValueChecked:tx,taskListCheckValueUnchecked:tx,paragraph:e5}}}function J6(){return{unsafe:[{atBreak:!0,character:"-",after:"[:|-]"}],handlers:{listItem:t5}}}function tx(e){const n=this.stack[this.stack.length-2];n.type,n.checked=e.type==="taskListCheckValueChecked"}function e5(e){const n=this.stack[this.stack.length-2];if(n&&n.type==="listItem"&&typeof n.checked=="boolean"){const a=this.stack[this.stack.length-1];a.type;const r=a.children[0];if(r&&r.type==="text"){const o=n.children;let s=-1,u;for(;++s<o.length;){const d=o[s];if(d.type==="paragraph"){u=d;break}}u===a&&(r.value=r.value.slice(1),r.value.length===0?a.children.shift():a.position&&r.position&&typeof r.position.start.offset=="number"&&(r.position.start.column++,r.position.start.offset++,a.position.start=Object.assign({},r.position.start)))}}this.exit(e)}function t5(e,n,a,r){const o=e.children[0],s=typeof e.checked=="boolean"&&o&&o.type==="paragraph",u="["+(e.checked?"x":" ")+"] ",d=a.createTracker(r);s&&d.move(u);let p=cS.listItem(e,n,a,{...r,...d.current()});return s&&(p=p.replace(/^(?:[*+-]|\d+\.)([\r\n]| {1,3})/,f)),p;function f(y){return y+u}}function n5(){return[MM(),t6(),r6(),G6(),Z6()]}function a5(e){return{extensions:[LM(),n6(e),l6(),X6(e),J6()]}}const i5={tokenize:u5,partial:!0},uS={tokenize:d5,partial:!0},dS={tokenize:f5,partial:!0},fS={tokenize:p5,partial:!0},r5={tokenize:h5,partial:!0},pS={name:"wwwAutolink",tokenize:s5,previous:mS},hS={name:"protocolAutolink",tokenize:c5,previous:gS},ei={name:"emailAutolink",tokenize:o5,previous:yS},Aa={};function l5(){return{text:Aa}}let ir=48;for(;ir<123;)Aa[ir]=ei,ir++,ir===58?ir=65:ir===91&&(ir=97);Aa[43]=ei;Aa[45]=ei;Aa[46]=ei;Aa[95]=ei;Aa[72]=[ei,hS];Aa[104]=[ei,hS];Aa[87]=[ei,pS];Aa[119]=[ei,pS];function o5(e,n,a){const r=this;let o,s;return u;function u(g){return!eh(g)||!yS.call(r,r.previous)||lm(r.events)?a(g):(e.enter("literalAutolink"),e.enter("literalAutolinkEmail"),d(g))}function d(g){return eh(g)?(e.consume(g),d):g===64?(e.consume(g),p):a(g)}function p(g){return g===46?e.check(r5,y,f)(g):g===45||g===95||on(g)?(s=!0,e.consume(g),p):y(g)}function f(g){return e.consume(g),o=!0,p}function y(g){return s&&o&&hn(r.previous)?(e.exit("literalAutolinkEmail"),e.exit("literalAutolink"),n(g)):a(g)}}function s5(e,n,a){const r=this;return o;function o(u){return u!==87&&u!==119||!mS.call(r,r.previous)||lm(r.events)?a(u):(e.enter("literalAutolink"),e.enter("literalAutolinkWww"),e.check(i5,e.attempt(uS,e.attempt(dS,s),a),a)(u))}function s(u){return e.exit("literalAutolinkWww"),e.exit("literalAutolink"),n(u)}}function c5(e,n,a){const r=this;let o="",s=!1;return u;function u(g){return(g===72||g===104)&&gS.call(r,r.previous)&&!lm(r.events)?(e.enter("literalAutolink"),e.enter("literalAutolinkHttp"),o+=String.fromCodePoint(g),e.consume(g),d):a(g)}function d(g){if(hn(g)&&o.length<5)return o+=String.fromCodePoint(g),e.consume(g),d;if(g===58){const x=o.toLowerCase();if(x==="http"||x==="https")return e.consume(g),p}return a(g)}function p(g){return g===47?(e.consume(g),s?f:(s=!0,p)):a(g)}function f(g){return g===null||Vc(g)||gt(g)||cr(g)||su(g)?a(g):e.attempt(uS,e.attempt(dS,y),a)(g)}function y(g){return e.exit("literalAutolinkHttp"),e.exit("literalAutolink"),n(g)}}function u5(e,n,a){let r=0;return o;function o(u){return(u===87||u===119)&&r<3?(r++,e.consume(u),o):u===46&&r===3?(e.consume(u),s):a(u)}function s(u){return u===null?a(u):n(u)}}function d5(e,n,a){let r,o,s;return u;function u(f){return f===46||f===95?e.check(fS,p,d)(f):f===null||gt(f)||cr(f)||f!==45&&su(f)?p(f):(s=!0,e.consume(f),u)}function d(f){return f===95?r=!0:(o=r,r=void 0),e.consume(f),u}function p(f){return o||r||!s?a(f):n(f)}}function f5(e,n){let a=0,r=0;return o;function o(u){return u===40?(a++,e.consume(u),o):u===41&&r<a?s(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(fS,n,s)(u):u===null||gt(u)||cr(u)?n(u):(e.consume(u),o)}function s(u){return u===41&&r++,e.consume(u),o}}function p5(e,n,a){return r;function r(d){return d===33||d===34||d===39||d===41||d===42||d===44||d===46||d===58||d===59||d===63||d===95||d===126?(e.consume(d),r):d===38?(e.consume(d),s):d===93?(e.consume(d),o):d===60||d===null||gt(d)||cr(d)?n(d):a(d)}function o(d){return d===null||d===40||d===91||gt(d)||cr(d)?n(d):r(d)}function s(d){return hn(d)?u(d):a(d)}function u(d){return d===59?(e.consume(d),r):hn(d)?(e.consume(d),u):a(d)}}function h5(e,n,a){return r;function r(s){return e.consume(s),o}function o(s){return on(s)?a(s):n(s)}}function mS(e){return e===null||e===40||e===42||e===95||e===91||e===93||e===126||gt(e)}function gS(e){return!hn(e)}function yS(e){return!(e===47||eh(e))}function eh(e){return e===43||e===45||e===46||e===95||on(e)}function lm(e){let n=e.length,a=!1;for(;n--;){const r=e[n][1];if((r.type==="labelLink"||r.type==="labelImage")&&!r._balanced){a=!0;break}if(r._gfmAutolinkLiteralWalkedInto){a=!1;break}}return e.length>0&&!a&&(e[e.length-1][1]._gfmAutolinkLiteralWalkedInto=!0),a}const m5={tokenize:k5,partial:!0};function g5(){return{document:{91:{name:"gfmFootnoteDefinition",tokenize:b5,continuation:{tokenize:w5},exit:S5}},text:{91:{name:"gfmFootnoteCall",tokenize:x5},93:{name:"gfmPotentialFootnoteCall",add:"after",tokenize:y5,resolveTo:v5}}}}function y5(e,n,a){const r=this;let o=r.events.length;const s=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let u;for(;o--;){const p=r.events[o][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 d;function d(p){if(!u||!u._balanced)return a(p);const f=da(r.sliceSerialize({start:u.end,end:r.now()}));return f.codePointAt(0)!==94||!s.includes(f.slice(1))?a(p):(e.enter("gfmFootnoteCallLabelMarker"),e.consume(p),e.exit("gfmFootnoteCallLabelMarker"),n(p))}}function v5(e,n){let a=e.length;for(;a--;)if(e[a][1].type==="labelImage"&&e[a][0]==="enter"){e[a][1];break}e[a+1][1].type="data",e[a+3][1].type="gfmFootnoteCallLabelMarker";const r={type:"gfmFootnoteCall",start:Object.assign({},e[a+3][1].start),end:Object.assign({},e[e.length-1][1].end)},o={type:"gfmFootnoteCallMarker",start:Object.assign({},e[a+3][1].end),end:Object.assign({},e[a+3][1].end)};o.end.column++,o.end.offset++,o.end._bufferIndex++;const s={type:"gfmFootnoteCallString",start:Object.assign({},o.end),end:Object.assign({},e[e.length-1][1].start)},u={type:"chunkString",contentType:"string",start:Object.assign({},s.start),end:Object.assign({},s.end)},d=[e[a+1],e[a+2],["enter",r,n],e[a+3],e[a+4],["enter",o,n],["exit",o,n],["enter",s,n],["enter",u,n],["exit",u,n],["exit",s,n],e[e.length-2],e[e.length-1],["exit",r,n]];return e.splice(a,e.length-a+1,...d),e}function x5(e,n,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s=0,u;return d;function d(g){return e.enter("gfmFootnoteCall"),e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),p}function p(g){return g!==94?a(g):(e.enter("gfmFootnoteCallMarker"),e.consume(g),e.exit("gfmFootnoteCallMarker"),e.enter("gfmFootnoteCallString"),e.enter("chunkString").contentType="string",f)}function f(g){if(s>999||g===93&&!u||g===null||g===91||gt(g))return a(g);if(g===93){e.exit("chunkString");const x=e.exit("gfmFootnoteCallString");return o.includes(da(r.sliceSerialize(x)))?(e.enter("gfmFootnoteCallLabelMarker"),e.consume(g),e.exit("gfmFootnoteCallLabelMarker"),e.exit("gfmFootnoteCall"),n):a(g)}return gt(g)||(u=!0),s++,e.consume(g),g===92?y:f}function y(g){return g===91||g===92||g===93?(e.consume(g),s++,f):f(g)}}function b5(e,n,a){const r=this,o=r.parser.gfmFootnotes||(r.parser.gfmFootnotes=[]);let s,u=0,d;return p;function p(k){return e.enter("gfmFootnoteDefinition")._container=!0,e.enter("gfmFootnoteDefinitionLabel"),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),f}function f(k){return k===94?(e.enter("gfmFootnoteDefinitionMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionMarker"),e.enter("gfmFootnoteDefinitionLabelString"),e.enter("chunkString").contentType="string",y):a(k)}function y(k){if(u>999||k===93&&!d||k===null||k===91||gt(k))return a(k);if(k===93){e.exit("chunkString");const C=e.exit("gfmFootnoteDefinitionLabelString");return s=da(r.sliceSerialize(C)),e.enter("gfmFootnoteDefinitionLabelMarker"),e.consume(k),e.exit("gfmFootnoteDefinitionLabelMarker"),e.exit("gfmFootnoteDefinitionLabel"),x}return gt(k)||(d=!0),u++,e.consume(k),k===92?g:y}function g(k){return k===91||k===92||k===93?(e.consume(k),u++,y):y(k)}function x(k){return k===58?(e.enter("definitionMarker"),e.consume(k),e.exit("definitionMarker"),o.includes(s)||o.push(s),Ke(e,b,"gfmFootnoteDefinitionWhitespace")):a(k)}function b(k){return n(k)}}function w5(e,n,a){return e.check(Fo,n,e.attempt(m5,n,a))}function S5(e){e.exit("gfmFootnoteDefinition")}function k5(e,n,a){const r=this;return Ke(e,o,"gfmFootnoteDefinitionIndent",5);function o(s){const u=r.events[r.events.length-1];return u&&u[1].type==="gfmFootnoteDefinitionIndent"&&u[2].sliceSerialize(u[1],!0).length===4?n(s):a(s)}}function C5(e){let a=(e||{}).singleTilde;const r={name:"strikethrough",tokenize:s,resolveAll:o};return a==null&&(a=!0),{text:{126:r},insideSpan:{null:[r]},attentionMarkers:{null:[126]}};function o(u,d){let p=-1;for(;++p<u.length;)if(u[p][0]==="enter"&&u[p][1].type==="strikethroughSequenceTemporary"&&u[p][1]._close){let f=p;for(;f--;)if(u[f][0]==="exit"&&u[f][1].type==="strikethroughSequenceTemporary"&&u[f][1]._open&&u[p][1].end.offset-u[p][1].start.offset===u[f][1].end.offset-u[f][1].start.offset){u[p][1].type="strikethroughSequence",u[f][1].type="strikethroughSequence";const y={type:"strikethrough",start:Object.assign({},u[f][1].start),end:Object.assign({},u[p][1].end)},g={type:"strikethroughText",start:Object.assign({},u[f][1].end),end:Object.assign({},u[p][1].start)},x=[["enter",y,d],["enter",u[f][1],d],["exit",u[f][1],d],["enter",g,d]],b=d.parser.constructs.insideSpan.null;b&&$n(x,x.length,0,cu(b,u.slice(f+1,p),d)),$n(x,x.length,0,[["exit",g,d],["enter",u[p][1],d],["exit",u[p][1],d],["exit",y,d]]),$n(u,f-1,p-f+3,x),p=f+x.length-2;break}}for(p=-1;++p<u.length;)u[p][1].type==="strikethroughSequenceTemporary"&&(u[p][1].type="data");return u}function s(u,d,p){const f=this.previous,y=this.events;let g=0;return x;function x(k){return f===126&&y[y.length-1][1].type!=="characterEscape"?p(k):(u.enter("strikethroughSequenceTemporary"),b(k))}function b(k){const C=ol(f);if(k===126)return g>1?p(k):(u.consume(k),g++,b);if(g<2&&!a)return p(k);const j=u.exit("strikethroughSequenceTemporary"),E=ol(k);return j._open=!E||E===2&&!!C,j._close=!C||C===2&&!!E,d(k)}}}class E5{constructor(){this.map=[]}add(n,a,r){A5(this,n,a,r)}consume(n){if(this.map.sort(function(s,u){return s[0]-u[0]}),this.map.length===0)return;let a=this.map.length;const r=[];for(;a>0;)a-=1,r.push(n.slice(this.map[a][0]+this.map[a][1]),this.map[a][2]),n.length=this.map[a][0];r.push(n.slice()),n.length=0;let o=r.pop();for(;o;){for(const s of o)n.push(s);o=r.pop()}this.map.length=0}}function A5(e,n,a,r){let o=0;if(!(a===0&&r.length===0)){for(;o<e.map.length;){if(e.map[o][0]===n){e.map[o][1]+=a,e.map[o][2].push(...r);return}o+=1}e.map.push([n,a,r])}}function j5(e,n){let a=!1;const r=[];for(;n<e.length;){const o=e[n];if(a){if(o[0]==="enter")o[1].type==="tableContent"&&r.push(e[n+1][1].type==="tableDelimiterMarker"?"left":"none");else if(o[1].type==="tableContent"){if(e[n-1][1].type==="tableDelimiterMarker"){const s=r.length-1;r[s]=r[s]==="left"?"center":"right"}}else if(o[1].type==="tableDelimiterRow")break}else o[0]==="enter"&&o[1].type==="tableDelimiterRow"&&(a=!0);n+=1}return r}function T5(){return{flow:{null:{name:"table",tokenize:N5,resolveAll:R5}}}}function N5(e,n,a){const r=this;let o=0,s=0,u;return d;function d(T){let q=r.events.length-1;for(;q>-1;){const P=r.events[q][1].type;if(P==="lineEnding"||P==="linePrefix")q--;else break}const V=q>-1?r.events[q][1].type:null,ae=V==="tableHead"||V==="tableRow"?D:p;return ae===D&&r.parser.lazy[r.now().line]?a(T):ae(T)}function p(T){return e.enter("tableHead"),e.enter("tableRow"),f(T)}function f(T){return T===124||(u=!0,s+=1),y(T)}function y(T){return T===null?a(T):Ae(T)?s>1?(s=0,r.interrupt=!0,e.exit("tableRow"),e.enter("lineEnding"),e.consume(T),e.exit("lineEnding"),b):a(T):qe(T)?Ke(e,y,"whitespace")(T):(s+=1,u&&(u=!1,o+=1),T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),u=!0,y):(e.enter("data"),g(T)))}function g(T){return T===null||T===124||gt(T)?(e.exit("data"),y(T)):(e.consume(T),T===92?x:g)}function x(T){return T===92||T===124?(e.consume(T),g):g(T)}function b(T){return r.interrupt=!1,r.parser.lazy[r.now().line]?a(T):(e.enter("tableDelimiterRow"),u=!1,qe(T)?Ke(e,k,"linePrefix",r.parser.constructs.disable.null.includes("codeIndented")?void 0:4)(T):k(T))}function k(T){return T===45||T===58?j(T):T===124?(u=!0,e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),C):U(T)}function C(T){return qe(T)?Ke(e,j,"whitespace")(T):j(T)}function j(T){return T===58?(s+=1,u=!0,e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),E):T===45?(s+=1,E(T)):T===null||Ae(T)?F(T):U(T)}function E(T){return T===45?(e.enter("tableDelimiterFiller"),_(T)):U(T)}function _(T){return T===45?(e.consume(T),_):T===58?(u=!0,e.exit("tableDelimiterFiller"),e.enter("tableDelimiterMarker"),e.consume(T),e.exit("tableDelimiterMarker"),R):(e.exit("tableDelimiterFiller"),R(T))}function R(T){return qe(T)?Ke(e,F,"whitespace")(T):F(T)}function F(T){return T===124?k(T):T===null||Ae(T)?!u||o!==s?U(T):(e.exit("tableDelimiterRow"),e.exit("tableHead"),n(T)):U(T)}function U(T){return a(T)}function D(T){return e.enter("tableRow"),W(T)}function W(T){return T===124?(e.enter("tableCellDivider"),e.consume(T),e.exit("tableCellDivider"),W):T===null||Ae(T)?(e.exit("tableRow"),n(T)):qe(T)?Ke(e,W,"whitespace")(T):(e.enter("data"),Q(T))}function Q(T){return T===null||T===124||gt(T)?(e.exit("data"),W(T)):(e.consume(T),T===92?M:Q)}function M(T){return T===92||T===124?(e.consume(T),Q):Q(T)}}function R5(e,n){let a=-1,r=!0,o=0,s=[0,0,0,0],u=[0,0,0,0],d=!1,p=0,f,y,g;const x=new E5;for(;++a<e.length;){const b=e[a],k=b[1];b[0]==="enter"?k.type==="tableHead"?(d=!1,p!==0&&(nx(x,n,p,f,y),y=void 0,p=0),f={type:"table",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(a,0,[["enter",f,n]])):k.type==="tableRow"||k.type==="tableDelimiterRow"?(r=!0,g=void 0,s=[0,0,0,0],u=[0,a+1,0,0],d&&(d=!1,y={type:"tableBody",start:Object.assign({},k.start),end:Object.assign({},k.end)},x.add(a,0,[["enter",y,n]])),o=k.type==="tableDelimiterRow"?2:y?3:1):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")?(r=!1,u[2]===0&&(s[1]!==0&&(u[0]=u[1],g=xc(x,n,s,o,void 0,g),s=[0,0,0,0]),u[2]=a)):k.type==="tableCellDivider"&&(r?r=!1:(s[1]!==0&&(u[0]=u[1],g=xc(x,n,s,o,void 0,g)),s=u,u=[s[1],a,0,0])):k.type==="tableHead"?(d=!0,p=a):k.type==="tableRow"||k.type==="tableDelimiterRow"?(p=a,s[1]!==0?(u[0]=u[1],g=xc(x,n,s,o,a,g)):u[1]!==0&&(g=xc(x,n,u,o,a,g)),o=0):o&&(k.type==="data"||k.type==="tableDelimiterMarker"||k.type==="tableDelimiterFiller")&&(u[3]=a)}for(p!==0&&nx(x,n,p,f,y),x.consume(n.events),a=-1;++a<n.events.length;){const b=n.events[a];b[0]==="enter"&&b[1].type==="table"&&(b[1]._align=j5(n.events,a))}return e}function xc(e,n,a,r,o,s){const u=r===1?"tableHeader":r===2?"tableDelimiter":"tableData",d="tableContent";a[0]!==0&&(s.end=Object.assign({},tl(n.events,a[0])),e.add(a[0],0,[["exit",s,n]]));const p=tl(n.events,a[1]);if(s={type:u,start:Object.assign({},p),end:Object.assign({},p)},e.add(a[1],0,[["enter",s,n]]),a[2]!==0){const f=tl(n.events,a[2]),y=tl(n.events,a[3]),g={type:d,start:Object.assign({},f),end:Object.assign({},y)};if(e.add(a[2],0,[["enter",g,n]]),r!==2){const x=n.events[a[2]],b=n.events[a[3]];if(x[1].end=Object.assign({},b[1].end),x[1].type="chunkText",x[1].contentType="text",a[3]>a[2]+1){const k=a[2]+1,C=a[3]-a[2]-1;e.add(k,C,[])}}e.add(a[3]+1,0,[["exit",g,n]])}return o!==void 0&&(s.end=Object.assign({},tl(n.events,o)),e.add(o,0,[["exit",s,n]]),s=void 0),s}function nx(e,n,a,r,o){const s=[],u=tl(n.events,a);o&&(o.end=Object.assign({},u),s.push(["exit",o,n])),r.end=Object.assign({},u),s.push(["exit",r,n]),e.add(a+1,0,s)}function tl(e,n){const a=e[n],r=a[0]==="enter"?"start":"end";return a[1][r]}const _5={name:"tasklistCheck",tokenize:D5};function O5(){return{text:{91:_5}}}function D5(e,n,a){const r=this;return o;function o(p){return r.previous!==null||!r._gfmTasklistFirstContentOfListItem?a(p):(e.enter("taskListCheck"),e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),s)}function s(p){return gt(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):a(p)}function u(p){return p===93?(e.enter("taskListCheckMarker"),e.consume(p),e.exit("taskListCheckMarker"),e.exit("taskListCheck"),d):a(p)}function d(p){return Ae(p)?n(p):qe(p)?e.check({tokenize:M5},n,a)(p):a(p)}}function M5(e,n,a){return Ke(e,r,"whitespace");function r(o){return o===null?a(o):n(o)}}function L5(e){return jw([l5(),g5(),C5(e),T5(),O5()])}const z5={};function I5(e){const n=this,a=e||z5,r=n.data(),o=r.micromarkExtensions||(r.micromarkExtensions=[]),s=r.fromMarkdownExtensions||(r.fromMarkdownExtensions=[]),u=r.toMarkdownExtensions||(r.toMarkdownExtensions=[]);o.push(L5(a)),s.push(n5()),u.push(a5(a))}function P5(e){Yw(e,[/\r?\n|\r/g,U5])}function U5(){return{type:"break"}}function B5(){return function(e){P5(e)}}const vS=[{aliases:{sh:"sh",shell:"sh",zsh:"sh",bash:"bash"},load:()=>nt(()=>import("./bash-Yzrsuije.js"),[])},{aliases:{css:"css"},load:()=>nt(()=>import("./css-CLj8gQPS.js"),[])},{aliases:{diff:"diff",patch:"diff"},load:()=>nt(()=>import("./diff-D97Zzqfu.js"),[])},{aliases:{dockerfile:"dockerfile",docker:"dockerfile"},load:()=>nt(()=>import("./dockerfile-BcOcwvcX.js"),[])},{aliases:{go:"go",golang:"go"},load:()=>nt(()=>import("./go-C27-OAKa.js"),[])},{aliases:{html:"html"},load:()=>nt(()=>import("./html-pp8916En.js"),__vite__mapDeps([0,1,2]))},{aliases:{js:"js",javascript:"js"},load:()=>nt(()=>import("./javascript-wDzz0qaB.js"),[])},{aliases:{json:"json"},load:()=>nt(()=>import("./json-Cp-IABpG.js"),[])},{aliases:{jsx:"jsx"},load:()=>nt(()=>import("./jsx-g9-lgVsj.js"),[])},{aliases:{md:"md",markdown:"md"},load:()=>nt(()=>import("./markdown-Cvjx9yec.js"),[])},{aliases:{py:"py",python:"py"},load:()=>nt(()=>import("./python-B6aJPvgy.js"),[])},{aliases:{rust:"rust",rs:"rust"},load:()=>nt(()=>import("./rust-B1yitclQ.js"),[])},{aliases:{solidity:"solidity",sol:"solidity"},load:()=>nt(()=>import("./solidity-rGO070M0.js"),[])},{aliases:{sparql:"sparql"},load:()=>nt(()=>import("./sparql-DVZY-KUA.js"),[])},{aliases:{sql:"sql"},load:()=>nt(()=>import("./sql-BLtJtn59.js"),[])},{aliases:{toml:"toml"},load:()=>nt(()=>import("./toml-vGWfd6FD.js"),[])},{aliases:{tsx:"tsx"},load:()=>nt(()=>import("./tsx-COt5Ahok.js"),[])},{aliases:{ts:"ts",typescript:"ts"},load:()=>nt(()=>import("./typescript-BPQ3VLAy.js"),[])},{aliases:{xml:"xml"},load:()=>nt(()=>import("./xml-B8PEiB0p.js"),[])},{aliases:{yaml:"yaml",yml:"yaml"},load:()=>nt(()=>import("./yaml-Buea-lGh.js"),[])}],xS=Object.freeze(Object.assign({},...vS.map(({aliases:e})=>e)));Object.freeze(Object.keys(xS));function H5(e){if(!e)return null;const n=e.toLowerCase().trim();return xS[n]??null}async function L9(){return(await Promise.all(vS.map(({load:n})=>n()))).flatMap(({default:n})=>n).filter((n,a,r)=>r.findIndex(o=>o.name===n.name)===a)}let bo=null;function $5(){return bo||(bo=nt(()=>import("./shikiHighlighter-BXl6qMQO.js"),[]).then(e=>e.createHighlighter()).catch(e=>{throw bo=null,e}),bo)}function q5({code:e,lang:n}){const a=H5(n),[r,o]=S.useState(null),[s,u]=S.useState(!1),p=Bn(g=>g.theme)==="light"?"github-light":"github-dark",f=S.useRef(null);S.useEffect(()=>{if(!a){o(null);return}let g=!1;return $5().then(x=>{if(!g)try{o(x.codeToHtml(e,{lang:a,theme:p}))}catch{o(null)}}).catch(()=>{g||o(null)}),()=>{g=!0}},[e,a,p]),S.useEffect(()=>()=>{f.current&&clearTimeout(f.current)},[]);const y=async()=>{try{await navigator.clipboard.writeText(e),u(!0),f.current&&clearTimeout(f.current),f.current=setTimeout(()=>u(!1),1200)}catch{}};return m.jsxs("div",{className:"v10-md-pre",children:[m.jsx("button",{type:"button",className:"v10-md-copy",onClick:y,"aria-label":s?"Copied":"Copy code",title:s?"Copied":"Copy code",children:s?m.jsx(lN,{size:14,"aria-hidden":"true"}):m.jsx(dN,{size:14,"aria-hidden":"true"})}),m.jsx("span",{className:"v10-md-copy-announce","aria-live":"polite",children:s?"Copied":""}),a&&m.jsx("span",{className:"v10-md-pre-lang","aria-hidden":"true",children:a}),r?m.jsx("div",{className:"v10-md-pre-rendered",dangerouslySetInnerHTML:{__html:r}}):m.jsx("pre",{className:"v10-md-pre-fallback",children:m.jsx("code",{children:e})})]})}function F5(){return e=>{let n="none",a=null;const r=new Set(["img","hr","br"]),o=(d,p)=>{const f=d.children;if(Array.isArray(f))for(let y=0;y<f.length;y++){const g=f[y];if(g.type==="text"&&typeof g.value=="string"&&g.value.trim().length>0)p?n="code":(a={siblings:f,index:y},n="text");else if(g.type==="element"){const x=g.tagName;x==="pre"?(n="code",o(g,!0)):x&&r.has(x)?n="leaf":o(g,p)}}},s=e;o(s,!1);const u={type:"element",tagName:"span",properties:{className:["v10-chat-cursor"]},children:[]};if(n==="text"&&a){const{siblings:d,index:p}=a;d.splice(p+1,0,u)}else n==="leaf"&&Array.isArray(s.children)&&s.children.push(u)}}function G5(e){return e?/^https?:\/\//i.test(e)?"http":/^mailto:/i.test(e)?"mailto":"inert":"inert"}function bS({content:e,streaming:n}){return m.jsx("div",{className:"v10-md",children:m.jsx(EM,{remarkPlugins:[I5,B5],rehypePlugins:n?[F5]:[],components:{img:({src:a,alt:r,title:o})=>m.jsxs("span",{className:"v10-md-image-placeholder",title:o||(typeof a=="string"?a:void 0),children:["[image",r?`: ${r}`:"","]"]}),h1:({children:a})=>m.jsx("h1",{className:"v10-md-h1",children:a}),h2:({children:a})=>m.jsx("h2",{className:"v10-md-h2",children:a}),h3:({children:a})=>m.jsx("h3",{className:"v10-md-h3",children:a}),h4:({children:a})=>m.jsx("h4",{className:"v10-md-h4",children:a}),h5:({children:a})=>m.jsx("h5",{className:"v10-md-h5",children:a}),h6:({children:a})=>m.jsx("h6",{className:"v10-md-h6",children:a}),p:({children:a})=>m.jsx("p",{className:"v10-md-p",children:a}),ul:({children:a})=>m.jsx("ul",{className:"v10-md-ul",children:a}),ol:({children:a})=>m.jsx("ol",{className:"v10-md-ol",children:a}),li:({children:a})=>m.jsx("li",{className:"v10-md-li",children:a}),a:({href:a,children:r})=>{const o=G5(a);return o==="http"?m.jsx("a",{className:"v10-md-link",href:a,target:"_blank",rel:"noopener noreferrer",children:r}):o==="mailto"?m.jsx("a",{className:"v10-md-link",href:a,children:r}):m.jsx("span",{className:"v10-md-link v10-md-link-inert",title:a,children:r})},blockquote:({children:a})=>m.jsx("blockquote",{className:"v10-md-blockquote",children:a}),hr:()=>m.jsx("hr",{className:"v10-md-hr"}),table:({children:a})=>m.jsx("div",{className:"v10-md-table-scroll",children:m.jsx("table",{className:"v10-md-table",children:a})}),thead:({children:a,node:r,...o})=>m.jsx("thead",{className:"v10-md-thead",...o,children:a}),tbody:({children:a,node:r,...o})=>m.jsx("tbody",{className:"v10-md-tbody",...o,children:a}),tr:({children:a,node:r,...o})=>m.jsx("tr",{className:"v10-md-tr",...o,children:a}),th:({children:a,node:r,...o})=>m.jsx("th",{className:"v10-md-th",...o,children:a}),td:({children:a,node:r,...o})=>m.jsx("td",{className:"v10-md-td",...o,children:a}),pre:({children:a,node:r})=>{var s,u,d;const o=(s=r==null?void 0:r.children)==null?void 0:s[0];if((o==null?void 0:o.tagName)==="code"){const p=((d=(u=o.properties)==null?void 0:u.className)==null?void 0:d[0])??"",f=/language-([\w-]+)/.exec(p),y=(o.children??[]).map(g=>(g==null?void 0:g.value)??"").join("").replace(/\n$/,"");return m.jsx(q5,{code:y,lang:f==null?void 0:f[1]})}return m.jsx("pre",{children:a})},code:({children:a})=>m.jsx("code",{className:"v10-md-code",children:a})},children:e})})}const V5=m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("line",{x1:"18",y1:"6",x2:"6",y2:"18"}),m.jsx("line",{x1:"6",y1:"6",x2:"18",y2:"18"})]}),W5=Ja(()=>nt(()=>import("./Operations-CNB1BMYg.js"),__vite__mapDeps([3,4])).then(e=>e.OperationsPage),"operations"),Y5=Ja(()=>nt(()=>import("./AgentHub-BO9jGbJl.js"),[]).then(e=>e.AgentHubPage),"agent hub"),K5=Ja(()=>nt(()=>import("./Settings-I6g3MQCV.js"),__vite__mapDeps([5,6])).then(e=>e.SettingsPage),"settings"),Q5=Ja(()=>nt(()=>import("./AgentProfilePage-DJJTn1WD.js"),__vite__mapDeps([7,8,9])).then(e=>e.AgentProfilePage),"account"),X5=Ja(()=>nt(()=>import("./PublishingConviction-DbP1i3v0.js"),__vite__mapDeps([10,11,6,12])).then(e=>e.PublishingConvictionPage),"Publisher Conviction"),Z5=Ja(()=>nt(()=>import("./ConvictionDetailView-J-DAKHtP.js"),__vite__mapDeps([13,12,6,11])).then(e=>e.ConvictionDetailView),"account"),J5=Ja(()=>nt(()=>import("./ProjectView-BP4vNSXI.js"),__vite__mapDeps([14,8,9,11,15,16])).then(e=>e.ProjectView),"project"),bp=Ja(()=>nt(()=>import("./MemoryLayerView-BOxI-_TF.js"),__vite__mapDeps([17,15])).then(e=>e.MemoryLayerView),({layer:e})=>({wm:"working memory",swm:"shared memory",vm:"verifiable memory"})[e]),eL=Ja(()=>nt(()=>import("./MemoryStackView-BTyZZKNm.js"),__vite__mapDeps([18,9])).then(e=>e.MemoryStackView),"memory stack");function tL(){const{tabs:e,activeTabId:n,setActiveTab:a,closeTab:r}=gn();return m.jsx("div",{className:"v10-center-tabs",children:e.map(o=>m.jsxs("button",{className:`v10-center-tab ${o.id===n?"active":""}`,onClick:()=>a(o.id),children:[m.jsx("span",{className:"v10-center-tab-label",children:o.label}),o.closable&&m.jsx("span",{className:"v10-center-tab-close",onClick:s=>{s.stopPropagation(),r(o.id)},children:V5})]},o.id))})}const nL=["text/","application/json","application/xml","application/javascript","application/x-yaml"];function aL(e){return nL.some(n=>e.startsWith(n))}function iL({docRef:e,contentType:n}){const{tabs:a,activeTabId:r,closeTab:o}=gn(),s=gn(T=>T.setActiveTab),[u,d]=S.useState(null),[p,f]=S.useState(null),[y,g]=S.useState(""),[x,b]=S.useState(!0),[k,C]=S.useState(null),[j,E]=S.useState("formatted"),_=e.startsWith("urn:dkg:file:"),R=a.find(T=>T.id===r),F=(R==null?void 0:R.label)??"Document",U=()=>{const T=a.find(q=>q.id.startsWith("project:"));T&&s(T.id),o(r)};S.useEffect(()=>{let T=!1;if(b(!0),C(null),d(null),f(null),g(""),!_){b(!1);return}const q=e.replace("urn:dkg:file:",""),V=new AbortController;return fetch(gj(q,n||void 0),{headers:$t(),signal:V.signal}).then(async ae=>{if(!ae.ok)throw new Error(`HTTP ${ae.status}`);const P=ae.headers.get("content-type")??"application/octet-stream";if(!T)if(g(P),aL(P)){const K=await ae.text();T||(d(K),b(!1))}else if(P.startsWith("image/")){const K=await ae.blob();T||(f(URL.createObjectURL(K)),b(!1))}else if(P==="application/pdf"){const K=await ae.blob();T||(f(URL.createObjectURL(K)),b(!1))}else{const K=await ae.text();T||(d(K),b(!1))}}).catch(ae=>{T||(C(ae.message),b(!1))}),()=>{T=!0,V.abort()}},[e,_,n]),S.useEffect(()=>{E("formatted")},[e]),S.useEffect(()=>{const T=p;return()=>{T&&URL.revokeObjectURL(T)}},[p]);const D=y.startsWith("image/"),W=y==="application/pdf",Q=y.startsWith("text/markdown")||n.startsWith("text/markdown"),M=!x&&!k&&_&&Q&&u!==null;return m.jsxs("div",{style:{height:"100%",display:"flex",flexDirection:"column",overflow:"hidden"},children:[m.jsxs("div",{style:{flexShrink:0,display:"flex",alignItems:"center",gap:10,padding:"8px 16px",borderBottom:"1px solid var(--border-subtle)",background:"var(--bg-panel)"},children:[m.jsx("button",{onClick:U,style:{border:"1px solid var(--border-default)",borderRadius:5,background:"none",color:"var(--text-secondary)",fontSize:11,fontWeight:600,padding:"4px 10px",cursor:"pointer",fontFamily:"var(--font-sans)"},children:"← Back to Project"}),m.jsxs("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-primary)"},children:["📄 ",F]}),M&&m.jsx("div",{role:"group","aria-label":"Document view mode",style:{marginLeft:"auto",display:"flex",gap:2,padding:2,border:"1px solid var(--border-default)",borderRadius:6,background:"var(--bg-surface)"},children:["formatted","raw"].map(T=>{const q=j===T;return m.jsx("button",{type:"button","aria-pressed":q,onClick:()=>E(T),style:{border:"none",borderRadius:4,cursor:"pointer",padding:"3px 12px",fontSize:11,fontWeight:600,fontFamily:"var(--font-sans)",color:q?"var(--text-primary)":"var(--text-secondary)",background:q?"var(--bg-elevated)":"transparent"},children:T==="formatted"?"Formatted":"Raw"},T)})})]}),m.jsx("div",{style:{flex:1,overflow:"auto",padding:"20px 24px"},children:_?m.jsxs(m.Fragment,{children:[x&&m.jsx("div",{style:{color:"var(--text-tertiary)",fontSize:12},children:"Loading document..."}),k&&m.jsxs("div",{style:{color:"var(--accent-red)",fontSize:12},children:["Failed to load: ",k]}),!x&&D&&p&&m.jsx("img",{src:p,alt:F,style:{maxWidth:"100%",borderRadius:8}}),!x&&W&&p&&m.jsx("iframe",{src:p,title:F,style:{width:"100%",height:"100%",border:"none",borderRadius:8}}),u!==null&&!D&&!W&&Q&&j==="formatted"&&m.jsx("div",{style:{background:"var(--bg-surface)",borderRadius:8,padding:"16px 20px",border:"1px solid var(--border-default)",color:"var(--text-primary)"},children:m.jsx(bS,{content:u})}),u!==null&&!D&&!W&&!(Q&&j==="formatted")&&m.jsx("pre",{style:{fontFamily:"var(--font-mono)",fontSize:12,lineHeight:1.7,color:"var(--text-primary)",whiteSpace:"pre-wrap",wordBreak:"break-word",background:"var(--bg-surface)",borderRadius:8,padding:16,border:"1px solid var(--border-default)",margin:0},children:u})]}):m.jsxs("div",{style:{display:"flex",flexDirection:"column",alignItems:"center",justifyContent:"center",gap:10,height:"100%",color:"var(--text-tertiary)",textAlign:"center"},children:[m.jsx("span",{style:{fontSize:28,opacity:.6},children:"📄"}),m.jsx("span",{style:{fontSize:13,fontWeight:600,color:"var(--text-secondary)"},children:"Source file not available for this document"}),m.jsx("span",{style:{fontSize:12,maxWidth:360,lineHeight:1.6},children:"This document was indexed into the graph without a stored source file, so there is nothing to preview here. You can still explore its extracted entities and relationships in the graph."})]})})]})}function rL(){const e=gn(n=>n.activeTabId);if(e==="dashboard")return m.jsx(c3,{});if(e==="operations")return m.jsx(W5,{});if(e==="agent-hub")return m.jsx(Y5,{});if(e==="settings")return m.jsx(K5,{});if(e==="conviction")return m.jsx(X5,{});if(e==="memory-stack")return m.jsx(eL,{});if(e===Hh)return m.jsx(f3,{});if(e.startsWith("project:")){const n=e.slice(8);return m.jsx(J5,{contextGraphId:n})}if(e.startsWith("conviction:")){const n=e.slice(11);return m.jsx(Z5,{accountId:n})}if(e.startsWith("agent:")){const n=e.slice(6),a=n.indexOf("|");if(a>0){const r=n.slice(0,a),o=n.slice(a+1),s=o.includes(":")?o:`urn:dkg:agent:${o}`;return m.jsx(Q5,{contextGraphId:r,agentUri:s})}}if(e.startsWith($h)){const{docRef:n,contentType:a}=p3(e);return m.jsx(iL,{docRef:n,contentType:a})}return e.startsWith("wm:")?m.jsx(bp,{layer:"wm",contextGraphId:e.slice(3)}):e.startsWith("swm:")?m.jsx(bp,{layer:"swm",contextGraphId:e.slice(4)}):e.startsWith("vm:")?m.jsx(bp,{layer:"vm",contextGraphId:e.slice(3)}):m.jsx("div",{className:"v10-view-placeholder",children:m.jsxs("p",{style:{color:"var(--text-tertiary)",fontSize:12},children:['View "',e,'" coming soon.']})})}function lL(){return m.jsxs("div",{className:"v10-panel-center",children:[m.jsx(tL,{}),m.jsx("div",{className:"v10-center-content",children:m.jsx(rL,{})})]})}const oL=["Node Log","Transactions"],sL=m.jsx("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:m.jsx("polyline",{points:"6 9 12 15 18 9"})}),cL=m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("polyline",{points:"15 3 21 3 21 9"}),m.jsx("polyline",{points:"9 21 3 21 3 15"}),m.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"}),m.jsx("line",{x1:"3",y1:"21",x2:"10",y2:"14"})]}),uL=m.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[m.jsx("polyline",{points:"4 14 10 14 10 20"}),m.jsx("polyline",{points:"20 10 14 10 14 4"}),m.jsx("line",{x1:"10",y1:"14",x2:"3",y2:"21"}),m.jsx("line",{x1:"21",y1:"3",x2:"14",y2:"10"})]}),dL=/(\x1B\[[0-9;]*[mGKHFJA-Z]|\[[0-9;]*m)/g;function fL(e){return e.replace(dL,"")}function ax(e){const n=e.toLowerCase();return n.includes("error")||n.includes(" err ")||n.includes("[error]")?"error":n.includes("warn")||n.includes("[warn]")?"warn":n.includes("debug")||n.includes("[debug]")||n.includes("trace")?"debug":"info"}const pL={error:"var(--accent-red, #ef4444)",warn:"var(--accent-yellow, #f59e0b)",info:"var(--text-primary)",debug:"var(--text-tertiary)"};function hL(e){const n=S.useRef(null),a=S.useRef(!0);return S.useEffect(()=>{const r=n.current;if(!r)return;const o=()=>{a.current=r.scrollHeight-r.scrollTop-r.clientHeight<40};return r.addEventListener("scroll",o),()=>r.removeEventListener("scroll",o)},[]),S.useEffect(()=>{a.current&&n.current&&(n.current.scrollTop=n.current.scrollHeight)},[e]),n}function mL(){const[e,n]=S.useState([]),[a,r]=S.useState(""),[o,s]=S.useState("all"),u=S.useCallback(()=>{Hn.fetchNodeLog({lines:300,q:a||void 0}).then(({lines:y})=>n((y??[]).map(fL))).catch(()=>{})},[a]);S.useEffect(()=>{u();const y=setInterval(u,3e3);return()=>clearInterval(y)},[u]);const d=e.filter(y=>o==="all"||ax(y)===o),p=d.length>0?d[d.length-1]:"",f=hL(p);return m.jsxs("div",{className:"v10-log-container",children:[m.jsxs("div",{className:"v10-log-toolbar",children:[m.jsx("input",{id:"dkg-node-log-filter",name:"dkg-node-log-filter",type:"text",placeholder:"Filter logs...",className:"v10-log-filter",value:a,onChange:y=>r(y.target.value),"aria-label":"Filter node log lines"}),m.jsxs("select",{id:"dkg-node-log-level",name:"dkg-node-log-level",className:"v10-log-level-select",value:o,onChange:y=>s(y.target.value),"aria-label":"Filter node log level",children:[m.jsx("option",{value:"all",children:"All"}),m.jsx("option",{value:"error",children:"Error"}),m.jsx("option",{value:"warn",children:"Warn"}),m.jsx("option",{value:"info",children:"Info"}),m.jsx("option",{value:"debug",children:"Debug"})]})]}),m.jsxs("div",{className:"v10-log-output",ref:f,children:[d.map((y,g)=>m.jsx("div",{className:"v10-log-line",style:{color:pL[ax(y)]},children:y},g)),d.length===0&&m.jsx("div",{className:"v10-log-line",style:{color:"var(--text-tertiary)"},children:"No log output"})]})]})}const gL=new Set(["publish","publishFromSWM","update","ka-update","verify","reconstruct"]),yL={publish:"#22c55e",publishFromSWM:"#16a34a",update:"#14b8a6","ka-update":"#0d9488",verify:"#8b5cf6",reconstruct:"#fb923c"};function vL(){const[e,n]=S.useState([]),[a,r]=S.useState(null),o=S.useCallback(()=>{const s=String(Date.now()-216e5),u=[...gL].join(",");Hn.fetchOperationsWithPhases({limit:"100",from:s,names:u}).then(d=>{n((d==null?void 0:d.operations)??[])}).catch(()=>{})},[]);return S.useEffect(()=>{o();const s=setInterval(o,1e4);return()=>clearInterval(s)},[o]),e.length===0?m.jsx("div",{style:{padding:"20px 16px",color:"var(--text-tertiary)",fontSize:12},children:"No publish, update, or verify activity in the last 6 hours."}):m.jsx("div",{className:"v10-log-output",style:{overflowY:"auto",flex:1},children:m.jsxs("table",{style:{width:"100%",borderCollapse:"collapse",fontSize:11},children:[m.jsx("thead",{children:m.jsxs("tr",{style:{borderBottom:"1px solid var(--border-subtle)",color:"var(--text-secondary)",textAlign:"left"},children:[m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Type"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"ID"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Status"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Duration"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Time"}),m.jsx("th",{style:{padding:"6px 12px",fontWeight:600},children:"Tx Hash"})]})}),m.jsx("tbody",{children:e.map(s=>{const u=(s.phases??[]).find(f=>f.phase==="chain"),d=s.tx_hash??(u==null?void 0:u.tx_hash),p=a===s.operation_id;return m.jsxs(mn.Fragment,{children:[m.jsxs("tr",{onClick:()=>r(f=>f===s.operation_id?null:s.operation_id),style:{borderBottom:"1px solid var(--border-subtle)",cursor:"pointer",background:p?"rgba(255,255,255,.03)":void 0},children:[m.jsx("td",{style:{padding:"7px 12px",color:yL[s.operation_name]??"var(--text-secondary)",fontWeight:600},children:s.operation_name}),m.jsx("td",{style:{padding:"7px 12px",fontFamily:"var(--font-mono)",color:"var(--text-secondary)"},children:i1(s.operation_id)}),m.jsx("td",{style:{padding:"7px 12px"},children:m.jsx("span",{style:{padding:"2px 6px",borderRadius:4,fontSize:10,fontWeight:600,background:s.status==="success"?"rgba(34,197,94,.15)":s.status==="error"?"rgba(239,68,68,.15)":"rgba(245,158,11,.15)",color:s.status==="success"?"#22c55e":s.status==="error"?"#ef4444":"#f59e0b"},children:s.status})}),m.jsx("td",{style:{padding:"7px 12px",color:"var(--text-secondary)"},children:s.duration_ms!=null?a1(s.duration_ms):"—"}),m.jsx("td",{style:{padding:"7px 12px",color:"var(--text-secondary)"},children:s.started_at?h4(s.started_at):"—"}),m.jsx("td",{style:{padding:"7px 12px",fontFamily:"var(--font-mono)",color:"var(--text-tertiary)",maxWidth:140,overflow:"hidden",textOverflow:"ellipsis",whiteSpace:"nowrap"},children:d?`${d.slice(0,10)}…`:s.status==="success"?m.jsx("span",{style:{fontFamily:"var(--font-sans)",fontStyle:"italic",color:"var(--text-tertiary)"},children:"local"}):"—"})]}),p&&m.jsx("tr",{style:{background:"rgba(0,0,0,.2)"},children:m.jsxs("td",{colSpan:6,style:{padding:"8px 16px"},children:[m.jsxs("div",{style:{display:"flex",flexWrap:"wrap",gap:16,fontSize:11,color:"var(--text-secondary)"},children:[m.jsxs("span",{children:[m.jsx("b",{children:"ID:"})," ",m.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:s.operation_id})]}),d&&m.jsxs("span",{children:[m.jsx("b",{children:"Tx:"})," ",m.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:d})]}),s.peer_id&&m.jsxs("span",{children:[m.jsx("b",{children:"Peer:"})," ",m.jsx("span",{style:{fontFamily:"var(--font-mono)"},children:i1(s.peer_id)})]}),s.error_message&&m.jsxs("span",{style:{color:"#ef4444"},children:[m.jsx("b",{children:"Error:"})," ",s.error_message]})]}),(s.phases??[]).length>0&&m.jsx("div",{style:{marginTop:8,display:"flex",gap:6,flexWrap:"wrap"},children:s.phases.map(f=>m.jsxs("span",{style:{padding:"2px 8px",borderRadius:4,fontSize:10,fontWeight:600,background:"rgba(255,255,255,.06)",color:"var(--text-secondary)"},children:[f.phase," ",f.duration_ms!=null?a1(f.duration_ms):""]},f.phase))})]})})]},s.operation_id)})})]})})}function xL(){const{bottomCollapsed:e,toggleBottom:n,bottomMaximised:a,toggleBottomMaximised:r,bottomHeight:o,setBottomHeight:s}=Bn(),[u,d]=S.useState("Node Log"),p=S.useRef(null),f=S.useRef(o);f.current=o,S.useEffect(()=>{const g=p.current;if(!g)return;let x=0;const b=j=>{const E=x-j.clientY;x=j.clientY,s(f.current+E)},k=()=>{document.removeEventListener("mousemove",b),document.removeEventListener("mouseup",k),document.body.style.cursor="",document.body.style.userSelect="",g.classList.remove("active")},C=j=>{j.preventDefault(),x=j.clientY,document.addEventListener("mousemove",b),document.addEventListener("mouseup",k),document.body.style.cursor="row-resize",document.body.style.userSelect="none",g.classList.add("active")};return g.addEventListener("mousedown",C),()=>g.removeEventListener("mousedown",C)},[s]);const y=e?void 0:a?"80vh":Math.min(o,Dc());return m.jsxs("div",{className:`v10-panel-bottom ${e?"collapsed":""} ${a?"maximised":""}`,style:e?void 0:{height:y},children:[!e&&!a&&m.jsx("div",{className:"v10-resize-handle-v",ref:p,title:"Drag to resize"}),m.jsxs("div",{className:"v10-bottom-tabs",children:[oL.map(g=>m.jsx("button",{className:`v10-bottom-tab ${g===u?"active":""}`,onClick:()=>{d(g),e&&n()},children:g},g)),m.jsx("div",{style:{flex:1}}),m.jsx("button",{className:"v10-bottom-toggle",onClick:r,title:a?"Restore":"Maximise",style:{display:e?"none":void 0},children:a?uL:cL}),m.jsx("button",{className:"v10-bottom-toggle",onClick:n,title:e?"Expand":"Collapse",children:m.jsx("span",{style:{transform:e?"rotate(180deg)":"none",display:"flex",transition:"transform 0.15s"},children:sL})})]}),!e&&m.jsxs("div",{className:"v10-bottom-content",children:[u==="Node Log"&&m.jsx(mL,{}),u==="Transactions"&&m.jsx(vL,{})]})]})}function ix(e){const n=Math.floor(e/1e3);if(n<60)return`${n}s`;const a=Math.floor(n/60);return a<60?`${a}m`:`${Math.floor(a/60)}h ${a%60}m`}function Qc(e){if(e==null||e==="")return"";const n=e instanceof Date?e:new Date(e);return Number.isNaN(n.valueOf())?typeof e=="string"?e:"":n.toLocaleString([],{dateStyle:"medium",timeStyle:"short"})}function th(e){if(e==null||e==="")return;const n=e instanceof Date?e:new Date(e);if(!Number.isNaN(n.valueOf()))return n.toISOString()}function bL(e){return e<1024?`${e} B`:e<1024*1024?`${(e/1024).toFixed(1)} KB`:`${(e/(1024*1024)).toFixed(1)} MB`}function wL(e){var a;const n=((a=e.split(".").pop())==null?void 0:a.toLowerCase())??"";return["md","txt","csv","json","xml","yaml","yml"].includes(n)?"TXT":["pdf"].includes(n)?"PDF":["docx","doc"].includes(n)?"DOC":["png","jpg","jpeg","webp"].includes(n)?"IMG":["py","ts","js","tsx","jsx","java","go","rs","c","cpp"].includes(n)?"CODE":"FILE"}function nh(e,n){var a;return((a=e.find(r=>r.id===n))==null?void 0:a.name)??n}function SL(e){return e.startsWith("did:dkg:context-graph:")?e:`did:dkg:context-graph:${e}`}function kL(e){return String(e??"").replace(/[\u0000-\u001F\u007F]/g," ").replace(/\s+/g," ").trim()}function wS(e){if(e.length===0)return"";const n=e.map(a=>a.fileName);return n.length<=2?`Attached ${n.join(" and ")}.`:`Attached ${n[0]} and ${n.length-1} more files.`}function SS(e){return e.status==="queued"||e.status==="completed"||e.status==="skipped"}function kS(e){return e.name.trim()}function CL(e){if(e.status!=="completed"||!e.result)return null;const n=e.result.extraction.mdIntermediateHash,a=n??(e.result.detectedContentType==="text/markdown"?e.result.fileHash:void 0);return{id:e.id,fileName:kS(e.file),contextGraphId:e.contextGraphId,assertionName:e.assertionName,assertionUri:e.result.assertionUri,fileHash:e.result.fileHash,detectedContentType:e.result.detectedContentType,rootEntity:e.result.rootEntity,extractionStatus:"completed",tripleCount:e.result.extraction.tripleCount??e.result.extraction.triplesWritten,...n?{mdIntermediateHash:n}:{},...a?{markdownHash:a,markdownForm:`urn:dkg:file:${a}`}:{}}}function EL(e){const n=[];return{results:e.flatMap(r=>{if(r.status!=="skipped"||!r.result)return[];n.push(r.id);const o=r.result,s=o.extraction;return[{id:r.id,fileName:kS(r.file),contextGraphId:r.contextGraphId,assertionName:r.assertionName,assertionUri:o.assertionUri,fileHash:o.fileHash,detectedContentType:o.detectedContentType,extractionStatus:"skipped",pipelineUsed:s.pipelineUsed??null,tripleCount:s.tripleCount??s.triplesWritten??0,...o.rootEntity?{rootEntity:o.rootEntity}:{},...s.mdIntermediateHash?{mdIntermediateHash:s.mdIntermediateHash}:{},...s.error?{error:s.error}:{}}]}),deliveredDraftIds:n}}function CS(e){return e.length===0?"":e.length===1?`Attachment import result: ${kL(e[0].fileName)}.`:`Attached ${e.length} document import results.`}function AL(e,n){const a=[wS(e),CS(n)].filter(r=>r.length>0).map(r=>r.replace(/\.$/,""));return a.length?`${a.join("; ")}.`:""}function jL(e,n,a){const r=[];if(n){const o=nh(e,n);r.push({key:"target_context_graph",label:"Target context graph id",value:n}),r.push({key:"target_context_graph_uri",label:"Target context graph URI",value:SL(n)}),r.push({key:"target_context_graph_name",label:"Target context graph name",value:o})}return a!=null&&a.agentAddress&&r.push({key:"current_agent_address",label:"Current agent address",value:a.agentAddress}),a!=null&&a.agentDid&&r.push({key:"current_agent_did",label:"Current agent DID",value:a.agentDid}),a!=null&&a.peerId&&r.push({key:"current_agent_peer_id",label:"Current agent peer ID",value:a.peerId}),r}const TL="https://docs.openclaw.ai/",NL="https://github.com/openclaw/openclaw/releases",sr="__add_agent__",RL=["openclaw"];function _L(e,n){const a=n instanceof Error?n.message:String(n??"Unknown error");if(n instanceof zc){if(n.code==="HERMES_BRIDGE_RESPONSE_TIMEOUT")return`${e.name} bridge response timed out.`;if(n.code==="HERMES_GATEWAY_RESPONSE_TIMEOUT")return`${e.name} gateway response timed out.`;if(n.code==="OPENCLAW_BRIDGE_RESPONSE_TIMEOUT")return`${e.name} bridge response timed out.`;if(n.code==="OPENCLAW_GATEWAY_RESPONSE_TIMEOUT")return`${e.name} gateway response timed out.`;if(n.code==="PRIME_AGENT_SESSION_BUSY")return`${e.name} session is busy — try again in a moment.`;if(n.code==="PRIME_AGENT_NO_SESSION")return`No live ${e.name} session is available. Start or resume a session, then send again.`;if(n.code==="PRIME_AGENT_PROVIDER_UNAUTHORIZED")return`${e.name} provider authentication failed. Check its provider credentials and try again.`;if(n.code==="PRIME_AGENT_PROVIDER_ERROR")return`${e.name} provider request failed. Check its provider configuration and try again.`;if(n.code==="PRIME_AGENT_TURN_ABORTED")return`${e.name} turn was aborted.`;if(n.code==="PRIME_AGENT_TURN_TIMEOUT")return`${e.name} turn exceeded its maximum run time.`;if(n.code==="PRIME_AGENT_DELIVERY_FAILED")return`${e.name} rejected the message before starting the turn.`;if(n.code==="SWM_SYNC_TIMEOUT"||n.source==="background-sync")return"Background sync timed out. The chat request was not marked as failed by the local-agent bridge."}return/OpenClaw bridge unreachable/i.test(a)?`${e.name} is unavailable right now.`:/Hermes bridge unreachable/i.test(a)?`${e.name} is unavailable right now.`:/gateway response timeout/i.test(a)?`${e.name} gateway response timed out.`:/bridge response timeout/i.test(a)||/aborted due to timeout/i.test(a)?`${e.name} bridge response timed out.`:/Agent response timeout/i.test(a)?`${e.name} took too long to respond.`:/Agent returned no text response/i.test(a)||/\(no response\)/i.test(a)?`${e.name} did not return a text reply.`:a}function wp(e,n,a){return e+(n-e)*a}function ES(e){return e-Math.floor(e)}function Sp(e,n){const a=Math.floor(e),r=Math.floor(n);let o=e-a,s=n-r;o=o*o*(3-2*o),s=s*s*(3-2*s);const u=ia(a,r),d=ia(a+1,r),p=ia(a,r+1),f=ia(a+1,r+1);return u+(d-u)*o+(p-u)*s+(u-d-p+f)*o*s}function ia(e,n){const a=Math.sin(e*12.9898+n*78.233)*43758.5453;return a-Math.floor(a)}function om(e,n){const a=Math.PI*(3-Math.sqrt(5)),r=1-2*(e+.5)/n,o=Math.sqrt(1-r*r),s=e*a;return[o*Math.cos(s),r,o*Math.sin(s)]}function OL(e,n){return Math.atan2(Math.sin(e-n),Math.cos(e-n))}function pr(e,n,a,r,o){const s=Math.sin(n),u=Math.cos(n),d=Math.sin(e),p=Math.cos(e);return(f,y,g)=>{const x=f*p+g*d,b=-f*d+g*p,k=y*u-b*s,C=y*s+b*u;return[a+x*o,r-k*o,C]}}function zi(e,n,a,r=.3){n.sort((o,s)=>o.z-s.z);for(const o of n){const s=o.a??1;if(s<.02)continue;const u=Math.min(1,Math.max(0,o.white)),d=Math.round((a?1-u:u)*255);e.fillStyle=`rgba(${d},${d},${d},${s})`,e.beginPath(),e.arc(o.x,o.y,Math.max(r,o.r),0,Math.PI*2),e.fill()}}function DL(e,n,a){for(const r of n){const o=r.a??1;if(o<.02)continue;const s=Math.min(1,Math.max(0,r.white)),u=Math.round((a?1-s:s)*255);e.strokeStyle=`rgba(${u},${u},${u},${o})`,e.lineWidth=r.w,e.beginPath(),e.moveTo(r.x1,r.y1),e.lineTo(r.x2,r.y2),e.stroke()}}function hr(e,n){return(e/300)**n}const ML=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.76,p=pr(a*.4,.3,s,u,1),f=hr(n,o.rsPow??.6),y=[],g=o.ghostN??150;for(let k=0;k<g;k++){const C=om(k,g),[j,E,_]=p(C[0]*d,C[1]*d,C[2]*d),R=(_/d+1)/2;y.push({x:j,y:E,z:_,r:.8*f,white:.78,a:.1+.22*R})}const x=o.strandN??52,b=o.turns??3;for(let k=0;k<3;k++){const C=k/3*2*Math.PI;for(let j=0;j<x;j++){const E=(ES(j/x+a*.045)*2-1)*.96,_=Math.sqrt(Math.max(0,1-E*E)),R=Math.min(1,(1-Math.abs(E))/.1),F=E*Math.PI*b+C,U=1+.075*Math.sin(E*Math.PI*b*2+C*2+a*.8),D=_*d*U,[W,Q,M]=p(Math.cos(F)*D,E*d*U,Math.sin(F)*D),T=(M/d+1)/2;y.push({x:W,y:Q,z:M,r:((o.rBase??1.2)+(o.rDepth??1.8)*T)*f,white:.55-.45*T,a:R*(.45+.55*T)})}}zi(e,y,r,o.rMin)};function LL(e,n,a,r){const o=2*n*a+r,s=e%o,u=new Array(n).fill(0);let d=-1;if(s<2*n*a){const p=Math.floor(s/a),f=(s-p*a)/a,y=1-(1-Math.min(1,f/.7))**3;if(p<n){for(let g=0;g<p;g++)u[g]=1;u[p]=y,d=p}else{const g=2*n-1-p;for(let x=0;x<g;x++)u[x]=1;u[g]=1-y,d=g}}return{amount:u,active:d}}function zL(e,n,a){let[r,o,s]=e,u=!1;for(let d=0;d<n.length;d++){if(a.amount[d]<=0)continue;const p=n[d],f=p.axis===0?r:p.axis===1?o:s;if(f<p.lo||f>=p.hi)continue;d===a.active&&(u=!0);const y=p.ang*a.amount[d],g=Math.cos(y),x=Math.sin(y);if(p.axis===0){const b=o*g-s*x;s=o*x+s*g,o=b}else if(p.axis===1){const b=r*g+s*x;s=-r*x+s*g,r=b}else{const b=r*g-o*x;o=r*x+o*g,r=b}}return[r,o,s,u]}function IL(e){const n=[];for(let a=0;a<e;a++){const r=Math.min(2,Math.floor(ia(a,2.3)*3)),o=-1+.5*Math.min(3,Math.floor(ia(a,5.9)*4)),s=ia(a,7.7)<.5?1:-1;n.push({axis:r,lo:o,hi:o+.5,ang:s*Math.PI/2})}return n}const PL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.82,p=.4+.06*Math.sin(a*.35),f=pr(a*.5,p,s,u,d),y=a*(.5+(1.7-.5)*(o.scanMul??1)),g=hr(n,o.rsPow??.6),x=o.dimBase??1,b=[],k=o.latRings??17,C=o.lonDensity??44;for(let j=0;j<=k;j++){const E=-Math.PI/2+j/k*Math.PI,_=Math.cos(E),R=Math.sin(E),F=Math.max(1,Math.round(Math.abs(_)*C));for(let U=0;U<F;U++){const D=U/F*2*Math.PI,[W,Q,M]=f(_*Math.cos(D),R,_*Math.sin(D)),T=(M+1)/2,q=OL(D+a*.5,y),V=Math.exp(-(q*q)/.18)*Math.max(0,M);b.push({x:W,y:Q,z:M,r:((o.rBase??.6)+(o.rDepth??1.7)*T+(o.rBoost??1)*V)*g,white:(o.inkFar??.62)-(o.inkSpan??.54)*T,a:x+(1-x)*Math.min(1,V)})}}zi(e,b,r,o.rMin)},UL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.82,p=pr(a*.55,.35+.1*Math.sin(a*.9),s,u,d),f=hr(n,o.rsPow??.6),y=o.moveCount??14,g=IL(y),x=LL(a,y,.42,1.2),b=[],k=o.latRings??15,C=o.lonDensity??40;for(let j=0;j<=k;j++){const E=-Math.PI/2+j/k*Math.PI,_=Math.cos(E),R=Math.sin(E),F=Math.max(1,Math.round(Math.abs(_)*C));for(let U=0;U<F;U++){const D=U/F*2*Math.PI,[W,Q,M,T]=zL([_*Math.cos(D),R,_*Math.sin(D)],g,x),[q,V,ae]=p(W,Q,M),P=(ae+1)/2;b.push({x:q,y:V,z:ae,r:((o.rBase??.6)+(o.rDepth??1.7)*P+(T?o.rActive??.3:0))*f,white:(o.inkFar??.62)-(o.inkSpan??.54)*P-(T?.14:0)})}}zi(e,b,r,o.rMin)},BL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.874,p=pr(a*.18,.38,s,u,1),f=hr(n,o.rsPow??.6),y=[],g=o.rings??15,x=o.lonDensity??40;for(let b=0;b<=g;b++){const k=-Math.PI/2+b/g*Math.PI,C=Math.cos(k),j=Math.sin(k),E=.62*Math.sin(a*2.1-b*.52)+.38*Math.sin(a*1.27+b*.83),_=d*(.88+.105*E),R=Math.max(1,Math.round(Math.abs(C)*x));for(let F=0;F<R;F++){const U=F/R*2*Math.PI,[D,W,Q]=p(C*Math.cos(U)*_,j*_,C*Math.sin(U)*_),M=(Q/d+1)/2,T=Math.max(0,E);y.push({x:D,y:W,z:Q,r:((o.rBase??.6)+(o.rDepth??1.7)*M)*(1+.4*T)*f,white:.66-.56*M-.1*T})}}zi(e,y,r,o.rMin)};function HL(e){return e*e*(3-2*e)}function AS(e){const n=e.length,a=[];let r=0;for(let o=0;o<n;o++){const s=e[o],u=e[(o+1)%n],d=Math.hypot(u[0]-s[0],u[1]-s[1]);a.push(d),r+=d}return o=>{let s=o*r,u=0;for(;s>a[u]&&u<n-1;)s-=a[u],u++;const d=e[u],p=e[(u+1)%n],f=a[u]?Math.min(1,s/a[u]):0;return[d[0]+(p[0]-d[0])*f,d[1]+(p[1]-d[1])*f]}}const $L=e=>{const n=-Math.PI/2+e*2*Math.PI;return[Math.cos(n)*.24,Math.sin(n)*.24]},qL=AS([[0,-.26],[.24,.16],[-.24,.16]]),FL=AS([[0,-.2],[.2,-.2],[.2,.2],[-.2,.2],[-.2,-.2]]),kp=[$L,qL,FL];function GL(e){return Math.max(6,Math.round(34*e))}const ah=1.4,jS=.9,Cp=ah+jS,VL=(e,n,a,r,o)=>{const s=kp.length,u=a%(Cp*s),d=Math.floor(u/Cp),p=u-d*Cp,f=p>ah?HL((p-ah)/jS):0,y=o.spread??1,g=kp[d],x=kp[(d+1)%s],b=160,k=[];for(let Q=0;Q<b;Q++){const M=Q/b,T=g(M),q=x(M);k.push([(T[0]+(q[0]-T[0])*f)*y,(T[1]+(q[1]-T[1])*f)*y])}const C=[];let j=0;for(let Q=0;Q<b;Q++){const M=k[Q],T=k[(Q+1)%b],q=Math.hypot(T[0]-M[0],T[1]-M[1]);C.push(q),j+=q}const E=GL(o.iconD??1),_=(o.rDot??.021)*1.35*y,R=1+.02*Math.sin(p*3.1),F=[],U=n/2;let D=0,W=0;for(let Q=0;Q<E;Q++){const M=Q/E*j;for(;W+C[D]<M&&D<b-1;)W+=C[D],D++;const T=k[D],q=k[(D+1)%b],V=C[D]?Math.min(1,(M-W)/C[D]):0,ae=(T[0]+(q[0]-T[0])*V)*R,P=(T[1]+(q[1]-T[1])*V)*R;F.push({x:U+ae*n,y:U+P*n,z:0,r:Math.max(.35,_*n),white:.1})}zi(e,F,r,o.rMin)},WL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.82,p=pr(a*.12,.3,s,u,1),f=hr(n,o.rsPow??.6),y=[],g=o.orbitN??12,x=o.ghostN??40,b=o.particles??3;for(let k=0;k<g;k++){const C=ia(k,1.7),j=ia(k,5.2),E=ia(k,8.9),_=d*(.45+.52*C),R=C*2*Math.PI,F=Math.acos(2*j-1),U=Math.sin(F)*Math.cos(R),D=Math.cos(F),W=Math.sin(F)*Math.sin(R);let Q=-D,M=U;const T=0,q=Math.max(1e-6,Math.sqrt(Q*Q+M*M));Q/=q,M/=q;const V=D*T-W*M,ae=W*Q-U*T,P=U*M-D*Q,K=(.25+.55*E)*(E>.5?1:-1);for(let B=0;B<x;B++){const Z=B/x*2*Math.PI,[ie,G,O]=p((Q*Math.cos(Z)+V*Math.sin(Z))*_,(M*Math.cos(Z)+ae*Math.sin(Z))*_,(T*Math.cos(Z)+P*Math.sin(Z))*_),L=(O/_+1)/2;y.push({x:ie,y:G,z:O,r:(o.ghostR??.9)*f,white:.72,a:(o.ghostA??.5)*(.4+.6*L)})}for(let B=0;B<b;B++){const Z=a*K+B/b*2*Math.PI+j*6,[ie,G,O]=p((Q*Math.cos(Z)+V*Math.sin(Z))*_,(M*Math.cos(Z)+ae*Math.sin(Z))*_,(T*Math.cos(Z)+P*Math.sin(Z))*_),L=(O/_+1)/2;y.push({x:ie,y:G,z:O,r:((o.partR??1.2)+(o.partRDepth??1.6)*L)*f,white:.3-.22*L})}}zi(e,y,r,o.rMin)},rx=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.78,p=o.spin??1,f=.3,y=pr(a*.1*p,f,s,u,1),g=hr(n,o.rsPow??.6),x=[],b=o.ghostN??150;for(let P=0;P<b;P++){const K=om(P,b),[B,Z,ie]=y(K[0]*d,K[1]*d,K[2]*d),G=(ie/d+1)/2;x.push({x:B,y:Z,z:ie,r:.8*g,white:.78,a:.1+.22*G})}const k=a*.24*p,C=o.faceOn?-f:.55+.3*Math.sin(a*.18)*p,j=Math.cos(k),E=0,_=Math.sin(k),R=-_*Math.sin(C),F=Math.cos(C),U=j*Math.sin(C),D=E*U-_*F,W=_*R-j*U,Q=j*F-E*R,M=.23*(o.wobMul??1),T=o.faceOn?d/(1+.85*M):d,q=o.lanes??5,V=o.segs??88,ae=Math.max(1,Math.round(q*(o.bandMul??1)));for(let P=0;P<ae;P++){const K=(P-(ae-1)/2)*.075,B=Math.abs(P-(ae-1)/2)/Math.max(1,(ae-1)/2);for(let Z=0;Z<V;Z++){const ie=Z/V*2*Math.PI,G=(.16*Math.sin(ie*3-a*1.7+P*.22)+.07*Math.sin(ie*5+a*1.1))*(o.wobMul??1),O=o.faceOn?1+G:1,L=o.faceOn?K:K+G,X=j*Math.cos(ie)+R*Math.sin(ie)+D*L,N=E*Math.cos(ie)+F*Math.sin(ie)+W*L,ue=_*Math.cos(ie)+U*Math.sin(ie)+Q*L,pe=Math.sqrt(X*X+N*N+ue*ue),he=T*O,[Ee,Ue,Ne]=y(X/pe*he,N/pe*he,ue/pe*he),et=(Ne/d+1)/2;x.push({x:Ee,y:Ue,z:Ne,r:((o.rBase??1.1)+(o.rDepth??1.7)*et)*(1-.25*B)*g,white:.52-.44*et+.18*B,a:.4+.6*et})}}zi(e,x,r,o.rMin)},YL=(e,n,a,r,o)=>{const s=n/2,u=n/2,d=n/2*.8*(o.spread??1),p=pr(a*.12,.32,s,u,d),f=hr(n,o.rsPow??.6),y=o.nodeN??30,g=o.thr??.72,x=o.nodeR??1.4,b=o.nodeRDepth??1.8,k=[];for(let _=0;_<y;_++){const R=om(_,y),F=R[0]+.3*(Sp(_*.31+9,a*.24)-.5)*2,U=R[1]+.3*(Sp(_*.53+27,a*.21)-.5)*2,D=R[2]+.3*(Sp(_*.77+55,a*.27)-.5)*2,W=Math.sqrt(F*F+U*U+D*D);k.push([F/W,U/W,D/W])}const C=[],j=[];for(let _=0;_<y;_++)for(let R=_+1;R<y;R++){const F=k[_][0]-k[R][0],U=k[_][1]-k[R][1],D=k[_][2]-k[R][2],W=Math.sqrt(F*F+U*U+D*D);if(W>=g)continue;const[Q,M,T]=p(k[_][0],k[_][1],k[_][2]),[q,V,ae]=p(k[R][0],k[R][1],k[R][2]),P=((T+ae)/2+1)/2;C.push({x1:Q,y1:M,x2:q,y2:V,white:.42,a:(1-W/g)*(.3+.55*P),w:Math.max(.6,(o.lineW??.8)*f)})}for(let _=0;_<y;_++){const[R,F,U]=p(k[_][0],k[_][1],k[_][2]),D=(U+1)/2,W=1+.25*Math.sin(a*1.4+_*2.7);j.push({x:R,y:F,z:U,r:(x+b*D)*W*f,white:.55-.45*D})}const E=o.signals??5;for(let _=0;_<E;_++){const R=Math.floor(a*.55+_*7.31),F=Math.floor(ia(R,_*3.1+1.7)*y),U=Math.floor(ia(R,_*5.7+4.2)*y);if(F===U)continue;const D=ES(a*.55+_*7.31),W=wp(k[F][0],k[U][0],D),Q=wp(k[F][1],k[U][1],D),M=wp(k[F][2],k[U][2],D),T=Math.max(1e-6,Math.sqrt(W*W+Q*Q+M*M)),[q,V,ae]=p(W/T,Q/T,M/T),P=(ae+1)/2;j.push({x:q,y:V,z:ae,r:(x*1.5+b*P)*f,white:.05,a:.5+.5*P})}DL(e,C,r),zi(e,j,r,o.rMin)},KL={orbits:WL,globe:PL,rubik:UL,wave:BL,web:YL,braid:ML,ribbon:rx,ring:rx,morph:VL},QL=[["latRings","lonDensity"],["rings","lonDensity"],["lanes","segs"]],XL=["orbitN","ghostN","nodeN","strandN","signals"],ZL=["iconD"],JL=["rBase","rDepth","rActive","rDot","ghostR","partR","partRDepth","nodeR","nodeRDepth"];function ez(e,n){const a={...e},r=new Set,o=Math.sqrt(n);for(const[s,u]of QL){const d=a[s],p=a[u];d!=null&&p!=null&&!r.has(s)&&!r.has(u)&&(a[s]=Math.max(2,Math.round(d*o)),a[u]=Math.max(2,Math.round(p*o)),r.add(s),r.add(u))}for(const s of XL){const u=a[s];u!=null&&u!==0&&!r.has(s)&&(a[s]=Math.max(1,Math.round(u*n)))}for(const s of ZL){const u=a[s];u!=null&&(a[s]=Math.max(.02,u*n))}return a}function tz(e,n){const a={...e};for(const r of JL){const o=a[r];o!=null&&(a[r]=o*n)}return a.rSizeMul=(a.rSizeMul??1)*n,a}const nz={globe:{latRings:17,lonDensity:44,rBase:.6,rDepth:1.7,rBoost:1,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},orbits:{orbitN:12,ghostN:40,ghostR:.9,ghostA:.5,particles:3,partR:1.2,partRDepth:1.6,rsPow:.6,rMin:.3},rubik:{latRings:15,lonDensity:40,moveCount:14,rBase:.6,rDepth:1.7,rActive:.3,inkFar:.62,inkSpan:.54,rsPow:.6,rMin:.3},wave:{rings:15,lonDensity:40,rBase:.6,rDepth:1.7,rsPow:.6,rMin:.3},web:{nodeN:30,thr:.72,signals:5,nodeR:1.4,nodeRDepth:1.8,lineW:.8,rsPow:.6,rMin:.3},braid:{strandN:52,turns:3,ghostN:150,rBase:1.2,rDepth:1.8,rsPow:.6,rMin:.3},ribbon:{lanes:5,segs:88,ghostN:150,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},ring:{lanes:5,segs:88,ghostN:0,faceOn:1,rBase:1.1,rDepth:1.7,rsPow:.6,rMin:.3},morph:{rDot:.021,iconD:1,rMin:.25}},az={working:"orbits",searching:"globe",solving:"rubik",listening:"wave",connecting:"web",weaving:"braid",composing:"ribbon",breathing:"ring",shaping:"morph"},iz={orbits:{64:{speed:1.885,count:1,size:1},20:{speed:3.9,count:.238,size:2.4}},globe:{64:{speed:2.015,count:.42,size:1.15,extra:{scanMul:4.08,dimBase:.45}},20:{speed:2.665,count:.105,size:1.75,extra:{scanMul:4.335,dimBase:.45}}},rubik:{64:{speed:1.82,count:.35,size:1.05},20:{speed:1.95,count:.088,size:1.9}},wave:{64:{speed:4.388,count:.341,size:1},20:{speed:3.998,count:.105,size:1.6}},web:{64:{speed:3.315,count:1.35,size:.95},20:{speed:6.63,count:.25,size:1.52}},braid:{64:{speed:1.625,count:.5,size:1},20:{speed:2.75,count:.1125,size:1.36}},ribbon:{64:{speed:2.34,count:.25,size:.85,extra:{spin:0,bandMul:3.9,wobMul:1}},20:{speed:3.12,count:.051,size:1.073,extra:{spin:0,bandMul:4.94,wobMul:1}}},ring:{64:{speed:3.24,count:.25,size:.956,extra:{spin:0,bandMul:3.627,wobMul:.368}},20:{speed:3.78,count:.028,size:1.622,extra:{spin:0,bandMul:3.968,wobMul:.565}}},morph:{64:{speed:2.405,count:.702,size:.395,extra:{spread:1.45}},20:{speed:2.08,count:.53,size:1.011,extra:{spread:1.45}}}},lx=new Map;function rz(e,n){const a=`${e}-${n}`,r=lx.get(a);if(r)return r;const o=az[e],s=iz[o][n];let u={...nz[o]};s.count!==1&&(u=ez(u,s.count)),s.size!==1&&(u=tz(u,s.size)),s.extra&&(u={...u,...s.extra});const d={mode:o,speed:s.speed,opts:u};return lx.set(a,d),d}function lz(e){let n=e;for(;n;){const a=n.getAttribute("data-theme");if(a==="dark")return!0;if(a==="light")return!1;if(n.classList.contains("dark"))return!0;if(n.classList.contains("light"))return!1;n=n.parentElement}return null}function oz(){return typeof matchMedia>"u"||matchMedia("(prefers-color-scheme: dark)").matches}function sz(e,n){const[a,r]=S.useState(!0);return S.useEffect(()=>{if(e==="dark"){r(!0);return}if(e==="light"){r(!1);return}const o=()=>{const p=lz(n.current);r(p??oz())};o();const s=typeof matchMedia<"u"?matchMedia("(prefers-color-scheme: dark)"):null,u=()=>o();s==null||s.addEventListener("change",u);let d=null;return typeof MutationObserver<"u"&&n.current&&(d=new MutationObserver(o),d.observe(document.documentElement,{attributes:!0,attributeFilter:["class","data-theme"],subtree:!0})),()=>{s==null||s.removeEventListener("change",u),d==null||d.disconnect()}},[e,n]),a}function cz(){const[e,n]=S.useState(!1);return S.useEffect(()=>{if(typeof matchMedia>"u")return;const a=matchMedia("(prefers-reduced-motion: reduce)");n(a.matches);const r=o=>n(o.matches);return a.addEventListener("change",r),()=>a.removeEventListener("change",r)},[]),e}const uz={working:"Working…",searching:"Searching…",solving:"Solving…",listening:"Listening…",connecting:"Connecting…",weaving:"Weaving…",composing:"Composing…",breathing:"Thinking…",shaping:"Shaping…"};function dz({state:e="working",size:n=64,theme:a="auto",speed:r=1,paused:o=!1,style:s,"aria-label":u,...d}){const p=S.useRef(null),f=sz(a,p),y=cz();return S.useEffect(()=>{const g=p.current;if(!g)return;const x=Math.min(2,typeof devicePixelRatio<"u"&&devicePixelRatio||1);g.width=Math.round(n*x),g.height=Math.round(n*x);const b=g.getContext("2d");if(!b)return;const{mode:k,speed:C,opts:j}=rz(e,n),E=KL[k],_=C*r,R=V=>{b.setTransform(x,0,0,x,0,0),b.clearRect(0,0,n,n),E(b,n,V,f,j)};if(y){R(.6);return}let F=0,U=!1;const D=()=>{R(performance.now()/1e3*_),U&&(F=requestAnimationFrame(D))},W=()=>{U||o||(U=!0,F=requestAnimationFrame(D))},Q=()=>{U=!1,cancelAnimationFrame(F)};R(performance.now()/1e3*_);let M=!0;const T=typeof IntersectionObserver<"u"?new IntersectionObserver(([V])=>{M=V.isIntersecting,M&&document.visibilityState!=="hidden"?W():Q()}):null;T==null||T.observe(g);const q=()=>{document.visibilityState==="hidden"?Q():M&&W()};return document.addEventListener("visibilitychange",q),T||W(),()=>{Q(),T==null||T.disconnect(),document.removeEventListener("visibilitychange",q)}},[e,n,f,r,o,y]),m.jsx("canvas",{ref:p,role:"img","aria-label":u??uz[e],style:{width:n,height:n,display:"block",...s},...d})}let fz=0;function pz(e,n,a){const r=e.trim();return r?r===n?!0:a==="Request cancelled."&&r===a:!1}function hz(e,n,a,r){return e&&pz(e,n,a)?{content:e,synthesized:!0}:e?r==="hermes"?{content:e,failureNotice:n,synthesized:!1}:{content:e,synthesized:!1}:{content:"",failureNotice:n,synthesized:!0}}function mz(e,n){return e?{content:e,failureNotice:n,synthesized:!1}:{content:n,synthesized:!0}}function ox(e,n=""){const a=e.author.toLowerCase(),r=a.includes("assistant")||a.includes("agent")?"assistant":"user",o=typeof e.failureReason=="string"&&e.failureReason.trim()?e.failureReason.trim():void 0,s=r==="assistant"&&(e.persistStatus==="failed"||!!o),u=`Error: ${o??"The local agent turn failed."}`,d=s?hz(e.text,u,o,n):null,p=(d==null?void 0:d.content)??(e.text||wS(e.attachmentRefs??[])),f=!!e.text;return{id:e.uri||`local-history:${++fz}`,uri:e.uri,turnId:e.turnId,role:r,content:p,ts:Qc(e.ts),tsRaw:th(e.ts),attachments:e.attachmentRefs,failureNotice:d==null?void 0:d.failureNotice,synthesized:(d==null?void 0:d.synthesized)??!f}}function gz(e){return e.turnId?`turn:${e.turnId}:${e.role}`:e.uri??`${e.role}:${e.ts??""}:${e.content}`}function Ep(e,n){const a=new Set,r=[];for(const o of[...n,...e]){const s=gz(o);a.has(s)||(a.add(s),r.push(o))}return r}function sx(e,n,a){const r=typeof a=="string"&&a.trim()?a.trim():n;return!r||r===n?e:e.map(o=>o.turnId===n?{...o,turnId:r}:o)}function cx(e){return e.replace(/\r\n/g,`
|
|
1167
|
+
`).replace(/^(?:[ \t]*\n)+/,"").replace(/(?:\n[ \t]*)+$/,"")}function yz(e,n,a,r,o){const s=cx(e),u=o?cx(o):"";if(n==="assistant"&&r&&s.trim()===""&&!u)return m.jsxs("span",{className:"v10-chat-thinking",role:"status","aria-live":"polite",children:[m.jsx(dz,{"aria-hidden":"true",className:"v10-chat-thinking-orb",state:"connecting",size:64,style:{width:28,height:28},theme:"auto"}),m.jsx("span",{children:"Connecting dots..."})]});if(n==="assistant"&&!a&&s.trim()!=="")return m.jsxs(m.Fragment,{children:[m.jsx(bS,{content:s,streaming:r&&!u}),u&&m.jsxs("span",{className:"v10-chat-plaintext v10-chat-failure-notice",children:[u,r&&m.jsx("span",{className:"v10-chat-cursor"})]})]});const d=[s,u].filter(Boolean).join(`
|
|
1168
|
+
|
|
1169
|
+
`);return m.jsxs("span",{className:"v10-chat-plaintext",children:[d,r&&m.jsx("span",{className:"v10-chat-cursor"})]})}function ih(){return ih=Object.assign?Object.assign.bind():function(e){for(var n=1;n<arguments.length;n++){var a=arguments[n];for(var r in a)({}).hasOwnProperty.call(a,r)&&(e[r]=a[r])}return e},ih.apply(null,arguments)}function vz(e,n){if(e==null)return{};var a={};for(var r in e)if({}.hasOwnProperty.call(e,r)){if(n.indexOf(r)!==-1)continue;a[r]=e[r]}return a}var xz=S.useLayoutEffect,bz=function(n){var a=mn.useRef(n);return xz(function(){a.current=n}),a},ux=function(n,a){if(typeof n=="function"){n(a);return}n.current=a},wz=function(n,a){var r=mn.useRef();return mn.useCallback(function(o){n.current=o,r.current&&ux(r.current,null),r.current=a,a&&ux(a,o)},[a])},dx={"min-height":"0","max-height":"none",height:"0",visibility:"hidden",overflow:"hidden",position:"absolute","z-index":"-1000",top:"0",right:"0",display:"block"},Sz=function(n){Object.keys(dx).forEach(function(a){n.style.setProperty(a,dx[a],"important")})},fx=Sz,pn=null,px=function(n,a){var r=n.scrollHeight;return a.sizingStyle.boxSizing==="border-box"?r+a.borderSize:r-a.paddingSize};function kz(e,n,a,r){a===void 0&&(a=1),r===void 0&&(r=1/0),pn||(pn=document.createElement("textarea"),pn.setAttribute("tabindex","-1"),pn.setAttribute("aria-hidden","true"),fx(pn)),pn.parentNode===null&&document.body.appendChild(pn);var o=e.paddingSize,s=e.borderSize,u=e.sizingStyle,d=u.boxSizing;Object.keys(u).forEach(function(x){var b=x;pn.style[b]=u[b]}),fx(pn),pn.value=n;var p=px(pn,e);pn.value=n,p=px(pn,e),pn.value="x";var f=pn.scrollHeight-o,y=f*a;d==="border-box"&&(y=y+o+s),p=Math.max(y,p);var g=f*r;return d==="border-box"&&(g=g+o+s),p=Math.min(g,p),[p,f]}var hx=function(){},Cz=function(n,a){return n.reduce(function(r,o){return r[o]=a[o],r},{})},Ez=["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth","boxSizing","fontFamily","fontSize","fontStyle","fontWeight","letterSpacing","lineHeight","paddingBottom","paddingLeft","paddingRight","paddingTop","tabSize","textIndent","textRendering","textTransform","width","wordBreak","wordSpacing","scrollbarGutter"],Az=!!document.documentElement.currentStyle,jz=function(n){var a=window.getComputedStyle(n);if(a===null)return null;var r=Cz(Ez,a),o=r.boxSizing;if(o==="")return null;Az&&o==="border-box"&&(r.width=parseFloat(r.width)+parseFloat(r.borderRightWidth)+parseFloat(r.borderLeftWidth)+parseFloat(r.paddingRight)+parseFloat(r.paddingLeft)+"px");var s=parseFloat(r.paddingBottom)+parseFloat(r.paddingTop),u=parseFloat(r.borderBottomWidth)+parseFloat(r.borderTopWidth);return{sizingStyle:r,paddingSize:s,borderSize:u}},Tz=jz;function sm(e,n,a){var r=bz(a);S.useLayoutEffect(function(){var o=function(u){return r.current(u)};if(e)return e.addEventListener(n,o),function(){return e.removeEventListener(n,o)}},[])}var Nz=function(n,a){sm(document.body,"reset",function(r){n.current.form===r.target&&a(r)})},Rz=function(n){sm(window,"resize",n)},_z=function(n){sm(document.fonts,"loadingdone",n)},Oz=["cacheMeasurements","maxRows","minRows","onChange","onHeightChange"],Dz=function(n,a){var r=n.cacheMeasurements,o=n.maxRows,s=n.minRows,u=n.onChange,d=u===void 0?hx:u,p=n.onHeightChange,f=p===void 0?hx:p,y=vz(n,Oz),g=y.value!==void 0,x=S.useRef(null),b=wz(x,a),k=S.useRef(0),C=S.useRef(),j=function(){var R=x.current,F=r&&C.current?C.current:Tz(R);if(F){C.current=F;var U=kz(F,R.value||R.placeholder||"x",s,o),D=U[0],W=U[1];k.current!==D&&(k.current=D,R.style.setProperty("height",D+"px","important"),f(D,{rowHeight:W}))}},E=function(R){g||j(),d(R)};return S.useLayoutEffect(j),Nz(x,function(){if(!g){var _=x.current.value;requestAnimationFrame(function(){var R=x.current;R&&_!==R.value&&j()})}}),Rz(j),_z(j),S.createElement("textarea",ih({},y,{onChange:E,ref:b}))},Mz=S.forwardRef(Dz),Ap={exports:{}},jp,mx;function Lz(){if(mx)return jp;mx=1;var e="SECRET_DO_NOT_PASS_THIS_OR_YOU_WILL_BE_FIRED";return jp=e,jp}var Tp,gx;function zz(){if(gx)return Tp;gx=1;var e=Lz();function n(){}function a(){}return a.resetWarningCache=n,Tp=function(){function r(u,d,p,f,y,g){if(g!==e){var x=new Error("Calling PropTypes validators directly is not supported by the `prop-types` package. Use PropTypes.checkPropTypes() to call them. Read more at http://fb.me/use-check-prop-types");throw x.name="Invariant Violation",x}}r.isRequired=r;function o(){return r}var s={array:r,bigint:r,bool:r,func:r,number:r,object:r,string:r,symbol:r,any:r,arrayOf:o,element:r,elementType:r,instanceOf:o,node:r,objectOf:o,oneOf:o,oneOfType:o,shape:o,exact:o,checkPropTypes:a,resetWarningCache:n};return s.PropTypes=s,s},Tp}var yx;function Iz(){return yx||(yx=1,Ap.exports=zz()()),Ap.exports}var Pz=Iz();const mt=Po(Pz);function mr(e,n,a,r){function o(s){return s instanceof a?s:new a(function(u){u(s)})}return new(a||(a=Promise))(function(s,u){function d(y){try{f(r.next(y))}catch(g){u(g)}}function p(y){try{f(r.throw(y))}catch(g){u(g)}}function f(y){y.done?s(y.value):o(y.value).then(d,p)}f((r=r.apply(e,n||[])).next())})}const Uz=new Map([["1km","application/vnd.1000minds.decision-model+xml"],["3dml","text/vnd.in3d.3dml"],["3ds","image/x-3ds"],["3g2","video/3gpp2"],["3gp","video/3gp"],["3gpp","video/3gpp"],["3mf","model/3mf"],["7z","application/x-7z-compressed"],["7zip","application/x-7z-compressed"],["123","application/vnd.lotus-1-2-3"],["aab","application/x-authorware-bin"],["aac","audio/x-acc"],["aam","application/x-authorware-map"],["aas","application/x-authorware-seg"],["abw","application/x-abiword"],["ac","application/vnd.nokia.n-gage.ac+xml"],["ac3","audio/ac3"],["acc","application/vnd.americandynamics.acc"],["ace","application/x-ace-compressed"],["acu","application/vnd.acucobol"],["acutc","application/vnd.acucorp"],["adp","audio/adpcm"],["aep","application/vnd.audiograph"],["afm","application/x-font-type1"],["afp","application/vnd.ibm.modcap"],["ahead","application/vnd.ahead.space"],["ai","application/pdf"],["aif","audio/x-aiff"],["aifc","audio/x-aiff"],["aiff","audio/x-aiff"],["air","application/vnd.adobe.air-application-installer-package+zip"],["ait","application/vnd.dvb.ait"],["ami","application/vnd.amiga.ami"],["amr","audio/amr"],["apk","application/vnd.android.package-archive"],["apng","image/apng"],["appcache","text/cache-manifest"],["application","application/x-ms-application"],["apr","application/vnd.lotus-approach"],["arc","application/x-freearc"],["arj","application/x-arj"],["asc","application/pgp-signature"],["asf","video/x-ms-asf"],["asm","text/x-asm"],["aso","application/vnd.accpac.simply.aso"],["asx","video/x-ms-asf"],["atc","application/vnd.acucorp"],["atom","application/atom+xml"],["atomcat","application/atomcat+xml"],["atomdeleted","application/atomdeleted+xml"],["atomsvc","application/atomsvc+xml"],["atx","application/vnd.antix.game-component"],["au","audio/x-au"],["avi","video/x-msvideo"],["avif","image/avif"],["aw","application/applixware"],["azf","application/vnd.airzip.filesecure.azf"],["azs","application/vnd.airzip.filesecure.azs"],["azv","image/vnd.airzip.accelerator.azv"],["azw","application/vnd.amazon.ebook"],["b16","image/vnd.pco.b16"],["bat","application/x-msdownload"],["bcpio","application/x-bcpio"],["bdf","application/x-font-bdf"],["bdm","application/vnd.syncml.dm+wbxml"],["bdoc","application/x-bdoc"],["bed","application/vnd.realvnc.bed"],["bh2","application/vnd.fujitsu.oasysprs"],["bin","application/octet-stream"],["blb","application/x-blorb"],["blorb","application/x-blorb"],["bmi","application/vnd.bmi"],["bmml","application/vnd.balsamiq.bmml+xml"],["bmp","image/bmp"],["book","application/vnd.framemaker"],["box","application/vnd.previewsystems.box"],["boz","application/x-bzip2"],["bpk","application/octet-stream"],["bpmn","application/octet-stream"],["bsp","model/vnd.valve.source.compiled-map"],["btif","image/prs.btif"],["buffer","application/octet-stream"],["bz","application/x-bzip"],["bz2","application/x-bzip2"],["c","text/x-c"],["c4d","application/vnd.clonk.c4group"],["c4f","application/vnd.clonk.c4group"],["c4g","application/vnd.clonk.c4group"],["c4p","application/vnd.clonk.c4group"],["c4u","application/vnd.clonk.c4group"],["c11amc","application/vnd.cluetrust.cartomobile-config"],["c11amz","application/vnd.cluetrust.cartomobile-config-pkg"],["cab","application/vnd.ms-cab-compressed"],["caf","audio/x-caf"],["cap","application/vnd.tcpdump.pcap"],["car","application/vnd.curl.car"],["cat","application/vnd.ms-pki.seccat"],["cb7","application/x-cbr"],["cba","application/x-cbr"],["cbr","application/x-cbr"],["cbt","application/x-cbr"],["cbz","application/x-cbr"],["cc","text/x-c"],["cco","application/x-cocoa"],["cct","application/x-director"],["ccxml","application/ccxml+xml"],["cdbcmsg","application/vnd.contact.cmsg"],["cda","application/x-cdf"],["cdf","application/x-netcdf"],["cdfx","application/cdfx+xml"],["cdkey","application/vnd.mediastation.cdkey"],["cdmia","application/cdmi-capability"],["cdmic","application/cdmi-container"],["cdmid","application/cdmi-domain"],["cdmio","application/cdmi-object"],["cdmiq","application/cdmi-queue"],["cdr","application/cdr"],["cdx","chemical/x-cdx"],["cdxml","application/vnd.chemdraw+xml"],["cdy","application/vnd.cinderella"],["cer","application/pkix-cert"],["cfs","application/x-cfs-compressed"],["cgm","image/cgm"],["chat","application/x-chat"],["chm","application/vnd.ms-htmlhelp"],["chrt","application/vnd.kde.kchart"],["cif","chemical/x-cif"],["cii","application/vnd.anser-web-certificate-issue-initiation"],["cil","application/vnd.ms-artgalry"],["cjs","application/node"],["cla","application/vnd.claymore"],["class","application/octet-stream"],["clkk","application/vnd.crick.clicker.keyboard"],["clkp","application/vnd.crick.clicker.palette"],["clkt","application/vnd.crick.clicker.template"],["clkw","application/vnd.crick.clicker.wordbank"],["clkx","application/vnd.crick.clicker"],["clp","application/x-msclip"],["cmc","application/vnd.cosmocaller"],["cmdf","chemical/x-cmdf"],["cml","chemical/x-cml"],["cmp","application/vnd.yellowriver-custom-menu"],["cmx","image/x-cmx"],["cod","application/vnd.rim.cod"],["coffee","text/coffeescript"],["com","application/x-msdownload"],["conf","text/plain"],["cpio","application/x-cpio"],["cpp","text/x-c"],["cpt","application/mac-compactpro"],["crd","application/x-mscardfile"],["crl","application/pkix-crl"],["crt","application/x-x509-ca-cert"],["crx","application/x-chrome-extension"],["cryptonote","application/vnd.rig.cryptonote"],["csh","application/x-csh"],["csl","application/vnd.citationstyles.style+xml"],["csml","chemical/x-csml"],["csp","application/vnd.commonspace"],["csr","application/octet-stream"],["css","text/css"],["cst","application/x-director"],["csv","text/csv"],["cu","application/cu-seeme"],["curl","text/vnd.curl"],["cww","application/prs.cww"],["cxt","application/x-director"],["cxx","text/x-c"],["dae","model/vnd.collada+xml"],["daf","application/vnd.mobius.daf"],["dart","application/vnd.dart"],["dataless","application/vnd.fdsn.seed"],["davmount","application/davmount+xml"],["dbf","application/vnd.dbf"],["dbk","application/docbook+xml"],["dcr","application/x-director"],["dcurl","text/vnd.curl.dcurl"],["dd2","application/vnd.oma.dd2+xml"],["ddd","application/vnd.fujixerox.ddd"],["ddf","application/vnd.syncml.dmddf+xml"],["dds","image/vnd.ms-dds"],["deb","application/x-debian-package"],["def","text/plain"],["deploy","application/octet-stream"],["der","application/x-x509-ca-cert"],["dfac","application/vnd.dreamfactory"],["dgc","application/x-dgc-compressed"],["dic","text/x-c"],["dir","application/x-director"],["dis","application/vnd.mobius.dis"],["disposition-notification","message/disposition-notification"],["dist","application/octet-stream"],["distz","application/octet-stream"],["djv","image/vnd.djvu"],["djvu","image/vnd.djvu"],["dll","application/octet-stream"],["dmg","application/x-apple-diskimage"],["dmn","application/octet-stream"],["dmp","application/vnd.tcpdump.pcap"],["dms","application/octet-stream"],["dna","application/vnd.dna"],["doc","application/msword"],["docm","application/vnd.ms-word.template.macroEnabled.12"],["docx","application/vnd.openxmlformats-officedocument.wordprocessingml.document"],["dot","application/msword"],["dotm","application/vnd.ms-word.template.macroEnabled.12"],["dotx","application/vnd.openxmlformats-officedocument.wordprocessingml.template"],["dp","application/vnd.osgi.dp"],["dpg","application/vnd.dpgraph"],["dra","audio/vnd.dra"],["drle","image/dicom-rle"],["dsc","text/prs.lines.tag"],["dssc","application/dssc+der"],["dtb","application/x-dtbook+xml"],["dtd","application/xml-dtd"],["dts","audio/vnd.dts"],["dtshd","audio/vnd.dts.hd"],["dump","application/octet-stream"],["dvb","video/vnd.dvb.file"],["dvi","application/x-dvi"],["dwd","application/atsc-dwd+xml"],["dwf","model/vnd.dwf"],["dwg","image/vnd.dwg"],["dxf","image/vnd.dxf"],["dxp","application/vnd.spotfire.dxp"],["dxr","application/x-director"],["ear","application/java-archive"],["ecelp4800","audio/vnd.nuera.ecelp4800"],["ecelp7470","audio/vnd.nuera.ecelp7470"],["ecelp9600","audio/vnd.nuera.ecelp9600"],["ecma","application/ecmascript"],["edm","application/vnd.novadigm.edm"],["edx","application/vnd.novadigm.edx"],["efif","application/vnd.picsel"],["ei6","application/vnd.pg.osasli"],["elc","application/octet-stream"],["emf","image/emf"],["eml","message/rfc822"],["emma","application/emma+xml"],["emotionml","application/emotionml+xml"],["emz","application/x-msmetafile"],["eol","audio/vnd.digital-winds"],["eot","application/vnd.ms-fontobject"],["eps","application/postscript"],["epub","application/epub+zip"],["es","application/ecmascript"],["es3","application/vnd.eszigno3+xml"],["esa","application/vnd.osgi.subsystem"],["esf","application/vnd.epson.esf"],["et3","application/vnd.eszigno3+xml"],["etx","text/x-setext"],["eva","application/x-eva"],["evy","application/x-envoy"],["exe","application/octet-stream"],["exi","application/exi"],["exp","application/express"],["exr","image/aces"],["ext","application/vnd.novadigm.ext"],["ez","application/andrew-inset"],["ez2","application/vnd.ezpix-album"],["ez3","application/vnd.ezpix-package"],["f","text/x-fortran"],["f4v","video/mp4"],["f77","text/x-fortran"],["f90","text/x-fortran"],["fbs","image/vnd.fastbidsheet"],["fcdt","application/vnd.adobe.formscentral.fcdt"],["fcs","application/vnd.isac.fcs"],["fdf","application/vnd.fdf"],["fdt","application/fdt+xml"],["fe_launch","application/vnd.denovo.fcselayout-link"],["fg5","application/vnd.fujitsu.oasysgp"],["fgd","application/x-director"],["fh","image/x-freehand"],["fh4","image/x-freehand"],["fh5","image/x-freehand"],["fh7","image/x-freehand"],["fhc","image/x-freehand"],["fig","application/x-xfig"],["fits","image/fits"],["flac","audio/x-flac"],["fli","video/x-fli"],["flo","application/vnd.micrografx.flo"],["flv","video/x-flv"],["flw","application/vnd.kde.kivio"],["flx","text/vnd.fmi.flexstor"],["fly","text/vnd.fly"],["fm","application/vnd.framemaker"],["fnc","application/vnd.frogans.fnc"],["fo","application/vnd.software602.filler.form+xml"],["for","text/x-fortran"],["fpx","image/vnd.fpx"],["frame","application/vnd.framemaker"],["fsc","application/vnd.fsc.weblaunch"],["fst","image/vnd.fst"],["ftc","application/vnd.fluxtime.clip"],["fti","application/vnd.anser-web-funds-transfer-initiation"],["fvt","video/vnd.fvt"],["fxp","application/vnd.adobe.fxp"],["fxpl","application/vnd.adobe.fxp"],["fzs","application/vnd.fuzzysheet"],["g2w","application/vnd.geoplan"],["g3","image/g3fax"],["g3w","application/vnd.geospace"],["gac","application/vnd.groove-account"],["gam","application/x-tads"],["gbr","application/rpki-ghostbusters"],["gca","application/x-gca-compressed"],["gdl","model/vnd.gdl"],["gdoc","application/vnd.google-apps.document"],["geo","application/vnd.dynageo"],["geojson","application/geo+json"],["gex","application/vnd.geometry-explorer"],["ggb","application/vnd.geogebra.file"],["ggt","application/vnd.geogebra.tool"],["ghf","application/vnd.groove-help"],["gif","image/gif"],["gim","application/vnd.groove-identity-message"],["glb","model/gltf-binary"],["gltf","model/gltf+json"],["gml","application/gml+xml"],["gmx","application/vnd.gmx"],["gnumeric","application/x-gnumeric"],["gpg","application/gpg-keys"],["gph","application/vnd.flographit"],["gpx","application/gpx+xml"],["gqf","application/vnd.grafeq"],["gqs","application/vnd.grafeq"],["gram","application/srgs"],["gramps","application/x-gramps-xml"],["gre","application/vnd.geometry-explorer"],["grv","application/vnd.groove-injector"],["grxml","application/srgs+xml"],["gsf","application/x-font-ghostscript"],["gsheet","application/vnd.google-apps.spreadsheet"],["gslides","application/vnd.google-apps.presentation"],["gtar","application/x-gtar"],["gtm","application/vnd.groove-tool-message"],["gtw","model/vnd.gtw"],["gv","text/vnd.graphviz"],["gxf","application/gxf"],["gxt","application/vnd.geonext"],["gz","application/gzip"],["gzip","application/gzip"],["h","text/x-c"],["h261","video/h261"],["h263","video/h263"],["h264","video/h264"],["hal","application/vnd.hal+xml"],["hbci","application/vnd.hbci"],["hbs","text/x-handlebars-template"],["hdd","application/x-virtualbox-hdd"],["hdf","application/x-hdf"],["heic","image/heic"],["heics","image/heic-sequence"],["heif","image/heif"],["heifs","image/heif-sequence"],["hej2","image/hej2k"],["held","application/atsc-held+xml"],["hh","text/x-c"],["hjson","application/hjson"],["hlp","application/winhlp"],["hpgl","application/vnd.hp-hpgl"],["hpid","application/vnd.hp-hpid"],["hps","application/vnd.hp-hps"],["hqx","application/mac-binhex40"],["hsj2","image/hsj2"],["htc","text/x-component"],["htke","application/vnd.kenameaapp"],["htm","text/html"],["html","text/html"],["hvd","application/vnd.yamaha.hv-dic"],["hvp","application/vnd.yamaha.hv-voice"],["hvs","application/vnd.yamaha.hv-script"],["i2g","application/vnd.intergeo"],["icc","application/vnd.iccprofile"],["ice","x-conference/x-cooltalk"],["icm","application/vnd.iccprofile"],["ico","image/x-icon"],["ics","text/calendar"],["ief","image/ief"],["ifb","text/calendar"],["ifm","application/vnd.shana.informed.formdata"],["iges","model/iges"],["igl","application/vnd.igloader"],["igm","application/vnd.insors.igm"],["igs","model/iges"],["igx","application/vnd.micrografx.igx"],["iif","application/vnd.shana.informed.interchange"],["img","application/octet-stream"],["imp","application/vnd.accpac.simply.imp"],["ims","application/vnd.ms-ims"],["in","text/plain"],["ini","text/plain"],["ink","application/inkml+xml"],["inkml","application/inkml+xml"],["install","application/x-install-instructions"],["iota","application/vnd.astraea-software.iota"],["ipfix","application/ipfix"],["ipk","application/vnd.shana.informed.package"],["irm","application/vnd.ibm.rights-management"],["irp","application/vnd.irepository.package+xml"],["iso","application/x-iso9660-image"],["itp","application/vnd.shana.informed.formtemplate"],["its","application/its+xml"],["ivp","application/vnd.immervision-ivp"],["ivu","application/vnd.immervision-ivu"],["jad","text/vnd.sun.j2me.app-descriptor"],["jade","text/jade"],["jam","application/vnd.jam"],["jar","application/java-archive"],["jardiff","application/x-java-archive-diff"],["java","text/x-java-source"],["jhc","image/jphc"],["jisp","application/vnd.jisp"],["jls","image/jls"],["jlt","application/vnd.hp-jlyt"],["jng","image/x-jng"],["jnlp","application/x-java-jnlp-file"],["joda","application/vnd.joost.joda-archive"],["jp2","image/jp2"],["jpe","image/jpeg"],["jpeg","image/jpeg"],["jpf","image/jpx"],["jpg","image/jpeg"],["jpg2","image/jp2"],["jpgm","video/jpm"],["jpgv","video/jpeg"],["jph","image/jph"],["jpm","video/jpm"],["jpx","image/jpx"],["js","application/javascript"],["json","application/json"],["json5","application/json5"],["jsonld","application/ld+json"],["jsonl","application/jsonl"],["jsonml","application/jsonml+json"],["jsx","text/jsx"],["jxr","image/jxr"],["jxra","image/jxra"],["jxrs","image/jxrs"],["jxs","image/jxs"],["jxsc","image/jxsc"],["jxsi","image/jxsi"],["jxss","image/jxss"],["kar","audio/midi"],["karbon","application/vnd.kde.karbon"],["kdb","application/octet-stream"],["kdbx","application/x-keepass2"],["key","application/x-iwork-keynote-sffkey"],["kfo","application/vnd.kde.kformula"],["kia","application/vnd.kidspiration"],["kml","application/vnd.google-earth.kml+xml"],["kmz","application/vnd.google-earth.kmz"],["kne","application/vnd.kinar"],["knp","application/vnd.kinar"],["kon","application/vnd.kde.kontour"],["kpr","application/vnd.kde.kpresenter"],["kpt","application/vnd.kde.kpresenter"],["kpxx","application/vnd.ds-keypoint"],["ksp","application/vnd.kde.kspread"],["ktr","application/vnd.kahootz"],["ktx","image/ktx"],["ktx2","image/ktx2"],["ktz","application/vnd.kahootz"],["kwd","application/vnd.kde.kword"],["kwt","application/vnd.kde.kword"],["lasxml","application/vnd.las.las+xml"],["latex","application/x-latex"],["lbd","application/vnd.llamagraphics.life-balance.desktop"],["lbe","application/vnd.llamagraphics.life-balance.exchange+xml"],["les","application/vnd.hhe.lesson-player"],["less","text/less"],["lgr","application/lgr+xml"],["lha","application/octet-stream"],["link66","application/vnd.route66.link66+xml"],["list","text/plain"],["list3820","application/vnd.ibm.modcap"],["listafp","application/vnd.ibm.modcap"],["litcoffee","text/coffeescript"],["lnk","application/x-ms-shortcut"],["log","text/plain"],["lostxml","application/lost+xml"],["lrf","application/octet-stream"],["lrm","application/vnd.ms-lrm"],["ltf","application/vnd.frogans.ltf"],["lua","text/x-lua"],["luac","application/x-lua-bytecode"],["lvp","audio/vnd.lucent.voice"],["lwp","application/vnd.lotus-wordpro"],["lzh","application/octet-stream"],["m1v","video/mpeg"],["m2a","audio/mpeg"],["m2v","video/mpeg"],["m3a","audio/mpeg"],["m3u","text/plain"],["m3u8","application/vnd.apple.mpegurl"],["m4a","audio/x-m4a"],["m4p","application/mp4"],["m4s","video/iso.segment"],["m4u","application/vnd.mpegurl"],["m4v","video/x-m4v"],["m13","application/x-msmediaview"],["m14","application/x-msmediaview"],["m21","application/mp21"],["ma","application/mathematica"],["mads","application/mads+xml"],["maei","application/mmt-aei+xml"],["mag","application/vnd.ecowin.chart"],["maker","application/vnd.framemaker"],["man","text/troff"],["manifest","text/cache-manifest"],["map","application/json"],["mar","application/octet-stream"],["markdown","text/markdown"],["mathml","application/mathml+xml"],["mb","application/mathematica"],["mbk","application/vnd.mobius.mbk"],["mbox","application/mbox"],["mc1","application/vnd.medcalcdata"],["mcd","application/vnd.mcd"],["mcurl","text/vnd.curl.mcurl"],["md","text/markdown"],["mdb","application/x-msaccess"],["mdi","image/vnd.ms-modi"],["mdx","text/mdx"],["me","text/troff"],["mesh","model/mesh"],["meta4","application/metalink4+xml"],["metalink","application/metalink+xml"],["mets","application/mets+xml"],["mfm","application/vnd.mfmp"],["mft","application/rpki-manifest"],["mgp","application/vnd.osgeo.mapguide.package"],["mgz","application/vnd.proteus.magazine"],["mid","audio/midi"],["midi","audio/midi"],["mie","application/x-mie"],["mif","application/vnd.mif"],["mime","message/rfc822"],["mj2","video/mj2"],["mjp2","video/mj2"],["mjs","application/javascript"],["mk3d","video/x-matroska"],["mka","audio/x-matroska"],["mkd","text/x-markdown"],["mks","video/x-matroska"],["mkv","video/x-matroska"],["mlp","application/vnd.dolby.mlp"],["mmd","application/vnd.chipnuts.karaoke-mmd"],["mmf","application/vnd.smaf"],["mml","text/mathml"],["mmr","image/vnd.fujixerox.edmics-mmr"],["mng","video/x-mng"],["mny","application/x-msmoney"],["mobi","application/x-mobipocket-ebook"],["mods","application/mods+xml"],["mov","video/quicktime"],["movie","video/x-sgi-movie"],["mp2","audio/mpeg"],["mp2a","audio/mpeg"],["mp3","audio/mpeg"],["mp4","video/mp4"],["mp4a","audio/mp4"],["mp4s","application/mp4"],["mp4v","video/mp4"],["mp21","application/mp21"],["mpc","application/vnd.mophun.certificate"],["mpd","application/dash+xml"],["mpe","video/mpeg"],["mpeg","video/mpeg"],["mpg","video/mpeg"],["mpg4","video/mp4"],["mpga","audio/mpeg"],["mpkg","application/vnd.apple.installer+xml"],["mpm","application/vnd.blueice.multipass"],["mpn","application/vnd.mophun.application"],["mpp","application/vnd.ms-project"],["mpt","application/vnd.ms-project"],["mpy","application/vnd.ibm.minipay"],["mqy","application/vnd.mobius.mqy"],["mrc","application/marc"],["mrcx","application/marcxml+xml"],["ms","text/troff"],["mscml","application/mediaservercontrol+xml"],["mseed","application/vnd.fdsn.mseed"],["mseq","application/vnd.mseq"],["msf","application/vnd.epson.msf"],["msg","application/vnd.ms-outlook"],["msh","model/mesh"],["msi","application/x-msdownload"],["msl","application/vnd.mobius.msl"],["msm","application/octet-stream"],["msp","application/octet-stream"],["msty","application/vnd.muvee.style"],["mtl","model/mtl"],["mts","model/vnd.mts"],["mus","application/vnd.musician"],["musd","application/mmt-usd+xml"],["musicxml","application/vnd.recordare.musicxml+xml"],["mvb","application/x-msmediaview"],["mvt","application/vnd.mapbox-vector-tile"],["mwf","application/vnd.mfer"],["mxf","application/mxf"],["mxl","application/vnd.recordare.musicxml"],["mxmf","audio/mobile-xmf"],["mxml","application/xv+xml"],["mxs","application/vnd.triscape.mxs"],["mxu","video/vnd.mpegurl"],["n-gage","application/vnd.nokia.n-gage.symbian.install"],["n3","text/n3"],["nb","application/mathematica"],["nbp","application/vnd.wolfram.player"],["nc","application/x-netcdf"],["ncx","application/x-dtbncx+xml"],["nfo","text/x-nfo"],["ngdat","application/vnd.nokia.n-gage.data"],["nitf","application/vnd.nitf"],["nlu","application/vnd.neurolanguage.nlu"],["nml","application/vnd.enliven"],["nnd","application/vnd.noblenet-directory"],["nns","application/vnd.noblenet-sealer"],["nnw","application/vnd.noblenet-web"],["npx","image/vnd.net-fpx"],["nq","application/n-quads"],["nsc","application/x-conference"],["nsf","application/vnd.lotus-notes"],["nt","application/n-triples"],["ntf","application/vnd.nitf"],["numbers","application/x-iwork-numbers-sffnumbers"],["nzb","application/x-nzb"],["oa2","application/vnd.fujitsu.oasys2"],["oa3","application/vnd.fujitsu.oasys3"],["oas","application/vnd.fujitsu.oasys"],["obd","application/x-msbinder"],["obgx","application/vnd.openblox.game+xml"],["obj","model/obj"],["oda","application/oda"],["odb","application/vnd.oasis.opendocument.database"],["odc","application/vnd.oasis.opendocument.chart"],["odf","application/vnd.oasis.opendocument.formula"],["odft","application/vnd.oasis.opendocument.formula-template"],["odg","application/vnd.oasis.opendocument.graphics"],["odi","application/vnd.oasis.opendocument.image"],["odm","application/vnd.oasis.opendocument.text-master"],["odp","application/vnd.oasis.opendocument.presentation"],["ods","application/vnd.oasis.opendocument.spreadsheet"],["odt","application/vnd.oasis.opendocument.text"],["oga","audio/ogg"],["ogex","model/vnd.opengex"],["ogg","audio/ogg"],["ogv","video/ogg"],["ogx","application/ogg"],["omdoc","application/omdoc+xml"],["onepkg","application/onenote"],["onetmp","application/onenote"],["onetoc","application/onenote"],["onetoc2","application/onenote"],["opf","application/oebps-package+xml"],["opml","text/x-opml"],["oprc","application/vnd.palm"],["opus","audio/ogg"],["org","text/x-org"],["osf","application/vnd.yamaha.openscoreformat"],["osfpvg","application/vnd.yamaha.openscoreformat.osfpvg+xml"],["osm","application/vnd.openstreetmap.data+xml"],["otc","application/vnd.oasis.opendocument.chart-template"],["otf","font/otf"],["otg","application/vnd.oasis.opendocument.graphics-template"],["oth","application/vnd.oasis.opendocument.text-web"],["oti","application/vnd.oasis.opendocument.image-template"],["otp","application/vnd.oasis.opendocument.presentation-template"],["ots","application/vnd.oasis.opendocument.spreadsheet-template"],["ott","application/vnd.oasis.opendocument.text-template"],["ova","application/x-virtualbox-ova"],["ovf","application/x-virtualbox-ovf"],["owl","application/rdf+xml"],["oxps","application/oxps"],["oxt","application/vnd.openofficeorg.extension"],["p","text/x-pascal"],["p7a","application/x-pkcs7-signature"],["p7b","application/x-pkcs7-certificates"],["p7c","application/pkcs7-mime"],["p7m","application/pkcs7-mime"],["p7r","application/x-pkcs7-certreqresp"],["p7s","application/pkcs7-signature"],["p8","application/pkcs8"],["p10","application/x-pkcs10"],["p12","application/x-pkcs12"],["pac","application/x-ns-proxy-autoconfig"],["pages","application/x-iwork-pages-sffpages"],["pas","text/x-pascal"],["paw","application/vnd.pawaafile"],["pbd","application/vnd.powerbuilder6"],["pbm","image/x-portable-bitmap"],["pcap","application/vnd.tcpdump.pcap"],["pcf","application/x-font-pcf"],["pcl","application/vnd.hp-pcl"],["pclxl","application/vnd.hp-pclxl"],["pct","image/x-pict"],["pcurl","application/vnd.curl.pcurl"],["pcx","image/x-pcx"],["pdb","application/x-pilot"],["pde","text/x-processing"],["pdf","application/pdf"],["pem","application/x-x509-user-cert"],["pfa","application/x-font-type1"],["pfb","application/x-font-type1"],["pfm","application/x-font-type1"],["pfr","application/font-tdpfr"],["pfx","application/x-pkcs12"],["pgm","image/x-portable-graymap"],["pgn","application/x-chess-pgn"],["pgp","application/pgp"],["php","application/x-httpd-php"],["php3","application/x-httpd-php"],["php4","application/x-httpd-php"],["phps","application/x-httpd-php-source"],["phtml","application/x-httpd-php"],["pic","image/x-pict"],["pkg","application/octet-stream"],["pki","application/pkixcmp"],["pkipath","application/pkix-pkipath"],["pkpass","application/vnd.apple.pkpass"],["pl","application/x-perl"],["plb","application/vnd.3gpp.pic-bw-large"],["plc","application/vnd.mobius.plc"],["plf","application/vnd.pocketlearn"],["pls","application/pls+xml"],["pm","application/x-perl"],["pml","application/vnd.ctc-posml"],["png","image/png"],["pnm","image/x-portable-anymap"],["portpkg","application/vnd.macports.portpkg"],["pot","application/vnd.ms-powerpoint"],["potm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["potx","application/vnd.openxmlformats-officedocument.presentationml.template"],["ppa","application/vnd.ms-powerpoint"],["ppam","application/vnd.ms-powerpoint.addin.macroEnabled.12"],["ppd","application/vnd.cups-ppd"],["ppm","image/x-portable-pixmap"],["pps","application/vnd.ms-powerpoint"],["ppsm","application/vnd.ms-powerpoint.slideshow.macroEnabled.12"],["ppsx","application/vnd.openxmlformats-officedocument.presentationml.slideshow"],["ppt","application/powerpoint"],["pptm","application/vnd.ms-powerpoint.presentation.macroEnabled.12"],["pptx","application/vnd.openxmlformats-officedocument.presentationml.presentation"],["pqa","application/vnd.palm"],["prc","application/x-pilot"],["pre","application/vnd.lotus-freelance"],["prf","application/pics-rules"],["provx","application/provenance+xml"],["ps","application/postscript"],["psb","application/vnd.3gpp.pic-bw-small"],["psd","application/x-photoshop"],["psf","application/x-font-linux-psf"],["pskcxml","application/pskc+xml"],["pti","image/prs.pti"],["ptid","application/vnd.pvi.ptid1"],["pub","application/x-mspublisher"],["pvb","application/vnd.3gpp.pic-bw-var"],["pwn","application/vnd.3m.post-it-notes"],["pya","audio/vnd.ms-playready.media.pya"],["pyv","video/vnd.ms-playready.media.pyv"],["qam","application/vnd.epson.quickanime"],["qbo","application/vnd.intu.qbo"],["qfx","application/vnd.intu.qfx"],["qps","application/vnd.publishare-delta-tree"],["qt","video/quicktime"],["qwd","application/vnd.quark.quarkxpress"],["qwt","application/vnd.quark.quarkxpress"],["qxb","application/vnd.quark.quarkxpress"],["qxd","application/vnd.quark.quarkxpress"],["qxl","application/vnd.quark.quarkxpress"],["qxt","application/vnd.quark.quarkxpress"],["ra","audio/x-realaudio"],["ram","audio/x-pn-realaudio"],["raml","application/raml+yaml"],["rapd","application/route-apd+xml"],["rar","application/x-rar"],["ras","image/x-cmu-raster"],["rcprofile","application/vnd.ipunplugged.rcprofile"],["rdf","application/rdf+xml"],["rdz","application/vnd.data-vision.rdz"],["relo","application/p2p-overlay+xml"],["rep","application/vnd.businessobjects"],["res","application/x-dtbresource+xml"],["rgb","image/x-rgb"],["rif","application/reginfo+xml"],["rip","audio/vnd.rip"],["ris","application/x-research-info-systems"],["rl","application/resource-lists+xml"],["rlc","image/vnd.fujixerox.edmics-rlc"],["rld","application/resource-lists-diff+xml"],["rm","audio/x-pn-realaudio"],["rmi","audio/midi"],["rmp","audio/x-pn-realaudio-plugin"],["rms","application/vnd.jcp.javame.midlet-rms"],["rmvb","application/vnd.rn-realmedia-vbr"],["rnc","application/relax-ng-compact-syntax"],["rng","application/xml"],["roa","application/rpki-roa"],["roff","text/troff"],["rp9","application/vnd.cloanto.rp9"],["rpm","audio/x-pn-realaudio-plugin"],["rpss","application/vnd.nokia.radio-presets"],["rpst","application/vnd.nokia.radio-preset"],["rq","application/sparql-query"],["rs","application/rls-services+xml"],["rsa","application/x-pkcs7"],["rsat","application/atsc-rsat+xml"],["rsd","application/rsd+xml"],["rsheet","application/urc-ressheet+xml"],["rss","application/rss+xml"],["rtf","text/rtf"],["rtx","text/richtext"],["run","application/x-makeself"],["rusd","application/route-usd+xml"],["rv","video/vnd.rn-realvideo"],["s","text/x-asm"],["s3m","audio/s3m"],["saf","application/vnd.yamaha.smaf-audio"],["sass","text/x-sass"],["sbml","application/sbml+xml"],["sc","application/vnd.ibm.secure-container"],["scd","application/x-msschedule"],["scm","application/vnd.lotus-screencam"],["scq","application/scvp-cv-request"],["scs","application/scvp-cv-response"],["scss","text/x-scss"],["scurl","text/vnd.curl.scurl"],["sda","application/vnd.stardivision.draw"],["sdc","application/vnd.stardivision.calc"],["sdd","application/vnd.stardivision.impress"],["sdkd","application/vnd.solent.sdkm+xml"],["sdkm","application/vnd.solent.sdkm+xml"],["sdp","application/sdp"],["sdw","application/vnd.stardivision.writer"],["sea","application/octet-stream"],["see","application/vnd.seemail"],["seed","application/vnd.fdsn.seed"],["sema","application/vnd.sema"],["semd","application/vnd.semd"],["semf","application/vnd.semf"],["senmlx","application/senml+xml"],["sensmlx","application/sensml+xml"],["ser","application/java-serialized-object"],["setpay","application/set-payment-initiation"],["setreg","application/set-registration-initiation"],["sfd-hdstx","application/vnd.hydrostatix.sof-data"],["sfs","application/vnd.spotfire.sfs"],["sfv","text/x-sfv"],["sgi","image/sgi"],["sgl","application/vnd.stardivision.writer-global"],["sgm","text/sgml"],["sgml","text/sgml"],["sh","application/x-sh"],["shar","application/x-shar"],["shex","text/shex"],["shf","application/shf+xml"],["shtml","text/html"],["sid","image/x-mrsid-image"],["sieve","application/sieve"],["sig","application/pgp-signature"],["sil","audio/silk"],["silo","model/mesh"],["sis","application/vnd.symbian.install"],["sisx","application/vnd.symbian.install"],["sit","application/x-stuffit"],["sitx","application/x-stuffitx"],["siv","application/sieve"],["skd","application/vnd.koan"],["skm","application/vnd.koan"],["skp","application/vnd.koan"],["skt","application/vnd.koan"],["sldm","application/vnd.ms-powerpoint.slide.macroenabled.12"],["sldx","application/vnd.openxmlformats-officedocument.presentationml.slide"],["slim","text/slim"],["slm","text/slim"],["sls","application/route-s-tsid+xml"],["slt","application/vnd.epson.salt"],["sm","application/vnd.stepmania.stepchart"],["smf","application/vnd.stardivision.math"],["smi","application/smil"],["smil","application/smil"],["smv","video/x-smv"],["smzip","application/vnd.stepmania.package"],["snd","audio/basic"],["snf","application/x-font-snf"],["so","application/octet-stream"],["spc","application/x-pkcs7-certificates"],["spdx","text/spdx"],["spf","application/vnd.yamaha.smaf-phrase"],["spl","application/x-futuresplash"],["spot","text/vnd.in3d.spot"],["spp","application/scvp-vp-response"],["spq","application/scvp-vp-request"],["spx","audio/ogg"],["sql","application/x-sql"],["src","application/x-wais-source"],["srt","application/x-subrip"],["sru","application/sru+xml"],["srx","application/sparql-results+xml"],["ssdl","application/ssdl+xml"],["sse","application/vnd.kodak-descriptor"],["ssf","application/vnd.epson.ssf"],["ssml","application/ssml+xml"],["sst","application/octet-stream"],["st","application/vnd.sailingtracker.track"],["stc","application/vnd.sun.xml.calc.template"],["std","application/vnd.sun.xml.draw.template"],["stf","application/vnd.wt.stf"],["sti","application/vnd.sun.xml.impress.template"],["stk","application/hyperstudio"],["stl","model/stl"],["stpx","model/step+xml"],["stpxz","model/step-xml+zip"],["stpz","model/step+zip"],["str","application/vnd.pg.format"],["stw","application/vnd.sun.xml.writer.template"],["styl","text/stylus"],["stylus","text/stylus"],["sub","text/vnd.dvb.subtitle"],["sus","application/vnd.sus-calendar"],["susp","application/vnd.sus-calendar"],["sv4cpio","application/x-sv4cpio"],["sv4crc","application/x-sv4crc"],["svc","application/vnd.dvb.service"],["svd","application/vnd.svd"],["svg","image/svg+xml"],["svgz","image/svg+xml"],["swa","application/x-director"],["swf","application/x-shockwave-flash"],["swi","application/vnd.aristanetworks.swi"],["swidtag","application/swid+xml"],["sxc","application/vnd.sun.xml.calc"],["sxd","application/vnd.sun.xml.draw"],["sxg","application/vnd.sun.xml.writer.global"],["sxi","application/vnd.sun.xml.impress"],["sxm","application/vnd.sun.xml.math"],["sxw","application/vnd.sun.xml.writer"],["t","text/troff"],["t3","application/x-t3vm-image"],["t38","image/t38"],["taglet","application/vnd.mynfc"],["tao","application/vnd.tao.intent-module-archive"],["tap","image/vnd.tencent.tap"],["tar","application/x-tar"],["tcap","application/vnd.3gpp2.tcap"],["tcl","application/x-tcl"],["td","application/urc-targetdesc+xml"],["teacher","application/vnd.smart.teacher"],["tei","application/tei+xml"],["teicorpus","application/tei+xml"],["tex","application/x-tex"],["texi","application/x-texinfo"],["texinfo","application/x-texinfo"],["text","text/plain"],["tfi","application/thraud+xml"],["tfm","application/x-tex-tfm"],["tfx","image/tiff-fx"],["tga","image/x-tga"],["tgz","application/x-tar"],["thmx","application/vnd.ms-officetheme"],["tif","image/tiff"],["tiff","image/tiff"],["tk","application/x-tcl"],["tmo","application/vnd.tmobile-livetv"],["toml","application/toml"],["torrent","application/x-bittorrent"],["tpl","application/vnd.groove-tool-template"],["tpt","application/vnd.trid.tpt"],["tr","text/troff"],["tra","application/vnd.trueapp"],["trig","application/trig"],["trm","application/x-msterminal"],["ts","video/mp2t"],["tsd","application/timestamped-data"],["tsv","text/tab-separated-values"],["ttc","font/collection"],["ttf","font/ttf"],["ttl","text/turtle"],["ttml","application/ttml+xml"],["twd","application/vnd.simtech-mindmapper"],["twds","application/vnd.simtech-mindmapper"],["txd","application/vnd.genomatix.tuxedo"],["txf","application/vnd.mobius.txf"],["txt","text/plain"],["u8dsn","message/global-delivery-status"],["u8hdr","message/global-headers"],["u8mdn","message/global-disposition-notification"],["u8msg","message/global"],["u32","application/x-authorware-bin"],["ubj","application/ubjson"],["udeb","application/x-debian-package"],["ufd","application/vnd.ufdl"],["ufdl","application/vnd.ufdl"],["ulx","application/x-glulx"],["umj","application/vnd.umajin"],["unityweb","application/vnd.unity"],["uoml","application/vnd.uoml+xml"],["uri","text/uri-list"],["uris","text/uri-list"],["urls","text/uri-list"],["usdz","model/vnd.usdz+zip"],["ustar","application/x-ustar"],["utz","application/vnd.uiq.theme"],["uu","text/x-uuencode"],["uva","audio/vnd.dece.audio"],["uvd","application/vnd.dece.data"],["uvf","application/vnd.dece.data"],["uvg","image/vnd.dece.graphic"],["uvh","video/vnd.dece.hd"],["uvi","image/vnd.dece.graphic"],["uvm","video/vnd.dece.mobile"],["uvp","video/vnd.dece.pd"],["uvs","video/vnd.dece.sd"],["uvt","application/vnd.dece.ttml+xml"],["uvu","video/vnd.uvvu.mp4"],["uvv","video/vnd.dece.video"],["uvva","audio/vnd.dece.audio"],["uvvd","application/vnd.dece.data"],["uvvf","application/vnd.dece.data"],["uvvg","image/vnd.dece.graphic"],["uvvh","video/vnd.dece.hd"],["uvvi","image/vnd.dece.graphic"],["uvvm","video/vnd.dece.mobile"],["uvvp","video/vnd.dece.pd"],["uvvs","video/vnd.dece.sd"],["uvvt","application/vnd.dece.ttml+xml"],["uvvu","video/vnd.uvvu.mp4"],["uvvv","video/vnd.dece.video"],["uvvx","application/vnd.dece.unspecified"],["uvvz","application/vnd.dece.zip"],["uvx","application/vnd.dece.unspecified"],["uvz","application/vnd.dece.zip"],["vbox","application/x-virtualbox-vbox"],["vbox-extpack","application/x-virtualbox-vbox-extpack"],["vcard","text/vcard"],["vcd","application/x-cdlink"],["vcf","text/x-vcard"],["vcg","application/vnd.groove-vcard"],["vcs","text/x-vcalendar"],["vcx","application/vnd.vcx"],["vdi","application/x-virtualbox-vdi"],["vds","model/vnd.sap.vds"],["vhd","application/x-virtualbox-vhd"],["vis","application/vnd.visionary"],["viv","video/vnd.vivo"],["vlc","application/videolan"],["vmdk","application/x-virtualbox-vmdk"],["vob","video/x-ms-vob"],["vor","application/vnd.stardivision.writer"],["vox","application/x-authorware-bin"],["vrml","model/vrml"],["vsd","application/vnd.visio"],["vsf","application/vnd.vsf"],["vss","application/vnd.visio"],["vst","application/vnd.visio"],["vsw","application/vnd.visio"],["vtf","image/vnd.valve.source.texture"],["vtt","text/vtt"],["vtu","model/vnd.vtu"],["vxml","application/voicexml+xml"],["w3d","application/x-director"],["wad","application/x-doom"],["wadl","application/vnd.sun.wadl+xml"],["war","application/java-archive"],["wasm","application/wasm"],["wav","audio/x-wav"],["wax","audio/x-ms-wax"],["wbmp","image/vnd.wap.wbmp"],["wbs","application/vnd.criticaltools.wbs+xml"],["wbxml","application/wbxml"],["wcm","application/vnd.ms-works"],["wdb","application/vnd.ms-works"],["wdp","image/vnd.ms-photo"],["weba","audio/webm"],["webapp","application/x-web-app-manifest+json"],["webm","video/webm"],["webmanifest","application/manifest+json"],["webp","image/webp"],["wg","application/vnd.pmi.widget"],["wgt","application/widget"],["wks","application/vnd.ms-works"],["wm","video/x-ms-wm"],["wma","audio/x-ms-wma"],["wmd","application/x-ms-wmd"],["wmf","image/wmf"],["wml","text/vnd.wap.wml"],["wmlc","application/wmlc"],["wmls","text/vnd.wap.wmlscript"],["wmlsc","application/vnd.wap.wmlscriptc"],["wmv","video/x-ms-wmv"],["wmx","video/x-ms-wmx"],["wmz","application/x-msmetafile"],["woff","font/woff"],["woff2","font/woff2"],["word","application/msword"],["wpd","application/vnd.wordperfect"],["wpl","application/vnd.ms-wpl"],["wps","application/vnd.ms-works"],["wqd","application/vnd.wqd"],["wri","application/x-mswrite"],["wrl","model/vrml"],["wsc","message/vnd.wfa.wsc"],["wsdl","application/wsdl+xml"],["wspolicy","application/wspolicy+xml"],["wtb","application/vnd.webturbo"],["wvx","video/x-ms-wvx"],["x3d","model/x3d+xml"],["x3db","model/x3d+fastinfoset"],["x3dbz","model/x3d+binary"],["x3dv","model/x3d-vrml"],["x3dvz","model/x3d+vrml"],["x3dz","model/x3d+xml"],["x32","application/x-authorware-bin"],["x_b","model/vnd.parasolid.transmit.binary"],["x_t","model/vnd.parasolid.transmit.text"],["xaml","application/xaml+xml"],["xap","application/x-silverlight-app"],["xar","application/vnd.xara"],["xav","application/xcap-att+xml"],["xbap","application/x-ms-xbap"],["xbd","application/vnd.fujixerox.docuworks.binder"],["xbm","image/x-xbitmap"],["xca","application/xcap-caps+xml"],["xcs","application/calendar+xml"],["xdf","application/xcap-diff+xml"],["xdm","application/vnd.syncml.dm+xml"],["xdp","application/vnd.adobe.xdp+xml"],["xdssc","application/dssc+xml"],["xdw","application/vnd.fujixerox.docuworks"],["xel","application/xcap-el+xml"],["xenc","application/xenc+xml"],["xer","application/patch-ops-error+xml"],["xfdf","application/vnd.adobe.xfdf"],["xfdl","application/vnd.xfdl"],["xht","application/xhtml+xml"],["xhtml","application/xhtml+xml"],["xhvml","application/xv+xml"],["xif","image/vnd.xiff"],["xl","application/excel"],["xla","application/vnd.ms-excel"],["xlam","application/vnd.ms-excel.addin.macroEnabled.12"],["xlc","application/vnd.ms-excel"],["xlf","application/xliff+xml"],["xlm","application/vnd.ms-excel"],["xls","application/vnd.ms-excel"],["xlsb","application/vnd.ms-excel.sheet.binary.macroEnabled.12"],["xlsm","application/vnd.ms-excel.sheet.macroEnabled.12"],["xlsx","application/vnd.openxmlformats-officedocument.spreadsheetml.sheet"],["xlt","application/vnd.ms-excel"],["xltm","application/vnd.ms-excel.template.macroEnabled.12"],["xltx","application/vnd.openxmlformats-officedocument.spreadsheetml.template"],["xlw","application/vnd.ms-excel"],["xm","audio/xm"],["xml","application/xml"],["xns","application/xcap-ns+xml"],["xo","application/vnd.olpc-sugar"],["xop","application/xop+xml"],["xpi","application/x-xpinstall"],["xpl","application/xproc+xml"],["xpm","image/x-xpixmap"],["xpr","application/vnd.is-xpr"],["xps","application/vnd.ms-xpsdocument"],["xpw","application/vnd.intercon.formnet"],["xpx","application/vnd.intercon.formnet"],["xsd","application/xml"],["xsl","application/xml"],["xslt","application/xslt+xml"],["xsm","application/vnd.syncml+xml"],["xspf","application/xspf+xml"],["xul","application/vnd.mozilla.xul+xml"],["xvm","application/xv+xml"],["xvml","application/xv+xml"],["xwd","image/x-xwindowdump"],["xyz","chemical/x-xyz"],["xz","application/x-xz"],["yaml","text/yaml"],["yang","application/yang"],["yin","application/yin+xml"],["yml","text/yaml"],["ymp","text/x-suse-ymp"],["z","application/x-compress"],["z1","application/x-zmachine"],["z2","application/x-zmachine"],["z3","application/x-zmachine"],["z4","application/x-zmachine"],["z5","application/x-zmachine"],["z6","application/x-zmachine"],["z7","application/x-zmachine"],["z8","application/x-zmachine"],["zaz","application/vnd.zzazz.deck+xml"],["zip","application/zip"],["zir","application/vnd.zul"],["zirz","application/vnd.zul"],["zmm","application/vnd.handheld-entertainment+xml"],["zsh","text/x-scriptzsh"]]);function sl(e,n,a){const r=Bz(e),{webkitRelativePath:o}=e,s=typeof n=="string"?n:typeof o=="string"&&o.length>0?o:`./${e.name}`;return typeof r.path!="string"&&vx(r,"path",s),vx(r,"relativePath",s),r}function Bz(e){const{name:n}=e;if(n&&n.lastIndexOf(".")!==-1&&!e.type){const r=n.split(".").pop().toLowerCase(),o=Uz.get(r);o&&Object.defineProperty(e,"type",{value:o,writable:!1,configurable:!1,enumerable:!0})}return e}function vx(e,n,a){Object.defineProperty(e,n,{value:a,writable:!1,configurable:!1,enumerable:!0})}const Hz=[".DS_Store","Thumbs.db"];function $z(e){return mr(this,void 0,void 0,function*(){return Xc(e)&&qz(e.dataTransfer)?Wz(e.dataTransfer,e.type):Fz(e)?Gz(e):Array.isArray(e)&&e.every(n=>"getFile"in n&&typeof n.getFile=="function")?Vz(e):[]})}function qz(e){return Xc(e)}function Fz(e){return Xc(e)&&Xc(e.target)}function Xc(e){return typeof e=="object"&&e!==null}function Gz(e){return rh(e.target.files).map(n=>sl(n))}function Vz(e){return mr(this,void 0,void 0,function*(){return(yield Promise.all(e.map(a=>a.getFile()))).map(a=>sl(a))})}function Wz(e,n){return mr(this,void 0,void 0,function*(){if(e.items){const a=rh(e.items).filter(o=>o.kind==="file");if(n!=="drop")return a;const r=yield Promise.all(a.map(Yz));return xx(TS(r))}return xx(rh(e.files).map(a=>sl(a)))})}function xx(e){return e.filter(n=>Hz.indexOf(n.name)===-1)}function rh(e){if(e===null)return[];const n=[];for(let a=0;a<e.length;a++){const r=e[a];n.push(r)}return n}function Yz(e){if(typeof e.webkitGetAsEntry!="function")return bx(e);const n=e.webkitGetAsEntry();return n&&n.isDirectory?NS(n):bx(e,n)}function TS(e){return e.reduce((n,a)=>[...n,...Array.isArray(a)?TS(a):[a]],[])}function bx(e,n){return mr(this,void 0,void 0,function*(){var a;if(globalThis.isSecureContext&&typeof e.getAsFileSystemHandle=="function"){const s=yield e.getAsFileSystemHandle();if(s===null)throw new Error(`${e} is not a File`);if(s!==void 0){const u=yield s.getFile();return u.handle=s,sl(u)}}const r=e.getAsFile();if(!r)throw new Error(`${e} is not a File`);return sl(r,(a=n==null?void 0:n.fullPath)!==null&&a!==void 0?a:void 0)})}function Kz(e){return mr(this,void 0,void 0,function*(){return e.isDirectory?NS(e):Qz(e)})}function NS(e){const n=e.createReader();return new Promise((a,r)=>{const o=[];function s(){n.readEntries(u=>mr(this,void 0,void 0,function*(){if(u.length){const d=Promise.all(u.map(Kz));o.push(d),s()}else try{const d=yield Promise.all(o);a(d)}catch(d){r(d)}}),u=>{r(u)})}s()})}function Qz(e){return mr(this,void 0,void 0,function*(){return new Promise((n,a)=>{e.file(r=>{const o=sl(r,e.fullPath);n(o)},r=>{a(r)})})})}var bc={},wx;function Xz(){return wx||(wx=1,bc.__esModule=!0,bc.default=function(e,n){if(e&&n){var a=Array.isArray(n)?n:n.split(",");if(a.length===0)return!0;var r=e.name||"",o=(e.type||"").toLowerCase(),s=o.replace(/\/.*$/,"");return a.some(function(u){var d=u.trim().toLowerCase();return d.charAt(0)==="."?r.toLowerCase().endsWith(d):d.endsWith("/*")?s===d.replace(/\/.*$/,""):o===d})}return!0}),bc}var Zz=Xz();const Np=Po(Zz);function Sx(e){return tI(e)||eI(e)||_S(e)||Jz()}function Jz(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1170
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function eI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function tI(e){if(Array.isArray(e))return lh(e)}function kx(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,r)}return a}function Cx(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?kx(Object(a),!0).forEach(function(r){RS(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):kx(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function RS(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Io(e,n){return iI(e)||aI(e,n)||_S(e,n)||nI()}function nI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1171
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _S(e,n){if(e){if(typeof e=="string")return lh(e,n);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return lh(e,n)}}function lh(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,r=new Array(n);a<n;a++)r[a]=e[a];return r}function aI(e,n){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var r=[],o=!0,s=!1,u,d;try{for(a=a.call(e);!(o=(u=a.next()).done)&&(r.push(u.value),!(n&&r.length===n));o=!0);}catch(p){s=!0,d=p}finally{try{!o&&a.return!=null&&a.return()}finally{if(s)throw d}}return r}}function iI(e){if(Array.isArray(e))return e}var rI=typeof Np=="function"?Np:Np.default,lI="file-invalid-type",oI="file-too-large",sI="file-too-small",cI="too-many-files",uI=function(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"",a=n.split(","),r=a.length>1?"one of ".concat(a.join(", ")):a[0];return{code:lI,message:"File type must be ".concat(r)}},Ex=function(n){return{code:oI,message:"File is larger than ".concat(n," ").concat(n===1?"byte":"bytes")}},Ax=function(n){return{code:sI,message:"File is smaller than ".concat(n," ").concat(n===1?"byte":"bytes")}},dI={code:cI,message:"Too many files"};function fI(e){return e.type===""&&typeof e.getAsFile=="function"}function OS(e,n){var a=e.type==="application/x-moz-file"||rI(e,n)||fI(e);return[a,a?null:uI(n)]}function DS(e,n,a){if(or(e.size))if(or(n)&&or(a)){if(e.size>a)return[!1,Ex(a)];if(e.size<n)return[!1,Ax(n)]}else{if(or(n)&&e.size<n)return[!1,Ax(n)];if(or(a)&&e.size>a)return[!1,Ex(a)]}return[!0,null]}function or(e){return e!=null}function pI(e){var n=e.files,a=e.accept,r=e.minSize,o=e.maxSize,s=e.multiple,u=e.maxFiles,d=e.validator;return!s&&n.length>1||s&&u>=1&&n.length>u?!1:n.every(function(p){var f=OS(p,a),y=Io(f,1),g=y[0],x=DS(p,r,o),b=Io(x,1),k=b[0],C=d?d(p):null;return g&&k&&!C})}function Zc(e){return typeof e.isPropagationStopped=="function"?e.isPropagationStopped():typeof e.cancelBubble<"u"?e.cancelBubble:!1}function wo(e){return e.dataTransfer?Array.prototype.some.call(e.dataTransfer.types,function(n){return n==="Files"||n==="application/x-moz-file"}):!!e.target&&!!e.target.files}function jx(e){e.preventDefault()}function hI(e){return e.indexOf("MSIE")!==-1||e.indexOf("Trident/")!==-1}function mI(e){return e.indexOf("Edge/")!==-1}function gI(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:window.navigator.userAgent;return hI(e)||mI(e)}function wa(){for(var e=arguments.length,n=new Array(e),a=0;a<e;a++)n[a]=arguments[a];return function(r){for(var o=arguments.length,s=new Array(o>1?o-1:0),u=1;u<o;u++)s[u-1]=arguments[u];return n.some(function(d){return!Zc(r)&&d&&d.apply(void 0,[r].concat(s)),Zc(r)})}}function yI(){return"showOpenFilePicker"in window}function vI(e){if(or(e)){var n=Object.entries(e).filter(function(a){var r=Io(a,2),o=r[0],s=r[1],u=!0;return MS(o)||(console.warn('Skipped "'.concat(o,'" because it is not a valid MIME type. Check https://developer.mozilla.org/en-US/docs/Web/HTTP/Basics_of_HTTP/MIME_types/Common_types for a list of valid MIME types.')),u=!1),(!Array.isArray(s)||!s.every(LS))&&(console.warn('Skipped "'.concat(o,'" because an invalid file extension was provided.')),u=!1),u}).reduce(function(a,r){var o=Io(r,2),s=o[0],u=o[1];return Cx(Cx({},a),{},RS({},s,u))},{});return[{description:"Files",accept:n}]}return e}function xI(e){if(or(e))return Object.entries(e).reduce(function(n,a){var r=Io(a,2),o=r[0],s=r[1];return[].concat(Sx(n),[o],Sx(s))},[]).filter(function(n){return MS(n)||LS(n)}).join(",")}function bI(e){return e instanceof DOMException&&(e.name==="AbortError"||e.code===e.ABORT_ERR)}function wI(e){return e instanceof DOMException&&(e.name==="SecurityError"||e.code===e.SECURITY_ERR)}function MS(e){return e==="audio/*"||e==="video/*"||e==="image/*"||e==="text/*"||e==="application/*"||/\w+\/[-+.\w]+/g.test(e)}function LS(e){return/^.*\.[\w]+$/.test(e)}var SI=["children"],kI=["open"],CI=["refKey","role","onKeyDown","onFocus","onBlur","onClick","onDragEnter","onDragOver","onDragLeave","onDrop"],EI=["refKey","onChange","onClick"];function Tx(e){return TI(e)||jI(e)||zS(e)||AI()}function AI(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
1172
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function jI(e){if(typeof Symbol<"u"&&e[Symbol.iterator]!=null||e["@@iterator"]!=null)return Array.from(e)}function TI(e){if(Array.isArray(e))return oh(e)}function Rp(e,n){return _I(e)||RI(e,n)||zS(e,n)||NI()}function NI(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
1173
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function zS(e,n){if(e){if(typeof e=="string")return oh(e,n);var a=Object.prototype.toString.call(e).slice(8,-1);if(a==="Object"&&e.constructor&&(a=e.constructor.name),a==="Map"||a==="Set")return Array.from(e);if(a==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(a))return oh(e,n)}}function oh(e,n){(n==null||n>e.length)&&(n=e.length);for(var a=0,r=new Array(n);a<n;a++)r[a]=e[a];return r}function RI(e,n){var a=e==null?null:typeof Symbol<"u"&&e[Symbol.iterator]||e["@@iterator"];if(a!=null){var r=[],o=!0,s=!1,u,d;try{for(a=a.call(e);!(o=(u=a.next()).done)&&(r.push(u.value),!(n&&r.length===n));o=!0);}catch(p){s=!0,d=p}finally{try{!o&&a.return!=null&&a.return()}finally{if(s)throw d}}return r}}function _I(e){if(Array.isArray(e))return e}function Nx(e,n){var a=Object.keys(e);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(e);n&&(r=r.filter(function(o){return Object.getOwnPropertyDescriptor(e,o).enumerable})),a.push.apply(a,r)}return a}function kt(e){for(var n=1;n<arguments.length;n++){var a=arguments[n]!=null?arguments[n]:{};n%2?Nx(Object(a),!0).forEach(function(r){sh(e,r,a[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(a)):Nx(Object(a)).forEach(function(r){Object.defineProperty(e,r,Object.getOwnPropertyDescriptor(a,r))})}return e}function sh(e,n,a){return n in e?Object.defineProperty(e,n,{value:a,enumerable:!0,configurable:!0,writable:!0}):e[n]=a,e}function Jc(e,n){if(e==null)return{};var a=OI(e,n),r,o;if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(e);for(o=0;o<s.length;o++)r=s[o],!(n.indexOf(r)>=0)&&Object.prototype.propertyIsEnumerable.call(e,r)&&(a[r]=e[r])}return a}function OI(e,n){if(e==null)return{};var a={},r=Object.keys(e),o,s;for(s=0;s<r.length;s++)o=r[s],!(n.indexOf(o)>=0)&&(a[o]=e[o]);return a}var cm=S.forwardRef(function(e,n){var a=e.children,r=Jc(e,SI),o=PS(r),s=o.open,u=Jc(o,kI);return S.useImperativeHandle(n,function(){return{open:s}},[s]),mn.createElement(S.Fragment,null,a(kt(kt({},u),{},{open:s})))});cm.displayName="Dropzone";var IS={disabled:!1,getFilesFromEvent:$z,maxSize:1/0,minSize:0,multiple:!0,maxFiles:0,preventDropOnDocument:!0,noClick:!1,noKeyboard:!1,noDrag:!1,noDragEventsBubbling:!1,validator:null,useFsAccessApi:!1,autoFocus:!1};cm.defaultProps=IS;cm.propTypes={children:mt.func,accept:mt.objectOf(mt.arrayOf(mt.string)),multiple:mt.bool,preventDropOnDocument:mt.bool,noClick:mt.bool,noKeyboard:mt.bool,noDrag:mt.bool,noDragEventsBubbling:mt.bool,minSize:mt.number,maxSize:mt.number,maxFiles:mt.number,disabled:mt.bool,getFilesFromEvent:mt.func,onFileDialogCancel:mt.func,onFileDialogOpen:mt.func,useFsAccessApi:mt.bool,autoFocus:mt.bool,onDragEnter:mt.func,onDragLeave:mt.func,onDragOver:mt.func,onDrop:mt.func,onDropAccepted:mt.func,onDropRejected:mt.func,onError:mt.func,validator:mt.func};var ch={isFocused:!1,isFileDialogActive:!1,isDragActive:!1,isDragAccept:!1,isDragReject:!1,isDragGlobal:!1,acceptedFiles:[],fileRejections:[]};function PS(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},n=kt(kt({},IS),e),a=n.accept,r=n.disabled,o=n.getFilesFromEvent,s=n.maxSize,u=n.minSize,d=n.multiple,p=n.maxFiles,f=n.onDragEnter,y=n.onDragLeave,g=n.onDragOver,x=n.onDrop,b=n.onDropAccepted,k=n.onDropRejected,C=n.onFileDialogCancel,j=n.onFileDialogOpen,E=n.useFsAccessApi,_=n.autoFocus,R=n.preventDropOnDocument,F=n.noClick,U=n.noKeyboard,D=n.noDrag,W=n.noDragEventsBubbling,Q=n.onError,M=n.validator,T=S.useMemo(function(){return xI(a)},[a]),q=S.useMemo(function(){return vI(a)},[a]),V=S.useMemo(function(){return typeof j=="function"?j:Rx},[j]),ae=S.useMemo(function(){return typeof C=="function"?C:Rx},[C]),P=S.useRef(null),K=S.useRef(null),B=S.useReducer(DI,ch),Z=Rp(B,2),ie=Z[0],G=Z[1],O=ie.isFocused,L=ie.isFileDialogActive,X=S.useRef(typeof window<"u"&&window.isSecureContext&&E&&yI()),N=function(){!X.current&&L&&setTimeout(function(){if(K.current){var H=K.current.files;H.length||(G({type:"closeDialog"}),ae())}},300)};S.useEffect(function(){return window.addEventListener("focus",N,!1),function(){window.removeEventListener("focus",N,!1)}},[K,L,ae,X]);var ue=S.useRef([]),pe=S.useRef([]),he=function(H){P.current&&P.current.contains(H.target)||(H.preventDefault(),ue.current=[])};S.useEffect(function(){return R&&(document.addEventListener("dragover",jx,!1),document.addEventListener("drop",he,!1)),function(){R&&(document.removeEventListener("dragover",jx),document.removeEventListener("drop",he))}},[P,R]),S.useEffect(function(){var fe=function(I){pe.current=[].concat(Tx(pe.current),[I.target]),wo(I)&&G({isDragGlobal:!0,type:"setDragGlobal"})},H=function(I){pe.current=pe.current.filter(function(Te){return Te!==I.target&&Te!==null}),!(pe.current.length>0)&&G({isDragGlobal:!1,type:"setDragGlobal"})},le=function(){pe.current=[],G({isDragGlobal:!1,type:"setDragGlobal"})},me=function(){pe.current=[],G({isDragGlobal:!1,type:"setDragGlobal"})};return document.addEventListener("dragenter",fe,!1),document.addEventListener("dragleave",H,!1),document.addEventListener("dragend",le,!1),document.addEventListener("drop",me,!1),function(){document.removeEventListener("dragenter",fe),document.removeEventListener("dragleave",H),document.removeEventListener("dragend",le),document.removeEventListener("drop",me)}},[P]),S.useEffect(function(){return!r&&_&&P.current&&P.current.focus(),function(){}},[P,_,r]);var Ee=S.useCallback(function(fe){Q?Q(fe):console.error(fe)},[Q]),Ue=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe),ue.current=[].concat(Tx(ue.current),[fe.target]),wo(fe)&&Promise.resolve(o(fe)).then(function(H){if(!(Zc(fe)&&!W)){var le=H.length,me=le>0&&pI({files:H,accept:T,minSize:u,maxSize:s,multiple:d,maxFiles:p,validator:M}),ye=le>0&&!me;G({isDragAccept:me,isDragReject:ye,isDragActive:!0,type:"setDraggedFiles"}),f&&f(fe)}}).catch(function(H){return Ee(H)})},[o,f,Ee,W,T,u,s,d,p,M]),Ne=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe);var H=wo(fe);if(H&&fe.dataTransfer)try{fe.dataTransfer.dropEffect="copy"}catch{}return H&&g&&g(fe),!1},[g,W]),et=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe);var H=ue.current.filter(function(me){return P.current&&P.current.contains(me)}),le=H.indexOf(fe.target);le!==-1&&H.splice(le,1),ue.current=H,!(H.length>0)&&(G({type:"setDraggedFiles",isDragActive:!1,isDragAccept:!1,isDragReject:!1}),wo(fe)&&y&&y(fe))},[P,y,W]),Ot=S.useCallback(function(fe,H){var le=[],me=[];fe.forEach(function(ye){var I=OS(ye,T),Te=Rp(I,2),at=Te[0],Ie=Te[1],Xe=DS(ye,u,s),Ve=Rp(Xe,2),Se=Ve[0],Vt=Ve[1],rt=M?M(ye):null;if(at&&Se&&!rt)le.push(ye);else{var ja=[Ie,Vt];rt&&(ja=ja.concat(rt)),me.push({file:ye,errors:ja.filter(function(ti){return ti})})}}),(!d&&le.length>1||d&&p>=1&&le.length>p)&&(le.forEach(function(ye){me.push({file:ye,errors:[dI]})}),le.splice(0)),G({acceptedFiles:le,fileRejections:me,type:"setFiles"}),x&&x(le,me,H),me.length>0&&k&&k(me,H),le.length>0&&b&&b(le,H)},[G,d,T,u,s,p,x,b,k,M]),xt=S.useCallback(function(fe){fe.preventDefault(),fe.persist(),Mt(fe),ue.current=[],wo(fe)&&Promise.resolve(o(fe)).then(function(H){Zc(fe)&&!W||Ot(H,fe)}).catch(function(H){return Ee(H)}),G({type:"reset"})},[o,Ot,Ee,W]),bt=S.useCallback(function(){if(X.current){G({type:"openDialog"}),V();var fe={multiple:d,types:q};window.showOpenFilePicker(fe).then(function(H){return o(H)}).then(function(H){Ot(H,null),G({type:"closeDialog"})}).catch(function(H){bI(H)?(ae(H),G({type:"closeDialog"})):wI(H)?(X.current=!1,K.current?(K.current.value=null,K.current.click()):Ee(new Error("Cannot open the file picker because the https://developer.mozilla.org/en-US/docs/Web/API/File_System_Access_API is not supported and no <input> was provided."))):Ee(H)});return}K.current&&(G({type:"openDialog"}),V(),K.current.value=null,K.current.click())},[G,V,ae,E,Ot,Ee,q,d]),yt=S.useCallback(function(fe){!P.current||!P.current.isEqualNode(fe.target)||(fe.key===" "||fe.key==="Enter"||fe.keyCode===32||fe.keyCode===13)&&(fe.preventDefault(),bt())},[P,bt]),Zt=S.useCallback(function(){G({type:"focus"})},[]),Pe=S.useCallback(function(){G({type:"blur"})},[]),pt=S.useCallback(function(){F||(gI()?setTimeout(bt,0):bt())},[F,bt]),Dt=function(H){return r?null:H},Nt=function(H){return U?null:Dt(H)},ge=function(H){return D?null:Dt(H)},Mt=function(H){W&&H.stopPropagation()},Fn=S.useMemo(function(){return function(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=fe.refKey,le=H===void 0?"ref":H,me=fe.role,ye=fe.onKeyDown,I=fe.onFocus,Te=fe.onBlur,at=fe.onClick,Ie=fe.onDragEnter,Xe=fe.onDragOver,Ve=fe.onDragLeave,Se=fe.onDrop,Vt=Jc(fe,CI);return kt(kt(sh({onKeyDown:Nt(wa(ye,yt)),onFocus:Nt(wa(I,Zt)),onBlur:Nt(wa(Te,Pe)),onClick:Dt(wa(at,pt)),onDragEnter:ge(wa(Ie,Ue)),onDragOver:ge(wa(Xe,Ne)),onDragLeave:ge(wa(Ve,et)),onDrop:ge(wa(Se,xt)),role:typeof me=="string"&&me!==""?me:"presentation"},le,P),!r&&!U?{tabIndex:0}:{}),Vt)}},[P,yt,Zt,Pe,pt,Ue,Ne,et,xt,U,D,r]),yn=S.useCallback(function(fe){fe.stopPropagation()},[]),it=S.useMemo(function(){return function(){var fe=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},H=fe.refKey,le=H===void 0?"ref":H,me=fe.onChange,ye=fe.onClick,I=Jc(fe,EI),Te=sh({accept:T,multiple:d,type:"file",style:{border:0,clip:"rect(0, 0, 0, 0)",clipPath:"inset(50%)",height:"1px",margin:"0 -1px -1px 0",overflow:"hidden",padding:0,position:"absolute",width:"1px",whiteSpace:"nowrap"},onChange:Dt(wa(me,xt)),onClick:Dt(wa(ye,yn)),tabIndex:-1},le,K);return kt(kt({},Te),I)}},[K,a,d,xt,r]);return kt(kt({},ie),{},{isFocused:O&&!r,getRootProps:Fn,getInputProps:it,rootRef:P,inputRef:K,open:Dt(bt)})}function DI(e,n){switch(n.type){case"focus":return kt(kt({},e),{},{isFocused:!0});case"blur":return kt(kt({},e),{},{isFocused:!1});case"openDialog":return kt(kt({},ch),{},{isFileDialogActive:!0});case"closeDialog":return kt(kt({},e),{},{isFileDialogActive:!1});case"setDraggedFiles":return kt(kt({},e),{},{isDragActive:n.isDragActive,isDragAccept:n.isDragAccept,isDragReject:n.isDragReject});case"setFiles":return kt(kt({},e),{},{acceptedFiles:n.acceptedFiles,fileRejections:n.fileRejections,isDragReject:!1});case"setDragGlobal":return kt(kt({},e),{},{isDragGlobal:n.isDragGlobal});case"reset":return kt({},ch);default:return e}}function Rx(){}function _x({value:e,onChange:n,options:a,placeholder:r="Select…",disabled:o=!1,className:s,ariaLabel:u,prefixIcon:d}){const[p,f]=S.useState(!1),[y,g]=S.useState(null),[x,b]=S.useState(()=>{const M=a.findIndex(T=>T.value===e);return M>=0?M:0}),k=S.useRef(null),C=S.useRef(null),j=S.useRef(null),E=a.find(M=>M.value===e),_=(E==null?void 0:E.label)??r,R=S.useCallback(()=>{var M;f(!1),(M=C.current)==null||M.focus()},[]),F=S.useCallback(()=>{const M=C.current;if(!M)return;const T=M.getBoundingClientRect(),q=Math.min(240,a.length*36+16),V=window.innerHeight-T.bottom,ae=T.top,P=V<q+16&&ae>V?"above":"below";g({left:T.left,top:P==="below"?T.bottom+4:T.top-4,width:T.width,placement:P})},[a.length]);S.useLayoutEffect(()=>{p&&F()},[p,F]),S.useEffect(()=>{if(!p)return;const M=()=>F(),T=()=>F(),q=ae=>{var K,B;const P=ae.target;(K=k.current)!=null&&K.contains(P)||(B=j.current)!=null&&B.contains(P)||f(!1)},V=ae=>{ae.key==="Escape"&&(ae.preventDefault(),R())};return window.addEventListener("scroll",M,!0),window.addEventListener("resize",T),document.addEventListener("mousedown",q),document.addEventListener("keydown",V),()=>{window.removeEventListener("scroll",M,!0),window.removeEventListener("resize",T),document.removeEventListener("mousedown",q),document.removeEventListener("keydown",V)}},[p,R,F]),S.useEffect(()=>{if(p){const M=a.findIndex(T=>T.value===e);b(M>=0?M:0),requestAnimationFrame(()=>{var T;return(T=j.current)==null?void 0:T.focus()})}},[p,e,a]),S.useEffect(()=>{o&&p&&f(!1)},[o,p]);const U=M=>{o||(M.key==="ArrowDown"||M.key==="Enter"||M.key===" ")&&(M.preventDefault(),f(!0))},D=M=>{var T;if(M.key==="ArrowDown")M.preventDefault(),b(q=>{var V;for(let ae=1;ae<=a.length;ae++){const P=(q+ae)%a.length;if(!((V=a[P])!=null&&V.disabled))return P}return q});else if(M.key==="ArrowUp")M.preventDefault(),b(q=>{var V;for(let ae=1;ae<=a.length;ae++){const P=(q-ae+a.length)%a.length;if(!((V=a[P])!=null&&V.disabled))return P}return q});else if(M.key==="Enter"){M.preventDefault();const q=a[x];q&&!q.disabled&&(n(q.value),R())}else if(M.key==="Home"){M.preventDefault();const q=a.findIndex(V=>!V.disabled);q>=0&&b(q)}else if(M.key==="End"){M.preventDefault();let q=-1;for(let V=a.length-1;V>=0;V--)if(!((T=a[V])!=null&&T.disabled)){q=V;break}q>=0&&b(q)}},W=["v10-select",s,o?"disabled":"",p?"open":""].filter(Boolean).join(" "),Q=y?y.placement==="below"?{position:"fixed",left:y.left,top:y.top,width:y.width}:{position:"fixed",left:y.left,top:y.top,width:y.width,transform:"translateY(-100%)"}:void 0;return m.jsxs("div",{ref:k,className:W,children:[m.jsxs("button",{ref:C,type:"button",className:"v10-select-trigger",onClick:()=>!o&&f(M=>!M),onKeyDown:U,disabled:o,"aria-haspopup":"listbox","aria-expanded":p,"aria-label":u,children:[d&&m.jsx("span",{className:"v10-select-prefix","aria-hidden":"true",children:d}),m.jsx("span",{className:`v10-select-value ${E?"":"placeholder"}`,children:_}),m.jsx(sN,{className:"v10-select-caret",size:12,"aria-hidden":"true"})]}),p&&y&&UE.createPortal(m.jsxs("ul",{ref:j,className:`v10-select-menu v10-select-menu-${y.placement}`,role:"listbox",tabIndex:-1,onKeyDown:D,style:Q,children:[a.length===0&&m.jsx("li",{className:"v10-select-option empty","aria-disabled":"true",children:"No options"}),a.map((M,T)=>m.jsx("li",{role:"option","aria-selected":M.value===e,title:M.label,className:["v10-select-option",M.value===e?"selected":"",T===x?"highlighted":"",M.disabled?"disabled":""].filter(Boolean).join(" "),onMouseEnter:()=>b(T),onMouseDown:q=>q.preventDefault(),onClick:()=>{o||M.disabled||(n(M.value),R())},children:M.label},M.value))]}),document.body)]})}function Ox(e){return e.bridgeOnline?"connected":e.status==="connecting"?"known":e.status==="degraded"?"degraded":"offline"}function MI(e,n){return n?"Session history":e.chatReady?`${e.name} connected`:e.status==="connecting"?`${e.name} is connecting…`:e.status==="degraded"?`${e.name} degraded`:`${e.name} is unavailable`}function LI(e){const[n,a]=S.useState(!1),[r,o]=S.useState(!1),s=S.useRef(null),u=S.useRef(null),d=S.useRef(null);S.useLayoutEffect(()=>{if(!n)return;const g=d.current,x=u.current;if(!g||!x)return;const k=(x.closest(".v10-panel-right")||document.body).getBoundingClientRect();x.getBoundingClientRect().left+g.offsetWidth>k.right-4?o(!0):o(!1)},[n]);const p=S.useCallback(()=>{var g;a(!1),(g=u.current)==null||g.focus()},[]);S.useEffect(()=>{if(!n)return;const g=b=>{var k;(k=s.current)!=null&&k.contains(b.target)||a(!1)},x=b=>{b.key==="Escape"&&(b.preventDefault(),p())};return document.addEventListener("mousedown",g),document.addEventListener("keydown",x),()=>{document.removeEventListener("mousedown",g),document.removeEventListener("keydown",x)}},[n,p]),S.useEffect(()=>{var x;if(!n)return;const g=(x=d.current)==null?void 0:x.querySelector(".v10-agent-tab-menu-item:not(:disabled)");g==null||g.focus()},[n]);const f=g=>{(g.key==="ArrowDown"||g.key==="Enter"||g.key===" ")&&(g.preventDefault(),a(!0))},y=g=>{var j,E;if(g.key==="Tab"){a(!1);return}if(g.key!=="ArrowDown"&&g.key!=="ArrowUp")return;g.preventDefault();const x=Array.from(((j=d.current)==null?void 0:j.querySelectorAll(".v10-agent-tab-menu-item:not(:disabled)"))??[]);if(x.length===0)return;const b=x.findIndex(_=>_===document.activeElement),k=g.key==="ArrowDown"?1:-1,C=b===-1?k===1?0:x.length-1:(b+k+x.length)%x.length;(E=x[C])==null||E.focus()};return m.jsxs("div",{className:"v10-agent-tab-menu",ref:s,children:[m.jsx("button",{ref:u,type:"button",className:"v10-agent-tab-menu-trigger","aria-label":`More actions for ${e.integration.name}`,"aria-haspopup":"menu","aria-expanded":n,title:`More actions for ${e.integration.name}`,onClick:g=>{g.stopPropagation(),a(x=>!x)},onKeyDown:f,children:m.jsx(pN,{"aria-hidden":"true",size:14})}),n&&m.jsxs("div",{ref:d,className:`v10-agent-tab-menu-popover${r?" align-right":""}`,role:"menu",onKeyDown:y,children:[m.jsxs("div",{className:"v10-agent-tab-menu-status","aria-hidden":"true",children:[m.jsx("span",{className:`v10-agents-stat-dot ${e.statusDotClass}`}),m.jsx("span",{children:e.statusLabel})]}),m.jsx("button",{type:"button",role:"menuitem",className:"v10-agent-tab-menu-item",disabled:e.refreshBusy,onClick:()=>{p(),e.onRefresh()},children:e.refreshBusy?"Refreshing…":"Refresh"}),e.canClearSession&&m.jsx("button",{type:"button",role:"menuitem",className:"v10-agent-tab-menu-item",disabled:e.clearBusy,onClick:()=>{var g;p(),(g=e.onClearSession)==null||g.call(e)},children:e.clearBusy?"Clearing…":"Clear session"}),e.canDisconnect&&m.jsx("button",{type:"button",role:"menuitem",className:"v10-agent-tab-menu-item danger",onClick:()=>{p(),e.onDisconnect()},children:"Disconnect"})]})]})}function um(e,n){return(n==null?void 0:n.trim())||`integration:${e}`}function Ro(e){const n=e.sessionId??e.defaultSessionId??rr(e.integrationId);return{integrationId:e.integrationId,sessionId:n,stateKey:um(e.integrationId,n)}}function US(e,n){for(const a of n)if(e===a.id||e.startsWith(`${a.id}:`))return{id:a.id,name:a.name};return null}function BS(e){var a;if(e.selectedSessionId==null)return!1;const n=e.integrations.find(r=>r.id===e.integrationId);return!(((a=US(e.selectedSessionId,e.integrations))==null?void 0:a.id)!==e.integrationId||n!=null&&n.defaultSessionId&&e.selectedSessionId!==n.defaultSessionId&&II(e.integrationId,e.selectedSessionId))}function zI(e){return BS(e)}function II(e,n){return n===`${e}:dkg-ui`||n.startsWith(`${e}:dkg-ui:profile-`)||n.startsWith(`${e}:dkg-ui:home-`)||n.startsWith(`${e}:dkg-ui:transport-`)}function Dx(e,n){const a=e.flatMap(r=>{var d;const o=US(r.session,n);if(!o)return[];const s=r.messages.find(p=>p.author==="user"),u=r.messages[r.messages.length-1];return[{sessionId:r.session,integrationId:o.id,integrationName:o.name,preview:((d=s==null?void 0:s.text)==null?void 0:d.slice(0,60))||r.session,messageCount:r.messages.length,lastTs:u==null?void 0:u.ts}]});return a.sort((r,o)=>{const s=Date.parse(r.lastTs??""),u=Date.parse(o.lastTs??"");return Number.isFinite(s)&&Number.isFinite(u)?u-s:String(o.lastTs??"").localeCompare(String(r.lastTs??""))}),a}function HS(e,n,a,r,o){var u;const s=Ro({integrationId:e,sessionId:n,defaultSessionId:o});return(((u=a[s.stateKey])==null?void 0:u.length)??0)>0||(s.sessionId?r.some(d=>d.sessionId===s.sessionId):!1)}function $S(e,n,a){const r=um(e,null);return Object.entries(n).some(([o,s])=>s.length>0&&(o===r||o.startsWith(`${e}:`)))||a.some(o=>o.integrationId===e)}function PI(e){const n=[...e.integrations].sort(pu),a=n.filter(d=>d.persistentChat),r=n.find(d=>d.id===e.selectedIntegrationId)??a[0]??null,o=r?Ro({integrationId:r.id,sessionId:e.selectedSessionId,defaultSessionId:r.defaultSessionId}):null,s=r?HS(r.id,e.selectedSessionId,e.localMessagesByConversation,e.sessions,r.defaultSessionId):!1,u=r?$S(r.id,e.localMessagesByConversation,e.sessions):!1;return{sortedIntegrations:n,connectedIntegrations:a,selectedIntegration:r,selectedConversation:o,selectedHasConversation:s,selectedIntegrationHasAnyConversation:u}}function UI(e){const n=e.selectedIntegration,a=!!(n&&!n.persistentChat&&e.selectedHasConversation),r=!!(n&&!n.persistentChat&&e.selectedIntegrationHasAnyConversation),o=r?[n,...e.connectedAgents.filter(d=>d.id!==n.id)]:e.connectedAgents,s=e.selectedIntegrationId===sr||!n&&e.connectedAgents.length===0||!!(n&&!n.persistentChat&&!e.selectedIntegrationHasAnyConversation),u=!e.localHistoryLoaded&&e.localMessagesCount===0&&!!(n!=null&&n.persistentChat||e.selectedHasConversation);return{showingSessionHistory:a,showingStoredSessions:r,visibleAgentTabs:o,showAddFlow:s,shouldShowConversationLoader:u}}function pu(e,n){const a=e.id==="openclaw"?0:1,r=n.id==="openclaw"?0:1;return a!==r?a-r:e.persistentChat!==n.persistentChat?e.persistentChat?-1:1:e.name.localeCompare(n.name)}function Nc(e,n){return[...e.filter(a=>a.id!==n.id),n].sort(pu)}function BI(e,n){const a=e.find(u=>u.id===n);if(!a)return e;const r=a.connectSupported,o=r?"available":"coming_soon",s=r?"Ready to connect":"Coming next";return Nc(e,{...a,configured:!1,detected:!1,persistentChat:!1,chatReady:!1,bridgeOnline:!1,bridgeStatusLabel:s,status:o,statusLabel:s,detail:r?`${a.name} is no longer attached to this node. Reconnect from the + tab when you want live chat again.`:a.detail,error:void 0,target:void 0})}function HI(e){const n=e.selectedItem;return e.selectedIntegrationId===sr||n!=null&&(n.persistentChat||HS(e.selectedIntegrationId,e.selectedSessionId,e.localMessagesByConversation,e.sessionSummaries,n.defaultSessionId)||$S(e.selectedIntegrationId,e.localMessagesByConversation,e.sessionSummaries))}const $I={openclaw:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAEy0lEQVR42u2ba4hVVRTHf1OmM9GUjzITRmEyX4nglxwjzZKMIsFHGEJJJlLfJGTGBD8kRkRCVmrRA8ueSqmRqJFOpqb2QafR0sovvbTygaPQpONM3s6W/43D7Z65Zx/OuWcfuAsWM/fOXnut/9pr77322nugQhWqUIWiUzVwC1CXgu466a5OC/wdwA9ADugE9gCPAD0S1NlDOvZIp9H9I9CQhgOmA98BrwIfAG0yaDswIgF9I9S30XFGOo3uVs8h96QVBVf6fh8IvCADTwFTfH8bANztOWk+sBLYAHyhkfwKaAbWAyvUZhJwk09+ivrMScdA39+qXFsX7gV+Bi4Ay4GtPuNt+LQX2p8BL6ov0+fkLCyMozWiuZi5WX07S4OBNzVauYT4gnQMdg38w8DxBIEX8nHtBqlTL+ClMgIv5JdlQyp0LbAxRfB5/kS2lJWu0eqec4S3yqaykMnG1joEPs9rE85C/6MlDoLP89NJg5/sy8HDrNQ7gIMRwVwCWtTHiZAyF5NMi3sD31usztdLrqfODW0W4H8H7vPp7g+sCSlrbLwuzdBvVn5u5uMqL2r2Ard6ETEvpPw/3iHrQekcBuwE3tEAHAjZx5IksrwzIZU/7jM+/90qjcq5EPLHgFr1sdj3/RhgYUgbjK2D4nTA8xbh+5ivWPKGRu12L2HqE3Ia/OLpu1p9jAK+1kmxxsIBhp+LC3w/zcmwijcUyF+hn7O0sJWS79TRudhxd6flOtIvDgfMtVy9zRxuBK7y9WEi4FeLPg4XnPxMND0bYSeZE4cDXrPY+vxsQv8tYDPwdwT5c0q1V3u7yKEI8p2qGFnTDcBQb+Wt18pbo89TlWgccTgROiIbp8rmamGo1+f+3QE3CcQWJR3m3N3uhf9vwDYtPg+oElujUXEN/GrZVidbm7yp97kwtAvTSZ0b/pcszVYWVUrJX5rfPR2LhMOyqVE2hskYZ/uLmactlHWoYPmMQw5YKpsuWtYcLxdXn4igcGxEuaTY2HJbRDnrUlaHsqyljkXAIMsIyGlrvjx/bIRaIiQlSfOXsqnFUu5blCzYJhc3ezvDeYcccF422WJ5FF0whk1U9snTaxzcBt+WbftCtjeYh+Rz7U0hBMxBZriurbocdECXbBse8tD1qf+cMa7EAmISifuVSf3kcCZobLtRtraXyAPGFSZDTd10epdSyr0Og/dP096yOWiwGoPSYXNk3a3t4RttL30UVvszAD7P+2VzX2FoUZ1hF/BQmANRre/q+ymLapBL3Cbb89f4tVHvAFozCD7PrXHcFSzKsAMWxlEQGVpiRXWV25XjxELrM+iAj+OsCk9UrS8r4I2td8bpgCpVi7LigC1JPJ4aq6Ow6+A7VBtIhFZmwAErkrwdNhcNRx0GfzSuy5DuaJKjU6FDtpWFmhx0QFM53whV6cbIFfCvp/Fk1jxPW+cA+HVpPpUzNzHvpgj+PdmQKpnT1rIUwC8r16swm+eyf5QB+J/S5STVKyy7Eip6vq/yt/M0HvgQOBsD8LNa6MaTQZoT8P7vSWAB8Iq200X6fKmbN0eZpGkBo1rsn5waAtpOy7IDZgSAmlCk7YSAtjMqDsgwzQwANTGg6lSs7cwsO8DM64+K8MgibUcGtG2gQsnRv1P7PFimYrmBAAAAAElFTkSuQmCC",hermes:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAANwElEQVR42rVbCZAcVRn+Z3bume6ZnnN3dg0EEzmMiWCJpVUmIjEeWJZiqRRBEw8owERRU4pXieWBEsAyZUlQMXhfSCkBQUuU9RY8IhQaECMEEjAEYyRkQULWflPfW7/8eT3dvYtb1cl0v9fv/e//X//H9/9PRGRURMZEpCIiIyLSFpGeiORFpIS2Jto8EemLSA33LbxfFJEC3mujrYq+Pu6bGKuEsbsi0hGRHOY2bQ30bRBNOfTrRtDkK5raoKkAukZB5wj69LEOcx8IBusTAzp4yU7Wx2RZvDiOgbIYeIwYwJNV0ddH3ybGsgzoYS7Tt4y2Ovo2FE1d9M8RTQH6+pinGsGAMdCUBd3jWIelaTBJBZO20KmKxgBtNbT5ILaO9hraA0ffOvVtYVI7T4A57DwNtPk0j+3bpL4B9fUc8zSJfk1TE30q1NeMMeDaSIyEKuCcllCZJGS3aFlJqJ5CQkl2WBttVUVToOi3NPEOaxBNdocNBuxgwCIY0cZAFbQFaPMwqIf7AH0rmKSN94tYRBfSLGDyDvqWsLgmftfQVld9a0RTS9HUQF8f83DfDugpJ6B/IOlRMCCPRXQxeAntAb4/DxKp4b6J9hIG7IHQHMYbA4G27yiIKoCwNuasoK2Bvg3cV4imDt4ro83S5BP9OczfAz2W/ibaaqDJw/2AAfkIArsOAusRBHZwcV8mcEwR2FUEagYzgczgLt7POxgcOBjciWBwnZg2M3iACewWbWOyIjryFq2rz6aF/tx32BZtp9iivJ2TfmKWJvvZRNFf02bQ2lzrBxQdfoBWUlahsZKKM4N2HvMsQz6ET0p2DIt2+QFxZrBHNEWZQav4B/9ok9bE7ypeZtPTVCatGWHSPGU6PZKsmWueiDxdRI4TkWNF5Kloz2CRwRAz2yTz56cws57DzA44YaXZB9dykCabEWtyMnhxHISOgOM9/C6ibcBdkq55tlhEVoVjbxSRX4vIv0VkWkT2icgOEflVKMHPhP+vwNhl2mF5/O6QGZzAYjJY9Djm1zSV0NZAX2uazfgDrvi46iSpOt3bNl/dR/X1aOuuDNs+FT67RETeKiInYVsa4k8VkWvABH39UUTejjGKKWjyU/YdSN1yI0OucA6c72N3ZPDyBLZhBt9bX0mohuttInKnY2FTIRMmReQ0vGf+3kC7QV9mVywnbc87LIPnE9gRlv4x0GPpb6Othr72UzPrmiG4Tt9dDduljt8e3VcxaQPPa/Q7D6luiViMvjbSQl4qIv+K6LdXRF6PxTeIpgC0MP1MU0PRb/sy/Ye5wi4dUIkIVkoUVR2B7/eJhIu31w8gNcEio95/VETeTIGMtjLWFY7SAZGusLXhNXwGUVbAatw2iCjTjjkmlOBvUy7cLmpXyOjP0g7aOKT/dSKyEAtoYGF+Cvo9Rf/ACgzDA2w8HYUHmPsTReQOReiBIYv4h4jcH37320TkZSJyPBTeKuy8Ptq13vge9MoFMKENhQdE+QHD8ICBpbKRlvUEy3jWwYsFDN5VwUobjNsMSVpid4rIfSThg2oxRuLvFZHV2ParwMBPgzAz14WhxXhQRK7CWJeh79PwfDW2ck95gl3yBNvknVaI/jz+71lXuEAMYL/bBiuWAT0awDobhpD3iMgPsdDHQi5fDM1tFv8dfLdmkb8RkZtCBpwLzp+P7b4VfS8XkaVY0KJwsV8XkVNE5EuhhXgnpH8ZmHgzuc0+0dQjAXIAVUFbw8WAniOwcX0COfoEzCRHwpRNYGBj59eLyGtxvxzm7cMiskRE1sIRssStc3wel0LShpZfQtrb0fZIyPC78fsgrIaoTyCXABLjYKsptFWsErGxdxmEtEnheASSvE9ErghN1DtE5IVYqJHwnyGhu5Vtn4K3twXt9zgY8AcQlsH4wxTolRRtWvqtC90ipKuNZ0y/h/vGbMxgBjvkNmx5I42HhxCaxiz+M5zvI2Dk9WDatEOPWGV6HAVmgTLNvaSIUDXCEbL4W1U5HYZBy1IsbAe2b5K+ByhGuAUMngaDXZZlJekopr9KjpCmv6qcpkNc4azDFR5XrrB5cU0KqW5P6SPcA6VoJHwXGL0vwku8FBKekyvsp7yMYvloigX9B9p7KkHfgyR1vTO2R8QJVRXQ+erei1nPIeHwuEMHZFU4LPhOoxZxr0Mn/FREfj4LT5Gvvyt/YxpWYh5omnU43HSAHAHphkAFQRXY5ChCH4E5NJ7e37B9jT9wpoj8Dtv6r7AEO1Iw4EFcWsEupbC8GkG/BnR8yg8cAollyY7mFCSWJTPybIc0DsDLW0tJltfAz/+JiPxIRN5PQGsfKNDahAx4DLtAPz+bFsz052MgsZnMUIlsYocw/pYCIBlUNO1fIYlPw3F5tYicTjsqA/9gJzHJMOJVGFfg0OhF3Qo7f5PS/tsc1mADRag67+ACRYsaFNWweEnB4jkHLO7BE7wBfvyfoORug2u7jCRiwuQ3Ybt+F4y7CN9mBszQDDDO0u8BnOxXccYe1fdnlFAdpcwQw+LlCFh84Ad0yS/OE26vEyN5LHyUpNuGb38q0B8TGO0ml7cLs2Pc46/B3z+Nkh1GAq9IoQcexi7gZ7vhEJUV/Tbv0IVw85hvlELvQWLEQs5VLJpTY4zbFxRuXyDEpQTp347vvEC4vcXnngKNnaN4wIx/VgoGGDP5F4dn+EqKXWxqjOlvEv09on/AgJz6BIoqOcr5+7rK31vn6UhI4luUlQlUvF4mJdUjPHBDSnO43eFZnk8KTydHc5ib6w/qhIHMKD2ruat41kyQ8rbZnmPgx38QW/4EQl0Yt9eITR6QWBoG7MVc/GwzKT6mvxlBv0/0H2YGu8oV1unrCQpAbCS5BP77i4HyWLvLuH2THJUc6YetKRnwOMwtP7sfNLtc4TFKqbMrbJ2/maDBhfF7Ch32FbpqCw5egu/yFIAfPukBxukbymlZFBNJDnOKtG5YQSYuDf2RmaGxCFdYZ4bM31tAyDp4gb8Ix/m4iCwg3L6iJGT+Tp6lW7zfoQjXg67UrnBDYfxpOVgExjcN2OuM0PZvwk44j96tq3mKAFN0JPjQLGKEaTC94shaRdHvaVeYy11cmaGsgsSsDvCRD7BbcQ22Y5USkRmF21tn6vNqMRfCnKZhwHUInffC1AbkCueT6IA0VsBmVxeRD2AWc63y4loOK6Bx+5yyAFOAyG9JyQBjeq/G79cRAmStQDnOCuQIEovzA4pwXE4mZ6nokNo6jJGlChGrL9qEPnMKbRLKdFdKBnwj1Anvxu9PKmvm8gMOg8RcnmDH4Qla13ES+LwFJBdj+2lnZQlBUB5qAE4kBs9TIMduoD4PpGTAlaSENyH7vIwWHusJRsUC7Etbr24cEloBaZpn5wwxVZOIErdicfvhKpu/+QoPMLvhBcAN0jDgYwSxm+DsmSFzv0hFlbGxQFw0mCd4+Xho6S0IY5dTCny/AyOI8udXgQm30vM34tn6lAxYCcDFhuSjwCCPpoKqodFgHB5QonTz82HqXN7ZNxPiftNAhM5TDHsAKNHBFIvfA8bZ/MON+LTuBWjjx+AB1TSIkMDn3wx8z8Li9yEkvp6QmycS5gAuSrlgVxXJzXR/OT5PI4ijsJ5YRIgxwWoMJmgY8mUR+bGIfAAWYQUU0TQ5QwcSuLIvgg7ZOAcG6HnOAS07KTvE+Q2fMMGqyxXmYEWjwjYIasPrOgDQc4+SyLeHEDwFp2kpdpQNWz80C/Onr4dgDSwM7ydwhSs6L1Afgp/XaSc0kbG9HVt+JzTwakduX6O4a6i2x5bQmb9PUL+7yBxOYXG7AL1NRiRJroBg9kFZV2LW47uKpLJDXGEukqqA6HmY1Ciil2MHRAUrXB+wgOIJgwx/FYvbAMj9KliXM6HNj4X3eRLc5UuQhOV44EYw+FxKgycuknLl1oIEuTXDpHepxd4JizBMuRk7/YyQmC8A4roAWns+lOkdWPAIudBlbGUjnM9BFzHavAPp+JwjN+jKbwRcJMWlrMWURVIZwOEXwyE5CvZ4WKrscWzza7FdF8Jz3IRFHY0dZs8LcBmeFdLVSKTuhwu8kGqOc2mKpNqEkZcS1gd4Khc/Iv/7Oz0mdN0GTb0Y0jgC1WFnw56fQBUqVQdNVrqL8dlcQ7uDaSonqA8IbJHU6JBiaV0hwucFuDbfMOG5sAyPQnlN4Zu/AZ+GSY19n7bhfEhyMUpizgITG1T6HnVoqgK4/QxiVk6BrvoMg64Qac2lRqgHIgpUWt/HYp4XOkzPQtC0AIpnARypcSrDN/8/B+NN0Lg18tW7JN0Oubc18lR1jVCB8EquEXIWSaWtEssPqciyIESTymmrNG6WzgCUaHsHVHano7UubXGmqeYQiqapparEuEjKnmGYU52gPjeoj80lPTdYprxDNuG5wSBBnWAxSZ1gKwKxSVIpqlEkV1WmH4M4ldWxvJLKO5QVxl8ldKcUUb0aVynKNM3ZDLrOC0Sd6Miqg5lx6WuXGXSdF4grknKZwRlXuBaB2rqqxV3V1royuxaBxHpqnpoDtfUcqHNSmmZLv7NIaizleYE8FT20SfkNywz1Ep5IyRJqNfL/OC/gqcyN/yScGBn2bt3xrp+iL4/bmOOJEc+VGSrO8cyQDT0Dh4RcOqAfk3vsz+LMUC5NZihQgMiwU2OuE1p8aqxFuQR9aowPZ8edBNMHrgOV6Y07NaZPsgURp8aC/wJs6rIsXDWrggAAAABJRU5ErkJggg==","prime-agent":"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAEAAAABACAYAAACqaXHeAAAEUElEQVR42u2Za4hWRRjHf7uuklZ0pSuRG26WUdHVIilqsduHXa39UJBCJWWlkNLNCrthQR+iD4ZWFLFZEhWRKJYVka6Q+qnY7trFG9GuZRetzextBv4Lw2HOeed99z3nLNv8YfZlmTkzzzPnufyf50BERERERERERERERETEiMcRwAH/J4UPAqYAC4E1wE7gY+C4kaz0aOBSYDHwDVDxjPaRqPhhwGxgU4rSg+N5YOxIUnwMcCvwdRXF7XgMaG7UwQcD5wHnAseUpPxkY+4fBSj+BzCrkQdfDnwJ7NfoAz4E5ijSFuHn9wK/Byj/I3BFo33tu4wDrSlek6Pyk4D3AhS3Y6ustKE426SVf6scvA+4rcHnNgG3y9pClN8BnJPHGzjVmN+fAQLYS5jeoDNbgTcS+9uLeCfl7F3K/7lgArA38C1sA44d4nnX6226+/bIFR5NefMX5RmArg5wAXc8Wec59uK6Pfs9Z3L58cALnrkf8jJ7F695Dv7EpJq7UnJxfx3Us9PD4v4B7tP8ZZ5zdio+5YoLgQHP4VdpfmWKFcwN3P9IYInHwqzLzXTWnZJIgft1abnjrZS3byusccDmlAtYF8DAbK7u9Tz7C9ChNW3mz8PiIO6aZ4pQ/nzgb4+AMzR/ckZw3Kv5NF7xtLJG8rmfgalOJtjlzFlL3GAC7c1ASxEX4As6PeLiyA2yguEdnj3bZUGVlDc/NbH+YrlChy50VFGc+2gPARmQQIO4u8oF9Do0+XBlh4GM9XMcAjTPMLpVRulXlRlelys0F3UB13kE7E6seSkgJX5qeMSyjFhhx1+KNWOcam9bCscYV9QFLPf49GnO/KiAOjx0LJN5jzfnTjRF1iVKpe6aX03Ov7HIsnNDQoAVntL4+wYovxv4AvhANPdtFT5r9f/L4gKTiq67Z4qY7JGgt3gKlcnqt9Wj+JtKgyeojzda+05JWFqpaNHtV1KaC03K97Uq/xlwiGe/+WJ//XkWNrXA0s8tEnq5Z/6COpS3fYUzE/vYDLHUQ7YOLFP5WY75D5aiyTbYWTUqv0qVpWtB01PYYEX7l4K5KdXfnYl1zXIRG7Ce8tDVipjk+0bJrsRzV5o6490qqbGtDOWnZZCVrxSw0uDygs9NYFtkgt3pzrz1+xt0YdWsZXWRrG8QJ6rEzBJsXsbzC9Q5WqRiaazM+CZT6z/rxJNqY08RNb4P3QHC9Sv9pbXNJ6hGf8XEke01NlLSXK0QnCG/CxGwTxnCB+vbvw2BGD1RVuB7vEZBfxJtdXGoIVDf1qm4zf8PlKW8jcrr6xD6wcQ+HXUqvzXn7wpBX116axB4QGVqa2Kf++ukxOOHA+tbHWimK9Un9GFhDYpvSfT8SkdXhrC2LfViAD9vD1DcptlHgKMYZmjyBMI+fYhorSGWPKTWVrKXsNH83qP+/rBGpwqfxUOgoicB16p52amWdgsREREREREREREREREREaXhPxXZ1AH/I5YbAAAAAElFTkSuQmCC"};function qI(e){return $I[e.trim().toLowerCase()]}function Mx({integrationId:e}){const n=qI(e);return n?m.jsx("span",{className:"v10-local-agent-logo","aria-hidden":"true","data-agent-logo":e,style:{maskImage:`url("${n}")`,WebkitMaskImage:`url("${n}")`}}):null}function FI(e){var me,ye;const{integrations:n,selectedIntegrationId:a,selectedIntegration:r,selectedSessionId:o,selectedHasConversation:s,selectedIntegrationHasAnyConversation:u,onSelectIntegration:d,onConnectIntegration:p,onDisconnectIntegration:f,onRefreshIntegration:y,onClearIntegrationSession:g,connectBusyId:x,refreshBusyId:b,clearBusyId:k,connectNotice:C,connectError:j,localMessages:E,localHistoryLoaded:_,localChatEndRef:R,localInput:F,onLocalInputChange:U,onSendLocalMessage:D,onStopLocalStream:W,localSending:Q,activeProjectId:M,availableProjects:T,projectsLoading:q,onSelectProject:V,attachments:ae,onAddAttachments:P,onRemoveAttachment:K}=e,B=e.selectableProjects??T,Z=ae,ie=Z.some(SS),G=[...new Set(Z.map(I=>I.contextGraphId))],O=Z.some(I=>I.status==="uploading"),X=E.some(I=>I.streaming)?"streaming":O?"uploading":"idle",N=Z.length>0&&Z.some(I=>I.contextGraphId!==M),ue=S.useRef(null),pe=S.useRef(null),[he,Ee]=S.useState(null),Ue=S.useCallback(I=>{pe.current=I,Ee(I)},[]),[Ne,et]=S.useState(!1),Ot=S.useCallback(()=>{const I=pe.current;if(!I)return;const Te=I.scrollHeight-I.scrollTop-I.clientHeight;et(Te>40)},[]),xt=S.useCallback(()=>{const I=pe.current;I&&I.scrollTo({top:I.scrollHeight,behavior:"smooth"})},[]);S.useEffect(()=>{const I=pe.current;if(!I)return;const Te=requestAnimationFrame(()=>{const at=I.scrollHeight-I.scrollTop-I.clientHeight;et(at>40)});return()=>cancelAnimationFrame(Te)},[a,o,E.length]),S.useEffect(()=>{if(!he||typeof MutationObserver>"u")return;const I=()=>{const at=he.scrollHeight-he.scrollTop-he.clientHeight;et(at>40)};I();const Te=new MutationObserver(I);return Te.observe(he,{childList:!0,subtree:!0,characterData:!0}),()=>Te.disconnect()},[he]);const bt=(me=e.selectedIntegration)!=null&&me.chatAttachments?e.activeProjectId?e.localSending?"sending":null:"noProject":"unsupported",yt=bt===null,Zt=S.useCallback(I=>{yt&&P(I)},[yt,P]),Pe=PS({onDrop:Zt,noClick:!0,noKeyboard:!0}),pt=[...n].sort(pu),Dt=pt.filter(I=>I.persistentChat),Nt=pt.filter(I=>!I.persistentChat),ge=r,{showingSessionHistory:Mt,showingStoredSessions:Fn,visibleAgentTabs:yn,showAddFlow:it,shouldShowConversationLoader:fe}=UI({connectedAgents:Dt,selectedIntegration:r,selectedIntegrationId:a,selectedHasConversation:s,selectedIntegrationHasAnyConversation:u,localHistoryLoaded:_,localMessagesCount:E.length}),H=Q||!(ge!=null&&ge.chatReady)||ge.busy===!0,le=!H&&!O&&(F.trim()!==""||ie);return m.jsxs("div",{className:"v10-agents-tab",children:[m.jsxs("div",{className:"v10-agent-subtabs",role:"tablist","aria-label":"Integrated agents",children:[yn.map(I=>{const Te=(ge==null?void 0:ge.id)===I.id&&!it;return m.jsxs("div",{className:`v10-agent-subtab-group ${Te?"active":""}`,children:[m.jsxs("button",{className:`v10-agent-subtab ${Te?"active":""}`,onClick:()=>d(I.id,{preserveSession:BS({integrationId:I.id,selectedSessionId:o,integrations:n}),sessionId:I.defaultSessionId}),role:"tab","aria-selected":Te,children:[m.jsx("span",{className:`v10-agents-stat-dot ${Ox(I)}`}),m.jsx(Mx,{integrationId:I.id}),m.jsx("span",{children:I.name})]}),Te&&m.jsx(LI,{integration:I,statusLabel:MI(I,Mt),statusDotClass:Ox(I),refreshBusy:b===I.id,clearBusy:k===I.id,canDisconnect:I.connectSupported&&I.persistentChat,canClearSession:I.id==="local-llm",onRefresh:()=>y(I.id),onDisconnect:()=>f(I.id),onClearSession:()=>g(I.id)})]},I.id)}),m.jsx("button",{className:`v10-agent-subtab add ${it?"active":""}`,onClick:()=>d(sr),role:"tab","aria-selected":it,"aria-label":"Add another integrated agent",title:"Add another integrated agent",children:"+"})]}),it?m.jsxs("div",{className:"v10-agent-add-surface",children:[m.jsx("div",{className:"v10-agents-section-label",children:"Connect Another Agent"}),C&&m.jsx("div",{className:"v10-local-agent-notice",children:C}),j&&m.jsx("div",{className:"v10-local-agent-error",children:j}),m.jsxs("div",{className:"v10-local-agent-list","aria-label":"Available agent integrations",children:[Nt.length===0&&m.jsx("div",{className:"v10-agent-empty-state",children:"No additional local agent integrations are available yet."}),Nt.map(I=>m.jsxs("div",{className:"v10-local-agent-detail v10-local-agent-choice",children:[m.jsxs("div",{className:"v10-local-agent-detail-head",children:[m.jsxs("div",{children:[m.jsxs("div",{className:"v10-local-agent-title",children:[m.jsx(Mx,{integrationId:I.id}),I.name]}),m.jsx("div",{className:"v10-local-agent-subtitle",children:I.description})]}),m.jsx("span",{className:`v10-local-agent-status-pill ${I.status}`,children:I.statusLabel})]}),m.jsx("p",{className:"v10-local-agent-copy",children:I.detail}),I.error&&m.jsx("div",{className:"v10-local-agent-warning offline",role:"status","data-testid":`local-agent-warning-${I.id}`,children:I.error}),I.id==="openclaw"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"v10-local-agent-copy",children:"Connect your local OpenClaw once, then this tab becomes the persistent chat surface for that agent. The node can retry the bridge without forcing you back through setup."}),m.jsxs("div",{className:"v10-local-agent-actions",children:[m.jsx("button",{className:"v10-agent-send-btn secondary",onClick:()=>p(I.id),disabled:x===I.id,children:x===I.id?"Connecting...":"Connect OpenClaw"}),m.jsx("a",{className:"v10-agent-link-btn",href:TL,target:"_blank",rel:"noreferrer",children:"Docs"}),m.jsx("a",{className:"v10-agent-link-btn",href:NL,target:"_blank",rel:"noreferrer",children:"Release Notes"})]})]}),I.id==="prime-agent"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"v10-local-agent-copy",children:"Connect a local Prime Agent through the node, then this tab becomes the persistent chat surface for it. Prime Agent publishes a bridge per live session; the first chat pins one session, and you can switch explicitly when several are live."}),typeof I.sessionCount=="number"&&m.jsx("p",{className:"v10-local-agent-copy","data-testid":`local-agent-sessions-${I.id}`,children:I.sessionCount===0?"No live session. Start a Prime Agent session, then refresh — the extension publishes its bridge on session start.":I.sessionCount===1?"1 live session.":`${I.sessionCount} live sessions — choose which session this chat should use.`}),I.connectSupported&&m.jsx("div",{className:"v10-local-agent-actions",children:m.jsx("button",{className:"v10-agent-send-btn secondary",onClick:()=>p(I.id),disabled:x===I.id,children:x===I.id?"Connecting...":"Connect Prime Agent"})})]}),I.id==="hermes"&&m.jsxs(m.Fragment,{children:[m.jsx("p",{className:"v10-local-agent-copy",children:"Connect a local Hermes profile through the node, then this tab becomes the persistent chat surface for that profile."}),I.connectSupported&&m.jsx("div",{className:"v10-local-agent-actions",children:m.jsx("button",{className:"v10-agent-send-btn secondary",onClick:()=>p(I.id),disabled:x===I.id,children:x===I.id?"Connecting...":"Connect Hermes"})})]})]},I.id))]})]}):ge&&m.jsxs("div",{...Pe.getRootProps({className:"v10-local-agent-chat-shell"}),children:[m.jsx("input",{...Pe.getInputProps()}),C&&m.jsx("div",{className:"v10-local-agent-notice",children:C}),j&&m.jsx("div",{className:"v10-local-agent-error",children:j}),!ge.chatReady&&m.jsx("div",{className:`v10-local-agent-warning ${ge.status==="connecting"?"connecting":"offline"}`,children:Mt?`${ge.name} is not currently attached to this node. Session history remains available here; reconnect from the + tab when you want live chat again.`:ge.status==="connecting"?`${ge.name} is still finishing setup. This chat tab stays in place and will go live automatically when the connection is ready.`:ge.status==="degraded"?ge.detail:Fn?`${ge.name} has saved sessions on this node. Open one from Sessions or reconnect from the + tab to resume live chat here.`:`${ge.name} is temporarily unavailable. Refresh after it recovers to resume chatting here.`}),ge.id==="prime-agent"&&ge.busy===!0&&m.jsx("div",{className:"v10-local-agent-warning connecting",role:"status","data-testid":"prime-agent-active-turn-status",children:ge.detail}),ge.id==="prime-agent"&&(((ye=ge.liveSessions)==null?void 0:ye.length)??0)>1&&m.jsxs("div",{className:"v10-composer-target","data-testid":"prime-agent-session-picker",children:[m.jsx("span",{className:"v10-local-agent-target-label",children:"Prime session"}),m.jsx(_x,{className:"v10-local-agent-target-select",value:o??ge.defaultSessionId??"",onChange:I=>d(ge.id,{sessionId:I}),options:ge.liveSessions.map((I,Te)=>{var at;return{value:I.sessionId,label:((at=I.sessionName)==null?void 0:at.trim())||`${Te===0?"Most recent":`Session ${Te+1}`} · ${I.sessionId.slice(0,8)}…`}}),ariaLabel:"Prime Agent session",disabled:Q||ge.busy===!0})]}),Pe.isDragActive&&m.jsx("div",{className:`v10-drop-overlay active ${yt?"accept":"refuse"}`,role:"status","aria-live":"polite",children:m.jsxs("div",{className:"v10-drop-overlay-card",children:[yt?m.jsx(RN,{className:"v10-drop-overlay-icon",size:32,"aria-hidden":"true"}):m.jsx(iN,{className:"v10-drop-overlay-icon",size:32,"aria-hidden":"true"}),m.jsx("div",{className:"v10-drop-overlay-title",children:yt?`Drop files to attach to ${nh(T,M)}`:bt==="sending"?"Wait for the current send to finish.":bt==="unsupported"?`${ge.name} doesn't accept file attachments.`:"Choose a context graph before attaching files."}),m.jsx("div",{className:"v10-drop-overlay-hint",children:yt?"Release to upload to this conversation.":bt==="sending"?"Drop will be accepted once the agent reply lands.":bt==="unsupported"?"Try a different agent that supports attachments.":"Use the picker below the composer."})]})}),m.jsxs("div",{className:"v10-chat-messages v10-local-agent-messages",ref:Ue,onScroll:Ot,children:[fe&&m.jsx("div",{className:"v10-agent-empty-state",children:"Loading the latest conversation from DKG memory..."}),!fe&&E.length===0&&(()=>{const I=Mt?{title:"No turns in this session yet.",hint:`Reconnect ${ge.name} from the + tab to start a new live thread.`}:Fn?{title:`${ge.name} has saved sessions.`,hint:"Open one from Sessions, or reconnect from + to start fresh."}:ge.chatReady?{title:`Start a conversation with ${ge.name}.`,hint:'Try: "What can you help me with?"'}:{title:`${ge.name} is offline.`,hint:"Conversation history stays here while the bridge reconnects."};return m.jsxs("div",{className:"v10-agent-empty-state",children:[m.jsx("div",{className:"v10-agent-empty-state-title",children:I.title}),m.jsx("div",{className:"v10-agent-empty-state-hint",children:I.hint})]})})(),E.map(I=>{var Te,at;return m.jsxs("div",{className:`v10-chat-msg ${I.role}`,children:[m.jsx("div",{className:`v10-chat-bubble ${I.role}`,children:yz(I.content,I.role,!!I.synthesized,!!I.streaming,I.failureNotice)}),I.attachments&&I.attachments.length>0&&m.jsx("div",{className:"v10-local-agent-attachment-row",style:{display:"flex",flexWrap:"wrap",gap:6,marginTop:6},children:I.attachments.map(Ie=>m.jsx("span",{className:"v10-local-agent-attachment-chip",style:{padding:"2px 8px",borderRadius:999,background:"var(--bg-elevated)",fontSize:11},children:Ie.fileName},Ie.id??Ie.assertionUri??Ie.fileHash))}),I.role==="assistant"&&(((Te=I.toolCalls)==null?void 0:Te.length)||I.traceFile)&&m.jsxs("div",{className:"v10-local-agent-copy","data-testid":"local-llm-turn-metadata",children:[(at=I.toolCalls)!=null&&at.length?`Tools: ${I.toolCalls.map(Ie=>Ie.name).join(", ")}`:"Tools: none",I.traceFile?` · Trace: ${I.traceFile}`:""]}),I.ts&&m.jsx("time",{className:`v10-local-agent-msg-time ${I.role}`,dateTime:I.tsRaw,children:I.ts})]},I.id)}),m.jsx("div",{ref:R}),m.jsx("button",{type:"button",className:`v10-scroll-to-bottom ${Ne?"visible":""}`,onClick:xt,"aria-label":"Scroll to latest message",title:"Scroll to latest message",tabIndex:Ne?0:-1,"aria-hidden":!Ne,children:m.jsx(eN,{size:14,"aria-hidden":"true"})})]}),m.jsx("div",{className:"v10-agent-input-area",children:m.jsxs("div",{style:{display:"flex",flexDirection:"column",gap:8,width:"100%"},children:[Z.length>0&&m.jsx("div",{className:"v10-attachment-chips",role:"list","aria-label":"Attached files",children:Z.map(I=>{var Ie,Xe;const Te=((Ie=I.result)==null?void 0:Ie.extraction.tripleCount)??((Xe=I.result)==null?void 0:Xe.extraction.triplesWritten),at=I.status==="queued"?"Queued":I.status==="uploading"?"Importing…":I.status==="completed"?Te!=null?`Ready · ${Te} triples`:"Ready":I.status==="skipped"?"Stored only":I.error??"Failed";return m.jsxs("div",{className:"v10-attachment-chip","data-status":I.status,role:"listitem",children:[m.jsx("div",{className:"v10-attachment-chip-badge","aria-hidden":"true",children:wL(I.file.name)}),m.jsxs("div",{className:"v10-attachment-chip-body",children:[m.jsx("div",{className:"v10-attachment-chip-name",title:I.file.name,children:I.file.name}),m.jsxs("div",{className:"v10-attachment-chip-meta",children:[m.jsx("span",{children:bL(I.file.size)}),m.jsx("span",{"aria-hidden":"true",children:"·"}),m.jsx("span",{className:"v10-attachment-chip-status",children:at})]})]}),m.jsx("button",{type:"button",className:"v10-attachment-chip-remove",onClick:()=>K(I.id),disabled:Q,"aria-label":`Remove ${I.file.name}`,title:"Remove attachment",children:m.jsx(zN,{size:12,"aria-hidden":"true"})})]},I.id)})}),N&&m.jsx("div",{className:"v10-local-agent-copy",style:{margin:0,color:"var(--text-tertiary)"},children:G.length>1?"Queued files keep their stored targets and may span multiple projects.":`Queued files keep their stored target (${nh(T,G[0])}), not the active project.`}),m.jsx("input",{ref:ue,type:"file",multiple:!0,style:{display:"none"},onChange:I=>{I.target.files&&(P(I.target.files),I.target.value="")}}),m.jsx("div",{className:"v10-local-agent-composer-row",children:m.jsxs("div",{className:"v10-local-agent-composer-shell",children:[m.jsx(Mz,{placeholder:Mt?`Reconnect ${ge.name} to resume live chat...`:ge.chatReady?`Message ${ge.name}...`:ge.status==="connecting"?`${ge.name} is still connecting...`:`${ge.name} bridge offline...`,className:"v10-agent-input",value:F,onChange:I=>U(I.target.value),onKeyDown:I=>{if(!I.nativeEvent.isComposing){if(I.key==="Enter"&&!I.shiftKey&&!I.ctrlKey&&!I.metaKey){I.preventDefault(),le&&D();return}if((I.ctrlKey||I.metaKey)&&I.key==="Enter"){I.preventDefault(),le&&D();return}I.key==="Escape"&&F.length>0&&(I.preventDefault(),U(""))}},disabled:H,minRows:1,maxRows:8}),m.jsxs("div",{className:"v10-composer-controls",children:[m.jsxs("div",{className:"v10-composer-controls-left",children:[m.jsx("button",{type:"button",className:"v10-composer-attach",onClick:()=>{var I;return(I=ue.current)==null?void 0:I.click()},disabled:!yt,title:yt?"Attach files":bt==="noProject"?"Choose a context graph to attach files":bt==="sending"?"Wait for the current message to send":"This agent does not support attachments","aria-label":"Attach files",children:m.jsx(kN,{size:14,"aria-hidden":"true"})}),m.jsx("div",{className:"v10-composer-target",children:m.jsx(_x,{className:"v10-local-agent-target-select",value:M??"",onChange:V,options:[...M?[{value:"",label:"No context graph (clear selection)"}]:[],...B.map(I=>({value:I.id,label:I.name}))],placeholder:q?"Loading context graphs…":"Choose a context graph",disabled:q||!M&&B.length===0,ariaLabel:"Active project",prefixIcon:m.jsx(mN,{size:12,"aria-hidden":"true"})})})]}),m.jsx("button",{type:"button",className:`v10-local-agent-inline-send v10-local-agent-inline-send-${X}`,onClick:X==="streaming"?W:D,disabled:X==="streaming"?!1:X==="uploading"?!0:!le,"aria-label":X==="streaming"?"Stop reply":X==="uploading"?"Send message (attachments uploading)":"Send message",title:X==="streaming"?"Stop reply":X==="uploading"?"Send message (attachments uploading)…":"Send message",children:X==="streaming"?m.jsx(AN,{size:12,"aria-hidden":"true"}):X==="uploading"?m.jsx(xN,{className:"v10-local-agent-inline-send-spinner",size:14,"aria-hidden":"true"}):m.jsx(nN,{size:14,"aria-hidden":"true"})})]})]})})]})})]})]})}function _p(e){return e.length>12?e.slice(-8):e}function GI(e){if(!e)return"";const n=e.lastIndexOf(":"),a=n>=0?e.slice(n+1):e;return a.length>10?a.slice(-10):a||e.slice(-8)}function VI(e,n){const a=new Map;for(const y of n){if(!y.peerId)continue;const g=a.get(y.peerId)??[];g.push(y),a.set(y.peerId,g)}const r=new Map;for(const y of e){if(!y.peerId)continue;const g=r.get(y.peerId)??{hasDirect:!1,hasRelay:!1,openedAt:null},x=g.hasDirect||y.transport==="direct",b=g.hasRelay||y.transport==="relayed",k=y.openedAt!=null?g.openedAt!=null?Math.min(g.openedAt,y.openedAt):y.openedAt:g.openedAt;r.set(y.peerId,{hasDirect:x,hasRelay:b,openedAt:k})}const o=y=>{var g;return(g=y.find(x=>x.name))==null?void 0:g.name},s=y=>y.reduce((g,x)=>x.lastSeen!=null&&(g==null||x.lastSeen>g)?x.lastSeen:g,void 0),u=[],d=new Set;for(const[y,g]of r){const x=a.get(y)??[];u.push({peerId:y,name:o(x),transport:g.hasDirect?"direct":"relayed",hasDirect:g.hasDirect,hasRelay:g.hasRelay,openedAt:g.openedAt,connected:!0,lastSeen:s(x),agents:x}),d.add(y)}for(const[y,g]of a){if(d.has(y))continue;const x=g.filter(j=>j.connectionStatus==="connected");if(x.length===0)continue;const b=x.some(j=>j.connectionTransport==="direct"),k=x.some(j=>j.connectionTransport==="relayed"),C=k&&!b?"relayed":"direct";u.push({peerId:y,name:o(g),transport:C,hasDirect:b,hasRelay:k,openedAt:null,connected:!0,lastSeen:s(g),agents:g}),d.add(y)}const p=[];for(const[y,g]of a){if(d.has(y))continue;const x=s(g);x!=null&&p.push({peerId:y,name:o(g),transport:"direct",hasDirect:!1,hasRelay:!1,openedAt:null,connected:!1,lastSeen:x,agents:g})}p.sort((y,g)=>(g.lastSeen??0)-(y.lastSeen??0));const f=u.filter(y=>y.transport==="direct").length;return{connected:u,recentlySeen:p,directCount:f,relayedCount:u.length-f}}function WI({peer:e}){var y;const[n,a]=S.useState(!1),r=S.useId(),o=3,s=e.connected?"connected":"offline",u=((y=e.name)==null?void 0:y.trim())||_p(e.peerId),d=n?e.agents:e.agents.slice(0,o),p=e.connected?e.transport:"Disconnected",f=e.connected&&e.hasDirect&&e.hasRelay?"Direct + relay paths active — direct shown":void 0;return m.jsxs("div",{className:`v10-agent-card v10-peer-card ${s}`,children:[m.jsxs("div",{className:"v10-agent-card-header",children:[m.jsx("span",{className:`v10-agent-card-dot ${s}`}),m.jsx("span",{className:"v10-peer-card-name",children:u}),m.jsx("span",{className:"v10-agent-card-badge",title:f,children:p})]}),m.jsxs("div",{className:"v10-peer-card-meta",children:[m.jsx("span",{title:e.peerId,children:_p(e.peerId)}),e.connected&&e.openedAt!=null&&m.jsxs("span",{children:["up ",ix(Date.now()-e.openedAt)]}),!e.connected&&e.lastSeen!=null&&m.jsxs("span",{children:[ix(Date.now()-e.lastSeen)," ago"]}),e.agents.length>0&&m.jsxs("span",{children:[e.agents.length," agent",e.agents.length===1?"":"s"]})]}),e.agents.length>0&&m.jsxs("ul",{id:r,className:"v10-peer-card-chips","aria-label":`Agents on ${u}`,children:[d.map((g,x)=>m.jsx("li",{className:"v10-peer-chip",title:g.agentUri||"",children:m.jsx("span",{className:"v10-peer-chip-label",children:GI(g.agentUri)||_p(g.peerId)})},g.agentUri||`${e.peerId}:${x}`)),e.agents.length>o&&m.jsx("li",{children:m.jsx("button",{type:"button",className:"v10-peer-chip-more","aria-expanded":n,"aria-controls":r,onClick:()=>a(g=>!g),children:n?"Show less":`+${e.agents.length-o} more`})})]})]})}function Lx(e){const{label:n,peers:a,expanded:r,onToggle:o,emptyMessage:s}=e;return m.jsxs("div",{className:"v10-peer-group",children:[m.jsxs("button",{type:"button",className:"v10-peer-group-header",onClick:o,"aria-expanded":r,children:[m.jsx(Bp,{size:14,className:`v10-peer-group-chevron ${r?"expanded":""}`,"aria-hidden":"true"}),m.jsx("span",{className:"v10-peer-group-label",children:n}),m.jsx("span",{className:"v10-peer-group-count",children:a.length})]}),r&&m.jsx("div",{className:"v10-peer-group-body",children:a.length===0?m.jsx("div",{className:"v10-agent-empty-state",children:s}):a.map(u=>m.jsx(WI,{peer:u},u.peerId))})]})}function YI(e){const{peerAgents:n,connections:a,loading:r,onRefresh:o}=e,[s,u]=S.useState(!0),[d,p]=S.useState(!1),{connected:f,recentlySeen:y,directCount:g,relayedCount:x}=VI(a.rows,n);return m.jsxs("div",{className:"v10-agent-scroll-tab",children:[m.jsxs("div",{className:"v10-agents-summary",children:[m.jsxs("span",{className:"v10-agents-stat",children:[m.jsx("span",{className:`v10-agents-stat-dot ${f.length>0||a.total>0?"connected":"known"}`}),m.jsxs("span",{title:"Unique libp2p peers connected to this node — matches the count in the header.",children:[f.length," peer",f.length===1?"":"s"]})]}),m.jsxs("span",{className:"v10-agents-stat",title:"Preferred transport per peer (peers reachable via direct + relay are bucketed under direct)",children:[g," direct / ",x," relayed"]}),m.jsx("button",{className:"v10-agents-refresh",onClick:o,title:"Refresh network peers",children:"Refresh"})]}),r&&m.jsx("p",{className:"v10-agents-loading",children:"Loading peers..."}),!r&&f.length===0&&y.length===0&&a.total===0&&m.jsx("div",{className:"v10-agent-empty-state",children:"No network peers detected yet."}),!r&&f.length===0&&a.total>0&&m.jsxs("div",{className:"v10-agent-empty-state",children:["Connected to ",a.total," peer",a.total===1?"":"s"," (peer metadata syncing…)."]}),(f.length>0||y.length>0)&&m.jsxs(m.Fragment,{children:[m.jsx(Lx,{label:"Connected",peers:f,expanded:s,onToggle:()=>u(b=>!b),emptyMessage:"No peers currently connected."}),m.jsx(Lx,{label:"Recently seen",peers:y,expanded:d,onToggle:()=>p(b=>!b),emptyMessage:"No previously-seen peers."})]})]})}function KI(e){const{sessions:n,onOpenSession:a}=e;return m.jsx("div",{className:"v10-agent-scroll-tab",children:m.jsxs("div",{className:"v10-sessions-list",children:[m.jsx("div",{className:"v10-local-agent-copy",style:{marginBottom:12},children:"Sessions track DKG-persisted conversations for your integrated agents."}),n.length===0?m.jsx("p",{className:"v10-agent-empty-state",children:"No integrated-agent sessions yet."}):n.map(r=>m.jsxs("button",{className:"v10-session-item",onClick:()=>a(r),children:[m.jsxs("span",{className:"v10-session-preview",children:[r.integrationName,": ",r.preview]}),m.jsxs("span",{className:"v10-session-count",children:[r.messageCount," msg",r.messageCount!==1?"s":"",r.lastTs?` - ${Qc(r.lastTs)}`:""]})]},r.sessionId))]})})}function QI(){return Rh().data}function XI(){const{stage:e,advance:n}=Lh(),[a,r]=S.useState("agents"),[o,s]=S.useState([]),[u,d]=S.useState([]),[p,f]=S.useState({total:0,direct:0,relayed:0,rows:[]}),[y,g]=S.useState(!0),x=QI(),[b,k]=S.useState([]),[C,j]=S.useState("openclaw"),[E,_]=S.useState(()=>rr("openclaw")),[R,F]=S.useState(null),[U,D]=S.useState(null),[W,Q]=S.useState(null),[M,T]=S.useState(null),[q,V]=S.useState(null),[ae,P]=S.useState({}),[K,B]=S.useState({}),[Z,ie]=S.useState({}),[G,O]=S.useState({}),[L,X]=S.useState({}),N=S.useRef(new Map),ue=S.useRef(!1),pe=S.useRef(null),he=S.useRef([]),Ee=S.useRef({}),Ue=S.useRef("openclaw"),Ne=S.useRef(rr("openclaw")),et=ca(se=>se.contextGraphs),Ot=ca(se=>se.loading),xt=ca(se=>se.activeProjectId),bt=ca(se=>se.setActiveProject),yt=S.useMemo(()=>KR(et,x?Uh(x):null,xt),[et,x,xt]),Zt=Dx(o,b),{selectedIntegration:Pe,selectedConversation:pt,selectedHasConversation:Dt,selectedIntegrationHasAnyConversation:Nt}=PI({integrations:b,selectedIntegrationId:C,selectedSessionId:E,localMessagesByConversation:ae,sessions:Zt}),ge=(pt==null?void 0:pt.stateKey)??null,Mt=ge?ae[ge]??[]:[],Fn=ge?G[ge]??!1:!1,yn=ge?K[ge]??"":"",it=ge?Z[ge]??!1:!1,fe=ge?L[ge]??[]:[],H=S.useCallback(()=>{var se;(se=pe.current)==null||se.scrollIntoView({behavior:"smooth"})},[]);S.useEffect(H,[ge,Mt,H]),S.useEffect(()=>{he.current=o},[o]),S.useEffect(()=>{Ee.current=ae},[ae]),S.useEffect(()=>{Ue.current=C},[C]),S.useEffect(()=>{Ne.current=E},[E]);const le=S.useCallback((se,ve)=>{P(ke=>({...ke,[se]:ve(ke[se]??[])}))},[]),me=S.useCallback((se,ve)=>{se&&B(ke=>({...ke,[se]:ve}))},[]),ye=S.useCallback((se,ve)=>{ie(ke=>({...ke,[se]:ve}))},[]),I=S.useCallback((se,ve)=>{X(ke=>({...ke,[se]:ve(ke[se]??[])}))},[]),Te=S.useCallback((se,ve,ke)=>{const De=Array.from(ve);if(De.length===0)return;const Ye=new Set((L[se]??[]).map(we=>`${we.contextGraphId}:${we.file.name}:${we.file.size}:${we.file.lastModified}`)),lt=De.filter(we=>{const _e=`${ke}:${we.name}:${we.size}:${we.lastModified}`;return Ye.has(_e)?!1:(Ye.add(_e),!0)});if(lt.length===0)return;const Re=lt.map(we=>({id:`${se}:${we.name}:${we.size}:${we.lastModified}:${crypto.randomUUID()}`,file:we,contextGraphId:ke,assertionName:`${Date.now().toString(36)}-${crypto.randomUUID().slice(0,8)}-${we.name.replace(/[^a-zA-Z0-9._-]/g,"_")}`,status:"queued"}));I(se,we=>[...we,...Re])},[L,I]),at=S.useCallback(async(se,ve)=>{const ke=[];for(const De of ve){if(De.status==="completed"||De.status==="skipped"){ke.push(De);continue}I(se,Ye=>Ye.map(lt=>lt.id===De.id?{...lt,status:"uploading",error:void 0}:lt));try{const Ye=await sj(De.assertionName,De.contextGraphId,De.file),lt=Ye.extraction.status==="completed"?"completed":Ye.extraction.status==="skipped"?"skipped":"error",Re={...De,status:lt,result:Ye,error:Ye.extraction.error};ke.push(Re),I(se,we=>we.map(_e=>_e.id===De.id?Re:_e))}catch(Ye){const lt={...De,status:"error",error:(Ye==null?void 0:Ye.message)??"Upload failed"};ke.push(lt),I(se,Re=>Re.map(we=>we.id===De.id?lt:we))}}return ke},[I]),Ie=S.useCallback((se,ve)=>{I(se,ke=>ke.filter(De=>De.id!==ve))},[I]),Xe=S.useCallback((se,ve)=>{const ke=new Set(ve);I(se,De=>De.filter(Ye=>!ke.has(Ye.id)))},[I]),Ve=S.useCallback((se,ve={})=>{j(se),se!==sr&&(ve.preserveSession||_(ve.sessionId??rr(se)))},[]),Se=S.useCallback(()=>{Hn.fetchMemorySessions(50).then(({sessions:se})=>s(se??[])).catch(()=>{})},[]),Vt=S.useCallback(async()=>{try{const[se,ve]=await Promise.all([Tb().catch(()=>({agents:[]})),YA().catch(()=>({total:0,direct:0,relayed:0,connections:[]}))]),ke=(se.agents??[]).filter(De=>De.connectionStatus!=="self");d(ke),f({total:ve.total??0,direct:ve.direct??0,relayed:ve.relayed??0,rows:Array.isArray(ve.connections)?ve.connections:[]})}catch{}g(!1)},[]),rt=S.useCallback(async()=>{try{const{integrations:se}=await lu();k(se);const ve=Dx(he.current,se),ke=[...se].sort(pu).filter(_e=>_e.persistentChat),De=Ue.current,Ye=Ne.current,lt=se.find(_e=>_e.id===De)??null,Re=HI({selectedIntegrationId:De,selectedItem:lt,selectedSessionId:Ye,localMessagesByConversation:Ee.current,sessionSummaries:ve});if(!Re){const _e=ke[0];Ve((_e==null?void 0:_e.id)??sr,{sessionId:(_e==null?void 0:_e.defaultSessionId)??null})}const we=ke[0];we&&!ue.current&&De!==sr?(ue.current=!0,Ve(we.id,{sessionId:we.defaultSessionId}),r("agents")):!we&&!Re&&(ue.current=!1,Ve(sr))}catch{}},[Ve]),ja=S.useCallback(async(se,ve=null,ke=null)=>{const De=Ro({integrationId:se,sessionId:ve,defaultSessionId:ke});O(Ye=>({...Ye,[De.stateKey]:!1}));try{const lt=(await N0(se,100,{sessionId:De.sessionId??void 0})).map(Re=>ox(Re,se));le(De.stateKey,Re=>Ep(Re,lt))}catch{le(De.stateKey,Ye=>Ye)}finally{O(Ye=>({...Ye,[De.stateKey]:!0})),Se()}},[Se,le]);S.useEffect(()=>{Se(),Vt(),rt()},[Se,Vt,rt]),S.useEffect(()=>{for(const se of RL)ja(se,rr(se))},[]);const ti=S.useCallback(()=>{Se(),Vt()},[Se,Vt]);Ho(ti,15e3,{runImmediately:!1});const Ii=b.some(se=>se.persistentChat&&(!se.chatReady||se.status==="connecting"))?3e3:15e3;S.useEffect(()=>{const se=setInterval(()=>{rt()},Ii);return()=>clearInterval(se)},[Ii,rt]),S.useEffect(()=>{if(!(Pe!=null&&Pe.chatSupported)||!Pe.persistentChat&&!Dt){ge&&O(ve=>({...ve,[ge]:!1}));return}let se=!1;return(async()=>await ja(Pe.id,(pt==null?void 0:pt.sessionId)??null,Pe.defaultSessionId??null))(),()=>{se=!0}},[ja,pt==null?void 0:pt.sessionId,ge,Dt,Pe==null?void 0:Pe.defaultSessionId,Pe==null?void 0:Pe.chatSupported,Pe==null?void 0:Pe.id,Pe==null?void 0:Pe.persistentChat]);const gr=S.useCallback(async()=>{var vr,Ra;const se=Pe,ve=pt,ke=yn.trim(),De=fe,Ye=De.some(SS);if(!(se!=null&&se.chatSupported)||!se.chatReady||it||!ve||!ke&&!Ye)return;const lt=se.id,Re=ve.stateKey;ye(Re,!0),Q(null);let we=null,_e="",rn="",Na="",xl="",Yo=[],ni=[],ha=[];try{ni=await at(Re,De);const Wt=ni.map(Be=>CL(Be)).filter(Be=>Be!=null),cn=EL(ni);if(!ke&&Wt.length===0&&cn.results.length===0)return;rn=crypto.randomUUID();const Gn=CS(cn.results),At=[ke,Gn].filter(Be=>Be.length>0).join(`
|
|
1174
|
+
|
|
1175
|
+
`);Na=ke?At:AL(Wt,cn.results);const vn=ke?At:"";Yo=Wt,ha=[...Wt.map(Be=>Be.id).filter(Be=>typeof Be=="string"&&Be.length>0),...cn.deliveredDraftIds];const un=`local:${Re}:${rn}:user`;_e=`local:${Re}:${rn}:assistant`;const Vn=new Date,ai=Qc(Vn),bl=th(Vn);le(Re,Be=>[...Be,{id:un,turnId:rn,role:"user",content:Na,ts:ai,tsRaw:bl,attachments:Wt},{id:_e,turnId:rn,role:"assistant",content:"",ts:ai,tsRaw:bl,streaming:!0}]),me(Re,""),ha.length>0&&Xe(Re,ha),we=new AbortController,N.current.set(Re,we);const Ko=[...jL(et,xt,x)],gu=se.id==="prime-agent"?(vr=se.liveSessions)==null?void 0:vr.find(Be=>Be.sessionId===ve.sessionId):void 0,dn=await Yj(lt,vn,{correlationId:rn,signal:we==null?void 0:we.signal,sessionId:ve.sessionId??void 0,liveSession:gu,profile:se.profile,persistUserMessage:vn?void 0:Na,attachments:Wt,attachmentImportResults:cn.results,contextEntries:Ko,contextGraphId:xt??void 0,onEvent:Be=>{Be.type==="text_delta"&&(xl+=Be.delta,le(Re,Ft=>Ft.map(_a=>_a.id===_e?{..._a,content:_a.content+Be.delta}:_a)))}}),Bi=new Date;le(Re,Be=>sx(Be,rn,dn.turnId).map(Ft=>{var _a;return Ft.id===_e?{...Ft,content:dn.text||Ft.content,turnId:((_a=dn.turnId)==null?void 0:_a.trim())||Ft.turnId,streaming:!1,synthesized:!dn.text&&!Ft.content?!0:Ft.synthesized,ts:Qc(Bi),tsRaw:th(Bi),toolCalls:dn.toolCalls,traceFile:dn.traceFile,profile:dn.profile,contextGraphId:dn.contextGraphId,readOnly:dn.readOnly}:Ft}));const xn=lt==="prime-agent"?(Ra=dn.sessionId)==null?void 0:Ra.trim():void 0;if(xn&&xn!==ve.sessionId&&Ue.current===lt&&Ne.current===ve.sessionId){const Be=um(lt,xn);P(Ft=>({...Ft,[Be]:Ep(Ft[Be]??[],Ft[Re]??[])})),O(Ft=>({...Ft,[Be]:Ft[Re]??!0})),Ve(lt,{sessionId:xn}),D(`${se.name} restarted; switched chat to the live session.`)}Se(),e===0&&n()}catch(Wt){const cn=(Wt==null?void 0:Wt.name)==="AbortError",Gn=cn?"Request cancelled.":_L(se,Wt),At=cn?Gn:`Error: ${Gn}`;if(_e){const vn=mz(xl,At);le(Re,ma=>ma.map(un=>un.id===_e?{...un,...vn,streaming:!1}:un))}!cn&<==="hermes"&&_e&&Na&&(async()=>{try{const vn=await Wj(lt,{sessionId:ve.sessionId??void 0,correlationId:rn||void 0,userMessage:Na,assistantReply:xl,failureReason:Gn,profile:se.profile,attachments:Yo,contextGraphId:xt??void 0});vn.turnId&&le(Re,ma=>sx(ma,rn,vn.turnId)),Se()}catch{}})(),ha.length>0&&ni.length>0&&X(vn=>{const ma=vn[Re]??[],un=new Set(ma.map(ai=>ai.id)),Vn=ni.filter(ai=>!un.has(ai.id));return Vn.length===0?vn:{...vn,[Re]:[...Vn,...ma]}}),rt()}finally{ye(Re,!1),N.current.get(Re)===we&&N.current.delete(Re)}},[xt,n,et,x,Se,yn,it,at,fe,rt,pt,Pe,Xe,me,ye,Ve,e,le]),Ta=S.useCallback(()=>{if(!ge)return;const se=N.current.get(ge);se==null||se.abort()},[ge]),yr=S.useCallback(async se=>{F(se),Q(null),D(null);try{const ve=await qj(se);k(Ye=>Nc(Ye,ve.integration)),await rt();const ke=Nc(b,ve.integration),De=zI({integrationId:se,selectedSessionId:E,integrations:ke});Ve(se,{preserveSession:De,sessionId:ve.integration.defaultSessionId}),ue.current=!0,D(ve.notice??(ve.integration.chatReady?`${ve.integration.name} is connected and chat-ready.`:`${ve.integration.name} attach is in progress. The node will keep checking for a live bridge.`)),r("agents")}catch(ve){await rt(),Q(ve.message)}finally{F(null)}},[b,rt,E,Ve]),Pi=S.useCallback(async se=>{Q(null),D(null);try{await Fj(se),k(ve=>BI(ve,se)),ue.current=!1,Ve(se,{preserveSession:C===se}),D("The local agent was disconnected from this node. Session history remains available here."),r("agents"),await rt()}catch(ve){Q(ve.message)}},[rt,C,Ve]),hu=S.useCallback(async se=>{var Ye,lt,Re;if(M===se)return;T(se),Q(null),D(null);const ve=Ro({integrationId:se,sessionId:C===se?Ne.current:null,defaultSessionId:(Ye=b.find(we=>we.id===se))==null?void 0:Ye.defaultSessionId}),[ke,De]=await Promise.allSettled([Gj(se),N0(se,100,{sessionId:ve.sessionId??void 0})]);try{if(ke.status==="fulfilled"?(k(we=>Nc(we,ke.value.integration)),ke.value.notice&&D(ke.value.notice)):Q(((lt=ke.reason)==null?void 0:lt.message)??"Failed to refresh integration."),De.status==="fulfilled"){const we=De.value.map(_e=>ox(_e,se));le(ve.stateKey,_e=>Ep(_e,we)),O(_e=>({..._e,[ve.stateKey]:!0}))}else ke.status==="fulfilled"&&Q(((Re=De.reason)==null?void 0:Re.message)??"Failed to refresh conversation.")}finally{T(null)}},[b,M,C,le]),Vo=S.useCallback(async se=>{if(!(se!=="local-llm"||q)){V(se),Q(null),D(null);try{await Nj();const ve=Ro({integrationId:se,sessionId:rr(se)});P(ke=>({...ke,[ve.stateKey]:[]})),B(ke=>({...ke,[ve.stateKey]:""})),X(ke=>({...ke,[ve.stateKey]:[]})),O(ke=>({...ke,[ve.stateKey]:!0})),D("DKG Local LLM session cleared. You can now select a different Context Graph."),await rt()}catch(ve){Q((ve==null?void 0:ve.message)??"Failed to clear the local LLM session.")}finally{V(null)}}},[q,rt]),vl=S.useCallback(se=>{Ve(se.integrationId,{sessionId:se.sessionId}),r("agents")},[Ve]),Ui=S.useCallback(se=>{bt(se||null)},[bt]),mu=S.useCallback(se=>{!ge||!xt||Te(ge,se,xt)},[xt,Te,ge]),Wo=S.useCallback(se=>{ge&&Ie(ge,se)},[Ie,ge]);return m.jsxs("div",{className:"v10-panel-right",children:[m.jsxs("div",{className:"v10-agent-mode-tabs",children:[m.jsx("button",{className:`v10-agent-mode-tab ${a==="agents"?"active":""}`,onClick:()=>r("agents"),children:"Agents"}),m.jsx("button",{className:`v10-agent-mode-tab ${a==="network"?"active":""}`,onClick:()=>r("network"),children:"Network"}),m.jsx("button",{className:`v10-agent-mode-tab ${a==="sessions"?"active":""}`,onClick:()=>r("sessions"),children:"Sessions"})]}),a==="agents"&&m.jsx(FI,{integrations:b,selectedIntegrationId:C,selectedIntegration:Pe,selectedSessionId:E,selectedHasConversation:Dt,selectedIntegrationHasAnyConversation:Nt,onSelectIntegration:Ve,onConnectIntegration:yr,onDisconnectIntegration:Pi,onRefreshIntegration:hu,onClearIntegrationSession:Vo,connectBusyId:R,refreshBusyId:M,clearBusyId:q,connectNotice:U,connectError:W,localMessages:Mt,localHistoryLoaded:Fn,localChatEndRef:pe,localInput:yn,onLocalInputChange:se=>me(ge,se),onSendLocalMessage:gr,onStopLocalStream:Ta,localSending:it,activeProjectId:xt,availableProjects:et,selectableProjects:yt,projectsLoading:Ot,onSelectProject:Ui,attachments:fe,onAddAttachments:mu,onRemoveAttachment:Wo}),a==="network"&&m.jsx(YI,{peerAgents:u,connections:p,loading:y,onRefresh:Vt}),a==="sessions"&&m.jsx(KI,{sessions:Zt,onOpenSession:vl})]})}function qS(e,n=document){const a=e==="light";n.documentElement.setAttribute("data-theme",e),n.documentElement.classList.toggle("light",a),n.body.classList.toggle("light",a)}function ZI(){const{toggleLeft:e,toggleRight:n,toggleBottom:a}=Bn();S.useEffect(()=>{const r=o=>{if(o.target instanceof HTMLInputElement||o.target instanceof HTMLTextAreaElement||!(o.metaKey||o.ctrlKey))return;const u=o.key.toLowerCase();if(o.shiftKey&&u==="b"){o.preventDefault(),n();return}if(!o.shiftKey){if(u==="b"){o.preventDefault(),e();return}if(u==="j"){o.preventDefault(),a();return}}};return window.addEventListener("keydown",r),()=>window.removeEventListener("keydown",r)},[e,n,a])}const zx={"/observability":{id:"operations",label:"Observability"},"/operations":{id:"operations",label:"Observability"},"/settings":{id:"settings",label:"Settings"}},JI={operations:"/observability",settings:"/settings",dashboard:"/"};function e8(){const{pathname:e}=pa(),n=ph(),a=gn(o=>o.openTab),r=gn(o=>o.activeTabId);S.useEffect(()=>{const o=zx[e];o&&a({id:o.id,label:o.label,closable:!0})},[e,a]),S.useEffect(()=>{const o=JI[r];if(o){o!==e&&n(o,{replace:!0});return}zx[e]&&n("/",{replace:!0})},[r,e,n])}function t8(){const e=Bn(n=>n.theme);return S.useEffect(()=>{qS(e)},[e]),m.jsx("main",{className:"v10-app",style:{alignItems:"center",justifyContent:"center",padding:24},children:m.jsxs("section",{role:"alert",style:{maxWidth:480,lineHeight:1.6},children:[m.jsx("h1",{children:"Node unavailable"}),m.jsx("p",{children:"Live node data could not be loaded. The node may be stopped, timing out or returning errors."}),m.jsx("p",{children:"Node status, balances, graphs and integration readiness are unavailable. Check the daemon, then reload to retry the connection."}),m.jsx("button",{type:"button",className:"v10-modal-btn primary",onClick:()=>window.location.reload(),children:"Retry connection"})]})})}const Ix=[1e3,2e3,4e3,8e3,15e3,3e4];function n8(e){return Ix[Math.min(e,Ix.length-1)]}function FS({reload:e=()=>window.location.reload(),probeRetryMs:n=n8}){const[a,r]=S.useState("hidden"),[o,s]=S.useState("");if(S.useEffect(()=>{if(XE())return;let d=!1,p;const f=async y=>{const g=await nA();if(d)return;if(g==="unknown"){p=setTimeout(()=>{f(y+1)},n(y));return}if(g==="accepted")return;const x=!!fb();x&&eA(),r(x?"rejected":"required")};return f(0),()=>{d=!0,p!==void 0&&clearTimeout(p)}},[]),a==="hidden")return null;const u=d=>{d.preventDefault(),o.trim()&&JE(o)&&e()};return m.jsxs("form",{className:"v10-token-prompt","aria-label":"Node API token",onSubmit:u,children:[m.jsxs("span",{className:"v10-token-prompt-text",children:[m.jsx("strong",{children:"API token required"}),a==="rejected"?" — the node did not accept that token.":" —"," The node passes its token to the dashboard only when it is opened on the node host. Paste the token from ",m.jsx("code",{children:"auth.token"})," on the node host to use this dashboard at ",m.jsx("strong",{children:window.location.host})," (kept for this tab only)."]}),m.jsx("input",{className:"v10-token-prompt-input",type:"password",autoComplete:"off",spellCheck:!1,"aria-label":"API token",value:o,onChange:d=>s(d.target.value)}),m.jsx("button",{type:"submit",className:"v10-token-prompt-submit",disabled:!o.trim(),children:"Use token"})]})}function a8(){const e=bh(n=>n.setNodeStatus);Ho(()=>{Hn.fetchStatus().then(e).catch(()=>{})},1e4)}function Px(e){const n=S.useRef(null),a=S.useRef(e);return a.current=e,S.useEffect(()=>{const r=n.current;if(!r)return;let o=0;const s=p=>{const f=p.clientX-o;o=p.clientX,a.current(f)},u=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.body.style.cursor="",document.body.style.userSelect="",r.classList.remove("active")},d=p=>{p.preventDefault(),o=p.clientX,document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.body.style.cursor="col-resize",document.body.style.userSelect="none",r.classList.add("active")};return r.addEventListener("mousedown",d),()=>r.removeEventListener("mousedown",d)},[]),n}function i8(e){const n=S.useRef(e);n.current=e;const[a,r]=S.useState(null);return S.useEffect(()=>{if(!a)return;let o=0;const s=p=>{const f=p.clientY-o;o=p.clientY,n.current(f)},u=()=>{document.removeEventListener("mousemove",s),document.removeEventListener("mouseup",u),document.body.style.cursor="",document.body.style.userSelect="",a.classList.remove("active")},d=p=>{p.preventDefault(),o=p.clientY,document.addEventListener("mousemove",s),document.addEventListener("mouseup",u),document.body.style.cursor="row-resize",document.body.style.userSelect="none",a.classList.add("active")};return a.addEventListener("mousedown",d),()=>{a.removeEventListener("mousedown",d),u()}},[a]),S.useCallback(o=>r(o),[])}function r8(){a8(),ZI(),e8();const{leftCollapsed:e,rightCollapsed:n,bottomCollapsed:a,theme:r,leftWidth:o,rightWidth:s,setLeftWidth:u,setRightWidth:d,setBottomHeight:p}=Bn(),[,f]=S.useState(0);S.useEffect(()=>{qS(r)},[r]),S.useEffect(()=>{const j=()=>f(E=>E+1);return window.addEventListener("resize",j),()=>window.removeEventListener("resize",j)},[]),S.useLayoutEffect(()=>{const j=window.requestAnimationFrame(()=>{window.dispatchEvent(new Event("resize"))});return()=>window.cancelAnimationFrame(j)},[e,n]);const y=S.useCallback(j=>{const E=Bn.getState().leftWidth;u(Math.max(140,Math.min(400,E+j)))},[u]),g=S.useCallback(j=>{const E=Bn.getState().rightWidth;d(Math.max(200,Math.min(500,E-j)))},[d]),x=S.useCallback(j=>{const E=Math.min(Bn.getState().bottomHeight,Dc());p(Math.min(E-j,Dc()))},[p]),b=Px(y),k=Px(g),C=i8(x);return m.jsxs("div",{className:"v10-app",children:[m.jsx(FS,{}),m.jsx(yR,{}),m.jsxs("div",{className:"v10-app-body",children:[!e&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"v10-panel-left",style:{width:o},children:m.jsx(c4,{})}),m.jsx("div",{className:"v10-resize-handle-h",ref:b})]}),m.jsxs("div",{className:"v10-center-region",style:{flex:1,minWidth:0,display:"flex",flexDirection:"column",overflow:"hidden"},children:[m.jsx("div",{style:{flex:1,minHeight:0,overflow:"hidden"},children:m.jsx(lL,{})}),!a&&m.jsx("div",{className:"v10-resize-handle-v",ref:C}),m.jsx(xL,{})]}),!n&&m.jsxs(m.Fragment,{children:[m.jsx("div",{className:"v10-resize-handle-h",ref:k}),m.jsx("div",{className:"v10-panel-right",style:{width:s},children:m.jsx(XI,{})})]})]})]})}const l8=mn.lazy(()=>nt(()=>import("./Network-DV9K48MH.js"),[]).then(e=>({default:e.NetworkPage})));function o8(){const e=gn(n=>n.openTab);return S.useLayoutEffect(()=>{e(u3)},[e]),m.jsx(So,{to:"/",replace:!0})}function s8(){const e=S.useSyncExternalStore(hT,_0,_0);return S.useEffect(()=>{Mb()},[]),e?m.jsx(t8,{}):m.jsxs(rE,{children:[m.jsx(Ni,{path:"/network",element:m.jsxs(m.Fragment,{children:[m.jsx(FS,{}),m.jsx(mn.Suspense,{fallback:m.jsx("div",{className:"lazy-spinner",children:"Loading..."}),children:m.jsx(l8,{})})]})}),m.jsx(Ni,{path:"/context-graph-primer",element:m.jsx(o8,{})}),m.jsx(Ni,{path:"/agent",element:m.jsx(So,{to:"/",replace:!0})}),m.jsx(Ni,{path:"/explorer",element:m.jsx(So,{to:"/",replace:!0})}),m.jsx(Ni,{path:"/messages",element:m.jsx(So,{to:"/",replace:!0})}),m.jsx(Ni,{path:"/apps/*",element:m.jsx(So,{to:"/",replace:!0})}),m.jsx(Ni,{path:"*",element:m.jsx(r8,{})})]})}function c8(){const[e,n]=S.useState(0);return S.useEffect(()=>tA(()=>n(a=>a+1)),[]),m.jsx(NE,{basename:"/ui",children:m.jsx(s8,{})},e)}oC.createRoot(document.getElementById("root")).render(m.jsx(mn.StrictMode,{children:m.jsx(c8,{})}));export{_8 as $,ew as A,C8 as B,W4 as C,T9 as D,Q8 as E,K8 as F,D9 as G,an as H,V4 as I,g9 as J,_9 as K,sw as L,A9 as M,L0 as N,jh as O,Z8 as P,Tb as Q,mn as R,E9 as S,f9 as T,$8 as U,u9 as V,MN as W,YA as X,Ah as Y,iu as Z,nt as _,Y4 as a,x9 as a$,X8 as a0,O8 as a1,XA as a2,N8 as a3,b8 as a4,JA as a5,R8 as a6,ZA as a7,A0 as a8,U8 as a9,Po as aA,v9 as aB,IT as aC,UT as aD,N3 as aE,b9 as aF,sj as aG,_4 as aH,Pb as aI,S8 as aJ,k8 as aK,BT as aL,RR as aM,t9 as aN,i9 as aO,m as aP,mj as aQ,c9 as aR,W8 as aS,w8 as aT,H8 as aU,tj as aV,v8 as aW,GA as aX,L9 as aY,g4 as aZ,Fb as a_,z8 as aa,I8 as ab,M8 as ac,D8 as ad,L8 as ae,E8 as af,WA as ag,P8 as ah,j8 as ai,Ob as aj,gj as ak,C9 as al,A3 as am,o9 as an,a1 as ao,e3 as ap,t3 as aq,IN as ar,n9 as as,O9 as at,h4 as au,R9 as av,N9 as aw,PN as ax,Qe as ay,f8 as az,u3 as b,K4 as b0,Gc as b1,Oh as b2,V8 as b3,J8 as b4,h8 as b5,x8 as b6,m8 as b7,y8 as b8,DT as b9,Jf as bA,Qb as bB,k9 as bC,Bn as bD,X4 as bE,O4 as bF,AT as bG,Fc as bH,hl as bI,Hb as bJ,$b as bK,Up as bL,ca as bM,gn as bN,s9 as bO,r9 as bP,x3 as bQ,q8 as bR,g8 as ba,_A as bb,Y8 as bc,G8 as bd,S as be,F8 as bf,rj as bg,B8 as bh,M9 as bi,i1 as bj,m9 as bk,d9 as bl,e9 as bm,l9 as bn,h3 as bo,R3 as bp,Fh as bq,YN as br,p9 as bs,h9 as bt,A8 as bu,T8 as bv,v4 as bw,bh as bx,S9 as by,Rh as bz,lN as c,sN as d,dN as e,a9 as f,ab as g,xN as h,Jb as i,XI as j,mt as k,j9 as l,w9 as m,Hn as n,Q4 as o,ij as p,$t as q,y9 as r,R4 as s,Mi as t,Qt as u,Q1 as v,$T as w,d8 as x,qt as y,p8 as z};
|