@netnodeag/kraftwerk 0.37.1 → 0.38.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/config.d.ts +3 -0
- package/dist/config.js +7 -1
- package/dist/inspector/instances.d.ts +8 -0
- package/dist/inspector/instances.js +23 -3
- package/dist/inspector/server.js +2 -0
- package/dist/inspector/settings.d.ts +2 -0
- package/dist/inspector/settings.js +8 -0
- package/inspector/dist/assets/{editor-vM6JSj5h.js → editor-CONb__vl.js} +3 -3
- package/inspector/dist/assets/{index-oIQqfbwm.js → index-6VtYKf_K.js} +1 -1
- package/inspector/dist/assets/{index-C1UXlW32.js → index-B_BJEGG5.js} +1 -1
- package/inspector/dist/assets/{index-CQ2XKqmD.js → index-BkznuDSS.js} +1 -1
- package/inspector/dist/assets/{index-BrCwDkJZ.js → index-BrGHSw5I.js} +1 -1
- package/inspector/dist/assets/{index-Bs1U0rWW.js → index-BuiRW-03.js} +1 -1
- package/inspector/dist/assets/{index-MWv5H1oP.js → index-C1tY1uK0.js} +1 -1
- package/inspector/dist/assets/{index-DfZT0IoM.js → index-CDY-uFno.js} +1 -1
- package/inspector/dist/assets/{index-CUGfxoYt.js → index-CcGsEtey.js} +1 -1
- package/inspector/dist/assets/{index-CtMGH62C.js → index-CntcQxRr.js} +1 -1
- package/inspector/dist/assets/{index-BKcOp35r.js → index-CpDzWqX0.js} +1 -1
- package/inspector/dist/assets/{index-CaKmxcD6.js → index-Cw6eNCH7.js} +1 -1
- package/inspector/dist/assets/index-D1_Glu0y.css +1 -0
- package/inspector/dist/assets/index-DMWUqEQi.js +217 -0
- package/inspector/dist/assets/{index-yGZsomcy.js → index-DfK1f9gz.js} +1 -1
- package/inspector/dist/assets/{index-D_11IZBV.js → index-IosqBxL0.js} +1 -1
- package/inspector/dist/assets/{index-CReepirH.js → index-iRFYcgNN.js} +1 -1
- package/inspector/dist/assets/{index-Bb08wK-l.js → index-p5w5E19N.js} +1 -1
- package/inspector/dist/assets/{index-BAAjszPI.js → index-rAZqRLhj.js} +1 -1
- package/inspector/dist/assets/{index-DykDNrYm.js → index-yGDq5Egm.js} +1 -1
- package/inspector/dist/index.html +2 -2
- package/package.json +1 -1
- package/inspector/dist/assets/index-Ba8VU6Wz.js +0 -217
- package/inspector/dist/assets/index-D4_mLTSH.css +0 -1
|
@@ -0,0 +1,217 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["assets/editor-CONb__vl.js","assets/editor-9rr2cQaW.css"])))=>i.map(i=>d[i]);
|
|
2
|
+
function Hx(s,c){for(var u=0;u<c.length;u++){const o=c[u];if(typeof o!="string"&&!Array.isArray(o)){for(const d in o)if(d!=="default"&&!(d in s)){const h=Object.getOwnPropertyDescriptor(o,d);h&&Object.defineProperty(s,d,h.get?h:{enumerable:!0,get:()=>o[d]})}}}return Object.freeze(Object.defineProperty(s,Symbol.toStringTag,{value:"Module"}))}(function(){const c=document.createElement("link").relList;if(c&&c.supports&&c.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))o(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const m of h.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&o(m)}).observe(document,{childList:!0,subtree:!0});function u(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function o(d){if(d.ep)return;d.ep=!0;const h=u(d);fetch(d.href,h)}})();function $x(s){return s&&s.__esModule&&Object.prototype.hasOwnProperty.call(s,"default")?s.default:s}var tu={exports:{}},di={};var xm;function Bx(){if(xm)return di;xm=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.fragment");function u(o,d,h){var m=null;if(h!==void 0&&(m=""+h),d.key!==void 0&&(m=""+d.key),"key"in d){h={};for(var g in d)g!=="key"&&(h[g]=d[g])}else h=d;return d=h.ref,{$$typeof:s,type:o,key:m,ref:d!==void 0?d:null,props:h}}return di.Fragment=c,di.jsx=u,di.jsxs=u,di}var vm;function qx(){return vm||(vm=1,tu.exports=Bx()),tu.exports}var l=qx(),au={exports:{}},xe={};var ym;function Gx(){if(ym)return xe;ym=1;var s=Symbol.for("react.transitional.element"),c=Symbol.for("react.portal"),u=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),m=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),y=Symbol.for("react.suspense"),x=Symbol.for("react.memo"),b=Symbol.for("react.lazy"),E=Symbol.for("react.activity"),N=Symbol.iterator;function L(k){return k===null||typeof k!="object"?null:(k=N&&k[N]||k["@@iterator"],typeof k=="function"?k:null)}var z={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},F=Object.assign,_={};function T(k,Z,ne){this.props=k,this.context=Z,this.refs=_,this.updater=ne||z}T.prototype.isReactComponent={},T.prototype.setState=function(k,Z){if(typeof k!="object"&&typeof k!="function"&&k!=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,k,Z,"setState")},T.prototype.forceUpdate=function(k){this.updater.enqueueForceUpdate(this,k,"forceUpdate")};function ee(){}ee.prototype=T.prototype;function le(k,Z,ne){this.props=k,this.context=Z,this.refs=_,this.updater=ne||z}var B=le.prototype=new ee;B.constructor=le,F(B,T.prototype),B.isPureReactComponent=!0;var I=Array.isArray;function A(){}var K={H:null,A:null,T:null,S:null},te=Object.prototype.hasOwnProperty;function U(k,Z,ne){var P=ne.ref;return{$$typeof:s,type:k,key:Z,ref:P!==void 0?P:null,props:ne}}function ue(k,Z){return U(k.type,Z,k.props)}function me(k){return typeof k=="object"&&k!==null&&k.$$typeof===s}function $(k){var Z={"=":"=0",":":"=2"};return"$"+k.replace(/[=:]/g,function(ne){return Z[ne]})}var ie=/\/+/g;function be(k,Z){return typeof k=="object"&&k!==null&&k.key!=null?$(""+k.key):Z.toString(36)}function Ie(k){switch(k.status){case"fulfilled":return k.value;case"rejected":throw k.reason;default:switch(typeof k.status=="string"?k.then(A,A):(k.status="pending",k.then(function(Z){k.status==="pending"&&(k.status="fulfilled",k.value=Z)},function(Z){k.status==="pending"&&(k.status="rejected",k.reason=Z)})),k.status){case"fulfilled":return k.value;case"rejected":throw k.reason}}throw k}function q(k,Z,ne,P,ge){var ve=typeof k;(ve==="undefined"||ve==="boolean")&&(k=null);var Ae=!1;if(k===null)Ae=!0;else switch(ve){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(k.$$typeof){case s:case c:Ae=!0;break;case b:return Ae=k._init,q(Ae(k._payload),Z,ne,P,ge)}}if(Ae)return ge=ge(k),Ae=P===""?"."+be(k,0):P,I(ge)?(ne="",Ae!=null&&(ne=Ae.replace(ie,"$&/")+"/"),q(ge,Z,ne,"",function(ze){return ze})):ge!=null&&(me(ge)&&(ge=ue(ge,ne+(ge.key==null||k&&k.key===ge.key?"":(""+ge.key).replace(ie,"$&/")+"/")+Ae)),Z.push(ge)),1;Ae=0;var mt=P===""?".":P+":";if(I(k))for(var X=0;X<k.length;X++)P=k[X],ve=mt+be(P,X),Ae+=q(P,Z,ne,ve,ge);else if(X=L(k),typeof X=="function")for(k=X.call(k),X=0;!(P=k.next()).done;)P=P.value,ve=mt+be(P,X++),Ae+=q(P,Z,ne,ve,ge);else if(ve==="object"){if(typeof k.then=="function")return q(Ie(k),Z,ne,P,ge);throw Z=String(k),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(k).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function ae(k,Z,ne){if(k==null)return k;var P=[],ge=0;return q(k,P,"","",function(ve){return Z.call(ne,ve,ge++)}),P}function de(k){if(k._status===-1){var Z=k._result;Z=Z(),Z.then(function(ne){(k._status===0||k._status===-1)&&(k._status=1,k._result=ne)},function(ne){(k._status===0||k._status===-1)&&(k._status=2,k._result=ne)}),k._status===-1&&(k._status=0,k._result=Z)}if(k._status===1)return k._result.default;throw k._result}var Re=typeof reportError=="function"?reportError:function(k){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Z=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof k=="object"&&k!==null&&typeof k.message=="string"?String(k.message):String(k),error:k});if(!window.dispatchEvent(Z))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",k);return}console.error(k)},Ne={map:ae,forEach:function(k,Z,ne){ae(k,function(){Z.apply(this,arguments)},ne)},count:function(k){var Z=0;return ae(k,function(){Z++}),Z},toArray:function(k){return ae(k,function(Z){return Z})||[]},only:function(k){if(!me(k))throw Error("React.Children.only expected to receive a single React element child.");return k}};return xe.Activity=E,xe.Children=Ne,xe.Component=T,xe.Fragment=u,xe.Profiler=d,xe.PureComponent=le,xe.StrictMode=o,xe.Suspense=y,xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=K,xe.__COMPILER_RUNTIME={__proto__:null,c:function(k){return K.H.useMemoCache(k)}},xe.cache=function(k){return function(){return k.apply(null,arguments)}},xe.cacheSignal=function(){return null},xe.cloneElement=function(k,Z,ne){if(k==null)throw Error("The argument must be a React element, but you passed "+k+".");var P=F({},k.props),ge=k.key;if(Z!=null)for(ve in Z.key!==void 0&&(ge=""+Z.key),Z)!te.call(Z,ve)||ve==="key"||ve==="__self"||ve==="__source"||ve==="ref"&&Z.ref===void 0||(P[ve]=Z[ve]);var ve=arguments.length-2;if(ve===1)P.children=ne;else if(1<ve){for(var Ae=Array(ve),mt=0;mt<ve;mt++)Ae[mt]=arguments[mt+2];P.children=Ae}return U(k.type,ge,P)},xe.createContext=function(k){return k={$$typeof:m,_currentValue:k,_currentValue2:k,_threadCount:0,Provider:null,Consumer:null},k.Provider=k,k.Consumer={$$typeof:h,_context:k},k},xe.createElement=function(k,Z,ne){var P,ge={},ve=null;if(Z!=null)for(P in Z.key!==void 0&&(ve=""+Z.key),Z)te.call(Z,P)&&P!=="key"&&P!=="__self"&&P!=="__source"&&(ge[P]=Z[P]);var Ae=arguments.length-2;if(Ae===1)ge.children=ne;else if(1<Ae){for(var mt=Array(Ae),X=0;X<Ae;X++)mt[X]=arguments[X+2];ge.children=mt}if(k&&k.defaultProps)for(P in Ae=k.defaultProps,Ae)ge[P]===void 0&&(ge[P]=Ae[P]);return U(k,ve,ge)},xe.createRef=function(){return{current:null}},xe.forwardRef=function(k){return{$$typeof:g,render:k}},xe.isValidElement=me,xe.lazy=function(k){return{$$typeof:b,_payload:{_status:-1,_result:k},_init:de}},xe.memo=function(k,Z){return{$$typeof:x,type:k,compare:Z===void 0?null:Z}},xe.startTransition=function(k){var Z=K.T,ne={};K.T=ne;try{var P=k(),ge=K.S;ge!==null&&ge(ne,P),typeof P=="object"&&P!==null&&typeof P.then=="function"&&P.then(A,Re)}catch(ve){Re(ve)}finally{Z!==null&&ne.types!==null&&(Z.types=ne.types),K.T=Z}},xe.unstable_useCacheRefresh=function(){return K.H.useCacheRefresh()},xe.use=function(k){return K.H.use(k)},xe.useActionState=function(k,Z,ne){return K.H.useActionState(k,Z,ne)},xe.useCallback=function(k,Z){return K.H.useCallback(k,Z)},xe.useContext=function(k){return K.H.useContext(k)},xe.useDebugValue=function(){},xe.useDeferredValue=function(k,Z){return K.H.useDeferredValue(k,Z)},xe.useEffect=function(k,Z){return K.H.useEffect(k,Z)},xe.useEffectEvent=function(k){return K.H.useEffectEvent(k)},xe.useId=function(){return K.H.useId()},xe.useImperativeHandle=function(k,Z,ne){return K.H.useImperativeHandle(k,Z,ne)},xe.useInsertionEffect=function(k,Z){return K.H.useInsertionEffect(k,Z)},xe.useLayoutEffect=function(k,Z){return K.H.useLayoutEffect(k,Z)},xe.useMemo=function(k,Z){return K.H.useMemo(k,Z)},xe.useOptimistic=function(k,Z){return K.H.useOptimistic(k,Z)},xe.useReducer=function(k,Z,ne){return K.H.useReducer(k,Z,ne)},xe.useRef=function(k){return K.H.useRef(k)},xe.useState=function(k){return K.H.useState(k)},xe.useSyncExternalStore=function(k,Z,ne){return K.H.useSyncExternalStore(k,Z,ne)},xe.useTransition=function(){return K.H.useTransition()},xe.version="19.2.8",xe}var jm;function Su(){return jm||(jm=1,au.exports=Gx()),au.exports}var w=Su();const Yx=$x(w),pb=Hx({__proto__:null,default:Yx},[w]);var nu={exports:{}},fi={},lu={exports:{}},su={};var bm;function Xx(){return bm||(bm=1,(function(s){function c(q,ae){var de=q.length;q.push(ae);e:for(;0<de;){var Re=de-1>>>1,Ne=q[Re];if(0<d(Ne,ae))q[Re]=ae,q[de]=Ne,de=Re;else break e}}function u(q){return q.length===0?null:q[0]}function o(q){if(q.length===0)return null;var ae=q[0],de=q.pop();if(de!==ae){q[0]=de;e:for(var Re=0,Ne=q.length,k=Ne>>>1;Re<k;){var Z=2*(Re+1)-1,ne=q[Z],P=Z+1,ge=q[P];if(0>d(ne,de))P<Ne&&0>d(ge,ne)?(q[Re]=ge,q[P]=de,Re=P):(q[Re]=ne,q[Z]=de,Re=Z);else if(P<Ne&&0>d(ge,de))q[Re]=ge,q[P]=de,Re=P;else break e}}return ae}function d(q,ae){var de=q.sortIndex-ae.sortIndex;return de!==0?de:q.id-ae.id}if(s.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;s.unstable_now=function(){return h.now()}}else{var m=Date,g=m.now();s.unstable_now=function(){return m.now()-g}}var y=[],x=[],b=1,E=null,N=3,L=!1,z=!1,F=!1,_=!1,T=typeof setTimeout=="function"?setTimeout:null,ee=typeof clearTimeout=="function"?clearTimeout:null,le=typeof setImmediate<"u"?setImmediate:null;function B(q){for(var ae=u(x);ae!==null;){if(ae.callback===null)o(x);else if(ae.startTime<=q)o(x),ae.sortIndex=ae.expirationTime,c(y,ae);else break;ae=u(x)}}function I(q){if(F=!1,B(q),!z)if(u(y)!==null)z=!0,A||(A=!0,$());else{var ae=u(x);ae!==null&&Ie(I,ae.startTime-q)}}var A=!1,K=-1,te=5,U=-1;function ue(){return _?!0:!(s.unstable_now()-U<te)}function me(){if(_=!1,A){var q=s.unstable_now();U=q;var ae=!0;try{e:{z=!1,F&&(F=!1,ee(K),K=-1),L=!0;var de=N;try{t:{for(B(q),E=u(y);E!==null&&!(E.expirationTime>q&&ue());){var Re=E.callback;if(typeof Re=="function"){E.callback=null,N=E.priorityLevel;var Ne=Re(E.expirationTime<=q);if(q=s.unstable_now(),typeof Ne=="function"){E.callback=Ne,B(q),ae=!0;break t}E===u(y)&&o(y),B(q)}else o(y);E=u(y)}if(E!==null)ae=!0;else{var k=u(x);k!==null&&Ie(I,k.startTime-q),ae=!1}}break e}finally{E=null,N=de,L=!1}ae=void 0}}finally{ae?$():A=!1}}}var $;if(typeof le=="function")$=function(){le(me)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,be=ie.port2;ie.port1.onmessage=me,$=function(){be.postMessage(null)}}else $=function(){T(me,0)};function Ie(q,ae){K=T(function(){q(s.unstable_now())},ae)}s.unstable_IdlePriority=5,s.unstable_ImmediatePriority=1,s.unstable_LowPriority=4,s.unstable_NormalPriority=3,s.unstable_Profiling=null,s.unstable_UserBlockingPriority=2,s.unstable_cancelCallback=function(q){q.callback=null},s.unstable_forceFrameRate=function(q){0>q||125<q?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):te=0<q?Math.floor(1e3/q):5},s.unstable_getCurrentPriorityLevel=function(){return N},s.unstable_next=function(q){switch(N){case 1:case 2:case 3:var ae=3;break;default:ae=N}var de=N;N=ae;try{return q()}finally{N=de}},s.unstable_requestPaint=function(){_=!0},s.unstable_runWithPriority=function(q,ae){switch(q){case 1:case 2:case 3:case 4:case 5:break;default:q=3}var de=N;N=q;try{return ae()}finally{N=de}},s.unstable_scheduleCallback=function(q,ae,de){var Re=s.unstable_now();switch(typeof de=="object"&&de!==null?(de=de.delay,de=typeof de=="number"&&0<de?Re+de:Re):de=Re,q){case 1:var Ne=-1;break;case 2:Ne=250;break;case 5:Ne=1073741823;break;case 4:Ne=1e4;break;default:Ne=5e3}return Ne=de+Ne,q={id:b++,callback:ae,priorityLevel:q,startTime:de,expirationTime:Ne,sortIndex:-1},de>Re?(q.sortIndex=de,c(x,q),u(y)===null&&q===u(x)&&(F?(ee(K),K=-1):F=!0,Ie(I,de-Re))):(q.sortIndex=Ne,c(y,q),z||L||(z=!0,A||(A=!0,$()))),q},s.unstable_shouldYield=ue,s.unstable_wrapCallback=function(q){var ae=N;return function(){var de=N;N=ae;try{return q.apply(this,arguments)}finally{N=de}}}})(su)),su}var Nm;function Qx(){return Nm||(Nm=1,lu.exports=Xx()),lu.exports}var iu={exports:{}},Rt={};var wm;function Zx(){if(wm)return Rt;wm=1;var s=Su();function c(y){var x="https://react.dev/errors/"+y;if(1<arguments.length){x+="?args[]="+encodeURIComponent(arguments[1]);for(var b=2;b<arguments.length;b++)x+="&args[]="+encodeURIComponent(arguments[b])}return"Minified React error #"+y+"; visit "+x+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function u(){}var o={d:{f:u,r:function(){throw Error(c(522))},D:u,C:u,L:u,m:u,X:u,S:u,M:u},p:0,findDOMNode:null},d=Symbol.for("react.portal");function h(y,x,b){var E=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:E==null?null:""+E,children:y,containerInfo:x,implementation:b}}var m=s.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(y,x){if(y==="font")return"";if(typeof x=="string")return x==="use-credentials"?x:""}return Rt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=o,Rt.createPortal=function(y,x){var b=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!x||x.nodeType!==1&&x.nodeType!==9&&x.nodeType!==11)throw Error(c(299));return h(y,x,null,b)},Rt.flushSync=function(y){var x=m.T,b=o.p;try{if(m.T=null,o.p=2,y)return y()}finally{m.T=x,o.p=b,o.d.f()}},Rt.preconnect=function(y,x){typeof y=="string"&&(x?(x=x.crossOrigin,x=typeof x=="string"?x==="use-credentials"?x:"":void 0):x=null,o.d.C(y,x))},Rt.prefetchDNS=function(y){typeof y=="string"&&o.d.D(y)},Rt.preinit=function(y,x){if(typeof y=="string"&&x&&typeof x.as=="string"){var b=x.as,E=g(b,x.crossOrigin),N=typeof x.integrity=="string"?x.integrity:void 0,L=typeof x.fetchPriority=="string"?x.fetchPriority:void 0;b==="style"?o.d.S(y,typeof x.precedence=="string"?x.precedence:void 0,{crossOrigin:E,integrity:N,fetchPriority:L}):b==="script"&&o.d.X(y,{crossOrigin:E,integrity:N,fetchPriority:L,nonce:typeof x.nonce=="string"?x.nonce:void 0})}},Rt.preinitModule=function(y,x){if(typeof y=="string")if(typeof x=="object"&&x!==null){if(x.as==null||x.as==="script"){var b=g(x.as,x.crossOrigin);o.d.M(y,{crossOrigin:b,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0})}}else x==null&&o.d.M(y)},Rt.preload=function(y,x){if(typeof y=="string"&&typeof x=="object"&&x!==null&&typeof x.as=="string"){var b=x.as,E=g(b,x.crossOrigin);o.d.L(y,b,{crossOrigin:E,integrity:typeof x.integrity=="string"?x.integrity:void 0,nonce:typeof x.nonce=="string"?x.nonce:void 0,type:typeof x.type=="string"?x.type:void 0,fetchPriority:typeof x.fetchPriority=="string"?x.fetchPriority:void 0,referrerPolicy:typeof x.referrerPolicy=="string"?x.referrerPolicy:void 0,imageSrcSet:typeof x.imageSrcSet=="string"?x.imageSrcSet:void 0,imageSizes:typeof x.imageSizes=="string"?x.imageSizes:void 0,media:typeof x.media=="string"?x.media:void 0})}},Rt.preloadModule=function(y,x){if(typeof y=="string")if(x){var b=g(x.as,x.crossOrigin);o.d.m(y,{as:typeof x.as=="string"&&x.as!=="script"?x.as:void 0,crossOrigin:b,integrity:typeof x.integrity=="string"?x.integrity:void 0})}else o.d.m(y)},Rt.requestFormReset=function(y){o.d.r(y)},Rt.unstable_batchedUpdates=function(y,x){return y(x)},Rt.useFormState=function(y,x,b){return m.H.useFormState(y,x,b)},Rt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Rt.version="19.2.8",Rt}var Sm;function Vx(){if(Sm)return iu.exports;Sm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(c){console.error(c)}}return s(),iu.exports=Zx(),iu.exports}var km;function Kx(){if(km)return fi;km=1;var s=Qx(),c=Su(),u=Vx();function o(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var a=2;a<arguments.length;a++)t+="&args[]="+encodeURIComponent(arguments[a])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){var t=e,a=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(a=t.return),e=t.return;while(e)}return t.tag===3?a:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function y(e){if(h(e)!==e)throw Error(o(188))}function x(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(o(188));return t!==e?null:e}for(var a=e,n=t;;){var i=a.return;if(i===null)break;var r=i.alternate;if(r===null){if(n=i.return,n!==null){a=n;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===a)return y(i),e;if(r===n)return y(i),t;r=r.sibling}throw Error(o(188))}if(a.return!==n.return)a=i,n=r;else{for(var f=!1,p=i.child;p;){if(p===a){f=!0,a=i,n=r;break}if(p===n){f=!0,n=i,a=r;break}p=p.sibling}if(!f){for(p=r.child;p;){if(p===a){f=!0,a=r,n=i;break}if(p===n){f=!0,n=r,a=i;break}p=p.sibling}if(!f)throw Error(o(189))}}if(a.alternate!==n)throw Error(o(190))}if(a.tag!==3)throw Error(o(188));return a.stateNode.current===a?e:t}function b(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=b(e),t!==null)return t;e=e.sibling}return null}var E=Object.assign,N=Symbol.for("react.element"),L=Symbol.for("react.transitional.element"),z=Symbol.for("react.portal"),F=Symbol.for("react.fragment"),_=Symbol.for("react.strict_mode"),T=Symbol.for("react.profiler"),ee=Symbol.for("react.consumer"),le=Symbol.for("react.context"),B=Symbol.for("react.forward_ref"),I=Symbol.for("react.suspense"),A=Symbol.for("react.suspense_list"),K=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),U=Symbol.for("react.activity"),ue=Symbol.for("react.memo_cache_sentinel"),me=Symbol.iterator;function $(e){return e===null||typeof e!="object"?null:(e=me&&e[me]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function be(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case F:return"Fragment";case T:return"Profiler";case _:return"StrictMode";case I:return"Suspense";case A:return"SuspenseList";case U:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case z:return"Portal";case le:return e.displayName||"Context";case ee:return(e._context.displayName||"Context")+".Consumer";case B:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case K:return t=e.displayName||null,t!==null?t:be(e.type)||"Memo";case te:t=e._payload,e=e._init;try{return be(e(t))}catch{}}return null}var Ie=Array.isArray,q=c.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ae=u.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,de={pending:!1,data:null,method:null,action:null},Re=[],Ne=-1;function k(e){return{current:e}}function Z(e){0>Ne||(e.current=Re[Ne],Re[Ne]=null,Ne--)}function ne(e,t){Ne++,Re[Ne]=e.current,e.current=t}var P=k(null),ge=k(null),ve=k(null),Ae=k(null);function mt(e,t){switch(ne(ve,t),ne(ge,e),ne(P,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Bh(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Bh(t),e=qh(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}Z(P),ne(P,e)}function X(){Z(P),Z(ge),Z(ve)}function ze(e){e.memoizedState!==null&&ne(Ae,e);var t=P.current,a=qh(t,e.type);t!==a&&(ne(ge,e),ne(P,a))}function Ye(e){ge.current===e&&(Z(P),Z(ge)),Ae.current===e&&(Z(Ae),ci._currentValue=de)}var Pe,aa;function De(e){if(Pe===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);Pe=t&&t[1]||"",aa=-1<a.stack.indexOf(`
|
|
3
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
4
|
+
`+Pe+e+aa}var Xn=!1;function Xe(e,t){if(!e||Xn)return"";Xn=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var n={DetermineComponentFrameRoot:function(){try{if(t){var V=function(){throw Error()};if(Object.defineProperty(V.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(V,[])}catch(H){var M=H}Reflect.construct(e,[],V)}else{try{V.call()}catch(H){M=H}e.call(V.prototype)}}else{try{throw Error()}catch(H){M=H}(V=e())&&typeof V.catch=="function"&&V.catch(function(){})}}catch(H){if(H&&M&&typeof H.stack=="string")return[H.stack,M.stack]}return[null,null]}};n.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(n.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(n.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=n.DetermineComponentFrameRoot(),f=r[0],p=r[1];if(f&&p){var j=f.split(`
|
|
5
|
+
`),D=p.split(`
|
|
6
|
+
`);for(i=n=0;n<j.length&&!j[n].includes("DetermineComponentFrameRoot");)n++;for(;i<D.length&&!D[i].includes("DetermineComponentFrameRoot");)i++;if(n===j.length||i===D.length)for(n=j.length-1,i=D.length-1;1<=n&&0<=i&&j[n]!==D[i];)i--;for(;1<=n&&0<=i;n--,i--)if(j[n]!==D[i]){if(n!==1||i!==1)do if(n--,i--,0>i||j[n]!==D[i]){var G=`
|
|
7
|
+
`+j[n].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=n&&0<=i);break}}}finally{Xn=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?De(a):""}function ds(e,t){switch(e.tag){case 26:case 27:case 5:return De(e.type);case 16:return De("Lazy");case 13:return e.child!==t&&t!==null?De("Suspense Fallback"):De("Suspense");case 19:return De("SuspenseList");case 0:case 15:return Xe(e.type,!1);case 11:return Xe(e.type.render,!1);case 1:return Xe(e.type,!0);case 31:return De("Activity");default:return""}}function Yt(e){try{var t="",a=null;do t+=ds(e,a),a=e,e=e.return;while(e);return t}catch(n){return`
|
|
8
|
+
Error generating stack: `+n.message+`
|
|
9
|
+
`+n.stack}}var Ba=Object.prototype.hasOwnProperty,jl=s.unstable_scheduleCallback,na=s.unstable_cancelCallback,ki=s.unstable_shouldYield,fs=s.unstable_requestPaint,At=s.unstable_now,Ti=s.unstable_getCurrentPriorityLevel,xa=s.unstable_ImmediatePriority,Aa=s.unstable_UserBlockingPriority,la=s.unstable_NormalPriority,hs=s.unstable_LowPriority,Qn=s.unstable_IdlePriority,bl=s.log,ms=s.unstable_setDisableYieldValue,sa=null,yt=null;function Xt(e){if(typeof bl=="function"&&ms(e),yt&&typeof yt.setStrictMode=="function")try{yt.setStrictMode(sa,e)}catch{}}var Ct=Math.clz32?Math.clz32:ps,Ei=Math.log,_i=Math.LN2;function ps(e){return e>>>=0,e===0?32:31-(Ei(e)/_i|0)|0}var un=256,va=262144,ya=4194304;function Ca(e){var t=e&42;if(t!==0)return t;switch(e&-e){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 e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Zn(e,t,a){var n=e.pendingLanes;if(n===0)return 0;var i=0,r=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var p=n&134217727;return p!==0?(n=p&~r,n!==0?i=Ca(n):(f&=p,f!==0?i=Ca(f):a||(a=p&~e,a!==0&&(i=Ca(a))))):(p=n&~r,p!==0?i=Ca(p):f!==0?i=Ca(f):a||(a=n&~e,a!==0&&(i=Ca(a)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,a=t&-t,r>=a||r===32&&(a&4194048)!==0)?t:i}function dn(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Ai(e,t){switch(e){case 1:case 2:case 4:case 8:case 64:return t+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 t+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 gs(){var e=ya;return ya<<=1,(ya&62914560)===0&&(ya=4194304),e}function fn(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function Ra(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function ia(e,t,a,n,i,r){var f=e.pendingLanes;e.pendingLanes=a,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=a,e.entangledLanes&=a,e.errorRecoveryDisabledLanes&=a,e.shellSuspendCounter=0;var p=e.entanglements,j=e.expirationTimes,D=e.hiddenUpdates;for(a=f&~a;0<a;){var G=31-Ct(a),V=1<<G;p[G]=0,j[G]=-1;var M=D[G];if(M!==null)for(D[G]=null,G=0;G<M.length;G++){var H=M[G];H!==null&&(H.lane&=-536870913)}a&=~V}n!==0&&qa(e,n,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(f&~t))}function qa(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var n=31-Ct(t);e.entangledLanes|=t,e.entanglements[n]=e.entanglements[n]|1073741824|a&261930}function Nl(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var n=31-Ct(a),i=1<<n;i&t|e[n]&t&&(e[n]|=t),a&=~i}}function wl(e,t){var a=t&-t;return a=(a&42)!==0?1:xs(a),(a&(e.suspendedLanes|t))!==0?0:a}function xs(e){switch(e){case 2:e=1;break;case 8:e=4;break;case 32:e=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:e=128;break;case 268435456:e=134217728;break;default:e=0}return e}function Sl(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function kl(){var e=ae.p;return e!==0?e:(e=window.event,e===void 0?32:um(e.type))}function vs(e,t){var a=ae.p;try{return ae.p=e,t()}finally{ae.p=a}}var ca=Math.random().toString(36).slice(2),pt="__reactFiber$"+ca,it="__reactProps$"+ca,hn="__reactContainer$"+ca,ys="__reactEvents$"+ca,tt="__reactListeners$"+ca,mn="__reactHandles$"+ca,Ci="__reactResources$"+ca,pn="__reactMarker$"+ca;function Vn(e){delete e[pt],delete e[it],delete e[ys],delete e[tt],delete e[mn]}function Ga(e){var t=e[pt];if(t)return t;for(var a=e.parentNode;a;){if(t=a[hn]||a[pt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Kh(e);e!==null;){if(a=e[pt])return a;e=Kh(e)}return t}e=a,a=e.parentNode}return null}function Ya(e){if(e=e[pt]||e[hn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Kn(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(o(33))}function gn(e){var t=e[Ci];return t||(t=e[Ci]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function ct(e){e[pn]=!0}var Ri=new Set,ja={};function za(e,t){ba(e,t),ba(e+"Capture",t)}function ba(e,t){for(ja[e]=t,e=0;e<t.length;e++)Ri.add(t[e])}var Xa=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]*$"),zi={},Jn={};function Oi(e){return Ba.call(Jn,e)?!0:Ba.call(zi,e)?!1:Xa.test(e)?Jn[e]=!0:(zi[e]=!0,!1)}function Tl(e,t,a){if(Oi(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var n=t.toLowerCase().slice(0,5);if(n!=="data-"&&n!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,""+a)}}function In(e,t,a){if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+a)}}function ra(e,t,a,n){if(n===null)e.removeAttribute(a);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,""+n)}}function Nt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function El(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function _l(e,t,a){var n=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof n<"u"&&typeof n.get=="function"&&typeof n.set=="function"){var i=n.get,r=n.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(f){a=""+f,r.call(this,f)}}),Object.defineProperty(e,t,{enumerable:n.enumerable}),{getValue:function(){return a},setValue:function(f){a=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Oa(e){if(!e._valueTracker){var t=El(e)?"checked":"value";e._valueTracker=_l(e,t,""+e[t])}}function xn(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),n="";return e&&(n=El(e)?e.checked?"true":"false":e.value),e=n,e!==a?(t.setValue(e),!0):!1}function Dt(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var Pc=/[\n"\\]/g;function wt(e){return e.replace(Pc,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function js(e,t,a,n,i,r,f,p){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Nt(t)):e.value!==""+Nt(t)&&(e.value=""+Nt(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?Al(e,f,Nt(t)):a!=null?Al(e,f,Nt(a)):n!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),p!=null&&typeof p!="function"&&typeof p!="symbol"&&typeof p!="boolean"?e.name=""+Nt(p):e.removeAttribute("name")}function bs(e,t,a,n,i,r,f,p){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||a!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){Oa(e);return}a=a!=null?""+Nt(a):"",t=t!=null?""+Nt(t):a,p||t===e.value||(e.value=t),e.defaultValue=t}n=n??i,n=typeof n!="function"&&typeof n!="symbol"&&!!n,e.checked=p?e.checked:!!n,e.defaultChecked=!!n,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),Oa(e)}function Al(e,t,a){t==="number"&&Dt(e.ownerDocument)===e||e.defaultValue===""+a||(e.defaultValue=""+a)}function Qa(e,t,a,n){if(e=e.options,t){t={};for(var i=0;i<a.length;i++)t["$"+a[i]]=!0;for(a=0;a<e.length;a++)i=t.hasOwnProperty("$"+e[a].value),e[a].selected!==i&&(e[a].selected=i),i&&n&&(e[a].defaultSelected=!0)}else{for(a=""+Nt(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,n&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Ns(e,t,a){if(t!=null&&(t=""+Nt(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+Nt(a):""}function Di(e,t,a,n){if(t==null){if(n!=null){if(a!=null)throw Error(o(92));if(Ie(n)){if(1<n.length)throw Error(o(93));n=n[0]}a=n}a==null&&(a=""),t=a}a=Nt(t),e.defaultValue=a,n=e.textContent,n===a&&n!==""&&n!==null&&(e.value=n),Oa(e)}function Za(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var er=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 Mi(e,t,a){var n=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?n?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":n?e.setProperty(t,a):typeof a!="number"||a===0||er.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function ws(e,t,a){if(t!=null&&typeof t!="object")throw Error(o(62));if(e=e.style,a!=null){for(var n in a)!a.hasOwnProperty(n)||t!=null&&t.hasOwnProperty(n)||(n.indexOf("--")===0?e.setProperty(n,""):n==="float"?e.cssFloat="":e[n]="");for(var i in t)n=t[i],t.hasOwnProperty(i)&&a[i]!==n&&Mi(e,i,n)}else for(var r in t)t.hasOwnProperty(r)&&Mi(e,r,t[r])}function vn(e){if(e.indexOf("-")===-1)return!1;switch(e){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 Ss=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"]]),W=/^[\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 v(e){return W.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function C(){}var J=null;function se(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var ce=null,he=null;function Be(e){var t=Ya(e);if(t&&(e=t.stateNode)){var a=e[it]||null;e:switch(e=t.stateNode,t.type){case"input":if(js(e,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name),t=a.name,a.type==="radio"&&t!=null){for(a=e;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll('input[name="'+wt(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var n=a[t];if(n!==e&&n.form===e.form){var i=n[it]||null;if(!i)throw Error(o(90));js(n,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)n=a[t],n.form===e.form&&xn(n)}break e;case"textarea":Ns(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&Qa(e,!!a.multiple,t,!1)}}}var Ke=!1;function St(e,t,a){if(Ke)return e(t,a);Ke=!0;try{var n=e(t);return n}finally{if(Ke=!1,(ce!==null||he!==null)&&(Nc(),ce&&(t=ce,e=he,he=ce=null,Be(t),e)))for(t=0;t<e.length;t++)Be(e[t])}}function rt(e,t){var a=e.stateNode;if(a===null)return null;var n=a[it]||null;if(n===null)return null;a=n[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(n=!n.disabled)||(e=e.type,n=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!n;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(o(231,t,typeof a));return a}var Qt=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),gt=!1;if(Qt)try{var ks={};Object.defineProperty(ks,"passive",{get:function(){gt=!0}}),window.addEventListener("test",ks,ks),window.removeEventListener("test",ks,ks)}catch{gt=!1}var yn=null,tr=null,Ui=null;function Bu(){if(Ui)return Ui;var e,t=tr,a=t.length,n,i="value"in yn?yn.value:yn.textContent,r=i.length;for(e=0;e<a&&t[e]===i[e];e++);var f=a-e;for(n=1;n<=f&&t[a-n]===i[r-n];n++);return Ui=i.slice(e,1<n?1-n:void 0)}function Li(e){var t=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&t===13&&(e=13)):e=t,e===10&&(e=13),32<=e||e===13?e:0}function Hi(){return!0}function qu(){return!1}function Ut(e){function t(a,n,i,r,f){this._reactName=a,this._targetInst=i,this.type=n,this.nativeEvent=r,this.target=f,this.currentTarget=null;for(var p in e)e.hasOwnProperty(p)&&(a=e[p],this[p]=a?a(r):r[p]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?Hi:qu,this.isPropagationStopped=qu,this}return E(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Hi)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Hi)},persist:function(){},isPersistent:Hi}),t}var Fn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},$i=Ut(Fn),Ts=E({},Fn,{view:0,detail:0}),Up=Ut(Ts),ar,nr,Es,Bi=E({},Ts,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:sr,button:0,buttons:0,relatedTarget:function(e){return e.relatedTarget===void 0?e.fromElement===e.srcElement?e.toElement:e.fromElement:e.relatedTarget},movementX:function(e){return"movementX"in e?e.movementX:(e!==Es&&(Es&&e.type==="mousemove"?(ar=e.screenX-Es.screenX,nr=e.screenY-Es.screenY):nr=ar=0,Es=e),ar)},movementY:function(e){return"movementY"in e?e.movementY:nr}}),Gu=Ut(Bi),Lp=E({},Bi,{dataTransfer:0}),Hp=Ut(Lp),$p=E({},Ts,{relatedTarget:0}),lr=Ut($p),Bp=E({},Fn,{animationName:0,elapsedTime:0,pseudoElement:0}),qp=Ut(Bp),Gp=E({},Fn,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Yp=Ut(Gp),Xp=E({},Fn,{data:0}),Yu=Ut(Xp),Qp={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zp={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"},Vp={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Kp(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Vp[e])?!!t[e]:!1}function sr(){return Kp}var Jp=E({},Ts,{key:function(e){if(e.key){var t=Qp[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=Li(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Zp[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:sr,charCode:function(e){return e.type==="keypress"?Li(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Li(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ip=Ut(Jp),Fp=E({},Bi,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Xu=Ut(Fp),Wp=E({},Ts,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:sr}),Pp=Ut(Wp),eg=E({},Fn,{propertyName:0,elapsedTime:0,pseudoElement:0}),tg=Ut(eg),ag=E({},Bi,{deltaX:function(e){return"deltaX"in e?e.deltaX:"wheelDeltaX"in e?-e.wheelDeltaX:0},deltaY:function(e){return"deltaY"in e?e.deltaY:"wheelDeltaY"in e?-e.wheelDeltaY:"wheelDelta"in e?-e.wheelDelta:0},deltaZ:0,deltaMode:0}),ng=Ut(ag),lg=E({},Fn,{newState:0,oldState:0}),sg=Ut(lg),ig=[9,13,27,32],ir=Qt&&"CompositionEvent"in window,_s=null;Qt&&"documentMode"in document&&(_s=document.documentMode);var cg=Qt&&"TextEvent"in window&&!_s,Qu=Qt&&(!ir||_s&&8<_s&&11>=_s),Zu=" ",Vu=!1;function Ku(e,t){switch(e){case"keyup":return ig.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Ju(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Cl=!1;function rg(e,t){switch(e){case"compositionend":return Ju(t);case"keypress":return t.which!==32?null:(Vu=!0,Zu);case"textInput":return e=t.data,e===Zu&&Vu?null:e;default:return null}}function og(e,t){if(Cl)return e==="compositionend"||!ir&&Ku(e,t)?(e=Bu(),Ui=tr=yn=null,Cl=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(t.ctrlKey||t.altKey||t.metaKey)||t.ctrlKey&&t.altKey){if(t.char&&1<t.char.length)return t.char;if(t.which)return String.fromCharCode(t.which)}return null;case"compositionend":return Qu&&t.locale!=="ko"?null:t.data;default:return null}}var ug={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 Iu(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!ug[e.type]:t==="textarea"}function Fu(e,t,a,n){ce?he?he.push(n):he=[n]:ce=n,t=Ac(t,"onChange"),0<t.length&&(a=new $i("onChange","change",null,a,n),e.push({event:a,listeners:t}))}var As=null,Cs=null;function dg(e){Dh(e,0)}function qi(e){var t=Kn(e);if(xn(t))return e}function Wu(e,t){if(e==="change")return t}var Pu=!1;if(Qt){var cr;if(Qt){var rr="oninput"in document;if(!rr){var ed=document.createElement("div");ed.setAttribute("oninput","return;"),rr=typeof ed.oninput=="function"}cr=rr}else cr=!1;Pu=cr&&(!document.documentMode||9<document.documentMode)}function td(){As&&(As.detachEvent("onpropertychange",ad),Cs=As=null)}function ad(e){if(e.propertyName==="value"&&qi(Cs)){var t=[];Fu(t,Cs,e,se(e)),St(dg,t)}}function fg(e,t,a){e==="focusin"?(td(),As=t,Cs=a,As.attachEvent("onpropertychange",ad)):e==="focusout"&&td()}function hg(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return qi(Cs)}function mg(e,t){if(e==="click")return qi(t)}function pg(e,t){if(e==="input"||e==="change")return qi(t)}function gg(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var Zt=typeof Object.is=="function"?Object.is:gg;function Rs(e,t){if(Zt(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),n=Object.keys(t);if(a.length!==n.length)return!1;for(n=0;n<a.length;n++){var i=a[n];if(!Ba.call(t,i)||!Zt(e[i],t[i]))return!1}return!0}function nd(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function ld(e,t){var a=nd(e);e=0;for(var n;a;){if(a.nodeType===3){if(n=e+a.textContent.length,e<=t&&n>=t)return{node:a,offset:t-e};e=n}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=nd(a)}}function sd(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?sd(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function id(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Dt(e.document);t instanceof e.HTMLIFrameElement;){try{var a=typeof t.contentWindow.location.href=="string"}catch{a=!1}if(a)e=t.contentWindow;else break;t=Dt(e.document)}return t}function or(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t&&(t==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||t==="textarea"||e.contentEditable==="true")}var xg=Qt&&"documentMode"in document&&11>=document.documentMode,Rl=null,ur=null,zs=null,dr=!1;function cd(e,t,a){var n=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;dr||Rl==null||Rl!==Dt(n)||(n=Rl,"selectionStart"in n&&or(n)?n={start:n.selectionStart,end:n.selectionEnd}:(n=(n.ownerDocument&&n.ownerDocument.defaultView||window).getSelection(),n={anchorNode:n.anchorNode,anchorOffset:n.anchorOffset,focusNode:n.focusNode,focusOffset:n.focusOffset}),zs&&Rs(zs,n)||(zs=n,n=Ac(ur,"onSelect"),0<n.length&&(t=new $i("onSelect","select",null,t,a),e.push({event:t,listeners:n}),t.target=Rl)))}function Wn(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var zl={animationend:Wn("Animation","AnimationEnd"),animationiteration:Wn("Animation","AnimationIteration"),animationstart:Wn("Animation","AnimationStart"),transitionrun:Wn("Transition","TransitionRun"),transitionstart:Wn("Transition","TransitionStart"),transitioncancel:Wn("Transition","TransitionCancel"),transitionend:Wn("Transition","TransitionEnd")},fr={},rd={};Qt&&(rd=document.createElement("div").style,"AnimationEvent"in window||(delete zl.animationend.animation,delete zl.animationiteration.animation,delete zl.animationstart.animation),"TransitionEvent"in window||delete zl.transitionend.transition);function Pn(e){if(fr[e])return fr[e];if(!zl[e])return e;var t=zl[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in rd)return fr[e]=t[a];return e}var od=Pn("animationend"),ud=Pn("animationiteration"),dd=Pn("animationstart"),vg=Pn("transitionrun"),yg=Pn("transitionstart"),jg=Pn("transitioncancel"),fd=Pn("transitionend"),hd=new Map,hr="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(" ");hr.push("scrollEnd");function Na(e,t){hd.set(e,t),za(t,[e])}var Gi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},oa=[],Ol=0,mr=0;function Yi(){for(var e=Ol,t=mr=Ol=0;t<e;){var a=oa[t];oa[t++]=null;var n=oa[t];oa[t++]=null;var i=oa[t];oa[t++]=null;var r=oa[t];if(oa[t++]=null,n!==null&&i!==null){var f=n.pending;f===null?i.next=i:(i.next=f.next,f.next=i),n.pending=i}r!==0&&md(a,i,r)}}function Xi(e,t,a,n){oa[Ol++]=e,oa[Ol++]=t,oa[Ol++]=a,oa[Ol++]=n,mr|=n,e.lanes|=n,e=e.alternate,e!==null&&(e.lanes|=n)}function pr(e,t,a,n){return Xi(e,t,a,n),Qi(e)}function el(e,t){return Xi(e,null,null,t),Qi(e)}function md(e,t,a){e.lanes|=a;var n=e.alternate;n!==null&&(n.lanes|=a);for(var i=!1,r=e.return;r!==null;)r.childLanes|=a,n=r.alternate,n!==null&&(n.childLanes|=a),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-Ct(a),e=r.hiddenUpdates,n=e[i],n===null?e[i]=[t]:n.push(t),t.lane=a|536870912),r):null}function Qi(e){if(50<ei)throw ei=0,ko=null,Error(o(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Dl={};function bg(e,t,a,n){this.tag=e,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=t,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=n,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Vt(e,t,a,n){return new bg(e,t,a,n)}function gr(e){return e=e.prototype,!(!e||!e.isReactComponent)}function Va(e,t){var a=e.alternate;return a===null?(a=Vt(e.tag,t,e.key,e.mode),a.elementType=e.elementType,a.type=e.type,a.stateNode=e.stateNode,a.alternate=e,e.alternate=a):(a.pendingProps=t,a.type=e.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=e.flags&65011712,a.childLanes=e.childLanes,a.lanes=e.lanes,a.child=e.child,a.memoizedProps=e.memoizedProps,a.memoizedState=e.memoizedState,a.updateQueue=e.updateQueue,t=e.dependencies,a.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},a.sibling=e.sibling,a.index=e.index,a.ref=e.ref,a.refCleanup=e.refCleanup,a}function pd(e,t){e.flags&=65011714;var a=e.alternate;return a===null?(e.childLanes=0,e.lanes=t,e.child=null,e.subtreeFlags=0,e.memoizedProps=null,e.memoizedState=null,e.updateQueue=null,e.dependencies=null,e.stateNode=null):(e.childLanes=a.childLanes,e.lanes=a.lanes,e.child=a.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=a.memoizedProps,e.memoizedState=a.memoizedState,e.updateQueue=a.updateQueue,e.type=a.type,t=a.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function Zi(e,t,a,n,i,r){var f=0;if(n=e,typeof e=="function")gr(e)&&(f=1);else if(typeof e=="string")f=Tx(e,a,P.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case U:return e=Vt(31,a,t,i),e.elementType=U,e.lanes=r,e;case F:return tl(a.children,i,r,t);case _:f=8,i|=24;break;case T:return e=Vt(12,a,t,i|2),e.elementType=T,e.lanes=r,e;case I:return e=Vt(13,a,t,i),e.elementType=I,e.lanes=r,e;case A:return e=Vt(19,a,t,i),e.elementType=A,e.lanes=r,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case le:f=10;break e;case ee:f=9;break e;case B:f=11;break e;case K:f=14;break e;case te:f=16,n=null;break e}f=29,a=Error(o(130,e===null?"null":typeof e,"")),n=null}return t=Vt(f,a,t,i),t.elementType=e,t.type=n,t.lanes=r,t}function tl(e,t,a,n){return e=Vt(7,e,n,t),e.lanes=a,e}function xr(e,t,a){return e=Vt(6,e,null,t),e.lanes=a,e}function gd(e){var t=Vt(18,null,null,0);return t.stateNode=e,t}function vr(e,t,a){return t=Vt(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var xd=new WeakMap;function ua(e,t){if(typeof e=="object"&&e!==null){var a=xd.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Yt(t)},xd.set(e,t),t)}return{value:e,source:t,stack:Yt(t)}}var Ml=[],Ul=0,Vi=null,Os=0,da=[],fa=0,jn=null,Da=1,Ma="";function Ka(e,t){Ml[Ul++]=Os,Ml[Ul++]=Vi,Vi=e,Os=t}function vd(e,t,a){da[fa++]=Da,da[fa++]=Ma,da[fa++]=jn,jn=e;var n=Da;e=Ma;var i=32-Ct(n)-1;n&=~(1<<i),a+=1;var r=32-Ct(t)+i;if(30<r){var f=i-i%5;r=(n&(1<<f)-1).toString(32),n>>=f,i-=f,Da=1<<32-Ct(t)+i|a<<i|n,Ma=r+e}else Da=1<<r|a<<i|n,Ma=e}function yr(e){e.return!==null&&(Ka(e,1),vd(e,1,0))}function jr(e){for(;e===Vi;)Vi=Ml[--Ul],Ml[Ul]=null,Os=Ml[--Ul],Ml[Ul]=null;for(;e===jn;)jn=da[--fa],da[fa]=null,Ma=da[--fa],da[fa]=null,Da=da[--fa],da[fa]=null}function yd(e,t){da[fa++]=Da,da[fa++]=Ma,da[fa++]=jn,Da=t.id,Ma=t.overflow,jn=e}var kt=null,Fe=null,Ce=!1,bn=null,ha=!1,br=Error(o(519));function Nn(e){var t=Error(o(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Ds(ua(t,e)),br}function jd(e){var t=e.stateNode,a=e.type,n=e.memoizedProps;switch(t[pt]=e,t[it]=n,a){case"dialog":Se("cancel",t),Se("close",t);break;case"iframe":case"object":case"embed":Se("load",t);break;case"video":case"audio":for(a=0;a<ai.length;a++)Se(ai[a],t);break;case"source":Se("error",t);break;case"img":case"image":case"link":Se("error",t),Se("load",t);break;case"details":Se("toggle",t);break;case"input":Se("invalid",t),bs(t,n.value,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name,!0);break;case"select":Se("invalid",t);break;case"textarea":Se("invalid",t),Di(t,n.value,n.defaultValue,n.children)}a=n.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||n.suppressHydrationWarning===!0||Hh(t.textContent,a)?(n.popover!=null&&(Se("beforetoggle",t),Se("toggle",t)),n.onScroll!=null&&Se("scroll",t),n.onScrollEnd!=null&&Se("scrollend",t),n.onClick!=null&&(t.onclick=C),t=!0):t=!1,t||Nn(e,!0)}function bd(e){for(kt=e.return;kt;)switch(kt.tag){case 5:case 31:case 13:ha=!1;return;case 27:case 3:ha=!0;return;default:kt=kt.return}}function Ll(e){if(e!==kt)return!1;if(!Ce)return bd(e),Ce=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Bo(e.type,e.memoizedProps)),a=!a),a&&Fe&&Nn(e),bd(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Fe=Vh(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(317));Fe=Vh(e)}else t===27?(t=Fe,Un(e.type)?(e=Qo,Qo=null,Fe=e):Fe=t):Fe=kt?pa(e.stateNode.nextSibling):null;return!0}function al(){Fe=kt=null,Ce=!1}function Nr(){var e=bn;return e!==null&&(Bt===null?Bt=e:Bt.push.apply(Bt,e),bn=null),e}function Ds(e){bn===null?bn=[e]:bn.push(e)}var wr=k(null),nl=null,Ja=null;function wn(e,t,a){ne(wr,t._currentValue),t._currentValue=a}function Ia(e){e._currentValue=wr.current,Z(wr)}function Sr(e,t,a){for(;e!==null;){var n=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,n!==null&&(n.childLanes|=t)):n!==null&&(n.childLanes&t)!==t&&(n.childLanes|=t),e===a)break;e=e.return}}function kr(e,t,a,n){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var f=i.child;r=r.firstContext;e:for(;r!==null;){var p=r;r=i;for(var j=0;j<t.length;j++)if(p.context===t[j]){r.lanes|=a,p=r.alternate,p!==null&&(p.lanes|=a),Sr(r.return,a,e),n||(f=null);break e}r=p.next}}else if(i.tag===18){if(f=i.return,f===null)throw Error(o(341));f.lanes|=a,r=f.alternate,r!==null&&(r.lanes|=a),Sr(f,a,e),f=null}else f=i.child;if(f!==null)f.return=i;else for(f=i;f!==null;){if(f===e){f=null;break}if(i=f.sibling,i!==null){i.return=f.return,f=i;break}f=f.return}i=f}}function Hl(e,t,a,n){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var f=i.alternate;if(f===null)throw Error(o(387));if(f=f.memoizedProps,f!==null){var p=i.type;Zt(i.pendingProps.value,f.value)||(e!==null?e.push(p):e=[p])}}else if(i===Ae.current){if(f=i.alternate,f===null)throw Error(o(387));f.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(ci):e=[ci])}i=i.return}e!==null&&kr(t,e,a,n),t.flags|=262144}function Ki(e){for(e=e.firstContext;e!==null;){if(!Zt(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ll(e){nl=e,Ja=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Tt(e){return Nd(nl,e)}function Ji(e,t){return nl===null&&ll(e),Nd(e,t)}function Nd(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},Ja===null){if(e===null)throw Error(o(308));Ja=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Ja=Ja.next=t;return a}var Ng=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},wg=s.unstable_scheduleCallback,Sg=s.unstable_NormalPriority,ot={$$typeof:le,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Tr(){return{controller:new Ng,data:new Map,refCount:0}}function Ms(e){e.refCount--,e.refCount===0&&wg(Sg,function(){e.controller.abort()})}var Us=null,Er=0,$l=0,Bl=null;function kg(e,t){if(Us===null){var a=Us=[];Er=0,$l=Ro(),Bl={status:"pending",value:void 0,then:function(n){a.push(n)}}}return Er++,t.then(wd,wd),t}function wd(){if(--Er===0&&Us!==null){Bl!==null&&(Bl.status="fulfilled");var e=Us;Us=null,$l=0,Bl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Tg(e,t){var a=[],n={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){n.status="fulfilled",n.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(n.status="rejected",n.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),n}var Sd=q.S;q.S=function(e,t){rh=At(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&kg(e,t),Sd!==null&&Sd(e,t)};var sl=k(null);function _r(){var e=sl.current;return e!==null?e:Je.pooledCache}function Ii(e,t){t===null?ne(sl,sl.current):ne(sl,t.pool)}function kd(){var e=_r();return e===null?null:{parent:ot._currentValue,pool:e}}var ql=Error(o(460)),Ar=Error(o(474)),Fi=Error(o(542)),Wi={then:function(){}};function Td(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Ed(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(C,C),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ad(e),e;default:if(typeof t.status=="string")t.then(C,C);else{if(e=Je,e!==null&&100<e.shellSuspendCounter)throw Error(o(482));e=t,e.status="pending",e.then(function(n){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=n}},function(n){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=n}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Ad(e),e}throw cl=t,ql}}function il(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(cl=a,ql):a}}var cl=null;function _d(){if(cl===null)throw Error(o(459));var e=cl;return cl=null,e}function Ad(e){if(e===ql||e===Fi)throw Error(o(483))}var Gl=null,Ls=0;function Pi(e){var t=Ls;return Ls+=1,Gl===null&&(Gl=[]),Ed(Gl,e,t)}function Hs(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function ec(e,t){throw t.$$typeof===N?Error(o(525)):(e=Object.prototype.toString.call(t),Error(o(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Cd(e){function t(R,S){if(e){var O=R.deletions;O===null?(R.deletions=[S],R.flags|=16):O.push(S)}}function a(R,S){if(!e)return null;for(;S!==null;)t(R,S),S=S.sibling;return null}function n(R){for(var S=new Map;R!==null;)R.key!==null?S.set(R.key,R):S.set(R.index,R),R=R.sibling;return S}function i(R,S){return R=Va(R,S),R.index=0,R.sibling=null,R}function r(R,S,O){return R.index=O,e?(O=R.alternate,O!==null?(O=O.index,O<S?(R.flags|=67108866,S):O):(R.flags|=67108866,S)):(R.flags|=1048576,S)}function f(R){return e&&R.alternate===null&&(R.flags|=67108866),R}function p(R,S,O,Y){return S===null||S.tag!==6?(S=xr(O,R.mode,Y),S.return=R,S):(S=i(S,O),S.return=R,S)}function j(R,S,O,Y){var fe=O.type;return fe===F?G(R,S,O.props.children,Y,O.key):S!==null&&(S.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===te&&il(fe)===S.type)?(S=i(S,O.props),Hs(S,O),S.return=R,S):(S=Zi(O.type,O.key,O.props,null,R.mode,Y),Hs(S,O),S.return=R,S)}function D(R,S,O,Y){return S===null||S.tag!==4||S.stateNode.containerInfo!==O.containerInfo||S.stateNode.implementation!==O.implementation?(S=vr(O,R.mode,Y),S.return=R,S):(S=i(S,O.children||[]),S.return=R,S)}function G(R,S,O,Y,fe){return S===null||S.tag!==7?(S=tl(O,R.mode,Y,fe),S.return=R,S):(S=i(S,O),S.return=R,S)}function V(R,S,O){if(typeof S=="string"&&S!==""||typeof S=="number"||typeof S=="bigint")return S=xr(""+S,R.mode,O),S.return=R,S;if(typeof S=="object"&&S!==null){switch(S.$$typeof){case L:return O=Zi(S.type,S.key,S.props,null,R.mode,O),Hs(O,S),O.return=R,O;case z:return S=vr(S,R.mode,O),S.return=R,S;case te:return S=il(S),V(R,S,O)}if(Ie(S)||$(S))return S=tl(S,R.mode,O,null),S.return=R,S;if(typeof S.then=="function")return V(R,Pi(S),O);if(S.$$typeof===le)return V(R,Ji(R,S),O);ec(R,S)}return null}function M(R,S,O,Y){var fe=S!==null?S.key:null;if(typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint")return fe!==null?null:p(R,S,""+O,Y);if(typeof O=="object"&&O!==null){switch(O.$$typeof){case L:return O.key===fe?j(R,S,O,Y):null;case z:return O.key===fe?D(R,S,O,Y):null;case te:return O=il(O),M(R,S,O,Y)}if(Ie(O)||$(O))return fe!==null?null:G(R,S,O,Y,null);if(typeof O.then=="function")return M(R,S,Pi(O),Y);if(O.$$typeof===le)return M(R,S,Ji(R,O),Y);ec(R,O)}return null}function H(R,S,O,Y,fe){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return R=R.get(O)||null,p(S,R,""+Y,fe);if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case L:return R=R.get(Y.key===null?O:Y.key)||null,j(S,R,Y,fe);case z:return R=R.get(Y.key===null?O:Y.key)||null,D(S,R,Y,fe);case te:return Y=il(Y),H(R,S,O,Y,fe)}if(Ie(Y)||$(Y))return R=R.get(O)||null,G(S,R,Y,fe,null);if(typeof Y.then=="function")return H(R,S,O,Pi(Y),fe);if(Y.$$typeof===le)return H(R,S,O,Ji(S,Y),fe);ec(S,Y)}return null}function re(R,S,O,Y){for(var fe=null,Ue=null,oe=S,je=S=0,Ee=null;oe!==null&&je<O.length;je++){oe.index>je?(Ee=oe,oe=null):Ee=oe.sibling;var Le=M(R,oe,O[je],Y);if(Le===null){oe===null&&(oe=Ee);break}e&&oe&&Le.alternate===null&&t(R,oe),S=r(Le,S,je),Ue===null?fe=Le:Ue.sibling=Le,Ue=Le,oe=Ee}if(je===O.length)return a(R,oe),Ce&&Ka(R,je),fe;if(oe===null){for(;je<O.length;je++)oe=V(R,O[je],Y),oe!==null&&(S=r(oe,S,je),Ue===null?fe=oe:Ue.sibling=oe,Ue=oe);return Ce&&Ka(R,je),fe}for(oe=n(oe);je<O.length;je++)Ee=H(oe,R,je,O[je],Y),Ee!==null&&(e&&Ee.alternate!==null&&oe.delete(Ee.key===null?je:Ee.key),S=r(Ee,S,je),Ue===null?fe=Ee:Ue.sibling=Ee,Ue=Ee);return e&&oe.forEach(function(qn){return t(R,qn)}),Ce&&Ka(R,je),fe}function pe(R,S,O,Y){if(O==null)throw Error(o(151));for(var fe=null,Ue=null,oe=S,je=S=0,Ee=null,Le=O.next();oe!==null&&!Le.done;je++,Le=O.next()){oe.index>je?(Ee=oe,oe=null):Ee=oe.sibling;var qn=M(R,oe,Le.value,Y);if(qn===null){oe===null&&(oe=Ee);break}e&&oe&&qn.alternate===null&&t(R,oe),S=r(qn,S,je),Ue===null?fe=qn:Ue.sibling=qn,Ue=qn,oe=Ee}if(Le.done)return a(R,oe),Ce&&Ka(R,je),fe;if(oe===null){for(;!Le.done;je++,Le=O.next())Le=V(R,Le.value,Y),Le!==null&&(S=r(Le,S,je),Ue===null?fe=Le:Ue.sibling=Le,Ue=Le);return Ce&&Ka(R,je),fe}for(oe=n(oe);!Le.done;je++,Le=O.next())Le=H(oe,R,je,Le.value,Y),Le!==null&&(e&&Le.alternate!==null&&oe.delete(Le.key===null?je:Le.key),S=r(Le,S,je),Ue===null?fe=Le:Ue.sibling=Le,Ue=Le);return e&&oe.forEach(function(Lx){return t(R,Lx)}),Ce&&Ka(R,je),fe}function Ve(R,S,O,Y){if(typeof O=="object"&&O!==null&&O.type===F&&O.key===null&&(O=O.props.children),typeof O=="object"&&O!==null){switch(O.$$typeof){case L:e:{for(var fe=O.key;S!==null;){if(S.key===fe){if(fe=O.type,fe===F){if(S.tag===7){a(R,S.sibling),Y=i(S,O.props.children),Y.return=R,R=Y;break e}}else if(S.elementType===fe||typeof fe=="object"&&fe!==null&&fe.$$typeof===te&&il(fe)===S.type){a(R,S.sibling),Y=i(S,O.props),Hs(Y,O),Y.return=R,R=Y;break e}a(R,S);break}else t(R,S);S=S.sibling}O.type===F?(Y=tl(O.props.children,R.mode,Y,O.key),Y.return=R,R=Y):(Y=Zi(O.type,O.key,O.props,null,R.mode,Y),Hs(Y,O),Y.return=R,R=Y)}return f(R);case z:e:{for(fe=O.key;S!==null;){if(S.key===fe)if(S.tag===4&&S.stateNode.containerInfo===O.containerInfo&&S.stateNode.implementation===O.implementation){a(R,S.sibling),Y=i(S,O.children||[]),Y.return=R,R=Y;break e}else{a(R,S);break}else t(R,S);S=S.sibling}Y=vr(O,R.mode,Y),Y.return=R,R=Y}return f(R);case te:return O=il(O),Ve(R,S,O,Y)}if(Ie(O))return re(R,S,O,Y);if($(O)){if(fe=$(O),typeof fe!="function")throw Error(o(150));return O=fe.call(O),pe(R,S,O,Y)}if(typeof O.then=="function")return Ve(R,S,Pi(O),Y);if(O.$$typeof===le)return Ve(R,S,Ji(R,O),Y);ec(R,O)}return typeof O=="string"&&O!==""||typeof O=="number"||typeof O=="bigint"?(O=""+O,S!==null&&S.tag===6?(a(R,S.sibling),Y=i(S,O),Y.return=R,R=Y):(a(R,S),Y=xr(O,R.mode,Y),Y.return=R,R=Y),f(R)):a(R,S)}return function(R,S,O,Y){try{Ls=0;var fe=Ve(R,S,O,Y);return Gl=null,fe}catch(oe){if(oe===ql||oe===Fi)throw oe;var Ue=Vt(29,oe,null,R.mode);return Ue.lanes=Y,Ue.return=R,Ue}}}var rl=Cd(!0),Rd=Cd(!1),Sn=!1;function Cr(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Rr(e,t){e=e.updateQueue,t.updateQueue===e&&(t.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,callbacks:null})}function kn(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Tn(e,t,a){var n=e.updateQueue;if(n===null)return null;if(n=n.shared,(He&2)!==0){var i=n.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),n.pending=t,t=Qi(e),md(e,null,a),t}return Xi(e,n,t,a),Qi(e)}function $s(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Nl(e,a)}}function zr(e,t){var a=e.updateQueue,n=e.alternate;if(n!==null&&(n=n.updateQueue,a===n)){var i=null,r=null;if(a=a.firstBaseUpdate,a!==null){do{var f={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};r===null?i=r=f:r=r.next=f,a=a.next}while(a!==null);r===null?i=r=t:r=r.next=t}else i=r=t;a={baseState:n.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:n.shared,callbacks:n.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var Or=!1;function Bs(){if(Or){var e=Bl;if(e!==null)throw e}}function qs(e,t,a,n){Or=!1;var i=e.updateQueue;Sn=!1;var r=i.firstBaseUpdate,f=i.lastBaseUpdate,p=i.shared.pending;if(p!==null){i.shared.pending=null;var j=p,D=j.next;j.next=null,f===null?r=D:f.next=D,f=j;var G=e.alternate;G!==null&&(G=G.updateQueue,p=G.lastBaseUpdate,p!==f&&(p===null?G.firstBaseUpdate=D:p.next=D,G.lastBaseUpdate=j))}if(r!==null){var V=i.baseState;f=0,G=D=j=null,p=r;do{var M=p.lane&-536870913,H=M!==p.lane;if(H?(Te&M)===M:(n&M)===M){M!==0&&M===$l&&(Or=!0),G!==null&&(G=G.next={lane:0,tag:p.tag,payload:p.payload,callback:null,next:null});e:{var re=e,pe=p;M=t;var Ve=a;switch(pe.tag){case 1:if(re=pe.payload,typeof re=="function"){V=re.call(Ve,V,M);break e}V=re;break e;case 3:re.flags=re.flags&-65537|128;case 0:if(re=pe.payload,M=typeof re=="function"?re.call(Ve,V,M):re,M==null)break e;V=E({},V,M);break e;case 2:Sn=!0}}M=p.callback,M!==null&&(e.flags|=64,H&&(e.flags|=8192),H=i.callbacks,H===null?i.callbacks=[M]:H.push(M))}else H={lane:M,tag:p.tag,payload:p.payload,callback:p.callback,next:null},G===null?(D=G=H,j=V):G=G.next=H,f|=M;if(p=p.next,p===null){if(p=i.shared.pending,p===null)break;H=p,p=H.next,H.next=null,i.lastBaseUpdate=H,i.shared.pending=null}}while(!0);G===null&&(j=V),i.baseState=j,i.firstBaseUpdate=D,i.lastBaseUpdate=G,r===null&&(i.shared.lanes=0),Rn|=f,e.lanes=f,e.memoizedState=V}}function zd(e,t){if(typeof e!="function")throw Error(o(191,e));e.call(t)}function Od(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)zd(a[e],t)}var Yl=k(null),tc=k(0);function Dd(e,t){e=sn,ne(tc,e),ne(Yl,t),sn=e|t.baseLanes}function Dr(){ne(tc,sn),ne(Yl,Yl.current)}function Mr(){sn=tc.current,Z(Yl),Z(tc)}var Kt=k(null),ma=null;function En(e){var t=e.alternate;ne(lt,lt.current&1),ne(Kt,e),ma===null&&(t===null||Yl.current!==null||t.memoizedState!==null)&&(ma=e)}function Ur(e){ne(lt,lt.current),ne(Kt,e),ma===null&&(ma=e)}function Md(e){e.tag===22?(ne(lt,lt.current),ne(Kt,e),ma===null&&(ma=e)):_n()}function _n(){ne(lt,lt.current),ne(Kt,Kt.current)}function Jt(e){Z(Kt),ma===e&&(ma=null),Z(lt)}var lt=k(0);function ac(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Yo(a)||Xo(a)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var Fa=0,ye=null,Qe=null,ut=null,nc=!1,Xl=!1,ol=!1,lc=0,Gs=0,Ql=null,Eg=0;function at(){throw Error(o(321))}function Lr(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!Zt(e[a],t[a]))return!1;return!0}function Hr(e,t,a,n,i,r){return Fa=r,ye=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,q.H=e===null||e.memoizedState===null?yf:Pr,ol=!1,r=a(n,i),ol=!1,Xl&&(r=Ld(t,a,n,i)),Ud(e),r}function Ud(e){q.H=Qs;var t=Qe!==null&&Qe.next!==null;if(Fa=0,ut=Qe=ye=null,nc=!1,Gs=0,Ql=null,t)throw Error(o(300));e===null||dt||(e=e.dependencies,e!==null&&Ki(e)&&(dt=!0))}function Ld(e,t,a,n){ye=e;var i=0;do{if(Xl&&(Ql=null),Gs=0,Xl=!1,25<=i)throw Error(o(301));if(i+=1,ut=Qe=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}q.H=jf,r=t(a,n)}while(Xl);return r}function _g(){var e=q.H,t=e.useState()[0];return t=typeof t.then=="function"?Ys(t):t,e=e.useState()[0],(Qe!==null?Qe.memoizedState:null)!==e&&(ye.flags|=1024),t}function $r(){var e=lc!==0;return lc=0,e}function Br(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function qr(e){if(nc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}nc=!1}Fa=0,ut=Qe=ye=null,Xl=!1,Gs=lc=0,Ql=null}function Mt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ut===null?ye.memoizedState=ut=e:ut=ut.next=e,ut}function st(){if(Qe===null){var e=ye.alternate;e=e!==null?e.memoizedState:null}else e=Qe.next;var t=ut===null?ye.memoizedState:ut.next;if(t!==null)ut=t,Qe=e;else{if(e===null)throw ye.alternate===null?Error(o(467)):Error(o(310));Qe=e,e={memoizedState:Qe.memoizedState,baseState:Qe.baseState,baseQueue:Qe.baseQueue,queue:Qe.queue,next:null},ut===null?ye.memoizedState=ut=e:ut=ut.next=e}return ut}function sc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ys(e){var t=Gs;return Gs+=1,Ql===null&&(Ql=[]),e=Ed(Ql,e,t),t=ye,(ut===null?t.memoizedState:ut.next)===null&&(t=t.alternate,q.H=t===null||t.memoizedState===null?yf:Pr),e}function ic(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Ys(e);if(e.$$typeof===le)return Tt(e)}throw Error(o(438,String(e)))}function Gr(e){var t=null,a=ye.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var n=ye.alternate;n!==null&&(n=n.updateQueue,n!==null&&(n=n.memoCache,n!=null&&(t={data:n.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=sc(),ye.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),n=0;n<e;n++)a[n]=ue;return t.index++,a}function Wa(e,t){return typeof t=="function"?t(e):t}function cc(e){var t=st();return Yr(t,Qe,e)}function Yr(e,t,a){var n=e.queue;if(n===null)throw Error(o(311));n.lastRenderedReducer=a;var i=e.baseQueue,r=n.pending;if(r!==null){if(i!==null){var f=i.next;i.next=r.next,r.next=f}t.baseQueue=i=r,n.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var p=f=null,j=null,D=t,G=!1;do{var V=D.lane&-536870913;if(V!==D.lane?(Te&V)===V:(Fa&V)===V){var M=D.revertLane;if(M===0)j!==null&&(j=j.next={lane:0,revertLane:0,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null}),V===$l&&(G=!0);else if((Fa&M)===M){D=D.next,M===$l&&(G=!0);continue}else V={lane:0,revertLane:D.revertLane,gesture:null,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},j===null?(p=j=V,f=r):j=j.next=V,ye.lanes|=M,Rn|=M;V=D.action,ol&&a(r,V),r=D.hasEagerState?D.eagerState:a(r,V)}else M={lane:V,revertLane:D.revertLane,gesture:D.gesture,action:D.action,hasEagerState:D.hasEagerState,eagerState:D.eagerState,next:null},j===null?(p=j=M,f=r):j=j.next=M,ye.lanes|=V,Rn|=V;D=D.next}while(D!==null&&D!==t);if(j===null?f=r:j.next=p,!Zt(r,e.memoizedState)&&(dt=!0,G&&(a=Bl,a!==null)))throw a;e.memoizedState=r,e.baseState=f,e.baseQueue=j,n.lastRenderedState=r}return i===null&&(n.lanes=0),[e.memoizedState,n.dispatch]}function Xr(e){var t=st(),a=t.queue;if(a===null)throw Error(o(311));a.lastRenderedReducer=e;var n=a.dispatch,i=a.pending,r=t.memoizedState;if(i!==null){a.pending=null;var f=i=i.next;do r=e(r,f.action),f=f.next;while(f!==i);Zt(r,t.memoizedState)||(dt=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),a.lastRenderedState=r}return[r,n]}function Hd(e,t,a){var n=ye,i=st(),r=Ce;if(r){if(a===void 0)throw Error(o(407));a=a()}else a=t();var f=!Zt((Qe||i).memoizedState,a);if(f&&(i.memoizedState=a,dt=!0),i=i.queue,Vr(qd.bind(null,n,i,e),[e]),i.getSnapshot!==t||f||ut!==null&&ut.memoizedState.tag&1){if(n.flags|=2048,Zl(9,{destroy:void 0},Bd.bind(null,n,i,a,t),null),Je===null)throw Error(o(349));r||(Fa&127)!==0||$d(n,t,a)}return a}function $d(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=ye.updateQueue,t===null?(t=sc(),ye.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function Bd(e,t,a,n){t.value=a,t.getSnapshot=n,Gd(t)&&Yd(e)}function qd(e,t,a){return a(function(){Gd(t)&&Yd(e)})}function Gd(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!Zt(e,a)}catch{return!0}}function Yd(e){var t=el(e,2);t!==null&&qt(t,e,2)}function Qr(e){var t=Mt();if(typeof e=="function"){var a=e;if(e=a(),ol){Xt(!0);try{a()}finally{Xt(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wa,lastRenderedState:e},t}function Xd(e,t,a,n){return e.baseState=a,Yr(e,Qe,typeof n=="function"?n:Wa)}function Ag(e,t,a,n,i){if(uc(e))throw Error(o(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){r.listeners.push(f)}};q.T!==null?a(!0):r.isTransition=!1,n(r),a=t.pending,a===null?(r.next=t.pending=r,Qd(t,r)):(r.next=a.next,t.pending=a.next=r)}}function Qd(e,t){var a=t.action,n=t.payload,i=e.state;if(t.isTransition){var r=q.T,f={};q.T=f;try{var p=a(i,n),j=q.S;j!==null&&j(f,p),Zd(e,t,p)}catch(D){Zr(e,t,D)}finally{r!==null&&f.types!==null&&(r.types=f.types),q.T=r}}else try{r=a(i,n),Zd(e,t,r)}catch(D){Zr(e,t,D)}}function Zd(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(n){Vd(e,t,n)},function(n){return Zr(e,t,n)}):Vd(e,t,a)}function Vd(e,t,a){t.status="fulfilled",t.value=a,Kd(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,Qd(e,a)))}function Zr(e,t,a){var n=e.pending;if(e.pending=null,n!==null){n=n.next;do t.status="rejected",t.reason=a,Kd(t),t=t.next;while(t!==n)}e.action=null}function Kd(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Jd(e,t){return t}function Id(e,t){if(Ce){var a=Je.formState;if(a!==null){e:{var n=ye;if(Ce){if(Fe){t:{for(var i=Fe,r=ha;i.nodeType!==8;){if(!r){i=null;break t}if(i=pa(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){Fe=pa(i.nextSibling),n=i.data==="F!";break e}}Nn(n)}n=!1}n&&(t=a[0])}}return a=Mt(),a.memoizedState=a.baseState=t,n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Jd,lastRenderedState:t},a.queue=n,a=gf.bind(null,ye,n),n.dispatch=a,n=Qr(!1),r=Wr.bind(null,ye,!1,n.queue),n=Mt(),i={state:t,dispatch:null,action:e,pending:null},n.queue=i,a=Ag.bind(null,ye,i,r,a),i.dispatch=a,n.memoizedState=e,[t,a,!1]}function Fd(e){var t=st();return Wd(t,Qe,e)}function Wd(e,t,a){if(t=Yr(e,t,Jd)[0],e=cc(Wa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var n=Ys(t)}catch(f){throw f===ql?Fi:f}else n=t;t=st();var i=t.queue,r=i.dispatch;return a!==t.memoizedState&&(ye.flags|=2048,Zl(9,{destroy:void 0},Cg.bind(null,i,a),null)),[n,r,e]}function Cg(e,t){e.action=t}function Pd(e){var t=st(),a=Qe;if(a!==null)return Wd(t,a,e);st(),t=t.memoizedState,a=st();var n=a.queue.dispatch;return a.memoizedState=e,[t,n,!1]}function Zl(e,t,a,n){return e={tag:e,create:a,deps:n,inst:t,next:null},t=ye.updateQueue,t===null&&(t=sc(),ye.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(n=a.next,a.next=e,e.next=n,t.lastEffect=e),e}function ef(){return st().memoizedState}function rc(e,t,a,n){var i=Mt();ye.flags|=e,i.memoizedState=Zl(1|t,{destroy:void 0},a,n===void 0?null:n)}function oc(e,t,a,n){var i=st();n=n===void 0?null:n;var r=i.memoizedState.inst;Qe!==null&&n!==null&&Lr(n,Qe.memoizedState.deps)?i.memoizedState=Zl(t,r,a,n):(ye.flags|=e,i.memoizedState=Zl(1|t,r,a,n))}function tf(e,t){rc(8390656,8,e,t)}function Vr(e,t){oc(2048,8,e,t)}function Rg(e){ye.flags|=4;var t=ye.updateQueue;if(t===null)t=sc(),ye.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function af(e){var t=st().memoizedState;return Rg({ref:t,nextImpl:e}),function(){if((He&2)!==0)throw Error(o(440));return t.impl.apply(void 0,arguments)}}function nf(e,t){return oc(4,2,e,t)}function lf(e,t){return oc(4,4,e,t)}function sf(e,t){if(typeof t=="function"){e=e();var a=t(e);return function(){typeof a=="function"?a():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function cf(e,t,a){a=a!=null?a.concat([e]):null,oc(4,4,sf.bind(null,t,e),a)}function Kr(){}function rf(e,t){var a=st();t=t===void 0?null:t;var n=a.memoizedState;return t!==null&&Lr(t,n[1])?n[0]:(a.memoizedState=[e,t],e)}function of(e,t){var a=st();t=t===void 0?null:t;var n=a.memoizedState;if(t!==null&&Lr(t,n[1]))return n[0];if(n=e(),ol){Xt(!0);try{e()}finally{Xt(!1)}}return a.memoizedState=[n,t],n}function Jr(e,t,a){return a===void 0||(Fa&1073741824)!==0&&(Te&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=uh(),ye.lanes|=e,Rn|=e,a)}function uf(e,t,a,n){return Zt(a,t)?a:Yl.current!==null?(e=Jr(e,a,n),Zt(e,t)||(dt=!0),e):(Fa&42)===0||(Fa&1073741824)!==0&&(Te&261930)===0?(dt=!0,e.memoizedState=a):(e=uh(),ye.lanes|=e,Rn|=e,t)}function df(e,t,a,n,i){var r=ae.p;ae.p=r!==0&&8>r?r:8;var f=q.T,p={};q.T=p,Wr(e,!1,t,a);try{var j=i(),D=q.S;if(D!==null&&D(p,j),j!==null&&typeof j=="object"&&typeof j.then=="function"){var G=Tg(j,n);Xs(e,t,G,Wt(e))}else Xs(e,t,n,Wt(e))}catch(V){Xs(e,t,{then:function(){},status:"rejected",reason:V},Wt())}finally{ae.p=r,f!==null&&p.types!==null&&(f.types=p.types),q.T=f}}function zg(){}function Ir(e,t,a,n){if(e.tag!==5)throw Error(o(476));var i=ff(e).queue;df(e,i,t,de,a===null?zg:function(){return hf(e),a(n)})}function ff(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:de,baseState:de,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wa,lastRenderedState:de},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Wa,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function hf(e){var t=ff(e);t.next===null&&(t=e.alternate.memoizedState),Xs(e,t.next.queue,{},Wt())}function Fr(){return Tt(ci)}function mf(){return st().memoizedState}function pf(){return st().memoizedState}function Og(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=Wt();e=kn(a);var n=Tn(t,e,a);n!==null&&(qt(n,t,a),$s(n,t,a)),t={cache:Tr()},e.payload=t;return}t=t.return}}function Dg(e,t,a){var n=Wt();a={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},uc(e)?xf(t,a):(a=pr(e,t,a,n),a!==null&&(qt(a,e,n),vf(a,t,n)))}function gf(e,t,a){var n=Wt();Xs(e,t,a,n)}function Xs(e,t,a,n){var i={lane:n,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(uc(e))xf(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var f=t.lastRenderedState,p=r(f,a);if(i.hasEagerState=!0,i.eagerState=p,Zt(p,f))return Xi(e,t,i,0),Je===null&&Yi(),!1}catch{}if(a=pr(e,t,i,n),a!==null)return qt(a,e,n),vf(a,t,n),!0}return!1}function Wr(e,t,a,n){if(n={lane:2,revertLane:Ro(),gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},uc(e)){if(t)throw Error(o(479))}else t=pr(e,a,n,2),t!==null&&qt(t,e,2)}function uc(e){var t=e.alternate;return e===ye||t!==null&&t===ye}function xf(e,t){Xl=nc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function vf(e,t,a){if((a&4194048)!==0){var n=t.lanes;n&=e.pendingLanes,a|=n,t.lanes=a,Nl(e,a)}}var Qs={readContext:Tt,use:ic,useCallback:at,useContext:at,useEffect:at,useImperativeHandle:at,useLayoutEffect:at,useInsertionEffect:at,useMemo:at,useReducer:at,useRef:at,useState:at,useDebugValue:at,useDeferredValue:at,useTransition:at,useSyncExternalStore:at,useId:at,useHostTransitionStatus:at,useFormState:at,useActionState:at,useOptimistic:at,useMemoCache:at,useCacheRefresh:at};Qs.useEffectEvent=at;var yf={readContext:Tt,use:ic,useCallback:function(e,t){return Mt().memoizedState=[e,t===void 0?null:t],e},useContext:Tt,useEffect:tf,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,rc(4194308,4,sf.bind(null,t,e),a)},useLayoutEffect:function(e,t){return rc(4194308,4,e,t)},useInsertionEffect:function(e,t){rc(4,2,e,t)},useMemo:function(e,t){var a=Mt();t=t===void 0?null:t;var n=e();if(ol){Xt(!0);try{e()}finally{Xt(!1)}}return a.memoizedState=[n,t],n},useReducer:function(e,t,a){var n=Mt();if(a!==void 0){var i=a(t);if(ol){Xt(!0);try{a(t)}finally{Xt(!1)}}}else i=t;return n.memoizedState=n.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},n.queue=e,e=e.dispatch=Dg.bind(null,ye,e),[n.memoizedState,e]},useRef:function(e){var t=Mt();return e={current:e},t.memoizedState=e},useState:function(e){e=Qr(e);var t=e.queue,a=gf.bind(null,ye,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Kr,useDeferredValue:function(e,t){var a=Mt();return Jr(a,e,t)},useTransition:function(){var e=Qr(!1);return e=df.bind(null,ye,e.queue,!0,!1),Mt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var n=ye,i=Mt();if(Ce){if(a===void 0)throw Error(o(407));a=a()}else{if(a=t(),Je===null)throw Error(o(349));(Te&127)!==0||$d(n,t,a)}i.memoizedState=a;var r={value:a,getSnapshot:t};return i.queue=r,tf(qd.bind(null,n,r,e),[e]),n.flags|=2048,Zl(9,{destroy:void 0},Bd.bind(null,n,r,a,t),null),a},useId:function(){var e=Mt(),t=Je.identifierPrefix;if(Ce){var a=Ma,n=Da;a=(n&~(1<<32-Ct(n)-1)).toString(32)+a,t="_"+t+"R_"+a,a=lc++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Eg++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:Fr,useFormState:Id,useActionState:Id,useOptimistic:function(e){var t=Mt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Wr.bind(null,ye,!0,a),a.dispatch=t,[e,t]},useMemoCache:Gr,useCacheRefresh:function(){return Mt().memoizedState=Og.bind(null,ye)},useEffectEvent:function(e){var t=Mt(),a={impl:e};return t.memoizedState=a,function(){if((He&2)!==0)throw Error(o(440));return a.impl.apply(void 0,arguments)}}},Pr={readContext:Tt,use:ic,useCallback:rf,useContext:Tt,useEffect:Vr,useImperativeHandle:cf,useInsertionEffect:nf,useLayoutEffect:lf,useMemo:of,useReducer:cc,useRef:ef,useState:function(){return cc(Wa)},useDebugValue:Kr,useDeferredValue:function(e,t){var a=st();return uf(a,Qe.memoizedState,e,t)},useTransition:function(){var e=cc(Wa)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Ys(e),t]},useSyncExternalStore:Hd,useId:mf,useHostTransitionStatus:Fr,useFormState:Fd,useActionState:Fd,useOptimistic:function(e,t){var a=st();return Xd(a,Qe,e,t)},useMemoCache:Gr,useCacheRefresh:pf};Pr.useEffectEvent=af;var jf={readContext:Tt,use:ic,useCallback:rf,useContext:Tt,useEffect:Vr,useImperativeHandle:cf,useInsertionEffect:nf,useLayoutEffect:lf,useMemo:of,useReducer:Xr,useRef:ef,useState:function(){return Xr(Wa)},useDebugValue:Kr,useDeferredValue:function(e,t){var a=st();return Qe===null?Jr(a,e,t):uf(a,Qe.memoizedState,e,t)},useTransition:function(){var e=Xr(Wa)[0],t=st().memoizedState;return[typeof e=="boolean"?e:Ys(e),t]},useSyncExternalStore:Hd,useId:mf,useHostTransitionStatus:Fr,useFormState:Pd,useActionState:Pd,useOptimistic:function(e,t){var a=st();return Qe!==null?Xd(a,Qe,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:Gr,useCacheRefresh:pf};jf.useEffectEvent=af;function eo(e,t,a,n){t=e.memoizedState,a=a(n,t),a=a==null?t:E({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var to={enqueueSetState:function(e,t,a){e=e._reactInternals;var n=Wt(),i=kn(n);i.payload=t,a!=null&&(i.callback=a),t=Tn(e,i,n),t!==null&&(qt(t,e,n),$s(t,e,n))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var n=Wt(),i=kn(n);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Tn(e,i,n),t!==null&&(qt(t,e,n),$s(t,e,n))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=Wt(),n=kn(a);n.tag=2,t!=null&&(n.callback=t),t=Tn(e,n,a),t!==null&&(qt(t,e,a),$s(t,e,a))}};function bf(e,t,a,n,i,r,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(n,r,f):t.prototype&&t.prototype.isPureReactComponent?!Rs(a,n)||!Rs(i,r):!0}function Nf(e,t,a,n){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,n),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,n),t.state!==e&&to.enqueueReplaceState(t,t.state,null)}function ul(e,t){var a=t;if("ref"in t){a={};for(var n in t)n!=="ref"&&(a[n]=t[n])}if(e=e.defaultProps){a===t&&(a=E({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function wf(e){Gi(e)}function Sf(e){console.error(e)}function kf(e){Gi(e)}function dc(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(n){setTimeout(function(){throw n})}}function Tf(e,t,a){try{var n=e.onCaughtError;n(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function ao(e,t,a){return a=kn(a),a.tag=3,a.payload={element:null},a.callback=function(){dc(e,t)},a}function Ef(e){return e=kn(e),e.tag=3,e}function _f(e,t,a,n){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var r=n.value;e.payload=function(){return i(r)},e.callback=function(){Tf(t,a,n)}}var f=a.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Tf(t,a,n),typeof i!="function"&&(zn===null?zn=new Set([this]):zn.add(this));var p=n.stack;this.componentDidCatch(n.value,{componentStack:p!==null?p:""})})}function Mg(e,t,a,n,i){if(a.flags|=32768,n!==null&&typeof n=="object"&&typeof n.then=="function"){if(t=a.alternate,t!==null&&Hl(t,a,i,!0),a=Kt.current,a!==null){switch(a.tag){case 31:case 13:return ma===null?wc():a.alternate===null&&nt===0&&(nt=3),a.flags&=-257,a.flags|=65536,a.lanes=i,n===Wi?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([n]):t.add(n),_o(e,n,i)),!1;case 22:return a.flags|=65536,n===Wi?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([n])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([n]):a.add(n)),_o(e,n,i)),!1}throw Error(o(435,a.tag))}return _o(e,n,i),wc(),!1}if(Ce)return t=Kt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,n!==br&&(e=Error(o(422),{cause:n}),Ds(ua(e,a)))):(n!==br&&(t=Error(o(423),{cause:n}),Ds(ua(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,n=ua(n,a),i=ao(e.stateNode,n,i),zr(e,i),nt!==4&&(nt=2)),!1;var r=Error(o(520),{cause:n});if(r=ua(r,a),Ps===null?Ps=[r]:Ps.push(r),nt!==4&&(nt=2),t===null)return!0;n=ua(n,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=ao(a.stateNode,n,e),zr(a,e),!1;case 1:if(t=a.type,r=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(zn===null||!zn.has(r))))return a.flags|=65536,i&=-i,a.lanes|=i,i=Ef(i),_f(i,e,a,n),zr(a,i),!1}a=a.return}while(a!==null);return!1}var no=Error(o(461)),dt=!1;function Et(e,t,a,n){t.child=e===null?Rd(t,null,a,n):rl(t,e.child,a,n)}function Af(e,t,a,n,i){a=a.render;var r=t.ref;if("ref"in n){var f={};for(var p in n)p!=="ref"&&(f[p]=n[p])}else f=n;return ll(t),n=Hr(e,t,a,f,r,i),p=$r(),e!==null&&!dt?(Br(e,t,i),Pa(e,t,i)):(Ce&&p&&yr(t),t.flags|=1,Et(e,t,n,i),t.child)}function Cf(e,t,a,n,i){if(e===null){var r=a.type;return typeof r=="function"&&!gr(r)&&r.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=r,Rf(e,t,r,n,i)):(e=Zi(a.type,null,n,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!fo(e,i)){var f=r.memoizedProps;if(a=a.compare,a=a!==null?a:Rs,a(f,n)&&e.ref===t.ref)return Pa(e,t,i)}return t.flags|=1,e=Va(r,n),e.ref=t.ref,e.return=t,t.child=e}function Rf(e,t,a,n,i){if(e!==null){var r=e.memoizedProps;if(Rs(r,n)&&e.ref===t.ref)if(dt=!1,t.pendingProps=n=r,fo(e,i))(e.flags&131072)!==0&&(dt=!0);else return t.lanes=e.lanes,Pa(e,t,i)}return lo(e,t,a,n,i)}function zf(e,t,a,n){var i=n.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|a:a,e!==null){for(n=t.child=e.child,i=0;n!==null;)i=i|n.lanes|n.childLanes,n=n.sibling;n=i&~r}else n=0,t.child=null;return Of(e,t,r,a,n)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ii(t,r!==null?r.cachePool:null),r!==null?Dd(t,r):Dr(),Md(t);else return n=t.lanes=536870912,Of(e,t,r!==null?r.baseLanes|a:a,a,n)}else r!==null?(Ii(t,r.cachePool),Dd(t,r),_n(),t.memoizedState=null):(e!==null&&Ii(t,null),Dr(),_n());return Et(e,t,i,a),t.child}function Zs(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function Of(e,t,a,n,i){var r=_r();return r=r===null?null:{parent:ot._currentValue,pool:r},t.memoizedState={baseLanes:a,cachePool:r},e!==null&&Ii(t,null),Dr(),Md(t),e!==null&&Hl(e,t,n,!0),t.childLanes=i,null}function fc(e,t){return t=mc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Df(e,t,a){return rl(t,e.child,null,a),e=fc(t,t.pendingProps),e.flags|=2,Jt(t),t.memoizedState=null,e}function Ug(e,t,a){var n=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ce){if(n.mode==="hidden")return e=fc(t,n),t.lanes=536870912,Zs(null,e);if(Ur(t),(e=Fe)?(e=Zh(e,ha),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jn!==null?{id:Da,overflow:Ma}:null,retryLane:536870912,hydrationErrors:null},a=gd(e),a.return=t,t.child=a,kt=t,Fe=null)):e=null,e===null)throw Nn(t);return t.lanes=536870912,null}return fc(t,n)}var r=e.memoizedState;if(r!==null){var f=r.dehydrated;if(Ur(t),i)if(t.flags&256)t.flags&=-257,t=Df(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(o(558));else if(dt||Hl(e,t,a,!1),i=(a&e.childLanes)!==0,dt||i){if(n=Je,n!==null&&(f=wl(n,a),f!==0&&f!==r.retryLane))throw r.retryLane=f,el(e,f),qt(n,e,f),no;wc(),t=Df(e,t,a)}else e=r.treeContext,Fe=pa(f.nextSibling),kt=t,Ce=!0,bn=null,ha=!1,e!==null&&yd(t,e),t=fc(t,n),t.flags|=4096;return t}return e=Va(e.child,{mode:n.mode,children:n.children}),e.ref=t.ref,t.child=e,e.return=t,e}function hc(e,t){var a=t.ref;if(a===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof a!="function"&&typeof a!="object")throw Error(o(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function lo(e,t,a,n,i){return ll(t),a=Hr(e,t,a,n,void 0,i),n=$r(),e!==null&&!dt?(Br(e,t,i),Pa(e,t,i)):(Ce&&n&&yr(t),t.flags|=1,Et(e,t,a,i),t.child)}function Mf(e,t,a,n,i,r){return ll(t),t.updateQueue=null,a=Ld(t,n,a,i),Ud(e),n=$r(),e!==null&&!dt?(Br(e,t,r),Pa(e,t,r)):(Ce&&n&&yr(t),t.flags|=1,Et(e,t,a,r),t.child)}function Uf(e,t,a,n,i){if(ll(t),t.stateNode===null){var r=Dl,f=a.contextType;typeof f=="object"&&f!==null&&(r=Tt(f)),r=new a(n,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=to,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=n,r.state=t.memoizedState,r.refs={},Cr(t),f=a.contextType,r.context=typeof f=="object"&&f!==null?Tt(f):Dl,r.state=t.memoizedState,f=a.getDerivedStateFromProps,typeof f=="function"&&(eo(t,a,f,n),r.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(f=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),f!==r.state&&to.enqueueReplaceState(r,r.state,null),qs(t,n,r,i),Bs(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!0}else if(e===null){r=t.stateNode;var p=t.memoizedProps,j=ul(a,p);r.props=j;var D=r.context,G=a.contextType;f=Dl,typeof G=="object"&&G!==null&&(f=Tt(G));var V=a.getDerivedStateFromProps;G=typeof V=="function"||typeof r.getSnapshotBeforeUpdate=="function",p=t.pendingProps!==p,G||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(p||D!==f)&&Nf(t,r,n,f),Sn=!1;var M=t.memoizedState;r.state=M,qs(t,n,r,i),Bs(),D=t.memoizedState,p||M!==D||Sn?(typeof V=="function"&&(eo(t,a,V,n),D=t.memoizedState),(j=Sn||bf(t,a,j,n,M,D,f))?(G||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=n,t.memoizedState=D),r.props=n,r.state=D,r.context=f,n=j):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),n=!1)}else{r=t.stateNode,Rr(e,t),f=t.memoizedProps,G=ul(a,f),r.props=G,V=t.pendingProps,M=r.context,D=a.contextType,j=Dl,typeof D=="object"&&D!==null&&(j=Tt(D)),p=a.getDerivedStateFromProps,(D=typeof p=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f!==V||M!==j)&&Nf(t,r,n,j),Sn=!1,M=t.memoizedState,r.state=M,qs(t,n,r,i),Bs();var H=t.memoizedState;f!==V||M!==H||Sn||e!==null&&e.dependencies!==null&&Ki(e.dependencies)?(typeof p=="function"&&(eo(t,a,p,n),H=t.memoizedState),(G=Sn||bf(t,a,G,n,M,H,j)||e!==null&&e.dependencies!==null&&Ki(e.dependencies))?(D||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(n,H,j),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(n,H,j)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),t.memoizedProps=n,t.memoizedState=H),r.props=n,r.state=H,r.context=j,n=G):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&M===e.memoizedState||(t.flags|=1024),n=!1)}return r=n,hc(e,t),n=(t.flags&128)!==0,r||n?(r=t.stateNode,a=n&&typeof a.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&n?(t.child=rl(t,e.child,null,i),t.child=rl(t,null,a,i)):Et(e,t,a,i),t.memoizedState=r.state,e=t.child):e=Pa(e,t,i),e}function Lf(e,t,a,n){return al(),t.flags|=256,Et(e,t,a,n),t.child}var so={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function io(e){return{baseLanes:e,cachePool:kd()}}function co(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=Ft),e}function Hf(e,t,a){var n=t.pendingProps,i=!1,r=(t.flags&128)!==0,f;if((f=r)||(f=e!==null&&e.memoizedState===null?!1:(lt.current&2)!==0),f&&(i=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ce){if(i?En(t):_n(),(e=Fe)?(e=Zh(e,ha),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:jn!==null?{id:Da,overflow:Ma}:null,retryLane:536870912,hydrationErrors:null},a=gd(e),a.return=t,t.child=a,kt=t,Fe=null)):e=null,e===null)throw Nn(t);return Xo(e)?t.lanes=32:t.lanes=536870912,null}var p=n.children;return n=n.fallback,i?(_n(),i=t.mode,p=mc({mode:"hidden",children:p},i),n=tl(n,i,a,null),p.return=t,n.return=t,p.sibling=n,t.child=p,n=t.child,n.memoizedState=io(a),n.childLanes=co(e,f,a),t.memoizedState=so,Zs(null,n)):(En(t),ro(t,p))}var j=e.memoizedState;if(j!==null&&(p=j.dehydrated,p!==null)){if(r)t.flags&256?(En(t),t.flags&=-257,t=oo(e,t,a)):t.memoizedState!==null?(_n(),t.child=e.child,t.flags|=128,t=null):(_n(),p=n.fallback,i=t.mode,n=mc({mode:"visible",children:n.children},i),p=tl(p,i,a,null),p.flags|=2,n.return=t,p.return=t,n.sibling=p,t.child=n,rl(t,e.child,null,a),n=t.child,n.memoizedState=io(a),n.childLanes=co(e,f,a),t.memoizedState=so,t=Zs(null,n));else if(En(t),Xo(p)){if(f=p.nextSibling&&p.nextSibling.dataset,f)var D=f.dgst;f=D,n=Error(o(419)),n.stack="",n.digest=f,Ds({value:n,source:null,stack:null}),t=oo(e,t,a)}else if(dt||Hl(e,t,a,!1),f=(a&e.childLanes)!==0,dt||f){if(f=Je,f!==null&&(n=wl(f,a),n!==0&&n!==j.retryLane))throw j.retryLane=n,el(e,n),qt(f,e,n),no;Yo(p)||wc(),t=oo(e,t,a)}else Yo(p)?(t.flags|=192,t.child=e.child,t=null):(e=j.treeContext,Fe=pa(p.nextSibling),kt=t,Ce=!0,bn=null,ha=!1,e!==null&&yd(t,e),t=ro(t,n.children),t.flags|=4096);return t}return i?(_n(),p=n.fallback,i=t.mode,j=e.child,D=j.sibling,n=Va(j,{mode:"hidden",children:n.children}),n.subtreeFlags=j.subtreeFlags&65011712,D!==null?p=Va(D,p):(p=tl(p,i,a,null),p.flags|=2),p.return=t,n.return=t,n.sibling=p,t.child=n,Zs(null,n),n=t.child,p=e.child.memoizedState,p===null?p=io(a):(i=p.cachePool,i!==null?(j=ot._currentValue,i=i.parent!==j?{parent:j,pool:j}:i):i=kd(),p={baseLanes:p.baseLanes|a,cachePool:i}),n.memoizedState=p,n.childLanes=co(e,f,a),t.memoizedState=so,Zs(e.child,n)):(En(t),a=e.child,e=a.sibling,a=Va(a,{mode:"visible",children:n.children}),a.return=t,a.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=a,t.memoizedState=null,a)}function ro(e,t){return t=mc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function mc(e,t){return e=Vt(22,e,null,t),e.lanes=0,e}function oo(e,t,a){return rl(t,e.child,null,a),e=ro(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function $f(e,t,a){e.lanes|=t;var n=e.alternate;n!==null&&(n.lanes|=t),Sr(e.return,t,a)}function uo(e,t,a,n,i,r){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:n,tail:a,tailMode:i,treeForkCount:r}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=n,f.tail=a,f.tailMode=i,f.treeForkCount=r)}function Bf(e,t,a){var n=t.pendingProps,i=n.revealOrder,r=n.tail;n=n.children;var f=lt.current,p=(f&2)!==0;if(p?(f=f&1|2,t.flags|=128):f&=1,ne(lt,f),Et(e,t,n,a),n=Ce?Os:0,!p&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&$f(e,a,t);else if(e.tag===19)$f(e,a,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case"forwards":for(a=t.child,i=null;a!==null;)e=a.alternate,e!==null&&ac(e)===null&&(i=a),a=a.sibling;a=i,a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),uo(t,!1,i,a,r,n);break;case"backwards":case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ac(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}uo(t,!0,a,null,r,n);break;case"together":uo(t,!1,null,null,void 0,n);break;default:t.memoizedState=null}return t.child}function Pa(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Rn|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(Hl(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(o(153));if(t.child!==null){for(e=t.child,a=Va(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=Va(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function fo(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Ki(e)))}function Lg(e,t,a){switch(t.tag){case 3:mt(t,t.stateNode.containerInfo),wn(t,ot,e.memoizedState.cache),al();break;case 27:case 5:ze(t);break;case 4:mt(t,t.stateNode.containerInfo);break;case 10:wn(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Ur(t),null;break;case 13:var n=t.memoizedState;if(n!==null)return n.dehydrated!==null?(En(t),t.flags|=128,null):(a&t.child.childLanes)!==0?Hf(e,t,a):(En(t),e=Pa(e,t,a),e!==null?e.sibling:null);En(t);break;case 19:var i=(e.flags&128)!==0;if(n=(a&t.childLanes)!==0,n||(Hl(e,t,a,!1),n=(a&t.childLanes)!==0),i){if(n)return Bf(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ne(lt,lt.current),n)break;return null;case 22:return t.lanes=0,zf(e,t,a,t.pendingProps);case 24:wn(t,ot,e.memoizedState.cache)}return Pa(e,t,a)}function qf(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)dt=!0;else{if(!fo(e,a)&&(t.flags&128)===0)return dt=!1,Lg(e,t,a);dt=(e.flags&131072)!==0}else dt=!1,Ce&&(t.flags&1048576)!==0&&vd(t,Os,t.index);switch(t.lanes=0,t.tag){case 16:e:{var n=t.pendingProps;if(e=il(t.elementType),t.type=e,typeof e=="function")gr(e)?(n=ul(e,n),t.tag=1,t=Uf(null,t,e,n,a)):(t.tag=0,t=lo(null,t,e,n,a));else{if(e!=null){var i=e.$$typeof;if(i===B){t.tag=11,t=Af(null,t,e,n,a);break e}else if(i===K){t.tag=14,t=Cf(null,t,e,n,a);break e}}throw t=be(e)||e,Error(o(306,t,""))}}return t;case 0:return lo(e,t,t.type,t.pendingProps,a);case 1:return n=t.type,i=ul(n,t.pendingProps),Uf(e,t,n,i,a);case 3:e:{if(mt(t,t.stateNode.containerInfo),e===null)throw Error(o(387));n=t.pendingProps;var r=t.memoizedState;i=r.element,Rr(e,t),qs(t,n,null,a);var f=t.memoizedState;if(n=f.cache,wn(t,ot,n),n!==r.cache&&kr(t,[ot],a,!0),Bs(),n=f.element,r.isDehydrated)if(r={element:n,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Lf(e,t,n,a);break e}else if(n!==i){i=ua(Error(o(424)),t),Ds(i),t=Lf(e,t,n,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,Fe=pa(e.firstChild),kt=t,Ce=!0,bn=null,ha=!0,a=Rd(t,null,n,a),t.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(al(),n===i){t=Pa(e,t,a);break e}Et(e,t,n,a)}t=t.child}return t;case 26:return hc(e,t),e===null?(a=Wh(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ce||(a=t.type,e=t.pendingProps,n=Cc(ve.current).createElement(a),n[pt]=t,n[it]=e,_t(n,a,e),ct(n),t.stateNode=n):t.memoizedState=Wh(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ze(t),e===null&&Ce&&(n=t.stateNode=Jh(t.type,t.pendingProps,ve.current),kt=t,ha=!0,i=Fe,Un(t.type)?(Qo=i,Fe=pa(n.firstChild)):Fe=i),Et(e,t,t.pendingProps.children,a),hc(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ce&&((i=n=Fe)&&(n=hx(n,t.type,t.pendingProps,ha),n!==null?(t.stateNode=n,kt=t,Fe=pa(n.firstChild),ha=!1,i=!0):i=!1),i||Nn(t)),ze(t),i=t.type,r=t.pendingProps,f=e!==null?e.memoizedProps:null,n=r.children,Bo(i,r)?n=null:f!==null&&Bo(i,f)&&(t.flags|=32),t.memoizedState!==null&&(i=Hr(e,t,_g,null,null,a),ci._currentValue=i),hc(e,t),Et(e,t,n,a),t.child;case 6:return e===null&&Ce&&((e=a=Fe)&&(a=mx(a,t.pendingProps,ha),a!==null?(t.stateNode=a,kt=t,Fe=null,e=!0):e=!1),e||Nn(t)),null;case 13:return Hf(e,t,a);case 4:return mt(t,t.stateNode.containerInfo),n=t.pendingProps,e===null?t.child=rl(t,null,n,a):Et(e,t,n,a),t.child;case 11:return Af(e,t,t.type,t.pendingProps,a);case 7:return Et(e,t,t.pendingProps,a),t.child;case 8:return Et(e,t,t.pendingProps.children,a),t.child;case 12:return Et(e,t,t.pendingProps.children,a),t.child;case 10:return n=t.pendingProps,wn(t,t.type,n.value),Et(e,t,n.children,a),t.child;case 9:return i=t.type._context,n=t.pendingProps.children,ll(t),i=Tt(i),n=n(i),t.flags|=1,Et(e,t,n,a),t.child;case 14:return Cf(e,t,t.type,t.pendingProps,a);case 15:return Rf(e,t,t.type,t.pendingProps,a);case 19:return Bf(e,t,a);case 31:return Ug(e,t,a);case 22:return zf(e,t,a,t.pendingProps);case 24:return ll(t),n=Tt(ot),e===null?(i=_r(),i===null&&(i=Je,r=Tr(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=a),i=r),t.memoizedState={parent:n,cache:i},Cr(t),wn(t,ot,i)):((e.lanes&a)!==0&&(Rr(e,t),qs(t,null,null,a),Bs()),i=e.memoizedState,r=t.memoizedState,i.parent!==n?(i={parent:n,cache:n},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),wn(t,ot,n)):(n=r.cache,wn(t,ot,n),n!==i.cache&&kr(t,[ot],a,!0))),Et(e,t,t.pendingProps.children,a),t.child;case 29:throw t.pendingProps}throw Error(o(156,t.tag))}function en(e){e.flags|=4}function ho(e,t,a,n,i){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(mh())e.flags|=8192;else throw cl=Wi,Ar}else e.flags&=-16777217}function Gf(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!nm(t))if(mh())e.flags|=8192;else throw cl=Wi,Ar}function pc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?gs():536870912,e.lanes|=t,Il|=t)}function Vs(e,t){if(!Ce)switch(e.tailMode){case"hidden":t=e.tail;for(var a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null;break;case"collapsed":a=e.tail;for(var n=null;a!==null;)a.alternate!==null&&(n=a),a=a.sibling;n===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:n.sibling=null}}function We(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,n=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags&65011712,n|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,n|=i.subtreeFlags,n|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=n,e.childLanes=a,t}function Hg(e,t,a){var n=t.pendingProps;switch(jr(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(t),null;case 1:return We(t),null;case 3:return a=t.stateNode,n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Ia(ot),X(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(Ll(t)?en(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Nr())),We(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(en(t),r!==null?(We(t),Gf(t,r)):(We(t),ho(t,i,null,n,a))):r?r!==e.memoizedState?(en(t),We(t),Gf(t,r)):(We(t),t.flags&=-16777217):(e=e.memoizedProps,e!==n&&en(t),We(t),ho(t,i,e,n,a)),null;case 27:if(Ye(t),a=ve.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&en(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return We(t),null}e=P.current,Ll(t)?jd(t):(e=Jh(i,n,a),t.stateNode=e,en(t))}return We(t),null;case 5:if(Ye(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==n&&en(t);else{if(!n){if(t.stateNode===null)throw Error(o(166));return We(t),null}if(r=P.current,Ll(t))jd(t);else{var f=Cc(ve.current);switch(r){case 1:r=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=f.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof n.is=="string"?f.createElement("select",{is:n.is}):f.createElement("select"),n.multiple?r.multiple=!0:n.size&&(r.size=n.size);break;default:r=typeof n.is=="string"?f.createElement(i,{is:n.is}):f.createElement(i)}}r[pt]=t,r[it]=n;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)r.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=r;e:switch(_t(r,i,n),i){case"button":case"input":case"select":case"textarea":n=!!n.autoFocus;break e;case"img":n=!0;break e;default:n=!1}n&&en(t)}}return We(t),ho(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==n&&en(t);else{if(typeof n!="string"&&t.stateNode===null)throw Error(o(166));if(e=ve.current,Ll(t)){if(e=t.stateNode,a=t.memoizedProps,n=null,i=kt,i!==null)switch(i.tag){case 27:case 5:n=i.memoizedProps}e[pt]=t,e=!!(e.nodeValue===a||n!==null&&n.suppressHydrationWarning===!0||Hh(e.nodeValue,a)),e||Nn(t,!0)}else e=Cc(e).createTextNode(n),e[pt]=t,t.stateNode=e}return We(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(n=Ll(t),a!==null){if(e===null){if(!n)throw Error(o(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(o(557));e[pt]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),e=!1}else a=Nr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(Jt(t),t):(Jt(t),null);if((t.flags&128)!==0)throw Error(o(558))}return We(t),null;case 13:if(n=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=Ll(t),n!==null&&n.dehydrated!==null){if(e===null){if(!i)throw Error(o(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(o(317));i[pt]=t}else al(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;We(t),i=!1}else i=Nr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(Jt(t),t):(Jt(t),null)}return Jt(t),(t.flags&128)!==0?(t.lanes=a,t):(a=n!==null,e=e!==null&&e.memoizedState!==null,a&&(n=t.child,i=null,n.alternate!==null&&n.alternate.memoizedState!==null&&n.alternate.memoizedState.cachePool!==null&&(i=n.alternate.memoizedState.cachePool.pool),r=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(r=n.memoizedState.cachePool.pool),r!==i&&(n.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),pc(t,t.updateQueue),We(t),null);case 4:return X(),e===null&&Mo(t.stateNode.containerInfo),We(t),null;case 10:return Ia(t.type),We(t),null;case 19:if(Z(lt),n=t.memoizedState,n===null)return We(t),null;if(i=(t.flags&128)!==0,r=n.rendering,r===null)if(i)Vs(n,!1);else{if(nt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=ac(e),r!==null){for(t.flags|=128,Vs(n,!1),e=r.updateQueue,t.updateQueue=e,pc(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)pd(a,e),a=a.sibling;return ne(lt,lt.current&1|2),Ce&&Ka(t,n.treeForkCount),t.child}e=e.sibling}n.tail!==null&&At()>jc&&(t.flags|=128,i=!0,Vs(n,!1),t.lanes=4194304)}else{if(!i)if(e=ac(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,pc(t,e),Vs(n,!0),n.tail===null&&n.tailMode==="hidden"&&!r.alternate&&!Ce)return We(t),null}else 2*At()-n.renderingStartTime>jc&&a!==536870912&&(t.flags|=128,i=!0,Vs(n,!1),t.lanes=4194304);n.isBackwards?(r.sibling=t.child,t.child=r):(e=n.last,e!==null?e.sibling=r:t.child=r,n.last=r)}return n.tail!==null?(e=n.tail,n.rendering=e,n.tail=e.sibling,n.renderingStartTime=At(),e.sibling=null,a=lt.current,ne(lt,i?a&1|2:a&1),Ce&&Ka(t,n.treeForkCount),e):(We(t),null);case 22:case 23:return Jt(t),Mr(),n=t.memoizedState!==null,e!==null?e.memoizedState!==null!==n&&(t.flags|=8192):n&&(t.flags|=8192),n?(a&536870912)!==0&&(t.flags&128)===0&&(We(t),t.subtreeFlags&6&&(t.flags|=8192)):We(t),a=t.updateQueue,a!==null&&pc(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),n=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(n=t.memoizedState.cachePool.pool),n!==a&&(t.flags|=2048),e!==null&&Z(sl),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),Ia(ot),We(t),null;case 25:return null;case 30:return null}throw Error(o(156,t.tag))}function $g(e,t){switch(jr(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Ia(ot),X(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ye(t),null;case 31:if(t.memoizedState!==null){if(Jt(t),t.alternate===null)throw Error(o(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(Jt(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(o(340));al()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Z(lt),null;case 4:return X(),null;case 10:return Ia(t.type),null;case 22:case 23:return Jt(t),Mr(),e!==null&&Z(sl),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Ia(ot),null;case 25:return null;default:return null}}function Yf(e,t){switch(jr(t),t.tag){case 3:Ia(ot),X();break;case 26:case 27:case 5:Ye(t);break;case 4:X();break;case 31:t.memoizedState!==null&&Jt(t);break;case 13:Jt(t);break;case 19:Z(lt);break;case 10:Ia(t.type);break;case 22:case 23:Jt(t),Mr(),e!==null&&Z(sl);break;case 24:Ia(ot)}}function Ks(e,t){try{var a=t.updateQueue,n=a!==null?a.lastEffect:null;if(n!==null){var i=n.next;a=i;do{if((a.tag&e)===e){n=void 0;var r=a.create,f=a.inst;n=r(),f.destroy=n}a=a.next}while(a!==i)}}catch(p){Ge(t,t.return,p)}}function An(e,t,a){try{var n=t.updateQueue,i=n!==null?n.lastEffect:null;if(i!==null){var r=i.next;n=r;do{if((n.tag&e)===e){var f=n.inst,p=f.destroy;if(p!==void 0){f.destroy=void 0,i=t;var j=a,D=p;try{D()}catch(G){Ge(i,j,G)}}}n=n.next}while(n!==r)}}catch(G){Ge(t,t.return,G)}}function Xf(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{Od(t,a)}catch(n){Ge(e,e.return,n)}}}function Qf(e,t,a){a.props=ul(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(n){Ge(e,t,n)}}function Js(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var n=e.stateNode;break;case 30:n=e.stateNode;break;default:n=e.stateNode}typeof a=="function"?e.refCleanup=a(n):a.current=n}}catch(i){Ge(e,t,i)}}function Ua(e,t){var a=e.ref,n=e.refCleanup;if(a!==null)if(typeof n=="function")try{n()}catch(i){Ge(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof a=="function")try{a(null)}catch(i){Ge(e,t,i)}else a.current=null}function Zf(e){var t=e.type,a=e.memoizedProps,n=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&n.focus();break e;case"img":a.src?n.src=a.src:a.srcSet&&(n.srcset=a.srcSet)}}catch(i){Ge(e,e.return,i)}}function mo(e,t,a){try{var n=e.stateNode;cx(n,e.type,a,t),n[it]=t}catch(i){Ge(e,e.return,i)}}function Vf(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Un(e.type)||e.tag===4}function po(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Vf(e.return))return null;e=e.return}for(e.sibling.return=e.return,e=e.sibling;e.tag!==5&&e.tag!==6&&e.tag!==18;){if(e.tag===27&&Un(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function go(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(e,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(e),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=C));else if(n!==4&&(n===27&&Un(e.type)&&(a=e.stateNode,t=null),e=e.child,e!==null))for(go(e,t,a),e=e.sibling;e!==null;)go(e,t,a),e=e.sibling}function gc(e,t,a){var n=e.tag;if(n===5||n===6)e=e.stateNode,t?a.insertBefore(e,t):a.appendChild(e);else if(n!==4&&(n===27&&Un(e.type)&&(a=e.stateNode),e=e.child,e!==null))for(gc(e,t,a),e=e.sibling;e!==null;)gc(e,t,a),e=e.sibling}function Kf(e){var t=e.stateNode,a=e.memoizedProps;try{for(var n=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);_t(t,n,a),t[pt]=e,t[it]=a}catch(r){Ge(e,e.return,r)}}var tn=!1,ft=!1,xo=!1,Jf=typeof WeakSet=="function"?WeakSet:Set,jt=null;function Bg(e,t){if(e=e.containerInfo,Ho=Lc,e=id(e),or(e)){if("selectionStart"in e)var a={start:e.selectionStart,end:e.selectionEnd};else e:{a=(a=e.ownerDocument)&&a.defaultView||window;var n=a.getSelection&&a.getSelection();if(n&&n.rangeCount!==0){a=n.anchorNode;var i=n.anchorOffset,r=n.focusNode;n=n.focusOffset;try{a.nodeType,r.nodeType}catch{a=null;break e}var f=0,p=-1,j=-1,D=0,G=0,V=e,M=null;t:for(;;){for(var H;V!==a||i!==0&&V.nodeType!==3||(p=f+i),V!==r||n!==0&&V.nodeType!==3||(j=f+n),V.nodeType===3&&(f+=V.nodeValue.length),(H=V.firstChild)!==null;)M=V,V=H;for(;;){if(V===e)break t;if(M===a&&++D===i&&(p=f),M===r&&++G===n&&(j=f),(H=V.nextSibling)!==null)break;V=M,M=V.parentNode}V=H}a=p===-1||j===-1?null:{start:p,end:j}}else a=null}a=a||{start:0,end:0}}else a=null;for($o={focusedElem:e,selectionRange:a},Lc=!1,jt=t;jt!==null;)if(t=jt,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,jt=e;else for(;jt!==null;){switch(t=jt,r=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(a=0;a<e.length;a++)i=e[a],i.ref.impl=i.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&r!==null){e=void 0,a=t,i=r.memoizedProps,r=r.memoizedState,n=a.stateNode;try{var re=ul(a.type,i);e=n.getSnapshotBeforeUpdate(re,r),n.__reactInternalSnapshotBeforeUpdate=e}catch(pe){Ge(a,a.return,pe)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,a=e.nodeType,a===9)Go(e);else if(a===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":Go(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(o(163))}if(e=t.sibling,e!==null){e.return=t.return,jt=e;break}jt=t.return}}function If(e,t,a){var n=a.flags;switch(a.tag){case 0:case 11:case 15:nn(e,a),n&4&&Ks(5,a);break;case 1:if(nn(e,a),n&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(f){Ge(a,a.return,f)}else{var i=ul(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Ge(a,a.return,f)}}n&64&&Xf(a),n&512&&Js(a,a.return);break;case 3:if(nn(e,a),n&64&&(e=a.updateQueue,e!==null)){if(t=null,a.child!==null)switch(a.child.tag){case 27:case 5:t=a.child.stateNode;break;case 1:t=a.child.stateNode}try{Od(e,t)}catch(f){Ge(a,a.return,f)}}break;case 27:t===null&&n&4&&Kf(a);case 26:case 5:nn(e,a),t===null&&n&4&&Zf(a),n&512&&Js(a,a.return);break;case 12:nn(e,a);break;case 31:nn(e,a),n&4&&Pf(e,a);break;case 13:nn(e,a),n&4&&eh(e,a),n&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=Jg.bind(null,a),px(e,a))));break;case 22:if(n=a.memoizedState!==null||tn,!n){t=t!==null&&t.memoizedState!==null||ft,i=tn;var r=ft;tn=n,(ft=t)&&!r?ln(e,a,(a.subtreeFlags&8772)!==0):nn(e,a),tn=i,ft=r}break;case 30:break;default:nn(e,a)}}function Ff(e){var t=e.alternate;t!==null&&(e.alternate=null,Ff(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Vn(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var et=null,Lt=!1;function an(e,t,a){for(a=a.child;a!==null;)Wf(e,t,a),a=a.sibling}function Wf(e,t,a){if(yt&&typeof yt.onCommitFiberUnmount=="function")try{yt.onCommitFiberUnmount(sa,a)}catch{}switch(a.tag){case 26:ft||Ua(a,t),an(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:ft||Ua(a,t);var n=et,i=Lt;Un(a.type)&&(et=a.stateNode,Lt=!1),an(e,t,a),li(a.stateNode),et=n,Lt=i;break;case 5:ft||Ua(a,t);case 6:if(n=et,i=Lt,et=null,an(e,t,a),et=n,Lt=i,et!==null)if(Lt)try{(et.nodeType===9?et.body:et.nodeName==="HTML"?et.ownerDocument.body:et).removeChild(a.stateNode)}catch(r){Ge(a,t,r)}else try{et.removeChild(a.stateNode)}catch(r){Ge(a,t,r)}break;case 18:et!==null&&(Lt?(e=et,Xh(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),ls(e)):Xh(et,a.stateNode));break;case 4:n=et,i=Lt,et=a.stateNode.containerInfo,Lt=!0,an(e,t,a),et=n,Lt=i;break;case 0:case 11:case 14:case 15:An(2,a,t),ft||An(4,a,t),an(e,t,a);break;case 1:ft||(Ua(a,t),n=a.stateNode,typeof n.componentWillUnmount=="function"&&Qf(a,t,n)),an(e,t,a);break;case 21:an(e,t,a);break;case 22:ft=(n=ft)||a.memoizedState!==null,an(e,t,a),ft=n;break;default:an(e,t,a)}}function Pf(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{ls(e)}catch(a){Ge(t,t.return,a)}}}function eh(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{ls(e)}catch(a){Ge(t,t.return,a)}}function qg(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Jf),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Jf),t;default:throw Error(o(435,e.tag))}}function xc(e,t){var a=qg(e);t.forEach(function(n){if(!a.has(n)){a.add(n);var i=Ig.bind(null,e,n);n.then(i,i)}})}function Ht(e,t){var a=t.deletions;if(a!==null)for(var n=0;n<a.length;n++){var i=a[n],r=e,f=t,p=f;e:for(;p!==null;){switch(p.tag){case 27:if(Un(p.type)){et=p.stateNode,Lt=!1;break e}break;case 5:et=p.stateNode,Lt=!1;break e;case 3:case 4:et=p.stateNode.containerInfo,Lt=!0;break e}p=p.return}if(et===null)throw Error(o(160));Wf(r,f,i),et=null,Lt=!1,r=i.alternate,r!==null&&(r.return=null),i.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)th(t,e),t=t.sibling}var wa=null;function th(e,t){var a=e.alternate,n=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Ht(t,e),$t(e),n&4&&(An(3,e,e.return),Ks(3,e),An(5,e,e.return));break;case 1:Ht(t,e),$t(e),n&512&&(ft||a===null||Ua(a,a.return)),n&64&&tn&&(e=e.updateQueue,e!==null&&(n=e.callbacks,n!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?n:a.concat(n))));break;case 26:var i=wa;if(Ht(t,e),$t(e),n&512&&(ft||a===null||Ua(a,a.return)),n&4){var r=a!==null?a.memoizedState:null;if(n=e.memoizedState,a===null)if(n===null)if(e.stateNode===null){e:{n=e.type,a=e.memoizedProps,i=i.ownerDocument||i;t:switch(n){case"title":r=i.getElementsByTagName("title")[0],(!r||r[pn]||r[pt]||r.namespaceURI==="http://www.w3.org/2000/svg"||r.hasAttribute("itemprop"))&&(r=i.createElement(n),i.head.insertBefore(r,i.querySelector("head > title"))),_t(r,n,a),r[pt]=e,ct(r),n=r;break e;case"link":var f=tm("link","href",i).get(n+(a.href||""));if(f){for(var p=0;p<f.length;p++)if(r=f[p],r.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&r.getAttribute("rel")===(a.rel==null?null:a.rel)&&r.getAttribute("title")===(a.title==null?null:a.title)&&r.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){f.splice(p,1);break t}}r=i.createElement(n),_t(r,n,a),i.head.appendChild(r);break;case"meta":if(f=tm("meta","content",i).get(n+(a.content||""))){for(p=0;p<f.length;p++)if(r=f[p],r.getAttribute("content")===(a.content==null?null:""+a.content)&&r.getAttribute("name")===(a.name==null?null:a.name)&&r.getAttribute("property")===(a.property==null?null:a.property)&&r.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&r.getAttribute("charset")===(a.charSet==null?null:a.charSet)){f.splice(p,1);break t}}r=i.createElement(n),_t(r,n,a),i.head.appendChild(r);break;default:throw Error(o(468,n))}r[pt]=e,ct(r),n=r}e.stateNode=n}else am(i,e.type,e.stateNode);else e.stateNode=em(i,n,e.memoizedProps);else r!==n?(r===null?a.stateNode!==null&&(a=a.stateNode,a.parentNode.removeChild(a)):r.count--,n===null?am(i,e.type,e.stateNode):em(i,n,e.memoizedProps)):n===null&&e.stateNode!==null&&mo(e,e.memoizedProps,a.memoizedProps)}break;case 27:Ht(t,e),$t(e),n&512&&(ft||a===null||Ua(a,a.return)),a!==null&&n&4&&mo(e,e.memoizedProps,a.memoizedProps);break;case 5:if(Ht(t,e),$t(e),n&512&&(ft||a===null||Ua(a,a.return)),e.flags&32){i=e.stateNode;try{Za(i,"")}catch(re){Ge(e,e.return,re)}}n&4&&e.stateNode!=null&&(i=e.memoizedProps,mo(e,i,a!==null?a.memoizedProps:i)),n&1024&&(xo=!0);break;case 6:if(Ht(t,e),$t(e),n&4){if(e.stateNode===null)throw Error(o(162));n=e.memoizedProps,a=e.stateNode;try{a.nodeValue=n}catch(re){Ge(e,e.return,re)}}break;case 3:if(Oc=null,i=wa,wa=Rc(t.containerInfo),Ht(t,e),wa=i,$t(e),n&4&&a!==null&&a.memoizedState.isDehydrated)try{ls(t.containerInfo)}catch(re){Ge(e,e.return,re)}xo&&(xo=!1,ah(e));break;case 4:n=wa,wa=Rc(e.stateNode.containerInfo),Ht(t,e),$t(e),wa=n;break;case 12:Ht(t,e),$t(e);break;case 31:Ht(t,e),$t(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,xc(e,n)));break;case 13:Ht(t,e),$t(e),e.child.flags&8192&&e.memoizedState!==null!=(a!==null&&a.memoizedState!==null)&&(yc=At()),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,xc(e,n)));break;case 22:i=e.memoizedState!==null;var j=a!==null&&a.memoizedState!==null,D=tn,G=ft;if(tn=D||i,ft=G||j,Ht(t,e),ft=G,tn=D,$t(e),n&8192)e:for(t=e.stateNode,t._visibility=i?t._visibility&-2:t._visibility|1,i&&(a===null||j||tn||ft||dl(e)),a=null,t=e;;){if(t.tag===5||t.tag===26){if(a===null){j=a=t;try{if(r=j.stateNode,i)f=r.style,typeof f.setProperty=="function"?f.setProperty("display","none","important"):f.display="none";else{p=j.stateNode;var V=j.memoizedProps.style,M=V!=null&&V.hasOwnProperty("display")?V.display:null;p.style.display=M==null||typeof M=="boolean"?"":(""+M).trim()}}catch(re){Ge(j,j.return,re)}}}else if(t.tag===6){if(a===null){j=t;try{j.stateNode.nodeValue=i?"":j.memoizedProps}catch(re){Ge(j,j.return,re)}}}else if(t.tag===18){if(a===null){j=t;try{var H=j.stateNode;i?Qh(H,!0):Qh(j.stateNode,!1)}catch(re){Ge(j,j.return,re)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;a===t&&(a=null),t=t.return}a===t&&(a=null),t.sibling.return=t.return,t=t.sibling}n&4&&(n=e.updateQueue,n!==null&&(a=n.retryQueue,a!==null&&(n.retryQueue=null,xc(e,a))));break;case 19:Ht(t,e),$t(e),n&4&&(n=e.updateQueue,n!==null&&(e.updateQueue=null,xc(e,n)));break;case 30:break;case 21:break;default:Ht(t,e),$t(e)}}function $t(e){var t=e.flags;if(t&2){try{for(var a,n=e.return;n!==null;){if(Vf(n)){a=n;break}n=n.return}if(a==null)throw Error(o(160));switch(a.tag){case 27:var i=a.stateNode,r=po(e);gc(e,r,i);break;case 5:var f=a.stateNode;a.flags&32&&(Za(f,""),a.flags&=-33);var p=po(e);gc(e,p,f);break;case 3:case 4:var j=a.stateNode.containerInfo,D=po(e);go(e,D,j);break;default:throw Error(o(161))}}catch(G){Ge(e,e.return,G)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function ah(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;ah(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function nn(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)If(e,t.alternate,t),t=t.sibling}function dl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:An(4,t,t.return),dl(t);break;case 1:Ua(t,t.return);var a=t.stateNode;typeof a.componentWillUnmount=="function"&&Qf(t,t.return,a),dl(t);break;case 27:li(t.stateNode);case 26:case 5:Ua(t,t.return),dl(t);break;case 22:t.memoizedState===null&&dl(t);break;case 30:dl(t);break;default:dl(t)}e=e.sibling}}function ln(e,t,a){for(a=a&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var n=t.alternate,i=e,r=t,f=r.flags;switch(r.tag){case 0:case 11:case 15:ln(i,r,a),Ks(4,r);break;case 1:if(ln(i,r,a),n=r,i=n.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(D){Ge(n,n.return,D)}if(n=r,i=n.updateQueue,i!==null){var p=n.stateNode;try{var j=i.shared.hiddenCallbacks;if(j!==null)for(i.shared.hiddenCallbacks=null,i=0;i<j.length;i++)zd(j[i],p)}catch(D){Ge(n,n.return,D)}}a&&f&64&&Xf(r),Js(r,r.return);break;case 27:Kf(r);case 26:case 5:ln(i,r,a),a&&n===null&&f&4&&Zf(r),Js(r,r.return);break;case 12:ln(i,r,a);break;case 31:ln(i,r,a),a&&f&4&&Pf(i,r);break;case 13:ln(i,r,a),a&&f&4&&eh(i,r);break;case 22:r.memoizedState===null&&ln(i,r,a),Js(r,r.return);break;case 30:break;default:ln(i,r,a)}t=t.sibling}}function vo(e,t){var a=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==a&&(e!=null&&e.refCount++,a!=null&&Ms(a))}function yo(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ms(e))}function Sa(e,t,a,n){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)nh(e,t,a,n),t=t.sibling}function nh(e,t,a,n){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Sa(e,t,a,n),i&2048&&Ks(9,t);break;case 1:Sa(e,t,a,n);break;case 3:Sa(e,t,a,n),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Ms(e)));break;case 12:if(i&2048){Sa(e,t,a,n),e=t.stateNode;try{var r=t.memoizedProps,f=r.id,p=r.onPostCommit;typeof p=="function"&&p(f,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(j){Ge(t,t.return,j)}}else Sa(e,t,a,n);break;case 31:Sa(e,t,a,n);break;case 13:Sa(e,t,a,n);break;case 23:break;case 22:r=t.stateNode,f=t.alternate,t.memoizedState!==null?r._visibility&2?Sa(e,t,a,n):Is(e,t):r._visibility&2?Sa(e,t,a,n):(r._visibility|=2,Vl(e,t,a,n,(t.subtreeFlags&10256)!==0||!1)),i&2048&&vo(f,t);break;case 24:Sa(e,t,a,n),i&2048&&yo(t.alternate,t);break;default:Sa(e,t,a,n)}}function Vl(e,t,a,n,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,f=t,p=a,j=n,D=f.flags;switch(f.tag){case 0:case 11:case 15:Vl(r,f,p,j,i),Ks(8,f);break;case 23:break;case 22:var G=f.stateNode;f.memoizedState!==null?G._visibility&2?Vl(r,f,p,j,i):Is(r,f):(G._visibility|=2,Vl(r,f,p,j,i)),i&&D&2048&&vo(f.alternate,f);break;case 24:Vl(r,f,p,j,i),i&&D&2048&&yo(f.alternate,f);break;default:Vl(r,f,p,j,i)}t=t.sibling}}function Is(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,n=t,i=n.flags;switch(n.tag){case 22:Is(a,n),i&2048&&vo(n.alternate,n);break;case 24:Is(a,n),i&2048&&yo(n.alternate,n);break;default:Is(a,n)}t=t.sibling}}var Fs=8192;function Kl(e,t,a){if(e.subtreeFlags&Fs)for(e=e.child;e!==null;)lh(e,t,a),e=e.sibling}function lh(e,t,a){switch(e.tag){case 26:Kl(e,t,a),e.flags&Fs&&e.memoizedState!==null&&Ex(a,wa,e.memoizedState,e.memoizedProps);break;case 5:Kl(e,t,a);break;case 3:case 4:var n=wa;wa=Rc(e.stateNode.containerInfo),Kl(e,t,a),wa=n;break;case 22:e.memoizedState===null&&(n=e.alternate,n!==null&&n.memoizedState!==null?(n=Fs,Fs=16777216,Kl(e,t,a),Fs=n):Kl(e,t,a));break;default:Kl(e,t,a)}}function sh(e){var t=e.alternate;if(t!==null&&(e=t.child,e!==null)){t.child=null;do t=e.sibling,e.sibling=null,e=t;while(e!==null)}}function Ws(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];jt=n,ch(n,e)}sh(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)ih(e),e=e.sibling}function ih(e){switch(e.tag){case 0:case 11:case 15:Ws(e),e.flags&2048&&An(9,e,e.return);break;case 3:Ws(e);break;case 12:Ws(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,vc(e)):Ws(e);break;default:Ws(e)}}function vc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var n=t[a];jt=n,ch(n,e)}sh(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:An(8,t,t.return),vc(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,vc(t));break;default:vc(t)}e=e.sibling}}function ch(e,t){for(;jt!==null;){var a=jt;switch(a.tag){case 0:case 11:case 15:An(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var n=a.memoizedState.cachePool.pool;n!=null&&n.refCount++}break;case 24:Ms(a.memoizedState.cache)}if(n=a.child,n!==null)n.return=a,jt=n;else e:for(a=e;jt!==null;){n=jt;var i=n.sibling,r=n.return;if(Ff(n),n===a){jt=null;break e}if(i!==null){i.return=r,jt=i;break e}jt=r}}}var Gg={getCacheForType:function(e){var t=Tt(ot),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Tt(ot).controller.signal}},Yg=typeof WeakMap=="function"?WeakMap:Map,He=0,Je=null,we=null,Te=0,qe=0,It=null,Cn=!1,Jl=!1,jo=!1,sn=0,nt=0,Rn=0,fl=0,bo=0,Ft=0,Il=0,Ps=null,Bt=null,No=!1,yc=0,rh=0,jc=1/0,bc=null,zn=null,xt=0,On=null,Fl=null,cn=0,wo=0,So=null,oh=null,ei=0,ko=null;function Wt(){return(He&2)!==0&&Te!==0?Te&-Te:q.T!==null?Ro():kl()}function uh(){if(Ft===0)if((Te&536870912)===0||Ce){var e=va;va<<=1,(va&3932160)===0&&(va=262144),Ft=e}else Ft=536870912;return e=Kt.current,e!==null&&(e.flags|=32),Ft}function qt(e,t,a){(e===Je&&(qe===2||qe===9)||e.cancelPendingCommit!==null)&&(Wl(e,0),Dn(e,Te,Ft,!1)),Ra(e,a),((He&2)===0||e!==Je)&&(e===Je&&((He&2)===0&&(fl|=a),nt===4&&Dn(e,Te,Ft,!1)),La(e))}function dh(e,t,a){if((He&6)!==0)throw Error(o(327));var n=!a&&(t&127)===0&&(t&e.expiredLanes)===0||dn(e,t),i=n?Zg(e,t):Eo(e,t,!0),r=n;do{if(i===0){Jl&&!n&&Dn(e,t,0,!1);break}else{if(a=e.current.alternate,r&&!Xg(a)){i=Eo(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var p=e;i=Ps;var j=p.current.memoizedState.isDehydrated;if(j&&(Wl(p,f).flags|=256),f=Eo(p,f,!1),f!==2){if(jo&&!j){p.errorRecoveryDisabledLanes|=r,fl|=r,i=4;break e}r=Bt,Bt=i,r!==null&&(Bt===null?Bt=r:Bt.push.apply(Bt,r))}i=f}if(r=!1,i!==2)continue}}if(i===1){Wl(e,0),Dn(e,t,0,!0);break}e:{switch(n=e,r=i,r){case 0:case 1:throw Error(o(345));case 4:if((t&4194048)!==t)break;case 6:Dn(n,t,Ft,!Cn);break e;case 2:Bt=null;break;case 3:case 5:break;default:throw Error(o(329))}if((t&62914560)===t&&(i=yc+300-At(),10<i)){if(Dn(n,t,Ft,!Cn),Zn(n,0,!0)!==0)break e;cn=t,n.timeoutHandle=Gh(fh.bind(null,n,a,Bt,bc,No,t,Ft,fl,Il,Cn,r,"Throttled",-0,0),i);break e}fh(n,a,Bt,bc,No,t,Ft,fl,Il,Cn,r,null,-0,0)}}break}while(!0);La(e)}function fh(e,t,a,n,i,r,f,p,j,D,G,V,M,H){if(e.timeoutHandle=-1,V=t.subtreeFlags,V&8192||(V&16785408)===16785408){V={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:C},lh(t,r,V);var re=(r&62914560)===r?yc-At():(r&4194048)===r?rh-At():0;if(re=_x(V,re),re!==null){cn=r,e.cancelPendingCommit=re(jh.bind(null,e,t,r,a,n,i,f,p,j,G,V,null,M,H)),Dn(e,r,f,!D);return}}jh(e,t,r,a,n,i,f,p,j)}function Xg(e){for(var t=e;;){var a=t.tag;if((a===0||a===11||a===15)&&t.flags&16384&&(a=t.updateQueue,a!==null&&(a=a.stores,a!==null)))for(var n=0;n<a.length;n++){var i=a[n],r=i.getSnapshot;i=i.value;try{if(!Zt(r(),i))return!1}catch{return!1}}if(a=t.child,t.subtreeFlags&16384&&a!==null)a.return=t,t=a;else{if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return!0;t=t.return}t.sibling.return=t.return,t=t.sibling}}return!0}function Dn(e,t,a,n){t&=~bo,t&=~fl,e.suspendedLanes|=t,e.pingedLanes&=~t,n&&(e.warmLanes|=t),n=e.expirationTimes;for(var i=t;0<i;){var r=31-Ct(i),f=1<<r;n[r]=-1,i&=~f}a!==0&&qa(e,a,t)}function Nc(){return(He&6)===0?(ti(0),!1):!0}function To(){if(we!==null){if(qe===0)var e=we.return;else e=we,Ja=nl=null,qr(e),Gl=null,Ls=0,e=we;for(;e!==null;)Yf(e.alternate,e),e=e.return;we=null}}function Wl(e,t){var a=e.timeoutHandle;a!==-1&&(e.timeoutHandle=-1,ux(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),cn=0,To(),Je=e,we=a=Va(e.current,null),Te=t,qe=0,It=null,Cn=!1,Jl=dn(e,t),jo=!1,Il=Ft=bo=fl=Rn=nt=0,Bt=Ps=null,No=!1,(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var i=31-Ct(n),r=1<<i;t|=e[i],n&=~r}return sn=t,Yi(),a}function hh(e,t){ye=null,q.H=Qs,t===ql||t===Fi?(t=_d(),qe=3):t===Ar?(t=_d(),qe=4):qe=t===no?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,It=t,we===null&&(nt=1,dc(e,ua(t,e.current)))}function mh(){var e=Kt.current;return e===null?!0:(Te&4194048)===Te?ma===null:(Te&62914560)===Te||(Te&536870912)!==0?e===ma:!1}function ph(){var e=q.H;return q.H=Qs,e===null?Qs:e}function gh(){var e=q.A;return q.A=Gg,e}function wc(){nt=4,Cn||(Te&4194048)!==Te&&Kt.current!==null||(Jl=!0),(Rn&134217727)===0&&(fl&134217727)===0||Je===null||Dn(Je,Te,Ft,!1)}function Eo(e,t,a){var n=He;He|=2;var i=ph(),r=gh();(Je!==e||Te!==t)&&(bc=null,Wl(e,t)),t=!1;var f=nt;e:do try{if(qe!==0&&we!==null){var p=we,j=It;switch(qe){case 8:To(),f=6;break e;case 3:case 2:case 9:case 6:Kt.current===null&&(t=!0);var D=qe;if(qe=0,It=null,Pl(e,p,j,D),a&&Jl){f=0;break e}break;default:D=qe,qe=0,It=null,Pl(e,p,j,D)}}Qg(),f=nt;break}catch(G){hh(e,G)}while(!0);return t&&e.shellSuspendCounter++,Ja=nl=null,He=n,q.H=i,q.A=r,we===null&&(Je=null,Te=0,Yi()),f}function Qg(){for(;we!==null;)xh(we)}function Zg(e,t){var a=He;He|=2;var n=ph(),i=gh();Je!==e||Te!==t?(bc=null,jc=At()+500,Wl(e,t)):Jl=dn(e,t);e:do try{if(qe!==0&&we!==null){t=we;var r=It;t:switch(qe){case 1:qe=0,It=null,Pl(e,t,r,1);break;case 2:case 9:if(Td(r)){qe=0,It=null,vh(t);break}t=function(){qe!==2&&qe!==9||Je!==e||(qe=7),La(e)},r.then(t,t);break e;case 3:qe=7;break e;case 4:qe=5;break e;case 7:Td(r)?(qe=0,It=null,vh(t)):(qe=0,It=null,Pl(e,t,r,7));break;case 5:var f=null;switch(we.tag){case 26:f=we.memoizedState;case 5:case 27:var p=we;if(f?nm(f):p.stateNode.complete){qe=0,It=null;var j=p.sibling;if(j!==null)we=j;else{var D=p.return;D!==null?(we=D,Sc(D)):we=null}break t}}qe=0,It=null,Pl(e,t,r,5);break;case 6:qe=0,It=null,Pl(e,t,r,6);break;case 8:To(),nt=6;break e;default:throw Error(o(462))}}Vg();break}catch(G){hh(e,G)}while(!0);return Ja=nl=null,q.H=n,q.A=i,He=a,we!==null?0:(Je=null,Te=0,Yi(),nt)}function Vg(){for(;we!==null&&!ki();)xh(we)}function xh(e){var t=qf(e.alternate,e,sn);e.memoizedProps=e.pendingProps,t===null?Sc(e):we=t}function vh(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=Mf(a,t,t.pendingProps,t.type,void 0,Te);break;case 11:t=Mf(a,t,t.pendingProps,t.type.render,t.ref,Te);break;case 5:qr(t);default:Yf(a,t),t=we=pd(t,sn),t=qf(a,t,sn)}e.memoizedProps=e.pendingProps,t===null?Sc(e):we=t}function Pl(e,t,a,n){Ja=nl=null,qr(t),Gl=null,Ls=0;var i=t.return;try{if(Mg(e,i,t,a,Te)){nt=1,dc(e,ua(a,e.current)),we=null;return}}catch(r){if(i!==null)throw we=i,r;nt=1,dc(e,ua(a,e.current)),we=null;return}t.flags&32768?(Ce||n===1?e=!0:Jl||(Te&536870912)!==0?e=!1:(Cn=e=!0,(n===2||n===9||n===3||n===6)&&(n=Kt.current,n!==null&&n.tag===13&&(n.flags|=16384))),yh(t,e)):Sc(t)}function Sc(e){var t=e;do{if((t.flags&32768)!==0){yh(t,Cn);return}e=t.return;var a=Hg(t.alternate,t,sn);if(a!==null){we=a;return}if(t=t.sibling,t!==null){we=t;return}we=t=e}while(t!==null);nt===0&&(nt=5)}function yh(e,t){do{var a=$g(e.alternate,e);if(a!==null){a.flags&=32767,we=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){we=e;return}we=e=a}while(e!==null);nt=6,we=null}function jh(e,t,a,n,i,r,f,p,j){e.cancelPendingCommit=null;do kc();while(xt!==0);if((He&6)!==0)throw Error(o(327));if(t!==null){if(t===e.current)throw Error(o(177));if(r=t.lanes|t.childLanes,r|=mr,ia(e,a,r,f,p,j),e===Je&&(we=Je=null,Te=0),Fl=t,On=e,cn=a,wo=r,So=i,oh=n,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,Fg(la,function(){return kh(),null})):(e.callbackNode=null,e.callbackPriority=0),n=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||n){n=q.T,q.T=null,i=ae.p,ae.p=2,f=He,He|=4;try{Bg(e,t,a)}finally{He=f,ae.p=i,q.T=n}}xt=1,bh(),Nh(),wh()}}function bh(){if(xt===1){xt=0;var e=On,t=Fl,a=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||a){a=q.T,q.T=null;var n=ae.p;ae.p=2;var i=He;He|=4;try{th(t,e);var r=$o,f=id(e.containerInfo),p=r.focusedElem,j=r.selectionRange;if(f!==p&&p&&p.ownerDocument&&sd(p.ownerDocument.documentElement,p)){if(j!==null&&or(p)){var D=j.start,G=j.end;if(G===void 0&&(G=D),"selectionStart"in p)p.selectionStart=D,p.selectionEnd=Math.min(G,p.value.length);else{var V=p.ownerDocument||document,M=V&&V.defaultView||window;if(M.getSelection){var H=M.getSelection(),re=p.textContent.length,pe=Math.min(j.start,re),Ve=j.end===void 0?pe:Math.min(j.end,re);!H.extend&&pe>Ve&&(f=Ve,Ve=pe,pe=f);var R=ld(p,pe),S=ld(p,Ve);if(R&&S&&(H.rangeCount!==1||H.anchorNode!==R.node||H.anchorOffset!==R.offset||H.focusNode!==S.node||H.focusOffset!==S.offset)){var O=V.createRange();O.setStart(R.node,R.offset),H.removeAllRanges(),pe>Ve?(H.addRange(O),H.extend(S.node,S.offset)):(O.setEnd(S.node,S.offset),H.addRange(O))}}}}for(V=[],H=p;H=H.parentNode;)H.nodeType===1&&V.push({element:H,left:H.scrollLeft,top:H.scrollTop});for(typeof p.focus=="function"&&p.focus(),p=0;p<V.length;p++){var Y=V[p];Y.element.scrollLeft=Y.left,Y.element.scrollTop=Y.top}}Lc=!!Ho,$o=Ho=null}finally{He=i,ae.p=n,q.T=a}}e.current=t,xt=2}}function Nh(){if(xt===2){xt=0;var e=On,t=Fl,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=q.T,q.T=null;var n=ae.p;ae.p=2;var i=He;He|=4;try{If(e,t.alternate,t)}finally{He=i,ae.p=n,q.T=a}}xt=3}}function wh(){if(xt===4||xt===3){xt=0,fs();var e=On,t=Fl,a=cn,n=oh;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?xt=5:(xt=0,Fl=On=null,Sh(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(zn=null),Sl(a),t=t.stateNode,yt&&typeof yt.onCommitFiberRoot=="function")try{yt.onCommitFiberRoot(sa,t,void 0,(t.current.flags&128)===128)}catch{}if(n!==null){t=q.T,i=ae.p,ae.p=2,q.T=null;try{for(var r=e.onRecoverableError,f=0;f<n.length;f++){var p=n[f];r(p.value,{componentStack:p.stack})}}finally{q.T=t,ae.p=i}}(cn&3)!==0&&kc(),La(e),i=e.pendingLanes,(a&261930)!==0&&(i&42)!==0?e===ko?ei++:(ei=0,ko=e):ei=0,ti(0)}}function Sh(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Ms(t)))}function kc(){return bh(),Nh(),wh(),kh()}function kh(){if(xt!==5)return!1;var e=On,t=wo;wo=0;var a=Sl(cn),n=q.T,i=ae.p;try{ae.p=32>a?32:a,q.T=null,a=So,So=null;var r=On,f=cn;if(xt=0,Fl=On=null,cn=0,(He&6)!==0)throw Error(o(331));var p=He;if(He|=4,ih(r.current),nh(r,r.current,f,a),He=p,ti(0,!1),yt&&typeof yt.onPostCommitFiberRoot=="function")try{yt.onPostCommitFiberRoot(sa,r)}catch{}return!0}finally{ae.p=i,q.T=n,Sh(e,t)}}function Th(e,t,a){t=ua(a,t),t=ao(e.stateNode,t,2),e=Tn(e,t,2),e!==null&&(Ra(e,2),La(e))}function Ge(e,t,a){if(e.tag===3)Th(e,e,a);else for(;t!==null;){if(t.tag===3){Th(t,e,a);break}else if(t.tag===1){var n=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof n.componentDidCatch=="function"&&(zn===null||!zn.has(n))){e=ua(a,e),a=Ef(2),n=Tn(t,a,2),n!==null&&(_f(a,n,t,e),Ra(n,2),La(n));break}}t=t.return}}function _o(e,t,a){var n=e.pingCache;if(n===null){n=e.pingCache=new Yg;var i=new Set;n.set(t,i)}else i=n.get(t),i===void 0&&(i=new Set,n.set(t,i));i.has(a)||(jo=!0,i.add(a),e=Kg.bind(null,e,t,a),t.then(e,e))}function Kg(e,t,a){var n=e.pingCache;n!==null&&n.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,Je===e&&(Te&a)===a&&(nt===4||nt===3&&(Te&62914560)===Te&&300>At()-yc?(He&2)===0&&Wl(e,0):bo|=a,Il===Te&&(Il=0)),La(e)}function Eh(e,t){t===0&&(t=gs()),e=el(e,t),e!==null&&(Ra(e,t),La(e))}function Jg(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),Eh(e,a)}function Ig(e,t){var a=0;switch(e.tag){case 31:case 13:var n=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:n=e.stateNode;break;case 22:n=e.stateNode._retryCache;break;default:throw Error(o(314))}n!==null&&n.delete(t),Eh(e,a)}function Fg(e,t){return jl(e,t)}var Tc=null,es=null,Ao=!1,Ec=!1,Co=!1,Mn=0;function La(e){e!==es&&e.next===null&&(es===null?Tc=es=e:es=es.next=e),Ec=!0,Ao||(Ao=!0,Pg())}function ti(e,t){if(!Co&&Ec){Co=!0;do for(var a=!1,n=Tc;n!==null;){if(e!==0){var i=n.pendingLanes;if(i===0)var r=0;else{var f=n.suspendedLanes,p=n.pingedLanes;r=(1<<31-Ct(42|e)+1)-1,r&=i&~(f&~p),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(a=!0,Rh(n,r))}else r=Te,r=Zn(n,n===Je?r:0,n.cancelPendingCommit!==null||n.timeoutHandle!==-1),(r&3)===0||dn(n,r)||(a=!0,Rh(n,r));n=n.next}while(a);Co=!1}}function Wg(){_h()}function _h(){Ec=Ao=!1;var e=0;Mn!==0&&ox()&&(e=Mn);for(var t=At(),a=null,n=Tc;n!==null;){var i=n.next,r=Ah(n,t);r===0?(n.next=null,a===null?Tc=i:a.next=i,i===null&&(es=a)):(a=n,(e!==0||(r&3)!==0)&&(Ec=!0)),n=i}xt!==0&&xt!==5||ti(e),Mn!==0&&(Mn=0)}function Ah(e,t){for(var a=e.suspendedLanes,n=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var f=31-Ct(r),p=1<<f,j=i[f];j===-1?((p&a)===0||(p&n)!==0)&&(i[f]=Ai(p,t)):j<=t&&(e.expiredLanes|=p),r&=~p}if(t=Je,a=Te,a=Zn(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n=e.callbackNode,a===0||e===t&&(qe===2||qe===9)||e.cancelPendingCommit!==null)return n!==null&&n!==null&&na(n),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||dn(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(n!==null&&na(n),Sl(a)){case 2:case 8:a=Aa;break;case 32:a=la;break;case 268435456:a=Qn;break;default:a=la}return n=Ch.bind(null,e),a=jl(a,n),e.callbackPriority=t,e.callbackNode=a,t}return n!==null&&n!==null&&na(n),e.callbackPriority=2,e.callbackNode=null,2}function Ch(e,t){if(xt!==0&&xt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(kc()&&e.callbackNode!==a)return null;var n=Te;return n=Zn(e,e===Je?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),n===0?null:(dh(e,n,t),Ah(e,At()),e.callbackNode!=null&&e.callbackNode===a?Ch.bind(null,e):null)}function Rh(e,t){if(kc())return null;dh(e,t,!0)}function Pg(){dx(function(){(He&6)!==0?jl(xa,Wg):_h()})}function Ro(){if(Mn===0){var e=$l;e===0&&(e=un,un<<=1,(un&261888)===0&&(un=256)),Mn=e}return Mn}function zh(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:v(""+e)}function Oh(e,t){var a=t.ownerDocument.createElement("input");return a.name=t.name,a.value=t.value,e.id&&a.setAttribute("form",e.id),t.parentNode.insertBefore(a,t),e=new FormData(e),a.parentNode.removeChild(a),e}function ex(e,t,a,n,i){if(t==="submit"&&a&&a.stateNode===i){var r=zh((i[it]||null).action),f=n.submitter;f&&(t=(t=f[it]||null)?zh(t.formAction):f.getAttribute("formAction"),t!==null&&(r=t,f=null));var p=new $i("action","action",null,n,i);e.push({event:p,listeners:[{instance:null,listener:function(){if(n.defaultPrevented){if(Mn!==0){var j=f?Oh(i,f):new FormData(i);Ir(a,{pending:!0,data:j,method:i.method,action:r},null,j)}}else typeof r=="function"&&(p.preventDefault(),j=f?Oh(i,f):new FormData(i),Ir(a,{pending:!0,data:j,method:i.method,action:r},r,j))},currentTarget:i}]})}}for(var zo=0;zo<hr.length;zo++){var Oo=hr[zo],tx=Oo.toLowerCase(),ax=Oo[0].toUpperCase()+Oo.slice(1);Na(tx,"on"+ax)}Na(od,"onAnimationEnd"),Na(ud,"onAnimationIteration"),Na(dd,"onAnimationStart"),Na("dblclick","onDoubleClick"),Na("focusin","onFocus"),Na("focusout","onBlur"),Na(vg,"onTransitionRun"),Na(yg,"onTransitionStart"),Na(jg,"onTransitionCancel"),Na(fd,"onTransitionEnd"),ba("onMouseEnter",["mouseout","mouseover"]),ba("onMouseLeave",["mouseout","mouseover"]),ba("onPointerEnter",["pointerout","pointerover"]),ba("onPointerLeave",["pointerout","pointerover"]),za("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),za("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),za("onBeforeInput",["compositionend","keypress","textInput","paste"]),za("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),za("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),za("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var ai="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(" "),nx=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(ai));function Dh(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var n=e[a],i=n.event;n=n.listeners;e:{var r=void 0;if(t)for(var f=n.length-1;0<=f;f--){var p=n[f],j=p.instance,D=p.currentTarget;if(p=p.listener,j!==r&&i.isPropagationStopped())break e;r=p,i.currentTarget=D;try{r(i)}catch(G){Gi(G)}i.currentTarget=null,r=j}else for(f=0;f<n.length;f++){if(p=n[f],j=p.instance,D=p.currentTarget,p=p.listener,j!==r&&i.isPropagationStopped())break e;r=p,i.currentTarget=D;try{r(i)}catch(G){Gi(G)}i.currentTarget=null,r=j}}}}function Se(e,t){var a=t[ys];a===void 0&&(a=t[ys]=new Set);var n=e+"__bubble";a.has(n)||(Mh(t,e,2,!1),a.add(n))}function Do(e,t,a){var n=0;t&&(n|=4),Mh(a,e,n,t)}var _c="_reactListening"+Math.random().toString(36).slice(2);function Mo(e){if(!e[_c]){e[_c]=!0,Ri.forEach(function(a){a!=="selectionchange"&&(nx.has(a)||Do(a,!1,e),Do(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[_c]||(t[_c]=!0,Do("selectionchange",!1,t))}}function Mh(e,t,a,n){switch(um(t)){case 2:var i=Rx;break;case 8:i=zx;break;default:i=Io}a=i.bind(null,t,a,e),i=void 0,!gt||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),n?i!==void 0?e.addEventListener(t,a,{capture:!0,passive:i}):e.addEventListener(t,a,!0):i!==void 0?e.addEventListener(t,a,{passive:i}):e.addEventListener(t,a,!1)}function Uo(e,t,a,n,i){var r=n;if((t&1)===0&&(t&2)===0&&n!==null)e:for(;;){if(n===null)return;var f=n.tag;if(f===3||f===4){var p=n.stateNode.containerInfo;if(p===i)break;if(f===4)for(f=n.return;f!==null;){var j=f.tag;if((j===3||j===4)&&f.stateNode.containerInfo===i)return;f=f.return}for(;p!==null;){if(f=Ga(p),f===null)return;if(j=f.tag,j===5||j===6||j===26||j===27){n=r=f;continue e}p=p.parentNode}}n=n.return}St(function(){var D=r,G=se(a),V=[];e:{var M=hd.get(e);if(M!==void 0){var H=$i,re=e;switch(e){case"keypress":if(Li(a)===0)break e;case"keydown":case"keyup":H=Ip;break;case"focusin":re="focus",H=lr;break;case"focusout":re="blur",H=lr;break;case"beforeblur":case"afterblur":H=lr;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":H=Gu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":H=Hp;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":H=Pp;break;case od:case ud:case dd:H=qp;break;case fd:H=tg;break;case"scroll":case"scrollend":H=Up;break;case"wheel":H=ng;break;case"copy":case"cut":case"paste":H=Yp;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":H=Xu;break;case"toggle":case"beforetoggle":H=sg}var pe=(t&4)!==0,Ve=!pe&&(e==="scroll"||e==="scrollend"),R=pe?M!==null?M+"Capture":null:M;pe=[];for(var S=D,O;S!==null;){var Y=S;if(O=Y.stateNode,Y=Y.tag,Y!==5&&Y!==26&&Y!==27||O===null||R===null||(Y=rt(S,R),Y!=null&&pe.push(ni(S,Y,O))),Ve)break;S=S.return}0<pe.length&&(M=new H(M,re,null,a,G),V.push({event:M,listeners:pe}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",H=e==="mouseout"||e==="pointerout",M&&a!==J&&(re=a.relatedTarget||a.fromElement)&&(Ga(re)||re[hn]))break e;if((H||M)&&(M=G.window===G?G:(M=G.ownerDocument)?M.defaultView||M.parentWindow:window,H?(re=a.relatedTarget||a.toElement,H=D,re=re?Ga(re):null,re!==null&&(Ve=h(re),pe=re.tag,re!==Ve||pe!==5&&pe!==27&&pe!==6)&&(re=null)):(H=null,re=D),H!==re)){if(pe=Gu,Y="onMouseLeave",R="onMouseEnter",S="mouse",(e==="pointerout"||e==="pointerover")&&(pe=Xu,Y="onPointerLeave",R="onPointerEnter",S="pointer"),Ve=H==null?M:Kn(H),O=re==null?M:Kn(re),M=new pe(Y,S+"leave",H,a,G),M.target=Ve,M.relatedTarget=O,Y=null,Ga(G)===D&&(pe=new pe(R,S+"enter",re,a,G),pe.target=O,pe.relatedTarget=Ve,Y=pe),Ve=Y,H&&re)t:{for(pe=lx,R=H,S=re,O=0,Y=R;Y;Y=pe(Y))O++;Y=0;for(var fe=S;fe;fe=pe(fe))Y++;for(;0<O-Y;)R=pe(R),O--;for(;0<Y-O;)S=pe(S),Y--;for(;O--;){if(R===S||S!==null&&R===S.alternate){pe=R;break t}R=pe(R),S=pe(S)}pe=null}else pe=null;H!==null&&Uh(V,M,H,pe,!1),re!==null&&Ve!==null&&Uh(V,Ve,re,pe,!0)}}e:{if(M=D?Kn(D):window,H=M.nodeName&&M.nodeName.toLowerCase(),H==="select"||H==="input"&&M.type==="file")var Ue=Wu;else if(Iu(M))if(Pu)Ue=pg;else{Ue=hg;var oe=fg}else H=M.nodeName,!H||H.toLowerCase()!=="input"||M.type!=="checkbox"&&M.type!=="radio"?D&&vn(D.elementType)&&(Ue=Wu):Ue=mg;if(Ue&&(Ue=Ue(e,D))){Fu(V,Ue,a,G);break e}oe&&oe(e,M,D),e==="focusout"&&D&&M.type==="number"&&D.memoizedProps.value!=null&&Al(M,"number",M.value)}switch(oe=D?Kn(D):window,e){case"focusin":(Iu(oe)||oe.contentEditable==="true")&&(Rl=oe,ur=D,zs=null);break;case"focusout":zs=ur=Rl=null;break;case"mousedown":dr=!0;break;case"contextmenu":case"mouseup":case"dragend":dr=!1,cd(V,a,G);break;case"selectionchange":if(xg)break;case"keydown":case"keyup":cd(V,a,G)}var je;if(ir)e:{switch(e){case"compositionstart":var Ee="onCompositionStart";break e;case"compositionend":Ee="onCompositionEnd";break e;case"compositionupdate":Ee="onCompositionUpdate";break e}Ee=void 0}else Cl?Ku(e,a)&&(Ee="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(Ee="onCompositionStart");Ee&&(Qu&&a.locale!=="ko"&&(Cl||Ee!=="onCompositionStart"?Ee==="onCompositionEnd"&&Cl&&(je=Bu()):(yn=G,tr="value"in yn?yn.value:yn.textContent,Cl=!0)),oe=Ac(D,Ee),0<oe.length&&(Ee=new Yu(Ee,e,null,a,G),V.push({event:Ee,listeners:oe}),je?Ee.data=je:(je=Ju(a),je!==null&&(Ee.data=je)))),(je=cg?rg(e,a):og(e,a))&&(Ee=Ac(D,"onBeforeInput"),0<Ee.length&&(oe=new Yu("onBeforeInput","beforeinput",null,a,G),V.push({event:oe,listeners:Ee}),oe.data=je)),ex(V,e,D,a,G)}Dh(V,t)})}function ni(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Ac(e,t){for(var a=t+"Capture",n=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=rt(e,a),i!=null&&n.unshift(ni(e,i,r)),i=rt(e,t),i!=null&&n.push(ni(e,i,r))),e.tag===3)return n;e=e.return}return[]}function lx(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Uh(e,t,a,n,i){for(var r=t._reactName,f=[];a!==null&&a!==n;){var p=a,j=p.alternate,D=p.stateNode;if(p=p.tag,j!==null&&j===n)break;p!==5&&p!==26&&p!==27||D===null||(j=D,i?(D=rt(a,r),D!=null&&f.unshift(ni(a,D,j))):i||(D=rt(a,r),D!=null&&f.push(ni(a,D,j)))),a=a.return}f.length!==0&&e.push({event:t,listeners:f})}var sx=/\r\n?/g,ix=/\u0000|\uFFFD/g;function Lh(e){return(typeof e=="string"?e:""+e).replace(sx,`
|
|
10
|
+
`).replace(ix,"")}function Hh(e,t){return t=Lh(t),Lh(e)===t}function Ze(e,t,a,n,i,r){switch(a){case"children":typeof n=="string"?t==="body"||t==="textarea"&&n===""||Za(e,n):(typeof n=="number"||typeof n=="bigint")&&t!=="body"&&Za(e,""+n);break;case"className":In(e,"class",n);break;case"tabIndex":In(e,"tabindex",n);break;case"dir":case"role":case"viewBox":case"width":case"height":In(e,a,n);break;case"style":ws(e,n,r);break;case"data":if(t!=="object"){In(e,"data",n);break}case"src":case"href":if(n===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(n==null||typeof n=="function"||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=v(""+n),e.setAttribute(a,n);break;case"action":case"formAction":if(typeof n=="function"){e.setAttribute(a,"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 r=="function"&&(a==="formAction"?(t!=="input"&&Ze(e,t,"name",i.name,i,null),Ze(e,t,"formEncType",i.formEncType,i,null),Ze(e,t,"formMethod",i.formMethod,i,null),Ze(e,t,"formTarget",i.formTarget,i,null)):(Ze(e,t,"encType",i.encType,i,null),Ze(e,t,"method",i.method,i,null),Ze(e,t,"target",i.target,i,null)));if(n==null||typeof n=="symbol"||typeof n=="boolean"){e.removeAttribute(a);break}n=v(""+n),e.setAttribute(a,n);break;case"onClick":n!=null&&(e.onclick=C);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"multiple":e.multiple=n&&typeof n!="function"&&typeof n!="symbol";break;case"muted":e.muted=n&&typeof n!="function"&&typeof n!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(n==null||typeof n=="function"||typeof n=="boolean"||typeof n=="symbol"){e.removeAttribute("xlink:href");break}a=v(""+n),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",a);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""+n):e.removeAttribute(a);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":n&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":n===!0?e.setAttribute(a,""):n!==!1&&n!=null&&typeof n!="function"&&typeof n!="symbol"?e.setAttribute(a,n):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":n!=null&&typeof n!="function"&&typeof n!="symbol"&&!isNaN(n)&&1<=n?e.setAttribute(a,n):e.removeAttribute(a);break;case"rowSpan":case"start":n==null||typeof n=="function"||typeof n=="symbol"||isNaN(n)?e.removeAttribute(a):e.setAttribute(a,n);break;case"popover":Se("beforetoggle",e),Se("toggle",e),Tl(e,"popover",n);break;case"xlinkActuate":ra(e,"http://www.w3.org/1999/xlink","xlink:actuate",n);break;case"xlinkArcrole":ra(e,"http://www.w3.org/1999/xlink","xlink:arcrole",n);break;case"xlinkRole":ra(e,"http://www.w3.org/1999/xlink","xlink:role",n);break;case"xlinkShow":ra(e,"http://www.w3.org/1999/xlink","xlink:show",n);break;case"xlinkTitle":ra(e,"http://www.w3.org/1999/xlink","xlink:title",n);break;case"xlinkType":ra(e,"http://www.w3.org/1999/xlink","xlink:type",n);break;case"xmlBase":ra(e,"http://www.w3.org/XML/1998/namespace","xml:base",n);break;case"xmlLang":ra(e,"http://www.w3.org/XML/1998/namespace","xml:lang",n);break;case"xmlSpace":ra(e,"http://www.w3.org/XML/1998/namespace","xml:space",n);break;case"is":Tl(e,"is",n);break;case"innerText":case"textContent":break;default:(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")&&(a=Ss.get(a)||a,Tl(e,a,n))}}function Lo(e,t,a,n,i,r){switch(a){case"style":ws(e,n,r);break;case"dangerouslySetInnerHTML":if(n!=null){if(typeof n!="object"||!("__html"in n))throw Error(o(61));if(a=n.__html,a!=null){if(i.children!=null)throw Error(o(60));e.innerHTML=a}}break;case"children":typeof n=="string"?Za(e,n):(typeof n=="number"||typeof n=="bigint")&&Za(e,""+n);break;case"onScroll":n!=null&&Se("scroll",e);break;case"onScrollEnd":n!=null&&Se("scrollend",e);break;case"onClick":n!=null&&(e.onclick=C);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!ja.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),t=a.slice(2,i?a.length-7:void 0),r=e[it]||null,r=r!=null?r[a]:null,typeof r=="function"&&e.removeEventListener(t,r,i),typeof n=="function")){typeof r!="function"&&r!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(t,n,i);break e}a in e?e[a]=n:n===!0?e.setAttribute(a,""):Tl(e,a,n)}}}function _t(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Se("error",e),Se("load",e);var n=!1,i=!1,r;for(r in a)if(a.hasOwnProperty(r)){var f=a[r];if(f!=null)switch(r){case"src":n=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ze(e,t,r,f,a,null)}}i&&Ze(e,t,"srcSet",a.srcSet,a,null),n&&Ze(e,t,"src",a.src,a,null);return;case"input":Se("invalid",e);var p=r=f=i=null,j=null,D=null;for(n in a)if(a.hasOwnProperty(n)){var G=a[n];if(G!=null)switch(n){case"name":i=G;break;case"type":f=G;break;case"checked":j=G;break;case"defaultChecked":D=G;break;case"value":r=G;break;case"defaultValue":p=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(o(137,t));break;default:Ze(e,t,n,G,a,null)}}bs(e,r,p,j,D,f,i,!1);return;case"select":Se("invalid",e),n=f=r=null;for(i in a)if(a.hasOwnProperty(i)&&(p=a[i],p!=null))switch(i){case"value":r=p;break;case"defaultValue":f=p;break;case"multiple":n=p;default:Ze(e,t,i,p,a,null)}t=r,a=f,e.multiple=!!n,t!=null?Qa(e,!!n,t,!1):a!=null&&Qa(e,!!n,a,!0);return;case"textarea":Se("invalid",e),r=i=n=null;for(f in a)if(a.hasOwnProperty(f)&&(p=a[f],p!=null))switch(f){case"value":n=p;break;case"defaultValue":i=p;break;case"children":r=p;break;case"dangerouslySetInnerHTML":if(p!=null)throw Error(o(91));break;default:Ze(e,t,f,p,a,null)}Di(e,n,i,r);return;case"option":for(j in a)a.hasOwnProperty(j)&&(n=a[j],n!=null)&&(j==="selected"?e.selected=n&&typeof n!="function"&&typeof n!="symbol":Ze(e,t,j,n,a,null));return;case"dialog":Se("beforetoggle",e),Se("toggle",e),Se("cancel",e),Se("close",e);break;case"iframe":case"object":Se("load",e);break;case"video":case"audio":for(n=0;n<ai.length;n++)Se(ai[n],e);break;case"image":Se("error",e),Se("load",e);break;case"details":Se("toggle",e);break;case"embed":case"source":case"link":Se("error",e),Se("load",e);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(D in a)if(a.hasOwnProperty(D)&&(n=a[D],n!=null))switch(D){case"children":case"dangerouslySetInnerHTML":throw Error(o(137,t));default:Ze(e,t,D,n,a,null)}return;default:if(vn(t)){for(G in a)a.hasOwnProperty(G)&&(n=a[G],n!==void 0&&Lo(e,t,G,n,a,void 0));return}}for(p in a)a.hasOwnProperty(p)&&(n=a[p],n!=null&&Ze(e,t,p,n,a,null))}function cx(e,t,a,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,f=null,p=null,j=null,D=null,G=null;for(H in a){var V=a[H];if(a.hasOwnProperty(H)&&V!=null)switch(H){case"checked":break;case"value":break;case"defaultValue":j=V;default:n.hasOwnProperty(H)||Ze(e,t,H,null,n,V)}}for(var M in n){var H=n[M];if(V=a[M],n.hasOwnProperty(M)&&(H!=null||V!=null))switch(M){case"type":r=H;break;case"name":i=H;break;case"checked":D=H;break;case"defaultChecked":G=H;break;case"value":f=H;break;case"defaultValue":p=H;break;case"children":case"dangerouslySetInnerHTML":if(H!=null)throw Error(o(137,t));break;default:H!==V&&Ze(e,t,M,H,n,V)}}js(e,f,p,j,D,G,r,i);return;case"select":H=f=p=M=null;for(r in a)if(j=a[r],a.hasOwnProperty(r)&&j!=null)switch(r){case"value":break;case"multiple":H=j;default:n.hasOwnProperty(r)||Ze(e,t,r,null,n,j)}for(i in n)if(r=n[i],j=a[i],n.hasOwnProperty(i)&&(r!=null||j!=null))switch(i){case"value":M=r;break;case"defaultValue":p=r;break;case"multiple":f=r;default:r!==j&&Ze(e,t,i,r,n,j)}t=p,a=f,n=H,M!=null?Qa(e,!!a,M,!1):!!n!=!!a&&(t!=null?Qa(e,!!a,t,!0):Qa(e,!!a,a?[]:"",!1));return;case"textarea":H=M=null;for(p in a)if(i=a[p],a.hasOwnProperty(p)&&i!=null&&!n.hasOwnProperty(p))switch(p){case"value":break;case"children":break;default:Ze(e,t,p,null,n,i)}for(f in n)if(i=n[f],r=a[f],n.hasOwnProperty(f)&&(i!=null||r!=null))switch(f){case"value":M=i;break;case"defaultValue":H=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(o(91));break;default:i!==r&&Ze(e,t,f,i,n,r)}Ns(e,M,H);return;case"option":for(var re in a)M=a[re],a.hasOwnProperty(re)&&M!=null&&!n.hasOwnProperty(re)&&(re==="selected"?e.selected=!1:Ze(e,t,re,null,n,M));for(j in n)M=n[j],H=a[j],n.hasOwnProperty(j)&&M!==H&&(M!=null||H!=null)&&(j==="selected"?e.selected=M&&typeof M!="function"&&typeof M!="symbol":Ze(e,t,j,M,n,H));return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var pe in a)M=a[pe],a.hasOwnProperty(pe)&&M!=null&&!n.hasOwnProperty(pe)&&Ze(e,t,pe,null,n,M);for(D in n)if(M=n[D],H=a[D],n.hasOwnProperty(D)&&M!==H&&(M!=null||H!=null))switch(D){case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(o(137,t));break;default:Ze(e,t,D,M,n,H)}return;default:if(vn(t)){for(var Ve in a)M=a[Ve],a.hasOwnProperty(Ve)&&M!==void 0&&!n.hasOwnProperty(Ve)&&Lo(e,t,Ve,void 0,n,M);for(G in n)M=n[G],H=a[G],!n.hasOwnProperty(G)||M===H||M===void 0&&H===void 0||Lo(e,t,G,M,n,H);return}}for(var R in a)M=a[R],a.hasOwnProperty(R)&&M!=null&&!n.hasOwnProperty(R)&&Ze(e,t,R,null,n,M);for(V in n)M=n[V],H=a[V],!n.hasOwnProperty(V)||M===H||M==null&&H==null||Ze(e,t,V,M,n,H)}function $h(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function rx(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),n=0;n<a.length;n++){var i=a[n],r=i.transferSize,f=i.initiatorType,p=i.duration;if(r&&p&&$h(f)){for(f=0,p=i.responseEnd,n+=1;n<a.length;n++){var j=a[n],D=j.startTime;if(D>p)break;var G=j.transferSize,V=j.initiatorType;G&&$h(V)&&(j=j.responseEnd,f+=G*(j<p?1:(p-D)/(j-D)))}if(--n,t+=8*(r+f)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var Ho=null,$o=null;function Cc(e){return e.nodeType===9?e:e.ownerDocument}function Bh(e){switch(e){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function qh(e,t){if(e===0)switch(t){case"svg":return 1;case"math":return 2;default:return 0}return e===1&&t==="foreignObject"?0:e}function Bo(e,t){return e==="textarea"||e==="noscript"||typeof t.children=="string"||typeof t.children=="number"||typeof t.children=="bigint"||typeof t.dangerouslySetInnerHTML=="object"&&t.dangerouslySetInnerHTML!==null&&t.dangerouslySetInnerHTML.__html!=null}var qo=null;function ox(){var e=window.event;return e&&e.type==="popstate"?e===qo?!1:(qo=e,!0):(qo=null,!1)}var Gh=typeof setTimeout=="function"?setTimeout:void 0,ux=typeof clearTimeout=="function"?clearTimeout:void 0,Yh=typeof Promise=="function"?Promise:void 0,dx=typeof queueMicrotask=="function"?queueMicrotask:typeof Yh<"u"?function(e){return Yh.resolve(null).then(e).catch(fx)}:Gh;function fx(e){setTimeout(function(){throw e})}function Un(e){return e==="head"}function Xh(e,t){var a=t,n=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(n===0){e.removeChild(i),ls(t);return}n--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")n++;else if(a==="html")li(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,li(a);for(var r=a.firstChild;r;){var f=r.nextSibling,p=r.nodeName;r[pn]||p==="SCRIPT"||p==="STYLE"||p==="LINK"&&r.rel.toLowerCase()==="stylesheet"||a.removeChild(r),r=f}}else a==="body"&&li(e.ownerDocument.body);a=i}while(a);ls(t)}function Qh(e,t){var a=e;e=0;do{var n=a.nextSibling;if(a.nodeType===1?t?(a._stashedDisplay=a.style.display,a.style.display="none"):(a.style.display=a._stashedDisplay||"",a.getAttribute("style")===""&&a.removeAttribute("style")):a.nodeType===3&&(t?(a._stashedText=a.nodeValue,a.nodeValue=""):a.nodeValue=a._stashedText||""),n&&n.nodeType===8)if(a=n.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=n}while(a)}function Go(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var a=t;switch(t=t.nextSibling,a.nodeName){case"HTML":case"HEAD":case"BODY":Go(a),Vn(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function hx(e,t,a,n){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!n&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(n){if(!e[pn])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=pa(e.nextSibling),e===null)break}return null}function mx(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=pa(e.nextSibling),e===null))return null;return e}function Zh(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=pa(e.nextSibling),e===null))return null;return e}function Yo(e){return e.data==="$?"||e.data==="$~"}function Xo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function px(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var n=function(){t(),a.removeEventListener("DOMContentLoaded",n)};a.addEventListener("DOMContentLoaded",n),e._reactRetry=n}}function pa(e){for(;e!=null;e=e.nextSibling){var t=e.nodeType;if(t===1||t===3)break;if(t===8){if(t=e.data,t==="$"||t==="$!"||t==="$?"||t==="$~"||t==="&"||t==="F!"||t==="F")break;if(t==="/$"||t==="/&")return null}}return e}var Qo=null;function Vh(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return pa(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Kh(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="$"||a==="$!"||a==="$?"||a==="$~"||a==="&"){if(t===0)return e;t--}else a!=="/$"&&a!=="/&"||t++}e=e.previousSibling}return null}function Jh(e,t,a){switch(t=Cc(a),e){case"html":if(e=t.documentElement,!e)throw Error(o(452));return e;case"head":if(e=t.head,!e)throw Error(o(453));return e;case"body":if(e=t.body,!e)throw Error(o(454));return e;default:throw Error(o(451))}}function li(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Vn(e)}var ga=new Map,Ih=new Set;function Rc(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var rn=ae.d;ae.d={f:gx,r:xx,D:vx,C:yx,L:jx,m:bx,X:wx,S:Nx,M:Sx};function gx(){var e=rn.f(),t=Nc();return e||t}function xx(e){var t=Ya(e);t!==null&&t.tag===5&&t.type==="form"?hf(t):rn.r(e)}var ts=typeof document>"u"?null:document;function Fh(e,t,a){var n=ts;if(n&&typeof t=="string"&&t){var i=wt(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),Ih.has(i)||(Ih.add(i),e={rel:e,crossOrigin:a,href:t},n.querySelector(i)===null&&(t=n.createElement("link"),_t(t,"link",e),ct(t),n.head.appendChild(t)))}}function vx(e){rn.D(e),Fh("dns-prefetch",e,null)}function yx(e,t){rn.C(e,t),Fh("preconnect",e,t)}function jx(e,t,a){rn.L(e,t,a);var n=ts;if(n&&e&&t){var i='link[rel="preload"][as="'+wt(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+wt(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+wt(a.imageSizes)+'"]')):i+='[href="'+wt(e)+'"]';var r=i;switch(t){case"style":r=as(e);break;case"script":r=ns(e)}ga.has(r)||(e=E({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),ga.set(r,e),n.querySelector(i)!==null||t==="style"&&n.querySelector(si(r))||t==="script"&&n.querySelector(ii(r))||(t=n.createElement("link"),_t(t,"link",e),ct(t),n.head.appendChild(t)))}}function bx(e,t){rn.m(e,t);var a=ts;if(a&&e){var n=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+wt(n)+'"][href="'+wt(e)+'"]',r=i;switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=ns(e)}if(!ga.has(r)&&(e=E({rel:"modulepreload",href:e},t),ga.set(r,e),a.querySelector(i)===null)){switch(n){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(ii(r)))return}n=a.createElement("link"),_t(n,"link",e),ct(n),a.head.appendChild(n)}}}function Nx(e,t,a){rn.S(e,t,a);var n=ts;if(n&&e){var i=gn(n).hoistableStyles,r=as(e);t=t||"default";var f=i.get(r);if(!f){var p={loading:0,preload:null};if(f=n.querySelector(si(r)))p.loading=5;else{e=E({rel:"stylesheet",href:e,"data-precedence":t},a),(a=ga.get(r))&&Zo(e,a);var j=f=n.createElement("link");ct(j),_t(j,"link",e),j._p=new Promise(function(D,G){j.onload=D,j.onerror=G}),j.addEventListener("load",function(){p.loading|=1}),j.addEventListener("error",function(){p.loading|=2}),p.loading|=4,zc(f,t,n)}f={type:"stylesheet",instance:f,count:1,state:p},i.set(r,f)}}}function wx(e,t){rn.X(e,t);var a=ts;if(a&&e){var n=gn(a).hoistableScripts,i=ns(e),r=n.get(i);r||(r=a.querySelector(ii(i)),r||(e=E({src:e,async:!0},t),(t=ga.get(i))&&Vo(e,t),r=a.createElement("script"),ct(r),_t(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(i,r))}}function Sx(e,t){rn.M(e,t);var a=ts;if(a&&e){var n=gn(a).hoistableScripts,i=ns(e),r=n.get(i);r||(r=a.querySelector(ii(i)),r||(e=E({src:e,async:!0,type:"module"},t),(t=ga.get(i))&&Vo(e,t),r=a.createElement("script"),ct(r),_t(r,"link",e),a.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},n.set(i,r))}}function Wh(e,t,a,n){var i=(i=ve.current)?Rc(i):null;if(!i)throw Error(o(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(t=as(a.href),a=gn(i).hoistableStyles,n=a.get(t),n||(n={type:"style",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=as(a.href);var r=gn(i).hoistableStyles,f=r.get(e);if(f||(i=i.ownerDocument||i,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,f),(r=i.querySelector(si(e)))&&!r._p&&(f.instance=r,f.state.loading=5),ga.has(e)||(a={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},ga.set(e,a),r||kx(i,e,a,f.state))),t&&n===null)throw Error(o(528,""));return f}if(t&&n!==null)throw Error(o(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=ns(a),a=gn(i).hoistableScripts,n=a.get(t),n||(n={type:"script",instance:null,count:0,state:null},a.set(t,n)),n):{type:"void",instance:null,count:0,state:null};default:throw Error(o(444,e))}}function as(e){return'href="'+wt(e)+'"'}function si(e){return'link[rel="stylesheet"]['+e+"]"}function Ph(e){return E({},e,{"data-precedence":e.precedence,precedence:null})}function kx(e,t,a,n){e.querySelector('link[rel="preload"][as="style"]['+t+"]")?n.loading=1:(t=e.createElement("link"),n.preload=t,t.addEventListener("load",function(){return n.loading|=1}),t.addEventListener("error",function(){return n.loading|=2}),_t(t,"link",a),ct(t),e.head.appendChild(t))}function ns(e){return'[src="'+wt(e)+'"]'}function ii(e){return"script[async]"+e}function em(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var n=e.querySelector('style[data-href~="'+wt(a.href)+'"]');if(n)return t.instance=n,ct(n),n;var i=E({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return n=(e.ownerDocument||e).createElement("style"),ct(n),_t(n,"style",i),zc(n,a.precedence,e),t.instance=n;case"stylesheet":i=as(a.href);var r=e.querySelector(si(i));if(r)return t.state.loading|=4,t.instance=r,ct(r),r;n=Ph(a),(i=ga.get(i))&&Zo(n,i),r=(e.ownerDocument||e).createElement("link"),ct(r);var f=r;return f._p=new Promise(function(p,j){f.onload=p,f.onerror=j}),_t(r,"link",n),t.state.loading|=4,zc(r,a.precedence,e),t.instance=r;case"script":return r=ns(a.src),(i=e.querySelector(ii(r)))?(t.instance=i,ct(i),i):(n=a,(i=ga.get(r))&&(n=E({},a),Vo(n,i)),e=e.ownerDocument||e,i=e.createElement("script"),ct(i),_t(i,"link",n),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(o(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(n=t.instance,t.state.loading|=4,zc(n,a.precedence,e));return t.instance}function zc(e,t,a){for(var n=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=n.length?n[n.length-1]:null,r=i,f=0;f<n.length;f++){var p=n[f];if(p.dataset.precedence===t)r=p;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Zo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Vo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Oc=null;function tm(e,t,a){if(Oc===null){var n=new Map,i=Oc=new Map;i.set(a,n)}else i=Oc,n=i.get(a),n||(n=new Map,i.set(a,n));if(n.has(e))return n;for(n.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var r=a[i];if(!(r[pn]||r[pt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var f=r.getAttribute(t)||"";f=e+f;var p=n.get(f);p?p.push(r):n.set(f,[r])}}return n}function am(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function Tx(e,t,a){if(a===1||t.itemProp!=null)return!1;switch(e){case"meta":case"title":return!0;case"style":if(typeof t.precedence!="string"||typeof t.href!="string"||t.href==="")break;return!0;case"link":if(typeof t.rel!="string"||typeof t.href!="string"||t.href===""||t.onLoad||t.onError)break;return t.rel==="stylesheet"?(e=t.disabled,typeof t.precedence=="string"&&e==null):!0;case"script":if(t.async&&typeof t.async!="function"&&typeof t.async!="symbol"&&!t.onLoad&&!t.onError&&t.src&&typeof t.src=="string")return!0}return!1}function nm(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Ex(e,t,a,n){if(a.type==="stylesheet"&&(typeof n.media!="string"||matchMedia(n.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=as(n.href),r=t.querySelector(si(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Dc.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=r,ct(r);return}r=t.ownerDocument||t,n=Ph(n),(i=ga.get(i))&&Zo(n,i),r=r.createElement("link"),ct(r);var f=r;f._p=new Promise(function(p,j){f.onload=p,f.onerror=j}),_t(r,"link",n),a.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=Dc.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Ko=0;function _x(e,t){return e.stylesheets&&e.count===0&&Uc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var n=setTimeout(function(){if(e.stylesheets&&Uc(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&Ko===0&&(Ko=62500*rx());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Uc(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>Ko?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(n),clearTimeout(i)}}:null}function Dc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Uc(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Mc=null;function Uc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Mc=new Map,t.forEach(Ax,e),Mc=null,Dc.call(e))}function Ax(e,t){if(!(t.state.loading&4)){var a=Mc.get(e);if(a)var n=a.get(null);else{a=new Map,Mc.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var f=i[r];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(a.set(f.dataset.precedence,f),n=f)}n&&a.set(null,n)}i=t.instance,f=i.getAttribute("data-precedence"),r=a.get(f)||n,r===n&&a.set(null,i),a.set(f,i),this.count++,n=Dc.bind(this),i.addEventListener("load",n),i.addEventListener("error",n),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var ci={$$typeof:le,Provider:null,Consumer:null,_currentValue:de,_currentValue2:de,_threadCount:0};function Cx(e,t,a,n,i,r,f,p,j){this.tag=1,this.containerInfo=e,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=fn(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=fn(0),this.hiddenUpdates=fn(null),this.identifierPrefix=n,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=j,this.incompleteTransitions=new Map}function lm(e,t,a,n,i,r,f,p,j,D,G,V){return e=new Cx(e,t,a,f,j,D,G,V,p),t=1,r===!0&&(t|=24),r=Vt(3,null,null,t),e.current=r,r.stateNode=e,t=Tr(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:n,isDehydrated:a,cache:t},Cr(r),e}function sm(e){return e?(e=Dl,e):Dl}function im(e,t,a,n,i,r){i=sm(i),n.context===null?n.context=i:n.pendingContext=i,n=kn(t),n.payload={element:a},r=r===void 0?null:r,r!==null&&(n.callback=r),a=Tn(e,n,t),a!==null&&(qt(a,e,t),$s(a,e,t))}function cm(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Jo(e,t){cm(e,t),(e=e.alternate)&&cm(e,t)}function rm(e){if(e.tag===13||e.tag===31){var t=el(e,67108864);t!==null&&qt(t,e,67108864),Jo(e,67108864)}}function om(e){if(e.tag===13||e.tag===31){var t=Wt();t=xs(t);var a=el(e,t);a!==null&&qt(a,e,t),Jo(e,t)}}var Lc=!0;function Rx(e,t,a,n){var i=q.T;q.T=null;var r=ae.p;try{ae.p=2,Io(e,t,a,n)}finally{ae.p=r,q.T=i}}function zx(e,t,a,n){var i=q.T;q.T=null;var r=ae.p;try{ae.p=8,Io(e,t,a,n)}finally{ae.p=r,q.T=i}}function Io(e,t,a,n){if(Lc){var i=Fo(n);if(i===null)Uo(e,t,n,Hc,a),dm(e,n);else if(Dx(i,e,t,a,n))n.stopPropagation();else if(dm(e,n),t&4&&-1<Ox.indexOf(e)){for(;i!==null;){var r=Ya(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var f=Ca(r.pendingLanes);if(f!==0){var p=r;for(p.pendingLanes|=2,p.entangledLanes|=2;f;){var j=1<<31-Ct(f);p.entanglements[1]|=j,f&=~j}La(r),(He&6)===0&&(jc=At()+500,ti(0))}}break;case 31:case 13:p=el(r,2),p!==null&&qt(p,r,2),Nc(),Jo(r,2)}if(r=Fo(n),r===null&&Uo(e,t,n,Hc,a),r===i)break;i=r}i!==null&&n.stopPropagation()}else Uo(e,t,n,null,a)}}function Fo(e){return e=se(e),Wo(e)}var Hc=null;function Wo(e){if(Hc=null,e=Ga(e),e!==null){var t=h(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=m(t),e!==null)return e;e=null}else if(a===31){if(e=g(t),e!==null)return e;e=null}else if(a===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Hc=e,null}function um(e){switch(e){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(Ti()){case xa:return 2;case Aa:return 8;case la:case hs:return 32;case Qn:return 268435456;default:return 32}default:return 32}}var Po=!1,Ln=null,Hn=null,$n=null,ri=new Map,oi=new Map,Bn=[],Ox="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 dm(e,t){switch(e){case"focusin":case"focusout":Ln=null;break;case"dragenter":case"dragleave":Hn=null;break;case"mouseover":case"mouseout":$n=null;break;case"pointerover":case"pointerout":ri.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":oi.delete(t.pointerId)}}function ui(e,t,a,n,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:a,eventSystemFlags:n,nativeEvent:r,targetContainers:[i]},t!==null&&(t=Ya(t),t!==null&&rm(t)),e):(e.eventSystemFlags|=n,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Dx(e,t,a,n,i){switch(t){case"focusin":return Ln=ui(Ln,e,t,a,n,i),!0;case"dragenter":return Hn=ui(Hn,e,t,a,n,i),!0;case"mouseover":return $n=ui($n,e,t,a,n,i),!0;case"pointerover":var r=i.pointerId;return ri.set(r,ui(ri.get(r)||null,e,t,a,n,i)),!0;case"gotpointercapture":return r=i.pointerId,oi.set(r,ui(oi.get(r)||null,e,t,a,n,i)),!0}return!1}function fm(e){var t=Ga(e.target);if(t!==null){var a=h(t);if(a!==null){if(t=a.tag,t===13){if(t=m(a),t!==null){e.blockedOn=t,vs(e.priority,function(){om(a)});return}}else if(t===31){if(t=g(a),t!==null){e.blockedOn=t,vs(e.priority,function(){om(a)});return}}else if(t===3&&a.stateNode.current.memoizedState.isDehydrated){e.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}e.blockedOn=null}function $c(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Fo(e.nativeEvent);if(a===null){a=e.nativeEvent;var n=new a.constructor(a.type,a);J=n,a.target.dispatchEvent(n),J=null}else return t=Ya(a),t!==null&&rm(t),e.blockedOn=a,!1;t.shift()}return!0}function hm(e,t,a){$c(e)&&a.delete(t)}function Mx(){Po=!1,Ln!==null&&$c(Ln)&&(Ln=null),Hn!==null&&$c(Hn)&&(Hn=null),$n!==null&&$c($n)&&($n=null),ri.forEach(hm),oi.forEach(hm)}function Bc(e,t){e.blockedOn===t&&(e.blockedOn=null,Po||(Po=!0,s.unstable_scheduleCallback(s.unstable_NormalPriority,Mx)))}var qc=null;function mm(e){qc!==e&&(qc=e,s.unstable_scheduleCallback(s.unstable_NormalPriority,function(){qc===e&&(qc=null);for(var t=0;t<e.length;t+=3){var a=e[t],n=e[t+1],i=e[t+2];if(typeof n!="function"){if(Wo(n||a)===null)continue;break}var r=Ya(a);r!==null&&(e.splice(t,3),t-=3,Ir(r,{pending:!0,data:i,method:a.method,action:n},n,i))}}))}function ls(e){function t(j){return Bc(j,e)}Ln!==null&&Bc(Ln,e),Hn!==null&&Bc(Hn,e),$n!==null&&Bc($n,e),ri.forEach(t),oi.forEach(t);for(var a=0;a<Bn.length;a++){var n=Bn[a];n.blockedOn===e&&(n.blockedOn=null)}for(;0<Bn.length&&(a=Bn[0],a.blockedOn===null);)fm(a),a.blockedOn===null&&Bn.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(n=0;n<a.length;n+=3){var i=a[n],r=a[n+1],f=i[it]||null;if(typeof r=="function")f||mm(a);else if(f){var p=null;if(r&&r.hasAttribute("formAction")){if(i=r,f=r[it]||null)p=f.formAction;else if(Wo(i)!==null)continue}else p=f.action;typeof p=="function"?a[n+1]=p:(a.splice(n,3),n-=3),mm(a)}}}function pm(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(f){return i=f})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),n||setTimeout(a,20)}function a(){if(!n&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var n=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){n=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function eu(e){this._internalRoot=e}Gc.prototype.render=eu.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(o(409));var a=t.current,n=Wt();im(a,n,e,t,null,null)},Gc.prototype.unmount=eu.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;im(e.current,2,null,e,null,null),Nc(),t[hn]=null}};function Gc(e){this._internalRoot=e}Gc.prototype.unstable_scheduleHydration=function(e){if(e){var t=kl();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Bn.length&&t!==0&&t<Bn[a].priority;a++);Bn.splice(a,0,e),a===0&&fm(e)}};var gm=c.version;if(gm!=="19.2.8")throw Error(o(527,gm,"19.2.8"));ae.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(o(188)):(e=Object.keys(e).join(","),Error(o(268,e)));return e=x(t),e=e!==null?b(e):null,e=e===null?null:e.stateNode,e};var Ux={bundleType:0,version:"19.2.8",rendererPackageName:"react-dom",currentDispatcherRef:q,reconcilerVersion:"19.2.8"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Yc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Yc.isDisabled&&Yc.supportsFiber)try{sa=Yc.inject(Ux),yt=Yc}catch{}}return fi.createRoot=function(e,t){if(!d(e))throw Error(o(299));var a=!1,n="",i=wf,r=Sf,f=kf;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(n=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=lm(e,1,!1,null,null,a,n,null,i,r,f,pm),e[hn]=t.current,Mo(e),new eu(t)},fi.hydrateRoot=function(e,t,a){if(!d(e))throw Error(o(299));var n=!1,i="",r=wf,f=Sf,p=kf,j=null;return a!=null&&(a.unstable_strictMode===!0&&(n=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(r=a.onUncaughtError),a.onCaughtError!==void 0&&(f=a.onCaughtError),a.onRecoverableError!==void 0&&(p=a.onRecoverableError),a.formState!==void 0&&(j=a.formState)),t=lm(e,1,!0,t,a??null,n,i,j,r,f,p,pm),t.context=sm(null),a=t.current,n=Wt(),n=xs(n),i=kn(n),i.callback=null,Tn(a,i,n),a=n,t.current.lanes=a,Ra(t,a),La(t),e[hn]=t.current,Mo(e),new Gc(t)},fi.version="19.2.8",fi}var Tm;function Jx(){if(Tm)return nu.exports;Tm=1;function s(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(s)}catch(c){console.error(c)}}return s(),nu.exports=Kx(),nu.exports}var Ix=Jx();const Fx="modulepreload",Wx=function(s){return"/"+s},Em={},Px=function(c,u,o){let d=Promise.resolve();if(u&&u.length>0){let y=function(x){return Promise.all(x.map(b=>Promise.resolve(b).then(E=>({status:"fulfilled",value:E}),E=>({status:"rejected",reason:E}))))};document.getElementsByTagName("link");const m=document.querySelector("meta[property=csp-nonce]"),g=m?.nonce||m?.getAttribute("nonce");d=y(u.map(x=>{if(x=Wx(x),x in Em)return;Em[x]=!0;const b=x.endsWith(".css"),E=b?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${x}"]${E}`))return;const N=document.createElement("link");if(N.rel=b?"stylesheet":Fx,b||(N.as="script"),N.crossOrigin="",N.href=x,g&&N.setAttribute("nonce",g),document.head.appendChild(N),b)return new Promise((L,z)=>{N.addEventListener("load",L),N.addEventListener("error",()=>z(new Error(`Unable to preload CSS for ${x}`)))})}))}function h(m){const g=new Event("vite:preloadError",{cancelable:!0});if(g.payload=m,window.dispatchEvent(g),!g.defaultPrevented)throw m}return d.then(m=>{for(const g of m||[])g.status==="rejected"&&h(g.reason);return c().catch(h)})};function Q({name:s,fill:c,className:u}){return l.jsx("span",{className:`ms material-symbols-rounded${c?" ms-fill":""}${s==="progress_activity"?" ms-spin":""}${u?` ${u}`:""}`,"aria-hidden":!0,children:s})}function ev(){const[s,c]=w.useState(()=>window.location.hash.slice(1)||"/");return w.useEffect(()=>{const u=()=>c(window.location.hash.slice(1)||"/");return window.addEventListener("hashchange",u),()=>window.removeEventListener("hashchange",u)},[]),s}let pu="kraftwerk inspector",gu="";function fp(){document.title=gu?`${gu} — ${pu}`:pu}function tv(s){pu=s,fp()}function _m(s){gu=s,fp()}function ta(s,c){c?.replace?window.location.replace(`#${s}`):window.location.hash=s}async function hp(s){const c=await fetch("/api/projects/start",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({root:s})}),u=await c.json();if(!u.ok)throw new Error(u.error||`HTTP ${c.status}`);if(window.dispatchEvent(new Event("kw-meta-refresh")),u.live&&u.url)return u.url;for(let o=0;o<12;o++){await new Promise(d=>setTimeout(d,1e3));try{const h=(await fetch("/api/meta",{cache:"no-store"}).then(m=>m.json())).switcher?.find(m=>m.root===s&&m.live);if(h)return h.url}catch{}}throw new Error("started, but the UI did not answer yet — see ~/.kraftwerk/logs")}function _e({href:s,...c}){return l.jsx("a",{href:`#${s}`,...c})}const mp="kw-expert";let ku=(()=>{try{return localStorage.getItem(mp)!=="off"}catch{return!0}})();const xu=new Set;document.documentElement.dataset.expert=ku?"on":"off";function av(s){ku=s,document.documentElement.dataset.expert=s?"on":"off";try{localStorage.setItem(mp,s?"on":"off")}catch{}xu.forEach(c=>c())}function $a(){return w.useSyncExternalStore(s=>(xu.add(s),()=>xu.delete(s)),()=>ku)}function nv(s){let c=2166136261;for(let u=0;u<s.length;u++)c=Math.imul(c^s.charCodeAt(u),16777619);return(c>>>0)%360}function ji(s,c){return s||`hsl(${nv(c)} 58% 46%)`}function Am(s){const c=s.split(/[^\p{L}\p{N}]+/u).filter(Boolean);return c.length===0?"?":(c.length>=2?c[0][0]+c[1][0]:c[0].slice(0,2)).toUpperCase()}function bi({icon:s,name:c,color:u,seed:o,ambiguous:d,className:h}){const m={"--ws-c":ji(u,o)};return l.jsxs("span",{className:`ws-tile${s?"":" ws-tile-mono"}${h?` ${h}`:""}`,style:m,"aria-hidden":!0,children:[s||Am(c),s&&d&&l.jsx("span",{className:"ws-tile-badge",children:Am(c)})]})}async function vu(s,c){const u=await fetch(s,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(c??{})}),o=await u.json().catch(()=>({}));return!u.ok&&!o.error&&(o.error=`HTTP ${u.status}`),o}function $e(s,c,u=6e3){const[o,d]=w.useState(null),h=w.useRef(s);return h.current=s,w.useEffect(()=>{let m=!0,g;const y=async()=>{try{const x=await fetch(h.current,{cache:"no-store"});x.ok&&m&&d(await x.json())}catch{}m&&(g=setTimeout(y,c?1500:u))};return y(),()=>{m=!1,clearTimeout(g)}},[s,c,u]),o}function Ni(s){if(s==null)return"—";const c=Math.round(s/1e3);return c<60?`${c}s`:`${Math.floor(c/60)}m${String(c%60).padStart(2,"0")}s`}function Tu(s){return s==null?"—":`$${s.toFixed(2)}`}function Zc(s){return s?s>=1e3?`${(s/1e3).toFixed(1)}k`:String(s):"0"}function Eu(s){return s<1024?`${s} B`:s<1024*1024?`${(s/1024).toFixed(1)} K`:`${(s/1024/1024).toFixed(1)} M`}function gl(s){if(!s)return"—";const c=new Date(s),u=new Date,o=c.toDateString()===u.toDateString(),d=c.toTimeString().slice(0,5);return o?d:`${c.toISOString().slice(5,10)} ${d}`}function cs(s){if(!s)return"—";const c=Date.now()-Date.parse(s);if(c<6e4)return"just now";const u=Math.floor(c/6e4);if(u<60)return`${u}m ago`;const o=Math.floor(u/60);if(o<24)return`${o}h ago`;const d=Math.floor(o/24);return d<7?`${d}d ago`:new Date(s).toISOString().slice(5,10)}function _u({since:s}){const[,c]=w.useState(0);return w.useEffect(()=>{const u=setInterval(()=>c(o=>o+1),1e3);return()=>clearInterval(u)},[]),s?l.jsx("span",{className:"num",children:Ni(Date.now()-Date.parse(s))}):null}function Fc({status:s}){return l.jsx("span",{className:`lamp ${s}`})}function lv({status:s}){return l.jsx("span",{className:`status-word ${s}`,children:s})}function Au(){return{async:!1,breaks:!1,extensions:null,gfm:!0,hooks:null,pedantic:!1,renderer:null,silent:!1,tokenizer:null,walkTokens:null}}var yl=Au();function pp(s){yl=s}var pl={exec:()=>null};function ss(s){let c=[];return u=>{let o=Math.max(0,Math.min(3,u-1)),d=c[o];return d||(d=s(o),c[o]=d),d}}function ke(s,c=""){let u=typeof s=="string"?s:s.source,o={replace:(d,h)=>{let m=typeof h=="string"?h:h.source;return m=m.replace(Ot.caret,"$1"),u=u.replace(d,m),o},getRegex:()=>new RegExp(u,c)};return o}var sv=((s="")=>{try{return!!new RegExp("(?<=1)(?<!1)"+s)}catch{return!1}})(),Ot={codeRemoveIndent:/^(?: {1,4}| {0,3}\t)/gm,outputLinkReplace:/\\([\[\]])/g,indentCodeCompensation:/^(\s+)(?:```)/,beginningSpace:/^\s+/,endingHash:/#$/,startingSpaceChar:/^ /,endingSpaceChar:/ $/,nonSpaceChar:/[^ ]/,newLineCharGlobal:/\n/g,tabCharGlobal:/\t/g,multipleSpaceGlobal:/\s+/g,blankLine:/^[ \t]*$/,doubleBlankLine:/\n[ \t]*\n[ \t]*$/,blockquoteStart:/^ {0,3}>/,blockquoteSetextReplace:/\n {0,3}((?:=+|-+) *)(?=\n|$)/g,blockquoteSetextReplace2:/^ {0,3}>[ \t]?/gm,listReplaceNesting:/^ {1,4}(?=( {4})*[^ ])/g,listIsTask:/^\[[ xX]\] +\S/,listReplaceTask:/^\[[ xX]\] +/,listTaskCheckbox:/\[[ xX]\]/,anyLine:/\n.*\n/,hrefBrackets:/^<(.*)>$/,tableDelimiter:/[:|]/,tableAlignChars:/^\||\| *$/g,tableRowBlankLine:/\n[ \t]*$/,tableAlignRight:/^ *-+: *$/,tableAlignCenter:/^ *:-+: *$/,tableAlignLeft:/^ *:-+ *$/,startATag:/^<a /i,endATag:/^<\/a>/i,startPreScriptTag:/^<(pre|code|kbd|script)(\s|>)/i,endPreScriptTag:/^<\/(pre|code|kbd|script)(\s|>)/i,startAngleBracket:/^</,endAngleBracket:/>$/,pedanticHrefTitle:/^([^'"]*[^\s])\s+(['"])(.*)\2/,unicodeAlphaNumeric:/[\p{L}\p{N}]/u,escapeTest:/[&<>"']/,escapeReplace:/[&<>"']/g,escapeTestNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/,escapeReplaceNoEncode:/[<>"']|&(?!(#\d{1,7}|#[Xx][a-fA-F0-9]{1,6}|\w+);)/g,caret:/(^|[^\[])\^/g,percentDecode:/%25/g,findPipe:/\|/g,splitPipe:/ \|/,slashPipe:/\\\|/g,carriageReturn:/\r\n|\r/g,spaceLine:/^ +$/gm,notSpaceStart:/^\S*/,endingNewline:/\n$/,listItemRegex:s=>new RegExp(`^( {0,3}${s})((?:[ ][^\\n]*)?(?:\\n|$))`),nextBulletRegex:ss(s=>new RegExp(`^ {0,${s}}(?:[*+-]|\\d{1,9}[.)])((?:[ ][^\\n]*)?(?:\\n|$))`)),hrRegex:ss(s=>new RegExp(`^ {0,${s}}((?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$)`)),fencesBeginRegex:ss(s=>new RegExp(`^ {0,${s}}(?:\`\`\`|~~~)`)),headingBeginRegex:ss(s=>new RegExp(`^ {0,${s}}#`)),htmlBeginRegex:ss(s=>new RegExp(`^ {0,${s}}<(?:[a-z].*>|!--)`,"i")),blockquoteBeginRegex:ss(s=>new RegExp(`^ {0,${s}}>`))},iv=/^(?:[ \t]*(?:\n|$))+/,cv=/^((?: {4}| {0,3}\t)[^\n]+(?:\n(?:[ \t]*(?:\n|$))*)?)+/,rv=/^ {0,3}(`{3,}(?=[^`\n]*(?:\n|$))|~{3,})([^\n]*)(?:\n|$)(?:|([\s\S]*?)(?:\n|$))(?: {0,3}\1[~`]* *(?=\n|$)|$)/,wi=/^ {0,3}((?:-[\t ]*){3,}|(?:_[ \t]*){3,}|(?:\*[ \t]*){3,})(?:\n+|$)/,ov=/^ {0,3}(#{1,6})(?=\s|$)(.*)(?:\n+|$)/,Cu=/ {0,3}(?:[*+-]|\d{1,9}[.)])/,gp=/^(?!bull |blockCode|fences|blockquote|heading|html|table)((?:.|\n(?!\s*?\n|bull |blockCode|fences|blockquote|heading|html|table))+?)\n {0,3}(=+|-+) *(?:\n+|$)/,xp=ke(gp).replace(/bull/g,Cu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/\|table/g,"").getRegex(),uv=ke(gp).replace(/bull/g,Cu).replace(/blockCode/g,/(?: {4}| {0,3}\t)/).replace(/fences/g,/ {0,3}(?:`{3,}|~{3,})/).replace(/blockquote/g,/ {0,3}>/).replace(/heading/g,/ {0,3}#{1,6}(?:\s|$)/).replace(/html/g,/ {0,3}<[^\n>]+>\n/).replace(/table/g,/ {0,3}\|?(?:[:\- ]*\|)+[\:\- ]*\n/).getRegex(),Ru=/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html|table|[ \t]+\n)[^\n]+)*)/,dv=/^[^\n]+/,zu=/(?!\s*\])(?:\\[\s\S]|[^\[\]\\])+/,fv=ke(/^ {0,3}\[(label)\]: *(?:\n[ \t]*)?([^<\s][^\s]*|<.*?>)(?:(?: +(?:\n[ \t]*)?| *\n[ \t]*)(title))? *(?:\n+|$)/).replace("label",zu).replace("title",/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/).getRegex(),hv=ke(/^(bull)([ \t][^\n]*?)?(?:\n|$)/).replace(/bull/g,Cu).getRegex(),Wc="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|search|section|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",Ou=/<!--(?:-?>|[\s\S]*?(?:-->|$))/,mv=ke("^ {0,3}(?:<(script|pre|style|textarea)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n*|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?(?:\\?>[^\\n]*\\n*|$)|<![A-Z][\\s\\S]*?(?:>[^\\n]*\\n*|$)|<!\\[CDATA\\[[\\s\\S]*?(?:\\]\\]>[^\\n]*\\n*|$)|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|<(?!script|pre|style|textarea)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$)|</(?!script|pre|style|textarea)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n[ ]*)+\\n|$))","i").replace("comment",Ou).replace("tag",Wc).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),vp=s=>ke(Ru).replace("hr",wi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("|table","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list",s).replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wc).getRegex(),pv=vp(/ {0,3}(?:[*+-]|1[.)])[ \t]+[^ \t\n]/),gv=vp(/ {0,3}(?:[*+-]|\d{1,9}[.)])(?:[ \t]|\n|$)/),xv=ke(/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/).replace("paragraph",gv).getRegex(),Du={blockquote:xv,code:cv,def:fv,fences:rv,heading:ov,hr:wi,html:mv,lheading:xp,list:hv,newline:iv,paragraph:pv,table:pl,text:dv},Cm=ke("^ *([^\\n ].*)\\n {0,3}((?:\\| *)?:?-+:? *(?:\\| *:?-+:? *)*(?:\\| *)?)(?:\\n((?:(?! *\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)").replace("hr",wi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("blockquote"," {0,3}>").replace("code","(?: {4}| {0,3} )[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wc).getRegex(),vv={...Du,lheading:uv,table:Cm,paragraph:ke(Ru).replace("hr",wi).replace("heading"," {0,3}#{1,6}(?:\\s|$)").replace("|lheading","").replace("table",Cm).replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*(?:\\n|$))|~~~)[^\\n]*(?:\\n|$)").replace("list"," {0,3}(?:[*+-]|1[.)])[ \\t]+[^ \\t\\n]").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|textarea|!--)").replace("tag",Wc).getRegex()},yv={...Du,html:ke(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Ou).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^(#{1,6})(.*)(?:\n+|$)/,fences:pl,lheading:/^(.+?)\n {0,3}(=+|-+) *(?:\n+|$)/,paragraph:ke(Ru).replace("hr",wi).replace("heading",` *#{1,6} *[^
|
|
11
|
+
]`).replace("lheading",xp).replace("|table","").replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").replace("|tag","").getRegex()},jv=/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,bv=/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,yp=/^( {2,}|\\)\n(?!\s*$)/,Nv=/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,on=/[\p{P}\p{S}]/u,os=/[\s\p{P}\p{S}]/u,Si=/[^\s\p{P}\p{S}]/u,wv=ke(/^((?![*_])punctSpace)/,"u").replace(/punctSpace/g,os).getRegex(),Sv=/[\p{Pi}\p{Ps}"']/u,jp=/(?!~)[\p{P}\p{S}]/u,kv=/(?!~)[\s\p{P}\p{S}]/u,Tv=/(?:[^\s\p{P}\p{S}]|~)/u,Ev=ke(/link|precode-code|html/,"g").replace("link",/\[(?:[^\[\]`]|(?<a>`+)[^`]+\k<a>(?!`))*?\]\((?:\\[\s\S]|[^\\\(\)]|\((?:\\[\s\S]|[^\\\(\)])*\))*\)/).replace("precode-",sv?"(?<!`)()":"(^^|[^`])").replace("code",/(?<b>`+)[^`]+\k<b>(?!`)/).replace("html",/<(?! )[^<>]*?>/).getRegex(),bp=/^(?:\*+(?:((?!\*)punct)|([^\s*]))?)|^_+(?:((?!_)punct)|([^\s_]))?/,_v=ke(bp,"u").replace(/punct/g,on).getRegex(),Av=ke(bp,"u").replace(/punct/g,jp).getRegex(),Cv=/^(?:\*+(?:((?!\*)(?!openQuote)punct)|([^\s*]))?)|^_+(?:((?!_)(?!openQuote)punct)|([^\s_]))?/,Rv=ke(Cv,"u").replace(/openQuote/g,Sv).replace(/punct/g,on).getRegex(),Np="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)punctSpace(\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|notPunctSpace(\\*+)(?=notPunctSpace)",zv=ke(Np,"gu").replace(/notPunctSpace/g,Si).replace(/punctSpace/g,os).replace(/punct/g,on).getRegex(),Ov=ke(Np,"gu").replace(/notPunctSpace/g,Tv).replace(/punctSpace/g,kv).replace(/punct/g,jp).getRegex(),Dv="^[^_*]*?__[^_*]*?\\*[^_*]*?(?=__)|[^*]+(?=[^*])|(?!\\*)punct(\\*+)(?=[\\s]|$)|notPunctSpace(\\*+)(?!\\*)(?=punctSpace|$)|(?!\\*)[\\s](\\*+)(?=notPunctSpace)|[\\s](\\*+)(?!\\*)(?=punct)|(?!\\*)punct(\\*+)(?!\\*)(?=punct)|(?:(?!\\*)punct|notPunctSpace)(\\*+)(?!\\*)(?=notPunctSpace)",Mv=ke(Dv,"gu").replace(/notPunctSpace/g,Si).replace(/punctSpace/g,os).replace(/punct/g,on).getRegex(),Uv=ke("^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)punctSpace(_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)","gu").replace(/notPunctSpace/g,Si).replace(/punctSpace/g,os).replace(/punct/g,on).getRegex(),Lv="^[^_*]*?\\*\\*[^_*]*?_[^_*]*?(?=\\*\\*)|[^_]+(?=[^_])|(?!_)punct(_+)(?=[\\s]|$)|notPunctSpace(_+)(?!_)(?=punctSpace|$)|(?!_)[\\s](_+)(?=notPunctSpace)|[\\s](_+)(?!_)(?=punct)|(?!_)punct(_+)(?!_)(?=punct)|(?:(?!_)punct|notPunctSpace)(_+)(?!_)(?=notPunctSpace)",Hv=ke(Lv,"gu").replace(/notPunctSpace/g,Si).replace(/punctSpace/g,os).replace(/punct/g,on).getRegex(),$v=ke(/^~~?(?:((?!~)punct)|[^\s~])/,"u").replace(/punct/g,on).getRegex(),Bv="^[^~]+(?=[^~])|(?!~)punct(~~?)(?=[\\s]|$)|notPunctSpace(~~?)(?!~)(?=punctSpace|$)|(?!~)punctSpace(~~?)(?=notPunctSpace)|[\\s](~~?)(?!~)(?=punct)|(?!~)punct(~~?)(?!~)(?=punct)|notPunctSpace(~~?)(?=notPunctSpace)",qv=ke(Bv,"gu").replace(/notPunctSpace/g,Si).replace(/punctSpace/g,os).replace(/punct/g,on).getRegex(),Gv=ke(/\\(punct)/,"gu").replace(/punct/g,on).getRegex(),Yv=ke(/^<(scheme:[^\s\x00-\x1f<>]*|email)>/).replace("scheme",/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/).replace("email",/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/).getRegex(),Xv=ke(Ou).replace("(?:-->|$)","-->").getRegex(),Qv=ke("^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\s\\S]*?\\]\\]>").replace("comment",Xv).replace("attribute",/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/).getRegex(),Vc=/(?:\[(?:\\[\s\S]|[^\[\]\\])*\]|\\[\s\S]|`+(?!`)[^`]*?`+(?!`)|``+(?=\])|[^\[\]\\`])*?/,Zv=ke(/^!?\[(label)\]\(\s*(href)(?:(?:[ \t]+(?:\n[ \t]*)?|\n[ \t]*)(title))?\s*\)/).replace("label",Vc).replace("href",/<(?:\\.|[^\n<>\\])+>|[^ \t\n\x00-\x1f]+|(?=\))/).replace("title",/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/).getRegex(),wp=ke(/^!?\[(label)\]\[(ref)\]/).replace("label",Vc).replace("ref",zu).getRegex(),Sp=ke(/^!?\[(ref)\](?:\[\])?/).replace("ref",zu).getRegex(),Vv=ke("reflink|nolink(?!\\()","g").replace("reflink",wp).replace("nolink",Sp).getRegex(),Rm=/[hH][tT][tT][pP][sS]?|[fF][tT][pP]/,Mu={_backpedal:pl,anyPunctuation:Gv,autolink:Yv,blockSkip:Ev,br:yp,code:bv,del:pl,delLDelim:pl,delRDelim:pl,emStrongLDelim:_v,emStrongRDelimAst:zv,emStrongRDelimUnd:Uv,escape:jv,link:Zv,nolink:Sp,punctuation:wv,reflink:wp,reflinkSearch:Vv,tag:Qv,text:Nv,url:pl},Kv={...Mu,emStrongLDelim:Rv,emStrongRDelimAst:Mv,emStrongRDelimUnd:Hv,link:ke(/^!?\[(label)\]\((.*?)\)/).replace("label",Vc).getRegex(),reflink:ke(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Vc).getRegex()},yu={...Mu,emStrongRDelimAst:Ov,emStrongLDelim:Av,delLDelim:$v,delRDelim:qv,url:ke(/^((?:protocol):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/).replace("protocol",Rm).replace("email",/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/).getRegex(),_backpedal:/(?:[^?!.,:;*_'"~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_'"~)]+(?!$))+/,del:/^(~~?)(?=[^\s~])((?:\\[\s\S]|[^\\])*?(?:\\[\s\S]|[^\s~\\]))\1(?=[^~]|$)/,text:ke(/^(`+|~+|[^`~])(?:(?=[`~])|(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|protocol:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/).replace("protocol",Rm).getRegex()},Jv={...yu,br:ke(yp).replace("{2,}","*").getRegex(),text:ke(yu.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()},Xc={normal:Du,gfm:vv,pedantic:yv},hi={normal:Mu,gfm:yu,breaks:Jv,pedantic:Kv},Iv={"&":"&","<":"<",">":">",'"':""","'":"'"},zm=s=>Iv[s];function Ha(s,c){if(c){if(Ot.escapeTest.test(s))return s.replace(Ot.escapeReplace,zm)}else if(Ot.escapeTestNoEncode.test(s))return s.replace(Ot.escapeReplaceNoEncode,zm);return s}function Om(s){try{s=encodeURI(s).replace(Ot.percentDecode,"%")}catch{return null}return s}function Dm(s,c){let u=s.replace(Ot.findPipe,(h,m,g)=>{let y=!1,x=m;for(;--x>=0&&g[x]==="\\";)y=!y;return y?"|":" |"}),o=u.split(Ot.splitPipe),d=0;if(o[0].trim()||o.shift(),o.length>0&&!o.at(-1)?.trim()&&o.pop(),c)if(o.length>c)o.splice(c);else for(;o.length<c;)o.push("");for(;d<o.length;d++)o[d]=o[d].trim().replace(Ot.slashPipe,"|");return o}function Gn(s,c,u){let o=s.length;if(o===0)return"";let d=0;for(;d<o&&s.charAt(o-d-1)===c;)d++;return s.slice(0,o-d)}function Mm(s){let c=s.split(`
|
|
12
|
+
`),u=c.length-1;for(;u>=0&&Ot.blankLine.test(c[u]);)u--;return c.length-u<=2?s:c.slice(0,u+1).join(`
|
|
13
|
+
`)}function Fv(s,c){if(s.indexOf(c[1])===-1)return-1;let u=0;for(let o=0;o<s.length;o++)if(s[o]==="\\")o++;else if(s[o]===c[0])u++;else if(s[o]===c[1]&&(u--,u<0))return o;return u>0?-2:-1}function Wv(s,c=0){let u=c,o="";for(let d of s)if(d===" "){let h=4-u%4;o+=" ".repeat(h),u+=h}else o+=d,u++;return o}function Um(s,c,u,o,d){let h=c.href,m=c.title||null,g=s[1].replace(d.other.outputLinkReplace,"$1"),y=s[0].charAt(0)==="!";o.state.inLink=!0;let x=o.state.linkEmitted,b=o.state.inRawBlock;o.state.linkEmitted=!1;let E=o.inlineTokens(g),N=o.state.linkEmitted;if(o.state.linkEmitted=x,o.state.inLink=!1,!y){if(N){o.state.inRawBlock=b;return}o.state.linkEmitted=!0}return{type:y?"image":"link",raw:u,href:h,title:m,text:g,tokens:E}}function Pv(s,c,u){let o=s.match(u.other.indentCodeCompensation);if(o===null)return c;let d=o[1];return c.split(`
|
|
14
|
+
`).map(h=>{let m=h.match(u.other.beginningSpace);if(m===null)return h;let[g]=m;return g.length>=d.length?h.slice(d.length):h}).join(`
|
|
15
|
+
`)}var Kc=class{options;rules;lexer;constructor(s){this.options=s||yl}space(s){let c=this.rules.block.newline.exec(s);if(c&&c[0].length>0)return{type:"space",raw:c[0]}}code(s){let c=this.rules.block.code.exec(s);if(c){let u=this.options.pedantic?c[0]:Mm(c[0]),o=u.replace(this.rules.other.codeRemoveIndent,"");return{type:"code",raw:u,codeBlockStyle:"indented",text:o}}}fences(s){let c=this.rules.block.fences.exec(s);if(c){let u=c[0],o=Pv(u,c[3]||"",this.rules);return{type:"code",raw:u,lang:c[2]?c[2].trim().replace(this.rules.inline.anyPunctuation,"$1"):c[2],text:o}}}heading(s){let c=this.rules.block.heading.exec(s);if(c){let u=c[2].trim();if(this.rules.other.endingHash.test(u)){let o=Gn(u,"#");(this.options.pedantic||!o||this.rules.other.endingSpaceChar.test(o))&&(u=o.trim())}return{type:"heading",raw:Gn(c[0],`
|
|
16
|
+
`),depth:c[1].length,text:u,tokens:this.lexer.inline(u)}}}hr(s){let c=this.rules.block.hr.exec(s);if(c)return{type:"hr",raw:Gn(c[0],`
|
|
17
|
+
`)}}blockquote(s){let c=this.rules.block.blockquote.exec(s);if(c){let u=Gn(c[0],`
|
|
18
|
+
`).split(`
|
|
19
|
+
`),o="",d="",h=[];for(;u.length>0;){let m=!1,g=[],y;for(y=0;y<u.length;y++)if(this.rules.other.blockquoteStart.test(u[y]))g.push(u[y]),m=!0;else if(!m)g.push(u[y]);else break;u=u.slice(y);let x=g.join(`
|
|
20
|
+
`),b=x.replace(this.rules.other.blockquoteSetextReplace,`
|
|
21
|
+
$1`).replace(this.rules.other.blockquoteSetextReplace2,"");o=o?`${o}
|
|
22
|
+
${x}`:x,d=d?`${d}
|
|
23
|
+
${b}`:b;let E=this.lexer.state.top;if(this.lexer.state.top=!0,this.lexer.blockTokens(b,h,!0),this.lexer.state.top=E,u.length===0)break;let N=h.at(-1);if(N?.type==="code")break;if(N?.type==="blockquote"){let L=N,z=u.join(`
|
|
24
|
+
`),F=L.raw+`
|
|
25
|
+
`+z.replace(this.rules.other.blockquoteSetextReplace2,""),_=this.blockquote(F);h[h.length-1]=_,o=`${o}
|
|
26
|
+
${z}`,d=d.substring(0,d.length-L.text.length)+_.text;break}else if(N?.type==="list"){let L=N,z=L.raw+`
|
|
27
|
+
`+u.join(`
|
|
28
|
+
`),F=this.list(z);h[h.length-1]=F,o=o.substring(0,o.length-N.raw.length)+F.raw,d=d.substring(0,d.length-L.raw.length)+F.raw,u=z.substring(h.at(-1).raw.length).split(`
|
|
29
|
+
`);continue}}return{type:"blockquote",raw:o,tokens:h,text:d}}}list(s){let c=this.rules.block.list.exec(s);if(c){let u=c[1].trim(),o=u.length>1,d={type:"list",raw:"",ordered:o,start:o?+u.slice(0,-1):"",loose:!1,items:[]};u=o?`\\d{1,9}\\${u.slice(-1)}`:`\\${u}`,this.options.pedantic&&(u=o?u:"[*+-]");let h=this.rules.other.listItemRegex(u),m=!1;for(;s;){let y=!1,x="",b="";if(!(c=h.exec(s))||this.rules.block.hr.test(s))break;x=c[0],s=s.substring(x.length);let E=Wv(c[2].split(`
|
|
30
|
+
`,1)[0],c[1].length),N=s.split(`
|
|
31
|
+
`,1)[0],L=!E.trim(),z=0;if(this.options.pedantic?(z=2,b=E.trimStart()):L?z=c[1].length+1:(z=E.search(this.rules.other.nonSpaceChar),z=z>4?1:z,b=E.slice(z),z+=c[1].length),L&&this.rules.other.blankLine.test(N)&&(x+=N+`
|
|
32
|
+
`,s=s.substring(N.length+1),y=!0),!y){let F=this.rules.other.nextBulletRegex(z),_=this.rules.other.hrRegex(z),T=this.rules.other.fencesBeginRegex(z),ee=this.rules.other.headingBeginRegex(z),le=this.rules.other.htmlBeginRegex(z),B=this.rules.other.blockquoteBeginRegex(z);for(;s;){let I=s.split(`
|
|
33
|
+
`,1)[0],A;if(N=I,this.options.pedantic?(N=N.replace(this.rules.other.listReplaceNesting," "),A=N):A=N.replace(this.rules.other.tabCharGlobal," "),T.test(N)||ee.test(N)||le.test(N)||B.test(N)||F.test(N)||_.test(N))break;if(A.search(this.rules.other.nonSpaceChar)>=z||!N.trim())b+=`
|
|
34
|
+
`+A.slice(z);else{if(L||E.replace(this.rules.other.tabCharGlobal," ").search(this.rules.other.nonSpaceChar)>=4||T.test(E)||ee.test(E)||_.test(E))break;b+=`
|
|
35
|
+
`+N}L=!N.trim(),x+=I+`
|
|
36
|
+
`,s=s.substring(I.length+1),E=A.slice(z)}}d.loose||(m?d.loose=!0:this.rules.other.doubleBlankLine.test(x)&&(m=!0)),d.items.push({type:"list_item",raw:x,task:!!this.options.gfm&&this.rules.other.listIsTask.test(b),loose:!1,text:b,tokens:[]}),d.raw+=x}let g=d.items.at(-1);if(g)g.raw=g.raw.trimEnd(),g.text=g.text.trimEnd();else return;d.raw=d.raw.trimEnd();for(let y of d.items)if(this.lexer.state.top=!1,y.tokens=this.lexer.blockTokens(y.text,[]),!d.loose){let x=y.tokens.filter(E=>E.type==="space"),b=x.length>0&&x.some(E=>this.rules.other.anyLine.test(E.raw));d.loose=b}for(let y of d.items){let x=y.tokens[0];if(y.task&&(x?.type==="text"||x?.type==="paragraph")){y.text=y.text.replace(this.rules.other.listReplaceTask,""),x.raw=x.raw.replace(this.rules.other.listReplaceTask,""),x.text=x.text.replace(this.rules.other.listReplaceTask,"");for(let E=this.lexer.inlineQueue.length-1;E>=0;E--)if(this.rules.other.listIsTask.test(this.lexer.inlineQueue[E].src)){this.lexer.inlineQueue[E].src=this.lexer.inlineQueue[E].src.replace(this.rules.other.listReplaceTask,"");break}let b=this.rules.other.listTaskCheckbox.exec(y.raw);if(b){let E={type:"checkbox",raw:b[0]+" ",checked:b[0]!=="[ ]"};y.checked=E.checked,d.loose?y.tokens[0]&&["paragraph","text"].includes(y.tokens[0].type)&&"tokens"in y.tokens[0]&&y.tokens[0].tokens?(y.tokens[0].raw=E.raw+y.tokens[0].raw,y.tokens[0].text=E.raw+y.tokens[0].text,y.tokens[0].tokens.unshift(E)):y.tokens.unshift({type:"paragraph",raw:E.raw,text:E.raw,tokens:[E]}):y.tokens.unshift(E)}}else y.task&&(y.task=!1)}if(d.loose)for(let y of d.items){y.loose=!0;for(let x of y.tokens)x.type==="text"&&(x.type="paragraph")}return d}}html(s){let c=this.rules.block.html.exec(s);if(c){let u=Mm(c[0]);return{type:"html",block:!0,raw:u,pre:c[1]==="pre"||c[1]==="script"||c[1]==="style",text:u}}}def(s){let c=this.rules.block.def.exec(s);if(c){let u=c[1].toLowerCase().replace(this.rules.other.multipleSpaceGlobal," "),o=c[2]?c[2].replace(this.rules.other.hrefBrackets,"$1").replace(this.rules.inline.anyPunctuation,"$1"):"",d=c[3]?c[3].substring(1,c[3].length-1).replace(this.rules.inline.anyPunctuation,"$1"):c[3];return{type:"def",tag:u,raw:Gn(c[0],`
|
|
37
|
+
`),href:o,title:d}}}table(s){let c=this.rules.block.table.exec(s);if(!c||!this.rules.other.tableDelimiter.test(c[2]))return;let u=Dm(c[1]),o=c[2].replace(this.rules.other.tableAlignChars,"").split("|"),d=c[3]?.trim()?c[3].replace(this.rules.other.tableRowBlankLine,"").split(`
|
|
38
|
+
`):[],h={type:"table",raw:Gn(c[0],`
|
|
39
|
+
`),header:[],align:[],rows:[]};if(u.length===o.length){for(let m of o)this.rules.other.tableAlignRight.test(m)?h.align.push("right"):this.rules.other.tableAlignCenter.test(m)?h.align.push("center"):this.rules.other.tableAlignLeft.test(m)?h.align.push("left"):h.align.push(null);for(let m=0;m<u.length;m++)h.header.push({text:u[m],tokens:this.lexer.inline(u[m]),header:!0,align:h.align[m]});for(let m of d)h.rows.push(Dm(m,h.header.length).map((g,y)=>({text:g,tokens:this.lexer.inline(g),header:!1,align:h.align[y]})));return h}}lheading(s){let c=this.rules.block.lheading.exec(s);if(c){let u=c[1].trim();return{type:"heading",raw:Gn(c[0],`
|
|
40
|
+
`),depth:c[2].charAt(0)==="="?1:2,text:u,tokens:this.lexer.inline(u)}}}paragraph(s){let c=this.rules.block.paragraph.exec(s);if(c){let u=c[1].charAt(c[1].length-1)===`
|
|
41
|
+
`?c[1].slice(0,-1):c[1];return{type:"paragraph",raw:c[0],text:u,tokens:this.lexer.inline(u)}}}text(s){let c=this.rules.block.text.exec(s);if(c)return{type:"text",raw:c[0],text:c[0],tokens:this.lexer.inline(c[0])}}escape(s){let c=this.rules.inline.escape.exec(s);if(c)return{type:"escape",raw:c[0],text:c[1]}}tag(s){let c=this.rules.inline.tag.exec(s);if(c)return!this.lexer.state.inLink&&this.rules.other.startATag.test(c[0])?this.lexer.state.inLink=!0:this.lexer.state.inLink&&this.rules.other.endATag.test(c[0])&&(this.lexer.state.inLink=!1),!this.lexer.state.inRawBlock&&this.rules.other.startPreScriptTag.test(c[0])?this.lexer.state.inRawBlock=!0:this.lexer.state.inRawBlock&&this.rules.other.endPreScriptTag.test(c[0])&&(this.lexer.state.inRawBlock=!1),{type:"html",raw:c[0],inLink:this.lexer.state.inLink,inRawBlock:this.lexer.state.inRawBlock,block:!1,text:c[0]}}link(s){let c=this.rules.inline.link.exec(s);if(c){let u=c[2].trim();if(!this.options.pedantic&&this.rules.other.startAngleBracket.test(u)){if(!this.rules.other.endAngleBracket.test(u))return;let h=Gn(u.slice(0,-1),"\\");if((u.length-h.length)%2===0)return}else{let h=Fv(c[2],"()");if(h===-2)return;if(h>-1){let m=(c[0].indexOf("!")===0?5:4)+c[1].length+h;c[2]=c[2].substring(0,h),c[0]=c[0].substring(0,m).trim(),c[3]=""}}let o=c[2],d="";if(this.options.pedantic){let h=this.rules.other.pedanticHrefTitle.exec(o);h&&(o=h[1],d=h[3])}else d=c[3]?c[3].slice(1,-1):"";return o=o.trim(),this.rules.other.startAngleBracket.test(o)&&(this.options.pedantic&&!this.rules.other.endAngleBracket.test(u)?o=o.slice(1):o=o.slice(1,-1)),Um(c,{href:o&&o.replace(this.rules.inline.anyPunctuation,"$1"),title:d&&d.replace(this.rules.inline.anyPunctuation,"$1")},c[0],this.lexer,this.rules)}}reflink(s,c){let u;if((u=this.rules.inline.reflink.exec(s))||(u=this.rules.inline.nolink.exec(s))){let o=(u[2]||u[1]).replace(this.rules.other.multipleSpaceGlobal," "),d=c[o.toLowerCase()];if(!d){let h=u[0].charAt(0);return{type:"text",raw:h,text:h}}return Um(u,d,u[0],this.lexer,this.rules)}}emStrong(s,c,u=""){let o=this.rules.inline.emStrongLDelim.exec(s);if(!(!o||!o[1]&&!o[2]&&!o[3]&&!o[4]||o[4]&&u.match(this.rules.other.unicodeAlphaNumeric))&&(!(o[1]||o[3])||!u||this.rules.inline.punctuation.exec(u))){let d=[...o[0]].length-1,h,m,g=d,y=0,x=o[0][0],b=u===x,E=x==="*"?this.rules.inline.emStrongRDelimAst:this.rules.inline.emStrongRDelimUnd;for(E.lastIndex=0,c=c.slice(-1*s.length+d);(o=E.exec(c))!==null;){if(h=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!h)continue;if(m=[...h].length,o[3]||o[4]){g+=m;continue}else if(o[5]||o[6]){if(d%3&&!((d+m)%3)){y+=m;continue}if(b)break}if(g-=m,g>0)continue;m=Math.min(m,m+g+y);let N=[...o[0]][0].length,L=s.slice(0,d+o.index+N+m);if(Math.min(d,m)%2){let F=L.slice(1,-1);return{type:"em",raw:L,text:F,tokens:this.lexer.inlineTokens(F)}}let z=L.slice(2,-2);return{type:"strong",raw:L,text:z,tokens:this.lexer.inlineTokens(z)}}}}codespan(s){let c=this.rules.inline.code.exec(s);if(c){let u=c[2].replace(this.rules.other.newLineCharGlobal," "),o=this.rules.other.nonSpaceChar.test(u),d=this.rules.other.startingSpaceChar.test(u)&&this.rules.other.endingSpaceChar.test(u);return o&&d&&(u=u.substring(1,u.length-1)),{type:"codespan",raw:c[0],text:u}}}br(s){let c=this.rules.inline.br.exec(s);if(c)return{type:"br",raw:c[0]}}del(s,c,u=""){let o=this.rules.inline.delLDelim.exec(s);if(o&&(!o[1]||!u||this.rules.inline.punctuation.exec(u))){let d=[...o[0]].length-1,h,m,g=d,y=this.rules.inline.delRDelim;for(y.lastIndex=0,c=c.slice(-1*s.length+d);(o=y.exec(c))!==null;){if(h=o[1]||o[2]||o[3]||o[4]||o[5]||o[6],!h||(m=[...h].length,m!==d))continue;if(o[3]||o[4]){g+=m;continue}if(g-=m,g>0)continue;m=Math.min(m,m+g);let x=[...o[0]][0].length,b=s.slice(0,d+o.index+x+m),E=b.slice(d,-d);return{type:"del",raw:b,text:E,tokens:this.lexer.inlineTokens(E)}}}}autolink(s){let c=this.rules.inline.autolink.exec(s);if(c){let u,o;return c[2]==="@"?(u=c[1],o="mailto:"+u):(u=c[1],o=u),{type:"link",raw:c[0],text:u,href:o,tokens:[{type:"text",raw:u,text:u}]}}}url(s){let c;if(c=this.rules.inline.url.exec(s)){let u,o;if(c[2]==="@")u=c[0],o="mailto:"+u;else{let d;do d=c[0],c[0]=this.rules.inline._backpedal.exec(c[0])?.[0]??"";while(d!==c[0]);u=c[0],c[1]==="www."?o="http://"+c[0]:o=c[0]}return{type:"link",raw:c[0],text:u,href:o,tokens:[{type:"text",raw:u,text:u}]}}}inlineText(s){let c=this.rules.inline.text.exec(s);if(c){let u=this.lexer.state.inRawBlock;return{type:"text",raw:c[0],text:c[0],escaped:u}}}},Ea=class ju{tokens;options;state;inlineQueue;tokenizer;constructor(c){this.tokens=[],this.tokens.links=Object.create(null),this.options=c||yl,this.options.tokenizer=this.options.tokenizer||new Kc,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options,this.tokenizer.lexer=this,this.inlineQueue=[],this.state={inLink:!1,inRawBlock:!1,linkEmitted:!1,top:!0};let u={other:Ot,block:Xc.normal,inline:hi.normal};this.options.pedantic?(u.block=Xc.pedantic,u.inline=hi.pedantic):this.options.gfm&&(u.block=Xc.gfm,this.options.breaks?u.inline=hi.breaks:u.inline=hi.gfm),this.tokenizer.rules=u}static get rules(){return{block:Xc,inline:hi}}static lex(c,u){return new ju(u).lex(c)}static lexInline(c,u){return new ju(u).inlineTokens(c)}lex(c){c=c.replace(Ot.carriageReturn,`
|
|
42
|
+
`),this.blockTokens(c,this.tokens);for(let u=0;u<this.inlineQueue.length;u++){let o=this.inlineQueue[u];this.inlineTokens(o.src,o.tokens)}return this.inlineQueue=[],this.tokens}blockTokens(c,u=[],o=!1){this.tokenizer.lexer=this,this.options.pedantic&&(c=c.replace(Ot.tabCharGlobal," ").replace(Ot.spaceLine,""));let d=1/0;for(;c;){if(c.length<d)d=c.length;else{this.infiniteLoopError(c.charCodeAt(0));break}let h;if(this.options.extensions?.block?.some(g=>(h=g.call({lexer:this},c,u))?(c=c.substring(h.raw.length),u.push(h),!0):!1))continue;if(h=this.tokenizer.space(c)){c=c.substring(h.raw.length);let g=u.at(-1);h.raw.length===1&&g!==void 0?g.raw+=`
|
|
43
|
+
`:u.push(h);continue}if(h=this.tokenizer.code(c)){c=c.substring(h.raw.length);let g=u.at(-1);g?.type==="paragraph"||g?.type==="text"?(g.raw+=(g.raw.endsWith(`
|
|
44
|
+
`)?"":`
|
|
45
|
+
`)+h.raw,g.text+=`
|
|
46
|
+
`+h.text,this.inlineQueue.at(-1).src=g.text):u.push(h);continue}if(h=this.tokenizer.fences(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.heading(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.hr(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.blockquote(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.list(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.html(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.def(c)){c=c.substring(h.raw.length);let g=u.at(-1);g?.type==="paragraph"||g?.type==="text"?(g.raw+=(g.raw.endsWith(`
|
|
47
|
+
`)?"":`
|
|
48
|
+
`)+h.raw,g.text+=`
|
|
49
|
+
`+h.raw,this.inlineQueue.at(-1).src=g.text):this.tokens.links[h.tag]||(this.tokens.links[h.tag]={href:h.href,title:h.title},u.push(h));continue}if(h=this.tokenizer.table(c)){c=c.substring(h.raw.length),u.push(h);continue}if(h=this.tokenizer.lheading(c)){c=c.substring(h.raw.length),u.push(h);continue}let m=c;if(this.options.extensions?.startBlock){let g=1/0,y=c.slice(1),x;this.options.extensions.startBlock.forEach(b=>{x=b.call({lexer:this},y),typeof x=="number"&&x>=0&&(g=Math.min(g,x))}),g<1/0&&g>=0&&(m=c.substring(0,g+1))}if(this.state.top&&(h=this.tokenizer.paragraph(m))){let g=u.at(-1);o&&g?.type==="paragraph"?(g.raw+=(g.raw.endsWith(`
|
|
50
|
+
`)?"":`
|
|
51
|
+
`)+h.raw,g.text+=`
|
|
52
|
+
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):u.push(h),o=m.length!==c.length,c=c.substring(h.raw.length);continue}if(h=this.tokenizer.text(c)){c=c.substring(h.raw.length);let g=u.at(-1);g?.type==="text"?(g.raw+=(g.raw.endsWith(`
|
|
53
|
+
`)?"":`
|
|
54
|
+
`)+h.raw,g.text+=`
|
|
55
|
+
`+h.text,this.inlineQueue.pop(),this.inlineQueue.at(-1).src=g.text):u.push(h);continue}if(c){this.infiniteLoopError(c.charCodeAt(0));break}}return this.state.top=!0,u}inline(c,u=[]){return this.inlineQueue.push({src:c,tokens:u}),u}linkInText(c){if(!c.includes("["))return!1;let u=this.tokenizer.rules.inline.link;for(let o of c.matchAll(this.tokenizer.rules.inline.blockSkip))if(u.test(o[0])&&c.charAt(o.index-1)!=="!")return!0;for(let o of c.matchAll(this.tokenizer.rules.inline.reflinkSearch)){let d=o[0],h=d.lastIndexOf("[");if(!(d.charAt(0)==="!"||!Object.hasOwn(this.tokens.links,d.slice(h+1,-1)))&&!(h>1&&this.linkInText(d.slice(1,h-1))))return!0}return!1}inlineTokens(c,u=[]){this.tokenizer.lexer=this;let o=c;if(this.tokens.links&&c.includes("[")){let g=this.tokenizer.rules.inline.reflinkSearch,y=x=>{let b=x.lastIndexOf("[");if(!Object.hasOwn(this.tokens.links,x.slice(b+1,-1)))return x;if(b>1&&x.charAt(0)!=="!"){let E=x.slice(1,b-1);if(this.linkInText(E))return"["+E.replace(g,y)+"]["+"a".repeat(x.length-b-2)+"]"}return"["+"a".repeat(x.length-2)+"]"};o=o.replace(g,y)}o=o.replace(this.tokenizer.rules.inline.anyPunctuation,g=>"+".repeat(g.length)),o=o.replace(this.tokenizer.rules.inline.blockSkip,(g,y,x)=>{let b=x?x.length:0;return g.slice(0,b)+"["+"a".repeat(g.length-b-2)+"]"}),o=this.options.hooks?.emStrongMask?.call({lexer:this},o)??o;let d=!1,h="",m=1/0;for(;c;){if(c.length<m)m=c.length;else{this.infiniteLoopError(c.charCodeAt(0));break}d||(h=""),d=!1;let g;if(this.options.extensions?.inline?.some(x=>(g=x.call({lexer:this},c,u))?(c=c.substring(g.raw.length),u.push(g),!0):!1))continue;if(g=this.tokenizer.escape(c)){c=c.substring(g.raw.length),u.push(g);continue}if(g=this.tokenizer.tag(c)){c=c.substring(g.raw.length),u.push(g);continue}if(g=this.tokenizer.link(c)){c=c.substring(g.raw.length),u.push(g);continue}if(g=this.tokenizer.reflink(c,this.tokens.links)){c=c.substring(g.raw.length);let x=u.at(-1);g.type==="text"&&x?.type==="text"?(x.raw+=g.raw,x.text+=g.text):u.push(g);continue}if(g=this.tokenizer.emStrong(c,o,h)){c=c.substring(g.raw.length),u.push(g);continue}if(g=this.tokenizer.codespan(c)){c=c.substring(g.raw.length),u.push(g);continue}if(g=this.tokenizer.br(c)){c=c.substring(g.raw.length),u.push(g);continue}if(g=this.tokenizer.del(c,o,h)){c=c.substring(g.raw.length),u.push(g);continue}if(g=this.tokenizer.autolink(c)){c=c.substring(g.raw.length),u.push(g);continue}if(!this.state.inLink&&(g=this.tokenizer.url(c))){c=c.substring(g.raw.length),u.push(g);continue}let y=c;if(this.options.extensions?.startInline){let x=1/0,b=c.slice(1),E;this.options.extensions.startInline.forEach(N=>{E=N.call({lexer:this},b),typeof E=="number"&&E>=0&&(x=Math.min(x,E))}),x<1/0&&x>=0&&(y=c.substring(0,x+1))}if(g=this.tokenizer.inlineText(y)){c=c.substring(g.raw.length),g.raw.slice(-1)!=="_"&&(h=g.raw.slice(-1)),d=!0;let x=u.at(-1);x?.type==="text"?(x.raw+=g.raw,x.text+=g.text):u.push(g);continue}if(c){this.infiniteLoopError(c.charCodeAt(0));break}}return u}infiniteLoopError(c){let u="Infinite loop on byte: "+c;if(this.options.silent)console.error(u);else throw new Error(u)}},Jc=class{options;parser;constructor(s){this.options=s||yl}space(s){return""}code({text:s,lang:c,escaped:u}){let o=(c||"").match(Ot.notSpaceStart)?.[0],d=s.replace(Ot.endingNewline,"")+`
|
|
56
|
+
`;return o?'<pre><code class="language-'+Ha(o)+'">'+(u?d:Ha(d,!0))+`</code></pre>
|
|
57
|
+
`:"<pre><code>"+(u?d:Ha(d,!0))+`</code></pre>
|
|
58
|
+
`}blockquote({tokens:s}){return`<blockquote>
|
|
59
|
+
${this.parser.parse(s)}</blockquote>
|
|
60
|
+
`}html({text:s}){return s}def(s){return""}heading({tokens:s,depth:c}){return`<h${c}>${this.parser.parseInline(s)}</h${c}>
|
|
61
|
+
`}hr(s){return`<hr>
|
|
62
|
+
`}list(s){let c=s.ordered,u=s.start,o="";for(let m=0;m<s.items.length;m++){let g=s.items[m];o+=this.listitem(g)}let d=c?"ol":"ul",h=c&&u!==1?' start="'+u+'"':"";return"<"+d+h+`>
|
|
63
|
+
`+o+"</"+d+`>
|
|
64
|
+
`}listitem(s){return`<li>${this.parser.parse(s.tokens)}</li>
|
|
65
|
+
`}checkbox({checked:s}){return"<input "+(s?'checked="" ':"")+'disabled="" type="checkbox"> '}paragraph({tokens:s}){return`<p>${this.parser.parseInline(s)}</p>
|
|
66
|
+
`}table(s){let c="",u="";for(let d=0;d<s.header.length;d++)u+=this.tablecell(s.header[d]);c+=this.tablerow({text:u});let o="";for(let d=0;d<s.rows.length;d++){let h=s.rows[d];u="";for(let m=0;m<h.length;m++)u+=this.tablecell(h[m]);o+=this.tablerow({text:u})}return o&&(o=`<tbody>${o}</tbody>`),`<table>
|
|
67
|
+
<thead>
|
|
68
|
+
`+c+`</thead>
|
|
69
|
+
`+o+`</table>
|
|
70
|
+
`}tablerow({text:s}){return`<tr>
|
|
71
|
+
${s}</tr>
|
|
72
|
+
`}tablecell(s){let c=this.parser.parseInline(s.tokens),u=s.header?"th":"td";return(s.align?`<${u} align="${s.align}">`:`<${u}>`)+c+`</${u}>
|
|
73
|
+
`}strong({tokens:s}){return`<strong>${this.parser.parseInline(s)}</strong>`}em({tokens:s}){return`<em>${this.parser.parseInline(s)}</em>`}codespan({text:s}){return`<code>${Ha(s,!0)}</code>`}br(s){return"<br>"}del({tokens:s}){return`<del>${this.parser.parseInline(s)}</del>`}link({href:s,title:c,tokens:u}){let o=this.parser.parseInline(u),d=Om(s);if(d===null)return o;s=d;let h='<a href="'+s+'"';return c&&(h+=' title="'+Ha(c)+'"'),h+=">"+o+"</a>",h}image({href:s,title:c,text:u,tokens:o}){o&&(u=this.parser.parseInline(o,this.parser.textRenderer));let d=Om(s);if(d===null)return Ha(u);s=d;let h=`<img src="${s}" alt="${Ha(u)}"`;return c&&(h+=` title="${Ha(c)}"`),h+=">",h}text(s){return"tokens"in s&&s.tokens?this.parser.parseInline(s.tokens):"escaped"in s&&s.escaped?s.text:Ha(s.text)}},Uu=class{strong({text:s}){return s}em({text:s}){return s}codespan({text:s}){return s}del({text:s}){return s}html({text:s}){return s}text({text:s}){return s}link({text:s}){return""+s}image({text:s}){return""+s}br(){return""}checkbox({raw:s}){return s}},_a=class bu{options;renderer;textRenderer;constructor(c){this.options=c||yl,this.options.renderer=this.options.renderer||new Jc,this.renderer=this.options.renderer,this.renderer.options=this.options,this.renderer.parser=this,this.textRenderer=new Uu}static parse(c,u){return new bu(u).parse(c)}static parseInline(c,u){return new bu(u).parseInline(c)}parse(c){this.renderer.parser=this;let u="";for(let o=0;o<c.length;o++){let d=c[o];if(this.options.extensions?.renderers?.[d.type]){let m=d,g=this.options.extensions.renderers[m.type].call({parser:this},m);if(g!==!1||!["space","hr","heading","code","table","blockquote","list","checkbox","html","def","paragraph","text"].includes(m.type)){u+=g||"";continue}}let h=d;switch(h.type){case"space":{u+=this.renderer.space(h);break}case"hr":{u+=this.renderer.hr(h);break}case"heading":{u+=this.renderer.heading(h);break}case"code":{u+=this.renderer.code(h);break}case"table":{u+=this.renderer.table(h);break}case"blockquote":{u+=this.renderer.blockquote(h);break}case"list":{u+=this.renderer.list(h);break}case"checkbox":{u+=this.renderer.checkbox(h);break}case"html":{u+=this.renderer.html(h);break}case"def":{u+=this.renderer.def(h);break}case"paragraph":{u+=this.renderer.paragraph(h);break}case"text":{u+=this.renderer.text(h);break}default:{let m='Token with "'+h.type+'" type was not found.';if(this.options.silent)return console.error(m),"";throw new Error(m)}}}return u}parseInline(c,u=this.renderer){this.renderer.parser=this;let o="";for(let d=0;d<c.length;d++){let h=c[d];if(this.options.extensions?.renderers?.[h.type]){let g=this.options.extensions.renderers[h.type].call({parser:this},h);if(g!==!1||!["escape","html","link","image","checkbox","strong","em","codespan","br","del","text"].includes(h.type)){o+=g||"";continue}}let m=h;switch(m.type){case"escape":{o+=u.text(m);break}case"html":{o+=u.html(m);break}case"link":{o+=u.link(m);break}case"image":{o+=u.image(m);break}case"checkbox":{o+=u.checkbox(m);break}case"strong":{o+=u.strong(m);break}case"em":{o+=u.em(m);break}case"codespan":{o+=u.codespan(m);break}case"br":{o+=u.br(m);break}case"del":{o+=u.del(m);break}case"text":{o+=u.text(m);break}default:{let g='Token with "'+m.type+'" type was not found.';if(this.options.silent)return console.error(g),"";throw new Error(g)}}}return o}},xi=class{options;block;constructor(s){this.options=s||yl}static passThroughHooks=new Set(["preprocess","postprocess","processAllTokens","emStrongMask"]);static passThroughHooksRespectAsync=new Set(["preprocess","postprocess","processAllTokens"]);preprocess(s){return s}postprocess(s){return s}processAllTokens(s){return s}emStrongMask(s){return s}provideLexer(s=this.block){return s?Ea.lex:Ea.lexInline}provideParser(s=this.block){return s?_a.parse:_a.parseInline}},ey=class{defaults=Au();options=this.setOptions;parse=this.parseMarkdown(!0);parseInline=this.parseMarkdown(!1);Parser=_a;Renderer=Jc;TextRenderer=Uu;Lexer=Ea;Tokenizer=Kc;Hooks=xi;constructor(...s){this.use(...s)}walkTokens(s,c){let u=[];for(let o of s)switch(u=u.concat(c.call(this,o)),o.type){case"table":{let d=o;for(let h of d.header)u=u.concat(this.walkTokens(h.tokens,c));for(let h of d.rows)for(let m of h)u=u.concat(this.walkTokens(m.tokens,c));break}case"list":{let d=o;u=u.concat(this.walkTokens(d.items,c));break}default:{let d=o;this.defaults.extensions?.childTokens?.[d.type]?this.defaults.extensions.childTokens[d.type].forEach(h=>{let m=d[h].flat(1/0);u=u.concat(this.walkTokens(m,c))}):d.tokens&&(u=u.concat(this.walkTokens(d.tokens,c)))}}return u}use(...s){let c=this.defaults.extensions||{renderers:{},childTokens:{}};return s.forEach(u=>{let o={...u};if(o.async=this.defaults.async||o.async||!1,u.extensions&&(u.extensions.forEach(d=>{if(!d.name)throw new Error("extension name required");if("renderer"in d){let h=c.renderers[d.name];h?c.renderers[d.name]=function(...m){let g=d.renderer.apply(this,m);return g===!1&&(g=h.apply(this,m)),g}:c.renderers[d.name]=d.renderer}if("tokenizer"in d){if(!d.level||d.level!=="block"&&d.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");let h=c[d.level];h?h.unshift(d.tokenizer):c[d.level]=[d.tokenizer],d.start&&(d.level==="block"?c.startBlock?c.startBlock.push(d.start):c.startBlock=[d.start]:d.level==="inline"&&(c.startInline?c.startInline.push(d.start):c.startInline=[d.start]))}"childTokens"in d&&d.childTokens&&(c.childTokens[d.name]=d.childTokens)}),o.extensions=c),u.renderer){let d=this.defaults.renderer||new Jc(this.defaults);for(let h in u.renderer){if(!(h in d))throw new Error(`renderer '${h}' does not exist`);if(["options","parser"].includes(h))continue;let m=h,g=u.renderer[m],y=d[m];d[m]=(...x)=>{let b=g.apply(d,x);return b===!1&&(b=y.apply(d,x)),b||""}}o.renderer=d}if(u.tokenizer){let d=this.defaults.tokenizer||new Kc(this.defaults);for(let h in u.tokenizer){if(!(h in d))throw new Error(`tokenizer '${h}' does not exist`);if(["options","rules","lexer"].includes(h))continue;let m=h,g=u.tokenizer[m],y=d[m];d[m]=(...x)=>{let b=g.apply(d,x);return b===!1&&(b=y.apply(d,x)),b}}o.tokenizer=d}if(u.hooks){let d=this.defaults.hooks||new xi;for(let h in u.hooks){if(!(h in d))throw new Error(`hook '${h}' does not exist`);if(["options","block"].includes(h))continue;let m=h,g=u.hooks[m],y=d[m];xi.passThroughHooks.has(h)?d[m]=x=>{if(this.defaults.async&&xi.passThroughHooksRespectAsync.has(h))return(async()=>{let E=await g.call(d,x);return y.call(d,E)})();let b=g.call(d,x);return y.call(d,b)}:d[m]=(...x)=>{if(this.defaults.async)return(async()=>{let E=await g.apply(d,x);return E===!1&&(E=await y.apply(d,x)),E})();let b=g.apply(d,x);return b===!1&&(b=y.apply(d,x)),b}}o.hooks=d}if(u.walkTokens){let d=this.defaults.walkTokens,h=u.walkTokens;o.walkTokens=function(m){let g=[];return g.push(h.call(this,m)),d&&(g=g.concat(d.call(this,m))),g}}this.defaults={...this.defaults,...o}}),this}setOptions(s){return this.defaults={...this.defaults,...s},this}lexer(s,c){return Ea.lex(s,c??this.defaults)}parser(s,c){return _a.parse(s,c??this.defaults)}parseMarkdown(s){return(c,u)=>{let o={...u},d={...this.defaults,...o},h=this.onError(!!d.silent,!!d.async);if(this.defaults.async===!0&&o.async===!1)return h(new Error("marked(): The async option was set to true by an extension. Remove async: false from the parse options object to return a Promise."));if(typeof c>"u"||c===null)return h(new Error("marked(): input parameter is undefined or null"));if(typeof c!="string")return h(new Error("marked(): input parameter is of type "+Object.prototype.toString.call(c)+", string expected"));if(d.hooks&&(d.hooks.options=d,d.hooks.block=s),d.async)return(async()=>{let m=d.hooks?await d.hooks.preprocess(c):c,g=await(d.hooks?await d.hooks.provideLexer(s):s?Ea.lex:Ea.lexInline)(m,d),y=d.hooks?await d.hooks.processAllTokens(g):g;d.walkTokens&&await Promise.all(this.walkTokens(y,d.walkTokens));let x=await(d.hooks?await d.hooks.provideParser(s):s?_a.parse:_a.parseInline)(y,d);return d.hooks?await d.hooks.postprocess(x):x})().catch(h);try{d.hooks&&(c=d.hooks.preprocess(c));let m=(d.hooks?d.hooks.provideLexer(s):s?Ea.lex:Ea.lexInline)(c,d);d.hooks&&(m=d.hooks.processAllTokens(m)),d.walkTokens&&this.walkTokens(m,d.walkTokens);let g=(d.hooks?d.hooks.provideParser(s):s?_a.parse:_a.parseInline)(m,d);return d.hooks&&(g=d.hooks.postprocess(g)),g}catch(m){return h(m)}}}onError(s,c){return u=>{if(u.message+=`
|
|
74
|
+
Please report this to https://github.com/markedjs/marked.`,s){let o="<p>An error occurred:</p><pre>"+Ha(u.message+"",!0)+"</pre>";return c?Promise.resolve(o):o}if(c)return Promise.reject(u);throw u}}},xl=new ey;function Oe(s,c){return xl.parse(s,c)}Oe.options=Oe.setOptions=function(s){return xl.setOptions(s),Oe.defaults=xl.defaults,pp(Oe.defaults),Oe};Oe.getDefaults=Au;Oe.defaults=yl;function ty(...s){return xl.use(...s),Oe.defaults=xl.defaults,pp(Oe.defaults),Oe}Oe.use=ty;Oe.walkTokens=function(s,c){return xl.walkTokens(s,c)};Oe.parseInline=xl.parseInline;Oe.Parser=_a;Oe.parser=_a.parse;Oe.Renderer=Jc;Oe.TextRenderer=Uu;Oe.Lexer=Ea;Oe.lexer=Ea.lex;Oe.Tokenizer=Kc;Oe.Hooks=xi;Oe.parse=Oe;Oe.options;Oe.setOptions;Oe.walkTokens;Oe.parseInline;_a.parse;Ea.lex;function Lm(s,c){(c==null||c>s.length)&&(c=s.length);for(var u=0,o=Array(c);u<c;u++)o[u]=s[u];return o}function ay(s){if(Array.isArray(s))return s}function ny(s,c){var u=s==null?null:typeof Symbol<"u"&&s[Symbol.iterator]||s["@@iterator"];if(u!=null){var o,d,h,m,g=[],y=!0,x=!1;try{if(h=(u=u.call(s)).next,c!==0)for(;!(y=(o=h.call(u)).done)&&(g.push(o.value),g.length!==c);y=!0);}catch(b){x=!0,d=b}finally{try{if(!y&&u.return!=null&&(m=u.return(),Object(m)!==m))return}finally{if(x)throw d}}return g}}function ly(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
75
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function sy(s,c){return ay(s)||ny(s,c)||iy(s,c)||ly()}function iy(s,c){if(s){if(typeof s=="string")return Lm(s,c);var u={}.toString.call(s).slice(8,-1);return u==="Object"&&s.constructor&&(u=s.constructor.name),u==="Map"||u==="Set"?Array.from(s):u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u)?Lm(s,c):void 0}}const kp=Object.entries,Hm=Object.setPrototypeOf,cy=Object.isFrozen,ry=Object.getPrototypeOf,oy=Object.getOwnPropertyDescriptor;let vt=Object.freeze,bt=Object.seal,is=Object.create,Tp=typeof Reflect<"u"&&Reflect,Nu=Tp.apply,wu=Tp.construct;vt||(vt=function(c){return c});bt||(bt=function(c){return c});Nu||(Nu=function(c,u){for(var o=arguments.length,d=new Array(o>2?o-2:0),h=2;h<o;h++)d[h-2]=arguments[h];return c.apply(u,d)});wu||(wu=function(c){for(var u=arguments.length,o=new Array(u>1?u-1:0),d=1;d<u;d++)o[d-1]=arguments[d];return new c(...o)});const ml=ht(Array.prototype.forEach),uy=ht(Array.prototype.lastIndexOf),$m=ht(Array.prototype.pop),mi=ht(Array.prototype.push),dy=ht(Array.prototype.splice),rs=Array.isArray,vi=ht(String.prototype.toLowerCase),cu=ht(String.prototype.toString),Bm=ht(String.prototype.match),pi=ht(String.prototype.replace),qm=ht(String.prototype.indexOf),fy=ht(String.prototype.trim),hy=ht(Number.prototype.toString),my=ht(Boolean.prototype.toString),Gm=typeof BigInt>"u"?null:ht(BigInt.prototype.toString),Ym=typeof Symbol>"u"?null:ht(Symbol.prototype.toString),Gt=ht(Object.prototype.hasOwnProperty),gi=ht(Object.prototype.toString),zt=ht(RegExp.prototype.test),hl=py(TypeError);function ht(s){return function(c){c instanceof RegExp&&(c.lastIndex=0);for(var u=arguments.length,o=new Array(u>1?u-1:0),d=1;d<u;d++)o[d-1]=arguments[d];return Nu(s,c,o)}}function py(s){return function(){for(var c=arguments.length,u=new Array(c),o=0;o<c;o++)u[o]=arguments[o];return wu(s,u)}}function Me(s,c){let u=arguments.length>2&&arguments[2]!==void 0?arguments[2]:vi;if(Hm&&Hm(s,null),!rs(c))return s;let o=c.length;for(;o--;){let d=c[o];if(typeof d=="string"){const h=u(d);h!==d&&(cy(c)||(c[o]=h),d=h)}s[d]=!0}return s}function gy(s){for(let c=0;c<s.length;c++)Gt(s,c)||(s[c]=null);return s}function ea(s){const c=is(null);for(const o of kp(s)){var u=sy(o,2);const d=u[0],h=u[1];Gt(s,d)&&(rs(h)?c[d]=gy(h):h&&typeof h=="object"&&h.constructor===Object?c[d]=ea(h):c[d]=h)}return c}function xy(s){switch(typeof s){case"string":return s;case"number":return hy(s);case"boolean":return my(s);case"bigint":return Gm?Gm(s):"0";case"symbol":return Ym?Ym(s):"Symbol()";case"undefined":return gi(s);case"function":case"object":{if(s===null)return gi(s);const c=s,u=ka(c,"toString");if(typeof u=="function"){const o=u(c);return typeof o=="string"?o:gi(o)}return gi(s)}default:return gi(s)}}function ka(s,c){for(;s!==null;){const o=oy(s,c);if(o){if(o.get)return ht(o.get);if(typeof o.value=="function")return ht(o.value)}s=ry(s)}function u(){return null}return u}function vy(s){try{return zt(s,""),!0}catch{return!1}}const Xm=vt(["a","abbr","acronym","address","area","article","aside","audio","b","bdi","bdo","big","blink","blockquote","body","br","button","canvas","caption","center","cite","code","col","colgroup","content","data","datalist","dd","decorator","del","details","dfn","dialog","dir","div","dl","dt","element","em","fieldset","figcaption","figure","font","footer","form","h1","h2","h3","h4","h5","h6","head","header","hgroup","hr","html","i","img","input","ins","kbd","label","legend","li","main","map","mark","marquee","menu","menuitem","meter","nav","nobr","ol","optgroup","option","output","p","picture","pre","progress","q","rp","rt","ruby","s","samp","search","section","select","shadow","slot","small","source","spacer","span","strike","strong","style","sub","summary","sup","table","tbody","td","template","textarea","tfoot","th","thead","time","tr","track","tt","u","ul","var","video","wbr"]),ru=vt(["svg","a","altglyph","altglyphdef","altglyphitem","animatecolor","animatemotion","animatetransform","circle","clippath","defs","desc","ellipse","enterkeyhint","exportparts","filter","font","g","glyph","glyphref","hkern","image","inputmode","line","lineargradient","marker","mask","metadata","mpath","part","path","pattern","polygon","polyline","radialgradient","rect","stop","style","switch","symbol","text","textpath","title","tref","tspan","view","vkern"]),ou=vt(["feBlend","feColorMatrix","feComponentTransfer","feComposite","feConvolveMatrix","feDiffuseLighting","feDisplacementMap","feDistantLight","feDropShadow","feFlood","feFuncA","feFuncB","feFuncG","feFuncR","feGaussianBlur","feImage","feMerge","feMergeNode","feMorphology","feOffset","fePointLight","feSpecularLighting","feSpotLight","feTile","feTurbulence"]),yy=vt(["animate","color-profile","cursor","discard","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","foreignobject","hatch","hatchpath","mesh","meshgradient","meshpatch","meshrow","missing-glyph","script","set","solidcolor","unknown","use"]),uu=vt(["math","menclose","merror","mfenced","mfrac","mglyph","mi","mlabeledtr","mmultiscripts","mn","mo","mover","mpadded","mphantom","mroot","mrow","ms","mspace","msqrt","mstyle","msub","msup","msubsup","mtable","mtd","mtext","mtr","munder","munderover","mprescripts"]),jy=vt(["maction","maligngroup","malignmark","mlongdiv","mscarries","mscarry","msgroup","mstack","msline","msrow","semantics","annotation","annotation-xml","mprescripts","none"]),Qm=vt(["#text"]),Zm=vt(["accept","action","align","alt","autocapitalize","autocomplete","autopictureinpicture","autoplay","background","bgcolor","border","capture","cellpadding","cellspacing","checked","cite","class","clear","color","cols","colspan","command","commandfor","controls","controlslist","coords","crossorigin","datetime","decoding","default","dir","disabled","disablepictureinpicture","disableremoteplayback","download","draggable","enctype","enterkeyhint","exportparts","face","for","headers","height","hidden","high","href","hreflang","id","inert","inputmode","integrity","ismap","kind","label","lang","list","loading","loop","low","max","maxlength","media","method","min","minlength","multiple","muted","name","nonce","noshade","novalidate","nowrap","open","optimum","part","pattern","placeholder","playsinline","popover","popovertarget","popovertargetaction","poster","preload","pubdate","radiogroup","readonly","rel","required","rev","reversed","role","rows","rowspan","spellcheck","scope","selected","shape","size","sizes","slot","span","srclang","start","src","srcset","step","style","summary","tabindex","title","translate","type","usemap","valign","value","width","wrap","xmlns"]),du=vt(["accent-height","accumulate","additive","alignment-baseline","amplitude","ascent","attributename","attributetype","azimuth","basefrequency","baseline-shift","begin","bias","by","class","clip","clippathunits","clip-path","clip-rule","color","color-interpolation","color-interpolation-filters","color-profile","color-rendering","cx","cy","d","dx","dy","diffuseconstant","direction","display","divisor","dominant-baseline","dur","edgemode","elevation","end","exponent","fill","fill-opacity","fill-rule","filter","filterunits","flood-color","flood-opacity","font-family","font-size","font-size-adjust","font-stretch","font-style","font-variant","font-weight","fx","fy","g1","g2","glyph-name","glyphref","gradientunits","gradienttransform","height","href","id","image-rendering","in","in2","intercept","k","k1","k2","k3","k4","kerning","keypoints","keysplines","keytimes","lang","lengthadjust","letter-spacing","kernelmatrix","kernelunitlength","lighting-color","local","marker-end","marker-mid","marker-start","markerheight","markerunits","markerwidth","maskcontentunits","maskunits","max","mask","mask-type","media","method","mode","min","name","numoctaves","offset","operator","opacity","order","orient","orientation","origin","overflow","paint-order","path","pathlength","patterncontentunits","patterntransform","patternunits","pointer-events","points","preservealpha","preserveaspectratio","primitiveunits","r","rx","ry","radius","refx","refy","repeatcount","repeatdur","restart","result","rotate","scale","seed","shape-rendering","slope","specularconstant","specularexponent","spreadmethod","startoffset","stddeviation","stitchtiles","stop-color","stop-opacity","stroke-dasharray","stroke-dashoffset","stroke-linecap","stroke-linejoin","stroke-miterlimit","stroke-opacity","stroke","stroke-width","style","surfacescale","systemlanguage","tabindex","tablevalues","targetx","targety","transform","transform-origin","text-anchor","text-decoration","text-orientation","text-rendering","textlength","type","u1","u2","unicode","values","vector-effect","viewbox","visibility","version","vert-adv-y","vert-origin-x","vert-origin-y","width","word-spacing","wrap","writing-mode","xchannelselector","ychannelselector","x","x1","x2","xmlns","y","y1","y2","z","zoomandpan"]),Vm=vt(["accent","accentunder","align","bevelled","close","columnalign","columnlines","columnspacing","columnspan","denomalign","depth","dir","display","displaystyle","encoding","fence","frame","height","href","id","largeop","length","linethickness","lquote","lspace","mathbackground","mathcolor","mathsize","mathvariant","maxsize","minsize","movablelimits","notation","numalign","open","rowalign","rowlines","rowspacing","rowspan","rspace","rquote","scriptlevel","scriptminsize","scriptsizemultiplier","selection","separator","separators","stretchy","subscriptshift","supscriptshift","symmetric","voffset","width","xmlns"]),Qc=vt(["xlink:href","xml:id","xlink:title","xml:space","xmlns:xlink"]),by=bt(/{{[\w\W]*|^[\w\W]*}}/g),Ny=bt(/<%[\w\W]*|^[\w\W]*%>/g),wy=bt(/\${[\w\W]*/g),Sy=bt(/^data-[\-\w.\u00B7-\uFFFF]+$/),ky=bt(/^aria-[\-\w]+$/),Km=bt(/^(?:(?:(?:f|ht)tps?|mailto|tel|callto|sms|cid|xmpp|matrix):|[^a-z]|[a-z+.\-]+(?:[^a-z+.\-:]|$))/i),Ty=bt(/^(?:\w+script|data):/i),Ey=bt(/[\u0000-\u0020\u00A0\u1680\u180E\u2000-\u2029\u205F\u3000]/g),_y=bt(/^html$/i),Ay=bt(/^[a-z][.\w]*(-[.\w]+)+$/i),Jm=bt(/<[/\w!]/g),Im=bt(/<[/\w]/g),Cy=bt(/<\/no(script|embed|frames)/i),Ry=bt(/\/>/i),Pt={element:1,attribute:2,text:3,cdataSection:4,entityReference:5,entityNode:6,processingInstruction:7,comment:8,document:9,documentType:10,documentFragment:11,notation:12},Ep=["style","script","xmp","iframe","noembed","noframes","plaintext","noscript"],zy=vt(Me({},Ep)),Oy=(function(){const s={};return ml(Ep,c=>{s[c]=bt(new RegExp("</"+c+"(?=[\\t\\n\\f\\r />])","i"))}),vt(s)})(),Dy=function(){return typeof window>"u"?null:window},My=function(c,u){if(typeof c!="object"||typeof c.createPolicy!="function")return null;let o=null;const d="data-tt-policy-suffix";u&&u.hasAttribute(d)&&(o=u.getAttribute(d));const h="dompurify"+(o?"#"+o:"");try{return c.createPolicy(h,{createHTML(m){return m},createScriptURL(m){return m}})}catch{return console.warn("TrustedTypes policy "+h+" could not be created."),null}},Fm=function(){return{afterSanitizeAttributes:[],afterSanitizeElements:[],afterSanitizeShadowDOM:[],beforeSanitizeAttributes:[],beforeSanitizeElements:[],beforeSanitizeShadowDOM:[],uponSanitizeAttribute:[],uponSanitizeElement:[],uponSanitizeShadowNode:[]}},Yn=function(c,u,o,d){return Gt(c,u)&&rs(c[u])?Me(d.base?ea(d.base):{},c[u],d.transform):o},fu=function(c,u,o){const d=Gt(c,u)?c[u]:void 0;return d&&typeof d=="object"?ea(d):o()};function _p(){let s=arguments.length>0&&arguments[0]!==void 0?arguments[0]:Dy();const c=W=>_p(W);if(c.version="3.4.14",c.removed=[],!s||!s.document||s.document.nodeType!==Pt.document||!s.Element)return c.isSupported=!1,c;let u=s.document;const o=u,d=o.currentScript;s.DocumentFragment;const h=s.HTMLTemplateElement,m=s.Node,g=s.Element,y=s.NodeFilter,x=s.NamedNodeMap;x===void 0&&(s.NamedNodeMap||s.MozNamedAttrMap),s.HTMLFormElement;const b=s.DOMParser,E=s.trustedTypes,N=g.prototype,L=ka(N,"cloneNode"),z=ka(N,"remove"),F=ka(N,"nextSibling"),_=ka(N,"childNodes"),T=ka(N,"parentNode"),ee=ka(N,"shadowRoot"),le=ka(N,"attributes"),B=m&&m.prototype?ka(m.prototype,"nodeType"):null,I=m&&m.prototype?ka(m.prototype,"nodeName"):null,A=m&&m.prototype?ka(m.prototype,"ownerDocument"):null,K=function(v){return B?B(v):v.nodeType},te=function(v){return I?I(v):v.nodeName};if(typeof h=="function"){const W=u.createElement("template");W.content&&W.content.ownerDocument&&(u=W.content.ownerDocument)}let U,ue="",me,$=!1,ie=0;const be=function(){if(ie>0)throw hl('A configured TRUSTED_TYPES_POLICY callback (createHTML or createScriptURL) must not call DOMPurify.sanitize, as that causes infinite recursion. Do not pass a policy whose callbacks wrap DOMPurify as TRUSTED_TYPES_POLICY; see the "DOMPurify and Trusted Types" section of the README.')},Ie=function(v){be(),ie++;try{return U.createHTML(v)}finally{ie--}},q=function(v){be(),ie++;try{return U.createScriptURL(v)}finally{ie--}},ae=function(){return $||(me=My(E,d),$=!0),me},de=u,Re=de.implementation,Ne=de.createNodeIterator,k=de.createDocumentFragment,Z=de.getElementsByTagName,ne=o.importNode;let P=Fm();c.isSupported=typeof kp=="function"&&typeof T=="function"&&Re&&Re.createHTMLDocument!==void 0;const ge=by,ve=Ny,Ae=wy,mt=Sy,X=ky,ze=Ty,Ye=Ey,Pe=Ay;let aa=Km,De=null;const Xn=Me({},[...Xm,...ru,...ou,...uu,...Qm]);let Xe=null;const ds=Me({},[...Zm,...du,...Vm,...Qc]);let Yt=Object.seal(is(null,{tagNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeNameCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},allowCustomizedBuiltInElements:{writable:!0,configurable:!1,enumerable:!0,value:!1}})),Ba=null,jl=null;const na=Object.seal(is(null,{tagCheck:{writable:!0,configurable:!1,enumerable:!0,value:null},attributeCheck:{writable:!0,configurable:!1,enumerable:!0,value:null}}));let ki=!0,fs=!0,At=!1,Ti=!0,xa=!1,Aa=!0,la=!1,hs=!1,Qn=null,bl=null,ms=!1,sa=!1,yt=!1,Xt=!1,Ct=!0,Ei=!1;const _i="user-content-";let ps=!0,un=!1,va={},ya=null;const Ca=Me({},["annotation-xml","audio","colgroup","desc","foreignobject","head","iframe","math","mi","mn","mo","ms","mtext","noembed","noframes","noscript","plaintext","script","selectedcontent","style","svg","template","thead","title","video","xmp"]);let Zn=null;const dn=Me({},["audio","video","img","source","image","track"]);let Ai=null;const gs=Me({},["alt","class","for","id","label","name","pattern","placeholder","role","summary","title","value","style","xmlns"]),fn="http://www.w3.org/1998/Math/MathML",Ra="http://www.w3.org/2000/svg",ia="http://www.w3.org/1999/xhtml";let qa=ia,Nl=!1,wl=null;const xs=Me({},[fn,Ra,ia],cu),Sl=vt(["mi","mo","mn","ms","mtext"]);let kl=Me({},Sl);const vs=vt(["annotation-xml"]);let ca=Me({},vs);const pt=Me({},["title","style","font","a","script"]);let it=null;const hn=["application/xhtml+xml","text/html"],ys="text/html";let tt=null,mn=null;const Ci=u.createElement("form"),pn=function(v){return v instanceof RegExp||v instanceof Function},Vn=function(){let v=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};if(mn&&mn===v)return;(!v||typeof v!="object")&&(v={}),v=ea(v),it=hn.indexOf(v.PARSER_MEDIA_TYPE)===-1?ys:v.PARSER_MEDIA_TYPE,tt=it==="application/xhtml+xml"?cu:vi,De=Yn(v,"ALLOWED_TAGS",Xn,{transform:tt}),Xe=Yn(v,"ALLOWED_ATTR",ds,{transform:tt}),wl=Yn(v,"ALLOWED_NAMESPACES",xs,{transform:cu}),Ai=Yn(v,"ADD_URI_SAFE_ATTR",gs,{transform:tt,base:gs}),Zn=Yn(v,"ADD_DATA_URI_TAGS",dn,{transform:tt,base:dn}),ya=Yn(v,"FORBID_CONTENTS",Ca,{transform:tt}),Ba=Yn(v,"FORBID_TAGS",ea({}),{transform:tt}),jl=Yn(v,"FORBID_ATTR",ea({}),{transform:tt}),va=Gt(v,"USE_PROFILES")?v.USE_PROFILES&&typeof v.USE_PROFILES=="object"?ea(v.USE_PROFILES):v.USE_PROFILES:!1,ki=v.ALLOW_ARIA_ATTR!==!1,fs=v.ALLOW_DATA_ATTR!==!1,At=v.ALLOW_UNKNOWN_PROTOCOLS||!1,Ti=v.ALLOW_SELF_CLOSE_IN_ATTR!==!1,xa=v.SAFE_FOR_TEMPLATES||!1,Aa=v.SAFE_FOR_XML!==!1,la=v.WHOLE_DOCUMENT||!1,sa=v.RETURN_DOM||!1,yt=v.RETURN_DOM_FRAGMENT||!1,Xt=v.RETURN_TRUSTED_TYPE||!1,ms=v.FORCE_BODY||!1,Ct=v.SANITIZE_DOM!==!1,Ei=v.SANITIZE_NAMED_PROPS||!1,ps=v.KEEP_CONTENT!==!1,un=v.IN_PLACE||!1,aa=vy(v.ALLOWED_URI_REGEXP)?v.ALLOWED_URI_REGEXP:Km,qa=typeof v.NAMESPACE=="string"?v.NAMESPACE:ia,kl=fu(v,"MATHML_TEXT_INTEGRATION_POINTS",()=>Me({},Sl)),ca=fu(v,"HTML_INTEGRATION_POINTS",()=>Me({},vs));const C=fu(v,"CUSTOM_ELEMENT_HANDLING",()=>is(null));if(Yt=is(null),Gt(C,"tagNameCheck")&&pn(C.tagNameCheck)&&(Yt.tagNameCheck=C.tagNameCheck),Gt(C,"attributeNameCheck")&&pn(C.attributeNameCheck)&&(Yt.attributeNameCheck=C.attributeNameCheck),Gt(C,"allowCustomizedBuiltInElements")&&typeof C.allowCustomizedBuiltInElements=="boolean"&&(Yt.allowCustomizedBuiltInElements=C.allowCustomizedBuiltInElements),bt(Yt),xa&&(fs=!1),yt&&(sa=!0),va&&(De=Me({},Qm),Xe=is(null),va.html===!0&&(Me(De,Xm),Me(Xe,Zm)),va.svg===!0&&(Me(De,ru),Me(Xe,du),Me(Xe,Qc)),va.svgFilters===!0&&(Me(De,ou),Me(Xe,du),Me(Xe,Qc)),va.mathMl===!0&&(Me(De,uu),Me(Xe,Vm),Me(Xe,Qc))),na.tagCheck=null,na.attributeCheck=null,Gt(v,"ADD_TAGS")&&(typeof v.ADD_TAGS=="function"?na.tagCheck=v.ADD_TAGS:rs(v.ADD_TAGS)&&(De===Xn&&(De=ea(De)),Me(De,v.ADD_TAGS,tt))),Gt(v,"ADD_ATTR")&&(typeof v.ADD_ATTR=="function"?na.attributeCheck=v.ADD_ATTR:rs(v.ADD_ATTR)&&(Xe===ds&&(Xe=ea(Xe)),Me(Xe,v.ADD_ATTR,tt))),Gt(v,"ADD_FORBID_CONTENTS")&&rs(v.ADD_FORBID_CONTENTS)&&(ya===Ca&&(ya=ea(ya)),Me(ya,v.ADD_FORBID_CONTENTS,tt)),ps&&(De["#text"]=!0),la&&Me(De,["html","head","body"]),De.table&&(Me(De,["tbody"]),delete Ba.tbody),v.TRUSTED_TYPES_POLICY){if(typeof v.TRUSTED_TYPES_POLICY.createHTML!="function")throw hl('TRUSTED_TYPES_POLICY configuration option must provide a "createHTML" hook.');if(typeof v.TRUSTED_TYPES_POLICY.createScriptURL!="function")throw hl('TRUSTED_TYPES_POLICY configuration option must provide a "createScriptURL" hook.');const J=U;U=v.TRUSTED_TYPES_POLICY;try{ue=Ie("")}catch(se){throw U=J,se}}else v.TRUSTED_TYPES_POLICY===null?(U=void 0,ue=""):(U===void 0&&(U=ae()),U&&typeof ue=="string"&&(ue=Ie("")));vt&&vt(v),mn=v},Ga=Me({},[...ru,...ou,...yy]),Ya=Me({},[...uu,...jy]),Kn=function(v,C,J){return C.namespaceURI===ia?v==="svg":C.namespaceURI===fn?v==="svg"&&(J==="annotation-xml"||kl[J]):!!Ga[v]},gn=function(v,C,J){return C.namespaceURI===ia?v==="math":C.namespaceURI===Ra?v==="math"&&ca[J]:!!Ya[v]},ct=function(v,C,J){return C.namespaceURI===Ra&&!ca[J]||C.namespaceURI===fn&&!kl[J]?!1:!Ya[v]&&(pt[v]||!Ga[v])},Ri=function(v){let C=T(v);(!C||!C.tagName)&&(C={namespaceURI:qa,tagName:"template"});const J=vi(v.tagName),se=vi(C.tagName);return wl[v.namespaceURI]?v.namespaceURI===Ra?Kn(J,C,se):v.namespaceURI===fn?gn(J,C,se):v.namespaceURI===ia?ct(J,C,se):!!(it==="application/xhtml+xml"&&wl[v.namespaceURI]):!1},ja=function(v){mi(c.removed,{element:v});try{T(v).removeChild(v)}catch{if(z(v),!T(v))throw hl("a node selected for removal could not be detached from its tree and cannot be safely returned; refusing to sanitize in place")}},za=function(v,C,J){try{v.removeAttributeNode(C)}catch{try{v.removeAttribute(J)}catch{}}},ba=function(v){Jn(v);const C=_(v);if(C){const se=[];ml(C,ce=>{mi(se,ce)}),ml(se,ce=>{try{z(ce)}catch{}})}const J=le(v);if(J)for(let se=J.length-1;se>=0;--se){const ce=J[se],he=ce&&ce.name;typeof he=="string"&&za(v,ce,he)}},Xa=function(v,C,J){if(!J)try{J=C.getAttributeNode(v)}catch{J=null}mi(c.removed,{attribute:J||null,from:C});try{J?C.removeAttributeNode(J):C.removeAttribute(v)}catch{try{C.removeAttribute(v)}catch{}}if(v==="is")if(sa||yt)try{ja(C)}catch{}else try{C.setAttribute(v,"")}catch{}},zi=function(v){const C=le(v);if(C)for(let J=C.length-1;J>=0;--J){const se=C[J],ce=se&&se.name;typeof ce!="string"||Xe[tt(ce)]||za(v,se,ce)}},Jn=function(v){const C=[v];for(;C.length>0;){const J=C.pop();K(J)===Pt.element&&zi(J);const ce=_(J);if(ce)for(let he=ce.length-1;he>=0;--he)C.push(ce[he])}},Oi=function(v,C){return Aa?v==="patchsrc"?!0:v==="for"&&C!=="label"&&C!=="output":!1},Tl=function(v){if(!Aa)return;const C=[v];for(;C.length>0;){const J=C.pop(),se=K(J);if(se===Pt.processingInstruction||se===Pt.comment&&zt(Im,J.data)){try{z(J)}catch{}continue}if(se===Pt.element){const he=J,Be=tt(te(J));try{he.hasAttribute&&he.hasAttribute("patchsrc")&&he.removeAttribute("patchsrc"),he.hasAttribute&&he.hasAttribute("for")&&Oi("for",Be)&&he.removeAttribute("for")}catch{}}const ce=_(J);if(ce)for(let he=ce.length-1;he>=0;--he)C.push(ce[he])}},In=function(v){let C=null,J=null;if(ms)v="<remove></remove>"+v;else{const he=Bm(v,/^[\r\n\t ]+/);J=he&&he[0]}it==="application/xhtml+xml"&&qa===ia&&(v='<html xmlns="http://www.w3.org/1999/xhtml"><head></head><body>'+v+"</body></html>");const se=U?Ie(v):v;if(qa===ia)try{C=new b().parseFromString(se,it)}catch{}if(!C||!C.documentElement){C=Re.createDocument(qa,"template",null);try{C.documentElement.innerHTML=Nl?ue:se}catch{}}const ce=C.body||C.documentElement;return v&&J&&ce.insertBefore(u.createTextNode(J),ce.childNodes[0]||null),qa===ia?Z.call(C,la?"html":"body")[0]:la?C.documentElement:ce},ra=function(v){const C=A?A(v):v.ownerDocument;return Ne.call(C||v,v,y.SHOW_ELEMENT|y.SHOW_COMMENT|y.SHOW_TEXT|y.SHOW_PROCESSING_INSTRUCTION|y.SHOW_CDATA_SECTION,null)},Nt=function(v){return v=pi(v,ge," "),v=pi(v,ve," "),v=pi(v,Ae," "),v},El=function(v){var C;v.normalize();const J=A?A(v):v.ownerDocument,se=Ne.call(J||v,v,y.SHOW_TEXT|y.SHOW_COMMENT|y.SHOW_CDATA_SECTION|y.SHOW_PROCESSING_INSTRUCTION,null);let ce=se.nextNode();for(;ce;)ce.data=Nt(ce.data),ce=se.nextNode();const he=(C=v.querySelectorAll)===null||C===void 0?void 0:C.call(v,"template");he&&ml(he,Be=>{Oa(Be.content)&&El(Be.content)})},_l=function(v){const C=I?I(v):null;return typeof C!="string"||tt(C)!=="form"?!1:typeof v.nodeName!="string"||typeof v.textContent!="string"||typeof v.removeChild!="function"||v.attributes!==le(v)||typeof v.removeAttribute!="function"||typeof v.setAttribute!="function"||typeof v.namespaceURI!="string"||typeof v.insertBefore!="function"||typeof v.hasChildNodes!="function"||v.nodeType!==B(v)||v.childNodes!==_(v)},Oa=function(v){if(!B||typeof v!="object"||v===null)return!1;try{return B(v)===Pt.documentFragment}catch{return!1}},xn=function(v){if(!B||typeof v!="object"||v===null)return!1;try{return typeof B(v)=="number"}catch{return!1}};function Dt(W,v,C){W.length!==0&&ml(W,J=>{J.call(c,v,C,mn)})}const Pc=function(v,C){return!!(Aa&&v.hasChildNodes()&&!xn(v.firstElementChild)&&zt(Jm,v.textContent)&&zt(Jm,v.innerHTML)||Aa&&v.namespaceURI===ia&&zy[C]&&(xn(v.firstElementChild)||typeof v.textContent=="string"&&zt(Oy[C],v.textContent))||v.nodeType===Pt.processingInstruction||Aa&&v.nodeType===Pt.comment&&zt(Im,v.data))},wt=function(v,C){if(v instanceof RegExp)return zt(v,C);if(v instanceof Function){for(var J=arguments.length,se=new Array(J>2?J-2:0),ce=2;ce<J;ce++)se[ce-2]=arguments[ce];return!!v(C,...se)}return!1},js=function(v,C,J){if(!Ba[C]&&Za(C)&&wt(Yt.tagNameCheck,C))return!1;if(ps&&!ya[C]){const se=T(v),ce=_(v);if(ce&&se){const he=ce.length;for(let Be=he-1;Be>=0;--Be){const Ke=v===J?L(ce[Be],!0):ce[Be];se.insertBefore(Ke,F(v))}}}return ja(v),!0},bs=function(v,C,J,se){return v.length===0?C:C===J||C===se?ea(C):C},Al=function(v,C){return v===C||T(v)!==null?!1:(un&&Jn(v),!0)},Qa=function(v,C){if(Dt(P.beforeSanitizeElements,v,null),Al(v,C))return!0;if(_l(v))return ja(v),!0;const J=tt(te(v));if(De=bs(P.uponSanitizeElement,De,Xn,Qn),Dt(P.uponSanitizeElement,v,{tagName:J,allowedTags:De}),Al(v,C))return!0;if(Pc(v,J))return ja(v),!0;if(Ba[J]||!(na.tagCheck instanceof Function&&na.tagCheck(J))&&!De[J]){const ce=js(v,J,C);return ce===!1&&Dt(P.afterSanitizeElements,v,null),ce}if(K(v)===Pt.element&&!Ri(v)||(J==="noscript"||J==="noembed"||J==="noframes")&&zt(Cy,v.innerHTML))return ja(v),!0;if(xa&&v.nodeType===Pt.text){const ce=Nt(v.textContent);v.textContent!==ce&&(mi(c.removed,{element:v.cloneNode()}),v.textContent=ce)}return Dt(P.afterSanitizeElements,v,null),!1},Ns=function(v,C,J){if(jl[C]||Oi(C,v)||Ct&&(C==="id"||C==="name")&&(J in u||J in Ci))return!1;const se=Xe[C]||na.attributeCheck instanceof Function&&na.attributeCheck(C,v);return fs&&zt(mt,C)||ki&&zt(X,C)?!0:se?Ai[C]||zt(aa,pi(J,Ye,""))||(C==="src"||C==="xlink:href"||C==="href")&&v!=="script"&&qm(J,"data:")===0&&Zn[v]||At&&!zt(ze,pi(J,Ye,""))?!0:!J:Za(v)&&wt(Yt.tagNameCheck,v)&&wt(Yt.attributeNameCheck,C,v)||C==="is"&&Yt.allowCustomizedBuiltInElements&&wt(Yt.tagNameCheck,J)},Di=Me({},["annotation-xml","color-profile","font-face","font-face-format","font-face-name","font-face-src","font-face-uri","missing-glyph"]),Za=function(v){return!Di[vi(v)]&&zt(Pe,v)},er=function(v,C,J,se){if(U&&typeof E=="object"&&typeof E.getAttributeType=="function"&&!J)switch(E.getAttributeType(v,C)){case"TrustedHTML":return Ie(se);case"TrustedScriptURL":return q(se)}return se},Mi=function(v,C,J,se){try{J?v.setAttributeNS(J,C,se):v.setAttribute(C,se),_l(v)?ja(v):$m(c.removed)}catch{Xa(C,v)}},ws=function(v){Dt(P.beforeSanitizeAttributes,v,null);const C=v.attributes;if(!C||_l(v))return;Xe=bs(P.uponSanitizeAttribute,Xe,ds,bl);const J={attrName:"",attrValue:"",keepAttr:!0,allowedAttributes:Xe,forceKeepAttr:void 0};let se=C.length;const ce=tt(v.nodeName);for(;se--;){const he=C[se],Be=he.name,Ke=he.namespaceURI,St=he.value,rt=tt(Be),Qt=St;let gt=Be==="value"?Qt:fy(Qt);if(J.attrName=rt,J.attrValue=gt,J.keepAttr=!0,J.forceKeepAttr=void 0,Dt(P.uponSanitizeAttribute,v,J),gt=J.attrValue,Ei&&(rt==="id"||rt==="name")&&qm(gt,_i)!==0&&(Xa(Be,v,he),gt=_i+gt),Aa&&zt(/((--!?|])>)|<\/(style|script|title|xmp|textarea|noscript|iframe|noembed|noframes)/i,gt)){Xa(Be,v,he);continue}if(rt==="attributename"&&Bm(gt,"href")){Xa(Be,v,he);continue}if(!J.forceKeepAttr){if(!J.keepAttr){Xa(Be,v,he);continue}if(!Ti&&zt(Ry,gt)){Xa(Be,v,he);continue}if(xa&&(gt=Nt(gt)),!Ns(ce,rt,gt)){Xa(Be,v,he);continue}gt=er(ce,rt,Ke,gt),gt!==Qt&&Mi(v,Be,Ke,gt)}}Dt(P.afterSanitizeAttributes,v,null)},vn=function(v){let C=null;const J=ra(v);for(Dt(P.beforeSanitizeShadowDOM,v,null);C=J.nextNode();)if(Dt(P.uponSanitizeShadowNode,C,null),Qa(C,v),ws(C),Oa(C.content)&&vn(C.content),K(C)===Pt.element){const se=ee(C);Oa(se)&&(Ss(se),vn(se))}Dt(P.afterSanitizeShadowDOM,v,null)},Ss=function(v){const C=[{node:v,shadow:null}];for(;C.length>0;){const J=C.pop();if(J.shadow){vn(J.shadow);continue}const se=J.node,he=K(se)===Pt.element,Be=_(se);if(Be)for(let Ke=Be.length-1;Ke>=0;--Ke)C.push({node:Be[Ke],shadow:null});if(he){const Ke=I?I(se):null;if(typeof Ke=="string"&&tt(Ke)==="template"){const St=se.content;Oa(St)&&C.push({node:St,shadow:null})}}if(he){const Ke=ee(se);Oa(Ke)&&C.push({node:null,shadow:Ke},{node:Ke,shadow:null})}}};return c.sanitize=function(W){let v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},C=null,J=null,se=null,ce=null;if(Nl=!W,Nl&&(W="<!-->"),typeof W!="string"&&!xn(W)&&(W=xy(W),typeof W!="string"))throw hl("dirty is not a string, aborting");if(!c.isSupported)return W;hs?(De=Qn,Xe=bl):Vn(v),(P.uponSanitizeElement.length>0||P.uponSanitizeAttribute.length>0)&&(De=ea(De)),P.uponSanitizeAttribute.length>0&&(Xe=ea(Xe)),c.removed=[];const he=un&&typeof W!="string"&&xn(W);if(he){Tl(W);const St=te(W);if(typeof St=="string"){const rt=tt(St);if(!De[rt]||Ba[rt])throw ba(W),hl("root node is forbidden and cannot be sanitized in-place")}if(_l(W))throw ba(W),hl("root node is clobbered and cannot be sanitized in-place");try{Ss(W)}catch(rt){throw ba(W),rt}}else if(xn(W))C=In("<!---->"),J=C.ownerDocument.importNode(W,!0),J.nodeType===Pt.element&&J.nodeName==="BODY"||J.nodeName==="HTML"?C=J:C.appendChild(J),Ss(J);else{if(!sa&&!xa&&!la&&W.indexOf("<")===-1)return U&&Xt?Ie(W):W;if(C=In(W),!C)return sa?null:Xt?ue:""}C&&ms&&ja(C.firstChild);const Be=he?W:C;try{const St=ra(Be);for(;se=St.nextNode();)Qa(se,Be),ws(se),Oa(se.content)&&vn(se.content)}catch(St){throw he&&(ba(W),ml(c.removed,rt=>{rt.element&&Jn(rt.element)})),St}if(he)return ml(c.removed,St=>{St.element&&Jn(St.element)}),xa&&El(W),W;if(sa){if(xa&&El(C),yt)for(ce=k.call(C.ownerDocument);C.firstChild;)ce.appendChild(C.firstChild);else ce=C;return(Xe.shadowroot||Xe.shadowrootmode)&&(ce=ne.call(o,ce,!0)),ce}let Ke=la?C.outerHTML:C.innerHTML;return la&&De["!doctype"]&&C.ownerDocument&&C.ownerDocument.doctype&&C.ownerDocument.doctype.name&&zt(_y,C.ownerDocument.doctype.name)&&(Ke="<!DOCTYPE "+C.ownerDocument.doctype.name+`>
|
|
76
|
+
`+Ke),xa&&(Ke=Nt(Ke)),U&&Xt?Ie(Ke):Ke},c.setConfig=function(){let W=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{};Vn(W),hs=!0,Qn=De,bl=Xe},c.clearConfig=function(){mn=null,hs=!1,Qn=null,bl=null,U=me,ue=""},c.isValidAttribute=function(W,v,C){mn||Vn({});const J=tt(W),se=tt(v);return Ns(J,se,C)},c.addHook=function(W,v){typeof v=="function"&&Gt(P,W)&&mi(P[W],v)},c.removeHook=function(W,v){if(Gt(P,W)){if(v!==void 0){const C=uy(P[W],v);return C===-1?void 0:dy(P[W],C,1)[0]}return $m(P[W])}},c.removeHooks=function(W){Gt(P,W)&&(P[W]=[])},c.removeAllHooks=function(){P=Fm()},c}var vl=_p();const Uy=[{id:"claude",label:"claude",hint:"Claude Code via ACP"},{id:"codex",label:"codex",hint:"Codex (ChatGPT) via ACP"},{id:"pi",label:"pi",hint:"pi coding agent"}];async function us(s,c){const o=await(await fetch("/api/chats",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({agent:s,scope:c})})).json();o.id&&ta(o.scope?.kind==="agent"?`/agents/${encodeURIComponent(o.scope.slug)}/chat/${o.id}`:`/agents/chats/${o.id}`)}function Ly(){const[s,c]=w.useState("claude"),[u,o]=w.useState(!0),[d,h]=w.useState(!1);return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:"new chat"})}),l.jsxs("section",{className:"panel new-chat-panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"agent"})}),l.jsx("div",{className:"agent-pick",children:Uy.map(m=>l.jsxs("button",{className:`agent-pick-btn ${s===m.id?"active":""}`,onClick:()=>c(m.id),children:[l.jsx("b",{children:m.label}),l.jsx("span",{children:m.hint})]},m.id))}),l.jsx("div",{className:"run-opts",style:{padding:"0 16px 14px"},children:l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:u,onChange:m=>o(m.target.checked)}),"kraftwerk-aware",l.jsx("span",{className:"opt-hint",children:"— agent gets workflows + recent runs as context"})]})}),l.jsx("div",{style:{padding:"0 16px 16px"},children:l.jsx("button",{className:"run-btn",disabled:d,onClick:async()=>{h(!0),await us(s,{kind:u?"kraftwerk":"general"}),h(!1)},children:d?"starting…":"start chat"})})]})]})}function Wm({id:s,agentName:c,agentDescription:u}){const[o,d]=w.useState(null),[h,m]=w.useState([]),[g,y]=w.useState(!1);w.useEffect(()=>{let E=!0,N=null;return fetch(`/api/chats/${s}`).then(L=>L.ok?L.json():Promise.reject()).then(L=>{if(!E)return;d(L.meta),m(L.events);const z=L.events[L.events.length-1]?.seq??0;N=new EventSource(`/api/chats/${s}/events?after=${z}`),N.onmessage=F=>{const _=JSON.parse(F.data);m(T=>T.some(ee=>ee.seq===_.seq)?T:[...T,_])}}).catch(()=>E&&y(!0)),()=>{E=!1,N?.close()}},[s]);const x=w.useMemo(()=>{for(let E=h.length-1;E>=0;E--){const N=h[E].type;if(N==="user_message")return!0;if(N==="turn_end"||N==="error")return!1}return!1},[h]),b=w.useMemo(()=>{if(o?.title)return o.title;const E=h.find(N=>N.type==="user_message");return E&&E.type==="user_message"?E.text.replace(/\s+/g," ").trim().slice(0,80):""},[o,h]);return w.useEffect(()=>{if(!o)return;const E=c??(o.scope.kind==="agent"?o.scope.slug:o.agent);return _m([E,u,b||"new chat"].filter(Boolean).join(" · ")),()=>_m("")},[o,b,c,u]),g?l.jsx("div",{className:"empty",children:"chat not found"}):o?l.jsxs("div",{className:"chat-thread",children:[l.jsxs("div",{className:"detail-head",children:[l.jsx("span",{className:`lamp ${x?"running":"ok"}`}),l.jsx("h1",{children:b||"new chat"}),l.jsx("span",{className:"chip agent",children:o.agent}),o.scope.kind==="run"&&l.jsx(_e,{href:`/runs/${o.scope.runId}`,className:"chip",children:o.scope.runId}),o.scope.kind==="kraftwerk"&&l.jsx("span",{className:"chip",children:"kraftwerk-aware"}),o.scope.kind==="knowledge"&&l.jsxs(_e,{href:o.scope.bundle?`/knowledge/${encodeURIComponent(o.scope.bundle)}`:"/knowledge",className:"chip",children:["knowledge",o.scope.bundle?`:${o.scope.bundle}`:""]}),o.scope.kind==="agent"&&l.jsxs(_e,{href:`/agents/${encodeURIComponent(o.scope.slug)}/info`,className:"chip",children:["agent:",o.scope.slug]}),l.jsx("span",{className:"rid",title:o.cwd,children:o.cwd})]}),l.jsx($y,{id:s,events:h,busy:x}),l.jsx(Yy,{id:s,busy:x,scope:o.scope})]}):l.jsx("div",{className:"empty",children:"loading…"})}function Hy(s){const c=[],u=new Map,o=new Map;for(const d of s){const h=c[c.length-1];switch(d.type){case"user_message":c.push({kind:"user",text:d.text,key:`e${d.seq}`});break;case"text":h?.kind==="agent"?h.text+=d.text:c.push({kind:"agent",text:d.text,key:`e${d.seq}`});break;case"thought":h?.kind==="thought"?h.text+=d.text:c.push({kind:"thought",text:d.text,key:`e${d.seq}`});break;case"tool_call":u.set(d.callId,c.length),c.push({kind:"tool",callId:d.callId,title:d.title,toolKind:d.kind,status:d.status,key:`e${d.seq}`});break;case"tool_update":{const m=u.get(d.callId);if(m!=null){const g=c[m];d.title&&(g.title=d.title),d.status&&(g.status=d.status)}break}case"permission_request":o.set(d.requestId,c.length),c.push({kind:"permission",requestId:d.requestId,title:d.title,options:d.options,resolved:void 0,key:`e${d.seq}`});break;case"permission_resolved":{const m=o.get(d.requestId);m!=null&&(c[m].resolved=d.optionId);break}case"error":c.push({kind:"error",text:d.message,key:`e${d.seq}`});break}}return c}function $y({id:s,events:c,busy:u}){const o=$a(),d=w.useMemo(()=>{const g=Hy(c);return o?g:g.filter(y=>y.kind!=="tool"&&y.kind!=="thought")},[c,o]),h=w.useRef(null),m=w.useRef(!0);return w.useEffect(()=>{const g=h.current;g&&m.current&&(g.scrollTop=g.scrollHeight)},[d,u]),l.jsxs("div",{className:"chat-scroll",ref:h,onScroll:g=>{const y=g.currentTarget;m.current=y.scrollHeight-y.scrollTop-y.clientHeight<60},children:[d.length===0&&l.jsx("div",{className:"empty",children:"say something — the agent starts on your first message"}),d.map(g=>l.jsx(qy,{b:g,chatId:s},g.key)),u&&l.jsxs("div",{className:"chat-working",children:[l.jsx("span",{className:"lamp running"})," working…"]})]})}function By({text:s}){const c=w.useMemo(()=>vl.sanitize(Oe.parse(s,{async:!1})),[s]);return l.jsx("div",{className:"msg agent md-body chat-md",dangerouslySetInnerHTML:{__html:c}})}function qy({b:s,chatId:c}){switch(s.kind){case"user":return l.jsx("div",{className:"msg user",children:s.text});case"agent":return l.jsx(By,{text:s.text});case"thought":return l.jsxs("details",{className:"msg thought",children:[l.jsx("summary",{children:"thinking"}),l.jsx("div",{children:s.text})]});case"tool":return l.jsxs("div",{className:`tool-card ${s.status??""}`,children:[l.jsx("span",{className:`lamp ${s.status==="completed"?"ok":s.status==="failed"?"failed":"running"}`}),s.toolKind&&l.jsx("span",{className:"chip tool-kind",children:s.toolKind}),l.jsx("span",{className:"tool-title",children:s.title})]});case"permission":return l.jsx(Gy,{b:s,chatId:c});case"error":return l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",s.text]})}}function Gy({b:s,chatId:c}){const[u,o]=w.useState(!1),d=s.resolved===void 0;async function h(m){o(!0),await fetch(`/api/chats/${c}/permission`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({requestId:s.requestId,optionId:m})}).catch(()=>{}),o(!1)}return l.jsxs("div",{className:`perm-card ${d?"pending":""}`,children:[l.jsxs("div",{className:"perm-title",children:[l.jsx("span",{className:"microlabel",children:"permission"})," ",s.title]}),d?l.jsx("div",{className:"perm-actions",children:s.options.map(m=>l.jsx("button",{className:`perm-btn ${m.kind?.startsWith("allow")?"allow":"deny"}`,disabled:u,onClick:()=>h(m.optionId),children:m.name},m.optionId))}):l.jsx("div",{className:"perm-resolved",children:s.resolved?`→ ${s.options.find(m=>m.optionId===s.resolved)?.name??s.resolved}`:"→ dismissed"})]})}function Yy({id:s,busy:c,scope:u}){const[o,d]=w.useState(""),[h,m]=w.useState([]),[g,y]=w.useState(0),[x,b]=w.useState(!1);w.useEffect(()=>{let T=!0;return(async()=>{try{let le=(await fetch("/api/skills").then(B=>B.json())).skills??[];if(u?.kind==="agent"){const[B,I]=await Promise.all([fetch(`/api/agents/${encodeURIComponent(u.slug)}`).then(te=>te.ok?te.json():null).catch(()=>null),fetch(`/api/agents/${encodeURIComponent(u.slug)}/skills`).then(te=>te.ok?te.json():null).catch(()=>null)]);if(B&&Array.isArray(B.skills)){const te=new Set(B.skills.map(U=>U.toLowerCase()));le=le.filter(U=>te.has(U.name.toLowerCase()))}const A=I?.skills??[],K=new Set(A.map(te=>te.name.toLowerCase()));le=[...A,...le.filter(te=>!K.has(te.name.toLowerCase()))]}T&&m(le)}catch{}})(),()=>{T=!1}},[s]);const E=/^\/([\w-]*)$/.exec(o)?.[1],N=E!==void 0&&!x?h.filter(T=>T.name.toLowerCase().startsWith(E.toLowerCase())):[],L=N.length>0,z=Math.min(g,N.length-1);function F(T){d(`/${T.name} `),y(0)}async function _(){const T=o.trim();!T||c||(d(""),await fetch(`/api/chats/${s}/message`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({text:T})}).catch(()=>{}))}return l.jsxs("div",{className:"composer",children:[L&&l.jsx("div",{className:"skill-menu",children:N.map((T,ee)=>l.jsxs("button",{className:ee===z?"active":"",onMouseDown:le=>{le.preventDefault(),F(T)},children:[l.jsxs("b",{children:["/",T.name]}),T.description&&l.jsxs("span",{children:[" — ",T.description]}),l.jsx("span",{className:"skill-src",children:T.source})]},T.name))}),l.jsx("textarea",{value:o,placeholder:c?"agent is working…":"message · Enter to send, Shift+Enter for newline, / for skills",rows:Math.min(6,Math.max(1,o.split(`
|
|
77
|
+
`).length)),onChange:T=>{d(T.target.value),y(0),b(!1)},onKeyDown:T=>{if(L){if(T.key==="ArrowDown")return T.preventDefault(),y((z+1)%N.length);if(T.key==="ArrowUp")return T.preventDefault(),y((z-1+N.length)%N.length);if(T.key==="Tab"||T.key==="Enter")return T.preventDefault(),F(N[z]);if(T.key==="Escape")return T.preventDefault(),b(!0)}T.key==="Enter"&&!T.shiftKey&&(T.preventDefault(),_())}}),c?l.jsxs("button",{className:"stop-btn",onClick:()=>fetch(`/api/chats/${s}/cancel`,{method:"POST"}).catch(()=>{}),children:[l.jsx(Q,{name:"stop",className:"ms-sm"})," stop"]}):l.jsxs("button",{className:"run-btn",disabled:!o.trim(),onClick:_,children:[l.jsx(Q,{name:"send",className:"ms-sm"})," send"]})]})}function Xy({id:s}){const c=$e("/api/runs",!0),u=c?.runs??[];return l.jsxs("div",{className:"runs-screen",children:[l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"runs"}),l.jsx("span",{className:"spacer"}),l.jsx("span",{className:"microlabel num",children:u.length})]}),l.jsxs("div",{className:"side-list",children:[u.map(o=>l.jsx(Qy,{r:o,active:o.id===s},o.id)),c&&u.length===0&&l.jsx("div",{className:"viewer-note",children:"no runs yet"})]})]}),l.jsx("div",{className:"runs-main",children:l.jsx(Zy,{id:s},s)})]})}function Qy({r:s,active:c}){return l.jsxs(_e,{href:`/runs/${s.id}`,className:`side-row ${c?"active":""}`,children:[l.jsx(Fc,{status:s.status}),l.jsxs("div",{className:"side-row-body",children:[l.jsxs("div",{className:"side-row-top",children:[l.jsx("span",{className:"side-wf",children:s.workflow??"unknown"}),l.jsx("span",{className:"side-when num",children:gl(s.startedAt)})]}),l.jsxs("div",{className:"side-row-sub",children:[l.jsx("span",{className:"side-req",title:s.request,children:s.status==="running"&&s.currentPhase?`${s.currentPhase}`:s.request??""}),l.jsx("span",{className:"side-meta num",children:s.status==="running"?l.jsx(_u,{since:s.startedAt}):Ni(s.durationMs)})]})]})]})}function Zy({id:s}){const c=$e(`/api/runs/${s}`,!0),u=c?.status==="running",[o,d]=w.useState(null),[h,m]=w.useState(!1),g=$a();if(!c)return l.jsx("div",{className:"empty",children:"loading…"});const y=c.files.some(N=>N.name==="runner.json"),x=o??(u?"run":"artifacts"),b=g?c.files.length:c.files.filter(N=>!Ic(N.name)).length;async function E(){m(!0),await fetch(`/api/runs/${s}/stop`,{method:"POST"}).catch(()=>{})}return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"detail-head",children:[l.jsx(Fc,{status:c.status}),l.jsx("h1",{children:c.workflow?l.jsx(_e,{href:`/workflows/${encodeURIComponent(c.workflow)}`,title:"open workflow",children:c.workflow}):"unknown workflow"}),l.jsx(lv,{status:c.status}),y&&l.jsxs("span",{className:"chip sandbox-chip",children:[l.jsx(Q,{name:"science",className:"ms-sm"})," sandbox"]}),l.jsx("span",{className:"rid",children:s.replace(/^run-/,"")}),u&&y&&l.jsx("button",{className:"stop-btn",onClick:E,disabled:h,children:h?"stopping…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"stop",className:"ms-sm"})," stop"]})}),l.jsx("span",{className:"spacer"}),l.jsx("button",{className:"open-raw",title:"chat with an agent about this run",onClick:()=>{us("claude",{kind:"run",runId:s})},children:"⌬ discuss"}),l.jsxs("nav",{className:"tabs",children:[l.jsx("button",{className:x==="run"?"active":"",onClick:()=>d("run"),children:"run"}),l.jsxs("button",{className:x==="artifacts"?"active":"",onClick:()=>d("artifacts"),children:["artifacts ",l.jsxs("span",{className:"num",children:["(",b,")"]})]})]})]}),c.request&&l.jsx("p",{className:"detail-req",children:c.request}),x==="run"?l.jsx(Vy,{run:c,live:u}):l.jsx(Fy,{id:s,files:c.files,live:u})]})}function Vy({run:s,live:c}){return l.jsxs("div",{className:"run-tab",children:[l.jsxs("div",{className:"statgrid",children:[l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"phases"}),l.jsxs("div",{className:"v num",children:[s.phasesDone,s.phasesTotal!=null?` / ${s.phasesTotal}`:""]})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"duration"}),l.jsx("div",{className:"v num",children:c?l.jsx(_u,{since:s.startedAt}):Ni(s.durationMs)})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"cost"}),l.jsx("div",{className:"v num",children:Tu(s.costUsd??Ky(s.phases))})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"tokens in / out"}),l.jsxs("div",{className:"v num",children:[Zc(Pm(s.phases,"tokensIn"))," / ",Zc(Pm(s.phases,"tokensOut"))]})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"phase timeline"}),l.jsx("span",{className:"spacer"}),c&&l.jsxs("span",{className:"live-note",children:[l.jsx("span",{className:"lamp running"})," live · polling"]})]}),l.jsx("div",{className:"phases",children:s.phases.map(u=>l.jsx(Jy,{p:u},u.phase))})]})]})}function Pm(s,c){return s.reduce((u,o)=>u+(o[c]??0),0)}function Ky(s){return s.reduce((c,u)=>c+(u.costUsd??0),0)}function Jy({p:s}){const c=s.gates.filter(u=>!u.passed);return l.jsxs("div",{className:"phase-row",children:[l.jsx(Fc,{status:s.status}),l.jsxs("div",{className:"phase-top",children:[l.jsx("span",{className:"phase-name",children:s.phase}),s.kind==="agent"?l.jsxs("span",{className:"chip agent",children:[s.agent,s.model?` · ${s.model}`:""]}):l.jsx("span",{className:"chip",children:"script"}),l.jsxs("span",{className:"right num",children:[s.attempts>1&&l.jsxs("span",{children:["att ",s.attempts]}),s.status==="running"?l.jsx(_u,{since:s.startedAt}):s.durationMs!=null&&l.jsx("span",{children:Ni(s.durationMs)}),s.kind==="agent"&&s.tokensIn!=null&&l.jsxs("span",{children:[Zc(s.tokensIn)," / ",Zc(s.tokensOut)]}),s.costUsd!=null&&s.costUsd>0&&l.jsx("span",{children:Tu(s.costUsd)})]})]}),s.status==="running"&&s.lastActivity&&l.jsx("div",{className:"phase-activity",children:s.lastActivity}),s.summary&&s.status!=="running"&&l.jsx("div",{className:"phase-sub",children:s.summary}),s.gates.length>0&&l.jsx("div",{className:"gate-line",children:s.gates.map(u=>l.jsxs("span",{className:`gate ${u.passed?"":"failed"}`,title:u.failure??"",children:[l.jsx(Q,{name:u.passed?"check":"close",className:"ms-sm"})," ",u.gate]},u.gate))}),c.map(u=>l.jsx("div",{className:"gate-fail-msg",children:u.failure},u.gate))]})}const Ap=new Set(["png","jpg","jpeg","gif","webp","svg"]);function Ic(s){return s==="runner.json"||s.endsWith(".jsonl")||s.endsWith(".log")}function Iy(s){const u=["report.html","recommendation.md"].find(h=>s.some(m=>m.name===h));if(u)return u;const o=h=>{const m=h.split(".").pop()?.toLowerCase()??"";return["html","md","markdown","pdf"].includes(m)||Ap.has(m)?0:Ic(h)?2:1};let d=null;for(const h of s)(!d||o(h.name)<o(d.name))&&(d=h);return d?.name??null}function Fy({id:s,files:c,live:u}){const[o,d]=w.useState(null),h=$a(),m=w.useMemo(()=>h?c:c.filter(g=>!Ic(g.name)),[c,h]);return w.useEffect(()=>{!h&&o&&Ic(o)&&d(null)},[h,o]),w.useEffect(()=>{o||m.length===0||d(Iy(m))},[m,o]),l.jsxs("div",{className:"art-layout",children:[l.jsxs("section",{className:"panel art-files",children:[l.jsx("div",{className:"panel-head",children:l.jsxs("span",{className:"microlabel",children:["files ",l.jsxs("span",{className:"num",children:["(",m.length,")"]})]})}),l.jsxs("div",{className:"file-list",children:[m.map(g=>l.jsxs("button",{className:`file-row ${o===g.name?"active":""}`,onClick:()=>d(g.name),children:[l.jsx("span",{className:"fname",children:g.name}),l.jsx("span",{className:"fsize num",children:Eu(g.size)})]},g.name)),m.length===0&&l.jsx("div",{className:"viewer-note",children:c.length>0?"no result files — raw run files live in expert mode":"no files yet"})]})]}),l.jsxs("section",{className:"panel art-viewer",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:o??"viewer"}),l.jsx("span",{className:"spacer"}),o&&l.jsx("a",{className:"open-raw",href:`/api/runs/${s}/file?name=${encodeURIComponent(o)}&raw=1`,target:"_blank",children:"open raw ↗"})]}),o?l.jsx(Wy,{id:s,name:o,live:u}):l.jsx("div",{className:"empty",children:"select a file"})]})]})}function Wy({id:s,name:c,live:u}){const o=c.split(".").pop()?.toLowerCase()??"",d=`/api/runs/${s}/file?name=${encodeURIComponent(c)}&raw=1`;return o==="html"?l.jsx("div",{className:"viewer",children:l.jsx("div",{className:"viewer-body",children:l.jsx("iframe",{src:d,sandbox:"allow-scripts",allow:"clipboard-write",title:c})})}):o==="pdf"?l.jsx("div",{className:"viewer",children:l.jsx("div",{className:"viewer-body",children:l.jsx("iframe",{src:d,title:c})})}):Ap.has(o)?l.jsx("div",{className:"viewer",children:l.jsx("div",{className:"viewer-body",children:l.jsx("img",{src:d,alt:c})})}):o==="md"||o==="markdown"?l.jsx(Py,{id:s,name:c,live:u}):l.jsx(ej,{id:s,name:c,live:u})}function Py({id:s,name:c,live:u}){const[o,d]=w.useState("rendered"),h=$e(`/api/runs/${s}/file?name=${encodeURIComponent(c)}`,u),m=w.useMemo(()=>h?vl.sanitize(Oe.parse(h.content,{async:!1})):"",[h?.content]);return l.jsxs("div",{className:"viewer",children:[l.jsxs("div",{className:"viewer-note md-toolbar",children:[l.jsxs("div",{className:"tabs",children:[l.jsx("button",{className:o==="rendered"?"active":"",onClick:()=>d("rendered"),children:"rendered"}),l.jsx("button",{className:o==="source"?"active":"",onClick:()=>d("source"),children:"source"})]}),h?.truncated&&l.jsxs("span",{children:["large file — showing the last ",Eu(4e5)]})]}),l.jsx("div",{className:"viewer-body",children:h?o==="rendered"?l.jsx("div",{className:"md-body",dangerouslySetInnerHTML:{__html:m}}):l.jsx("pre",{children:h.content||"(empty)"}):l.jsx("pre",{children:"loading…"})})]})}function ej({id:s,name:c,live:u}){const o=$e(`/api/runs/${s}/file?name=${encodeURIComponent(c)}`,u);return l.jsxs("div",{className:"viewer",children:[o?.truncated&&l.jsxs("div",{className:"viewer-note",children:["large file — showing the last ",Eu(4e5)]}),l.jsx("div",{className:"viewer-body",children:l.jsx("pre",{children:o?o.content||"(empty)":"loading…"})})]})}function tj(){const s=$e("/api/workflows",!1),c=s?.workflows??[];return l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"page-head",children:[l.jsx("h1",{children:"Workflows"}),l.jsxs("span",{className:"count num",children:[c.length," discovered"]}),s?.root&&l.jsx("span",{className:"count mono",children:s.root})]}),s&&c.length===0&&l.jsxs("div",{className:"empty",children:["No workflows found — expected ",l.jsx("code",{children:"src/workflows/"})," or ",l.jsx("code",{children:"workflows/"})," ","next to the output folder."]}),l.jsx("div",{className:"wf-grid",children:c.map(u=>l.jsxs(_e,{href:`/workflows/${u.slug}`,className:"wf-card",children:[l.jsxs("div",{className:"wf-card-head",children:[l.jsx("span",{className:"wf-name",children:u.name??u.slug}),u.error&&l.jsx("span",{className:"status-word failed",children:"broken"})]}),l.jsx("p",{className:"wf-desc",children:u.error??u.description??""}),l.jsxs("div",{className:"wf-meta num",children:[l.jsxs("span",{children:[u.agents," agents"]}),l.jsx("span",{children:"·"}),l.jsxs("span",{children:[u.steps," steps"]})]})]},u.slug))})]})}function aj({slug:s}){const c=$e(`/api/workflows/${encodeURIComponent(s)}`,!1),u=$e("/api/runs",!1);if(!c)return l.jsx("div",{className:"empty",children:"loading…"});if(c.error)return l.jsxs(l.Fragment,{children:[l.jsx(ep,{slug:c.slug}),l.jsxs("div",{className:"empty",children:[l.jsx("span",{className:"status-word failed",children:"broken workflow"}),l.jsx("pre",{style:{marginTop:12,textAlign:"left"},children:c.error})]})]});const o=new Map(c.agents.map((h,m)=>[h.id,m%4])),d=(u?.runs??[]).filter(h=>h.workflow===c.name).slice(0,8);return l.jsxs(l.Fragment,{children:[l.jsx(ep,{slug:c.slug}),l.jsxs("div",{className:"detail-head",children:[l.jsx("h1",{children:c.name??c.slug}),l.jsx("span",{className:"rid mono",children:c.dir})]}),c.description&&l.jsx("p",{className:"detail-req",children:c.description}),l.jsxs("div",{className:"statgrid",children:[l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"agents"}),l.jsx("div",{className:"v num",children:c.agents.length})]}),l.jsxs("div",{className:"stat",children:[l.jsx("div",{className:"microlabel",children:"steps"}),l.jsxs("div",{className:"v num",children:[c.steps.length," ",l.jsxs("span",{style:{color:"var(--muted)",fontWeight:400},children:["(",c.steps.filter(h=>h.kind==="agent").length," agent ·"," ",c.steps.filter(h=>h.kind==="script").length," script)"]})]})]}),c.workspace&&l.jsxs("div",{className:"stat",style:{maxWidth:420},children:[l.jsx("div",{className:"microlabel",children:"workspace"}),l.jsx("div",{className:"wf-workspace mono",children:c.workspace})]})]}),l.jsx(nj,{slug:c.slug,lastRequest:d[0]?.request}),l.jsxs("section",{className:"panel",style:{marginBottom:18},children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"agents"})}),l.jsxs("div",{className:"agent-grid",children:[c.agents.map(h=>l.jsx(lj,{a:h,idx:o.get(h.id)??0},h.id)),c.agents.length===0&&l.jsx("div",{className:"viewer-note",children:"no agents — script-only workflow"})]})]}),l.jsxs("div",{className:"columns",children:[l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"pipeline"})}),l.jsx("div",{className:"pipeline",children:c.steps.map((h,m)=>l.jsx(sj,{s:h,i:m,idx:h.agent?o.get(h.agent)??0:null},h.name))})]}),l.jsxs("div",{style:{display:"grid",gap:18},children:[l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsxs("span",{className:"microlabel",children:["folder ",l.jsxs("span",{className:"num",children:["(",c.files.length," files)"]})]})}),l.jsx("div",{className:"file-list",children:c.files.map(h=>l.jsx("div",{className:"file-row",style:{cursor:"default"},children:l.jsx("span",{className:"fname",children:h})},h))})]}),l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsxs("span",{className:"microlabel",children:["recent runs ",l.jsxs("span",{className:"num",children:["(",d.length,")"]})]})}),l.jsxs("div",{className:"file-list",children:[d.map(h=>l.jsxs(_e,{href:`/runs/${h.id}`,className:"file-row",children:[l.jsx(Fc,{status:h.status}),l.jsx("span",{className:"fname",children:h.id.replace(/^run-/,"")}),l.jsxs("span",{className:"fsize num",children:[Ni(h.durationMs)," · ",Tu(h.costUsd)," · ",gl(h.startedAt)]})]},h.id)),d.length===0&&l.jsx("div",{className:"viewer-note",children:"no runs of this workflow yet"})]})]})]})]})]})}function nj({slug:s,lastRequest:c}){const[u,o]=w.useState(""),[d,h]=w.useState(!0),[m,g]=w.useState(!1),[y,x]=w.useState(!1),[b,E]=w.useState(null),N=$e(`/api/workflows/${encodeURIComponent(s)}/run`,!1);w.useEffect(()=>{!u&&c&&o(c)},[c]);const L=N?.available&&N?.image,z=N?N.available?N.image?"isolated container per run":"image missing — run `kraftwerk runner build`":"Docker not running — sandbox unavailable":"";async function F(){if(!(!u.trim()||y)){x(!0),E(null);try{const _=await fetch(`/api/workflows/${encodeURIComponent(s)}/run`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({request:u.trim(),sandbox:d,ssh:m})}),T=await _.json();if(!_.ok)throw new Error(T.error??`HTTP ${_.status}`);ta(`/runs/${T.runId}`)}catch(_){E(_.message),x(!1)}}}return l.jsxs("section",{className:"panel run-panel",style:{marginBottom:18},children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"trigger run"})}),l.jsxs("div",{className:"run-form",children:[l.jsx("input",{type:"text",value:u,placeholder:"request — topic, URL, host …",onChange:_=>o(_.target.value),onKeyDown:_=>_.key==="Enter"&&F()}),l.jsx("button",{className:"run-btn",onClick:F,disabled:y||!u.trim()||d&&!L,children:y?"starting…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"play_arrow",className:"ms-sm"})," ",d?"run in sandbox":"run locally"]})})]}),l.jsxs("div",{className:"run-opts",children:[l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:d,onChange:_=>h(_.target.checked)}),"docker sandbox ",z&&l.jsxs("span",{className:"opt-hint",children:["— ",z]})]}),l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:m,onChange:_=>g(_.target.checked),disabled:!d}),"forward SSH agent"]})]}),b&&l.jsx("div",{className:"gate-fail-msg",children:b})]})}function ep({slug:s}){return l.jsxs("nav",{className:"crumbs",children:[l.jsx(_e,{href:"/workflows",children:"workflows"}),l.jsx("span",{className:"sep",children:"/"}),l.jsx("span",{className:"mono",children:s})]})}function lj({a:s,idx:c}){return l.jsxs("div",{className:`agent-card aid-${c}`,children:[l.jsxs("div",{className:"agent-head",children:[l.jsx("span",{className:"agent-dot"}),l.jsx("b",{children:s.name??s.id}),l.jsxs("code",{className:"agent-id",children:["[",s.id,"]"]}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"chip",children:[s.model??"default",s.effort?` · ${s.effort}`:""]})]}),s.tools.length>0&&l.jsx("div",{className:"agent-tools",children:s.tools.map(u=>l.jsx("span",{className:"tool-chip",children:u},u))}),s.persona&&l.jsx("p",{className:"agent-persona",children:s.persona})]})}function sj({s,i:c,idx:u}){const o=s.kind==="script"?s.script:s.prompt;return l.jsxs("div",{className:"step-node",children:[l.jsx("div",{className:`step-index num ${u!=null?`aid-${u}`:"is-script"}`,children:c+1}),l.jsxs("div",{className:"step-body",children:[l.jsxs("div",{className:"phase-top",children:[l.jsx("span",{className:"phase-name",children:s.name}),s.kind==="agent"?l.jsxs("span",{className:`chip agent-chip aid-${u??0}`,children:["agent · ",s.agent]}):l.jsxs("span",{className:"chip",children:["script",s.sourceRef?` · ${s.sourceRef}`:""]})]}),o&&l.jsxs("details",{className:"step-source",children:[l.jsx("summary",{children:s.kind==="agent"?"prompt":"script"}),l.jsx("pre",{children:o})]}),s.gates.length>0&&l.jsx("div",{className:"gate-line",children:s.gates.map(d=>l.jsxs("span",{className:"gate neutral",children:["⛨ ",d]},d))})]})]})}const ij=s=>s==="ok"?"ok":s==="running"?"running":s==="aborted"?"aborted":"failed",cj=s=>s==="ok"?"done":s==="running"?"working":s==="aborted"?"stopped":"failed";function rj(s){return s.scope.kind==="agent"?`/agents/${s.scope.slug}/chat/${s.id}`:`/agents/chats/${s.id}`}function tp(s){switch(s.scope.kind){case"agent":return s.scope.slug;case"run":return s.scope.runId;case"knowledge":return s.scope.bundle?`knowledge:${s.scope.bundle}`:"knowledge";case"kraftwerk":return"kraftwerk-aware";default:return"general"}}function ap(s){return s.length>64?`${s.slice(0,46)}…${s.slice(-14)}`:s}function oj(){const s=$e("/api/runs",!1),c=$e("/api/chats",!1),u=$e("/api/knowledge",!1),o=$e("/api/agents",!1),d=$e("/api/workflows",!1),h=$e("/api/skills",!1),m=$e("/api/meta",!1),[g,y]=w.useState("all"),x=s?.runs??[],b=c?.chats??[],E=u?.bundles??[],N=(h?.skills??[]).filter(F=>F.source==="workspace"),L=[[d?.workflows.length,"workflows","/workflows"],[s?x.length:void 0,"runs","/runs"],[u?E.length:void 0,"bundles","/knowledge"],[h?N.length:void 0,"skills","/skills"],[c?b.length:void 0,"chats","/agents/chats"]],z=x.filter(F=>F.status==="failed"&&Date.now()-Date.parse(F.updatedAt)<24*36e5);return l.jsxs("div",{className:"dash",children:[l.jsxs("div",{className:"page-head",children:[l.jsxs("h1",{children:[m?.projectIcon?`${m.projectIcon} `:"",m?.projectName||"workspace"]}),l.jsx("span",{className:"spacer"}),l.jsx("span",{className:"dash-mini",children:L.map(([F,_,T])=>l.jsxs(_e,{href:T,children:[l.jsx("b",{className:"num",children:F??"…"})," ",_]},_))}),l.jsx(uj,{workflows:d?.workflows??[]})]}),l.jsx(dj,{agents:o?.agents.filter(F=>!F.archived),chats:b}),z.length>0&&g!=="failed"&&l.jsxs("button",{className:"dash-alert",onClick:()=>y("failed"),children:["⚠ ",z.length," run",z.length===1?"":"s"," failed in the last 24 h — review"]}),l.jsx(mj,{runs:x,chats:b,bundles:E,agents:o?.agents??[],workflows:d?.workflows??[],filter:g,setFilter:y})]})}function uj({workflows:s}){const[c,u]=w.useState(!1);return w.useEffect(()=>{if(!c)return;const o=d=>{d.target.closest(".wf-pick-wrap")||u(!1)};return window.addEventListener("mousedown",o),()=>window.removeEventListener("mousedown",o)},[c]),l.jsxs("div",{className:"dash-actions",children:[l.jsxs("button",{className:"run-btn dash-newchat",onClick:()=>ta("/agents/chats"),children:[l.jsx(Q,{name:"forum"})," new chat"]}),l.jsxs("span",{className:"wf-pick-wrap",children:[l.jsxs("button",{className:"run-btn tonal","aria-haspopup":"menu","aria-expanded":c,onClick:()=>u(o=>!o),children:[l.jsx(Q,{name:"play_arrow"})," run workflow"]}),c&&l.jsxs("div",{className:"wf-pick-pop",role:"menu",children:[s.length===0&&l.jsx("span",{className:"wf-pick-empty",children:"no workflows yet"}),s.map(o=>l.jsxs(_e,{href:`/workflows/${encodeURIComponent(o.slug)}`,className:"wf-pick-item",role:"menuitem",children:[l.jsx("span",{className:"wf-pick-name",children:o.name??o.slug}),o.description&&l.jsx("span",{className:"wf-pick-desc",children:o.description})]},o.slug))]})]})]})}function dj({agents:s,chats:c}){const u=$a();return s&&s.length===0?l.jsx("section",{className:"panel dash-agents-empty",children:l.jsx("div",{className:"viewer-note",children:u?l.jsxs(l.Fragment,{children:["No agents yet — ",l.jsx(_e,{href:"/agents/new",children:"create your first agent"})," and it will show up here, ready to chat."]}):l.jsx(l.Fragment,{children:"No agents yet — ask an expert-mode user to create one."})})}):l.jsx("div",{className:"dash-agents",children:(s??[]).map(o=>{const h=c.filter(g=>g.scope.kind==="agent"&&g.scope.slug===o.slug).find(g=>g.busy),m=()=>ta(`/agents/${encodeURIComponent(o.slug)}`);return l.jsxs("div",{className:"dash-agent",role:"link",tabIndex:0,onClick:m,onKeyDown:g=>{g.key==="Enter"&&m()},children:[l.jsxs("div",{className:"dash-agent-id",children:[l.jsxs("span",{className:"agent-avatar lg",children:[l.jsx("span",{"aria-hidden":!0,children:o.emoji}),l.jsx("span",{className:`lamp ${h?"running":"idle"}`})]}),l.jsx("span",{className:"dash-agent-name",children:o.name}),o.description&&l.jsx("span",{className:"dash-agent-desc",children:o.description})]}),l.jsxs("div",{className:"dash-agent-foot",children:[l.jsx("span",{className:"dash-agent-state",children:h&&l.jsx(_e,{href:`/agents/${encodeURIComponent(o.slug)}/chat/${h.id}`,onClick:g=>g.stopPropagation(),children:"working…"})}),l.jsxs("button",{className:"run-btn dash-chat-btn",onClick:g=>{g.stopPropagation(),us("claude",{kind:"agent",slug:o.slug})},children:[l.jsx(Q,{name:"chat_bubble",className:"ms-sm"})," chat"]})]})]},o.slug)})})}function fj(s){if(s.lamp==="running")return"now";const c=new Date(s.at),u=new Date;if(c.toDateString()===u.toDateString())return"today";const o=new Date(u);return o.setDate(o.getDate()-1),c.toDateString()===o.toDateString()?"yesterday":"earlier"}const hj=[["all","all"],["run","runs"],["session","chats"],["knowledge","knowledge"]];function mj({runs:s,chats:c,bundles:u,agents:o,workflows:d,filter:h,setFilter:m}){const g=$a(),y=w.useMemo(()=>{const b=[],E=L=>L?d.find(z=>z.slug===L)?.name??L:void 0;for(const L of s)b.push({at:L.updatedAt,kind:"run",emoji:"⚙️",title:E(L.workflow)??L.id,sub:L.request??"",href:`/runs/${L.id}`,lamp:ij(L.status),status:cj(L.status)});for(const L of c){const z=L.scope.kind==="agent"?o.find(F=>L.scope.kind==="agent"&&F.slug===L.scope.slug):void 0;b.push({at:L.updatedAt,kind:"session",emoji:z?z.emoji||"🤖":"💬",title:z?z.name:L.title||"new chat",sub:z?`${L.title||"new chat"}${g?` · ${L.agent}`:""}`:g?`${L.agent} · ${tp(L)}`:tp(L),href:rj(L),lamp:L.busy?"running":"ok",status:L.busy?"working":void 0})}for(const L of u)L.updatedAt&&b.push({at:L.updatedAt,kind:"knowledge",emoji:"📚",title:L.name,sub:`${L.concepts} concepts`,href:`/knowledge/${encodeURIComponent(L.name)}`,lamp:"ok"});return(h==="all"?b:h==="failed"?b.filter(L=>L.kind==="run"&&L.lamp==="failed"):b.filter(L=>L.kind===h)).sort((L,z)=>{const F=+(z.lamp==="running")-+(L.lamp==="running");return F!==0?F:z.at.localeCompare(L.at)}).slice(0,15)},[s,c,u,o,g,h]);let x="";return l.jsxs("section",{className:"panel dash-feed",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"activity"}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"dash-feed-filter",children:[hj.map(([b,E])=>l.jsx("button",{className:`feed-chip ${h===b?"on":""}`,onClick:()=>m(b),children:E},b)),h==="failed"&&l.jsxs("button",{className:"feed-chip on failed",onClick:()=>m("all"),children:["failed ",l.jsx(Q,{name:"close",className:"ms-sm"})]})]})]}),y.length===0?l.jsx("div",{className:"viewer-note",children:h==="all"?"nothing yet — run a workflow or start a session":"nothing here for this filter"}):l.jsx("div",{className:"m3-list",children:y.map(b=>{const E=fj(b),N=E!==x?E:null;return x=E,l.jsxs("div",{className:"feed-group",children:[N&&l.jsx("div",{className:"feed-day microlabel",children:N}),l.jsxs(_e,{href:b.href,className:"m3-row m3-link",children:[l.jsxs("span",{className:"agent-avatar",children:[l.jsx("span",{"aria-hidden":!0,children:b.emoji}),b.lamp==="running"&&l.jsx("span",{className:"lamp running"})]}),l.jsx("span",{className:`chip dash-kind ${b.kind}`,children:b.kind==="session"?"chat":b.kind}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:ap(b.title)}),b.sub&&l.jsx("span",{className:"m3-sub",children:ap(b.sub)})]}),b.status&&l.jsx("span",{className:`chip status ${b.lamp}`,children:b.status}),l.jsx("span",{className:"side-when num",title:new Date(b.at).toLocaleString(),children:cs(b.at)}),l.jsx("span",{className:"m3-chev",children:l.jsx(Q,{name:"chevron_right"})})]})]},`${b.kind}:${b.href}:${b.at}`)})})]})}async function Lu(s,c){const u=window.open("","_blank");if(!u)return;const o=c?`${s}/${c}`:s;u.document.write(`<title>${Ta(o)}</title><body style="font-family:system-ui;padding:40px;color:#555">preparing ${Ta(o)}…</body>`);const d=z=>`/api/knowledge/${encodeURIComponent(s)}/concept?id=${encodeURIComponent(z)}`;let h,m="";try{const[z,F]=await Promise.all([c?Promise.resolve([c]):fetch(`/api/knowledge/${encodeURIComponent(s)}`).then(_=>_.json()).then(_=>_.concepts.map(T=>T.id)),fetch("/api/meta").then(_=>_.json()).catch(()=>({}))]);if(m=F.projectName??"",h=await Promise.all(z.map(_=>fetch(d(_)).then(T=>T.json()))),h.some(_=>typeof _?.id!="string"))throw new Error("missing concept")}catch{u.document.body.textContent=`could not load "${o}"`;return}const g=[],y=h.map(z=>{const F=[z.type,z.generated?.at?`updated ${z.generated.at.slice(0,10)}`:"",z.trustTier==="human-reviewed"?"human-reviewed":"",(z.tags??[]).map(A=>`#${A}`).join(" ")].filter(Boolean).join(" · "),{md:_,notes:T}=pj(Cp(z.body??"",null)),ee=!z.title||z.title===z.id||z.title===z.id.split("/").pop(),{html:le,title:B}=gj(vl.sanitize(Oe.parse(_,{async:!1})),{title:z.title||z.id,meta:F,titleIsFallback:ee});g.push(B);const I=T.length?`<ol class="notes">${T.map(A=>`<li id="fn-${Ta(A.id)}">${vl.sanitize(Oe.parseInline(A.text,{async:!1}))}</li>`).join("")}</ol>`:"";return`<article>
|
|
78
|
+
${le}
|
|
79
|
+
${I}
|
|
80
|
+
</article>`}).join(`
|
|
81
|
+
`),x=new Date().toISOString().slice(0,10),b=m?`${Ta(m)} · ${Ta(s)}`:Ta(s),E=c?g[0]||o:s,N=c?"":`<h1 class="cover">${Ta(s)}</h1>
|
|
82
|
+
<div class="cover-sub">${m?`${Ta(m)} · `:""}knowledge bundle · ${h.length} concept${h.length===1?"":"s"} · exported ${x}</div>`,L=`<!doctype html>
|
|
83
|
+
<html>
|
|
84
|
+
<head>
|
|
85
|
+
<meta charset="utf-8">
|
|
86
|
+
<title>${Ta(E)}</title>
|
|
87
|
+
<style>
|
|
88
|
+
:root { color-scheme: light; }
|
|
89
|
+
/* Page margins live in the sheet itself (repeating thead/tfoot cells +
|
|
90
|
+
cell padding), not in @page — print dialogs that override or drop CSS
|
|
91
|
+
page margins (macOS system dialog, "Margins: None") then still print
|
|
92
|
+
the intended layout. Top 14mm, right 48mm (notes), bottom 16mm, left 20mm. */
|
|
93
|
+
@page { size: A4; margin: 0; }
|
|
94
|
+
* { box-sizing: border-box; }
|
|
95
|
+
body {
|
|
96
|
+
margin: 0; background: #e9e5df;
|
|
97
|
+
font: 10pt/1.5 -apple-system, "Segoe UI", system-ui, sans-serif; color: #1c1b19;
|
|
98
|
+
font-feature-settings: "kern", "liga", "tnum";
|
|
99
|
+
-webkit-print-color-adjust: exact; print-color-adjust: exact;
|
|
100
|
+
}
|
|
101
|
+
.no-print {
|
|
102
|
+
position: sticky; top: 0; z-index: 1; display: flex; gap: 12px; align-items: center;
|
|
103
|
+
padding: 10px 24px; background: #f4efea; border-bottom: 1px solid #ded6cb; font-size: 13px;
|
|
104
|
+
}
|
|
105
|
+
.no-print button {
|
|
106
|
+
font: inherit; font-weight: 600; padding: 6px 16px; cursor: pointer;
|
|
107
|
+
background: #191919; color: #fff; border: none; border-radius: 999px;
|
|
108
|
+
}
|
|
109
|
+
/* Screen preview mimics the printed page incl. the note gutter. */
|
|
110
|
+
.sheet {
|
|
111
|
+
width: 210mm; margin: 24px auto; background: #fff;
|
|
112
|
+
border-collapse: separate; border-spacing: 0; box-shadow: 0 2px 12px rgba(0,0,0,.12);
|
|
113
|
+
}
|
|
114
|
+
.sheet > thead > tr > td { padding: 14mm 48mm 0 20mm; vertical-align: top; }
|
|
115
|
+
.sheet > tbody > tr > td { padding: 0 48mm 0 20mm; vertical-align: top; }
|
|
116
|
+
.sheet > tfoot > tr > td { padding: 16mm 0 0; }
|
|
117
|
+
|
|
118
|
+
/* Running header */
|
|
119
|
+
.runhead {
|
|
120
|
+
display: flex; justify-content: space-between; gap: 16px;
|
|
121
|
+
font-size: 7.5pt; line-height: 1; color: #6b6660; letter-spacing: 0.08em; text-transform: uppercase;
|
|
122
|
+
padding-bottom: 6px; border-bottom: 0.5pt solid #1c1b19; margin-bottom: 30px;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
/* Cover */
|
|
126
|
+
.cover { margin: 0 0 3px; font-size: 22pt; font-weight: 700; letter-spacing: -0.02em; line-height: 1.15; }
|
|
127
|
+
.cover-sub { color: #6b6660; font-size: 8.5pt; margin-bottom: 26px; }
|
|
128
|
+
|
|
129
|
+
/* Concept */
|
|
130
|
+
article { margin-top: 36px; }
|
|
131
|
+
article:first-of-type { margin-top: 0; }
|
|
132
|
+
article header { break-inside: avoid; break-after: avoid; margin-bottom: 12px; }
|
|
133
|
+
article h1 { font-size: 16pt; font-weight: 700; margin: 0 0 3px; letter-spacing: -0.015em; line-height: 1.2; }
|
|
134
|
+
article .meta { color: #6b6660; font-size: 8pt; letter-spacing: 0.01em; }
|
|
135
|
+
|
|
136
|
+
/* Type scale for body headings (concept body starts at h2 after demotion) */
|
|
137
|
+
h2 { font-size: 13pt; font-weight: 700; letter-spacing: -0.01em; line-height: 1.25; margin: 22px 0 6px; break-after: avoid; }
|
|
138
|
+
h3 { font-size: 11pt; font-weight: 650; line-height: 1.3; margin: 18px 0 4px; break-after: avoid; }
|
|
139
|
+
h4 { font-size: 9.5pt; font-weight: 650; color: #3d3a36; margin: 14px 0 2px; break-after: avoid; }
|
|
140
|
+
h5, h6 { font-size: 10pt; font-weight: 650; margin: 12px 0 2px; }
|
|
141
|
+
h2 + h3, h3 + h4 { margin-top: 6px; }
|
|
142
|
+
.keep { break-inside: avoid; }
|
|
143
|
+
|
|
144
|
+
/* Copy */
|
|
145
|
+
p, ul, ol { margin: 0 0 8px; orphans: 3; widows: 3; }
|
|
146
|
+
ul, ol { padding-left: 16px; }
|
|
147
|
+
li { margin: 0 0 3px; padding-left: 2px; }
|
|
148
|
+
li > p { margin: 0; }
|
|
149
|
+
li::marker { color: #8a857e; }
|
|
150
|
+
ul ul, ol ol, ul ol, ol ul { margin: 2px 0 0; }
|
|
151
|
+
strong { font-weight: 650; }
|
|
152
|
+
em { font-style: italic; }
|
|
153
|
+
a { color: inherit; text-decoration-color: #b8b2aa; text-decoration-thickness: 0.5pt; text-underline-offset: 2px; }
|
|
154
|
+
hr { border: 0; border-top: 0.5pt solid #ded6cb; margin: 14px 0; }
|
|
155
|
+
code { font: 8.5pt/1.4 ui-monospace, "SF Mono", Menlo, monospace; background: #f2ede7; padding: 0 3px; border-radius: 3px; }
|
|
156
|
+
pre { background: #f2ede7; padding: 8px 10px; border-radius: 4px; overflow-x: auto; white-space: pre-wrap; margin: 4px 0 10px; }
|
|
157
|
+
pre code { background: none; padding: 0; }
|
|
158
|
+
blockquote { margin: 6px 0 10px; padding: 1px 0 1px 12px; border-left: 2px solid #c9c2b8; color: #4d4944; }
|
|
159
|
+
img { max-width: 100%; }
|
|
160
|
+
li:has(> input[type="checkbox"]) { list-style: none; margin-left: -16px; }
|
|
161
|
+
input[type="checkbox"] { width: 9px; height: 9px; margin: 0 6px 0 0; vertical-align: -0.5px; }
|
|
162
|
+
pre, blockquote, table, img { break-inside: avoid; }
|
|
163
|
+
|
|
164
|
+
/* Tables: hairline rules, tabular figures, tight leading */
|
|
165
|
+
table.md { width: 100%; border-collapse: collapse; margin: 6px 0 12px; font-size: 8.75pt; line-height: 1.35; }
|
|
166
|
+
table.md th, table.md td { padding: 4px 10px 4px 0; text-align: left; vertical-align: top; border-bottom: 0.5pt solid #ded6cb; }
|
|
167
|
+
table.md th:last-child, table.md td:last-child { padding-right: 0; }
|
|
168
|
+
table.md th { font-weight: 650; padding-bottom: 5px; border-top: 0.5pt solid #1c1b19; border-bottom: 0.5pt solid #1c1b19; color: #1c1b19; }
|
|
169
|
+
table.md tr:last-child td { border-bottom: 0.5pt solid #1c1b19; }
|
|
170
|
+
table.md .nw { white-space: nowrap; }
|
|
171
|
+
|
|
172
|
+
/* Footnotes */
|
|
173
|
+
.fnref { font-size: 6.5pt; line-height: 0; margin-left: 1px; color: #6b6660; }
|
|
174
|
+
.fnref + .fnref::before { content: ","; }
|
|
175
|
+
.notes { margin: 14px 0 0; padding: 8px 0 0 14px; border-top: 0.5pt solid #ded6cb; font-size: 8pt; line-height: 1.4; color: #6b6660; }
|
|
176
|
+
.notes li { margin: 0 0 2px; }
|
|
177
|
+
@media print {
|
|
178
|
+
body { background: #fff; }
|
|
179
|
+
.no-print { display: none; }
|
|
180
|
+
.sheet { width: 100%; margin: 0; box-shadow: none; }
|
|
181
|
+
.runhead { margin-bottom: 24px; }
|
|
182
|
+
}
|
|
183
|
+
</style>
|
|
184
|
+
</head>
|
|
185
|
+
<body>
|
|
186
|
+
<div class="no-print">
|
|
187
|
+
<span>Use “Save as PDF” in the print dialog.</span>
|
|
188
|
+
<button onclick="window.print()">print / save as PDF</button>
|
|
189
|
+
</div>
|
|
190
|
+
<table class="sheet">
|
|
191
|
+
<thead><tr><td>
|
|
192
|
+
<div class="runhead"><span>${b}</span><span>${x}</span></div>
|
|
193
|
+
</td></tr></thead>
|
|
194
|
+
<tbody><tr><td>
|
|
195
|
+
${N}
|
|
196
|
+
${y}
|
|
197
|
+
</td></tr></tbody>
|
|
198
|
+
<tfoot><tr><td></td></tr></tfoot>
|
|
199
|
+
</table>
|
|
200
|
+
<script>setTimeout(() => window.print(), 400);<\/script>
|
|
201
|
+
</body>
|
|
202
|
+
</html>`;u.location.href=URL.createObjectURL(new Blob([L],{type:"text/html"}))}function Cp(s,c){return s.split(/(```[\s\S]*?```|`[^`]*`)/).map((u,o)=>o%2===1?u:u.replace(/\[\[([^\]|]+)(?:\|([^\]]+))?\]\]/g,(d,h,m)=>{const g=h.trim().replace(/\.md$/,""),y=(m??g).trim();return c===null?y:`[${y}](#/knowledge/${encodeURIComponent(c)}/${g})`})).join("")}function pj(s){const c=[];return{md:s.replace(/^\[\^([^\]]+)\]:[ \t]*(.+)$/gm,(o,d,h)=>(c.push({id:d,text:h.trim()}),"")).replace(/\[\^([^\]]+)\]/g,(o,d)=>{const h=c.findIndex(m=>m.id===d);return h>=0?`<sup class="fnref">${h+1}</sup>`:""}),notes:c}}function gj(s,c){const u=new DOMParser().parseFromString(s,"text/html");let o=c.title;const d=u.body.firstElementChild;c.titleIsFallback&&d?.tagName==="H1"&&(o=d.textContent?.trim()||o,d.remove());const h=u.createElement("header");h.innerHTML=`<h1>${Ta(o)}</h1><div class="meta">${Ta(c.meta)}</div>`,u.body.prepend(h);for(const m of u.querySelectorAll("table")){m.classList.add("md");for(const g of m.querySelectorAll("th, td"))(g.textContent??"").trim().length<=14&&g.classList.add("nw")}for(const m of[5,4,3,2,1])for(const g of Array.from(u.body.querySelectorAll(`:scope > h${m}`))){const y=u.createElement(`h${m+1}`);y.innerHTML=g.innerHTML,g.replaceWith(y)}for(const m of Array.from(u.body.querySelectorAll(":scope > header, :scope > h2, :scope > h3, :scope > h4"))){const g=m.nextElementSibling;if(!g||/^H[1-6]$/.test(g.tagName))continue;const y=u.createElement("div");y.className="keep",m.replaceWith(y),y.append(m,g)}return{html:u.body.innerHTML,title:o}}function Ta(s){return s.replace(/&/g,"&").replace(/</g,"<").replace(/>/g,">")}function Rp(s,c){return`/edit/${encodeURIComponent(s)}/${c.split("/").map(encodeURIComponent).join("/")}`}function xj({bundle:s,conceptId:c}){const u=$e("/api/knowledge",!1),o=u?.bundles??[];return l.jsxs("div",{className:"runs-screen",children:[l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"bundles"}),l.jsx("span",{className:"spacer"}),l.jsxs(_e,{href:"/knowledge",className:"open-raw",children:[l.jsx(Q,{name:"add",className:"ms-sm"})," new"]})]}),l.jsxs("div",{className:"side-list",children:[o.map(d=>l.jsxs(_e,{href:`/knowledge/${encodeURIComponent(d.name)}`,className:`side-row ${d.name===s?"active":""}`,children:[l.jsx("span",{className:"lamp ok"}),l.jsxs("div",{className:"side-row-body",children:[l.jsxs("div",{className:"side-row-top",children:[l.jsx("span",{className:"side-wf",children:d.name}),l.jsx("span",{className:"side-when num",children:d.concepts})]}),l.jsx("div",{className:"side-row-sub",children:l.jsxs("span",{className:"side-req",children:[d.okfVersion?`okf ${d.okfVersion}`:"okf",d.updatedAt?` · ${d.updatedAt.slice(0,10)}`:""]})})]})]},d.name)),u&&o.length===0&&l.jsx("div",{className:"viewer-note",children:"no bundles yet"})]})]}),l.jsx("div",{className:"runs-main",children:s?l.jsx(yj,{name:s,conceptId:c},s):l.jsx(vj,{root:u?.root})})]})}function vj({root:s}){const[c,u]=w.useState(""),[o,d]=w.useState(""),[h,m]=w.useState(!1);async function g(){const y=c.trim();if(!y)return;m(!0),d("");const b=await(await fetch("/api/knowledge",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:y})})).json();m(!1),b.error?d(b.error):window.location.hash=`/knowledge/${encodeURIComponent(y)}`}return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:"context & knowledge"})}),l.jsxs("section",{className:"panel new-chat-panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"what lives here"})}),l.jsxs("div",{className:"know-intro",children:["Curated knowledge as ",l.jsx("b",{children:"OKF bundles"})," (Open Knowledge Format v0.2): plain markdown files with YAML frontmatter",s?l.jsxs(l.Fragment,{children:[" under ",l.jsx("code",{children:s})]}):null,", readable by humans and agents, diffable in git. Agents write through"," ",l.jsx("code",{children:"kraftwerk knowledge put"})," (provenance is stamped automatically); you raise a concept's trust tier by verifying it here."]}),l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"new bundle"})}),l.jsxs("div",{className:"know-newbundle",children:[l.jsx("input",{value:c,placeholder:"bundle name, e.g. customer-support",onChange:y=>u(y.target.value),onKeyDown:y=>y.key==="Enter"&&void g()}),l.jsx("button",{className:"run-btn",disabled:!c.trim()||h,onClick:g,children:h?"creating…":"create"})]}),o&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",o]})]})]})}function np({tier:s}){return l.jsx("span",{className:`chip trust ${s}`,children:s})}const lp="@activity";function yj({name:s,conceptId:c}){const u=$e(`/api/knowledge/${encodeURIComponent(s)}`,!1);if(!u)return l.jsx("div",{className:"empty",children:"loading…"});if("error"in u)return l.jsx("div",{className:"empty",children:"bundle not found"});const o=c===lp?"activity":"pages",d=u.concepts,h=o==="pages"?c&&d.some(g=>g.id===c)?c:d[0]?.id:void 0,m=`/knowledge/${encodeURIComponent(s)}`;return l.jsxs("div",{className:"agent-view",children:[l.jsxs("div",{className:"page-head",children:[l.jsx("h1",{children:s}),l.jsxs("span",{className:"count",children:[d.length," pages"]}),l.jsxs("div",{className:"tabs",children:[l.jsx(_e,{href:m,className:o==="pages"?"active":"",children:"pages"}),l.jsx(_e,{href:`${m}/${lp}`,className:o==="activity"?"active":"",children:"activity"})]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:()=>{Lu(s)},children:[l.jsx(Q,{name:"picture_as_pdf",className:"ms-sm"})," export PDF"]}),l.jsx("button",{className:"run-btn",onClick:()=>{us("claude",{kind:"knowledge",bundle:s})},children:"curate in chat"})]}),o==="activity"?u.log?l.jsx(wj,{name:s,log:u.log}):l.jsx("section",{className:"panel",children:l.jsx("div",{className:"viewer-note",children:"no activity yet"})}):d.length===0?l.jsx("section",{className:"panel",children:l.jsxs("div",{className:"viewer-note",children:["No pages yet — start a chat to author some, or write one with"," ",l.jsxs("code",{children:["kraftwerk knowledge put ",s,"/<path>"]}),"."]})}):l.jsxs("div",{className:"wiki",children:[l.jsx("aside",{className:"wiki-side",children:Sj(d).map(({folder:g,concepts:y})=>l.jsxs(w.Fragment,{children:[g&&l.jsxs("div",{className:"wiki-folder",children:[g,"/"]}),y.map(x=>l.jsxs(_e,{href:`${m}/${x.id}`,className:`wiki-page ${x.id===h?"active":""}`,title:`${x.id}.md`,children:[l.jsx(Q,{name:jj(x.type),className:"ms-sm"}),l.jsx("span",{className:"wiki-page-title",children:x.title}),(x.stale||x.error)&&l.jsx("span",{className:"wiki-dot",title:x.error??"stale"})]},x.id))]},g||"."))}),l.jsx("div",{className:"wiki-main",children:h&&l.jsx(kj,{bundle:s,conceptId:h},h)})]})]})}function jj(s){switch((s??"").toLowerCase()){case"reference":return"article";case"policy":return"gavel";case"guide":case"howto":return"route";case"decision":return"balance";default:return"menu_book"}}function bj(s){const c=[];for(const u of s.split(`
|
|
203
|
+
`)){const o=u.match(/^##\s+(\d{4}-\d{2}-\d{2})/);if(o){c.push({date:o[1],entries:[]});continue}const d=u.match(/^[*-]\s+\*\*([^*]+)\*\*:\s*(.*)$/);d&&c.length>0&&c[c.length-1].entries.push({kind:d[1].toLowerCase(),text:d[2]})}return c.filter(u=>u.entries.length>0)}function Nj(s,c){const u=[],o=/\[([^\]]+)\]\(\/?([^)]+?)\.md\)/g;let d=0,h;for(;h=o.exec(c);)h.index>d&&u.push(c.slice(d,h.index)),u.push(l.jsx(_e,{href:`/knowledge/${encodeURIComponent(s)}/${h[2].replace(/^\//,"")}`,children:h[1]},h.index)),d=h.index+h[0].length;return d<c.length&&u.push(c.slice(d)),u}function wj({name:s,log:c}){const u=bj(c),[o,d]=w.useState(!1);return l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"activity"}),l.jsx("span",{className:"spacer"}),l.jsx("button",{className:"open-raw",onClick:()=>d(!o),children:o?"timeline":"raw log"})]}),o||u.length===0?l.jsx("div",{className:"viewer-body",children:l.jsx("pre",{children:c})}):l.jsx("div",{className:"know-log",children:u.map(h=>l.jsxs(w.Fragment,{children:[l.jsx("div",{className:"m3-subhead num",children:h.date}),h.entries.map((m,g)=>l.jsxs("div",{className:"know-log-row",children:[l.jsx("span",{className:`chip log-kind log-${m.kind}`,children:m.kind}),l.jsx("span",{className:"know-log-text",children:Nj(s,m.text)})]},g))]},h.date))})]})}function Sj(s){const c=new Map;for(const u of s){const o=u.id.includes("/")?u.id.slice(0,u.id.lastIndexOf("/")):"";(c.get(o)??c.set(o,[]).get(o)).push(u)}return[...c.keys()].sort((u,o)=>u===""?-1:o===""?1:u.localeCompare(o)).map(u=>({folder:u,concepts:c.get(u)}))}function kj({bundle:s,conceptId:c}){const[u,o]=w.useState(null),[d,h]=w.useState(!1),[m,g]=w.useState(!1),[y,x]=w.useState(!1),[b,E]=w.useState(""),[N,L]=w.useState(!1),[z,F]=w.useState(""),[_,T]=w.useState("rendered"),ee=w.useMemo(()=>u?vl.sanitize(Oe.parse(Cp(u.body,s),{async:!1})):"",[u?.body,s]),le=()=>{fetch(`/api/knowledge/${encodeURIComponent(s)}/concept?id=${encodeURIComponent(c)}`).then(A=>A.ok?A.json():Promise.reject()).then(o).catch(()=>h(!0))};w.useEffect(()=>{if(y)return;let A=!0,K;const te=async()=>{try{const U=await fetch(`/api/knowledge/${encodeURIComponent(s)}/concept?id=${encodeURIComponent(c)}`,{cache:"no-store"});if(U.ok){const ue=await U.json();A&&(h(!1),o(me=>JSON.stringify(me)===JSON.stringify(ue)?me:ue))}else U.status===404&&A&&h(!0)}catch{}A&&(K=setTimeout(te,6e3))};return te(),()=>{A=!1,clearTimeout(K)}},[s,c,y]);async function B(){g(!0),await fetch(`/api/knowledge/${encodeURIComponent(s)}/verify`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:c})}).catch(()=>{}),g(!1),le()}async function I(){L(!0),F("");const A=await fetch(`/api/knowledge/${encodeURIComponent(s)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:c,content:b})}).then(K=>K.json()).catch(()=>({error:"save failed"}));L(!1),A.error?F(A.error):(o(A),x(!1))}return d?l.jsx("div",{className:"empty",children:"concept not found"}):u?l.jsxs("div",{className:"agent-view",children:[l.jsxs("div",{className:"detail-head",children:[l.jsx("h1",{children:u.title}),u.type&&l.jsx("span",{className:"chip agent",children:u.type}),l.jsx(np,{tier:u.trustTier}),u.status!=="stable"&&l.jsx("span",{className:`chip ${u.status}`,children:u.status}),u.stale&&l.jsxs("span",{className:"chip stale",children:["stale since ",u.staleAfter?.slice(0,10)]}),l.jsx("span",{className:"spacer"}),l.jsxs(_e,{href:Rp(s,u.id),className:"open-raw",title:"Full-screen document editor with autosave",children:[l.jsx(Q,{name:"edit_document",className:"ms-sm"})," open in editor"]}),l.jsxs("button",{className:"open-raw",onClick:()=>{Lu(s,u.id)},children:[l.jsx(Q,{name:"picture_as_pdf",className:"ms-sm"})," export PDF"]}),l.jsx("button",{className:"run-btn",disabled:m,onClick:B,children:m?"verifying…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"check",className:"ms-sm"})," verify (human)"]})})]}),u.error&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",u.error]}),l.jsxs("div",{className:"detail-cols",children:[l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"content"}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"side-meta",children:[s,"/",u.id,".md"]}),y?l.jsxs(l.Fragment,{children:[l.jsx("button",{className:"open-raw",onClick:()=>{x(!1),F("")},children:"cancel"}),l.jsx("button",{className:"open-raw",disabled:N,onClick:I,children:N?"saving…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"check",className:"ms-sm"})," save"]})})]}):l.jsxs("button",{className:"open-raw",onClick:()=>{E(u.raw),x(!0),F("")},children:[l.jsx(Q,{name:"edit",className:"ms-sm"})," edit"]})]}),y?l.jsxs(l.Fragment,{children:[l.jsx("textarea",{className:"concept-edit",value:b,rows:Math.min(40,Math.max(18,b.split(`
|
|
204
|
+
`).length+2)),onChange:A=>E(A.target.value),spellCheck:!1}),l.jsxs("div",{className:"viewer-note",children:["full file (frontmatter + markdown body) — saving stamps provenance as"," ",l.jsx("code",{children:"human:user"})," and logs an update."]})]}):l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"viewer-note md-toolbar",children:l.jsxs("div",{className:"tabs",children:[l.jsx("button",{className:_==="rendered"?"active":"",onClick:()=>T("rendered"),children:"rendered"}),l.jsx("button",{className:_==="source"?"active":"",onClick:()=>T("source"),children:"source"})]})}),l.jsx("div",{className:"viewer-body",children:_==="rendered"?l.jsx("div",{className:"md-body concept-md",dangerouslySetInnerHTML:{__html:ee}}):l.jsx("pre",{children:u.body.trim()||"(empty body)"})})]}),z&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",z]})]}),l.jsxs("aside",{className:"detail-rail",children:[l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"about"})}),l.jsxs("div",{className:"rail-list",children:[l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"trust"}),l.jsx("span",{className:"v",children:l.jsx(np,{tier:u.trustTier})})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"generated"}),l.jsx("span",{className:`v ${u.generated?"":"dim"}`,children:u.generated?`${u.generated.by??"?"} · ${(u.generated.at??"?").slice(0,10)}`:"not stamped"})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"verified"}),u.verified.length===0?l.jsx("span",{className:"v dim",children:"never"}):u.verified.map((A,K)=>l.jsxs("span",{className:"v",children:[A.by??"?"," · ",(A.at??"?").slice(0,10)]},K))]}),u.staleAfter&&l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"stale after"}),l.jsxs("span",{className:`v ${u.stale?"":"dim"}`,children:[u.staleAfter.slice(0,10),u.stale&&l.jsx("span",{className:"chip stale",children:"stale"})]})]}),u.tags.length>0&&l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"tags"}),l.jsx("span",{className:"m3-chips",children:u.tags.map(A=>l.jsx("span",{className:"chip",children:A},A))})]})]})]}),u.sources.length>0&&l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"sources"})}),l.jsx("div",{className:"rail-list",children:u.sources.map((A,K)=>l.jsxs("div",{className:"rail-kv",children:[l.jsxs("span",{className:"v",children:[A.resource?.startsWith("http")?l.jsx("a",{href:A.resource,target:"_blank",rel:"noreferrer",children:A.title??A.resource}):A.title??A.resource??"?",A.id&&l.jsxs("span",{className:"know-id",children:["[^",A.id,"]"]})]}),l.jsx("span",{className:"v dim",children:[A.author,A.usage_count!=null?`${A.usage_count} uses`:null,A.last_modified?`mod ${A.last_modified.slice(0,10)}`:null].filter(Boolean).join(" · ")})]},K))})]})]})]})]}):l.jsx("div",{className:"empty",children:"loading…"})}const Tj={workspace:"workspace",project:".claude",user:"global",agent:"agent"};function zp(s){return l.jsx("span",{className:`chip skill-src ${s}`,children:Tj[s]})}function Ej({name:s}){const c=$e("/api/skills",!1),u=c?.skills??[],o=u.filter(m=>m.source==="workspace"),d=u.filter(m=>m.source!=="workspace"),h=m=>l.jsxs(_e,{href:`/skills/${encodeURIComponent(m.name)}`,className:`side-row ${m.name===s?"active":""}`,children:[l.jsx("span",{className:`lamp ${m.source==="workspace"?"ok":"dim"}`}),l.jsxs("div",{className:"side-row-body",children:[l.jsxs("div",{className:"side-row-top",children:[l.jsxs("span",{className:"side-wf",children:["/",m.name]}),m.source!=="workspace"&&zp(m.source)]}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:m.description||"no description"})})]})]},`${m.source}:${m.name}`);return l.jsxs("div",{className:"runs-screen",children:[l.jsxs("aside",{className:"runs-side",children:[l.jsx("div",{className:"side-head",children:l.jsx("span",{className:"microlabel",children:"workspace skills"})}),l.jsxs("div",{className:"side-list",children:[o.map(h),c&&o.length===0&&l.jsx("div",{className:"viewer-note",children:"no workspace skills yet"}),d.length>0&&l.jsxs(w.Fragment,{children:[l.jsx("div",{className:"side-head skills-local-head",children:l.jsx("span",{className:"microlabel",children:"local (this machine / repo)"})}),d.map(h)]})]})]}),l.jsx("div",{className:"runs-main",children:s?l.jsx(Aj,{name:s},s):l.jsx(_j,{root:c?.root,workspace:o})})]})}function _j({root:s,workspace:c}){return l.jsxs("div",{className:"new-chat",children:[l.jsxs("div",{className:"page-head",children:[l.jsx("h1",{children:"skills"}),l.jsxs("span",{className:"count",children:[c.length," in workspace"]})]}),l.jsxs("section",{className:"panel new-chat-panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"what lives here"})}),l.jsxs("div",{className:"know-intro",children:["Skills are reusable ",l.jsx("b",{children:"instruction packages"}),": one folder per skill with a"," ",l.jsx("code",{children:"SKILL.md"})," (YAML frontmatter: name, description). ",l.jsx("b",{children:"Workspace skills"}),s?l.jsxs(l.Fragment,{children:[" live under ",l.jsx("code",{children:s})]}):null,", are tracked in git and shared with everyone in this workspace — they are the ones to build on. Skills from"," ",l.jsx("code",{children:".claude/skills"})," and your personal ",l.jsx("code",{children:"~/.claude/skills"})," also work here, but stay repo-/machine-local. Invoke any skill in a session with"," ",l.jsx("code",{children:"/<name>"}),"."]}),l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"add a workspace skill"})}),l.jsxs("div",{className:"know-intro",children:["Create ",l.jsxs("code",{children:[s?`${s}/`:"skills/","<name>/SKILL.md"]}),", commit it, done — it appears here and in every session's ",l.jsx("code",{children:"/"})," menu."]})]})]})}function Aj({name:s}){const[c,u]=w.useState(null),[o,d]=w.useState(!1),[h,m]=w.useState("rendered"),g=w.useMemo(()=>c?c.content.replace(/^---\r?\n[\s\S]*?\r?\n---(\r?\n|$)/,""):"",[c?.content]),y=w.useMemo(()=>c?vl.sanitize(Oe.parse(g,{async:!1})):"",[g]);return w.useEffect(()=>{fetch(`/api/skills/${encodeURIComponent(s)}`).then(x=>x.ok?x.json():Promise.reject()).then(u).catch(()=>d(!0))},[s]),o?l.jsx("div",{className:"empty",children:"skill not found"}):c?l.jsxs("div",{className:"agent-view",children:[l.jsxs("div",{className:"detail-head",children:[l.jsxs("h1",{children:["/",c.name]}),zp(c.source)]}),c.description&&l.jsx("div",{className:"know-intro skill-desc",children:c.description}),l.jsxs("div",{className:"detail-cols",children:[l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"SKILL.md"}),l.jsx("span",{className:"spacer"}),l.jsxs("div",{className:"tabs",children:[l.jsx("button",{className:h==="rendered"?"active":"",onClick:()=>m("rendered"),children:"rendered"}),l.jsx("button",{className:h==="source"?"active":"",onClick:()=>m("source"),children:"source"})]})]}),l.jsx("div",{className:"viewer-body",children:h==="rendered"?l.jsx("div",{className:"md-body concept-md",dangerouslySetInnerHTML:{__html:y}}):l.jsx("pre",{children:c.content.trim()||"(empty)"})})]}),l.jsx("aside",{className:"detail-rail",children:l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"about"})}),l.jsxs("div",{className:"rail-list",children:[l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"source"}),l.jsx("span",{className:"v",children:c.source==="workspace"?"workspace — git-tracked, shared with the team":c.source==="project"?"repo .claude/skills — tracked, but outside the workspace root":"global ~/.claude/skills — only on this machine"})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"path"}),l.jsx("span",{className:"v mono skill-path",title:c.path,children:c.path})]}),l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"invoke"}),l.jsxs("span",{className:"v",children:[l.jsxs("code",{children:["/",c.name]})," in any session"]})]}),c.files.length>0&&l.jsxs("div",{className:"rail-kv",children:[l.jsx("span",{className:"microlabel",children:"bundled files"}),c.files.map(x=>l.jsx("span",{className:"v mono",children:x},x))]})]})]})})]})]}):l.jsx("div",{className:"empty",children:"loading…"})}const Cj=["","low","medium","high","xhigh","max"],Rj=["🤖","🧑💻","🎧","🛠️","📊","✍️","🔍","🧹","📦","🚀"];function sp({seg:s}){const c=s[0]&&s[0]!=="new"&&s[0]!=="chats"?decodeURIComponent(s[0]):void 0,u=s[0]==="new"?"new":s[0]==="chats"?"chats":s[1]==="edit"?"edit":s[1]==="info"?"info":s[1]==="chat"?"chat":c?"agent":"home",o=u==="chat"?s[2]:u==="chats"?s[1]:void 0,d=$e("/api/agents",!1),h=$a(),[m,g]=w.useState(()=>{try{const X=JSON.parse(localStorage.getItem("kw-agent-groups")??"[]");return Array.isArray(X)?X.map(String):[]}catch{return[]}}),[y,x]=w.useState(!1),[b,E]=w.useState(""),[N,L]=w.useState(null),[z,F]=w.useState(""),[_,T]=w.useState(null),[ee,le]=w.useState(null),[B,I]=w.useState({}),A=(d?.agents??[]).map(X=>B[X.slug]!==void 0?{...X,group:B[X.slug]||void 0}:X);w.useEffect(()=>{I(X=>{const ze={...X};let Ye=!1;for(const Pe of d?.agents??[])ze[Pe.slug]!==void 0&&(Pe.group??"")===ze[Pe.slug]&&(delete ze[Pe.slug],Ye=!0);return Ye?ze:X})},[d]);const K=A.filter(X=>!X.archived),te=A.filter(X=>X.archived),[U,ue]=w.useState(!1),me=[...new Set([...K.map(X=>X.group??"").filter(Boolean),...m])].sort((X,ze)=>X.localeCompare(ze)),$=K.filter(X=>!X.group);function ie(X){g(X);try{localStorage.setItem("kw-agent-groups",JSON.stringify(X))}catch{}}function be(){const X=b.trim();x(!1),E(""),X&&!me.includes(X)&&ie([...m,X])}function Ie(X,ze){L(null);const Ye=ze.trim();if(!(!Ye||Ye===X)){for(const Pe of A.filter(aa=>aa.group===X))q(Pe.slug,Ye);m.includes(X)&&ie([...new Set(m.map(Pe=>Pe===X?Ye:Pe))])}}async function q(X,ze){if((A.find(Pe=>Pe.slug===X)?.group??"")!==ze){I(Pe=>({...Pe,[X]:ze}));try{const Pe=await fetch(`/api/agents/${encodeURIComponent(X)}`);if(!Pe.ok)throw new Error;const aa=await Pe.json();if(!(await fetch(`/api/agents/${encodeURIComponent(X)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({...aa,group:ze||void 0})})).ok)throw new Error}catch{I(Pe=>{const aa={...Pe};return delete aa[X],aa})}}}const ae=X=>h?{onDragOver:ze=>{_!=null&&(ze.preventDefault(),ze.dataTransfer.dropEffect="move",ee!==X&&le(X))},onDrop:ze=>{ze.preventDefault();const Ye=ze.dataTransfer.getData("text/plain")||_;Ye&&q(Ye,X),T(null),le(null)}}:{},de=X=>l.jsxs(_e,{href:`/agents/${encodeURIComponent(X.slug)}`,className:`side-row ${X.slug===c?"active":""} ${_===X.slug?"dragging":""}`,draggable:h,onDragStart:ze=>{ze.dataTransfer.setData("text/plain",X.slug),ze.dataTransfer.effectAllowed="move",T(X.slug)},onDragEnd:()=>{T(null),le(null)},children:[l.jsx("span",{className:"agent-avatar sm",children:l.jsx("span",{"aria-hidden":!0,children:X.emoji})}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:X.name})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:X.description||X.harness})})]})]},X.slug),Re=X=>l.jsxs(_e,{href:`/agents/${encodeURIComponent(X.slug)}/info`,className:`side-row archived-row ${X.slug===c?"active":""}`,children:[l.jsx("span",{className:"agent-avatar sm",children:l.jsx("span",{"aria-hidden":!0,children:X.emoji})}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:X.name})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:X.description||X.harness})})]})]},X.slug);let Ne;u==="new"?Ne=l.jsx(cp,{},"new"):u==="edit"&&c?Ne=l.jsx(cp,{slug:c},c):u==="chat"&&c&&o?Ne=l.jsx("div",{className:"chat-main",children:l.jsx(Wm,{id:o,agentName:A.find(X=>X.slug===c)?.name??c,agentDescription:A.find(X=>X.slug===c)?.description},o)}):u==="chats"?Ne=o?l.jsx("div",{className:"chat-main",children:l.jsx(Wm,{id:o},o)}):l.jsx(Ly,{}):u==="info"&&c?Ne=l.jsx(Op,{slug:c},c):c?Ne=l.jsx(Oj,{slug:c},c):Ne=l.jsx(Uj,{hasAgents:K.length>0,root:d?.root});const k=(u==="agent"||u==="info"||u==="chat")&&c?A.find(X=>X.slug===c)?.knowledge??[]:[],[Z,ne]=w.useState(()=>localStorage.getItem("kw-kside")!=="hidden"),[P,ge]=w.useState(()=>Number(localStorage.getItem("kw-kside-w"))||460),ve=k.length>0&&Z;function Ae(X){ne(X),localStorage.setItem("kw-kside",X?"open":"hidden")}function mt(X){ge(X),localStorage.setItem("kw-kside-w",String(X))}return l.jsxs("div",{className:`runs-screen agents-screen ${c||u==="chats"?"has-sessions":""} ${ve?"has-knowledge":""}`,style:ve?{"--kside-w":`${P}px`}:void 0,children:[l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"agents"}),l.jsx("span",{className:"spacer"}),h&&l.jsxs(_e,{href:"/agents/new",className:"open-raw",children:[l.jsx(Q,{name:"add",className:"ms-sm"})," new"]})]}),l.jsxs("div",{className:"side-list",children:[l.jsxs(_e,{href:"/agents/chats",className:`side-row side-general ${u==="chats"?"active":""}`,children:[l.jsx("span",{className:"agent-avatar sm",children:l.jsx("span",{"aria-hidden":!0,children:"💬"})}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:"General Chats"})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-req",children:"chats without an agent"})})]})]}),l.jsxs("div",{className:`side-group ${_&&ee===""?"drop-over":""}`,...ae(""),children:[$.map(de),_!=null&&$.length===0&&l.jsx("div",{className:"side-group-empty",children:"no group — drop here"})]}),me.map(X=>{const ze=K.filter(Ye=>Ye.group===X);return l.jsxs("div",{className:`side-group ${_&&ee===X?"drop-over":""}`,...ae(X),children:[l.jsxs("div",{className:"side-group-head",children:[N===X?l.jsx("input",{className:"side-group-rename",autoFocus:!0,value:z,onChange:Ye=>F(Ye.target.value),onKeyDown:Ye=>{Ye.key==="Enter"&&Ie(X,z),Ye.key==="Escape"&&L(null)},onBlur:()=>Ie(X,z)}):l.jsx("span",{className:"microlabel",children:X}),l.jsx("span",{className:"side-group-count num",children:ze.length}),l.jsx("span",{className:"spacer"}),h&&N!==X&&l.jsx("button",{className:"side-group-x",title:"Rename group",onClick:()=>{L(X),F(X)},children:l.jsx(Q,{name:"edit",className:"ms-sm"})}),h&&ze.length===0&&m.includes(X)&&l.jsx("button",{className:"side-group-x",title:"Remove empty group",onClick:()=>ie(m.filter(Ye=>Ye!==X)),children:l.jsx(Q,{name:"close",className:"ms-sm"})})]}),ze.map(de),ze.length===0&&l.jsx("div",{className:"side-group-empty",children:h?"drag agents here":"no agents"})]},X)}),te.length>0&&l.jsxs("div",{className:"side-group side-archived",children:[l.jsxs("button",{className:"side-archived-toggle","aria-expanded":U,onClick:()=>ue(X=>!X),children:[l.jsx("span",{className:"microlabel",children:"archived"}),l.jsx("span",{className:"side-group-count num",children:te.length}),l.jsx("span",{className:"spacer"}),l.jsx(Q,{name:U?"expand_less":"expand_more",className:"ms-sm"})]}),U&&te.map(Re)]}),d&&A.length===0&&l.jsx("div",{className:"viewer-note",children:"no agents yet"}),h&&(y?l.jsx("div",{className:"side-group-new",children:l.jsx("input",{autoFocus:!0,value:b,placeholder:"group name, e.g. Team Content",onChange:X=>E(X.target.value),onKeyDown:X=>{X.key==="Enter"&&be(),X.key==="Escape"&&(x(!1),E(""))},onBlur:be})}):l.jsxs("button",{className:"side-group-add",onClick:()=>x(!0),children:[l.jsx(Q,{name:"add",className:"ms-sm"})," group"]}))]})]}),c&&l.jsx(Dj,{slug:c,chatId:o}),u==="chats"&&l.jsx(Mj,{chatId:o}),l.jsx("div",{className:"runs-main",children:Ne}),ve&&l.jsx(zj,{bundles:k,onHide:()=>Ae(!1),onResize:mt}),k.length>0&&!Z&&l.jsxs("button",{className:"kside-reopen",onClick:()=>Ae(!0),title:"Show knowledge sidebar",children:[l.jsx(Q,{name:"menu_book",className:"ms-sm"})," knowledge"]})]})}function zj({bundles:s,onHide:c,onResize:u}){const[o,d]=w.useState({}),[h,m]=w.useState(null),[g,y]=w.useState({}),[x,b]=w.useState({}),[E,N]=w.useState(null),[L,z]=w.useState(""),[F,_]=w.useState(!1),[T,ee]=w.useState("");w.useEffect(()=>{d({});let I=!0,A;const K=async()=>{await Promise.all(s.map(async te=>{try{const U=await fetch(`/api/knowledge/${encodeURIComponent(te)}`,{cache:"no-store"}),ue=U.ok?await U.json():null;I&&d(me=>JSON.stringify(me[te])===JSON.stringify(ue)?me:{...me,[te]:ue})}catch{I&&d(U=>te in U?U:{...U,[te]:null})}})),I&&(A=setTimeout(K,6e3))};return K(),()=>{I=!1,clearTimeout(A)}},[s.join(",")]),w.useEffect(()=>{if(!h||E===h)return;const I=h.indexOf("::"),A=h.slice(0,I),K=h.slice(I+2);let te=!0,U;const ue=async()=>{try{const me=await fetch(`/api/knowledge/${encodeURIComponent(A)}/concept?id=${encodeURIComponent(K)}`,{cache:"no-store"}),$=me.ok?await me.json():null;te&&y(ie=>JSON.stringify(ie[h])===JSON.stringify($)?ie:{...ie,[h]:$})}catch{te&&y(me=>h in me?me:{...me,[h]:null})}te&&(U=setTimeout(ue,6e3))};return ue(),()=>{te=!1,clearTimeout(U)}},[h,E]);function le(I,A){const K=`${I}::${A}`;m(h===K?null:K)}async function B(I,A){const K=`${I}::${A}`;_(!0),ee("");try{const U=await(await fetch(`/api/knowledge/${encodeURIComponent(I)}/concept`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({id:A,content:L})})).json();U.error?ee(U.error):(y(ue=>({...ue,[K]:U})),N(null))}catch(te){ee(te.message)}_(!1)}return l.jsxs("aside",{className:"runs-side knowledge-side",children:[l.jsx("div",{className:"kside-resizer",title:"Drag to resize",onMouseDown:I=>{I.preventDefault();const A=I.clientX,K=I.currentTarget.parentElement.offsetWidth,te=ue=>u(Math.min(900,Math.max(280,K+(A-ue.clientX)))),U=()=>{window.removeEventListener("mousemove",te),window.removeEventListener("mouseup",U)};window.addEventListener("mousemove",te),window.addEventListener("mouseup",U)}}),l.jsxs("div",{className:"side-head",children:[l.jsxs("span",{className:"kside-headline",children:[l.jsx("span",{className:"microlabel",children:"knowledge"}),l.jsx("span",{className:"kside-hint",children:"read & kept current by this agent"})]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:c,title:"Hide knowledge sidebar",children:["hide ",l.jsx(Q,{name:"close",className:"ms-sm"})]})]}),l.jsx("div",{className:"side-list",children:s.map(I=>{const A=o[I],K=x[I]===!0;return l.jsxs("div",{className:"kside-bundle",children:[l.jsxs("div",{className:"kside-bundle-head",children:[l.jsxs("button",{className:"kside-bundle-toggle","aria-expanded":!K,onClick:()=>b({...x,[I]:!K}),children:[l.jsx("span",{className:`kside-chev ${K?"":"open"}`,"aria-hidden":!0,children:l.jsx(Q,{name:"chevron_right",className:"ms-sm"})}),l.jsx("span",{className:"kside-bundle-name",children:I}),A&&l.jsx("span",{className:"kside-count num",children:A.concepts.length})]}),l.jsx("button",{className:"kside-open",title:"Export this bundle as PDF",onClick:()=>{Lu(I)},children:l.jsx(Q,{name:"picture_as_pdf",className:"ms-sm"})}),l.jsx(_e,{href:`/knowledge/${encodeURIComponent(I)}`,className:"kside-open",title:"Open this bundle on the knowledge screen",children:"↗"})]}),!K&&A===null&&l.jsx("div",{className:"viewer-note",children:"bundle not found"}),!K&&A?.concepts.map(te=>{const U=`${I}::${te.id}`,ue=h===U,me=`/knowledge/${encodeURIComponent(I)}/${te.id.split("/").map(encodeURIComponent).join("/")}`;return l.jsxs("div",{className:`kside-concept ${ue?"open":""}`,children:[l.jsxs("button",{className:"kside-row","aria-expanded":ue,title:te.description||void 0,onClick:()=>le(I,te.id),children:[l.jsx("span",{className:`kside-chev ${ue?"open":""}`,"aria-hidden":!0,children:l.jsx(Q,{name:"chevron_right",className:"ms-sm"})}),l.jsx("span",{className:"kside-title",children:te.title||te.id}),te.stale&&l.jsx("span",{className:"kside-stale",title:"Past its stale-after date — ask the agent to re-verify it",children:"stale"})]}),ue&&l.jsx("div",{className:"kside-card",ref:$=>$?.scrollIntoView({block:"nearest"}),children:g[U]===void 0?l.jsx("div",{className:"viewer-note",children:"loading…"}):g[U]===null?l.jsx("div",{className:"viewer-note",children:"could not load concept"}):E===U?l.jsxs("div",{className:"kside-edit",children:[l.jsx("textarea",{className:"concept-edit",value:L,rows:Math.min(28,Math.max(10,L.split(`
|
|
205
|
+
`).length+2)),onChange:$=>z($.target.value),spellCheck:!1}),l.jsxs("div",{className:"kside-actions",children:[l.jsx("button",{className:"open-raw",disabled:F,onClick:()=>N(null),children:"cancel"}),l.jsx("button",{className:"open-raw",disabled:F,onClick:()=>B(I,te.id),children:F?"saving…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"check",className:"ms-sm"})," save"]})})]}),T&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",T]})]}):l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"kside-card-bar",children:[te.type&&l.jsx("span",{className:"kside-type",children:te.type}),ip(te)&&l.jsxs("span",{className:"kside-updated num",children:["updated ",gl(ip(te))]}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"open-raw",onClick:()=>{z(g[U].raw),N(U),ee("")},children:[l.jsx(Q,{name:"edit",className:"ms-sm"})," edit"]}),l.jsxs(_e,{href:Rp(I,te.id),className:"open-raw",title:"Full-screen document editor with autosave",children:[l.jsx(Q,{name:"edit_document",className:"ms-sm"})," editor"]}),l.jsx(_e,{href:me,className:"open-raw",children:"open ↗"})]}),l.jsx("div",{className:"kside-md md-body",dangerouslySetInnerHTML:{__html:vl.sanitize(Oe.parse(g[U].body??"",{async:!1}))}})]})})]},te.id)}),!K&&A&&A.concepts.length===0&&l.jsx("div",{className:"viewer-note",children:"no concepts yet"})]},I)})})]})}function ip(s){return[s.generated?.at,...s.verified.map(u=>u.at)].filter(u=>typeof u=="string"&&u.length>0).sort().pop()}function Oj({slug:s}){const[c,u]=w.useState(!1);return w.useEffect(()=>{let o=!0;return u(!1),fetch("/api/chats").then(d=>d.json()).then(d=>{if(!o)return;const h=d.chats.find(m=>m.scope.kind==="agent"&&m.scope.slug===s);h?ta(`/agents/${encodeURIComponent(s)}/chat/${h.id}`,{replace:!0}):u(!0)}).catch(()=>o&&u(!0)),()=>{o=!1}},[s]),c?l.jsx(Op,{slug:s}):l.jsx("div",{className:"empty",children:"loading…"})}function Dj({slug:s,chatId:c}){const u=$e("/api/chats",!1),o=(u?.chats??[]).filter(m=>m.scope.kind==="agent"&&m.scope.slug===s),[d,h]=w.useState(!1);return l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"sessions"}),l.jsx("span",{className:"spacer"}),l.jsx(_e,{href:`/agents/${encodeURIComponent(s)}/info`,className:"open-raw",title:"agent profile & settings",children:"profile"}),l.jsx("button",{className:"open-raw",disabled:d,onClick:async()=>{h(!0),await us("claude",{kind:"agent",slug:s}),h(!1)},children:d?"…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"add",className:"ms-sm"})," new"]})})]}),l.jsxs("div",{className:"side-list",children:[o.map(m=>l.jsxs(_e,{href:`/agents/${encodeURIComponent(s)}/chat/${m.id}`,className:`side-row ${m.id===c?"active":""}`,children:[l.jsx("span",{className:`lamp ${m.busy?"running":"pending"}`}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:m.title||"new session"})}),l.jsx("div",{className:"side-row-sub",children:l.jsx("span",{className:"side-when num",children:gl(m.updatedAt)})})]}),l.jsx("button",{type:"button",className:"row-x",title:"delete session",onClick:async g=>{g.preventDefault(),g.stopPropagation(),window.confirm(`Delete session "${m.title||m.id}"?`)&&(await fetch(`/api/chats/${m.id}`,{method:"DELETE"}).catch(()=>{}),m.id===c&&ta(`/agents/${encodeURIComponent(s)}`))},children:l.jsx(Q,{name:"close",className:"ms-sm"})})]},m.id)),u&&o.length===0&&l.jsx("div",{className:"viewer-note",children:"no sessions yet"})]})]})}function Mj({chatId:s}){const c=$e("/api/chats",!1),u=(c?.chats??[]).filter(o=>o.scope.kind!=="agent");return l.jsxs("aside",{className:"runs-side",children:[l.jsxs("div",{className:"side-head",children:[l.jsx("span",{className:"microlabel",children:"chats"}),l.jsx("span",{className:"spacer"}),l.jsxs(_e,{href:"/agents/chats",className:"open-raw",children:[l.jsx(Q,{name:"add",className:"ms-sm"})," new"]})]}),l.jsxs("div",{className:"side-list",children:[u.map(o=>l.jsxs(_e,{href:`/agents/chats/${o.id}`,className:`side-row ${o.id===s?"active":""}`,children:[l.jsx("span",{className:`lamp ${o.busy?"running":"pending"}`}),l.jsxs("div",{className:"side-row-body",children:[l.jsx("div",{className:"side-row-top",children:l.jsx("span",{className:"side-wf",children:o.title||"new chat"})}),l.jsxs("div",{className:"side-row-sub",children:[l.jsxs("span",{className:"side-req",children:[o.agent,o.scope.kind==="run"?` · ${o.scope.runId}`:o.scope.kind==="kraftwerk"?" · kraftwerk":o.scope.kind==="knowledge"?` · knowledge${o.scope.bundle?`:${o.scope.bundle}`:""}`:""]}),l.jsx("span",{className:"side-when num",children:gl(o.updatedAt)})]})]}),l.jsx("button",{type:"button",className:"row-x",title:"delete chat",onClick:async d=>{d.preventDefault(),d.stopPropagation(),window.confirm(`Delete chat "${o.title||o.id}"?`)&&(await fetch(`/api/chats/${o.id}`,{method:"DELETE"}).catch(()=>{}),o.id===s&&ta("/agents/chats"))},children:l.jsx(Q,{name:"close",className:"ms-sm"})})]},o.id)),c&&u.length===0&&l.jsx("div",{className:"viewer-note",children:"no chats yet"})]})]})}function Uj({hasAgents:s,root:c}){const u=$a();return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:"agents"})}),l.jsxs("section",{className:"panel new-chat-panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"what lives here"})}),l.jsxs("div",{className:"know-intro",children:["Your agents, set up like agents: each one has a name, a role (system prompt), a harness/model to run on, and the workflows that belong to its job. An agent lives in"," ",l.jsx("code",{children:c?`${c}/<slug>/`:"agents/<slug>/"})," as ",l.jsx("code",{children:"agent.yml"})," +"," ",l.jsx("code",{children:"system.md"})," — git-tracked, so your team travels with the repo. Every session is a persistent conversation with that agent; it knows its connected workflows and knowledge bundles, runs the workflows for you, and keeps the knowledge current."]}),u?l.jsx("div",{style:{padding:"0 16px 16px"},children:l.jsx("button",{className:"run-btn",onClick:()=>ta("/agents/new"),children:l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"add",className:"ms-sm"})," ",s?"new agent":"create your first agent"]})})}):l.jsx("div",{className:"settings-note",style:{padding:"0 16px 16px"},children:"Creating agents needs expert mode — flip the switch in the top bar."})]})]})}function Op({slug:s}){const[c,u]=w.useState(null),[o,d]=w.useState(!1),[h,m]=w.useState(!1),[g,y]=w.useState(!1),[x,b]=w.useState(""),[E,N]=w.useState(""),[L,z]=w.useState([]),[F,_]=w.useState(!0),[T,ee]=w.useState(!1),[le,B]=w.useState(""),I=$e("/api/workflows",!1),A=$e("/api/knowledge",!1),K=$e("/api/skills",!1);w.useEffect(()=>{let $=!0;return fetch(`/api/agents/${encodeURIComponent(s)}`).then(ie=>ie.ok?ie.json():Promise.reject()).then(ie=>$&&u(ie)).catch(()=>$&&d(!0)),()=>{$=!1}},[s]);async function te($){if(c){ee(!0),B("");try{const be=await(await fetch(`/api/agents/${encodeURIComponent(s)}`,{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:c.name,emoji:c.emoji,description:c.description,harness:c.harness,model:c.model,effort:c.effort,group:c.group,system:c.system,workflows:c.workflows,knowledge:c.knowledge,skills:c.skills,...$})})).json();be.error?B(be.error):(u(be),b(""))}catch(ie){B(ie.message)}ee(!1)}}function U($,ie){z(ie?[...L,$]:L.filter(be=>be!==$))}async function ue($){ee(!0),B("");try{const be=await(await fetch(`/api/agents/${encodeURIComponent(s)}/archive`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({archived:$})})).json();be.error?B(be.error):u(be)}catch(ie){B(ie.message)}ee(!1)}if(o)return l.jsx("div",{className:"empty",children:"agent not found"});if(!c)return l.jsx("div",{className:"empty",children:"loading…"});const me=$=>l.jsxs("div",{className:"agent-form-row",style:{marginTop:8},children:[l.jsx("button",{className:"run-btn",disabled:T,onClick:()=>{te($)},children:T?"saving…":"save"}),l.jsx("button",{className:"open-raw",disabled:T,onClick:()=>(b(""),B("")),children:"cancel"})]});return l.jsxs("div",{className:"agent-view",children:[l.jsxs("div",{className:"detail-head",children:[l.jsx("span",{className:"agent-avatar lg",children:l.jsx("span",{"aria-hidden":!0,children:c.emoji})}),l.jsx("h1",{children:c.name}),l.jsx("span",{className:"chip agent",children:c.harness}),c.model&&l.jsx("span",{className:"chip",children:c.model}),c.effort&&l.jsxs("span",{className:"chip",children:["effort: ",c.effort]}),c.archived&&l.jsxs("span",{className:"chip archived-chip",children:[l.jsx(Q,{name:"inventory_2",className:"ms-sm"})," archived"]}),l.jsx("span",{className:"spacer"}),l.jsx(_e,{href:`/agents/${encodeURIComponent(s)}/edit`,className:"open-raw",children:"edit"}),c.archived?l.jsxs("button",{className:"run-btn tonal",disabled:T,onClick:()=>{ue(!1)},children:[l.jsx(Q,{name:"unarchive",className:"ms-sm"})," ",T?"…":"unarchive"]}):l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"open-raw",disabled:T,title:"Hide this agent from the roster — restorable any time",onClick:()=>{ue(!0)},children:[l.jsx(Q,{name:"archive",className:"ms-sm"})," archive"]}),l.jsx("button",{className:"run-btn",disabled:h,onClick:async()=>{m(!0),await us("claude",{kind:"agent",slug:s}),m(!1)},children:h?"starting…":"new session"})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"m3-list",children:[l.jsxs("button",{type:"button",className:"m3-row m3-toggle",onClick:()=>y(!g),children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{name:"badge"})}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:"role"}),!g&&l.jsx("span",{className:"m3-sub m3-ellipsis",children:(c.system||"").trim().split(`
|
|
206
|
+
`)[0]||"empty — expand to give this agent a role"})]}),l.jsx("span",{className:`m3-chev ${g?"open":""}`,children:l.jsx(Q,{name:"expand_more",className:"ms-sm"})})]}),g&&x!=="role"&&l.jsxs("div",{className:"m3-expand",children:[l.jsx("pre",{children:c.system||"(empty — click edit to give this agent a role)"}),l.jsxs("div",{className:"agent-form-row",style:{marginTop:10},children:[l.jsxs("button",{className:"open-raw",onClick:()=>{N(c.system),b("role"),B("")},children:[l.jsx(Q,{name:"edit",className:"ms-sm"})," edit role"]}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"m3-sub",children:["agents/",c.slug,"/system.md"]})]})]}),g&&x==="role"&&l.jsxs("div",{className:"m3-expand",children:[l.jsx("textarea",{className:"concept-edit",rows:Math.min(24,Math.max(8,E.split(`
|
|
207
|
+
`).length+2)),value:E,placeholder:"You are the ... for this project. Your job is ...",onChange:$=>N($.target.value),spellCheck:!1}),me({system:E})]}),l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{name:"account_tree"})}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:"workflows"}),x==="workflows"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"wf-checks",children:[(I?.workflows??[]).map($=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:L.includes($.slug),onChange:ie=>U($.slug,ie.target.checked)}),l.jsx("b",{children:$.slug}),$.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",$.description]})]},$.slug)),(I?.workflows??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no workflows in this project"})]}),me({workflows:L})]}):c.workflows.length===0?l.jsx("span",{className:"m3-sub",children:"none connected — the agent can run any workflow you connect"}):l.jsx("span",{className:"m3-chips",children:c.workflows.map($=>l.jsx(_e,{href:`/workflows/${encodeURIComponent($)}`,className:"chip",children:$},$))})]}),x!=="workflows"&&l.jsx("button",{className:"open-raw",onClick:()=>{z(c.workflows),b("workflows"),B("")},children:"edit"})]}),l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{name:"menu_book"})}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:"knowledge"}),x==="knowledge"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"wf-checks",children:[(A?.bundles??[]).map($=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:L.includes($.name),onChange:ie=>U($.name,ie.target.checked)}),l.jsx("b",{children:$.name}),l.jsxs("span",{className:"opt-hint",children:[" — ",$.concepts," concepts"]})]},$.name)),(A?.bundles??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no knowledge bundles in this project"})]}),me({knowledge:L})]}):c.knowledge.length===0?l.jsx("span",{className:"m3-sub",children:"none connected — connected bundles are read and kept current by the agent"}):l.jsx("span",{className:"m3-chips",children:c.knowledge.map($=>l.jsx(_e,{href:`/knowledge/${encodeURIComponent($)}`,className:"chip",children:$},$))})]}),x!=="knowledge"&&l.jsx("button",{className:"open-raw",onClick:()=>{z(c.knowledge),b("knowledge"),B("")},children:"edit"})]}),l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{name:"extension"})}),l.jsxs("span",{className:"m3-body",children:[l.jsx("span",{className:"m3-head",children:"shared skills"}),x==="skills"?l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"wf-checks",children:[l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:F,onChange:$=>_($.target.checked)}),l.jsx("b",{children:"all skills"}),l.jsx("span",{className:"opt-hint",children:" — every discovered skill, including future ones"})]}),!F&&(K?.skills??[]).map($=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:L.includes($.name),onChange:ie=>U($.name,ie.target.checked)}),l.jsxs("b",{children:["/",$.name]}),$.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",$.description]})]},$.name)),!F&&(K?.skills??[]).length===0&&l.jsx("div",{className:"viewer-note",children:"no skills found (.claude/skills, project or user)"})]}),me({skills:F?void 0:L})]}):c.skills===void 0?l.jsx("span",{className:"m3-sub",children:"all discovered skills (default) — invoke with /name in a session"}):c.skills.length===0?l.jsx("span",{className:"m3-sub",children:"none — this agent runs without skills"}):l.jsx("span",{className:"m3-chips",children:c.skills.map($=>l.jsxs("span",{className:"chip",children:["/",$]},$))})]}),x!=="skills"&&l.jsx("button",{className:"open-raw",onClick:()=>{_(c.skills===void 0),z(c.skills??[]),b("skills"),B("")},children:"edit"})]})]}),le&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",le]})]}),l.jsx(Hj,{slug:s}),l.jsx($j,{slug:s})]})}const Lj=`---
|
|
208
|
+
description: What this skill is for (one line)
|
|
209
|
+
---
|
|
210
|
+
|
|
211
|
+
Instructions this agent follows when the skill applies or is invoked with /<name>.
|
|
212
|
+
`;function Hj({slug:s}){const u=$e(`/api/agents/${encodeURIComponent(s)}/skills`,!1)?.skills??[],[o,d]=w.useState(null),[h,m]=w.useState(!1),[g,y]=w.useState("");async function x(N){y("");const L=await fetch(`/api/agents/${encodeURIComponent(s)}/skills/${encodeURIComponent(N)}`),z=await L.json().catch(()=>null);if(!L.ok||!z||z.error)return void y(z?.error??"could not load skill");d({name:N,content:z.content??"",isNew:!1})}async function b(){if(!o)return;m(!0),y("");const L=await(await fetch(`/api/agents/${encodeURIComponent(s)}/skills`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({name:o.name,content:o.content})})).json().catch(()=>({error:"save failed"}));m(!1),L.error?y(L.error):d(null)}async function E(N){window.confirm(`Delete skill "/${N}" of this agent (its folder is removed)?`)&&(await fetch(`/api/agents/${encodeURIComponent(s)}/skills/${encodeURIComponent(N)}`,{method:"DELETE"}).catch(()=>{}),o?.name===N&&d(null))}return l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"own skills — only this agent"}),l.jsx("span",{className:"spacer"}),!o&&l.jsxs("button",{className:"open-raw",onClick:()=>{d({name:"",content:Lj,isNew:!0}),y("")},children:[l.jsx(Q,{name:"add",className:"ms-sm"})," new skill"]})]}),u.length===0&&!o&&l.jsxs("div",{className:"viewer-note",children:["none — skills in ",l.jsxs("code",{children:["agents/",s,"/skills/"]})," are private to this agent; skills for every agent live in the workspace skills folder."]}),u.length>0&&!o&&l.jsx("div",{className:"m3-list",children:u.map(N=>l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{name:"extension"})}),l.jsxs("span",{className:"m3-body",children:[l.jsxs("span",{className:"m3-head",children:["/",N.name]}),l.jsx("span",{className:"m3-sub",children:N.description||l.jsx("code",{children:"SKILL.md"})})]}),l.jsxs("button",{className:"open-raw",onClick:()=>{x(N.name)},children:[l.jsx(Q,{name:"edit",className:"ms-sm"})," edit"]}),l.jsx("button",{className:"open-raw",onClick:()=>{E(N.name)},children:l.jsx(Q,{name:"close",className:"ms-sm"})})]},N.name))}),o&&l.jsxs("div",{className:"agent-form",children:[l.jsx("div",{className:"agent-form-row",children:l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name — invoked as /<name>",l.jsx("input",{value:o.name,placeholder:"e.g. report-html",disabled:!o.isNew,onChange:N=>d({...o,name:N.target.value})})]})}),l.jsxs("label",{className:"agent-field",children:["SKILL.md — frontmatter (description) + the instructions",l.jsx("textarea",{className:"concept-edit",rows:Math.min(28,Math.max(12,o.content.split(`
|
|
213
|
+
`).length+2)),value:o.content,spellCheck:!1,onChange:N=>d({...o,content:N.target.value})})]}),l.jsxs("div",{className:"agent-form-row",children:[l.jsx("button",{className:"run-btn",disabled:h||!o.name.trim(),onClick:()=>{b()},children:h?"saving…":"save"}),l.jsx("button",{className:"open-raw",disabled:h,onClick:()=>d(null),children:"cancel"})]})]}),g&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",g]})]})}function $j({slug:s}){const u=$e(`/api/agents/${encodeURIComponent(s)}/routines`,!1)?.routines??[],[o,d]=w.useState(null),[h,m]=w.useState(""),[g,y]=w.useState("");async function x(N){m("");const z=await(await fetch(`/api/agents/${encodeURIComponent(s)}/routines`,{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify(N)})).json();return z.error?(m(z.error),!1):!0}async function b(N){y(N),m("");const z=await(await fetch(`/api/agents/${encodeURIComponent(s)}/routines/${encodeURIComponent(N)}/run`,{method:"POST"})).json();y(""),z.error?m(z.error):z.chatId&&ta(`/agents/${encodeURIComponent(s)}/chat/${z.chatId}`)}async function E(N){window.confirm(`Delete routine "${N}"?`)&&await fetch(`/api/agents/${encodeURIComponent(s)}/routines/${encodeURIComponent(N)}`,{method:"DELETE"}).catch(()=>{})}return l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"routines — scheduled prompts"}),l.jsx("span",{className:"spacer"}),!o&&l.jsxs("button",{className:"open-raw",onClick:()=>d({name:"",schedule:"0 9 * * 1-5",prompt:"",enabled:!0}),children:[l.jsx(Q,{name:"add",className:"ms-sm"})," new routine"]})]}),u.length===0&&!o&&l.jsx("div",{className:"viewer-note",children:"none — a routine messages this agent on a schedule (cron, server local time) and each run opens a new session with the result."}),u.length>0&&l.jsx("div",{className:"m3-list",children:u.map(N=>l.jsxs("div",{className:"m3-row",children:[l.jsx("span",{className:"m3-ico",children:l.jsx(Q,{name:"schedule"})}),l.jsxs("span",{className:"m3-body",children:[l.jsxs("span",{className:"m3-head",children:[N.name,N.lastError&&l.jsx("span",{className:"chip stale",title:N.lastError,children:"error"})]}),l.jsxs("span",{className:"m3-sub",children:[l.jsx("code",{children:N.schedule}),N.enabled?N.nextRunAt?` · next ${gl(N.nextRunAt)}`:"":" · paused"," · ",N.lastChatId?l.jsxs(_e,{href:`/agents/${encodeURIComponent(s)}/chat/${N.lastChatId}`,children:["last run ",gl(N.lastRunAt)]}):"never ran"]})]}),l.jsx("button",{className:"open-raw",disabled:g===N.id,onClick:()=>b(N.id),children:g===N.id?"starting…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"play_arrow",className:"ms-sm"})," run"]})}),l.jsx("button",{className:"open-raw",onClick:()=>d({id:N.id,name:N.name,schedule:N.schedule,prompt:N.prompt,enabled:N.enabled}),children:"edit"}),l.jsx("button",{className:"open-raw",onClick:()=>{E(N.id)},children:"delete"}),l.jsxs("label",{className:"m3-switch",title:N.enabled?"enabled — click to pause":"paused — click to enable",children:[l.jsx("input",{type:"checkbox",checked:N.enabled,onChange:()=>{x({id:N.id,name:N.name,schedule:N.schedule,prompt:N.prompt,enabled:!N.enabled})}}),l.jsx("span",{className:"m3-switch-track"})]})]},N.id))}),o&&l.jsxs("div",{className:"agent-form",children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:o.name,placeholder:"e.g. Morning report",onChange:N=>d({...o,name:N.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:200},children:["schedule (cron)",l.jsx("input",{value:o.schedule,placeholder:"0 9 * * 1-5",onChange:N=>d({...o,schedule:N.target.value})})]}),l.jsxs("label",{className:"agent-field wf-checks",style:{width:90},children:["enabled",l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:o.enabled,onChange:N=>d({...o,enabled:N.target.checked})}),"on"]})]})]}),l.jsxs("label",{className:"agent-field",children:["prompt — what to ask this agent on each run",l.jsx("textarea",{rows:5,value:o.prompt,placeholder:"Check ... and summarize what changed.",onChange:N=>d({...o,prompt:N.target.value})})]}),l.jsxs("div",{className:"agent-form-row",children:[l.jsx("button",{className:"run-btn",disabled:!o.name.trim()||!o.prompt.trim(),onClick:async()=>{await x(o)&&d(null)},children:o.id?"save routine":"create routine"}),l.jsx("button",{className:"open-raw",onClick:()=>(d(null),m("")),children:"cancel"})]})]}),h&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",h]})]})}function cp({slug:s}){const[c,u]=w.useState(s?null:L()),[o,d]=w.useState(""),[h,m]=w.useState(!1),y=$e("/api/workflows",!1)?.workflows??[],b=$e("/api/knowledge",!1)?.bundles??[],N=$e("/api/skills",!1)?.skills??[];w.useEffect(()=>{s&&fetch(`/api/agents/${encodeURIComponent(s)}`).then(T=>T.ok?T.json():Promise.reject()).then(T=>u({name:T.name,emoji:T.emoji,description:T.description??"",harness:T.harness,model:T.model??"",effort:T.effort??"",group:T.group??"",system:T.system,workflows:T.workflows,knowledge:T.knowledge??[],skillsAll:T.skills===void 0,skills:T.skills??[]})).catch(()=>d("agent not found"))},[s]);function L(){return{name:"",emoji:"🤖",description:"",harness:"claude",model:"",effort:"",group:"",system:"",workflows:[],knowledge:[],skillsAll:!0,skills:[]}}async function z(){if(!c)return;m(!0),d("");const ee=await(await fetch(s?`/api/agents/${encodeURIComponent(s)}`:"/api/agents",{method:s?"PUT":"POST",headers:{"content-type":"application/json"},body:JSON.stringify({...c,skills:c.skillsAll?void 0:c.skills})})).json();m(!1),ee.error?d(ee.error):ta(`/agents/${encodeURIComponent(ee.slug)}/info`)}async function F(){!s||!window.confirm(`Delete agent "${s}" and its definition folder?`)||(await fetch(`/api/agents/${encodeURIComponent(s)}`,{method:"DELETE"}).catch(()=>{}),ta("/agents"))}if(!c)return l.jsx("div",{className:"empty",children:o||"loading…"});const _=T=>u({...c,...T});return l.jsxs("div",{className:"new-chat",children:[l.jsx("div",{className:"page-head",children:l.jsx("h1",{children:s?`edit ${s}`:"new agent"})}),l.jsx("section",{className:"panel new-chat-panel",children:l.jsxs("div",{className:"agent-form",children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:c.name,placeholder:"e.g. Max",onChange:T=>_({name:T.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:90},children:["emoji",l.jsx("input",{value:c.emoji,onChange:T=>_({emoji:T.target.value})})]})]}),l.jsx("div",{className:"emoji-pick",children:Rj.map(T=>l.jsx("button",{type:"button",className:c.emoji===T?"active":"",onClick:()=>_({emoji:T}),children:T},T))}),l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:1},children:["description",l.jsx("input",{value:c.description,placeholder:"one line: what this agent is for",onChange:T=>_({description:T.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:180},children:["group",l.jsx("input",{value:c.group,placeholder:"none",onChange:T=>_({group:T.target.value})})]})]}),l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{width:140},children:["harness",l.jsxs("select",{value:c.harness,onChange:T=>_({harness:T.target.value}),children:[l.jsx("option",{value:"claude",children:"claude"}),l.jsx("option",{value:"codex",children:"codex"}),l.jsx("option",{value:"pi",children:"pi"})]})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["model",l.jsx("input",{value:c.model,placeholder:"harness default — e.g. sonnet, gpt-5.6-sol",onChange:T=>_({model:T.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:140},children:["effort",l.jsx("select",{value:c.effort,onChange:T=>_({effort:T.target.value}),children:Cj.map(T=>l.jsx("option",{value:T,children:T||"default"},T))})]})]}),l.jsxs("label",{className:"agent-field",children:["system prompt — the agent's role",l.jsx("textarea",{rows:10,value:c.system,placeholder:"You are the ... for this project. Your job is ...",onChange:T=>_({system:T.target.value})})]}),l.jsxs("div",{className:"agent-field",children:[l.jsx("span",{className:"agent-field-label",children:"connected workflows — autoloaded into the agent's context; it can run them"}),l.jsxs("div",{className:"wf-checks",children:[y.map(T=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.workflows.includes(T.slug),onChange:ee=>_({workflows:ee.target.checked?[...c.workflows,T.slug]:c.workflows.filter(le=>le!==T.slug)})}),l.jsx("b",{children:T.slug}),T.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",T.description]})]},T.slug)),y.length===0&&l.jsx("div",{className:"viewer-note",children:"no workflows in this project"})]})]}),l.jsxs("div",{className:"agent-field",children:[l.jsx("span",{className:"agent-field-label",children:"connected knowledge — OKF bundles the agent consults and maintains"}),l.jsxs("div",{className:"wf-checks",children:[b.map(T=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.knowledge.includes(T.name),onChange:ee=>_({knowledge:ee.target.checked?[...c.knowledge,T.name]:c.knowledge.filter(le=>le!==T.name)})}),l.jsx("b",{children:T.name}),l.jsxs("span",{className:"opt-hint",children:[" — ",T.concepts," concepts"]})]},T.name)),b.length===0&&l.jsx("div",{className:"viewer-note",children:"no knowledge bundles in this project"})]})]}),l.jsxs("div",{className:"agent-field",children:[l.jsx("span",{className:"agent-field-label",children:"connected skills — workspace skill packages (see the skills tab); invoked with /name in sessions"}),l.jsxs("div",{className:"wf-checks",children:[l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.skillsAll,onChange:T=>_({skillsAll:T.target.checked})}),l.jsx("b",{children:"all skills"}),l.jsx("span",{className:"opt-hint",children:" — every discovered skill, including future ones"})]}),!c.skillsAll&&N.map(T=>l.jsxs("label",{children:[l.jsx("input",{type:"checkbox",checked:c.skills.includes(T.name),onChange:ee=>_({skills:ee.target.checked?[...c.skills,T.name]:c.skills.filter(le=>le!==T.name)})}),l.jsxs("b",{children:["/",T.name]}),T.description&&l.jsxs("span",{className:"opt-hint",children:[" — ",T.description]})]},T.name)),!c.skillsAll&&N.length===0&&l.jsx("div",{className:"viewer-note",children:"no skills found (.claude/skills, project or user)"})]})]}),o&&l.jsxs("div",{className:"msg error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",o]}),l.jsxs("div",{className:"agent-form-row",children:[l.jsx("button",{className:"run-btn",disabled:!c.name.trim()||h,onClick:z,children:h?"saving…":s?"save":"create"}),l.jsx("span",{className:"spacer"}),s&&l.jsx("button",{className:"stop-btn",onClick:F,children:"delete agent"})]})]})})]})}const yi={enabled:!1,remote:"origin",branch:"",interval:"300",autosync:"pull"};function rp(s){const c=s.config.git;return c?{enabled:c.enabled!==!1,remote:c.remote??yi.remote,branch:c.branch??"",interval:String(c.interval??yi.interval),autosync:c.autosync??yi.autosync}:yi}const Dp={enabled:!1,root:""};function op(s){const c=s.config.repos;return c?{enabled:c.enabled!==!1,root:c.root??""}:Dp}function Bj(){const[s,c]=w.useState(null),[u,o]=w.useState(""),[d,h]=w.useState(""),[m,g]=w.useState(""),[y,x]=w.useState([]),[b,E]=w.useState(yi),[N,L]=w.useState(Dp),[z,F]=w.useState(!1),[_,T]=w.useState(!1),[ee,le]=w.useState(!1),[B,I]=w.useState("");w.useEffect(()=>{fetch("/api/settings").then($=>$.json()).then($=>{c($),o($.config.name??""),h($.config.icon??""),g($.config.color??""),x($.config.switcher??[]),E(rp($)),L(op($))}).catch(()=>I("could not load settings"))},[]);const A=()=>{F(!0),le(!1),I("")};async function K(){T(!0),I("");try{const $=await fetch("/api/settings",{method:"PUT",headers:{"content-type":"application/json"},body:JSON.stringify({name:u,icon:d,color:m,switcher:y,git:{...b,interval:b.interval===""?void 0:Number(b.interval)},repos:N})}),ie=await $.json();if(!$.ok)throw new Error(ie.error||"save failed");c(ie),x(ie.config.switcher??[]),E(rp(ie)),L(op(ie)),F(!1),le(!0),window.dispatchEvent(new Event("kw-meta-refresh"))}catch($){I($.message)}finally{T(!1)}}const te=($,ie)=>{x(be=>be.map((Ie,q)=>q===$?{...Ie,...ie}:Ie)),A()},U=$=>{E(ie=>({...ie,...$})),A()},ue=$=>{L(ie=>({...ie,...$})),A()};if(!s)return l.jsx("div",{className:"empty",children:B||"loading…"});const me=[["port",String(s.resolved.port),"kraftwerk ui listens here (CLI --port wins)"],["workflows",s.resolved.workflowsRoot??"— none found","workflow definitions"],["output",s.resolved.outputDir,"run artifacts"],["knowledge",s.config.knowledge??"knowledge","OKF knowledge bundles"],["agents",s.config.agents??"agents","agent definitions"],["skills",s.config.skills??"skills","workspace skills"]];return l.jsxs("div",{className:"settings-screen",children:[l.jsxs("div",{className:"settings-head",children:[l.jsxs("h1",{children:[l.jsx(Q,{name:"settings",className:"ms-lg"})," Settings"]}),l.jsx("span",{className:"spacer"}),B&&l.jsx("span",{className:"settings-err",children:B}),ee&&!z&&l.jsxs("span",{className:"settings-saved",children:[l.jsx(Q,{name:"check",className:"ms-sm"})," saved"]}),l.jsx("button",{className:"run-btn",disabled:_||!z,onClick:()=>{K()},children:_?"saving…":"save changes"})]}),l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"workspace"})}),l.jsxs("div",{className:"agent-form",children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{width:90},children:["icon",l.jsx("input",{value:d,placeholder:"🤖",onChange:$=>{h($.target.value),A()}})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:u,placeholder:"my workspace",onChange:$=>{o($.target.value),A()}})]}),l.jsxs("label",{className:"agent-field settings-color",style:{width:130},title:"Accent in the workspace switcher; empty = derived from the folder",children:["color",l.jsxs("span",{className:"settings-color-row",children:[l.jsx("input",{type:"color",value:/^#[0-9a-f]{6}$/i.test(m)?m:"#888888",onChange:$=>{g($.target.value),A()}}),l.jsx("input",{value:m,placeholder:"auto",onChange:$=>{g($.target.value),A()}})]})]})]}),l.jsx("div",{className:"settings-note",children:"Shown in the header, browser tab and to other workspaces discovering this one."})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"workspace switcher"}),l.jsx("span",{className:"spacer"}),l.jsxs("button",{className:"run-btn tonal",onClick:()=>{x($=>[...$,{name:"",url:"http://localhost:"}]),A()},children:[l.jsx(Q,{name:"add",className:"ms-sm"})," add entry"]})]}),l.jsxs("div",{className:"agent-form",children:[y.length===0&&l.jsx("div",{className:"settings-note",children:"No manual entries."}),y.map(($,ie)=>l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{width:70},children:["icon",l.jsx("input",{value:$.icon??"",placeholder:"•",onChange:be=>te(ie,{icon:be.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:$.name,placeholder:"other workspace",onChange:be=>te(ie,{name:be.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{flex:1.4},children:["url",l.jsx("input",{value:$.url,placeholder:"http://localhost:1982",onChange:be=>te(ie,{url:be.target.value})})]}),l.jsx("button",{className:"row-x settings-row-x",title:"remove entry",onClick:()=>{x(be=>be.filter((Ie,q)=>q!==ie)),A()},children:l.jsx(Q,{name:"close",className:"ms-sm"})})]},ie)),l.jsx("div",{className:"settings-note",children:"Running workspaces on this machine are discovered automatically — manual entries are for remote instances or extra links."})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"git sync"}),l.jsx("span",{className:"spacer"}),l.jsxs("a",{className:"run-btn tonal",href:"#/git",children:[l.jsx(Q,{name:"account_tree",className:"ms-sm"})," open git"]})]}),l.jsxs("div",{className:"agent-form",children:[l.jsxs("label",{className:"settings-check",children:[l.jsx("input",{type:"checkbox",checked:b.enabled,onChange:$=>U({enabled:$.target.checked})}),"sync workflows, knowledge, agents and skills with a git remote"]}),b.enabled&&l.jsxs(l.Fragment,{children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:1},children:["remote",l.jsx("input",{value:b.remote,placeholder:"origin",onChange:$=>U({remote:$.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["branch",l.jsx("input",{value:b.branch,placeholder:"checked-out branch",onChange:$=>U({branch:$.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:120},children:["interval (s)",l.jsx("input",{type:"number",min:0,step:1,value:b.interval,placeholder:"300",onChange:$=>U({interval:$.target.value})})]}),l.jsxs("label",{className:"agent-field",style:{width:150},children:["autosync",l.jsxs("select",{value:b.autosync,onChange:$=>U({autosync:$.target.value}),children:[l.jsx("option",{value:"pull",children:"fetch and pull"}),l.jsx("option",{value:"off",children:"fetch only"})]})]})]}),l.jsx("div",{className:"settings-note",children:"The interval fetches in the background (0 turns the timer off); with autosync on it also fast-forwards when behind and nothing is modified locally. Commit and push stay manual on the git screen."})]})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"repositories"}),l.jsx("span",{className:"spacer"}),l.jsxs("a",{className:"run-btn tonal",href:"#/repos",children:[l.jsx(Q,{name:"source",className:"ms-sm"})," open repositories"]})]}),l.jsxs("div",{className:"agent-form",children:[l.jsxs("label",{className:"settings-check",children:[l.jsx("input",{type:"checkbox",checked:N.enabled,onChange:$=>ue({enabled:$.target.checked})}),"keep git repositories the agents work on under one folder"]}),N.enabled&&l.jsxs(l.Fragment,{children:[l.jsx("div",{className:"agent-form-row",children:l.jsxs("label",{className:"agent-field",style:{flex:1},children:["repos root",l.jsx("input",{value:N.root,placeholder:"repos",onChange:$=>ue({root:$.target.value})})]})}),l.jsxs("div",{className:"settings-note",children:["Relative to the project root. Saving creates the folder and adds it to .gitignore; every agent gets the list of clones as context and can add more with ",l.jsx("code",{children:"kraftwerk repos add"}),"."]})]})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"paths & port"}),l.jsx("span",{className:"spacer"}),l.jsx("code",{className:"settings-file",title:s.configPath,children:s.exists?s.configPath:`${s.configPath} (not created yet)`})]}),l.jsx("div",{className:"settings-kv-list",children:me.map(([$,ie,be])=>l.jsxs("div",{className:"settings-kv",children:[l.jsx("span",{className:"microlabel",children:$}),l.jsx("code",{children:ie}),l.jsx("span",{className:"settings-kv-hint",children:be})]},$))}),l.jsxs("div",{className:"settings-note",style:{padding:"0 18px 14px"},children:["Read-only here — edit ",l.jsx("code",{children:"kraftwerk.yml"})," directly to change these."]})]})]})}const hu={running:{label:"running"},stopped:{label:"stopped"},died:{label:"died",note:"was killed or crashed"},missing:{label:"missing",note:"folder is gone"},orphaned:{label:"orphaned",note:"no kraftwerk.yml any more"}};function qj(){const[s,c]=w.useState(null),[u,o]=w.useState(""),[d,h]=w.useState({}),[m,g]=w.useState({}),[y,x]=w.useState(null),b=w.useCallback(async()=>{try{const _=await fetch("/api/projects",{cache:"no-store"});if(_.ok){c(await _.json()),o("");return}o(_.status===404?"This workspace runs a kraftwerk without the projects API. Update it and restart its UI.":`Could not load the project registry (HTTP ${_.status}).`)}catch(_){o(_.message||"Could not reach this workspace's server.")}},[]);w.useEffect(()=>{let _=!0,T;const ee=async()=>{await b(),_&&(T=setTimeout(ee,6e3))};return ee(),()=>{_=!1,clearTimeout(T)}},[b]);const E=_=>_.root??_.url,N=async(_,T)=>{const ee=E(_);h(le=>({...le,[ee]:T})),g(le=>({...le,[ee]:""})),x(null);try{const le=T==="stop"?{root:_.root,url:_.url}:{root:_.root},B=await vu(`/api/projects/${T}`,le);if(!B.ok)throw new Error(B.error||"failed");window.dispatchEvent(new Event("kw-meta-refresh"))}catch(le){g(B=>({...B,[ee]:le.message}))}finally{h(le=>{const B={...le};return delete B[ee],B}),b()}},L=s?.filter(_=>_.live).length??0,z=new Map;for(const _ of s??[])_.icon&&z.set(_.icon,(z.get(_.icon)??0)+1);const F=_=>!!_&&(z.get(_)??0)>1;return l.jsxs("div",{className:"settings-screen ws-screen",children:[l.jsxs("div",{className:"settings-head",children:[l.jsxs("h1",{children:[l.jsx(Q,{name:"hub",className:"ms-lg"})," Workspaces"]}),l.jsx("span",{className:"spacer"}),s&&l.jsxs("span",{className:"settings-note",children:[s.length," known · ",L," running"]}),s&&u&&l.jsx("span",{className:"settings-err",children:u})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"projects on this machine"}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"settings-note",children:["registry: ",l.jsx("code",{children:"~/.kraftwerk/projects"})]})]}),!s&&!u&&l.jsx("div",{className:"ws-empty",children:"loading…"}),!s&&u&&l.jsxs("div",{className:"ws-empty ws-load-error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",u]}),s&&s.length===0&&l.jsx("div",{className:"ws-empty",children:"No workspaces known yet."}),s?.map(_=>{const T=E(_),ee=d[T],le=!_.live&&!!_.root&&(_.exists===!1||_.hasConfig===!1);return l.jsxs("div",{className:`ws-row state-${_.state} ${_.current?"current":""}`,children:[l.jsx(bi,{className:"ws-icon",icon:_.icon,name:_.name,color:_.color,seed:_.root??_.url,ambiguous:F(_.icon)}),l.jsxs("div",{className:"ws-main",children:[l.jsxs("div",{className:"ws-title",children:[_.live&&!_.current?l.jsx("a",{href:_.url,className:`ws-name${_.named===!1?" unnamed":""}`,children:_.name}):l.jsx("span",{className:`ws-name${_.named===!1?" unnamed":""}`,children:_.name}),_.current&&l.jsx("span",{className:"switcher-hint",children:"current"}),l.jsxs("span",{className:`ws-state ws-state-${_.state}`,children:[_.live&&l.jsx("span",{className:"live-dot"}),hu[_.state].label]}),hu[_.state].note&&l.jsx("span",{className:"ws-note",children:hu[_.state].note})]}),l.jsx("div",{className:"ws-root",title:_.root,children:_.rootLabel??l.jsx("span",{className:"ws-dim",children:"no root recorded (started by an older version)"})}),l.jsxs("div",{className:"ws-meta",children:[_.state!=="missing"&&_.state!=="orphaned"&&l.jsx("span",{children:_.url.replace(/^https?:\/\//,"")}),_.counts&&l.jsxs(l.Fragment,{children:[l.jsxs("span",{children:[_.counts.agents," agents"]}),l.jsxs("span",{children:[_.counts.workflows," workflows"]}),l.jsxs("span",{children:[_.counts.runs," runs"]}),l.jsxs("span",{children:[_.counts.chats," chats"]})]}),_.lastStarted&&l.jsxs("span",{title:_.lastStarted,children:["started ",cs(_.lastStarted)]}),!_.live&&_.lastStopped&&l.jsxs("span",{title:_.lastStopped,children:["stopped ",cs(_.lastStopped)]}),_.startCount!=null&&l.jsxs("span",{children:[_.startCount,"× launched"]}),_.firstSeen&&l.jsxs("span",{title:_.firstSeen,children:["first seen ",cs(_.firstSeen)]})]}),m[T]&&l.jsx("div",{className:"settings-err",children:m[T]})]}),l.jsxs("div",{className:"ws-actions",children:[_.live&&!_.current&&l.jsxs("a",{className:"ws-btn",href:_.url,title:"Open this workspace",children:[l.jsx(Q,{name:"open_in_new",className:"ms-sm"})," open"]}),!_.live&&_.root&&_.exists!==!1&&!_.dirGone&&l.jsxs("button",{className:"ws-btn primary",disabled:!!ee,onClick:()=>{N(_,"start")},children:[l.jsx(Q,{name:ee==="start"?"progress_activity":"play_arrow",className:"ms-sm"}),ee==="start"?"starting…":"start"]}),_.live&&!_.current&&l.jsxs("button",{className:"ws-btn danger",disabled:!!ee,onClick:()=>{N(_,"stop")},children:[l.jsx(Q,{name:ee==="stop"?"progress_activity":"stop",className:"ms-sm"}),ee==="stop"?"stopping…":"stop"]}),le&&y!==T&&l.jsxs("button",{className:"ws-btn",disabled:!!ee,title:"Drop this project from the registry (files untouched)",onClick:()=>x(T),children:[l.jsx(Q,{name:"delete",className:"ms-sm"})," remove"]}),le&&y===T&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"ws-btn danger",onClick:()=>{N(_,"forget")},children:[l.jsx(Q,{name:"delete",className:"ms-sm"})," confirm remove"]}),l.jsx("button",{className:"ws-btn",onClick:()=>x(null),children:"cancel"})]})]})]},T)})]}),l.jsxs("p",{className:"settings-note",children:["Start launches ",l.jsx("code",{children:"kraftwerk ui"})," detached in the project root (log in ",l.jsx("code",{children:"~/.kraftwerk/logs"}),"). Stop sends SIGTERM to the running server. Remove is offered only for records whose root no longer holds a ",l.jsx("code",{children:"kraftwerk.yml"})," — the same from the terminal:"," ",l.jsx("code",{children:"kraftwerk projects"}),"."]})]})}function Gj(s){if(s<60)return`${s}s`;const c=Math.round(s/60);if(c<60)return`${c} min`;const u=Math.floor(c/60),o=c%60;return o?`${u} h ${o} min`:`${u} h`}const Yj=[[/^(\+\+\+|---|diff |index )/,"d-meta"],[/^@@/,"d-hunk"],[/^\+/,"d-add"],[/^-/,"d-del"]],Xj=s=>Yj.find(([c])=>c.test(s))?.[1]??"";function Qj({file:s}){const[c,u]=w.useState(null),[o,d]=w.useState(!1),[h,m]=w.useState("");return w.useEffect(()=>{let g=!0;return fetch(`/api/git/diff?path=${encodeURIComponent(s)}`).then(y=>y.json()).then(y=>{g&&(u(y.diff??""),d(!!y.truncated),m(y.error??""))}).catch(()=>g&&m("could not load the diff")),()=>{g=!1}},[s]),h?l.jsx("div",{className:"git-diff git-diff-error",children:h}):c===null?l.jsx("div",{className:"git-diff",children:"loading…"}):c.trim()?l.jsxs("pre",{className:"git-diff",children:[c.split(`
|
|
214
|
+
`).map((g,y)=>l.jsxs("span",{className:Xj(g),children:[g||" ",`
|
|
215
|
+
`]},y)),o&&l.jsxs("span",{className:"d-meta",children:["… diff truncated, see the rest in a terminal",`
|
|
216
|
+
`]})]}):l.jsx("div",{className:"git-diff",children:"no textual diff (binary or empty)"})}function Zj(){const[s,c]=w.useState(null),[u,o]=w.useState(new Set),[d,h]=w.useState(new Set),[m,g]=w.useState(""),[y,x]=w.useState(""),[b,E]=w.useState(""),[N,L]=w.useState(""),z=w.useCallback(async()=>{try{const B=await fetch("/api/git",{cache:"no-store"});B.ok&&c(await B.json())}catch{}},[]);w.useEffect(()=>{let B=!0,I;const A=async()=>{await z(),B&&(I=setTimeout(A,6e3))};return A(),()=>{B=!1,clearTimeout(I)}},[z]),w.useEffect(()=>{if(!s?.files)return;const B=new Set(s.files.filter(I=>I.syncable).map(I=>I.path));o(I=>{const A=new Set([...I].filter(K=>B.has(K)));return A.size===I.size?I:A})},[s]);const F=async(B,I)=>{x(B),E(""),L("");try{const A=await vu(`/api/git/${B}`,I);A.ok?L(B==="push"?"pushed":B==="pull"?"pulled":"fetched"):E(A.error||`${B} failed`)}catch(A){E(A.message||`${B} failed`)}finally{x("")}z()},_=async()=>{x("commit"),E(""),L("");try{const B=await vu("/api/git/commit",{paths:[...u],message:m});B.ok?(L(`committed ${u.size} file${u.size===1?"":"s"}`),o(new Set),g("")):E(B.error||"commit failed")}catch(B){E(B.message||"commit failed")}finally{x("")}z()};if(!s)return l.jsx("div",{className:"settings-screen",children:l.jsx("div",{className:"ws-empty",children:"loading…"})});if(!s.enabled)return l.jsxs("div",{className:"settings-screen",children:[l.jsx("div",{className:"settings-head",children:l.jsxs("h1",{children:[l.jsx(Q,{name:"cloud_sync",className:"ms-lg"})," Git sync"]})}),l.jsx("section",{className:"panel",children:l.jsxs("div",{className:"ws-empty",children:["Git sync is off. Turn it on in ",l.jsx("a",{href:"#/settings",children:"settings"}),", or add a ",l.jsx("code",{children:"git:"})," block to kraftwerk.yml."]})})]});const T=(s.files??[]).filter(B=>B.syncable),ee=(s.files??[]).filter(B=>!B.syncable),le=(B,I)=>o(A=>{const K=new Set(A);return I?K.add(B):K.delete(B),K});return l.jsxs("div",{className:"settings-screen ws-screen",children:[l.jsxs("div",{className:"settings-head",children:[l.jsxs("h1",{children:[l.jsx(Q,{name:"cloud_sync",className:"ms-lg"})," Git sync"]}),l.jsx("span",{className:"spacer"}),N&&l.jsxs("span",{className:"settings-saved",children:[l.jsx(Q,{name:"check",className:"ms-sm"})," ",N]}),b&&l.jsx("span",{className:"settings-err",children:b})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"branch"}),l.jsx("span",{className:"spacer"}),s.lastFetch&&l.jsxs("span",{className:"settings-note",title:s.lastFetch,children:["fetched ",cs(s.lastFetch)]}),s.lastError&&l.jsxs("span",{className:"settings-err git-sync-err",title:s.lastError,children:[l.jsx(Q,{name:"cloud_off",className:"ms-sm"})," ",s.lastError.split(`
|
|
217
|
+
`)[0]]})]}),s.error?l.jsxs("div",{className:"ws-empty ws-load-error",children:[l.jsx(Q,{name:"error",className:"ms-sm"})," ",s.error]}):l.jsxs("div",{className:"git-head",children:[l.jsxs("div",{className:"git-branch",children:[l.jsx(Q,{name:"account_tree",className:"ms-sm"}),l.jsx("strong",{children:s.branch}),s.upstream?l.jsxs("span",{className:"settings-note",children:["tracking ",s.upstream]}):l.jsx("span",{className:"settings-note",children:"no upstream yet, push sets one"})]}),l.jsxs("div",{className:"git-counts",children:[s.diverged&&l.jsx("span",{className:"git-diverged",children:"diverged, resolve in a terminal"}),!!s.behind&&l.jsxs("span",{className:"git-behind",children:[s.behind," behind"]}),!!s.ahead&&l.jsxs("span",{className:"git-ahead",children:[s.ahead," ahead"]}),!s.ahead&&!s.behind&&l.jsx("span",{className:"settings-note",children:"up to date"})]}),l.jsxs("div",{className:"ws-actions",children:[l.jsxs("button",{className:"ws-btn",disabled:!!y,onClick:()=>{F("fetch")},children:[l.jsx(Q,{name:y==="fetch"?"progress_activity":"refresh",className:"ms-sm"})," fetch"]}),l.jsxs("button",{className:"ws-btn",disabled:!!y||!s.behind||s.diverged,title:s.diverged?"Diverged. Resolve in a terminal.":"Fast-forward to the remote",onClick:()=>{F("pull")},children:[l.jsx(Q,{name:y==="pull"?"progress_activity":"download",className:"ms-sm"})," pull"]}),l.jsxs("button",{className:"ws-btn primary",disabled:!!y||!s.ahead&&!!s.upstream,title:s.upstream?"Push to the upstream":"Push and set the upstream",onClick:()=>{F("push")},children:[l.jsx(Q,{name:y==="push"?"progress_activity":"upload",className:"ms-sm"})," push"]})]})]})]}),l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"changes"}),l.jsx("span",{className:"spacer"}),l.jsx("span",{className:"settings-note",children:T.length===0?"workspace clean":`${u.size} of ${T.length} selected`})]}),T.length===0&&ee.length===0&&l.jsx("div",{className:"ws-empty",children:"Nothing changed under the workspace paths."}),T.map(B=>l.jsxs("div",{className:"git-row",children:[l.jsx("label",{className:"git-pick",children:l.jsx("input",{type:"checkbox",checked:u.has(B.path),onChange:I=>le(B.path,I.target.checked)})}),l.jsxs("button",{className:"git-file",onClick:()=>h(I=>{const A=new Set(I);return A.has(B.path)?A.delete(B.path):A.add(B.path),A}),children:[l.jsx(Q,{name:d.has(B.path)?"expand_more":"chevron_right",className:"ms-sm"}),l.jsx("span",{className:`git-status s-${B.status}`,children:B.status}),l.jsx("span",{className:"git-path",children:B.path})]}),d.has(B.path)&&l.jsx(Qj,{file:B.path})]},B.path)),T.length>0&&l.jsxs("div",{className:"git-commit",children:[l.jsx("input",{className:"git-message",placeholder:"Commit message",value:m,onChange:B=>g(B.target.value),onKeyDown:B=>{B.key==="Enter"&&!y&&m.trim()&&u.size>0&&_()}}),l.jsx("button",{className:"ws-btn",disabled:u.size===T.length,onClick:()=>o(new Set(T.map(B=>B.path))),children:"select all"}),l.jsxs("button",{className:"ws-btn primary",disabled:!!y||u.size===0||!m.trim(),onClick:()=>{_()},children:[l.jsx(Q,{name:y==="commit"?"progress_activity":"check",className:"ms-sm"}),"commit ",u.size||""]})]}),ee.length>0&&l.jsxs("details",{className:"git-blocked",children:[l.jsxs("summary",{children:[ee.length,s.blockedHidden?"+":""," change",ee.length===1&&!s.blockedHidden?"":"s"," outside the workspace paths"]}),ee.map(B=>l.jsxs("div",{className:"git-row blocked",children:[l.jsx("span",{className:"git-status s-blocked",children:B.status}),l.jsx("span",{className:"git-path",children:B.path}),l.jsx("span",{className:"settings-note",children:B.reason})]},B.path)),!!s.blockedHidden&&l.jsx("div",{className:"git-row blocked",children:l.jsxs("span",{className:"settings-note",children:["and ",s.blockedHidden," more, not listed"]})})]})]}),l.jsxs("p",{className:"settings-note",children:["Synced paths: ",(s.scope??[]).map((B,I)=>l.jsxs("span",{children:[I>0&&", ",l.jsx("code",{children:B})]},B)),". Run artifacts and files like ",l.jsx("code",{children:".env"})," are never staged."," ",s.interval?`Fetches every ${Gj(s.interval)}${s.autosync==="pull"?" and fast-forwards when the working tree is clean":""}. `:"Background fetching is off. ","Commit and push are always manual."]})]})}const Vj=s=>s.replace(/^https?:\/\//,"").replace(/^git@([^:]+):/,"$1/").replace(/\.git$/,""),Kj=s=>s.error?{label:"unreadable",cls:"missing"}:s.dirty?{label:`${s.dirty} changed`,cls:"died"}:s.ahead?{label:`${s.ahead} to push`,cls:"running"}:s.behind?{label:`${s.behind} behind`,cls:"stopped"}:{label:"clean",cls:"running"},up=s=>!!(s.error||s.dirty||s.ahead===void 0||s.ahead);function Jj(){const[s,c]=w.useState(null),[u,o]=w.useState(""),[d,h]=w.useState({}),[m,g]=w.useState({}),[y,x]=w.useState(null),[b,E]=w.useState(""),[N,L]=w.useState(""),[z,F]=w.useState(""),[_,T]=w.useState(!1),[ee,le]=w.useState(""),B=$a(),I=w.useCallback(async()=>{try{const U=await fetch("/api/repos",{cache:"no-store"});if(!U.ok)throw new Error(`HTTP ${U.status}`);c(await U.json()),o("")}catch(U){o(U.message||"could not load repositories")}},[]);w.useEffect(()=>{let U=!0,ue;const me=async()=>{await I(),U&&(ue=setTimeout(me,15e3))};return me(),()=>{U=!1,clearTimeout(ue)}},[I]);const A=async(U,ue,me=!1)=>{h($=>({...$,[U]:ue})),g($=>({...$,[U]:""})),x(null);try{const $=ue==="update"?await fetch(`/api/repos/${encodeURIComponent(U)}/update`,{method:"POST"}):await fetch(`/api/repos/${encodeURIComponent(U)}${me?"?force=1":""}`,{method:"DELETE"}),ie=await $.json();if(!$.ok||!ie.ok)throw new Error(ie.error||"failed");ie.error&&g(be=>({...be,[U]:ie.error}))}catch($){g(ie=>({...ie,[U]:$.message}))}finally{h($=>{const ie={...$};return delete ie[U],ie}),I()}},K=async U=>{if(U.preventDefault(),!(!b.trim()||_)){T(!0),le("");try{const ue=await fetch("/api/repos",{method:"POST",headers:{"content-type":"application/json"},body:JSON.stringify({url:b.trim(),name:N.trim()||void 0,branch:z.trim()||void 0})}),me=await ue.json();if(!ue.ok)throw new Error(me.error||"clone failed");E(""),L(""),F(""),await I()}catch(ue){le(ue.message)}finally{T(!1)}}},te=s?.repos??[];return l.jsxs("div",{className:"settings-screen ws-screen repos-screen",children:[l.jsxs("div",{className:"settings-head",children:[l.jsxs("h1",{children:[l.jsx(Q,{name:"source",className:"ms-lg"})," Repositories"]}),l.jsx("span",{className:"spacer"}),s?.enabled&&l.jsxs("span",{className:"settings-note",children:[te.length," cloned"]}),u&&l.jsx("span",{className:"settings-err",children:u})]}),s&&!s.enabled&&l.jsx("section",{className:"panel",children:l.jsx("div",{className:"ws-empty",children:s.error&&!/are off/.test(s.error)?l.jsx("span",{className:"settings-err",children:s.error}):l.jsxs(l.Fragment,{children:["Repositories are off. Turn them on in ",l.jsx("a",{href:"#/settings",children:"settings"})," or add a ",l.jsx("code",{children:"repos:"})," block to kraftwerk.yml."]})})}),s?.enabled&&l.jsxs("section",{className:"panel",children:[l.jsxs("div",{className:"panel-head",children:[l.jsx("span",{className:"microlabel",children:"add a repository"}),l.jsx("span",{className:"spacer"}),l.jsxs("span",{className:"settings-note",children:["clones into ",l.jsx("code",{title:s.root,children:s.root})]})]}),l.jsxs("form",{className:"agent-form",onSubmit:U=>{K(U)},children:[l.jsxs("div",{className:"agent-form-row",children:[l.jsxs("label",{className:"agent-field",style:{flex:2},children:["url",l.jsx("input",{value:b,placeholder:"https://github.com/org/repo.git, git@host:org/repo.git or github:org/repo",onChange:U=>E(U.target.value),autoFocus:!0})]}),l.jsxs("label",{className:"agent-field",style:{flex:1},children:["name",l.jsx("input",{value:N,placeholder:"from the url",onChange:U=>L(U.target.value)})]}),l.jsxs("label",{className:"agent-field",style:{width:140},children:["branch",l.jsx("input",{value:z,placeholder:"default",onChange:U=>F(U.target.value)})]}),l.jsxs("button",{className:"ws-btn primary",type:"submit",disabled:_||!b.trim(),children:[l.jsx(Q,{name:_?"progress_activity":"download",className:"ms-sm"}),_?"cloning…":"clone"]})]}),ee&&l.jsx("div",{className:"settings-err",children:ee}),l.jsxs("div",{className:"settings-note",children:["Uses your own git credentials and never prompts: a private remote must already work from a terminal. Agents see every clone here and can add more with ",l.jsx("code",{children:"kraftwerk repos add"}),"."]})]})]}),s?.enabled&&l.jsxs("section",{className:"panel",children:[l.jsx("div",{className:"panel-head",children:l.jsx("span",{className:"microlabel",children:"cloned repositories"})}),te.length===0&&l.jsx("div",{className:"ws-empty",children:"Nothing cloned yet."}),te.map(U=>{const ue=d[U.slug],me=Kj(U);return l.jsxs("div",{className:`ws-row repo-row state-${me.cls}`,"data-repo":U.slug,children:[l.jsx("span",{className:"switcher-icon ws-icon",children:l.jsx(Q,{name:"folder_data"})}),l.jsxs("div",{className:"ws-main",children:[l.jsxs("div",{className:"ws-title",children:[l.jsx("span",{className:"ws-name",children:U.slug}),U.branch&&l.jsx("span",{className:"repo-branch",children:U.branch}),l.jsx("span",{className:`ws-state ws-state-${me.cls}`,children:me.label})]}),U.url&&l.jsx("div",{className:"ws-root",title:U.url,children:Vj(U.url)}),B&&l.jsx("div",{className:"ws-root ws-dim",title:U.path,children:U.path}),l.jsxs("div",{className:"ws-meta",children:[U.head&&l.jsxs("span",{title:U.committedAt,children:[l.jsx("code",{children:U.head})," ",U.subject,U.committedAt?` · ${cs(U.committedAt)}`:""]}),!!U.behind&&!!U.dirty&&l.jsxs("span",{children:["behind by ",U.behind]}),U.error&&l.jsx("span",{className:"settings-err",children:U.error})]}),m[U.slug]&&l.jsx("div",{className:"settings-err",children:m[U.slug]})]}),l.jsxs("div",{className:"ws-actions",children:[l.jsxs("button",{className:"ws-btn",disabled:!!ue,onClick:()=>{A(U.slug,"update")},title:"git fetch, then fast-forward when clean",children:[l.jsx(Q,{name:ue==="update"?"progress_activity":"sync",className:"ms-sm"}),ue==="update"?"updating…":"update"]}),y!==U.slug&&l.jsxs("button",{className:"ws-btn",disabled:!!ue,onClick:()=>x(U.slug),title:"Delete the clone",children:[l.jsx(Q,{name:"delete",className:"ms-sm"})," remove"]}),y===U.slug&&l.jsxs(l.Fragment,{children:[l.jsxs("button",{className:"ws-btn danger",onClick:()=>{A(U.slug,"remove",up(U))},children:[l.jsx(Q,{name:"delete",className:"ms-sm"}),U.dirty||U.ahead?"delete with local changes":up(U)?"delete anyway":"confirm remove"]}),l.jsx("button",{className:"ws-btn",onClick:()=>x(null),children:"cancel"})]})]})]},U.slug)})]})]})}const Ij=40,Fj=/Mac|iPhone|iPad/.test(navigator.platform);let mu=null;const Wj=s=>(s?.workspaces??[]).flatMap(c=>c.agents.map(u=>({agent:u,ws:c,key:`${c.url}|${u.slug}`})));function Pj(s,c){const u=c.toLowerCase().split(/\s+/).filter(Boolean);if(u.length===0)return s;const o=[];for(const d of s){const h=d.agent.name.toLowerCase(),m=[h,d.agent.slug,d.agent.description??"",d.agent.group??"",d.ws.name].join(" ").toLowerCase();if(!u.every(y=>m.includes(y)))continue;const g=h.startsWith(u[0])?0:h.includes(u[0])?1:2;o.push({hit:d,score:g})}return o.sort((d,h)=>d.score-h.score).map(d=>d.hit)}async function dp(s){const c=`/agents/${encodeURIComponent(s.agent.slug)}`;if(s.ws.current)return ta(c);const u=s.ws.live||!s.ws.root?s.ws.url:await hp(s.ws.root);window.location.assign(`${u.replace(/\/+$/,"")}/#${c}`)}function eb(){const[s,c]=w.useState(!1);return w.useEffect(()=>{const u=o=>{(o.metaKey||o.ctrlKey)&&!o.altKey&&!o.shiftKey&&o.key.toLowerCase()==="k"&&(o.preventDefault(),c(d=>!d))};return window.addEventListener("keydown",u),()=>window.removeEventListener("keydown",u)},[]),l.jsxs(l.Fragment,{children:[l.jsxs("button",{type:"button",className:"search-btn",onClick:()=>c(!0),title:"jump to an agent","aria-label":"search agents",children:[l.jsx(Q,{name:"search"}),l.jsx("kbd",{className:"kbd",children:Fj?"⌘K":"Ctrl K"})]}),s&&l.jsx(tb,{onClose:()=>c(!1)})]})}function tb({onClose:s}){const[c,u]=w.useState(mu),[o,d]=w.useState(mu===null),[h,m]=w.useState(!1),[g,y]=w.useState(""),[x,b]=w.useState(0),[E,N]=w.useState(null),[L,z]=w.useState(""),F=w.useRef(null);w.useEffect(()=>{let A=!0;return fetch("/api/search/agents",{cache:"no-store"}).then(K=>K.ok?K.json():Promise.reject(new Error(String(K.status)))).then(K=>{mu=K,A&&u(K)}).catch(()=>A&&m(!0)).finally(()=>A&&d(!1)),()=>{A=!1}},[]);const _=w.useMemo(()=>Wj(c),[c]),T=w.useMemo(()=>Pj(_,g).slice(0,Ij),[_,g]),ee=Math.min(x,Math.max(T.length-1,0));w.useEffect(()=>{F.current?.children[ee]?.scrollIntoView({block:"nearest"})},[ee,T]);const le=A=>{if(!E){if(A.ws.current||A.ws.live){s(),dp(A);return}N(A.key),z(""),dp(A).catch(K=>{N(null),z(`${A.ws.name}: ${K.message}`)})}},B=A=>{if(A.key==="ArrowDown")A.preventDefault(),b(T.length?(ee+1)%T.length:0);else if(A.key==="ArrowUp")A.preventDefault(),b(T.length?(ee-1+T.length)%T.length:0);else if(A.key==="Enter"){A.preventDefault();const K=T[ee];K&&le(K)}else A.key==="Escape"&&(A.preventDefault(),s())};let I;return T.length>0?I=l.jsx("ul",{className:"palette-list",role:"listbox","aria-label":"agents",ref:F,children:T.map((A,K)=>l.jsxs("li",{role:"option","aria-selected":K===ee,className:`palette-item${K===ee?" active":""}`,onMouseMove:()=>K!==ee&&b(K),onClick:()=>le(A),children:[l.jsx("span",{className:"palette-emoji","aria-hidden":!0,children:A.agent.emoji}),l.jsxs("span",{className:"palette-text",children:[l.jsx("span",{className:"palette-name",children:A.agent.name}),A.agent.description&&l.jsx("span",{className:"palette-sub",children:A.agent.description})]}),l.jsxs("span",{className:"palette-ws",title:A.ws.current?"this workspace":A.ws.url,children:[A.ws.icon&&l.jsx("span",{"aria-hidden":!0,children:A.ws.icon}),A.ws.name,E===A.key?l.jsx(Q,{name:"progress_activity",className:"ms-sm"}):A.ws.live?!A.ws.current&&l.jsx(Q,{name:"open_in_new",className:"ms-sm"}):l.jsx("span",{className:"palette-chip",children:"stopped"})]})]},A.key))}):h?I=l.jsx("div",{className:"palette-empty",children:"could not load the agents"}):o?I=l.jsx("div",{className:"palette-empty",children:"looking for agents…"}):_.length===0?I=l.jsxs("div",{className:"palette-empty",children:["no agents yet — ",l.jsx("a",{href:"#/agents/new",onClick:s,children:"create one"})]}):I=l.jsxs("div",{className:"palette-empty",children:["no agent matches “",g,"”"]}),l.jsx("div",{className:"palette-backdrop",onMouseDown:s,children:l.jsxs("div",{className:"palette",role:"dialog","aria-label":"jump to an agent",onMouseDown:A=>A.stopPropagation(),onKeyDown:B,children:[l.jsxs("div",{className:"palette-input",children:[l.jsx(Q,{name:"search"}),l.jsx("input",{autoFocus:!0,value:g,onChange:A=>{y(A.target.value),b(0)},placeholder:"jump to an agent…","aria-label":"search agents",autoComplete:"off",spellCheck:!1}),o&&c&&l.jsx(Q,{name:"progress_activity",className:"ms-sm"}),l.jsx("kbd",{className:"kbd",children:"esc"})]}),I,l.jsxs("div",{className:"palette-foot",children:[l.jsxs("span",{children:[l.jsx("kbd",{className:"kbd",children:"↑"}),l.jsx("kbd",{className:"kbd",children:"↓"})," move"]}),l.jsxs("span",{children:[l.jsx("kbd",{className:"kbd",children:"↵"})," open"]}),E&&l.jsxs("span",{className:"palette-note",children:[l.jsx(Q,{name:"progress_activity",className:"ms-sm"})," starting the workspace…"]}),L&&l.jsxs("span",{className:"palette-warn",title:L,children:[l.jsx(Q,{name:"warning",className:"ms-sm"})," ",L]})]})]})})}const ab=w.lazy(()=>Px(()=>import("./editor-CONb__vl.js").then(s=>s.w),__vite__mapDeps([0,1])).then(s=>({default:s.EditorScreen})));function nb(){const c=ev().split("/").filter(Boolean),[u,o]=w.useState(""),[d,h]=w.useState(""),[m,g]=w.useState(""),[y,x]=w.useState(!0),[b,E]=w.useState(""),[N,L]=w.useState(""),[z,F]=w.useState(!1),[_,T]=w.useState(!1),[ee,le]=w.useState([]);w.useEffect(()=>{let I=!0,A;const K=async()=>{try{const U=await fetch("/api/meta",{cache:"no-store"}).then(ue=>ue.json());if(!I)return;o(U.projectName??""),h(U.projectIcon??""),g(U.projectColor??""),x(U.projectNamed!==!1),E(U.projectRootLabel??""),L(U.projectRoot??""),F(!!U.git),T(!!U.repos),le(Array.isArray(U.switcher)?U.switcher:[])}catch{}I&&(A=setTimeout(K,3e4))};K();const te=()=>{clearTimeout(A),K()};return window.addEventListener("kw-meta-refresh",te),()=>{I=!1,clearTimeout(A),window.removeEventListener("kw-meta-refresh",te)}},[]),w.useEffect(()=>{if(tv(u?`${u} — kraftwerk`:"kraftwerk inspector"),!d)return;const I=`<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 100 100"><text y="0.9em" font-size="85">${d}</text></svg>`;let A=document.querySelector('link[rel="icon"]');A||(A=document.createElement("link"),A.rel="icon",document.head.appendChild(A)),A.href=`data:image/svg+xml,${encodeURIComponent(I)}`},[u,d]);let B;return c[0]==="runs"&&c[1]?B=l.jsx(Xy,{id:c[1]}):c[0]==="runs"?B=l.jsx(rb,{}):c[0]==="workflows"&&c[1]?B=l.jsx(aj,{slug:decodeURIComponent(c[1])}):c[0]==="workflows"?B=l.jsx(tj,{}):c[0]==="chats"?B=l.jsx(sp,{seg:c}):c[0]==="skills"?B=l.jsx(Ej,{name:c[1]?decodeURIComponent(c[1]):void 0}):c[0]==="settings"?B=l.jsx(Bj,{}):c[0]==="workspaces"?B=l.jsx(qj,{}):c[0]==="git"?B=l.jsx(Zj,{}):c[0]==="repos"?B=l.jsx(Jj,{}):c[0]==="agents"||c[0]==="team"?B=l.jsx(sp,{seg:c.slice(1)}):c[0]==="knowledge"?B=l.jsx(xj,{bundle:c[1]?decodeURIComponent(c[1]):void 0,conceptId:c.length>2?c.slice(2).map(decodeURIComponent).join("/"):void 0}):B=l.jsx(oj,{}),c[0]==="edit"&&c[1]&&c.length>2?l.jsx(w.Suspense,{fallback:l.jsx("div",{className:"empty",children:"loading editor…"}),children:l.jsx(ab,{bundle:decodeURIComponent(c[1]),conceptId:c.slice(2).map(decodeURIComponent).join("/")},c.slice(1).join("/"))}):l.jsxs(l.Fragment,{children:[l.jsxs("header",{className:"topbar",style:{"--ws-c":ji(m,N||u)},children:[l.jsxs("span",{className:"wordmark",children:[l.jsx("a",{href:"#/",className:"home-link",title:"Dashboard",children:u?l.jsx(bi,{className:"home-tile",icon:d,name:u,color:m,seed:N||u}):l.jsx(Q,{name:"home"})}),u&&l.jsx(cb,{name:u,icon:d,color:m,named:y,root:b,seed:N||u,entries:ee})]}),l.jsxs("nav",{children:[l.jsxs("a",{href:"#/agents",children:[l.jsx(Q,{name:"groups"})," agents"]}),l.jsxs("a",{href:"#/knowledge",children:[l.jsx(Q,{name:"menu_book"})," context & knowledge"]}),l.jsxs("a",{href:"#/workflows",children:[l.jsx(Q,{name:"account_tree"})," workflows"]}),l.jsxs("a",{href:"#/runs",children:[l.jsx(Q,{name:"history"})," workflow runs"]}),l.jsxs("a",{href:"#/skills",children:[l.jsx(Q,{name:"extension"})," skills"]}),_&&l.jsxs("a",{href:"#/repos",children:[l.jsx(Q,{name:"source"})," repositories"]}),z&&l.jsx(lb,{})]}),l.jsx("span",{className:"spacer"}),l.jsx(eb,{}),l.jsx(ob,{}),l.jsx(ub,{}),l.jsx(db,{})]}),l.jsx("main",{className:"shell",children:B})]})}function lb(){const s=$e("/api/git",!1,15e3),c=s?.files?.filter(u=>u.syncable).length??0;return l.jsxs("a",{href:"#/git",children:[l.jsx(Q,{name:"cloud_sync"})," git",!!s?.behind&&l.jsxs("span",{className:"git-badge behind",children:[s.behind,"↓"]}),!!s?.ahead&&l.jsxs("span",{className:"git-badge ahead",children:[s.ahead,"↑"]}),!s?.ahead&&!s?.behind&&!!c&&l.jsx("span",{className:"git-badge dirty",children:c})]})}function Mp(s){try{const c=new URL(s);return c.hostname==="localhost"||c.hostname==="127.0.0.1"?`:${c.port||(c.protocol==="https:"?443:80)}`:c.host}catch{return s.replace(/^https?:\/\//,"")}}function Hu({label:s}){return s?l.jsx("span",{className:"switcher-root",title:s,children:l.jsx("span",{dir:"ltr",children:s})}):null}function $u({name:s,named:c}){const u=c===!1;return l.jsx("span",{className:`switcher-name${u?" unnamed":""}`,title:u?`${s} — folder name; set name: in kraftwerk.yml`:s,children:s})}function sb({entry:s,ambiguous:c}){const[u,o]=w.useState("idle"),[d,h]=w.useState(""),m=s.exists===!1,g=async()=>{o("starting"),h("");try{window.location.assign(await hp(s.root))}catch(y){o("error"),h(y.message)}};return l.jsxs("span",{className:`switcher-item stopped ${m?"missing":""}`,role:"menuitem",style:{"--ws-c":ji(s.color,s.root??s.url)},children:[l.jsx(bi,{icon:s.icon,name:s.name,color:s.color,seed:s.root??s.url,ambiguous:c}),l.jsxs("span",{className:"switcher-text",children:[l.jsx($u,{name:s.name,named:s.named}),u==="error"?l.jsx("span",{className:"switcher-sub switcher-err",title:d,children:d}):m?l.jsx("span",{className:"switcher-sub",children:"folder missing"}):l.jsx(Hu,{label:s.rootLabel})]}),l.jsxs("span",{className:"switcher-side",children:[l.jsx("span",{className:"switcher-port",children:Mp(s.url)}),l.jsxs("button",{className:"switcher-start",disabled:m||u==="starting",title:m?"The project folder no longer exists":"Start the UI for this project",onClick:y=>{y.stopPropagation(),g()},children:[u==="starting"?l.jsx(Q,{name:"progress_activity"}):l.jsx(Q,{name:"play_arrow"}),u==="starting"?"starting":"start"]})]})]})}function ib({entry:s,ambiguous:c}){const u=s.root??s.url;return l.jsxs("a",{className:`switcher-item${s.live?" live":""}`,role:"menuitem",href:s.url,style:{"--ws-c":ji(s.color,u)},children:[l.jsx(bi,{icon:s.icon,name:s.name,color:s.color,seed:u,ambiguous:c}),l.jsxs("span",{className:"switcher-text",children:[l.jsx($u,{name:s.name,named:s.named}),l.jsx(Hu,{label:s.rootLabel??(s.root?void 0:s.url.replace(/^https?:\/\//,""))})]}),l.jsx("span",{className:"switcher-side",children:l.jsxs("span",{className:"switcher-port",children:[s.live&&l.jsx("span",{className:"live-dot",title:"running"}),Mp(s.url)]})})]})}function cb({name:s,icon:c,color:u,named:o,root:d,seed:h,entries:m}){const[g,y]=w.useState(!1),x=$a();if(w.useEffect(()=>{if(!g)return;const z=F=>{F.target.closest(".switcher-wrap")||y(!1)};return window.addEventListener("mousedown",z),()=>window.removeEventListener("mousedown",z)},[g]),m.length===0)return l.jsx("span",{className:"env-name",title:d||"Project (kraftwerk.yml: name)",children:s});const b=new Map;for(const z of[c,...m.map(F=>F.icon)])z&&b.set(z,(b.get(z)??0)+1);const E=z=>!!z&&(b.get(z)??0)>1,N=[{key:"running",label:"running",items:m.filter(z=>z.live===!0)},{key:"stopped",label:"stopped",items:m.filter(z=>z.live===!1)},{key:"linked",label:"linked",items:m.filter(z=>z.live===void 0)}].filter(z=>z.items.length>0),L=h||s;return l.jsxs("span",{className:"switcher-wrap",children:[l.jsxs("button",{className:"env-name env-switch",title:d?`${d} — switch workspace`:"Switch workspace","aria-haspopup":"menu","aria-expanded":g,onClick:()=>y(z=>!z),children:[s,l.jsx(Q,{name:"expand_more"})]}),g&&l.jsxs("div",{className:"switcher-pop",role:"menu",children:[l.jsx("div",{className:"switcher-head",children:"Workspaces"}),l.jsxs("span",{className:"switcher-item current","aria-current":"true",style:{"--ws-c":ji(u,L)},children:[l.jsx(bi,{icon:c,name:s,color:u,seed:L,ambiguous:E(c)}),l.jsxs("span",{className:"switcher-text",children:[l.jsx($u,{name:s,named:o}),d?l.jsx(Hu,{label:d}):l.jsx("span",{className:"switcher-sub",children:"this workspace"})]}),l.jsx("span",{className:"switcher-side",children:l.jsx(Q,{name:"check",className:"switcher-check"})})]}),N.map(z=>l.jsxs("div",{className:`switcher-group switcher-group-${z.key}`,role:"group","aria-label":z.label,children:[l.jsx("div",{className:"switcher-group-head",children:z.label}),z.items.map(F=>F.live===!1&&F.root?l.jsx(sb,{entry:F,ambiguous:E(F.icon)},F.root):l.jsx(ib,{entry:F,ambiguous:E(F.icon)},F.root??F.url))]},z.key)),x&&l.jsxs("a",{className:"switcher-foot",href:"#/workspaces",role:"menuitem",onClick:()=>y(!1),children:[l.jsx(Q,{name:"hub"})," manage workspaces"]})]})]})}function rb(){const[s,c]=w.useState(null);return w.useEffect(()=>{let u=!0;return fetch("/api/runs").then(o=>o.json()).then(o=>{u&&(o.runs.length>0?ta(`/runs/${o.runs[0].id}`,{replace:!0}):c({outputDir:o.outputDir}))}).catch(()=>{}),()=>{u=!1}},[]),s?l.jsxs("div",{className:"empty",children:["No runs found in ",l.jsx("code",{children:s.outputDir}),". Start one with"," ",l.jsx("code",{children:"kraftwerk run <workflow> <request>"})," or from a workflow page."]}):l.jsx("div",{className:"empty",children:"loading…"})}function ob(){const[s,c]=w.useState(null),[u,o]=w.useState(!1);w.useEffect(()=>{let m=!0,g;const y=async()=>{try{const x=await fetch("/api/meta",{cache:"no-store"}).then(b=>b.json());m&&c(x)}catch{}m&&(g=setTimeout(y,3e4))};return y(),()=>{m=!1,clearTimeout(g)}},[]);const d=s?.restartable&&s.diskVersion&&s.diskVersion!==s.version?s.diskVersion:null;async function h(){if(d){o(!0),await fetch("/api/restart",{method:"POST"}).catch(()=>{});for(let m=0;m<60;m++){await new Promise(g=>setTimeout(g,500));try{if((await fetch("/api/meta",{cache:"no-store"}).then(y=>y.json())).version===d)break}catch{}}location.reload()}}return!d&&!u?null:l.jsx("button",{className:"relaunch-note",disabled:u,title:`v${d} is installed on disk, the server still runs v${s?.version}. Click to relaunch with the new version.`,onClick:()=>{h()},children:u?"relaunching…":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"restart_alt",className:"ms-sm"})," v",d," ready — relaunch"]})})}function ub(){const s=$a();return l.jsxs("button",{className:`expert-toggle ${s?"on":""}`,title:s?"Expert mode on — full detail":"Expert mode off — simplified view","aria-pressed":s,onClick:()=>av(!s),children:[l.jsx("span",{className:"expert-track",children:l.jsx("span",{className:"expert-knob"})}),"expert"]})}function db(){const[s,c]=w.useState(!1),[u,o]=w.useState(null),[d,h]=w.useState(null),[m,g]=w.useState("");w.useEffect(()=>{if(!s)return;fetch("/api/runs").then(b=>b.json()).then(o).catch(()=>{}),fetch("/api/workflows").then(b=>b.json()).then(h).catch(()=>{}),fetch("/api/meta").then(b=>b.json()).then(b=>g(b.version)).catch(()=>{});const x=b=>{b.target.closest(".info-wrap")||c(!1)};return window.addEventListener("mousedown",x),()=>window.removeEventListener("mousedown",x)},[s]);const y=u?.runs[0];return l.jsxs("span",{className:"info-wrap",children:[l.jsx("button",{className:"info-btn",title:"Project info","aria-label":"Project info",onClick:()=>c(x=>!x),children:l.jsx(Q,{name:"info"})}),s&&l.jsxs("div",{className:"info-pop",children:[l.jsxs("div",{className:"info-row",children:[l.jsx("span",{className:"microlabel",children:"Workflows"}),l.jsx("span",{className:"info-v",children:d?`${d.workflows.length} discovered`:"…"}),l.jsx("code",{className:"info-path",title:d?.root,children:d?.root??""})]}),l.jsxs("div",{className:"info-row",children:[l.jsx("span",{className:"microlabel",children:"Runs"}),l.jsxs("span",{className:"info-v",children:[u?`${u.runs.length} total`:"…",y?` · latest ${y.status}`:""]}),l.jsx("code",{className:"info-path",title:u?.outputDir,children:u?.outputDir??""})]}),l.jsxs("div",{className:"info-row info-actions",children:[l.jsx("span",{className:"microlabel",children:"Workspace"}),l.jsxs("a",{className:"update-btn",href:"#/settings",onClick:()=>c(!1),children:[l.jsx(Q,{name:"settings",className:"ms-sm"})," settings"]})]}),l.jsxs("div",{className:"info-row info-actions",children:[l.jsx("span",{className:"microlabel",children:"Theme"}),l.jsx(mb,{})]}),l.jsxs("div",{className:"info-row info-actions",children:[l.jsx("span",{className:"microlabel",children:"Version"}),l.jsx("span",{className:"info-v mono",children:m?`kraftwerk ${m}`:"…"}),l.jsx(hb,{})]})]})]})}function fb(s,c){const u=s.split(".").map(Number),o=c.split(".").map(Number);for(let d=0;d<3;d++)if((u[d]??0)!==(o[d]??0))return(u[d]??0)<(o[d]??0);return!1}function hb(){const[s,c]=w.useState("idle"),[u,o]=w.useState(null);async function d(){c("busy");try{const h=await fetch("/api/update-check",{cache:"no-store"}),m=await h.json();if(!h.ok||!m.latest)throw new Error;o(m),c("done")}catch{c("err")}}return s==="done"&&u?fb(u.current,u.latest)?l.jsxs("span",{className:"update-result newer",children:["v",u.latest," available — ",l.jsxs("code",{children:["npm i -g ",u.name,"@latest"]})]}):l.jsxs("span",{className:"update-result",children:[l.jsx(Q,{name:"check",className:"ms-sm"})," up to date"]}):l.jsx("button",{className:"update-btn",disabled:s==="busy",onClick:()=>{d()},children:s==="busy"?"checking…":s==="err"?"npm unreachable — retry":l.jsxs(l.Fragment,{children:[l.jsx(Q,{name:"sync",className:"ms-sm"})," check for updates"]})})}function mb(){return l.jsx("button",{className:"theme-btn",onClick:()=>{const s=document.documentElement,c=s.dataset.theme==="light"?"dark":"light";s.dataset.theme=c;try{localStorage.setItem("kw-theme",c)}catch{}},children:"day / night"})}Ix.createRoot(document.getElementById("root")).render(l.jsx(w.StrictMode,{children:l.jsx(nb,{})}));export{Q as I,Yx as R,Px as _,Vx as a,pb as b,$x as g,l as j,ta as n,w as r,_m as s};
|