@feltdb/feltkit 0.3.36 → 0.3.37
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/dashboard/assets/index-BhxrvY37.js +15 -0
- package/dist/dashboard/assets/index-CSzYeCo_.css +1 -0
- package/dist/dashboard/index.html +2 -2
- package/dist/runtime/contract.js +1 -1
- package/dist/runtime/contract.js.map +1 -1
- package/dist/runtime/providers.d.ts +126 -1
- package/dist/runtime/providers.js +242 -6
- package/dist/runtime/providers.js.map +1 -1
- package/dist/server/admin.js +48 -1
- package/dist/server/admin.js.map +1 -1
- package/dist/server/index.js +17 -0
- package/dist/server/index.js.map +1 -1
- package/docs/PROVIDERS.md +58 -1
- package/docs/README.md +2 -2
- package/package.json +13 -13
- package/skills/.claude-plugin/marketplace.json +1 -1
- package/skills/.claude-plugin/plugin.json +1 -1
- package/dist/dashboard/assets/index-9rMS3yBm.js +0 -15
- package/dist/dashboard/assets/index-DkiYTUMR.css +0 -1
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
(function(){const u=document.createElement("link").relList;if(u&&u.supports&&u.supports("modulepreload"))return;for(const f of document.querySelectorAll('link[rel="modulepreload"]'))r(f);new MutationObserver(f=>{for(const h of f)if(h.type==="childList")for(const g of h.addedNodes)g.tagName==="LINK"&&g.rel==="modulepreload"&&r(g)}).observe(document,{childList:!0,subtree:!0});function o(f){const h={};return f.integrity&&(h.integrity=f.integrity),f.referrerPolicy&&(h.referrerPolicy=f.referrerPolicy),f.crossOrigin==="use-credentials"?h.credentials="include":f.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function r(f){if(f.ep)return;f.ep=!0;const h=o(f);fetch(f.href,h)}})();var Fo={exports:{}},fs={};var sy;function j0(){if(sy)return fs;sy=1;var n=Symbol.for("react.transitional.element"),u=Symbol.for("react.fragment");function o(r,f,h){var g=null;if(h!==void 0&&(g=""+h),f.key!==void 0&&(g=""+f.key),"key"in f){h={};for(var v in f)v!=="key"&&(h[v]=f[v])}else h=f;return f=h.ref,{$$typeof:n,type:r,key:g,ref:f!==void 0?f:null,props:h}}return fs.Fragment=u,fs.jsx=o,fs.jsxs=o,fs}var cy;function S0(){return cy||(cy=1,Fo.exports=j0()),Fo.exports}var s=S0(),Wo={exports:{}},be={};var uy;function _0(){if(uy)return be;uy=1;var n=Symbol.for("react.transitional.element"),u=Symbol.for("react.portal"),o=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),f=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),g=Symbol.for("react.context"),v=Symbol.for("react.forward_ref"),m=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),x=Symbol.for("react.view_transition"),T=Symbol.iterator;function B(N){return N===null||typeof N!="object"?null:(N=T&&N[T]||N["@@iterator"],typeof N=="function"?N:null)}var D={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},C=Object.assign,w={};function H(N,X,Q){this.props=N,this.context=X,this.refs=w,this.updater=Q||D}H.prototype.isReactComponent={},H.prototype.setState=function(N,X){if(typeof N!="object"&&typeof N!="function"&&N!=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,N,X,"setState")},H.prototype.forceUpdate=function(N){this.updater.enqueueForceUpdate(this,N,"forceUpdate")};function W(){}W.prototype=H.prototype;function $(N,X,Q){this.props=N,this.context=X,this.refs=w,this.updater=Q||D}var Z=$.prototype=new W;Z.constructor=$,C(Z,H.prototype),Z.isPureReactComponent=!0;var ae=Array.isArray;function P(){}var q={H:null,A:null,T:null,S:null},de=Object.prototype.hasOwnProperty;function I(N,X,Q){var J=Q.ref;return{$$typeof:n,type:N,key:X,ref:J!==void 0?J:null,props:Q}}function Ne(N,X){return I(N.type,X,N.props)}function Ye(N){return typeof N=="object"&&N!==null&&N.$$typeof===n}function mt(N){var X={"=":"=0",":":"=2"};return"$"+N.replace(/[=:]/g,function(Q){return X[Q]})}var bt=/\/+/g;function Qe(N,X){return typeof N=="object"&&N!==null&&N.key!=null?mt(""+N.key):X.toString(36)}function V(N){switch(N.status){case"fulfilled":return N.value;case"rejected":throw N.reason;default:switch(typeof N.status=="string"?N.then(P,P):(N.status="pending",N.then(function(X){N.status==="pending"&&(N.status="fulfilled",N.value=X)},function(X){N.status==="pending"&&(N.status="rejected",N.reason=X)})),N.status){case"fulfilled":return N.value;case"rejected":throw N.reason}}throw N}function ee(N,X,Q,J,re){var pe=typeof N;(pe==="undefined"||pe==="boolean")&&(N=null);var Ae=!1;if(N===null)Ae=!0;else switch(pe){case"bigint":case"string":case"number":Ae=!0;break;case"object":switch(N.$$typeof){case n:case u:Ae=!0;break;case j:return Ae=N._init,ee(Ae(N._payload),X,Q,J,re)}}if(Ae)return re=re(N),Ae=J===""?"."+Qe(N,0):J,ae(re)?(Q="",Ae!=null&&(Q=Ae.replace(bt,"$&/")+"/"),ee(re,X,Q,"",function(ye){return ye})):re!=null&&(Ye(re)&&(re=Ne(re,Q+(re.key==null||N&&N.key===re.key?"":(""+re.key).replace(bt,"$&/")+"/")+Ae)),X.push(re)),1;Ae=0;var ne=J===""?".":J+":";if(ae(N))for(var K=0;K<N.length;K++)J=N[K],pe=ne+Qe(J,K),Ae+=ee(J,X,Q,pe,re);else if(K=B(N),typeof K=="function")for(N=K.call(N),K=0;!(J=N.next()).done;)J=J.value,pe=ne+Qe(J,K++),Ae+=ee(J,X,Q,pe,re);else if(pe==="object"){if(typeof N.then=="function")return ee(V(N),X,Q,J,re);throw X=String(N),Error("Objects are not valid as a React child (found: "+(X==="[object Object]"?"object with keys {"+Object.keys(N).join(", ")+"}":X)+"). If you meant to render a collection of children, use an array instead.")}return Ae}function ie(N,X,Q){if(N==null)return N;var J=[],re=0;return ee(N,J,"","",function(pe){return X.call(Q,pe,re++)}),J}function _e(N){if(N._status===-1){var X=N._result,Q=X();Q.then(function(J){(N._status===0||N._status===-1)&&(N._status=1,N._result=J,Q.status===void 0&&(Q.status="fulfilled",Q.value=J))},function(J){(N._status===0||N._status===-1)&&(N._status=2,N._result=J,Q.status===void 0&&(Q.status="rejected",Q.reason=J))}),N._status===-1&&(N._status=0,N._result=Q)}if(N._status===1)return N._result.default;throw N._result}var Te=typeof reportError=="function"?reportError:function(N){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var X=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N),error:N});if(!window.dispatchEvent(X))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",N);return}console.error(N)};function ct(N){var X=q.T,Q={};Q.types=X!==null?X.types:null,q.T=Q;try{var J=N(),re=q.S;re!==null&&re(Q,J),typeof J=="object"&&J!==null&&typeof J.then=="function"&&J.then(P,Te)}catch(pe){Te(pe)}finally{X!==null&&Q.types!==null&&(X.types=Q.types),q.T=X}}function ut(N){var X=q.T;if(X!==null){var Q=X.types;Q===null?X.types=[N]:Q.indexOf(N)===-1&&Q.push(N)}else ct(ut.bind(null,N))}var Oa={map:ie,forEach:function(N,X,Q){ie(N,function(){X.apply(this,arguments)},Q)},count:function(N){var X=0;return ie(N,function(){X++}),X},toArray:function(N){return ie(N,function(X){return X})||[]},only:function(N){if(!Ye(N))throw Error("React.Children.only expected to receive a single React element child.");return N}};return be.Activity=y,be.Children=Oa,be.Component=H,be.Fragment=o,be.Profiler=f,be.PureComponent=$,be.StrictMode=r,be.Suspense=m,be.ViewTransition=x,be.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=q,be.__COMPILER_RUNTIME={__proto__:null,c:function(N){return q.H.useMemoCache(N)}},be.addTransitionType=ut,be.cache=function(N){return function(){return N.apply(null,arguments)}},be.cacheSignal=function(){return null},be.cloneElement=function(N,X,Q){if(N==null)throw Error("The argument must be a React element, but you passed "+N+".");var J=C({},N.props),re=N.key;if(X!=null)for(pe in X.key!==void 0&&(re=""+X.key),X)!de.call(X,pe)||pe==="key"||pe==="__self"||pe==="__source"||pe==="ref"&&X.ref===void 0||(J[pe]=X[pe]);var pe=arguments.length-2;if(pe===1)J.children=Q;else if(1<pe){for(var Ae=Array(pe),ne=0;ne<pe;ne++)Ae[ne]=arguments[ne+2];J.children=Ae}return I(N.type,re,J)},be.createContext=function(N){return N={$$typeof:g,_currentValue:N,_currentValue2:N,_threadCount:0,Provider:null,Consumer:null},N.Provider=N,N.Consumer={$$typeof:h,_context:N},N},be.createElement=function(N,X,Q){var J,re={},pe=null;if(X!=null)for(J in X.key!==void 0&&(pe=""+X.key),X)de.call(X,J)&&J!=="key"&&J!=="__self"&&J!=="__source"&&(re[J]=X[J]);var Ae=arguments.length-2;if(Ae===1)re.children=Q;else if(1<Ae){for(var ne=Array(Ae),K=0;K<Ae;K++)ne[K]=arguments[K+2];re.children=ne}if(N&&N.defaultProps)for(J in Ae=N.defaultProps,Ae)re[J]===void 0&&(re[J]=Ae[J]);return I(N,pe,re)},be.createRef=function(){return{current:null}},be.forwardRef=function(N){return{$$typeof:v,render:N}},be.isValidElement=Ye,be.lazy=function(N){return{$$typeof:j,_payload:{_status:-1,_result:N},_init:_e}},be.memo=function(N,X){return{$$typeof:p,type:N,compare:X===void 0?null:X}},be.startTransition=ct,be.unstable_useCacheRefresh=function(){return q.H.useCacheRefresh()},be.use=function(N){return q.H.use(N)},be.useActionState=function(N,X,Q){return q.H.useActionState(N,X,Q)},be.useCallback=function(N,X){return q.H.useCallback(N,X)},be.useContext=function(N){return q.H.useContext(N)},be.useDebugValue=function(){},be.useDeferredValue=function(N,X){return q.H.useDeferredValue(N,X)},be.useEffect=function(N,X){return q.H.useEffect(N,X)},be.useEffectEvent=function(N){return q.H.useEffectEvent(N)},be.useId=function(){return q.H.useId()},be.useImperativeHandle=function(N,X,Q){return q.H.useImperativeHandle(N,X,Q)},be.useInsertionEffect=function(N,X){return q.H.useInsertionEffect(N,X)},be.useLayoutEffect=function(N,X){return q.H.useLayoutEffect(N,X)},be.useMemo=function(N,X){return q.H.useMemo(N,X)},be.useOptimistic=function(N,X){return q.H.useOptimistic(N,X)},be.useReducer=function(N,X,Q){return q.H.useReducer(N,X,Q)},be.useRef=function(N){return q.H.useRef(N)},be.useState=function(N){return q.H.useState(N)},be.useSyncExternalStore=function(N,X,Q){return q.H.useSyncExternalStore(N,X,Q)},be.useTransition=function(){return q.H.useTransition()},be.version="19.3.1",be}var ry;function xd(){return ry||(ry=1,Wo.exports=_0()),Wo.exports}var E=xd(),Po={exports:{}},hs={},ed={exports:{}},td={};var oy;function k0(){return oy||(oy=1,(function(n){function u(V,ee){var ie=V.length;V.push(ee);e:for(;0<ie;){var _e=ie-1>>>1,Te=V[_e];if(0<f(Te,ee))V[_e]=ee,V[ie]=Te,ie=_e;else break e}}function o(V){return V.length===0?null:V[0]}function r(V){if(V.length===0)return null;var ee=V[0],ie=V.pop();if(ie!==ee){V[0]=ie;e:for(var _e=0,Te=V.length,ct=Te>>>1;_e<ct;){var ut=2*(_e+1)-1,Oa=V[ut],N=ut+1,X=V[N];if(0>f(Oa,ie))N<Te&&0>f(X,Oa)?(V[_e]=X,V[N]=ie,_e=N):(V[_e]=Oa,V[ut]=ie,_e=ut);else if(N<Te&&0>f(X,ie))V[_e]=X,V[N]=ie,_e=N;else break e}}return ee}function f(V,ee){var ie=V.sortIndex-ee.sortIndex;return ie!==0?ie:V.id-ee.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;n.unstable_now=function(){return h.now()}}else{var g=Date,v=g.now();n.unstable_now=function(){return g.now()-v}}var m=[],p=[],j=1,y=null,x=3,T=!1,B=!1,D=!1,C=!1,w=typeof setTimeout=="function"?setTimeout:null,H=typeof clearTimeout=="function"?clearTimeout:null,W=typeof setImmediate<"u"?setImmediate:null;function $(V){for(var ee=o(p);ee!==null;){if(ee.callback===null)r(p);else if(ee.startTime<=V)r(p),ee.sortIndex=ee.expirationTime,u(m,ee);else break;ee=o(p)}}function Z(V){if(D=!1,$(V),!B)if(o(m)!==null)B=!0,ae||(ae=!0,Ye());else{var ee=o(p);ee!==null&&Qe(Z,ee.startTime-V)}}var ae=!1,P=-1,q=5,de=-1;function I(){return C?!0:!(n.unstable_now()-de<q)}function Ne(){if(C=!1,ae){var V=n.unstable_now();de=V;var ee=!0;try{e:{B=!1,D&&(D=!1,H(P),P=-1),T=!0;var ie=x;try{t:{for($(V),y=o(m);y!==null&&!(y.expirationTime>V&&I());){var _e=y.callback;if(typeof _e=="function"){y.callback=null,x=y.priorityLevel;var Te=_e(y.expirationTime<=V);if(V=n.unstable_now(),typeof Te=="function"){y.callback=Te,$(V),ee=!0;break t}y===o(m)&&r(m),$(V)}else r(m);y=o(m)}if(y!==null)ee=!0;else{var ct=o(p);ct!==null&&Qe(Z,ct.startTime-V),ee=!1}}break e}finally{y=null,x=ie,T=!1}ee=void 0}}finally{ee?Ye():ae=!1}}}var Ye;if(typeof W=="function")Ye=function(){W(Ne)};else if(typeof MessageChannel<"u"){var mt=new MessageChannel,bt=mt.port2;mt.port1.onmessage=Ne,Ye=function(){bt.postMessage(null)}}else Ye=function(){w(Ne,0)};function Qe(V,ee){P=w(function(){V(n.unstable_now())},ee)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(V){V.callback=null},n.unstable_forceFrameRate=function(V){0>V||125<V?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<V?Math.floor(1e3/V):5},n.unstable_getCurrentPriorityLevel=function(){return x},n.unstable_next=function(V){switch(x){case 1:case 2:case 3:var ee=3;break;default:ee=x}var ie=x;x=ee;try{return V()}finally{x=ie}},n.unstable_requestPaint=function(){C=!0},n.unstable_runWithPriority=function(V,ee){switch(V){case 1:case 2:case 3:case 4:case 5:break;default:V=3}var ie=x;x=V;try{return ee()}finally{x=ie}},n.unstable_scheduleCallback=function(V,ee,ie){var _e=n.unstable_now();switch(typeof ie=="object"&&ie!==null?(ie=ie.delay,ie=typeof ie=="number"&&0<ie?_e+ie:_e):ie=_e,V){case 1:var Te=-1;break;case 2:Te=250;break;case 5:Te=1073741823;break;case 4:Te=1e4;break;default:Te=5e3}return Te=ie+Te,V={id:j++,callback:ee,priorityLevel:V,startTime:ie,expirationTime:Te,sortIndex:-1},ie>_e?(V.sortIndex=ie,u(p,V),o(m)===null&&V===o(p)&&(D?(H(P),P=-1):D=!0,Qe(Z,ie-_e))):(V.sortIndex=Te,u(m,V),B||T||(B=!0,ae||(ae=!0,Ye()))),V},n.unstable_shouldYield=I,n.unstable_wrapCallback=function(V){var ee=x;return function(){var ie=x;x=ee;try{return V.apply(this,arguments)}finally{x=ie}}}})(td)),td}var dy;function N0(){return dy||(dy=1,ed.exports=k0()),ed.exports}var ad={exports:{}},Lt={};var fy;function T0(){if(fy)return Lt;fy=1;var n=xd();function u(j){var y="https://react.dev/errors/"+j;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var x=2;x<arguments.length;x++)y+="&args[]="+encodeURIComponent(arguments[x])}return"Minified React error #"+j+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(){}var r={d:{f:o,r:function(){throw Error(u(522))},D:o,C:o,L:o,m:o,X:o,S:o,M:o},p:0,findDOMNode:null},f=Symbol.for("react.portal"),h=Symbol.for("react.recoverable"),g=Symbol.for("react.optimistic_key");function v(j,y,x){var T=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:f,key:T==null?null:T===g?g:""+T,children:j,containerInfo:y,implementation:x}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function p(j,y){if(j==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Lt.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Lt.browser=function(j){return{$$typeof:h,_reason:j}},Lt.createPortal=function(j,y){var x=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(u(299));return v(j,y,null,x)},Lt.flushSync=function(j){var y=m.T,x=r.p;try{if(m.T=null,r.p=2,j)return j()}finally{m.T=y,r.p=x,r.d.f()}},Lt.preconnect=function(j,y){typeof j=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,r.d.C(j,y))},Lt.prefetchDNS=function(j){typeof j=="string"&&r.d.D(j)},Lt.preinit=function(j,y){if(typeof j=="string"&&y&&typeof y.as=="string"){var x=y.as,T=p(x,y.crossOrigin),B=typeof y.integrity=="string"?y.integrity:void 0,D=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;x==="style"?r.d.S(j,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:T,integrity:B,fetchPriority:D}):x==="script"&&r.d.X(j,{crossOrigin:T,integrity:B,fetchPriority:D,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Lt.preinitModule=function(j,y){if(typeof j=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var x=p(y.as,y.crossOrigin);r.d.M(j,{crossOrigin:x,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}}else y==null&&r.d.M(j)},Lt.preload=function(j,y){if(typeof j=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var x=y.as,T=p(x,y.crossOrigin);r.d.L(j,x,{crossOrigin:T,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Lt.preloadModule=function(j,y){if(typeof j=="string")if(y){var x=p(y.as,y.crossOrigin);r.d.m(j,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:x,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0})}else r.d.m(j)},Lt.requestFormReset=function(j){r.d.r(j)},Lt.unstable_batchedUpdates=function(j,y){return j(y)},Lt.useFormState=function(j,y,x){return m.H.useFormState(j,y,x)},Lt.useFormStatus=function(){return m.H.useHostTransitionStatus()},Lt.version="19.3.1",Lt}var hy;function E0(){if(hy)return ad.exports;hy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(u){console.error(u)}}return n(),ad.exports=T0(),ad.exports}var my;function A0(){if(my)return hs;my=1;var n=N0(),u=xd(),o=E0();function r(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 f(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){for(var t=e,a=t;a&&!a.alternate;)t=a,(t.flags&4098)!==0&&(e=t.return),a=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function g(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 v(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 m(e){if(h(e)!==e)throw Error(r(188))}function p(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(r(188));return t!==e?null:e}for(var a=e,l=t;;){var i=a.return;if(i===null)break;var c=i.alternate;if(c===null){if(l=i.return,l!==null){a=l;continue}break}if(i.child===c.child){for(c=i.child;c;){if(c===a)return m(i),e;if(c===l)return m(i),t;c=c.sibling}throw Error(r(188))}if(a.return!==l.return)a=i,l=c;else{for(var d=!1,b=i.child;b;){if(b===a){d=!0,a=i,l=c;break}if(b===l){d=!0,l=i,a=c;break}b=b.sibling}if(!d){for(b=c.child;b;){if(b===a){d=!0,a=c,l=i;break}if(b===l){d=!0,l=c,a=i;break}b=b.sibling}if(!d)throw Error(r(189))}}if(a.alternate!==l)throw Error(r(190))}if(a.tag!==3)throw Error(r(188));return a.stateNode.current===a?e:t}function j(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=j(e),t!==null)return t;e=e.sibling}return null}function y(e,t,a,l,i,c){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&a(e,l,i,c)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&y(e.child,t,a,l,i,c))return!0;e=e.sibling}return!1}function x(e){for(e=e.return;e!==null;){if(e.tag===3||e.tag===5||e.tag===27)return e;e=e.return}return null}function T(e){var t=!1;for(e=e.return;e!==null&&(e.tag===4&&(t=!0),!(e.tag===3||e.tag===5||e.tag===27));)e=e.return;return t}function B(e){var t=[null,null],a=x(e);return a===null||D(t,e,a.child,{foundSelf:!1}),t}function D(e,t,a,l){for(;a!==null;){if(a===t)l.foundSelf=!0;else if(a.tag===5||a.tag===27||a.tag===6){if(l.foundSelf)return e[1]=a,!0;e[0]=a}else if((a.tag!==22||a.memoizedState===null)&&D(e,t,a.child,l))return!0;a=a.sibling}return!1}function C(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(r(559))}}var w=null,H=null;function W(e,t,a){return e===a?!0:e===t?(w=e,!0):!1}function $(e,t,a){return e===a?(H=e,!1):e===t?(H!==null&&(w=e),!0):!1}function Z(e){if(e===null)return null;do e=e===null?null:e.return;while(e&&e.tag!==5&&e.tag!==27&&e.tag!==3);return e||null}function ae(e,t,a){for(var l=0,i=e;i;i=a(i))l++;i=0;for(var c=t;c;c=a(c))i++;for(;0<l-i;)e=a(e),l--;for(;0<i-l;)t=a(t),i--;for(;l--;){if(e===t||t!==null&&e===t.alternate)return e;e=a(e),t=a(t)}return null}var P=Object.assign,q=Symbol.for("react.element"),de=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),Ne=Symbol.for("react.fragment"),Ye=Symbol.for("react.strict_mode"),mt=Symbol.for("react.profiler"),bt=Symbol.for("react.consumer"),Qe=Symbol.for("react.context"),V=Symbol.for("react.forward_ref"),ee=Symbol.for("react.suspense"),ie=Symbol.for("react.suspense_list"),_e=Symbol.for("react.memo"),Te=Symbol.for("react.lazy"),ct=Symbol.for("react.activity"),ut=Symbol.for("react.legacy_hidden"),Oa=Symbol.for("react.memo_cache_sentinel"),N=Symbol.for("react.view_transition"),X=Symbol.for("react.recoverable"),Q=Symbol.iterator;function J(e){return e===null||typeof e!="object"?null:(e=Q&&e[Q]||e["@@iterator"],typeof e=="function"?e:null)}var re=Symbol.for("react.client.reference");function pe(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===re?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case Ne:return"Fragment";case mt:return"Profiler";case Ye:return"StrictMode";case ee:return"Suspense";case ie:return"SuspenseList";case ct:return"Activity";case N:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case I:return"Portal";case Qe:return e.displayName||"Context";case bt:return(e._context.displayName||"Context")+".Consumer";case V:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case _e:return t=e.displayName||null,t!==null?t:pe(e.type)||"Memo";case Te:t=e._payload,e=e._init;try{return pe(e(t))}catch{}}return null}var Ae=Array.isArray,ne=u.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,K=o.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},Oe=[],Pe=-1;function at(e){return{current:e}}function $e(e){0>Pe||(e.current=Oe[Pe],Oe[Pe]=null,Pe--)}function he(e,t){Pe++,Oe[Pe]=e.current,e.current=t}var nt=at(null),pt=at(null),Ct=at(null),vt=at(null);function Gt(e,t){switch(he(Ct,t),he(pt,e),he(nt,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?vv(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=vv(t),e=yv(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}$e(nt),he(nt,e)}function La(){$e(nt),$e(pt),$e(Ct)}function yu(e){var t=e.memoizedState;t!==null&&(oi._currentValue=t.memoizedState,he(vt,e)),t=nt.current;var a=yv(t,e.type);t!==a&&(he(pt,e),he(nt,a))}function Ns(e){pt.current===e&&($e(nt),$e(pt)),vt.current===e&&($e(vt),oi._currentValue=ye)}var gu,Md;function bl(e){if(gu===void 0)try{throw Error()}catch(a){var t=a.stack.trim().match(/\n( *(at )?)/);gu=t&&t[1]||"",Md=-1<a.stack.indexOf(`
|
|
2
|
+
at`)?" (<anonymous>)":-1<a.stack.indexOf("@")?"@unknown:0:0":""}return`
|
|
3
|
+
`+gu+e+Md}var bu=!1;function pu(e,t){if(!e||bu)return"";bu=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var l={DetermineComponentFrameRoot:function(){try{if(t){var Y=function(){throw Error()};if(Object.defineProperty(Y.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Y,[])}catch(F){var A=F}Reflect.construct(e,[],Y)}else{try{Y.call()}catch(F){A=F}Y=!1;try{var M=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),Y=!0,new e}finally{Y&&(M!==void 0?Object.defineProperty(e.prototype,"props",M):delete e.prototype.props)}}}else{try{throw Error()}catch(F){A=F}(Y=e())&&typeof Y.catch=="function"&&Y.catch(function(){})}}catch(F){if(F&&A&&typeof F.stack=="string")return[F.stack,A.stack]}return[null,null]}};l.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(l.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(l.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var c=l.DetermineComponentFrameRoot(),d=c[0],b=c[1];if(d&&b){var _=d.split(`
|
|
4
|
+
`),R=b.split(`
|
|
5
|
+
`);for(i=l=0;l<_.length&&!_[l].includes("DetermineComponentFrameRoot");)l++;for(;i<R.length&&!R[i].includes("DetermineComponentFrameRoot");)i++;if(l===_.length||i===R.length)for(l=_.length-1,i=R.length-1;1<=l&&0<=i&&_[l]!==R[i];)i--;for(;1<=l&&0<=i;l--,i--)if(_[l]!==R[i]){if(l!==1||i!==1)do if(l--,i--,0>i||_[l]!==R[i]){var U=`
|
|
6
|
+
`+_[l].replace(" at new "," at ");return e.displayName&&U.includes("<anonymous>")&&(U=U.replace("<anonymous>",e.displayName)),U}while(1<=l&&0<=i);break}}}finally{bu=!1,Error.prepareStackTrace=a}return(a=e?e.displayName||e.name:"")?bl(a):""}function Ng(e,t){switch(e.tag){case 26:case 27:case 5:return bl(e.type);case 16:return bl("Lazy");case 13:return e.child!==t&&t!==null?bl("Suspense Fallback"):bl("Suspense");case 19:return bl("SuspenseList");case 0:case 15:return pu(e.type,!1);case 11:return pu(e.type.render,!1);case 1:return pu(e.type,!0);case 31:return bl("Activity");case 30:return bl("ViewTransition");default:return""}}function Ud(e){try{var t="",a=null;do t+=Ng(e,a),a=e,e=e.return;while(e);return t}catch(l){return`
|
|
7
|
+
Error generating stack: `+l.message+`
|
|
8
|
+
`+l.stack}}var xu=Object.prototype.hasOwnProperty,ju=n.unstable_scheduleCallback,Su=n.unstable_cancelCallback,Tg=n.unstable_shouldYield,Eg=n.unstable_requestPaint,ua=n.unstable_now,Ag=n.unstable_getCurrentPriorityLevel,$d=n.unstable_ImmediatePriority,Bd=n.unstable_UserBlockingPriority,Ts=n.unstable_NormalPriority,Cg=n.unstable_LowPriority,qd=n.unstable_IdlePriority,wg=n.log,Og=n.unstable_setDisableYieldValue,pi=null,ra=null;function pl(e){if(typeof wg=="function"&&Og(e),ra&&typeof ra.setStrictMode=="function")try{ra.setStrictMode(pi,e)}catch{}}var oa=Math.clz32?Math.clz32:zg,Rg=Math.log,Dg=Math.LN2;function zg(e){return e>>>=0,e===0?32:31-(Rg(e)/Dg|0)|0}var Es=256,As=262144,Cs=4194304;function Fl(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&-e;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 ws(e,t,a){var l=e.pendingLanes;if(l===0)return 0;var i=0,c=e.suspendedLanes,d=e.pingedLanes;e=e.warmLanes;var b=l&134217727;return b!==0?(l=b&~c,l!==0?i=Fl(l):(d&=b,d!==0?i=Fl(d):a||(a=b&~e,a!==0&&(i=Fl(a))))):(b=l&~c,b!==0?i=Fl(b):d!==0?i=Fl(d):a||(a=l&~e,a!==0&&(i=Fl(a)))),i===0?0:t!==0&&t!==i&&(t&c)===0&&(c=i&-i,a=t&-t,c>=a||c===32&&(a&4194048)!==0)?t:i}function xi(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Hd(e,t){(t&8)!==0&&(t|=t&32);var a=e.entangledLanes;if(a!==0)for(e=e.entanglements,a&=t;0<a;){var l=31-oa(a),i=1<<l;t|=e[l],a&=~i}return t}function Mg(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 Ld(){var e=Cs;return Cs<<=1,(Cs&62914560)===0&&(Cs=4194304),e}function _u(e){for(var t=[],a=0;31>a;a++)t.push(e);return t}function ji(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function Ug(e,t,a,l,i,c){var d=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 b=e.entanglements,_=e.expirationTimes,R=e.hiddenUpdates;for(a=d&~a;0<a;){var U=31-oa(a),Y=1<<U;b[U]=0,_[U]=-1;var A=R[U];if(A!==null)for(R[U]=null,U=0;U<A.length;U++){var M=A[U];M!==null&&(M.lane&=-536870913)}a&=~Y}l!==0&&Yd(e,l,0),c!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=c&~(d&~t))}function Yd(e,t,a){e.pendingLanes|=t,e.suspendedLanes&=~t;var l=31-oa(t);e.entangledLanes|=t,e.entanglements[l]=e.entanglements[l]|1073741824|a&261930}function Gd(e,t){var a=e.entangledLanes|=t;for(e=e.entanglements;a;){var l=31-oa(a),i=1<<l;i&t|e[l]&t&&(e[l]|=t),a&=~i}}function Vd(e,t){var a=t&-t;return a=(a&42)!==0?1:ku(a),(a&(e.suspendedLanes|t))!==0?0:a}function ku(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 Nu(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function Xd(){var e=K.p;return e!==0?e:(e=window.event,e===void 0?32:Pv(e.type))}function Qd(e,t){var a=K.p;try{return K.p=e,t()}finally{K.p=a}}var tl=Math.random().toString(36).slice(2),Mt="__reactFiber$"+tl,Pt="__reactProps$"+tl,kn="__reactContainer$"+tl,Zd="__reactEvents$"+tl,$g="__reactListeners$"+tl,Bg="__reactHandles$"+tl,Kd="__reactResources$"+tl,Si="__reactMarker$"+tl,Os="__reactLoad$"+tl;function Rs(e){delete e[Mt],delete e[Pt],delete e[$g],delete e[Bg]}function Wl(e){var t;if(t=e[Mt])return t;for(var a=e.parentNode;a;){if(t=a[kn]||a[Mt]){if(a=t.alternate,t.child!==null||a!==null&&a.child!==null)for(e=Dv(e);e!==null;){if(a=e[Mt])return a;e=Dv(e)}return t}e=a,a=e.parentNode}return null}function Nn(e){if(e=e[Mt]||e[kn]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function _i(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(r(33))}function Tn(e){var t=e[Kd];return t||(t=e[Kd]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function wt(e){e[Si]=!0}function Jd(e){e[Os]=void 0}var Id=new Set,Fd={};function Pl(e,t){En(e,t),En(e+"Capture",t)}function En(e,t){for(Fd[e]=t,e=0;e<t.length;e++)Id.add(t[e])}var qg=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]*$"),Wd={},Pd={};function Hg(e){return xu.call(Pd,e)?!0:xu.call(Wd,e)?!1:qg.test(e)?Pd[e]=!0:(Wd[e]=!0,!1)}var Ge=!1;function ef(){var e=Ge;return Ge=!1,e}function Ds(e,t,a){if(Hg(t))if(a===null)e.removeAttribute(t);else{switch(typeof a){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var l=t.toLowerCase().slice(0,5);if(l!=="data-"&&l!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,a)}}function zs(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 al(e,t,a,l){if(l===null)e.removeAttribute(a);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(a);return}e.setAttributeNS(t,a,l)}}function da(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function tf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Lg(e,t,a){var l=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof l<"u"&&typeof l.get=="function"&&typeof l.set=="function"){var i=l.get,c=l.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(d){a=""+d,c.call(this,d)}}),Object.defineProperty(e,t,{enumerable:l.enumerable}),{getValue:function(){return a},setValue:function(d){a=""+d},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Tu(e){if(!e._valueTracker){var t=tf(e)?"checked":"value";e._valueTracker=Lg(e,t,""+e[t])}}function af(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var a=t.getValue(),l="";return e&&(l=tf(e)?e.checked?"true":"false":e.value),e=l,e!==a?(t.setValue(e),!0):!1}var Yg=/[\n"\\]/g;function ja(e){return e.replace(Yg,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function Eu(e,t,a,l,i,c,d,b){e.name="",d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"?e.type=d:e.removeAttribute("type"),t!=null?d==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+da(t)):e.value!==""+da(t)&&(e.value=""+da(t)):d!=="submit"&&d!=="reset"||e.removeAttribute("value"),t!=null?d==="number"&&e.value==t?Au(e,da(e.value)):Au(e,da(t)):a!=null?Au(e,da(a)):l!=null&&e.removeAttribute("value"),i==null&&c!=null&&(e.defaultChecked=!!c),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),b!=null&&typeof b!="function"&&typeof b!="symbol"&&typeof b!="boolean"?e.name=""+da(b):e.removeAttribute("name")}function lf(e,t,a,l,i,c,d,b){if(c!=null&&typeof c!="function"&&typeof c!="symbol"&&typeof c!="boolean"&&(e.type=c),t!=null||a!=null){if(!(c!=="submit"&&c!=="reset"||t!=null)){Tu(e);return}a=a!=null?""+da(a):"",t=t!=null?""+da(t):a,b||t===e.value||(e.value=t),e.defaultValue=t}l=l??i,l=typeof l!="function"&&typeof l!="symbol"&&!!l,e.checked=b?e.checked:!!l,e.defaultChecked=!!l,d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.name=d),Tu(e)}function Au(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function An(e,t,a,l){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&&l&&(e[a].defaultSelected=!0)}else{for(a=""+da(a),t=null,i=0;i<e.length;i++){if(e[i].value===a){e[i].selected=!0,l&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function nf(e,t,a){if(t!=null&&(t=""+da(t),t!==e.value&&(e.value=t),a==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=a!=null?""+da(a):""}function sf(e,t,a,l){if(t==null){if(l!=null){if(a!=null)throw Error(r(92));if(Ae(l)){if(1<l.length)throw Error(r(93));l=l[0]}a=l}a==null&&(a=""),t=a}a=da(t),e.defaultValue=a,l=e.textContent,l===a&&l!==""&&l!==null&&(e.value=l),Tu(e)}function Cn(e,t){if(t){var a=e.firstChild;if(a&&a===e.lastChild&&a.nodeType===3){a.nodeValue=t;return}}e.textContent=t}var Gg=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 cf(e,t,a){var l=t.indexOf("--")===0;a==null||typeof a=="boolean"||a===""?l?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":l?e.setProperty(t,a):typeof a!="number"||a===0||Gg.has(t)?t==="float"?e.cssFloat=a:e[t]=(""+a).trim():e[t]=a+"px"}function uf(e,t,a){if(t!=null&&typeof t!="object")throw Error(r(62));if(e=e.style,a!=null){for(var l in a)!a.hasOwnProperty(l)||t!=null&&t.hasOwnProperty(l)||(l.indexOf("--")===0?e.setProperty(l,""):l==="float"?e.cssFloat="":e[l]="",Ge=!0);for(var i in t)l=t[i],t.hasOwnProperty(i)&&a[i]!==l&&(cf(e,i,l),Ge=!0)}else for(var c in t)t.hasOwnProperty(c)&&cf(e,c,t[c])}function Cu(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 Vg=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"],["maskType","mask-type"],["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"]]),Xg=/^[\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 Ms(e){return Xg.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Ya(){}var wu=null;function Ou(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var wn=null,On=null;function rf(e){var t=Nn(e);if(t&&(e=t.stateNode)){var a=e[Pt]||null;e:switch(e=t.stateNode,t.type){case"input":if(Eu(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="'+ja(""+t)+'"][type="radio"]'),t=0;t<a.length;t++){var l=a[t];if(l!==e&&l.form===e.form){var i=l[Pt]||null;if(!i)throw Error(r(90));Eu(l,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<a.length;t++)l=a[t],l.form===e.form&&af(l)}break e;case"textarea":nf(e,a.value,a.defaultValue);break e;case"select":t=a.value,t!=null&&An(e,!!a.multiple,t,!1)}}}var Ru=!1;function of(e,t,a){if(Ru)return e(t,a);Ru=!0;try{var l=e(t);return l}finally{if(Ru=!1,(wn!==null||On!==null)&&(Mc(),wn&&(t=wn,e=On,On=wn=null,rf(t),e)))for(t=0;t<e.length;t++)rf(e[t])}}function ki(e,t){var a=e.stateNode;if(a===null)return null;var l=a[Pt]||null;if(l===null)return null;a=l[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":(l=!l.disabled)||(e=e.type,l=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!l;break e;default:e=!1}if(e)return null;if(a&&typeof a!="function")throw Error(r(231,t,typeof a));return a}var ll=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Du=!1;if(ll)try{var Ni={};Object.defineProperty(Ni,"passive",{get:function(){Du=!0}}),window.addEventListener("test",Ni,Ni),window.removeEventListener("test",Ni,Ni)}catch{Du=!1}var xl=null,zu=null,Us=null;function df(){if(Us)return Us;var e,t=zu,a=t.length,l,i="value"in xl?xl.value:xl.textContent,c=i.length;for(e=0;e<a&&t[e]===i[e];e++);var d=a-e;for(l=1;l<=d&&t[a-l]===i[c-l];l++);return Us=i.slice(e,1<l?1-l:void 0)}function $s(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 Bs(){return!0}function ff(){return!1}function Qt(e){function t(a,l,i,c,d){this._reactName=a,this._targetInst=i,this.type=l,this.nativeEvent=c,this.target=d,this.currentTarget=null;for(var b in e)e.hasOwnProperty(b)&&(a=e[b],this[b]=a?a(c):c[b]);return this.isDefaultPrevented=(c.defaultPrevented!=null?c.defaultPrevented:c.returnValue===!1)?Bs:ff,this.isPropagationStopped=ff,this}return P(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=Bs)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Bs)},persist:function(){},isPersistent:Bs}),t}var jl={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},qs=Qt(jl),Ti=P({},jl,{view:0,detail:0}),Qg=Qt(Ti),Mu,Uu,Ei,Hs=P({},Ti,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Bu,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!==Ei&&(Ei&&e.type==="mousemove"?(Mu=e.screenX-Ei.screenX,Uu=e.screenY-Ei.screenY):Uu=Mu=0,Ei=e),Mu)},movementY:function(e){return"movementY"in e?e.movementY:Uu}}),hf=Qt(Hs),Zg=P({},Hs,{dataTransfer:0}),Kg=Qt(Zg),Jg=P({},Ti,{relatedTarget:0}),$u=Qt(Jg),Ig=P({},jl,{animationName:0,elapsedTime:0,pseudoElement:0}),Fg=Qt(Ig),Wg=P({},jl,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),Pg=Qt(Wg),eb=P({},jl,{data:0}),mf=Qt(eb),tb={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ab={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"},lb={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function nb(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=lb[e])?!!t[e]:!1}function Bu(){return nb}var ib=P({},Ti,{key:function(e){if(e.key){var t=tb[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=$s(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ab[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Bu,charCode:function(e){return e.type==="keypress"?$s(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?$s(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),sb=Qt(ib),cb=P({},Hs,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),vf=Qt(cb),ub=P({},jl,{submitter:0}),rb=Qt(ub),ob=P({},Ti,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Bu}),db=Qt(ob),fb=P({},jl,{propertyName:0,elapsedTime:0,pseudoElement:0}),hb=Qt(fb),mb=P({},Hs,{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}),vb=Qt(mb),yb=P({},jl,{newState:0,oldState:0,source:0}),gb=Qt(yb),bb=[9,13,27,32],qu=ll&&"CompositionEvent"in window,Ai=null;ll&&"documentMode"in document&&(Ai=document.documentMode);var pb=ll&&"TextEvent"in window&&!Ai,yf=ll&&(!qu||Ai&&8<Ai&&11>=Ai),gf=" ",bf=!1;function pf(e,t){switch(e){case"keyup":return bb.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function xf(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Rn=!1;function xb(e,t){switch(e){case"compositionend":return xf(t);case"keypress":return t.which!==32?null:(bf=!0,gf);case"textInput":return e=t.data,e===gf&&bf?null:e;default:return null}}function jb(e,t){if(Rn)return e==="compositionend"||!qu&&pf(e,t)?(e=df(),Us=zu=xl=null,Rn=!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 yf&&t.locale!=="ko"?null:t.data;default:return null}}var Sb={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 jf(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Sb[e.type]:t==="textarea"}function Sf(e,t,a,l){wn?On?On.push(l):On=[l]:wn=l,t=Lc(t,"onChange"),0<t.length&&(a=new qs("onChange","change",null,a,l),e.push({event:a,listeners:t}))}var Ci=null,wi=null;function _b(e){rv(e,0)}function Ls(e){var t=_i(e);if(af(t))return e}function _f(e,t){if(e==="change")return t}var kf=!1;if(ll){var Hu;if(ll){var Lu="oninput"in document;if(!Lu){var Nf=document.createElement("div");Nf.setAttribute("oninput","return;"),Lu=typeof Nf.oninput=="function"}Hu=Lu}else Hu=!1;kf=Hu&&(!document.documentMode||9<document.documentMode)}function Tf(){Ci&&(Ci.detachEvent("onpropertychange",Ef),wi=Ci=null)}function Ef(e){if(e.propertyName==="value"&&Ls(wi)){var t=[];Sf(t,wi,e,Ou(e)),of(_b,t)}}function kb(e,t,a){e==="focusin"?(Tf(),Ci=t,wi=a,Ci.attachEvent("onpropertychange",Ef)):e==="focusout"&&Tf()}function Nb(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ls(wi)}function Tb(e,t){if(e==="click")return Ls(t)}function Eb(e,t){if(e==="input"||e==="change")return Ls(t)}function Ab(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var fa=typeof Object.is=="function"?Object.is:Ab;function Oi(e,t){if(fa(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var a=Object.keys(e),l=Object.keys(t);if(a.length!==l.length)return!1;for(l=0;l<a.length;l++){var i=a[l];if(!xu.call(t,i)||!fa(e[i],t[i]))return!1}return!0}function Yu(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}}function Af(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function Cf(e,t){var a=Af(e);e=0;for(var l;a;){if(a.nodeType===3){if(l=e+a.textContent.length,e<=t&&l>=t)return{node:a,offset:t-e};e=l}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=Af(a)}}function wf(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?wf(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Of(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Yu(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=Yu(e.document)}return t}function Gu(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 Cb=ll&&"documentMode"in document&&11>=document.documentMode,Dn=null,Vu=null,Ri=null,Xu=!1;function Rf(e,t,a){var l=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Xu||Dn==null||Dn!==Yu(l)||(l=Dn,"selectionStart"in l&&Gu(l)?l={start:l.selectionStart,end:l.selectionEnd}:(l=(l.ownerDocument&&l.ownerDocument.defaultView||window).getSelection(),l={anchorNode:l.anchorNode,anchorOffset:l.anchorOffset,focusNode:l.focusNode,focusOffset:l.focusOffset}),Ri&&Oi(Ri,l)||(Ri=l,l=Lc(Vu,"onSelect"),0<l.length&&(t=new qs("onSelect","select",null,t,a),e.push({event:t,listeners:l}),t.target=Dn)))}function en(e,t){var a={};return a[e.toLowerCase()]=t.toLowerCase(),a["Webkit"+e]="webkit"+t,a["Moz"+e]="moz"+t,a}var zn={animationend:en("Animation","AnimationEnd"),animationiteration:en("Animation","AnimationIteration"),animationstart:en("Animation","AnimationStart"),transitionrun:en("Transition","TransitionRun"),transitionstart:en("Transition","TransitionStart"),transitioncancel:en("Transition","TransitionCancel"),transitionend:en("Transition","TransitionEnd")},Qu={},Df={};ll&&(Df=document.createElement("div").style,"AnimationEvent"in window||(delete zn.animationend.animation,delete zn.animationiteration.animation,delete zn.animationstart.animation),"TransitionEvent"in window||delete zn.transitionend.transition);function tn(e){if(Qu[e])return Qu[e];if(!zn[e])return e;var t=zn[e],a;for(a in t)if(t.hasOwnProperty(a)&&a in Df)return Qu[e]=t[a];return e}var zf=tn("animationend"),Mf=tn("animationiteration"),Uf=tn("animationstart"),wb=tn("transitionrun"),Ob=tn("transitionstart"),Rb=tn("transitioncancel"),$f=tn("transitionend"),Bf=new Map,Zu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error fullscreenChange fullscreenError 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(" ");Zu.push("scrollEnd");function Ra(e,t){Bf.set(e,t),Pl(t,[e])}var Db=0;function nl(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=Ua.identifierPrefix;var a=Db++;return e="_"+e+"t_"+a.toString(32)+"_",t.autoName=e}function qf(e){if(e==null||typeof e=="string")return e;var t=null,a=ei;if(a!==null)for(var l=0;l<a.length;l++){var i=e[a[l]];if(i!=null){if(i==="none")return"none";t=t==null?i:t+(" "+i)}}return t??e.default}function il(e,t){return e=qf(e),t=qf(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var Ys=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)},Sa=[],Mn=0,Ku=0;function Gs(){for(var e=Mn,t=Ku=Mn=0;t<e;){var a=Sa[t];Sa[t++]=null;var l=Sa[t];Sa[t++]=null;var i=Sa[t];Sa[t++]=null;var c=Sa[t];if(Sa[t++]=null,l!==null&&i!==null){var d=l.pending;d===null?i.next=i:(i.next=d.next,d.next=i),l.pending=i}c!==0&&Hf(a,i,c)}}function Vs(e,t,a,l){Sa[Mn++]=e,Sa[Mn++]=t,Sa[Mn++]=a,Sa[Mn++]=l,Ku|=l,e.lanes|=l,e=e.alternate,e!==null&&(e.lanes|=l)}function Ju(e,t,a,l){return Vs(e,t,a,l),Xs(e)}function an(e,t){return Vs(e,null,null,t),Xs(e)}function Hf(e,t,a){e.lanes|=a;var l=e.alternate;l!==null&&(l.lanes|=a);for(var i=!1,c=e.return;c!==null;)c.childLanes|=a,l=c.alternate,l!==null&&(l.childLanes|=a),c.tag===22&&(e=c.stateNode,e===null||e._visibility&1||(i=!0)),e=c,c=c.return;return e.tag===3?(c=e.stateNode,i&&t!==null&&(i=31-oa(a),e=c.hiddenUpdates,l=e[i],l===null?e[i]=[t]:l.push(t),t.lane=a|536870912),c):null}function Xs(e){if(50<es)throw es=0,zc=null,Error(r(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Un={};function zb(e,t,a,l){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=l,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ea(e,t,a,l){return new zb(e,t,a,l)}function Iu(e){return e=e.prototype,!(!e||!e.isReactComponent)}function sl(e,t){var a=e.alternate;return a===null?(a=ea(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&1206910976,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 Lf(e,t){e.flags&=1206910978;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 Qs(e,t,a,l,i,c){var d=0;if(l=e,typeof l=="function")Iu(l)&&(d=1);else if(typeof l=="string")d=u0(e,a,nt.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(l){case ct:return e=ea(31,a,t,i),e.elementType=ct,e.lanes=c,e;case Ne:return ln(a.children,i,c,t);case Ye:d=8,i|=24;break;case mt:return e=ea(12,a,t,i|2),e.elementType=mt,e.lanes=c,e;case ee:return e=ea(13,a,t,i),e.elementType=ee,e.lanes=c,e;case ie:return e=ea(19,a,t,i),e.elementType=ie,e.lanes=c,e;case ut:case N:return e=i|32,e=ea(30,a,t,e),e.elementType=N,e.lanes=c,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof l=="object"&&l!==null)switch(l.$$typeof){case Qe:d=10;break e;case bt:d=9;break e;case V:d=11;break e;case _e:d=14;break e;case Te:d=16,l=null;break e}d=29,a=Error(r(130,e===null?"null":typeof e,"")),l=null}return t=ea(d,a,t,i),t.elementType=e,t.type=l,t.lanes=c,t}function ln(e,t,a,l){return e=ea(7,e,l,t),e.lanes=a,e}function Fu(e,t,a){return e=ea(6,e,null,t),e.lanes=a,e}function Yf(e){var t=ea(18,null,null,0);return t.stateNode=e,t}function Wu(e,t,a){return t=ea(4,e.children!==null?e.children:[],e.key,t),t.lanes=a,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Gf=new WeakMap;function _a(e,t){if(typeof e=="object"&&e!==null){var a=Gf.get(e);return a!==void 0?a:(t={value:e,source:t,stack:Ud(t)},Gf.set(e,t),t)}return{value:e,source:t,stack:Ud(t)}}var $n=[],Bn=0,Zs=null,Di=0,ka=[],Na=0,Sl=null,Ga=1,Va="";function cl(e,t){$n[Bn++]=Di,$n[Bn++]=Zs,Zs=e,Di=t}function Vf(e,t,a){ka[Na++]=Ga,ka[Na++]=Va,ka[Na++]=Sl,Sl=e;var l=Ga;e=Va;var i=32-oa(l)-1;l&=~(1<<i),a+=1;var c=32-oa(t)+i;if(30<c){var d=i-i%5;c=(l&(1<<d)-1).toString(32),l>>=d,i-=d,Ga=1<<32-oa(t)+i|a<<i|l,Va=c+e}else Ga=1<<c|a<<i|l,Va=e}function Ks(e){e.return!==null&&(cl(e,1),Vf(e,1,0))}function Pu(e){for(;e===Zs;)Zs=$n[--Bn],$n[Bn]=null,Di=$n[--Bn],$n[Bn]=null;for(;e===Sl;)Sl=ka[--Na],ka[Na]=null,Va=ka[--Na],ka[Na]=null,Ga=ka[--Na],ka[Na]=null}function Xf(e,t){ka[Na++]=Ga,ka[Na++]=Va,ka[Na++]=Sl,Ga=t.id,Va=t.overflow,Sl=e}var Ot=null,it=null,Ee=!1,_l=null,Ta=!1,er=Error(r(519));function kl(e){var t=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw zi(_a(t,e)),er}function Qf(e){var t=e.stateNode,a=e.type,l=e.memoizedProps;switch(t[Mt]=e,t[Pt]=l,a){case"dialog":we("cancel",t),we("close",t);break;case"iframe":case"object":case"embed":we("load",t);break;case"video":case"audio":for(a=0;a<as.length;a++)we(as[a],t);break;case"source":we("error",t);break;case"img":case"image":case"link":we("error",t),we("load",t);break;case"details":we("toggle",t);break;case"input":we("invalid",t),lf(t,l.value,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name,!0);break;case"select":we("invalid",t);break;case"textarea":we("invalid",t),sf(t,l.value,l.defaultValue,l.children)}a=l.children,typeof a!="string"&&typeof a!="number"&&typeof a!="bigint"||t.textContent===""+a||l.suppressHydrationWarning===!0||hv(t.textContent,a)?(l.popover!=null&&(we("beforetoggle",t),we("toggle",t)),l.onScroll!=null&&we("scroll",t),l.onScrollEnd!=null&&we("scrollend",t),l.onClick!=null&&(t.onclick=Ya),t=!0):t=!1,t||kl(e,!0)}function Js(e){for(Ot=e.return;Ot;)switch(Ot.tag){case 5:case 31:case 13:Ta=!1;return;case 27:case 3:Ta=!0;return;default:Ot=Ot.return}}function qn(e){if(e!==Ot)return!1;if(!Ee)return Js(e),Ee=!0,!1;var t=e.tag,a;if((a=t!==3&&t!==27)&&((a=t===5)&&(a=e.type,a=!(a!=="form"&&a!=="button")||Oo(e.type,e.memoizedProps)),a=!a),a&&it&&kl(e),Js(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));it=Rv(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(317));it=Rv(e)}else t===27?(t=it,Hl(e.type)?(e=Ho,Ho=null,it=e):it=t):it=Ot?Aa(e.stateNode.nextSibling):null;return!0}function nn(){it=Ot=null,Ee=!1}function tr(){var e=_l;return e!==null&&(la===null?la=e:la.push.apply(la,e),_l=null),e}function zi(e){_l===null?_l=[e]:_l.push(e)}var ar=at(null),sn=null,ul=null;function Nl(e,t,a){he(ar,t._currentValue),t._currentValue=a}function rl(e){e._currentValue=ar.current,$e(ar)}function Is(e,t,a){for(;e!==null;){var l=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,l!==null&&(l.childLanes|=t)):l!==null&&(l.childLanes&t)!==t&&(l.childLanes|=t),e===a)break;e=e.return}}function lr(e,t,a,l){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var c=i.dependencies;if(c!==null){var d=i.child;c=c.firstContext;e:for(;c!==null;){var b=c;c=i;for(var _=0;_<t.length;_++)if(b.context===t[_]){c.lanes|=a,b=c.alternate,b!==null&&(b.lanes|=a),Is(c.return,a,e),l||(d=null);break e}c=b.next}}else if(i.tag===18){if(d=i.return,d===null)throw Error(r(341));d.lanes|=a,c=d.alternate,c!==null&&(c.lanes|=a),Is(d,a,e),d=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=a,d=i.alternate,d!==null&&(d.lanes|=a),Is(i.return,a,e),d=i.child,d=d!==null?d.sibling:null):d=i.child;if(d!==null)d.return=i;else for(d=i;d!==null;){if(d===e){d=null;break}if(i=d.sibling,i!==null){i.return=d.return,d=i;break}d=d.return}i=d}}function cn(e,t,a,l){e=null;for(var i=t,c=!1;i!==null;){if(!c){if((i.flags&524288)!==0)c=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var d=i.alternate;if(d===null)throw Error(r(387));if(d=d.memoizedProps,d!==null){var b=i.type;fa(i.pendingProps.value,d.value)||(e!==null?e.push(b):e=[b])}}else if(i===vt.current){if(d=i.alternate,d===null)throw Error(r(387));d.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(oi):e=[oi])}i=i.return}return e!==null&&lr(t,e,a,l),t.flags|=262144,e!==null}function Fs(e){for(e=e.firstContext;e!==null;){if(!fa(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function un(e){sn=e,ul=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function Ut(e){return Zf(sn,e)}function Ws(e,t){return sn===null&&un(e),Zf(e,t)}function Zf(e,t){var a=t._currentValue;if(t={context:t,memoizedValue:a,next:null},ul===null){if(e===null)throw Error(r(308));ul=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ul=ul.next=t;return a}var Mb=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(a,l){e.push(l)}};this.abort=function(){t.aborted=!0,e.forEach(function(a){return a()})}},Ub=n.unstable_scheduleCallback,$b=n.unstable_NormalPriority,xt={$$typeof:Qe,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function nr(){return{controller:new Mb,data:new Map,refCount:0}}function Mi(e){e.refCount--,e.refCount===0&&Ub($b,function(){e.controller.abort()})}function Kf(e,t){if((e.pendingLanes&4194048)!==0){var a=e.transitionTypes;for(a===null&&(a=e.transitionTypes=[]),e=0;e<t.length;e++){var l=t[e];a.indexOf(l)===-1&&a.push(l)}}}var Ui=null;function Bb(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var $i=null,ir=0,rn=0,Hn=null;function qb(e,t){if($i===null){var a=$i=[];ir=0,rn=So(),Hn={status:"pending",value:void 0,then:function(l){a.push(l)}}}return ir++,t.then(Jf,Jf),t}function Jf(){if(--ir===0&&(Ui=null,$i!==null)){Hn!==null&&(Hn.status="fulfilled");var e=$i;$i=null,rn=0,Hn=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function Hb(e,t){var a=[],l={status:"pending",value:null,reason:null,then:function(i){a.push(i)}};return e.then(function(){l.status="fulfilled",l.value=t;for(var i=0;i<a.length;i++)(0,a[i])(t)},function(i){for(l.status="rejected",l.reason=i,i=0;i<a.length;i++)(0,a[i])(void 0)}),l}var If=ne.S;ne.S=function(e,t){if(Ym=ua(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&qb(e,t),Ui!==null)for(var a=ni;a!==null;)Kf(a,Ui),a=a.next;if(a=e.types,a!==null){for(var l=ni;l!==null;)Kf(l,a),l=l.next;if(rn!==0){l=Ui,l===null&&(l=Ui=[]);for(var i=0;i<a.length;i++){var c=a[i];l.indexOf(c)===-1&&l.push(c)}}}If!==null&&If(e,t)};var on=at(null);function sr(){var e=on.current;return e!==null?e:lt.pooledCache}function Ps(e,t){t===null?he(on,on.current):he(on,t.pool)}function Ff(){var e=sr();return e===null?null:{parent:xt._currentValue,pool:e}}var Ln=Error(r(460)),cr=Error(r(474)),ec=Error(r(542)),tc={then:function(){}};function Wf(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Pf(e,t,a){switch(a=e[a],a===void 0?e.push(t):a!==t&&(t.then(Ya,Ya),t=a),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,th(e),e===void 0&&!("reason"in t)?Error(r(600)):e;default:if(typeof t.status=="string")t.then(Ya,Ya);else{if(e=lt,e!==null&&100<e.shellSuspendCounter)throw Error(r(482));e=t,e.status="pending",e.then(function(l){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=l}},function(l){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=l}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,th(e),e}throw fn=t,Ln}}function dn(e){try{var t=e._init;return t(e._payload)}catch(a){throw a!==null&&typeof a=="object"&&typeof a.then=="function"?(fn=a,Ln):a}}var fn=null;function eh(){if(fn===null)throw Error(r(459));var e=fn;return fn=null,e}function th(e){if(e===Ln||e===ec)throw Error(r(483))}var Yn=null,Bi=0;function ac(e){var t=Bi;return Bi+=1,Yn===null&&(Yn=[]),Pf(Yn,e,t)}function Tl(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function lc(e,t){throw t.$$typeof===q?Error(r(525)):(e=Object.prototype.toString.call(t),Error(r(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function ah(e){function t(O,k){if(e){var z=O.deletions;z===null?(O.deletions=[k],O.flags|=16):z.push(k)}}function a(O,k){if(!e)return null;for(;k!==null;)t(O,k),k=k.sibling;return null}function l(O){for(var k=new Map;O!==null;)O.key===null?k.set(O.index,O):k.set(O.key,O),O=O.sibling;return k}function i(O,k){return O=sl(O,k),O.index=0,O.sibling=null,O}function c(O,k,z){return O.index=z,e?(z=O.alternate,z!==null?(z=z.index,z<k?(O.flags|=2,k):z):(O.flags|=134217730,k)):(O.flags|=1048576,k)}function d(O){return e&&O.alternate===null&&(O.flags|=134217730),O}function b(O,k,z,L){return k===null||k.tag!==6?(k=Fu(z,O.mode,L),k.return=O,k):(k=i(k,z),k.return=O,k)}function _(O,k,z,L){var le=z.type;return le===Ne?(O=U(O,k,z.props.children,L,z.key),Tl(O,z),O):k!==null&&(k.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Te&&dn(le)===k.type)?(k=i(k,z.props),Tl(k,z),k.return=O,k):(k=Qs(z.type,z.key,z.props,null,O.mode,L),Tl(k,z),k.return=O,k)}function R(O,k,z,L){return k===null||k.tag!==4||k.stateNode.containerInfo!==z.containerInfo||k.stateNode.implementation!==z.implementation?(k=Wu(z,O.mode,L),k.return=O,k):(k=i(k,z.children||[]),k.return=O,k)}function U(O,k,z,L,le){return k===null||k.tag!==7?(k=ln(z,O.mode,L,le),k.return=O,k):(k=i(k,z),k.return=O,k)}function Y(O,k,z){if(typeof k=="string"&&k!==""||typeof k=="number"||typeof k=="bigint")return k=Fu(""+k,O.mode,z),k.return=O,k;if(typeof k=="object"&&k!==null){switch(k.$$typeof){case de:return z=Qs(k.type,k.key,k.props,null,O.mode,z),Tl(z,k),z.return=O,z;case I:return k=Wu(k,O.mode,z),k.return=O,k;case Te:return k=dn(k),Y(O,k,z)}if(Ae(k)||J(k))return k=ln(k,O.mode,z,null),k.return=O,k;if(typeof k.then=="function")return Y(O,ac(k),z);if(k.$$typeof===Qe)return Y(O,Ws(O,k),z);lc(O,k)}return null}function A(O,k,z,L){var le=k!==null?k.key:null;if(typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint")return le!==null?null:b(O,k,""+z,L);if(typeof z=="object"&&z!==null){switch(z.$$typeof){case de:return z.key===le?_(O,k,z,L):null;case I:return z.key===le?R(O,k,z,L):null;case Te:return z=dn(z),A(O,k,z,L)}if(Ae(z)||J(z))return le!==null?null:U(O,k,z,L,null);if(typeof z.then=="function")return A(O,k,ac(z),L);if(z.$$typeof===Qe)return A(O,k,Ws(O,z),L);lc(O,z)}return null}function M(O,k,z,L,le){if(typeof L=="string"&&L!==""||typeof L=="number"||typeof L=="bigint")return O=O.get(z)||null,b(k,O,""+L,le);if(typeof L=="object"&&L!==null){switch(L.$$typeof){case de:return O=O.get(L.key===null?z:L.key)||null,_(k,O,L,le);case I:return O=O.get(L.key===null?z:L.key)||null,R(k,O,L,le);case Te:return L=dn(L),M(O,k,z,L,le)}if(Ae(L)||J(L))return O=O.get(z)||null,U(k,O,L,le,null);if(typeof L.then=="function")return M(O,k,z,ac(L),le);if(L.$$typeof===Qe)return M(O,k,z,Ws(k,L),le);lc(k,L)}return null}function F(O,k,z,L){for(var le=null,De=null,fe=k,ve=k=0,_t=null;fe!==null&&ve<z.length;ve++){fe.index>ve?(_t=fe,fe=null):_t=fe.sibling;var Be=A(O,fe,z[ve],L);if(Be===null){fe===null&&(fe=_t);break}e&&fe&&Be.alternate===null&&t(O,fe),k=c(Be,k,ve),De===null?le=Be:De.sibling=Be,De=Be,fe=_t}if(ve===z.length)return a(O,fe),Ee&&cl(O,ve),le;if(fe===null){for(;ve<z.length;ve++)fe=Y(O,z[ve],L),fe!==null&&(k=c(fe,k,ve),De===null?le=fe:De.sibling=fe,De=fe);return Ee&&cl(O,ve),le}for(fe=l(fe);ve<z.length;ve++)_t=M(fe,O,ve,z[ve],L),_t!==null&&(e&&(Be=_t.alternate,Be!==null&&fe.delete(Be.key===null?ve:Be.key)),k=c(_t,k,ve),De===null?le=_t:De.sibling=_t,De=_t);return e&&fe.forEach(function(Xl){return t(O,Xl)}),Ee&&cl(O,ve),le}function ce(O,k,z,L){if(z==null)throw Error(r(151));for(var le=null,De=null,fe=k,ve=k=0,_t=null,Be=z.next();fe!==null&&!Be.done;ve++,Be=z.next()){fe.index>ve?(_t=fe,fe=null):_t=fe.sibling;var Xl=A(O,fe,Be.value,L);if(Xl===null){fe===null&&(fe=_t);break}e&&fe&&Xl.alternate===null&&t(O,fe),k=c(Xl,k,ve),De===null?le=Xl:De.sibling=Xl,De=Xl,fe=_t}if(Be.done)return a(O,fe),Ee&&cl(O,ve),le;if(fe===null){for(;!Be.done;ve++,Be=z.next())Be=Y(O,Be.value,L),Be!==null&&(k=c(Be,k,ve),De===null?le=Be:De.sibling=Be,De=Be);return Ee&&cl(O,ve),le}for(fe=l(fe);!Be.done;ve++,Be=z.next())Be=M(fe,O,ve,Be.value,L),Be!==null&&(e&&(_t=Be.alternate,_t!==null&&fe.delete(_t.key===null?ve:_t.key)),k=c(Be,k,ve),De===null?le=Be:De.sibling=Be,De=Be);return e&&fe.forEach(function(x0){return t(O,x0)}),Ee&&cl(O,ve),le}function Se(O,k,z,L){if(typeof z=="object"&&z!==null&&z.type===Ne&&z.key===null&&z.props.ref===void 0&&(z=z.props.children),typeof z=="object"&&z!==null){switch(z.$$typeof){case de:e:{for(var le=z.key;k!==null;){if(k.key===le){if(le=z.type,le===Ne){if(k.tag===7){a(O,k.sibling),L=i(k,z.props.children),Tl(L,z),L.return=O,O=L;break e}}else if(k.elementType===le||typeof le=="object"&&le!==null&&le.$$typeof===Te&&dn(le)===k.type){a(O,k.sibling),L=i(k,z.props),Tl(L,z),L.return=O,O=L;break e}a(O,k);break}else t(O,k);k=k.sibling}z.type===Ne?(L=ln(z.props.children,O.mode,L,z.key),Tl(L,z),L.return=O,O=L):(L=Qs(z.type,z.key,z.props,null,O.mode,L),Tl(L,z),L.return=O,O=L)}return d(O);case I:e:{for(le=z.key;k!==null;){if(k.key===le)if(k.tag===4&&k.stateNode.containerInfo===z.containerInfo&&k.stateNode.implementation===z.implementation){a(O,k.sibling),L=i(k,z.children||[]),L.return=O,O=L;break e}else{a(O,k);break}else t(O,k);k=k.sibling}L=Wu(z,O.mode,L),L.return=O,O=L}return d(O);case Te:return z=dn(z),Se(O,k,z,L)}if(Ae(z))return F(O,k,z,L);if(J(z)){if(le=J(z),typeof le!="function")throw Error(r(150));return z=le.call(z),ce(O,k,z,L)}if(typeof z.then=="function")return Se(O,k,ac(z),L);if(z.$$typeof===Qe)return Se(O,k,Ws(O,z),L);lc(O,z)}return typeof z=="string"&&z!==""||typeof z=="number"||typeof z=="bigint"?(z=""+z,k!==null&&k.tag===6?(a(O,k.sibling),L=i(k,z),L.return=O,O=L):(a(O,k),L=Fu(z,O.mode,L),L.return=O,O=L),d(O)):a(O,k)}return function(O,k,z,L){try{Bi=0;var le=Se(O,k,z,L);return Yn=null,le}catch(fe){if(fe===Ln||fe===ec)throw fe;var De=ea(29,fe,null,O.mode);return De.lanes=L,De.return=O,De}}}var hn=ah(!0),lh=ah(!1),El=!1;function ur(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 Al(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Cl(e,t,a){var l=e.updateQueue;if(l===null)return null;if(l=l.shared,(Xe&2)!==0){var i=l.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),l.pending=t,t=Xs(e),Hf(e,null,a),t}return Vs(e,l,t,a),Xs(e)}function qi(e,t,a){if(t=t.updateQueue,t!==null&&(t=t.shared,(a&4194048)!==0)){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Gd(e,a)}}function or(e,t){var a=e.updateQueue,l=e.alternate;if(l!==null&&(l=l.updateQueue,a===l)){var i=null,c=null;if(a=a.firstBaseUpdate,a!==null){do{var d={lane:a.lane,tag:a.tag,payload:a.payload,callback:null,next:null};c===null?i=c=d:c=c.next=d,a=a.next}while(a!==null);c===null?i=c=t:c=c.next=t}else i=c=t;a={baseState:l.baseState,firstBaseUpdate:i,lastBaseUpdate:c,shared:l.shared,callbacks:l.callbacks},e.updateQueue=a;return}e=a.lastBaseUpdate,e===null?a.firstBaseUpdate=t:e.next=t,a.lastBaseUpdate=t}var dr=!1;function Hi(){if(dr){var e=Hn;if(e!==null)throw e}}function Li(e,t,a,l){dr=!1;var i=e.updateQueue;El=!1;var c=i.firstBaseUpdate,d=i.lastBaseUpdate,b=i.shared.pending;if(b!==null){i.shared.pending=null;var _=b,R=_.next;_.next=null,d===null?c=R:d.next=R,d=_;var U=e.alternate;U!==null&&(U=U.updateQueue,b=U.lastBaseUpdate,b!==d&&(b===null?U.firstBaseUpdate=R:b.next=R,U.lastBaseUpdate=_))}if(c!==null){var Y=i.baseState;d=0,U=R=_=null,b=c;do{var A=b.lane&-536870913,M=A!==b.lane;if(M?(Re&A)===A:(l&A)===A){A!==0&&A===rn&&(dr=!0),U!==null&&(U=U.next={lane:0,tag:b.tag,payload:b.payload,callback:null,next:null});e:{var F=e,ce=b;A=t;var Se=a;switch(ce.tag){case 1:if(F=ce.payload,typeof F=="function"){Y=F.call(Se,Y,A);break e}Y=F;break e;case 3:F.flags=F.flags&-65537|128;case 0:if(F=ce.payload,A=typeof F=="function"?F.call(Se,Y,A):F,A==null)break e;Y=P({},Y,A);break e;case 2:El=!0}}A=b.callback,A!==null&&(e.flags|=64,M&&(e.flags|=8192),M=i.callbacks,M===null?i.callbacks=[A]:M.push(A))}else M={lane:A,tag:b.tag,payload:b.payload,callback:b.callback,next:null},U===null?(R=U=M,_=Y):U=U.next=M,d|=A;if(b=b.next,b===null){if(b=i.shared.pending,b===null)break;M=b,b=M.next,M.next=null,i.lastBaseUpdate=M,i.shared.pending=null}}while(!0);U===null&&(_=Y),i.baseState=_,i.firstBaseUpdate=R,i.lastBaseUpdate=U,c===null&&(i.shared.lanes=0),Ul|=d,e.lanes=d,e.memoizedState=Y}}function nh(e,t){if(typeof e!="function")throw Error(r(191,e));e.call(t)}function ih(e,t){var a=e.callbacks;if(a!==null)for(e.callbacks=null,e=0;e<a.length;e++)nh(a[e],t)}var wl=at(null),nc=at(0);function sh(e,t){e=ml,he(nc,e),he(wl,t),ml=e|t.baseLanes}function fr(){he(nc,ml),he(wl,wl.current)}function hr(){ml=nc.current,$e(wl),$e(nc)}var $t=at(null),Vt=null;function Ol(e){var t=e.alternate;he(Bt,Bt.current&1),he($t,e),Vt===null&&(t===null||wl.current!==null||t.memoizedState!==null)&&(Vt=e)}function mr(e){he(Bt,Bt.current),he($t,e),Vt===null&&(Vt=e)}function ch(e){e.tag===22?(he(Bt,Bt.current),he($t,e),Vt===null&&(Vt=e)):Rl()}function Rl(){he(Bt,Bt.current),he($t,$t.current)}function ha(e){$e($t),Vt===e&&(Vt=null),$e(Bt)}var Bt=at(0);function Yi(e,t){he($t,$t.current),he(Bt,t)}function vr(e){$e(Bt),$e($t),Vt===e&&(Vt=null)}function ic(e){for(var t=e;t!==null;){if(t.tag===13){var a=t.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||Bo(a)||qo(a)))return t}else if(t.tag===19&&t.memoizedProps.revealOrder!=="independent"){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 ol=0,je=null,et=null,jt=null,sc=!1,Gn=!1,mn=!1,cc=0,Gi=0,Vn=null,Lb=0;function ft(){throw Error(r(321))}function yr(e,t){if(t===null)return!1;for(var a=0;a<t.length&&a<e.length;a++)if(!fa(e[a],t[a]))return!1;return!0}function gr(e,t,a,l,i,c){return ol=c,je=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,ne.H=e===null||e.memoizedState===null?Vh:Xh,mn=!1,c=a(l,i),mn=!1,Gn&&(c=rh(t,a,l,i)),uh(e),c}function uh(e){ne.H=mc;var t=et!==null&&et.next!==null;if(ol=0,jt=et=je=null,sc=!1,Gi=0,Vn=null,t)throw Error(r(300));e===null||St||(e=e.dependencies,e!==null&&Fs(e)&&(St=!0))}function rh(e,t,a,l){je=e;var i=0;do{if(Gn&&(Vn=null),Gi=0,Gn=!1,25<=i)throw Error(r(301));if(i+=1,jt=et=null,e.updateQueue!=null){var c=e.updateQueue;c.lastEffect=null,c.events=null,c.stores=null,c.memoCache!=null&&(c.memoCache.index=0)}ne.H=Jb,c=t(a,l)}while(Gn);return c}function Yb(){var e=ne.H,t=e.useState()[0];return t=typeof t.then=="function"?Vi(t):t,e=e.useState()[0],(et!==null?et.memoizedState:null)!==e&&(je.flags|=1024),t}function br(){var e=cc!==0;return cc=0,e}function pr(e,t,a){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~a}function xr(e){if(sc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}sc=!1}ol=0,jt=et=je=null,Gn=!1,Gi=cc=0,Vn=null}function Zt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return jt===null?je.memoizedState=jt=e:jt=jt.next=e,jt}function yt(){if(et===null){var e=je.alternate;e=e!==null?e.memoizedState:null}else e=et.next;var t=jt===null?je.memoizedState:jt.next;if(t!==null)jt=t,et=e;else{if(e===null)throw je.alternate===null?Error(r(467)):Error(r(310));et=e,e={memoizedState:et.memoizedState,baseState:et.baseState,baseQueue:et.baseQueue,queue:et.queue,next:null},jt===null?je.memoizedState=jt=e:jt=jt.next=e}return jt}function uc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Vi(e){var t=Gi;return Gi+=1,Vn===null&&(Vn=[]),e=Pf(Vn,e,t),t=je,(jt===null?t.memoizedState:jt.next)===null&&(t=t.alternate,ne.H=t===null||t.memoizedState===null?Vh:Xh),e}function rc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return Vi(e);if(e.$$typeof===X)return;if(e.$$typeof===Qe)return Ut(e)}throw Error(r(438,String(e)))}function jr(e){var t=null,a=je.updateQueue;if(a!==null&&(t=a.memoCache),t==null){var l=je.alternate;l!==null&&(l=l.updateQueue,l!==null&&(l=l.memoCache,l!=null&&(t={data:l.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),a===null&&(a=uc(),je.updateQueue=a),a.memoCache=t,a=t.data[t.index],a===void 0)for(a=t.data[t.index]=Array(e),l=0;l<e;l++)a[l]=Oa;return t.index++,a}function dl(e,t){return typeof t=="function"?t(e):t}function oc(e){var t=yt();return Sr(t,et,e)}function Sr(e,t,a){var l=e.queue;if(l===null)throw Error(r(311));l.lastRenderedReducer=a;var i=e.baseQueue,c=l.pending;if(c!==null){if(i!==null){var d=i.next;i.next=c.next,c.next=d}t.baseQueue=i=c,l.pending=null}if(c=e.baseState,i===null)e.memoizedState=c;else{t=i.next;var b=d=null,_=null,R=t,U=!1;do{var Y=R.lane&-536870913;if(Y!==R.lane?(Re&Y)===Y:(ol&Y)===Y){var A=R.revertLane;if(A===0)_!==null&&(_=_.next={lane:0,revertLane:0,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null}),Y===rn&&(U=!0);else if((ol&A)===A){R=R.next,A===rn&&(U=!0);continue}else Y={lane:0,revertLane:R.revertLane,gesture:null,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},_===null?(b=_=Y,d=c):_=_.next=Y,je.lanes|=A,Ul|=A;Y=R.action,mn&&a(c,Y),c=R.hasEagerState?R.eagerState:a(c,Y)}else A={lane:Y,revertLane:R.revertLane,gesture:R.gesture,action:R.action,hasEagerState:R.hasEagerState,eagerState:R.eagerState,next:null},_===null?(b=_=A,d=c):_=_.next=A,je.lanes|=Y,Ul|=Y;R=R.next}while(R!==null&&R!==t);if(_===null?d=c:_.next=b,!fa(c,e.memoizedState)&&(St=!0,U&&(a=Hn,a!==null)))throw a;e.memoizedState=c,e.baseState=d,e.baseQueue=_,l.lastRenderedState=c}return i===null&&(l.lanes=0),[e.memoizedState,l.dispatch]}function _r(e){var t=yt(),a=t.queue;if(a===null)throw Error(r(311));a.lastRenderedReducer=e;var l=a.dispatch,i=a.pending,c=t.memoizedState;if(i!==null){a.pending=null;var d=i=i.next;do c=e(c,d.action),d=d.next;while(d!==i);fa(c,t.memoizedState)||(St=!0),t.memoizedState=c,t.baseQueue===null&&(t.baseState=c),a.lastRenderedState=c}return[c,l]}function oh(e,t,a){var l=je,i=yt(),c=Ee;if(c){if(a===void 0)throw Error(r(407));a=a()}else a=t();var d=!fa((et||i).memoizedState,a);if(d&&(i.memoizedState=a,St=!0),i=i.queue,Tr(hh.bind(null,l,i,e),[e]),e=i.getSnapshot!==t||d||jt!==null&&(jt.memoizedState.tag&1)!==0,Xn(e?9:8,{destroy:void 0},fh.bind(null,l,i,a,t),null),e){if(l.flags|=2048,lt===null)throw Error(r(349));c||(ol&127)!==0||dh(l,t,a)}return a}function dh(e,t,a){e.flags|=16384,e={getSnapshot:t,value:a},t=je.updateQueue,t===null?(t=uc(),je.updateQueue=t,t.stores=[e]):(a=t.stores,a===null?t.stores=[e]:a.push(e))}function fh(e,t,a,l){t.value=a,t.getSnapshot=l,mh(t)&&vh(e)}function hh(e,t,a){return a(function(){mh(t)&&vh(e)})}function mh(e){var t=e.getSnapshot;e=e.value;try{var a=t();return!fa(e,a)}catch{return!0}}function vh(e){var t=an(e,2);t!==null&&na(t,e,2)}function kr(e){var t=Zt();if(typeof e=="function"){var a=e;if(e=a(),mn){pl(!0);try{a()}finally{pl(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:dl,lastRenderedState:e},t}function yh(e,t,a,l){return e.baseState=a,Sr(e,et,typeof l=="function"?l:dl)}function Gb(e,t,a,l,i){if(hc(e))throw Error(r(485));if(e=t.action,e!==null){var c={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(d){c.listeners.push(d)}};ne.T!==null?a(!0):c.isTransition=!1,l(c),a=t.pending,a===null?(c.next=t.pending=c,gh(t,c)):(c.next=a.next,t.pending=a.next=c)}}function gh(e,t){var a=t.action,l=t.payload,i=e.state;if(t.isTransition){var c=ne.T,d={};d.types=c!==null?c.types:null,ne.T=d;try{var b=a(i,l),_=ne.S;_!==null&&_(d,b),bh(e,t,b)}catch(R){Nr(e,t,R)}finally{c!==null&&d.types!==null&&(c.types=d.types),ne.T=c}}else try{c=a(i,l),bh(e,t,c)}catch(R){Nr(e,t,R)}}function bh(e,t,a){a!==null&&typeof a=="object"&&typeof a.then=="function"?a.then(function(l){ph(e,t,l)},function(l){return Nr(e,t,l)}):ph(e,t,a)}function ph(e,t,a){t.status="fulfilled",t.value=a,xh(t),e.state=a,t=e.pending,t!==null&&(a=t.next,a===t?e.pending=null:(a=a.next,t.next=a,gh(e,a)))}function Nr(e,t,a){var l=e.pending;if(e.pending=null,l!==null){l=l.next;do t.status="rejected",t.reason=a,xh(t),t=t.next;while(t!==l)}e.action=null}function xh(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function jh(e,t){return t}function Sh(e,t){if(Ee){var a=lt.formState;if(a!==null){e:{var l=je;if(Ee){if(it){t:{for(var i=it,c=Ta;i.nodeType!==8;){if(!c){i=null;break t}if(i=Aa(i.nextSibling),i===null){i=null;break t}}c=i.data,i=c==="F!"||c==="F"?i:null}if(i){it=Aa(i.nextSibling),l=i.data==="F!";break e}}kl(l)}l=!1}l&&(t=a[0])}}return a=Zt(),a.memoizedState=a.baseState=t,l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:jh,lastRenderedState:t},a.queue=l,a=Lh.bind(null,je,l),l.dispatch=a,l=kr(!1),c=Or.bind(null,je,!1,l.queue),l=Zt(),i={state:t,dispatch:null,action:e,pending:null},l.queue=i,a=Gb.bind(null,je,i,c,a),i.dispatch=a,l.memoizedState=e,[t,a,!1]}function _h(e){var t=yt();return kh(t,et,e)}function kh(e,t,a){if(t=Sr(e,t,jh)[0],e=oc(dl)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var l=Vi(t)}catch(d){throw d===Ln?ec:d}else l=t;t=yt();var i=t.queue,c=i.dispatch;return a!==t.memoizedState&&(je.flags|=2048,Xn(9,{destroy:void 0},Vb.bind(null,i,a),null)),[l,c,e]}function Vb(e,t){e.action=t}function Nh(e){var t=yt(),a=et;if(a!==null)return kh(t,a,e);yt(),t=t.memoizedState,a=yt();var l=a.queue.dispatch;return a.memoizedState=e,[t,l,!1]}function Xn(e,t,a,l){return e={tag:e,create:a,deps:l,inst:t,next:null},t=je.updateQueue,t===null&&(t=uc(),je.updateQueue=t),a=t.lastEffect,a===null?t.lastEffect=e.next=e:(l=a.next,a.next=e,e.next=l,t.lastEffect=e),e}function Th(){return yt().memoizedState}function dc(e,t,a,l){var i=Zt();je.flags|=e,i.memoizedState=Xn(1|t,{destroy:void 0},a,l===void 0?null:l)}function fc(e,t,a,l){var i=yt();l=l===void 0?null:l;var c=i.memoizedState.inst;et!==null&&l!==null&&yr(l,et.memoizedState.deps)?i.memoizedState=Xn(t,c,a,l):(je.flags|=e,i.memoizedState=Xn(1|t,c,a,l))}function Eh(e,t){dc(8390656,8,e,t)}function Tr(e,t){fc(2048,8,e,t)}function Xb(e){je.flags|=4;var t=je.updateQueue;if(t===null)t=uc(),je.updateQueue=t,t.events=[e];else{var a=t.events;a===null?t.events=[e]:a.push(e)}}function Ah(e){var t=yt().memoizedState;return Xb({ref:t,nextImpl:e}),function(){if((Xe&2)!==0)throw Error(r(440));return t.impl.apply(void 0,arguments)}}function Ch(e,t){return fc(4,2,e,t)}function wh(e,t){return fc(4,4,e,t)}function Oh(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 Rh(e,t,a){a=a!=null?a.concat([e]):null,fc(4,4,Oh.bind(null,t,e),a)}function Er(){}function Dh(e,t){var a=yt();t=t===void 0?null:t;var l=a.memoizedState;return t!==null&&yr(t,l[1])?l[0]:(a.memoizedState=[e,t],e)}function zh(e,t){var a=yt();t=t===void 0?null:t;var l=a.memoizedState;if(t!==null&&yr(t,l[1]))return l[0];if(l=e(),mn){pl(!0);try{e()}finally{pl(!1)}}return a.memoizedState=[l,t],l}function Ar(e,t,a){return a===void 0||(ol&1073741824)!==0&&(Re&261930)===0?e.memoizedState=t:(e.memoizedState=a,e=Vm(),je.lanes|=e,Ul|=e,a)}function Mh(e,t,a,l){return fa(a,t)?a:wl.current!==null?(e=Ar(e,a,l),fa(e,t)||(St=!0),e):(ol&106)===0||(ol&1073741824)!==0&&(Re&261930)===0?(St=!0,e.memoizedState=a):(e=Vm(),je.lanes|=e,Ul|=e,t)}function Uh(e,t,a,l,i){var c=K.p;K.p=c!==0&&8>c?c:8;var d=ne.T,b={};b.types=d!==null?d.types:null,ne.T=b,Or(e,!1,t,a);try{var _=i(),R=ne.S;if(R!==null&&R(b,_),_!==null&&typeof _=="object"&&typeof _.then=="function"){var U=Hb(_,l);Xi(e,t,U,ga(e))}else Xi(e,t,l,ga(e))}catch(Y){Xi(e,t,{then:function(){},status:"rejected",reason:Y},ga())}finally{K.p=c,d!==null&&b.types!==null&&(d.types=b.types),ne.T=d}}function Qb(){}function Cr(e,t,a,l){if(e.tag!==5)throw Error(r(476));var i=$h(e).queue;Uh(e,i,t,ye,a===null?Qb:function(){return Bh(e),a(l)})}function $h(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dl,lastRenderedState:ye},next:null};var a={};return t.next={memoizedState:a,baseState:a,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:dl,lastRenderedState:a},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Bh(e){var t=$h(e);t.next===null&&(t=e.alternate.memoizedState),Xi(e,t.next.queue,{},ga())}function wr(){return Ut(oi)}function qh(){return yt().memoizedState}function Hh(){return yt().memoizedState}function Zb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var a=ga();e=Al(a);var l=Cl(t,e,a);l!==null&&(na(l,t,a),qi(l,t,a)),t={cache:nr()},e.payload=t;return}t=t.return}}function Kb(e,t,a){var l=ga();a={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null},hc(e)?Yh(t,a):(a=Ju(e,t,a,l),a!==null&&(na(a,e,l),Gh(a,t,l)))}function Lh(e,t,a){var l=ga();Xi(e,t,a,l)}function Xi(e,t,a,l){var i={lane:l,revertLane:0,gesture:null,action:a,hasEagerState:!1,eagerState:null,next:null};if(hc(e))Yh(t,i);else{var c=e.alternate;if(e.lanes===0&&(c===null||c.lanes===0)&&(c=t.lastRenderedReducer,c!==null))try{var d=t.lastRenderedState,b=c(d,a);if(i.hasEagerState=!0,i.eagerState=b,fa(b,d))return Vs(e,t,i,0),lt===null&&Gs(),!1}catch{}if(a=Ju(e,t,i,l),a!==null)return na(a,e,l),Gh(a,t,l),!0}return!1}function Or(e,t,a,l){if(l={lane:2,revertLane:So(),gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null},hc(e)){if(t)throw Error(r(479))}else t=Ju(e,a,l,2),t!==null&&na(t,e,2)}function hc(e){var t=e.alternate;return e===je||t!==null&&t===je}function Yh(e,t){Gn=sc=!0;var a=e.pending;a===null?t.next=t:(t.next=a.next,a.next=t),e.pending=t}function Gh(e,t,a){if((a&4194048)!==0){var l=t.lanes;l&=e.pendingLanes,a|=l,t.lanes=a,Gd(e,a)}}var mc={readContext:Ut,use:rc,useCallback:ft,useContext:ft,useEffect:ft,useImperativeHandle:ft,useLayoutEffect:ft,useInsertionEffect:ft,useMemo:ft,useReducer:ft,useRef:ft,useState:ft,useDebugValue:ft,useDeferredValue:ft,useTransition:ft,useSyncExternalStore:ft,useId:ft,useHostTransitionStatus:ft,useFormState:ft,useActionState:ft,useOptimistic:ft,useMemoCache:ft,useCacheRefresh:ft,useEffectEvent:ft},Vh={readContext:Ut,use:rc,useCallback:function(e,t){return Zt().memoizedState=[e,t===void 0?null:t],e},useContext:Ut,useEffect:Eh,useImperativeHandle:function(e,t,a){a=a!=null?a.concat([e]):null,dc(4194308,4,Oh.bind(null,t,e),a)},useLayoutEffect:function(e,t){return dc(4194308,4,e,t)},useInsertionEffect:function(e,t){dc(4,2,e,t)},useMemo:function(e,t){var a=Zt();t=t===void 0?null:t;var l=e();if(mn){pl(!0);try{e()}finally{pl(!1)}}return a.memoizedState=[l,t],l},useReducer:function(e,t,a){var l=Zt();if(a!==void 0){var i=a(t);if(mn){pl(!0);try{a(t)}finally{pl(!1)}}}else i=t;return l.memoizedState=l.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},l.queue=e,e=e.dispatch=Kb.bind(null,je,e),[l.memoizedState,e]},useRef:function(e){var t=Zt();return e={current:e},t.memoizedState=e},useState:function(e){e=kr(e);var t=e.queue,a=Lh.bind(null,je,t);return t.dispatch=a,[e.memoizedState,a]},useDebugValue:Er,useDeferredValue:function(e,t){var a=Zt();return Ar(a,e,t)},useTransition:function(){var e=kr(!1);return e=Uh.bind(null,je,e.queue,!0,!1),Zt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,a){var l=je,i=Zt();if(Ee){if(a===void 0)throw Error(r(407));a=a()}else{if(a=t(),lt===null)throw Error(r(349));(Re&127)!==0||dh(l,t,a)}i.memoizedState=a;var c={value:a,getSnapshot:t};return i.queue=c,Eh(hh.bind(null,l,c,e),[e]),l.flags|=2048,Xn(9,{destroy:void 0},fh.bind(null,l,c,a,t),null),a},useId:function(){var e=Zt(),t=lt.identifierPrefix;if(Ee){var a=Va,l=Ga;a=(l&~(1<<32-oa(l)-1)).toString(32)+a,t="_"+t+"R_"+a,a=cc++,0<a&&(t+="H"+a.toString(32)),t+="_"}else a=Lb++,t="_"+t+"r_"+a.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:wr,useFormState:Sh,useActionState:Sh,useOptimistic:function(e){var t=Zt();t.memoizedState=t.baseState=e;var a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=a,t=Or.bind(null,je,!0,a),a.dispatch=t,[e,t]},useMemoCache:jr,useCacheRefresh:function(){return Zt().memoizedState=Zb.bind(null,je)},useEffectEvent:function(e){var t=Zt(),a={impl:e};return t.memoizedState=a,function(){if((Xe&2)!==0)throw Error(r(440));return a.impl.apply(void 0,arguments)}}},Xh={readContext:Ut,use:rc,useCallback:Dh,useContext:Ut,useEffect:Tr,useImperativeHandle:Rh,useInsertionEffect:Ch,useLayoutEffect:wh,useMemo:zh,useReducer:oc,useRef:Th,useState:function(){return oc(dl)},useDebugValue:Er,useDeferredValue:function(e,t){var a=yt();return Mh(a,et.memoizedState,e,t)},useTransition:function(){var e=oc(dl)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Vi(e),t]},useSyncExternalStore:oh,useId:qh,useHostTransitionStatus:wr,useFormState:_h,useActionState:_h,useOptimistic:function(e,t){var a=yt();return yh(a,et,e,t)},useMemoCache:jr,useCacheRefresh:Hh,useEffectEvent:Ah},Jb={readContext:Ut,use:rc,useCallback:Dh,useContext:Ut,useEffect:Tr,useImperativeHandle:Rh,useInsertionEffect:Ch,useLayoutEffect:wh,useMemo:zh,useReducer:_r,useRef:Th,useState:function(){return _r(dl)},useDebugValue:Er,useDeferredValue:function(e,t){var a=yt();return et===null?Ar(a,e,t):Mh(a,et.memoizedState,e,t)},useTransition:function(){var e=_r(dl)[0],t=yt().memoizedState;return[typeof e=="boolean"?e:Vi(e),t]},useSyncExternalStore:oh,useId:qh,useHostTransitionStatus:wr,useFormState:Nh,useActionState:Nh,useOptimistic:function(e,t){var a=yt();return et!==null?yh(a,et,e,t):(a.baseState=e,[e,a.queue.dispatch])},useMemoCache:jr,useCacheRefresh:Hh,useEffectEvent:Ah};function Rr(e,t,a,l){t=e.memoizedState,a=a(l,t),a=a==null?t:P({},t,a),e.memoizedState=a,e.lanes===0&&(e.updateQueue.baseState=a)}var Dr={enqueueSetState:function(e,t,a){e=e._reactInternals;var l=ga(),i=Al(l);i.payload=t,a!=null&&(i.callback=a),t=Cl(e,i,l),t!==null&&(na(t,e,l),qi(t,e,l))},enqueueReplaceState:function(e,t,a){e=e._reactInternals;var l=ga(),i=Al(l);i.tag=1,i.payload=t,a!=null&&(i.callback=a),t=Cl(e,i,l),t!==null&&(na(t,e,l),qi(t,e,l))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var a=ga(),l=Al(a);l.tag=2,t!=null&&(l.callback=t),t=Cl(e,l,a),t!==null&&(na(t,e,a),qi(t,e,a))}};function Qh(e,t,a,l,i,c,d){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(l,c,d):t.prototype&&t.prototype.isPureReactComponent?!Oi(a,l)||!Oi(i,c):!0}function Zh(e,t,a,l){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(a,l),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(a,l),t.state!==e&&Dr.enqueueReplaceState(t,t.state,null)}function vn(e,t){var a=t;if("ref"in t){a={};for(var l in t)l!=="ref"&&(a[l]=t[l])}if(e=e.defaultProps){a===t&&(a=P({},a));for(var i in e)a[i]===void 0&&(a[i]=e[i])}return a}function Kh(e){Ys(e)}function Jh(e){console.error(e)}function Ih(e){Ys(e)}function vc(e,t){try{var a=e.onUncaughtError;a(t.value,{componentStack:t.stack})}catch(l){setTimeout(function(){throw l})}}function Fh(e,t,a){try{var l=e.onCaughtError;l(a.value,{componentStack:a.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function zr(e,t,a){return a=Al(a),a.tag=3,a.payload={element:null},a.callback=function(){vc(e,t)},a}function Wh(e){return e=Al(e),e.tag=3,e}function Ph(e,t,a,l){var i=a.type.getDerivedStateFromError;if(typeof i=="function"){var c=l.value;e.payload=function(){return i(c)},e.callback=function(){Fh(t,a,l)}}var d=a.stateNode;d!==null&&typeof d.componentDidCatch=="function"&&(e.callback=function(){Fh(t,a,l),typeof i!="function"&&($l===null?$l=new Set([this]):$l.add(this));var b=l.stack;this.componentDidCatch(l.value,{componentStack:b!==null?b:""})})}function Ib(e,t,a,l,i){if(a.flags|=32768,l!==null&&typeof l=="object"&&typeof l.then=="function"){if(t=a.alternate,t!==null&&cn(t,a,i,!0),a=$t.current,a!==null){switch(a.tag){case 31:case 13:case 19:return Vt===null?Uc():a.alternate===null&&ht===0&&(ht=3),a.flags&=-257,a.flags|=65536,a.lanes=i,l===tc?a.flags|=16384:(t=a.updateQueue,t===null?a.updateQueue=new Set([l]):t.add(l),po(e,l,i)),!1;case 22:return a.flags|=65536,l===tc?a.flags|=16384:(t=a.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([l])},a.updateQueue=t):(a=t.retryQueue,a===null?t.retryQueue=new Set([l]):a.add(l)),po(e,l,i)),!1}throw Error(r(435,a.tag))}return po(e,l,i),Uc(),!1}if(Ee)return t=$t.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,l!==er&&(e=Error(r(422),{cause:l}),zi(_a(e,a)))):(l!==er&&(t=Error(r(423),{cause:l}),zi(_a(t,a))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,l=_a(l,a),i=zr(e.stateNode,l,i),or(e,i),ht!==4&&(ht=2)),!1;var c=Error(r(520),{cause:l});if(c=_a(c,a),Pi===null?Pi=[c]:Pi.push(c),ht!==4&&(ht=2),t===null)return!0;l=_a(l,a),a=t;do{switch(a.tag){case 3:return a.flags|=65536,e=i&-i,a.lanes|=e,e=zr(a.stateNode,l,e),or(a,e),!1;case 1:if(t=a.type,c=a.stateNode,(a.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||c!==null&&typeof c.componentDidCatch=="function"&&($l===null||!$l.has(c))))return a.flags|=65536,i&=-i,a.lanes|=i,i=Wh(i),Ph(i,e,a,l),or(a,i),!1;break;case 22:if(a.memoizedState!==null)return a.flags|=65536,!1}a=a.return}while(a!==null);return!1}var Mr=Error(r(461)),St=!1;function Tt(e,t,a,l){t.child=e===null?lh(t,null,a,l):hn(t,e.child,a,l)}function em(e,t,a,l,i){a=a.render;var c=t.ref;if("ref"in l){var d={};for(var b in l)b!=="ref"&&(d[b]=l[b])}else d=l;return un(t),l=gr(e,t,a,d,c,i),b=br(),e!==null&&!St?(pr(e,t,i),fl(e,t,i)):(Ee&&b&&Ks(t),t.flags|=1,Tt(e,t,l,i),t.child)}function tm(e,t,a,l,i){if(e===null){var c=a.type;return typeof c=="function"&&!Iu(c)&&c.defaultProps===void 0&&a.compare===null?(t.tag=15,t.type=c,am(e,t,c,l,i)):(e=Qs(a.type,null,l,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(c=e.child,!Gr(e,i)){var d=c.memoizedProps;if(a=a.compare,a=a!==null?a:Oi,a(d,l)&&e.ref===t.ref)return fl(e,t,i)}return t.flags|=1,e=sl(c,l),e.ref=t.ref,e.return=t,t.child=e}function am(e,t,a,l,i){if(e!==null){var c=e.memoizedProps;if(Oi(c,l)&&e.ref===t.ref)if(St=!1,t.pendingProps=l=c,Gr(e,i))(e.flags&131072)!==0&&(St=!0);else return t.lanes=e.lanes,fl(e,t,i)}return Ur(e,t,a,l,i)}function lm(e,t,a,l){var i=l.children,c=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),l.mode==="hidden"){if((t.flags&128)!==0){if(c=c!==null?c.baseLanes|a:a,e!==null){for(l=t.child=e.child,i=0;l!==null;)i=i|l.lanes|l.childLanes,l=l.sibling;l=i&~c}else l=0,t.child=null;return nm(e,t,c,a,l)}if((a&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Ps(t,c!==null?c.cachePool:null),c!==null?sh(t,c):fr(),ch(t);else return l=t.lanes=536870912,nm(e,t,c!==null?c.baseLanes|a:a,a,l)}else c!==null?(Ps(t,c.cachePool),sh(t,c),Rl(),t.memoizedState=null):(e!==null&&Ps(t,null),fr(),Rl());return Tt(e,t,i,a),t.child}function Qi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function nm(e,t,a,l,i){var c=sr();return c=c===null?null:{parent:xt._currentValue,pool:c},t.memoizedState={baseLanes:a,cachePool:c},e!==null&&Ps(t,null),fr(),ch(t),e!==null&&cn(e,t,l,!0),t.childLanes=i,null}function yc(e,t){return t=gc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function im(e,t,a){return hn(t,e.child,null,a),e=yc(t,t.pendingProps),e.flags|=2,ha(t),t.memoizedState=null,e}function Fb(e,t,a){var l=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(Ee){if(l.mode==="hidden")return e=yc(t,l),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},Qi(null,e);if(mr(t),(e=it)?(e=Ov(e,Ta),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Sl!==null?{id:Ga,overflow:Va}:null,retryLane:536870912,hydrationErrors:null},a=Yf(e),a.return=t,t.child=a,Ot=t,it=null)):e=null,e===null)throw kl(t);return t.lanes=536870912,null}return yc(t,l)}var c=e.memoizedState;if(c!==null){var d=c.dehydrated;if(mr(t),i)if(t.flags&256)t.flags&=-257,t=im(e,t,a);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(r(558));else if(St||cn(e,t,a,!1),i=(a&e.childLanes)!==0,St||i){if(wl.current===null){if(l=lt,l!==null&&(d=Vd(l,a),d!==0&&d!==c.retryLane))throw c.retryLane=d,an(e,d),na(l,e,d),Mr;Uc()}t=im(e,t,a)}else e=c.treeContext,it=Aa(d.nextSibling),Ot=t,Ee=!0,_l=null,Ta=!1,e!==null&&Xf(t,e),t=yc(t,l),t.flags|=134221824;return t}return e=sl(e.child,{mode:l.mode,children:l.children}),e.ref=t.ref,t.child=e,e.return=t,e}function Qn(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(r(284));(e===null||e.ref!==a)&&(t.flags|=4194816)}}function Ur(e,t,a,l,i){return un(t),a=gr(e,t,a,l,void 0,i),l=br(),e!==null&&!St?(pr(e,t,i),fl(e,t,i)):(Ee&&l&&Ks(t),t.flags|=1,Tt(e,t,a,i),t.child)}function sm(e,t,a,l,i,c){return un(t),t.updateQueue=null,a=rh(t,l,a,i),uh(e),l=br(),e!==null&&!St?(pr(e,t,c),fl(e,t,c)):(Ee&&l&&Ks(t),t.flags|=1,Tt(e,t,a,c),t.child)}function cm(e,t,a,l,i){if(un(t),t.stateNode===null){var c=Un,d=a.contextType;typeof d=="object"&&d!==null&&(c=Ut(d)),c=new a(l,c),t.memoizedState=c.state!==null&&c.state!==void 0?c.state:null,c.updater=Dr,t.stateNode=c,c._reactInternals=t,c=t.stateNode,c.props=l,c.state=t.memoizedState,c.refs={},ur(t),d=a.contextType,c.context=typeof d=="object"&&d!==null?Ut(d):Un,c.state=t.memoizedState,d=a.getDerivedStateFromProps,typeof d=="function"&&(Rr(t,a,d,l),c.state=t.memoizedState),typeof a.getDerivedStateFromProps=="function"||typeof c.getSnapshotBeforeUpdate=="function"||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(d=c.state,typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount(),d!==c.state&&Dr.enqueueReplaceState(c,c.state,null),Li(t,l,c,i),Hi(),c.state=t.memoizedState),typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!0}else if(e===null){c=t.stateNode;var b=t.memoizedProps,_=vn(a,b);c.props=_;var R=c.context,U=a.contextType;d=Un,typeof U=="object"&&U!==null&&(d=Ut(U));var Y=a.getDerivedStateFromProps;U=typeof Y=="function"||typeof c.getSnapshotBeforeUpdate=="function",b=t.pendingProps!==b,U||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(b||R!==d)&&Zh(t,c,l,d),El=!1;var A=t.memoizedState;c.state=A,Li(t,l,c,i),Hi(),R=t.memoizedState,b||A!==R||El?(typeof Y=="function"&&(Rr(t,a,Y,l),R=t.memoizedState),(_=El||Qh(t,a,_,l,A,R,d))?(U||typeof c.UNSAFE_componentWillMount!="function"&&typeof c.componentWillMount!="function"||(typeof c.componentWillMount=="function"&&c.componentWillMount(),typeof c.UNSAFE_componentWillMount=="function"&&c.UNSAFE_componentWillMount()),typeof c.componentDidMount=="function"&&(t.flags|=4194308)):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=l,t.memoizedState=R),c.props=l,c.state=R,c.context=d,l=_):(typeof c.componentDidMount=="function"&&(t.flags|=4194308),l=!1)}else{c=t.stateNode,rr(e,t),d=t.memoizedProps,U=vn(a,d),c.props=U,Y=t.pendingProps,A=c.context,R=a.contextType,_=Un,typeof R=="object"&&R!==null&&(_=Ut(R)),b=a.getDerivedStateFromProps,(R=typeof b=="function"||typeof c.getSnapshotBeforeUpdate=="function")||typeof c.UNSAFE_componentWillReceiveProps!="function"&&typeof c.componentWillReceiveProps!="function"||(d!==Y||A!==_)&&Zh(t,c,l,_),El=!1,A=t.memoizedState,c.state=A,Li(t,l,c,i),Hi();var M=t.memoizedState;d!==Y||A!==M||El||e!==null&&e.dependencies!==null&&Fs(e.dependencies)?(typeof b=="function"&&(Rr(t,a,b,l),M=t.memoizedState),(U=El||Qh(t,a,U,l,A,M,_)||e!==null&&e.dependencies!==null&&Fs(e.dependencies))?(R||typeof c.UNSAFE_componentWillUpdate!="function"&&typeof c.componentWillUpdate!="function"||(typeof c.componentWillUpdate=="function"&&c.componentWillUpdate(l,M,_),typeof c.UNSAFE_componentWillUpdate=="function"&&c.UNSAFE_componentWillUpdate(l,M,_)),typeof c.componentDidUpdate=="function"&&(t.flags|=4),typeof c.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),t.memoizedProps=l,t.memoizedState=M),c.props=l,c.state=M,c.context=_,l=U):(typeof c.componentDidUpdate!="function"||d===e.memoizedProps&&A===e.memoizedState||(t.flags|=4),typeof c.getSnapshotBeforeUpdate!="function"||d===e.memoizedProps&&A===e.memoizedState||(t.flags|=1024),l=!1)}return c=l,Qn(e,t),l=(t.flags&128)!==0,c||l?(c=t.stateNode,a=l&&typeof a.getDerivedStateFromError!="function"?null:c.render(),t.flags|=1,e!==null&&l?(t.child=hn(t,e.child,null,i),t.child=hn(t,null,a,i)):Tt(e,t,a,i),t.memoizedState=c.state,e=t.child):e=fl(e,t,i),e}function um(e,t,a,l){return nn(),t.flags|=256,Tt(e,t,a,l),t.child}var $r={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Br(e){return{baseLanes:e,cachePool:Ff()}}function qr(e,t,a){return e=e!==null?e.childLanes&~a:0,t&&(e|=ya),e}function rm(e,t,a){var l=t.pendingProps,i=!1,c=(t.flags&128)!==0,d;if((d=c)||(d=e!==null&&e.memoizedState===null?!1:(Bt.current&2)!==0),d&&(i=!0,t.flags&=-129),d=(t.flags&32)!==0,t.flags&=-33,e===null){if(Ee){if(i?Ol(t):Rl(),(e=it)?(e=Ov(e,Ta),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Sl!==null?{id:Ga,overflow:Va}:null,retryLane:536870912,hydrationErrors:null},a=Yf(e),a.return=t,t.child=a,Ot=t,it=null)):e=null,e===null)throw kl(t);return qo(e)?t.lanes=32:t.lanes=536870912,null}return c=l.children,l=l.fallback,i?(Rl(),i=t.mode,c=gc({mode:"hidden",children:c},i),l=ln(l,i,a,null),c.return=t,l.return=t,c.sibling=l,t.child=c,l=t.child,l.memoizedState=Br(a),l.childLanes=qr(e,d,a),t.memoizedState=$r,Qi(null,l)):(Ol(t),Hr(t,c))}var b=e.memoizedState;if(b!==null){var _=b.dehydrated;if(_!==null)return Wb(e,t,c,d,l,_,b,a)}return i?(Rl(),i=l.fallback,c=t.mode,b=e.child,_=b.sibling,l=sl(b,{mode:"hidden",children:l.children}),l.subtreeFlags=b.subtreeFlags&1206910976,_!==null?i=sl(_,i):(i=ln(i,c,a,null),i.flags|=2),i.return=t,l.return=t,l.sibling=i,t.child=l,Qi(null,l),l=t.child,i=e.child.memoizedState,i===null?i=Br(a):(c=i.cachePool,c!==null?(b=xt._currentValue,c=c.parent!==b?{parent:b,pool:b}:c):c=Ff(),i={baseLanes:i.baseLanes|a,cachePool:c}),l.memoizedState=i,l.childLanes=qr(e,d,a),t.memoizedState=$r,Qi(e.child,l)):(Ol(t),a=e.child,e=a.sibling,a=sl(a,{mode:"visible",children:l.children}),a.return=t,a.sibling=null,e!==null&&(d=t.deletions,d===null?(t.deletions=[e],t.flags|=16):d.push(e)),t.child=a,t.memoizedState=null,a)}function Hr(e,t){return t=gc({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function gc(e,t){return e=ea(22,e,null,t),e.lanes=0,e}function bc(e,t,a){return hn(t,e.child,null,a),e=Hr(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Wb(e,t,a,l,i,c,d,b){if(a)return t.flags&256?(Ol(t),t.flags&=-257,bc(e,t,b)):t.memoizedState!==null?(Rl(),t.child=e.child,t.flags|=128,null):(Rl(),c=i.fallback,d=t.mode,i=gc({mode:"visible",children:i.children},d),c=ln(c,d,b,null),c.flags|=2,i.return=t,c.return=t,i.sibling=c,t.child=i,hn(t,e.child,null,b),i=t.child,i.memoizedState=Br(b),i.childLanes=qr(e,l,b),t.memoizedState=$r,Qi(null,i));if(Ol(t),qo(c)){if(l=c.nextSibling&&c.nextSibling.dataset,l)var _=l.dgst;return l=_,l!==""&&(i=Error(r(419)),i.stack="",i.digest=l,zi({value:i,source:null,stack:null})),bc(e,t,b)}if(St||cn(e,t,b,!1),l=(b&e.childLanes)!==0,St||l){if(wl.current!==null)return bc(e,t,b);if(l=lt,l!==null&&(i=Vd(l,b),i!==0&&i!==d.retryLane))throw d.retryLane=i,an(e,i),na(l,e,i),Mr;return Bo(c)||Uc(),bc(e,t,b)}return Bo(c)?(t.flags|=192,t.child=e.child,null):(e=d.treeContext,it=Aa(c.nextSibling),Ot=t,Ee=!0,_l=null,Ta=!1,e!==null&&Xf(t,e),t=Hr(t,i.children),t.flags|=134221824,t)}function om(e,t,a){e.lanes|=t;var l=e.alternate;l!==null&&(l.lanes|=t),Is(e.return,t,a)}function dm(e){for(var t=null;e!==null;){var a=e.alternate;a!==null&&ic(a)===null&&(t=e),e=e.sibling}return t}function pc(e,t,a,l,i,c){var d=e.memoizedState;d===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:l,tail:a,tailMode:i,treeForkCount:c}:(d.isBackwards=t,d.rendering=null,d.renderingStartTime=0,d.last=l,d.tail=a,d.tailMode=i,d.treeForkCount=c)}function Lr(e){var t=e.child;for(e.child=null;t!==null;){var a=t.sibling;t.sibling=e.child,e.child=t,t=a}}function Yr(e,t,a){var l=t.pendingProps,i=l.revealOrder,c=l.tail;l=l.children;var d=Bt.current;if(t.flags&128)return Yi(t,d),null;var b=(d&2)!==0;if(b?(d=d&1|2,t.flags|=128):d&=1,Yi(t,d),i==="backwards"&&e!==null?(Lr(e),Tt(e,t,l,a),Lr(e)):Tt(e,t,l,a),l=Ee?Di:0,!b&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&om(e,a,t);else if(e.tag===19)om(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"backwards":a=dm(t.child),a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null,Lr(t)),pc(t,!0,i,null,c,l);break;case"unstable_legacy-backwards":for(a=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&ic(e)===null){t.child=i;break}e=i.sibling,i.sibling=a,a=i,i=e}pc(t,!0,a,null,c,l);break;case"together":pc(t,!1,null,null,void 0,l);break;case"independent":t.memoizedState=null;break;default:a=dm(t.child),a===null?(i=t.child,t.child=null):(i=a.sibling,a.sibling=null),pc(t,!1,i,a,c,l)}return t.child}function fm(e,t,a){var l=t.pendingProps;return Nl(t,t.type,l.value),Tt(e,t,l.children,a),t.child}function fl(e,t,a){if(e!==null&&(t.dependencies=e.dependencies),Ul|=t.lanes,(a&t.childLanes)===0)if(e!==null){if(cn(e,t,a,!1),(a&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(r(153));if(t.child!==null){for(e=t.child,a=sl(e,e.pendingProps),t.child=a,a.return=t;e.sibling!==null;)e=e.sibling,a=a.sibling=sl(e,e.pendingProps),a.return=t;a.sibling=null}return t.child}function Gr(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&Fs(e)))}function Pb(e,t,a){switch(t.tag){case 3:Gt(t,t.stateNode.containerInfo),Nl(t,xt,e.memoizedState.cache),nn();break;case 27:case 5:yu(t);break;case 4:Gt(t,t.stateNode.containerInfo);break;case 10:Nl(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,mr(t),null;break;case 13:var l=t.memoizedState;if(l!==null){if(l.dehydrated!==null)return Ol(t),t.flags|=128,null;l=cn(e,t,a,!1);var i=t.child.childLanes;return l||(a&i)!==0?rm(e,t,a):(Ol(t),e=fl(e,t,a),e!==null?e.sibling:null)}Ol(t);break;case 19:if(t.flags&128)return Yr(e,t,a);if(i=(e.flags&128)!==0,l=(a&t.childLanes)!==0,l||(cn(e,t,a,!1),l=(a&t.childLanes)!==0),i){if(l)return Yr(e,t,a);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),Yi(t,Bt.current),l)break;return null;case 22:return t.lanes=0,lm(e,t,a,t.pendingProps);case 24:Nl(t,xt,e.memoizedState.cache)}return fl(e,t,a)}function hm(e,t,a){if(e!==null)if(e.memoizedProps!==t.pendingProps)St=!0;else{if(!Gr(e,a)&&(t.flags&128)===0)return St=!1,Pb(e,t,a);St=(e.flags&131072)!==0}else St=!1,Ee&&(t.flags&1048576)!==0&&Vf(t,Di,t.index);switch(t.lanes=0,t.tag){case 16:e:{var l=t.pendingProps;if(e=dn(t.elementType),t.type=e,typeof e=="function")Iu(e)?(l=vn(e,l),t.tag=1,t=cm(null,t,e,l,a)):(t.tag=0,t=Ur(null,t,e,l,a));else{if(e!=null){var i=e.$$typeof;if(i===V){t.tag=11,t=em(null,t,e,l,a);break e}else if(i===_e){t.tag=14,t=tm(null,t,e,l,a);break e}else if(i===Qe){t.tag=10,t.type=e,t=fm(null,t,a);break e}}throw t=pe(e)||e,Error(r(306,t,""))}}return t;case 0:return Ur(e,t,t.type,t.pendingProps,a);case 1:return l=t.type,i=vn(l,t.pendingProps),cm(e,t,l,i,a);case 3:e:{if(Gt(t,t.stateNode.containerInfo),e===null)throw Error(r(387));l=t.pendingProps;var c=t.memoizedState;i=c.element,rr(e,t),Li(t,l,null,a);var d=t.memoizedState;if(l=d.cache,Nl(t,xt,l),l!==c.cache&&lr(t,[xt],a,!0),Hi(),l=d.element,c.isDehydrated)if(c={element:l,isDehydrated:!1,cache:d.cache},t.updateQueue.baseState=c,t.memoizedState=c,t.flags&256){t=um(e,t,l,a);break e}else if(l!==i){i=_a(Error(r(424)),t),zi(i),t=um(e,t,l,a);break e}else for(e=t.stateNode.containerInfo,e.nodeType===9?e=e.body:e=e.nodeName==="HTML"?e.ownerDocument.body:e,it=Aa(e.firstChild),Ot=t,Ee=!0,_l=null,Ta=!0,a=lh(t,null,l,a),t.child=a;a;)a.flags=a.flags&-3|134221824,a=a.sibling;else{if(nn(),l===i){t=fl(e,t,a);break e}Tt(e,t,l,a)}t=t.child}return t;case 26:return Qn(e,t),e===null?(a=Bv(t.type,null,t.pendingProps,null))?t.memoizedState=a:Ee||(t.stateNode=gv(t.type,t.pendingProps,Ct.current,t)):t.memoizedState=Bv(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return yu(t),e===null&&Ee&&(l=t.stateNode=zv(t.type,t.pendingProps,Ct.current),Ot=t,Ta=!0,i=it,Hl(t.type)?(Ho=i,it=Aa(l.firstChild)):it=i),Tt(e,t,t.pendingProps.children,a),Qn(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&Ee&&((i=l=it)&&(l=Zp(l,t.type,t.pendingProps,Ta),l!==null?(t.stateNode=l,Ot=t,it=Aa(l.firstChild),Ta=!1,i=!0):i=!1),i||kl(t)),yu(t),i=t.type,c=t.pendingProps,d=e!==null?e.memoizedProps:null,l=c.children,Oo(i,c)?l=null:d!==null&&Oo(i,d)&&(t.flags|=32),t.memoizedState!==null&&(i=gr(e,t,Yb,null,null,a),oi._currentValue=i),Qn(e,t),Tt(e,t,l,a),t.child;case 6:return e===null&&Ee&&((e=a=it)&&(a=Kp(a,t.pendingProps,Ta),a!==null?(t.stateNode=a,Ot=t,it=null,e=!0):e=!1),e||kl(t)),null;case 13:return rm(e,t,a);case 4:return Gt(t,t.stateNode.containerInfo),l=t.pendingProps,e===null?t.child=hn(t,null,l,a):Tt(e,t,l,a),t.child;case 11:return em(e,t,t.type,t.pendingProps,a);case 7:return l=t.pendingProps,Qn(e,t),Tt(e,t,l,a),t.child;case 8:return Tt(e,t,t.pendingProps.children,a),t.child;case 12:return Tt(e,t,t.pendingProps.children,a),t.child;case 10:return fm(e,t,a);case 9:return i=t.type._context,l=t.pendingProps.children,un(t),i=Ut(i),l=l(i),t.flags|=1,Tt(e,t,l,a),t.child;case 14:return tm(e,t,t.type,t.pendingProps,a);case 15:return am(e,t,t.type,t.pendingProps,a);case 19:return Yr(e,t,a);case 31:return Fb(e,t,a);case 22:return lm(e,t,a,t.pendingProps);case 24:return un(t),l=Ut(xt),e===null?(i=sr(),i===null&&(i=lt,c=nr(),i.pooledCache=c,c.refCount++,c!==null&&(i.pooledCacheLanes|=a),i=c),t.memoizedState={parent:l,cache:i},ur(t),Nl(t,xt,i)):((e.lanes&a)!==0&&(rr(e,t),Li(t,null,null,a),Hi()),i=e.memoizedState,c=t.memoizedState,i.parent!==l?(i={parent:l,cache:l},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Nl(t,xt,l)):(l=c.cache,Nl(t,xt,l),l!==i.cache&&lr(t,[xt],a,!0))),Tt(e,t,t.pendingProps.children,a),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),l=t.pendingProps,l.name!=null&&l.name!=="auto"?t.flags|=e===null?18882560:18874368:Ee&&Ks(t),e!==null&&e.memoizedProps.name!==l.name?t.flags|=4194816:Qn(e,t),Tt(e,t,l.children,a),t.child;case 29:throw t.pendingProps}throw Error(r(156,t.tag))}function hl(e){e.flags|=4}function Vr(e,t,a,l,i){var c;if((c=(e.mode&32)!==0)&&(c=a===null?Yv(t,l):Yv(t,l)&&(l.src!==a.src||l.srcSet!==a.srcSet)),c){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Km())e.flags|=8192;else throw fn=tc,cr}else e.flags&=-16777217}function mm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Gv(t))if(Km())e.flags|=8192;else throw fn=tc,cr}function xc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ld():536870912,e.lanes|=t,Fn|=t)}function Zi(e,t){if(!Ee)switch(e.tailMode){case"visible":break;case"collapsed":for(var a=e.tail,l=null;a!==null;)a.alternate!==null&&(l=a),a=a.sibling;l===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:l.sibling=null;break;default:for(t=e.tail,a=null;t!==null;)t.alternate!==null&&(a=t),t=t.sibling;a===null?e.tail=null:a.sibling=null}}function st(e){var t=e.alternate!==null&&e.alternate.child===e.child,a=0,l=0;if(t)for(var i=e.child;i!==null;)a|=i.lanes|i.childLanes,l|=i.subtreeFlags&1206910976,l|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)a|=i.lanes|i.childLanes,l|=i.subtreeFlags,l|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=l,e.childLanes=a,t}function ep(e,t,a){var l=t.pendingProps;switch(Pu(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return st(t),null;case 1:return st(t),null;case 3:return a=t.stateNode,l=null,e!==null&&(l=e.memoizedState.cache),t.memoizedState.cache!==l&&(t.flags|=2048),rl(xt),La(),a.pendingContext&&(a.context=a.pendingContext,a.pendingContext=null),(e===null||e.child===null)&&(qn(t)?hl(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,tr())),st(t),null;case 26:var i=t.type,c=t.memoizedState;return e===null?(hl(t),c!==null?(st(t),mm(t,c)):(st(t),Vr(t,i,null,l,a))):c?c!==e.memoizedState?(hl(t),st(t),mm(t,c)):(st(t),t.flags&=-16777217):(e=e.memoizedProps,e!==l&&hl(t),st(t),Vr(t,i,e,l,a)),null;case 27:if(Ns(t),a=Ct.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&hl(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return st(t),t.subtreeFlags&=-33554433,null}e=nt.current,qn(t)?Qf(t):(e=zv(i,l,a),t.stateNode=e,hl(t))}return st(t),t.subtreeFlags&=-33554433,null;case 5:if(Ns(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==l&&hl(t);else{if(!l){if(t.stateNode===null)throw Error(r(166));return st(t),t.subtreeFlags&=-33554433,null}if(c=nt.current,qn(t))Qf(t);else{var d=ns(Ct.current);switch(c){case 1:c=d.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:c=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":c=d.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":c=d.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":c=d.createElement("div"),c.innerHTML="<script><\/script>",c=c.removeChild(c.firstChild);break;case"select":c=typeof l.is=="string"?d.createElement("select",{is:l.is}):d.createElement("select"),l.multiple?c.multiple=!0:l.size&&(c.size=l.size);break;default:c=typeof l.is=="string"?d.createElement(i,{is:l.is}):d.createElement(i)}}c[Mt]=t,c[Pt]=l;e:for(d=t.child;d!==null;){if(d.tag===5||d.tag===6)c.appendChild(d.stateNode);else if(d.tag!==4&&d.tag!==27&&d.child!==null){d.child.return=d,d=d.child;continue}if(d===t)break e;for(;d.sibling===null;){if(d.return===null||d.return===t)break e;d=d.return}d.sibling.return=d.return,d=d.sibling}t.stateNode=c;e:switch(Ht(c,i,l),i){case"button":case"input":case"select":case"textarea":l=!!l.autoFocus;break e;case"img":l=!0;break e;default:l=!1}l&&hl(t)}}return st(t),t.subtreeFlags&=-33554433,Vr(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,a),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==l&&hl(t);else{if(typeof l!="string"&&t.stateNode===null)throw Error(r(166));if(e=Ct.current,qn(t)){if(e=t.stateNode,a=t.memoizedProps,l=null,i=Ot,i!==null)switch(i.tag){case 27:case 5:l=i.memoizedProps}e[Mt]=t,e=!!(e.nodeValue===a||l!==null&&l.suppressHydrationWarning===!0||hv(e.nodeValue,a)),e||kl(t,!0)}else e=ns(e).createTextNode(l),e[Mt]=t,t.stateNode=e}return st(t),null;case 31:if(a=t.memoizedState,e===null||e.memoizedState!==null){if(l=qn(t),a!==null){if(e===null){if(!l)throw Error(r(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(r(557));e[Mt]=t}else nn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),e=!1}else a=tr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),e=!0;if(!e)return t.flags&256?(ha(t),t):(ha(t),null);if((t.flags&128)!==0)throw Error(r(558))}return st(t),null;case 13:if(l=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=qn(t),l!==null&&l.dehydrated!==null){if(e===null){if(!i)throw Error(r(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(r(317));i[Mt]=t}else nn(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;st(t),i=!1}else i=tr(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(ha(t),t):(ha(t),null)}return ha(t),(t.flags&128)!==0?(t.lanes=a,t):(a=l!==null,e=e!==null&&e.memoizedState!==null,a&&(l=t.child,i=null,l.alternate!==null&&l.alternate.memoizedState!==null&&l.alternate.memoizedState.cachePool!==null&&(i=l.alternate.memoizedState.cachePool.pool),c=null,l.memoizedState!==null&&l.memoizedState.cachePool!==null&&(c=l.memoizedState.cachePool.pool),c!==i&&(l.flags|=2048)),a!==e&&a&&(t.child.flags|=8192),xc(t,t.updateQueue),st(t),null);case 4:return La(),e===null&&To(t.stateNode.containerInfo),t.flags|=67108864,st(t),null;case 10:return rl(t.type),st(t),null;case 19:if(vr(t),l=t.memoizedState,l===null)return st(t),null;if(i=(t.flags&128)!==0,c=l.rendering,c===null)if(i)Zi(l,!1);else{if(ht!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(c=ic(e),c!==null){for(t.flags|=128,Zi(l,!1),e=c.updateQueue,t.updateQueue=e,xc(t,e),t.subtreeFlags=0,e=a,a=t.child;a!==null;)Lf(a,e),a=a.sibling;return Yi(t,Bt.current&1|2),Ee&&cl(t,l.treeForkCount),t.child}e=e.sibling}l.tail!==null&&ua()>Rc&&(t.flags|=128,i=!0,Zi(l,!1),t.lanes=4194304)}else{if(!i)if(e=ic(c),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,xc(t,e),Zi(l,!0),l.tail===null&&l.tailMode!=="collapsed"&&l.tailMode!=="visible"&&!c.alternate&&!Ee)return st(t),null}else 2*ua()-l.renderingStartTime>Rc&&a!==536870912&&(t.flags|=128,i=!0,Zi(l,!1),t.lanes=4194304);l.isBackwards?(c.sibling=t.child,t.child=c):(e=l.last,e!==null?e.sibling=c:t.child=c,l.last=c)}if(l.tail!==null){e=l.tail;e:{for(a=e;a!==null;){if(a.alternate!==null){a=!1;break e}a=a.sibling}a=!0}return l.rendering=e,l.tail=e.sibling,l.renderingStartTime=ua(),e.sibling=null,c=Bt.current,c=i?c&1|2:c&1,l.tailMode==="visible"||l.tailMode==="collapsed"||!a||Ee?Yi(t,c):(a=c,he($t,t),he(Bt,a),Vt===null&&(Vt=t)),Ee&&cl(t,l.treeForkCount),e}return st(t),null;case 22:case 23:return ha(t),hr(),l=t.memoizedState!==null,e!==null?e.memoizedState!==null!==l&&(t.flags|=8192):l&&(t.flags|=8192),l?(a&536870912)!==0&&(t.flags&128)===0&&(st(t),t.subtreeFlags&6&&(t.flags|=8192)):st(t),a=t.updateQueue,a!==null&&xc(t,a.retryQueue),a=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(a=e.memoizedState.cachePool.pool),l=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),l!==a&&(t.flags|=2048),e!==null&&$e(on),null;case 24:return a=null,e!==null&&(a=e.memoizedState.cache),t.memoizedState.cache!==a&&(t.flags|=2048),rl(xt),st(t),null;case 25:return null;case 30:return t.flags|=33554432,st(t),null}throw Error(r(156,t.tag))}function tp(e,t){switch(Pu(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return rl(xt),La(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Ns(t),null;case 31:if(t.memoizedState!==null){if(ha(t),t.alternate===null)throw Error(r(340));nn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ha(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(r(340));nn()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return vr(t),e=t.flags,e&65536?(t.flags=e&-65537|128,e=t.memoizedState,e!==null&&(e.rendering=null,e.tail=null),t.flags|=4,t):null;case 4:return La(),null;case 10:return rl(t.type),null;case 22:case 23:return ha(t),hr(),e!==null&&$e(on),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return rl(xt),null;case 25:return null;default:return null}}function vm(e,t){switch(Pu(t),t.tag){case 3:rl(xt),La();break;case 26:case 27:case 5:Ns(t);break;case 4:La();break;case 31:t.memoizedState!==null&&ha(t);break;case 13:ha(t);break;case 19:vr(t);break;case 10:rl(t.type);break;case 22:case 23:ha(t),hr(),e!==null&&$e(on);break;case 24:rl(xt)}}function Ki(e,t){try{var a=t.updateQueue,l=a!==null?a.lastEffect:null;if(l!==null){var i=l.next;a=i;do{if((a.tag&e)===e){l=void 0;var c=a.create,d=a.inst;l=c(),d.destroy=l}a=a.next}while(a!==i)}}catch(b){Ie(t,t.return,b)}}function Dl(e,t,a){try{var l=t.updateQueue,i=l!==null?l.lastEffect:null;if(i!==null){var c=i.next;l=c;do{if((l.tag&e)===e){var d=l.inst,b=d.destroy;if(b!==void 0){d.destroy=void 0,i=t;var _=a,R=b;try{R()}catch(U){Ie(i,_,U)}}}l=l.next}while(l!==c)}}catch(U){Ie(t,t.return,U)}}function ym(e){var t=e.updateQueue;if(t!==null){var a=e.stateNode;try{ih(t,a)}catch(l){Ie(e,e.return,l)}}}function gm(e,t,a){a.props=vn(e.type,e.memoizedProps),a.state=e.memoizedState;try{a.componentWillUnmount()}catch(l){Ie(e,t,l)}}function Xa(e,t){try{var a=e.ref;if(a!==null){switch(e.tag){case 26:case 27:case 5:var l=e.stateNode;break;case 30:var i=e.stateNode,c=nl(e.memoizedProps,i);(i.ref===null||i.ref.name!==c)&&(i.ref=kv(c)),l=i.ref;break;case 7:if(e.stateNode===null){var d=new ba(e);y(e.child,!1,Xp,d,void 0,void 0),e.stateNode=d}l=e.stateNode;break;default:l=e.stateNode}typeof a=="function"?e.refCleanup=a(l):a.current=l}}catch(b){Ie(e,t,b)}}function qt(e,t){var a=e.ref,l=e.refCleanup;if(a!==null)if(typeof l=="function")try{l()}catch(i){Ie(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){Ie(e,t,i)}else a.current=null}function jc(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var a=0;a<t.length;a++)wv(e.stateNode,t[a])}function bm(e){for(var t=e.return;t!==null&&(Qr(t)&&wv(e.stateNode,t.stateNode),!Xr(t));)t=t.return}function Ji(e){for(var t=e.return;t!==null&&(Qr(t)&&Qp(e.stateNode,t.stateNode),!Xr(t));)t=t.return}function Xr(e){return e.tag===5||e.tag===3||e.tag===27}function Qr(e){return e&&e.tag===7&&e.stateNode!==null}function Zr(e){var t=e.type,a=e.memoizedProps,l=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":a.autoFocus&&l.focus();break e;case"img":a.src?l.src=a.src:a.srcSet&&(l.srcset=a.srcSet)}}catch(i){Ie(e,e.return,i)}}function Kr(e,t,a){try{var l=e.stateNode;Ep(l,e.type,a,t),l[Pt]=t}catch(i){Ie(e,e.return,i)}}function pm(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Hl(e.type)||e.tag===4}function Jr(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||pm(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&&Hl(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 Ir(e,t,a,l){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a).insertBefore(i,t):(t=a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,t.appendChild(i),a=a._reactRootContainer,a!=null||t.onclick!==null||(t.onclick=Ya)),jc(e,l),Ge=!0;else if(i!==4&&(i===27&&(jc(e,l),l=null,Hl(e.type)&&(a=e.stateNode,t=null)),e=e.child,e!==null))for(Ir(e,t,a,l),e=e.sibling;e!==null;)Ir(e,t,a,l),e=e.sibling}function Sc(e,t,a,l){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?a.insertBefore(i,t):a.appendChild(i),jc(e,l),Ge=!0;else if(i!==4&&(i===27&&(jc(e,l),l=null,Hl(e.type)&&(a=e.stateNode)),e=e.child,e!==null))for(Sc(e,t,a,l),e=e.sibling;e!==null;)Sc(e,t,a,l),e=e.sibling}function xm(e){var t=e.stateNode,a=e.memoizedProps;try{for(var l=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Ht(t,l,a),t[Mt]=e,t[Pt]=a}catch(c){Ie(e,e.return,c)}}var _c=!1,ma=null;function jm(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(_c=!0)}var Qa=null;function Sm(){var e=Qa;return Qa=null,e}var ta=0;function Zn(e,t,a,l,i){return ta=0,_m(e.child,t,a,l,i)}function _m(e,t,a,l,i){for(var c=!1;e!==null;){if(e.tag===5){var d=e.stateNode;if(l!==null){var b=zo(d);l.push(b),b.view&&(c=!0)}else c||zo(d).view&&(c=!0);_c=!0,Sv(d,ta===0?t:t+"_"+ta,a),ta++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||_m(e.child,t,a,l,i)&&(c=!0));e=e.sibling}return c}function Za(e,t){for(;e!==null;)e.tag===5?_v(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||Za(e.child,t)),e=e.sibling}function kc(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(kc(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(r(544));var a=t.name;t=il(t.default,t.share),t!=="none"&&(Zn(e,a,t,null,!1)||Za(e.child,!1))}e=e.sibling}}function Fr(e,t){if(e.tag===30){var a=e.stateNode,l=e.memoizedProps,i=nl(l,a),c=il(l.default,a.paired?l.share:l.enter);c!=="none"?Zn(e,i,c,null,!1)?(kc(e),a.paired||t||ti(e,l.onEnter)):Za(e.child,!1):kc(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Fr(e,t),e=e.sibling;else kc(e)}function Wr(e){if(ma!==null&&ma.size!==0){var t=ma;if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var a=e.memoizedProps,l=a.name;if(l!=null&&l!=="auto"){var i=t.get(l);if(i!==void 0){var c=il(a.default,a.share);if(c!=="none"&&(Zn(e,l,c,null,!1)?(c=e.stateNode,i.paired=c,c.paired=i,ti(e,a.onShare)):Za(e.child,!1)),t.delete(l),t.size===0)break}}}Wr(e)}e=e.sibling}}}function Pr(e){if(e.tag===30){var t=e.memoizedProps,a=nl(t,e.stateNode),l=ma!==null?ma.get(a):void 0,i=il(t.default,l!==void 0?t.share:t.exit);i!=="none"&&(Zn(e,a,i,null,!1)?l!==void 0?(i=e.stateNode,l.paired=i,i.paired=l,ma.delete(a),ti(e,t.onShare)):ti(e,t.onExit):Za(e.child,!1)),ma!==null&&Wr(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Pr(e),e=e.sibling;else ma!==null&&Wr(e)}function km(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,a=nl(t,e.stateNode);t=il(t.default,t.update),e.flags&=-5,t!=="none"&&Zn(e,a,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&km(e);e=e.sibling}}function eo(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if(e.tag!==22||e.memoizedState===null){if(e.tag===30&&(e.flags&18874368)!==0){var t=e.stateNode;t.paired!==null&&(t.paired=null,Za(e.child,!1))}eo(e)}e=e.sibling}}function Nc(e){if(e.tag===30)e.stateNode.paired=null,Za(e.child,!1),eo(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Nc(e),e=e.sibling;else eo(e)}function Nm(e){for(e=e.child;e!==null;)e.tag===30?Za(e.child,!1):(e.subtreeFlags&33554432)!==0&&Nm(e),e=e.sibling}function to(e,t,a,l,i,c,d){for(var b=!1;t!==null;){if(t.tag===5){var _=t.stateNode;if(c!==null&&ta<c.length){var R=c[ta],U=zo(_);(R.view||U.view)&&(b=!0);var Y;if(Y=(e.flags&4)===0)if(U.clip)Y=!0;else{Y=R.rect;var A=U.rect;Y=Y.y!==A.y||Y.x!==A.x||Y.height!==A.height||Y.width!==A.width}Y&&(e.flags|=4),U.abs?U=!R.abs:(R=R.rect,U=U.rect,U=R.height!==U.height||R.width!==U.width),U&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&Sv(_,ta===0?a:a+"_"+ta,i),b&&(e.flags&4)!==0||(Qa===null&&(Qa=[]),Qa.push(_,ta===0?l:l+"_"+ta,t.memoizedProps)),ta++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&d?e.flags|=t.flags&32:to(e,t.child,a,l,i,c,d)&&(b=!0));t=t.sibling}return b}function Tm(e,t){for(e=e.child;e!==null;){if(e.tag===30){var a=e.memoizedProps,l=e.stateNode,i=nl(a,l),c=il(a.default,a.update),d;d=e.memoizedState,e.memoizedState=null,l=e;var b=e.child;ta=0,i=to(l,b,i,i,c,d,!1),(e.flags&4)!==0&&i&&ti(e,a.onUpdate)}else(e.subtreeFlags&33554432)!==0&&Tm(e);e=e.sibling}}var Rt=!1,Ze=!1,Ka=!1,ao=!1,Em=typeof WeakSet=="function"?WeakSet:Set,Dt=null,Ja=!1,Ii=!1,Tc=!1,lo=!1;function ap(e,t,a){if(e=e.containerInfo,Co=di,e=Of(e),Gu(e)){if("selectionStart"in e)var l={start:e.selectionStart,end:e.selectionEnd};else e:{l=(l=e.ownerDocument)&&l.defaultView||window;var i=l.getSelection&&l.getSelection();if(i&&i.rangeCount!==0){l=i.anchorNode;var c=i.anchorOffset,d=i.focusNode;i=i.focusOffset;try{l.nodeType,d.nodeType}catch{l=null;break e}var b=0,_=-1,R=-1,U=0,Y=0,A=e,M=null;t:for(;;){for(var F;A!==l||c!==0&&A.nodeType!==3||(_=b+c),A!==d||i!==0&&A.nodeType!==3||(R=b+i),A.nodeType===3&&(b+=A.nodeValue.length),(F=A.firstChild)!==null;)M=A,A=F;for(;;){if(A===e)break t;if(M===l&&++U===c&&(_=b),M===d&&++Y===i&&(R=b),(F=A.nextSibling)!==null)break;A=M,M=A.parentNode}A=F}l=_===-1||R===-1?null:{start:_,end:R}}else l=null}l=l||{start:0,end:0}}else l=null;for(wo={focusedElem:e,selectionRange:l},di=!1,a=(a&335544064)===a,Dt=t,t=a?9270:1024;Dt!==null;){if(e=Dt,a&&(l=e.deletions,l!==null))for(c=0;c<l.length;c++)a&&Pr(l[c]);if(e.alternate===null&&(e.flags&2)!==0)a&&jm(e),Ec(a);else{if(e.tag===22){if(l=e.alternate,e.memoizedState!==null){l!==null&&l.memoizedState===null&&a&&Pr(l),Ec(a);continue}else if(l!==null&&l.memoizedState!==null){a&&jm(e),Ec(a);continue}}l=e.child,(e.subtreeFlags&t)!==0&&l!==null?(l.return=e,Dt=l):(a&&km(e),Ec(a))}}ma=null}function Ec(e){for(;Dt!==null;){var t=Dt,a=e,l=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((i&1024)!==0&&l!==null){a=void 0,i=l.memoizedProps,l=l.memoizedState;var c=t.stateNode;try{var d=vn(t.type,i);a=c.getSnapshotBeforeUpdate(d,l),c.__reactInternalSnapshotBeforeUpdate=a}catch(b){Ie(t,t.return,b)}}break;case 3:if((i&1024)!==0){if(l=t.stateNode.containerInfo,a=l.nodeType,a===9)$o(l);else if(a===1)switch(l.nodeName){case"HEAD":case"HTML":case"BODY":$o(l);break;default:l.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:a&&l!==null&&(a=nl(l.memoizedProps,l.stateNode),i=t.memoizedProps,i=il(i.default,i.update),i!=="none"&&Zn(l,a,i,l.memoizedState=[],!0));break;default:if((i&1024)!==0)throw Error(r(163))}if(l=t.sibling,l!==null){l.return=t.return,Dt=l;break}Dt=t.return}}function Am(e,t,a){var l=a.flags;switch(a.tag){case 0:case 11:case 15:Ia(e,a),l&4&&Ki(5,a);break;case 1:if(Ia(e,a),l&4)if(e=a.stateNode,t===null)try{e.componentDidMount()}catch(d){Ie(a,a.return,d)}else{var i=vn(a.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(d){Ie(a,a.return,d)}}l&64&&ym(a),l&512&&Xa(a,a.return);break;case 3:if(Ia(e,a),l&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{ih(e,t)}catch(d){Ie(a,a.return,d)}}break;case 27:t===null&&l&4&&xm(a);case 26:case 5:Ia(e,a),t===null&&l&4&&Zr(a),l&512&&Xa(a,a.return);break;case 12:Ia(e,a);break;case 31:Ia(e,a),l&4&&Rm(e,a);break;case 13:Ia(e,a),l&4&&Dm(e,a),l&64&&(e=a.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(a=mp.bind(null,a),Jp(e,a))));break;case 22:if(l=a.memoizedState!==null||Rt,!l){var c=t!==null&&t.memoizedState!==null||Ze;t=Rt,i=Ze,Rt=l,(Ze=c)&&!i?(l=2,(a.subtreeFlags&8772)!==0&&(l|=1),Ma(e,a,l)):Ia(e,a),Rt=t,Ze=i}break;case 30:Ia(e,a),l&512&&Xa(a,a.return);break;case 7:l&512&&Xa(a,a.return);default:Ia(e,a)}}function no(e,t){for(e=e.child;e!==null;)Cm(e,t),e=e.sibling}function Cm(e,t){switch(e.tag){case 5:case 26:try{var a=e.stateNode;if(t){var l=a.style;typeof l.setProperty=="function"?l.setProperty("display","none","important"):l.display="none"}else{var i=e.stateNode,c=e.memoizedProps.style,d=c!=null&&c.hasOwnProperty("display")?c.display:null;i.style.display=d==null||typeof d=="boolean"?"":(""+d).trim()}}catch(_){Ie(e,e.return,_)}io(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Ge=!0}catch(_){Ie(e,e.return,_)}break;case 18:try{var b=e.stateNode;t?jv(b,!0):jv(e.stateNode,!1)}catch(_){Ie(e,e.return,_)}break;case 22:case 23:e.memoizedState===null&&no(e,t);break;default:no(e,t)}}function io(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var a=e,l=t;switch(a.tag){case 4:Cm(a,l);break e;case 22:a.memoizedState===null&&io(a,l);break e;default:io(a,l)}}e=e.sibling}}function wm(e){var t=e.alternate;t!==null&&(e.alternate=null,wm(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&Rs(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 rt=null,aa=!1;function Da(e,t,a){for(a=a.child;a!==null;)Om(e,t,a),a=a.sibling}function Om(e,t,a){if(ra&&typeof ra.onCommitFiberUnmount=="function")try{ra.onCommitFiberUnmount(pi,a)}catch{}switch(a.tag){case 26:Ze||qt(a,t),Da(e,t,a),a.memoizedState?a.memoizedState.count--:a.stateNode&&!Ze&&(a=a.stateNode,a.parentNode.removeChild(a));break;case 27:Ze||qt(a,t),Ji(a);var l=rt,i=aa;Hl(a.type)&&(rt=a.stateNode,aa=!1),Da(e,t,a),Mv(a.stateNode,a.type,a.memoizedProps),rt=l,aa=i;break;case 5:Ze||qt(a,t),Ji(a);case 6:if(a.tag===6&&Ji(a),l=rt,i=aa,rt=null,Da(e,t,a),rt=l,aa=i,rt!==null)if(aa)try{(rt.nodeType===9?rt.body:rt.nodeName==="HTML"?rt.ownerDocument.body:rt).removeChild(a.stateNode),Ge=!0}catch(c){Ie(a,t,c)}else try{rt.removeChild(a.stateNode),Ge=!0}catch(c){Ie(a,t,c)}break;case 18:rt!==null&&(aa?(e=rt,xv(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,a.stateNode),fi(e)):xv(rt,a.stateNode));break;case 4:l=rt,i=aa,rt=a.stateNode.containerInfo,aa=!0,Da(e,t,a),rt=l,aa=i;break;case 0:case 11:case 14:case 15:Dl(2,a,t),Ze||Dl(4,a,t),Da(e,t,a);break;case 1:Ze||(qt(a,t),l=a.stateNode,typeof l.componentWillUnmount=="function"&&gm(a,t,l)),Da(e,t,a);break;case 21:Da(e,t,a);break;case 22:Ze=(l=Ze)||a.memoizedState!==null,Da(e,t,a),Ze=l;break;case 30:qt(a,t),Da(e,t,a);break;case 7:Ze||qt(a,t),Da(e,t,a);break;default:Da(e,t,a)}}function Rm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{fi(e)}catch(a){Ie(t,t.return,a)}}}function Dm(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{fi(e)}catch(a){Ie(t,t.return,a)}}function lp(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Em),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Em),t;default:throw Error(r(435,e.tag))}}function Ac(e,t){var a=lp(e);t.forEach(function(l){if(!a.has(l)){a.add(l);var i=vp.bind(null,e,l);l.then(i,i)}})}function Kt(e,t,a){var l=t.deletions;if(l!==null)for(var i=0;i<l.length;i++){var c=l[i],d=e,b=t,_=b;e:for(;_!==null;){switch(_.tag){case 27:if(Hl(_.type)){rt=_.stateNode,aa=!1;break e}break;case 5:rt=_.stateNode,aa=!1;break e;case 3:case 4:rt=_.stateNode.containerInfo,aa=!0;break e}_=_.return}if(rt===null)throw Error(r(160));Om(d,b,c),rt=null,aa=!1,d=c.alternate,d!==null&&(d.return=null),c.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)zm(t,e,a),t=t.sibling}var za=null;function zm(e,t,a){var l=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(l=e.updateQueue,l=l!==null?l.events:null,l!==null))for(var c=0;c<l.length;c++){var d=l[c];d.ref.impl=d.nextImpl}Kt(t,e,a),Jt(e),i&4&&(Dl(3,e,e.return),Ki(3,e),Dl(5,e,e.return));break;case 1:Kt(t,e,a),Jt(e),i&512&&(Ze||l===null||qt(l,l.return)),i&64&&Rt&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(a=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=a===null?t:a.concat(t))));break;case 26:if(c=za,Kt(t,e,a),Jt(e),i&512&&(Ze||l===null||qt(l,l.return)),i&4)if(i=l!==null?l.memoizedState:null,a=e.memoizedState,l===null)if(a===null)if(e.stateNode===null)if(Rt)e.stateNode=gv(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,a=e.memoizedProps,i=c.ownerDocument||c;t:switch(t){case"title":l=i.getElementsByTagName("title")[0],(!l||l[Si]||l[Mt]||l.namespaceURI==="http://www.w3.org/2000/svg"||l.hasAttribute("itemprop"))&&(l=i.createElement(t),i.head.insertBefore(l,i.querySelector("head > title"))),Ht(l,t,a),l[Mt]=e,wt(l),t=l;break e;case"link":if(c=Lv("link","href",i).get(t+(a.href||""))){for(d=0;d<c.length;d++)if(l=c[d],l.getAttribute("href")===(a.href==null||a.href===""?null:a.href)&&l.getAttribute("rel")===(a.rel==null?null:a.rel)&&l.getAttribute("title")===(a.title==null?null:a.title)&&l.getAttribute("crossorigin")===(a.crossOrigin==null?null:a.crossOrigin)){c.splice(d,1);break t}}l=i.createElement(t),Ht(l,t,a),i.head.appendChild(l);break;case"meta":if(c=Lv("meta","content",i).get(t+(a.content||""))){for(d=0;d<c.length;d++)if(l=c[d],l.getAttribute("content")===(a.content==null?null:""+a.content)&&l.getAttribute("name")===(a.name==null?null:a.name)&&l.getAttribute("property")===(a.property==null?null:a.property)&&l.getAttribute("http-equiv")===(a.httpEquiv==null?null:a.httpEquiv)&&l.getAttribute("charset")===(a.charSet==null?null:a.charSet)){c.splice(d,1);break t}}l=i.createElement(t),Ht(l,t,a),i.head.appendChild(l);break;default:throw Error(r(468,t))}l[Mt]=e,wt(l),t=l}e.stateNode=t}else Rt||Vo(c,e.type,e.stateNode);else e.stateNode=Hv(c,a,e.memoizedProps);else i!==a?(i===null?(t=l.stateNode,t===null||Ze||t.parentNode.removeChild(t)):i.count--,a===null?Rt||Vo(c,e.type,e.stateNode):Hv(c,a,e.memoizedProps)):a===null&&e.stateNode!==null&&Kr(e,e.memoizedProps,l.memoizedProps);break;case 27:Kt(t,e,a),Jt(e),i&512&&(Ze||l===null||qt(l,l.return)),l!==null&&i&4&&Kr(e,e.memoizedProps,l.memoizedProps);break;case 5:if(c=Ka,Ka=!1,Kt(t,e,a),Ka=c,Jt(e),i&512&&(Ze||l===null||qt(l,l.return)),e.flags&32){t=e.stateNode;try{Cn(t,""),Ge=!0}catch(U){Ie(e,e.return,U)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,Kr(e,t,l!==null?l.memoizedProps:t)),i&1024&&(ao=!0);break;case 6:if(Kt(t,e,a),Jt(e),i&4){if(e.stateNode===null)throw Error(r(162));t=e.memoizedProps,a=e.stateNode;try{a.nodeValue=t,Ge=!0}catch(U){Ie(e,e.return,U)}}break;case 3:if(Ge=!1,Gc=null,c=za,za=is(t.containerInfo),Kt(t,e,a),za=c,Jt(e),i&4&&l!==null&&l.memoizedState.isDehydrated)try{fi(t.containerInfo)}catch(U){Ie(e,e.return,U)}ao&&(ao=!1,Mm(e)),Ge=!1;break;case 4:i=Ka,Ka=Rt,l=ef(),c=za,za=is(e.stateNode.containerInfo),Kt(t,e,a),Jt(e),za=c,Ge&&Ii&&(Tc=!0),Ge=l,Ka=i;break;case 12:Kt(t,e,a),Jt(e);break;case 31:Kt(t,e,a),Jt(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ac(e,t)));break;case 13:Kt(t,e,a),Jt(e),e.child.flags&8192&&e.memoizedState!==null!=(l!==null&&l.memoizedState!==null)&&(Oc=ua()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ac(e,t)));break;case 22:c=e.memoizedState!==null,d=l!==null&&l.memoizedState!==null;var b=Rt,_=Ze,R=Ka;Rt=b||c,Ka=R||c,Ze=_||d,Kt(t,e,a),Ze=_,Ka=R,Rt=b,Jt(e),i&8192&&(t=e.stateNode,t._visibility=c?t._visibility&-2:t._visibility|1,!c||l===null||d||Rt||Ze||(t=d||Ze,a=Rt,l=Ze,Rt=c||Rt,Ze=t,zl(e,2),Rt=a,Ze=l),!c&&Ka||no(e,c)),i&4&&(t=e.updateQueue,t!==null&&(a=t.retryQueue,a!==null&&(t.retryQueue=null,Ac(e,a))));break;case 19:Kt(t,e,a),Jt(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,Ac(e,t)));break;case 30:i&512&&(Ze||l===null||qt(l,l.return)),i=ef(),c=Ii,d=(a&335544064)===a,b=e.memoizedProps,Ii=d&&il(b.default,b.update)!=="none",Kt(t,e,a),Jt(e),d&&l!==null&&Ge&&(e.flags|=4),Ii=c,Ge=i;break;case 21:break;case 7:i&512&&(Ze||l===null||qt(l,l.return)),l&&l.stateNode!==null&&(l.stateNode._fragmentFiber=e);default:Kt(t,e,a),Jt(e)}}function Jt(e){var t=e.flags;if(t&2){try{for(var a,l=e.return;l!==null;){if(pm(l)){a=l;break}l=l.return}l=null;for(var i=e.return;i!==null;){if(Qr(i)){var c=i.stateNode;l===null?l=[c]:l.push(c)}if(Xr(i))break;i=i.return}var d=l;if(a==null)throw Error(r(160));switch(a.tag){case 27:var b=a.stateNode,_=Jr(e);Sc(e,_,b,d);break;case 5:var R=a.stateNode;a.flags&32&&(Cn(R,""),a.flags&=-33);var U=Jr(e);Sc(e,U,R,d);break;case 3:case 4:var Y=a.stateNode.containerInfo,A=Jr(e);Ir(e,A,Y,d);break;default:throw Error(r(161))}}catch(M){Ie(e,e.return,M)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Mm(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Mm(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,di=!0,t.reset(),di=!1),e=e.sibling}}function Kn(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)Um(t,e),t=t.sibling;else Tm(t)}function Um(e,t){var a=e.alternate;if(a===null)Fr(e,!1);else switch(e.tag){case 3:if(lo=Ja=!1,Sm(),Kn(t,e),!Ja&&!Tc){if(e=Qa,e!==null)for(var l=0;l<e.length;l+=3){a=e[l];var i=e[l+1];_v(a,e[l+2]),a=a.ownerDocument.documentElement,a!==null&&a.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group("+i+")"})}e=t.containerInfo,e=e.nodeType===9?e.documentElement:e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName===""&&(e.style.viewTransitionName="none",e.animate({opacity:[0,0],pointerEvents:["none","none"]},{duration:0,fill:"forwards",pseudoElement:"::view-transition-group(root)"}),e.animate({width:[0,0],height:[0,0]},{duration:0,fill:"forwards",pseudoElement:"::view-transition"})),lo=!0}Qa=null;break;case 5:Kn(t,e);break;case 4:l=Ja,Ja=!1,Kn(t,e),Ja&&(Tc=!0),Ja=l;break;case 22:e.memoizedState===null&&(a.memoizedState!==null?Fr(e,!1):Kn(t,e));break;case 30:l=Ja,i=Sm(),Ja=!1,Kn(t,e),Ja&&(e.flags|=4);var c=e.memoizedProps,d=e.stateNode;t=nl(c,d),d=nl(a.memoizedProps,d);var b=il(c.default,c.update);b==="none"?t=!1:(c=a.memoizedState,a.memoizedState=null,a=e.child,ta=0,t=to(e,a,t,d,b,c,!0),ta!==(c===null?0:c.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(ti(e,e.memoizedProps.onUpdate),Qa=i):i!==null&&(i.push.apply(i,Qa),Qa=i),Ja=(e.flags&32)!==0?!0:l;break;default:Kn(t,e)}}function Ia(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Am(e,t.alternate,t),t=t.sibling}function zl(e,t){for(e=e.child;e!==null;){var a=e,l=t;switch(a.tag){case 0:case 11:case 14:case 15:Dl(4,a,a.return),zl(a,l);break;case 1:qt(a,a.return);var i=a.stateNode;typeof i.componentWillUnmount=="function"&&gm(a,a.return,i),zl(a,l);break;case 27:(l&2)!==0&&Mv(a.stateNode,a.type,a.memoizedProps);case 5:qt(a,a.return),a.tag!==5&&a.tag!==27||Ji(a),zl(a,l);break;case 6:Ji(a);break;case 26:qt(a,a.return),i=a.stateNode,a.memoizedState!==null||i===null||Ze||i.parentNode.removeChild(i),zl(a,l);break;case 22:a.memoizedState===null&&zl(a,l);break;case 30:qt(a,a.return),zl(a,l);break;case 7:qt(a,a.return);default:zl(a,l)}e=e.sibling}}function Ma(e,t,a){for(a=(t.subtreeFlags&8772)!==0?a:a&-2,t=t.child;t!==null;){var l=t.alternate,i=e,c=t,d=c.flags,b=(a&1)!==0;switch(c.tag){case 0:case 11:case 15:Ma(i,c,a),Ki(4,c);break;case 1:if(Ma(i,c,a),l=c,i=l.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(U){Ie(l,l.return,U)}if(l=c,i=l.updateQueue,i!==null){var _=l.stateNode;try{var R=i.shared.hiddenCallbacks;if(R!==null)for(i.shared.hiddenCallbacks=null,i=0;i<R.length;i++)nh(R[i],_)}catch(U){Ie(l,l.return,U)}}b&&d&64&&ym(c),Xa(c,c.return);break;case 27:(a&2)!==0&&xm(c);case 5:c.tag!==5&&c.tag!==27||bm(c),Ma(i,c,a),b&&l===null&&d&4&&Zr(c),Xa(c,c.return);break;case 6:bm(c);break;case 26:_=c.stateNode,c.memoizedState!==null||_===null||Rt||Vo(is(_.ownerDocument),c.type,_),Ma(i,c,a),b&&l===null&&d&4&&Zr(c),Xa(c,c.return);break;case 12:Ma(i,c,a);break;case 31:Ma(i,c,a),b&&d&4&&Rm(i,c);break;case 13:Ma(i,c,a),b&&d&4&&Dm(i,c);break;case 22:c.memoizedState===null&&Ma(i,c,a),Xa(c,c.return);break;case 30:Ma(i,c,a),Xa(c,c.return);break;case 7:Xa(c,c.return);default:Ma(i,c,a)}t=t.sibling}}function so(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&&Mi(a))}function co(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Mi(e))}function Ea(e,t,a,l){var i=(a&335544064)===a;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)$m(e,t,a,l),t=t.sibling;else i&&Nm(t)}function $m(e,t,a,l){var i=(a&335544064)===a;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Nc(t);var c=t.flags;switch(t.tag){case 0:case 11:case 15:Ea(e,t,a,l),c&2048&&Ki(9,t);break;case 1:Ea(e,t,a,l);break;case 3:Ea(e,t,a,l),i&&lo&&(e=e.containerInfo,e=e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,e.style.viewTransitionName==="root"&&(e.style.viewTransitionName=""),e=e.ownerDocument.documentElement,e!==null&&e.style.viewTransitionName==="none"&&(e.style.viewTransitionName="")),c&2048&&(c=null,t.alternate!==null&&(c=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==c&&(t.refCount++,c!=null&&Mi(c)));break;case 12:if(c&2048){Ea(e,t,a,l),c=t.stateNode;try{var d=t.memoizedProps,b=d.id,_=d.onPostCommit;typeof _=="function"&&_(b,t.alternate===null?"mount":"update",c.passiveEffectDuration,-0)}catch(R){Ie(t,t.return,R)}}else Ea(e,t,a,l);break;case 31:Ea(e,t,a,l);break;case 13:Ea(e,t,a,l);break;case 23:break;case 22:d=t.stateNode,b=t.alternate,t.memoizedState!==null?(i&&b!==null&&b.memoizedState===null&&Nc(b),d._visibility&2?Ea(e,t,a,l):Fi(e,t)):(i&&b!==null&&b.memoizedState!==null&&Nc(t),d._visibility&2?Ea(e,t,a,l):(d._visibility|=2,Jn(e,t,a,l,(t.subtreeFlags&10256)!==0||!1))),c&2048&&so(b,t);break;case 24:Ea(e,t,a,l),c&2048&&co(t.alternate,t);break;case 30:i&&(c=t.alternate,c!==null&&(Za(c.child,!0),Za(t.child,!0))),Ea(e,t,a,l);break;default:Ea(e,t,a,l)}}function Jn(e,t,a,l,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var c=e,d=t,b=a,_=l,R=d.flags;switch(d.tag){case 0:case 11:case 15:Jn(c,d,b,_,i),Ki(8,d);break;case 23:break;case 22:var U=d.stateNode;d.memoizedState!==null?U._visibility&2?Jn(c,d,b,_,i):Fi(c,d):(U._visibility|=2,Jn(c,d,b,_,i)),i&&R&2048&&so(d.alternate,d);break;case 24:Jn(c,d,b,_,i),i&&R&2048&&co(d.alternate,d);break;default:Jn(c,d,b,_,i)}t=t.sibling}}function Fi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var a=e,l=t,i=l.flags;switch(l.tag){case 22:Fi(a,l),i&2048&&so(l.alternate,l);break;case 24:Fi(a,l),i&2048&&co(l.alternate,l);break;default:Fi(a,l)}t=t.sibling}}var yn=8192;function gn(e,t,a){if(e.subtreeFlags&yn)for(e=e.child;e!==null;)Bm(e,t,a),e=e.sibling}function Bm(e,t,a){switch(e.tag){case 26:gn(e,t,a),e.flags&yn&&(e.memoizedState!==null?r0(a,za,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Xv(a,e)));break;case 5:gn(e,t,a),e.flags&yn&&(e=e.stateNode,(t&335544128)===t&&Xv(a,e));break;case 3:case 4:var l=za;za=is(e.stateNode.containerInfo),gn(e,t,a),za=l;break;case 22:e.memoizedState===null&&(l=e.alternate,l!==null&&l.memoizedState!==null?(l=yn,yn=16777216,gn(e,t,a),yn=l):gn(e,t,a));break;case 30:if((e.flags&yn)!==0&&(l=e.memoizedProps.name,l!=null&&l!=="auto")){var i=e.stateNode;i.paired=null,ma===null&&(ma=new Map),ma.set(l,i)}gn(e,t,a);break;default:gn(e,t,a)}}function qm(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 Wi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Dt=l,Lm(l,e)}qm(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Hm(e),e=e.sibling}function Hm(e){switch(e.tag){case 0:case 11:case 15:Wi(e),e.flags&2048&&Dl(9,e,e.return);break;case 3:Wi(e);break;case 12:Wi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Cc(e)):Wi(e);break;default:Wi(e)}}function Cc(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var a=0;a<t.length;a++){var l=t[a];Dt=l,Lm(l,e)}qm(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Dl(8,t,t.return),Cc(t);break;case 22:a=t.stateNode,a._visibility&2&&(a._visibility&=-3,Cc(t));break;default:Cc(t)}e=e.sibling}}function Lm(e,t){for(;Dt!==null;){var a=Dt;switch(a.tag){case 0:case 11:case 15:Dl(8,a,t);break;case 23:case 22:if(a.memoizedState!==null&&a.memoizedState.cachePool!==null){var l=a.memoizedState.cachePool.pool;l!=null&&l.refCount++}break;case 24:Mi(a.memoizedState.cache)}if(l=a.child,l!==null)l.return=a,Dt=l;else e:for(a=e;Dt!==null;){l=Dt;var i=l.sibling,c=l.return;if(wm(l),l===a){Dt=null;break e}if(i!==null){i.return=c,Dt=i;break e}Dt=c}}}var np={getCacheForType:function(e){var t=Ut(xt),a=t.data.get(e);return a===void 0&&(a=e(),t.data.set(e,a)),a},cacheSignal:function(){return Ut(xt).controller.signal}},ip=typeof WeakMap=="function"?WeakMap:Map,Xe=0,lt=null,Ce=null,Re=0,Je=0,va=null,Ml=!1,In=!1,uo=!1,ml=0,ht=0,Ul=0,bn=0,wc=0,ya=0,Fn=0,Pi=null,la=null,ro=!1,Oc=0,Ym=0,Rc=1/0,Dc=null,$l=null,dt=0,Ua=null,pn=null,Fa=0,oo=0,fo=null,Gm=null,Wn=null,Pn=null,ei=null,es=0,zc=null;function ga(){return(Xe&2)!==0&&Re!==0?Re&-Re:ne.T!==null?So():Xd()}function Vm(){if(ya===0)if((Re&536870912)===0||Ee){var e=As;As<<=1,(As&3932160)===0&&(As=262144),ya=e}else ya=536870912;return e=$t.current,e!==null&&(e.flags|=32),ya}function ti(e,t){if(t!=null){var a=e.stateNode,l=a.ref;l===null&&(l=a.ref=kv(nl(e.memoizedProps,a))),Pn===null&&(Pn=[]),Pn.push(t.bind(null,l))}}function na(e,t,a){(e===lt&&(Je===2||Je===9)||e.cancelPendingCommit!==null)&&(ai(e,0),Bl(e,Re,ya,!1)),ji(e,a),((Xe&2)===0||e!==lt)&&(e===lt&&((Xe&2)===0&&(bn|=a),ht===4&&Bl(e,Re,ya,!1)),Wa(e))}function Xm(e,t,a){if((Xe&6)!==0)throw Error(r(327));var l=!a&&(t&127)===0&&(t&e.expiredLanes)===0||xi(e,t),i=l?up(e,t):mo(e,t,!0),c=l;do{if(i===0){In&&!l&&Bl(e,t,0,!1);break}else{if(a=e.current.alternate,c&&!sp(a)){i=mo(e,t,!1),c=!1;continue}if(i===2){if(c=t,e.errorRecoveryDisabledLanes&c)var d=0;else d=e.pendingLanes&-536870913,d=d!==0?d:d&536870912?536870912:0;if(d!==0){t=d;e:{var b=e;i=Pi;var _=b.current.memoizedState.isDehydrated;if(_&&(ai(b,d).flags|=256),d=mo(b,d,!1),d!==2&&d!==6){if(uo&&!_){b.errorRecoveryDisabledLanes|=c,bn|=c,i=4;break e}c=la,la=i,c!==null&&(la===null?la=c:la.push.apply(la,c))}i=d}if(c=!1,i!==2)continue}}if(i===1){ai(e,0),Bl(e,t,0,!0);break}e:{switch(l=e,c=i,c){case 0:case 1:throw Error(r(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Bl(l,t,ya,!Ml);break e;case 2:la=null;break;case 3:case 5:break;default:throw Error(r(329))}if((t&62914560)===t&&(i=Oc+300-ua(),10<i)){if(Bl(l,t,ya,!Ml),ws(l,0,!0)!==0)break e;Fa=t,l.timeoutHandle=Do(Qm.bind(null,l,a,la,Dc,ro,t,ya,bn,Fn,Ml,c,"Throttled",-0,0),i);break e}Qm(l,a,la,Dc,ro,t,ya,bn,Fn,Ml,c,null,-0,0)}}break}while(!0);Wa(e)}function Qm(e,t,a,l,i,c,d,b,_,R,U,Y,A,M){e.timeoutHandle=-1;var F=t.subtreeFlags,ce=(c&335544064)===c;if(Y=null,(ce||F&8192||(F&16785408)===16785408)&&(Y={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ya},ma=null,Bm(t,c,Y),ce&&(F=Y,ce=e.containerInfo,ce=(ce.nodeType===9?ce:ce.ownerDocument).__reactViewTransition,ce!=null&&(F.count++,F.waitingForViewTransition=!0,F=us.bind(F),ce.finished.then(F,F))),F=(c&62914560)===c?Oc-ua():(c&4194048)===c?Ym-ua():0,F=o0(Y,F),F!==null)){Fa=c,e.cancelPendingCommit=F(ev.bind(null,e,t,c,a,l,i,d,b,_,R,U,Y,null,A,M)),Bl(e,c,d,!R);return}ev(e,t,c,a,l,i,d,b,_,R,U,Y)}function sp(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 l=0;l<a.length;l++){var i=a[l],c=i.getSnapshot;i=i.value;try{if(!fa(c(),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 Bl(e,t,a,l){t=Hd(e,t),t&=~wc,t&=~bn,e.suspendedLanes|=t,e.pingedLanes&=~t,l&&(e.warmLanes|=t),l=e.expirationTimes;for(var i=t;0<i;){var c=31-oa(i),d=1<<c;l[c]=-1,i&=~d}a!==0&&Yd(e,a,t)}function Mc(){return(Xe&6)===0?(ts(0),!1):!0}function ho(){if(Ce!==null){if(Je===0)var e=Ce.return;else e=Ce,ul=sn=null,xr(e),Yn=null,Bi=0,e=Ce;for(;e!==null;)vm(e.alternate,e),e=e.return;Ce=null}}function ai(e,t){var a=e.timeoutHandle;return a!==-1&&(e.timeoutHandle=-1,wp(a)),a=e.cancelPendingCommit,a!==null&&(e.cancelPendingCommit=null,a()),Fa=0,ho(),lt=e,Ce=a=sl(e.current,null),Re=t,Je=0,va=null,Ml=!1,In=xi(e,t),uo=!1,Fn=ya=wc=bn=Ul=ht=0,la=Pi=null,ro=!1,ml=Hd(e,t),Gs(),a}function Zm(e,t){je=null,ne.H=mc,t===Ln||t===ec?(t=eh(),Je=3):t===cr?(t=eh(),Je=4):Je=t===Mr?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,va=t,Ce===null&&(ht=1,vc(e,_a(t,e.current)))}function Km(){var e=$t.current;return e===null?!0:(Re&4194048)===Re?Vt===null:(Re&62914560)===Re||(Re&536870912)!==0?e===Vt:!1}function Jm(){var e=ne.H;return ne.H=mc,e===null?mc:e}function Im(){var e=ne.A;return ne.A=np,e}function Uc(){ht=4,Ml||(Re&4194048)!==Re&&$t.current!==null||(In=!0),(Ul&134217727)===0&&(bn&134217727)===0||lt===null||Bl(lt,Re,ya,!1)}function mo(e,t,a){var l=Xe;Xe|=2;var i=Jm(),c=Im();(lt!==e||Re!==t)&&(Dc=null,ai(e,t)),t=!1;var d=ht;e:do try{if(Je!==0&&Ce!==null){var b=Ce,_=va;switch(Je){case 8:ho(),d=6;break e;case 3:case 2:case 9:case 6:$t.current===null&&(t=!0);var R=Je;if(Je=0,va=null,li(e,b,_,R),a&&In){d=0;break e}break;default:R=Je,Je=0,va=null,li(e,b,_,R)}}cp(),d=ht;break}catch(U){Zm(e,U)}while(!0);return t&&e.shellSuspendCounter++,ul=sn=null,Xe=l,ne.H=i,ne.A=c,Ce===null&&(lt=null,Re=0,Gs()),d}function cp(){for(;Ce!==null;)Fm(Ce)}function up(e,t){var a=Xe;Xe|=2;var l=Jm(),i=Im();lt!==e||Re!==t?(Dc=null,Rc=ua()+500,ai(e,t)):In=xi(e,t);e:do try{if(Je!==0&&Ce!==null){t=Ce;var c=va;t:switch(Je){case 1:Je=0,va=null,li(e,t,c,1);break;case 2:case 9:if(Wf(c)){Je=0,va=null,Wm(t);break}t=function(){Je!==2&&Je!==9||lt!==e||(Je=7),Wa(e)},c.then(t,t);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:Wf(c)?(Je=0,va=null,Wm(t)):(Je=0,va=null,li(e,t,c,7));break;case 5:var d=null;switch(Ce.tag){case 26:d=Ce.memoizedState;case 5:case 27:var b=Ce;if(d?Gv(d):b.stateNode.complete){Je=0,va=null;var _=b.sibling;if(_!==null)Ce=_;else{var R=b.return;R!==null?(Ce=R,$c(R)):Ce=null}break t}}Je=0,va=null,li(e,t,c,5);break;case 6:Je=0,va=null,li(e,t,c,6);break;case 8:ho(),ht=6;break e;default:throw Error(r(462))}}rp();break}catch(U){Zm(e,U)}while(!0);return ul=sn=null,ne.H=l,ne.A=i,Xe=a,Ce!==null?0:(lt=null,Re=0,Gs(),ht)}function rp(){for(;Ce!==null&&!Tg();)Fm(Ce)}function Fm(e){var t=hm(e.alternate,e,ml);e.memoizedProps=e.pendingProps,t===null?$c(e):Ce=t}function Wm(e){var t=e,a=t.alternate;switch(t.tag){case 15:case 0:t=sm(a,t,t.pendingProps,t.type,void 0,Re);break;case 11:t=sm(a,t,t.pendingProps,t.type.render,t.ref,Re);break;case 5:xr(t);var l=t;l===Ot&&(Ee?(Js(l),l.tag===5&&l.stateNode!=null&&(it=l.stateNode)):(Js(l),Ee=!0));default:vm(a,t),t=Ce=Lf(t,ml),t=hm(a,t,ml)}e.memoizedProps=e.pendingProps,t===null?$c(e):Ce=t}function li(e,t,a,l){ul=sn=null,xr(t),Yn=null,Bi=0;var i=t.return;try{if(Ib(e,i,t,a,Re)){ht=1,vc(e,_a(a,e.current)),Ce=null;return}}catch(c){if(i!==null)throw Ce=i,c;ht=1,vc(e,_a(a,e.current)),Ce=null;return}t.flags&32768?(Ee||l===1?e=!0:In||(Re&536870912)!==0?e=!1:(Ml=e=!0,(l===2||l===9||l===3||l===6)&&(l=$t.current,l!==null&&l.tag===13&&(l.flags|=16384))),Pm(t,e)):$c(t)}function $c(e){var t=e;do{if((t.flags&32768)!==0){Pm(t,Ml);return}e=t.return;var a=ep(t.alternate,t,ml);if(a!==null){Ce=a;return}if(t=t.sibling,t!==null){Ce=t;return}Ce=t=e}while(t!==null);ht===0&&(ht=5)}function Pm(e,t){do{var a=tp(e.alternate,e);if(a!==null){a.flags&=32767,Ce=a;return}if(a=e.return,a!==null&&(a.flags|=32768,a.subtreeFlags=0,a.deletions=null),!t&&(e=e.sibling,e!==null)){Ce=e;return}Ce=e=a}while(e!==null);ht=6,Ce=null}function ev(e,t,a,l,i,c,d,b,_,R,U,Y){e.cancelPendingCommit=null;do Bc();while(dt!==0);if((Xe&6)!==0)throw Error(r(327));if(t!==null){if(t===e.current)throw Error(r(177));e===lt&&(Ce=lt=null,Re=0),pn=t,Ua=e,Fa=a,fo=i,Gm=l,op(e,t,a,d,b,_,Y)}}function op(e,t,a,l,i,c,d){var b=t.lanes|t.childLanes;if(oo=b,b|=Ku,Ug(e,a,b,l,i,c),Pn=null,(a&335544064)===a?(ei=Bb(e),l=10262):(ei=null,l=10256),(t.subtreeFlags&l)!==0||(t.flags&l)!==0?(e.callbackNode=null,e.callbackPriority=0,yp(Ts,function(){return bo(),null})):(e.callbackNode=null,e.callbackPriority=0),_c=!1,l=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||l){l=ne.T,ne.T=null,i=K.p,K.p=2,c=Xe,Xe|=4;try{ap(e,t,a)}finally{Xe=c,K.p=i,ne.T=l}}dt=1,_c?Wn=Up(d,e.containerInfo,ei,vo,yo,fp,go,bo,dp):(vo(),yo(),go())}function dp(e){if(dt!==0){var t=Ua.onRecoverableError;t(e,{componentStack:null})}}function fp(){dt===3&&(dt=0,Um(pn,Ua),dt=4)}function vo(){if(dt===1){dt=0;var e=Ua,t=pn,a=Fa,l=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||l){l=ne.T,ne.T=null;var i=K.p;K.p=2;var c=Xe;Xe|=4;try{Ii=Tc=!1,zm(t,e,a),a=wo;var d=Of(e.containerInfo),b=a.focusedElem,_=a.selectionRange;if(d!==b&&b&&b.ownerDocument&&wf(b.ownerDocument.documentElement,b)){if(_!==null&&Gu(b)){var R=_.start,U=_.end;if(U===void 0&&(U=R),"selectionStart"in b)b.selectionStart=R,b.selectionEnd=Math.min(U,b.value.length);else{var Y=b.ownerDocument||document,A=Y&&Y.defaultView||window;if(A.getSelection){var M=A.getSelection(),F=b.textContent.length,ce=Math.min(_.start,F),Se=_.end===void 0?ce:Math.min(_.end,F);!M.extend&&ce>Se&&(d=Se,Se=ce,ce=d);var O=Cf(b,ce),k=Cf(b,Se);if(O&&k&&(M.rangeCount!==1||M.anchorNode!==O.node||M.anchorOffset!==O.offset||M.focusNode!==k.node||M.focusOffset!==k.offset)){var z=Y.createRange();z.setStart(O.node,O.offset),M.removeAllRanges(),ce>Se?(M.addRange(z),M.extend(k.node,k.offset)):(z.setEnd(k.node,k.offset),M.addRange(z))}}}}for(Y=[],M=b;M=M.parentNode;)M.nodeType===1&&Y.push({element:M,left:M.scrollLeft,top:M.scrollTop});for(typeof b.focus=="function"&&b.focus(),b=0;b<Y.length;b++){var L=Y[b];L.element.scrollLeft=L.left,L.element.scrollTop=L.top}}di=!!Co,wo=Co=null}finally{Xe=c,K.p=i,ne.T=l}}e.current=t,dt=2}}function yo(){if(dt===2){dt=0;var e=Ua,t=pn,a=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||a){a=ne.T,ne.T=null;var l=K.p;K.p=2;var i=Xe;Xe|=4;try{Am(e,t.alternate,t)}finally{Xe=i,K.p=l,ne.T=a}}dt=3}}function go(){if(dt===4||dt===3){dt=0;var e=Wn;Wn=null,Eg();var t=Ua,a=pn,l=Fa,i=Gm,c=(l&335544064)===l?10262:10256;if((a.subtreeFlags&c)!==0||(a.flags&c)!==0?dt=5:(dt=0,pn=Ua=null,tv(t,t.pendingLanes)),c=t.pendingLanes,c===0&&($l=null),Nu(l),a=a.stateNode,ra&&typeof ra.onCommitFiberRoot=="function")try{ra.onCommitFiberRoot(pi,a,void 0,(a.current.flags&128)===128)}catch{}if(i!==null){a=ne.T,c=K.p,K.p=2,ne.T=null;try{for(var d=t.onRecoverableError,b=0;b<i.length;b++){var _=i[b];d(_.value,{componentStack:_.stack})}}finally{ne.T=a,K.p=c}}if(i=Pn,d=ei,ei=null,i!==null&&(Pn=null,d===null&&(d=[]),e!==null))for(_=0;_<i.length;_++)a=(0,i[_])(d),a!==void 0&&e.finished.finally(a);(Fa&3)!==0&&Bc(),Wa(t),c=t.pendingLanes,(l&261930)!==0&&(c&42)!==0?t===zc?es++:(es=0,zc=t):(es=0,zc=null),ts(0)}}function tv(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Mi(t)))}function Bc(){return Wn!==null&&(Wn.skipTransition(),Wn=null),vo(),yo(),go(),bo()}function bo(){if(dt!==5)return!1;var e=Ua,t=oo;oo=0;var a=Nu(Fa),l=ne.T,i=K.p;try{K.p=32>a?32:a,ne.T=null,a=fo,fo=null;var c=Ua,d=Fa;if(dt=0,pn=Ua=null,Fa=0,(Xe&6)!==0)throw Error(r(331));var b=Xe;if(Xe|=4,Hm(c.current),$m(c,c.current,d,a),Xe=b,ts(0,!1),ra&&typeof ra.onPostCommitFiberRoot=="function")try{ra.onPostCommitFiberRoot(pi,c)}catch{}return!0}finally{K.p=i,ne.T=l,tv(e,t)}}function av(e,t,a){t=_a(a,t),t=zr(e.stateNode,t,2),e=Cl(e,t,2),e!==null&&(ji(e,2),Wa(e))}function Ie(e,t,a){if(e.tag===3)av(e,e,a);else for(;t!==null;){if(t.tag===3){av(t,e,a);break}else if(t.tag===1){var l=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof l.componentDidCatch=="function"&&($l===null||!$l.has(l))){e=_a(a,e),a=Wh(2),l=Cl(t,a,2),l!==null&&(Ph(a,l,t,e),ji(l,2),Wa(l));break}}t=t.return}}function po(e,t,a){var l=e.pingCache;if(l===null){l=e.pingCache=new ip;var i=new Set;l.set(t,i)}else i=l.get(t),i===void 0&&(i=new Set,l.set(t,i));i.has(a)||(uo=!0,i.add(a),e=hp.bind(null,e,t,a),t.then(e,e))}function hp(e,t,a){var l=e.pingCache;l!==null&&l.delete(t),e.pingedLanes|=e.suspendedLanes&a,e.warmLanes&=~a,lt===e&&(Re&a)===a&&((ht===4||ht===3&&(Re&62914560)===Re&&300>ua()-Oc)&&(Xe&2)===0?ai(e,0):wc|=a,Fn===Re&&(Fn=0)),Wa(e)}function lv(e,t){t===0&&(t=Ld()),e=an(e,t),e!==null&&(ji(e,t),Wa(e))}function mp(e){var t=e.memoizedState,a=0;t!==null&&(a=t.retryLane),lv(e,a)}function vp(e,t){var a=0;switch(e.tag){case 31:case 13:var l=e.stateNode,i=e.memoizedState;i!==null&&(a=i.retryLane);break;case 19:l=e.stateNode;break;case 22:l=e.stateNode._retryCache;break;default:throw Error(r(314))}l!==null&&l.delete(t),lv(e,a)}function yp(e,t){return ju(e,t)}var ni=null,ii=null,xo=!1,qc=!1,jo=!1,ql=0;function Wa(e){e!==ii&&e.next===null&&(ii===null?ni=ii=e:ii=ii.next=e),qc=!0,xo||(xo=!0,bp())}function ts(e,t){if(!jo&&qc){jo=!0;do for(var a=!1,l=ni;l!==null;){if(e!==0){var i=l.pendingLanes;if(i===0)var c=0;else{var d=l.suspendedLanes,b=l.pingedLanes;c=(1<<31-oa(42|e)+1)-1,c&=i&~(d&~b),c=c&201326741?c&201326741|1:c?c|2:0}c!==0&&(a=!0,cv(l,c))}else c=Re,c=ws(l,l===lt?c:0,l.cancelPendingCommit!==null||l.timeoutHandle!==-1),(c&3)===0||xi(l,c)||(a=!0,cv(l,c));l=l.next}while(a);jo=!1}}function gp(){nv()}function nv(){qc=xo=!1;var e=0;ql!==0&&Cp()&&(e=ql);for(var t=ua(),a=null,l=ni;l!==null;){var i=l.next,c=iv(l,t);c===0?(l.next=null,a===null?ni=i:a.next=i,i===null&&(ii=a)):(a=l,(e!==0||(c&3)!==0)&&(qc=!0)),l=i}dt!==0&&dt!==5||ts(e),ql!==0&&(ql=0)}function iv(e,t){for(var a=e.suspendedLanes,l=e.pingedLanes,i=e.expirationTimes,c=e.pendingLanes&-62914561;0<c;){var d=31-oa(c),b=1<<d,_=i[d];_===-1?((b&a)===0||(b&l)!==0)&&(i[d]=Mg(b,t)):_<=t&&(e.expiredLanes|=b),c&=~b}if(t=lt,a=Re,a=ws(e,e===t?a:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l=e.callbackNode,a===0||e===t&&(Je===2||Je===9)||e.cancelPendingCommit!==null)return l!==null&&l!==null&&Su(l),e.callbackNode=null,e.callbackPriority=0;if((a&3)===0||xi(e,a)){if(t=a&-a,t===e.callbackPriority)return t;switch(l!==null&&Su(l),Nu(a)){case 2:case 8:a=Bd;break;case 32:a=Ts;break;case 268435456:a=qd;break;default:a=Ts}return l=sv.bind(null,e),a=ju(a,l),e.callbackPriority=t,e.callbackNode=a,t}return l!==null&&l!==null&&Su(l),e.callbackPriority=2,e.callbackNode=null,2}function sv(e,t){if(dt!==0&&dt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var a=e.callbackNode;if(Bc()&&e.callbackNode!==a)return null;var l=Re;return l=ws(e,e===lt?l:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),l===0?null:(Xm(e,l,t),iv(e,ua()),e.callbackNode!=null&&e.callbackNode===a?sv.bind(null,e):null)}function cv(e,t){if(Bc())return null;Xm(e,t,!0)}function bp(){Op(function(){(Xe&6)!==0?ju($d,gp):nv()})}function So(){if(ql===0){var e=rn;e===0&&(e=Es,Es<<=1,(Es&261888)===0&&(Es=256)),ql=e}return ql}function uv(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:Ms(e)}function pp(e,t,a,l,i){if(t==="submit"&&a&&a.stateNode===i){var c=uv((i[Pt]||null).action),d=l.submitter;d&&(t=(t=d[Pt]||null)?uv(t.formAction):d.getAttribute("formAction"),t!==null&&(c=t,d=null));var b=new qs("action","action",null,l,i);e.push({event:b,listeners:[{instance:null,listener:function(){if(l.defaultPrevented){if(ql!==0){var _=new FormData(i,d);Cr(a,{pending:!0,data:_,method:i.method,action:c},null,_)}}else typeof c=="function"&&(b.preventDefault(),_=new FormData(i,d),Cr(a,{pending:!0,data:_,method:i.method,action:c},c,_))},currentTarget:i}]})}}for(var _o=0;_o<Zu.length;_o++){var ko=Zu[_o],xp=ko.toLowerCase(),jp=ko[0].toUpperCase()+ko.slice(1);Ra(xp,"on"+jp)}Ra(zf,"onAnimationEnd"),Ra(Mf,"onAnimationIteration"),Ra(Uf,"onAnimationStart"),Ra("dblclick","onDoubleClick"),Ra("focusin","onFocus"),Ra("focusout","onBlur"),Ra(wb,"onTransitionRun"),Ra(Ob,"onTransitionStart"),Ra(Rb,"onTransitionCancel"),Ra($f,"onTransitionEnd"),En("onMouseEnter",["mouseout","mouseover"]),En("onMouseLeave",["mouseout","mouseover"]),En("onPointerEnter",["pointerout","pointerover"]),En("onPointerLeave",["pointerout","pointerover"]),Pl("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Pl("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Pl("onBeforeInput",["compositionend","keypress","textInput","paste"]),Pl("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Pl("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Pl("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var as="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(" "),Sp=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(as));function rv(e,t){t=(t&4)!==0;for(var a=0;a<e.length;a++){var l=e[a],i=l.event;l=l.listeners;e:{var c=void 0;if(t)for(var d=l.length-1;0<=d;d--){var b=l[d],_=b.instance,R=b.currentTarget;if(b=b.listener,_!==c&&i.isPropagationStopped())break e;c=b,i.currentTarget=R;try{c(i)}catch(U){Ys(U)}i.currentTarget=null,c=_}else for(d=0;d<l.length;d++){if(b=l[d],_=b.instance,R=b.currentTarget,b=b.listener,_!==c&&i.isPropagationStopped())break e;c=b,i.currentTarget=R;try{c(i)}catch(U){Ys(U)}i.currentTarget=null,c=_}}}}function we(e,t){var a=t[Zd];a===void 0&&(a=t[Zd]=new Set);var l=e+"__bubble";a.has(l)||(ov(t,e,2,!1),a.add(l))}function No(e,t,a){var l=0;t&&(l|=4),ov(a,e,l,t)}var Hc="_reactListening"+Math.random().toString(36).slice(2);function To(e){if(!e[Hc]){e[Hc]=!0,Id.forEach(function(a){a!=="selectionchange"&&(Sp.has(a)||No(a,!1,e),No(a,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Hc]||(t[Hc]=!0,No("selectionchange",!1,t))}}function ov(e,t,a,l){switch(Pv(t)){case 2:var i=m0;break;case 8:i=v0;break;default:i=Qo}a=i.bind(null,t,a,e),i=void 0,!Du||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),l?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 Eo(e,t,a,l,i){var c=l;if((t&1)===0&&(t&2)===0&&l!==null)e:for(;;){if(l===null)return;var d=l.tag;if(d===3||d===4){var b=l.stateNode.containerInfo;if(b===i)break;if(d===4)for(d=l.return;d!==null;){var _=d.tag;if((_===3||_===4)&&d.stateNode.containerInfo===i)return;d=d.return}for(;b!==null;){if(d=Wl(b),d===null)return;if(_=d.tag,_===5||_===6||_===26||_===27){l=c=d;continue e}b=b.parentNode}}l=l.return}of(function(){var R=c,U=Ou(a),Y=[];e:{var A=Bf.get(e);if(A!==void 0){var M=qs,F=e;switch(e){case"keypress":if($s(a)===0)break e;case"keydown":case"keyup":M=sb;break;case"focusin":F="focus",M=$u;break;case"focusout":F="blur",M=$u;break;case"beforeblur":case"afterblur":M=$u;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":M=hf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":M=Kg;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":M=db;break;case zf:case Mf:case Uf:M=Fg;break;case $f:M=hb;break;case"scroll":case"scrollend":M=Qg;break;case"wheel":M=vb;break;case"copy":case"cut":case"paste":M=Pg;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":M=vf;break;case"submit":M=rb;break;case"toggle":case"beforetoggle":M=gb}var ce=(t&4)!==0,Se=!ce&&(e==="scroll"||e==="scrollend"),O=ce?A!==null?A+"Capture":null:A;ce=[];for(var k=R,z;k!==null;){var L=k;if(z=L.stateNode,L=L.tag,L!==5&&L!==26&&L!==27||z===null||O===null||(L=ki(k,O),L!=null&&ce.push(ls(k,L,z))),Se)break;k=k.return}0<ce.length&&(A=new M(A,F,null,a,U),Y.push({event:A,listeners:ce}))}}if((t&7)===0){e:{if(M=e==="mouseover"||e==="pointerover",A=e==="mouseout"||e==="pointerout",M&&a!==wu&&(F=a.relatedTarget||a.fromElement)&&(Wl(F)||F[kn]))break e;(A||M)&&(F=U.window===U?U:(M=U.ownerDocument)?M.defaultView||M.parentWindow:window,A?(M=a.relatedTarget||a.toElement,A=R,M=M?Wl(M):null,M!==null&&(Se=h(M),ce=M.tag,M!==Se||ce!==5&&ce!==27&&ce!==6)&&(M=null)):(A=null,M=R),A!==M&&(ce=hf,L="onMouseLeave",O="onMouseEnter",k="mouse",(e==="pointerout"||e==="pointerover")&&(ce=vf,L="onPointerLeave",O="onPointerEnter",k="pointer"),Se=A==null?F:_i(A),z=M==null?F:_i(M),F=new ce(L,k+"leave",A,a,U),F.target=Se,F.relatedTarget=z,L=null,Wl(U)===R&&(ce=new ce(O,k+"enter",M,a,U),ce.target=z,ce.relatedTarget=Se,L=ce),Se=L,ce=A&&M?ae(A,M,_p):null,A!==null&&dv(Y,F,A,ce,!1),M!==null&&Se!==null&&dv(Y,Se,M,ce,!0)))}e:{if(A=R?_i(R):window,M=A.nodeName&&A.nodeName.toLowerCase(),M==="select"||M==="input"&&A.type==="file")var le=_f;else if(jf(A))if(kf)le=Eb;else{le=Nb;var De=kb}else M=A.nodeName,!M||M.toLowerCase()!=="input"||A.type!=="checkbox"&&A.type!=="radio"?R&&Cu(R.elementType)&&(le=_f):le=Tb;if(le&&(le=le(e,R))){Sf(Y,le,a,U);break e}De&&De(e,A,R)}switch(De=R?_i(R):window,e){case"focusin":(jf(De)||De.contentEditable==="true")&&(Dn=De,Vu=R,Ri=null);break;case"focusout":Ri=Vu=Dn=null;break;case"mousedown":Xu=!0;break;case"contextmenu":case"mouseup":case"dragend":Xu=!1,Rf(Y,a,U);break;case"selectionchange":if(Cb)break;case"keydown":case"keyup":Rf(Y,a,U)}var fe;if(qu)e:{switch(e){case"compositionstart":var ve="onCompositionStart";break e;case"compositionend":ve="onCompositionEnd";break e;case"compositionupdate":ve="onCompositionUpdate";break e}ve=void 0}else Rn?pf(e,a)&&(ve="onCompositionEnd"):e==="keydown"&&a.keyCode===229&&(ve="onCompositionStart");ve&&(yf&&a.locale!=="ko"&&(Rn||ve!=="onCompositionStart"?ve==="onCompositionEnd"&&Rn&&(fe=df()):(xl=U,zu="value"in xl?xl.value:xl.textContent,Rn=!0)),De=Lc(R,ve),0<De.length&&(ve=new mf(ve,e,null,a,U),Y.push({event:ve,listeners:De}),fe?ve.data=fe:(fe=xf(a),fe!==null&&(ve.data=fe)))),(fe=pb?xb(e,a):jb(e,a))&&(ve=Lc(R,"onBeforeInput"),0<ve.length&&(De=new mf("onBeforeInput","beforeinput",null,a,U),Y.push({event:De,listeners:ve}),De.data=fe)),pp(Y,e,R,a,U)}rv(Y,t)})}function ls(e,t,a){return{instance:e,listener:t,currentTarget:a}}function Lc(e,t){for(var a=t+"Capture",l=[];e!==null;){var i=e,c=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||c===null||(i=ki(e,a),i!=null&&l.unshift(ls(e,i,c)),i=ki(e,t),i!=null&&l.push(ls(e,i,c))),e.tag===3)return l;e=e.return}return[]}function _p(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function dv(e,t,a,l,i){for(var c=t._reactName,d=[];a!==null&&a!==l;){var b=a,_=b.alternate,R=b.stateNode;if(b=b.tag,_!==null&&_===l)break;b!==5&&b!==26&&b!==27||R===null||(_=R,i?(R=ki(a,c),R!=null&&d.unshift(ls(a,R,_))):i||(R=ki(a,c),R!=null&&d.push(ls(a,R,_)))),a=a.return}d.length!==0&&e.push({event:t,listeners:d})}var kp=/\r\n?/g,Np=/\u0000|\uFFFD/g;function fv(e){return(typeof e=="string"?e:""+e).replace(kp,`
|
|
9
|
+
`).replace(Np,"")}function hv(e,t){return t=fv(t),fv(e)===t}function Fe(e,t,a,l,i,c){switch(a){case"children":if(typeof l=="string")t==="body"||t==="textarea"&&l===""||Cn(e,l);else if(typeof l=="number"||typeof l=="bigint")t!=="body"&&Cn(e,""+l);else return;break;case"className":zs(e,"class",l);break;case"tabIndex":zs(e,"tabindex",l);break;case"dir":case"role":case"viewBox":case"width":case"height":zs(e,a,l);break;case"style":uf(e,l,c);return;case"data":if(t!=="object"){zs(e,"data",l);break}case"src":case"href":if(l===""&&(t!=="a"||a!=="href")){e.removeAttribute(a);break}if(l==null||typeof l=="function"||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Ms(l),e.setAttribute(a,l);break;case"action":case"formAction":if(typeof l=="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 c=="function"&&(a==="formAction"?(t!=="input"&&Fe(e,t,"name",i.name,i,null),Fe(e,t,"formEncType",i.formEncType,i,null),Fe(e,t,"formMethod",i.formMethod,i,null),Fe(e,t,"formTarget",i.formTarget,i,null)):(Fe(e,t,"encType",i.encType,i,null),Fe(e,t,"method",i.method,i,null),Fe(e,t,"target",i.target,i,null)));if(l==null||typeof l=="symbol"||typeof l=="boolean"){e.removeAttribute(a);break}l=Ms(l),e.setAttribute(a,l);break;case"onClick":l!=null&&(e.onclick=Ya);return;case"onScroll":l!=null&&we("scroll",e);return;case"onScrollEnd":l!=null&&we("scrollend",e);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(a=l.__html,a!=null){if(i.children!=null)throw Error(r(60));c?.__html!==a&&(e.innerHTML=a)}}break;case"multiple":e.multiple=l&&typeof l!="function"&&typeof l!="symbol";break;case"muted":e.muted=l&&typeof l!="function"&&typeof l!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(l==null||typeof l=="function"||typeof l=="boolean"||typeof l=="symbol"){e.removeAttribute("xlink:href");break}a=Ms(l),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":l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"credentialless":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":l&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,""):e.removeAttribute(a);break;case"capture":case"download":l===!0?e.setAttribute(a,""):l!==!1&&l!=null&&typeof l!="function"&&typeof l!="symbol"?e.setAttribute(a,l):e.removeAttribute(a);break;case"cols":case"rows":case"size":case"span":l!=null&&typeof l!="function"&&typeof l!="symbol"&&!isNaN(l)&&1<=l?e.setAttribute(a,l):e.removeAttribute(a);break;case"rowSpan":case"start":l==null||typeof l=="function"||typeof l=="symbol"||isNaN(l)?e.removeAttribute(a):e.setAttribute(a,l);break;case"popover":we("beforetoggle",e),we("toggle",e),Ds(e,"popover",l);break;case"xlinkActuate":al(e,"http://www.w3.org/1999/xlink","xlink:actuate",l);break;case"xlinkArcrole":al(e,"http://www.w3.org/1999/xlink","xlink:arcrole",l);break;case"xlinkRole":al(e,"http://www.w3.org/1999/xlink","xlink:role",l);break;case"xlinkShow":al(e,"http://www.w3.org/1999/xlink","xlink:show",l);break;case"xlinkTitle":al(e,"http://www.w3.org/1999/xlink","xlink:title",l);break;case"xlinkType":al(e,"http://www.w3.org/1999/xlink","xlink:type",l);break;case"xmlBase":al(e,"http://www.w3.org/XML/1998/namespace","xml:base",l);break;case"xmlLang":al(e,"http://www.w3.org/XML/1998/namespace","xml:lang",l);break;case"xmlSpace":al(e,"http://www.w3.org/XML/1998/namespace","xml:space",l);break;case"is":Ds(e,"is",l);break;case"innerText":case"textContent":return;default:if(!(2<a.length)||a[0]!=="o"&&a[0]!=="O"||a[1]!=="n"&&a[1]!=="N")a=Vg.get(a)||a,Ds(e,a,l);else return}Ge=!0}function Ao(e,t,a,l,i,c){switch(a){case"style":uf(e,l,c);return;case"dangerouslySetInnerHTML":if(l!=null){if(typeof l!="object"||!("__html"in l))throw Error(r(61));if(a=l.__html,a!=null){if(i.children!=null)throw Error(r(60));c?.__html!==a&&(e.innerHTML=a)}}break;case"children":if(typeof l=="string")Cn(e,l);else if(typeof l=="number"||typeof l=="bigint")Cn(e,""+l);else return;break;case"onScroll":l!=null&&we("scroll",e);return;case"onScrollEnd":l!=null&&we("scrollend",e);return;case"onClick":l!=null&&(e.onclick=Ya);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Fd.hasOwnProperty(a))e:{if(a[0]==="o"&&a[1]==="n"&&(i=a.endsWith("Capture"),c=a.slice(2,i?a.length-7:void 0),t=e[Pt]||null,t=t!=null?t[a]:null,typeof t=="function"&&e.removeEventListener(c,t,i),typeof l=="function")){typeof t!="function"&&t!==null&&(a in e?e[a]=null:e.hasAttribute(a)&&e.removeAttribute(a)),e.addEventListener(c,l,i);break e}Ge=!0,a in e?e[a]=l:l===!0?e.setAttribute(a,""):Ds(e,a,l)}return}Ge=!0}function Ht(e,t,a){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":we("error",e),we("load",e);var l=!1,i=!1,c;for(c in a)if(a.hasOwnProperty(c)){var d=a[c];if(d!=null)switch(c){case"src":l=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Fe(e,t,c,d,a,null)}}i&&Fe(e,t,"srcSet",a.srcSet,a,null),l&&Fe(e,t,"src",a.src,a,null);return;case"input":we("invalid",e);var b=c=d=i=null,_=null,R=null;for(l in a)if(a.hasOwnProperty(l)){var U=a[l];if(U!=null)switch(l){case"name":i=U;break;case"type":d=U;break;case"checked":_=U;break;case"defaultChecked":R=U;break;case"value":c=U;break;case"defaultValue":b=U;break;case"children":case"dangerouslySetInnerHTML":if(U!=null)throw Error(r(137,t));break;default:Fe(e,t,l,U,a,null)}}lf(e,c,b,_,R,d,i,!1);return;case"select":we("invalid",e),l=d=c=null;for(i in a)if(a.hasOwnProperty(i)&&(b=a[i],b!=null))switch(i){case"value":c=b;break;case"defaultValue":d=b;break;case"multiple":l=b;default:Fe(e,t,i,b,a,null)}t=c,a=d,e.multiple=!!l,t!=null?An(e,!!l,t,!1):a!=null&&An(e,!!l,a,!0);return;case"textarea":we("invalid",e),c=i=l=null;for(d in a)if(a.hasOwnProperty(d)&&(b=a[d],b!=null))switch(d){case"value":l=b;break;case"defaultValue":i=b;break;case"children":c=b;break;case"dangerouslySetInnerHTML":if(b!=null)throw Error(r(91));break;default:Fe(e,t,d,b,a,null)}sf(e,l,i,c);return;case"option":for(_ in a)a.hasOwnProperty(_)&&(l=a[_],l!=null)&&(_==="selected"?e.selected=l&&typeof l!="function"&&typeof l!="symbol":Fe(e,t,_,l,a,null));return;case"dialog":we("beforetoggle",e),we("toggle",e),we("cancel",e),we("close",e);break;case"iframe":case"object":we("load",e);break;case"video":case"audio":for(l=0;l<as.length;l++)we(as[l],e);break;case"image":we("error",e),we("load",e);break;case"details":we("toggle",e);break;case"embed":case"source":case"link":we("error",e),we("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(R in a)if(a.hasOwnProperty(R)&&(l=a[R],l!=null))switch(R){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,t));default:Fe(e,t,R,l,a,null)}return;default:if(Cu(t)){for(U in a)a.hasOwnProperty(U)&&(l=a[U],l!==void 0&&Ao(e,t,U,l,a,void 0));return}}for(b in a)a.hasOwnProperty(b)&&(l=a[b],l!=null&&Fe(e,t,b,l,a,null))}var Tp={};function Ep(e,t,a,l){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,c=null,d=null,b=null,_=null,R=null,U=null;for(M in a){var Y=a[M];if(a.hasOwnProperty(M)&&Y!=null)switch(M){case"checked":break;case"value":break;case"defaultValue":_=Y;default:l.hasOwnProperty(M)||Fe(e,t,M,null,l,Y)}}for(var A in l){var M=l[A];if(Y=a[A],l.hasOwnProperty(A)&&(M!=null||Y!=null))switch(A){case"type":M!==Y&&(Ge=!0),c=M;break;case"name":M!==Y&&(Ge=!0),i=M;break;case"checked":M!==Y&&(Ge=!0),R=M;break;case"defaultChecked":M!==Y&&(Ge=!0),U=M;break;case"value":M!==Y&&(Ge=!0),d=M;break;case"defaultValue":M!==Y&&(Ge=!0),b=M;break;case"children":case"dangerouslySetInnerHTML":if(M!=null)throw Error(r(137,t));break;default:M!==Y&&Fe(e,t,A,M,l,Y)}}Eu(e,d,b,_,R,U,c,i);return;case"select":M=d=b=A=null;for(c in a)if(_=a[c],a.hasOwnProperty(c)&&_!=null)switch(c){case"value":break;case"multiple":M=_;default:l.hasOwnProperty(c)||Fe(e,t,c,null,l,_)}for(i in l)if(c=l[i],_=a[i],l.hasOwnProperty(i)&&(c!=null||_!=null))switch(i){case"value":c!==_&&(Ge=!0),A=c;break;case"defaultValue":c!==_&&(Ge=!0),b=c;break;case"multiple":c!==_&&(Ge=!0),d=c;default:c!==_&&Fe(e,t,i,c,l,_)}t=b,a=d,l=M,A!=null?An(e,!!a,A,!1):!!l!=!!a&&(t!=null?An(e,!!a,t,!0):An(e,!!a,a?[]:"",!1));return;case"textarea":M=A=null;for(b in a)if(i=a[b],a.hasOwnProperty(b)&&i!=null&&!l.hasOwnProperty(b))switch(b){case"value":break;case"children":break;default:Fe(e,t,b,null,l,i)}for(d in l)if(i=l[d],c=a[d],l.hasOwnProperty(d)&&(i!=null||c!=null))switch(d){case"value":i!==c&&(Ge=!0),A=i;break;case"defaultValue":i!==c&&(Ge=!0),M=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(r(91));break;default:i!==c&&Fe(e,t,d,i,l,c)}nf(e,A,M);return;case"option":for(var F in a)A=a[F],a.hasOwnProperty(F)&&A!=null&&!l.hasOwnProperty(F)&&(F==="selected"?e.selected=!1:Fe(e,t,F,null,l,A));for(_ in l)A=l[_],M=a[_],l.hasOwnProperty(_)&&A!==M&&(A!=null||M!=null)&&(_==="selected"?(A!==M&&(Ge=!0),e.selected=A&&typeof A!="function"&&typeof A!="symbol"):Fe(e,t,_,A,l,M));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 ce in a)A=a[ce],a.hasOwnProperty(ce)&&A!=null&&!l.hasOwnProperty(ce)&&Fe(e,t,ce,null,l,A);for(R in l)if(A=l[R],M=a[R],l.hasOwnProperty(R)&&A!==M&&(A!=null||M!=null))switch(R){case"children":case"dangerouslySetInnerHTML":if(A!=null)throw Error(r(137,t));break;default:Fe(e,t,R,A,l,M)}return;default:if(Cu(t)){for(var Se in a)A=a[Se],a.hasOwnProperty(Se)&&A!==void 0&&!l.hasOwnProperty(Se)&&Ao(e,t,Se,void 0,l,A);for(U in l)A=l[U],M=a[U],!l.hasOwnProperty(U)||A===M||A===void 0&&M===void 0||Ao(e,t,U,A,l,M);return}}for(var O in a)A=a[O],a.hasOwnProperty(O)&&A!=null&&!l.hasOwnProperty(O)&&Fe(e,t,O,null,l,A);for(Y in l)A=l[Y],M=a[Y],!l.hasOwnProperty(Y)||A===M||A==null&&M==null||Fe(e,t,Y,A,l,M)}function mv(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Ap(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,a=performance.getEntriesByType("resource"),l=0;l<a.length;l++){var i=a[l],c=i.transferSize,d=i.initiatorType,b=i.duration;if(c&&b&&mv(d)){for(d=0,b=i.responseEnd,l+=1;l<a.length;l++){var _=a[l],R=_.startTime;if(R>b)break;var U=_.transferSize,Y=_.initiatorType;U&&mv(Y)&&(_=_.responseEnd,d+=U*(_<b?1:(b-R)/(_-R)))}if(--l,t+=8*(c+d)/(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 Co=null,wo=null;function ns(e){return e.nodeType===9?e:e.ownerDocument}function vv(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 yv(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 gv(e,t,a,l){return a=ns(a).createElement(e),a[Mt]=l,a[Pt]=t,Ht(a,e,t),wt(a),a}function Oo(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 Ro=null;function Cp(){var e=window.event;return e&&e.type==="popstate"?e===Ro?!1:(Ro=e,!0):(Ro=null,!1)}var Do=typeof setTimeout=="function"?setTimeout:void 0,wp=typeof clearTimeout=="function"?clearTimeout:void 0,bv=typeof Promise=="function"?Promise:void 0,pv=typeof requestAnimationFrame=="function"?requestAnimationFrame:Do,Op=typeof queueMicrotask=="function"?queueMicrotask:typeof bv<"u"?function(e){return bv.resolve(null).then(e).catch(Rp)}:Do;function Rp(e){setTimeout(function(){throw e})}function Hl(e){return e==="head"}function xv(e,t){var a=t,l=0;do{var i=a.nextSibling;if(e.removeChild(a),i&&i.nodeType===8)if(a=i.data,a==="/$"||a==="/&"){if(l===0){e.removeChild(i),fi(t);return}l--}else if(a==="$"||a==="$?"||a==="$~"||a==="$!"||a==="&")l++;else if(a==="html")Lo(e.ownerDocument.documentElement);else if(a==="head"){a=e.ownerDocument.head,Lo(a);for(var c=a.firstChild;c;){var d=c.nextSibling,b=c.nodeName;c[Si]||b==="SCRIPT"||b==="STYLE"||b==="LINK"&&c.rel.toLowerCase()==="stylesheet"||a.removeChild(c),c=d}}else a==="body"&&Lo(e.ownerDocument.body);a=i}while(a);fi(t)}function jv(e,t){var a=e;e=0;do{var l=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||""),l&&l.nodeType===8)if(a=l.data,a==="/$"){if(e===0)break;e--}else a!=="$"&&a!=="$?"&&a!=="$~"&&a!=="$!"||e++;a=l}while(a)}function Sv(e,t,a){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,a!=null&&(e.style.viewTransitionClass=a),a=getComputedStyle(e),a.display==="inline"){if(t=e.getClientRects(),t.length===1)var l=1;else for(var i=l=0;i<t.length;i++){var c=t[i];0<c.width&&0<c.height&&l++}l===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+a.paddingTop,e.marginBottom="-"+a.paddingBottom)}}function _v(e,t){e=e.style,t=t.style;var a=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=a==null||typeof a=="boolean"?"":(""+a).trim(),a=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=a==null||typeof a=="boolean"?"":(""+a).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(a=t.display,e.display=a==null||typeof a=="boolean"?"":a,a=t.margin,a!=null?e.margin=a:(a=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=a==null||typeof a=="boolean"?"":a,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function Dp(e,t,a){return a=a.ownerDocument.defaultView,{rect:e,abs:t.position==="absolute"||t.position==="fixed",clip:t.clipPath!=="none"||t.overflow!=="visible"||t.filter!=="none"||t.mask!=="none"||t.mask!=="none"||t.borderRadius!=="0px",view:0<=e.bottom&&0<=e.right&&e.top<=a.innerHeight&&e.left<=a.innerWidth}}function zo(e){var t=e.getBoundingClientRect(),a=getComputedStyle(e);return Dp(t,a,e)}function zp(e){return e.documentElement.clientHeight}function Mp(e){this.addEventListener("load",e),this.addEventListener("error",e)}function Up(e,t,a,l,i,c,d,b,_){var R=t.nodeType===9?t:t.ownerDocument;try{var U=R.startViewTransition({update:function(){var A=R.defaultView,M=A.navigation&&A.navigation.transition,F=R.fonts.status;l();var ce=[];if(F==="loaded"&&(zp(R),R.fonts.status==="loading"&&ce.push(R.fonts.ready)),F=ce.length,e!==null)for(var Se=e.suspenseyImages,O=0,k=0;k<Se.length;k++){var z=Se[k];if(!z.complete){var L=z.getBoundingClientRect();if(0<L.bottom&&0<L.right&&L.top<A.innerHeight&&L.left<A.innerWidth){if(O+=Vv(z),O>Vc){ce.length=F;break}z=new Promise(Mp.bind(z)),ce.push(z)}}}if(0<ce.length)return A=Promise.race([Promise.all(ce),new Promise(function(le){return setTimeout(le,500)})]).then(i,i),(M?Promise.allSettled([M.finished,A]):A).then(c,c);if(i(),M)return M.finished.then(c,c);c()},types:a});R.__reactViewTransition=U;var Y=[];return U.ready.then(function(){for(var A=R.documentElement.getAnimations({subtree:!0}),M=0;M<A.length;M++){var F=A[M],ce=F.effect,Se=ce.pseudoElement;if(Se!=null&&Se.startsWith("::view-transition")){Y.push(F),F=ce.getKeyframes();for(var O=Se=void 0,k=!0,z=0;z<F.length;z++){var L=F[z],le=L.width;if(Se===void 0)Se=le;else if(Se!==le){k=!1;break}if(le=L.height,O===void 0)O=le;else if(O!==le){k=!1;break}delete L.width,delete L.height,L.transform==="none"&&delete L.transform}k&&Se!==void 0&&O!==void 0&&(ce.setKeyframes(F),k=getComputedStyle(ce.target,ce.pseudoElement),k.width!==Se||k.height!==O)&&(k=F[0],k.width=Se,k.height=O,k=F[F.length-1],k.width=Se,k.height=O,ce.setKeyframes(F))}}d()},function(A){R.__reactViewTransition===U&&(R.__reactViewTransition=null);try{typeof A=="object"&&A!==null&&A.name==="InvalidStateError"&&(A.message==="View transition was skipped because document visibility state is hidden."||A.message==="Skipping view transition because document visibility state has become hidden."||A.message==="Skipping view transition because viewport size changed."||A.message==="Transition was aborted because of invalid state")&&(A=null),A!==null&&_(A)}finally{l(),i(),d()}}),U.finished.finally(function(){for(var A=0;A<Y.length;A++)Y[A].cancel();R.__reactViewTransition===U&&(R.__reactViewTransition=null),b()}),U}catch{return l(),i(),d(),null}}function xn(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}xn.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:P({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},xn.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,a=e.getAnimations({subtree:!0}),l=[],i=0;i<a.length;i++){var c=a[i].effect;c!==null&&c.target===e&&c.pseudoElement===t&&l.push(a[i])}return l},xn.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function kv(e){return{name:e,group:new xn("group",e),imagePair:new xn("image-pair",e),old:new xn("old",e),new:new xn("new",e)}}function ba(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}ba.prototype.addEventListener=function(e,t,a){var l=null,i=null;if(!(a!=null&&typeof a!="boolean"&&(l=a.signal||null,l!==null&&l.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var c=this._eventListeners;if(Tv(c,e,t,a)===-1){var d=this,b=t;a!=null&&typeof a!="boolean"&&a.once===!0&&(b=function(_){d.removeEventListener(e,t,a),typeof t=="function"?t.call(this,_):t.handleEvent(_)}),l!==null&&(i=d.removeEventListener.bind(d,e,t,a),l.addEventListener("abort",i,{once:!0}),i=l.removeEventListener.bind(l,"abort",i)),l=si(a),c.push({type:e,listener:t,optionsOrUseCapture:a,attachedListener:b,cleanup:i}),y(this._fragmentFiber.child,!1,$p,e,b,l)}this._eventListeners=c}};function $p(e,t,a,l){return C(e).addEventListener(t,a,l),!1}ba.prototype.removeEventListener=function(e,t,a){var l=this._eventListeners;if(l!==null&&(t=Tv(l,e,t,a),t!==-1)){var i=l[t];a=i.attachedListener;var c=i.cleanup;i=si(i.optionsOrUseCapture),y(this._fragmentFiber.child,!1,Bp,e,a,i),l.splice(t,1),c!==null&&c()}};function Bp(e,t,a,l){return C(e).removeEventListener(t,a,l),!1}function si(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function Nv(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function Tv(e,t,a,l){if(e.length===0)return-1;l=Nv(l);for(var i=0;i<e.length;i++){var c=e[i];if(c.type===t&&c.listener===a&&Nv(c.optionsOrUseCapture)===l)return i}return-1}ba.prototype.dispatchEvent=function(e){var t=x(this._fragmentFiber);if(t===null)return!0;t=C(t);var a=this._eventListeners;if(a!==null&&0<a.length||!e.bubbles){var l=t.nodeType===9?t.createComment(""):document.createTextNode("");if(a)for(var i=0;i<a.length;i++){var c=a[i];l.addEventListener(c.type,c.attachedListener,si(c.optionsOrUseCapture))}if(t.appendChild(l),e=l.dispatchEvent(e),a)for(i=0;i<a.length;i++)c=a[i],l.removeEventListener(c.type,c.attachedListener,si(c.optionsOrUseCapture));return t.removeChild(l),e}return t.dispatchEvent(e)},ba.prototype.focus=function(e){y(this._fragmentFiber.child,!0,Ev,e,void 0,void 0)};function Ev(e,t){return e.tag===6?!1:(e=C(e),Ip(e,t))}ba.prototype.focusLast=function(e){var t=[];y(this._fragmentFiber.child,!0,Mo,t,void 0,void 0);for(var a=t.length-1;0<=a&&!Ev(t[a],e);a--);};function Mo(e,t){return t.push(e),!1}ba.prototype.blur=function(){var e=x(this._fragmentFiber);e!==null&&(e=C(e),e=ns(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,qp,e,void 0,void 0))};function qp(e,t){return e.tag===6?!1:(e=C(e),e===t||e.contains(t)?(t.blur(),!0):!1)}ba.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,Hp,e,void 0,void 0)};function Hp(e,t){return e.tag===6||(e=C(e),t.observe(e)),!1}ba.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),y(this._fragmentFiber.child,!1,Lp,e,void 0,void 0);for(var a=t=0;a<$a.length;a++){var l=$a[a];l.fragmentInstance===this&&l.observer===e?e.unobserve(l.instance):$a[t++]=l}$a.length=t}};function Lp(e,t){return e.tag===6||(e=C(e),t.unobserve(e)),!1}var $a=[],Uo=!1;function Yp(e,t,a){$a.push({fragmentInstance:e,observer:t,instance:a}),Uo||(Uo=!0,Fp(function(){Uo=!1;var l=$a;$a=[];for(var i=0;i<l.length;i++){var c=l[i];c.observer.unobserve(c.instance)}}))}ba.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,Gp,e,void 0,void 0),e};function Gp(e,t){if(e.tag===6){e=e.stateNode;var a=e.ownerDocument.createRange();a.selectNodeContents(e),t.push.apply(t,a.getClientRects())}else e=C(e),t.push.apply(t,e.getClientRects());return!1}ba.prototype.getRootNode=function(e){var t=x(this._fragmentFiber);return t===null?this:C(t).getRootNode(e)},ba.prototype.compareDocumentPosition=function(e){var t=x(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var a=[];y(this._fragmentFiber.child,!1,Mo,a,void 0,void 0);var l=C(t);if(a.length===0){if(a=l,T(this._fragmentFiber)){e:{for(t=this._fragmentFiber.return;t!==null;){if(t.tag===4){t=t.stateNode.containerInfo;break e}if(t.tag===3||t.tag===5||t.tag===27)break;t=t.return}t=null}t!=null&&(a=t)}t=this._fragmentFiber;var i=l=a.compareDocumentPosition(e);return a===e?i=Node.DOCUMENT_POSITION_CONTAINS:l&Node.DOCUMENT_POSITION_CONTAINED_BY&&(a=B(t)[1],a===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=C(a).compareDocumentPosition(e),i=e===0||e&Node.DOCUMENT_POSITION_FOLLOWING?Node.DOCUMENT_POSITION_FOLLOWING:Node.DOCUMENT_POSITION_PRECEDING)),i|=Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC}t=C(a[0]),i=C(a[a.length-1]);var c=T(this._fragmentFiber)?t.parentElement:l;if(c==null)return Node.DOCUMENT_POSITION_DISCONNECTED;l=c.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,c=c.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var d=t.compareDocumentPosition(e),b=i.compareDocumentPosition(e),_=d&Node.DOCUMENT_POSITION_CONTAINED_BY||b&Node.DOCUMENT_POSITION_CONTAINED_BY;return b=l&&c&&d&Node.DOCUMENT_POSITION_FOLLOWING&&b&Node.DOCUMENT_POSITION_PRECEDING,t=l&&t===e||c&&i===e||_||b?Node.DOCUMENT_POSITION_CONTAINED_BY:!l&&t===e||!c&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:d,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||Vp(t,this._fragmentFiber,a[0],a[a.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function Vp(e,t,a,l,i){var c=Wl(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(a=!!c)e:{for(;c!==null;){if(c.tag===7&&(c===t||c.alternate===t)){a=!0;break e}c=c.return}a=!1}return a}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(c===null)return c=i.ownerDocument,i===c||i===c.documentElement||i===c.body;e:{for(c=t,t=x(t);c!==null;){if(!(c.tag!==5&&c.tag!==3&&c.tag!==27||c!==t&&c.alternate!==t)){c=!0;break e}c=c.return}c=!1}return c}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!c)&&!(t=c===a)&&(t=ae(a,c,Z),t===null?t=!1:(y(t,!0,W,c,a),c=w,w=null,t=c!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!c)&&!(t=c===l)&&(t=ae(l,c,Z),t===null?t=!1:(y(t,!0,$,c,l),c=w,H=w=null,t=c!==null)),t):!1}function Av(e,t){var a=e.ownerDocument.createRange();a.selectNodeContents(e),e=a.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}ba.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(r(566));var t=[];y(this._fragmentFiber.child,!1,Mo,t,void 0,void 0);var a=e!==!1;if(t.length===0){var l=B(this._fragmentFiber);if(l=a?l[1]||l[0]||x(this._fragmentFiber):l[0]||l[1],l===null)return;if(l.tag===6){e=C(l),Av(e,a);return}if(l=C(l),l.nodeType!==9){if(l.nodeType===11){a="host"in l?l.host:null,a!==null&&a.scrollIntoView(e);return}l.scrollIntoView(e)}}for(l=a?t.length-1:0;l!==(a?-1:t.length);){var i=t[l];i.tag===6?(i=C(i),Av(i,a)):C(i).scrollIntoView(e),l+=a?-1:1}};function Xp(e,t){return e=C(e),Cv(e,t),!1}function Cv(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function wv(e,t){var a=t._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var i=a[l];e.addEventListener(i.type,i.attachedListener,si(i.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(c){for(var d=0,b=0;b<$a.length;b++){var _=$a[b];(_.fragmentInstance!==t||_.observer!==c||_.instance!==e)&&($a[d++]=_)}$a.length=d,c.observe(e)}),Cv(e,t))}function Qp(e,t){var a=t._eventListeners;if(a!==null)for(var l=0;l<a.length;l++){var i=a[l];e.removeEventListener(i.type,i.attachedListener,si(i.optionsOrUseCapture))}e.nodeType!==3&&(a=t._observers,a!==null&&a.forEach(function(c){typeof c.rootMargin=="string"?Yp(t,c,e):c.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function $o(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":$o(a),Rs(a);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(a.rel.toLowerCase()==="stylesheet")continue}e.removeChild(a)}}function Zp(e,t,a,l){for(;e.nodeType===1;){var i=a;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!l&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(l){if(!e[Si])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(c=e.getAttribute("rel"),c==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(c!==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(c=e.getAttribute("src"),(c!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&c&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var c=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===c)return e}else return e;if(e=Aa(e.nextSibling),e===null)break}return null}function Kp(e,t,a){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!a||(e=Aa(e.nextSibling),e===null))return null;return e}function Ov(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Aa(e.nextSibling),e===null))return null;return e}function Bo(e){return e.data==="$?"||e.data==="$~"}function qo(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function Jp(e,t){var a=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||a.readyState!=="loading")t();else{var l=function(){t(),a.removeEventListener("DOMContentLoaded",l)};a.addEventListener("DOMContentLoaded",l),e._reactRetry=l}}function Aa(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 Ho=null;function Rv(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var a=e.data;if(a==="/$"||a==="/&"){if(t===0)return Aa(e.nextSibling);t--}else a!=="$"&&a!=="$!"&&a!=="$?"&&a!=="$~"&&a!=="&"||t++}e=e.nextSibling}return null}function Dv(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 Ip(e,t){function a(){l=!0}if(e.ownerDocument.activeElement===e)return!0;var l=!1;try{e.ownerDocument.addEventListener("focus",a,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",a,!0)}return l}function Fp(e){pv(function(){pv(function(t){return e(t)})})}function zv(e,t,a){switch(t=ns(a),e){case"html":if(e=t.documentElement,!e)throw Error(r(452));return e;case"head":if(e=t.head,!e)throw Error(r(453));return e;case"body":if(e=t.body,!e)throw Error(r(454));return e;default:throw Error(r(451))}}function Mv(e,t,a){for(var l in a){var i=a[l];a.hasOwnProperty(l)&&i!=null&&Fe(e,t,l,null,Tp,i)}a.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Ya&&(e.onclick=null),Rs(e)}function Lo(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);Rs(e)}var Ca=new Map,Uv=new Set;function is(e){if(typeof e.getRootNode=="function"){var t=e.getRootNode();if(t.nodeType===9||t.nodeType===11)return t}return e.nodeType===9?e:e.ownerDocument}var vl=K.d;K.d={f:Wp,r:Pp,D:e0,C:t0,L:a0,m:l0,X:i0,S:n0,M:s0};function Wp(){var e=vl.f(),t=Mc();return e||t}function Pp(e){var t=Nn(e);t!==null&&t.tag===5&&t.type==="form"?Bh(t):vl.r(e)}var ci=typeof document>"u"?null:document;function $v(e,t,a){var l=ci;if(l&&typeof t=="string"&&t){var i=ja(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof a=="string"&&(i+='[crossorigin="'+a+'"]'),Uv.has(i)||(Uv.add(i),e={rel:e,crossOrigin:a,href:t},l.querySelector(i)===null&&(t=l.createElement("link"),Ht(t,"link",e),wt(t),l.head.appendChild(t)))}}function e0(e){vl.D(e),$v("dns-prefetch",e,null)}function t0(e,t){vl.C(e,t),$v("preconnect",e,t)}function a0(e,t,a){vl.L(e,t,a);var l=ci;if(l&&e&&t){var i='link[rel="preload"][as="'+ja(t)+'"]';t==="image"&&a&&a.imageSrcSet?(i+='[imagesrcset="'+ja(a.imageSrcSet)+'"]',typeof a.imageSizes=="string"&&(i+='[imagesizes="'+ja(a.imageSizes)+'"]')):i+='[href="'+ja(e)+'"]';var c=i;switch(t){case"style":c=ui(e);break;case"script":c=ri(e)}if(!(Ca.has(c)||(e=P({rel:"preload",href:t==="image"&&a&&a.imageSrcSet?void 0:e,as:t},a),Ca.set(c,e),l.querySelector(i)!==null||t==="style"&&l.querySelector(ss(c))||t==="script"&&l.querySelector(cs(c))))){var d=l.createElement("link");Ht(d,"link",e),t==="style"&&(d[Os]=!0,d.onload=d.onerror=function(){Jd(d)}),wt(d),l.head.appendChild(d)}}}function l0(e,t){vl.m(e,t);var a=ci;if(a&&e){var l=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+ja(l)+'"][href="'+ja(e)+'"]',c=i;switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":c=ri(e)}if(!Ca.has(c)&&(e=P({rel:"modulepreload",href:e},t),Ca.set(c,e),a.querySelector(i)===null)){switch(l){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(a.querySelector(cs(c)))return}l=a.createElement("link"),Ht(l,"link",e),wt(l),a.head.appendChild(l)}}}function n0(e,t,a){vl.S(e,t,a);var l=ci;if(l&&e){var i=Tn(l).hoistableStyles,c=ui(e);t=t||"default";var d=i.get(c);if(!d){var b={loading:0,preload:null};if(d=l.querySelector(ss(c)))b.loading=5;else{e=P({rel:"stylesheet",href:e,"data-precedence":t},a),(a=Ca.get(c))&&Yo(e,a);var _=d=l.createElement("link");wt(_),Ht(_,"link",e),_._p=new Promise(function(R,U){_.onload=R,_.onerror=U}),_.addEventListener("load",function(){b.loading|=1}),_.addEventListener("error",function(){b.loading|=2}),b.loading|=4,Yc(d,t,l)}d={type:"stylesheet",instance:d,count:1,state:b},i.set(c,d)}}}function i0(e,t){vl.X(e,t);var a=ci;if(a&&e){var l=Tn(a).hoistableScripts,i=ri(e),c=l.get(i);c||(c=a.querySelector(cs(i)),c||(e=P({src:e,async:!0},t),(t=Ca.get(i))&&Go(e,t),c=a.createElement("script"),wt(c),Ht(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function s0(e,t){vl.M(e,t);var a=ci;if(a&&e){var l=Tn(a).hoistableScripts,i=ri(e),c=l.get(i);c||(c=a.querySelector(cs(i)),c||(e=P({src:e,async:!0,type:"module"},t),(t=Ca.get(i))&&Go(e,t),c=a.createElement("script"),wt(c),Ht(c,"link",e),a.head.appendChild(c)),c={type:"script",instance:c,count:1,state:null},l.set(i,c))}}function Bv(e,t,a,l){var i=(i=Ct.current)?is(i):null;if(!i)throw Error(r(446));switch(e){case"meta":case"title":return null;case"style":return typeof a.precedence=="string"&&typeof a.href=="string"?(a=ui(a.href),t=Tn(i).hoistableStyles,l=t.get(a),l||(l={type:"style",instance:null,count:0,state:null},t.set(a,l)),l):{type:"void",instance:null,count:0,state:null};case"link":if(a.rel==="stylesheet"&&typeof a.href=="string"&&typeof a.precedence=="string"){e=ui(a.href);var c=Tn(i).hoistableStyles,d=c.get(e);if(d||(i=i.ownerDocument||i,d={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},c.set(e,d),(c=i.querySelector(ss(e)))?c._p||(d.instance=c,d.state.loading=5):(c=Ca.get(e),c||(c={rel:"preload",as:"style",href:a.href,crossOrigin:a.crossOrigin,integrity:a.integrity,media:a.media,hrefLang:a.hrefLang,referrerPolicy:a.referrerPolicy},Ca.set(e,c)),c0(i,e,c,d.state))),t&&l===null)throw Error(r(528,""));return d}if(t&&l!==null)throw Error(r(529,""));return null;case"script":return t=a.async,a=a.src,typeof a=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(a=ri(a),t=Tn(i).hoistableScripts,l=t.get(a),l||(l={type:"script",instance:null,count:0,state:null},t.set(a,l)),l):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,e))}}function ui(e){return'href="'+ja(e)+'"'}function ss(e){return'link[rel="stylesheet"]['+e+"]"}function qv(e){return P({},e,{"data-precedence":e.precedence,precedence:null})}function c0(e,t,a,l){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[Os]!==!0){l.loading=1;return}}else t=e.createElement("link"),t[Os]=!0,t.onload=t.onerror=Jd.bind(null,t),Ht(t,"link",a),wt(t),e.head.appendChild(t);l.preload=t,t.addEventListener("load",function(){return l.loading|=1}),t.addEventListener("error",function(){return l.loading|=2})}function ri(e){return'[src="'+ja(e)+'"]'}function cs(e){return"script[async]"+e}function Hv(e,t,a){if(t.count++,t.instance===null)switch(t.type){case"style":var l=e.querySelector('style[data-href~="'+ja(a.href)+'"]');if(l)return t.instance=l,wt(l),l;var i=P({},a,{"data-href":a.href,"data-precedence":a.precedence,href:null,precedence:null});return l=(e.ownerDocument||e).createElement("style"),wt(l),Ht(l,"style",i),Yc(l,a.precedence,e),t.instance=l;case"stylesheet":i=ui(a.href);var c=e.querySelector(ss(i));if(c)return t.state.loading|=4,t.instance=c,wt(c),c;l=qv(a),(i=Ca.get(i))&&Yo(l,i),c=(e.ownerDocument||e).createElement("link"),wt(c);var d=c;return d._p=new Promise(function(b,_){d.onload=b,d.onerror=_}),Ht(c,"link",l),t.state.loading|=4,Yc(c,a.precedence,e),t.instance=c;case"script":return c=ri(a.src),(i=e.querySelector(cs(c)))?(t.instance=i,wt(i),i):(l=a,(i=Ca.get(c))&&(l=P({},a),Go(l,i)),e=e.ownerDocument||e,i=e.createElement("script"),wt(i),Ht(i,"link",l),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(r(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(l=t.instance,t.state.loading|=4,Yc(l,a.precedence,e));return t.instance}function Yc(e,t,a){for(var l=a.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=l.length?l[l.length-1]:null,c=i,d=0;d<l.length;d++){var b=l[d];if(b.dataset.precedence===t)c=b;else if(c!==i)break}c?c.parentNode.insertBefore(e,c.nextSibling):(t=a.nodeType===9?a.head:a,t.insertBefore(e,t.firstChild))}function Yo(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function Go(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var Gc=null;function Lv(e,t,a){if(Gc===null){var l=new Map,i=Gc=new Map;i.set(a,l)}else i=Gc,l=i.get(a),l||(l=new Map,i.set(a,l));if(l.has(e))return l;for(l.set(e,null),a=a.getElementsByTagName(e),i=0;i<a.length;i++){var c=a[i];if(!(c[Si]||c[Mt]||e==="link"&&c.getAttribute("rel")==="stylesheet")&&c.namespaceURI!=="http://www.w3.org/2000/svg"){var d=c.getAttribute(t)||"";d=e+d;var b=l.get(d);b?b.push(c):l.set(d,[c])}}return l}function Vo(e,t,a){e=e.ownerDocument||e,e.head.insertBefore(a,t==="title"?e.querySelector("head > title"):null)}function u0(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 Yv(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Gv(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Vv(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Xv(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Vv(t),e.suspenseyImages.push(t)),e=d0.bind(e),t.decode().then(e,e))}function r0(e,t,a,l){if(a.type==="stylesheet"&&(typeof l.media!="string"||matchMedia(l.media).matches!==!1)&&(a.state.loading&4)===0){if(a.instance===null){var i=ui(l.href),c=t.querySelector(ss(i));if(c){t=c._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=us.bind(e),t.then(e,e)),a.state.loading|=4,a.instance=c,wt(c);return}c=t.ownerDocument||t,l=qv(l),(i=Ca.get(i))&&Yo(l,i),c=c.createElement("link"),wt(c);var d=c;d._p=new Promise(function(b,_){d.onload=b,d.onerror=_}),Ht(c,"link",l),a.instance=c}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(a,t),(t=a.state.preload)&&(a.state.loading&3)===0&&(e.count++,a=us.bind(e),t.addEventListener("load",a),t.addEventListener("error",a))}}var Vc=0;function o0(e,t){return e.stylesheets&&e.count===0&&Qc(e,e.stylesheets),0<e.count||0<e.imgCount?function(a){var l=setTimeout(function(){if(e.stylesheets&&Qc(e,e.stylesheets),e.unsuspend){var c=e.unsuspend;e.unsuspend=null,c()}},6e4+t);0<e.imgBytes&&Vc===0&&(Vc=62500*Ap());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Qc(e,e.stylesheets),e.unsuspend)){var c=e.unsuspend;e.unsuspend=null,c()}},(e.imgBytes>Vc?50:800)+t);return e.unsuspend=a,function(){e.unsuspend=null,clearTimeout(l),clearTimeout(i)}}:null}function Qv(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)Qc(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function us(){this.count--,Qv(this)}function d0(){this.imgCount--,Qv(this)}var Xc=null;function Qc(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Xc=new Map,t.forEach(f0,e),Xc=null,us.call(e))}function f0(e,t){if(!(t.state.loading&4)){var a=Xc.get(e);if(a)var l=a.get(null);else{a=new Map,Xc.set(e,a);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),c=0;c<i.length;c++){var d=i[c];(d.nodeName==="LINK"||d.getAttribute("media")!=="not all")&&(a.set(d.dataset.precedence,d),l=d)}l&&a.set(null,l)}i=t.instance,d=i.getAttribute("data-precedence"),c=a.get(d)||l,c===l&&a.set(null,i),a.set(d,i),this.count++,l=us.bind(this),i.addEventListener("load",l),i.addEventListener("error",l),c?c.parentNode.insertBefore(i,c.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var oi={$$typeof:Qe,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function h0(e,t,a,l,i,c,d,b,_){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=_u(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_u(0),this.hiddenUpdates=_u(null),this.identifierPrefix=l,this.onUncaughtError=i,this.onCaughtError=c,this.onRecoverableError=d,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=_,this.transitionTypes=null,this.incompleteTransitions=new Map}function Zv(e,t,a,l,i,c,d,b,_,R,U,Y){return e=new h0(e,t,a,d,_,R,U,Y,b),t=1,c===!0&&(t|=24),c=ea(3,null,null,t),e.current=c,c.stateNode=e,t=nr(),t.refCount++,e.pooledCache=t,t.refCount++,c.memoizedState={element:l,isDehydrated:a,cache:t},ur(c),e}function Kv(e){return e?(e=Un,e):Un}function Jv(e,t,a,l,i,c){i=Kv(i),l.context===null?l.context=i:l.pendingContext=i,l=Al(t),l.payload={element:a},c=c===void 0?null:c,c!==null&&(l.callback=c),a=Cl(e,l,t),a!==null&&(na(a,e,t),qi(a,e,t))}function Iv(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var a=e.retryLane;e.retryLane=a!==0&&a<t?a:t}}function Xo(e,t){Iv(e,t),(e=e.alternate)&&Iv(e,t)}function Fv(e){if(e.tag===13||e.tag===31){var t=an(e,67108864);t!==null&&na(t,e,67108864),Xo(e,67108864)}}function Wv(e){if(e.tag===13||e.tag===31){var t=ga();t=ku(t);var a=an(e,t);a!==null&&na(a,e,t),Xo(e,t)}}var di=!0;function m0(e,t,a,l){var i=ne.T;ne.T=null;var c=K.p;try{K.p=2,Qo(e,t,a,l)}finally{K.p=c,ne.T=i}}function v0(e,t,a,l){var i=ne.T;ne.T=null;var c=K.p;try{K.p=8,Qo(e,t,a,l)}finally{K.p=c,ne.T=i}}function Qo(e,t,a,l){if(di){var i=Zo(l);if(i===null)Eo(e,t,l,Zc,a),ey(e,l);else if(g0(i,e,t,a,l))l.stopPropagation();else if(ey(e,l),t&4&&-1<y0.indexOf(e)){for(;i!==null;){var c=Nn(i);if(c!==null)switch(c.tag){case 3:if(c=c.stateNode,c.current.memoizedState.isDehydrated){var d=Fl(c.pendingLanes);if(d!==0){var b=c;for(b.pendingLanes|=2,b.entangledLanes|=2;d;){var _=1<<31-oa(d);b.entanglements[1]|=_,d&=~_}Wa(c),(Xe&6)===0&&(Rc=ua()+500,ts(0))}}break;case 31:case 13:b=an(c,2),b!==null&&na(b,c,2),Mc(),Xo(c,2)}if(c=Zo(l),c===null&&Eo(e,t,l,Zc,a),c===i)break;i=c}i!==null&&l.stopPropagation()}else Eo(e,t,l,null,a)}}function Zo(e){return e=Ou(e),Ko(e)}var Zc=null;function Ko(e){if(Zc=null,e=Wl(e),e!==null){var t=h(e);if(t===null)e=null;else{var a=t.tag;if(a===13){if(e=g(t),e!==null)return e;e=null}else if(a===31){if(e=v(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 Zc=e,null}function Pv(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"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"fullscreenerror":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"resize":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(Ag()){case $d:return 2;case Bd:return 8;case Ts:case Cg:return 32;case qd:return 268435456;default:return 32}default:return 32}}var Jo=!1,Ll=null,Yl=null,Gl=null,rs=new Map,os=new Map,Vl=[],y0="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 ey(e,t){switch(e){case"focusin":case"focusout":Ll=null;break;case"dragenter":case"dragleave":Yl=null;break;case"mouseover":case"mouseout":Gl=null;break;case"pointerover":case"pointerout":rs.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":os.delete(t.pointerId)}}function ds(e,t,a,l,i,c){return e===null||e.nativeEvent!==c?(e={blockedOn:t,domEventName:a,eventSystemFlags:l,nativeEvent:c,targetContainers:[i]},t!==null&&(t=Nn(t),t!==null&&Fv(t)),e):(e.eventSystemFlags|=l,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function g0(e,t,a,l,i){switch(t){case"focusin":return Ll=ds(Ll,e,t,a,l,i),!0;case"dragenter":return Yl=ds(Yl,e,t,a,l,i),!0;case"mouseover":return Gl=ds(Gl,e,t,a,l,i),!0;case"pointerover":var c=i.pointerId;return rs.set(c,ds(rs.get(c)||null,e,t,a,l,i)),!0;case"gotpointercapture":return c=i.pointerId,os.set(c,ds(os.get(c)||null,e,t,a,l,i)),!0}return!1}function ty(e){var t=Wl(e.target);if(t!==null){var a=h(t);if(a!==null){if(t=a.tag,t===13){if(t=g(a),t!==null){e.blockedOn=t,Qd(e.priority,function(){Wv(a)});return}}else if(t===31){if(t=v(a),t!==null){e.blockedOn=t,Qd(e.priority,function(){Wv(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 Kc(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var a=Zo(e.nativeEvent);if(a===null){a=e.nativeEvent;var l=new a.constructor(a.type,a);wu=l,a.target.dispatchEvent(l),wu=null}else return t=Nn(a),t!==null&&Fv(t),e.blockedOn=a,!1;t.shift()}return!0}function ay(e,t,a){Kc(e)&&a.delete(t)}function b0(){Jo=!1,Ll!==null&&Kc(Ll)&&(Ll=null),Yl!==null&&Kc(Yl)&&(Yl=null),Gl!==null&&Kc(Gl)&&(Gl=null),rs.forEach(ay),os.forEach(ay)}function Jc(e,t){e.blockedOn===t&&(e.blockedOn=null,Jo||(Jo=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,b0)))}var Ic=null;function ly(e){Ic!==e&&(Ic=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Ic===e&&(Ic=null);for(var t=0;t<e.length;t+=3){var a=e[t],l=e[t+1],i=e[t+2];if(typeof l!="function"){if(Ko(l||a)===null)continue;break}var c=Nn(a);c!==null&&(e.splice(t,3),t-=3,Cr(c,{pending:!0,data:i,method:a.method,action:l},l,i))}}))}function fi(e){function t(_){return Jc(_,e)}Ll!==null&&Jc(Ll,e),Yl!==null&&Jc(Yl,e),Gl!==null&&Jc(Gl,e),rs.forEach(t),os.forEach(t);for(var a=0;a<Vl.length;a++){var l=Vl[a];l.blockedOn===e&&(l.blockedOn=null)}for(;0<Vl.length&&(a=Vl[0],a.blockedOn===null);)ty(a),a.blockedOn===null&&Vl.shift();if(a=(e.ownerDocument||e).$$reactFormReplay,a!=null)for(l=0;l<a.length;l+=3){var i=a[l],c=a[l+1],d=i[Pt]||null;if(typeof c=="function")d||ly(a);else if(d){var b=null;if(c&&c.hasAttribute("formAction")){if(i=c,d=c[Pt]||null)b=d.formAction;else if(Ko(i)!==null)continue}else b=d.action;typeof b=="function"?a[l+1]=b:(a.splice(l,3),l-=3),ly(a)}}}function ny(){function e(c){c.canIntercept&&c.info==="react-transition"&&c.intercept({handler:function(){return new Promise(function(d){return i=d})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),l||setTimeout(a,20)}function a(){if(!l&&!navigation.transition){var c=navigation.currentEntry;c&&c.url!=null&&navigation.navigate(c.url,{state:c.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var l=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(a,100),function(){l=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function Io(e){this._internalRoot=e}Fc.prototype.render=Io.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(r(409));var a=t.current,l=ga();Jv(a,l,e,t,null,null)},Fc.prototype.unmount=Io.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Jv(e.current,2,null,e,null,null),Mc(),t[kn]=null}};function Fc(e){this._internalRoot=e}Fc.prototype.unstable_scheduleHydration=function(e){if(e){var t=Xd();e={blockedOn:null,target:e,priority:t};for(var a=0;a<Vl.length&&t!==0&&t<Vl[a].priority;a++);Vl.splice(a,0,e),a===0&&ty(e)}};var iy=u.version;if(iy!=="19.3.1")throw Error(r(527,iy,"19.3.1"));K.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(r(188)):(e=Object.keys(e).join(","),Error(r(268,e)));return e=p(t),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var p0={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:ne,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Wc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Wc.isDisabled&&Wc.supportsFiber)try{pi=Wc.inject(p0),ra=Wc}catch{}}return hs.createRoot=function(e,t){if(!f(e))throw Error(r(299));var a=!1,l="",i=Kh,c=Jh,d=Ih;return t!=null&&(t.unstable_strictMode===!0&&(a=!0),t.identifierPrefix!==void 0&&(l=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(c=t.onCaughtError),t.onRecoverableError!==void 0&&(d=t.onRecoverableError)),t=Zv(e,1,!1,null,null,a,l,null,i,c,d,ny),e[kn]=t.current,To(e),new Io(t)},hs.hydrateRoot=function(e,t,a){if(!f(e))throw Error(r(299));var l=!1,i="",c=Kh,d=Jh,b=Ih,_=null;return a!=null&&(a.unstable_strictMode===!0&&(l=!0),a.identifierPrefix!==void 0&&(i=a.identifierPrefix),a.onUncaughtError!==void 0&&(c=a.onUncaughtError),a.onCaughtError!==void 0&&(d=a.onCaughtError),a.onRecoverableError!==void 0&&(b=a.onRecoverableError),a.formState!==void 0&&(_=a.formState)),t=Zv(e,1,!0,t,a??null,l,i,_,c,d,b,ny),t.context=Kv(null),a=t.current,l=ga(),l=ku(l),i=Al(l),i.callback=null,Cl(a,i,l),a=l,t.current.lanes=a,ji(t,a),Wa(t),e[kn]=t.current,To(e),new Fc(t)},hs.version="19.3.1",hs}var vy;function C0(){if(vy)return Po.exports;vy=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(u){console.error(u)}}return n(),Po.exports=A0(),Po.exports}var w0=C0();const nu="feltkit.admin-token";function O0(){const n=/(?:^|[#&])token=([^&]+)/.exec(location.hash);if(n){try{sessionStorage.setItem(nu,decodeURIComponent(n[1]))}catch{}return history.replaceState(null,"",`${location.pathname}#/overview`),decodeURIComponent(n[1])}try{return sessionStorage.getItem(nu)}catch{return null}}function yy(n){try{n?sessionStorage.setItem(nu,n):sessionStorage.removeItem(nu)}catch{}}class gy extends Error{constructor(u,o,r){super(o),this.code=u,this.status=r}code;status}let zy=null;const ld=n=>zy=n;let tu=null;const nd=n=>tu=n;function My(n){return tu?n?{"x-feltkit-csrf":tu.csrf,"x-feltkit-environment":tu.environment}:{}:{"x-feltkit-admin":zy??""}}async function ue(n,u={}){const o=await fetch(`/_feltkit/api${n}`,{...u,credentials:"same-origin",headers:{...My(!!(u.method&&u.method!=="GET")),...u.body?{"Content-Type":"application/json"}:{},...u.headers??{}}});let r;try{r=await o.json()}catch{throw new gy("UNAVAILABLE",`The server answered ${o.status}.`,o.status)}if(!o.ok)throw new gy(r?.error?.code??"INTERNAL",r?.error?.message??`Request failed (${o.status})`,o.status);return r}function R0(n,u){const o=new AbortController;return(async()=>{let r=500;for(;!o.signal.aborted;){try{const f=await fetch("/_feltkit/api/events",{credentials:"same-origin",headers:My(!1),signal:o.signal});if(!f.ok||!f.body)throw new Error(String(f.status));u(!0),r=500;const h=f.body.getReader(),g=new TextDecoder;let v="";for(;;){const{value:m,done:p}=await h.read();if(p)break;v+=g.decode(m,{stream:!0});let j;for(;(j=v.indexOf(`
|
|
10
|
+
|
|
11
|
+
`))>=0;){const y=v.slice(0,j);v=v.slice(j+2);const x=/^event: (.+)$/m.exec(y)?.[1],T=/^data: (.+)$/m.exec(y)?.[1];x&&T&&n(x,JSON.parse(T))}}}catch{}if(u(!1),o.signal.aborted)break;await new Promise(f=>setTimeout(f,r)),r=Math.min(r*2,8e3)}})(),()=>o.abort()}function ps(n){const u=!!n?.environment?.development,r=(n?.operator?.permissions??[]).some(f=>f==="*"||f==="feltkit.*"||f==="feltkit.operations.*"||f==="feltkit.operations.write");return{development:u,canAct:u||r,actor:n?.operator?.principal?.id??null}}const od=Object.freeze({positive:"●",progress:"◐",attention:"▲",critical:"✕",neutral:"○",unknown:"?"}),D0=Object.freeze(["verified","verification_failed","not_verified","not_evaluated"]);function Uy(n){const u=String(n).replace(/_/g," ");return u&&u[0].toUpperCase()+u.slice(1)}const ke="positive",me="progress",Yt="attention",Ke="critical",Ue="neutral",Zl="unknown",z0={"compute.environment.actual_state":{running:ke,completed:ke,pending:me,starting:me,stopping:me,degraded:Yt,failed:Ke,denied:Ke,stopped:Ue},"compute.health":{healthy:ke,unhealthy:Ke,unknown:Zl},"compute.environment.readiness":{ready:ke,created:me,starting:me,degraded:Yt,failed:Ke,unavailable:Ke},"compute.process.readiness":{ready:ke,starting:me,unready:Yt},"compute.process.state":{ready:ke,running:ke,pending:me,starting:me,stopping:me,unready:Yt,failed:Ke,lost:Ke,stopped:Ue,exited:Ue,destroyed:Ue,expired:Ue,unverified:Zl,unreachable:Zl},"compute.deployment.status":{active:ke,complete:ke,pending:me,starting:me,ready:me,network_ready:me,switching:me,draining:me,failed:Ke,rolled_back:Ke},"compute.version.status":{published:ke,publishing:me,failed:Ke},"compute.rollout.status":{active:ke,applying:me,failed:Ke,superseded:Ue},"compute.job.status":{succeeded:ke,created:me,accepted:me,queued:me,waiting_for_capacity:me,reserved:me,admitted:me,preparing:me,running:me,failed:Ke,rejected:Ke,timed_out:Ke,cancelled:Ue},"compute.computer.observed":{running:ke,starting:me,reconciling:me,stopping:me,failed:Ke,lost:Ke,stopped:Ue,destroyed:Ue,expired:Ue,unverified:Zl,unreachable:Zl},"compute.computer.status":{running:ke,pending:me,provisioning:me,resuming:me,stopping:me,destroying:me,failed:Ke,lost:Ke,stopped:Ue,destroyed:Ue,expired:Ue,unreachable:Zl},"feltdb.health.ready_state":{healthy:ke,recovering:me,degraded:Yt,unavailable:Ke},"feltdb.authority.availability":{available:ke,recovering:me,degraded:Yt,closed:Ue,unknown:Zl},"feltdb.authority.lease_clock_healthy":{true:[ke,"Healthy"],false:[Yt,"Degraded"]},"authboundry.decision.live":{allow:[ke,"Allow"],deny:[Ke,"Deny"]},"authboundry.decision.recorded":{allow:[ke,"Allow"],deny:[Ue,"Deny"]},"authboundry.delegation.status":{active:ke,pending:me,revoked:Ke,expired:Ue},"authboundry.application.status":{active:ke,awaiting_contract:me,disabled:Ue},"authboundry.studio.attached":{true:[ke,"Attached"],false:[Yt,"Not attached"]},"authboundry.studio.protection":{active:[ke,"Active"],inactive:[Ue,"Inactive"],unreachable:[Yt,"Upstream unreachable"]},"appport.agent.phase":{running:[me,"Working"],pausing:[me,"Pausing"],paused:[Ue,"Paused"],interrupted:[Yt,"Interrupted"],blocked:[Yt,"Waiting for approval"],completed:[ke,"Completed"],stopped:[Ue,"Stopped"]},"appport.agent.instruction.state":{signaled:[me,"Coming"],received:[me,"Received, queued"],delivered:[me,"Incorporating"],incorporated:[ke,"Incorporated"],conflict:[Yt,"Conflict"],withdrawn:[Ue,"Withdrawn"],abandoned:[Ue,"Not used"]},"appport.job.status":{completed:ke,scheduled:me,pending:me,running:me,retrying:me,failed:Ke},"appport.notification.status":{delivered:ke,pending:me,failed:Ke,read:Ue,acknowledged:Ue,expired:Ue},"appport.api_key.revoked":{false:[ke,"Active"],true:[Ue,"Revoked"]},"appport.webhook.disabled":{false:[ke,"Enabled"],true:[Ue,"Disabled"]},"appport.schedule.enabled":{true:[ke,"Enabled"],false:[Ue,"Disabled"]},"appport.configuration.secret.configured":{true:[ke,"Configured"]},"appboundry.lifecycle.phase":{ACTIVE:[ke,"Active"],DRAFT:[me,"Draft"],VALIDATED:[me,"Validated"],REGISTERED:[me,"Registered"],CHANGE_PROPOSED:[Yt,"Change proposed"],RETIRED:[Ue,"Retired"]},"appboundry.provider.compatible":{true:[ke,"Compatible"],false:[Yt,"Incompatible"]},"appboundry.execution.status":{succeeded:ke,running:me,failed:Ke,timed_out:[Ke,"Timed out"],cancelled:Ue},"appboundry.source.status":{connected:ke,stale:Yt,failed:Ke,disconnected:Ue},"appboundry.implementation.status":{verified:[ke,"Current"],stale:Yt,revoked:Ke},"appboundry.provider.eligibility":{ELIGIBLE:[ke,"Eligible"],INELIGIBLE:[Ue,"Ineligible"]},"appboundry.deployment.status":{running:ke,available:Ue,stopped:Ue},"appboundry.deployment.step":{complete:ke,failed:Ke,pending:[Ue,"Not run"]},"appboundry.health.ready":{true:[ke,"Ready"],false:[Ke,"Not ready"]},"appboundry.health.check":{available:ke,degraded:Yt,unavailable:Ke}},M0={"feltdb.revision.integrity_verified":{true:"verified",false:"verification_failed"},"appboundry.implementation.verification":{verified:"verified",stale:"not_verified"},"appboundry.attestation.status":{verified:"verified",CONTRACT_MISMATCH:"verification_failed",IDENTITY_MISMATCH:"verification_failed"},"appboundry.conformance.status":{CONFORMING:"verified",NON_CONFORMING:"verification_failed"}},U0={"compute.response.state":{live:"live",cached:"cached",stale:"stale"},"feltdb.snapshot.staleness":{current:"live",stale:"stale",unknown:"unknown"}},jd=n=>Object.freeze(Object.fromEntries(Object.entries(n).map(([u,o])=>[u,Object.freeze({...o})]))),$0=jd(z0);jd(M0);jd(U0);const B0=(n,u)=>Object.prototype.hasOwnProperty.call(n,u);function q0(n,u,o){const r=$0[n];if(!r)throw new Error(`unknown field: ${n}`);const f=String(u),h=B0(r,f)?r[f]:null,[g,v]=h===null?[Zl,null]:Array.isArray(h)?h:[h,null],m=o&&o.label||v||(h===null?f:Uy(f));return{field:n,value:f,tone:g,label:m,glyph:od[g],mapped:h!==null}}function dd(n,u){const o=H0(u);let r=D0.includes(n)?n:"not_evaluated";return r==="verified"&&o.length===0&&(r="not_evaluated"),r==="verified"&&o.some(f=>f.status==="failed")&&(r="verification_failed"),{state:r,checks:o}}function H0(n){return n?n.map(u=>typeof u=="string"?{label:u}:{label:String(u.label),...u.status?{status:u.status}:{}}):[]}const yl=Object.freeze({company:Object.freeze({name:"Boundry",href:"https://boundry.company",tagline:"Infrastructure for applications and agents.",family:"Part of the Boundry family of products"}),products:Object.freeze([{id:"feltdb",name:"FeltDB",mark:"FD",category:"Durable state",href:"https://feltdb.com"},{id:"feltkit",name:"FeltKit",mark:"FK",category:"Developer platform",href:"https://getfeltkit.com"},{id:"appboundry",name:"AppBoundry",mark:"AB",category:"Application boundaries",href:"https://appboundry.com"},{id:"authboundry",name:"AuthBoundry",mark:"AU",category:"Authority and delegation",href:"https://authboundry.com"},{id:"appport",name:"AppPort",mark:"AP",category:"Application capabilities",href:"https://boundry.company/ecosystem/#appport"}].map(n=>Object.freeze(n)))});function fd(n){return yl.products.find(u=>u.id===n)||null}const S=(n,u,o,r,f)=>({t:n,a:u||{},c:o===void 0?[]:[].concat(o),...r?{on:r}:{},...f==null?{}:{k:String(f)}}),au=n=>!!(n&&typeof n=="object"&&typeof n.t=="string"&&n.a&&Array.isArray(n.c)),ge=(...n)=>n.filter(Boolean).join(" "),G=n=>n!=null&&n!=="",xe=n=>{const u={};for(const[o,r]of Object.entries(n||{}))(/^(data-|aria-)/.test(o)||o==="id"||o==="title")&&(u[o]=r);return u};function L0(n){const u=new Date(n);return Number.isNaN(u.getTime())?String(n):`${u.toISOString().slice(0,19).replace("T"," ")} UTC`}const xs=(n,u)=>{const o=new Date(n);return Number.isNaN(o.getTime())?S("span",{class:u},String(n)):S("time",{class:u,datetime:o.toISOString()},L0(n))};function Sd(n){const{field:u,value:o,detail:r,className:f,attrs:h}=n,g=u?q0(u,o,{label:n.label}):null,v=g?g.tone:n.tone||"unknown",m=g?g.label:G(n.label)?n.label:Uy(v),p=n.glyph||od[v]||od.unknown;return S("span",{class:ge("stack-status",`stack-status--${v}`,f),"data-tone":v,...g?{"data-field":g.field,"data-value":g.value}:{},...xe(h)},[S("span",{class:"stack-status__glyph","aria-hidden":"true"},p),S("span",{class:"stack-status__label"},m),G(r)?S("span",{class:"stack-status__detail"},r):null])}const Y0={verified:"✓",verification_failed:"✕",not_verified:"!",not_evaluated:"–"};function $y(n){const{state:u,checks:o}=dd(n.state,n.checks),r=o.filter(h=>h.status==="failed");let f;if(u==="verified")f=o.length===1?`Verified · ${o[0].label}`:`Verified · ${o.length} checks`;else if(u==="verification_failed"){const h=r.length?r:o;f=h.length===1?`Verification failed · ${h[0].label}`:h.length?`Verification failed · ${h.length} checks`:"Verification failed"}else f=u==="not_verified"?"Not verified":"Not evaluated";return S("div",{class:ge("stack-verification",`stack-verification--${u}`,n.className),"data-verification":u,...xe(n.attrs)},[S("span",{class:"stack-verification__glyph","aria-hidden":"true"},Y0[u]),S("span",{class:"stack-verification__label"},f),G(n.at)?[" · ",xs(n.at,"stack-verification__at")]:null,G(n.evidenceHref)?S("a",{class:"stack-verification__evidence",href:n.evidenceHref},"Evidence"):null,o.length>1?S("ul",{class:"stack-verification__checks"},o.map(h=>S("li",{class:"stack-verification__check",...h.status?{"data-check-status":h.status}:{}},h.status?`${h.label} — ${h.status}`:h.label))):null])}const by={live:"Live",cached:"Cached",stale:"Stale",unknown:"Freshness unknown"},G0={live:"●",cached:"◷",stale:"▲",unknown:"?"};function V0(n){const u=by[n.freshness]?n.freshness:"unknown",o=G(n.asOf)&&u!=="live";return S("span",{class:ge("stack-freshness",`stack-freshness--${u}`,n.className),"data-freshness":u,...xe(n.attrs)},[S("span",{class:"stack-freshness__glyph","aria-hidden":"true"},G0[u]),S("span",{class:"stack-freshness__label"},[by[u],o?[" · as of ",xs(n.asOf,"stack-freshness__as-of")]:null,G(n.source)?` · ${n.source}`:null])])}function X0(n){const u=n.status==="partial"?"partial":"unsupported",o=G(n.title)?n.title:u==="partial"?"Partly available":"Not available";return S("div",{class:ge("stack-unavailable",`stack-unavailable--${u}`,n.className),role:"note","data-capability-status":u,...G(n.capability)?{"data-capability":n.capability}:{},...xe(n.attrs)},[S(n.headingLevel?du(n.headingLevel):"p",{class:"stack-unavailable__title"},o),G(n.reason)?S("p",{class:"stack-unavailable__reason"},n.reason):null,n.children||null])}function ou(n){const u=G(n.what)?n.what:"",o=n.long?`Still loading${u?` ${u}`:""}…`:`Loading${u?` ${u}`:""}…`;return S("div",{class:ge("stack-loading",n.long?"stack-loading--long":null,n.className),role:"status","aria-live":"polite",...xe(n.attrs)},[S("span",{class:"stack-loading__indicator","aria-hidden":"true"}),S("span",{class:"stack-loading__label"},o)])}const du=n=>`h${Math.min(6,Math.max(1,Number(n)||2))}`;function js(n){const u=n.variant==="no-match"?"no-match":"empty",o=G(n.title)?n.title:u==="no-match"?"Nothing matches":"Nothing here yet";return S("div",{class:ge("stack-empty",`stack-empty--${u}`,n.className),...xe(n.attrs)},[S(du(n.headingLevel),{class:"stack-empty__title"},o),G(n.body)?S("p",{class:"stack-empty__body"},n.body):null,n.action?S("div",{class:"stack-empty__action"},n.action):null])}function Ss(n){const u=[G(n.code)?["Code ",S("code",{},n.code)]:null,G(n.requestId)?[G(n.code)?" · ":"","Request ",S("code",{},n.requestId)]:null].filter(Boolean);return S("div",{class:ge("stack-error",n.className),role:"alert",...xe(n.attrs)},[S("p",{class:"stack-error__title"},G(n.title)?n.title:"Something went wrong"),G(n.message)?S("p",{class:"stack-error__message"},n.message):null,u.length?S("p",{class:"stack-error__meta"},u):null,n.onRetry||n.actions?S("div",{class:"stack-error__actions"},[n.onRetry?xa({label:n.retryLabel||"Retry",onClick:n.onRetry}):null,n.actions||null]):null])}function Q0(n){return S("dl",{class:ge("stack-meta",n.className),...xe(n.attrs)},(n.items||[]).map(u=>{const o=!G(u.value)&&u.value!==0&&u.value!==!1;return S("div",{class:"stack-meta__item",...xe(u.attrs)},[S("dt",{class:"stack-meta__label"},u.label),S("dd",{class:ge("stack-meta__value",u.mono?"stack-meta__value--mono":null),...o?{"data-missing":"true"}:{}},o?"—":typeof u.value=="boolean"?String(u.value):u.value),G(u.hint)?S("dd",{class:"stack-meta__hint"},u.hint):null])}))}function Z0(n){const u=Number(n.length)||12,o=G(n.id)?String(n.id):null,r=o&&o.length>u?`${o.slice(0,u)}…`:o,f=G(n.name)?S(n.href?"a":"span",{class:"stack-identity__name",...n.href?{href:n.href}:{}},n.name):null;return S("span",{class:ge("stack-identity",n.className),...xe(n.attrs)},[G(n.kind)?S("span",{class:"stack-identity__kind"},n.kind):null,f,o?S("code",{class:"stack-identity__id",title:o},r===o?o:[S("span",{"aria-hidden":"true"},r),S("span",{class:"stack-visually-hidden"},o)]):null])}function K0(n){return S("header",{class:ge("stack-page-header",n.className),...xe(n.attrs)},[G(n.eyebrow)?S("p",{class:"stack-page-header__eyebrow"},n.eyebrow):null,S("div",{class:"stack-page-header__title-row"},[S(du(n.headingLevel||1),{class:"stack-page-header__title"},n.title),n.status?S("span",{class:"stack-page-header__status"},n.status):null,n.actions?S("div",{class:"stack-page-header__actions"},n.actions):null]),G(n.description)?S("p",{class:"stack-page-header__description"},n.description):null,n.meta?S("div",{class:"stack-page-header__meta"},n.meta):null])}const J0=["primary","secondary","danger","ghost"],I0=["sm","md","lg"];function xa(n){const u=J0.includes(n.variant)?n.variant:"secondary",o=I0.includes(n.size)?n.size:"md",r=!!(n.disabled||n.busy);return S("button",{class:ge("stack-button",`stack-button--${u}`,`stack-button--${o}`,n.className),type:n.type==="submit"?"submit":"button",...r?{disabled:!0}:{},...n.busy?{"aria-busy":"true"}:{},...xe(n.attrs)},[n.busy?S("span",{class:"stack-button__busy","aria-hidden":"true"}):null,S("span",{class:"stack-button__label"},n.label)],n.onClick&&!r?{click:n.onClick}:void 0)}function F0(n){const u=(n.items||[]).filter(o=>o&&G(o.label));return S("nav",{class:ge("stack-breadcrumbs",n.className),"aria-label":n.label||"Breadcrumb",...xe(n.attrs)},S("ol",{class:"stack-breadcrumbs__list"},u.map((o,r)=>{const f=r===u.length-1;return S("li",{class:"stack-breadcrumbs__item"},[r>0?S("span",{class:"stack-breadcrumbs__separator","aria-hidden":"true"},"/"):null,f||!G(o.href)?S("span",{class:"stack-breadcrumbs__current",...f?{"aria-current":"page"}:{}},o.label):S("a",{class:"stack-breadcrumbs__link",href:o.href},o.label)])})))}function W0(n){if(!["ArrowRight","ArrowLeft","ArrowDown","ArrowUp","Home","End"].includes(n.key))return;const o=n.currentTarget,r=Array.from(o.querySelectorAll('[role="tab"]:not([disabled])'));if(!r.length)return;const f=r.indexOf(o.ownerDocument.activeElement),h=o.getAttribute("aria-orientation")==="vertical",g=h?"ArrowDown":"ArrowRight",v=h?"ArrowUp":"ArrowLeft";let m;if(n.key==="Home")m=0;else if(n.key==="End")m=r.length-1;else if(n.key===g)m=f<0?0:(f+1)%r.length;else if(n.key===v)m=f<0?r.length-1:(f-1+r.length)%r.length;else return;n.preventDefault(),r[m].focus()}const kt=n=>String(n).replace(/[^A-Za-z0-9_-]/g,"-"),P0=n=>u=>{const o=u.currentTarget.ownerDocument.getElementById(n);o&&(u.preventDefault(),o.focus(),typeof o.scrollIntoView=="function"&&o.scrollIntoView())};function ex(n){const u=kt(n.idPrefix||"stack-tabs"),o=n.tabs||[],r=o.some(f=>f.id===n.active&&!f.disabled)?n.active:null;return S("div",{class:ge("stack-tabs",n.className),role:"tablist",...G(n.label)?{"aria-label":n.label}:{},...xe(n.attrs)},o.map((f,h)=>{const g=f.id===r,v=g||r===null&&h===0;return S("button",{class:ge("stack-tabs__tab",g?"stack-tabs__tab--selected":null,f.className),type:"button",role:"tab",id:`${u}-tab-${kt(f.id)}`,"aria-selected":g?"true":"false",...G(n.panelId)?{"aria-controls":n.panelId}:{},tabindex:v?"0":"-1",...f.disabled?{disabled:!0,...G(f.reason)?{title:f.reason}:{}}:{},...xe(f.attrs)},[f.label,G(f.badge)?S("span",{class:"stack-tabs__badge"},f.badge):null],n.onSelect&&!f.disabled?{click:()=>n.onSelect(f.id)}:void 0)}),{keydown:W0})}function tx(n){const u=kt(n.idPrefix||"stack-tabs");return S("div",{class:ge("stack-tabpanel",n.className),role:"tabpanel",id:n.id,...G(n.active)?{"aria-labelledby":`${u}-tab-${kt(n.active)}`}:{},tabindex:"0",...xe(n.attrs)},n.children||null)}const py={ascending:"▲",descending:"▼"},ax=n=>u=>{u.target===u.currentTarget&&(u.key!=="Enter"&&u.key!==" "||(u.preventDefault(),n()))};function lx(n){const u=n.columns||[],o=n.rows||[],r=G(n.label)?n.label:"Table";if(n.error)return Ss({title:n.error.title||`${r} could not be read`,message:n.error.message,code:n.error.code,requestId:n.error.requestId,onRetry:n.error.onRetry,className:ge("stack-table-state",n.className),attrs:n.attrs});if(n.loading&&!o.length)return ou({what:n.loadingWhat||r.toLowerCase(),className:ge("stack-table-state",n.className),attrs:n.attrs});if(!o.length){const v=!!n.noMatch;return js({variant:v?"no-match":"empty",title:v?n.noMatchTitle||"Nothing matches":n.emptyTitle||"Nothing here yet",body:v?n.noMatchBody:n.emptyBody,action:v?null:n.emptyAction,headingLevel:n.emptyHeadingLevel||3,className:ge("stack-table-state",n.className),attrs:n.attrs})}const f=n.sort||{},h=S("thead",{},S("tr",{},u.map(v=>{const m=f.column===v.id&&py[f.direction]?f.direction:null,p=v.sortable&&n.onSort?S("button",{class:"stack-table__sort",type:"button"},[v.header,S("span",{class:"stack-table__sort-indicator","aria-hidden":"true"},m?py[m]:"↕")],{click:()=>n.onSort(v.id)}):v.header;return S("th",{class:ge("stack-table__header",v.align==="end"?"stack-table__cell--end":null),scope:"col",...v.sortable&&n.onSort?{"aria-sort":m||"none"}:{}},p)}))),g=S("tbody",{},o.map(v=>{const m=typeof v.onSelect=="function";return S("tr",{class:ge("stack-table__row",m?"stack-table__row--selectable":null,v.selected?"stack-table__row--selected":null,v.className),...m?{tabindex:"0"}:{},...v.selected?{"aria-current":"true"}:{},...xe(v.attrs)},u.map(p=>{const j=v.cells?v.cells[p.id]:void 0,y=j==null;return S("td",{class:ge("stack-table__cell",p.align==="end"?"stack-table__cell--end":null),...y?{"data-missing":"true"}:{}},y?"—":j)}),m?{click:v.onSelect,keydown:ax(v.onSelect)}:void 0,v.key)}));return S("div",{class:ge("stack-table",n.className),role:"region","aria-label":r,tabindex:"0",...n.loading?{"aria-busy":"true"}:{},...xe(n.attrs)},S("table",{class:"stack-table__table"},[S("caption",{class:n.captionVisible?"stack-table__caption":"stack-visually-hidden"},r),h,g]))}function nx(n,u,o){const r=`${u}-${kt(n.id)}`,f=G(n.value)?String(n.value):"",h=o?v=>o(n.id,v.target.value):null,g=n.type==="select"?S("select",{class:"stack-filter__control",id:r,name:n.id},(n.options||[]).map(v=>{const m=String(typeof v=="object"?v.value:v);return S("option",{value:m,...m===f?{selected:!0}:{}},typeof v=="object"?v.label:v)}),h?{change:h}:void 0):S("input",{class:"stack-filter__control",id:r,name:n.id,type:"search",value:f,...G(n.placeholder)?{placeholder:n.placeholder}:{}},[],h?{input:h}:void 0);return S("div",{class:"stack-filter__field"},[S("label",{class:"stack-filter__label",for:r},n.label),g])}function ix(n){const u=kt(n.idPrefix||"stack-filter"),o=Number(n.applied)||0;return S("form",{class:ge("stack-filter",n.className),role:"search","aria-label":n.label||"Filters",...xe(n.attrs)},[S("div",{class:"stack-filter__controls"},[(n.filters||[]).map(r=>nx(r,u,n.onChange)),S("div",{class:"stack-filter__actions"},[n.live?null:xa({label:n.applyLabel||"Apply",type:"submit",variant:"secondary"}),o&&n.onClear?xa({label:n.clearLabel||"Clear",variant:"ghost",onClick:n.onClear}):null])]),S("p",{class:"stack-filter__result",role:"status","aria-live":"polite"},G(n.result)?n.result:"")],n.onSubmit||n.live?{submit:r=>{r.preventDefault(),n.onSubmit&&n.onSubmit()}}:void 0)}function sx(n){return S("nav",{class:ge("stack-pagination",n.className),"aria-label":n.label||"Pagination",...xe(n.attrs)},[G(n.summary)?S("p",{class:"stack-pagination__summary"},n.summary):null,S("div",{class:"stack-pagination__actions"},[xa({label:n.previousLabel||"← Previous",variant:"ghost",disabled:!n.hasPrevious,onClick:n.onPrevious,attrs:{"data-page":"previous"}}),xa({label:n.nextLabel||"Next →",variant:"ghost",disabled:!n.hasNext,onClick:n.onNext,attrs:{"data-page":"next"}})])])}const By=Object.freeze([{value:"system",label:"System theme"},{value:"light",label:"Light theme"},{value:"dark",label:"Dark theme"}]);function cx(n){const u=n.product||{},o=$=>n.onNavigate?{click:Z=>{Z.defaultPrevented||Z.button!==0||Z.metaKey||Z.ctrlKey||Z.shiftKey||Z.altKey||(Z.preventDefault(),n.onNavigate($))}}:void 0,r=kt(n.mainId||"stack-main"),f=n.narrowNavigation==="menu"&&typeof n.onNavigationToggle=="function",h=f&&!!n.navigationOpen,g=`${r}-nav`,v=`${r}-menu-button`,m=typeof n.onSidebarToggle=="function",p=m&&!!n.sidebarCollapsed,j=n.sidebarLabel||"sidebar",y=$=>{n.onNavigationToggle(!1);const Z=$.currentTarget.ownerDocument.getElementById(v);Z&&Z.focus()},x=[];for(const $ of n.navigation||[]){const Z=$.group||"";let ae=x.find(P=>P.name===Z);ae||x.push(ae={name:Z,items:[]}),ae.items.push($)}for(const $ of x)$.items.sort((Z,ae)=>(Z.order??0)-(ae.order??0));const T=$=>{const Z=o($);return h?{click:ae=>{!ae.metaKey&&!ae.ctrlKey&&!ae.shiftKey&&!ae.altKey&&n.onNavigationToggle(!1),Z&&Z.click(ae)}}:Z},B=$=>S("li",{class:ge("stack-shell__nav-entry",$.action?"stack-shell__nav-entry--action":null)},$.action?[D($),S("div",{class:"stack-shell__nav-action"},$.action)]:D($)),D=$=>S("a",{class:ge("stack-shell__nav-item",$.className),href:$.href,...$.current?{"aria-current":"page"}:{},...xe($.attrs)},G($.detail)||G($.meta)?[S("span",{class:"stack-shell__nav-label"},$.label),G($.detail)?S("span",{class:"stack-shell__nav-detail"},$.detail):null,G($.meta)?S("span",{class:"stack-shell__nav-meta"},$.meta):null]:$.label,T($.href)),C=n.theme,w=`${r}-theme`,H=n.otherProducts||(G(u.id)&&fd(u.id)?yl.products.filter($=>$.id!==u.id).map($=>({name:$.name,href:$.href})):[]),W=G(u.id)&&fd(u.id)&&n.family!==!1;return S("div",{class:ge("stack-shell",f?"stack-shell--menu":null,h?"stack-shell--menu-open":null,m?"stack-shell--collapsible":null,p?"stack-shell--collapsed":null,n.className),...G(u.id)?{"data-stack-product":u.id}:{},...xe(n.attrs)},[S("a",{class:"stack-shell__skip",href:`#${r}`},n.skipLabel||"Skip to content",{click:P0(r)}),S("header",{class:"stack-shell__bar"},[m?S("button",{class:"stack-shell__sidebar-button",type:"button","aria-expanded":p?"false":"true","aria-controls":g,"aria-label":`${p?"Show":"Hide"} ${j}`,title:`${p?"Show":"Hide"} ${j}`},S("svg",{class:"stack-shell__sidebar-icon",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true"},[S("rect",{x:"2.75",y:"3.75",width:"14.5",height:"12.5",rx:"2",fill:"none",stroke:"currentColor","stroke-width":"1.5"}),S("rect",{x:"2.75",y:"3.75",width:"5.5",height:"12.5",rx:"2",fill:p?"none":"currentColor",stroke:"currentColor","stroke-width":"1.5"})]),{click:()=>n.onSidebarToggle(!p)}):null,f?S("button",{class:"stack-shell__menu-button",type:"button",id:v,"aria-expanded":h?"true":"false","aria-controls":g},[S("span",{"aria-hidden":"true"},h?"✕":"☰"),S("span",{class:"stack-visually-hidden"},n.menuLabel||"Menu")],{click:()=>n.onNavigationToggle(!h),...h?{keydown:$=>{$.key==="Escape"&&($.preventDefault(),n.onNavigationToggle(!1))}}:{}}):null,S("a",{class:"stack-shell__product",href:u.homeHref||"#"},[G(u.mark)?S("span",{class:"stack-shell__mark","aria-hidden":"true"},u.mark):null,S("span",{class:"stack-shell__product-name"},u.name||"")],o(u.homeHref||"#")),n.context?S("div",{class:"stack-shell__context"},n.context):null,n.search?S("div",{class:"stack-shell__search"},n.search):null,S("div",{class:"stack-shell__end"},[C?S("div",{class:"stack-shell__prefs"},[S("label",{class:"stack-visually-hidden",for:w},"Theme"),S("select",{class:"stack-shell__theme",id:w,"data-stack-theme-control":""},By.map($=>S("option",{value:$.value,...$.value===(C.preference||"system")?{selected:!0}:{}},$.label)),C.onChange?{change:$=>C.onChange($.target.value)}:void 0)]):null,n.account?S("div",{class:"stack-shell__account"},n.account):null,W?S("a",{class:"stack-shell__family",href:yl.company.href},[fu({idPrefix:`${r}-family-mark`}),S("span",{},["A ",yl.company.name," product"])]):null])]),S("div",{class:"stack-shell__body"},[S("nav",{class:"stack-shell__nav","aria-label":`${u.name||"Product"} navigation`,...f||m?{id:g}:{}},[x.map($=>S("div",{class:"stack-shell__nav-group"},[G($.name)?S("p",{class:"stack-shell__nav-heading"},$.name):null,S("ul",{class:"stack-shell__nav-list"},$.items.map(B))])),G(n.activityHref)?S("div",{class:"stack-shell__nav-group stack-shell__activity"},S("ul",{class:"stack-shell__nav-list"},B({label:n.activityLabel||"Activity",href:n.activityHref,current:n.activityCurrent}))):null,H.length||W?S("div",{class:"stack-shell__nav-group stack-shell__switcher"},[S("p",{class:"stack-shell__nav-heading"},n.otherProductsLabel||"Other Boundry products"),S("ul",{class:"stack-shell__nav-list"},[H.map($=>S("li",{class:"stack-shell__nav-entry"},S("a",{class:"stack-shell__nav-item",href:$.href},$.name))),W?S("li",{class:"stack-shell__nav-entry"},S("a",{class:"stack-shell__nav-item stack-shell__nav-item--company",href:yl.company.href},["About ",yl.company.name])):null])]):null],h?{keydown:$=>{$.key==="Escape"&&($.preventDefault(),y($))}}:void 0),S("main",{class:"stack-shell__main",id:r,tabindex:"-1",...xe(n.mainAttrs)},n.children||null)])])}const ux=["pattern","min","max","step","minlength","maxlength","autocomplete","inputmode","list","spellcheck"],_d=n=>kt(G(n.id)?n.id:`stack-field-${n.name||"field"}`);function qy(n,u,o,r){return S("div",{class:ge("stack-field",`stack-field--${r}`,n.error?"stack-field--invalid":null,n.className),...xe(n.attrs)},[S("label",{class:"stack-field__label",for:u},[n.label,n.required?S("span",{class:"stack-field__required","aria-hidden":"true"}," *"):null]),o,G(n.hint)?S("p",{class:"stack-field__hint",id:`${u}-hint`},n.hint):null,G(n.error)?S("p",{class:"stack-field__error",id:`${u}-error`},n.error):null])}const rx=(n,u)=>{const o=[G(n.hint)?`${u}-hint`:null,G(n.error)?`${u}-error`:null].filter(Boolean);return o.length?{"aria-describedby":o.join(" ")}:{}},kd=(n,u)=>({...n.required?{required:!0}:{},...n.readOnly?{readonly:!0}:{},...n.disabled?{disabled:!0}:{},...G(n.error)?{"aria-invalid":"true"}:{},...rx(n,u)});function Hy(n){const u=_d(n),o=n.value!==void 0&&n.value!==null,r=o?String(n.value):null,f=n.onChange?{input:m=>n.onChange(m.target.value)}:void 0,h={};for(const m of ux)G(n[m])&&(h[m]=String(n[m]));const g={class:"stack-field__control",id:u,...G(n.name)?{name:n.name}:{},...G(n.placeholder)?{placeholder:n.placeholder}:{},...h,...kd(n,u)},v=n.multiline?S("textarea",{...g,rows:String(Number(n.rows)||4)},o?r:[],f):S("input",{...g,type:n.type||"text",...o?{value:r}:{}},[],f);return qy(n,u,v,n.multiline?"multiline":"text")}function ox(n){const u=_d(n),o=G(n.value)?String(n.value):null,r=n.onChange?{change:h=>n.onChange(h.target.value)}:void 0,f=S("select",{class:"stack-field__control",id:u,...G(n.name)?{name:n.name}:{},...kd(n,u)},(n.options||[]).map(h=>{const g=String(typeof h=="object"?h.value:h);return S("option",{value:g,...g===o?{selected:!0}:{},...typeof h=="object"&&h.disabled?{disabled:!0}:{}},typeof h=="object"?h.label:h)}),r);return qy(n,u,f,"select")}function dx(n){return S("form",{class:ge("stack-form",n.layout==="inline"?"stack-form--inline":null,n.className),...G(n.label)?{"aria-label":n.label}:{},...G(n.id)?{id:kt(n.id)}:{},...n.busy?{"aria-busy":"true"}:{},...xe(n.attrs)},[S("div",{class:"stack-form__fields"},n.children||null),S("div",{class:"stack-form__actions"},[xa({label:n.submitLabel||"Save",type:"submit",variant:n.submitVariant||"primary",busy:n.busy}),n.actions||null])],{submit:u=>{u.preventDefault(),n.onSubmit&&n.onSubmit(u)}})}function Ly(n){const u=kt(n.id||"stack-dialog"),o=[G(n.description)?`${u}-description`:null,...n.describedBy||[]].filter(Boolean);return S("dialog",{class:ge("stack-dialog",n.className),id:u,...n.role==="alertdialog"?{role:"alertdialog"}:{},"aria-labelledby":`${u}-title`,...o.length?{"aria-describedby":o.join(" ")}:{},...xe(n.attrs)},S("div",{class:"stack-dialog__surface"},[S("h2",{class:"stack-dialog__title",id:`${u}-title`},n.title),G(n.description)?S("p",{class:"stack-dialog__description",id:`${u}-description`},n.description):null,n.children?S("div",{class:"stack-dialog__body"},n.children):null,n.actions?S("div",{class:"stack-dialog__actions"},n.actions):null]),{cancel:r=>{r.preventDefault(),n.onClose&&n.onClose()}})}function fx(n){const u=kt(n.id||"stack-confirm"),o=(n.consequences||[]).filter(G),r=!G(n.requireText)||n.typed===n.requireText;return Ly({id:u,role:"alertdialog",title:n.title,description:n.description,describedBy:o.length?[`${u}-consequences`]:[],className:ge("stack-confirm",n.className),attrs:n.attrs,onClose:n.busy?null:n.onCancel,children:[o.length?S("ul",{class:"stack-confirm__consequences",id:`${u}-consequences`},o.map(f=>S("li",{},f))):null,G(n.requireText)?Hy({id:`${u}-typed`,name:"confirm",label:n.requireTextLabel||`Type ${n.requireText} to confirm`,value:n.typed===void 0||n.typed===null?"":n.typed,autocomplete:"off",spellcheck:"false",disabled:n.busy,onChange:n.onTypedChange}):null,n.error?Ss({title:n.error.title||"Not done",message:n.error.message,code:n.error.code,requestId:n.error.requestId}):null],actions:[xa({label:n.cancelLabel||"Cancel",variant:"ghost",disabled:n.busy,onClick:n.onCancel,attrs:{"data-dialog-cancel":"true"}}),xa({label:n.confirmLabel,variant:"danger",busy:n.busy,disabled:!r,onClick:n.onConfirm,attrs:{"data-dialog-confirm":"true"}})]})}function hx(n){const u=kt(n.id||"stack-evidence"),o=(n.claims||[]).filter(y=>y&&G(y.label)),r=o.map(y=>G(y.verification)?dd(y.verification,y.checks).state:"not_evaluated"),f=r.filter(y=>y!=="not_evaluated"),h=f.filter(y=>y==="verified").length,g=f.filter(y=>y==="verification_failed").length,v=r.length-f.length,m=f.length===0?"recorded":h===f.length&&v===0?"verified":"partial",p=v?` · ${v} recorded, not checked`:"",j=m==="recorded"?"Recorded facts · not independently verified":m==="verified"?f.length===1?"Verified":`All ${f.length} claims verified`:`${h} of ${f.length} checked claims verified${g?` · ${g} failed`:""}${p}`;return S("section",{class:ge("stack-evidence",`stack-evidence--${m}`,n.className),"aria-labelledby":`${u}-title`,"data-evidence":m,...xe(n.attrs)},[S("div",{class:"stack-evidence__header"},[S(du(n.headingLevel||2),{class:"stack-evidence__title",id:`${u}-title`},G(n.title)?n.title:"Evidence"),n.outcome?S("div",{class:"stack-evidence__outcome"},n.outcome):null]),S("p",{class:"stack-evidence__summary"},j),o.length?S("dl",{class:"stack-evidence__claims"},o.map(y=>{const x=!G(y.value)&&y.value!==0&&y.value!==!1;return S("div",{class:"stack-evidence__claim",...G(y.verification)?{"data-verification":dd(y.verification,y.checks).state}:{},...xe(y.attrs)},[S("dt",{class:"stack-evidence__label"},y.label),S("dd",{class:ge("stack-evidence__value",y.mono?"stack-evidence__value--mono":null),...x?{"data-missing":"true"}:{}},x?"—":typeof y.value=="boolean"?String(y.value):y.value),G(y.verification)?S("dd",{class:"stack-evidence__check"},$y({state:y.verification,checks:y.checks,evidenceHref:y.evidenceHref})):null])})):null,G(n.source)||G(n.recordedAt)?S("p",{class:"stack-evidence__source"},[G(n.source)?n.source:"Recorded",G(n.recordedAt)?[" · ",xs(n.recordedAt,"stack-evidence__at")]:null]):null])}const mx=["info","attention","critical"],vx={info:"i",attention:"▲",critical:"✕"};function yx(n){const u=mx.includes(n.tone)?n.tone:"info";return S("div",{class:ge("stack-alert",`stack-alert--${u}`,n.className),role:u==="critical"?"alert":"status","data-tone":u,...xe(n.attrs)},[S("span",{class:"stack-alert__glyph","aria-hidden":"true"},vx[u]),S("div",{class:"stack-alert__content"},[G(n.title)?S("p",{class:"stack-alert__title"},n.title):null,n.children?S("div",{class:"stack-alert__body"},n.children):null,n.actions?S("div",{class:"stack-alert__actions"},n.actions):null])])}function gx(n){const u=_d(n),o=n.checked!==void 0&&n.checked!==null,r=S("input",{class:"stack-checkbox__control",type:"checkbox",id:u,...G(n.name)?{name:n.name}:{},...G(n.value)?{value:String(n.value)}:{},...o&&n.checked?{checked:!0}:{},...kd(n,u)},[],n.onChange?{change:f=>n.onChange(!!f.target.checked)}:void 0);return S("div",{class:ge("stack-checkbox",n.error?"stack-checkbox--invalid":null,n.className),...xe(n.attrs)},[S("div",{class:"stack-checkbox__row"},[r,S("label",{class:"stack-checkbox__label",for:u},[n.label,n.required?S("span",{class:"stack-field__required","aria-hidden":"true"}," *"):null])]),G(n.hint)?S("p",{class:"stack-field__hint",id:`${u}-hint`},n.hint):null,G(n.error)?S("p",{class:"stack-field__error",id:`${u}-error`},n.error):null])}function bx(n){const u=kt(n.id||"stack-group"),o=[G(n.hint)?`${u}-hint`:null,G(n.error)?`${u}-error`:null].filter(Boolean);return S("fieldset",{class:ge("stack-fieldgroup",n.error?"stack-fieldgroup--invalid":null,n.className),id:u,...o.length?{"aria-describedby":o.join(" ")}:{},...n.disabled?{disabled:!0}:{},...xe(n.attrs)},[S("legend",{class:"stack-fieldgroup__legend"},[n.legend,n.required?S("span",{class:"stack-field__required","aria-hidden":"true"}," *"):null]),G(n.hint)?S("p",{class:"stack-field__hint",id:`${u}-hint`},n.hint):null,S("div",{class:"stack-fieldgroup__controls"},n.children||null),G(n.error)?S("p",{class:"stack-field__error",id:`${u}-error`},n.error):null])}function px(n){const u=(n.items||[]).filter(f=>f&&G(f.summary)),o=G(n.label)?n.label:"Activity";let r;return n.error?r=Ss(typeof n.error=="string"?{message:n.error}:n.error):n.loading&&!u.length?r=ou({what:G(n.what)?n.what:"activity"}):u.length?r=S("ol",{class:"stack-timeline__list","aria-label":o},u.map((f,h)=>S("li",{class:"stack-timeline__item",...xe(f.attrs)},[S("span",{class:"stack-timeline__marker","aria-hidden":"true"}),S("div",{class:"stack-timeline__content"},[S("p",{class:"stack-timeline__summary"},G(f.href)?S("a",{class:"stack-timeline__link",href:f.href},f.summary):f.summary),S("p",{class:"stack-timeline__meta"},[G(f.at)?xs(f.at,"stack-timeline__at"):S("span",{class:"stack-timeline__at","data-missing":"true"},"Time not recorded"),G(f.actor)?[" · ",S("span",{class:"stack-timeline__actor"},f.actor)]:null,f.status?[" ",S("span",{class:"stack-timeline__status"},f.status)]:null]),f.detail?S("div",{class:"stack-timeline__detail"},f.detail):null])],void 0,G(f.id)?f.id:h))):r=js({title:G(n.emptyTitle)?n.emptyTitle:"No activity recorded",headingLevel:n.headingLevel||3}),S("section",{class:ge("stack-timeline",n.className),...n.loading?{"aria-busy":"true"}:{},...xe(n.attrs)},[r,n.hasMore&&u.length?S("p",{class:"stack-timeline__more"},[G(n.moreHref)?S("a",{href:n.moreHref,class:"stack-timeline__link"},n.moreLabel||"Older activity exists"):n.onMore?xa({label:n.moreLabel||"Load older activity",onClick:n.onMore,busy:!!n.loading}):n.moreLabel||"Older activity exists"]):null])}const Yy=["completed","stopped"],xx=["running","pausing","paused","interrupted","blocked"],jx={signal:[["path",{d:"M3 14.6V17h2.4l8.2-8.2-2.4-2.4L3 14.6zm13.6-7.9a1 1 0 000-1.4l-1.9-1.9a1 1 0 00-1.4 0l-1.3 1.3 3.3 3.3 1.3-1.3z"}]],pause:[["rect",{x:"4.5",y:"3.5",width:"4",height:"13",rx:"1"}],["rect",{x:"11.5",y:"3.5",width:"4",height:"13",rx:"1"}]],resume:[["path",{d:"M6 3.8v12.4a.8.8 0 001.2.7l10-6.2a.8.8 0 000-1.4l-10-6.2A.8.8 0 006 3.8z"}]],interrupt:[["path",{d:"M11.6 1.8L4 11.2h5.2l-1 7 7.8-9.6h-5.3l.9-6.8z"}]],stop:[["rect",{x:"4",y:"4",width:"12",height:"12",rx:"1.5"}]],send:[["path",{d:"M10 2.5a1 1 0 01.7.3l5.5 5.5a1 1 0 01-1.4 1.4L11 5.9V16.5a1 1 0 01-2 0V5.9L5.2 9.7a1 1 0 01-1.4-1.4l5.5-5.5a1 1 0 01.7-.3z"}]]},Gy=n=>S("svg",{class:"stack-agent-controls__svg",xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 20 20",focusable:"false","aria-hidden":"true"},jx[n].map(([u,o])=>S(u,{...o,fill:"currentColor"}))),Pc=n=>Array.isArray(n)?n.length:Number(n)||0,id=(n,u,o)=>`${n} ${n===1?u:o}`;function Sx(n){const u=G(n.phase)?n.phase:"unknown",o=Pc(n.inFlight&&n.inFlight.generations),r=Pc(n.inFlight&&n.inFlight.actions),f=Pc(n.signaled),h=Pc(n.queued),g=[o||r?S("li",{class:"stack-agent-status__fact","data-fact":"in_flight"},[[o?id(o,"model call","model calls"):null,r?id(r,"action","actions"):null].filter(Boolean).join(", ")," in flight",u==="pausing"?" — it finishes before the pause takes effect":""]):null,f?S("li",{class:"stack-agent-status__fact","data-fact":"signaled"},`${f===1?"An update is":`${f} updates are`} coming; the agent keeps working`):null,h?S("li",{class:"stack-agent-status__fact","data-fact":"queued"},`${id(h,"update","updates")} queued for the next checkpoint`):null,G(n.reason)&&!Yy.includes(u)&&u!=="running"?S("li",{class:"stack-agent-status__fact","data-fact":"reason"},["Reason: ",n.reason]):null].filter(Boolean);return S("div",{class:ge("stack-agent-status",n.className),"data-phase":u,role:"status",...xe(n.attrs)},[Sd({field:"appport.agent.phase",value:u}),g.length?S("ul",{class:"stack-agent-status__facts"},g):null])}function Vy(n,u){const o=G(n.phase)?n.phase:"unknown",r=xx.includes(o)&&!n.disabled,f=o==="paused"||o==="interrupted"||o==="pausing",h=(g,v,m,p,j,y)=>xa({label:[S("span",{class:"stack-agent-controls__icon","aria-hidden":"true"},Gy(g)),n.labels?S("span",{class:"stack-agent-controls__text"},v):null],variant:j||"secondary",size:u,className:n.labels?null:"stack-agent-controls__square",disabled:!m||!p,busy:n.busy===g,onClick:p,attrs:{"data-op":g,"aria-label":v,title:y?`${v}: ${y}`:v}});return{phase:o,signal:h("signal",n.signalLabel||"Update coming",r,n.onSignal,u==="sm"?"ghost":"primary","Tell the agent an update is coming. It keeps working while you write it."),hold:f?h("resume","Resume",r,n.onResume,"secondary","Continue from where the agent stopped."):h("pause","Pause",r&&(o==="running"||o==="blocked"),n.onPause,"secondary","Start no new work. Work in flight finishes first."),interrupt:h("interrupt","Interrupt",r&&o!=="interrupted",n.onInterrupt,"secondary","Stop the agent’s current thinking now and hold. A running action still finishes."),stop:h("stop","Stop",r,n.onStop,"danger","End the task. Updates not yet used are closed.")}}function _x(n){const u=Vy(n,"md");return S("div",{class:ge("stack-agent-controls",n.className),role:"group","aria-label":G(n.label)?n.label:"Agent controls","data-phase":u.phase,...xe(n.attrs)},[u.signal,u.hold,u.interrupt,u.stop])}function kx(n){const u=n.phase||n.controls&&n.controls.phase,o=Yy.includes(u),r=kt(G(n.id)?n.id:"agent-update"),f=o?"The task has ended; it takes no more updates.":n.signaled?"The agent knows an update is coming and keeps working. It takes your update at its next checkpoint.":"The agent keeps working. It takes your update at its next checkpoint.",h=o||!!n.disabled,g=n.value!==void 0&&n.value!==null,v=[`${r}-hint`,G(n.error)?`${r}-error`:null].filter(Boolean).join(" "),m=n.controls?Vy({...n.controls,phase:n.controls.phase||u},"sm"):null,p=xa({label:S("span",{class:"stack-agent-controls__icon","aria-hidden":"true"},Gy("send")),type:"submit",variant:"primary",size:"sm",className:"stack-agent-controls__square",disabled:h,busy:!!n.busy,attrs:{"data-op":"send","aria-label":n.submitLabel||"Send update",title:n.submitLabel||"Send update"}});return S("form",{class:ge("stack-agent-composer",n.className),"aria-label":G(n.label)?n.label:"Update for the agent","data-signaled":n.signaled?"true":"false",...n.busy?{"aria-busy":"true"}:{},...xe(n.attrs)},[S("label",{class:"stack-field__label",for:r},G(n.fieldLabel)?n.fieldLabel:"Update"),S("div",{class:ge("stack-agent-composer__box",G(n.error)?"stack-agent-composer__box--invalid":null,h?"stack-agent-composer__box--disabled":null)},[S("textarea",{class:"stack-agent-composer__input",id:r,rows:String(Number(n.rows)||3),maxlength:String(n.maxLength||8e3),"aria-describedby":v,...G(n.placeholder)?{placeholder:n.placeholder}:{},...h?{disabled:!0}:{},...G(n.error)?{"aria-invalid":"true"}:{}},g?String(n.value):[],n.onChange?{input:j=>n.onChange(j.target.value)}:void 0),S("div",{class:"stack-agent-composer__bar",...m?{role:"group","aria-label":"Agent controls","data-phase":m.phase}:{}},[S("div",{class:"stack-agent-composer__start"},[m?m.signal:null,n.actions||null]),S("div",{class:"stack-agent-composer__end"},[m?m.hold:null,m?m.interrupt:null,m?m.stop:null,p])])]),S("p",{class:"stack-field__hint",id:`${r}-hint`},f),G(n.error)?S("p",{class:"stack-field__error",id:`${r}-error`},n.error):null],{submit:j=>{j.preventDefault();const y=j.target&&j.target.querySelector?j.target.querySelector("textarea"):null,x=y?y.value:g?String(n.value):"";!h&&n.onSubmit&&String(x).trim()&&n.onSubmit(j)},keydown:j=>{j.key==="Enter"&&!j.shiftKey&&!j.isComposing&&j.target&&j.target.tagName==="TEXTAREA"&&(j.preventDefault(),!h&&n.onSubmit&&String(j.target.value).trim()&&n.onSubmit(j))}})}const xy=["signaled","received","delivered","incorporated"],Nx={signaled:"Coming",received:"Received",delivered:"Incorporating",incorporated:"Incorporated"};function Tx(n){const u=(n.items||[]).filter(f=>f&&G(f.state)),o=G(n.label)?n.label:"Updates",r=u.length?S("ol",{class:"stack-agent-updates__list","aria-label":o},u.map((f,h)=>{const g=xy.indexOf(f.state),v=f.resolvedAt||f.deliveredAt||f.receivedAt||f.signaledAt;return S("li",{class:"stack-agent-update","data-state":f.state},[S("div",{class:"stack-agent-update__head"},[Sd({field:"appport.agent.instruction.state",value:f.state}),G(v)?xs(v,"stack-agent-update__at"):null]),g>=0?S("ol",{class:"stack-agent-update__track","aria-label":"Progress"},xy.map((m,p)=>S("li",{class:"stack-agent-update__step","data-reached":p<=g?"true":"false",...p===g?{"aria-current":"step"}:{}},Nx[m]))):null,G(f.text)?S("p",{class:"stack-agent-update__text"},f.text):S("p",{class:"stack-agent-update__text","data-missing":"true"},f.note?`Being written (${f.note})`:"Being written"),G(f.from)?S("p",{class:"stack-agent-update__from"},["From ",f.from]):null,f.resolution&&G(f.resolution.note)?S("p",{class:"stack-agent-update__resolution"},[S("span",{class:"stack-agent-update__resolution-by"},f.state==="incorporated"||f.state==="conflict"?"Agent: ":"Note: "),f.resolution.note]):null,n.onWithdraw&&(f.state==="signaled"||f.state==="received")?xa({label:"Withdraw",size:"sm",variant:"ghost",onClick:()=>n.onWithdraw(f),busy:n.busy===f.instructionId,attrs:{"data-op":"withdraw"}}):null],void 0,G(f.instructionId)?f.instructionId:h)})):js({title:G(n.emptyTitle)?n.emptyTitle:"No updates sent",headingLevel:n.headingLevel||3});return S("section",{class:ge("stack-agent-updates",n.className),...xe(n.attrs)},r)}function fu(n){const u=kt(n.idPrefix||"stack-brand-mark"),o=G(n.title);return S("svg",{class:ge("stack-brand-mark",n.className),xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 340 315",focusable:"false",...o?{role:"img","aria-labelledby":`${u}-title`}:{"aria-hidden":"true"},...xe(n.attrs)},[o?S("title",{id:`${u}-title`},n.title):null,S("defs",{},S("linearGradient",{id:`${u}-fill`,x1:"0",y1:"0",x2:"340",y2:"0",gradientUnits:"userSpaceOnUse"},[S("stop",{class:"stack-brand-mark__start",offset:"0.2"}),S("stop",{class:"stack-brand-mark__end",offset:"0.85"})])),S("path",{fill:`url(#${u}-fill)`,d:"M0 0H250C298 0 330 38 329 84C328 114 309 135 281 143L0 269V182L225 80H0Z"}),S("path",{fill:`url(#${u}-fill)`,d:"M0 315L290 182C318 172 341 202 340 246C339 288 306 315 268 315Z"})])}function Xy(n){const u=kt(n.id||"stack-theme");return S("div",{class:ge("stack-theme-switch",n.className),...xe(n.attrs)},[S("label",{class:"stack-visually-hidden",for:u},n.label||"Theme"),S("select",{class:"stack-theme-switch__control",id:u,"data-stack-theme-control":""},By.map(o=>S("option",{value:o.value,...o.value===(n.preference||"system")?{selected:!0}:{}},o.label)),n.onChange?{change:o=>n.onChange(o.target.value)}:void 0)])}const Qy=n=>n.product?{...fd(n.product.id)||{},...n.product}:null;function Ex(n){const u=yl.company,o=Qy(n),r=o?o.name:u.name,f=G(n.homeHref)?n.homeHref:"/";return S("header",{class:ge("stack-site-header",n.className),...o&&G(o.id)?{"data-stack-product":o.id}:{},...xe(n.attrs)},[S("a",{class:"stack-site-header__skip",href:`#${kt(n.mainId||"main")}`},n.skipLabel||"Skip to content"),S("div",{class:"stack-site-header__inner"},[S("div",{class:"stack-site-header__identity"},[S("a",{class:"stack-site-header__home",href:f,"aria-label":`${r} home`},[n.logo?S("span",{class:"stack-site-header__logo"},n.logo):o?S("span",{class:"stack-site-header__product-mark","aria-hidden":"true"},o.mark||r.slice(0,2)):fu({className:"stack-site-header__logo",idPrefix:`${kt(n.mainId||"main")}-mark`}),S("span",{class:"stack-site-header__name"},r)]),o?S("a",{class:"stack-site-header__family",href:u.href},["A ",u.name," product"]):null]),(n.navigation||[]).length?S("nav",{class:"stack-site-header__nav","aria-label":n.navigationLabel||"Main"},S("ul",{class:"stack-site-header__nav-list"},n.navigation.map(h=>S("li",{},S("a",{class:"stack-site-header__nav-item",href:h.href,...h.current?{"aria-current":"page"}:{},...xe(h.attrs)},h.label))))):null,S("div",{class:"stack-site-header__end"},[n.theme?Xy({id:`${kt(n.mainId||"main")}-theme`,preference:n.theme.preference,onChange:n.theme.onChange}):null,n.actions||null])])])}function Ax(n){const u=yl.company,o=Qy(n),r=n.columns||[],f=G(n.year)?n.year:null,h=G(n.owner)?n.owner:u.name;return S("footer",{class:ge("stack-site-footer",n.className),...o&&G(o.id)?{"data-stack-product":o.id}:{},...xe(n.attrs)},S("div",{class:"stack-site-footer__inner"},[S("div",{class:"stack-site-footer__top"},[S("div",{class:"stack-site-footer__about"},[S("p",{class:"stack-site-footer__name"},o?o.name:u.name),G(n.tagline)?S("p",{class:"stack-site-footer__tagline"},n.tagline):null]),r.map(g=>S("nav",{class:"stack-site-footer__column","aria-label":g.title},[S("p",{class:"stack-site-footer__heading"},g.title),S("ul",{class:"stack-site-footer__list"},(g.links||[]).map(v=>S("li",{},S("a",{class:"stack-site-footer__link",href:v.href,...xe(v.attrs)},v.label))))]))]),S("nav",{class:"stack-site-footer__family","aria-label":`${u.name} products`},[S("a",{class:"stack-site-footer__company",href:u.href},[fu({className:"stack-site-footer__mark",idPrefix:`${kt(n.id||"stack-footer")}-mark`}),S("span",{},o?u.family:`${u.name} — ${u.tagline}`)]),S("ul",{class:"stack-site-footer__products"},yl.products.map(g=>S("li",{"data-stack-product":g.id},S("a",{class:"stack-site-footer__product",href:g.href,...o&&o.id===g.id?{"aria-current":"true"}:{}},[S("span",{class:"stack-site-footer__product-name"},g.name),S("span",{class:"stack-site-footer__product-category"},g.category)]))))]),S("p",{class:"stack-site-footer__legal"},[`© ${f?`${f} `:""}${h}`,o?[" · ",o.name," is a ",S("a",{href:u.href},`${u.name} product`)]:null,n.legal?[" · ",n.legal]:null])]))}const hu=Object.freeze({Breadcrumbs:F0,Tabs:ex,TabPanel:tx,DataTable:lx,FilterBar:ix,Pagination:sx,Shell:cx,StatusIndicator:Sd,VerificationBadge:$y,FreshnessLabel:V0,Unavailable:X0,Loading:ou,EmptyState:js,ErrorPanel:Ss,MetadataList:Q0,ResourceIdentity:Z0,PageHeader:K0,Button:xa,TextField:Hy,Select:ox,Form:dx,Dialog:Ly,ConfirmAction:fx,EvidenceSummary:hx,Alert:yx,Checkbox:gx,FieldGroup:bx,ActivityTimeline:px,BrandMark:fu,ThemeSwitch:Xy,SiteHeader:Ex,SiteFooter:Ax,AgentStatus:Sx,AgentControls:_x,AgentUpdateComposer:kx,AgentUpdateList:Tx}),te=(n,u,o,r)=>({t:n,a:u||{},c:o===void 0?[]:[].concat(o),...r==null?{}:{k:String(r)}}),Ba=(...n)=>n.filter(Boolean).join(" "),Nd=n=>n!=null&&n!=="",hd=n=>{const u={};for(const[o,r]of Object.entries(n||{}))(/^(data-|aria-)/.test(o)||o==="id"||o==="title")&&(u[o]=r);return u},se=n=>Math.round(n*100)/100,md=8,Td=12,Zy=.6,Cx=640,wx=60,Ox=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Kl=(n,u=Td)=>String(n).length*u*Zy,vs=(n,u,o=Td)=>{const r=String(n);if(Kl(r,o)<=u)return r;const f=Math.max(1,Math.floor(u/(o*Zy))-1);return`${r.slice(0,f)}…`},Rx={USD:"$",EUR:"€",GBP:"£",JPY:"¥",CAD:"CA$",AUD:"A$",NZD:"NZ$",CHF:"CHF ",INR:"₹",CNY:"CN¥",MXN:"MX$",BRL:"R$"},Dx=new Set(["JPY"]),zx=[[1e12,"T"],[1e9,"B"],[1e6,"M"],[1e3,"K"]];function jy(n,u,o){const r=10**o,f=Math.round(n*r+n*r*Number.EPSILON),h=Math.floor(f/r);let g=o?String(f-h*r).padStart(o,"0"):"";for(;g.length>u&&g.endsWith("0");)g=g.slice(0,-1);const v=String(h).replace(/\B(?=(\d{3})+(?!\d))/g,",");return g?`${v}.${g}`:v}function Ft(n,u){if(n==null)return"—";if(typeof u=="function")return String(u(n));const o=u||{},r=o.style==="currency"||o.style==="percent"?o.style:"number";let f=o.divisor?n/o.divisor:n;r==="percent"&&(f*=100);const h=f<0;let g=Math.abs(f);const v=o.currency||"USD",m=r==="currency"?Dx.has(v)?0:2:r==="percent"?1:2;let p=o.maximumFractionDigits!==void 0?o.maximumFractionDigits:m,j=o.minimumFractionDigits!==void 0?o.minimumFractionDigits:r==="currency"?Math.min(m,p):0,y="";if(o.compact){p=o.maximumFractionDigits!==void 0?o.maximumFractionDigits:1,j=0;const C=10**p,w=zx.find(([H])=>Math.round(g/H*C)>=C);w&&(g/=w[0],y=w[1])}p<j&&(p=j);let x=jy(g,j,p);x.replace(/[0.,]/g,"")===""&&(x=jy(0,j,p));const T=x.replace(/[0.,]/g,"")==="",B=h&&!T?"-":"",D=r==="currency"?Rx[v]||`${v} `:"";return`${B}${D}${x}${y}${r==="percent"?"%":""}${o.suffix||""}`}const Mx=n=>new Date(n).toISOString().slice(0,10),Ux=n=>n.every(o=>{const r=new Date(o);return r.getUTCDate()===1&&r.getUTCHours()===0})?o=>{const r=new Date(o);return`${Ox[r.getUTCMonth()]} ${r.getUTCFullYear()}`}:Mx,It=(n,u)=>{throw new TypeError(`${n}: ${u}`)};function $x(n,u){const o=typeof u=="number"?u:Date.parse(u);return Number.isFinite(o)||It(n,`x value ${JSON.stringify(u)} is not a time (use epoch milliseconds or an ISO date)`),o}function Ed(n,u,o="category"){Array.isArray(u)||It(n,"series must be an array"),["category","time","number"].includes(o)||It(n,`xType must be "category", "time" or "number", not ${JSON.stringify(o)}`);const r=new Set,f=[],h=new Map,g=u.map((v,m)=>{(!v||typeof v!="object")&&It(n,`series[${m}] must be an object`),(typeof v.id!="string"||!v.id)&&It(n,`series[${m}] needs a non-empty string id`),r.has(v.id)&&It(n,`series id "${v.id}" is used twice`),r.add(v.id),(typeof v.label!="string"||!v.label)&&It(n,`series "${v.id}" needs a label`),Array.isArray(v.data)||It(n,`series "${v.id}" data must be an array`);const p=new Set,j=new Map;v.data.forEach((x,T)=>{(!x||typeof x!="object")&&It(n,`series "${v.id}" point ${T} must be an object`),typeof x.x=="string"||typeof x.x=="number"&&Number.isFinite(x.x)||It(n,`series "${v.id}" point ${T} has an invalid x`),x.y===null||typeof x.y=="number"&&Number.isFinite(x.y)||It(n,`series "${v.id}" point ${T} y must be a finite number or null, not ${JSON.stringify(x.y)}`);let D;o==="time"?D=$x(n,x.x):o==="number"?(typeof x.x!="number"&&It(n,`series "${v.id}" point ${T} x must be a number for xType "number"`),D=x.x):D=String(x.x),p.has(D)&&It(n,`series "${v.id}" has two points at x ${JSON.stringify(x.x)}`),p.add(D),j.set(D,x.y),h.has(D)||(h.set(D,f.length),f.push(D))});const y=Number.isInteger(v.palette)&&v.palette>=1&&v.palette<=md?v.palette:m%md+1;return{id:v.id,label:v.label,hidden:!!v.hidden,palette:y,dash:m%4,values:j}});return o!=="category"&&f.sort((v,m)=>v-m),{keys:f,series:g.map(v=>({...v,y:f.map(m=>v.values.has(m)?v.values.get(m):null)}))}}function Ky(n,u,o=5){if(!(Number.isFinite(n)&&Number.isFinite(u)))return{min:0,max:1,ticks:[0,1]};if(n===u){if(n===0)return{min:0,max:1,ticks:[0,.5,1]};const j=Math.abs(n)*.5;return Ky(Math.min(0,n-j),Math.max(0,u+j),o)}const r=u-n,f=r/Math.max(1,o),h=10**Math.floor(Math.log10(f)),g=[1,2,2.5,5,10].map(j=>j*h).find(j=>r/j<=o)||10*h,v=Math.floor(n/g)*g,m=Math.ceil(u/g)*g,p=[];for(let j=v;j<=m+g/2;j+=g)p.push(Math.abs(j)<g/1e6?0:Number(j.toPrecision(12)));return{min:v,max:m,ticks:p}}const lu=(n,u,o,r)=>f=>u===n?(o+r)/2:o+(f-n)/(u-n)*(r-o),Jy=(n,u)=>{const o=Math.max(120,Math.round(Number(n.width)||Cx)),r=Number(n.aspectRatio)>0?Number(n.aspectRatio):u.aspectRatio,f=Math.round(Number(n.height)>0?Number(n.height):Math.min(u.maxHeight,Math.max(u.minHeight,o/r)));return{width:o,height:f}};function ms(n,u,o){const r=!!u.loading;return te("figure",{class:Ba("stack-chart",`stack-chart--${n}`,u.className),"data-chart":n,"data-chart-state":o.state,...r?{"aria-busy":"true"}:{},...hd(u.attrs)},[te("figcaption",{class:"stack-chart__header"},[u.headingLevel?te(`h${Math.min(6,Math.max(1,Number(u.headingLevel)||3))}`,{class:"stack-chart__title"},u.title):te("span",{class:"stack-chart__title"},u.title),Nd(u.description)?te("span",{class:"stack-chart__description"},u.description):null]),o.content])}function Iy(n,u,o){if(u.error){const r=typeof u.error=="string"?{message:u.error}:u.error;return{state:"error",content:te("div",{class:"stack-chart__state"},Ss({title:u.errorTitle||"Could not show this chart",message:r.message,code:r.code,requestId:r.requestId,onRetry:u.onRetry}))}}return u.loading?{state:"loading",content:te("div",{class:"stack-chart__state"},ou({what:u.loadingWhat||"chart data",long:u.loadingLong}))}:o?null:{state:"empty",content:te("div",{class:"stack-chart__state"},js({title:u.emptyTitle||"No data to show",body:u.emptyBody,headingLevel:(Number(u.headingLevel)||2)+1}))}}function vd(n,u,o){const r=typeof o.onToggleSeries=="function"?o.onToggleSeries:null;return te("ul",{class:"stack-chart__legend","aria-label":o.legendLabel||"Series"},u.map(f=>{const g=[te("span",{class:Ba("stack-chart__swatch",n==="line"||n==="sparkline"?"stack-chart__swatch--line":null,`stack-chart__s${f.palette}`,`stack-chart__d${f.dash}`),"aria-hidden":"true"}),te("span",{class:"stack-chart__legend-label"},f.label),f.note?te("span",{class:"stack-chart__legend-note"},f.note):null],v=r?{...te("button",{type:"button",class:"stack-chart__legend-toggle","aria-pressed":f.hidden?"false":"true"},g),on:{click:()=>r(f.id)}}:g;return te("li",{class:Ba("stack-chart__legend-item",f.hidden?"stack-chart__legend-item--hidden":null),"data-series":f.id},v,f.id)}))}function Fy(n,u,o){const r=n.table==="visible",f=te("thead",{},te("tr",{},u.map((v,m)=>te("th",{scope:"col",class:m?"stack-chart__num":null},v,m)))),h=te("tbody",{},o.map((v,m)=>te("tr",{},v.map((p,j)=>j===0?te("th",{scope:"row"},p,j):te("td",{class:"stack-chart__num",...p==="—"?{"data-missing":"true"}:{}},p,j)),m))),g=te("div",{class:"stack-chart__table-wrap"},te("table",{class:"stack-chart__table"},[te("caption",{class:"stack-visually-hidden"},n.title),f,h]));return n.table==="none"?null:te("details",{class:"stack-chart__data",...r?{open:!0}:{}},[te("summary",{class:"stack-chart__data-summary"},n.tableLabel||"Data table"),g])}function Wy(n,u,o,r,f){const v=Math.max(Kl(r),...f.map(x=>Kl(x.text)+(x.palette?14:0))),m=Math.min(o-4,v+16),p=16+16*(f.length+1)-4;let j=n+10;j+m>o-2&&(j=n-10-m),j<2&&(j=2);const y=m-16;return te("g",{class:"stack-chart__tip","aria-hidden":"true"},[te("rect",{class:"stack-chart__tip-box",x:se(j),y:se(u),width:se(m),height:se(p),rx:4}),te("text",{class:"stack-chart__tip-title",x:se(j+8),y:se(u+8+10)},vs(r,y)),f.map((x,T)=>[x.palette?te("rect",{class:Ba("stack-chart__tip-swatch",`stack-chart__s${x.palette}`),x:se(j+8),y:se(u+8+16*(T+1)+1),width:9,height:9,rx:2},[],`s${T}`):null,te("text",{class:"stack-chart__tip-row",x:se(j+8+(x.palette?14:0)),y:se(u+8+16*(T+1)+10)},vs(x.text,y-(x.palette?14:0)),`t${T}`)])])}function Bx(n,u,o){if(typeof o.xFormat=="function")return n.keys.map(r=>String(o.xFormat(r)));if(u==="time"){const r=Ux(n.keys);return n.keys.map(r)}return u==="number"?n.keys.map(r=>Ft(r,o.xFormat)):n.keys.map(String)}const qx=(n,u)=>n.axisFormat||(n.format&&typeof n.format=="object"&&Math.max(Math.abs(u.min),Math.abs(u.max))>=1e4?{...n.format,compact:!0,minimumFractionDigits:void 0,maximumFractionDigits:void 0}:n.format);function Hx(n,u,o,r){let f=1/0,h=-1/0;for(let g=0;g<u;g++)if(o){let v=0,m=0;for(const p of n){const j=p.y[g];j!==null&&(j>=0?v+=j:m+=j)}h=Math.max(h,v),f=Math.min(f,m)}else for(const v of n){const m=v.y[g];m!==null&&(h=Math.max(h,m),f=Math.min(f,m))}return r&&(f=Math.min(f,0),h=Math.max(h,0)),{min:f,max:h}}function Lx(n,u){const o=new Array(u).fill(0),r=new Array(u).fill(0);return n.map(f=>f.y.map((h,g)=>{if(h===null)return null;if(h>=0){const m=o[g];return o[g]+=h,[m,o[g]]}const v=r[g];return r[g]+=h,[r[g],v]}))}function mu(n,u){const o=u.xType||"category",r=Ed(Yx(n),u.series,o),f=r.series,h=f.filter(K=>!K.hidden),g=r.keys.length,v=h.some(K=>K.y.some(ye=>ye!==null)),m=Iy(n,u,v),p=f.map(K=>({id:K.id,label:K.label,palette:K.palette,dash:K.dash,hidden:K.hidden})),j=u.legend===!1?!1:u.legend===!0||f.length>1;if(m)return ms(n,u,{state:m.state,content:[j&&m.state==="empty"?vd(n,p,u):null,m.content]});const y=n==="bar"&&u.orientation==="horizontal",x=!!u.stacked,T=n==="bar",B=x?30:Math.max(24,12*h.length+12),D=Math.max(120,g*B+48),{width:C,height:w}=Jy(u,y?{aspectRatio:.01,minHeight:D,maxHeight:D}:{aspectRatio:2,minHeight:180,maxHeight:420}),H=Bx(r,o,u),W=n!=="line"||u.zeroBaseline!==!1,$=Hx(h,g,x,W),Z=y?C:w,ae=Ky($.min,$.max,Math.max(2,Math.min(8,Math.floor(Z/(y?90:48))))),P=qx(u,$),q=ae.ticks.map(K=>Ft(K,P)),de=Td,I=u.yLabel?de+8:0,Ne=u.xLabel?de+10:0;let Ye,mt;const bt=10;let Qe=12;if(y){const K=Math.max(...H.map(ye=>Kl(ye)));Ye=Math.round(Math.min(C*.4,K+12)+I),mt=de+12+Ne,Qe=Math.round(Math.max(12,Kl(q[q.length-1])/2+4))}else Ye=Math.round(Math.max(...q.map(K=>Kl(K)))+12+I),mt=de+14+Ne,!T&&o!=="category"&&g&&(Qe=Math.round(Math.max(12,Kl(H[g-1])/2+4)));const V={x0:Ye,x1:Math.max(Ye+20,C-Qe),y0:bt,y1:Math.max(bt+20,w-mt)},ee=V.x1-V.x0,ie=V.y1-V.y0,_e=y?lu(ae.min,ae.max,V.x0,V.x1):lu(ae.min,ae.max,V.y1,V.y0),Te=(y?ie:ee)/Math.max(1,g);let ct;if(T||o==="category")ct=K=>(y?V.y0:V.x0)+Te*(K+.5);else{const K=lu(r.keys[0],r.keys[g-1],V.x0,V.x1);ct=ye=>K(r.keys[ye])}const ut=[],Oa=u.grid!==!1;ut.push(te("g",{class:"stack-chart__axis stack-chart__axis--value","aria-hidden":"true"},ae.ticks.map((K,ye)=>{const Oe=se(_e(K));return[Oa?te("line",y?{class:Ba("stack-chart__grid",K===0?"stack-chart__zero":null),x1:Oe,x2:Oe,y1:V.y0,y2:V.y1}:{class:Ba("stack-chart__grid",K===0?"stack-chart__zero":null),x1:V.x0,x2:V.x1,y1:Oe,y2:Oe},[],`g${ye}`):null,te("text",y?{class:"stack-chart__tick stack-chart__tick--middle",x:Oe,y:se(V.y1+de+4)}:{class:"stack-chart__tick stack-chart__tick--end",x:se(V.x0-6),y:se(Oe+4)},q[ye],`t${ye}`)]})));const N=y?Ye-I-8:Math.min(140,Math.max(24,ee/2));let X=-1/0;if(ut.push(te("g",{class:"stack-chart__axis stack-chart__axis--category","aria-hidden":"true"},H.map((K,ye)=>{const Oe=se(ct(ye)),Pe=vs(K,N);if(y)return Oe-de/2<X+4?null:(X=Oe+de/2,te("text",{class:"stack-chart__tick stack-chart__tick--end",x:se(V.x0-8),y:se(Oe+4)},Pe,ye));const at=Kl(Pe);let $e=Oe-at/2,he="middle",nt=Oe;return $e<0?($e=0,he="start",nt=0):$e+at>C&&($e=C-at,he="end",nt=C),$e<X+8||$e<0?null:(X=$e+at,te("text",{class:`stack-chart__tick stack-chart__tick--${he}`,x:se(nt),y:se(V.y1+de+6)},Pe,ye))}))),u.yLabel){const K=se((V.y0+V.y1)/2);ut.push(te("text",{class:"stack-chart__axis-label stack-chart__tick--middle",x:se(de),y:K,transform:`rotate(-90 ${se(de)} ${K})`},u.yLabel))}u.xLabel&&ut.push(te("text",{class:"stack-chart__axis-label stack-chart__tick--middle",x:se((V.x0+V.x1)/2),y:se(w-4)},u.xLabel));const Q=x?Lx(h,g):null,J=[];if(T){const K=Te*.72,ye=x?K:K/Math.max(1,h.length);h.forEach((Oe,Pe)=>{const at=Oe.y.map(($e,he)=>{if($e===null)return null;const[nt,pt]=x?Q[Pe][he]:$e>=0?[0,$e]:[$e,0],Ct=_e(nt),vt=_e(pt),Gt=ct(he)-K/2+(x?0:Pe*ye),La=Math.abs(vt-Ct);return La===0?null:y?te("rect",{class:"stack-chart__bar",x:se(Math.min(Ct,vt)),y:se(Gt+.5),width:se(La),height:se(Math.max(1,ye-1))},[],he):te("rect",{class:"stack-chart__bar",x:se(Gt+.5),y:se(Math.min(Ct,vt)),width:se(Math.max(1,ye-1)),height:se(La)},[],he)});J.push(te("g",{class:Ba("stack-chart__series",`stack-chart__s${Oe.palette}`,`stack-chart__d${Oe.dash}`),"data-series":Oe.id},at,Oe.id))})}else h.forEach((K,ye)=>{const Oe=[];let Pe=[];K.y.forEach((he,nt)=>{if(he===null){Pe.length&&Oe.push(Pe),Pe=[];return}const[pt,Ct]=x?Q[ye][nt]:[0,he];Pe.push({i:nt,x:ct(nt),y:_e(x?he>=0?Ct:pt:he),base:_e(x?he>=0?pt:Ct:Math.max(ae.min,Math.min(0,ae.max)))})}),Pe.length&&Oe.push(Pe);const at=[],$e=u.curve==="step";Oe.forEach((he,nt)=>{const pt=$e?he.flatMap((vt,Gt)=>Gt?[{...vt,y:he[Gt-1].y,base:he[Gt-1].base},vt]:[vt]):he,Ct=pt.map((vt,Gt)=>`${Gt?"L":"M"}${se(vt.x)} ${se(vt.y)}`).join(" ");if(n==="area"&&he.length>1){const vt=[...pt].reverse().map(Gt=>`L${se(Gt.x)} ${se(Gt.base)}`).join(" ");at.push(te("path",{class:"stack-chart__area",d:`${Ct} ${vt} Z`},[],`a${nt}`))}he.length>1&&at.push(te("path",{class:"stack-chart__line",d:Ct},[],`l${nt}`)),(he.length===1||u.points)&&he.forEach(vt=>at.push(te("circle",{class:"stack-chart__point",cx:se(vt.x),cy:se(vt.y),r:3.5},[],`p${nt}-${vt.i}`)))}),J.push(te("g",{class:Ba("stack-chart__series",`stack-chart__s${K.palette}`,`stack-chart__d${K.dash}`),"data-series":K.id},at,K.id))});ut.push(te("g",{class:"stack-chart__marks"},J));const re=u.format,pe=g<=wx;ut.push(te("g",{class:"stack-chart__targets"},r.keys.map((K,ye)=>{const Oe=ct(ye);let Pe,at;T||o==="category"?(Pe=Oe-Te/2,at=Oe+Te/2):(Pe=ye===0?V.x0:(ct(ye-1)+Oe)/2,at=ye===g-1?V.x1:(Oe+ct(ye+1))/2);const $e=h.map(pt=>({palette:pt.palette,text:`${pt.label}: ${Ft(pt.y[ye],re)}`})),he=`${H[ye]}: ${h.map(pt=>`${pt.label} ${Ft(pt.y[ye],re)}`).join(", ")}`,nt=y?{x:V.x0,y:se(Pe),width:se(ee),height:se(Math.max(1,at-Pe))}:{x:se(Pe),y:V.y0,width:se(Math.max(1,at-Pe)),height:se(ie)};return te("g",{class:"stack-chart__target",...pe?{tabindex:"0"}:{},role:"img","aria-label":he},[te("rect",{class:"stack-chart__target-area",...nt}),T?null:te("line",{class:"stack-chart__cursor",x1:se(Oe),x2:se(Oe),y1:V.y0,y2:V.y1}),Wy(y?Math.min(C-20,V.x0+ee/2):Oe,y?se(Math.min(Pe+Te,w-16*(h.length+2))):V.y0,C,H[ye],$e)],ye)})));const Ae=te("svg",{class:"stack-chart__svg",viewBox:`0 0 ${C} ${w}`,width:C,height:w,role:"group","aria-label":`${u.title}. ${pe?"Use Tab to read each value, or open the data table.":"Open the data table to read the values."}`},ut),ne=Fy(u,[u.xLabel||(o==="time"?"Date":"Category"),...h.map(K=>K.label)],r.keys.map((K,ye)=>[H[ye],...h.map(Oe=>Ft(Oe.y[ye],re))]));return ms(n,u,{state:"ready",content:[j?vd(n,p,u):null,te("div",{class:"stack-chart__plot"},Ae),ne]})}const Yx=n=>({line:"LineChart",area:"AreaChart",bar:"BarChart"})[n]||n;function Gx(n){return mu("line",n||{})}function Vx(n){return mu("area",n||{})}function Xx(n){return mu("bar",n||{})}function Qx(n){return mu("bar",{...n||{},stacked:!0})}const sd=(n,u,o,r,f,h)=>{const g=(m,p)=>`${se(n+m*Math.sin(p))} ${se(u-m*Math.cos(p))}`,v=h-f>Math.PI?1:0;return`M${g(r,f)} A${se(r)} ${se(r)} 0 ${v} 1 ${g(r,h)} L${g(o,h)} A${se(o)} ${se(o)} 0 ${v} 0 ${g(o,f)} Z`};function Zx(n){const u=n||{},o=Ed("DonutChart",u.series,"category"),r=o.series.filter(I=>!I.hidden);r.length>1&&It("DonutChart","shows exactly one series; hide the others or use another chart");const f=r[0],h=u.format,g=f?o.keys.map((I,Ne)=>({id:I,label:I,value:f.y[Ne],palette:Ne%md+1,dash:Ne%4})):[],v=g.filter(I=>I.value!==null&&I.value<0),m=g.reduce((I,Ne)=>I+(Ne.value&&Ne.value>0?Ne.value:0),0),p=Iy("donut",u,m>0&&!v.length);if(p&&!(v.length&&!u.error&&!u.loading))return ms("donut",u,p);if(v.length)return ms("donut",u,{state:"unsupported",content:te("div",{class:"stack-chart__state"},te("div",{class:"stack-unavailable stack-unavailable--unsupported",role:"note","data-capability-status":"unsupported"},[te("p",{class:"stack-unavailable__title"},"This data cannot be shown as parts of a whole"),te("p",{class:"stack-unavailable__reason"},`Negative values: ${v.map(I=>`${I.label} (${Ft(I.value,h)})`).join(", ")}. Use a bar chart.`)]))});const{width:j,height:y}=Jy({...u,width:Math.min(Number(u.width)||320,360)},{aspectRatio:1,minHeight:160,maxHeight:360}),x=Math.min(j,y),T=j/2,B=y/2,D=x/2-4,C=D*(Number(u.innerRatio)>0&&Number(u.innerRatio)<.95?Number(u.innerRatio):.62),w=I=>I&&I>0?I/m:0,H=I=>`${(w(I)*100).toFixed(1)}%`;let W=0;const $=[];g.forEach((I,Ne)=>{if(!(I.value>0))return;const Ye=w(I.value)*Math.PI*2,mt=Ye>=Math.PI*2-1e-9?`${sd(T,B,C,D,0,Math.PI)} ${sd(T,B,C,D,Math.PI,Math.PI*2)}`:sd(T,B,C,D,W,W+Ye),bt=W+Ye/2;$.push(te("g",{class:Ba("stack-chart__slice",`stack-chart__s${I.palette}`),tabindex:"0",role:"img","aria-label":`${I.label}: ${Ft(I.value,h)}, ${H(I.value)}`,"data-slice":I.id},[te("path",{class:"stack-chart__arc",d:mt}),Wy(se(T+D*.6*Math.sin(bt)),se(Math.max(2,Math.min(y-54,B-D*.6*Math.cos(bt)-20))),j,I.label,[{text:`${Ft(I.value,h)} · ${H(I.value)}`}])],Ne)),W+=Ye});const Z=Nd(u.centerValue)?String(u.centerValue):Ft(m,h),ae=u.center===!1?null:te("g",{class:"stack-chart__center","aria-hidden":"true"},[te("text",{class:"stack-chart__center-value stack-chart__tick--middle",x:se(T),y:se(B+2)},vs(Z,C*1.8,16)),te("text",{class:"stack-chart__center-label stack-chart__tick--middle",x:se(T),y:se(B+18)},vs(u.centerLabel||"Total",C*1.8))]),P=te("svg",{class:"stack-chart__svg stack-chart__svg--donut",viewBox:`0 0 ${j} ${y}`,width:j,height:y,role:"group","aria-label":`${u.title}. Use Tab to read each part, or open the data table.`},[te("g",{class:"stack-chart__marks"},$),ae]),q=g.map(I=>({id:I.id,label:I.label,palette:I.palette,dash:I.dash,note:I.value===null?"—":`${Ft(I.value,h)} · ${H(I.value)}`})),de=Fy(u,[u.xLabel||"Category",f.label,u.shareLabel||"Share"],g.map(I=>[I.label,Ft(I.value,h),I.value===null?"—":H(I.value)]));return ms("donut",u,{state:"ready",content:[te("div",{class:"stack-chart__donut"},[te("div",{class:"stack-chart__plot stack-chart__plot--donut"},P),u.legend===!1?null:vd("donut",q,{...u,onToggleSeries:void 0})]),de]})}function Kx(n){const u=n||{};Nd(u.label)||It("Sparkline","needs a label (its accessible name)");const r=Ed("Sparkline",[{id:"spark",label:u.label,data:u.data||[]}],u.xType||"category").series[0].y,f=r.length,h=Math.max(24,Math.round(Number(u.width)||120)),g=Math.max(12,Math.round(Number(u.height)||32)),v=u.format,m=r.map((Z,ae)=>({v:Z,i:ae})).filter(Z=>Z.v!==null),p=Ba("stack-sparkline",u.className);if(!m.length)return te("span",{class:Ba(p,"stack-sparkline--empty"),role:"img","aria-label":`${u.label}: no data`,...hd(u.attrs)},te("span",{class:"stack-sparkline__empty","aria-hidden":"true"},"—"));let j=Math.min(...m.map(Z=>Z.v)),y=Math.max(...m.map(Z=>Z.v));j===y&&(j-=1,y+=1);const x=3,T=Z=>f===1?h/2:x+Z/(f-1)*(h-x*2),B=lu(j,y,g-x,x),D=[];let C=[];r.forEach((Z,ae)=>{Z===null?(C.length&&D.push(C),C=[]):C.push(ae)}),C.length&&D.push(C);const w=m[0],H=m[m.length-1],W=`${u.label}: ${Ft(w.v,v)} to ${Ft(H.v,v)}, low ${Ft(Math.min(...m.map(Z=>Z.v)),v)}, high ${Ft(Math.max(...m.map(Z=>Z.v)),v)}${m.length<f?`, ${f-m.length} missing`:""}`,$=H.v>w.v?"up":H.v<w.v?"down":"flat";return te("span",{class:p,"data-trend":$,...hd(u.attrs)},te("svg",{class:"stack-sparkline__svg",viewBox:`0 0 ${h} ${g}`,width:h,height:g,role:"img","aria-label":W},[D.map((Z,ae)=>Z.length>1?te("path",{class:"stack-sparkline__line",d:Z.map((P,q)=>`${q?"L":"M"}${se(T(P))} ${se(B(r[P]))}`).join(" ")},[],ae):te("circle",{class:"stack-sparkline__point",cx:se(T(Z[0])),cy:se(B(r[Z[0]])),r:1.75},[],ae)),u.endpoints?[w,H].map((Z,ae)=>te("circle",{class:"stack-sparkline__endpoint",cx:se(T(Z.i)),cy:se(B(Z.v)),r:2.5},[],`e${ae}`)):null]))}const Py=Object.freeze({LineChart:Gx,AreaChart:Vx,BarChart:Xx,StackedBarChart:Qx,DonutChart:Zx,Sparkline:Kx}),ys="stack-ui.theme",Ad=Object.freeze(["system","light","dark"]),eg=n=>{try{return n&&n.localStorage?n.localStorage:null}catch{return null}};function Sy(n){const u=eg(globalThis);if(!u)return"system";try{const o=u.getItem(ys);return Ad.includes(o)?o:"system"}catch{return"system"}}function Jx(n,u){const o=eg(globalThis);if(!o||!Ad.includes(n))return!1;try{return n==="system"?o.removeItem(ys):o.setItem(ys,n),!0}catch{return!1}}function Ix(n,u){const o=typeof document<"u"?document.documentElement:null;o&&(n==="light"||n==="dark"?o.setAttribute("data-stack-theme",n):o.removeAttribute("data-stack-theme"))}function Fx(n,u,o){const r=Ad.includes(n)?n:"system";return Jx(r),Ix(r),r}`${JSON.stringify(ys)}`;const Wx="http://www.w3.org/2000/svg";function yd(n,u,o){const r=u||document;if(n==null||n===!1||n===!0)return r.createDocumentFragment();if(typeof n=="string"||typeof n=="number")return r.createTextNode(String(n));if(Array.isArray(n)){const f=r.createDocumentFragment();for(const h of n)f.appendChild(yd(h,r,o));return f}if(au(n)){const f=n.t==="svg"?Wx:o,h=f?r.createElementNS(f,n.t):r.createElement(n.t);for(const[g,v]of Object.entries(n.a))v==null||v===!1||h.setAttribute(g,v===!0?"":String(v));for(const[g,v]of Object.entries(n.on||{}))h.addEventListener(g,v);for(const g of n.c)h.appendChild(yd(g,r,f));return h}if(n&&typeof n.nodeType=="number")return n;throw new TypeError("toDom: unsupported child")}function Px(n,u){const r=document.getElementById(String(n).replace(/[^A-Za-z0-9_-]/g,"-"));r&&typeof r.focus=="function"&&r.focus({preventScroll:!0})}Object.freeze(Object.fromEntries(Object.entries({...hu,...Py}).map(([n,u])=>[n,(o,r)=>yd(u(o||{}),r)])));const ej={class:"className",for:"htmlFor",datetime:"dateTime",tabindex:"tabIndex",readonly:"readOnly",autocomplete:"autoComplete",inputmode:"inputMode",maxlength:"maxLength",minlength:"minLength",spellcheck:"spellCheck"},_y={click:"onClick",change:"onChange",input:"onInput",submit:"onSubmit",keydown:"onKeyDown",cancel:"onCancel",close:"onClose"};function hi(n,u){if(n==null||n===!1||n===!0)return null;if(typeof n=="string"||typeof n=="number")return n;if(Array.isArray(n))return E.createElement(E.Fragment,u===void 0?null:{key:u},...n.map((o,r)=>hi(o,r)));if(E.isValidElement(n))return u===void 0?n:E.createElement(E.Fragment,{key:u},n);if(au(n)){const o=n.k===void 0?u:n.k,r=o===void 0?{}:{key:o};for(const[v,m]of Object.entries(n.a))m==null||m===!1||(r[ej[v]||v]=m);const f=n.t==="input"||n.t==="select"||n.t==="textarea";for(const[v,m]of Object.entries(n.on||{})){if(!_y[v])throw new Error(`toReact: unsupported event ${v}`);r[f&&(v==="input"||v==="change")?"onChange":_y[v]]=m}let h=n.c;if(n.t==="textarea"&&(r.value=h.filter(v=>typeof v=="string"||typeof v=="number").join(""),h=[]),n.t==="select"){const v=h.find(m=>au(m)&&m.t==="option"&&m.a.selected);h=h.map(m=>au(m)&&m.t==="option"&&m.a.selected?{...m,a:{...m.a,selected:!1}}:m),v&&(r.value=v.a.value)}f&&"checked"in r&&!r.onChange&&(r.defaultChecked=r.checked,delete r.checked),f&&"value"in r&&!r.onChange&&(r.defaultValue=r.value,delete r.value);const g=h.map((v,m)=>hi(v,m));return E.createElement(n.t,r,...g)}throw new TypeError("toReact: unsupported child")}const Le=n=>{const u=hu[n],o=r=>hi(u(r||{}));return o.displayName=`Stack${n}`,o},Ve=Le("StatusIndicator"),ky=Le("VerificationBadge"),tg=Le("FreshnessLabel");Le("Unavailable");const tj=Le("Loading"),aj=Le("EmptyState"),lj=Le("ErrorPanel"),ca=Le("MetadataList");Le("ResourceIdentity");const nj=Le("PageHeader"),ze=Le("Button"),ij=Le("Breadcrumbs"),ag=Le("Tabs"),lg=Le("TabPanel"),gt=Le("DataTable"),ng=Le("FilterBar"),sj=Le("Pagination"),cj=Le("Shell"),qe=Le("TextField"),Xt=Le("Select"),gl=Le("Form");Le("EvidenceSummary");const tt=Le("Alert"),iu=Le("Checkbox"),gd=Le("FieldGroup"),su=Le("ActivityTimeline");Le("AgentStatus");Le("AgentControls");Le("AgentUpdateComposer");Le("AgentUpdateList");const uj=Le("BrandMark"),rj=Le("ThemeSwitch");Le("SiteHeader");Le("SiteFooter");function oj(n){const u=E.useRef(null),[o,r]=E.useState(void 0);return E.useEffect(()=>{const f=u.current;if(n||!f||typeof ResizeObserver>"u")return;const h=()=>{const v=f.querySelector(".stack-chart__plot"),m=Math.round(v&&v.clientWidth||f.clientWidth||0);m>0&&r(p=>p===m?p:m)};h();const g=new ResizeObserver(h);return g.observe(f),()=>g.disconnect()},[n]),[u,n||o]}const gi=n=>{const u=Py[n],o=r=>{const[f,h]=oj(r.width),g=hi(u(h?{...r,width:h}:r));return n==="Sparkline"?g:E.cloneElement(g,{ref:f})};return o.displayName=`Stack${n}`,o};gi("LineChart");gi("AreaChart");gi("BarChart");gi("StackedBarChart");gi("DonutChart");gi("Sparkline");function ig(n,u,o){const r=E.useRef(null),f=E.useRef({open:n,onDismiss:u,busy:o});return f.current={open:n,onDismiss:u,busy:o},E.useEffect(()=>{const h=r.current;if(!h)return;const g=()=>{const v=f.current;v.open&&(v.busy?h.showModal():v.onDismiss&&v.onDismiss())};return h.addEventListener("close",g),()=>h.removeEventListener("close",g)},[]),E.useEffect(()=>{const h=r.current;h&&(n&&!h.open?h.showModal():!n&&h.open&&h.close())},[n]),r}function Cd(n){const u=ig(!!n.open,n.onClose,!n.onClose);return E.cloneElement(hi(hu.Dialog(n)),{ref:u})}Cd.displayName="StackDialog";function wd(n){const u=ig(!!n.open,n.onCancel,!!n.busy),[o,r]=E.useState("");E.useEffect(()=>{n.open||r("")},[n.open]);const f=n.typed!==void 0;return E.cloneElement(hi(hu.ConfirmAction({...n,typed:f?n.typed:o,onTypedChange:f?n.onTypedChange:r})),{ref:u})}wd.displayName="StackConfirmAction";const Et="positive",Pa="progress",jn="attention",ia="critical",pa="neutral",Ql="unknown",dj={"feltkit.runtime.state":{starting:Pa,ready:Et,closing:Pa,closed:pa,failed:ia},"feltkit.activity.outcome":{success:[Et,"Success"],error:[ia,"Error"],denied:[pa,"Denied"]},"feltkit.authority.allowed":{true:[Et,"Allowed"],false:[pa,"Denied"]},"feltkit.service.state":{configured:[Et,"Configured"],unconfigured:[jn,"Not set up"],unhealthy:[ia,"Unhealthy"],available:[pa,"Not enabled"],unavailable:[ia,"Unavailable"]},"feltkit.service.evidence":{succeeded:[Et,"Succeeded"],denied:[pa,"Denied"],failed:[ia,"Failed"],started:[Ql,"Outcome unknown"]},"feltkit.webhook.delivery":{delivered:Et,pending:Pa,delivering:Pa,retrying:Pa,failed:ia},"feltkit.secret.state":{set:[Et,"Set"],missing:[jn,"Missing"],revoked:[pa,"Removed"]},"feltkit.agent.task":{ready:Pa,running:Pa,waiting:Pa,blocked:jn,completed:Et,failed:ia,cancelled:pa},"feltkit.agent.action":{proposed:[jn,"Waiting for approval"],approved:[Pa,"Approved, starting"],executing:[Pa,"Running"],succeeded:[Et,"Succeeded"],failed:[ia,"Failed"],rejected:[pa,"Rejected"],interrupted:[Ql,"Outcome unknown"]},"feltkit.provider.call":{succeeded:[Et,"Completed"],failed:[ia,"Known failure"],running:[pa,"Running"],unknown:[Ql,"Outcome unknown"],stranded:[Ql,"Stranded: outcome unknown"],verified:[Et,"Settled: verified"],decided:[jn,"Settled: person's decision"]},"feltkit.integration.call":{succeeded:[Et,"Succeeded"],failed:[ia,"Failed"],unknown:[Ql,"Outcome unknown"],started:[Ql,"Outcome unknown"]},"feltkit.readiness.check":{pass:[Et,"Passes"],fail:[ia,"Fails"],warn:[jn,"Review"],external:[Ql,"Outside FeltKit"]},"feltkit.path.step":{done:[Et,"Done"],todo:[jn,"To do"],info:[pa,"Review"],"not-tracked":[Ql,"Not tracked"]},"feltkit.project.state":{current:[Et,"This dashboard"],running:[Et,"Running"],stopped:[pa,"Stopped"],missing:[ia,"Missing"]},"feltkit.model.ready":{true:[Et,"Ready"],false:[ia,"Not ready"]},"feltkit.integration.configured":{true:[Et,"Configured"],false:[ia,"Not configured"]},"feltkit.deployment.state":{live:[Et,"Live"],built:[pa,"Not deployed"],none:[pa,"Not set up"]}},Ny=n=>n?n.charAt(0).toUpperCase()+n.slice(1).replace(/[_-]+/g," "):"Unknown";function Od(n,u){const o=String(u),r=dj[n]?.[o];return r?Array.isArray(r)?{tone:r[0],label:r[1],mapped:!0}:{tone:r,label:Ny(o),mapped:!0}:{tone:"unknown",label:u==null||u===""?"Unknown":Ny(o),mapped:!1}}function Nt(n){if(n==null||n==="")return"—";const u=typeof n=="number"?n:Date.parse(n);if(Number.isNaN(u))return String(n);const o=Math.max(0,Math.round((Date.now()-u)/1e3));return o<5?"just now":o<60?`${o}s ago`:o<3600?`${Math.floor(o/60)}m ago`:o<86400?`${Math.floor(o/3600)}h ago`:new Date(u).toLocaleDateString()}function sg(n=15e3){const[,u]=E.useState(0);E.useEffect(()=>{const o=setInterval(()=>u(r=>r+1),n);return()=>clearInterval(o)},[n])}function ot({field:n,value:u,label:o,detail:r}){const f=Od(n,u);return s.jsx(Ve,{tone:f.tone,label:o??f.label,detail:r,attrs:{"data-state":String(u)}})}function mi({outcome:n}){const u=Od("feltkit.activity.outcome",n);return s.jsx(Ve,{tone:u.mapped?u.tone:"critical",label:u.label,attrs:{"data-outcome":n}})}function oe({title:n,action:u,children:o,className:r="",label:f}){const h=E.useId();return s.jsxs("section",{className:`feltkit-panel ${r}`,...n?{"aria-labelledby":h}:f?{"aria-label":f}:{},children:[(n||u)&&s.jsxs("header",{className:"feltkit-panel__header",children:[n&&s.jsx("h2",{className:"feltkit-panel__title",id:h,children:n}),u&&s.jsx("div",{className:"feltkit-panel__actions",children:u})]}),o]})}function wa({title:n,children:u,noMatch:o,action:r}){return s.jsx(aj,{title:n,body:u,variant:o?"no-match":"empty",action:r,headingLevel:3})}function At({what:n}){return s.jsx(tj,{what:n})}function Me({error:n,retry:u,title:o}){const r=n;return s.jsx(lj,{title:o??"Not done",message:r?.message??String(n),code:r?.code,requestId:r?.requestId,onRetry:u})}function Jl(n,u){const o=n;return{message:o?.message??String(n),...o?.code?{code:o.code}:{},...o?.requestId?{requestId:o.requestId}:{},...u?{onRetry:u}:{}}}function el({value:n,max:u=4e3,label:o}){let r=JSON.stringify(n,null,2)??"undefined";return r.length>u&&(r=`${r.slice(0,u)}
|
|
12
|
+
… (${r.length-u} more characters)`),s.jsx("pre",{className:"feltkit-code",tabIndex:0,...o?{"aria-label":o}:{},children:r})}function gs({text:n,label:u}){return s.jsxs("div",{className:"feltkit-command",children:[s.jsx("pre",{className:"feltkit-code",tabIndex:0,...u?{"aria-label":u}:{},children:n}),s.jsx(_s,{text:n})]})}function _s({text:n,label:u="Copy"}){const[o,r]=E.useState(!1);return s.jsx(ze,{size:"sm",variant:"ghost",label:o?"Copied":u,onClick:()=>{navigator.clipboard?.writeText(n).then(()=>{r(!0),setTimeout(()=>r(!1),1200)})}})}function bs({schema:n,label:u}){if(!n)return s.jsx("span",{className:"feltkit-muted",children:"—"});if(n.type!=="object"||!n.properties)return s.jsx("code",{className:"feltkit-type",children:cu(n)});const o=new Set(n.required??[]),r=Object.entries(n.properties);return r.length?s.jsx("ul",{className:"feltkit-schema",...u?{"aria-label":u}:{},children:r.map(([f,h])=>s.jsxs("li",{children:[s.jsxs("code",{children:[f,o.has(f)?"":"?"]}),s.jsx("code",{className:"feltkit-type",children:cu(h)}),Ty(h)&&s.jsx("span",{className:"feltkit-muted feltkit-small",children:Ty(h)})]},f))}):s.jsx("span",{className:"feltkit-muted",children:"no fields"})}function cu(n){return n?n.enum?n.enum.map(u=>JSON.stringify(u)).join(" | "):n.anyOf?n.anyOf.map(cu).join(" | "):n.type==="array"?`${cu(n.items)}[]`:n.type==="object"?n.properties?`{ ${Object.keys(n.properties).join(", ")} }`:"object":Array.isArray(n.type)?n.type.join(" | "):n.type??"unknown":"unknown"}function Ty(n){const u=[];return n.minLength!==void 0&&u.push(`min ${n.minLength}`),n.maxLength!==void 0&&u.push(`max ${n.maxLength}`),n.minimum!==void 0&&u.push(`≥ ${n.minimum}`),n.maximum!==void 0&&u.push(`≤ ${n.maximum}`),u.join(", ")}function We(n,u){const[o,r]=E.useState({loading:!0}),[f,h]=E.useState(0);return E.useEffect(()=>{let g=!0;return r(v=>({...v,loading:!0})),n().then(v=>g&&r({data:v,loading:!1}),v=>g&&r(m=>({data:m.data,error:v,loading:!1}))),()=>{g=!1}},[...u,f]),{...o,reload:()=>h(g=>g+1)}}function He({label:n,action:u,done:o,variant:r="secondary",size:f="sm",disabled:h,confirm:g}){const[v,m]=E.useState(!1),[p,j]=E.useState(!1),[y,x]=E.useState(null),T=E.useId().replace(/:/g,""),B=async()=>{j(!0),x(null);try{const D=await u();m(!1),o?.(D)}catch(D){x(D)}finally{j(!1)}};return s.jsxs(s.Fragment,{children:[s.jsx(ze,{label:n,size:f,variant:g&&r==="secondary"?"secondary":r,busy:p&&!g,disabled:h,onClick:()=>g?(x(null),m(!0)):void B()}),g&&s.jsx(wd,{id:`confirm-${T}`,open:v,title:g.title,consequences:g.consequences,confirmLabel:g.confirmLabel??n,requireText:g.requireText,busy:p,error:y?Jl(y):null,onConfirm:()=>{B()},onCancel:()=>m(!1)}),!g&&y?s.jsx(Me,{error:y}):null]})}function _n({as:n,setAs:u,devUsers:o,label:r="Act as",id:f}){return o.length?s.jsx(Xt,{id:f,label:r,value:n,onChange:u,options:o.map(h=>({value:h.id,label:`${h.name??h.id} (${h.roles.join(", ")})`})),className:"feltkit-identity"}):null}function cg(){const[n,u]=E.useState(()=>Sy());return E.useEffect(()=>{Fx(n)},[n]),E.useEffect(()=>{const o=r=>{r.key===ys&&u(Sy())};return window.addEventListener("storage",o),()=>window.removeEventListener("storage",o)},[]),[n,u]}const fj="/_feltkit/assets/feltkit-mark-BygpVIiS.png";function hj(){sg();const{overview:n,activity:u}=Wt();if(!n)return null;const o=n.capabilities??[],r=ug(u,n.recentActivity??[]).slice(0,8),f=[...n.recentErrors??[],...n.recentDenials??[]].sort((p,j)=>j.at.localeCompare(p.at)).slice(0,6),h=Object.values(n.counts??{}).reduce((p,j)=>p+Number(j),0),g=(n.services??[]).filter(p=>p.state!=="available"&&p.state!=="unavailable"),v=n.agent??{tasks:[],waiting:0,handoffs:0},m=!!n.environment.production;return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:n.application.name,subtitle:n.application.description??"Where this application's state lives, what it can do, and what it has done.",status:s.jsx(ot,{field:"feltkit.runtime.state",value:n.state}),actions:n.url?s.jsx("a",{href:n.url,target:"_blank",rel:"noreferrer",children:"Open app ↗"}):null}),s.jsxs("div",{className:"feltkit-grid feltkit-grid--stats",children:[s.jsx(eu,{label:"Records",value:h,detail:`${n.collections.length} collection${n.collections.length===1?"":"s"}`,href:"#/data"}),s.jsx(eu,{label:"Functions",value:n.functions.length,detail:`${n.functions.filter(p=>p.kind==="query").length} queries · ${n.functions.filter(p=>p.kind==="mutation").length} mutations`,href:"#/capabilities/functions"}),s.jsx(eu,{label:"Capabilities",value:o.length,detail:"published through AppPort",href:"#/capabilities"}),s.jsx(eu,{label:"Errors",value:(n.recentErrors??[]).length,detail:`${(n.recentDenials??[]).length} recent denials`,href:"#/activity"})]}),s.jsxs("div",{className:"feltkit-grid feltkit-grid--wide",children:[s.jsxs(oe,{title:"Where state lives",children:[s.jsx("p",{className:"feltkit-muted",children:"One FeltDB instance serves this environment. Functions, AppPort capabilities, AppPort Services, sessions and this activity log all read and write it."}),s.jsx(ca,{items:[{label:"Environment",value:n.environment.name},{label:"Storage",value:`FeltDB ${n.instance.feltdbVersion} · ${n.instance.mode} · ${n.instance.durable?"durable":"ephemeral"}`},{label:"Location",value:n.instance.location,mono:!0},{label:"Journal position",value:String(n.instance.sequence??""),mono:!0},{label:"Opened",value:`${Nt(n.instance.openedAt)} by pid ${n.instance.pid}`}]}),s.jsxs("div",{children:[s.jsx("p",{className:"feltkit-label",children:"Components on this instance"}),s.jsx("ul",{className:"feltkit-list",children:Object.entries(n.components??{}).map(([p,j])=>s.jsxs("li",{className:"feltkit-list__row",children:[s.jsx("span",{className:"feltkit-list__name",children:p}),s.jsx("span",{className:"feltkit-muted feltkit-small",children:j.join(", ")})]},p))})]})]}),s.jsxs(oe,{title:"Recent activity",action:s.jsx("a",{href:"#/activity",children:"All activity →"}),children:[s.jsx(su,{label:"Recent activity",emptyTitle:"Nothing has happened yet",items:r.map(p=>({id:p.id,at:p.at,actor:p.principal?.id??(p.kind==="system"?"system":"anonymous"),summary:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:p.name})," ",s.jsxs("span",{className:"feltkit-muted",children:["via ",p.via]}),p.writes?.length?s.jsxs("span",{className:"feltkit-muted",children:[" · ",p.writes.length," write",p.writes.length===1?"":"s"]}):null]}),status:s.jsx(mi,{outcome:p.outcome}),href:`#/activity/${p.id}`}))}),r.length===0&&s.jsx("p",{className:"feltkit-muted feltkit-small",children:"Open the app and make a change. Every query, mutation, capability call and sign-in appears here."})]})]}),n.path&&s.jsx(oe,{title:"Path to production",children:s.jsx("ol",{className:"feltkit-steps",children:n.path.map(p=>s.jsxs("li",{children:[s.jsx(ot,{field:"feltkit.path.step",value:p.state}),s.jsxs("span",{children:[p.link?s.jsx("a",{href:`#/${p.link}`,children:p.step}):s.jsx("strong",{children:p.step})," ",s.jsx("span",{className:"feltkit-steps__detail",children:p.detail})]})]},p.step))})}),s.jsxs("div",{className:"feltkit-grid",children:[s.jsx(oe,{title:"Data",action:s.jsx("a",{href:"#/data",children:"Explore →"}),children:n.collections.length===0?s.jsxs(wa,{title:"No collections",children:["Declare one with ",s.jsxs("code",{children:['app.collection("name", ',"{ … }",")"]}),"."]}):s.jsx("ul",{className:"feltkit-list",children:n.collections.map(p=>s.jsx("li",{children:m?s.jsxs("span",{className:"feltkit-list__row",children:[s.jsx("span",{className:"feltkit-list__name",children:p.name}),s.jsx("span",{className:"feltkit-muted",children:n.counts?.[p.name]??"—"})]}):s.jsxs("a",{href:`#/data/${p.name}`,className:"feltkit-list__row",children:[s.jsx("span",{className:"feltkit-list__name",children:p.name}),s.jsx("span",{className:"feltkit-muted",children:n.counts?.[p.name]??"—"})]})},p.name))})}),s.jsx(oe,{title:"Capabilities",action:s.jsx("a",{href:"#/capabilities",children:"Inspect →"}),children:o.length===0?s.jsxs(wa,{title:"No capabilities published",children:["Add ",s.jsx("code",{children:'capability: "name.verb"'})," to a query or mutation to publish it through AppPort."]}):s.jsx("ul",{className:"feltkit-list",children:o.map(p=>s.jsx("li",{children:s.jsxs("a",{href:`#/capabilities/${p.name}`,className:"feltkit-list__row",children:[s.jsx("span",{className:"feltkit-list__name",children:p.name}),s.jsx("span",{className:"feltkit-muted feltkit-small",children:p.effect})]})},p.name))})}),s.jsx(oe,{title:"Services",action:s.jsx("a",{href:"#/services",children:"Manage →"}),children:g.length===0?s.jsxs(wa,{title:"No services enabled",children:["Enable AppPort Services with ",s.jsxs("code",{children:["feltkit(","{"," services: ","{"," files: true ","}"," ","}",")"]}),"."]}):s.jsx("ul",{className:"feltkit-list",children:g.map(p=>s.jsx("li",{children:s.jsxs("a",{href:`#/services/${p.id}`,className:"feltkit-list__row",children:[s.jsx("span",{children:p.name}),s.jsx(ot,{field:"feltkit.service.state",value:p.state})]})},p.id))})})]}),s.jsxs(oe,{title:"Agent",action:s.jsx("a",{href:"#/agent",children:"Open agent →"}),children:[v.waiting>0&&s.jsx("p",{children:s.jsxs("a",{href:"#/agent",children:[v.waiting," action",v.waiting===1?"":"s"," waiting for approval: review"]})}),v.handoffs>0&&s.jsxs("p",{className:"feltkit-muted feltkit-small",children:[v.handoffs," task(s) wait for a coding agent. Nothing works on them until one claims it: connect one from the Agent screen."]}),v.tasks.length===0?s.jsx("p",{className:"feltkit-muted feltkit-small",children:"No agent tasks yet. Diagnose a failed job from Services, or start one on the Agent screen."}):s.jsx("ul",{className:"feltkit-list",children:v.tasks.map(p=>s.jsx("li",{children:s.jsxs("a",{href:`#/agent/${p.id}`,className:"feltkit-list__row",children:[s.jsx("span",{children:p.objective}),s.jsx(ot,{field:"feltkit.agent.task",value:p.status})]})},p.id))})]}),f.length>0&&s.jsx(oe,{title:"Recent errors and denials",action:s.jsx("a",{href:"#/activity",children:"Investigate →"}),children:s.jsx(su,{label:"Recent errors and denials",items:f.map(p=>({id:p.id,at:p.at,summary:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:p.name})," ",p.error?.code?s.jsx("code",{children:p.error.code}):null," ",s.jsx("span",{className:"feltkit-muted",children:p.error?.message})]}),status:s.jsx(mi,{outcome:p.outcome}),href:`#/activity/${p.id}`}))})}),!m&&s.jsx(oe,{title:"Development",children:s.jsx(ca,{items:[{label:"Runtime",value:`started ${Nt(n.startedAt)} · functions loaded ${Nt(n.loadedAt)} · generation ${n.generation}`},{label:"Project",value:n.projectDir,mono:!0},{label:"Endpoints",value:`${n.url}/api · ${n.url}/appport · ${n.url}/mcp`,mono:!0},{label:"Deploy",value:"npx feltkit deploy",mono:!0,hint:"Builds, verifies the production build boots, and writes a Node/Docker artifact."}]})})]})}function eu({label:n,value:u,detail:o,href:r}){return s.jsxs("a",{className:"feltkit-stat",href:r,children:[s.jsx("span",{className:"feltkit-stat__label",children:n}),s.jsx("span",{className:"feltkit-stat__value",children:u}),s.jsx("span",{className:"feltkit-stat__detail",children:o})]})}function ug(n,u){const o=new Set;return[...n,...u].filter(r=>o.has(r.id)?!1:(o.add(r.id),!0)).sort((r,f)=>f.id.localeCompare(r.id))}function mj({collection:n}){const{version:u,overview:o}=Wt(),r=We(()=>ue("/collections"),[u]),f=r.data?.collections??[],h=f.find(v=>v.name===n)??f.find(v=>v.owner==="application")??f[0],g=!!h?.editable&&!o?.environment?.production;return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:"Data",subtitle:"Records in this environment's FeltDB instance. Application collections are validated by their schemas; platform collections belong to FeltKit and AppPort Services and are read-only here."}),r.error&&!r.data?s.jsx(Me,{title:"Collections could not be read",error:r.error,retry:r.reload}):r.data?s.jsxs("div",{className:"feltkit-split",children:[s.jsx("nav",{className:"feltkit-index","aria-label":"Collections",children:["application","platform"].map(v=>{const m=f.filter(p=>v==="application"?p.owner==="application":p.owner!=="application");return m.length?s.jsxs("div",{children:[s.jsx("p",{className:"feltkit-index__heading",children:v==="application"?"Application":"Platform"}),s.jsx("ul",{children:m.map(p=>s.jsx("li",{children:s.jsxs("a",{href:`#/data/${p.name}`,"aria-current":h?.name===p.name?"page":void 0,children:[s.jsx("span",{className:"feltkit-index__name",children:p.name}),s.jsx("span",{className:"feltkit-index__meta",children:p.count})]})},p.name))})]},v):null})}),s.jsx("section",{className:"feltkit-detail","aria-label":h?`Collection ${h.name}`:"Collection",children:h?s.jsx(vj,{collection:h,editable:g},h.name):s.jsx(wa,{title:"No collections"})})]}):s.jsx(At,{what:"collections"})]})}function vj({collection:n,editable:u}){const{version:o}=Wt(),[r,f]=E.useState(""),[h,g]=E.useState(""),[v,m]=E.useState(null),[p,j]=E.useState([]),[y,x]=E.useState(null),[T,B]=E.useState({busy:!1,error:null}),[D,C]=E.useState(null),w=v?`&field=${encodeURIComponent(v.field)}&eq=${encodeURIComponent(v.value)}`:"",H=We(()=>ue(`/collections/${encodeURIComponent(n.name)}?limit=50${w}`),[n.name,w,o]);E.useEffect(()=>{H.data&&(j(H.data.records),x(H.data.nextCursor))},[H.data]);const W=E.useMemo(()=>{const Z=n.schema?.properties?Object.keys(n.schema.properties):[],ae=[...new Set(p.flatMap(P=>Object.keys(P)))].filter(P=>P!=="id"&&P!=="__version");return["id",...(Z.length?Z:ae).slice(0,6),"__version"]},[n.schema,p]),$=async()=>{if(y){B({busy:!0,error:null});try{const Z=await ue(`/collections/${encodeURIComponent(n.name)}?limit=50&cursor=${encodeURIComponent(y)}${w}`);j(ae=>[...ae,...Z.records]),x(Z.nextCursor),B({busy:!1,error:null})}catch(Z){B({busy:!1,error:Z})}}};return s.jsxs(s.Fragment,{children:[s.jsx(zt,{title:s.jsx("code",{children:n.name}),subtitle:`${n.owner==="application"?"Application collection":`Owned by ${n.owner}`} · ${n.count} record${n.count===1?"":"s"}${n.description?` · ${n.description}`:""}`,status:n.editable?null:s.jsx(Ve,{tone:"neutral",label:"Read-only"}),actions:u?s.jsx(ze,{variant:"primary",label:"New record",onClick:()=>C("new")}):null}),n.schema&&s.jsxs("details",{className:"feltkit-details",children:[s.jsx("summary",{children:"Schema"}),s.jsx(bs,{schema:n.schema,label:`${n.name} schema`}),s.jsx("p",{className:"feltkit-muted feltkit-small",children:"Enforced by FeltKit on every write through ctx.db. FeltDB stores JSON documents and adds id and __version."})]}),s.jsx(ng,{label:`Filter ${n.name}`,idPrefix:`filter-${n.name}`,filters:[{id:"field",label:"Field",type:"select",value:r,options:[{value:"",label:"Choose a field"},...W.map(Z=>({value:Z,label:Z}))]},{id:"value",label:"Equals",type:"text",value:h,placeholder:"value"}],onChange:(Z,ae)=>Z==="field"?f(ae):g(ae),onSubmit:()=>m(r&&h!==""?{field:r,value:h}:null),onClear:()=>(m(null),f(""),g("")),applied:v?1:0,result:H.data?v?`${p.length}${y?"+":""} records match ${v.field} = ${v.value}`:`${p.length}${y?"+":""} records shown`:"",applyLabel:"Apply"}),s.jsx(gt,{label:`${n.name} records`,columns:W.map(Z=>({id:Z,header:Z})),rows:p.map(Z=>({key:Z.id,cells:Object.fromEntries(W.map(ae=>[ae,s.jsx(yj,{value:Z[ae],mono:ae==="id"||ae==="__version"},ae)])),onSelect:()=>C(Z),selected:D!=="new"&&D?.id===Z.id})),loading:H.loading,loadingWhat:"records",error:H.error&&!H.data?{title:"Records could not be read",...Jl(H.error,H.reload)}:null,noMatch:!!v,noMatchTitle:"No records match",noMatchBody:"Try another value, or clear the filter.",emptyTitle:"No records yet",emptyBody:n.owner==="application"?"Records appear here as soon as a mutation writes them.":void 0}),p.length>0&&s.jsx(sj,{label:`${n.name} pages`,hasNext:!!y,onNext:()=>{$()},nextLabel:T.busy?"Loading…":"Load more",summary:`${p.length} shown${y?"; more exist":""}`}),T.error?s.jsx(Me,{title:"The next page could not be read",error:T.error,retry:()=>{$()}}):null,D&&s.jsx(bj,{collection:n,record:D==="new"?null:D,editable:u,onClose:()=>C(null),onSaved:()=>(C(null),H.reload())})]})}function yj({value:n,mono:u}){if(n==null)return s.jsx("span",{className:"feltkit-muted",children:"—"});if(typeof n=="boolean")return s.jsx("code",{children:String(n)});if(typeof n=="number"&&n>1e12&&n<1e13)return s.jsx("span",{title:String(n),children:new Date(n).toLocaleString()});if(typeof n=="object")return s.jsx("span",{className:"feltkit-mono",children:JSON.stringify(n).slice(0,80)});const o=String(n),r=o.length>60?`${o.slice(0,60)}…`:o;return u?s.jsx("span",{className:"feltkit-mono",children:r}):s.jsx("span",{title:o.length>60?o:void 0,children:r})}function gj(n){const u={};for(const[o,r]of Object.entries(n?.properties??{}))(n.required??[]).includes(o)&&(u[o]=r.type==="number"||r.type==="integer"?/At$/.test(o)?Date.now():0:r.type==="boolean"?!1:"");return u}function bj({collection:n,record:u,editable:o,onClose:r,onSaved:f}){const h=u?Object.fromEntries(Object.entries(u).filter(([H])=>H!=="id"&&H!=="__version")):gj(n.schema),[g,v]=E.useState(JSON.stringify(h,null,2)),[m,p]=E.useState(null),[j,y]=E.useState(!1),[x,T]=E.useState(!1),[B,D]=E.useState(null),C=async()=>{p(null);let H;try{H=JSON.parse(g)}catch{p({code:"INVALID_JSON",message:"That is not valid JSON."});return}y(!0);try{await ue(u?`/collections/${n.name}/${encodeURIComponent(u.id)}`:`/collections/${n.name}`,{method:u?"PATCH":"POST",body:JSON.stringify({record:H})}),f()}catch(W){p(W)}finally{y(!1)}},w=async()=>{y(!0),D(null);try{await ue(`/collections/${n.name}/${encodeURIComponent(u.id)}`,{method:"DELETE"}),T(!1),f()}catch(H){D(H)}finally{y(!1)}};return s.jsxs(s.Fragment,{children:[s.jsxs(Cd,{id:"record",open:!0,className:"feltkit-dialog-wide",title:u?s.jsx("code",{children:`${n.name} / ${u.id}`}):`New ${n.name} record`,description:u?`Version ${u.__version}. Activity shows what wrote it.`:"Validated against the collection's schema when you create it.",onClose:j?void 0:r,actions:o?s.jsxs(s.Fragment,{children:[u&&s.jsx(ze,{variant:"danger",label:"Delete record",disabled:j,onClick:()=>(D(null),T(!0))}),s.jsx(ze,{variant:"ghost",label:"Close",disabled:j,onClick:r}),s.jsx(ze,{variant:"primary",label:u?"Save changes":"Create record",busy:j,onClick:()=>{C()}})]}):s.jsx(ze,{label:"Close",onClick:r}),children:[o?s.jsxs(s.Fragment,{children:[s.jsxs(tt,{tone:"attention",title:"Development edit",children:["Validated against the schema and committed atomically, recorded in Activity as ",s.jsx("code",{children:"admin"})," via ",s.jsx("code",{children:"dashboard"}),". Function access rules do not apply to these edits; this tool is not offered in production."]}),s.jsx(qe,{id:"record-json",label:"Record (JSON)",multiline:!0,rows:14,value:g,onChange:v,spellcheck:"false"}),m?s.jsx(Me,{title:u?"Not saved":"Not created",error:m}):null]}):s.jsx(el,{value:u,max:2e4,label:"Record"}),u&&n.owner!=="application"&&s.jsxs("p",{className:"feltkit-muted feltkit-small",children:[n.owner," owns this collection. Change it through its service or capability so its authorization and audit trail apply: ",s.jsx("a",{href:"#/services",children:"Services"}),"."]}),u&&s.jsx("p",{className:"feltkit-small",children:s.jsx("a",{href:"#/activity",children:"Find what wrote it in Activity →"})})]}),u&&s.jsx(wd,{id:"record-delete",open:x,title:`Delete ${n.name} / ${u.id}?`,consequences:["The record is removed from FeltDB in one transaction.","Activity records the delete as admin via dashboard.","It cannot be undone from here."],confirmLabel:"Delete record",busy:j,error:B?Jl(B):null,onConfirm:()=>{w()},onCancel:()=>T(!1)})]})}const pj=(n,u)=>n==="*"||n===u||n.endsWith(".*")&&u.startsWith(n.slice(0,-1));function xj(n,u){return Object.entries(n??{}).filter(([,o])=>o.some(r=>pj(r,u))).map(([o])=>o)}function rg(n){if(!n||n.type!=="object")return{};const u={};for(const o of n.required??[]){const r=n.properties?.[o]??{};u[o]=r.type==="boolean"?!0:r.type==="number"||r.type==="integer"?0:""}return u}function jj({selected:n}){const{version:u,overview:o}=Wt(),r=We(()=>ue("/capabilities"),[u]),f=r.data?.capabilities??[],h=o?.functions??[],[g,v]=E.useState(n==="functions"||n?.includes(":")?"functions":"capabilities"),m=g==="capabilities"?f:h,p=m.find(j=>j.name===n)??m[0];return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:"Capabilities",subtitle:"What this application can do. Capabilities are published through AppPort, discoverable by other applications and agents (MCP), and every invocation passes the same authorization as any other caller."}),s.jsx(ag,{label:"Capabilities and functions",idPrefix:"capabilities",panelId:"capabilities-panel",active:g,onSelect:j=>{v(j),Ha(j==="functions"?"capabilities/functions":"capabilities")},tabs:[{id:"capabilities",label:"AppPort capabilities",badge:String(f.length)},{id:"functions",label:"All functions",badge:String(h.length)}]}),s.jsx(lg,{id:"capabilities-panel",idPrefix:"capabilities",active:g,children:r.error&&!r.data?s.jsx(Me,{title:"Capabilities could not be read",error:r.error,retry:r.reload}):r.data?s.jsxs("div",{className:"feltkit-split",children:[s.jsx("nav",{className:"feltkit-index","aria-label":g==="capabilities"?"Capabilities":"Functions",children:m.length===0?s.jsx("p",{className:"feltkit-muted feltkit-small",children:"None published yet."}):s.jsx("ul",{children:m.map(j=>s.jsx("li",{children:s.jsxs("a",{href:`#/capabilities/${j.name}`,"aria-current":p?.name===j.name?"page":void 0,children:[s.jsx("span",{className:"feltkit-index__name",children:j.name}),s.jsx("span",{className:"feltkit-index__meta",children:g==="functions"?j.kind:`v${j.version}`})]})},j.name))})}),s.jsx("section",{className:"feltkit-detail","aria-label":p?p.name:"Detail",children:p?g==="capabilities"?s.jsx(Sj,{capability:p,roles:o?.roles??{},mcpTools:r.data.mcp?.tools??[],devUsers:o?.devUsers??[],development:o?.environment?.development},p.name):s.jsx(_j,{fn:p,roles:o?.roles??{},devUsers:o?.devUsers??[],development:o?.environment?.development},p.name):s.jsx(wa,{title:g==="capabilities"?"No capabilities":"No functions",children:g==="capabilities"?s.jsxs(s.Fragment,{children:["Publish a query or mutation with ",s.jsxs("code",{children:["capability: ","{",' name: "tasks.complete", description: "…" ',"}"]})," and a returns schema."]}):s.jsxs(s.Fragment,{children:["Export ",s.jsx("code",{children:"app.query()"})," or ",s.jsx("code",{children:"app.mutation()"})," from a module in ",s.jsx("code",{children:"feltkit/"}),"."]})})})]}):s.jsx(At,{what:"capabilities"})})]})}function og({required:n,roles:u}){return n.length?s.jsx(s.Fragment,{children:n.map(o=>s.jsxs("span",{children:[s.jsx("code",{children:o})," ",s.jsxs("span",{className:"feltkit-muted",children:["granted to ",xj(u,o).join(", ")||"no role"]})]},o))}):s.jsx(s.Fragment,{children:"any signed-in principal"})}function Sj({capability:n,roles:u,mcpTools:o,devUsers:r,development:f}){const h=o.find(g=>g.replace(/_/g,".").includes(n.name))??null;return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"feltkit-stack",children:[s.jsxs("h2",{className:"feltkit-panel__title",children:[s.jsx("code",{children:n.name})," ",s.jsxs("span",{className:"feltkit-muted feltkit-small",children:["v",n.version," · ",n.effect]})]}),s.jsx("p",{children:n.description??s.jsx("span",{className:"feltkit-muted",children:"No description. Add one so agents and other applications know what this does."})})]}),s.jsxs(oe,{title:"Contract",children:[s.jsx(ca,{items:[{label:"Requires",value:s.jsx(og,{required:n.authorization,roles:u})},{label:"Implemented by",value:n.function?s.jsx("a",{href:`#/capabilities/${n.function.name}`,children:s.jsx("code",{children:n.function.name})}):null},{label:"Services used",value:n.services?.length?n.services.join(", "):"none observed"},{label:"Idempotency",value:n.idempotency??null},{label:"Reachable at",value:`POST /appport${h?` · MCP tool ${h}`:""}`,mono:!0}]}),s.jsxs("div",{className:"feltkit-grid",children:[s.jsxs("div",{children:[s.jsx("p",{className:"feltkit-label",children:"Input"}),s.jsx(bs,{schema:n.input,label:"Input fields"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"feltkit-label",children:"Output"}),s.jsx(bs,{schema:n.output,label:"Output fields"})]})]})]}),s.jsx(oe,{title:"Recent invocations",children:s.jsx(su,{label:`Recent invocations of ${n.name}`,emptyTitle:"Not invoked through AppPort yet",items:(n.recent??[]).map(g=>({id:g.id,at:g.at,actor:g.principal??"anonymous",summary:s.jsxs(s.Fragment,{children:["via ",g.via," · ",g.durationMs," ms ",g.error?s.jsx("code",{children:g.error.code}):null]}),status:s.jsx(mi,{outcome:g.outcome}),href:`#/activity/${g.id}`}))})}),f&&s.jsx(dg,{id:`invoke-${n.name}`,title:"Invoke through AppPort",note:"Runs through AppPort's dispatch pipeline with a short-lived session for the identity you choose. The same authorization applies as for any agent or application. Input is validated against the contract before authorization runs.",example:rg(n.input),devUsers:r,submitLabel:"Invoke",run:(g,v)=>ue("/capabilities/invoke",{method:"POST",body:JSON.stringify({capability:n.name,version:n.version,input:g,as:v})})})]})}function _j({fn:n,roles:u,devUsers:o,development:r}){const f=n.access==="public"||n.access==="authenticated"?[]:[n.access];return s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"feltkit-stack",children:[s.jsxs("h2",{className:"feltkit-panel__title",children:[s.jsx("code",{children:n.name})," ",s.jsxs("span",{className:"feltkit-muted feltkit-small",children:[n.kind,n.capability?` · published as ${n.capability.name}`:""]})]}),s.jsx("p",{className:"feltkit-muted",children:n.description??(n.kind==="query"?"Read-only: its database handle cannot write.":"All writes commit in one FeltDB transaction, or none do.")})]}),s.jsxs(oe,{title:"Contract",children:[s.jsx(ca,{items:[{label:"Access",value:n.access==="public"?"anyone, including anonymous callers":s.jsx(og,{required:f,roles:u})},{label:"Endpoint",value:`POST /api/${n.kind}/${n.name}`,mono:!0}]}),s.jsxs("div",{className:"feltkit-grid",children:[s.jsxs("div",{children:[s.jsx("p",{className:"feltkit-label",children:"Arguments"}),s.jsx(bs,{schema:n.args,label:"Arguments"})]}),s.jsxs("div",{children:[s.jsx("p",{className:"feltkit-label",children:"Returns"}),n.returns?s.jsx(bs,{schema:n.returns,label:"Returns"}):s.jsx("span",{className:"feltkit-muted",children:"not declared"})]})]})]}),r&&s.jsx(dg,{id:`run-${n.name}`,title:`Run ${n.kind}`,note:"Runs as the identity you choose, through the same validation and authorization as a request from the app.",example:rg(n.args),devUsers:o,submitLabel:`Run ${n.kind}`,run:(h,g)=>ue("/functions/run",{method:"POST",body:JSON.stringify({name:n.name,args:h,as:g})})})]})}function dg({id:n,title:u,note:o,example:r,devUsers:f,submitLabel:h,run:g}){const[v,m]=E.useState(JSON.stringify(r,null,2)),[p,j]=E.useState(f[0]?.id??"anonymous"),[y,x]=E.useState(null),[T,B]=E.useState(null),[D,C]=E.useState(!1),w=y?.ok===!0,H=n.replace(/[^a-z0-9-]/gi,"-");return s.jsxs(oe,{title:u,children:[s.jsx("p",{className:"feltkit-muted feltkit-small",children:o}),s.jsxs(gl,{label:u,submitLabel:h,busy:D,onSubmit:async()=>{B(null),x(null);let W;try{W=JSON.parse(v||"{}")}catch{B({code:"INVALID_JSON",message:"That is not valid JSON."});return}C(!0);try{x(await g(W,p))}catch($){B($)}finally{C(!1)}},children:[s.jsx(Xt,{id:`${H}-as`,label:"Act as",value:p,onChange:j,options:[...f.map(W=>({value:W.id,label:`${W.name??W.id} · ${W.roles.join(", ")}`})),{value:"anonymous",label:"anonymous"}]}),s.jsx(qe,{id:`${H}-input`,label:"Input (JSON)",multiline:!0,rows:6,value:v,onChange:m,spellcheck:"false"})]}),T?s.jsx(Me,{title:"Not run",error:T}):null,y&&s.jsxs("div",{className:"feltkit-stack",role:"status",children:[s.jsxs("span",{className:"feltkit-row",children:[s.jsx(mi,{outcome:w?"success":y.error?.code==="FORBIDDEN"||y.error?.code==="UNAUTHORIZED"?"denied":"error"}),y.requestId?s.jsx("code",{children:y.requestId}):null,!w&&y.error?.code?s.jsx("code",{children:y.error.code}):null]}),s.jsx(el,{value:w?y.output??y.value:y.error,label:"Result"})]})]})}function ks(n){const u=n.trim();if(!u||u.startsWith("credential-ref:"))return!1;if(/^(sk-|sk-ant-|sk_live_|sk_test_|rk_live_|xai-|AIza|ghp_|gho_|github_pat_|gsk_|glpat-|xox[abpr]-|hf_|pk_live_)/.test(u))return!0;if(u.length<32||/\s/.test(u)||!/[0-9]/.test(u)||!/[A-Za-z]/.test(u))return!1;const o=new Map;for(const f of u)o.set(f,(o.get(f)??0)+1);let r=0;for(const f of o.values())r-=f/u.length*Math.log2(f/u.length);return r>=4}function vu({credential:n}){return n?n.present?s.jsx(Ve,{tone:"positive",label:"Set",detail:`${n.location??n.variable??"custody"}${n.version&&n.source==="vault"?`, version ${n.version}`:""}`,attrs:{"data-credential":"set",...n.updatedAt?{title:`updated ${n.updatedAt}`}:{}}}):n.state==="revoked"?s.jsx(Ve,{tone:"neutral",label:"Removed",attrs:{"data-credential":"removed"}}):s.jsx(Ve,{tone:"attention",label:"Not set",attrs:{"data-credential":"missing"}}):null}function Rd(n){const u=n?.devUsers??[],[o,r]=E.useState("");return E.useEffect(()=>{!o&&u[0]&&r(u[0].id)},[u,o]),[o,r,u]}function uu({credentialRef:n,provider:u,as:o,label:r="Set key",onSaved:f}){const[h,g]=E.useState(!1),[v,m]=E.useState(""),[p,j]=E.useState(!1),[y,x]=E.useState(null),[T,B]=E.useState(null),D=`key-${E.useId().replace(/:/g,"")}`,C=async()=>{if(!v.trim())return;j(!0),x(null);const w=v;m("");try{const H=await ue("/credentials",{method:"POST",body:JSON.stringify({ref:n,value:w,...u?{provider:u}:{},...o?{as:o}:{}})});B(H.stored),g(!1),f?.(H.stored)}catch(H){x(H)}finally{j(!1)}};return h?s.jsxs("div",{className:"feltkit-stack",children:[s.jsx(gl,{layout:"inline",label:`Value for ${n}`,submitLabel:"Save",busy:p,onSubmit:()=>{C()},actions:s.jsx(ze,{variant:"ghost",label:"Cancel",onClick:()=>(m(""),g(!1))}),children:s.jsx(qe,{id:D,type:"password",label:`Value for ${n}`,hint:"Stored on the server, outside FeltDB. It is never shown again.",autocomplete:"off",spellcheck:"false",value:v,onChange:m,required:!0})}),y?s.jsx(Me,{title:"Not stored",error:y}):null]}):s.jsxs("span",{className:"feltkit-actions",children:[s.jsx(ze,{size:"sm",label:r,onClick:()=>g(!0)}),T&&s.jsxs("span",{className:"feltkit-muted feltkit-small",role:"status",children:["Stored (",T.location??"custody",", version ",T.version,")."]})]})}function kj(n){return n.filter(u=>{const o=u.usedBy??[];return o.every(r=>r.startsWith("webhook "))&&(o.length>0||/webhook|signing/i.test(u.ref))})}function Nj(n){return n.status==="delivered"?null:n.lastError??null}function Tj(n){return(u,o="GET",r)=>ue(`/services/manage${u}`,{method:o,headers:{"x-feltkit-as":n},...r!==void 0?{body:JSON.stringify(r)}:o!=="GET"&&o!=="DELETE"?{body:"{}"}:{}})}function vi(n,u){if(n==null)throw new Error(`${u} was not found or changed meanwhile. Nothing was done.`);return n}const Ej="A credential reference, like credential-ref:stripe. Set its value under Services → Credentials; the value is never stored here.",Aj={files:{title:"Files",description:"File records with ownership and audit. Bytes are stored in this environment's FeltDB instance.",render:n=>s.jsx($j,{...n})},notifications:{title:"Notifications",description:"Durable in-app notifications. A principal reads only the notifications addressed to it.",render:n=>s.jsx(qj,{...n})},configuration:{title:"Configuration",description:"Variables and secret references for this environment. Secret values stay in FeltKit's custody.",render:n=>s.jsx(Hj,{...n})},apiKeys:{title:"API keys",description:"Durable machine identities. A secret is shown once, when a key is created or rotated. FeltKit accepts a key as an identity holding services.apiKeys.roles.",render:n=>s.jsx(Yj,{...n})},webhooks:{title:"Webhooks",description:"Endpoints for signed outbound delivery, with retries and history.",render:n=>s.jsx(Vj,{...n})},jobs:{title:"Jobs",description:"Durable background work. Each job type runs the FeltKit function declared in services.jobs.handlers, as the principal that queued it.",render:n=>s.jsx(Xj,{...n})},schedules:{title:"Schedules",description:"Recurring jobs. Each run queues a job of the schedule's type.",render:n=>s.jsx(Kj,{...n})},intelligence:{title:"Intelligence",description:"The provider, model, endpoint and credential reference for this environment. Configuration only: AppPort Services never runs a model.",render:n=>s.jsx(Jj,{...n})}};function Cj({id:n,service:u,as:o,picker:r,development:f,summary:h,operations:g}){const{version:v}=Wt(),m=Aj[n],p=s.jsx(zt,{title:m?.title??n,crumbs:[{label:"Services",href:"#/services"},{label:m?.title??n}],subtitle:m?.description,actions:r}),j=m?u?u.state==="available"||u.state==="unavailable"?s.jsx(wj,{service:u}):s.jsxs(s.Fragment,{children:[h,f?o?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Acting as ",s.jsx("strong",{children:o}),". AppPort Services' gateway authorizes every operation with this identity's roles, and Activity records it."]}),m.render({as:o,manage:Tj(o),version:v})]}):s.jsxs(tt,{tone:"attention",title:"No development identity",children:["Declare one in ",s.jsxs("code",{children:["feltkit(","{"," dev: ","{"," users ","}"," ","}",")"]}),": service operations are authorized as that identity."]}):s.jsxs(s.Fragment,{children:[g,s.jsx(tt,{tone:"info",title:`Configuring ${m.title} is a development tool`,children:"Change it in development, or with the service's own API from your application."})]})]}):s.jsx(At,{what:m.title}):s.jsx(wa,{title:"No such service",children:s.jsx("a",{href:"#/services",children:"Back to Services"})});return s.jsxs("div",{className:"feltkit-page",children:[p,j]})}function wj({service:n}){const u=Oj[n.id]??`${n.id}: true`;return s.jsx(oe,{title:`Enable ${n.name}`,action:s.jsx(ot,{field:"feltkit.service.state",value:n.state}),children:n.state==="unavailable"?s.jsx(tt,{tone:"critical",title:`${n.name} cannot run here`,children:n.detail}):s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"feltkit-small",children:["Add it to ",s.jsx("code",{children:"services"})," in ",s.jsx("code",{children:"feltkit/app.ts"}),". The backend reloads in place and keeps its state; this screen then manages it."]}),s.jsx(gs,{text:`services: { …, ${u} },`,label:`How to enable ${n.name}`}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Its permissions (",n.capabilities.join(", "),") are granted through your roles."]})]})})}const Oj={apiKeys:'apiKeys: { roles: ["member"] }',jobs:'jobs: { handlers: { "report.build": "reports:build" } }'},Rj=new Set(["text","email","url","number","password","search","tel"]);function Sn({title:n,fields:u,submitLabel:o,send:r,done:f}){const h=()=>Object.fromEntries(u.map(w=>[w.name,w.value??(w.options?yi(w.options[0]):w.choices?.length&&!w.multi?yi(w.choices[0]):"")])),[g,v]=E.useState(h),[m,p]=E.useState(!1),[j,y]=E.useState(null),[x,T]=E.useState(null),B=`form-${E.useId().replace(/:/g,"")}`,D=w=>H=>v(W=>({...W,[w]:H})),C=async()=>{p(!0),y(null),T(null);try{const w=await r(g);T(f?f(w):"Done."),v(h())}catch(w){y(w)}finally{p(!1)}};return s.jsxs(oe,{title:n,children:[s.jsx(gl,{label:n,submitLabel:o,busy:m,onSubmit:()=>{C()},children:u.map(w=>{const H=`${B}-${w.name}`,W=g[w.name]??"";return w.choices&&w.multi?s.jsx(Mj,{id:H,field:w,value:W,onChange:D(w.name)},w.name):w.choices?s.jsx(zj,{id:H,field:w,value:W,onChange:D(w.name)},w.name):w.options?s.jsx(Xt,{id:H,name:w.name,label:w.label,hint:w.hint,value:W,onChange:D(w.name),options:w.options,required:w.required},w.name):w.type==="datetime-local"?s.jsx(Dj,{id:H,field:w,value:W,onChange:D(w.name)},w.name):s.jsx(qe,{id:H,name:w.name,label:w.label,hint:w.hint,value:W,onChange:D(w.name),type:Rj.has(w.type??"text")?w.type??"text":"text",placeholder:w.placeholder,required:w.required,pattern:w.pattern,multiline:w.multiline,rows:w.multiline?3:void 0,autocomplete:"off",spellcheck:"false"},w.name)})}),j?s.jsx(Me,{title:"Not done",error:j}):null,x?s.jsx(tt,{tone:"info",title:"Done",children:x}):null]})}function Dj({id:n,field:u,value:o,onChange:r}){return s.jsxs("div",{className:"stack-field stack-field--text",children:[s.jsxs("label",{className:"stack-field__label",htmlFor:n,children:[u.label,u.required?s.jsx("span",{className:"stack-field__required","aria-hidden":"true",children:" *"}):null]}),s.jsx("input",{className:"stack-field__control",id:n,name:u.name,type:u.type,value:o,required:u.required,onChange:f=>r(f.target.value),...u.hint?{"aria-describedby":`${n}-hint`}:{}}),u.hint&&s.jsx("p",{className:"stack-field__hint",id:`${n}-hint`,children:u.hint})]})}const yi=n=>typeof n=="string"?n:n.value,fg=n=>typeof n=="string"?n:n.label,cd="__other__";function zj({id:n,field:u,value:o,onChange:r}){const f=(u.choices??[]).some(p=>yi(p)===o),[h,g]=E.useState(!f&&o!==""),v=h||!u.choices?.length&&!u.strict,m=s.jsx(qe,{id:`${n}-other`,name:u.name,label:u.choices?.length?`${u.label}: other value`:u.label,hint:u.choices?.length?void 0:u.hint,value:o,onChange:r,placeholder:u.placeholder,required:u.required,pattern:u.pattern,autocomplete:"off",spellcheck:"false"});return u.choices?.length?s.jsxs("div",{className:"feltkit-stack",children:[s.jsx(Xt,{id:n,label:u.label,hint:u.hint,required:u.required,value:v?cd:o,onChange:p=>{const j=p===cd;g(j),r(j?"":p)},options:[...u.choices.map(p=>({value:yi(p),label:fg(p)})),...u.strict?[]:[{value:cd,label:"Other…"}]]}),v&&m]}):u.strict?s.jsx(Xt,{id:n,label:u.label,hint:u.placeholder??u.hint,value:"",options:[{value:"",label:u.placeholder??"Nothing to choose",disabled:!0}],required:u.required}):m}function Mj({id:n,field:u,value:o,onChange:r}){const f=(u.choices??[]).map(yi),h=ru(o),g=h.filter(y=>f.includes(y)),v=h.filter(y=>!f.includes(y)),[m,p]=E.useState(v.join(", ")),j=(y,x)=>r([...y,...ru(x)].join(", "));return s.jsxs(gd,{id:n,legend:u.label,hint:u.hint,required:u.required,children:[(u.choices??[]).length>0&&s.jsx("div",{className:"feltkit-choices",children:(u.choices??[]).map((y,x)=>{const T=yi(y);return s.jsx(iu,{id:`${n}-${x}`,label:s.jsx("code",{children:fg(y)}),checked:g.includes(T),onChange:B=>j(B?[...g,T]:g.filter(D=>D!==T),m)},T)})}),!u.strict&&s.jsx(qe,{id:`${n}-others`,label:f.length?"Others, comma separated":"Values, comma separated",value:m,placeholder:u.placeholder,autocomplete:"off",spellcheck:"false",required:u.required&&g.length===0,onChange:y=>(p(y),j(g,y))})]})}function bi(n,u=0){return We(()=>ue("/services/catalog"),[n,u]).data}function Il({title:n,read:u,deps:o,empty:r,columns:f,actions:h,after:g,tools:v}){const m=We(u,o),p=m.data??[];return s.jsxs(oe,{title:n,action:s.jsxs(s.Fragment,{children:[v?.(m.reload),s.jsx(ze,{size:"sm",variant:"ghost",label:"Refresh",busy:m.loading&&!!m.data,onClick:m.reload})]}),children:[s.jsx(gt,{label:n,columns:[...f.map(([j])=>({id:j,header:j})),...h?[{id:"__actions",header:"Actions"}]:[]],rows:p.map((j,y)=>({key:j.id??String(y),cells:{...Object.fromEntries(f.map(([x,T])=>[x,T(j)])),...h?{__actions:s.jsx("span",{className:"feltkit-actions",children:h(j,m.reload)})}:{}}})),loading:m.loading,error:m.error&&!m.data?{title:`${n} could not be read`,...Jl(m.error,m.reload)}:null,emptyTitle:r}),g]})}const qa=n=>n?s.jsx("span",{title:n,children:Nt(n)}):null,sa=n=>n?s.jsx("code",{children:n}):null;function Uj(n,u){let o;try{o=JSON.parse(n||"{}")}catch{throw new Error(`The ${u} is not valid JSON.`)}if(!o||typeof o!="object"||Array.isArray(o))throw new Error(`The ${u} must be a JSON object, like {"invoice": 7}.`);return o}const ru=n=>n.split(",").map(u=>u.trim()).filter(Boolean),bd=({done:n})=>s.jsx(He,{label:"Run due work now",action:()=>ue("/services/run",{method:"POST",body:"{}"}),done:n});function $j({as:n,manage:u,version:o}){const[r,f]=E.useState(0),[h,g]=E.useState(null),[v,m]=E.useState(!1),[p,j]=E.useState(null),[y,x]=E.useState(null),[T,B]=E.useState(0),D=async()=>{if(h){m(!0),j(null),x(null);try{const w=await Bj(h),{file:H}=await ue("/services/files",{method:"POST",body:JSON.stringify({as:n,name:h.name,contentType:h.type||void 0,contentBase64:w})});x(`Uploaded ${H.name} (${H.size.toLocaleString()} bytes).`),g(null),B(W=>W+1),f(W=>W+1)}catch(w){j(w)}finally{m(!1)}}},C=async w=>{const{file:H,contentBase64:W}=await ue(`/services/files/${encodeURIComponent(w.id)}/content?as=${encodeURIComponent(n)}`),$=Uint8Array.from(atob(W),P=>P.charCodeAt(0)),Z=URL.createObjectURL(new Blob([$],{type:H.contentType??"application/octet-stream"}));Object.assign(document.createElement("a"),{href:Z,download:H.name}).click(),setTimeout(()=>URL.revokeObjectURL(Z),1e3)};return s.jsxs(s.Fragment,{children:[s.jsxs(oe,{title:"Upload a file",children:[s.jsx(gl,{label:"Upload a file",layout:"inline",submitLabel:"Upload",busy:v,onSubmit:()=>{D()},children:s.jsxs("div",{className:"stack-field stack-field--text",children:[s.jsx("label",{className:"stack-field__label",htmlFor:"files-upload",children:"File"}),s.jsx("input",{className:"stack-field__control",id:"files-upload",type:"file",required:!0,onChange:w=>g(w.target.files?.[0]??null),"aria-describedby":"files-upload-hint"},T),s.jsxs("p",{className:"stack-field__hint",id:"files-upload-hint",children:["Stored in this environment's FeltDB instance as ",n,", through the Files service your functions use (ctx.services.files)."]})]})}),p?s.jsx(Me,{title:"Not uploaded",error:p}):null,y?s.jsx(tt,{tone:"info",title:"Uploaded",children:y}):null]}),s.jsx(Il,{title:"Files",read:()=>u("/_appport/files"),deps:[n,o,r],empty:"No files yet",columns:[["Name",w=>s.jsx("strong",{children:w.name})],["Owner",w=>sa(w.owner)],["Type",w=>w.contentType??null],["Size",w=>typeof w.size=="number"?w.size.toLocaleString():null],["Updated",w=>qa(w.updatedAt??w.createdAt)]],actions:(w,H)=>s.jsxs(s.Fragment,{children:[s.jsx(He,{label:"Download",action:()=>C(w)}),s.jsx(hg,{current:w.name,label:`New name for ${w.name}`,onSave:W=>u(`/_appport/files/${encodeURIComponent(w.id)}`,"PATCH",{name:W}),done:H}),s.jsx(He,{label:"Delete",variant:"danger",confirm:{title:`Delete ${w.name}?`,consequences:["The file record and its bytes are deleted from this environment's FeltDB instance.","Anything that links to it stops working."],confirmLabel:"Delete file",requireText:w.name},action:()=>ue(`/services/files/${encodeURIComponent(w.id)}?as=${encodeURIComponent(n)}`,{method:"DELETE"}),done:H})]})})]})}function Bj(n){return new Promise((u,o)=>{const r=new FileReader;r.onload=()=>u(String(r.result).replace(/^data:[^,]*,/,"")),r.onerror=()=>o(r.error),r.readAsDataURL(n)})}function hg({current:n,label:u,onSave:o,done:r,edit:f="Rename"}){const[h,g]=E.useState(!1),[v,m]=E.useState(n),[p,j]=E.useState(!1),[y,x]=E.useState(null),T=`rename-${E.useId().replace(/:/g,"")}`;if(!h)return s.jsx(ze,{size:"sm",label:f,onClick:()=>(m(n),x(null),g(!0))});const B=async()=>{if(v.trim()){x(null),j(!0);try{vi(await o(v.trim()),"The record"),g(!1),r()}catch(D){x(D)}finally{j(!1)}}};return s.jsxs("div",{className:"feltkit-stack",children:[s.jsx(gl,{label:u,layout:"inline",submitLabel:"Save",busy:p,onSubmit:()=>{B()},actions:s.jsx(ze,{variant:"ghost",label:"Cancel",onClick:()=>g(!1)}),children:s.jsx(qe,{id:T,label:u,value:v,onChange:m,required:!0,spellcheck:"false"})}),y?s.jsx(Me,{title:"Not saved",error:y}):null]})}function qj({as:n,manage:u,version:o}){const[r,f]=E.useState(0),h=()=>f(m=>m+1),g=bi(o,r),v=Wt().overview?.devUsers??[];return s.jsxs(s.Fragment,{children:[s.jsx(Sn,{title:"Send a notification",submitLabel:"Send",fields:[{name:"recipient",label:"Recipient",required:!0,value:n,choices:v.map(m=>({value:m.id,label:`${m.name??m.id} (${m.id})`})),hint:"A principal id. Only the recipient can read it."},{name:"type",label:"Type",required:!0,placeholder:"task.assigned",choices:g?.notificationTypes.all??[],hint:g?.notificationTypes.declared.length?"Declared in services.notifications.types, plus types already sent.":"Declare your types in services: { notifications: { types: [...] } } to list them here."},{name:"title",label:"Title",required:!0},{name:"priority",label:"Priority",options:["normal","low","high","urgent"]}],send:async m=>{await u("/_appport/notifications","POST",m),h()},done:()=>"Notification sent."},g?"ready":"loading"),s.jsx(Il,{title:`Notifications for ${n}`,read:()=>u(`/_appport/notifications?limit=50&recipient=${encodeURIComponent(n)}`).then(m=>m.items),deps:[n,o,r],empty:"No notifications for this identity",columns:[["Title",m=>s.jsx("strong",{children:m.title??m.type})],["Type",m=>sa(m.type)],["Priority",m=>m.priority],["State",m=>m.dismissedAt?s.jsx(Ve,{tone:"neutral",label:"Dismissed"}):s.jsx(Ve,{field:"appport.notification.status",value:m.readAt&&m.status==="delivered"?"read":m.status,attrs:{"data-state":m.status}})],["Created",m=>qa(m.createdAt)]],actions:(m,p)=>{const j=`/_appport/notifications/${encodeURIComponent(m.id)}`;return s.jsxs(s.Fragment,{children:[!m.readAt&&s.jsx(He,{label:"Mark read",action:async()=>vi(await u(`${j}/read`,"POST"),"The notification"),done:p}),!m.dismissedAt&&s.jsx(He,{label:"Dismiss",action:async()=>vi(await u(`${j}/dismiss`,"POST"),"The notification"),done:p}),s.jsx(He,{label:"Delete",variant:"danger",confirm:{title:`Delete the notification ${m.title??m.type}?`,consequences:["The notification and its deliveries are deleted.",`${m.recipient??"Its recipient"} no longer sees it.`],confirmLabel:"Delete notification"},action:()=>u(j,"DELETE"),done:p})]})}})]})}const Ey={pattern:"[A-Z][A-Z0-9_]*",placeholder:"STRIPE_ACCOUNT",hint:"Uppercase letters, digits and underscores, starting with a letter."};function Hj({as:n,manage:u,version:o}){const[r,f]=E.useState(0),h=()=>f(D=>D+1),g=bi(o,r),v=We(()=>u("/v1/configuration"),[n,o,r]),m=[...new Set((v.data?.secrets??[]).map(D=>D.credentialRef))],p=We(()=>m.length?u(`/v1/configuration/credentials/status?${m.map(D=>`ref=${encodeURIComponent(D)}`).join("&")}`):Promise.resolve([]),[m.join(","),r]),j=new Map((p.data??[]).map(D=>[D.ref,D]));if(v.error&&!v.data)return s.jsx(Me,{title:"Configuration could not be read",error:v.error,retry:v.reload});if(!v.data)return s.jsx(At,{what:"configuration"});const{variables:y,secrets:x,declarations:T}=v.data,B=T.filter(D=>D.required&&!y.some(C=>C.name===D.name)&&!x.some(C=>C.name===D.name)).length;return s.jsxs(s.Fragment,{children:[B===0?s.jsx("p",{className:"feltkit-small",children:s.jsx(Ve,{tone:"positive",label:"Every required value is set"})}):s.jsx(tt,{tone:"attention",title:`${B} required value${B===1?"":"s"} missing`,children:"Add them below: the application declares them as required."}),s.jsx(oe,{title:"Variables",children:s.jsx(gt,{label:"Variables",columns:[{id:"name",header:"Name"},{id:"value",header:"Value"},{id:"updated",header:"Updated"},{id:"actions",header:"Actions"}],rows:y.map(D=>({key:D.name,cells:{name:sa(D.name),value:s.jsx("code",{children:D.value}),updated:qa(D.updatedAt),actions:s.jsxs("span",{className:"feltkit-actions",children:[s.jsx(hg,{current:D.value,edit:"Edit",label:`New value for ${D.name}`,onSave:C=>u(`/v1/configuration/variables/${encodeURIComponent(D.name)}`,"PATCH",{value:C,required:!1}),done:h}),s.jsx(He,{label:"Delete",variant:"danger",confirm:{title:`Delete ${D.name}?`,consequences:["Code reading this variable no longer gets a value."],confirmLabel:"Delete variable",requireText:D.name},action:()=>u(`/v1/configuration/variables/${encodeURIComponent(D.name)}`,"DELETE"),done:h})]})}})),emptyTitle:"No variables yet"})}),s.jsx(Sn,{title:"Add a variable",submitLabel:"Add variable",fields:[{name:"name",label:"Name",required:!0,...Ey},{name:"value",label:"Value",required:!0,hint:"Not for secrets: add a secret reference below instead."}],send:async D=>{if(ks(D.value))throw new Error("This looks like a secret. Add it as a secret reference instead, and set its value; a variable is stored in FeltDB.");await u("/v1/configuration/variables","POST",{...D,required:!1}),h()},done:()=>"Variable added."}),s.jsx(oe,{title:"Secrets",children:s.jsx(gt,{label:"Secrets",columns:[{id:"name",header:"Name"},{id:"ref",header:"Reference"},{id:"value",header:"Value"},{id:"updated",header:"Updated"},{id:"actions",header:"Actions"}],rows:x.map(D=>{const C=j.get(D.credentialRef);return{key:D.name,cells:{name:sa(D.name),ref:sa(D.credentialRef),value:C?s.jsx(ot,{field:"feltkit.secret.state",value:C.state,detail:C.state==="set"&&C.version?`v${C.version}`:void 0}):s.jsx(Ve,{tone:"unknown",label:"Unknown"}),updated:qa(D.updatedAt),actions:s.jsxs("span",{className:"feltkit-actions",children:[s.jsx(uu,{credentialRef:D.credentialRef,label:C?.state==="set"?"Replace value":"Set value",as:n,onSaved:h}),s.jsx(He,{label:"Delete",variant:"danger",confirm:{title:`Delete the binding ${D.name}?`,consequences:["Code reading this secret no longer gets a value.",`The stored value of ${D.credentialRef} is kept.`],confirmLabel:"Delete binding"},action:()=>u(`/v1/configuration/secrets/${encodeURIComponent(D.name)}`,"DELETE"),done:h})]})}}}),emptyTitle:"No secrets yet"})}),s.jsx(Sn,{title:"Add a secret reference",submitLabel:"Add secret",fields:[{name:"name",label:"Name",required:!0,...Ey},{name:"credentialRef",label:"Credential reference",required:!0,pattern:"credential-ref:.+",placeholder:"credential-ref:stripe",choices:(g?.credentials??[]).map(D=>({value:D.ref,label:`${D.ref}${D.present?"":" (not set)"}`})),hint:Ej}],send:async D=>{await u("/v1/configuration/secrets","POST",{...D,required:!1}),h()},done:()=>"Secret reference added. Set its value in the table above."},g?"ready":"loading")]})}function Lj({lead:n,value:u,onDone:o}){return s.jsx(tt,{tone:"attention",title:`${n} Copy this secret now: it is not shown again.`,actions:s.jsxs(s.Fragment,{children:[s.jsx(_s,{text:u,label:"Copy secret"}),s.jsx(ze,{size:"sm",variant:"ghost",label:"Done",onClick:o})]}),children:s.jsx("code",{className:"feltkit-secret",children:u})})}function Yj({manage:n,version:u}){const[o,r]=E.useState(0),f=bi(u),[h,g]=E.useState(null),[v,m]=E.useState(null),p=()=>r(y=>y+1),j="/_appport/api/keys";return s.jsxs(s.Fragment,{children:[h&&s.jsx(Lj,{lead:h.lead,value:h.value,onDone:()=>g(null)}),s.jsx(Sn,{title:"Create an API key",submitLabel:"Create API key",fields:[{name:"name",label:"Key name",required:!0},{name:"capabilities",label:"Only these capabilities (optional)",multi:!0,choices:f?.capabilities??[],placeholder:"files.read, jobs.create",hint:"A ceiling: the key's roles still decide. None chosen: no ceiling."},{name:"expiresAt",label:"Expires at (optional)",type:"datetime-local"}],send:async y=>{const x=ru(y.capabilities??""),T=await n(j,"POST",{name:y.name,...x.length?{restrictions:{capabilities:x}}:{},...y.expiresAt?{expiresAt:new Date(y.expiresAt).toISOString()}:{}});return T?.secret&&g({lead:`Created ${y.name}.`,value:T.secret}),p(),T},done:()=>"API key created."},f?"ready":"loading"),s.jsx(Il,{title:"API keys",read:()=>n(j),deps:[u,o],empty:"No API keys yet",columns:[["Name",y=>s.jsx("strong",{children:y.name})],["Prefix",y=>sa(y.keyPrefix)],["Ceiling",y=>y.restrictions?y.restrictions.capabilities.length?y.restrictions.capabilities.join(", "):"denies everything":"none"],["Expires",y=>qa(y.expiresAt)],["Last used",y=>qa(y.lastUsedAt)],["State",y=>y.rotatedTo?s.jsx(Ve,{tone:"neutral",label:"Replaced"}):s.jsx(Ve,{field:"appport.api_key.revoked",value:y.status!=="active",attrs:{"data-state":y.status}})]],actions:(y,x)=>s.jsxs(s.Fragment,{children:[y.status==="active"&&!y.rotatedTo&&s.jsx(He,{label:"Rotate",confirm:{title:`Rotate ${y.name}?`,consequences:["A new secret is issued and shown once.","The current secret is revoked now: requests with it are refused."],confirmLabel:"Rotate key"},action:async()=>{const T=vi(await n(`${j}/${encodeURIComponent(y.id)}/rotate`,"POST",{overlapSeconds:0}),`The API key ${y.name}`);g({lead:`Rotated ${y.name}.`,value:T.secret})},done:x}),s.jsx(ze,{size:"sm",label:"Audit",onClick:()=>m(y)}),y.status==="active"&&s.jsx(He,{label:"Revoke",variant:"danger",confirm:{title:`Revoke ${y.name}?`,consequences:["Requests with this key are refused from now on.","A revoked key cannot be restored; create a new one."],confirmLabel:"Revoke key",requireText:y.name},action:()=>n(`${j}/${encodeURIComponent(y.id)}`,"DELETE"),done:x})]})}),v&&s.jsx(Il,{title:`Audit for ${v.name}`,read:()=>n(`${j}/${encodeURIComponent(v.id)}/audit`).then(y=>Array.isArray(y)?y:y.items??[]),deps:[v.id,o],empty:"No events",columns:[["Time",y=>qa(y.timestamp)],["Event",y=>sa(y.type)],["Result",y=>y.result],["Principal",y=>sa(y.principalId)]]})]})}const Ay="generate";function Gj(){const n=crypto.getRandomValues(new Uint8Array(32));return btoa(String.fromCharCode(...n)).replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function Vj({as:n,manage:u,version:o}){const[r,f]=E.useState(0),h=()=>f(m=>m+1),g=bi(o,r),v=g?.credentials??[];return s.jsxs(s.Fragment,{children:[s.jsx(Sn,{title:"Register an endpoint",submitLabel:"Register endpoint",fields:[{name:"url",label:"Endpoint URL",type:"url",required:!0,placeholder:"https://example.com/webhook"},{name:"events",label:"Events",required:!0,multi:!0,placeholder:"invoice.created, invoice.paid",choices:g?.webhookEvents.all??[],hint:g?.webhookEvents.declared.length?"Declared in services.webhooks.events; your mutations emit them with ctx.afterCommit.webhooks.emit().":"Declare your events in services: { webhooks: { events: [...] } } to list them here."},{name:"signingCredentialRef",label:"Signing secret",required:!0,pattern:"credential-ref:.+",placeholder:"credential-ref:webhook-signing",choices:[{value:Ay,label:"Generate a new signing secret"},...kj(v).map(m=>({value:m.ref,label:`${m.ref}${m.present?"":" (not set)"}`}))],hint:"A new secret is stored in FeltKit's custody and shown to you once, to configure the receiver."}],send:async m=>{const p=ru(m.events??"");if(!p.length)throw new Error("Choose at least one event.");let j=m.signingCredentialRef,y=null;return j===Ay&&(j=`credential-ref:webhook-${new URL(m.url).hostname.replace(/[^A-Za-z0-9]+/g,"-").replace(/^-|-$/g,"")}-${Date.now().toString(36)}`,y=Gj(),await ue("/credentials",{method:"POST",body:JSON.stringify({ref:j,value:y,as:n})})),await u("/_appport/webhooks","POST",{url:m.url,events:p,signingCredentialRef:j}),h(),{ref:j,secret:y}},done:m=>m.secret?s.jsxs(s.Fragment,{children:["Endpoint registered, signing with ",s.jsx("code",{children:m.ref}),". Give the receiver this secret now; it is not shown again: ",s.jsx("code",{className:"feltkit-secret",children:m.secret})," ",s.jsx(_s,{text:m.secret,label:"Copy secret"})]}):s.jsxs(s.Fragment,{children:["Endpoint registered, signing with ",s.jsx("code",{children:m.ref}),"."]})},g?"ready":"loading"),s.jsx(Il,{title:"Endpoints",read:()=>u("/_appport/webhooks"),deps:[n,o,r],empty:"No endpoints yet",columns:[["URL",m=>sa(m.url)],["Events",m=>(m.events??[]).join(", ")||null],["Signing secret",m=>sa(m.signingCredentialRef)],["Created",m=>qa(m.createdAt)],["Status",m=>s.jsx(Ve,{field:"appport.webhook.disabled",value:!!m.disabledAt})]],actions:(m,p)=>m.disabledAt?null:s.jsx(He,{label:"Disable",variant:"danger",confirm:{title:`Disable ${m.url}?`,consequences:["Nothing more is delivered to this endpoint.","A disabled endpoint cannot be enabled again; register it anew."],confirmLabel:"Disable endpoint"},action:()=>u(`/_appport/webhooks/${encodeURIComponent(m.id)}`,"DELETE"),done:p})}),s.jsx(Il,{title:"Recent deliveries",read:()=>u("/_appport/webhooks/deliveries?limit=50").then(m=>Array.isArray(m)?m:m.items??[]),deps:[n,o,r],empty:"No deliveries yet",columns:[["Event",m=>sa(m.eventType)],["Status",m=>s.jsx(ot,{field:"feltkit.webhook.delivery",value:m.status})],["Attempts",m=>m.attemptCount],["HTTP",m=>m.lastStatusCode??null],["Last error",m=>Nj(m)],["Created",m=>qa(m.createdAt)]],tools:m=>s.jsx(bd,{done:m}),actions:(m,p)=>m.status==="failed"?s.jsxs(s.Fragment,{children:[s.jsx(He,{label:"Replay",action:()=>ue(`/services/deliveries/${encodeURIComponent(m.id)}/replay`,{method:"POST",body:JSON.stringify({as:n})}),done:p}),s.jsx(ze,{size:"sm",label:"Diagnose",onClick:()=>Ha(`agent/new/diagnose-delivery/${encodeURIComponent(m.id)}`)})]}):null})]})}function mg({handlers:n,mutations:u}){const[o,r]=E.useState(u[0]??"");if(Object.keys(n).length)return null;const h=`jobs: { handlers: { "${o.replace(":",".")}": "${o}" } },`;return s.jsxs(oe,{title:"Declare a job type",children:[s.jsxs("p",{className:"feltkit-small",children:["A job type runs one of your mutations, as the person who queued it, with retries. None is declared yet. Choose the mutation it runs, then add the line to ",s.jsx("code",{children:"services"})," in ",s.jsx("code",{children:"feltkit/app.ts"}),"; the backend reloads and the type appears below."]}),u.length?s.jsxs(s.Fragment,{children:[s.jsx(Xt,{id:"declare-handler-mutation",label:"Mutation",value:o,onChange:r,options:u}),s.jsx(gs,{text:h,label:"Line to add to services"})]}):s.jsx("p",{className:"feltkit-muted feltkit-small",children:"Write a mutation in feltkit/ first."})]})}function Xj({as:n,manage:u,version:o}){const[r,f]=E.useState(0),h=()=>f(p=>p+1),g=bi(o),v=g?.jobHandlers??{},m=Object.keys(v);return s.jsxs(s.Fragment,{children:[g&&s.jsx(mg,{handlers:v,mutations:g.mutations}),s.jsx(Sn,{title:"Queue a job",submitLabel:"Queue job",fields:[{name:"type",label:"Job type",required:!0,strict:!0,choices:m.map(p=>({value:p,label:`${p} → ${v[p]}`})),placeholder:"Declare a handler first"},{name:"payload",label:"Payload (JSON object)",multiline:!0,value:"{}"}],send:async p=>{if(!m.includes(p.type))throw new Error(`No handler is declared for "${p.type}", so the job would fail. Declare it in services.jobs.handlers first.`);await u("/_appport/jobs","POST",{type:p.type,payload:Uj(p.payload??"{}","payload")}),h()},done:()=>s.jsxs("span",{className:"feltkit-row",children:["Job queued as ",n,". ",s.jsx(bd,{done:h})]})},m.join(",")),s.jsx(Il,{title:"Jobs",read:()=>u("/_appport/jobs").then(p=>[...p].sort((j,y)=>String(y.createdAt).localeCompare(String(j.createdAt)))),deps:[n,o,r],empty:"No jobs yet",tools:p=>s.jsx(bd,{done:p}),columns:[["Type",p=>sa(p.type)],["Status",p=>s.jsx(Ve,{field:"appport.job.status",value:p.status,attrs:{"data-state":p.status}})],["Attempts",p=>`${p.attemptCount}/${p.maxAttempts}`],["Run at",p=>qa(p.runAt)],["Last error",p=>p.lastError??null]],actions:(p,j)=>s.jsxs(s.Fragment,{children:[(p.status==="failed"||p.status==="completed")&&s.jsx(He,{label:"Retry",action:async()=>vi(await u(`/_appport/jobs/${encodeURIComponent(p.id)}/retry`,"POST"),`The ${p.type} job`),done:j}),p.status==="failed"&&s.jsx(ze,{size:"sm",label:"Diagnose",onClick:()=>Ha(`agent/new/diagnose-job/${encodeURIComponent(p.id)}`)})]})})]})}const Qj={s:"second",m:"minute",h:"hour",d:"day"},Zj=n=>{const u=/^(\d+)([smhd])$/.exec(String(n));return u?`Every ${u[1]} ${Qj[u[2]]}${u[1]==="1"?"":"s"}`:String(n)};function Kj({manage:n,version:u}){const[o,r]=E.useState(0),f=()=>r(m=>m+1),h=bi(u),g=h?.jobHandlers??{},v=Object.keys(g);return s.jsxs(s.Fragment,{children:[h&&v.length===0&&s.jsx(mg,{handlers:g,mutations:h.mutations}),s.jsx(Sn,{title:"Create a schedule",submitLabel:"Create schedule",fields:[{name:"type",label:"Job type",required:!0,strict:!0,choices:v.map(m=>({value:m,label:`${m} → ${g[m]}`})),placeholder:"Declare a handler first"},{name:"interval",label:"Frequency",options:[{value:"15m",label:"Every 15 minutes"},{value:"30m",label:"Every 30 minutes"},{value:"1h",label:"Every hour"},{value:"6h",label:"Every 6 hours"},{value:"1d",label:"Every day"},{value:"7d",label:"Every week"}]}],send:async m=>{if(!v.includes(m.type))throw new Error(`No handler is declared for "${m.type}", so every scheduled job would fail. Declare it in services.jobs.handlers first.`);await n("/_appport/schedules","POST",{type:m.type,interval:m.interval}),f()},done:()=>"Schedule created."},v.join(",")),s.jsx(Il,{title:"Schedules",read:()=>n("/_appport/schedules"),deps:[u,o],empty:"No schedules yet",columns:[["Type",m=>sa(m.type)],["Frequency",m=>Zj(m.interval)],["Next run",m=>qa(m.nextRunAt)],["Created by",m=>sa(m.createdBy)],["Status",m=>s.jsx(Ve,{field:"appport.schedule.enabled",value:!!m.enabled})]],actions:(m,p)=>m.enabled?s.jsx(He,{label:"Disable",variant:"danger",confirm:{title:`Disable the ${m.type} schedule?`,consequences:["It stops queueing jobs.","A disabled schedule cannot be enabled again; create a new one."],confirmLabel:"Disable schedule"},action:async()=>vi(await n(`/_appport/schedules/${encodeURIComponent(m.id)}`,"DELETE"),"The schedule"),done:p}):null})]})}function Jj({manage:n,version:u}){const[o,r]=E.useState(0),f=We(()=>Promise.all([n("/v1/intelligence/catalog"),n("/v1/intelligence")]),[u,o]),[h,g]=E.useState(null),[v,m]=E.useState(null),[p,j]=E.useState(!1),[y,x]=E.useState(!1);if(f.error&&!f.data)return s.jsx(Me,{title:"Intelligence could not be read",error:f.error,retry:f.reload});if(!f.data)return s.jsx(At,{what:"Intelligence"});const[T,B]=f.data,D=h??{provider:B.configured?B.provider:T[0]?.id??"",model:B.configured?B.model:"",endpoint:B.configured&&B.endpoint?.kind==="custom"?B.endpoint.url:"",credentialRef:""},C=T.find($=>$.id===D.provider),w=$=>(j(!1),g({...D,...$})),H=C?.credential==="required"&&!B.credentialConfigured,W=async()=>{m(null),x(!0);try{if(ks(D.credentialRef))throw new Error("That looks like an API key. Enter the key in Studio → Models; here, give a credential reference.");await n("/v1/intelligence","PUT",{provider:D.provider,model:D.model,endpoint:D.endpoint&&C?.customEndpoint?D.endpoint:"default",...D.credentialRef?{credentialRef:D.credentialRef}:{}}),g(null),j(!0),r($=>$+1)}catch($){m($)}finally{x(!1)}};return s.jsxs(s.Fragment,{children:[s.jsxs(oe,{title:"Current",children:[s.jsx("p",{className:"feltkit-small",children:B.configured?s.jsxs(s.Fragment,{children:[s.jsx("strong",{children:B.provider})," / ",s.jsx("code",{children:B.model})," ·"," ",B.credentialConfigured?s.jsx(Ve,{tone:"positive",label:"Credential attached"}):s.jsx(Ve,{tone:"attention",label:"No credential attached"})]}):"Not configured. The platform works without it; the agent then has no model to decide with."}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["To enter an API key and test the model, open ",s.jsx("a",{href:"#/models",children:"Models"}),"."]})]}),s.jsxs(oe,{title:"Configure",children:[s.jsxs(gl,{label:"Configure Intelligence",submitLabel:"Save",busy:y,onSubmit:()=>{W()},actions:B.credentialConfigured&&C?.credential!=="required"?s.jsx(He,{label:"Remove credential",variant:"danger",size:"md",confirm:{title:"Detach the credential reference?",consequences:["Intelligence calls this provider without a key.","The stored value stays in custody."],confirmLabel:"Remove credential"},action:()=>n("/v1/intelligence/credential","DELETE"),done:()=>r($=>$+1)}):null,children:[s.jsx(Xt,{id:"intelligence-provider",label:"Provider",required:!0,value:D.provider,onChange:$=>w({provider:$,model:""}),options:T.map($=>({value:$.id,label:$.displayName}))}),s.jsx(qe,{id:"intelligence-model",label:"Model",required:!0,list:"intelligence-models",value:D.model,onChange:$=>w({model:$}),spellcheck:"false"}),C?.customEndpoint&&s.jsx(qe,{id:"intelligence-endpoint",label:"Custom endpoint (optional)",type:"url",value:D.endpoint,placeholder:C.endpoints?.[0]?.url??"http://localhost:11434/v1",onChange:$=>w({endpoint:$})}),s.jsx(qe,{id:"intelligence-credential",label:"Credential reference",hint:"Leave empty to keep the current one.",value:D.credentialRef,pattern:"credential-ref:.+",placeholder:`credential-ref:${D.provider}`,required:H,onChange:$=>w({credentialRef:$}),spellcheck:"false"})]}),s.jsx("datalist",{id:"intelligence-models",children:(C?.models??[]).map($=>s.jsx("option",{value:$.id,children:$.displayName},$.id))}),v?s.jsx(Me,{title:"Not saved",error:v}):null,p?s.jsxs(tt,{tone:"info",title:"Saved",children:["Intelligence now uses ",B.provider??D.provider,"."]}):null]})]})}const vg={configured:"Enabled, set up, and its records read cleanly.",unconfigured:"Enabled, but nothing is set up yet.",unhealthy:"Enabled, but its store failed a check or recent work failed.",available:"Can run here; not enabled in feltkit({ services }).",unavailable:"Cannot run in this installation."};function pd({service:n}){return s.jsx(ot,{field:"feltkit.service.state",value:n.state})}const yg="feltkit.services.as",Ij=()=>{try{return sessionStorage.getItem(yg)}catch{return null}};function Fj(n){const[u,o]=E.useState(()=>Ij()??n[0]?.id??""),r=h=>{o(h);try{sessionStorage.setItem(yg,h)}catch{}};return E.useEffect(()=>{n.length&&!n.some(h=>h.id===u)&&o(n[0].id)},[n,u]),{as:u,picker:s.jsx(_n,{id:"services-as",as:u,setAs:r,devUsers:n})}}const ud=n=>n.state!=="available"&&n.state!=="unavailable";function Wj({page:n}){const{version:u}=Wt(),o=We(()=>ue("/services"),[u]),r=We(()=>ue("/overview"),[u]),f=r.data?.devUsers??[],h=!!r.data?.environment?.development,{canAct:g}=ps(r.data),{as:v,picker:m}=Fj(f),p=o.data?.services??[],j=h&&f.length?m:null;if(n==="credentials")return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:"Credentials",crumbs:[{label:"Services",href:"#/services"},{label:"Credentials"}],subtitle:"Credential references the services and configuration use, and where each value is kept.",actions:j}),s.jsx(eS,{as:v,canAct:g,development:h,version:u})]});if(n){const T=p.find(B=>B.id===n);return s.jsx(Cj,{id:n,service:T,as:v,picker:j,development:h,summary:T&&ud(T)?s.jsx(Pj,{service:T}):null,operations:!h&&n==="jobs"?s.jsx(tS,{as:v,development:!1,canAct:g,version:u}):!h&&n==="webhooks"?s.jsx(aS,{as:v,development:!1,canAct:!1,version:u}):null})}const y=p.filter(ud),x=p.filter(T=>!ud(T));return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:"Services",subtitle:h?"AppPort Services on this environment's FeltDB instance. Each service has its own screen; every operation there is authorized by your roles, as the identity you choose.":"AppPort Services on this environment's FeltDB instance. Configuration is a development tool; job retries here are authorized as you and recorded as yours.",actions:j}),o.error&&!o.data?s.jsx(Me,{title:"Services could not be read",error:o.error,retry:o.reload}):o.data?s.jsxs(s.Fragment,{children:[h&&f.length===0&&s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Declare a development identity in ",s.jsxs("code",{children:["feltkit(","{"," dev: ","{"," users ","}"," ","}",")"]})," to manage services: their operations are authorized as that identity."]}),y.length===0&&s.jsxs(wa,{title:"No services enabled",children:["Enable services with ",s.jsxs("code",{children:["feltkit(","{"," services: ","{"," … ","}"," ","}",")"]}),". Each one gets its own screen here."]}),s.jsxs("div",{className:"feltkit-grid",children:[y.map(T=>s.jsxs(oe,{title:s.jsx("a",{href:`#/services/${T.id}`,children:T.name}),action:s.jsx(pd,{service:T}),className:"feltkit-service",children:[s.jsx("p",{className:"feltkit-small",children:T.detail}),T.summary&&s.jsx("p",{className:"feltkit-muted feltkit-small",children:Object.entries(T.summary).slice(0,3).map(([B,D])=>`${B} ${D}`).join(" · ")})]},T.id)),s.jsx(oe,{title:s.jsx("a",{href:"#/services/credentials",children:"Credentials"}),className:"feltkit-service",children:s.jsx("p",{className:"feltkit-small",children:"References the services use, and whether each value is set. Values are never shown."})})]}),x.length>0&&s.jsx(oe,{title:"Not enabled",children:s.jsx(gt,{label:"Services not enabled",columns:[{id:"name",header:"Service"},{id:"state",header:"State"},{id:"about",header:"About"},{id:"actions",header:"Actions"}],rows:x.map(T=>({key:T.id,attrs:{"data-service":T.id},cells:{name:s.jsx("strong",{children:T.name}),state:s.jsx(pd,{service:T}),about:T.state==="unavailable"?T.detail:T.description??vg[T.state],actions:T.state==="available"?s.jsx(ze,{size:"sm",label:`Enable ${T.name}`,onClick:()=>Ha(`services/${T.id}`)}):null}}))})})]}):s.jsx(At,{what:"services"})]})}function Pj({service:n}){return s.jsxs(oe,{title:s.jsxs(s.Fragment,{children:["Status ",s.jsx(pd,{service:n})]}),action:s.jsx("code",{children:`${n.package}@${n.version}`}),children:[s.jsx(ca,{items:[{label:"Status",value:n.detail,hint:n.lastCheckedAt?`checked ${Nt(n.lastCheckedAt)}`:vg[n.state]},...n.summary?[{label:"Records",value:Object.entries(n.summary).map(([u,o])=>`${u} ${String(o)}`).join(" · ")}]:[],...n.lastError?[{label:"Last error",value:s.jsx(Ve,{tone:"critical",label:"Failed",detail:n.lastError.message}),hint:Nt(n.lastError.at)}]:[]]}),s.jsxs("details",{className:"feltkit-details",children:[s.jsx("summary",{children:"Permissions and stored state"}),s.jsx(ca,{items:[{label:"Permissions",value:n.capabilities.join(" "),mono:!0},{label:"State",value:s.jsx("span",{className:"feltkit-choices",children:n.collections.map(u=>s.jsx("a",{href:`#/data/${u}`,children:s.jsx("code",{children:u})},u))})}]})]})]})}function eS({as:n,canAct:u,development:o,version:r}){const[f,h]=E.useState(0),g=We(()=>ue("/credentials"),[r,f]),[v,m]=E.useState("");if(g.error&&!g.data)return s.jsx(Me,{title:"Credentials could not be read",error:g.error,retry:g.reload});if(!g.data)return s.jsx(At,{what:"credentials"});const{custody:p,credentials:j}=g.data,y=()=>h(T=>T+1),x=v.trim()?v.trim().startsWith("credential-ref:")?v.trim():`credential-ref:${v.trim()}`:"";return s.jsxs(oe,{title:"Credentials",children:[s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Services and configuration hold credential references only. Values are kept by FeltKit's custody (",p.location,") and used inside the effect that needs them; they are never stored in FeltDB, logged, or shown. ",p.note]}),s.jsx(gt,{label:"Credential references",columns:[{id:"ref",header:"Reference"},{id:"usedBy",header:"Used by"},{id:"value",header:"Value"},{id:"variable",header:"Override variable"},{id:"actions",header:"Actions"}],rows:j.map(T=>({key:T.ref,cells:{ref:s.jsx("code",{children:T.ref}),usedBy:T.usedBy.length?T.usedBy.join(", "):"stored, not used yet",value:s.jsx(vu,{credential:T}),variable:T.variable?s.jsx("code",{children:T.variable}):"invalid reference",actions:u&&T.writable?s.jsxs("span",{className:"feltkit-actions",children:[s.jsx(uu,{credentialRef:T.ref,label:T.present?"Replace":"Set",...o&&n?{as:n}:{},onSaved:y}),T.source==="vault"&&T.present&&s.jsx(He,{label:"Remove",variant:"danger",action:()=>ue(`/credentials/${encodeURIComponent(T.ref)}${o&&n?`?as=${encodeURIComponent(n)}`:""}`,{method:"DELETE"}),done:y,confirm:{title:`Remove the value of ${T.ref}?`,consequences:[T.usedBy.length?`${T.usedBy.join(", ")} can no longer use it.`:"Nothing uses it yet.","The value is deleted from custody; set it again to restore it."],confirmLabel:"Remove value",requireText:T.ref}})]}):null}})),emptyTitle:"No credential references yet"}),u&&p.writable&&s.jsxs("div",{className:"feltkit-inline",children:[s.jsx(qe,{id:"credential-new",label:"New credential reference",value:v,onChange:T=>m(ks(T)?"":T),placeholder:"credential-ref:stripe",hint:"A name, never the value: a pasted secret is cleared.",spellcheck:"false"}),x&&s.jsx(uu,{credentialRef:x,label:"Set value",...o&&n?{as:n}:{},onSaved:()=>(m(""),y())})]})]})}function gg({title:n,path:u,as:o,development:r,canAct:f,version:h,retry:g,columns:v}){const[m,p]=E.useState(0),j=We(()=>ue(`/services/${u}`),[h,m]),y=()=>p(T=>T+1),x=j.data?.items??[];return s.jsxs(oe,{title:n,action:r?s.jsx(He,{label:"Run due work now",action:()=>ue("/services/run",{method:"POST",body:"{}"}),done:y}):null,children:[j.data?.replay&&!j.data.replay.enabled?s.jsx("p",{className:"feltkit-muted feltkit-small",children:j.data.replay.reason}):null,s.jsx(gt,{label:n,columns:[...v.map(([T])=>({id:T,header:T})),{id:"actions",header:"Actions"}],rows:x.slice(0,50).map(T=>({key:T.id,cells:{...Object.fromEntries(v.map(([B,D])=>[B,D(T)])),actions:s.jsxs("span",{className:"feltkit-actions",children:[r&&T.status==="failed"&&s.jsx(ze,{size:"sm",label:"Diagnose",onClick:()=>Ha(`agent/new/${u==="jobs"?"diagnose-job":"diagnose-delivery"}/${encodeURIComponent(T.id)}`)}),f&&g.when(T)&&(T.retryable??!0)&&s.jsx(He,{label:g.label,disabled:r&&!o,action:()=>ue(`/services/${u}/${encodeURIComponent(T.id)}/${g.action}`,{method:"POST",body:JSON.stringify(r?{as:o}:{})}),done:y})]})}})),loading:j.loading,error:j.error&&!j.data?{title:`${n} could not be read`,...Jl(j.error,j.reload)}:null,emptyTitle:"Nothing yet"}),x.length>50&&s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["The 50 newest of ",x.length," are shown."]})]})}function tS(n){return s.jsx(gg,{...n,title:"Job runs",path:"jobs",retry:{label:"Retry",action:"retry",when:u=>u.status==="failed"},columns:[["Type",u=>s.jsx("code",{children:u.type})],["Status",u=>s.jsx(Ve,{field:"appport.job.status",value:u.status,attrs:{"data-state":u.status}})],["Attempts",u=>`${u.attemptCount}/${u.maxAttempts}`],["As",u=>u.principal?s.jsx("code",{children:u.principal}):null],["Last error",u=>u.lastError??null],["Created",u=>Nt(u.createdAt)]]})}function aS(n){return s.jsx(gg,{...n,title:"Webhook deliveries",path:"deliveries",retry:{label:"Replay",action:"replay",when:u=>u.status==="failed"},columns:[["Event",u=>s.jsx("code",{children:u.eventType})],["To",u=>s.jsx("code",{children:u.destination??u.endpointId})],["Status",u=>s.jsx(ot,{field:"feltkit.webhook.delivery",value:u.status})],["Attempts",u=>u.attemptCount],["HTTP",u=>u.lastStatusCode??null],["Last error",u=>u.lastError??null],["Created",u=>Nt(u.createdAt)]]})}const lS=["","query","mutation","capability","integration","agent","service","auth","admin","system"],nS=["","success","error","denied"];function iS({selected:n}){sg(1e4);const{activity:u,live:o}=Wt(),[r,f]=E.useState(""),[h,g]=E.useState(""),[v,m]=E.useState(!1),p=We(()=>ue(`/activity?limit=200${r?`&kind=${r}`:""}${h?`&outcome=${h}`:""}`),[r,h]),j=E.useMemo(()=>{const x=ug(u.filter(T=>(!r||T.kind===r)&&(!h||T.outcome===h)),p.data?.entries??[]);return v?x.filter(T=>T.kind!=="query"):x},[u,p.data,r,h,v]),y=!!(r||h||v);return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:"Activity",subtitle:"What actually happened, from the runtime's own records: who called what, through which interface, the authority decision, and the writes FeltDB committed.",status:s.jsx(tg,{freshness:o?"live":"stale",source:"the runtime's event stream"})}),s.jsx(ng,{live:!0,label:"Filter activity",idPrefix:"activity-filter",filters:[{id:"kind",label:"Kind",type:"select",value:r,options:lS.map(x=>({value:x,label:x||"All kinds"}))},{id:"outcome",label:"Outcome",type:"select",value:h,options:nS.map(x=>({value:x,label:x||"All outcomes"}))}],onChange:(x,T)=>x==="kind"?f(T):g(T),onClear:()=>(f(""),g(""),m(!1)),applied:(r?1:0)+(h?1:0)+(v?1:0),result:p.data?`${j.length} entr${j.length===1?"y":"ies"}, newest first`:""}),s.jsx(iu,{id:"activity-hide-queries",label:"Hide queries",checked:v,onChange:m}),s.jsx(gt,{label:"Activity",columns:[{id:"when",header:"When"},{id:"outcome",header:"Outcome"},{id:"kind",header:"Kind"},{id:"name",header:"Name"},{id:"principal",header:"Principal"},{id:"via",header:"Via"},{id:"writes",header:"Writes",align:"end"},{id:"ms",header:"ms",align:"end"}],rows:j.map(x=>({key:x.id,selected:n===x.id,onSelect:()=>Ha(`activity/${x.id}`),attrs:{"data-activity":x.id},cells:{when:s.jsx("span",{title:x.at,children:Nt(x.at)}),outcome:s.jsx(mi,{outcome:x.outcome}),kind:x.kind,name:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:x.name})," ",x.error?s.jsx("code",{children:x.error.code}):null]}),principal:x.principal?x.principal.id:x.kind==="system"?null:"anonymous",via:x.via,writes:x.writes?.length?x.writes.length:null,ms:x.durationMs??null}})),loading:p.loading,loadingWhat:"activity",error:p.error&&!p.data?{title:"Activity could not be read",...Jl(p.error,p.reload)}:null,noMatch:y,noMatchTitle:"No activity matches",noMatchBody:"Change or clear the filters.",emptyTitle:"Nothing has happened yet",emptyBody:"Use the app, invoke a capability, or run a function from Capabilities."}),n&&s.jsx(sS,{id:n,onClose:()=>Ha("activity")})]})}function sS({id:n,onClose:u}){const o=We(()=>ue(`/activity/${encodeURIComponent(n)}`),[n]),r=o.data?.entry,f=o.data?.serviceEvidence??[];return s.jsx(Cd,{id:"activity-detail",open:!0,className:"feltkit-dialog-wide",title:r?s.jsx("code",{children:r.name}):"Activity entry",description:r?`${r.kind} via ${r.via} · request ${r.requestId}`:void 0,onClose:u,actions:s.jsx(ze,{label:"Close",onClick:u}),children:o.error?s.jsx(Me,{title:"This entry could not be read",error:o.error,retry:o.reload}):r?s.jsxs(s.Fragment,{children:[s.jsx(ca,{items:[{label:"Outcome",value:s.jsx(mi,{outcome:r.outcome})},{label:"When",value:`${new Date(r.at).toLocaleString()} (${Nt(r.at)})`},{label:"Principal",value:r.principal?`${r.principal.id} (${r.principal.type}; roles: ${r.principal.roles.join(", ")||"none"})`:"anonymous"},...r.capability?[{label:"AppPort capability",value:`${r.capability.name}@${r.capability.version}`,mono:!0}]:[],{label:"Request",value:r.requestId,mono:!0},{label:"Duration",value:`${r.durationMs} ms`},...r.argKeys?[{label:"Arguments",value:r.argKeys.length?r.argKeys.join(", "):"none",mono:!0}]:[]]}),r.error&&s.jsx(Me,{title:r.error.code,error:{message:r.error.message}}),r.authority&&s.jsxs("section",{className:"feltkit-stack","aria-label":"Authority",children:[s.jsx("h3",{className:"feltkit-label",children:"Authority"}),s.jsx(ca,{items:[{label:"Decision",value:s.jsx(ot,{field:"feltkit.authority.allowed",value:!!r.authority.allowed})},{label:"Required",value:r.authority.required??"an authenticated principal",mono:!!r.authority.required},...r.authority.reason?[{label:"Reason",value:r.authority.reason}]:[],{label:"Decision id",value:r.authority.decisionId,mono:!0},...r.authority.appportDecisionId?[{label:"AppPort decision",value:r.authority.appportDecisionId,mono:!0}]:[],{label:"Policy version",value:r.authority.policyVersion,mono:!0}]})]}),s.jsxs("section",{className:"feltkit-stack","aria-label":"State changes",children:[s.jsx("h3",{className:"feltkit-label",children:"State changes"}),r.writes?.length?s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Committed by FeltDB in one transaction ",s.jsx("code",{children:r.transactionId}),r.commitRevision!==void 0?` at revision ${r.commitRevision}`:"","."]}),s.jsx(gt,{label:"Writes",columns:[{id:"op",header:"Op"},{id:"collection",header:"Collection"},{id:"record",header:"Record"},{id:"expected",header:"Expected version"}],rows:r.writes.map((h,g)=>({key:`${g}`,cells:{op:s.jsx("code",{children:h.op}),collection:s.jsx("code",{children:h.collection}),record:h.op==="delete"?s.jsx("code",{children:h.id}):s.jsx("a",{href:`#/data/${h.collection}`,children:s.jsx("code",{children:h.id})}),expected:h.expectedVersion??"— (create)"}}))})]}):s.jsx("p",{className:"feltkit-muted",children:r.kind==="query"?"Queries cannot write.":r.outcome!=="success"?"Nothing was written through ctx.db: a failed mutation commits nothing.":r.services?.length?"No application records changed through ctx.db. Service effects commit separately; see the evidence below.":"No application records changed."}),r.reads?.length?s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Read: ",r.reads.join(", ")]}):null]}),(f.length>0||r.services?.length)&&s.jsxs("section",{className:"feltkit-stack","aria-label":"Service evidence",children:[s.jsx("h3",{className:"feltkit-label",children:"Service evidence"}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Recorded by AppPort Services' gateway in the same FeltDB instance.",o.data?.serviceEvidenceState==="started"?" An effect has no recorded completion: its outcome is unknown, not failed.":"",o.data?.serviceEvidenceTruncated?" More records exist than are shown.":""]}),s.jsx(gt,{label:"Service evidence",columns:[{id:"outcome",header:"Outcome"},{id:"capability",header:"Capability"},{id:"service",header:"Service"},{id:"decision",header:"Decision"},{id:"resource",header:"Resource"}],emptyTitle:"No evidence recorded",rows:f.map(h=>({key:h.id,cells:{outcome:s.jsx(ot,{field:"feltkit.service.evidence",value:h.outcome}),capability:s.jsx("code",{children:h.capability}),service:h.service,decision:s.jsxs(s.Fragment,{children:[h.decision==="allow"?s.jsx(Ve,{tone:"positive",label:"Allow"}):h.decision?s.jsx(Ve,{tone:"neutral",label:h.decision}):null,h.decisionId?s.jsxs("code",{children:[" ",h.decisionId]}):null]}),resource:h.resource?s.jsx("code",{children:h.resource}):null}}))})]}),r.detail&&s.jsxs("section",{className:"feltkit-stack","aria-label":"Detail",children:[s.jsx("h3",{className:"feltkit-label",children:"Detail"}),s.jsx(el,{value:r.detail,label:"Entry detail"})]})]}):s.jsx(At,{what:"the entry"})})}function bg(){const[n,u]=E.useState(null),[o,r]=E.useState(!1);return{open:async()=>{u(null),r(!0);const h=window.open("about:blank","_blank");try{const g=await ue("/production/studio-link",{method:"POST",body:"{}"});if(!g.url)throw new Error("No deployment is recorded for this project. Run `npx feltkit vercel deploy` or `npx feltkit cloudflare deploy` first.");h?(h.opener=null,h.location.href=g.url):window.location.assign(g.url)}catch(g){h?.close(),u(g)}finally{r(!1)}},error:n,busy:o}}const cS=n=>n==="vercel"||n==="cloudflare"?`npx feltkit ${n} deploy`:"npx feltkit deploy";function uS({production:n}){const u=bg(),o=cS(n?.targetId??n?.deployment?.target),r=n?.deployment??null;return n?s.jsxs(oe,{title:"Production",action:s.jsx(ot,{field:"feltkit.deployment.state",value:r?"live":n.target?"built":"none"}),children:[r?s.jsxs(s.Fragment,{children:[s.jsxs("p",{children:[s.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",children:r.url})," ",s.jsxs("span",{className:"feltkit-muted feltkit-small",children:["· ",n.target??r.target," · deployed ",Nt(r.deployedAt)]})]}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Data: ",n.storage==="remote"?s.jsx("code",{children:n.location}):n.location]}),s.jsxs("div",{className:"feltkit-actions",children:[s.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",children:"Open app ↗"}),r.studio?s.jsx(ze,{size:"sm",variant:"primary",label:"Manage in production Studio ↗",busy:u.busy,onClick:()=>{u.open()}}):s.jsxs("span",{className:"feltkit-muted feltkit-small",children:["Production Studio is off. Turn it on with ",s.jsxs("code",{children:[o," --studio"]}),"."]})]}),u.error!=null&&s.jsx(Me,{title:"Production Studio did not open",error:u.error}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Sign someone in to the app: ",s.jsx("code",{children:"npx feltkit session create --env production --type user --id <id> --role <role>"})," in this project's folder. It uses the deployment's FeltDB settings from ",s.jsx("code",{children:".env.local"}),"."]})]}):n.target?s.jsxs("p",{className:"feltkit-muted",children:["Built for ",n.target,", not deployed from here yet. Run ",s.jsx("code",{children:o}),": it uploads the settings, deploys, and signs you in."]}):s.jsxs("p",{className:"feltkit-muted",children:["Not deployed. ",s.jsx("code",{children:"npx feltkit deploy"})," builds it for where it will run (one container, Vercel, or a FeltDB server) and says what to do next."]}),n.storage==="unconfigured"&&s.jsx(tt,{tone:"attention",title:"Production storage is not configured",children:n.location})]}):null}function rS(){const{version:n,overview:u}=Wt(),o=We(()=>ue("/environments"),[]),r=We(()=>ue("/sessions"),[n]),f=u?.environment?.development;return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:"Settings",subtitle:"Environments, access policy and sessions. Configuration lives in feltkit/app.ts; this page shows what the runtime actually uses."}),f&&o.data&&s.jsx(uS,{production:o.data.environments.find(h=>h.name==="production"&&!h.active)}),s.jsxs(oe,{title:"Environments",children:[s.jsx("p",{className:"feltkit-muted feltkit-small",children:"Each environment has its own FeltDB instance. They never share state; FeltKit refuses to open two environments on the same location."}),s.jsx(gt,{label:"Environments",columns:[{id:"name",header:"Environment"},{id:"storage",header:"Storage"},{id:"location",header:"Location"},{id:"instance",header:"Instance"}],rows:(o.data?.environments??[]).map(h=>({key:h.name,selected:!!h.active,cells:{name:s.jsxs("span",{className:"feltkit-row",children:[s.jsx("strong",{children:h.name})," ",h.active&&s.jsx(Ve,{tone:"positive",label:"Active"})]}),storage:h.storage,location:s.jsxs("span",{className:"feltkit-mono",children:[h.target&&s.jsxs("span",{className:"feltkit-muted",children:[h.target," · "]}),h.location,h.deployment&&s.jsxs(s.Fragment,{children:[" · ",s.jsx("a",{href:h.deployment.url,target:"_blank",rel:"noreferrer",children:h.deployment.url})]})]}),instance:h.instanceId?s.jsx("code",{children:h.instanceId}):"not open here"}})),loading:o.loading,error:o.error&&!o.data?{title:"Environments could not be read",...Jl(o.error,o.reload)}:null,emptyTitle:"No environments"}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Production is what your deployment uses. Built with ",s.jsx("code",{children:"npx feltkit deploy"})," for Vercel or a FeltDB server, that is its FeltDB, reached with the settings in ",s.jsx("code",{children:".env.local"}),"; otherwise ",s.jsx("code",{children:"FELTDB_URL"})," + ",s.jsx("code",{children:"FELTDB_TOKEN"})," when set, else ",s.jsx("code",{children:"FELTKIT_STATE_DIR"})," or ",s.jsx("code",{children:".feltkit/production/state"}),"."]})]}),s.jsxs("div",{className:"feltkit-grid feltkit-grid--wide",children:[s.jsxs(oe,{title:"Access policy",action:s.jsxs("code",{children:["policy ",u?.policyVersion]}),children:[s.jsx(gt,{label:"Roles and permissions",columns:[{id:"role",header:"Role"},{id:"permissions",header:"Permissions"}],rows:Object.entries(u?.roles??{}).map(([h,g])=>({key:h,cells:{role:s.jsx("strong",{children:h}),permissions:s.jsx("span",{className:"feltkit-mono",children:g.join(" ")})}})),emptyTitle:"No roles declared"}),s.jsx("p",{className:"feltkit-muted feltkit-small",children:"Enforced through AppPort's authorizer on functions, capabilities and services alike. Edit roles in feltkit/app.ts."})]}),s.jsx(oe,{title:"Development identities",children:f?s.jsx(gt,{label:"Development identities",columns:[{id:"name",header:"Name"},{id:"id",header:"Id"},{id:"roles",header:"Roles"}],rows:(u?.devUsers??[]).map(h=>({key:h.id,cells:{name:h.name??null,id:s.jsx("code",{children:h.id}),roles:h.roles.join(", ")}})),emptyTitle:"None declared",emptyBody:s.jsxs(s.Fragment,{children:["Add ",s.jsxs("code",{children:["dev: ","{ users: [...] }"]})," to ",s.jsxs("code",{children:["feltkit(","{ … }",")"]}),"."]})}):s.jsx("p",{className:"feltkit-muted",children:"Development sign-in is disabled in this environment."})})]}),s.jsxs(oe,{title:"Sessions",action:s.jsx("span",{className:"feltkit-muted feltkit-small",children:"Tokens are stored only as SHA-256 digests."}),children:[f&&s.jsx(oS,{roles:Object.keys(u?.roles??{}),onIssued:r.reload}),s.jsx(gt,{label:"Active sessions",columns:[{id:"ref",header:"Ref"},{id:"principal",header:"Principal"},{id:"roles",header:"Roles"},{id:"kind",header:"Kind"},{id:"created",header:"Created"},{id:"expires",header:"Expires"},{id:"actions",header:"Actions"}],rows:(r.data?.sessions??[]).map(h=>({key:h.ref,cells:{ref:s.jsx("code",{children:h.ref}),principal:s.jsxs(s.Fragment,{children:[h.principal?.id," ",s.jsx("span",{className:"feltkit-muted feltkit-small",children:h.principal?.type})]}),roles:h.principal?.roles?.join(", ")||null,kind:h.kind,created:Nt(h.createdAt),expires:h.expiresAt?new Date(h.expiresAt).toLocaleString():"never",actions:s.jsx(He,{label:"Revoke",variant:"danger",action:()=>ue(`/sessions/${h.ref}`,{method:"DELETE"}),done:r.reload,confirm:{title:`Revoke session ${h.ref}?`,consequences:[`${h.principal?.id??"Its principal"} is signed out wherever this token is used.`,"The token stops working at once; issue a new session to restore access."],confirmLabel:"Revoke session"}})}})),loading:r.loading,error:r.error&&!r.data?{title:"Sessions could not be read",...Jl(r.error,r.reload)}:null,emptyTitle:"No active sessions"})]})]})}function oS({roles:n,onIssued:u}){const[o,r]=E.useState("triage-agent"),[f,h]=E.useState(n.includes("agent")?"agent":n[0]??""),[g,v]=E.useState("agent"),[m,p]=E.useState(null),[j,y]=E.useState(null),[x,T]=E.useState(!1);return s.jsxs("div",{className:"feltkit-stack",children:[s.jsxs(gl,{label:"Issue a session",layout:"inline",submitLabel:"Issue 24-hour session",busy:x,onSubmit:async()=>{if(!(!o||!f)){y(null),T(!0);try{const B=await ue("/sessions",{method:"POST",body:JSON.stringify({principal:{id:o,type:g,roles:[f]},label:"issued from the dashboard",ttlMs:864e5})});p(B.token),u()}catch(B){y(B)}finally{T(!1)}}},children:[s.jsx(qe,{id:"session-principal",label:"Principal id",value:o,onChange:r,required:!0,spellcheck:"false"}),s.jsx(Xt,{id:"session-type",label:"Principal type",value:g,onChange:v,options:["agent","service","user"]}),s.jsx(Xt,{id:"session-role",label:"Role",value:f,onChange:h,options:n,required:!0})]}),j?s.jsx(Me,{title:"No session issued",error:j}):null,m&&s.jsxs(tt,{tone:"attention",title:"Copy this token now: it is shown once",actions:s.jsx(_s,{text:m,label:"Copy token"}),children:[s.jsx("code",{className:"feltkit-secret",children:m}),s.jsxs("p",{className:"feltkit-small",children:["Agents: connect an MCP client to ",s.jsxs("code",{children:[location.origin,"/mcp"]})," with ",s.jsx("code",{children:"Authorization: Bearer <token>"}),". It sees only what this role allows."]})]})]})}function dS(){const n=We(()=>ue("/projects"),[]),u=n.data?.projects??[],o=bg();return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:"Projects",subtitle:"FeltKit applications this machine has run. Each has its own environments and FeltDB instances."}),n.error?s.jsx(Me,{title:"Projects could not be read",error:n.error,retry:n.reload}):n.data?u.length===0?s.jsxs(wa,{title:"Only this project so far",children:["Create another with ",s.jsx("code",{children:"npm create feltkit@latest my-app"}),"."]}):s.jsx("div",{className:"feltkit-grid feltkit-grid--wide",children:u.map(r=>{const f=r.path===n.data.current;return s.jsxs(oe,{title:r.name,className:f?"feltkit-panel--current":"",action:s.jsx(ot,{field:"feltkit.project.state",value:f?"current":r.running?"running":r.exists?"stopped":"missing"}),children:[s.jsx("code",{className:"feltkit-path",children:r.path}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["last run ",Nt(r.lastRunAt)," · ",r.lastEnvironment]}),r.deployment&&s.jsxs("p",{className:"feltkit-small",children:["Live:"," ",s.jsx("a",{href:r.deployment.url,target:"_blank",rel:"noreferrer",children:r.deployment.url})," ",s.jsxs("span",{className:"feltkit-muted",children:["(",r.deployment.target,", deployed ",Nt(r.deployment.deployedAt),")"]})]}),s.jsxs("div",{className:"feltkit-actions",children:[r.running&&r.url&&!f&&s.jsx("a",{href:r.url,target:"_blank",rel:"noreferrer",children:"Open app ↗"}),r.deployment&&s.jsx("a",{href:r.deployment.url,target:"_blank",rel:"noreferrer",children:"Open live app ↗"}),r.deployment?.studio&&f&&s.jsx(ze,{size:"sm",variant:"primary",label:"Manage production ↗",busy:o.busy,onClick:()=>{o.open()}}),r.deployment?.studio&&!f&&s.jsxs("span",{className:"feltkit-muted feltkit-small",children:["Manage it: ",s.jsx("code",{children:"npx feltkit manage"})," in its directory."]}),!r.running&&r.exists&&!r.deployment&&s.jsxs("span",{className:"feltkit-muted feltkit-small",children:["Start it: ",s.jsx("code",{children:"npm run dev"})," in its directory."]})]})]},r.path)})}):s.jsx(At,{what:"projects"}),o.error!=null&&s.jsx(Me,{title:"Production Studio did not open",error:o.error}),s.jsx(oe,{title:"Start a new application",children:s.jsx(gs,{text:`npm create feltkit@latest my-app
|
|
13
|
+
cd my-app
|
|
14
|
+
npm install
|
|
15
|
+
npm run dev`,label:"Commands to start a new application"})})]})}const rd=[{id:"inspect-app",label:"Inspect the application",help:"Capabilities you may use, unhealthy services, recent errors and denials."},{id:"diagnose-job",label:"Diagnose a job",help:"Read the job, its runs and error; propose a retry when it can help.",target:"Job id"},{id:"diagnose-delivery",label:"Diagnose a webhook delivery",help:"Read the delivery, endpoint, and signing credential; propose a replay when it can help.",target:"Delivery id"},{id:"invoke",label:"Run a capability",help:"One capability: observations run now, consequential ones wait for approval."},{id:"handoff",label:"Hand off to a coding agent",help:"Open-ended work, such as a change to the app. Nothing happens until a coding agent (Claude Code, Cursor, or another MCP client working in this project) claims it; connect one once it is created."}];function fS({rest:n}){const{version:u}=Wt(),o=We(()=>ue("/overview"),[u]),r=o.data?.devUsers??[],f=!!o.data?.environment?.development,{canAct:h,actor:g}=ps(o.data),[v,m]=E.useState("");E.useEffect(()=>{!v&&r[0]&&m(r[0].id)},[r,v]);const p=We(()=>ue(`/agent${v?`?as=${encodeURIComponent(v)}`:""}`),[u,v]),j=n[0]&&n[0]!=="new"?n[0]:null,y=s.jsx(_n,{id:"agent-as",as:v,setAs:m,devUsers:r});return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:"Agent",crumbs:j?[{label:"Agent",href:"#/agent"},{label:"Task"}]:void 0,subtitle:"FeltDB's agent runtime, operating this application through its AppPort capabilities and AppPort Services. Every action runs as the task owner; consequential ones wait for a person who may perform them.",actions:r.length?y:null}),p.error&&!p.data?s.jsx(Me,{title:"Agent tasks could not be read",error:p.error,retry:p.reload}):p.data?j?s.jsx(vS,{taskId:j,as:v,development:f,canAct:h,actor:f?v:g??"",version:u,handoff:p.data.handoffs.find(x=>x.taskId===j)}):s.jsxs(s.Fragment,{children:[f&&r.length>0&&s.jsx(hS,{as:v,tools:p.data.tools,initial:n[0]==="new"?{playbook:n[1],target:n[2]}:void 0}),!f&&s.jsx(tt,{tone:"info",title:"Production tasks come from agents (over MCP) and playbooks",children:h?"Approve, reject, retry and settle their actions: each runs as the task owner and is recorded as yours.":"You can inspect them; acting needs feltkit.operations.write."}),p.data.handoffs.length>0&&s.jsxs(oe,{title:"Waiting for a coding agent",children:[s.jsx("ul",{className:"feltkit-list",children:p.data.handoffs.map(x=>s.jsx("li",{children:s.jsxs("a",{href:`#/agent/${x.taskId}`,className:"feltkit-list__row",children:[s.jsx("span",{children:x.objective}),s.jsxs("span",{className:"feltkit-mono feltkit-muted",children:[x.handoffId," · from ",x.from]})]})},x.handoffId))}),s.jsx("p",{className:"feltkit-muted feltkit-small",children:"Nothing works on these until a coding agent claims them. FeltKit has no built-in coding agent: connect yours (Claude Code, Cursor, any MCP client) to this app, in this project."}),s.jsx(pg,{as:v,development:f,handoffId:p.data.handoffs.length===1?p.data.handoffs[0].handoffId:void 0})]}),s.jsx(oe,{title:"Tasks",children:s.jsx(gt,{label:"Agent tasks",columns:[{id:"objective",header:"Objective"},{id:"status",header:"Status"},{id:"execution",header:"FeltDB execution"},{id:"owner",header:"Owner"},{id:"waiting",header:"Waiting"},{id:"updated",header:"Updated"}],rows:p.data.tasks.map(x=>({key:x.task.task_id,onSelect:()=>Ha(`agent/${x.task.task_id}`),attrs:{"data-task":x.task.task_id},cells:{objective:s.jsx("a",{href:`#/agent/${x.task.task_id}`,children:x.task.objective}),status:s.jsx(ot,{field:"feltkit.agent.task",value:x.task.status}),execution:x.execution?.status?s.jsx("code",{children:x.execution.status}):null,owner:s.jsx("code",{children:x.task.owner}),waiting:x.pending?s.jsx(Ve,{tone:"attention",label:`${x.pending} approval${x.pending>1?"s":""}`}):null,updated:Nt(x.task.updated_at)}})),emptyTitle:"No tasks yet",emptyBody:"Start one above, or from a failed job or delivery on the Services screen."})})]}):s.jsx(At,{what:"agent tasks"})]})}function hS({as:n,tools:u,initial:o}){const[r,f]=E.useState(o?.playbook&&rd.some($=>$.id===o.playbook)?o.playbook:"inspect-app"),[h,g]=E.useState(o?.target??""),[v,m]=E.useState(""),[p,j]=E.useState(""),[y,x]=E.useState("{}"),[T,B]=E.useState(!1),[D,C]=E.useState(null),w=rd.find($=>$.id===r),H=!!n&&!(w.target&&!h)&&!(r==="invoke"&&!p)&&!(r==="handoff"&&!v),W=async()=>{if(H){C(null),B(!0);try{let $={};if(r==="invoke")try{$=JSON.parse(y||"{}")}catch{throw new Error("Input is not valid JSON.")}const Z=await ue("/agent/tasks",{method:"POST",body:JSON.stringify({as:n,playbook:r,objective:v||(w.target?`${w.label}: ${h}`:r==="invoke"?`Run ${p}`:w.label),...w.target?{target:h}:{},...r==="invoke"?{capability:p,args:$}:{}})});Ha(`agent/${Z.task.task_id}`)}catch($){C($)}finally{B(!1)}}};return s.jsxs(oe,{title:"New task",children:[s.jsxs(gl,{label:"New task",submitLabel:"Start task",busy:T,onSubmit:()=>{W()},children:[s.jsx(Xt,{id:"task-playbook",label:"What",hint:w.help,value:r,onChange:f,options:rd.map($=>({value:$.id,label:$.label}))}),w.target&&s.jsx(qe,{id:"task-target",label:w.target,value:h,onChange:g,required:!0,spellcheck:"false"}),r==="invoke"&&s.jsxs(s.Fragment,{children:[s.jsx(Xt,{id:"task-capability",label:"Capability",value:p,onChange:j,required:!0,options:[{value:"",label:"Choose a capability"},...u.map($=>({value:$.name,label:`${$.name}: ${$.effect==="consequential"?"needs approval":"observation"}${$.allowed?"":" (not permitted for this identity)"}`,disabled:!$.allowed}))]}),s.jsx(qe,{id:"task-args",label:"Input (JSON)",multiline:!0,rows:3,value:y,onChange:x,spellcheck:"false"})]}),s.jsx(qe,{id:"task-objective",label:"Objective",value:v,onChange:m,required:r==="handoff",placeholder:r==="handoff"?"Describe the work for the coding agent":"Optional"})]}),D?s.jsx(Me,{title:"Not started",error:D}):null]})}const mS=n=>({failed:"Failed",interrupted:"Outcome unknown",executing:"Running",approved:"Approved, starting"})[n]??n;function pg({as:n,development:u,handoffId:o}){const[r,f]=E.useState(null);return u?r?s.jsxs("ol",{className:"feltkit-stack",children:[s.jsxs("li",{className:"feltkit-stack",children:[s.jsxs("p",{className:"feltkit-small",children:["In a terminal in this project, add this app to Claude Code. The token is shown once, lasts 7 days, and acts with ",n,"'s roles:"]}),s.jsx(gs,{text:r.claudeCode,label:"Add this app to Claude Code"})]}),s.jsxs("li",{className:"feltkit-stack",children:[s.jsxs("p",{className:"feltkit-small",children:["Start ",s.jsx("code",{children:"claude"})," in the project and ask:"]}),s.jsx(gs,{text:r.prompt,label:"What to ask the coding agent"})]}),s.jsx("li",{children:s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Another MCP client: endpoint ",s.jsx("code",{children:r.mcpUrl})," with the header ",s.jsx("code",{children:"Authorization: Bearer …"})," from the command above. Its progress, proposals waiting for approval, and summary appear on the task here."]})})]}):s.jsx("div",{children:s.jsx(He,{label:"Connect a coding agent",variant:"primary",size:"md",disabled:!n,action:()=>ue("/agent/connect",{method:"POST",body:JSON.stringify({as:n,...o?{handoffId:o}:{}})}),done:f})}):s.jsxs("p",{className:"feltkit-small",children:["Give the agent a session with ",s.jsx("code",{children:"npx feltkit session create --env production --type agent --id coding-agent --role <role>"}),", add this app's ",s.jsx("code",{children:"/mcp"})," endpoint to it with that token, and ask it to claim the handoff."]})}function vS({taskId:n,as:u,development:o,canAct:r,actor:f,version:h,handoff:g}){const[v,m]=E.useState({}),[p,j]=E.useState(0),y=We(()=>ue(`/agent/tasks/${encodeURIComponent(n)}${o&&u?`?as=${encodeURIComponent(u)}`:""}`),[n,h,p,u]),[x,T]=E.useState(""),B=()=>j(q=>q+1),D=(q,de={})=>()=>ue(`/agent/tasks/${encodeURIComponent(n)}/${q}`,{method:"POST",body:JSON.stringify(o?{as:u,...de}:de)});if(y.error&&!y.data)return s.jsx(Me,{title:"This task could not be read",error:y.error,retry:y.reload});if(!y.data)return s.jsx(At,{what:"the task"});const{task:C,checkpoints:w,execution:H,pending:W,actions:$=[],approval:Z={}}=y.data,ae=$.filter(q=>q.state==="failed"||q.state==="interrupted"||q.state==="executing"||q.state==="approved"),P=C.status!=="completed"&&C.status!=="cancelled";return s.jsxs(s.Fragment,{children:[s.jsxs(oe,{title:s.jsxs(s.Fragment,{children:[C.objective," ",s.jsx(ot,{field:"feltkit.agent.task",value:C.status})]}),action:s.jsx("code",{children:C.owner}),children:[s.jsx(ca,{items:[{label:"FeltDB execution",value:H?`${H.agentRef} · ${H.status}${H.error?` · ${H.error}`:""}`:null,mono:!0},{label:"Task",value:C.task_id,mono:!0,hint:`checkpoint v${C.checkpoint_version}`}]}),r&&P&&y.data.playbook==="decide"&&$.every(q=>!["proposed","approved","executing","interrupted"].includes(q.state))&&s.jsxs("div",{className:"feltkit-actions",children:[s.jsx(He,{label:"Ask the model again",size:"md",action:D("decide"),done:B}),s.jsx("span",{className:"feltkit-muted feltkit-small",children:"Uses this environment's model (Models). The answer is a new proposal."})]}),g&&s.jsxs("div",{className:"feltkit-stack",children:[s.jsx(tt,{tone:"attention",title:"Waiting for a coding agent",children:"Nothing works on this task until one claims it."}),s.jsx(pg,{as:u,development:o,handoffId:g.handoffId})]}),o&&P&&s.jsxs("div",{className:"feltkit-inline",children:[s.jsx(qe,{id:"task-summary",label:"Summary of what was done",value:x,onChange:T}),s.jsx(He,{label:"Complete task",variant:"primary",size:"md",disabled:W.length>0,action:D("complete",{summary:x}),done:B}),s.jsx(He,{label:"Cancel task",size:"md",variant:"ghost",action:D("cancel",{reason:"cancelled from Studio"}),done:B,confirm:{title:"Cancel this task?",consequences:["Nothing more runs for it.",W.length?`${W.length} proposal(s) waiting for approval are not performed.`:"Its checkpoints stay as the record of what was done."],confirmLabel:"Cancel task"}})]})]}),W.map(q=>s.jsxs(oe,{title:s.jsxs(s.Fragment,{children:["Waiting for approval ",s.jsx("code",{children:q.capability})]}),action:s.jsxs("span",{className:"feltkit-muted feltkit-small",children:["proposed by ",q.proposedBy]}),children:[s.jsx("p",{children:q.reason}),q.decision&&s.jsxs("p",{className:"feltkit-small",children:["Chosen by the model ",s.jsx("code",{children:`${q.decision.provider}${q.decision.model?` / ${q.decision.model}`:""}`})," (",q.decision.runtime,") among the options the owner may take. A choice is a proposal, not evidence."]}),s.jsx(el,{value:q.input,label:"Proposed input"}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["Runs as ",s.jsx("code",{children:C.owner}),", through ",q.source==="application"?"the application's AppPort dispatch":"AppPort Services",". You must be permitted to perform it yourself to approve it."]}),r&&s.jsxs("div",{className:"feltkit-actions",children:[Z[q.actionId]?.allowed?s.jsx(He,{label:`Approve as ${f}`,variant:"primary",size:"md",action:D("approve",{actionId:q.actionId,...q.inputDigest?{inputDigest:q.inputDigest}:{}}),done:B}):s.jsxs("span",{className:"feltkit-muted feltkit-small","data-approval-refused":!0,children:[f," cannot approve this: ",Z[q.actionId]?.reason??"no approval decision was returned","."]}),(Z[q.actionId]?.allowed||!/lacks feltkit\.agent\.write|only a person/.test(Z[q.actionId]?.reason??""))&&s.jsx(He,{label:"Reject",size:"md",action:D("reject",{actionId:q.actionId,reason:"rejected in Studio"}),done:B})]})]},q.actionId)),ae.map(q=>s.jsxs(oe,{title:s.jsxs(s.Fragment,{children:[mS(q.state)," ",s.jsx("code",{children:q.capability})," ",s.jsx(ot,{field:"feltkit.agent.action",value:q.state})]}),action:s.jsxs("span",{className:"feltkit-muted feltkit-small",children:["attempt ",q.attempt," · approved by ",q.decidedBy??"—"]}),children:[s.jsx("p",{children:q.reason}),q.outcome?.error?s.jsx(Me,{title:q.outcome.error.code,error:{message:q.outcome.error.message}}):null,q.interruption?s.jsxs(tt,{tone:"attention",title:"The outcome is unknown",children:[String(q.interruption).replace(/\.?$/,".")," Check the effect before settling it; it is never replayed automatically."]}):null,r&&q.state==="failed"&&P&&s.jsx(He,{label:"Retry (needs approval again)",size:"md",action:D("retry",{actionId:q.actionId}),done:B}),r&&q.state==="interrupted"&&s.jsxs("div",{className:"feltkit-inline",children:[s.jsx(qe,{id:`settle-${q.actionId}`,label:"What you checked (recorded with your name)",value:v[q.actionId]??"",onChange:de=>m(I=>({...I,[q.actionId]:de}))}),s.jsx(He,{label:"It succeeded",size:"md",disabled:(v[q.actionId]??"").trim().length<3,action:D("resolve",{actionId:q.actionId,outcome:"succeeded",note:v[q.actionId]}),done:B}),s.jsx(He,{label:"It did not take effect",size:"md",disabled:(v[q.actionId]??"").trim().length<3,action:D("resolve",{actionId:q.actionId,outcome:"failed",note:v[q.actionId]}),done:B})]})]},q.actionId)),s.jsx(oe,{title:"Checkpoints",children:s.jsx(su,{label:"Checkpoints",emptyTitle:"No checkpoints yet",items:w.slice().reverse().map(q=>({id:String(q.version),at:q.created_at,actor:q.actor,summary:s.jsxs(s.Fragment,{children:[s.jsxs("strong",{children:["v",q.version]})," ",q.summary]}),status:s.jsx(ot,{field:"feltkit.agent.task",value:q.status}),detail:s.jsxs("div",{className:"feltkit-stack",children:[q.completed.length>0&&s.jsx("ul",{className:"feltkit-schema","aria-label":`Done in v${q.version}`,children:q.completed.map((de,I)=>s.jsx("li",{children:s.jsx("code",{children:de})},I))}),q.decisions.length>0&&q.version===w.length&&s.jsxs("details",{className:"feltkit-details",children:[s.jsxs("summary",{children:["Decisions (",q.decisions.length,")"]}),s.jsx("ul",{children:q.decisions.map((de,I)=>s.jsx("li",{children:de},I))})]}),q.evidence.filter(de=>de.checkpoint_version===q.version).map((de,I)=>s.jsxs("div",{className:"feltkit-row",children:[s.jsx("span",{children:"Evidence:"}),de.kind==="record"?s.jsx("a",{href:`#/activity/${de.id}`,children:s.jsxs("code",{children:[de.collection,"/",de.id]})}):s.jsx("code",{children:de.uri}),de.verified?s.jsx(ky,{state:"verified",checks:["record verified at commit"]}):s.jsx(ky,{state:"not_verified"})]},I))]})}))})})]})}const Cy="SmolLM2-360M-Instruct-q4f32_1-MLC";async function yS(){const n=navigator.gpu;if(!n)return{ok:!1,detail:"This browser does not expose WebGPU (navigator.gpu)."};try{const u=await n.requestAdapter();if(!u)return{ok:!1,detail:"This browser exposes WebGPU but offers no adapter."};const o=u.info;return{ok:!0,detail:[o?.vendor,o?.description].filter(Boolean).join(" · ")||"an adapter is available"}}catch(u){return{ok:!1,detail:String(u)}}}function gS({development:n}){const[u,o]=E.useState(null),[r,f]=E.useState(null),[h,g]=E.useState("disabled"),[v,m]=E.useState(""),[p,j]=E.useState(null),[y,x]=E.useState(null);E.useEffect(()=>{let w=!0;return(async()=>{const[H,W]=await Promise.all([ue("/models/browser-inference"),yS()]);w&&(o(H),f(W),g(W.ok?H.enabled?"enabled":"disabled":"unsupported"))})().catch(H=>w&&(x(H),g("failed"))),()=>{w=!1}},[]);const T=async w=>{x(null),g(w?"enabling":"disabled");try{const H=await ue("/models/browser-inference",{method:"POST",body:JSON.stringify({enabled:w})});o(H),g(H.enabled?"enabled":"disabled"),H.enabled||(j(null),m(""))}catch(H){x(H),g("failed")}},B=async()=>{if(u){x(null),j(null),g("loading");try{const W=await(await(await import(u.module)).CreateMLCEngine(Cy,{initProgressCallback:$=>m($.text??($.progress!==void 0?`${Math.round($.progress*100)}%`:""))})).chat.completions.create({messages:[{role:"user",content:"Reply with the single word: ready"}],max_tokens:8});j(W.choices?.[0]?.message?.content??""),g("ready")}catch(w){x(w),g("failed")}}},D=h==="ready"?"positive":h==="failed"?"critical":h==="unsupported"?"neutral":h==="enabling"||h==="loading"?"progress":"attention",C={unsupported:"WebGPU is not available in this browser",disabled:"Not enabled for this environment",enabling:"Enabling…",enabled:"Enabled; the model is not loaded",loading:"Loading the model in this browser…",ready:"A model is running in this browser",failed:"Something refused"};return s.jsxs(oe,{title:"Run a model in this browser",children:[s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["A small model runs on this device through WebGPU: no API key, no account, and no prompt leaves the browser. It is"," ",s.jsx("strong",{children:"not"})," the agent's model — the agent decides on the server, and this is not available to it."]}),s.jsx(Ve,{tone:D,label:C[h]}),r&&s.jsx(ca,{items:[{label:"WebGPU",value:r.ok?`available · ${r.detail}`:`unavailable · ${r.detail}`},{label:"Model",value:Cy},...u?.at?[{label:u.enabled?"Enabled":"Changed",value:`${new Date(u.at).toLocaleString()}${u.by?` by ${u.by}`:""}`}]:[]]}),h==="unsupported"&&s.jsxs(tt,{tone:"info",title:"This browser cannot run a model",children:[r?.detail," Chrome and Edge on a machine with a GPU expose WebGPU; a headless browser and most continuous-integration runners do not. Nothing has been changed, and the Content-Security-Policy is untouched."]}),h==="disabled"&&r?.ok&&s.jsxs(tt,{tone:"info",title:"What enabling this changes",children:[s.jsxs("p",{children:["Studio's Content-Security-Policy gains WebAssembly compilation (",s.jsx("code",{children:"'wasm-unsafe-eval'"}),"), a blob worker, and network access to the hosts the weights come from. Nothing else changes, it applies to this environment only, and turning it off restores the original policy exactly."]}),u&&s.jsx(el,{value:u.hosts,label:"Hosts this allows"})]}),s.jsxs("div",{className:"feltkit-row",children:[r?.ok&&!u?.enabled&&s.jsx(ze,{label:"Enable browser inference",onClick:()=>{T(!0)},disabled:!n||h==="enabling",variant:"primary"}),u?.enabled&&s.jsxs(s.Fragment,{children:[s.jsx(ze,{label:h==="ready"?"Run again":"Load and test the model",onClick:()=>{B()},disabled:h==="loading",variant:"primary"}),s.jsx(ze,{label:"Disable",onClick:()=>{T(!1)},disabled:h==="loading"})]})]}),h==="loading"&&s.jsx("p",{className:"feltkit-muted feltkit-small",children:v||"Starting…"}),h==="ready"&&s.jsx(el,{value:p,label:"The model answered, in this browser"}),y!=null&&s.jsx(Me,{title:"Browser inference",error:y}),!n&&s.jsx("p",{className:"feltkit-muted feltkit-small",children:"Turning this on or off is a development-environment action."})]})}function bS(){const{version:n}=Wt(),[u,o]=E.useState(0),r=We(()=>ue("/models"),[n,u]),f=We(()=>ue("/overview"),[n]),{development:h,canAct:g}=ps(f.data),[v,m]=E.useState(null),[p,j]=E.useState(!1),y=s.jsx(zt,{title:"Models",subtitle:"The model that makes agent decisions in this environment. It chooses among the options your application offers and the task owner may take; its choice becomes a proposal, never an execution."});if(r.error&&!r.data)return s.jsxs("div",{className:"feltkit-page",children:[y,s.jsx(Me,{title:"Models could not be read",error:r.error,retry:r.reload})]});if(!r.data)return s.jsxs("div",{className:"feltkit-page",children:[y,s.jsx(At,{what:"models"})]});const{status:x,catalog:T,intelligence:B,saved:D}=r.data,C=async()=>{j(!0),m(null);try{m(await ue("/models/test",{method:"POST",body:"{}"}))}catch(H){m({ok:!1,error:{message:H.message,code:H.code}})}finally{j(!1)}},w=["binary","choice","score","batch","probability_distribution"];return s.jsxs("div",{className:"feltkit-page",children:[y,s.jsxs(oe,{title:s.jsxs(s.Fragment,{children:["Decision model ",s.jsx(ot,{field:"feltkit.model.ready",value:!!x.ready})]}),action:g?s.jsx(ze,{label:"Test the model",busy:p,disabled:!x.ready,onClick:()=>{C()}}):null,children:[s.jsx(ca,{items:[{label:"Source",value:x.source==="application"?"Application code (agent.decisions)":x.source==="resolver"?`Resolver ${x.reference?.ref??""}${x.reference?.revision!=null?` at revision ${x.reference.revision}`:""}: change it in Resolver, not here`:x.source==="intelligence"?"AppPort Services Intelligence (this environment)":"None"},{label:"Provider",value:x.provider?`${x.provider}${x.protocol?` · ${x.protocol}`:""}`:null,mono:!0},{label:"Model",value:x.model??null,mono:!0},{label:"Endpoint",value:x.endpoint??null,mono:!0},{label:"API key",value:x.credential.ref?s.jsxs(s.Fragment,{children:[s.jsx("code",{children:x.credential.ref})," ",s.jsx(vu,{credential:x.credential})]}):x.credential.required?s.jsx(Ve,{tone:"critical",label:"Required, none entered"}):"none needed"},{label:"Runtime",value:x.runtime?`${x.runtime.metadata.runtime} (${x.runtime.metadata.execution_method})`:null,mono:!0},{label:"Can decide",value:x.runtime?s.jsx("span",{className:"feltkit-choices",children:w.map(H=>s.jsx(Ve,{tone:x.runtime.capabilities[H]?"positive":"neutral",label:H.replace("_"," "),detail:x.runtime.capabilities[H]?void 0:"no"},H))}):null}]}),x.problems.map(H=>s.jsx(tt,{tone:"critical",title:H.message,children:H.fix},H.problem)),v&&(v.ok?s.jsx(tt,{tone:"info",title:`The model answered in ${v.durationMs} ms (${v.provider}, ${v.runtime.runtime})`,children:s.jsx(el,{value:v.result,label:"Model answer"})}):s.jsx(Me,{title:"The model did not answer",error:{message:`${v.error.message}${v.error.hint?` ${v.error.hint}`:""}`,code:v.error.code}}))]}),B&&D.length>0&&s.jsx(pS,{saved:D,development:h,overview:f.data,onChanged:()=>(m(null),o(H=>H+1))}),s.jsx(gS,{development:h}),h&&B&&s.jsx(xS,{catalog:T,current:x,overview:f.data,onSaved:()=>o(H=>H+1)}),!h&&s.jsxs(tt,{tone:"info",title:"Production models are set on the host",children:["Select one with ",s.jsx("code",{children:"feltkit model set --env production"}),". Keys live in the host's environment as ",s.jsx("code",{children:"FELTKIT_CREDENTIAL_<ID>"})," (or in a vault the operator opted in to with"," ",s.jsx("code",{children:"FELTKIT_CREDENTIAL_VAULT=1"}),")."]}),!B&&s.jsxs(tt,{tone:"info",title:"The Intelligence service is not enabled",children:["Add ",s.jsx("code",{children:"intelligence: true"})," to ",s.jsx("code",{children:"services"})," in ",s.jsx("code",{children:"feltkit/app.ts"})," (new apps have it on); Studio reloads and you can choose a provider and enter its API key here. Or pass"," ",s.jsx("code",{children:"agent.decisions"}),"."]})]})}function pS({saved:n,development:u,overview:o,onChanged:r}){const[f,h,g]=Rd(o);return s.jsxs(oe,{title:"Saved models",action:u?s.jsx(_n,{id:"saved-models-as",as:f,setAs:h,devUsers:g,label:"Switch as"}):null,children:[s.jsx("p",{className:"feltkit-muted feltkit-small",children:"The agent decides with the model in use. Keep others here to switch between providers and models; each keeps its own API key reference."}),s.jsx(gt,{label:"Saved models",columns:[{id:"provider",header:"Provider"},{id:"model",header:"Model"},{id:"endpoint",header:"Endpoint"},{id:"key",header:"API key"},{id:"actions",header:"Actions"}],rows:n.map(v=>({key:v.id,selected:!!v.active,cells:{provider:s.jsx("code",{children:v.provider}),model:s.jsxs("span",{className:"feltkit-row",children:[s.jsx("code",{children:v.model})," ",v.active&&s.jsx(Ve,{tone:"positive",label:"In use"})]}),endpoint:v.endpoint?s.jsx("code",{children:v.endpoint}):"default",key:v.credentialRef?s.jsx("code",{children:v.credentialRef}):"none",actions:u&&!v.active?s.jsxs("span",{className:"feltkit-actions",children:[s.jsx(He,{label:"Use",variant:"primary",action:()=>ue(`/models/saved/${v.id}/use`,{method:"POST",body:JSON.stringify({as:f})}),done:r}),s.jsx(He,{label:"Forget",action:()=>ue(`/models/saved/${v.id}`,{method:"DELETE"}),done:r,confirm:{title:`Forget ${v.provider} / ${v.model}?`,consequences:["The saved selection is removed from this environment's configuration.","Its API key stays in custody under its reference."],confirmLabel:"Forget model"}})]}):null}}))})]})}function xS({catalog:n,current:u,overview:o,onSaved:r}){const[f,h]=E.useState(u.provider??n[0]?.id??""),g=n.find(ee=>ee.id===f),[v,m]=E.useState(u.model??""),[p,j]=E.useState(u.endpoint??""),[y,x]=E.useState(u.credential?.ref??""),[T,B]=E.useState(""),[D,C]=E.useState(!1),[w,H]=E.useState(null),[W,$]=E.useState(null),[Z,ae]=E.useState(null),[P,q,de]=Rd(o),I=g?g.credential!=="none":!1,Ne=`credential-ref:${f}`,Ye=y.trim()||Ne,mt=u.credential?.ref===Ye?u.credential:null;E.useEffect(()=>{g&&g.modelSelection==="catalog"&&!g.models.includes(v)&&m(g.models[0]??"")},[f]);const bt=ee=>{if(ks(ee)){B(ee.trim()),x(""),C(!0);return}x(ee)},Qe=async ee=>{H(null),$(null),ae(ee?"use":"later");const ie=T;B(""),C(!1);try{const _e=I?Ye:y.trim(),Te={provider:f,model:v,...g?.customEndpoint&&p?{endpoint:p}:{},..._e&&(ie||g?.credential==="required"||y.trim())?{credentialRef:_e}:{},...ie?{apiKey:ie}:{},...P?{as:P}:{},...ee?{}:{activate:!1}},ct=await ue("/models",{method:"POST",body:JSON.stringify(Te)});$({...ct.stored??{},activate:ee}),r()}catch(_e){H(_e)}finally{ae(null)}},V=!!(f&&v)&&Z===null;return s.jsxs(oe,{title:"Add a model (development)",children:[s.jsxs("div",{className:"feltkit-grid",children:[s.jsx(Xt,{id:"model-provider",label:"Provider",value:f,onChange:h,options:n.map(ee=>({value:ee.id,label:`${ee.displayName} (${ee.protocol}${ee.credential==="required"?", needs an API key":ee.credential==="optional"?", API key optional":""})`}))}),g?.modelSelection==="catalog"?s.jsx(Xt,{id:"model-model",label:"Model",value:v,onChange:m,options:g.models}):s.jsx(qe,{id:"model-model",label:"Model",value:v,onChange:m,placeholder:g?.models[0]??"model id",spellcheck:"false",hint:"Required."}),g?.customEndpoint&&s.jsx(qe,{id:"model-endpoint",label:"Endpoint",type:"url",value:p,onChange:j,placeholder:g.endpoints[0]??"http://localhost:11434/v1"}),I&&s.jsx(qe,{id:"model-key",label:`API key${g?.credential==="optional"?" (optional)":""}`,type:"password",autocomplete:"off",spellcheck:"false",value:T,onChange:B,placeholder:mt?.present?"Set: leave empty to keep it":"Paste your API key",hint:mt?.present?"A key is set. Type a new one to replace it.":void 0}),s.jsx(_n,{id:"model-as",as:P,setAs:q,devUsers:de,label:"Save as"})]}),D&&s.jsx(tt,{tone:"info",title:"This looks like an API key",children:"It moved to the key field: it will be stored securely, not in configuration."}),I&&s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["The key is stored on the server in this environment's custody (",u.credential?.location&&u.credential.source!=="environment"?u.credential.location:"the local encrypted vault","), outside FeltDB, and never shown again. An environment variable ",s.jsx("code",{children:jS(Ye)})," overrides it.",mt?.present?s.jsxs(s.Fragment,{children:[" ","Currently: ",s.jsx(vu,{credential:mt})]}):null]}),s.jsxs("details",{className:"feltkit-details",children:[s.jsx("summary",{children:"Advanced: credential reference"}),s.jsx(qe,{id:"model-reference",label:"Credential reference",hint:`A name for where the key is kept, such as credential-ref:openai, never the key itself. Configuration stores only this name. Default ${Ne}.`,value:y,onChange:bt,placeholder:Ne,spellcheck:"false"})]}),s.jsxs("div",{className:"feltkit-actions",children:[s.jsx(ze,{variant:"primary",label:"Save and use",busy:Z==="use",disabled:!V,onClick:()=>{Qe(!0)}}),s.jsx(ze,{label:"Save for later",busy:Z==="later",disabled:!V,onClick:()=>{Qe(!1)}})]}),w?s.jsx(Me,{title:"Not saved",error:w}):null,W&&s.jsxs(tt,{tone:"info",title:W.activate?"Saved and in use":"Saved for later",children:[W.activate?"Use Test the model above to call it.":"Switch to it under Saved models.",W.version?` API key: set (${W.location??"custody"}, version ${W.version}).`:""]})]})}function jS(n){return`FELTKIT_CREDENTIAL_${n.replace(/^credential-ref:/,"").replace(/[^A-Za-z0-9]/g,"_").toUpperCase()}`}const SS=["GET","POST","PUT","PATCH","DELETE"],_S=["string","number","integer","boolean","unknown"],wy=n=>n.map(u=>`${u.name}${u.required?"":"?"}${u.type==="string"?"":`:${u.type}`}`).join(", ");function kS(n){return n.split(",").map(u=>u.trim()).filter(Boolean).map(u=>{const[o="",r="string"]=u.split(":").map(h=>h.trim()),f=_S.includes(r)?r:"string";return{name:o.replace(/\?$/,""),type:f,required:!o.endsWith("?")}})}const NS=n=>{const o=[...n.path.matchAll(/\{([^}]+)\}/g)].map(r=>r[1]).filter(r=>!n.input.some(f=>f.name===r));return o.length?{...n,input:[...o.map(r=>({name:r,type:"string",required:!0})),...n.input]}:n},Oy=n=>n.toLowerCase().replace(/[^a-z0-9]+/g,"").replace(/^[0-9]+/,"")||"op";function TS({overview:n,existing:u,onConnected:o,onClose:r}){const f=Object.keys(n?.roles??{}),[h,g,v]=Rd(n),[m,p]=E.useState("openapi"),[j,y]=E.useState(""),[x,T]=E.useState(""),[B,D]=E.useState(""),[C,w]=E.useState(""),[H,W]=E.useState(""),[$,Z]=E.useState("bearer"),[ae,P]=E.useState("X-API-Key"),[q,de]=E.useState(""),[I,Ne]=E.useState([]),[Ye,mt]=E.useState(f.filter(Q=>Q==="member"||Q==="admin")),[bt,Qe]=E.useState(null),[V,ee]=E.useState(null),[ie,_e]=E.useState(null),Te=async()=>{ee(null),Qe("read");try{const Q=await ue("/integrations/openapi",{method:"POST",body:JSON.stringify(j.trim()?{url:j.trim()}:{document:x})});D(Q.name),w(Q.description??Q.title??""),W(Q.baseUrl??""),Ne(Q.operations.map(J=>({...J,include:!0})))}catch(Q){ee(Q)}finally{Qe(null)}},ct=()=>Ne([...I,{include:!0,name:"",method:"GET",path:"/",access:`${B||"api"}.read`,input:[]}]),ut=(Q,J)=>Ne(I.map((re,pe)=>{if(pe!==Q)return re;const Ae={...re,...J},ne=B||"api";return J.method&&re.access===`${ne}.${re.method==="GET"?"read":"write"}`&&(Ae.access=`${ne}.${J.method==="GET"?"read":"write"}`),Ae})),Oa=Q=>{const J=Q.toLowerCase().replace(/[^a-z0-9]/g,""),re=`${B||"api"}.`;Ne(I.map(pe=>pe.access.startsWith(re)?{...pe,access:`${J||"api"}.${pe.access.slice(re.length)}`}:pe)),D(J)},N=I.filter(Q=>Q.include),X=async()=>{ee(null),Qe("connect");const Q=q;de("");try{const J={name:B,...C.trim()?{description:C.trim()}:{},baseUrl:H.trim(),auth:$==="header"?{kind:"header",header:ae}:{kind:$},operations:N.map(({include:pe,...Ae})=>{const ne=NS({...Ae,include:!0}),{include:K,...ye}=ne;return{...ye,name:Oy(ye.name),effect:ye.method==="GET"?"observation":"consequential"}})},re=await ue("/integrations/connect",{method:"POST",body:JSON.stringify({integration:J,roles:Ye,...Q?{apiKey:Q,as:h}:{}})});_e(re),o()}catch(J){ee(J)}finally{Qe(null)}};return ie?s.jsxs(oe,{title:`Connected ${B}`,children:[s.jsxs(tt,{tone:"info",title:`Wrote ${ie.file}`,children:[ie.granted.length?s.jsxs(s.Fragment,{children:["Granted ",s.jsxs("code",{children:[B,".*"]})," to ",ie.granted.join(", ")," in ",s.jsx("code",{children:"feltkit/app.ts"}),"."," "]}):null,"The server reloads and publishes its operations below as capabilities.",ie.stored?` The API key is stored (version ${ie.stored.version}) and is never shown again.`:""]}),ie.skipped.length>0&&s.jsxs("p",{className:"feltkit-small",children:["Not granted to ",ie.skipped.join(", "),": add ",s.jsxs("code",{children:['"',B,'.*"']})," to their permissions in ",s.jsx("code",{children:"feltkit/app.ts"}),"."]}),s.jsxs("ul",{className:"feltkit-small",children:[s.jsxs("li",{children:["Narrow each operation's ",s.jsx("code",{children:"output"})," in ",s.jsx("code",{children:ie.file})," to what the API returns: AppPort checks every response against it."]}),s.jsxs("li",{children:["For consequential operations, add ",s.jsx("code",{children:"idempotencyHeader"})," if the API deduplicates, and ",s.jsx("code",{children:"verify"})," so an unknown outcome can be settled without resending."]}),s.jsxs("li",{children:["In production set ",s.jsxs("code",{children:[B.toUpperCase(),"_URL"]}),ie.credential?s.jsxs(s.Fragment,{children:[" ","and ",s.jsxs("code",{children:["FELTKIT_CREDENTIAL_",B.toUpperCase()]})]}):null," ","on the host."]})]}),s.jsxs("div",{className:"feltkit-actions",children:[s.jsx(ze,{variant:"primary",label:"Done",onClick:r}),s.jsx(ze,{label:"Connect another",onClick:()=>(_e(null),Ne([]),D(""),y(""),T(""))})]})]}):s.jsxs(oe,{title:"Connect an API",children:[s.jsxs("p",{className:"feltkit-small",children:["Connect a service your app calls: each operation becomes an AppPort capability your functions, agents and other apps can use, with its permission, effect, and every call recorded. This writes ",s.jsx("code",{children:"feltkit/<name>.ts"}),", which you own and can edit."]}),s.jsx(ag,{label:"How to describe the API",idPrefix:"connect",panelId:"connect-panel",active:m,onSelect:Q=>{p(Q),Q==="manual"&&I.length===0&&ct()},tabs:[{id:"openapi",label:"From an OpenAPI document"},{id:"manual",label:"Describe it yourself"}]}),s.jsx(lg,{id:"connect-panel",idPrefix:"connect",active:m,children:s.jsxs("div",{className:"feltkit-stack",children:[m==="openapi"&&s.jsxs(s.Fragment,{children:[s.jsx(qe,{id:"connect-url",label:"Document URL",type:"url",value:j,onChange:y,placeholder:"https://api.example.com/openapi.json"}),s.jsx(qe,{id:"connect-pasted",label:"Or paste it (JSON)",multiline:!0,rows:4,value:x,onChange:T,placeholder:'{"openapi": "3.0.0", "paths": { … }}',spellcheck:"false"}),s.jsx("div",{children:s.jsx(ze,{variant:"primary",label:"Read operations",busy:bt==="read",disabled:bt!==null||!j.trim()&&!x.trim(),onClick:()=>{Te()}})})]}),V?s.jsx(Me,{title:"Not connected",error:V}):null,(I.length>0||m==="manual")&&s.jsxs(s.Fragment,{children:[s.jsxs("div",{className:"feltkit-grid",children:[s.jsx(qe,{id:"connect-name",label:"Name",required:!0,value:B,onChange:Oa,placeholder:"crm",spellcheck:"false",hint:u.includes(B)?void 0:`Capabilities are ${B||"<name>"}.<operation>.`,error:u.includes(B)?"Already connected: choose another name.":void 0}),s.jsx(qe,{id:"connect-base",label:"Base URL",required:!0,type:"url",value:H,onChange:W,placeholder:"https://api.example.com",hint:`Used in development; production reads ${B?`${B.toUpperCase()}_URL`:"<NAME>_URL"}.`}),s.jsx(qe,{id:"connect-description",label:"Description",value:C,onChange:w}),s.jsx(Xt,{id:"connect-auth",label:"API key",value:$,onChange:Q=>Z(Q),options:[{value:"bearer",label:"Sent as Authorization: Bearer"},{value:"header",label:"Sent in a header"},{value:"none",label:"No key"}]}),$==="header"&&s.jsx(qe,{id:"connect-header",label:"Header",value:ae,onChange:P,spellcheck:"false"}),$!=="none"&&s.jsx(qe,{id:"connect-key",label:"Key value (optional now)",type:"password",autocomplete:"off",spellcheck:"false",value:q,onChange:de,placeholder:"Stored securely; never shown again",hint:q&&!ks(q)&&q.length<8?"That looks short for a key.":void 0}),$!=="none"&&q&&s.jsx(_n,{id:"connect-as",as:h,setAs:g,devUsers:v,label:"Store as"})]}),s.jsx("div",{className:"feltkit-stack",children:I.map((Q,J)=>s.jsxs(gd,{legend:`Operation ${J+1}${Q.name?`: ${Q.name}`:""} · ${Q.method==="GET"?"observation":"consequential"}`,hint:Q.description,children:[s.jsx(iu,{id:`connect-op-${J}-include`,label:"Include this operation",checked:Q.include,onChange:re=>ut(J,{include:re})}),s.jsxs("div",{className:"feltkit-grid",children:[s.jsx(qe,{id:`connect-op-${J}-name`,label:"Operation",value:Q.name,onChange:re=>ut(J,{name:Oy(re)}),placeholder:"listcontacts",spellcheck:"false"}),s.jsx(Xt,{id:`connect-op-${J}-method`,label:"Method",value:Q.method,onChange:re=>ut(J,{method:re}),options:[...SS]}),s.jsx(qe,{id:`connect-op-${J}-path`,label:"Path",value:Q.path,onChange:re=>ut(J,{path:re}),spellcheck:"false"}),s.jsx(ES,{id:`connect-op-${J}-input`,initial:wy(Q.input),onDone:re=>ut(J,{input:kS(re)})},wy(Q.input)),s.jsx(qe,{id:`connect-op-${J}-access`,label:"Permission",value:Q.access,onChange:re=>ut(J,{access:re}),spellcheck:"false"})]})]},J))}),s.jsxs("div",{className:"feltkit-actions",children:[s.jsx(ze,{size:"sm",label:"Add operation",onClick:ct}),s.jsx("span",{className:"feltkit-muted feltkit-small",children:"GET reads (observation); other methods may change the API (consequential). An unknown outcome is never re-sent."})]}),f.length>0&&s.jsx(gd,{legend:`Grant ${B||"<name>"}.* to`,children:s.jsx("div",{className:"feltkit-choices",children:f.map(Q=>s.jsx(iu,{id:`connect-grant-${Q}`,label:Q,checked:Ye.includes(Q),onChange:J=>mt(J?[...Ye,Q]:Ye.filter(re=>re!==Q))},Q))})}),s.jsxs("div",{className:"feltkit-actions",children:[s.jsx(ze,{variant:"primary",label:`Connect ${N.length} operation${N.length===1?"":"s"}`,busy:bt==="connect",disabled:bt!==null||!B||!H.trim()||N.length===0||u.includes(B),onClick:()=>{X()}}),B&&s.jsx(_s,{text:`feltkit/${B}.ts`,label:"Copy file path"})]})]})]})})]})}function ES({id:n,initial:u,onDone:o}){const[r,f]=E.useState(u);return s.jsx("div",{onBlur:()=>r!==u&&o(r),children:s.jsx(qe,{id:n,label:"Input (name?:type)",value:r,onChange:f,placeholder:"id, amount:number, note?",spellcheck:"false"})})}function AS(){const{version:n}=Wt(),[u,o]=E.useState(0),r=We(()=>ue("/integrations"),[n,u]),f=We(()=>ue("/overview"),[n]),{development:h,canAct:g}=ps(f.data),m=(f.data?.devUsers??[])[0]?.id??"",[p,j]=E.useState({}),[y,x]=E.useState(!1),T=r.data?.integrations??[],B=r.data?.calls??[],D=s.jsx(zt,{title:"Integrations",subtitle:"Existing APIs, published as AppPort capabilities: what each operation does, who may invoke it, whether repeating it is safe, and how its outcome is verified. Seeing an operation grants nothing.",actions:h&&T.length>0&&!y?s.jsx(ze,{variant:"primary",label:"Connect an API",onClick:()=>x(!0)}):null});return r.error&&!r.data?s.jsxs("div",{className:"feltkit-page",children:[D,s.jsx(Me,{title:"Integrations could not be read",error:r.error,retry:r.reload})]}):r.data?s.jsxs("div",{className:"feltkit-page",children:[D,h&&(y||T.length===0)&&s.jsx(TS,{overview:f.data,existing:T.map(C=>C.name),onConnected:()=>(x(!0),o(C=>C+1)),onClose:()=>x(!1)}),T.length===0?!h&&s.jsxs(wa,{title:"No integrations yet",children:["Connect an API in development (Studio → Integrations), or with ",s.jsxs("code",{children:['app.integration("payments", ',"{"," baseUrl, credential, operations ","}",")"]})," in ",s.jsx("code",{children:"feltkit/"}),"."]}):T.map(C=>s.jsxs(oe,{title:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:C.name})," ",s.jsx(ot,{field:"feltkit.integration.configured",value:C.problems.length===0})]}),action:g&&C.health?s.jsx(He,{label:"Check",action:()=>ue(`/integrations/${encodeURIComponent(C.name)}/check`,{method:"POST",body:"{}"}),done:w=>j(H=>({...H,[C.name]:w}))}):null,children:[C.description&&s.jsx("p",{children:C.description}),s.jsxs("div",{className:"feltkit-row feltkit-small",children:[s.jsx("code",{children:C.baseUrl.value??"—"}),s.jsxs("span",{className:"feltkit-muted",children:["(",C.baseUrl.source,C.baseUrl.variable?` ${C.baseUrl.variable}`:"",")"]}),C.credential&&s.jsxs(s.Fragment,{children:[s.jsx("code",{children:C.credential.ref})," ",C.credential.kind==="oauth2"?s.jsx(CS,{credential:C.credential}):s.jsx(vu,{credential:C.credential}),g&&C.credential.kind==="oauth2"&&C.credential.writable&&s.jsx(wS,{integration:C.name,connected:C.credential.oauth?.state==="active",as:h?m:void 0}),g&&C.credential.kind!=="oauth2"&&C.credential.writable&&s.jsx(uu,{credentialRef:C.credential.ref,label:C.credential.present?"Replace key":"Set key",...h&&m?{as:m}:{},onSaved:()=>o(w=>w+1)}),!C.credential.writable&&!C.credential.present&&s.jsxs("span",{className:"feltkit-muted",children:["Set ",C.credential.variable," on the host."]})]})]}),C.problems.map((w,H)=>s.jsx(tt,{tone:"critical",title:w.message,children:w.fix},H)),p[C.name]&&s.jsx(tt,{tone:p[C.name].ok?"info":"critical",title:p[C.name].ok?"The API answered":"The check failed",children:p[C.name].message}),s.jsx(gt,{label:`${C.name} operations`,columns:[{id:"capability",header:"Capability"},{id:"request",header:"Request"},{id:"effect",header:"Effect"},{id:"access",header:"Who may invoke"},{id:"repeat",header:"Repeat"},{id:"unknown",header:"Outcome unknown"}],rows:C.operations.map(w=>({key:w.capability,cells:{capability:s.jsx("code",{children:w.capability}),request:s.jsx("code",{children:`${w.method} ${w.path}`}),effect:w.effect,access:s.jsx("code",{children:w.access}),repeat:w.effect==="observation"?"safe":w.idempotent?"deduplicated by the API":"may duplicate",unknown:w.effect==="observation"?null:w.verifiable?"verify, never re-send":"a person settles it"}})),emptyTitle:"No operations declared"})]},C.name)),s.jsxs(oe,{title:"Calls",children:[s.jsx(gt,{label:"Integration calls",columns:[{id:"capability",header:"Capability"},{id:"state",header:"State"},{id:"known",header:"How known"},{id:"as",header:"As"},{id:"http",header:"HTTP",align:"end"},{id:"detail",header:"Detail"},{id:"when",header:"When"},{id:"actions",header:"Actions"}],rows:B.map(C=>({key:C.id,cells:{capability:s.jsx("code",{children:C.capability}),state:s.jsx(ot,{field:"feltkit.integration.call",value:C.state}),known:C.determinedBy?`${C.determinedBy}${C.verification?` (${C.verification.outcome})`:""}`:null,as:s.jsx("code",{children:C.principal.id}),http:C.status??null,detail:C.error?.message?s.jsx(Ve,{tone:"critical",label:C.error.code??"Error",detail:C.error.message}):null,when:Nt(C.startedAt),actions:g&&(C.state==="unknown"||C.state==="started")?s.jsx(He,{label:"Verify",disabled:h&&!m,action:()=>ue(`/integrations/calls/${encodeURIComponent(C.id)}/verify`,{method:"POST",body:JSON.stringify(h?{as:m}:{})}),done:()=>o(w=>w+1)}):null}})),emptyTitle:"No calls yet"}),s.jsx("p",{className:"feltkit-muted feltkit-small",children:"A call is recorded before it is sent. Verify reads the API's own state through the declared probe; it never sends the request again."})]})]}):s.jsxs("div",{className:"feltkit-page",children:[D,s.jsx(At,{what:"integrations"})]})}function CS({credential:n}){const u=n.oauth;if(!u)return s.jsx(Ve,{tone:"attention",label:n.state==="revoked"?"Disconnected":"Not connected",attrs:{"data-grant":"missing"}});const o=[u.expiry==="known"?OS(u.expiresAt):"expiry not stated by the provider",u.renewable?"renewable":"not renewable",`${u.refreshes} renewal${u.refreshes===1?"":"s"}${u.refreshedAt?`, last ${Nt(u.refreshedAt)}`:""}`,u.scope?`scope ${u.scope}`:null,u.failure?`last failure: ${u.failure.kind} (${u.failure.message})`:null].filter(Boolean).join(" · ");return u.state==="active"?s.jsx(Ve,{tone:u.failure?"attention":"positive",label:"Connected",detail:o,attrs:{"data-grant":"active"}}):s.jsx(Ve,{tone:"critical",label:"Reconnect needed",detail:o,attrs:{"data-grant":"reconnect_required"}})}function wS({integration:n,connected:u,as:o}){const[r,f]=E.useState(null),[h,g]=E.useState(null),v=async()=>{f(null);try{const m=await ue(`/integrations/${encodeURIComponent(n)}/connect`,{method:"POST",body:JSON.stringify(o?{as:o}:{})});g(m.redirectUri),window.open(m.url,"_blank","noopener")}catch(m){f(m)}};return s.jsxs("span",{className:"feltkit-actions",children:[s.jsx(ze,{size:"sm",label:u?"Reconnect":"Connect",onClick:()=>{v()}}),h&&s.jsxs("span",{className:"feltkit-muted feltkit-small",role:"status",children:["Approve access in the window that opened; the provider returns to ",h,". Then refresh."]}),r?s.jsx(Me,{title:"Not connected",error:r}):null]})}function OS(n){const u=Math.round((Date.parse(n)-Date.now())/1e3);return u<=0?`expired ${Nt(n)} (renewed on the next call)`:u<3600?`expires in ${Math.ceil(u/60)}m`:`expires in ${Math.round(u/3600)}h`}function RS({rest:n}){return n[0]?s.jsx(US,{id:decodeURIComponent(n[0])}):s.jsx(MS,{})}const DS=new Set(["unknown","stranded"]),zS={unknown:"The call reached the point of no return and its outcome was not reported.",stranded:"Started, then the process running it stopped before recording an outcome.",running:"Started recently; it may still be running. It becomes settleable after the stranded threshold.",verified:"Settled by the external system's own answer.",decided:"Settled by a person's decision, without external evidence.",succeeded:"Completed; the record is the evidence.",failed:"Known failure: the provider knew the effect did not happen. Not uncertain."};function xg(){const n=We(()=>ue("/overview"),[]),{development:u,canAct:o}=ps(n.data),r=n.data?.devUsers??[],[f,h]=E.useState(""),g=u&&(f||r[0]?.id)||"";return{overview:n,development:u,canAct:o,devUsers:r,as:g,setAs:h}}function MS(){const{version:n}=Wt(),u=xg(),o=u.development&&u.as?`?as=${encodeURIComponent(u.as)}`:"",r=We(()=>ue(`/providers/calls${o}`),[n,o]),f=r.data?.calls??[],h=s.jsx(zt,{title:"External effects",subtitle:"Calls provider capabilities made to external systems. A call whose outcome is unknown is never repeated: ask the external system what happened, or, when it cannot tell, a person who may perform the operation decides and says why."});if(r.error&&!r.data)return s.jsxs("div",{className:"feltkit-page",children:[h,s.jsx(Me,{error:r.error,retry:r.reload})]});if(!r.data)return s.jsxs("div",{className:"feltkit-page",children:[h,s.jsx(At,{what:"external effects"})]});const g=f.filter(j=>DS.has(j.status)),v=j=>f.filter(y=>y.status===j).length,m=j=>j.map(y=>({key:y.id,cells:{call:s.jsx("a",{href:`#/effects/${encodeURIComponent(y.id)}`,"data-call":y.id,children:s.jsx("code",{children:y.id})}),capability:s.jsx("code",{children:y.capability}),status:s.jsx(ot,{field:"feltkit.provider.call",value:y.status}),since:y.uncertainSince?`uncertain for ${Nt(y.uncertainSince).replace(/ ago$/,"")}`:Nt(y.startedAt),by:y.principal?s.jsx("code",{children:y.principal.id}):null,verify:y.verifiable?"Yes":"No: a person decides",next:y.may.verify?"Verify":y.may.decide?"Decide":s.jsx("span",{className:"feltkit-muted feltkit-small",children:y.may.why})}})),p=[{id:"call",header:"Call"},{id:"capability",header:"Operation"},{id:"status",header:"Status"},{id:"since",header:"Since"},{id:"by",header:"Requested by"},{id:"verify",header:"External verification"},{id:"next",header:"You can"}];return s.jsxs("div",{className:"feltkit-page",children:[h,u.development&&u.devUsers.length>0&&s.jsx(_n,{id:"effects-as",as:u.as,setAs:u.setAs,devUsers:u.devUsers,label:"View and act as"}),s.jsx(oe,{title:"Summary",label:"effects-summary",children:s.jsx(ca,{items:[{label:"Need attention (unknown or stranded)",value:String(g.length)},{label:"Running",value:String(v("running"))},{label:"Settled by verification",value:String(v("verified"))},{label:"Settled by a person",value:String(v("decided"))},{label:"Completed",value:String(v("succeeded"))},{label:"Known failures",value:String(v("failed"))},{label:"Stranded after",value:`${r.data.strandedAfterSeconds} s without an outcome`}]})}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:[s.jsx("strong",{children:"Outcome unknown"}),": the call passed the point of no return and its outcome was not reported. ",s.jsx("strong",{children:"Stranded"}),": the process running it stopped before recording an outcome. ",s.jsx("strong",{children:"Known failure"}),": the provider knew the effect did not happen; it is not uncertain. ",s.jsx("strong",{children:"Settled"}),": verified by the external system's answer, or decided by a person when it could not tell."]}),s.jsx(oe,{title:"Needs attention",label:"effects-attention",children:g.length?s.jsx(gt,{label:"Effects whose outcome is unknown",columns:p,rows:m(g),emptyTitle:"Nothing needs attention"}):s.jsx(wa,{title:"Nothing needs attention",children:"Every recorded call has a known outcome or a settlement."})}),s.jsx(oe,{title:"All calls",label:"effects-all",children:s.jsx(gt,{label:"All external calls",columns:p,rows:m(f),emptyTitle:"No external calls yet"})})]})}function US({id:n}){const{version:u}=Wt(),o=xg(),[r,f]=E.useState(0),h=o.development&&o.as?`?as=${encodeURIComponent(o.as)}`:"",g=We(()=>ue(`/providers/calls/${encodeURIComponent(n)}${h}`),[u,r,h,n]),[v,m]=E.useState("failed"),[p,j]=E.useState(""),y=[{label:"External effects",href:"#/effects"},{label:n}];if(g.error&&!g.data)return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:s.jsx("code",{children:n}),crumbs:y}),s.jsx(Me,{error:g.error,retry:g.reload})]});if(!g.data)return s.jsxs("div",{className:"feltkit-page",children:[s.jsx(zt,{title:s.jsx("code",{children:n}),crumbs:y}),s.jsx(At,{what:"the call"})]});const x=g.data.call,T=(D={})=>JSON.stringify({...o.development?{as:o.as}:{},...D}),B=()=>f(D=>D+1);return s.jsxs("div",{className:"feltkit-page","data-effect":x.id,"data-status":x.status,children:[s.jsx(zt,{title:s.jsxs(s.Fragment,{children:[s.jsx("code",{children:x.capability})," · ",s.jsx("code",{children:x.id})]}),crumbs:y,status:s.jsx(ot,{field:"feltkit.provider.call",value:x.status,detail:zS[x.status]})}),o.development&&o.devUsers.length>0&&s.jsx(_n,{id:"effect-as",as:o.as,setAs:o.setAs,devUsers:o.devUsers,label:"Act as"}),s.jsxs(oe,{title:"Recorded when it ran",label:"effect-recorded",children:[s.jsx("p",{className:"feltkit-muted feltkit-small",children:"What the application recorded at the time. It is never changed: what was established later is kept below, separately."}),s.jsx(ca,{items:[{label:"Recorded outcome",value:x.recorded.outcome??"none (the process stopped before recording one)",mono:!0},{label:"Started",value:x.startedAt,mono:!0},{label:"Finished",value:x.recorded.finishedAt??"not recorded",mono:!0},{label:"Error",value:x.recorded.error?`${x.recorded.error.code}: ${x.recorded.error.message}`:null,mono:!0},{label:"Requested by",value:x.principal?.id??null,mono:!0},{label:"Provider",value:x.provider,mono:!0},{label:"Environment",value:x.environment,mono:!0}]}),x.detail?s.jsx(el,{value:x.detail,label:"Context the provider recorded"}):null]}),s.jsx(oe,{title:"Verification attempts",label:"effect-verifications",children:x.verifications.length?s.jsx(gt,{label:"Verification attempts",columns:[{id:"at",header:"When"},{id:"by",header:"Asked by"},{id:"answer",header:"External system's answer"},{id:"conclusive",header:"Conclusive"},{id:"evidence",header:"Evidence or reason"}],rows:x.verifications.map((D,C)=>({key:`${C}`,cells:{at:s.jsx("code",{children:D.at}),by:s.jsx("code",{children:D.by.id}),answer:D.outcome,conclusive:D.conclusive?"Yes":"No",evidence:D.conclusive?s.jsx(el,{value:D.evidence}):D.reason}}))}):s.jsx(wa,{title:"Not verified yet",children:x.verifiable?"Ask the external system what happened to this call.":"This operation declares no way to ask the external system; a person decides."})}),s.jsx(oe,{title:"Settlement",label:"effect-settlement",children:x.settlement?s.jsxs(s.Fragment,{children:[s.jsx(ca,{items:[{label:"Settled outcome",value:x.settlement.outcome,mono:!0},{label:"Determined by",value:x.settlement.determinedBy==="verification"?"the external system's answer (evidence)":"a person's decision (no external evidence)"},{label:"Settled by",value:x.settlement.settledBy.id,mono:!0},{label:"Settled at",value:x.settlement.settledAt,mono:!0},{label:"Note",value:x.settlement.note}]}),x.settlement.evidence!==void 0&&s.jsx(el,{value:x.settlement.evidence,label:"Evidence"})]}):s.jsx(wa,{title:"Not settled"})}),s.jsxs(oe,{title:"What you can do",label:"effect-actions",children:[x.may.why&&s.jsx(tt,{tone:"info",title:x.may.verify?"A decision is not available yet":"Not available",children:x.may.why}),x.may.verify&&o.canAct&&s.jsxs(s.Fragment,{children:[s.jsxs("p",{className:"feltkit-small",children:["Asks ",x.provider," what happened to this call. It never repeats the call."]}),s.jsx(He,{label:"Verify with the external system",variant:"primary",action:()=>ue(`/providers/calls/${encodeURIComponent(x.id)}/verify`,{method:"POST",body:T()}),done:B})]}),x.may.decide&&o.canAct&&s.jsxs("div",{className:"feltkit-form","data-decide":!0,children:[s.jsxs("p",{className:"feltkit-small",children:[x.verifiable?"The external system could not tell what happened.":"This operation cannot be verified with the external system."," Decide what happened, and say what you checked. Your decision is recorded as yours, with your name, and cannot be changed."]}),s.jsx(Xt,{id:"effect-outcome",label:"What happened",value:v,onChange:m,options:[{value:"failed",label:"It did not happen (failed)"},{value:"succeeded",label:"It happened (succeeded)"}]}),s.jsx(qe,{id:"effect-note",label:"What you checked",multiline:!0,rows:3,value:p,onChange:j,required:!0,hint:"Required. Recorded with your decision."}),s.jsx(He,{label:"Record decision",variant:"primary",disabled:p.trim().length<3,confirm:{title:`Record that ${x.capability} ${v}?`,consequences:[`The call is settled as ${v}, determined by a person (you), with your note.`,"The settlement is permanent. The recorded outcome stays as it was.","Nothing is run: the operation is not attempted again."],confirmLabel:"Record decision"},action:()=>ue(`/providers/calls/${encodeURIComponent(x.id)}/settle`,{method:"POST",body:T({outcome:v,note:p})}),done:()=>(j(""),B())})]}),!o.canAct&&s.jsx(Ve,{tone:"neutral",label:"Read-only",detail:"Your operator grant does not include feltkit.operations.write."}),s.jsx("p",{children:s.jsx("a",{href:"#/effects",onClick:D=>(D.preventDefault(),Ha("effects")),children:"Back to external effects"})})]})]})}const $S=["fail","warn","pass","external"];function BS(){const{version:n}=Wt(),u=We(()=>ue("/readiness"),[n]),o=s.jsx(zt,{title:"Readiness",subtitle:"Real checks of this environment, not a status anyone sets. A passing check means the checked thing is in place; the operational requirements at the end are yours to meet.",actions:s.jsx(ze,{label:"Check again",busy:u.loading&&!!u.data,onClick:u.reload})});if(u.error&&!u.data)return s.jsxs("div",{className:"feltkit-page",children:[o,s.jsx(Me,{title:"Readiness could not be checked",error:u.error,retry:u.reload})]});if(!u.data)return s.jsxs("div",{className:"feltkit-page",children:[o,s.jsx(At,{what:"this environment's checks"})]});const r=u.data,f=[...new Set(r.checks.map(h=>h.area))];return s.jsxs("div",{className:"feltkit-page",children:[o,s.jsxs(oe,{label:"Summary",children:[s.jsx("p",{children:s.jsx("strong",{children:r.summary})}),s.jsx("ul",{className:"feltkit-choices","aria-label":"Checks by result",children:$S.map(h=>s.jsx("li",{className:"feltkit-row",children:s.jsx(ot,{field:"feltkit.readiness.check",value:h,detail:String(r.counts[h]??0)})},h))}),s.jsxs("p",{className:"feltkit-muted feltkit-small",children:["The same report: ",s.jsxs("code",{children:["npx feltkit readiness --env ",r.environment.name]})]})]}),f.map(h=>s.jsx(oe,{title:h,children:s.jsx("ul",{className:"feltkit-list",children:r.checks.filter(g=>g.area===h).map(g=>s.jsxs("li",{className:"feltkit-stack feltkit-check","data-check":g.id,children:[s.jsxs("span",{className:"feltkit-row",children:[s.jsx(ot,{field:"feltkit.readiness.check",value:g.status})," ",s.jsx("strong",{children:g.title})]}),s.jsx("span",{className:"feltkit-small",children:g.detail}),g.fix&&g.status!=="pass"&&s.jsxs("span",{className:"feltkit-small feltkit-muted",children:["Fix: ",g.fix]})]},g.id))})},h))]})}const qS=new Set(["service_effect_evidence","_feltkit_activity"]),jg=E.createContext({live:!1,version:0,changed:{},activity:[],overview:void 0,reloadOverview(){}}),Wt=()=>E.useContext(jg),Dd=[{id:"overview",label:"Overview",key:"1",group:"Application"},{id:"data",label:"Data",key:"2",group:"Application"},{id:"capabilities",label:"Capabilities",key:"3",group:"Application"},{id:"integrations",label:"Integrations",key:"i",group:"Application"},{id:"services",label:"Services",key:"4",group:"Services"},{id:"agent",label:"Agent",key:"5",group:"Operate"},{id:"effects",label:"External effects",key:"e",group:"Operate"},{id:"models",label:"Models",key:"m",group:"Operate"},{id:"activity",label:"Activity",key:"6",group:"Operate"},{id:"readiness",label:"Readiness",key:"r",group:"Operate"},{id:"settings",label:"Settings",key:"7",group:"Development"},{id:"projects",label:"Projects",key:"8",group:"Development"}],Sg=["settings","projects"];function Ry(){const n=location.hash.replace(/^#\/?/,"").split("/").filter(Boolean).map(decodeURIComponent);return{route:Dd.find(o=>o.id===n[0])?.id??"overview",rest:n.slice(1)}}function Ha(n){location.hash=`#/${n}`}const zd="feltkit-main";function HS(){const[n,u]=E.useState("loading"),[o,r]=E.useState("");return E.useEffect(()=>{fetch("/api/session",{credentials:"same-origin"}).then(f=>f.json()).then(f=>{r(f?.environment?.name??""),u(f?.environment?.production?"production":"development")}).catch(()=>u("development"))},[]),n==="loading"?s.jsx("main",{className:"feltkit-gate",children:s.jsx(At,{what:"the runtime"})}):n==="production"?s.jsx(YS,{environment:o}):s.jsx(GS,{})}function LS(){const n=/(?:^|[#&])grant=([^&]+)/.exec(location.hash);if(!n)return null;history.replaceState(null,"",`${location.pathname}#/overview`);try{return decodeURIComponent(n[1])}catch{return null}}function YS({environment:n}){const[u,o]=E.useState("checking"),[r,f]=E.useState(null),[h,g]=E.useState(!1),[v]=E.useState(LS),m=j=>{j?.operator&&j?.csrf?(nd({csrf:j.csrf,environment:n}),o("signed-in")):(nd(null),o("signed-out"))},p=async j=>{f(null),g(!0);try{const y=await fetch("/_feltkit/api/operator/signin",{method:"POST",credentials:"same-origin",headers:{"Content-Type":"application/json","x-feltkit-environment":n},body:JSON.stringify({grant:j})}),x=await y.json();if(!y.ok)throw new Error(x?.error?.message??`Sign-in failed (${y.status})`);m(x)}catch(y){f(`${y.message}${v===j?" The link works once and expires after 10 minutes: run `npx feltkit manage` for a new one.":""}`),o("signed-out")}finally{g(!1)}};return E.useEffect(()=>{v?p(v):ue("/operator/session").then(m,()=>o("signed-out"))},[]),u==="checking"?s.jsx("main",{className:"feltkit-gate",children:s.jsx(At,{what:v?"your sign-in":"your operator session"})}):u==="signed-in"?s.jsx(kg,{onSignOut:()=>{ue("/operator/signout",{method:"POST",body:"{}"}).catch(()=>{}).finally(()=>(nd(null),o("signed-out")))}}):s.jsxs(_g,{title:`Sign in to ${n} Studio`,field:{id:"operator-grant",label:"Operator grant",placeholder:"fkg1.…"},submitLabel:"Sign in",busy:h,error:r,onSubmit:j=>{p(j)},children:["Production Studio is for operators. In your project folder, run ",s.jsx("code",{children:"npx feltkit manage"})," and open the one-time link it prints, or paste the grant from"," ",s.jsx("code",{children:"npx feltkit operator grant --id <you> --role <role>"}),". Everything you do is authorized and recorded as you."]})}function GS(){const[n,u]=E.useState(()=>{const f=O0();return ld(f),f}),[o,r]=E.useState(!1);return n?s.jsx(kg,{onSignOut:f=>(ld(null),yy(null),r(!!f),u(null))}):s.jsxs(_g,{title:"Open the FeltKit dashboard",field:{id:"admin-token",label:"Admin token",placeholder:"fka_…"},submitLabel:"Continue",error:o?"That admin token was not accepted. Delete .feltkit/<env>/admin-token to generate a new one.":null,onSubmit:f=>(ld(f),yy(f),r(!1),u(f)),children:["Open the ",s.jsx("strong",{children:"Dashboard"})," link ",s.jsx("code",{children:"feltkit dev"})," prints (it carries the token), or paste the token from ",s.jsx("code",{children:".feltkit/development/admin-token"}),"."]})}function _g({title:n,field:u,submitLabel:o,busy:r,error:f,onSubmit:h,children:g}){const[v,m]=E.useState(""),[p,j]=cg();return s.jsxs("div",{className:"feltkit-gate","data-stack-shell":"",children:[s.jsxs("header",{className:"feltkit-gate__bar",children:[s.jsx(rj,{id:"gate-theme",preference:p,onChange:j}),s.jsx(VS,{id:"gate-family-mark"})]}),s.jsxs("main",{className:"feltkit-gate__card",id:zd,children:[s.jsx("img",{src:fj,width:"32",height:"32",alt:"FeltKit"}),s.jsx("h1",{className:"feltkit-gate__title",children:n}),s.jsx("p",{className:"feltkit-muted",children:g}),f&&s.jsx(tt,{tone:"critical",title:"Not signed in",children:f}),s.jsx(gl,{label:n,submitLabel:o,busy:r,onSubmit:()=>{v.trim()&&h(v.trim())},children:s.jsx(qe,{id:u.id,label:u.label,value:v,onChange:m,placeholder:u.placeholder,autocomplete:"off",spellcheck:"false",required:!0})})]})]})}function VS({id:n}){return s.jsxs("a",{className:"feltkit-family",href:"https://boundry.company",children:[s.jsx(uj,{idPrefix:n})," A Boundry product"]})}function kg({onSignOut:n}){const[{route:u,rest:o},r]=E.useState(Ry),[f,h]=E.useState(!1),[g,v]=E.useState(null),[m,p]=E.useState(0),[j,y]=E.useState({}),[x,T]=E.useState([]),[B,D]=cg(),C=We(()=>ue("/overview"),[m]),w=E.useRef(null),H=E.useRef(!0);E.useEffect(()=>{const P=()=>r(Ry());return window.addEventListener("hashchange",P),()=>window.removeEventListener("hashchange",P)},[]),E.useEffect(()=>{H.current?H.current=!1:Px(zd)},[u,o[0]]),E.useEffect(()=>R0((P,q)=>{v(new Date().toISOString()),!(P==="activity"&&(T(de=>[q,...de].slice(0,200)),q?.outcome!=="success"&&!q?.writes?.length))&&(P==="change"&&(y(de=>{const I={...de};for(const Ne of q.collections)I[Ne]=(I[Ne]??0)+1;return I}),q.collections.every(de=>qS.has(de)))||w.current===null&&(w.current=window.setTimeout(()=>{w.current=null,p(de=>de+1)},250)))},P=>{h(P),P||v(q=>q??new Date().toISOString())}),[]),E.useEffect(()=>{const P=q=>{const de=q.target;if(q.metaKey||q.ctrlKey||q.altKey||["INPUT","TEXTAREA","SELECT"].includes(de.tagName)||de.isContentEditable||de.closest("dialog"))return;const I=Dd.find(Ne=>Ne.key===q.key);I&&Ha(I.id)};return window.addEventListener("keydown",P),()=>window.removeEventListener("keydown",P)},[]);const W=E.useMemo(()=>({live:f,version:m,changed:j,activity:x,overview:C.data,reloadOverview:C.reload}),[f,m,j,x,C.data,C.reload]),$=C.error?.status===401;E.useEffect(()=>{$&&n(!0)},[$,n]);const Z=C.data,ae=!!Z?.environment?.production;return s.jsx(jg.Provider,{value:W,children:s.jsx(QS,{overview:Z,route:u,rest:o,live:f,lastEventAt:g,theme:B,setTheme:D,onSignOut:()=>n(),children:C.loading&&!Z?s.jsx(At,{what:"the runtime"}):Z?s.jsx(ZS,{route:ae&&Sg.includes(u)?"overview":u,rest:o}):s.jsx(Me,{title:"The runtime did not answer",error:C.error,retry:C.reload})})})}const Dy=n=>n.state!=="available"&&n.state!=="unavailable";function XS(n,u,o){const r=!!n?.environment?.production,f=Dd.filter(g=>!r||!Sg.includes(g.id)).map((g,v)=>({id:g.id,label:g.label,href:`#/${g.id}`,group:g.group,order:v,current:u===g.id&&!(g.id==="services"&&o[0]),attrs:{"aria-keyshortcuts":g.key,"data-route":g.id}})),h=n?.services??[];if(h.length){const g=u==="services"?o[0]:void 0,v=(m,p,j,y)=>({id:`service-${m}`,label:p,href:`#/services/${m}`,group:j,order:y,current:g===m,attrs:{"data-service":m}});h.filter(Dy).forEach((m,p)=>f.push(v(m.id,m.name,"Services",100+p))),f.push(v("credentials","Credentials","Services",200)),h.filter(m=>!Dy(m)).forEach((m,p)=>f.push(v(m.id,m.name,"Services not enabled",300+p)))}return f}function QS({overview:n,route:u,rest:o,live:r,lastEventAt:f,theme:h,setTheme:g,onSignOut:v,children:m}){const p=!!n?.environment?.production,j=Od("feltkit.runtime.state",n?.state);return s.jsxs(cj,{product:{id:"feltkit",name:"FeltKit",homeHref:"#/overview",mark:"FK"},navigation:XS(n,u,o),onNavigate:y=>location.hash=y,mainId:zd,context:s.jsxs("span",{className:"feltkit-context",children:[s.jsx("strong",{className:"feltkit-context__app",children:n?.application?.name??"…"}),n&&s.jsx("code",{className:"feltkit-context__env",children:n.environment.name}),s.jsx(tg,{freshness:r?"live":f?"stale":"unknown",...!r&&f?{asOf:f}:{},source:"events"})]}),theme:{preference:h,onChange:g},account:s.jsx(s.Fragment,{children:s.jsx(ze,{size:"sm",variant:"ghost",label:n?.operator?"Sign out":"Lock",onClick:v,attrs:{title:n?.operator?"Sign out of production Studio":"Forget the admin token in this tab"}})}),children:[n&&s.jsx("div",{className:"feltkit-environment","data-environment":n.environment.name,children:p?s.jsxs(tt,{tone:"attention",title:`Production · signed in as ${n.operator?.principal?.id??"unknown"}`,children:["Roles ",(n.operator?.principal?.roles??[]).join(", ")||"none",". Actions run on this environment only and are recorded as you."]}):s.jsxs("p",{className:"feltkit-environment__line",children:[s.jsxs("span",{children:["FeltDB ",n.instance.feltdbVersion]}),s.jsx("span",{children:n.instance.mode}),s.jsx("code",{className:"feltkit-path",title:n.instance.location,children:n.instance.location}),s.jsxs("span",{className:"feltkit-muted",children:["runtime ",j.label.toLowerCase()," · development tools on"]})]})}),m]})}function ZS({route:n,rest:u}){switch(n){case"data":return s.jsx(mj,{collection:u[0]});case"capabilities":return s.jsx(jj,{selected:u[0]});case"services":return s.jsx(Wj,{page:u[0]});case"agent":return s.jsx(fS,{rest:u});case"models":return s.jsx(bS,{});case"integrations":return s.jsx(AS,{});case"effects":return s.jsx(RS,{rest:u});case"readiness":return s.jsx(BS,{});case"activity":return s.jsx(iS,{selected:u[0]});case"settings":return s.jsx(rS,{});case"projects":return s.jsx(dS,{});default:return s.jsx(hj,{})}}function zt({title:n,subtitle:u,actions:o,crumbs:r,status:f}){return s.jsxs(s.Fragment,{children:[r&&s.jsx(ij,{items:r}),s.jsx(nj,{title:n,description:u,actions:o,status:f})]})}w0.createRoot(document.getElementById("root")).render(s.jsx(E.StrictMode,{children:s.jsx(HS,{})}));
|