easy-devops 1.3.4 → 1.3.5

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.
@@ -0,0 +1,475 @@
1
+ (function(){const o=document.createElement("link").relList;if(o&&o.supports&&o.supports("modulepreload"))return;for(const d of document.querySelectorAll('link[rel="modulepreload"]'))u(d);new MutationObserver(d=>{for(const h of d)if(h.type==="childList")for(const x of h.addedNodes)x.tagName==="LINK"&&x.rel==="modulepreload"&&u(x)}).observe(document,{childList:!0,subtree:!0});function c(d){const h={};return d.integrity&&(h.integrity=d.integrity),d.referrerPolicy&&(h.referrerPolicy=d.referrerPolicy),d.crossOrigin==="use-credentials"?h.credentials="include":d.crossOrigin==="anonymous"?h.credentials="omit":h.credentials="same-origin",h}function u(d){if(d.ep)return;d.ep=!0;const h=c(d);fetch(d.href,h)}})();var kd={exports:{}},_i={};/**
2
+ * @license React
3
+ * react-jsx-runtime.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var Yp;function Y0(){if(Yp)return _i;Yp=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.fragment");function c(u,d,h){var x=null;if(h!==void 0&&(x=""+h),d.key!==void 0&&(x=""+d.key),"key"in d){h={};for(var m in d)m!=="key"&&(h[m]=d[m])}else h=d;return d=h.ref,{$$typeof:l,type:u,key:x,ref:d!==void 0?d:null,props:h}}return _i.Fragment=o,_i.jsx=c,_i.jsxs=c,_i}var Vp;function V0(){return Vp||(Vp=1,kd.exports=Y0()),kd.exports}var a=V0(),Td={exports:{}},Te={};/**
10
+ * @license React
11
+ * react.production.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var Xp;function X0(){if(Xp)return Te;Xp=1;var l=Symbol.for("react.transitional.element"),o=Symbol.for("react.portal"),c=Symbol.for("react.fragment"),u=Symbol.for("react.strict_mode"),d=Symbol.for("react.profiler"),h=Symbol.for("react.consumer"),x=Symbol.for("react.context"),m=Symbol.for("react.forward_ref"),p=Symbol.for("react.suspense"),b=Symbol.for("react.memo"),j=Symbol.for("react.lazy"),y=Symbol.for("react.activity"),N=Symbol.for("react.view_transition"),C=Symbol.iterator;function U(R){return R===null||typeof R!="object"?null:(R=C&&R[C]||R["@@iterator"],typeof R=="function"?R:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},k=Object.assign,E={};function T(R,I,J){this.props=R,this.context=I,this.refs=E,this.updater=J||S}T.prototype.isReactComponent={},T.prototype.setState=function(R,I){if(typeof R!="object"&&typeof R!="function"&&R!=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,R,I,"setState")},T.prototype.forceUpdate=function(R){this.updater.enqueueForceUpdate(this,R,"forceUpdate")};function Y(){}Y.prototype=T.prototype;function z(R,I,J){this.props=R,this.context=I,this.refs=E,this.updater=J||S}var D=z.prototype=new Y;D.constructor=z,k(D,T.prototype),D.isPureReactComponent=!0;var te=Array.isArray;function L(){}var Q={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function K(R,I,J){var ee=J.ref;return{$$typeof:l,type:R,key:I,ref:ee!==void 0?ee:null,props:J}}function ae(R,I){return K(R.type,I,R.props)}function M(R){return typeof R=="object"&&R!==null&&R.$$typeof===l}function _(R){var I={"=":"=0",":":"=2"};return"$"+R.replace(/[=:]/g,function(J){return I[J]})}var se=/\/+/g;function F(R,I){return typeof R=="object"&&R!==null&&R.key!=null?_(""+R.key):I.toString(36)}function ne(R){switch(R.status){case"fulfilled":return R.value;case"rejected":throw R.reason;default:switch(typeof R.status=="string"?R.then(L,L):(R.status="pending",R.then(function(I){R.status==="pending"&&(R.status="fulfilled",R.value=I)},function(I){R.status==="pending"&&(R.status="rejected",R.reason=I)})),R.status){case"fulfilled":return R.value;case"rejected":throw R.reason}}throw R}function fe(R,I,J,ee,Ne){var Ce=typeof R;(Ce==="undefined"||Ce==="boolean")&&(R=null);var De=!1;if(R===null)De=!0;else switch(Ce){case"bigint":case"string":case"number":De=!0;break;case"object":switch(R.$$typeof){case l:case o:De=!0;break;case j:return De=R._init,fe(De(R._payload),I,J,ee,Ne)}}if(De)return Ne=Ne(R),De=ee===""?"."+F(R,0):ee,te(Ne)?(J="",De!=null&&(J=De.replace(se,"$&/")+"/"),fe(Ne,I,J,"",function($t){return $t})):Ne!=null&&(M(Ne)&&(Ne=ae(Ne,J+(Ne.key==null||R&&R.key===Ne.key?"":(""+Ne.key).replace(se,"$&/")+"/")+De)),I.push(Ne)),1;De=0;var he=ee===""?".":ee+":";if(te(R))for(var be=0;be<R.length;be++)ee=R[be],Ce=he+F(ee,be),De+=fe(ee,I,J,Ce,Ne);else if(be=U(R),typeof be=="function")for(R=be.call(R),be=0;!(ee=R.next()).done;)ee=ee.value,Ce=he+F(ee,be++),De+=fe(ee,I,J,Ce,Ne);else if(Ce==="object"){if(typeof R.then=="function")return fe(ne(R),I,J,ee,Ne);throw I=String(R),Error("Objects are not valid as a React child (found: "+(I==="[object Object]"?"object with keys {"+Object.keys(R).join(", ")+"}":I)+"). If you meant to render a collection of children, use an array instead.")}return De}function V(R,I,J){if(R==null)return R;var ee=[],Ne=0;return fe(R,ee,"","",function(Ce){return I.call(J,Ce,Ne++)}),ee}function ce(R){if(R._status===-1){var I=R._result,J=I();J.then(function(ee){(R._status===0||R._status===-1)&&(R._status=1,R._result=ee,J.status===void 0&&(J.status="fulfilled",J.value=ee))},function(ee){(R._status===0||R._status===-1)&&(R._status=2,R._result=ee,J.status===void 0&&(J.status="rejected",J.reason=ee))}),R._status===-1&&(R._status=0,R._result=J)}if(R._status===1)return R._result.default;throw R._result}var Se=typeof reportError=="function"?reportError:function(R){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var I=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof R=="object"&&R!==null&&typeof R.message=="string"?String(R.message):String(R),error:R});if(!window.dispatchEvent(I))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",R);return}console.error(R)};function ke(R){var I=Q.T,J={};J.types=I!==null?I.types:null,Q.T=J;try{var ee=R(),Ne=Q.S;Ne!==null&&Ne(J,ee),typeof ee=="object"&&ee!==null&&typeof ee.then=="function"&&ee.then(L,Se)}catch(Ce){Se(Ce)}finally{I!==null&&J.types!==null&&(I.types=J.types),Q.T=I}}function Ve(R){var I=Q.T;if(I!==null){var J=I.types;J===null?I.types=[R]:J.indexOf(R)===-1&&J.push(R)}else ke(Ve.bind(null,R))}var $e={map:V,forEach:function(R,I,J){V(R,function(){I.apply(this,arguments)},J)},count:function(R){var I=0;return V(R,function(){I++}),I},toArray:function(R){return V(R,function(I){return I})||[]},only:function(R){if(!M(R))throw Error("React.Children.only expected to receive a single React element child.");return R}};return Te.Activity=y,Te.Children=$e,Te.Component=T,Te.Fragment=c,Te.Profiler=d,Te.PureComponent=z,Te.StrictMode=u,Te.Suspense=p,Te.ViewTransition=N,Te.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=Q,Te.__COMPILER_RUNTIME={__proto__:null,c:function(R){return Q.H.useMemoCache(R)}},Te.addTransitionType=Ve,Te.cache=function(R){return function(){return R.apply(null,arguments)}},Te.cacheSignal=function(){return null},Te.cloneElement=function(R,I,J){if(R==null)throw Error("The argument must be a React element, but you passed "+R+".");var ee=k({},R.props),Ne=R.key;if(I!=null)for(Ce in I.key!==void 0&&(Ne=""+I.key),I)!re.call(I,Ce)||Ce==="key"||Ce==="__self"||Ce==="__source"||Ce==="ref"&&I.ref===void 0||(ee[Ce]=I[Ce]);var Ce=arguments.length-2;if(Ce===1)ee.children=J;else if(1<Ce){for(var De=Array(Ce),he=0;he<Ce;he++)De[he]=arguments[he+2];ee.children=De}return K(R.type,Ne,ee)},Te.createContext=function(R){return R={$$typeof:x,_currentValue:R,_currentValue2:R,_threadCount:0,Provider:null,Consumer:null},R.Provider=R,R.Consumer={$$typeof:h,_context:R},R},Te.createElement=function(R,I,J){var ee,Ne={},Ce=null;if(I!=null)for(ee in I.key!==void 0&&(Ce=""+I.key),I)re.call(I,ee)&&ee!=="key"&&ee!=="__self"&&ee!=="__source"&&(Ne[ee]=I[ee]);var De=arguments.length-2;if(De===1)Ne.children=J;else if(1<De){for(var he=Array(De),be=0;be<De;be++)he[be]=arguments[be+2];Ne.children=he}if(R&&R.defaultProps)for(ee in De=R.defaultProps,De)Ne[ee]===void 0&&(Ne[ee]=De[ee]);return K(R,Ce,Ne)},Te.createRef=function(){return{current:null}},Te.forwardRef=function(R){return{$$typeof:m,render:R}},Te.isValidElement=M,Te.lazy=function(R){return{$$typeof:j,_payload:{_status:-1,_result:R},_init:ce}},Te.memo=function(R,I){return{$$typeof:b,type:R,compare:I===void 0?null:I}},Te.startTransition=ke,Te.unstable_useCacheRefresh=function(){return Q.H.useCacheRefresh()},Te.use=function(R){return Q.H.use(R)},Te.useActionState=function(R,I,J){return Q.H.useActionState(R,I,J)},Te.useCallback=function(R,I){return Q.H.useCallback(R,I)},Te.useContext=function(R){return Q.H.useContext(R)},Te.useDebugValue=function(){},Te.useDeferredValue=function(R,I){return Q.H.useDeferredValue(R,I)},Te.useEffect=function(R,I){return Q.H.useEffect(R,I)},Te.useEffectEvent=function(R){return Q.H.useEffectEvent(R)},Te.useId=function(){return Q.H.useId()},Te.useImperativeHandle=function(R,I,J){return Q.H.useImperativeHandle(R,I,J)},Te.useInsertionEffect=function(R,I){return Q.H.useInsertionEffect(R,I)},Te.useLayoutEffect=function(R,I){return Q.H.useLayoutEffect(R,I)},Te.useMemo=function(R,I){return Q.H.useMemo(R,I)},Te.useOptimistic=function(R,I){return Q.H.useOptimistic(R,I)},Te.useReducer=function(R,I,J){return Q.H.useReducer(R,I,J)},Te.useRef=function(R){return Q.H.useRef(R)},Te.useState=function(R){return Q.H.useState(R)},Te.useSyncExternalStore=function(R,I,J){return Q.H.useSyncExternalStore(R,I,J)},Te.useTransition=function(){return Q.H.useTransition()},Te.version="19.3.1",Te}var Qp;function Wd(){return Qp||(Qp=1,Td.exports=X0()),Td.exports}var g=Wd(),Cd={exports:{}},Oi={},Ed={exports:{}},zd={};/**
18
+ * @license React
19
+ * scheduler.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var Zp;function Q0(){return Zp||(Zp=1,(function(l){function o(ne,fe){var V=ne.length;ne.push(fe);e:for(;0<V;){var ce=V-1>>>1,Se=ne[ce];if(0<d(Se,fe))ne[ce]=fe,ne[V]=Se,V=ce;else break e}}function c(ne){return ne.length===0?null:ne[0]}function u(ne){if(ne.length===0)return null;var fe=ne[0],V=ne.pop();if(V!==fe){ne[0]=V;e:for(var ce=0,Se=ne.length,ke=Se>>>1;ce<ke;){var Ve=2*(ce+1)-1,$e=ne[Ve],R=Ve+1,I=ne[R];if(0>d($e,V))R<Se&&0>d(I,$e)?(ne[ce]=I,ne[R]=V,ce=R):(ne[ce]=$e,ne[Ve]=V,ce=Ve);else if(R<Se&&0>d(I,V))ne[ce]=I,ne[R]=V,ce=R;else break e}}return fe}function d(ne,fe){var V=ne.sortIndex-fe.sortIndex;return V!==0?V:ne.id-fe.id}if(l.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var h=performance;l.unstable_now=function(){return h.now()}}else{var x=Date,m=x.now();l.unstable_now=function(){return x.now()-m}}var p=[],b=[],j=1,y=null,N=3,C=!1,U=!1,S=!1,k=!1,E=typeof setTimeout=="function"?setTimeout:null,T=typeof clearTimeout=="function"?clearTimeout:null,Y=typeof setImmediate<"u"?setImmediate:null;function z(ne){for(var fe=c(b);fe!==null;){if(fe.callback===null)u(b);else if(fe.startTime<=ne)u(b),fe.sortIndex=fe.expirationTime,o(p,fe);else break;fe=c(b)}}function D(ne){if(S=!1,z(ne),!U)if(c(p)!==null)U=!0,te||(te=!0,M());else{var fe=c(b);fe!==null&&F(D,fe.startTime-ne)}}var te=!1,L=-1,Q=5,re=-1;function K(){return k?!0:!(l.unstable_now()-re<Q)}function ae(){if(k=!1,te){var ne=l.unstable_now();re=ne;var fe=!0;try{e:{U=!1,S&&(S=!1,T(L),L=-1),C=!0;var V=N;try{t:{for(z(ne),y=c(p);y!==null&&!(y.expirationTime>ne&&K());){var ce=y.callback;if(typeof ce=="function"){y.callback=null,N=y.priorityLevel;var Se=ce(y.expirationTime<=ne);if(ne=l.unstable_now(),typeof Se=="function"){y.callback=Se,z(ne),fe=!0;break t}y===c(p)&&u(p),z(ne)}else u(p);y=c(p)}if(y!==null)fe=!0;else{var ke=c(b);ke!==null&&F(D,ke.startTime-ne),fe=!1}}break e}finally{y=null,N=V,C=!1}fe=void 0}}finally{fe?M():te=!1}}}var M;if(typeof Y=="function")M=function(){Y(ae)};else if(typeof MessageChannel<"u"){var _=new MessageChannel,se=_.port2;_.port1.onmessage=ae,M=function(){se.postMessage(null)}}else M=function(){E(ae,0)};function F(ne,fe){L=E(function(){ne(l.unstable_now())},fe)}l.unstable_IdlePriority=5,l.unstable_ImmediatePriority=1,l.unstable_LowPriority=4,l.unstable_NormalPriority=3,l.unstable_Profiling=null,l.unstable_UserBlockingPriority=2,l.unstable_cancelCallback=function(ne){ne.callback=null},l.unstable_forceFrameRate=function(ne){0>ne||125<ne?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Q=0<ne?Math.floor(1e3/ne):5},l.unstable_getCurrentPriorityLevel=function(){return N},l.unstable_next=function(ne){switch(N){case 1:case 2:case 3:var fe=3;break;default:fe=N}var V=N;N=fe;try{return ne()}finally{N=V}},l.unstable_requestPaint=function(){k=!0},l.unstable_runWithPriority=function(ne,fe){switch(ne){case 1:case 2:case 3:case 4:case 5:break;default:ne=3}var V=N;N=ne;try{return fe()}finally{N=V}},l.unstable_scheduleCallback=function(ne,fe,V){var ce=l.unstable_now();switch(typeof V=="object"&&V!==null?(V=V.delay,V=typeof V=="number"&&0<V?ce+V:ce):V=ce,ne){case 1:var Se=-1;break;case 2:Se=250;break;case 5:Se=1073741823;break;case 4:Se=1e4;break;default:Se=5e3}return Se=V+Se,ne={id:j++,callback:fe,priorityLevel:ne,startTime:V,expirationTime:Se,sortIndex:-1},V>ce?(ne.sortIndex=V,o(b,ne),c(p)===null&&ne===c(b)&&(S?(T(L),L=-1):S=!0,F(D,V-ce))):(ne.sortIndex=Se,o(p,ne),U||C||(U=!0,te||(te=!0,M()))),ne},l.unstable_shouldYield=K,l.unstable_wrapCallback=function(ne){var fe=N;return function(){var V=N;N=fe;try{return ne.apply(this,arguments)}finally{N=V}}}})(zd)),zd}var Kp;function Z0(){return Kp||(Kp=1,Ed.exports=Q0()),Ed.exports}var Rd={exports:{}},Lt={};/**
26
+ * @license React
27
+ * react-dom.production.js
28
+ *
29
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
30
+ *
31
+ * This source code is licensed under the MIT license found in the
32
+ * LICENSE file in the root directory of this source tree.
33
+ */var Jp;function K0(){if(Jp)return Lt;Jp=1;var l=Wd();function o(j){var y="https://react.dev/errors/"+j;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var N=2;N<arguments.length;N++)y+="&args[]="+encodeURIComponent(arguments[N])}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 c(){}var u={d:{f:c,r:function(){throw Error(o(522))},D:c,C:c,L:c,m:c,X:c,S:c,M:c},p:0,findDOMNode:null},d=Symbol.for("react.portal"),h=Symbol.for("react.recoverable"),x=Symbol.for("react.optimistic_key");function m(j,y,N){var C=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:d,key:C==null?null:C===x?x:""+C,children:j,containerInfo:y,implementation:N}}var p=l.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function b(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=u,Lt.browser=function(j){return{$$typeof:h,_reason:j}},Lt.createPortal=function(j,y){var N=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(o(299));return m(j,y,null,N)},Lt.flushSync=function(j){var y=p.T,N=u.p;try{if(p.T=null,u.p=2,j)return j()}finally{p.T=y,u.p=N,u.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,u.d.C(j,y))},Lt.prefetchDNS=function(j){typeof j=="string"&&u.d.D(j)},Lt.preinit=function(j,y){if(typeof j=="string"&&y&&typeof y.as=="string"){var N=y.as,C=b(N,y.crossOrigin),U=typeof y.integrity=="string"?y.integrity:void 0,S=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;N==="style"?u.d.S(j,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:C,integrity:U,fetchPriority:S}):N==="script"&&u.d.X(j,{crossOrigin:C,integrity:U,fetchPriority:S,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 N=b(y.as,y.crossOrigin);u.d.M(j,{crossOrigin:N,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&&u.d.M(j)},Lt.preload=function(j,y){if(typeof j=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var N=y.as,C=b(N,y.crossOrigin);u.d.L(j,N,{crossOrigin:C,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 N=b(y.as,y.crossOrigin);u.d.m(j,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:N,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 u.d.m(j)},Lt.requestFormReset=function(j){u.d.r(j)},Lt.unstable_batchedUpdates=function(j,y){return j(y)},Lt.useFormState=function(j,y,N){return p.H.useFormState(j,y,N)},Lt.useFormStatus=function(){return p.H.useHostTransitionStatus()},Lt.version="19.3.1",Lt}var Pp;function Vg(){if(Pp)return Rd.exports;Pp=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),Rd.exports=K0(),Rd.exports}/**
34
+ * @license React
35
+ * react-dom-client.production.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var Fp;function J0(){if(Fp)return Oi;Fp=1;var l=Z0(),o=Wd(),c=Vg();function u(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var n=2;n<arguments.length;n++)t+="&args[]="+encodeURIComponent(arguments[n])}return"Minified React error #"+e+"; visit "+t+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function d(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function h(e){for(var t=e,n=t;n&&!n.alternate;)t=n,(t.flags&4098)!==0&&(e=t.return),n=t.return;for(;t.return;)t=t.return;return t.tag===3?e:null}function x(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 m(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 p(e){if(h(e)!==e)throw Error(u(188))}function b(e){var t=e.alternate;if(!t){if(t=h(e),t===null)throw Error(u(188));return t!==e?null:e}for(var n=e,s=t;;){var i=n.return;if(i===null)break;var r=i.alternate;if(r===null){if(s=i.return,s!==null){n=s;continue}break}if(i.child===r.child){for(r=i.child;r;){if(r===n)return p(i),e;if(r===s)return p(i),t;r=r.sibling}throw Error(u(188))}if(n.return!==s.return)n=i,s=r;else{for(var f=!1,v=i.child;v;){if(v===n){f=!0,n=i,s=r;break}if(v===s){f=!0,s=i,n=r;break}v=v.sibling}if(!f){for(v=r.child;v;){if(v===n){f=!0,n=r,s=i;break}if(v===s){f=!0,s=r,n=i;break}v=v.sibling}if(!f)throw Error(u(189))}}if(n.alternate!==s)throw Error(u(190))}if(n.tag!==3)throw Error(u(188));return n.stateNode.current===n?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,n,s,i,r){for(;e!==null;){if((e.tag===5||e.tag===27||e.tag===6)&&n(e,s,i,r)||(e.tag!==22||e.memoizedState===null)&&(t||e.tag!==5&&e.tag!==27)&&y(e.child,t,n,s,i,r))return!0;e=e.sibling}return!1}function N(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 C(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 U(e){var t=[null,null],n=N(e);return n===null||S(t,e,n.child,{foundSelf:!1}),t}function S(e,t,n,s){for(;n!==null;){if(n===t)s.foundSelf=!0;else if(n.tag===5||n.tag===27||n.tag===6){if(s.foundSelf)return e[1]=n,!0;e[0]=n}else if((n.tag!==22||n.memoizedState===null)&&S(e,t,n.child,s))return!0;n=n.sibling}return!1}function k(e){switch(e.tag){case 5:case 27:case 6:return e.stateNode;case 3:return e.stateNode.containerInfo;default:throw Error(u(559))}}var E=null,T=null;function Y(e,t,n){return e===n?!0:e===t?(E=e,!0):!1}function z(e,t,n){return e===n?(T=e,!1):e===t?(T!==null&&(E=e),!0):!1}function D(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 te(e,t,n){for(var s=0,i=e;i;i=n(i))s++;i=0;for(var r=t;r;r=n(r))i++;for(;0<s-i;)e=n(e),s--;for(;0<i-s;)t=n(t),i--;for(;s--;){if(e===t||t!==null&&e===t.alternate)return e;e=n(e),t=n(t)}return null}var L=Object.assign,Q=Symbol.for("react.element"),re=Symbol.for("react.transitional.element"),K=Symbol.for("react.portal"),ae=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),_=Symbol.for("react.profiler"),se=Symbol.for("react.consumer"),F=Symbol.for("react.context"),ne=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),V=Symbol.for("react.suspense_list"),ce=Symbol.for("react.memo"),Se=Symbol.for("react.lazy"),ke=Symbol.for("react.activity"),Ve=Symbol.for("react.legacy_hidden"),$e=Symbol.for("react.memo_cache_sentinel"),R=Symbol.for("react.view_transition"),I=Symbol.for("react.recoverable"),J=Symbol.iterator;function ee(e){return e===null||typeof e!="object"?null:(e=J&&e[J]||e["@@iterator"],typeof e=="function"?e:null)}var Ne=Symbol.for("react.client.reference");function Ce(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===Ne?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ae:return"Fragment";case _:return"Profiler";case M:return"StrictMode";case fe:return"Suspense";case V:return"SuspenseList";case ke:return"Activity";case R:return"ViewTransition"}if(typeof e=="object")switch(e.$$typeof){case K:return"Portal";case F:return e.displayName||"Context";case se:return(e._context.displayName||"Context")+".Consumer";case ne:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case ce:return t=e.displayName||null,t!==null?t:Ce(e.type)||"Memo";case Se:t=e._payload,e=e._init;try{return Ce(e(t))}catch{}}return null}var De=Array.isArray,he=o.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,be=c.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,$t={pending:!1,data:null,method:null,action:null},Zn=[],ln=-1;function Gt(e){return{current:e}}function rt(e){0>ln||(e.current=Zn[ln],Zn[ln]=null,ln--)}function Ue(e,t){ln++,Zn[ln]=e.current,e.current=t}var Ut=Gt(null),Nn=Gt(null),Pt=Gt(null),fa=Gt(null);function Kn(e,t){switch(Ue(Pt,t),Ue(Nn,e),Ue(Ut,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Ix(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Ix(t),e=Wx(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}rt(Ut),Ue(Ut,e)}function rn(){rt(Ut),rt(Nn),rt(Pt)}function X(e){var t=e.memoizedState;t!==null&&(Tl._currentValue=t.memoizedState,Ue(fa,e)),t=Ut.current;var n=Wx(t,e.type);t!==n&&(Ue(Nn,e),Ue(Ut,n))}function pe(e){Nn.current===e&&(rt(Ut),rt(Nn)),fa.current===e&&(rt(fa),Tl._currentValue=$t)}var Ae,Ft;function kt(e){if(Ae===void 0)try{throw Error()}catch(n){var t=n.stack.trim().match(/\n( *(at )?)/);Ae=t&&t[1]||"",Ft=-1<n.stack.indexOf(`
42
+ at`)?" (<anonymous>)":-1<n.stack.indexOf("@")?"@unknown:0:0":""}return`
43
+ `+Ae+e+Ft}var We=!1;function cs(e,t){if(!e||We)return"";We=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var s={DetermineComponentFrameRoot:function(){try{if(t){var P=function(){throw Error()};if(Object.defineProperty(P.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(P,[])}catch(oe){var O=oe}Reflect.construct(e,[],P)}else{try{P.call()}catch(oe){O=oe}P=!1;try{var $=Object.getOwnPropertyDescriptor(e.prototype,"props");Object.defineProperty(e.prototype,"props",{configurable:!0,set:function(){throw Error()}}),P=!0,new e}finally{P&&($!==void 0?Object.defineProperty(e.prototype,"props",$):delete e.prototype.props)}}}else{try{throw Error()}catch(oe){O=oe}(P=e())&&typeof P.catch=="function"&&P.catch(function(){})}}catch(oe){if(oe&&O&&typeof oe.stack=="string")return[oe.stack,O.stack]}return[null,null]}};s.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var i=Object.getOwnPropertyDescriptor(s.DetermineComponentFrameRoot,"name");i&&i.configurable&&Object.defineProperty(s.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var r=s.DetermineComponentFrameRoot(),f=r[0],v=r[1];if(f&&v){var w=f.split(`
44
+ `),B=v.split(`
45
+ `);for(i=s=0;s<w.length&&!w[s].includes("DetermineComponentFrameRoot");)s++;for(;i<B.length&&!B[i].includes("DetermineComponentFrameRoot");)i++;if(s===w.length||i===B.length)for(s=w.length-1,i=B.length-1;1<=s&&0<=i&&w[s]!==B[i];)i--;for(;1<=s&&0<=i;s--,i--)if(w[s]!==B[i]){if(s!==1||i!==1)do if(s--,i--,0>i||w[s]!==B[i]){var G=`
46
+ `+w[s].replace(" at new "," at ");return e.displayName&&G.includes("<anonymous>")&&(G=G.replace("<anonymous>",e.displayName)),G}while(1<=s&&0<=i);break}}}finally{We=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:"")?kt(n):""}function Fo(e,t){switch(e.tag){case 26:case 27:case 5:return kt(e.type);case 16:return kt("Lazy");case 13:return e.child!==t&&t!==null?kt("Suspense Fallback"):kt("Suspense");case 19:return kt("SuspenseList");case 0:case 15:return cs(e.type,!1);case 11:return cs(e.type.render,!1);case 1:return cs(e.type,!0);case 31:return kt("Activity");case 30:return kt("ViewTransition");default:return""}}function je(e){try{var t="",n=null;do t+=Fo(e,n),n=e,e=e.return;while(e);return t}catch(s){return`
47
+ Error generating stack: `+s.message+`
48
+ `+s.stack}}var ot=Object.prototype.hasOwnProperty,Ht=l.unstable_scheduleCallback,ft=l.unstable_cancelCallback,ct=l.unstable_shouldYield,on=l.unstable_requestPaint,cn=l.unstable_now,Py=l.unstable_getCurrentPriorityLevel,jf=l.unstable_ImmediatePriority,Nf=l.unstable_UserBlockingPriority,Ii=l.unstable_NormalPriority,Fy=l.unstable_LowPriority,wf=l.unstable_IdlePriority,Iy=l.log,Wy=l.unstable_setDisableYieldValue,ql=null,un=null;function Da(e){if(typeof Iy=="function"&&Wy(e),un&&typeof un.setStrictMode=="function")try{un.setStrictMode(ql,e)}catch{}}var dn=Math.clz32?Math.clz32:nv,ev=Math.log,tv=Math.LN2;function nv(e){return e>>>=0,e===0?32:31-(ev(e)/tv|0)|0}var Wi=256,er=262144,tr=4194304;function us(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 nr(e,t,n){var s=e.pendingLanes;if(s===0)return 0;var i=0,r=e.suspendedLanes,f=e.pingedLanes;e=e.warmLanes;var v=s&134217727;return v!==0?(s=v&~r,s!==0?i=us(s):(f&=v,f!==0?i=us(f):n||(n=v&~e,n!==0&&(i=us(n))))):(v=s&~r,v!==0?i=us(v):f!==0?i=us(f):n||(n=s&~e,n!==0&&(i=us(n)))),i===0?0:t!==0&&t!==i&&(t&r)===0&&(r=i&-i,n=t&-t,r>=n||r===32&&(n&4194048)!==0)?t:i}function $l(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function Sf(e,t){(t&8)!==0&&(t|=t&32);var n=e.entangledLanes;if(n!==0)for(e=e.entanglements,n&=t;0<n;){var s=31-dn(n),i=1<<s;t|=e[s],n&=~i}return t}function av(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 kf(){var e=tr;return tr<<=1,(tr&62914560)===0&&(tr=4194304),e}function Io(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function Gl(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function sv(e,t,n,s,i,r){var f=e.pendingLanes;e.pendingLanes=n,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=n,e.entangledLanes&=n,e.errorRecoveryDisabledLanes&=n,e.shellSuspendCounter=0;var v=e.entanglements,w=e.expirationTimes,B=e.hiddenUpdates;for(n=f&~n;0<n;){var G=31-dn(n),P=1<<G;v[G]=0,w[G]=-1;var O=B[G];if(O!==null)for(B[G]=null,G=0;G<O.length;G++){var $=O[G];$!==null&&($.lane&=-536870913)}n&=~P}s!==0&&Tf(e,s,0),r!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=r&~(f&~t))}function Tf(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var s=31-dn(t);e.entangledLanes|=t,e.entanglements[s]=e.entanglements[s]|1073741824|n&261930}function Cf(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var s=31-dn(n),i=1<<s;i&t|e[s]&t&&(e[s]|=t),n&=~i}}function Ef(e,t){var n=t&-t;return n=(n&42)!==0?1:Wo(n),(n&(e.suspendedLanes|t))!==0?0:n}function Wo(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 ec(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function zf(){var e=be.p;return e!==0?e:(e=window.event,e===void 0?32:Lp(e.type))}function Rf(e,t){var n=be.p;try{return be.p=e,t()}finally{be.p=n}}var ha=Math.random().toString(36).slice(2),Rt="__reactFiber$"+ha,It="__reactProps$"+ha,qs="__reactContainer$"+ha,Af="__reactEvents$"+ha,lv="__reactListeners$"+ha,iv="__reactHandles$"+ha,Df="__reactResources$"+ha,Yl="__reactMarker$"+ha,ar="__reactLoad$"+ha;function sr(e){delete e[Rt],delete e[It],delete e[lv],delete e[iv]}function ds(e){var t;if(t=e[Rt])return t;for(var n=e.parentNode;n;){if(t=n[qs]||n[Rt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=pp(e);e!==null;){if(n=e[Rt])return n;e=pp(e)}return t}e=n,n=e.parentNode}return null}function $s(e){if(e=e[Rt]||e[qs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function Vl(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(u(33))}function Gs(e){var t=e[Df];return t||(t=e[Df]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Tt(e){e[Yl]=!0}function _f(e){e[ar]=void 0}var Of=new Set,Mf={};function fs(e,t){Ys(e,t),Ys(e+"Capture",t)}function Ys(e,t){for(Mf[e]=t,e=0;e<t.length;e++)Of.add(t[e])}var rv=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]*$"),Lf={},Uf={};function ov(e){return ot.call(Uf,e)?!0:ot.call(Lf,e)?!1:rv.test(e)?Uf[e]=!0:(Lf[e]=!0,!1)}var Ge=!1;function Hf(){var e=Ge;return Ge=!1,e}function lr(e,t,n){if(ov(t))if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":e.removeAttribute(t);return;case"boolean":var s=t.toLowerCase().slice(0,5);if(s!=="data-"&&s!=="aria-"){e.removeAttribute(t);return}}e.setAttribute(t,n)}}function ir(e,t,n){if(n===null)e.removeAttribute(t);else{switch(typeof n){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,n)}}function ma(e,t,n,s){if(s===null)e.removeAttribute(n);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(n);return}e.setAttributeNS(t,n,s)}}function fn(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function Bf(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function cv(e,t,n){var s=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof s<"u"&&typeof s.get=="function"&&typeof s.set=="function"){var i=s.get,r=s.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(f){n=""+f,r.call(this,f)}}),Object.defineProperty(e,t,{enumerable:s.enumerable}),{getValue:function(){return n},setValue:function(f){n=""+f},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function tc(e){if(!e._valueTracker){var t=Bf(e)?"checked":"value";e._valueTracker=cv(e,t,""+e[t])}}function qf(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),s="";return e&&(s=Bf(e)?e.checked?"true":"false":e.value),e=s,e!==n?(t.setValue(e),!0):!1}var uv=/[\n"\\]/g;function wn(e){return e.replace(uv,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function nc(e,t,n,s,i,r,f,v){e.name="",f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"?e.type=f:e.removeAttribute("type"),t!=null?f==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+fn(t)):e.value!==""+fn(t)&&(e.value=""+fn(t)):f!=="submit"&&f!=="reset"||e.removeAttribute("value"),t!=null?f==="number"&&e.value==t?ac(e,fn(e.value)):ac(e,fn(t)):n!=null?ac(e,fn(n)):s!=null&&e.removeAttribute("value"),i==null&&r!=null&&(e.defaultChecked=!!r),i!=null&&(e.checked=i&&typeof i!="function"&&typeof i!="symbol"),v!=null&&typeof v!="function"&&typeof v!="symbol"&&typeof v!="boolean"?e.name=""+fn(v):e.removeAttribute("name")}function $f(e,t,n,s,i,r,f,v){if(r!=null&&typeof r!="function"&&typeof r!="symbol"&&typeof r!="boolean"&&(e.type=r),t!=null||n!=null){if(!(r!=="submit"&&r!=="reset"||t!=null)){tc(e);return}n=n!=null?""+fn(n):"",t=t!=null?""+fn(t):n,v||t===e.value||(e.value=t),e.defaultValue=t}s=s??i,s=typeof s!="function"&&typeof s!="symbol"&&!!s,e.checked=v?e.checked:!!s,e.defaultChecked=!!s,f!=null&&typeof f!="function"&&typeof f!="symbol"&&typeof f!="boolean"&&(e.name=f),tc(e)}function ac(e,t){e.defaultValue!==""+t&&(e.defaultValue=""+t)}function Vs(e,t,n,s){if(e=e.options,t){t={};for(var i=0;i<n.length;i++)t["$"+n[i]]=!0;for(n=0;n<e.length;n++)i=t.hasOwnProperty("$"+e[n].value),e[n].selected!==i&&(e[n].selected=i),i&&s&&(e[n].defaultSelected=!0)}else{for(n=""+fn(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,s&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function Gf(e,t,n){if(t!=null&&(t=""+fn(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n!=null?""+fn(n):""}function Yf(e,t,n,s){if(t==null){if(s!=null){if(n!=null)throw Error(u(92));if(De(s)){if(1<s.length)throw Error(u(93));s=s[0]}n=s}n==null&&(n=""),t=n}n=fn(t),e.defaultValue=n,s=e.textContent,s===n&&s!==""&&s!==null&&(e.value=s),tc(e)}function Xs(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var dv=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 Vf(e,t,n){var s=t.indexOf("--")===0;n==null||typeof n=="boolean"||n===""?s?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":s?e.setProperty(t,n):typeof n!="number"||n===0||dv.has(t)?t==="float"?e.cssFloat=n:e[t]=(""+n).trim():e[t]=n+"px"}function Xf(e,t,n){if(t!=null&&typeof t!="object")throw Error(u(62));if(e=e.style,n!=null){for(var s in n)!n.hasOwnProperty(s)||t!=null&&t.hasOwnProperty(s)||(s.indexOf("--")===0?e.setProperty(s,""):s==="float"?e.cssFloat="":e[s]="",Ge=!0);for(var i in t)s=t[i],t.hasOwnProperty(i)&&n[i]!==s&&(Vf(e,i,s),Ge=!0)}else for(var r in t)t.hasOwnProperty(r)&&Vf(e,r,t[r])}function sc(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 fv=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"]]),hv=/^[\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 rr(e){return hv.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function Jn(){}var lc=null;function ic(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Qs=null,Zs=null;function Qf(e){var t=$s(e);if(t&&(e=t.stateNode)){var n=e[It]||null;e:switch(e=t.stateNode,t.type){case"input":if(nc(e,n.value,n.defaultValue,n.defaultValue,n.checked,n.defaultChecked,n.type,n.name),t=n.name,n.type==="radio"&&t!=null){for(n=e;n.parentNode;)n=n.parentNode;for(n=n.querySelectorAll('input[name="'+wn(""+t)+'"][type="radio"]'),t=0;t<n.length;t++){var s=n[t];if(s!==e&&s.form===e.form){var i=s[It]||null;if(!i)throw Error(u(90));nc(s,i.value,i.defaultValue,i.defaultValue,i.checked,i.defaultChecked,i.type,i.name)}}for(t=0;t<n.length;t++)s=n[t],s.form===e.form&&qf(s)}break e;case"textarea":Gf(e,n.value,n.defaultValue);break e;case"select":t=n.value,t!=null&&Vs(e,!!n.multiple,t,!1)}}}var rc=!1;function Zf(e,t,n){if(rc)return e(t,n);rc=!0;try{var s=e(t);return s}finally{if(rc=!1,(Qs!==null||Zs!==null)&&(ro(),Qs&&(t=Qs,e=Zs,Zs=Qs=null,Qf(t),e)))for(t=0;t<e.length;t++)Qf(e[t])}}function Xl(e,t){var n=e.stateNode;if(n===null)return null;var s=n[It]||null;if(s===null)return null;n=s[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":(s=!s.disabled)||(e=e.type,s=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!s;break e;default:e=!1}if(e)return null;if(n&&typeof n!="function")throw Error(u(231,t,typeof n));return n}var xa=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),oc=!1;if(xa)try{var Ql={};Object.defineProperty(Ql,"passive",{get:function(){oc=!0}}),window.addEventListener("test",Ql,Ql),window.removeEventListener("test",Ql,Ql)}catch{oc=!1}var _a=null,cc=null,or=null;function Kf(){if(or)return or;var e,t=cc,n=t.length,s,i="value"in _a?_a.value:_a.textContent,r=i.length;for(e=0;e<n&&t[e]===i[e];e++);var f=n-e;for(s=1;s<=f&&t[n-s]===i[r-s];s++);return or=i.slice(e,1<s?1-s:void 0)}function cr(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 ur(){return!0}function Jf(){return!1}function Yt(e){function t(n,s,i,r,f){this._reactName=n,this._targetInst=i,this.type=s,this.nativeEvent=r,this.target=f,this.currentTarget=null;for(var v in e)e.hasOwnProperty(v)&&(n=e[v],this[v]=n?n(r):r[v]);return this.isDefaultPrevented=(r.defaultPrevented!=null?r.defaultPrevented:r.returnValue===!1)?ur:Jf,this.isPropagationStopped=Jf,this}return L(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var n=this.nativeEvent;n&&(n.preventDefault?n.preventDefault():typeof n.returnValue!="unknown"&&(n.returnValue=!1),this.isDefaultPrevented=ur)},stopPropagation:function(){var n=this.nativeEvent;n&&(n.stopPropagation?n.stopPropagation():typeof n.cancelBubble!="unknown"&&(n.cancelBubble=!0),this.isPropagationStopped=ur)},persist:function(){},isPersistent:ur}),t}var Oa={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},dr=Yt(Oa),Zl=L({},Oa,{view:0,detail:0}),mv=Yt(Zl),uc,dc,Kl,fr=L({},Zl,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:hc,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!==Kl&&(Kl&&e.type==="mousemove"?(uc=e.screenX-Kl.screenX,dc=e.screenY-Kl.screenY):dc=uc=0,Kl=e),uc)},movementY:function(e){return"movementY"in e?e.movementY:dc}}),Pf=Yt(fr),xv=L({},fr,{dataTransfer:0}),pv=Yt(xv),gv=L({},Zl,{relatedTarget:0}),fc=Yt(gv),yv=L({},Oa,{animationName:0,elapsedTime:0,pseudoElement:0}),vv=Yt(yv),bv=L({},Oa,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),jv=Yt(bv),Nv=L({},Oa,{data:0}),Ff=Yt(Nv),wv={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Sv={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"},kv={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Tv(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=kv[e])?!!t[e]:!1}function hc(){return Tv}var Cv=L({},Zl,{key:function(e){if(e.key){var t=wv[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=cr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?Sv[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:hc,charCode:function(e){return e.type==="keypress"?cr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?cr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),Ev=Yt(Cv),zv=L({},fr,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),If=Yt(zv),Rv=L({},Oa,{submitter:0}),Av=Yt(Rv),Dv=L({},Zl,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:hc}),_v=Yt(Dv),Ov=L({},Oa,{propertyName:0,elapsedTime:0,pseudoElement:0}),Mv=Yt(Ov),Lv=L({},fr,{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}),Uv=Yt(Lv),Hv=L({},Oa,{newState:0,oldState:0,source:0}),Bv=Yt(Hv),qv=[9,13,27,32],mc=xa&&"CompositionEvent"in window,Jl=null;xa&&"documentMode"in document&&(Jl=document.documentMode);var $v=xa&&"TextEvent"in window&&!Jl,Wf=xa&&(!mc||Jl&&8<Jl&&11>=Jl),eh=" ",th=!1;function nh(e,t){switch(e){case"keyup":return qv.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ah(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Ks=!1;function Gv(e,t){switch(e){case"compositionend":return ah(t);case"keypress":return t.which!==32?null:(th=!0,eh);case"textInput":return e=t.data,e===eh&&th?null:e;default:return null}}function Yv(e,t){if(Ks)return e==="compositionend"||!mc&&nh(e,t)?(e=Kf(),or=cc=_a=null,Ks=!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 Wf&&t.locale!=="ko"?null:t.data;default:return null}}var Vv={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 sh(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Vv[e.type]:t==="textarea"}function lh(e,t,n,s){Qs?Zs?Zs.push(s):Zs=[s]:Qs=s,t=mo(t,"onChange"),0<t.length&&(n=new dr("onChange","change",null,n,s),e.push({event:n,listeners:t}))}var Pl=null,Fl=null;function Xv(e){Qx(e,0)}function hr(e){var t=Vl(e);if(qf(t))return e}function ih(e,t){if(e==="change")return t}var rh=!1;if(xa){var xc;if(xa){var pc="oninput"in document;if(!pc){var oh=document.createElement("div");oh.setAttribute("oninput","return;"),pc=typeof oh.oninput=="function"}xc=pc}else xc=!1;rh=xc&&(!document.documentMode||9<document.documentMode)}function ch(){Pl&&(Pl.detachEvent("onpropertychange",uh),Fl=Pl=null)}function uh(e){if(e.propertyName==="value"&&hr(Fl)){var t=[];lh(t,Fl,e,ic(e)),Zf(Xv,t)}}function Qv(e,t,n){e==="focusin"?(ch(),Pl=t,Fl=n,Pl.attachEvent("onpropertychange",uh)):e==="focusout"&&ch()}function Zv(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return hr(Fl)}function Kv(e,t){if(e==="click")return hr(t)}function Jv(e,t){if(e==="input"||e==="change")return hr(t)}function Pv(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var hn=typeof Object.is=="function"?Object.is:Pv;function Il(e,t){if(hn(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var n=Object.keys(e),s=Object.keys(t);if(n.length!==s.length)return!1;for(s=0;s<n.length;s++){var i=n[s];if(!ot.call(t,i)||!hn(e[i],t[i]))return!1}return!0}function gc(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 dh(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function fh(e,t){var n=dh(e);e=0;for(var s;n;){if(n.nodeType===3){if(s=e+n.textContent.length,e<=t&&s>=t)return{node:n,offset:t-e};e=s}e:{for(;n;){if(n.nextSibling){n=n.nextSibling;break e}n=n.parentNode}n=void 0}n=dh(n)}}function hh(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?hh(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function mh(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=gc(e.document);t instanceof e.HTMLIFrameElement;){try{var n=typeof t.contentWindow.location.href=="string"}catch{n=!1}if(n)e=t.contentWindow;else break;t=gc(e.document)}return t}function yc(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 Fv=xa&&"documentMode"in document&&11>=document.documentMode,Js=null,vc=null,Wl=null,bc=!1;function xh(e,t,n){var s=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;bc||Js==null||Js!==gc(s)||(s=Js,"selectionStart"in s&&yc(s)?s={start:s.selectionStart,end:s.selectionEnd}:(s=(s.ownerDocument&&s.ownerDocument.defaultView||window).getSelection(),s={anchorNode:s.anchorNode,anchorOffset:s.anchorOffset,focusNode:s.focusNode,focusOffset:s.focusOffset}),Wl&&Il(Wl,s)||(Wl=s,s=mo(vc,"onSelect"),0<s.length&&(t=new dr("onSelect","select",null,t,n),e.push({event:t,listeners:s}),t.target=Js)))}function hs(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n["Webkit"+e]="webkit"+t,n["Moz"+e]="moz"+t,n}var Ps={animationend:hs("Animation","AnimationEnd"),animationiteration:hs("Animation","AnimationIteration"),animationstart:hs("Animation","AnimationStart"),transitionrun:hs("Transition","TransitionRun"),transitionstart:hs("Transition","TransitionStart"),transitioncancel:hs("Transition","TransitionCancel"),transitionend:hs("Transition","TransitionEnd")},jc={},ph={};xa&&(ph=document.createElement("div").style,"AnimationEvent"in window||(delete Ps.animationend.animation,delete Ps.animationiteration.animation,delete Ps.animationstart.animation),"TransitionEvent"in window||delete Ps.transitionend.transition);function ms(e){if(jc[e])return jc[e];if(!Ps[e])return e;var t=Ps[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in ph)return jc[e]=t[n];return e}var gh=ms("animationend"),yh=ms("animationiteration"),vh=ms("animationstart"),Iv=ms("transitionrun"),Wv=ms("transitionstart"),eb=ms("transitioncancel"),bh=ms("transitionend"),jh=new Map,Nc="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(" ");Nc.push("scrollEnd");function Ln(e,t){jh.set(e,t),fs(t,[e])}var tb=0;function pa(e,t){if(e.name!=null&&e.name!=="auto")return e.name;if(t.autoName!==null)return t.autoName;e=qn.identifierPrefix;var n=tb++;return e="_"+e+"t_"+n.toString(32)+"_",t.autoName=e}function Nh(e){if(e==null||typeof e=="string")return e;var t=null,n=pl;if(n!==null)for(var s=0;s<n.length;s++){var i=e[n[s]];if(i!=null){if(i==="none")return"none";t=t==null?i:t+(" "+i)}}return t??e.default}function ga(e,t){return e=Nh(e),t=Nh(t),t==null?e==="auto"?null:e:t==="auto"?null:t}var mr=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)},Sn=[],Fs=0,wc=0;function xr(){for(var e=Fs,t=wc=Fs=0;t<e;){var n=Sn[t];Sn[t++]=null;var s=Sn[t];Sn[t++]=null;var i=Sn[t];Sn[t++]=null;var r=Sn[t];if(Sn[t++]=null,s!==null&&i!==null){var f=s.pending;f===null?i.next=i:(i.next=f.next,f.next=i),s.pending=i}r!==0&&wh(n,i,r)}}function pr(e,t,n,s){Sn[Fs++]=e,Sn[Fs++]=t,Sn[Fs++]=n,Sn[Fs++]=s,wc|=s,e.lanes|=s,e=e.alternate,e!==null&&(e.lanes|=s)}function Sc(e,t,n,s){return pr(e,t,n,s),gr(e)}function xs(e,t){return pr(e,null,null,t),gr(e)}function wh(e,t,n){e.lanes|=n;var s=e.alternate;s!==null&&(s.lanes|=n);for(var i=!1,r=e.return;r!==null;)r.childLanes|=n,s=r.alternate,s!==null&&(s.childLanes|=n),r.tag===22&&(e=r.stateNode,e===null||e._visibility&1||(i=!0)),e=r,r=r.return;return e.tag===3?(r=e.stateNode,i&&t!==null&&(i=31-dn(n),e=r.hiddenUpdates,s=e[i],s===null?e[i]=[t]:s.push(t),t.lane=n|536870912),r):null}function gr(e){if(50<ji)throw ji=0,io=null,Error(u(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Is={};function nb(e,t,n,s){this.tag=e,this.key=n,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=s,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function Wt(e,t,n,s){return new nb(e,t,n,s)}function kc(e){return e=e.prototype,!(!e||!e.isReactComponent)}function ya(e,t){var n=e.alternate;return n===null?(n=Wt(e.tag,t,e.key,e.mode),n.elementType=e.elementType,n.type=e.type,n.stateNode=e.stateNode,n.alternate=e,e.alternate=n):(n.pendingProps=t,n.type=e.type,n.flags=0,n.subtreeFlags=0,n.deletions=null),n.flags=e.flags&1206910976,n.childLanes=e.childLanes,n.lanes=e.lanes,n.child=e.child,n.memoizedProps=e.memoizedProps,n.memoizedState=e.memoizedState,n.updateQueue=e.updateQueue,t=e.dependencies,n.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},n.sibling=e.sibling,n.index=e.index,n.ref=e.ref,n.refCleanup=e.refCleanup,n}function Sh(e,t){e.flags&=1206910978;var n=e.alternate;return n===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=n.childLanes,e.lanes=n.lanes,e.child=n.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=n.memoizedProps,e.memoizedState=n.memoizedState,e.updateQueue=n.updateQueue,e.type=n.type,t=n.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function yr(e,t,n,s,i,r){var f=0;if(s=e,typeof s=="function")kc(s)&&(f=1);else if(typeof s=="string")f=R0(e,n,Ut.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(s){case ke:return e=Wt(31,n,t,i),e.elementType=ke,e.lanes=r,e;case ae:return ps(n.children,i,r,t);case M:f=8,i|=24;break;case _:return e=Wt(12,n,t,i|2),e.elementType=_,e.lanes=r,e;case fe:return e=Wt(13,n,t,i),e.elementType=fe,e.lanes=r,e;case V:return e=Wt(19,n,t,i),e.elementType=V,e.lanes=r,e;case Ve:case R:return e=i|32,e=Wt(30,n,t,e),e.elementType=R,e.lanes=r,e.stateNode={autoName:null,paired:null,clones:null,ref:null},e;default:if(typeof s=="object"&&s!==null)switch(s.$$typeof){case F:f=10;break e;case se:f=9;break e;case ne:f=11;break e;case ce:f=14;break e;case Se:f=16,s=null;break e}f=29,n=Error(u(130,e===null?"null":typeof e,"")),s=null}return t=Wt(f,n,t,i),t.elementType=e,t.type=s,t.lanes=r,t}function ps(e,t,n,s){return e=Wt(7,e,s,t),e.lanes=n,e}function Tc(e,t,n){return e=Wt(6,e,null,t),e.lanes=n,e}function kh(e){var t=Wt(18,null,null,0);return t.stateNode=e,t}function Cc(e,t,n){return t=Wt(4,e.children!==null?e.children:[],e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Th=new WeakMap;function kn(e,t){if(typeof e=="object"&&e!==null){var n=Th.get(e);return n!==void 0?n:(t={value:e,source:t,stack:je(t)},Th.set(e,t),t)}return{value:e,source:t,stack:je(t)}}var Ws=[],el=0,vr=null,ei=0,Tn=[],Cn=0,Ma=null,Pn=1,Fn="";function va(e,t){Ws[el++]=ei,Ws[el++]=vr,vr=e,ei=t}function Ch(e,t,n){Tn[Cn++]=Pn,Tn[Cn++]=Fn,Tn[Cn++]=Ma,Ma=e;var s=Pn;e=Fn;var i=32-dn(s)-1;s&=~(1<<i),n+=1;var r=32-dn(t)+i;if(30<r){var f=i-i%5;r=(s&(1<<f)-1).toString(32),s>>=f,i-=f,Pn=1<<32-dn(t)+i|n<<i|s,Fn=r+e}else Pn=1<<r|n<<i|s,Fn=e}function br(e){e.return!==null&&(va(e,1),Ch(e,1,0))}function Ec(e){for(;e===vr;)vr=Ws[--el],Ws[el]=null,ei=Ws[--el],Ws[el]=null;for(;e===Ma;)Ma=Tn[--Cn],Tn[Cn]=null,Fn=Tn[--Cn],Tn[Cn]=null,Pn=Tn[--Cn],Tn[Cn]=null}function Eh(e,t){Tn[Cn++]=Pn,Tn[Cn++]=Fn,Tn[Cn++]=Ma,Pn=t.id,Fn=t.overflow,Ma=e}var Ct=null,tt=null,_e=!1,La=null,En=!1,zc=Error(u(519));function Ua(e){var t=Error(u(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw ti(kn(t,e)),zc}function zh(e){var t=e.stateNode,n=e.type,s=e.memoizedProps;switch(t[Rt]=e,t[It]=s,n){case"dialog":Me("cancel",t),Me("close",t);break;case"iframe":case"object":case"embed":Me("load",t);break;case"video":case"audio":for(n=0;n<wi.length;n++)Me(wi[n],t);break;case"source":Me("error",t);break;case"img":case"image":case"link":Me("error",t),Me("load",t);break;case"details":Me("toggle",t);break;case"input":Me("invalid",t),$f(t,s.value,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name,!0);break;case"select":Me("invalid",t);break;case"textarea":Me("invalid",t),Yf(t,s.value,s.defaultValue,s.children)}n=s.children,typeof n!="string"&&typeof n!="number"&&typeof n!="bigint"||t.textContent===""+n||s.suppressHydrationWarning===!0||Px(t.textContent,n)?(s.popover!=null&&(Me("beforetoggle",t),Me("toggle",t)),s.onScroll!=null&&Me("scroll",t),s.onScrollEnd!=null&&Me("scrollend",t),s.onClick!=null&&(t.onclick=Jn),t=!0):t=!1,t||Ua(e,!0)}function jr(e){for(Ct=e.return;Ct;)switch(Ct.tag){case 5:case 31:case 13:En=!1;return;case 27:case 3:En=!0;return;default:Ct=Ct.return}}function tl(e){if(e!==Ct)return!1;if(!_e)return jr(e),_e=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=!(n!=="form"&&n!=="button")||ld(e.type,e.memoizedProps)),n=!n),n&&tt&&Ua(e),jr(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));tt=xp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(317));tt=xp(e)}else t===27?(t=tt,Wa(e.type)?(e=md,md=null,tt=e):tt=t):tt=Ct?Rn(e.stateNode.nextSibling):null;return!0}function gs(){tt=Ct=null,_e=!1}function Rc(){var e=La;return e!==null&&(nn===null?nn=e:nn.push.apply(nn,e),La=null),e}function ti(e){La===null?La=[e]:La.push(e)}var Ac=Gt(null),ys=null,ba=null;function Ha(e,t,n){Ue(Ac,t._currentValue),t._currentValue=n}function ja(e){e._currentValue=Ac.current,rt(Ac)}function Nr(e,t,n){for(;e!==null;){var s=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,s!==null&&(s.childLanes|=t)):s!==null&&(s.childLanes&t)!==t&&(s.childLanes|=t),e===n)break;e=e.return}}function Dc(e,t,n,s){var i=e.child;for(i!==null&&(i.return=e);i!==null;){var r=i.dependencies;if(r!==null){var f=i.child;r=r.firstContext;e:for(;r!==null;){var v=r;r=i;for(var w=0;w<t.length;w++)if(v.context===t[w]){r.lanes|=n,v=r.alternate,v!==null&&(v.lanes|=n),Nr(r.return,n,e),s||(f=null);break e}r=v.next}}else if(i.tag===18){if(f=i.return,f===null)throw Error(u(341));f.lanes|=n,r=f.alternate,r!==null&&(r.lanes|=n),Nr(f,n,e),f=null}else i.tag===13&&i.memoizedState!==null&&i.memoizedState.dehydrated===null?(i.lanes|=n,f=i.alternate,f!==null&&(f.lanes|=n),Nr(i.return,n,e),f=i.child,f=f!==null?f.sibling:null):f=i.child;if(f!==null)f.return=i;else for(f=i;f!==null;){if(f===e){f=null;break}if(i=f.sibling,i!==null){i.return=f.return,f=i;break}f=f.return}i=f}}function vs(e,t,n,s){e=null;for(var i=t,r=!1;i!==null;){if(!r){if((i.flags&524288)!==0)r=!0;else if((i.flags&262144)!==0)break}if(i.tag===10){var f=i.alternate;if(f===null)throw Error(u(387));if(f=f.memoizedProps,f!==null){var v=i.type;hn(i.pendingProps.value,f.value)||(e!==null?e.push(v):e=[v])}}else if(i===fa.current){if(f=i.alternate,f===null)throw Error(u(387));f.memoizedState.memoizedState!==i.memoizedState.memoizedState&&(e!==null?e.push(Tl):e=[Tl])}i=i.return}return e!==null&&Dc(t,e,n,s),t.flags|=262144,e!==null}function wr(e){for(e=e.firstContext;e!==null;){if(!hn(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function bs(e){ys=e,ba=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function At(e){return Rh(ys,e)}function Sr(e,t){return ys===null&&bs(e),Rh(e,t)}function Rh(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},ba===null){if(e===null)throw Error(u(308));ba=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else ba=ba.next=t;return n}var ab=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(n,s){e.push(s)}};this.abort=function(){t.aborted=!0,e.forEach(function(n){return n()})}},sb=l.unstable_scheduleCallback,lb=l.unstable_NormalPriority,pt={$$typeof:F,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function _c(){return{controller:new ab,data:new Map,refCount:0}}function ni(e){e.refCount--,e.refCount===0&&sb(lb,function(){e.controller.abort()})}function Ah(e,t){if((e.pendingLanes&4194048)!==0){var n=e.transitionTypes;for(n===null&&(n=e.transitionTypes=[]),e=0;e<t.length;e++){var s=t[e];n.indexOf(s)===-1&&n.push(s)}}}var ai=null;function ib(e){var t=e.transitionTypes;return e.transitionTypes=null,t}var si=null,Oc=0,js=0,nl=null;function rb(e,t){if(si===null){var n=si=[];Oc=0,js=Pu(),nl={status:"pending",value:void 0,then:function(s){n.push(s)}}}return Oc++,t.then(Dh,Dh),t}function Dh(){if(--Oc===0&&(ai=null,si!==null)){nl!==null&&(nl.status="fulfilled");var e=si;si=null,js=0,nl=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ob(e,t){var n=[],s={status:"pending",value:null,reason:null,then:function(i){n.push(i)}};return e.then(function(){s.status="fulfilled",s.value=t;for(var i=0;i<n.length;i++)(0,n[i])(t)},function(i){for(s.status="rejected",s.reason=i,i=0;i<n.length;i++)(0,n[i])(void 0)}),s}var _h=he.S;he.S=function(e,t){if(kx=cn(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&rb(e,t),ai!==null)for(var n=bl;n!==null;)Ah(n,ai),n=n.next;if(n=e.types,n!==null){for(var s=bl;s!==null;)Ah(s,n),s=s.next;if(js!==0){s=ai,s===null&&(s=ai=[]);for(var i=0;i<n.length;i++){var r=n[i];s.indexOf(r)===-1&&s.push(r)}}}_h!==null&&_h(e,t)};var Ns=Gt(null);function Mc(){var e=Ns.current;return e!==null?e:et.pooledCache}function kr(e,t){t===null?Ue(Ns,Ns.current):Ue(Ns,t.pool)}function Oh(){var e=Mc();return e===null?null:{parent:pt._currentValue,pool:e}}var al=Error(u(460)),Lc=Error(u(474)),Tr=Error(u(542)),Cr={then:function(){}};function Mh(e){return e=e.status,e==="fulfilled"||e==="rejected"}function Lh(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(Jn,Jn),t=n),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hh(e),e===void 0&&!("reason"in t)?Error(u(600)):e;default:if(typeof t.status=="string")t.then(Jn,Jn);else{if(e=et,e!==null&&100<e.shellSuspendCounter)throw Error(u(482));e=t,e.status="pending",e.then(function(s){if(t.status==="pending"){var i=t;i.status="fulfilled",i.value=s}},function(s){if(t.status==="pending"){var i=t;i.status="rejected",i.reason=s}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,Hh(e),e}throw Ss=t,al}}function ws(e){try{var t=e._init;return t(e._payload)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(Ss=n,al):n}}var Ss=null;function Uh(){if(Ss===null)throw Error(u(459));var e=Ss;return Ss=null,e}function Hh(e){if(e===al||e===Tr)throw Error(u(483))}var sl=null,li=0;function Er(e){var t=li;return li+=1,sl===null&&(sl=[]),Lh(sl,e,t)}function Ba(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function zr(e,t){throw t.$$typeof===Q?Error(u(525)):(e=Object.prototype.toString.call(t),Error(u(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function Bh(e){function t(H,A){if(e){var q=H.deletions;q===null?(H.deletions=[A],H.flags|=16):q.push(A)}}function n(H,A){if(!e)return null;for(;A!==null;)t(H,A),A=A.sibling;return null}function s(H){for(var A=new Map;H!==null;)H.key===null?A.set(H.index,H):A.set(H.key,H),H=H.sibling;return A}function i(H,A){return H=ya(H,A),H.index=0,H.sibling=null,H}function r(H,A,q){return H.index=q,e?(q=H.alternate,q!==null?(q=q.index,q<A?(H.flags|=2,A):q):(H.flags|=134217730,A)):(H.flags|=1048576,A)}function f(H){return e&&H.alternate===null&&(H.flags|=134217730),H}function v(H,A,q,Z){return A===null||A.tag!==6?(A=Tc(q,H.mode,Z),A.return=H,A):(A=i(A,q),A.return=H,A)}function w(H,A,q,Z){var me=q.type;return me===ae?(H=G(H,A,q.props.children,Z,q.key),Ba(H,q),H):A!==null&&(A.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===Se&&ws(me)===A.type)?(A=i(A,q.props),Ba(A,q),A.return=H,A):(A=yr(q.type,q.key,q.props,null,H.mode,Z),Ba(A,q),A.return=H,A)}function B(H,A,q,Z){return A===null||A.tag!==4||A.stateNode.containerInfo!==q.containerInfo||A.stateNode.implementation!==q.implementation?(A=Cc(q,H.mode,Z),A.return=H,A):(A=i(A,q.children||[]),A.return=H,A)}function G(H,A,q,Z,me){return A===null||A.tag!==7?(A=ps(q,H.mode,Z,me),A.return=H,A):(A=i(A,q),A.return=H,A)}function P(H,A,q){if(typeof A=="string"&&A!==""||typeof A=="number"||typeof A=="bigint")return A=Tc(""+A,H.mode,q),A.return=H,A;if(typeof A=="object"&&A!==null){switch(A.$$typeof){case re:return q=yr(A.type,A.key,A.props,null,H.mode,q),Ba(q,A),q.return=H,q;case K:return A=Cc(A,H.mode,q),A.return=H,A;case Se:return A=ws(A),P(H,A,q)}if(De(A)||ee(A))return A=ps(A,H.mode,q,null),A.return=H,A;if(typeof A.then=="function")return P(H,Er(A),q);if(A.$$typeof===F)return P(H,Sr(H,A),q);zr(H,A)}return null}function O(H,A,q,Z){var me=A!==null?A.key:null;if(typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint")return me!==null?null:v(H,A,""+q,Z);if(typeof q=="object"&&q!==null){switch(q.$$typeof){case re:return q.key===me?w(H,A,q,Z):null;case K:return q.key===me?B(H,A,q,Z):null;case Se:return q=ws(q),O(H,A,q,Z)}if(De(q)||ee(q))return me!==null?null:G(H,A,q,Z,null);if(typeof q.then=="function")return O(H,A,Er(q),Z);if(q.$$typeof===F)return O(H,A,Sr(H,q),Z);zr(H,q)}return null}function $(H,A,q,Z,me){if(typeof Z=="string"&&Z!==""||typeof Z=="number"||typeof Z=="bigint")return H=H.get(q)||null,v(A,H,""+Z,me);if(typeof Z=="object"&&Z!==null){switch(Z.$$typeof){case re:return H=H.get(Z.key===null?q:Z.key)||null,w(A,H,Z,me);case K:return H=H.get(Z.key===null?q:Z.key)||null,B(A,H,Z,me);case Se:return Z=ws(Z),$(H,A,q,Z,me)}if(De(Z)||ee(Z))return H=H.get(q)||null,G(A,H,Z,me,null);if(typeof Z.then=="function")return $(H,A,q,Er(Z),me);if(Z.$$typeof===F)return $(H,A,q,Sr(A,Z),me);zr(A,Z)}return null}function oe(H,A,q,Z){for(var me=null,Be=null,ve=A,we=A=0,vt=null;ve!==null&&we<q.length;we++){ve.index>we?(vt=ve,ve=null):vt=ve.sibling;var qe=O(H,ve,q[we],Z);if(qe===null){ve===null&&(ve=vt);break}e&&ve&&qe.alternate===null&&t(H,ve),A=r(qe,A,we),Be===null?me=qe:Be.sibling=qe,Be=qe,ve=vt}if(we===q.length)return n(H,ve),_e&&va(H,we),me;if(ve===null){for(;we<q.length;we++)ve=P(H,q[we],Z),ve!==null&&(A=r(ve,A,we),Be===null?me=ve:Be.sibling=ve,Be=ve);return _e&&va(H,we),me}for(ve=s(ve);we<q.length;we++)vt=$(ve,H,we,q[we],Z),vt!==null&&(e&&(qe=vt.alternate,qe!==null&&ve.delete(qe.key===null?we:qe.key)),A=r(vt,A,we),Be===null?me=vt:Be.sibling=vt,Be=vt);return e&&ve.forEach(function(ss){return t(H,ss)}),_e&&va(H,we),me}function xe(H,A,q,Z){if(q==null)throw Error(u(151));for(var me=null,Be=null,ve=A,we=A=0,vt=null,qe=q.next();ve!==null&&!qe.done;we++,qe=q.next()){ve.index>we?(vt=ve,ve=null):vt=ve.sibling;var ss=O(H,ve,qe.value,Z);if(ss===null){ve===null&&(ve=vt);break}e&&ve&&ss.alternate===null&&t(H,ve),A=r(ss,A,we),Be===null?me=ss:Be.sibling=ss,Be=ss,ve=vt}if(qe.done)return n(H,ve),_e&&va(H,we),me;if(ve===null){for(;!qe.done;we++,qe=q.next())qe=P(H,qe.value,Z),qe!==null&&(A=r(qe,A,we),Be===null?me=qe:Be.sibling=qe,Be=qe);return _e&&va(H,we),me}for(ve=s(ve);!qe.done;we++,qe=q.next())qe=$(ve,H,we,qe.value,Z),qe!==null&&(e&&(vt=qe.alternate,vt!==null&&ve.delete(vt.key===null?we:vt.key)),A=r(qe,A,we),Be===null?me=qe:Be.sibling=qe,Be=qe);return e&&ve.forEach(function(G0){return t(H,G0)}),_e&&va(H,we),me}function Re(H,A,q,Z){if(typeof q=="object"&&q!==null&&q.type===ae&&q.key===null&&q.props.ref===void 0&&(q=q.props.children),typeof q=="object"&&q!==null){switch(q.$$typeof){case re:e:{for(var me=q.key;A!==null;){if(A.key===me){if(me=q.type,me===ae){if(A.tag===7){n(H,A.sibling),Z=i(A,q.props.children),Ba(Z,q),Z.return=H,H=Z;break e}}else if(A.elementType===me||typeof me=="object"&&me!==null&&me.$$typeof===Se&&ws(me)===A.type){n(H,A.sibling),Z=i(A,q.props),Ba(Z,q),Z.return=H,H=Z;break e}n(H,A);break}else t(H,A);A=A.sibling}q.type===ae?(Z=ps(q.props.children,H.mode,Z,q.key),Ba(Z,q),Z.return=H,H=Z):(Z=yr(q.type,q.key,q.props,null,H.mode,Z),Ba(Z,q),Z.return=H,H=Z)}return f(H);case K:e:{for(me=q.key;A!==null;){if(A.key===me)if(A.tag===4&&A.stateNode.containerInfo===q.containerInfo&&A.stateNode.implementation===q.implementation){n(H,A.sibling),Z=i(A,q.children||[]),Z.return=H,H=Z;break e}else{n(H,A);break}else t(H,A);A=A.sibling}Z=Cc(q,H.mode,Z),Z.return=H,H=Z}return f(H);case Se:return q=ws(q),Re(H,A,q,Z)}if(De(q))return oe(H,A,q,Z);if(ee(q)){if(me=ee(q),typeof me!="function")throw Error(u(150));return q=me.call(q),xe(H,A,q,Z)}if(typeof q.then=="function")return Re(H,A,Er(q),Z);if(q.$$typeof===F)return Re(H,A,Sr(H,q),Z);zr(H,q)}return typeof q=="string"&&q!==""||typeof q=="number"||typeof q=="bigint"?(q=""+q,A!==null&&A.tag===6?(n(H,A.sibling),Z=i(A,q),Z.return=H,H=Z):(n(H,A),Z=Tc(q,H.mode,Z),Z.return=H,H=Z),f(H)):n(H,A)}return function(H,A,q,Z){try{li=0;var me=Re(H,A,q,Z);return sl=null,me}catch(ve){if(ve===al||ve===Tr)throw ve;var Be=Wt(29,ve,null,H.mode);return Be.lanes=Z,Be.return=H,Be}finally{}}}var ks=Bh(!0),qh=Bh(!1),qa=!1;function Uc(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Hc(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 $a(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Ga(e,t,n){var s=e.updateQueue;if(s===null)return null;if(s=s.shared,(Xe&2)!==0){var i=s.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),s.pending=t,t=gr(e),wh(e,null,n),t}return pr(e,s,t,n),gr(e)}function ii(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,(n&4194048)!==0)){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Cf(e,n)}}function Bc(e,t){var n=e.updateQueue,s=e.alternate;if(s!==null&&(s=s.updateQueue,n===s)){var i=null,r=null;if(n=n.firstBaseUpdate,n!==null){do{var f={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};r===null?i=r=f:r=r.next=f,n=n.next}while(n!==null);r===null?i=r=t:r=r.next=t}else i=r=t;n={baseState:s.baseState,firstBaseUpdate:i,lastBaseUpdate:r,shared:s.shared,callbacks:s.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qc=!1;function ri(){if(qc){var e=nl;if(e!==null)throw e}}function oi(e,t,n,s){qc=!1;var i=e.updateQueue;qa=!1;var r=i.firstBaseUpdate,f=i.lastBaseUpdate,v=i.shared.pending;if(v!==null){i.shared.pending=null;var w=v,B=w.next;w.next=null,f===null?r=B:f.next=B,f=w;var G=e.alternate;G!==null&&(G=G.updateQueue,v=G.lastBaseUpdate,v!==f&&(v===null?G.firstBaseUpdate=B:v.next=B,G.lastBaseUpdate=w))}if(r!==null){var P=i.baseState;f=0,G=B=w=null,v=r;do{var O=v.lane&-536870913,$=O!==v.lane;if($?(He&O)===O:(s&O)===O){O!==0&&O===js&&(qc=!0),G!==null&&(G=G.next={lane:0,tag:v.tag,payload:v.payload,callback:null,next:null});e:{var oe=e,xe=v;O=t;var Re=n;switch(xe.tag){case 1:if(oe=xe.payload,typeof oe=="function"){P=oe.call(Re,P,O);break e}P=oe;break e;case 3:oe.flags=oe.flags&-65537|128;case 0:if(oe=xe.payload,O=typeof oe=="function"?oe.call(Re,P,O):oe,O==null)break e;P=L({},P,O);break e;case 2:qa=!0}}O=v.callback,O!==null&&(e.flags|=64,$&&(e.flags|=8192),$=i.callbacks,$===null?i.callbacks=[O]:$.push(O))}else $={lane:O,tag:v.tag,payload:v.payload,callback:v.callback,next:null},G===null?(B=G=$,w=P):G=G.next=$,f|=O;if(v=v.next,v===null){if(v=i.shared.pending,v===null)break;$=v,v=$.next,$.next=null,i.lastBaseUpdate=$,i.shared.pending=null}}while(!0);G===null&&(w=P),i.baseState=w,i.firstBaseUpdate=B,i.lastBaseUpdate=G,r===null&&(i.shared.lanes=0),Ja|=f,e.lanes=f,e.memoizedState=P}}function $h(e,t){if(typeof e!="function")throw Error(u(191,e));e.call(t)}function Gh(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)$h(n[e],t)}var Ya=Gt(null),Rr=Gt(0);function Yh(e,t){e=Ta,Ue(Rr,e),Ue(Ya,t),Ta=e|t.baseLanes}function $c(){Ue(Rr,Ta),Ue(Ya,Ya.current)}function Gc(){Ta=Rr.current,rt(Ya),rt(Rr)}var Dt=Gt(null),Bt=null;function Va(e){var t=e.alternate;Ue(_t,_t.current&1),Ue(Dt,e),Bt===null&&(t===null||Ya.current!==null||t.memoizedState!==null)&&(Bt=e)}function Yc(e){Ue(_t,_t.current),Ue(Dt,e),Bt===null&&(Bt=e)}function Vh(e){e.tag===22?(Ue(_t,_t.current),Ue(Dt,e),Bt===null&&(Bt=e)):Xa()}function Xa(){Ue(_t,_t.current),Ue(Dt,Dt.current)}function mn(e){rt(Dt),Bt===e&&(Bt=null),rt(_t)}var _t=Gt(0);function ci(e,t){Ue(Dt,Dt.current),Ue(_t,t)}function Vc(e){rt(_t),rt(Dt),Bt===e&&(Bt=null)}function Ar(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||fd(n)||hd(n)))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 Na=0,ze=null,Ie=null,gt=null,Dr=!1,ll=!1,Ts=!1,_r=0,ui=0,il=null,cb=0;function ut(){throw Error(u(321))}function Xc(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!hn(e[n],t[n]))return!1;return!0}function Qc(e,t,n,s,i,r){return Na=r,ze=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,he.H=e===null||e.memoizedState===null?Cm:Em,Ts=!1,r=n(s,i),Ts=!1,ll&&(r=Qh(t,n,s,i)),Xh(e),r}function Xh(e){he.H=qr;var t=Ie!==null&&Ie.next!==null;if(Na=0,gt=Ie=ze=null,Dr=!1,ui=0,il=null,t)throw Error(u(300));e===null||yt||(e=e.dependencies,e!==null&&wr(e)&&(yt=!0))}function Qh(e,t,n,s){ze=e;var i=0;do{if(ll&&(il=null),ui=0,ll=!1,25<=i)throw Error(u(301));if(i+=1,gt=Ie=null,e.updateQueue!=null){var r=e.updateQueue;r.lastEffect=null,r.events=null,r.stores=null,r.memoCache!=null&&(r.memoCache.index=0)}he.H=gb,r=t(n,s)}while(ll);return r}function ub(){var e=he.H,t=e.useState()[0];return t=typeof t.then=="function"?di(t):t,e=e.useState()[0],(Ie!==null?Ie.memoizedState:null)!==e&&(ze.flags|=1024),t}function Zc(){var e=_r!==0;return _r=0,e}function Kc(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function Jc(e){if(Dr){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Dr=!1}Na=0,gt=Ie=ze=null,ll=!1,ui=_r=0,il=null}function Vt(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return gt===null?ze.memoizedState=gt=e:gt=gt.next=e,gt}function ht(){if(Ie===null){var e=ze.alternate;e=e!==null?e.memoizedState:null}else e=Ie.next;var t=gt===null?ze.memoizedState:gt.next;if(t!==null)gt=t,Ie=e;else{if(e===null)throw ze.alternate===null?Error(u(467)):Error(u(310));Ie=e,e={memoizedState:Ie.memoizedState,baseState:Ie.baseState,baseQueue:Ie.baseQueue,queue:Ie.queue,next:null},gt===null?ze.memoizedState=gt=e:gt=gt.next=e}return gt}function Or(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function di(e){var t=ui;return ui+=1,il===null&&(il=[]),e=Lh(il,e,t),t=ze,(gt===null?t.memoizedState:gt.next)===null&&(t=t.alternate,he.H=t===null||t.memoizedState===null?Cm:Em),e}function Mr(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return di(e);if(e.$$typeof===I)return;if(e.$$typeof===F)return At(e)}throw Error(u(438,String(e)))}function Pc(e){var t=null,n=ze.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var s=ze.alternate;s!==null&&(s=s.updateQueue,s!==null&&(s=s.memoCache,s!=null&&(t={data:s.data.map(function(i){return i.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),n===null&&(n=Or(),ze.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),s=0;s<e;s++)n[s]=$e;return t.index++,n}function wa(e,t){return typeof t=="function"?t(e):t}function Lr(e){var t=ht();return Fc(t,Ie,e)}function Fc(e,t,n){var s=e.queue;if(s===null)throw Error(u(311));s.lastRenderedReducer=n;var i=e.baseQueue,r=s.pending;if(r!==null){if(i!==null){var f=i.next;i.next=r.next,r.next=f}t.baseQueue=i=r,s.pending=null}if(r=e.baseState,i===null)e.memoizedState=r;else{t=i.next;var v=f=null,w=null,B=t,G=!1;do{var P=B.lane&-536870913;if(P!==B.lane?(He&P)===P:(Na&P)===P){var O=B.revertLane;if(O===0)w!==null&&(w=w.next={lane:0,revertLane:0,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null}),P===js&&(G=!0);else if((Na&O)===O){B=B.next,O===js&&(G=!0);continue}else P={lane:0,revertLane:B.revertLane,gesture:null,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},w===null?(v=w=P,f=r):w=w.next=P,ze.lanes|=O,Ja|=O;P=B.action,Ts&&n(r,P),r=B.hasEagerState?B.eagerState:n(r,P)}else O={lane:P,revertLane:B.revertLane,gesture:B.gesture,action:B.action,hasEagerState:B.hasEagerState,eagerState:B.eagerState,next:null},w===null?(v=w=O,f=r):w=w.next=O,ze.lanes|=P,Ja|=P;B=B.next}while(B!==null&&B!==t);if(w===null?f=r:w.next=v,!hn(r,e.memoizedState)&&(yt=!0,G&&(n=nl,n!==null)))throw n;e.memoizedState=r,e.baseState=f,e.baseQueue=w,s.lastRenderedState=r}return i===null&&(s.lanes=0),[e.memoizedState,s.dispatch]}function Ic(e){var t=ht(),n=t.queue;if(n===null)throw Error(u(311));n.lastRenderedReducer=e;var s=n.dispatch,i=n.pending,r=t.memoizedState;if(i!==null){n.pending=null;var f=i=i.next;do r=e(r,f.action),f=f.next;while(f!==i);hn(r,t.memoizedState)||(yt=!0),t.memoizedState=r,t.baseQueue===null&&(t.baseState=r),n.lastRenderedState=r}return[r,s]}function Zh(e,t,n){var s=ze,i=ht(),r=_e;if(r){if(n===void 0)throw Error(u(407));n=n()}else n=t();var f=!hn((Ie||i).memoizedState,n);if(f&&(i.memoizedState=n,yt=!0),i=i.queue,tu(Ph.bind(null,s,i,e),[e]),e=i.getSnapshot!==t||f||gt!==null&&(gt.memoizedState.tag&1)!==0,rl(e?9:8,{destroy:void 0},Jh.bind(null,s,i,n,t),null),e){if(s.flags|=2048,et===null)throw Error(u(349));r||(Na&127)!==0||Kh(s,t,n)}return n}function Kh(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=ze.updateQueue,t===null?(t=Or(),ze.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Jh(e,t,n,s){t.value=n,t.getSnapshot=s,Fh(t)&&Ih(e)}function Ph(e,t,n){return n(function(){Fh(t)&&Ih(e)})}function Fh(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!hn(e,n)}catch{return!0}}function Ih(e){var t=xs(e,2);t!==null&&an(t,e,2)}function Wc(e){var t=Vt();if(typeof e=="function"){var n=e;if(e=n(),Ts){Da(!0);try{n()}finally{Da(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:e},t}function Wh(e,t,n,s){return e.baseState=n,Fc(e,Ie,typeof s=="function"?s:wa)}function db(e,t,n,s,i){if(Br(e))throw Error(u(485));if(e=t.action,e!==null){var r={payload:i,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(f){r.listeners.push(f)}};he.T!==null?n(!0):r.isTransition=!1,s(r),n=t.pending,n===null?(r.next=t.pending=r,em(t,r)):(r.next=n.next,t.pending=n.next=r)}}function em(e,t){var n=t.action,s=t.payload,i=e.state;if(t.isTransition){var r=he.T,f={};f.types=r!==null?r.types:null,he.T=f;try{var v=n(i,s),w=he.S;w!==null&&w(f,v),tm(e,t,v)}catch(B){eu(e,t,B)}finally{r!==null&&f.types!==null&&(r.types=f.types),he.T=r}}else try{r=n(i,s),tm(e,t,r)}catch(B){eu(e,t,B)}}function tm(e,t,n){n!==null&&typeof n=="object"&&typeof n.then=="function"?n.then(function(s){nm(e,t,s)},function(s){return eu(e,t,s)}):nm(e,t,n)}function nm(e,t,n){t.status="fulfilled",t.value=n,am(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,em(e,n)))}function eu(e,t,n){var s=e.pending;if(e.pending=null,s!==null){s=s.next;do t.status="rejected",t.reason=n,am(t),t=t.next;while(t!==s)}e.action=null}function am(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function sm(e,t){return t}function lm(e,t){if(_e){var n=et.formState;if(n!==null){e:{var s=ze;if(_e){if(tt){t:{for(var i=tt,r=En;i.nodeType!==8;){if(!r){i=null;break t}if(i=Rn(i.nextSibling),i===null){i=null;break t}}r=i.data,i=r==="F!"||r==="F"?i:null}if(i){tt=Rn(i.nextSibling),s=i.data==="F!";break e}}Ua(s)}s=!1}s&&(t=n[0])}}return n=Vt(),n.memoizedState=n.baseState=t,s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:sm,lastRenderedState:t},n.queue=s,n=Sm.bind(null,ze,s),s.dispatch=n,s=Wc(!1),r=iu.bind(null,ze,!1,s.queue),s=Vt(),i={state:t,dispatch:null,action:e,pending:null},s.queue=i,n=db.bind(null,ze,i,r,n),i.dispatch=n,s.memoizedState=e,[t,n,!1]}function im(e){var t=ht();return rm(t,Ie,e)}function rm(e,t,n){if(t=Fc(e,t,sm)[0],e=Lr(wa)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var s=di(t)}catch(f){throw f===al?Tr:f}else s=t;t=ht();var i=t.queue,r=i.dispatch;return n!==t.memoizedState&&(ze.flags|=2048,rl(9,{destroy:void 0},fb.bind(null,i,n),null)),[s,r,e]}function fb(e,t){e.action=t}function om(e){var t=ht(),n=Ie;if(n!==null)return rm(t,n,e);ht(),t=t.memoizedState,n=ht();var s=n.queue.dispatch;return n.memoizedState=e,[t,s,!1]}function rl(e,t,n,s){return e={tag:e,create:n,deps:s,inst:t,next:null},t=ze.updateQueue,t===null&&(t=Or(),ze.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(s=n.next,n.next=e,e.next=s,t.lastEffect=e),e}function cm(){return ht().memoizedState}function Ur(e,t,n,s){var i=Vt();ze.flags|=e,i.memoizedState=rl(1|t,{destroy:void 0},n,s===void 0?null:s)}function Hr(e,t,n,s){var i=ht();s=s===void 0?null:s;var r=i.memoizedState.inst;Ie!==null&&s!==null&&Xc(s,Ie.memoizedState.deps)?i.memoizedState=rl(t,r,n,s):(ze.flags|=e,i.memoizedState=rl(1|t,r,n,s))}function um(e,t){Ur(8390656,8,e,t)}function tu(e,t){Hr(2048,8,e,t)}function hb(e){ze.flags|=4;var t=ze.updateQueue;if(t===null)t=Or(),ze.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function dm(e){var t=ht().memoizedState;return hb({ref:t,nextImpl:e}),function(){if((Xe&2)!==0)throw Error(u(440));return t.impl.apply(void 0,arguments)}}function fm(e,t){return Hr(4,2,e,t)}function hm(e,t){return Hr(4,4,e,t)}function mm(e,t){if(typeof t=="function"){e=e();var n=t(e);return function(){typeof n=="function"?n():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function xm(e,t,n){n=n!=null?n.concat([e]):null,Hr(4,4,mm.bind(null,t,e),n)}function nu(){}function pm(e,t){var n=ht();t=t===void 0?null:t;var s=n.memoizedState;return t!==null&&Xc(t,s[1])?s[0]:(n.memoizedState=[e,t],e)}function gm(e,t){var n=ht();t=t===void 0?null:t;var s=n.memoizedState;if(t!==null&&Xc(t,s[1]))return s[0];if(s=e(),Ts){Da(!0);try{e()}finally{Da(!1)}}return n.memoizedState=[s,t],s}function au(e,t,n){return n===void 0||(Na&1073741824)!==0&&(He&261930)===0?e.memoizedState=t:(e.memoizedState=n,e=Cx(),ze.lanes|=e,Ja|=e,n)}function ym(e,t,n,s){return hn(n,t)?n:Ya.current!==null?(e=au(e,n,s),hn(e,t)||(yt=!0),e):(Na&106)===0||(Na&1073741824)!==0&&(He&261930)===0?(yt=!0,e.memoizedState=n):(e=Cx(),ze.lanes|=e,Ja|=e,t)}function vm(e,t,n,s,i){var r=be.p;be.p=r!==0&&8>r?r:8;var f=he.T,v={};v.types=f!==null?f.types:null,he.T=v,iu(e,!1,t,n);try{var w=i(),B=he.S;if(B!==null&&B(v,w),w!==null&&typeof w=="object"&&typeof w.then=="function"){var G=ob(w,s);fi(e,t,G,yn(e))}else fi(e,t,s,yn(e))}catch(P){fi(e,t,{then:function(){},status:"rejected",reason:P},yn())}finally{be.p=r,f!==null&&v.types!==null&&(f.types=v.types),he.T=f}}function mb(){}function su(e,t,n,s){if(e.tag!==5)throw Error(u(476));var i=bm(e).queue;vm(e,i,t,$t,n===null?mb:function(){return jm(e),n(s)})}function bm(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:$t,baseState:$t,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:$t},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:wa,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function jm(e){var t=bm(e);t.next===null&&(t=e.alternate.memoizedState),fi(e,t.next.queue,{},yn())}function lu(){return At(Tl)}function Nm(){return ht().memoizedState}function wm(){return ht().memoizedState}function xb(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=yn();e=$a(n);var s=Ga(t,e,n);s!==null&&(an(s,t,n),ii(s,t,n)),t={cache:_c()},e.payload=t;return}t=t.return}}function pb(e,t,n){var s=yn();n={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Br(e)?km(t,n):(n=Sc(e,t,n,s),n!==null&&(an(n,e,s),Tm(n,t,s)))}function Sm(e,t,n){var s=yn();fi(e,t,n,s)}function fi(e,t,n,s){var i={lane:s,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Br(e))km(t,i);else{var r=e.alternate;if(e.lanes===0&&(r===null||r.lanes===0)&&(r=t.lastRenderedReducer,r!==null))try{var f=t.lastRenderedState,v=r(f,n);if(i.hasEagerState=!0,i.eagerState=v,hn(v,f))return pr(e,t,i,0),et===null&&xr(),!1}catch{}finally{}if(n=Sc(e,t,i,s),n!==null)return an(n,e,s),Tm(n,t,s),!0}return!1}function iu(e,t,n,s){if(s={lane:2,revertLane:Pu(),gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},Br(e)){if(t)throw Error(u(479))}else t=Sc(e,n,s,2),t!==null&&an(t,e,2)}function Br(e){var t=e.alternate;return e===ze||t!==null&&t===ze}function km(e,t){ll=Dr=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Tm(e,t,n){if((n&4194048)!==0){var s=t.lanes;s&=e.pendingLanes,n|=s,t.lanes=n,Cf(e,n)}}var qr={readContext:At,use:Mr,useCallback:ut,useContext:ut,useEffect:ut,useImperativeHandle:ut,useLayoutEffect:ut,useInsertionEffect:ut,useMemo:ut,useReducer:ut,useRef:ut,useState:ut,useDebugValue:ut,useDeferredValue:ut,useTransition:ut,useSyncExternalStore:ut,useId:ut,useHostTransitionStatus:ut,useFormState:ut,useActionState:ut,useOptimistic:ut,useMemoCache:ut,useCacheRefresh:ut,useEffectEvent:ut},Cm={readContext:At,use:Mr,useCallback:function(e,t){return Vt().memoizedState=[e,t===void 0?null:t],e},useContext:At,useEffect:um,useImperativeHandle:function(e,t,n){n=n!=null?n.concat([e]):null,Ur(4194308,4,mm.bind(null,t,e),n)},useLayoutEffect:function(e,t){return Ur(4194308,4,e,t)},useInsertionEffect:function(e,t){Ur(4,2,e,t)},useMemo:function(e,t){var n=Vt();t=t===void 0?null:t;var s=e();if(Ts){Da(!0);try{e()}finally{Da(!1)}}return n.memoizedState=[s,t],s},useReducer:function(e,t,n){var s=Vt();if(n!==void 0){var i=n(t);if(Ts){Da(!0);try{n(t)}finally{Da(!1)}}}else i=t;return s.memoizedState=s.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},s.queue=e,e=e.dispatch=pb.bind(null,ze,e),[s.memoizedState,e]},useRef:function(e){var t=Vt();return e={current:e},t.memoizedState=e},useState:function(e){e=Wc(e);var t=e.queue,n=Sm.bind(null,ze,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:nu,useDeferredValue:function(e,t){var n=Vt();return au(n,e,t)},useTransition:function(){var e=Wc(!1);return e=vm.bind(null,ze,e.queue,!0,!1),Vt().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var s=ze,i=Vt();if(_e){if(n===void 0)throw Error(u(407));n=n()}else{if(n=t(),et===null)throw Error(u(349));(He&127)!==0||Kh(s,t,n)}i.memoizedState=n;var r={value:n,getSnapshot:t};return i.queue=r,um(Ph.bind(null,s,r,e),[e]),s.flags|=2048,rl(9,{destroy:void 0},Jh.bind(null,s,r,n,t),null),n},useId:function(){var e=Vt(),t=et.identifierPrefix;if(_e){var n=Fn,s=Pn;n=(s&~(1<<32-dn(s)-1)).toString(32)+n,t="_"+t+"R_"+n,n=_r++,0<n&&(t+="H"+n.toString(32)),t+="_"}else n=cb++,t="_"+t+"r_"+n.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:lu,useFormState:lm,useActionState:lm,useOptimistic:function(e){var t=Vt();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=iu.bind(null,ze,!0,n),n.dispatch=t,[e,t]},useMemoCache:Pc,useCacheRefresh:function(){return Vt().memoizedState=xb.bind(null,ze)},useEffectEvent:function(e){var t=Vt(),n={impl:e};return t.memoizedState=n,function(){if((Xe&2)!==0)throw Error(u(440));return n.impl.apply(void 0,arguments)}}},Em={readContext:At,use:Mr,useCallback:pm,useContext:At,useEffect:tu,useImperativeHandle:xm,useInsertionEffect:fm,useLayoutEffect:hm,useMemo:gm,useReducer:Lr,useRef:cm,useState:function(){return Lr(wa)},useDebugValue:nu,useDeferredValue:function(e,t){var n=ht();return ym(n,Ie.memoizedState,e,t)},useTransition:function(){var e=Lr(wa)[0],t=ht().memoizedState;return[typeof e=="boolean"?e:di(e),t]},useSyncExternalStore:Zh,useId:Nm,useHostTransitionStatus:lu,useFormState:im,useActionState:im,useOptimistic:function(e,t){var n=ht();return Wh(n,Ie,e,t)},useMemoCache:Pc,useCacheRefresh:wm,useEffectEvent:dm},gb={readContext:At,use:Mr,useCallback:pm,useContext:At,useEffect:tu,useImperativeHandle:xm,useInsertionEffect:fm,useLayoutEffect:hm,useMemo:gm,useReducer:Ic,useRef:cm,useState:function(){return Ic(wa)},useDebugValue:nu,useDeferredValue:function(e,t){var n=ht();return Ie===null?au(n,e,t):ym(n,Ie.memoizedState,e,t)},useTransition:function(){var e=Ic(wa)[0],t=ht().memoizedState;return[typeof e=="boolean"?e:di(e),t]},useSyncExternalStore:Zh,useId:Nm,useHostTransitionStatus:lu,useFormState:om,useActionState:om,useOptimistic:function(e,t){var n=ht();return Ie!==null?Wh(n,Ie,e,t):(n.baseState=e,[e,n.queue.dispatch])},useMemoCache:Pc,useCacheRefresh:wm,useEffectEvent:dm};function ru(e,t,n,s){t=e.memoizedState,n=n(s,t),n=n==null?t:L({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var ou={enqueueSetState:function(e,t,n){e=e._reactInternals;var s=yn(),i=$a(s);i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,s),t!==null&&(an(t,e,s),ii(t,e,s))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var s=yn(),i=$a(s);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Ga(e,i,s),t!==null&&(an(t,e,s),ii(t,e,s))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=yn(),s=$a(n);s.tag=2,t!=null&&(s.callback=t),t=Ga(e,s,n),t!==null&&(an(t,e,n),ii(t,e,n))}};function zm(e,t,n,s,i,r,f){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(s,r,f):t.prototype&&t.prototype.isPureReactComponent?!Il(n,s)||!Il(i,r):!0}function Rm(e,t,n,s){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(n,s),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(n,s),t.state!==e&&ou.enqueueReplaceState(t,t.state,null)}function Cs(e,t){var n=t;if("ref"in t){n={};for(var s in t)s!=="ref"&&(n[s]=t[s])}if(e=e.defaultProps){n===t&&(n=L({},n));for(var i in e)n[i]===void 0&&(n[i]=e[i])}return n}function Am(e){mr(e)}function Dm(e){console.error(e)}function _m(e){mr(e)}function $r(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(s){setTimeout(function(){throw s})}}function Om(e,t,n){try{var s=e.onCaughtError;s(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(i){setTimeout(function(){throw i})}}function cu(e,t,n){return n=$a(n),n.tag=3,n.payload={element:null},n.callback=function(){$r(e,t)},n}function Mm(e){return e=$a(e),e.tag=3,e}function Lm(e,t,n,s){var i=n.type.getDerivedStateFromError;if(typeof i=="function"){var r=s.value;e.payload=function(){return i(r)},e.callback=function(){Om(t,n,s)}}var f=n.stateNode;f!==null&&typeof f.componentDidCatch=="function"&&(e.callback=function(){Om(t,n,s),typeof i!="function"&&(Pa===null?Pa=new Set([this]):Pa.add(this));var v=s.stack;this.componentDidCatch(s.value,{componentStack:v!==null?v:""})})}function yb(e,t,n,s,i){if(n.flags|=32768,s!==null&&typeof s=="object"&&typeof s.then=="function"){if(t=n.alternate,t!==null&&vs(t,n,i,!0),n=Dt.current,n!==null){switch(n.tag){case 31:case 13:case 19:return Bt===null?oo():n.alternate===null&&dt===0&&(dt=3),n.flags&=-257,n.flags|=65536,n.lanes=i,s===Cr?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([s]):t.add(s),Zu(e,s,i)),!1;case 22:return n.flags|=65536,s===Cr?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([s])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([s]):n.add(s)),Zu(e,s,i)),!1}throw Error(u(435,n.tag))}return Zu(e,s,i),oo(),!1}if(_e)return t=Dt.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=i,s!==zc&&(e=Error(u(422),{cause:s}),ti(kn(e,n)))):(s!==zc&&(t=Error(u(423),{cause:s}),ti(kn(t,n))),e=e.current.alternate,e.flags|=65536,i&=-i,e.lanes|=i,s=kn(s,n),i=cu(e.stateNode,s,i),Bc(e,i),dt!==4&&(dt=2)),!1;var r=Error(u(520),{cause:s});if(r=kn(r,n),bi===null?bi=[r]:bi.push(r),dt!==4&&(dt=2),t===null)return!0;s=kn(s,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=i&-i,n.lanes|=e,e=cu(n.stateNode,s,e),Bc(n,e),!1;case 1:if(t=n.type,r=n.stateNode,(n.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||r!==null&&typeof r.componentDidCatch=="function"&&(Pa===null||!Pa.has(r))))return n.flags|=65536,i&=-i,n.lanes|=i,i=Mm(i),Lm(i,e,n,s),Bc(n,i),!1;break;case 22:if(n.memoizedState!==null)return n.flags|=65536,!1}n=n.return}while(n!==null);return!1}var uu=Error(u(461)),yt=!1;function Nt(e,t,n,s){t.child=e===null?qh(t,null,n,s):ks(t,e.child,n,s)}function Um(e,t,n,s,i){n=n.render;var r=t.ref;if("ref"in s){var f={};for(var v in s)v!=="ref"&&(f[v]=s[v])}else f=s;return bs(t),s=Qc(e,t,n,f,r,i),v=Zc(),e!==null&&!yt?(Kc(e,t,i),Sa(e,t,i)):(_e&&v&&br(t),t.flags|=1,Nt(e,t,s,i),t.child)}function Hm(e,t,n,s,i){if(e===null){var r=n.type;return typeof r=="function"&&!kc(r)&&r.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=r,Bm(e,t,r,s,i)):(e=yr(n.type,null,s,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(r=e.child,!yu(e,i)){var f=r.memoizedProps;if(n=n.compare,n=n!==null?n:Il,n(f,s)&&e.ref===t.ref)return Sa(e,t,i)}return t.flags|=1,e=ya(r,s),e.ref=t.ref,e.return=t,t.child=e}function Bm(e,t,n,s,i){if(e!==null){var r=e.memoizedProps;if(Il(r,s)&&e.ref===t.ref)if(yt=!1,t.pendingProps=s=r,yu(e,i))(e.flags&131072)!==0&&(yt=!0);else return t.lanes=e.lanes,Sa(e,t,i)}return du(e,t,n,s,i)}function qm(e,t,n,s){var i=s.children,r=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),s.mode==="hidden"){if((t.flags&128)!==0){if(r=r!==null?r.baseLanes|n:n,e!==null){for(s=t.child=e.child,i=0;s!==null;)i=i|s.lanes|s.childLanes,s=s.sibling;s=i&~r}else s=0,t.child=null;return $m(e,t,r,n,s)}if((n&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&kr(t,r!==null?r.cachePool:null),r!==null?Yh(t,r):$c(),Vh(t);else return s=t.lanes=536870912,$m(e,t,r!==null?r.baseLanes|n:n,n,s)}else r!==null?(kr(t,r.cachePool),Yh(t,r),Xa(),t.memoizedState=null):(e!==null&&kr(t,null),$c(),Xa());return Nt(e,t,i,n),t.child}function hi(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function $m(e,t,n,s,i){var r=Mc();return r=r===null?null:{parent:pt._currentValue,pool:r},t.memoizedState={baseLanes:n,cachePool:r},e!==null&&kr(t,null),$c(),Vh(t),e!==null&&vs(e,t,s,!0),t.childLanes=i,null}function Gr(e,t){return t=Yr({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function Gm(e,t,n){return ks(t,e.child,null,n),e=Gr(t,t.pendingProps),e.flags|=2,mn(t),t.memoizedState=null,e}function vb(e,t,n){var s=t.pendingProps,i=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(_e){if(s.mode==="hidden")return e=Gr(t,s),t.lanes=536870912,e.memoizedState={baseLanes:0,cachePool:null},hi(null,e);if(Yc(t),(e=tt)?(e=mp(e,En),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ma!==null?{id:Pn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},n=kh(e),n.return=t,t.child=n,Ct=t,tt=null)):e=null,e===null)throw Ua(t);return t.lanes=536870912,null}return Gr(t,s)}var r=e.memoizedState;if(r!==null){var f=r.dehydrated;if(Yc(t),i)if(t.flags&256)t.flags&=-257,t=Gm(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(u(558));else if(yt||vs(e,t,n,!1),i=(n&e.childLanes)!==0,yt||i){if(Ya.current===null){if(s=et,s!==null&&(f=Ef(s,n),f!==0&&f!==r.retryLane))throw r.retryLane=f,xs(e,f),an(s,e,f),uu;oo()}t=Gm(e,t,n)}else e=r.treeContext,tt=Rn(f.nextSibling),Ct=t,_e=!0,La=null,En=!1,e!==null&&Eh(t,e),t=Gr(t,s),t.flags|=134221824;return t}return e=ya(e.child,{mode:s.mode,children:s.children}),e.ref=t.ref,t.child=e,e.return=t,e}function ol(e,t){var n=t.ref;if(n===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof n!="function"&&typeof n!="object")throw Error(u(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function du(e,t,n,s,i){return bs(t),n=Qc(e,t,n,s,void 0,i),s=Zc(),e!==null&&!yt?(Kc(e,t,i),Sa(e,t,i)):(_e&&s&&br(t),t.flags|=1,Nt(e,t,n,i),t.child)}function Ym(e,t,n,s,i,r){return bs(t),t.updateQueue=null,n=Qh(t,s,n,i),Xh(e),s=Zc(),e!==null&&!yt?(Kc(e,t,r),Sa(e,t,r)):(_e&&s&&br(t),t.flags|=1,Nt(e,t,n,r),t.child)}function Vm(e,t,n,s,i){if(bs(t),t.stateNode===null){var r=Is,f=n.contextType;typeof f=="object"&&f!==null&&(r=At(f)),r=new n(s,r),t.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=ou,t.stateNode=r,r._reactInternals=t,r=t.stateNode,r.props=s,r.state=t.memoizedState,r.refs={},Uc(t),f=n.contextType,r.context=typeof f=="object"&&f!==null?At(f):Is,r.state=t.memoizedState,f=n.getDerivedStateFromProps,typeof f=="function"&&(ru(t,n,f,s),r.state=t.memoizedState),typeof n.getDerivedStateFromProps=="function"||typeof r.getSnapshotBeforeUpdate=="function"||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(f=r.state,typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount(),f!==r.state&&ou.enqueueReplaceState(r,r.state,null),oi(t,s,r,i),ri(),r.state=t.memoizedState),typeof r.componentDidMount=="function"&&(t.flags|=4194308),s=!0}else if(e===null){r=t.stateNode;var v=t.memoizedProps,w=Cs(n,v);r.props=w;var B=r.context,G=n.contextType;f=Is,typeof G=="object"&&G!==null&&(f=At(G));var P=n.getDerivedStateFromProps;G=typeof P=="function"||typeof r.getSnapshotBeforeUpdate=="function",v=t.pendingProps!==v,G||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(v||B!==f)&&Rm(t,r,s,f),qa=!1;var O=t.memoizedState;r.state=O,oi(t,s,r,i),ri(),B=t.memoizedState,v||O!==B||qa?(typeof P=="function"&&(ru(t,n,P,s),B=t.memoizedState),(w=qa||zm(t,n,w,s,O,B,f))?(G||typeof r.UNSAFE_componentWillMount!="function"&&typeof r.componentWillMount!="function"||(typeof r.componentWillMount=="function"&&r.componentWillMount(),typeof r.UNSAFE_componentWillMount=="function"&&r.UNSAFE_componentWillMount()),typeof r.componentDidMount=="function"&&(t.flags|=4194308)):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=s,t.memoizedState=B),r.props=s,r.state=B,r.context=f,s=w):(typeof r.componentDidMount=="function"&&(t.flags|=4194308),s=!1)}else{r=t.stateNode,Hc(e,t),f=t.memoizedProps,G=Cs(n,f),r.props=G,P=t.pendingProps,O=r.context,B=n.contextType,w=Is,typeof B=="object"&&B!==null&&(w=At(B)),v=n.getDerivedStateFromProps,(B=typeof v=="function"||typeof r.getSnapshotBeforeUpdate=="function")||typeof r.UNSAFE_componentWillReceiveProps!="function"&&typeof r.componentWillReceiveProps!="function"||(f!==P||O!==w)&&Rm(t,r,s,w),qa=!1,O=t.memoizedState,r.state=O,oi(t,s,r,i),ri();var $=t.memoizedState;f!==P||O!==$||qa||e!==null&&e.dependencies!==null&&wr(e.dependencies)?(typeof v=="function"&&(ru(t,n,v,s),$=t.memoizedState),(G=qa||zm(t,n,G,s,O,$,w)||e!==null&&e.dependencies!==null&&wr(e.dependencies))?(B||typeof r.UNSAFE_componentWillUpdate!="function"&&typeof r.componentWillUpdate!="function"||(typeof r.componentWillUpdate=="function"&&r.componentWillUpdate(s,$,w),typeof r.UNSAFE_componentWillUpdate=="function"&&r.UNSAFE_componentWillUpdate(s,$,w)),typeof r.componentDidUpdate=="function"&&(t.flags|=4),typeof r.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),t.memoizedProps=s,t.memoizedState=$),r.props=s,r.state=$,r.context=w,s=G):(typeof r.componentDidUpdate!="function"||f===e.memoizedProps&&O===e.memoizedState||(t.flags|=4),typeof r.getSnapshotBeforeUpdate!="function"||f===e.memoizedProps&&O===e.memoizedState||(t.flags|=1024),s=!1)}return r=s,ol(e,t),s=(t.flags&128)!==0,r||s?(r=t.stateNode,n=s&&typeof n.getDerivedStateFromError!="function"?null:r.render(),t.flags|=1,e!==null&&s?(t.child=ks(t,e.child,null,i),t.child=ks(t,null,n,i)):Nt(e,t,n,i),t.memoizedState=r.state,e=t.child):e=Sa(e,t,i),e}function Xm(e,t,n,s){return gs(),t.flags|=256,Nt(e,t,n,s),t.child}var fu={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function hu(e){return{baseLanes:e,cachePool:Oh()}}function mu(e,t,n){return e=e!==null?e.childLanes&~n:0,t&&(e|=gn),e}function Qm(e,t,n){var s=t.pendingProps,i=!1,r=(t.flags&128)!==0,f;if((f=r)||(f=e!==null&&e.memoizedState===null?!1:(_t.current&2)!==0),f&&(i=!0,t.flags&=-129),f=(t.flags&32)!==0,t.flags&=-33,e===null){if(_e){if(i?Va(t):Xa(),(e=tt)?(e=mp(e,En),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ma!==null?{id:Pn,overflow:Fn}:null,retryLane:536870912,hydrationErrors:null},n=kh(e),n.return=t,t.child=n,Ct=t,tt=null)):e=null,e===null)throw Ua(t);return hd(e)?t.lanes=32:t.lanes=536870912,null}return r=s.children,s=s.fallback,i?(Xa(),i=t.mode,r=Yr({mode:"hidden",children:r},i),s=ps(s,i,n,null),r.return=t,s.return=t,r.sibling=s,t.child=r,s=t.child,s.memoizedState=hu(n),s.childLanes=mu(e,f,n),t.memoizedState=fu,hi(null,s)):(Va(t),xu(t,r))}var v=e.memoizedState;if(v!==null){var w=v.dehydrated;if(w!==null)return bb(e,t,r,f,s,w,v,n)}return i?(Xa(),i=s.fallback,r=t.mode,v=e.child,w=v.sibling,s=ya(v,{mode:"hidden",children:s.children}),s.subtreeFlags=v.subtreeFlags&1206910976,w!==null?i=ya(w,i):(i=ps(i,r,n,null),i.flags|=2),i.return=t,s.return=t,s.sibling=i,t.child=s,hi(null,s),s=t.child,i=e.child.memoizedState,i===null?i=hu(n):(r=i.cachePool,r!==null?(v=pt._currentValue,r=r.parent!==v?{parent:v,pool:v}:r):r=Oh(),i={baseLanes:i.baseLanes|n,cachePool:r}),s.memoizedState=i,s.childLanes=mu(e,f,n),t.memoizedState=fu,hi(e.child,s)):(Va(t),n=e.child,e=n.sibling,n=ya(n,{mode:"visible",children:s.children}),n.return=t,n.sibling=null,e!==null&&(f=t.deletions,f===null?(t.deletions=[e],t.flags|=16):f.push(e)),t.child=n,t.memoizedState=null,n)}function xu(e,t){return t=Yr({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function Yr(e,t){return e=Wt(22,e,null,t),e.lanes=0,e}function Vr(e,t,n){return ks(t,e.child,null,n),e=xu(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function bb(e,t,n,s,i,r,f,v){if(n)return t.flags&256?(Va(t),t.flags&=-257,Vr(e,t,v)):t.memoizedState!==null?(Xa(),t.child=e.child,t.flags|=128,null):(Xa(),r=i.fallback,f=t.mode,i=Yr({mode:"visible",children:i.children},f),r=ps(r,f,v,null),r.flags|=2,i.return=t,r.return=t,i.sibling=r,t.child=i,ks(t,e.child,null,v),i=t.child,i.memoizedState=hu(v),i.childLanes=mu(e,s,v),t.memoizedState=fu,hi(null,i));if(Va(t),hd(r)){if(s=r.nextSibling&&r.nextSibling.dataset,s)var w=s.dgst;return s=w,s!==""&&(i=Error(u(419)),i.stack="",i.digest=s,ti({value:i,source:null,stack:null})),Vr(e,t,v)}if(yt||vs(e,t,v,!1),s=(v&e.childLanes)!==0,yt||s){if(Ya.current!==null)return Vr(e,t,v);if(s=et,s!==null&&(i=Ef(s,v),i!==0&&i!==f.retryLane))throw f.retryLane=i,xs(e,i),an(s,e,i),uu;return fd(r)||oo(),Vr(e,t,v)}return fd(r)?(t.flags|=192,t.child=e.child,null):(e=f.treeContext,tt=Rn(r.nextSibling),Ct=t,_e=!0,La=null,En=!1,e!==null&&Eh(t,e),t=xu(t,i.children),t.flags|=134221824,t)}function Zm(e,t,n){e.lanes|=t;var s=e.alternate;s!==null&&(s.lanes|=t),Nr(e.return,t,n)}function Km(e){for(var t=null;e!==null;){var n=e.alternate;n!==null&&Ar(n)===null&&(t=e),e=e.sibling}return t}function Xr(e,t,n,s,i,r){var f=e.memoizedState;f===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:s,tail:n,tailMode:i,treeForkCount:r}:(f.isBackwards=t,f.rendering=null,f.renderingStartTime=0,f.last=s,f.tail=n,f.tailMode=i,f.treeForkCount=r)}function pu(e){var t=e.child;for(e.child=null;t!==null;){var n=t.sibling;t.sibling=e.child,e.child=t,t=n}}function gu(e,t,n){var s=t.pendingProps,i=s.revealOrder,r=s.tail;s=s.children;var f=_t.current;if(t.flags&128)return ci(t,f),null;var v=(f&2)!==0;if(v?(f=f&1|2,t.flags|=128):f&=1,ci(t,f),i==="backwards"&&e!==null?(pu(e),Nt(e,t,s,n),pu(e)):Nt(e,t,s,n),s=_e?ei:0,!v&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Zm(e,n,t);else if(e.tag===19)Zm(e,n,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":n=Km(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null,pu(t)),Xr(t,!0,i,null,r,s);break;case"unstable_legacy-backwards":for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&Ar(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Xr(t,!0,n,null,r,s);break;case"together":Xr(t,!1,null,null,void 0,s);break;case"independent":t.memoizedState=null;break;default:n=Km(t.child),n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Xr(t,!1,i,n,r,s)}return t.child}function Jm(e,t,n){var s=t.pendingProps;return Ha(t,t.type,s.value),Nt(e,t,s.children,n),t.child}function Sa(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),Ja|=t.lanes,(n&t.childLanes)===0)if(e!==null){if(vs(e,t,n,!1),(n&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(u(153));if(t.child!==null){for(e=t.child,n=ya(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=ya(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function yu(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&wr(e)))}function jb(e,t,n){switch(t.tag){case 3:Kn(t,t.stateNode.containerInfo),Ha(t,pt,e.memoizedState.cache),gs();break;case 27:case 5:X(t);break;case 4:Kn(t,t.stateNode.containerInfo);break;case 10:Ha(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,Yc(t),null;break;case 13:var s=t.memoizedState;if(s!==null){if(s.dehydrated!==null)return Va(t),t.flags|=128,null;s=vs(e,t,n,!1);var i=t.child.childLanes;return s||(n&i)!==0?Qm(e,t,n):(Va(t),e=Sa(e,t,n),e!==null?e.sibling:null)}Va(t);break;case 19:if(t.flags&128)return gu(e,t,n);if(i=(e.flags&128)!==0,s=(n&t.childLanes)!==0,s||(vs(e,t,n,!1),s=(n&t.childLanes)!==0),i){if(s)return gu(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),ci(t,_t.current),s)break;return null;case 22:return t.lanes=0,qm(e,t,n,t.pendingProps);case 24:Ha(t,pt,e.memoizedState.cache)}return Sa(e,t,n)}function Pm(e,t,n){if(e!==null)if(e.memoizedProps!==t.pendingProps)yt=!0;else{if(!yu(e,n)&&(t.flags&128)===0)return yt=!1,jb(e,t,n);yt=(e.flags&131072)!==0}else yt=!1,_e&&(t.flags&1048576)!==0&&Ch(t,ei,t.index);switch(t.lanes=0,t.tag){case 16:e:{var s=t.pendingProps;if(e=ws(t.elementType),t.type=e,typeof e=="function")kc(e)?(s=Cs(e,s),t.tag=1,t=Vm(null,t,e,s,n)):(t.tag=0,t=du(null,t,e,s,n));else{if(e!=null){var i=e.$$typeof;if(i===ne){t.tag=11,t=Um(null,t,e,s,n);break e}else if(i===ce){t.tag=14,t=Hm(null,t,e,s,n);break e}else if(i===F){t.tag=10,t.type=e,t=Jm(null,t,n);break e}}throw t=Ce(e)||e,Error(u(306,t,""))}}return t;case 0:return du(e,t,t.type,t.pendingProps,n);case 1:return s=t.type,i=Cs(s,t.pendingProps),Vm(e,t,s,i,n);case 3:e:{if(Kn(t,t.stateNode.containerInfo),e===null)throw Error(u(387));s=t.pendingProps;var r=t.memoizedState;i=r.element,Hc(e,t),oi(t,s,null,n);var f=t.memoizedState;if(s=f.cache,Ha(t,pt,s),s!==r.cache&&Dc(t,[pt],n,!0),ri(),s=f.element,r.isDehydrated)if(r={element:s,isDehydrated:!1,cache:f.cache},t.updateQueue.baseState=r,t.memoizedState=r,t.flags&256){t=Xm(e,t,s,n);break e}else if(s!==i){i=kn(Error(u(424)),t),ti(i),t=Xm(e,t,s,n);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for(tt=Rn(e.firstChild),Ct=t,_e=!0,La=null,En=!0,n=qh(t,null,s,n),t.child=n;n;)n.flags=n.flags&-3|134221824,n=n.sibling}else{if(gs(),s===i){t=Sa(e,t,n);break e}Nt(e,t,s,n)}t=t.child}return t;case 26:return ol(e,t),e===null?(n=jp(t.type,null,t.pendingProps,null))?t.memoizedState=n:_e||(t.stateNode=ep(t.type,t.pendingProps,Pt.current,t)):t.memoizedState=jp(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return X(t),e===null&&_e&&(s=t.stateNode=gp(t.type,t.pendingProps,Pt.current),Ct=t,En=!0,i=tt,Wa(t.type)?(md=i,tt=Rn(s.firstChild)):tt=i),Nt(e,t,t.pendingProps.children,n),ol(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&_e&&((i=s=tt)&&(s=x0(s,t.type,t.pendingProps,En),s!==null?(t.stateNode=s,Ct=t,tt=Rn(s.firstChild),En=!1,i=!0):i=!1),i||Ua(t)),X(t),i=t.type,r=t.pendingProps,f=e!==null?e.memoizedProps:null,s=r.children,ld(i,r)?s=null:f!==null&&ld(i,f)&&(t.flags|=32),t.memoizedState!==null&&(i=Qc(e,t,ub,null,null,n),Tl._currentValue=i),ol(e,t),Nt(e,t,s,n),t.child;case 6:return e===null&&_e&&((e=n=tt)&&(n=p0(n,t.pendingProps,En),n!==null?(t.stateNode=n,Ct=t,tt=null,e=!0):e=!1),e||Ua(t)),null;case 13:return Qm(e,t,n);case 4:return Kn(t,t.stateNode.containerInfo),s=t.pendingProps,e===null?t.child=ks(t,null,s,n):Nt(e,t,s,n),t.child;case 11:return Um(e,t,t.type,t.pendingProps,n);case 7:return s=t.pendingProps,ol(e,t),Nt(e,t,s,n),t.child;case 8:return Nt(e,t,t.pendingProps.children,n),t.child;case 12:return Nt(e,t,t.pendingProps.children,n),t.child;case 10:return Jm(e,t,n);case 9:return i=t.type._context,s=t.pendingProps.children,bs(t),i=At(i),s=s(i),t.flags|=1,Nt(e,t,s,n),t.child;case 14:return Hm(e,t,t.type,t.pendingProps,n);case 15:return Bm(e,t,t.type,t.pendingProps,n);case 19:return gu(e,t,n);case 31:return vb(e,t,n);case 22:return qm(e,t,n,t.pendingProps);case 24:return bs(t),s=At(pt),e===null?(i=Mc(),i===null&&(i=et,r=_c(),i.pooledCache=r,r.refCount++,r!==null&&(i.pooledCacheLanes|=n),i=r),t.memoizedState={parent:s,cache:i},Uc(t),Ha(t,pt,i)):((e.lanes&n)!==0&&(Hc(e,t),oi(t,null,null,n),ri()),i=e.memoizedState,r=t.memoizedState,i.parent!==s?(i={parent:s,cache:s},t.memoizedState=i,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=i),Ha(t,pt,s)):(s=r.cache,Ha(t,pt,s),s!==i.cache&&Dc(t,[pt],n,!0))),Nt(e,t,t.pendingProps.children,n),t.child;case 30:return t.stateNode===null&&(t.stateNode={autoName:null,paired:null,clones:null,ref:null}),s=t.pendingProps,s.name!=null&&s.name!=="auto"?t.flags|=e===null?18882560:18874368:_e&&br(t),e!==null&&e.memoizedProps.name!==s.name?t.flags|=4194816:ol(e,t),Nt(e,t,s.children,n),t.child;case 29:throw t.pendingProps}throw Error(u(156,t.tag))}function ka(e){e.flags|=4}function vu(e,t,n,s,i){var r;if((r=(e.mode&32)!==0)&&(r=n===null?kp(t,s):kp(t,s)&&(s.src!==n.src||s.srcSet!==n.srcSet)),r){if(e.flags|=16777216,(i&335544128)===i)if(e.stateNode.complete)e.flags|=8192;else if(Ax())e.flags|=8192;else throw Ss=Cr,Lc}else e.flags&=-16777217}function Fm(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Tp(t))if(Ax())e.flags|=8192;else throw Ss=Cr,Lc}function Qr(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?kf():536870912,e.lanes|=t,hl|=t)}function mi(e,t){if(!_e)switch(e.tailMode){case"visible":break;case"collapsed":for(var n=e.tail,s=null;n!==null;)n.alternate!==null&&(s=n),n=n.sibling;s===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:s.sibling=null;break;default:for(t=e.tail,n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null}}function nt(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,s=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags&1206910976,s|=i.flags&1206910976,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,s|=i.subtreeFlags,s|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=s,e.childLanes=n,t}function Nb(e,t,n){var s=t.pendingProps;switch(Ec(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return nt(t),null;case 1:return nt(t),null;case 3:return n=t.stateNode,s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),ja(pt),rn(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(tl(t)?ka(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,Rc())),nt(t),null;case 26:var i=t.type,r=t.memoizedState;return e===null?(ka(t),r!==null?(nt(t),Fm(t,r)):(nt(t),vu(t,i,null,s,n))):r?r!==e.memoizedState?(ka(t),nt(t),Fm(t,r)):(nt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==s&&ka(t),nt(t),vu(t,i,e,s,n)),null;case 27:if(pe(t),n=Pt.current,i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ka(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return nt(t),t.subtreeFlags&=-33554433,null}e=Ut.current,tl(t)?zh(t):(e=gp(i,s,n),t.stateNode=e,ka(t))}return nt(t),t.subtreeFlags&=-33554433,null;case 5:if(pe(t),i=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==s&&ka(t);else{if(!s){if(t.stateNode===null)throw Error(u(166));return nt(t),t.subtreeFlags&=-33554433,null}if(r=Ut.current,tl(t))zh(t);else{var f=ki(Pt.current);switch(r){case 1:r=f.createElementNS("http://www.w3.org/2000/svg",i);break;case 2:r=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;default:switch(i){case"svg":r=f.createElementNS("http://www.w3.org/2000/svg",i);break;case"math":r=f.createElementNS("http://www.w3.org/1998/Math/MathML",i);break;case"script":r=f.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild);break;case"select":r=typeof s.is=="string"?f.createElement("select",{is:s.is}):f.createElement("select"),s.multiple?r.multiple=!0:s.size&&(r.size=s.size);break;default:r=typeof s.is=="string"?f.createElement(i,{is:s.is}):f.createElement(i)}}r[Rt]=t,r[It]=s;e:for(f=t.child;f!==null;){if(f.tag===5||f.tag===6)r.appendChild(f.stateNode);else if(f.tag!==4&&f.tag!==27&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===t)break e;for(;f.sibling===null;){if(f.return===null||f.return===t)break e;f=f.return}f.sibling.return=f.return,f=f.sibling}t.stateNode=r;e:switch(Mt(r,i,s),i){case"button":case"input":case"select":case"textarea":s=!!s.autoFocus;break e;case"img":s=!0;break e;default:s=!1}s&&ka(t)}}return nt(t),t.subtreeFlags&=-33554433,vu(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==s&&ka(t);else{if(typeof s!="string"&&t.stateNode===null)throw Error(u(166));if(e=Pt.current,tl(t)){if(e=t.stateNode,n=t.memoizedProps,s=null,i=Ct,i!==null)switch(i.tag){case 27:case 5:s=i.memoizedProps}e[Rt]=t,e=!!(e.nodeValue===n||s!==null&&s.suppressHydrationWarning===!0||Px(e.nodeValue,n)),e||Ua(t,!0)}else e=ki(e).createTextNode(s),e[Rt]=t,t.stateNode=e}return nt(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(s=tl(t),n!==null){if(e===null){if(!s)throw Error(u(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(u(557));e[Rt]=t}else gs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nt(t),e=!1}else n=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(mn(t),t):(mn(t),null);if((t.flags&128)!==0)throw Error(u(558))}return nt(t),null;case 13:if(s=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(i=tl(t),s!==null&&s.dehydrated!==null){if(e===null){if(!i)throw Error(u(318));if(i=t.memoizedState,i=i!==null?i.dehydrated:null,!i)throw Error(u(317));i[Rt]=t}else gs(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;nt(t),i=!1}else i=Rc(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=i),i=!0;if(!i)return t.flags&256?(mn(t),t):(mn(t),null)}return mn(t),(t.flags&128)!==0?(t.lanes=n,t):(n=s!==null,e=e!==null&&e.memoizedState!==null,n&&(s=t.child,i=null,s.alternate!==null&&s.alternate.memoizedState!==null&&s.alternate.memoizedState.cachePool!==null&&(i=s.alternate.memoizedState.cachePool.pool),r=null,s.memoizedState!==null&&s.memoizedState.cachePool!==null&&(r=s.memoizedState.cachePool.pool),r!==i&&(s.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),Qr(t,t.updateQueue),nt(t),null);case 4:return rn(),e===null&&ed(t.stateNode.containerInfo),t.flags|=67108864,nt(t),null;case 10:return ja(t.type),nt(t),null;case 19:if(Vc(t),s=t.memoizedState,s===null)return nt(t),null;if(i=(t.flags&128)!==0,r=s.rendering,r===null)if(i)mi(s,!1);else{if(dt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(r=Ar(e),r!==null){for(t.flags|=128,mi(s,!1),e=r.updateQueue,t.updateQueue=e,Qr(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)Sh(n,e),n=n.sibling;return ci(t,_t.current&1|2),_e&&va(t,s.treeForkCount),t.child}e=e.sibling}s.tail!==null&&cn()>so&&(t.flags|=128,i=!0,mi(s,!1),t.lanes=4194304)}else{if(!i)if(e=Ar(r),e!==null){if(t.flags|=128,i=!0,e=e.updateQueue,t.updateQueue=e,Qr(t,e),mi(s,!0),s.tail===null&&s.tailMode!=="collapsed"&&s.tailMode!=="visible"&&!r.alternate&&!_e)return nt(t),null}else 2*cn()-s.renderingStartTime>so&&n!==536870912&&(t.flags|=128,i=!0,mi(s,!1),t.lanes=4194304);s.isBackwards?(r.sibling=t.child,t.child=r):(e=s.last,e!==null?e.sibling=r:t.child=r,s.last=r)}if(s.tail!==null){e=s.tail;e:{for(n=e;n!==null;){if(n.alternate!==null){n=!1;break e}n=n.sibling}n=!0}return s.rendering=e,s.tail=e.sibling,s.renderingStartTime=cn(),e.sibling=null,r=_t.current,r=i?r&1|2:r&1,s.tailMode==="visible"||s.tailMode==="collapsed"||!n||_e?ci(t,r):(n=r,Ue(Dt,t),Ue(_t,n),Bt===null&&(Bt=t)),_e&&va(t,s.treeForkCount),e}return nt(t),null;case 22:case 23:return mn(t),Gc(),s=t.memoizedState!==null,e!==null?e.memoizedState!==null!==s&&(t.flags|=8192):s&&(t.flags|=8192),s?(n&536870912)!==0&&(t.flags&128)===0&&(nt(t),t.subtreeFlags&6&&(t.flags|=8192)):nt(t),n=t.updateQueue,n!==null&&Qr(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),s=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(s=t.memoizedState.cachePool.pool),s!==n&&(t.flags|=2048),e!==null&&rt(Ns),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),ja(pt),nt(t),null;case 25:return null;case 30:return t.flags|=33554432,nt(t),null}throw Error(u(156,t.tag))}function wb(e,t){switch(Ec(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return ja(pt),rn(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return pe(t),null;case 31:if(t.memoizedState!==null){if(mn(t),t.alternate===null)throw Error(u(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(mn(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(u(340));gs()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return Vc(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 rn(),null;case 10:return ja(t.type),null;case 22:case 23:return mn(t),Gc(),e!==null&&rt(Ns),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return ja(pt),null;case 25:return null;default:return null}}function Im(e,t){switch(Ec(t),t.tag){case 3:ja(pt),rn();break;case 26:case 27:case 5:pe(t);break;case 4:rn();break;case 31:t.memoizedState!==null&&mn(t);break;case 13:mn(t);break;case 19:Vc(t);break;case 10:ja(t.type);break;case 22:case 23:mn(t),Gc(),e!==null&&rt(Ns);break;case 24:ja(pt)}}function xi(e,t){try{var n=t.updateQueue,s=n!==null?n.lastEffect:null;if(s!==null){var i=s.next;n=i;do{if((n.tag&e)===e){s=void 0;var r=n.create,f=n.inst;s=r(),f.destroy=s}n=n.next}while(n!==i)}}catch(v){Pe(t,t.return,v)}}function Qa(e,t,n){try{var s=t.updateQueue,i=s!==null?s.lastEffect:null;if(i!==null){var r=i.next;s=r;do{if((s.tag&e)===e){var f=s.inst,v=f.destroy;if(v!==void 0){f.destroy=void 0,i=t;var w=n,B=v;try{B()}catch(G){Pe(i,w,G)}}}s=s.next}while(s!==r)}}catch(G){Pe(t,t.return,G)}}function Wm(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Gh(t,n)}catch(s){Pe(e,e.return,s)}}}function ex(e,t,n){n.props=Cs(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(s){Pe(e,t,s)}}function In(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var s=e.stateNode;break;case 30:var i=e.stateNode,r=pa(e.memoizedProps,i);(i.ref===null||i.ref.name!==r)&&(i.ref=rp(r)),s=i.ref;break;case 7:if(e.stateNode===null){var f=new vn(e);y(e.child,!1,h0,f,void 0,void 0),e.stateNode=f}s=e.stateNode;break;default:s=e.stateNode}typeof n=="function"?e.refCleanup=n(s):n.current=s}}catch(v){Pe(e,t,v)}}function Ot(e,t){var n=e.ref,s=e.refCleanup;if(n!==null)if(typeof s=="function")try{s()}catch(i){Pe(e,t,i)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n=="function")try{n(null)}catch(i){Pe(e,t,i)}else n.current=null}function Zr(e,t){if((e.tag===5||e.tag===27||e.tag===6)&&e.alternate===null&&t!==null)for(var n=0;n<t.length;n++)hp(e.stateNode,t[n])}function tx(e){for(var t=e.return;t!==null&&(ju(t)&&hp(e.stateNode,t.stateNode),!bu(t));)t=t.return}function pi(e){for(var t=e.return;t!==null&&(ju(t)&&m0(e.stateNode,t.stateNode),!bu(t));)t=t.return}function bu(e){return e.tag===5||e.tag===3||e.tag===27}function ju(e){return e&&e.tag===7&&e.stateNode!==null}function Nu(e){var t=e.type,n=e.memoizedProps,s=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":n.autoFocus&&s.focus();break e;case"img":n.src?s.src=n.src:n.srcSet&&(s.srcset=n.srcSet)}}catch(i){Pe(e,e.return,i)}}function wu(e,t,n){try{var s=e.stateNode;Jb(s,e.type,n,t),s[It]=t}catch(i){Pe(e,e.return,i)}}function nx(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Wa(e.type)||e.tag===4}function Su(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||nx(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&&Wa(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 ku(e,t,n,s){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n).insertBefore(i,t):(t=n.nodeType===9?n.body:n.nodeName==="HTML"?n.ownerDocument.body:n,t.appendChild(i),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=Jn)),Zr(e,s),Ge=!0;else if(i!==4&&(i===27&&(Zr(e,s),s=null,Wa(e.type)&&(n=e.stateNode,t=null)),e=e.child,e!==null))for(ku(e,t,n,s),e=e.sibling;e!==null;)ku(e,t,n,s),e=e.sibling}function Kr(e,t,n,s){var i=e.tag;if(i===5||i===6)i=e.stateNode,t?n.insertBefore(i,t):n.appendChild(i),Zr(e,s),Ge=!0;else if(i!==4&&(i===27&&(Zr(e,s),s=null,Wa(e.type)&&(n=e.stateNode)),e=e.child,e!==null))for(Kr(e,t,n,s),e=e.sibling;e!==null;)Kr(e,t,n,s),e=e.sibling}function ax(e){var t=e.stateNode,n=e.memoizedProps;try{for(var s=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Mt(t,s,n),t[Rt]=e,t[It]=n}catch(r){Pe(e,e.return,r)}}var Jr=!1,xn=null;function sx(e){(e.tag===30||(e.subtreeFlags&33554432)!==0)&&(Jr=!0)}var Wn=null;function lx(){var e=Wn;return Wn=null,e}var en=0;function cl(e,t,n,s,i){return en=0,ix(e.child,t,n,s,i)}function ix(e,t,n,s,i){for(var r=!1;e!==null;){if(e.tag===5){var f=e.stateNode;if(s!==null){var v=od(f);s.push(v),v.view&&(r=!0)}else r||od(f).view&&(r=!0);Jr=!0,lp(f,en===0?t:t+"_"+en,n),en++}else(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&i||ix(e.child,t,n,s,i)&&(r=!0));e=e.sibling}return r}function ea(e,t){for(;e!==null;)e.tag===5?ip(e.stateNode,e.memoizedProps):(e.tag!==22||e.memoizedState===null)&&(e.tag===30&&t||ea(e.child,t)),e=e.sibling}function Pr(e){if((e.subtreeFlags&18874368)!==0)for(e=e.child;e!==null;){if((e.tag!==22||e.memoizedState===null)&&(Pr(e),e.tag===30&&(e.flags&18874368)!==0&&e.stateNode.paired)){var t=e.memoizedProps;if(t.name==null||t.name==="auto")throw Error(u(544));var n=t.name;t=ga(t.default,t.share),t!=="none"&&(cl(e,n,t,null,!1)||ea(e.child,!1))}e=e.sibling}}function Tu(e,t){if(e.tag===30){var n=e.stateNode,s=e.memoizedProps,i=pa(s,n),r=ga(s.default,n.paired?s.share:s.enter);r!=="none"?cl(e,i,r,null,!1)?(Pr(e),n.paired||t||gl(e,s.onEnter)):ea(e.child,!1):Pr(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Tu(e,t),e=e.sibling;else Pr(e)}function Cu(e){if(xn!==null&&xn.size!==0){var t=xn;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 n=e.memoizedProps,s=n.name;if(s!=null&&s!=="auto"){var i=t.get(s);if(i!==void 0){var r=ga(n.default,n.share);if(r!=="none"&&(cl(e,s,r,null,!1)?(r=e.stateNode,i.paired=r,r.paired=i,gl(e,n.onShare)):ea(e.child,!1)),t.delete(s),t.size===0)break}}}Cu(e)}e=e.sibling}}}function Eu(e){if(e.tag===30){var t=e.memoizedProps,n=pa(t,e.stateNode),s=xn!==null?xn.get(n):void 0,i=ga(t.default,s!==void 0?t.share:t.exit);i!=="none"&&(cl(e,n,i,null,!1)?s!==void 0?(i=e.stateNode,s.paired=i,i.paired=s,xn.delete(n),gl(e,t.onShare)):gl(e,t.onExit):ea(e.child,!1)),xn!==null&&Cu(e)}else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Eu(e),e=e.sibling;else xn!==null&&Cu(e)}function rx(e){for(e=e.child;e!==null;){if(e.tag===30){var t=e.memoizedProps,n=pa(t,e.stateNode);t=ga(t.default,t.update),e.flags&=-5,t!=="none"&&cl(e,n,t,e.memoizedState=[],!1)}else(e.subtreeFlags&33554432)!==0&&rx(e);e=e.sibling}}function zu(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,ea(e.child,!1))}zu(e)}e=e.sibling}}function Fr(e){if(e.tag===30)e.stateNode.paired=null,ea(e.child,!1),zu(e);else if((e.subtreeFlags&33554432)!==0)for(e=e.child;e!==null;)Fr(e),e=e.sibling;else zu(e)}function ox(e){for(e=e.child;e!==null;)e.tag===30?ea(e.child,!1):(e.subtreeFlags&33554432)!==0&&ox(e),e=e.sibling}function Ru(e,t,n,s,i,r,f){for(var v=!1;t!==null;){if(t.tag===5){var w=t.stateNode;if(r!==null&&en<r.length){var B=r[en],G=od(w);(B.view||G.view)&&(v=!0);var P;if(P=(e.flags&4)===0)if(G.clip)P=!0;else{P=B.rect;var O=G.rect;P=P.y!==O.y||P.x!==O.x||P.height!==O.height||P.width!==O.width}P&&(e.flags|=4),G.abs?G=!B.abs:(B=B.rect,G=G.rect,G=B.height!==G.height||B.width!==G.width),G&&(e.flags|=32)}else e.flags|=32;(e.flags&4)!==0&&lp(w,en===0?n:n+"_"+en,i),v&&(e.flags&4)!==0||(Wn===null&&(Wn=[]),Wn.push(w,en===0?s:s+"_"+en,t.memoizedProps)),en++}else(t.tag!==22||t.memoizedState===null)&&(t.tag===30&&f?e.flags|=t.flags&32:Ru(e,t.child,n,s,i,r,f)&&(v=!0));t=t.sibling}return v}function cx(e,t){for(e=e.child;e!==null;){if(e.tag===30){var n=e.memoizedProps,s=e.stateNode,i=pa(n,s),r=ga(n.default,n.update),f;f=e.memoizedState,e.memoizedState=null,s=e;var v=e.child;en=0,i=Ru(s,v,i,i,r,f,!1),(e.flags&4)!==0&&i&&gl(e,n.onUpdate)}else(e.subtreeFlags&33554432)!==0&&cx(e);e=e.sibling}}var Et=!1,Ke=!1,ta=!1,Au=!1,ux=typeof WeakSet=="function"?WeakSet:Set,zt=null,na=!1,gi=!1,Ir=!1,Du=!1;function Sb(e,t,n){if(e=e.containerInfo,ad=Cl,e=mh(e),yc(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var i=s.getSelection&&s.getSelection();if(i&&i.rangeCount!==0){s=i.anchorNode;var r=i.anchorOffset,f=i.focusNode;i=i.focusOffset;try{s.nodeType,f.nodeType}catch{s=null;break e}var v=0,w=-1,B=-1,G=0,P=0,O=e,$=null;t:for(;;){for(var oe;O!==s||r!==0&&O.nodeType!==3||(w=v+r),O!==f||i!==0&&O.nodeType!==3||(B=v+i),O.nodeType===3&&(v+=O.nodeValue.length),(oe=O.firstChild)!==null;)$=O,O=oe;for(;;){if(O===e)break t;if($===s&&++G===r&&(w=v),$===f&&++P===i&&(B=v),(oe=O.nextSibling)!==null)break;O=$,$=O.parentNode}O=oe}s=w===-1||B===-1?null:{start:w,end:B}}else s=null}s=s||{start:0,end:0}}else s=null;for(sd={focusedElem:e,selectionRange:s},Cl=!1,n=(n&335544064)===n,zt=t,t=n?9270:1024;zt!==null;){if(e=zt,n&&(s=e.deletions,s!==null))for(r=0;r<s.length;r++)n&&Eu(s[r]);if(e.alternate===null&&(e.flags&2)!==0)n&&sx(e),Wr(n);else{if(e.tag===22){if(s=e.alternate,e.memoizedState!==null){s!==null&&s.memoizedState===null&&n&&Eu(s),Wr(n);continue}else if(s!==null&&s.memoizedState!==null){n&&sx(e),Wr(n);continue}}s=e.child,(e.subtreeFlags&t)!==0&&s!==null?(s.return=e,zt=s):(n&&rx(e),Wr(n))}}xn=null}function Wr(e){for(;zt!==null;){var t=zt,n=e,s=t.alternate,i=t.flags;switch(t.tag){case 0:case 11:case 15:break;case 1:if((i&1024)!==0&&s!==null){n=void 0,i=s.memoizedProps,s=s.memoizedState;var r=t.stateNode;try{var f=Cs(t.type,i);n=r.getSnapshotBeforeUpdate(f,s),r.__reactInternalSnapshotBeforeUpdate=n}catch(v){Pe(t,t.return,v)}}break;case 3:if((i&1024)!==0){if(s=t.stateNode.containerInfo,n=s.nodeType,n===9)dd(s);else if(n===1)switch(s.nodeName){case"HEAD":case"HTML":case"BODY":dd(s);break;default:s.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;case 30:n&&s!==null&&(n=pa(s.memoizedProps,s.stateNode),i=t.memoizedProps,i=ga(i.default,i.update),i!=="none"&&cl(s,n,i,s.memoizedState=[],!0));break;default:if((i&1024)!==0)throw Error(u(163))}if(s=t.sibling,s!==null){s.return=t.return,zt=s;break}zt=t.return}}function dx(e,t,n){var s=n.flags;switch(n.tag){case 0:case 11:case 15:aa(e,n),s&4&&xi(5,n);break;case 1:if(aa(e,n),s&4)if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(f){Pe(n,n.return,f)}else{var i=Cs(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(f){Pe(n,n.return,f)}}s&64&&Wm(n),s&512&&In(n,n.return);break;case 3:if(aa(e,n),s&64&&(e=n.updateQueue,e!==null)){if(t=null,n.child!==null)switch(n.child.tag){case 27:case 5:t=n.child.stateNode;break;case 1:t=n.child.stateNode}try{Gh(e,t)}catch(f){Pe(n,n.return,f)}}break;case 27:t===null&&s&4&&ax(n);case 26:case 5:aa(e,n),t===null&&s&4&&Nu(n),s&512&&In(n,n.return);break;case 12:aa(e,n);break;case 31:aa(e,n),s&4&&xx(e,n);break;case 13:aa(e,n),s&4&&px(e,n),s&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Lb.bind(null,n),g0(e,n))));break;case 22:if(s=n.memoizedState!==null||Et,!s){var r=t!==null&&t.memoizedState!==null||Ke;t=Et,i=Ke,Et=s,(Ke=r)&&!i?(s=2,(n.subtreeFlags&8772)!==0&&(s|=1),Bn(e,n,s)):aa(e,n),Et=t,Ke=i}break;case 30:aa(e,n),s&512&&In(n,n.return);break;case 7:s&512&&In(n,n.return);default:aa(e,n)}}function _u(e,t){for(e=e.child;e!==null;)fx(e,t),e=e.sibling}function fx(e,t){switch(e.tag){case 5:case 26:try{var n=e.stateNode;if(t){var s=n.style;typeof s.setProperty=="function"?s.setProperty("display","none","important"):s.display="none"}else{var i=e.stateNode,r=e.memoizedProps.style,f=r!=null&&r.hasOwnProperty("display")?r.display:null;i.style.display=f==null||typeof f=="boolean"?"":(""+f).trim()}}catch(w){Pe(e,e.return,w)}Ou(e,t);break;case 6:try{e.stateNode.nodeValue=t?"":e.memoizedProps,Ge=!0}catch(w){Pe(e,e.return,w)}break;case 18:try{var v=e.stateNode;t?sp(v,!0):sp(e.stateNode,!1)}catch(w){Pe(e,e.return,w)}break;case 22:case 23:e.memoizedState===null&&_u(e,t);break;default:_u(e,t)}}function Ou(e,t){if(e.subtreeFlags&67108864)for(e=e.child;e!==null;){e:{var n=e,s=t;switch(n.tag){case 4:fx(n,s);break e;case 22:n.memoizedState===null&&Ou(n,s);break e;default:Ou(n,s)}}e=e.sibling}}function hx(e){var t=e.alternate;t!==null&&(e.alternate=null,hx(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&sr(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 st=null,tn=!1;function Un(e,t,n){for(n=n.child;n!==null;)mx(e,t,n),n=n.sibling}function mx(e,t,n){if(un&&typeof un.onCommitFiberUnmount=="function")try{un.onCommitFiberUnmount(ql,n)}catch{}switch(n.tag){case 26:Ke||Ot(n,t),Un(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&!Ke&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:Ke||Ot(n,t),pi(n);var s=st,i=tn;Wa(n.type)&&(st=n.stateNode,tn=!1),Un(e,t,n),yp(n.stateNode,n.type,n.memoizedProps),st=s,tn=i;break;case 5:Ke||Ot(n,t),pi(n);case 6:if(n.tag===6&&pi(n),s=st,i=tn,st=null,Un(e,t,n),st=s,tn=i,st!==null)if(tn)try{(st.nodeType===9?st.body:st.nodeName==="HTML"?st.ownerDocument.body:st).removeChild(n.stateNode),Ge=!0}catch(r){Pe(n,t,r)}else try{st.removeChild(n.stateNode),Ge=!0}catch(r){Pe(n,t,r)}break;case 18:st!==null&&(tn?(e=st,ap(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,n.stateNode),El(e)):ap(st,n.stateNode));break;case 4:s=st,i=tn,st=n.stateNode.containerInfo,tn=!0,Un(e,t,n),st=s,tn=i;break;case 0:case 11:case 14:case 15:Qa(2,n,t),Ke||Qa(4,n,t),Un(e,t,n);break;case 1:Ke||(Ot(n,t),s=n.stateNode,typeof s.componentWillUnmount=="function"&&ex(n,t,s)),Un(e,t,n);break;case 21:Un(e,t,n);break;case 22:Ke=(s=Ke)||n.memoizedState!==null,Un(e,t,n),Ke=s;break;case 30:Ot(n,t),Un(e,t,n);break;case 7:Ke||Ot(n,t),Un(e,t,n);break;default:Un(e,t,n)}}function xx(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{El(e)}catch(n){Pe(t,t.return,n)}}}function px(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{El(e)}catch(n){Pe(t,t.return,n)}}function kb(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ux),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ux),t;default:throw Error(u(435,e.tag))}}function eo(e,t){var n=kb(e);t.forEach(function(s){if(!n.has(s)){n.add(s);var i=Ub.bind(null,e,s);s.then(i,i)}})}function Xt(e,t,n){var s=t.deletions;if(s!==null)for(var i=0;i<s.length;i++){var r=s[i],f=e,v=t,w=v;e:for(;w!==null;){switch(w.tag){case 27:if(Wa(w.type)){st=w.stateNode,tn=!1;break e}break;case 5:st=w.stateNode,tn=!1;break e;case 3:case 4:st=w.stateNode.containerInfo,tn=!0;break e}w=w.return}if(st===null)throw Error(u(160));mx(f,v,r),st=null,tn=!1,f=r.alternate,f!==null&&(f.return=null),r.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)gx(t,e,n),t=t.sibling}var Hn=null;function gx(e,t,n){var s=e.alternate,i=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(i&4&&(s=e.updateQueue,s=s!==null?s.events:null,s!==null))for(var r=0;r<s.length;r++){var f=s[r];f.ref.impl=f.nextImpl}Xt(t,e,n),Qt(e),i&4&&(Qa(3,e,e.return),xi(3,e),Qa(5,e,e.return));break;case 1:Xt(t,e,n),Qt(e),i&512&&(Ke||s===null||Ot(s,s.return)),i&64&&Et&&(e=e.updateQueue,e!==null&&(t=e.callbacks,t!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?t:n.concat(t))));break;case 26:if(r=Hn,Xt(t,e,n),Qt(e),i&512&&(Ke||s===null||Ot(s,s.return)),i&4)if(i=s!==null?s.memoizedState:null,n=e.memoizedState,s===null)if(n===null)if(e.stateNode===null)if(Et)e.stateNode=ep(e.type,e.memoizedProps,t.containerInfo,e);else{e:{t=e.type,n=e.memoizedProps,i=r.ownerDocument||r;t:switch(t){case"title":s=i.getElementsByTagName("title")[0],(!s||s[Yl]||s[Rt]||s.namespaceURI==="http://www.w3.org/2000/svg"||s.hasAttribute("itemprop"))&&(s=i.createElement(t),i.head.insertBefore(s,i.querySelector("head > title"))),Mt(s,t,n),s[Rt]=e,Tt(s),t=s;break e;case"link":if(r=Sp("link","href",i).get(t+(n.href||""))){for(f=0;f<r.length;f++)if(s=r[f],s.getAttribute("href")===(n.href==null||n.href===""?null:n.href)&&s.getAttribute("rel")===(n.rel==null?null:n.rel)&&s.getAttribute("title")===(n.title==null?null:n.title)&&s.getAttribute("crossorigin")===(n.crossOrigin==null?null:n.crossOrigin)){r.splice(f,1);break t}}s=i.createElement(t),Mt(s,t,n),i.head.appendChild(s);break;case"meta":if(r=Sp("meta","content",i).get(t+(n.content||""))){for(f=0;f<r.length;f++)if(s=r[f],s.getAttribute("content")===(n.content==null?null:""+n.content)&&s.getAttribute("name")===(n.name==null?null:n.name)&&s.getAttribute("property")===(n.property==null?null:n.property)&&s.getAttribute("http-equiv")===(n.httpEquiv==null?null:n.httpEquiv)&&s.getAttribute("charset")===(n.charSet==null?null:n.charSet)){r.splice(f,1);break t}}s=i.createElement(t),Mt(s,t,n),i.head.appendChild(s);break;default:throw Error(u(468,t))}s[Rt]=e,Tt(s),t=s}e.stateNode=t}else Et||yd(r,e.type,e.stateNode);else e.stateNode=wp(r,n,e.memoizedProps);else i!==n?(i===null?(t=s.stateNode,t===null||Ke||t.parentNode.removeChild(t)):i.count--,n===null?Et||yd(r,e.type,e.stateNode):wp(r,n,e.memoizedProps)):n===null&&e.stateNode!==null&&wu(e,e.memoizedProps,s.memoizedProps);break;case 27:Xt(t,e,n),Qt(e),i&512&&(Ke||s===null||Ot(s,s.return)),s!==null&&i&4&&wu(e,e.memoizedProps,s.memoizedProps);break;case 5:if(r=ta,ta=!1,Xt(t,e,n),ta=r,Qt(e),i&512&&(Ke||s===null||Ot(s,s.return)),e.flags&32){t=e.stateNode;try{Xs(t,""),Ge=!0}catch(G){Pe(e,e.return,G)}}i&4&&e.stateNode!=null&&(t=e.memoizedProps,wu(e,t,s!==null?s.memoizedProps:t)),i&1024&&(Au=!0);break;case 6:if(Xt(t,e,n),Qt(e),i&4){if(e.stateNode===null)throw Error(u(162));t=e.memoizedProps,n=e.stateNode;try{n.nodeValue=t,Ge=!0}catch(G){Pe(e,e.return,G)}}break;case 3:if(Ge=!1,po=null,r=Hn,Hn=Ti(t.containerInfo),Xt(t,e,n),Hn=r,Qt(e),i&4&&s!==null&&s.memoizedState.isDehydrated)try{El(t.containerInfo)}catch(G){Pe(e,e.return,G)}Au&&(Au=!1,yx(e)),Ge=!1;break;case 4:i=ta,ta=Et,s=Hf(),r=Hn,Hn=Ti(e.stateNode.containerInfo),Xt(t,e,n),Qt(e),Hn=r,Ge&&gi&&(Ir=!0),Ge=s,ta=i;break;case 12:Xt(t,e,n),Qt(e);break;case 31:Xt(t,e,n),Qt(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,eo(e,t)));break;case 13:Xt(t,e,n),Qt(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(ao=cn()),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,eo(e,t)));break;case 22:r=e.memoizedState!==null,f=s!==null&&s.memoizedState!==null;var v=Et,w=Ke,B=ta;Et=v||r,ta=B||r,Ke=w||f,Xt(t,e,n),Ke=w,ta=B,Et=v,Qt(e),i&8192&&(t=e.stateNode,t._visibility=r?t._visibility&-2:t._visibility|1,!r||s===null||f||Et||Ke||(t=f||Ke,n=Et,s=Ke,Et=r||Et,Ke=t,Za(e,2),Et=n,Ke=s),!r&&ta||_u(e,r)),i&4&&(t=e.updateQueue,t!==null&&(n=t.retryQueue,n!==null&&(t.retryQueue=null,eo(e,n))));break;case 19:Xt(t,e,n),Qt(e),i&4&&(t=e.updateQueue,t!==null&&(e.updateQueue=null,eo(e,t)));break;case 30:i&512&&(Ke||s===null||Ot(s,s.return)),i=Hf(),r=gi,f=(n&335544064)===n,v=e.memoizedProps,gi=f&&ga(v.default,v.update)!=="none",Xt(t,e,n),Qt(e),f&&s!==null&&Ge&&(e.flags|=4),gi=r,Ge=i;break;case 21:break;case 7:i&512&&(Ke||s===null||Ot(s,s.return)),s&&s.stateNode!==null&&(s.stateNode._fragmentFiber=e);default:Xt(t,e,n),Qt(e)}}function Qt(e){var t=e.flags;if(t&2){try{for(var n,s=e.return;s!==null;){if(nx(s)){n=s;break}s=s.return}s=null;for(var i=e.return;i!==null;){if(ju(i)){var r=i.stateNode;s===null?s=[r]:s.push(r)}if(bu(i))break;i=i.return}var f=s;if(n==null)throw Error(u(160));switch(n.tag){case 27:var v=n.stateNode,w=Su(e);Kr(e,w,v,f);break;case 5:var B=n.stateNode;n.flags&32&&(Xs(B,""),n.flags&=-33);var G=Su(e);Kr(e,G,B,f);break;case 3:case 4:var P=n.stateNode.containerInfo,O=Su(e);ku(e,O,P,f);break;default:throw Error(u(161))}}catch($){Pe(e,e.return,$)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yx(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yx(t),t.tag===5&&t.flags&1024&&(t=t.stateNode,Cl=!0,t.reset(),Cl=!1),e=e.sibling}}function ul(e,t){if(t.subtreeFlags&9270)for(t=t.child;t!==null;)vx(t,e),t=t.sibling;else cx(t)}function vx(e,t){var n=e.alternate;if(n===null)Tu(e,!1);else switch(e.tag){case 3:if(Du=na=!1,lx(),ul(t,e),!na&&!Ir){if(e=Wn,e!==null)for(var s=0;s<e.length;s+=3){n=e[s];var i=e[s+1];ip(n,e[s+2]),n=n.ownerDocument.documentElement,n!==null&&n.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"})),Du=!0}Wn=null;break;case 5:ul(t,e);break;case 4:s=na,na=!1,ul(t,e),na&&(Ir=!0),na=s;break;case 22:e.memoizedState===null&&(n.memoizedState!==null?Tu(e,!1):ul(t,e));break;case 30:s=na,i=lx(),na=!1,ul(t,e),na&&(e.flags|=4);var r=e.memoizedProps,f=e.stateNode;t=pa(r,f),f=pa(n.memoizedProps,f);var v=ga(r.default,r.update);v==="none"?t=!1:(r=n.memoizedState,n.memoizedState=null,n=e.child,en=0,t=Ru(e,n,t,f,v,r,!0),en!==(r===null?0:r.length)&&(e.flags|=32)),(e.flags&4)!==0&&t?(gl(e,e.memoizedProps.onUpdate),Wn=i):i!==null&&(i.push.apply(i,Wn),Wn=i),na=(e.flags&32)!==0?!0:s;break;default:ul(t,e)}}function aa(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)dx(e,t.alternate,t),t=t.sibling}function Za(e,t){for(e=e.child;e!==null;){var n=e,s=t;switch(n.tag){case 0:case 11:case 14:case 15:Qa(4,n,n.return),Za(n,s);break;case 1:Ot(n,n.return);var i=n.stateNode;typeof i.componentWillUnmount=="function"&&ex(n,n.return,i),Za(n,s);break;case 27:(s&2)!==0&&yp(n.stateNode,n.type,n.memoizedProps);case 5:Ot(n,n.return),n.tag!==5&&n.tag!==27||pi(n),Za(n,s);break;case 6:pi(n);break;case 26:Ot(n,n.return),i=n.stateNode,n.memoizedState!==null||i===null||Ke||i.parentNode.removeChild(i),Za(n,s);break;case 22:n.memoizedState===null&&Za(n,s);break;case 30:Ot(n,n.return),Za(n,s);break;case 7:Ot(n,n.return);default:Za(n,s)}e=e.sibling}}function Bn(e,t,n){for(n=(t.subtreeFlags&8772)!==0?n:n&-2,t=t.child;t!==null;){var s=t.alternate,i=e,r=t,f=r.flags,v=(n&1)!==0;switch(r.tag){case 0:case 11:case 15:Bn(i,r,n),xi(4,r);break;case 1:if(Bn(i,r,n),s=r,i=s.stateNode,typeof i.componentDidMount=="function")try{i.componentDidMount()}catch(G){Pe(s,s.return,G)}if(s=r,i=s.updateQueue,i!==null){var w=s.stateNode;try{var B=i.shared.hiddenCallbacks;if(B!==null)for(i.shared.hiddenCallbacks=null,i=0;i<B.length;i++)$h(B[i],w)}catch(G){Pe(s,s.return,G)}}v&&f&64&&Wm(r),In(r,r.return);break;case 27:(n&2)!==0&&ax(r);case 5:r.tag!==5&&r.tag!==27||tx(r),Bn(i,r,n),v&&s===null&&f&4&&Nu(r),In(r,r.return);break;case 6:tx(r);break;case 26:w=r.stateNode,r.memoizedState!==null||w===null||Et||yd(Ti(w.ownerDocument),r.type,w),Bn(i,r,n),v&&s===null&&f&4&&Nu(r),In(r,r.return);break;case 12:Bn(i,r,n);break;case 31:Bn(i,r,n),v&&f&4&&xx(i,r);break;case 13:Bn(i,r,n),v&&f&4&&px(i,r);break;case 22:r.memoizedState===null&&Bn(i,r,n),In(r,r.return);break;case 30:Bn(i,r,n),In(r,r.return);break;case 7:In(r,r.return);default:Bn(i,r,n)}t=t.sibling}}function Mu(e,t){var n=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==n&&(e!=null&&e.refCount++,n!=null&&ni(n))}function Lu(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&ni(e))}function zn(e,t,n,s){var i=(n&335544064)===n;if(t.subtreeFlags&(i?10262:10256))for(t=t.child;t!==null;)bx(e,t,n,s),t=t.sibling;else i&&ox(t)}function bx(e,t,n,s){var i=(n&335544064)===n;i&&t.alternate===null&&t.return!==null&&t.return.alternate!==null&&Fr(t);var r=t.flags;switch(t.tag){case 0:case 11:case 15:zn(e,t,n,s),r&2048&&xi(9,t);break;case 1:zn(e,t,n,s);break;case 3:zn(e,t,n,s),i&&Du&&(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="")),r&2048&&(r=null,t.alternate!==null&&(r=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==r&&(t.refCount++,r!=null&&ni(r)));break;case 12:if(r&2048){zn(e,t,n,s),r=t.stateNode;try{var f=t.memoizedProps,v=f.id,w=f.onPostCommit;typeof w=="function"&&w(v,t.alternate===null?"mount":"update",r.passiveEffectDuration,-0)}catch(B){Pe(t,t.return,B)}}else zn(e,t,n,s);break;case 31:zn(e,t,n,s);break;case 13:zn(e,t,n,s);break;case 23:break;case 22:f=t.stateNode,v=t.alternate,t.memoizedState!==null?(i&&v!==null&&v.memoizedState===null&&Fr(v),f._visibility&2?zn(e,t,n,s):yi(e,t)):(i&&v!==null&&v.memoizedState!==null&&Fr(t),f._visibility&2?zn(e,t,n,s):(f._visibility|=2,dl(e,t,n,s,(t.subtreeFlags&10256)!==0||!1))),r&2048&&Mu(v,t);break;case 24:zn(e,t,n,s),r&2048&&Lu(t.alternate,t);break;case 30:i&&(r=t.alternate,r!==null&&(ea(r.child,!0),ea(t.child,!0))),zn(e,t,n,s);break;default:zn(e,t,n,s)}}function dl(e,t,n,s,i){for(i=i&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var r=e,f=t,v=n,w=s,B=f.flags;switch(f.tag){case 0:case 11:case 15:dl(r,f,v,w,i),xi(8,f);break;case 23:break;case 22:var G=f.stateNode;f.memoizedState!==null?G._visibility&2?dl(r,f,v,w,i):yi(r,f):(G._visibility|=2,dl(r,f,v,w,i)),i&&B&2048&&Mu(f.alternate,f);break;case 24:dl(r,f,v,w,i),i&&B&2048&&Lu(f.alternate,f);break;default:dl(r,f,v,w,i)}t=t.sibling}}function yi(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,s=t,i=s.flags;switch(s.tag){case 22:yi(n,s),i&2048&&Mu(s.alternate,s);break;case 24:yi(n,s),i&2048&&Lu(s.alternate,s);break;default:yi(n,s)}t=t.sibling}}var Es=8192;function zs(e,t,n){if(e.subtreeFlags&Es)for(e=e.child;e!==null;)jx(e,t,n),e=e.sibling}function jx(e,t,n){switch(e.tag){case 26:zs(e,t,n),e.flags&Es&&(e.memoizedState!==null?A0(n,Hn,e.memoizedState,e.memoizedProps):(e=e.stateNode,(t&335544128)===t&&Ep(n,e)));break;case 5:zs(e,t,n),e.flags&Es&&(e=e.stateNode,(t&335544128)===t&&Ep(n,e));break;case 3:case 4:var s=Hn;Hn=Ti(e.stateNode.containerInfo),zs(e,t,n),Hn=s;break;case 22:e.memoizedState===null&&(s=e.alternate,s!==null&&s.memoizedState!==null?(s=Es,Es=16777216,zs(e,t,n),Es=s):zs(e,t,n));break;case 30:if((e.flags&Es)!==0&&(s=e.memoizedProps.name,s!=null&&s!=="auto")){var i=e.stateNode;i.paired=null,xn===null&&(xn=new Map),xn.set(s,i)}zs(e,t,n);break;default:zs(e,t,n)}}function Nx(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 vi(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];zt=s,Sx(s,e)}Nx(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)wx(e),e=e.sibling}function wx(e){switch(e.tag){case 0:case 11:case 15:vi(e),e.flags&2048&&Qa(9,e,e.return);break;case 3:vi(e);break;case 12:vi(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,to(e)):vi(e);break;default:vi(e)}}function to(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var n=0;n<t.length;n++){var s=t[n];zt=s,Sx(s,e)}Nx(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Qa(8,t,t.return),to(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,to(t));break;default:to(t)}e=e.sibling}}function Sx(e,t){for(;zt!==null;){var n=zt;switch(n.tag){case 0:case 11:case 15:Qa(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var s=n.memoizedState.cachePool.pool;s!=null&&s.refCount++}break;case 24:ni(n.memoizedState.cache)}if(s=n.child,s!==null)s.return=n,zt=s;else e:for(n=e;zt!==null;){s=zt;var i=s.sibling,r=s.return;if(hx(s),s===n){zt=null;break e}if(i!==null){i.return=r,zt=i;break e}zt=r}}}var Tb={getCacheForType:function(e){var t=At(pt),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return At(pt).controller.signal}},Cb=typeof WeakMap=="function"?WeakMap:Map,Xe=0,et=null,Oe=null,He=0,Je=0,pn=null,Ka=!1,fl=!1,Uu=!1,Ta=0,dt=0,Ja=0,Rs=0,no=0,gn=0,hl=0,bi=null,nn=null,Hu=!1,ao=0,kx=0,so=1/0,lo=null,Pa=null,lt=0,qn=null,As=null,sa=0,Bu=0,qu=null,Tx=null,ml=null,xl=null,pl=null,ji=0,io=null;function yn(){return(Xe&2)!==0&&He!==0?He&-He:he.T!==null?Pu():zf()}function Cx(){if(gn===0)if((He&536870912)===0||_e){var e=er;er<<=1,(er&3932160)===0&&(er=262144),gn=e}else gn=536870912;return e=Dt.current,e!==null&&(e.flags|=32),gn}function gl(e,t){if(t!=null){var n=e.stateNode,s=n.ref;s===null&&(s=n.ref=rp(pa(e.memoizedProps,n))),xl===null&&(xl=[]),xl.push(t.bind(null,s))}}function an(e,t,n){(e===et&&(Je===2||Je===9)||e.cancelPendingCommit!==null)&&(yl(e,0),Fa(e,He,gn,!1)),Gl(e,n),((Xe&2)===0||e!==et)&&(e===et&&((Xe&2)===0&&(Rs|=n),dt===4&&Fa(e,He,gn,!1)),la(e))}function Ex(e,t,n){if((Xe&6)!==0)throw Error(u(327));var s=!n&&(t&127)===0&&(t&e.expiredLanes)===0||$l(e,t),i=s?Rb(e,t):Gu(e,t,!0),r=s;do{if(i===0){fl&&!s&&Fa(e,t,0,!1);break}else{if(n=e.current.alternate,r&&!Eb(n)){i=Gu(e,t,!1),r=!1;continue}if(i===2){if(r=t,e.errorRecoveryDisabledLanes&r)var f=0;else f=e.pendingLanes&-536870913,f=f!==0?f:f&536870912?536870912:0;if(f!==0){t=f;e:{var v=e;i=bi;var w=v.current.memoizedState.isDehydrated;if(w&&(yl(v,f).flags|=256),f=Gu(v,f,!1),f!==2&&f!==6){if(Uu&&!w){v.errorRecoveryDisabledLanes|=r,Rs|=r,i=4;break e}r=nn,nn=i,r!==null&&(nn===null?nn=r:nn.push.apply(nn,r))}i=f}if(r=!1,i!==2)continue}}if(i===1){yl(e,0),Fa(e,t,0,!0);break}e:{switch(s=e,r=i,r){case 0:case 1:throw Error(u(345));case 4:if((t&4194048)!==t&&(t&62914560)!==t)break;case 6:Fa(s,t,gn,!Ka);break e;case 2:nn=null;break;case 3:case 5:break;default:throw Error(u(329))}if((t&62914560)===t&&(i=ao+300-cn(),10<i)){if(Fa(s,t,gn,!Ka),nr(s,0,!0)!==0)break e;sa=t,s.timeoutHandle=rd(zx.bind(null,s,n,nn,lo,Hu,t,gn,Rs,hl,Ka,r,"Throttled",-0,0),i);break e}zx(s,n,nn,lo,Hu,t,gn,Rs,hl,Ka,r,null,-0,0)}}break}while(!0);la(e)}function zx(e,t,n,s,i,r,f,v,w,B,G,P,O,$){e.timeoutHandle=-1;var oe=t.subtreeFlags,xe=(r&335544064)===r;if(P=null,(xe||oe&8192||(oe&16785408)===16785408)&&(P={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Jn},xn=null,jx(t,r,P),xe&&(oe=P,xe=e.containerInfo,xe=(xe.nodeType===9?xe:xe.ownerDocument).__reactViewTransition,xe!=null&&(oe.count++,oe.waitingForViewTransition=!0,oe=zi.bind(oe),xe.finished.then(oe,oe))),oe=(r&62914560)===r?ao-cn():(r&4194048)===r?kx-cn():0,oe=D0(P,oe),oe!==null)){sa=r,e.cancelPendingCommit=oe(Ux.bind(null,e,t,r,n,s,i,f,v,w,B,G,P,null,O,$)),Fa(e,r,f,!B);return}Ux(e,t,r,n,s,i,f,v,w,B,G,P)}function Eb(e){for(var t=e;;){var n=t.tag;if((n===0||n===11||n===15)&&t.flags&16384&&(n=t.updateQueue,n!==null&&(n=n.stores,n!==null)))for(var s=0;s<n.length;s++){var i=n[s],r=i.getSnapshot;i=i.value;try{if(!hn(r(),i))return!1}catch{return!1}}if(n=t.child,t.subtreeFlags&16384&&n!==null)n.return=t,t=n;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 Fa(e,t,n,s){t=Sf(e,t),t&=~no,t&=~Rs,e.suspendedLanes|=t,e.pingedLanes&=~t,s&&(e.warmLanes|=t),s=e.expirationTimes;for(var i=t;0<i;){var r=31-dn(i),f=1<<r;s[r]=-1,i&=~f}n!==0&&Tf(e,n,t)}function ro(){return(Xe&6)===0?(Ni(0),!1):!0}function $u(){if(Oe!==null){if(Je===0)var e=Oe.return;else e=Oe,ba=ys=null,Jc(e),sl=null,li=0,e=Oe;for(;e!==null;)Im(e.alternate,e),e=e.return;Oe=null}}function yl(e,t){var n=e.timeoutHandle;return n!==-1&&(e.timeoutHandle=-1,Ib(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),sa=0,$u(),et=e,Oe=n=ya(e.current,null),He=t,Je=0,pn=null,Ka=!1,fl=$l(e,t),Uu=!1,hl=gn=no=Rs=Ja=dt=0,nn=bi=null,Hu=!1,Ta=Sf(e,t),xr(),n}function Rx(e,t){ze=null,he.H=qr,t===al||t===Tr?(t=Uh(),Je=3):t===Lc?(t=Uh(),Je=4):Je=t===uu?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,pn=t,Oe===null&&(dt=1,$r(e,kn(t,e.current)))}function Ax(){var e=Dt.current;return e===null?!0:(He&4194048)===He?Bt===null:(He&62914560)===He||(He&536870912)!==0?e===Bt:!1}function Dx(){var e=he.H;return he.H=qr,e===null?qr:e}function _x(){var e=he.A;return he.A=Tb,e}function oo(){dt=4,Ka||(He&4194048)!==He&&Dt.current!==null||(fl=!0),(Ja&134217727)===0&&(Rs&134217727)===0||et===null||Fa(et,He,gn,!1)}function Gu(e,t,n){var s=Xe;Xe|=2;var i=Dx(),r=_x();(et!==e||He!==t)&&(lo=null,yl(e,t)),t=!1;var f=dt;e:do try{if(Je!==0&&Oe!==null){var v=Oe,w=pn;switch(Je){case 8:$u(),f=6;break e;case 3:case 2:case 9:case 6:Dt.current===null&&(t=!0);var B=Je;if(Je=0,pn=null,vl(e,v,w,B),n&&fl){f=0;break e}break;default:B=Je,Je=0,pn=null,vl(e,v,w,B)}}zb(),f=dt;break}catch(G){Rx(e,G)}while(!0);return t&&e.shellSuspendCounter++,ba=ys=null,Xe=s,he.H=i,he.A=r,Oe===null&&(et=null,He=0,xr()),f}function zb(){for(;Oe!==null;)Ox(Oe)}function Rb(e,t){var n=Xe;Xe|=2;var s=Dx(),i=_x();et!==e||He!==t?(lo=null,so=cn()+500,yl(e,t)):fl=$l(e,t);e:do try{if(Je!==0&&Oe!==null){t=Oe;var r=pn;t:switch(Je){case 1:Je=0,pn=null,vl(e,t,r,1);break;case 2:case 9:if(Mh(r)){Je=0,pn=null,Mx(t);break}t=function(){Je!==2&&Je!==9||et!==e||(Je=7),la(e)},r.then(t,t);break e;case 3:Je=7;break e;case 4:Je=5;break e;case 7:Mh(r)?(Je=0,pn=null,Mx(t)):(Je=0,pn=null,vl(e,t,r,7));break;case 5:var f=null;switch(Oe.tag){case 26:f=Oe.memoizedState;case 5:case 27:var v=Oe;if(f?Tp(f):v.stateNode.complete){Je=0,pn=null;var w=v.sibling;if(w!==null)Oe=w;else{var B=v.return;B!==null?(Oe=B,co(B)):Oe=null}break t}}Je=0,pn=null,vl(e,t,r,5);break;case 6:Je=0,pn=null,vl(e,t,r,6);break;case 8:$u(),dt=6;break e;default:throw Error(u(462))}}Ab();break}catch(G){Rx(e,G)}while(!0);return ba=ys=null,he.H=s,he.A=i,Xe=n,Oe!==null?0:(et=null,He=0,xr(),dt)}function Ab(){for(;Oe!==null&&!ct();)Ox(Oe)}function Ox(e){var t=Pm(e.alternate,e,Ta);e.memoizedProps=e.pendingProps,t===null?co(e):Oe=t}function Mx(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=Ym(n,t,t.pendingProps,t.type,void 0,He);break;case 11:t=Ym(n,t,t.pendingProps,t.type.render,t.ref,He);break;case 5:Jc(t);var s=t;s===Ct&&(_e?(jr(s),s.tag===5&&s.stateNode!=null&&(tt=s.stateNode)):(jr(s),_e=!0));default:Im(n,t),t=Oe=Sh(t,Ta),t=Pm(n,t,Ta)}e.memoizedProps=e.pendingProps,t===null?co(e):Oe=t}function vl(e,t,n,s){ba=ys=null,Jc(t),sl=null,li=0;var i=t.return;try{if(yb(e,i,t,n,He)){dt=1,$r(e,kn(n,e.current)),Oe=null;return}}catch(r){if(i!==null)throw Oe=i,r;dt=1,$r(e,kn(n,e.current)),Oe=null;return}t.flags&32768?(_e||s===1?e=!0:fl||(He&536870912)!==0?e=!1:(Ka=e=!0,(s===2||s===9||s===3||s===6)&&(s=Dt.current,s!==null&&s.tag===13&&(s.flags|=16384))),Lx(t,e)):co(t)}function co(e){var t=e;do{if((t.flags&32768)!==0){Lx(t,Ka);return}e=t.return;var n=Nb(t.alternate,t,Ta);if(n!==null){Oe=n;return}if(t=t.sibling,t!==null){Oe=t;return}Oe=t=e}while(t!==null);dt===0&&(dt=5)}function Lx(e,t){do{var n=wb(e.alternate,e);if(n!==null){n.flags&=32767,Oe=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){Oe=e;return}Oe=e=n}while(e!==null);dt=6,Oe=null}function Ux(e,t,n,s,i,r,f,v,w,B,G,P){e.cancelPendingCommit=null;do uo();while(lt!==0);if((Xe&6)!==0)throw Error(u(327));if(t!==null){if(t===e.current)throw Error(u(177));e===et&&(Oe=et=null,He=0),As=t,qn=e,sa=n,qu=i,Tx=s,Db(e,t,n,f,v,w,P)}}function Db(e,t,n,s,i,r,f){var v=t.lanes|t.childLanes;if(Bu=v,v|=wc,sv(e,n,v,s,i,r),xl=null,(n&335544064)===n?(pl=ib(e),s=10262):(pl=null,s=10256),(t.subtreeFlags&s)!==0||(t.flags&s)!==0?(e.callbackNode=null,e.callbackPriority=0,Hb(Ii,function(){return Qu(),null})):(e.callbackNode=null,e.callbackPriority=0),Jr=!1,s=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||s){s=he.T,he.T=null,i=be.p,be.p=2,r=Xe,Xe|=4;try{Sb(e,t,n)}finally{Xe=r,be.p=i,he.T=s}}lt=1,Jr?ml=s0(f,e.containerInfo,pl,Yu,Vu,Ob,Xu,Qu,_b):(Yu(),Vu(),Xu())}function _b(e){if(lt!==0){var t=qn.onRecoverableError;t(e,{componentStack:null})}}function Ob(){lt===3&&(lt=0,vx(As,qn),lt=4)}function Yu(){if(lt===1){lt=0;var e=qn,t=As,n=sa,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=he.T,he.T=null;var i=be.p;be.p=2;var r=Xe;Xe|=4;try{gi=Ir=!1,gx(t,e,n),n=sd;var f=mh(e.containerInfo),v=n.focusedElem,w=n.selectionRange;if(f!==v&&v&&v.ownerDocument&&hh(v.ownerDocument.documentElement,v)){if(w!==null&&yc(v)){var B=w.start,G=w.end;if(G===void 0&&(G=B),"selectionStart"in v)v.selectionStart=B,v.selectionEnd=Math.min(G,v.value.length);else{var P=v.ownerDocument||document,O=P&&P.defaultView||window;if(O.getSelection){var $=O.getSelection(),oe=v.textContent.length,xe=Math.min(w.start,oe),Re=w.end===void 0?xe:Math.min(w.end,oe);!$.extend&&xe>Re&&(f=Re,Re=xe,xe=f);var H=fh(v,xe),A=fh(v,Re);if(H&&A&&($.rangeCount!==1||$.anchorNode!==H.node||$.anchorOffset!==H.offset||$.focusNode!==A.node||$.focusOffset!==A.offset)){var q=P.createRange();q.setStart(H.node,H.offset),$.removeAllRanges(),xe>Re?($.addRange(q),$.extend(A.node,A.offset)):(q.setEnd(A.node,A.offset),$.addRange(q))}}}}for(P=[],$=v;$=$.parentNode;)$.nodeType===1&&P.push({element:$,left:$.scrollLeft,top:$.scrollTop});for(typeof v.focus=="function"&&v.focus(),v=0;v<P.length;v++){var Z=P[v];Z.element.scrollLeft=Z.left,Z.element.scrollTop=Z.top}}Cl=!!ad,sd=ad=null}finally{Xe=r,be.p=i,he.T=s}}e.current=t,lt=2}}function Vu(){if(lt===2){lt=0;var e=qn,t=As,n=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||n){n=he.T,he.T=null;var s=be.p;be.p=2;var i=Xe;Xe|=4;try{dx(e,t.alternate,t)}finally{Xe=i,be.p=s,he.T=n}}lt=3}}function Xu(){if(lt===4||lt===3){lt=0;var e=ml;ml=null,on();var t=qn,n=As,s=sa,i=Tx,r=(s&335544064)===s?10262:10256;if((n.subtreeFlags&r)!==0||(n.flags&r)!==0?lt=5:(lt=0,As=qn=null,Hx(t,t.pendingLanes)),r=t.pendingLanes,r===0&&(Pa=null),ec(s),n=n.stateNode,un&&typeof un.onCommitFiberRoot=="function")try{un.onCommitFiberRoot(ql,n,void 0,(n.current.flags&128)===128)}catch{}if(i!==null){n=he.T,r=be.p,be.p=2,he.T=null;try{for(var f=t.onRecoverableError,v=0;v<i.length;v++){var w=i[v];f(w.value,{componentStack:w.stack})}}finally{he.T=n,be.p=r}}if(i=xl,f=pl,pl=null,i!==null&&(xl=null,f===null&&(f=[]),e!==null))for(w=0;w<i.length;w++)n=(0,i[w])(f),n!==void 0&&e.finished.finally(n);(sa&3)!==0&&uo(),la(t),r=t.pendingLanes,(s&261930)!==0&&(r&42)!==0?t===io?ji++:(ji=0,io=t):(ji=0,io=null),Ni(0)}}function Hx(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,ni(t)))}function uo(){return ml!==null&&(ml.skipTransition(),ml=null),Yu(),Vu(),Xu(),Qu()}function Qu(){if(lt!==5)return!1;var e=qn,t=Bu;Bu=0;var n=ec(sa),s=he.T,i=be.p;try{be.p=32>n?32:n,he.T=null,n=qu,qu=null;var r=qn,f=sa;if(lt=0,As=qn=null,sa=0,(Xe&6)!==0)throw Error(u(331));var v=Xe;if(Xe|=4,wx(r.current),bx(r,r.current,f,n),Xe=v,Ni(0,!1),un&&typeof un.onPostCommitFiberRoot=="function")try{un.onPostCommitFiberRoot(ql,r)}catch{}return!0}finally{be.p=i,he.T=s,Hx(e,t)}}function Bx(e,t,n){t=kn(n,t),t=cu(e.stateNode,t,2),e=Ga(e,t,2),e!==null&&(Gl(e,2),la(e))}function Pe(e,t,n){if(e.tag===3)Bx(e,e,n);else for(;t!==null;){if(t.tag===3){Bx(t,e,n);break}else if(t.tag===1){var s=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof s.componentDidCatch=="function"&&(Pa===null||!Pa.has(s))){e=kn(n,e),n=Mm(2),s=Ga(t,n,2),s!==null&&(Lm(n,s,t,e),Gl(s,2),la(s));break}}t=t.return}}function Zu(e,t,n){var s=e.pingCache;if(s===null){s=e.pingCache=new Cb;var i=new Set;s.set(t,i)}else i=s.get(t),i===void 0&&(i=new Set,s.set(t,i));i.has(n)||(Uu=!0,i.add(n),e=Mb.bind(null,e,t,n),t.then(e,e))}function Mb(e,t,n){var s=e.pingCache;s!==null&&s.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,et===e&&(He&n)===n&&((dt===4||dt===3&&(He&62914560)===He&&300>cn()-ao)&&(Xe&2)===0?yl(e,0):no|=n,hl===He&&(hl=0)),la(e)}function qx(e,t){t===0&&(t=kf()),e=xs(e,t),e!==null&&(Gl(e,t),la(e))}function Lb(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),qx(e,n)}function Ub(e,t){var n=0;switch(e.tag){case 31:case 13:var s=e.stateNode,i=e.memoizedState;i!==null&&(n=i.retryLane);break;case 19:s=e.stateNode;break;case 22:s=e.stateNode._retryCache;break;default:throw Error(u(314))}s!==null&&s.delete(t),qx(e,n)}function Hb(e,t){return Ht(e,t)}var bl=null,jl=null,Ku=!1,fo=!1,Ju=!1,Ia=0;function la(e){e!==jl&&e.next===null&&(jl===null?bl=jl=e:jl=jl.next=e),fo=!0,Ku||(Ku=!0,qb())}function Ni(e,t){if(!Ju&&fo){Ju=!0;do for(var n=!1,s=bl;s!==null;){if(e!==0){var i=s.pendingLanes;if(i===0)var r=0;else{var f=s.suspendedLanes,v=s.pingedLanes;r=(1<<31-dn(42|e)+1)-1,r&=i&~(f&~v),r=r&201326741?r&201326741|1:r?r|2:0}r!==0&&(n=!0,Vx(s,r))}else r=He,r=nr(s,s===et?r:0,s.cancelPendingCommit!==null||s.timeoutHandle!==-1),(r&3)===0||$l(s,r)||(n=!0,Vx(s,r));s=s.next}while(n);Ju=!1}}function Bb(){$x()}function $x(){fo=Ku=!1;var e=0;Ia!==0&&Fb()&&(e=Ia);for(var t=cn(),n=null,s=bl;s!==null;){var i=s.next,r=Gx(s,t);r===0?(s.next=null,n===null?bl=i:n.next=i,i===null&&(jl=n)):(n=s,(e!==0||(r&3)!==0)&&(fo=!0)),s=i}lt!==0&&lt!==5||Ni(e),Ia!==0&&(Ia=0)}function Gx(e,t){for(var n=e.suspendedLanes,s=e.pingedLanes,i=e.expirationTimes,r=e.pendingLanes&-62914561;0<r;){var f=31-dn(r),v=1<<f,w=i[f];w===-1?((v&n)===0||(v&s)!==0)&&(i[f]=av(v,t)):w<=t&&(e.expiredLanes|=v),r&=~v}if(t=et,n=He,n=nr(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s=e.callbackNode,n===0||e===t&&(Je===2||Je===9)||e.cancelPendingCommit!==null)return s!==null&&s!==null&&ft(s),e.callbackNode=null,e.callbackPriority=0;if((n&3)===0||$l(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(s!==null&&ft(s),ec(n)){case 2:case 8:n=Nf;break;case 32:n=Ii;break;case 268435456:n=wf;break;default:n=Ii}return s=Yx.bind(null,e),n=Ht(n,s),e.callbackPriority=t,e.callbackNode=n,t}return s!==null&&s!==null&&ft(s),e.callbackPriority=2,e.callbackNode=null,2}function Yx(e,t){if(lt!==0&&lt!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(uo()&&e.callbackNode!==n)return null;var s=He;return s=nr(e,e===et?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),s===0?null:(Ex(e,s,t),Gx(e,cn()),e.callbackNode!=null&&e.callbackNode===n?Yx.bind(null,e):null)}function Vx(e,t){if(uo())return null;Ex(e,t,!0)}function qb(){Wb(function(){(Xe&6)!==0?Ht(jf,Bb):$x()})}function Pu(){if(Ia===0){var e=js;e===0&&(e=Wi,Wi<<=1,(Wi&261888)===0&&(Wi=256)),Ia=e}return Ia}function Xx(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:rr(e)}function $b(e,t,n,s,i){if(t==="submit"&&n&&n.stateNode===i){var r=Xx((i[It]||null).action),f=s.submitter;f&&(t=(t=f[It]||null)?Xx(t.formAction):f.getAttribute("formAction"),t!==null&&(r=t,f=null));var v=new dr("action","action",null,s,i);e.push({event:v,listeners:[{instance:null,listener:function(){if(s.defaultPrevented){if(Ia!==0){var w=new FormData(i,f);su(n,{pending:!0,data:w,method:i.method,action:r},null,w)}}else typeof r=="function"&&(v.preventDefault(),w=new FormData(i,f),su(n,{pending:!0,data:w,method:i.method,action:r},r,w))},currentTarget:i}]})}}for(var Fu=0;Fu<Nc.length;Fu++){var Iu=Nc[Fu],Gb=Iu.toLowerCase(),Yb=Iu[0].toUpperCase()+Iu.slice(1);Ln(Gb,"on"+Yb)}Ln(gh,"onAnimationEnd"),Ln(yh,"onAnimationIteration"),Ln(vh,"onAnimationStart"),Ln("dblclick","onDoubleClick"),Ln("focusin","onFocus"),Ln("focusout","onBlur"),Ln(Iv,"onTransitionRun"),Ln(Wv,"onTransitionStart"),Ln(eb,"onTransitionCancel"),Ln(bh,"onTransitionEnd"),Ys("onMouseEnter",["mouseout","mouseover"]),Ys("onMouseLeave",["mouseout","mouseover"]),Ys("onPointerEnter",["pointerout","pointerover"]),Ys("onPointerLeave",["pointerout","pointerover"]),fs("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),fs("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),fs("onBeforeInput",["compositionend","keypress","textInput","paste"]),fs("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),fs("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var wi="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(" "),Vb=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(wi));function Qx(e,t){t=(t&4)!==0;for(var n=0;n<e.length;n++){var s=e[n],i=s.event;s=s.listeners;e:{var r=void 0;if(t)for(var f=s.length-1;0<=f;f--){var v=s[f],w=v.instance,B=v.currentTarget;if(v=v.listener,w!==r&&i.isPropagationStopped())break e;r=v,i.currentTarget=B;try{r(i)}catch(G){mr(G)}i.currentTarget=null,r=w}else for(f=0;f<s.length;f++){if(v=s[f],w=v.instance,B=v.currentTarget,v=v.listener,w!==r&&i.isPropagationStopped())break e;r=v,i.currentTarget=B;try{r(i)}catch(G){mr(G)}i.currentTarget=null,r=w}}}}function Me(e,t){var n=t[Af];n===void 0&&(n=t[Af]=new Set);var s=e+"__bubble";n.has(s)||(Zx(t,e,2,!1),n.add(s))}function Wu(e,t,n){var s=0;t&&(s|=4),Zx(n,e,s,t)}var ho="_reactListening"+Math.random().toString(36).slice(2);function ed(e){if(!e[ho]){e[ho]=!0,Of.forEach(function(n){n!=="selectionchange"&&(Vb.has(n)||Wu(n,!1,e),Wu(n,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[ho]||(t[ho]=!0,Wu("selectionchange",!1,t))}}function Zx(e,t,n,s){switch(Lp(t)){case 2:var i=L0;break;case 8:i=U0;break;default:i=bd}n=i.bind(null,t,n,e),i=void 0,!oc||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(i=!0),s?i!==void 0?e.addEventListener(t,n,{capture:!0,passive:i}):e.addEventListener(t,n,!0):i!==void 0?e.addEventListener(t,n,{passive:i}):e.addEventListener(t,n,!1)}function td(e,t,n,s,i){var r=s;if((t&1)===0&&(t&2)===0&&s!==null)e:for(;;){if(s===null)return;var f=s.tag;if(f===3||f===4){var v=s.stateNode.containerInfo;if(v===i)break;if(f===4)for(f=s.return;f!==null;){var w=f.tag;if((w===3||w===4)&&f.stateNode.containerInfo===i)return;f=f.return}for(;v!==null;){if(f=ds(v),f===null)return;if(w=f.tag,w===5||w===6||w===26||w===27){s=r=f;continue e}v=v.parentNode}}s=s.return}Zf(function(){var B=r,G=ic(n),P=[];e:{var O=jh.get(e);if(O!==void 0){var $=dr,oe=e;switch(e){case"keypress":if(cr(n)===0)break e;case"keydown":case"keyup":$=Ev;break;case"focusin":oe="focus",$=fc;break;case"focusout":oe="blur",$=fc;break;case"beforeblur":case"afterblur":$=fc;break;case"click":if(n.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":$=Pf;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":$=pv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":$=_v;break;case gh:case yh:case vh:$=vv;break;case bh:$=Mv;break;case"scroll":case"scrollend":$=mv;break;case"wheel":$=Uv;break;case"copy":case"cut":case"paste":$=jv;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":$=If;break;case"submit":$=Av;break;case"toggle":case"beforetoggle":$=Bv}var xe=(t&4)!==0,Re=!xe&&(e==="scroll"||e==="scrollend"),H=xe?O!==null?O+"Capture":null:O;xe=[];for(var A=B,q;A!==null;){var Z=A;if(q=Z.stateNode,Z=Z.tag,Z!==5&&Z!==26&&Z!==27||q===null||H===null||(Z=Xl(A,H),Z!=null&&xe.push(Si(A,Z,q))),Re)break;A=A.return}0<xe.length&&(O=new $(O,oe,null,n,G),P.push({event:O,listeners:xe}))}}if((t&7)===0){e:{if($=e==="mouseover"||e==="pointerover",O=e==="mouseout"||e==="pointerout",$&&n!==lc&&(oe=n.relatedTarget||n.fromElement)&&(ds(oe)||oe[qs]))break e;(O||$)&&(oe=G.window===G?G:($=G.ownerDocument)?$.defaultView||$.parentWindow:window,O?($=n.relatedTarget||n.toElement,O=B,$=$?ds($):null,$!==null&&(Re=h($),xe=$.tag,$!==Re||xe!==5&&xe!==27&&xe!==6)&&($=null)):(O=null,$=B),O!==$&&(xe=Pf,Z="onMouseLeave",H="onMouseEnter",A="mouse",(e==="pointerout"||e==="pointerover")&&(xe=If,Z="onPointerLeave",H="onPointerEnter",A="pointer"),Re=O==null?oe:Vl(O),q=$==null?oe:Vl($),oe=new xe(Z,A+"leave",O,n,G),oe.target=Re,oe.relatedTarget=q,Z=null,ds(G)===B&&(xe=new xe(H,A+"enter",$,n,G),xe.target=q,xe.relatedTarget=Re,Z=xe),Re=Z,xe=O&&$?te(O,$,Xb):null,O!==null&&Kx(P,oe,O,xe,!1),$!==null&&Re!==null&&Kx(P,Re,$,xe,!0)))}e:{if(O=B?Vl(B):window,$=O.nodeName&&O.nodeName.toLowerCase(),$==="select"||$==="input"&&O.type==="file")var me=ih;else if(sh(O))if(rh)me=Jv;else{me=Zv;var Be=Qv}else $=O.nodeName,!$||$.toLowerCase()!=="input"||O.type!=="checkbox"&&O.type!=="radio"?B&&sc(B.elementType)&&(me=ih):me=Kv;if(me&&(me=me(e,B))){lh(P,me,n,G);break e}Be&&Be(e,O,B)}switch(Be=B?Vl(B):window,e){case"focusin":(sh(Be)||Be.contentEditable==="true")&&(Js=Be,vc=B,Wl=null);break;case"focusout":Wl=vc=Js=null;break;case"mousedown":bc=!0;break;case"contextmenu":case"mouseup":case"dragend":bc=!1,xh(P,n,G);break;case"selectionchange":if(Fv)break;case"keydown":case"keyup":xh(P,n,G)}var ve;if(mc)e:{switch(e){case"compositionstart":var we="onCompositionStart";break e;case"compositionend":we="onCompositionEnd";break e;case"compositionupdate":we="onCompositionUpdate";break e}we=void 0}else Ks?nh(e,n)&&(we="onCompositionEnd"):e==="keydown"&&n.keyCode===229&&(we="onCompositionStart");we&&(Wf&&n.locale!=="ko"&&(Ks||we!=="onCompositionStart"?we==="onCompositionEnd"&&Ks&&(ve=Kf()):(_a=G,cc="value"in _a?_a.value:_a.textContent,Ks=!0)),Be=mo(B,we),0<Be.length&&(we=new Ff(we,e,null,n,G),P.push({event:we,listeners:Be}),ve?we.data=ve:(ve=ah(n),ve!==null&&(we.data=ve)))),(ve=$v?Gv(e,n):Yv(e,n))&&(we=mo(B,"onBeforeInput"),0<we.length&&(Be=new Ff("onBeforeInput","beforeinput",null,n,G),P.push({event:Be,listeners:we}),Be.data=ve)),$b(P,e,B,n,G)}Qx(P,t)})}function Si(e,t,n){return{instance:e,listener:t,currentTarget:n}}function mo(e,t){for(var n=t+"Capture",s=[];e!==null;){var i=e,r=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||r===null||(i=Xl(e,n),i!=null&&s.unshift(Si(e,i,r)),i=Xl(e,t),i!=null&&s.push(Si(e,i,r))),e.tag===3)return s;e=e.return}return[]}function Xb(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Kx(e,t,n,s,i){for(var r=t._reactName,f=[];n!==null&&n!==s;){var v=n,w=v.alternate,B=v.stateNode;if(v=v.tag,w!==null&&w===s)break;v!==5&&v!==26&&v!==27||B===null||(w=B,i?(B=Xl(n,r),B!=null&&f.unshift(Si(n,B,w))):i||(B=Xl(n,r),B!=null&&f.push(Si(n,B,w)))),n=n.return}f.length!==0&&e.push({event:t,listeners:f})}var Qb=/\r\n?/g,Zb=/\u0000|\uFFFD/g;function Jx(e){return(typeof e=="string"?e:""+e).replace(Qb,`
49
+ `).replace(Zb,"")}function Px(e,t){return t=Jx(t),Jx(e)===t}function Fe(e,t,n,s,i,r){switch(n){case"children":if(typeof s=="string")t==="body"||t==="textarea"&&s===""||Xs(e,s);else if(typeof s=="number"||typeof s=="bigint")t!=="body"&&Xs(e,""+s);else return;break;case"className":ir(e,"class",s);break;case"tabIndex":ir(e,"tabindex",s);break;case"dir":case"role":case"viewBox":case"width":case"height":ir(e,n,s);break;case"style":Xf(e,s,r);return;case"data":if(t!=="object"){ir(e,"data",s);break}case"src":case"href":if(s===""&&(t!=="a"||n!=="href")){e.removeAttribute(n);break}if(s==null||typeof s=="function"||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=rr(s),e.setAttribute(n,s);break;case"action":case"formAction":if(typeof s=="function"){e.setAttribute(n,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof r=="function"&&(n==="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(s==null||typeof s=="symbol"||typeof s=="boolean"){e.removeAttribute(n);break}s=rr(s),e.setAttribute(n,s);break;case"onClick":s!=null&&(e.onclick=Jn);return;case"onScroll":s!=null&&Me("scroll",e);return;case"onScrollEnd":s!=null&&Me("scrollend",e);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(n=s.__html,n!=null){if(i.children!=null)throw Error(u(60));r?.__html!==n&&(e.innerHTML=n)}}break;case"multiple":e.multiple=s&&typeof s!="function"&&typeof s!="symbol";break;case"muted":e.muted=s&&typeof s!="function"&&typeof s!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(s==null||typeof s=="function"||typeof s=="boolean"||typeof s=="symbol"){e.removeAttribute("xlink:href");break}n=rr(s),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",n);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);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":s&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,""):e.removeAttribute(n);break;case"capture":case"download":s===!0?e.setAttribute(n,""):s!==!1&&s!=null&&typeof s!="function"&&typeof s!="symbol"?e.setAttribute(n,s):e.removeAttribute(n);break;case"cols":case"rows":case"size":case"span":s!=null&&typeof s!="function"&&typeof s!="symbol"&&!isNaN(s)&&1<=s?e.setAttribute(n,s):e.removeAttribute(n);break;case"rowSpan":case"start":s==null||typeof s=="function"||typeof s=="symbol"||isNaN(s)?e.removeAttribute(n):e.setAttribute(n,s);break;case"popover":Me("beforetoggle",e),Me("toggle",e),lr(e,"popover",s);break;case"xlinkActuate":ma(e,"http://www.w3.org/1999/xlink","xlink:actuate",s);break;case"xlinkArcrole":ma(e,"http://www.w3.org/1999/xlink","xlink:arcrole",s);break;case"xlinkRole":ma(e,"http://www.w3.org/1999/xlink","xlink:role",s);break;case"xlinkShow":ma(e,"http://www.w3.org/1999/xlink","xlink:show",s);break;case"xlinkTitle":ma(e,"http://www.w3.org/1999/xlink","xlink:title",s);break;case"xlinkType":ma(e,"http://www.w3.org/1999/xlink","xlink:type",s);break;case"xmlBase":ma(e,"http://www.w3.org/XML/1998/namespace","xml:base",s);break;case"xmlLang":ma(e,"http://www.w3.org/XML/1998/namespace","xml:lang",s);break;case"xmlSpace":ma(e,"http://www.w3.org/XML/1998/namespace","xml:space",s);break;case"is":lr(e,"is",s);break;case"innerText":case"textContent":return;default:if(!(2<n.length)||n[0]!=="o"&&n[0]!=="O"||n[1]!=="n"&&n[1]!=="N")n=fv.get(n)||n,lr(e,n,s);else return}Ge=!0}function nd(e,t,n,s,i,r){switch(n){case"style":Xf(e,s,r);return;case"dangerouslySetInnerHTML":if(s!=null){if(typeof s!="object"||!("__html"in s))throw Error(u(61));if(n=s.__html,n!=null){if(i.children!=null)throw Error(u(60));r?.__html!==n&&(e.innerHTML=n)}}break;case"children":if(typeof s=="string")Xs(e,s);else if(typeof s=="number"||typeof s=="bigint")Xs(e,""+s);else return;break;case"onScroll":s!=null&&Me("scroll",e);return;case"onScrollEnd":s!=null&&Me("scrollend",e);return;case"onClick":s!=null&&(e.onclick=Jn);return;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":return;case"innerText":case"textContent":return;default:if(!Mf.hasOwnProperty(n))e:{if(n[0]==="o"&&n[1]==="n"&&(i=n.endsWith("Capture"),r=n.slice(2,i?n.length-7:void 0),t=e[It]||null,t=t!=null?t[n]:null,typeof t=="function"&&e.removeEventListener(r,t,i),typeof s=="function")){typeof t!="function"&&t!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(r,s,i);break e}Ge=!0,n in e?e[n]=s:s===!0?e.setAttribute(n,""):lr(e,n,s)}return}Ge=!0}function Mt(e,t,n){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Me("error",e),Me("load",e);var s=!1,i=!1,r;for(r in n)if(n.hasOwnProperty(r)){var f=n[r];if(f!=null)switch(r){case"src":s=!0;break;case"srcSet":i=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Fe(e,t,r,f,n,null)}}i&&Fe(e,t,"srcSet",n.srcSet,n,null),s&&Fe(e,t,"src",n.src,n,null);return;case"input":Me("invalid",e);var v=r=f=i=null,w=null,B=null;for(s in n)if(n.hasOwnProperty(s)){var G=n[s];if(G!=null)switch(s){case"name":i=G;break;case"type":f=G;break;case"checked":w=G;break;case"defaultChecked":B=G;break;case"value":r=G;break;case"defaultValue":v=G;break;case"children":case"dangerouslySetInnerHTML":if(G!=null)throw Error(u(137,t));break;default:Fe(e,t,s,G,n,null)}}$f(e,r,v,w,B,f,i,!1);return;case"select":Me("invalid",e),s=f=r=null;for(i in n)if(n.hasOwnProperty(i)&&(v=n[i],v!=null))switch(i){case"value":r=v;break;case"defaultValue":f=v;break;case"multiple":s=v;default:Fe(e,t,i,v,n,null)}t=r,n=f,e.multiple=!!s,t!=null?Vs(e,!!s,t,!1):n!=null&&Vs(e,!!s,n,!0);return;case"textarea":Me("invalid",e),r=i=s=null;for(f in n)if(n.hasOwnProperty(f)&&(v=n[f],v!=null))switch(f){case"value":s=v;break;case"defaultValue":i=v;break;case"children":r=v;break;case"dangerouslySetInnerHTML":if(v!=null)throw Error(u(91));break;default:Fe(e,t,f,v,n,null)}Yf(e,s,i,r);return;case"option":for(w in n)if(n.hasOwnProperty(w)&&(s=n[w],s!=null))switch(w){case"selected":e.selected=s&&typeof s!="function"&&typeof s!="symbol";break;default:Fe(e,t,w,s,n,null)}return;case"dialog":Me("beforetoggle",e),Me("toggle",e),Me("cancel",e),Me("close",e);break;case"iframe":case"object":Me("load",e);break;case"video":case"audio":for(s=0;s<wi.length;s++)Me(wi[s],e);break;case"image":Me("error",e),Me("load",e);break;case"details":Me("toggle",e);break;case"embed":case"source":case"link":Me("error",e),Me("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(B in n)if(n.hasOwnProperty(B)&&(s=n[B],s!=null))switch(B){case"children":case"dangerouslySetInnerHTML":throw Error(u(137,t));default:Fe(e,t,B,s,n,null)}return;default:if(sc(t)){for(G in n)n.hasOwnProperty(G)&&(s=n[G],s!==void 0&&nd(e,t,G,s,n,void 0));return}}for(v in n)n.hasOwnProperty(v)&&(s=n[v],s!=null&&Fe(e,t,v,s,n,null))}var Kb={};function Jb(e,t,n,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var i=null,r=null,f=null,v=null,w=null,B=null,G=null;for($ in n){var P=n[$];if(n.hasOwnProperty($)&&P!=null)switch($){case"checked":break;case"value":break;case"defaultValue":w=P;default:s.hasOwnProperty($)||Fe(e,t,$,null,s,P)}}for(var O in s){var $=s[O];if(P=n[O],s.hasOwnProperty(O)&&($!=null||P!=null))switch(O){case"type":$!==P&&(Ge=!0),r=$;break;case"name":$!==P&&(Ge=!0),i=$;break;case"checked":$!==P&&(Ge=!0),B=$;break;case"defaultChecked":$!==P&&(Ge=!0),G=$;break;case"value":$!==P&&(Ge=!0),f=$;break;case"defaultValue":$!==P&&(Ge=!0),v=$;break;case"children":case"dangerouslySetInnerHTML":if($!=null)throw Error(u(137,t));break;default:$!==P&&Fe(e,t,O,$,s,P)}}nc(e,f,v,w,B,G,r,i);return;case"select":$=f=v=O=null;for(r in n)if(w=n[r],n.hasOwnProperty(r)&&w!=null)switch(r){case"value":break;case"multiple":$=w;default:s.hasOwnProperty(r)||Fe(e,t,r,null,s,w)}for(i in s)if(r=s[i],w=n[i],s.hasOwnProperty(i)&&(r!=null||w!=null))switch(i){case"value":r!==w&&(Ge=!0),O=r;break;case"defaultValue":r!==w&&(Ge=!0),v=r;break;case"multiple":r!==w&&(Ge=!0),f=r;default:r!==w&&Fe(e,t,i,r,s,w)}t=v,n=f,s=$,O!=null?Vs(e,!!n,O,!1):!!s!=!!n&&(t!=null?Vs(e,!!n,t,!0):Vs(e,!!n,n?[]:"",!1));return;case"textarea":$=O=null;for(v in n)if(i=n[v],n.hasOwnProperty(v)&&i!=null&&!s.hasOwnProperty(v))switch(v){case"value":break;case"children":break;default:Fe(e,t,v,null,s,i)}for(f in s)if(i=s[f],r=n[f],s.hasOwnProperty(f)&&(i!=null||r!=null))switch(f){case"value":i!==r&&(Ge=!0),O=i;break;case"defaultValue":i!==r&&(Ge=!0),$=i;break;case"children":break;case"dangerouslySetInnerHTML":if(i!=null)throw Error(u(91));break;default:i!==r&&Fe(e,t,f,i,s,r)}Gf(e,O,$);return;case"option":for(var oe in n)if(O=n[oe],n.hasOwnProperty(oe)&&O!=null&&!s.hasOwnProperty(oe))switch(oe){case"selected":e.selected=!1;break;default:Fe(e,t,oe,null,s,O)}for(w in s)if(O=s[w],$=n[w],s.hasOwnProperty(w)&&O!==$&&(O!=null||$!=null))switch(w){case"selected":O!==$&&(Ge=!0),e.selected=O&&typeof O!="function"&&typeof O!="symbol";break;default:Fe(e,t,w,O,s,$)}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 xe in n)O=n[xe],n.hasOwnProperty(xe)&&O!=null&&!s.hasOwnProperty(xe)&&Fe(e,t,xe,null,s,O);for(B in s)if(O=s[B],$=n[B],s.hasOwnProperty(B)&&O!==$&&(O!=null||$!=null))switch(B){case"children":case"dangerouslySetInnerHTML":if(O!=null)throw Error(u(137,t));break;default:Fe(e,t,B,O,s,$)}return;default:if(sc(t)){for(var Re in n)O=n[Re],n.hasOwnProperty(Re)&&O!==void 0&&!s.hasOwnProperty(Re)&&nd(e,t,Re,void 0,s,O);for(G in s)O=s[G],$=n[G],!s.hasOwnProperty(G)||O===$||O===void 0&&$===void 0||nd(e,t,G,O,s,$);return}}for(var H in n)O=n[H],n.hasOwnProperty(H)&&O!=null&&!s.hasOwnProperty(H)&&Fe(e,t,H,null,s,O);for(P in s)O=s[P],$=n[P],!s.hasOwnProperty(P)||O===$||O==null&&$==null||Fe(e,t,P,O,s,$)}function Fx(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Pb(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,n=performance.getEntriesByType("resource"),s=0;s<n.length;s++){var i=n[s],r=i.transferSize,f=i.initiatorType,v=i.duration;if(r&&v&&Fx(f)){for(f=0,v=i.responseEnd,s+=1;s<n.length;s++){var w=n[s],B=w.startTime;if(B>v)break;var G=w.transferSize,P=w.initiatorType;G&&Fx(P)&&(w=w.responseEnd,f+=G*(w<v?1:(v-B)/(w-B)))}if(--s,t+=8*(r+f)/(i.duration/1e3),e++,10<e)break}}if(0<e)return t/e/1e6}return navigator.connection&&(e=navigator.connection.downlink,typeof e=="number")?e:5}var ad=null,sd=null;function ki(e){return e.nodeType===9?e:e.ownerDocument}function Ix(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 Wx(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 ep(e,t,n,s){return n=ki(n).createElement(e),n[Rt]=s,n[It]=t,Mt(n,e,t),Tt(n),n}function ld(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 id=null;function Fb(){var e=window.event;return e&&e.type==="popstate"?e===id?!1:(id=e,!0):(id=null,!1)}var rd=typeof setTimeout=="function"?setTimeout:void 0,Ib=typeof clearTimeout=="function"?clearTimeout:void 0,tp=typeof Promise=="function"?Promise:void 0,np=typeof requestAnimationFrame=="function"?requestAnimationFrame:rd,Wb=typeof queueMicrotask=="function"?queueMicrotask:typeof tp<"u"?function(e){return tp.resolve(null).then(e).catch(e0)}:rd;function e0(e){setTimeout(function(){throw e})}function Wa(e){return e==="head"}function ap(e,t){var n=t,s=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8)if(n=i.data,n==="/$"||n==="/&"){if(s===0){e.removeChild(i),El(t);return}s--}else if(n==="$"||n==="$?"||n==="$~"||n==="$!"||n==="&")s++;else if(n==="html")xd(e.ownerDocument.documentElement);else if(n==="head"){n=e.ownerDocument.head,xd(n);for(var r=n.firstChild;r;){var f=r.nextSibling,v=r.nodeName;r[Yl]||v==="SCRIPT"||v==="STYLE"||v==="LINK"&&r.rel.toLowerCase()==="stylesheet"||n.removeChild(r),r=f}}else n==="body"&&xd(e.ownerDocument.body);n=i}while(n);El(t)}function sp(e,t){var n=e;e=0;do{var s=n.nextSibling;if(n.nodeType===1?t?(n._stashedDisplay=n.style.display,n.style.display="none"):(n.style.display=n._stashedDisplay||"",n.getAttribute("style")===""&&n.removeAttribute("style")):n.nodeType===3&&(t?(n._stashedText=n.nodeValue,n.nodeValue=""):n.nodeValue=n._stashedText||""),s&&s.nodeType===8)if(n=s.data,n==="/$"){if(e===0)break;e--}else n!=="$"&&n!=="$?"&&n!=="$~"&&n!=="$!"||e++;n=s}while(n)}function lp(e,t,n){if(t=CSS.escape(t)!==t?"r-"+btoa(t).replace(/=/g,""):t,e.style.viewTransitionName=t,n!=null&&(e.style.viewTransitionClass=n),n=getComputedStyle(e),n.display==="inline"){if(t=e.getClientRects(),t.length===1)var s=1;else for(var i=s=0;i<t.length;i++){var r=t[i];0<r.width&&0<r.height&&s++}s===1&&(e=e.style,e.display=t.length===1?"inline-block":"block",e.marginTop="-"+n.paddingTop,e.marginBottom="-"+n.paddingBottom)}}function ip(e,t){e=e.style,t=t.style;var n=t!=null?t.hasOwnProperty("viewTransitionName")?t.viewTransitionName:t.hasOwnProperty("view-transition-name")?t["view-transition-name"]:null:null;e.viewTransitionName=n==null||typeof n=="boolean"?"":(""+n).trim(),n=t!=null?t.hasOwnProperty("viewTransitionClass")?t.viewTransitionClass:t.hasOwnProperty("view-transition-class")?t["view-transition-class"]:null:null,e.viewTransitionClass=n==null||typeof n=="boolean"?"":(""+n).trim(),e.display==="inline-block"&&(t==null?e.display=e.margin="":(n=t.display,e.display=n==null||typeof n=="boolean"?"":n,n=t.margin,n!=null?e.margin=n:(n=t.hasOwnProperty("marginTop")?t.marginTop:t["margin-top"],e.marginTop=n==null||typeof n=="boolean"?"":n,t=t.hasOwnProperty("marginBottom")?t.marginBottom:t["margin-bottom"],e.marginBottom=t==null||typeof t=="boolean"?"":t)))}function t0(e,t,n){return n=n.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<=n.innerHeight&&e.left<=n.innerWidth}}function od(e){var t=e.getBoundingClientRect(),n=getComputedStyle(e);return t0(t,n,e)}function n0(e){return e.documentElement.clientHeight}function a0(e){this.addEventListener("load",e),this.addEventListener("error",e)}function s0(e,t,n,s,i,r,f,v,w){var B=t.nodeType===9?t:t.ownerDocument;try{var G=B.startViewTransition({update:function(){var O=B.defaultView,$=O.navigation&&O.navigation.transition,oe=B.fonts.status;s();var xe=[];if(oe==="loaded"&&(n0(B),B.fonts.status==="loading"&&xe.push(B.fonts.ready)),oe=xe.length,e!==null)for(var Re=e.suspenseyImages,H=0,A=0;A<Re.length;A++){var q=Re[A];if(!q.complete){var Z=q.getBoundingClientRect();if(0<Z.bottom&&0<Z.right&&Z.top<O.innerHeight&&Z.left<O.innerWidth){if(H+=Cp(q),H>go){xe.length=oe;break}q=new Promise(a0.bind(q)),xe.push(q)}}}if(0<xe.length)return O=Promise.race([Promise.all(xe),new Promise(function(me){return setTimeout(me,500)})]).then(i,i),($?Promise.allSettled([$.finished,O]):O).then(r,r);if(i(),$)return $.finished.then(r,r);r()},types:n});B.__reactViewTransition=G;var P=[];return G.ready.then(function(){for(var O=B.documentElement.getAnimations({subtree:!0}),$=0;$<O.length;$++){var oe=O[$],xe=oe.effect,Re=xe.pseudoElement;if(Re!=null&&Re.startsWith("::view-transition")){P.push(oe),oe=xe.getKeyframes();for(var H=Re=void 0,A=!0,q=0;q<oe.length;q++){var Z=oe[q],me=Z.width;if(Re===void 0)Re=me;else if(Re!==me){A=!1;break}if(me=Z.height,H===void 0)H=me;else if(H!==me){A=!1;break}delete Z.width,delete Z.height,Z.transform==="none"&&delete Z.transform}A&&Re!==void 0&&H!==void 0&&(xe.setKeyframes(oe),A=getComputedStyle(xe.target,xe.pseudoElement),A.width!==Re||A.height!==H)&&(A=oe[0],A.width=Re,A.height=H,A=oe[oe.length-1],A.width=Re,A.height=H,xe.setKeyframes(oe))}}f()},function(O){B.__reactViewTransition===G&&(B.__reactViewTransition=null);try{if(typeof O=="object"&&O!==null)switch(O.name){case"InvalidStateError":(O.message==="View transition was skipped because document visibility state is hidden."||O.message==="Skipping view transition because document visibility state has become hidden."||O.message==="Skipping view transition because viewport size changed."||O.message==="Transition was aborted because of invalid state")&&(O=null)}O!==null&&w(O)}finally{s(),i(),f()}}),G.finished.finally(function(){for(var O=0;O<P.length;O++)P[O].cancel();B.__reactViewTransition===G&&(B.__reactViewTransition=null),v()}),G}catch{return s(),i(),f(),null}}function Ds(e,t){this._scope=document.documentElement,this._selector="::view-transition-"+e+"("+t+")"}Ds.prototype.animate=function(e,t){return t=typeof t=="number"?{duration:t}:L({},t),t.pseudoElement=this._selector,this._scope.animate(e,t)},Ds.prototype.getAnimations=function(){for(var e=this._scope,t=this._selector,n=e.getAnimations({subtree:!0}),s=[],i=0;i<n.length;i++){var r=n[i].effect;r!==null&&r.target===e&&r.pseudoElement===t&&s.push(n[i])}return s},Ds.prototype.getComputedStyle=function(){return getComputedStyle(this._scope,this._selector)};function rp(e){return{name:e,group:new Ds("group",e),imagePair:new Ds("image-pair",e),old:new Ds("old",e),new:new Ds("new",e)}}function vn(e){this._fragmentFiber=e,this._observers=this._eventListeners=null}vn.prototype.addEventListener=function(e,t,n){var s=null,i=null;if(!(n!=null&&typeof n!="boolean"&&(s=n.signal||null,s!==null&&s.aborted))){this._eventListeners===null&&(this._eventListeners=[]);var r=this._eventListeners;if(cp(r,e,t,n)===-1){var f=this,v=t;n!=null&&typeof n!="boolean"&&n.once===!0&&(v=function(w){f.removeEventListener(e,t,n),typeof t=="function"?t.call(this,w):t.handleEvent(w)}),s!==null&&(i=f.removeEventListener.bind(f,e,t,n),s.addEventListener("abort",i,{once:!0}),i=s.removeEventListener.bind(s,"abort",i)),s=Nl(n),r.push({type:e,listener:t,optionsOrUseCapture:n,attachedListener:v,cleanup:i}),y(this._fragmentFiber.child,!1,l0,e,v,s)}this._eventListeners=r}};function l0(e,t,n,s){return k(e).addEventListener(t,n,s),!1}vn.prototype.removeEventListener=function(e,t,n){var s=this._eventListeners;if(s!==null&&(t=cp(s,e,t,n),t!==-1)){var i=s[t];n=i.attachedListener;var r=i.cleanup;i=Nl(i.optionsOrUseCapture),y(this._fragmentFiber.child,!1,i0,e,n,i),s.splice(t,1),r!==null&&r()}};function i0(e,t,n,s){return k(e).removeEventListener(t,n,s),!1}function Nl(e){return e!=null&&typeof e!="boolean"&&(e.once===!0||e.signal instanceof AbortSignal)?{capture:e.capture,passive:e.passive}:e}function op(e){return e==null?"c=0":typeof e=="boolean"?"c="+(e?"1":"0"):"c="+(e.capture?"1":"0")}function cp(e,t,n,s){if(e.length===0)return-1;s=op(s);for(var i=0;i<e.length;i++){var r=e[i];if(r.type===t&&r.listener===n&&op(r.optionsOrUseCapture)===s)return i}return-1}vn.prototype.dispatchEvent=function(e){var t=N(this._fragmentFiber);if(t===null)return!0;t=k(t);var n=this._eventListeners;if(n!==null&&0<n.length||!e.bubbles){var s=t.nodeType===9?t.createComment(""):document.createTextNode("");if(n)for(var i=0;i<n.length;i++){var r=n[i];s.addEventListener(r.type,r.attachedListener,Nl(r.optionsOrUseCapture))}if(t.appendChild(s),e=s.dispatchEvent(e),n)for(i=0;i<n.length;i++)r=n[i],s.removeEventListener(r.type,r.attachedListener,Nl(r.optionsOrUseCapture));return t.removeChild(s),e}return t.dispatchEvent(e)},vn.prototype.focus=function(e){y(this._fragmentFiber.child,!0,up,e,void 0,void 0)};function up(e,t){return e.tag===6?!1:(e=k(e),y0(e,t))}vn.prototype.focusLast=function(e){var t=[];y(this._fragmentFiber.child,!0,cd,t,void 0,void 0);for(var n=t.length-1;0<=n&&!up(t[n],e);n--);};function cd(e,t){return t.push(e),!1}vn.prototype.blur=function(){var e=N(this._fragmentFiber);e!==null&&(e=k(e),e=ki(e).activeElement,e!==null&&y(this._fragmentFiber.child,!1,r0,e,void 0,void 0))};function r0(e,t){return e.tag===6?!1:(e=k(e),e===t||e.contains(t)?(t.blur(),!0):!1)}vn.prototype.observeUsing=function(e){this._observers===null&&(this._observers=new Set),this._observers.add(e),y(this._fragmentFiber.child,!1,o0,e,void 0,void 0)};function o0(e,t){return e.tag===6||(e=k(e),t.observe(e)),!1}vn.prototype.unobserveUsing=function(e){var t=this._observers;if(t!==null&&t.has(e)){t.delete(e),y(this._fragmentFiber.child,!1,c0,e,void 0,void 0);for(var n=t=0;n<$n.length;n++){var s=$n[n];s.fragmentInstance===this&&s.observer===e?e.unobserve(s.instance):$n[t++]=s}$n.length=t}};function c0(e,t){return e.tag===6||(e=k(e),t.unobserve(e)),!1}var $n=[],ud=!1;function u0(e,t,n){$n.push({fragmentInstance:e,observer:t,instance:n}),ud||(ud=!0,v0(function(){ud=!1;var s=$n;$n=[];for(var i=0;i<s.length;i++){var r=s[i];r.observer.unobserve(r.instance)}}))}vn.prototype.getClientRects=function(){var e=[];return y(this._fragmentFiber.child,!1,d0,e,void 0,void 0),e};function d0(e,t){if(e.tag===6){e=e.stateNode;var n=e.ownerDocument.createRange();n.selectNodeContents(e),t.push.apply(t,n.getClientRects())}else e=k(e),t.push.apply(t,e.getClientRects());return!1}vn.prototype.getRootNode=function(e){var t=N(this._fragmentFiber);return t===null?this:k(t).getRootNode(e)},vn.prototype.compareDocumentPosition=function(e){var t=N(this._fragmentFiber);if(t===null)return Node.DOCUMENT_POSITION_DISCONNECTED;var n=[];y(this._fragmentFiber.child,!1,cd,n,void 0,void 0);var s=k(t);if(n.length===0){if(n=s,C(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&&(n=t)}t=this._fragmentFiber;var i=s=n.compareDocumentPosition(e);return n===e?i=Node.DOCUMENT_POSITION_CONTAINS:s&Node.DOCUMENT_POSITION_CONTAINED_BY&&(n=U(t)[1],n===null?i=Node.DOCUMENT_POSITION_PRECEDING:(e=k(n).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=k(n[0]),i=k(n[n.length-1]);var r=C(this._fragmentFiber)?t.parentElement:s;if(r==null)return Node.DOCUMENT_POSITION_DISCONNECTED;s=r.compareDocumentPosition(t)&Node.DOCUMENT_POSITION_CONTAINED_BY,r=r.compareDocumentPosition(i)&Node.DOCUMENT_POSITION_CONTAINED_BY;var f=t.compareDocumentPosition(e),v=i.compareDocumentPosition(e),w=f&Node.DOCUMENT_POSITION_CONTAINED_BY||v&Node.DOCUMENT_POSITION_CONTAINED_BY;return v=s&&r&&f&Node.DOCUMENT_POSITION_FOLLOWING&&v&Node.DOCUMENT_POSITION_PRECEDING,t=s&&t===e||r&&i===e||w||v?Node.DOCUMENT_POSITION_CONTAINED_BY:!s&&t===e||!r&&i===e?Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC:f,t&Node.DOCUMENT_POSITION_DISCONNECTED||t&Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC||f0(t,this._fragmentFiber,n[0],n[n.length-1],e)?t:Node.DOCUMENT_POSITION_IMPLEMENTATION_SPECIFIC};function f0(e,t,n,s,i){var r=ds(i);if(e&Node.DOCUMENT_POSITION_CONTAINED_BY){if(n=!!r)e:{for(;r!==null;){if(r.tag===7&&(r===t||r.alternate===t)){n=!0;break e}r=r.return}n=!1}return n}if(e&Node.DOCUMENT_POSITION_CONTAINS){if(r===null)return r=i.ownerDocument,i===r||i===r.documentElement||i===r.body;e:{for(r=t,t=N(t);r!==null;){if(!(r.tag!==5&&r.tag!==3&&r.tag!==27||r!==t&&r.alternate!==t)){r=!0;break e}r=r.return}r=!1}return r}return e&Node.DOCUMENT_POSITION_PRECEDING?((t=!!r)&&!(t=r===n)&&(t=te(n,r,D),t===null?t=!1:(y(t,!0,Y,r,n),r=E,E=null,t=r!==null)),t):e&Node.DOCUMENT_POSITION_FOLLOWING?((t=!!r)&&!(t=r===s)&&(t=te(s,r,D),t===null?t=!1:(y(t,!0,z,r,s),r=E,T=E=null,t=r!==null)),t):!1}function dp(e,t){var n=e.ownerDocument.createRange();n.selectNodeContents(e),e=n.getBoundingClientRect(),window.scrollTo(window.scrollX+e.left,t?window.scrollY+e.top:window.scrollY+e.bottom-window.innerHeight)}vn.prototype.scrollIntoView=function(e){if(typeof e=="object")throw Error(u(566));var t=[];y(this._fragmentFiber.child,!1,cd,t,void 0,void 0);var n=e!==!1;if(t.length===0){var s=U(this._fragmentFiber);if(s=n?s[1]||s[0]||N(this._fragmentFiber):s[0]||s[1],s===null)return;if(s.tag===6){e=k(s),dp(e,n);return}if(s=k(s),s.nodeType!==9){if(s.nodeType===11){n="host"in s?s.host:null,n!==null&&n.scrollIntoView(e);return}s.scrollIntoView(e)}}for(s=n?t.length-1:0;s!==(n?-1:t.length);){var i=t[s];i.tag===6?(i=k(i),dp(i,n)):k(i).scrollIntoView(e),s+=n?-1:1}};function h0(e,t){return e=k(e),fp(e,t),!1}function fp(e,t){e.reactFragments==null&&(e.reactFragments=new Set),e.reactFragments.add(t)}function hp(e,t){var n=t._eventListeners;if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];e.addEventListener(i.type,i.attachedListener,Nl(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){for(var f=0,v=0;v<$n.length;v++){var w=$n[v];(w.fragmentInstance!==t||w.observer!==r||w.instance!==e)&&($n[f++]=w)}$n.length=f,r.observe(e)}),fp(e,t))}function m0(e,t){var n=t._eventListeners;if(n!==null)for(var s=0;s<n.length;s++){var i=n[s];e.removeEventListener(i.type,i.attachedListener,Nl(i.optionsOrUseCapture))}e.nodeType!==3&&(n=t._observers,n!==null&&n.forEach(function(r){typeof r.rootMargin=="string"?u0(t,r,e):r.unobserve(e)}),e.reactFragments!=null&&e.reactFragments.delete(t))}function dd(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var n=t;switch(t=t.nextSibling,n.nodeName){case"HTML":case"HEAD":case"BODY":dd(n),sr(n);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(n.rel.toLowerCase()==="stylesheet")continue}e.removeChild(n)}}function x0(e,t,n,s){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!s&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(s){if(!e[Yl])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(r=e.getAttribute("rel"),r==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(r!==i.rel||e.getAttribute("href")!==(i.href==null||i.href===""?null:i.href)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin)||e.getAttribute("title")!==(i.title==null?null:i.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(r=e.getAttribute("src"),(r!==(i.src==null?null:i.src)||e.getAttribute("type")!==(i.type==null?null:i.type)||e.getAttribute("crossorigin")!==(i.crossOrigin==null?null:i.crossOrigin))&&r&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var r=i.name==null?null:""+i.name;if(i.type==="hidden"&&e.getAttribute("name")===r)return e}else return e;if(e=Rn(e.nextSibling),e===null)break}return null}function p0(e,t,n){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!n||(e=Rn(e.nextSibling),e===null))return null;return e}function mp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Rn(e.nextSibling),e===null))return null;return e}function fd(e){return e.data==="$?"||e.data==="$~"}function hd(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function g0(e,t){var n=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||n.readyState!=="loading")t();else{var s=function(){t(),n.removeEventListener("DOMContentLoaded",s)};n.addEventListener("DOMContentLoaded",s),e._reactRetry=s}}function Rn(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 md=null;function xp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="/$"||n==="/&"){if(t===0)return Rn(e.nextSibling);t--}else n!=="$"&&n!=="$!"&&n!=="$?"&&n!=="$~"&&n!=="&"||t++}e=e.nextSibling}return null}function pp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n==="$"||n==="$!"||n==="$?"||n==="$~"||n==="&"){if(t===0)return e;t--}else n!=="/$"&&n!=="/&"||t++}e=e.previousSibling}return null}function y0(e,t){function n(){s=!0}if(e.ownerDocument.activeElement===e)return!0;var s=!1;try{e.ownerDocument.addEventListener("focus",n,!0),(e.focus||HTMLElement.prototype.focus).call(e,t)}finally{e.ownerDocument.removeEventListener("focus",n,!0)}return s}function v0(e){np(function(){np(function(t){return e(t)})})}function gp(e,t,n){switch(t=ki(n),e){case"html":if(e=t.documentElement,!e)throw Error(u(452));return e;case"head":if(e=t.head,!e)throw Error(u(453));return e;case"body":if(e=t.body,!e)throw Error(u(454));return e;default:throw Error(u(451))}}function yp(e,t,n){for(var s in n){var i=n[s];n.hasOwnProperty(s)&&i!=null&&Fe(e,t,s,null,Kb,i)}n.dangerouslySetInnerHTML!=null&&(e.textContent=""),e.onclick===Jn&&(e.onclick=null),sr(e)}function xd(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);sr(e)}var An=new Map,vp=new Set;function Ti(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 Ca=be.d;be.d={f:b0,r:j0,D:N0,C:w0,L:S0,m:k0,X:C0,S:T0,M:E0};function b0(){var e=Ca.f(),t=ro();return e||t}function j0(e){var t=$s(e);t!==null&&t.tag===5&&t.type==="form"?jm(t):Ca.r(e)}var wl=typeof document>"u"?null:document;function bp(e,t,n){var s=wl;if(s&&typeof t=="string"&&t){var i=wn(t);i='link[rel="'+e+'"][href="'+i+'"]',typeof n=="string"&&(i+='[crossorigin="'+n+'"]'),vp.has(i)||(vp.add(i),e={rel:e,crossOrigin:n,href:t},s.querySelector(i)===null&&(t=s.createElement("link"),Mt(t,"link",e),Tt(t),s.head.appendChild(t)))}}function N0(e){Ca.D(e),bp("dns-prefetch",e,null)}function w0(e,t){Ca.C(e,t),bp("preconnect",e,t)}function S0(e,t,n){Ca.L(e,t,n);var s=wl;if(s&&e&&t){var i='link[rel="preload"][as="'+wn(t)+'"]';t==="image"&&n&&n.imageSrcSet?(i+='[imagesrcset="'+wn(n.imageSrcSet)+'"]',typeof n.imageSizes=="string"&&(i+='[imagesizes="'+wn(n.imageSizes)+'"]')):i+='[href="'+wn(e)+'"]';var r=i;switch(t){case"style":r=Sl(e);break;case"script":r=kl(e)}if(!(An.has(r)||(e=L({rel:"preload",href:t==="image"&&n&&n.imageSrcSet?void 0:e,as:t},n),An.set(r,e),s.querySelector(i)!==null||t==="style"&&s.querySelector(Ci(r))||t==="script"&&s.querySelector(Ei(r))))){var f=s.createElement("link");Mt(f,"link",e),t==="style"&&(f[ar]=!0,f.onload=f.onerror=function(){_f(f)}),Tt(f),s.head.appendChild(f)}}}function k0(e,t){Ca.m(e,t);var n=wl;if(n&&e){var s=t&&typeof t.as=="string"?t.as:"script",i='link[rel="modulepreload"][as="'+wn(s)+'"][href="'+wn(e)+'"]',r=i;switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":r=kl(e)}if(!An.has(r)&&(e=L({rel:"modulepreload",href:e},t),An.set(r,e),n.querySelector(i)===null)){switch(s){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(n.querySelector(Ei(r)))return}s=n.createElement("link"),Mt(s,"link",e),Tt(s),n.head.appendChild(s)}}}function T0(e,t,n){Ca.S(e,t,n);var s=wl;if(s&&e){var i=Gs(s).hoistableStyles,r=Sl(e);t=t||"default";var f=i.get(r);if(!f){var v={loading:0,preload:null};if(f=s.querySelector(Ci(r)))v.loading=5;else{e=L({rel:"stylesheet",href:e,"data-precedence":t},n),(n=An.get(r))&&pd(e,n);var w=f=s.createElement("link");Tt(w),Mt(w,"link",e),w._p=new Promise(function(B,G){w.onload=B,w.onerror=G}),w.addEventListener("load",function(){v.loading|=1}),w.addEventListener("error",function(){v.loading|=2}),v.loading|=4,xo(f,t,s)}f={type:"stylesheet",instance:f,count:1,state:v},i.set(r,f)}}}function C0(e,t){Ca.X(e,t);var n=wl;if(n&&e){var s=Gs(n).hoistableScripts,i=kl(e),r=s.get(i);r||(r=n.querySelector(Ei(i)),r||(e=L({src:e,async:!0},t),(t=An.get(i))&&gd(e,t),r=n.createElement("script"),Tt(r),Mt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function E0(e,t){Ca.M(e,t);var n=wl;if(n&&e){var s=Gs(n).hoistableScripts,i=kl(e),r=s.get(i);r||(r=n.querySelector(Ei(i)),r||(e=L({src:e,async:!0,type:"module"},t),(t=An.get(i))&&gd(e,t),r=n.createElement("script"),Tt(r),Mt(r,"link",e),n.head.appendChild(r)),r={type:"script",instance:r,count:1,state:null},s.set(i,r))}}function jp(e,t,n,s){var i=(i=Pt.current)?Ti(i):null;if(!i)throw Error(u(446));switch(e){case"meta":case"title":return null;case"style":return typeof n.precedence=="string"&&typeof n.href=="string"?(n=Sl(n.href),t=Gs(i).hoistableStyles,s=t.get(n),s||(s={type:"style",instance:null,count:0,state:null},t.set(n,s)),s):{type:"void",instance:null,count:0,state:null};case"link":if(n.rel==="stylesheet"&&typeof n.href=="string"&&typeof n.precedence=="string"){e=Sl(n.href);var r=Gs(i).hoistableStyles,f=r.get(e);if(f||(i=i.ownerDocument||i,f={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},r.set(e,f),(r=i.querySelector(Ci(e)))?r._p||(f.instance=r,f.state.loading=5):(r=An.get(e),r||(r={rel:"preload",as:"style",href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},An.set(e,r)),z0(i,e,r,f.state))),t&&s===null)throw Error(u(528,""));return f}if(t&&s!==null)throw Error(u(529,""));return null;case"script":return t=n.async,n=n.src,typeof n=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(n=kl(n),t=Gs(i).hoistableScripts,s=t.get(n),s||(s={type:"script",instance:null,count:0,state:null},t.set(n,s)),s):{type:"void",instance:null,count:0,state:null};default:throw Error(u(444,e))}}function Sl(e){return'href="'+wn(e)+'"'}function Ci(e){return'link[rel="stylesheet"]['+e+"]"}function Np(e){return L({},e,{"data-precedence":e.precedence,precedence:null})}function z0(e,t,n,s){if(t=e.querySelector('link[rel="preload"][as="style"]['+t+"]")){if(t[ar]!==!0){s.loading=1;return}}else t=e.createElement("link"),t[ar]=!0,t.onload=t.onerror=_f.bind(null,t),Mt(t,"link",n),Tt(t),e.head.appendChild(t);s.preload=t,t.addEventListener("load",function(){return s.loading|=1}),t.addEventListener("error",function(){return s.loading|=2})}function kl(e){return'[src="'+wn(e)+'"]'}function Ei(e){return"script[async]"+e}function wp(e,t,n){if(t.count++,t.instance===null)switch(t.type){case"style":var s=e.querySelector('style[data-href~="'+wn(n.href)+'"]');if(s)return t.instance=s,Tt(s),s;var i=L({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return s=(e.ownerDocument||e).createElement("style"),Tt(s),Mt(s,"style",i),xo(s,n.precedence,e),t.instance=s;case"stylesheet":i=Sl(n.href);var r=e.querySelector(Ci(i));if(r)return t.state.loading|=4,t.instance=r,Tt(r),r;s=Np(n),(i=An.get(i))&&pd(s,i),r=(e.ownerDocument||e).createElement("link"),Tt(r);var f=r;return f._p=new Promise(function(v,w){f.onload=v,f.onerror=w}),Mt(r,"link",s),t.state.loading|=4,xo(r,n.precedence,e),t.instance=r;case"script":return r=kl(n.src),(i=e.querySelector(Ei(r)))?(t.instance=i,Tt(i),i):(s=n,(i=An.get(r))&&(s=L({},n),gd(s,i)),e=e.ownerDocument||e,i=e.createElement("script"),Tt(i),Mt(i,"link",s),e.head.appendChild(i),t.instance=i);case"void":return null;default:throw Error(u(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(s=t.instance,t.state.loading|=4,xo(s,n.precedence,e));return t.instance}function xo(e,t,n){for(var s=n.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),i=s.length?s[s.length-1]:null,r=i,f=0;f<s.length;f++){var v=s[f];if(v.dataset.precedence===t)r=v;else if(r!==i)break}r?r.parentNode.insertBefore(e,r.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function pd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function gd(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var po=null;function Sp(e,t,n){if(po===null){var s=new Map,i=po=new Map;i.set(n,s)}else i=po,s=i.get(n),s||(s=new Map,i.set(n,s));if(s.has(e))return s;for(s.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var r=n[i];if(!(r[Yl]||r[Rt]||e==="link"&&r.getAttribute("rel")==="stylesheet")&&r.namespaceURI!=="http://www.w3.org/2000/svg"){var f=r.getAttribute(t)||"";f=e+f;var v=s.get(f);v?v.push(r):s.set(f,[r])}}return s}function yd(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t==="title"?e.querySelector("head > title"):null)}function R0(e,t,n){if(n===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;switch(t.rel){case"stylesheet":return e=t.disabled,typeof t.precedence=="string"&&e==null;default:return!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 kp(e,t){return e==="img"&&t.src!=null&&t.src!==""&&t.onLoad==null&&t.loading!=="lazy"}function Tp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function Cp(e){return(e.width||100)*(e.height||100)*(typeof devicePixelRatio=="number"?devicePixelRatio:1)*.25}function Ep(e,t){typeof t.decode=="function"&&(e.imgCount++,t.complete||(e.imgBytes+=Cp(t),e.suspenseyImages.push(t)),e=_0.bind(e),t.decode().then(e,e))}function A0(e,t,n,s){if(n.type==="stylesheet"&&(typeof s.media!="string"||matchMedia(s.media).matches!==!1)&&(n.state.loading&4)===0){if(n.instance===null){var i=Sl(s.href),r=t.querySelector(Ci(i));if(r){t=r._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=zi.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=r,Tt(r);return}r=t.ownerDocument||t,s=Np(s),(i=An.get(i))&&pd(s,i),r=r.createElement("link"),Tt(r);var f=r;f._p=new Promise(function(v,w){f.onload=v,f.onerror=w}),Mt(r,"link",s),n.instance=r}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&(n.state.loading&3)===0&&(e.count++,n=zi.bind(e),t.addEventListener("load",n),t.addEventListener("error",n))}}var go=0;function D0(e,t){return e.stylesheets&&e.count===0&&vo(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var s=setTimeout(function(){if(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend){var r=e.unsuspend;e.unsuspend=null,r()}},6e4+t);0<e.imgBytes&&go===0&&(go=62500*Pb());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&vo(e,e.stylesheets),e.unsuspend)){var r=e.unsuspend;e.unsuspend=null,r()}},(e.imgBytes>go?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(s),clearTimeout(i)}}:null}function zp(e){if(e.count===0&&(e.imgCount===0||!e.waitingForImages)){if(e.stylesheets)vo(e,e.stylesheets);else if(e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}}}function zi(){this.count--,zp(this)}function _0(){this.imgCount--,zp(this)}var yo=null;function vo(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,yo=new Map,t.forEach(O0,e),yo=null,zi.call(e))}function O0(e,t){if(!(t.state.loading&4)){var n=yo.get(e);if(n)var s=n.get(null);else{n=new Map,yo.set(e,n);for(var i=e.querySelectorAll("link[data-precedence],style[data-precedence]"),r=0;r<i.length;r++){var f=i[r];(f.nodeName==="LINK"||f.getAttribute("media")!=="not all")&&(n.set(f.dataset.precedence,f),s=f)}s&&n.set(null,s)}i=t.instance,f=i.getAttribute("data-precedence"),r=n.get(f)||s,r===s&&n.set(null,i),n.set(f,i),this.count++,s=zi.bind(this),i.addEventListener("load",s),i.addEventListener("error",s),r?r.parentNode.insertBefore(i,r.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Tl={$$typeof:F,Provider:null,Consumer:null,_currentValue:$t,_currentValue2:$t,_threadCount:0};function M0(e,t,n,s,i,r,f,v,w){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=Io(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Io(0),this.hiddenUpdates=Io(null),this.identifierPrefix=s,this.onUncaughtError=i,this.onCaughtError=r,this.onRecoverableError=f,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=w,this.transitionTypes=null,this.incompleteTransitions=new Map}function Rp(e,t,n,s,i,r,f,v,w,B,G,P){return e=new M0(e,t,n,f,w,B,G,P,v),t=1,r===!0&&(t|=24),r=Wt(3,null,null,t),e.current=r,r.stateNode=e,t=_c(),t.refCount++,e.pooledCache=t,t.refCount++,r.memoizedState={element:s,isDehydrated:n,cache:t},Uc(r),e}function Ap(e){return e?(e=Is,e):Is}function Dp(e,t,n,s,i,r){i=Ap(i),s.context===null?s.context=i:s.pendingContext=i,s=$a(t),s.payload={element:n},r=r===void 0?null:r,r!==null&&(s.callback=r),n=Ga(e,s,t),n!==null&&(an(n,e,t),ii(n,e,t))}function _p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function vd(e,t){_p(e,t),(e=e.alternate)&&_p(e,t)}function Op(e){if(e.tag===13||e.tag===31){var t=xs(e,67108864);t!==null&&an(t,e,67108864),vd(e,67108864)}}function Mp(e){if(e.tag===13||e.tag===31){var t=yn();t=Wo(t);var n=xs(e,t);n!==null&&an(n,e,t),vd(e,t)}}var Cl=!0;function L0(e,t,n,s){var i=he.T;he.T=null;var r=be.p;try{be.p=2,bd(e,t,n,s)}finally{be.p=r,he.T=i}}function U0(e,t,n,s){var i=he.T;he.T=null;var r=be.p;try{be.p=8,bd(e,t,n,s)}finally{be.p=r,he.T=i}}function bd(e,t,n,s){if(Cl){var i=jd(s);if(i===null)td(e,t,s,bo,n),Up(e,s);else if(B0(i,e,t,n,s))s.stopPropagation();else if(Up(e,s),t&4&&-1<H0.indexOf(e)){for(;i!==null;){var r=$s(i);if(r!==null)switch(r.tag){case 3:if(r=r.stateNode,r.current.memoizedState.isDehydrated){var f=us(r.pendingLanes);if(f!==0){var v=r;for(v.pendingLanes|=2,v.entangledLanes|=2;f;){var w=1<<31-dn(f);v.entanglements[1]|=w,f&=~w}la(r),(Xe&6)===0&&(so=cn()+500,Ni(0))}}break;case 31:case 13:v=xs(r,2),v!==null&&an(v,r,2),ro(),vd(r,2)}if(r=jd(s),r===null&&td(e,t,s,bo,n),r===i)break;i=r}i!==null&&s.stopPropagation()}else td(e,t,s,null,n)}}function jd(e){return e=ic(e),Nd(e)}var bo=null;function Nd(e){if(bo=null,e=ds(e),e!==null){var t=h(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=x(t),e!==null)return e;e=null}else if(n===31){if(e=m(t),e!==null)return e;e=null}else if(n===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return bo=e,null}function Lp(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(Py()){case jf:return 2;case Nf:return 8;case Ii:case Fy:return 32;case wf:return 268435456;default:return 32}default:return 32}}var wd=!1,es=null,ts=null,ns=null,Ri=new Map,Ai=new Map,as=[],H0="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 Up(e,t){switch(e){case"focusin":case"focusout":es=null;break;case"dragenter":case"dragleave":ts=null;break;case"mouseover":case"mouseout":ns=null;break;case"pointerover":case"pointerout":Ri.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":Ai.delete(t.pointerId)}}function Di(e,t,n,s,i,r){return e===null||e.nativeEvent!==r?(e={blockedOn:t,domEventName:n,eventSystemFlags:s,nativeEvent:r,targetContainers:[i]},t!==null&&(t=$s(t),t!==null&&Op(t)),e):(e.eventSystemFlags|=s,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function B0(e,t,n,s,i){switch(t){case"focusin":return es=Di(es,e,t,n,s,i),!0;case"dragenter":return ts=Di(ts,e,t,n,s,i),!0;case"mouseover":return ns=Di(ns,e,t,n,s,i),!0;case"pointerover":var r=i.pointerId;return Ri.set(r,Di(Ri.get(r)||null,e,t,n,s,i)),!0;case"gotpointercapture":return r=i.pointerId,Ai.set(r,Di(Ai.get(r)||null,e,t,n,s,i)),!0}return!1}function Hp(e){var t=ds(e.target);if(t!==null){var n=h(t);if(n!==null){if(t=n.tag,t===13){if(t=x(n),t!==null){e.blockedOn=t,Rf(e.priority,function(){Mp(n)});return}}else if(t===31){if(t=m(n),t!==null){e.blockedOn=t,Rf(e.priority,function(){Mp(n)});return}}else if(t===3&&n.stateNode.current.memoizedState.isDehydrated){e.blockedOn=n.tag===3?n.stateNode.containerInfo:null;return}}}e.blockedOn=null}function jo(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=jd(e.nativeEvent);if(n===null){n=e.nativeEvent;var s=new n.constructor(n.type,n);lc=s,n.target.dispatchEvent(s),lc=null}else return t=$s(n),t!==null&&Op(t),e.blockedOn=n,!1;t.shift()}return!0}function Bp(e,t,n){jo(e)&&n.delete(t)}function q0(){wd=!1,es!==null&&jo(es)&&(es=null),ts!==null&&jo(ts)&&(ts=null),ns!==null&&jo(ns)&&(ns=null),Ri.forEach(Bp),Ai.forEach(Bp)}function No(e,t){e.blockedOn===t&&(e.blockedOn=null,wd||(wd=!0,l.unstable_scheduleCallback(l.unstable_NormalPriority,q0)))}var wo=null;function qp(e){wo!==e&&(wo=e,l.unstable_scheduleCallback(l.unstable_NormalPriority,function(){wo===e&&(wo=null);for(var t=0;t<e.length;t+=3){var n=e[t],s=e[t+1],i=e[t+2];if(typeof s!="function"){if(Nd(s||n)===null)continue;break}var r=$s(n);r!==null&&(e.splice(t,3),t-=3,su(r,{pending:!0,data:i,method:n.method,action:s},s,i))}}))}function El(e){function t(w){return No(w,e)}es!==null&&No(es,e),ts!==null&&No(ts,e),ns!==null&&No(ns,e),Ri.forEach(t),Ai.forEach(t);for(var n=0;n<as.length;n++){var s=as[n];s.blockedOn===e&&(s.blockedOn=null)}for(;0<as.length&&(n=as[0],n.blockedOn===null);)Hp(n),n.blockedOn===null&&as.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(s=0;s<n.length;s+=3){var i=n[s],r=n[s+1],f=i[It]||null;if(typeof r=="function")f||qp(n);else if(f){var v=null;if(r&&r.hasAttribute("formAction")){if(i=r,f=r[It]||null)v=f.formAction;else if(Nd(i)!==null)continue}else v=f.action;typeof v=="function"?n[s+1]=v:(n.splice(s,3),s-=3),qp(n)}}}function $p(){function e(r){r.canIntercept&&r.info==="react-transition"&&r.intercept({handler:function(){return new Promise(function(f){return i=f})},focusReset:"manual",scroll:"manual"})}function t(){i!==null&&(i(),i=null),s||setTimeout(n,20)}function n(){if(!s&&!navigation.transition){var r=navigation.currentEntry;r&&r.url!=null&&navigation.navigate(r.url,{state:r.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var s=!1,i=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(n,100),function(){s=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),i!==null&&(i(),i=null)}}}function Sd(e){this._internalRoot=e}So.prototype.render=Sd.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(u(409));var n=t.current,s=yn();Dp(n,s,e,t,null,null)},So.prototype.unmount=Sd.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Dp(e.current,2,null,e,null,null),ro(),t[qs]=null}};function So(e){this._internalRoot=e}So.prototype.unstable_scheduleHydration=function(e){if(e){var t=zf();e={blockedOn:null,target:e,priority:t};for(var n=0;n<as.length&&t!==0&&t<as[n].priority;n++);as.splice(n,0,e),n===0&&Hp(e)}};var Gp=o.version;if(Gp!=="19.3.1")throw Error(u(527,Gp,"19.3.1"));be.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(u(188)):(e=Object.keys(e).join(","),Error(u(268,e)));return e=b(t),e=e!==null?j(e):null,e=e===null?null:e.stateNode,e};var $0={bundleType:0,version:"19.3.1",rendererPackageName:"react-dom",currentDispatcherRef:he,reconcilerVersion:"19.3.1"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var ko=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!ko.isDisabled&&ko.supportsFiber)try{ql=ko.inject($0),un=ko}catch{}}return Oi.createRoot=function(e,t){if(!d(e))throw Error(u(299));var n=!1,s="",i=Am,r=Dm,f=_m;return t!=null&&(t.unstable_strictMode===!0&&(n=!0),t.identifierPrefix!==void 0&&(s=t.identifierPrefix),t.onUncaughtError!==void 0&&(i=t.onUncaughtError),t.onCaughtError!==void 0&&(r=t.onCaughtError),t.onRecoverableError!==void 0&&(f=t.onRecoverableError)),t=Rp(e,1,!1,null,null,n,s,null,i,r,f,$p),e[qs]=t.current,ed(e),new Sd(t)},Oi.hydrateRoot=function(e,t,n){if(!d(e))throw Error(u(299));var s=!1,i="",r=Am,f=Dm,v=_m,w=null;return n!=null&&(n.unstable_strictMode===!0&&(s=!0),n.identifierPrefix!==void 0&&(i=n.identifierPrefix),n.onUncaughtError!==void 0&&(r=n.onUncaughtError),n.onCaughtError!==void 0&&(f=n.onCaughtError),n.onRecoverableError!==void 0&&(v=n.onRecoverableError),n.formState!==void 0&&(w=n.formState)),t=Rp(e,1,!0,t,n??null,s,i,w,r,f,v,$p),t.context=Ap(null),n=t.current,s=yn(),s=Wo(s),i=$a(s),i.callback=null,Ga(n,i,s),n=s,t.current.lanes=n,Gl(t,n),la(t),e[qs]=t.current,ed(e),new So(t)},Oi.version="19.3.1",Oi}var Ip;function P0(){if(Ip)return Cd.exports;Ip=1;function l(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(l)}catch(o){console.error(o)}}return l(),Cd.exports=J0(),Cd.exports}var F0=P0();/**
50
+ * react-router v7.18.5
51
+ *
52
+ * Copyright (c) Remix Software Inc.
53
+ *
54
+ * This source code is licensed under the MIT license found in the
55
+ * LICENSE.md file in the root directory of this source tree.
56
+ *
57
+ * @license MIT
58
+ */var ef=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Xg=/^[\\/]{2}/;function I0(l,o){return o+l.replace(/\\/g,"/")}var Wp="popstate";function eg(l){return typeof l=="object"&&l!=null&&"pathname"in l&&"search"in l&&"hash"in l&&"state"in l&&"key"in l}function W0(l={}){function o(d,h){let{pathname:x="/",search:m="",hash:p=""}=Us(d.location.hash.substring(1));return!x.startsWith("/")&&!x.startsWith(".")&&(x="/"+x),$d("",{pathname:x,search:m,hash:p},h.state&&h.state.usr||null,h.state&&h.state.key||"default")}function c(d,h){let x=d.document.querySelector("base"),m="";if(x&&x.getAttribute("href")){let p=d.location.href,b=p.indexOf("#");m=b===-1?p:p.slice(0,b)}return m+"#"+(typeof h=="string"?h:Al(h))}function u(d,h){On(d.pathname.charAt(0)==="/",`relative pathnames are not supported in hash history.push(${JSON.stringify(h)})`)}return t1(o,c,u,l)}function it(l,o){if(l===!1||l===null||typeof l>"u")throw new Error(o)}function On(l,o){if(!l){typeof console<"u"&&console.warn(o);try{throw new Error(o)}catch{}}}function e1(){return Math.random().toString(36).substring(2,10)}function tg(l,o){return{usr:l.state,key:l.key,idx:o,masked:l.mask?{pathname:l.pathname,search:l.search,hash:l.hash}:void 0}}function $d(l,o,c=null,u,d){return{pathname:typeof l=="string"?l:l.pathname,search:"",hash:"",...typeof o=="string"?Us(o):o,state:c,key:o&&o.key||u||e1(),mask:d}}function Al({pathname:l="/",search:o="",hash:c=""}){return o&&o!=="?"&&(l+=o.charAt(0)==="?"?o:"?"+o),c&&c!=="#"&&(l+=c.charAt(0)==="#"?c:"#"+c),l}function Us(l){let o={};if(l){let c=l.indexOf("#");c>=0&&(o.hash=l.substring(c),l=l.substring(0,c));let u=l.indexOf("?");u>=0&&(o.search=l.substring(u),l=l.substring(0,u)),l&&(o.pathname=l)}return o}function t1(l,o,c,u={}){let{window:d=document.defaultView,v5Compat:h=!1}=u,x=d.history,m="POP",p=null,b=j();b==null&&(b=0,x.replaceState({...x.state,idx:b},""));function j(){return(x.state||{idx:null}).idx}function y(){m="POP";let k=j(),E=k==null?null:k-b;b=k,p&&p({action:m,location:S.location,delta:E})}function N(k,E){m="PUSH";let T=eg(k)?k:$d(S.location,k,E);c&&c(T,k),b=j()+1;let Y=tg(T,b),z=S.createHref(T.mask||T);try{x.pushState(Y,"",z)}catch(D){if(D instanceof DOMException&&D.name==="DataCloneError")throw D;d.location.assign(z)}h&&p&&p({action:m,location:S.location,delta:1})}function C(k,E){m="REPLACE";let T=eg(k)?k:$d(S.location,k,E);c&&c(T,k),b=j();let Y=tg(T,b),z=S.createHref(T.mask||T);x.replaceState(Y,"",z),h&&p&&p({action:m,location:S.location,delta:0})}function U(k){return n1(d,k)}let S={get action(){return m},get location(){return l(d,x)},listen(k){if(p)throw new Error("A history only accepts one active listener");return d.addEventListener(Wp,y),p=k,()=>{d.removeEventListener(Wp,y),p=null}},createHref(k){return o(d,k)},createURL:U,encodeLocation(k){let E=U(k);return{pathname:E.pathname,search:E.search,hash:E.hash}},push:N,replace:C,go(k){return x.go(k)}};return S}function n1(l,o,c=!1){let u="http://localhost";l&&(u=l.location.origin!=="null"?l.location.origin:l.location.href),it(u,"No window.location.(origin|href) available to create URL");let d=typeof o=="string"?o:Al(o);return d=d.replace(/ $/,"%20"),!c&&Xg.test(d)&&(d=u+d),new URL(d,u)}function Qg(l,o,c="/"){return a1(l,o,c,!1)}function a1(l,o,c,u,d){let h=typeof o=="string"?Us(o):o,x=za(h.pathname||"/",c);if(x==null)return null;let m=s1(l),p=null,b=x1(x);for(let j=0;p==null&&j<m.length;++j)p=m1(m[j],b,u);return p}function s1(l){let o=Zg(l);return l1(o),o}function Zg(l,o=[],c=[],u="",d=!1){let h=(x,m,p=d,b)=>{let j={relativePath:b===void 0?x.path||"":b,caseSensitive:x.caseSensitive===!0,childrenIndex:m,route:x};if(j.relativePath.startsWith("/")){if(!j.relativePath.startsWith(u)&&p)return;it(j.relativePath.startsWith(u),`Absolute route path "${j.relativePath}" nested under path "${u}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),j.relativePath=j.relativePath.slice(u.length)}let y=Gn([u,j.relativePath]),N=c.concat(j);x.children&&x.children.length>0&&(it(x.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${y}".`),Zg(x.children,o,N,y,p)),!(x.path==null&&!x.index)&&o.push({path:y,score:f1(y,x.index),routesMeta:N.map((C,U)=>{let[S,k]=Pg(C.relativePath,C.caseSensitive,U===N.length-1);return{...C,matcher:S,compiledParams:k}})})};return l.forEach((x,m)=>{if(x.path===""||!x.path?.includes("?"))h(x,m);else for(let p of Kg(x.path))h(x,m,!0,p)}),o}function Kg(l){let o=l.split("/");if(o.length===0)return[];let[c,...u]=o,d=c.endsWith("?"),h=c.replace(/\?$/,"");if(u.length===0)return d?[h,""]:[h];let x=Kg(u.join("/")),m=[];return m.push(...x.map(p=>p===""?h:[h,p].join("/"))),d&&m.push(...x),m.map(p=>l.startsWith("/")&&p===""?"/":p)}function l1(l){l.sort((o,c)=>o.score!==c.score?c.score-o.score:h1(o.routesMeta.map(u=>u.childrenIndex),c.routesMeta.map(u=>u.childrenIndex)))}var i1=/^:[\w-]+$/,r1=3,o1=2,c1=1,u1=10,d1=-2,ng=l=>l==="*";function f1(l,o){let c=l.split("/"),u=c.length;return c.some(ng)&&(u+=d1),o&&(u+=o1),c.filter(d=>!ng(d)).reduce((d,h)=>d+(i1.test(h)?r1:h===""?c1:u1),u)}function h1(l,o){return l.length===o.length&&l.slice(0,-1).every((u,d)=>u===o[d])?l[l.length-1]-o[o.length-1]:0}function m1(l,o,c=!1){let{routesMeta:u}=l,d={},h="/",x=[];for(let m=0;m<u.length;++m){let p=u[m],b=m===u.length-1,j=h==="/"?o:o.slice(h.length)||"/",y={path:p.relativePath,caseSensitive:p.caseSensitive,end:b},N=p.matcher&&p.compiledParams?Jg(y,j,p.matcher,p.compiledParams):Mo(y,j),C=p.route;if(!N&&b&&c&&!u[u.length-1].route.index&&(N=Mo({path:p.relativePath,caseSensitive:p.caseSensitive,end:!1},j)),!N)return null;Object.assign(d,N.params),x.push({params:d,pathname:Gn([h,N.pathname]),pathnameBase:y1(Gn([h,N.pathnameBase])),route:C}),N.pathnameBase!=="/"&&(h=Gn([h,N.pathnameBase]))}return x}function Mo(l,o){typeof l=="string"&&(l={path:l,caseSensitive:!1,end:!0});let[c,u]=Pg(l.path,l.caseSensitive,l.end);return Jg(l,o,c,u)}function Jg(l,o,c,u){let d=o.match(c);if(!d)return null;let h=d[0],x=Dl(h,1),m=d.slice(1);return{params:u.reduce((b,{paramName:j,isOptional:y},N)=>{if(j==="*"){let U=m[N]||"";x=Dl(h.slice(0,h.length-U.length),1)}const C=m[N];return y&&!C?b[j]=void 0:b[j]=(C||"").replace(/%2F/g,"/"),b},{}),pathname:h,pathnameBase:x,pattern:l}}function Pg(l,o=!1,c=!0){On(l==="*"||!l.endsWith("*")||l.endsWith("/*"),`Route path "${l}" will be treated as if it were "${l.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${l.replace(/\*$/,"/*")}".`);let u=[],d="^"+l.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(x,m,p,b,j)=>{if(u.push({paramName:m,isOptional:p!=null}),p){let y=j.charAt(b+x.length);return y&&y!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return l.endsWith("*")?(u.push({paramName:"*"}),d+=l==="*"||l==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):c?d+="\\/*$":l!==""&&l!=="/"&&(d+="(?:(?=\\/|$))"),[new RegExp(d,o?void 0:"i"),u]}function x1(l){try{return l.split("/").map(o=>decodeURIComponent(o).replace(/\//g,"%2F")).join("/")}catch(o){return On(!1,`The URL path "${l}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${o}).`),l}}function za(l,o){if(o==="/")return l;if(!l.toLowerCase().startsWith(o.toLowerCase()))return null;let c=o.endsWith("/")?o.length-1:o.length,u=l.charAt(c);return u&&u!=="/"?null:l.slice(c)||"/"}function p1(l,o="/"){let{pathname:c,search:u="",hash:d=""}=typeof l=="string"?Us(l):l,h;return c?(c=Ig(c),c.startsWith("/")||c.startsWith("\\")?h=ag(c.substring(1),"/"):h=ag(c,o)):h=o,{pathname:h,search:v1(u),hash:b1(d)}}function ag(l,o){let c=Dl(o).split("/");return l.split("/").forEach(d=>{d===".."?c.length>1&&c.pop():d!=="."&&c.push(d)}),c.length>1?c.join("/"):"/"}function Ad(l,o,c,u){return`Cannot include a '${l}' character in a manually specified \`to.${o}\` field [${JSON.stringify(u)}]. Please separate it out to the \`to.${c}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function g1(l){return l.filter((o,c)=>c===0||o.route.path&&o.route.path.length>0)}function Fg(l){let o=g1(l);return o.map((c,u)=>u===o.length-1?c.pathname:c.pathnameBase)}function tf(l,o,c,u=!1){let d;typeof l=="string"?d=Us(l):(d={...l},it(!d.pathname||!d.pathname.includes("?"),Ad("?","pathname","search",d)),it(!d.pathname||!d.pathname.includes("#"),Ad("#","pathname","hash",d)),it(!d.search||!d.search.includes("#"),Ad("#","search","hash",d)));let h=l===""||d.pathname==="",x=h?"/":d.pathname,m;if(x==null)m=c;else{let y=o.length-1;if(!u&&x.startsWith("..")){let N=x.split("/");for(;N[0]==="..";)N.shift(),y-=1;d.pathname=N.join("/")}m=y>=0?o[y]:"/"}let p=p1(d,m),b=x&&x!=="/"&&x.endsWith("/"),j=(h||x===".")&&c.endsWith("/");return!p.pathname.endsWith("/")&&(b||j)&&(p.pathname+="/"),p}var Ig=l=>l.replace(/[\\/]{2,}/g,"/"),Gn=l=>Ig(l.join("/"));function Dl(l,o=0){let c=l.length;for(;c>o&&l.charCodeAt(c-1)===47;)c--;return c===l.length?l:l.slice(0,c)}var y1=l=>Dl(l).replace(/^\/*/,"/"),v1=l=>!l||l==="?"?"":l.startsWith("?")?l:"?"+l,b1=l=>!l||l==="#"?"":l.startsWith("#")?l:"#"+l,j1=class{constructor(l,o,c,u=!1){this.status=l,this.statusText=o||"",this.internal=u,c instanceof Error?(this.data=c.toString(),this.error=c):this.data=c}};function N1(l){return l!=null&&typeof l.status=="number"&&typeof l.statusText=="string"&&typeof l.internal=="boolean"&&"data"in l}function w1(l){let o=l.map(c=>c.route.path).filter(Boolean);return Gn(o)||"/"}var Wg=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function ey(l,o){let c=l;if(typeof c!="string"||!ef.test(c))return{absoluteURL:void 0,isExternal:!1,to:c};let u=c,d=!1;if(Wg)try{let h=new URL(window.location.href),x=Xg.test(c)?new URL(I0(c,h.protocol)):new URL(c),m=za(x.pathname,o);x.origin===h.origin&&m!=null?c=m+x.search+x.hash:d=!0}catch{On(!1,`<Link to="${c}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:u,isExternal:d,to:c}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var sg=new URL("http://localhost");function ty(l){if(l.createURL)return l.createURL("/");try{return new URL(l.createHref("/"),sg)}catch{return sg}}function Dd(l,o){return l.origin===o.origin&&(l.origin!=="null"||l.protocol===o.protocol&&l.host===o.host)}function S1(l,o){if(l.startsWith("//"))return!0;let c=o.protocol.toLowerCase();return l.toLowerCase().startsWith(c)?o.host===""||l.slice(c.length).startsWith("//"):!1}function ny(l,o,c,u){let d=null;try{d=l==null?null:new URL(l,c)}catch{}let h=new URL(o,c),x=d!=null&&!Dd(d,c),m=!Dd(h,c);if(u==="reject"){if(x||m)throw new Error("External navigation is not allowed")}else if(m&&(d==null||!S1(l,d)||!Dd(d,h)))throw new Error("External navigation is not allowed")}var ay=["POST","PUT","PATCH","DELETE"];new Set(ay);var k1=["GET",...ay];new Set(k1);var T1=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function C1(l){try{return T1.includes(new URL(l).protocol)}catch{return!1}}var Ml=g.createContext(null);Ml.displayName="DataRouter";var Go=g.createContext(null);Go.displayName="DataRouterState";var sy=g.createContext(!1);function E1(){return g.useContext(sy)}var ly=g.createContext({isTransitioning:!1});ly.displayName="ViewTransition";var z1=g.createContext(new Map);z1.displayName="Fetchers";var R1=g.createContext(null);R1.displayName="Await";var Mn=g.createContext(null);Mn.displayName="Navigation";var Yi=g.createContext(null);Yi.displayName="Location";var ca=g.createContext({outlet:null,matches:[],isDataRoute:!1});ca.displayName="Route";var nf=g.createContext(null);nf.displayName="RouteError";var iy="REACT_ROUTER_ERROR",A1="REDIRECT",D1="ROUTE_ERROR_RESPONSE";function _1(l){if(l.startsWith(`${iy}:${A1}:{`))try{let o=JSON.parse(l.slice(28));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string"&&typeof o.location=="string"&&typeof o.reloadDocument=="boolean"&&typeof o.replace=="boolean")return o}catch{}}function O1(l){if(l.startsWith(`${iy}:${D1}:{`))try{let o=JSON.parse(l.slice(40));if(typeof o=="object"&&o&&typeof o.status=="number"&&typeof o.statusText=="string")return new j1(o.status,o.statusText,o.data)}catch{}}function M1(l,{relative:o}={}){it(Vi(),"useHref() may be used only in the context of a <Router> component.");let{basename:c,navigator:u}=g.useContext(Mn),{hash:d,pathname:h,search:x}=Qi(l,{relative:o}),m=h;return c!=="/"&&(m=h==="/"?c:Gn([c,h])),u.createHref({pathname:m,search:x,hash:d})}function Vi(){return g.useContext(Yi)!=null}function jn(){return it(Vi(),"useLocation() may be used only in the context of a <Router> component."),g.useContext(Yi).location}var ry="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function oy(l){g.useContext(Mn).static||g.useLayoutEffect(l)}function Xi(){let{isDataRoute:l}=g.useContext(ca);return l?P1():L1()}function L1(){it(Vi(),"useNavigate() may be used only in the context of a <Router> component.");let l=g.useContext(Ml),{basename:o,navigator:c}=g.useContext(Mn),{matches:u}=g.useContext(ca),{pathname:d}=jn(),h=JSON.stringify(Fg(u)),x=g.useRef(!1);return oy(()=>{x.current=!0}),g.useCallback((p,b={})=>{if(On(x.current,ry),!x.current)return;if(typeof p=="number"){c.go(p);return}let j=tf(p,JSON.parse(h),d,b.relative==="path");l==null&&o!=="/"&&(j.pathname=j.pathname==="/"?o:Gn([o,j.pathname])),ny(typeof p=="string"?p:Al(p),c.createHref(j),ty(c),"reject"),(b.replace?c.replace:c.push)(j,b.state,b)},[o,c,h,d,l])}var U1=g.createContext(null);function H1(l){let o=g.useContext(ca).outlet;return g.useMemo(()=>o&&g.createElement(U1.Provider,{value:l},o),[o,l])}function Qi(l,{relative:o}={}){let{matches:c}=g.useContext(ca),{pathname:u}=jn(),d=JSON.stringify(Fg(c));return g.useMemo(()=>tf(l,JSON.parse(d),u,o==="path"),[l,d,u,o])}function B1(l,o){return cy(l,o)}function cy(l,o,c){it(Vi(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:u}=g.useContext(Mn),{matches:d}=g.useContext(ca),h=d[d.length-1],x=h?h.params:{},m=h?h.pathname:"/",p=h?h.pathnameBase:"/",b=h&&h.route;{let k=b&&b.path||"";dy(m,!b||k.endsWith("*")||k.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${m}" (under <Route path="${k}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
59
+
60
+ Please change the parent <Route path="${k}"> to <Route path="${k==="/"?"*":`${k}/*`}">.`)}let j=jn(),y;if(o){let k=typeof o=="string"?Us(o):o;it(p==="/"||k.pathname?.startsWith(p),`When overriding the location using \`<Routes location>\` or \`useRoutes(routes, location)\`, the location pathname must begin with the portion of the URL pathname that was matched by all parent routes. The current pathname base is "${p}" but pathname "${k.pathname}" was given in the \`location\` prop.`),y=k}else y=j;let N=y.pathname||"/",C=N;if(p!=="/"){let k=p.replace(/^\//,"").split("/");C="/"+N.replace(/^\//,"").split("/").slice(k.length).join("/")}let U=c&&c.state.matches.length?c.state.matches.map(k=>Object.assign(k,{route:c.manifest[k.route.id]||k.route})):Qg(l,{pathname:C});On(b||U!=null,`No routes matched location "${y.pathname}${y.search}${y.hash}" `),On(U==null||U[U.length-1].route.element!==void 0||U[U.length-1].route.Component!==void 0||U[U.length-1].route.lazy!==void 0,`Matched leaf route at location "${y.pathname}${y.search}${y.hash}" does not have an element or Component. This means it will render an <Outlet /> with a null value by default resulting in an "empty" page.`);let S=V1(U&&U.map(k=>Object.assign({},k,{params:Object.assign({},x,k.params),pathname:Gn([p,u.encodeLocation?u.encodeLocation(k.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathname]),pathnameBase:k.pathnameBase==="/"?p:Gn([p,u.encodeLocation?u.encodeLocation(k.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:k.pathnameBase])})),d,c);return o&&S?g.createElement(Yi.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...y},navigationType:"POP"}},S):S}function q1(){let l=J1(),o=N1(l)?`${l.status} ${l.statusText}`:l instanceof Error?l.message:JSON.stringify(l),c=l instanceof Error?l.stack:null,u="rgba(200,200,200, 0.5)",d={padding:"0.5rem",backgroundColor:u},h={padding:"2px 4px",backgroundColor:u},x=null;return console.error("Error handled by React Router default ErrorBoundary:",l),x=g.createElement(g.Fragment,null,g.createElement("p",null,"💿 Hey developer 👋"),g.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",g.createElement("code",{style:h},"ErrorBoundary")," or"," ",g.createElement("code",{style:h},"errorElement")," prop on your route.")),g.createElement(g.Fragment,null,g.createElement("h2",null,"Unexpected Application Error!"),g.createElement("h3",{style:{fontStyle:"italic"}},o),c?g.createElement("pre",{style:d},c):null,x)}var $1=g.createElement(q1,null),uy=class extends g.Component{constructor(l){super(l),this.state={location:l.location,revalidation:l.revalidation,error:l.error}}static getDerivedStateFromError(l){return{error:l}}static getDerivedStateFromProps(l,o){return o.location!==l.location||o.revalidation!=="idle"&&l.revalidation==="idle"?{error:l.error,location:l.location,revalidation:l.revalidation}:{error:l.error!==void 0?l.error:o.error,location:o.location,revalidation:l.revalidation||o.revalidation}}componentDidCatch(l,o){this.props.onError?this.props.onError(l,o):console.error("React Router caught the following error during render",l)}render(){let l=this.state.error;if(this.context&&typeof l=="object"&&l&&"digest"in l&&typeof l.digest=="string"){const c=O1(l.digest);c&&(l=c)}let o=l!==void 0?g.createElement(ca.Provider,{value:this.props.routeContext},g.createElement(nf.Provider,{value:l,children:this.props.component})):this.props.children;return this.context?g.createElement(G1,{error:l},o):o}};uy.contextType=sy;var _d=new WeakMap;function G1({children:l,error:o}){let{basename:c,navigator:u}=g.useContext(Mn);if(typeof o=="object"&&o&&"digest"in o&&typeof o.digest=="string"){let d=_1(o.digest);if(d){let h=_d.get(o);if(h)throw h;let x=ey(d.location,c),m=x.absoluteURL||x.to;if(ny(d.location,m,ty(u),"allow-explicit"),C1(m))throw new Error("Invalid redirect location");if(Wg&&!_d.get(o))if(x.isExternal||d.reloadDocument)window.location.href=m;else{const p=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(x.to,{replace:d.replace}));throw _d.set(o,p),p}return g.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m}`})}}return l}function Y1({routeContext:l,match:o,children:c}){let u=g.useContext(Ml);return u&&u.static&&u.staticContext&&(o.route.errorElement||o.route.ErrorBoundary)&&(u.staticContext._deepestRenderedBoundaryId=o.route.id),g.createElement(ca.Provider,{value:l},c)}function V1(l,o=[],c){let u=c?.state;if(l==null){if(!u)return null;if(u.errors)l=u.matches;else if(o.length===0&&!u.initialized&&u.matches.length>0)l=u.matches;else return null}let d=l,h=u?.errors;if(h!=null){let j=d.findIndex(y=>y.route.id&&h?.[y.route.id]!==void 0);it(j>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(h).join(",")}`),d=d.slice(0,Math.min(d.length,j+1))}let x=!1,m=-1;if(c&&u){x=u.renderFallback;for(let j=0;j<d.length;j++){let y=d[j];if((y.route.HydrateFallback||y.route.hydrateFallbackElement)&&(m=j),y.route.id){let{loaderData:N,errors:C}=u,U=y.route.loader&&!N.hasOwnProperty(y.route.id)&&(!C||C[y.route.id]===void 0);if(y.route.lazy||U){c.isStatic&&(x=!0),m>=0?d=d.slice(0,m+1):d=[d[0]];break}}}}let p=c?.onError,b=u&&p?(j,y)=>{p(j,{location:u.location,params:u.matches?.[0]?.params??{},pattern:w1(u.matches),errorInfo:y})}:void 0;return d.reduceRight((j,y,N)=>{let C,U=!1,S=null,k=null;u&&(C=h&&y.route.id?h[y.route.id]:void 0,S=y.route.errorElement||$1,x&&(m<0&&N===0?(dy("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),U=!0,k=null):m===N&&(U=!0,k=y.route.hydrateFallbackElement||null)));let E=o.concat(d.slice(0,N+1)),T=()=>{let Y;return C?Y=S:U?Y=k:y.route.Component?Y=g.createElement(y.route.Component,null):y.route.element?Y=y.route.element:Y=j,g.createElement(Y1,{match:y,routeContext:{outlet:j,matches:E,isDataRoute:u!=null},children:Y})};return u&&(y.route.ErrorBoundary||y.route.errorElement||N===0)?g.createElement(uy,{location:u.location,revalidation:u.revalidation,component:S,error:C,children:T(),routeContext:{outlet:null,matches:E,isDataRoute:!0},onError:b}):T()},null)}function af(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function X1(l){let o=g.useContext(Ml);return it(o,af(l)),o}function Q1(l){let o=g.useContext(Go);return it(o,af(l)),o}function Z1(l){let o=g.useContext(ca);return it(o,af(l)),o}function sf(l){let o=Z1(l),c=o.matches[o.matches.length-1];return it(c.route.id,`${l} can only be used on routes that contain a unique "id"`),c.route.id}function K1(){return sf("useRouteId")}function J1(){let l=g.useContext(nf),o=Q1("useRouteError"),c=sf("useRouteError");return l!==void 0?l:o.errors?.[c]}function P1(){let{router:l}=X1("useNavigate"),o=sf("useNavigate"),c=g.useRef(!1);return oy(()=>{c.current=!0}),g.useCallback(async(d,h={})=>{On(c.current,ry),c.current&&(typeof d=="number"?await l.navigate(d):await l.navigate(d,{fromRouteId:o,...h}))},[l,o])}var lg={};function dy(l,o,c){!o&&!lg[l]&&(lg[l]=!0,On(!1,c))}g.memo(F1);function F1({routes:l,manifest:o,future:c,state:u,isStatic:d,onError:h}){return cy(l,void 0,{manifest:o,state:u,isStatic:d,onError:h})}function I1(l){return H1(l.context)}function Dn(l){it(!1,"A <Route> is only ever to be used as the child of <Routes> element, never rendered directly. Please wrap your <Route> in a <Routes>.")}function W1({basename:l="/",children:o=null,location:c,navigationType:u="POP",navigator:d,static:h=!1,useTransitions:x}){it(!Vi(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let m=l.replace(/^\/*/,"/"),p=g.useMemo(()=>({basename:m,navigator:d,static:h,useTransitions:x,future:{}}),[m,d,h,x]);typeof c=="string"&&(c=Us(c));let{pathname:b="/",search:j="",hash:y="",state:N=null,key:C="default",mask:U}=c,S=g.useMemo(()=>{let k=za(b,m);return k==null?null:{location:{pathname:k,search:j,hash:y,state:N,key:C,mask:U},navigationType:u}},[m,b,j,y,N,C,u,U]);return On(S!=null,`<Router basename="${m}"> is not able to match the URL "${b}${j}${y}" because it does not start with the basename, so the <Router> won't render anything.`),S==null?null:g.createElement(Mn.Provider,{value:p},g.createElement(Yi.Provider,{children:o,value:S}))}function ej({children:l,location:o}){return B1(Gd(l),o)}function Gd(l,o=[]){let c=[];return g.Children.forEach(l,(u,d)=>{if(!g.isValidElement(u))return;let h=[...o,d];if(u.type===g.Fragment){c.push.apply(c,Gd(u.props.children,h));return}it(u.type===Dn,`[${typeof u.type=="string"?u.type:u.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),it(!u.props.index||!u.props.children,"An index route cannot have child routes.");let x={id:u.props.id||h.join("-"),caseSensitive:u.props.caseSensitive,element:u.props.element,Component:u.props.Component,index:u.props.index,path:u.props.path,middleware:u.props.middleware,loader:u.props.loader,action:u.props.action,hydrateFallbackElement:u.props.hydrateFallbackElement,HydrateFallback:u.props.HydrateFallback,errorElement:u.props.errorElement,ErrorBoundary:u.props.ErrorBoundary,hasErrorBoundary:u.props.hasErrorBoundary===!0||u.props.ErrorBoundary!=null||u.props.errorElement!=null,shouldRevalidate:u.props.shouldRevalidate,handle:u.props.handle,lazy:u.props.lazy};u.props.children&&(x.children=Gd(u.props.children,h)),c.push(x)}),c}var Ro="get",Ao="application/x-www-form-urlencoded";function Yo(l){return typeof HTMLElement<"u"&&l instanceof HTMLElement}function tj(l){return Yo(l)&&l.tagName.toLowerCase()==="button"}function nj(l){return Yo(l)&&l.tagName.toLowerCase()==="form"}function aj(l){return Yo(l)&&l.tagName.toLowerCase()==="input"}function sj(l){return!!(l.metaKey||l.altKey||l.ctrlKey||l.shiftKey)}function lj(l,o){return l.button===0&&(!o||o==="_self")&&!sj(l)}function Yd(l=""){return new URLSearchParams(typeof l=="string"||Array.isArray(l)||l instanceof URLSearchParams?l:Object.keys(l).reduce((o,c)=>{let u=l[c];return o.concat(Array.isArray(u)?u.map(d=>[c,d]):[[c,u]])},[]))}function ij(l,o){let c=Yd(l);return o&&o.forEach((u,d)=>{c.has(d)||o.getAll(d).forEach(h=>{c.append(d,h)})}),c}var To=null;function rj(){if(To===null)try{new FormData(document.createElement("form"),0),To=!1}catch{To=!0}return To}var oj=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function Od(l){return l!=null&&!oj.has(l)?(On(!1,`"${l}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Ao}"`),null):l}function cj(l,o){let c,u,d,h,x;if(nj(l)){let m=l.getAttribute("action");u=m?za(m,o):null,c=l.getAttribute("method")||Ro,d=Od(l.getAttribute("enctype"))||Ao,h=new FormData(l)}else if(tj(l)||aj(l)&&(l.type==="submit"||l.type==="image")){let m=l.form;if(m==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let p=l.getAttribute("formaction")||m.getAttribute("action");if(u=p?za(p,o):null,c=l.getAttribute("formmethod")||m.getAttribute("method")||Ro,d=Od(l.getAttribute("formenctype"))||Od(m.getAttribute("enctype"))||Ao,h=new FormData(m,l),!rj()){let{name:b,type:j,value:y}=l;if(j==="image"){let N=b?`${b}.`:"";h.append(`${N}x`,"0"),h.append(`${N}y`,"0")}else b&&h.append(b,y)}}else{if(Yo(l))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');c=Ro,u=null,d=Ao,x=l}return h&&d==="text/plain"&&(x=h,h=void 0),{action:u,method:c.toLowerCase(),encType:d,formData:h,body:x}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function lf(l,o){if(l===!1||l===null||typeof l>"u")throw new Error(o)}function fy(l,o,c,u){let d=typeof l=="string"?new URL(l,typeof window>"u"?"server://singlefetch/":window.location.origin):l;return c?d.pathname.endsWith("/")?d.pathname=`${d.pathname}_.${u}`:d.pathname=`${d.pathname}.${u}`:d.pathname==="/"?d.pathname=`_root.${u}`:o&&za(d.pathname,o)==="/"?d.pathname=`${Dl(o)}/_root.${u}`:d.pathname=`${Dl(d.pathname)}.${u}`,d}async function uj(l,o){if(l.id in o)return o[l.id];try{let c=await import(l.module);return o[l.id]=c,c}catch(c){return console.error(`Error loading route module \`${l.module}\`, reloading page...`),console.error(c),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function dj(l){return l==null?!1:l.href==null?l.rel==="preload"&&typeof l.imageSrcSet=="string"&&typeof l.imageSizes=="string":typeof l.rel=="string"&&typeof l.href=="string"}async function fj(l,o,c){let u=await Promise.all(l.map(async d=>{let h=o.routes[d.route.id];if(h){let x=await uj(h,c);return x.links?x.links():[]}return[]}));return pj(u.flat(1).filter(dj).filter(d=>d.rel==="stylesheet"||d.rel==="preload").map(d=>d.rel==="stylesheet"?{...d,rel:"prefetch",as:"style"}:{...d,rel:"prefetch"}))}function ig(l,o,c,u,d,h){let x=(p,b)=>c[b]?p.route.id!==c[b].route.id:!0,m=(p,b)=>c[b].pathname!==p.pathname||c[b].route.path?.endsWith("*")&&c[b].params["*"]!==p.params["*"];return h==="assets"?o.filter((p,b)=>x(p,b)||m(p,b)):h==="data"?o.filter((p,b)=>{let j=u.routes[p.route.id];if(!j||!j.hasLoader)return!1;if(x(p,b)||m(p,b))return!0;if(p.route.shouldRevalidate){let y=p.route.shouldRevalidate({currentUrl:new URL(d.pathname+d.search+d.hash,window.origin),currentParams:c[0]?.params||{},nextUrl:new URL(l,window.origin),nextParams:p.params,defaultShouldRevalidate:!0});if(typeof y=="boolean")return y}return!0}):[]}function hj(l,o,{includeHydrateFallback:c}={}){return mj(l.map(u=>{let d=o.routes[u.route.id];if(!d)return[];let h=[d.module];return d.clientActionModule&&(h=h.concat(d.clientActionModule)),d.clientLoaderModule&&(h=h.concat(d.clientLoaderModule)),c&&d.hydrateFallbackModule&&(h=h.concat(d.hydrateFallbackModule)),d.imports&&(h=h.concat(d.imports)),h}).flat(1))}function mj(l){return[...new Set(l)]}function xj(l){let o={},c=Object.keys(l).sort();for(let u of c)o[u]=l[u];return o}function pj(l,o){let c=new Set;return new Set(o),l.reduce((u,d)=>{let h=JSON.stringify(xj(d));return c.has(h)||(c.add(h),u.push({key:h,link:d})),u},[])}function rf(){let l=g.useContext(Ml);return lf(l,"You must render this element inside a <DataRouterContext.Provider> element"),l}function gj(){let l=g.useContext(Go);return lf(l,"You must render this element inside a <DataRouterStateContext.Provider> element"),l}var of=g.createContext(void 0);of.displayName="FrameworkContext";function Vo(){let l=g.useContext(of);return lf(l,"You must render this element inside a <HydratedRouter> element"),l}function yj(l,o){let c=g.useContext(of),[u,d]=g.useState(!1),[h,x]=g.useState(!1),{onFocus:m,onBlur:p,onMouseEnter:b,onMouseLeave:j,onTouchStart:y}=o,N=g.useRef(null);g.useEffect(()=>{if(l==="render"&&x(!0),l==="viewport"){let S=E=>{E.forEach(T=>{x(T.isIntersecting)})},k=new IntersectionObserver(S,{threshold:.5});return N.current&&k.observe(N.current),()=>{k.disconnect()}}},[l]),g.useEffect(()=>{if(u){let S=setTimeout(()=>{x(!0)},100);return()=>{clearTimeout(S)}}},[u]);let C=()=>{d(!0)},U=()=>{d(!1),x(!1)};return c?l!=="intent"?[h,N,{}]:[h,N,{onFocus:Mi(m,C),onBlur:Mi(p,U),onMouseEnter:Mi(b,C),onMouseLeave:Mi(j,U),onTouchStart:Mi(y,C)}]:[!1,N,{}]}function Mi(l,o){return c=>{l&&l(c),c.defaultPrevented||o(c)}}function vj({page:l,...o}){let c=E1(),{nonce:u}=Vo(),{router:d}=rf(),h=g.useMemo(()=>Qg(d.routes,l,d.basename),[d.routes,l,d.basename]);return h?(o.nonce==null&&u&&(o={...o,nonce:u}),c?g.createElement(jj,{page:l,matches:h,...o}):g.createElement(Nj,{page:l,matches:h,...o})):null}function bj(l){let{manifest:o,routeModules:c}=Vo(),[u,d]=g.useState([]);return g.useEffect(()=>{let h=!1;return fj(l,o,c).then(x=>{h||d(x)}),()=>{h=!0}},[l,o,c]),u}function jj({page:l,matches:o,...c}){let u=jn(),{future:d}=Vo(),{basename:h}=rf(),x=g.useMemo(()=>{if(l===u.pathname+u.search+u.hash)return[];let m=fy(l,h,d.v8_trailingSlashAwareDataRequests,"rsc"),p=!1,b=[];for(let j of o)typeof j.route.shouldRevalidate=="function"?p=!0:b.push(j.route.id);return p&&b.length>0&&m.searchParams.set("_routes",b.join(",")),[m.pathname+m.search]},[h,d.v8_trailingSlashAwareDataRequests,l,u,o]);return g.createElement(g.Fragment,null,x.map(m=>g.createElement("link",{key:m,rel:"prefetch",as:"fetch",href:m,...c})))}function Nj({page:l,matches:o,...c}){let u=jn(),{future:d,manifest:h,routeModules:x}=Vo(),{basename:m}=rf(),{loaderData:p,matches:b}=gj(),j=g.useMemo(()=>ig(l,o,b,h,u,"data"),[l,o,b,h,u]),y=g.useMemo(()=>ig(l,o,b,h,u,"assets"),[l,o,b,h,u]),N=g.useMemo(()=>{if(l===u.pathname+u.search+u.hash)return[];let S=new Set,k=!1;if(o.forEach(T=>{let Y=h.routes[T.route.id];!Y||!Y.hasLoader||(!j.some(z=>z.route.id===T.route.id)&&T.route.id in p&&x[T.route.id]?.shouldRevalidate||Y.hasClientLoader?k=!0:S.add(T.route.id))}),S.size===0)return[];let E=fy(l,m,d.v8_trailingSlashAwareDataRequests,"data");return k&&S.size>0&&E.searchParams.set("_routes",o.filter(T=>S.has(T.route.id)).map(T=>T.route.id).join(",")),[E.pathname+E.search]},[m,d.v8_trailingSlashAwareDataRequests,p,u,h,j,o,l,x]),C=g.useMemo(()=>hj(y,h),[y,h]),U=bj(y);return g.createElement(g.Fragment,null,N.map(S=>g.createElement("link",{key:S,rel:"prefetch",as:"fetch",href:S,...c})),C.map(S=>g.createElement("link",{key:S,rel:"modulepreload",href:S,...c})),U.map(({key:S,link:k})=>g.createElement("link",{key:S,nonce:c.nonce,...k,crossOrigin:k.crossOrigin??c.crossOrigin})))}function wj(...l){return o=>{l.forEach(c=>{typeof c=="function"?c(o):c!=null&&(c.current=o)})}}var Sj=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{Sj&&(window.__reactRouterVersion="7.18.5")}catch{}function kj({basename:l,children:o,useTransitions:c,window:u}){let d=g.useRef();d.current==null&&(d.current=W0({window:u,v5Compat:!0}));let h=d.current,[x,m]=g.useState({action:h.action,location:h.location}),p=g.useCallback(b=>{c===!1?m(b):g.startTransition(()=>m(b))},[c]);return g.useLayoutEffect(()=>h.listen(p),[h,p]),g.createElement(W1,{basename:l,children:o,location:x.location,navigationType:x.action,navigator:h,useTransitions:c})}var mt=g.forwardRef(function({onClick:o,discover:c="render",prefetch:u="none",relative:d,reloadDocument:h,replace:x,mask:m,state:p,target:b,to:j,preventScrollReset:y,viewTransition:N,defaultShouldRevalidate:C,...U},S){let{basename:k,navigator:E,useTransitions:T}=g.useContext(Mn),Y=typeof j=="string"&&ef.test(j),z=ey(j,k);j=z.to;let D=M1(j,{relative:d}),te=jn(),L=null;if(m){let F=tf(m,[],te.mask?te.mask.pathname:"/",!0);k!=="/"&&(F.pathname=F.pathname==="/"?k:Gn([k,F.pathname])),L=E.createHref(F)}let[Q,re,K]=yj(u,U),ae=Ej(j,{replace:x,mask:m,state:p,target:b,preventScrollReset:y,relative:d,viewTransition:N,defaultShouldRevalidate:C,useTransitions:T});function M(F){o&&o(F),F.defaultPrevented||ae(F)}let _=!(z.isExternal||h),se=g.createElement("a",{...U,...K,href:(_?L:void 0)||z.absoluteURL||D,onClick:_?M:o,ref:wj(S,re),target:b,"data-discover":!Y&&c==="render"?"true":void 0});return Q&&!Y?g.createElement(g.Fragment,null,se,g.createElement(vj,{page:D})):se});mt.displayName="Link";var hy=g.forwardRef(function({"aria-current":o="page",caseSensitive:c=!1,className:u="",end:d=!1,style:h,to:x,viewTransition:m,children:p,...b},j){let y=Qi(x,{relative:b.relative}),N=jn(),C=g.useContext(Go),{navigator:U,basename:S}=g.useContext(Mn),k=C!=null&&_j(y)&&m===!0,E=U.encodeLocation?U.encodeLocation(y).pathname:y.pathname,T=N.pathname,Y=C&&C.navigation&&C.navigation.location?C.navigation.location.pathname:null;c||(T=T.toLowerCase(),Y=Y?Y.toLowerCase():null,E=E.toLowerCase()),Y&&S&&(Y=za(Y,S)||Y);const z=E!=="/"&&E.endsWith("/")?E.length-1:E.length;let D=T===E||!d&&T.startsWith(E)&&T.charAt(z)==="/",te=Y!=null&&(Y===E||!d&&Y.startsWith(E)&&Y.charAt(E.length)==="/"),L={isActive:D,isPending:te,isTransitioning:k},Q=D?o:void 0,re;typeof u=="function"?re=u(L):re=[u,D?"active":null,te?"pending":null,k?"transitioning":null].filter(Boolean).join(" ");let K=typeof h=="function"?h(L):h;return g.createElement(mt,{...b,"aria-current":Q,className:re,ref:j,style:K,to:x,viewTransition:m},typeof p=="function"?p(L):p)});hy.displayName="NavLink";var Tj=g.forwardRef(({discover:l="render",fetcherKey:o,navigate:c,reloadDocument:u,replace:d,state:h,method:x=Ro,action:m,onSubmit:p,relative:b,preventScrollReset:j,viewTransition:y,defaultShouldRevalidate:N,...C},U)=>{let{useTransitions:S}=g.useContext(Mn),k=Aj(),E=Dj(m,{relative:b}),T=x.toLowerCase()==="get"?"get":"post",Y=typeof m=="string"&&ef.test(m),z=D=>{if(p&&p(D),D.defaultPrevented)return;D.preventDefault();let te=D.nativeEvent.submitter,L=te?.getAttribute("formmethod")||x,Q=()=>k(te||D.currentTarget,{fetcherKey:o,method:L,navigate:c,replace:d,state:h,relative:b,preventScrollReset:j,viewTransition:y,defaultShouldRevalidate:N});S&&c!==!1?g.startTransition(()=>Q()):Q()};return g.createElement("form",{ref:U,method:T,action:E,onSubmit:u?p:z,...C,"data-discover":!Y&&l==="render"?"true":void 0})});Tj.displayName="Form";function Cj(l){return`${l} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function my(l){let o=g.useContext(Ml);return it(o,Cj(l)),o}function Ej(l,{target:o,replace:c,mask:u,state:d,preventScrollReset:h,relative:x,viewTransition:m,defaultShouldRevalidate:p,useTransitions:b}={}){let j=Xi(),y=jn(),N=Qi(l,{relative:x});return g.useCallback(C=>{if(lj(C,o)){C.preventDefault();let U=c!==void 0?c:Al(y)===Al(N),S=()=>j(l,{replace:U,mask:u,state:d,preventScrollReset:h,relative:x,viewTransition:m,defaultShouldRevalidate:p});b?g.startTransition(()=>S()):S()}},[y,j,N,c,u,d,o,l,h,x,m,p,b])}function Xo(l){On(typeof URLSearchParams<"u","You cannot use the `useSearchParams` hook in a browser that does not support the URLSearchParams API. If you need to support Internet Explorer 11, we recommend you load a polyfill such as https://github.com/ungap/url-search-params.");let o=g.useRef(Yd(l)),c=g.useRef(!1),u=jn(),d=g.useMemo(()=>ij(u.search,c.current?null:o.current),[u.search]),h=Xi(),x=g.useCallback((m,p)=>{const b=Yd(typeof m=="function"?m(new URLSearchParams(d)):m);c.current=!0,h("?"+b,p)},[h,d]);return[d,x]}var zj=0,Rj=()=>`__${String(++zj)}__`;function Aj(){let{router:l}=my("useSubmit"),{basename:o}=g.useContext(Mn),c=K1(),u=l.fetch,d=l.navigate;return g.useCallback(async(h,x={})=>{let{action:m,method:p,encType:b,formData:j,body:y}=cj(h,o);if(x.navigate===!1){let N=x.fetcherKey||Rj();await u(N,c,x.action||m,{defaultShouldRevalidate:x.defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:j,body:y,formMethod:x.method||p,formEncType:x.encType||b,flushSync:x.flushSync})}else await d(x.action||m,{defaultShouldRevalidate:x.defaultShouldRevalidate,preventScrollReset:x.preventScrollReset,formData:j,body:y,formMethod:x.method||p,formEncType:x.encType||b,replace:x.replace,state:x.state,fromRouteId:c,flushSync:x.flushSync,viewTransition:x.viewTransition})},[u,d,o,c])}function Dj(l,{relative:o}={}){let{basename:c}=g.useContext(Mn),u=g.useContext(ca);it(u,"useFormAction must be used inside a RouteContext");let[d]=u.matches.slice(-1),h={...Qi(l||".",{relative:o})},x=jn();if(l==null){h.search=x.search;let m=new URLSearchParams(h.search),p=m.getAll("index");if(p.some(j=>j==="")){m.delete("index"),p.filter(y=>y).forEach(y=>m.append("index",y));let j=m.toString();h.search=j?`?${j}`:""}}return(!l||l===".")&&d.route.index&&(h.search=h.search?h.search.replace(/^\?/,"?index&"):"?index"),c!=="/"&&(h.pathname=h.pathname==="/"?c:Gn([c,h.pathname])),Al(h)}function _j(l,{relative:o}={}){let c=g.useContext(ly);it(c!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:u}=my("useViewTransitionState"),d=Qi(l,{relative:o});if(!c.isTransitioning)return!1;let h=za(c.currentLocation.pathname,u)||c.currentLocation.pathname,x=za(c.nextLocation.pathname,u)||c.nextLocation.pathname;return Mo(d.pathname,x)!=null||Mo(d.pathname,h)!=null}var Oj=Vg();const xy="ez-theme",py=g.createContext(null);function Mj(){try{const l=localStorage.getItem(xy);if(l==="light"||l==="dark")return l}catch{}return"dark"}function Lj({children:l}){const[o,c]=g.useState(Mj);g.useEffect(()=>{document.documentElement.dataset.theme=o;try{localStorage.setItem(xy,o)}catch{}},[o]);const u=g.useCallback(()=>{c(h=>h==="dark"?"light":"dark")},[]),d=g.useMemo(()=>({theme:o,setTheme:c,toggleTheme:u}),[o,u]);return a.jsx(py.Provider,{value:d,children:l})}function gy(){const l=g.useContext(py);if(!l)throw new Error("useTheme must be used inside ThemeProvider");return l}/**
61
+ * @license lucide-react v0.511.0 - ISC
62
+ *
63
+ * This source code is licensed under the ISC license.
64
+ * See the LICENSE file in the root directory of this source tree.
65
+ */const Uj=l=>l.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Hj=l=>l.replace(/^([A-Z])|[\s-_]+(\w)/g,(o,c,u)=>u?u.toUpperCase():c.toLowerCase()),rg=l=>{const o=Hj(l);return o.charAt(0).toUpperCase()+o.slice(1)},yy=(...l)=>l.filter((o,c,u)=>!!o&&o.trim()!==""&&u.indexOf(o)===c).join(" ").trim(),Bj=l=>{for(const o in l)if(o.startsWith("aria-")||o==="role"||o==="title")return!0};/**
66
+ * @license lucide-react v0.511.0 - ISC
67
+ *
68
+ * This source code is licensed under the ISC license.
69
+ * See the LICENSE file in the root directory of this source tree.
70
+ */var qj={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
71
+ * @license lucide-react v0.511.0 - ISC
72
+ *
73
+ * This source code is licensed under the ISC license.
74
+ * See the LICENSE file in the root directory of this source tree.
75
+ */const $j=g.forwardRef(({color:l="currentColor",size:o=24,strokeWidth:c=2,absoluteStrokeWidth:u,className:d="",children:h,iconNode:x,...m},p)=>g.createElement("svg",{ref:p,...qj,width:o,height:o,stroke:l,strokeWidth:u?Number(c)*24/Number(o):c,className:yy("lucide",d),...!h&&!Bj(m)&&{"aria-hidden":"true"},...m},[...x.map(([b,j])=>g.createElement(b,j)),...Array.isArray(h)?h:[h]]));/**
76
+ * @license lucide-react v0.511.0 - ISC
77
+ *
78
+ * This source code is licensed under the ISC license.
79
+ * See the LICENSE file in the root directory of this source tree.
80
+ */const ue=(l,o)=>{const c=g.forwardRef(({className:u,...d},h)=>g.createElement($j,{ref:h,iconNode:o,className:yy(`lucide-${Uj(rg(l))}`,`lucide-${l}`,u),...d}));return c.displayName=rg(l),c};/**
81
+ * @license lucide-react v0.511.0 - ISC
82
+ *
83
+ * This source code is licensed under the ISC license.
84
+ * See the LICENSE file in the root directory of this source tree.
85
+ */const Gj=[["path",{d:"M22 12h-2.48a2 2 0 0 0-1.93 1.46l-2.35 8.36a.25.25 0 0 1-.48 0L9.24 2.18a.25.25 0 0 0-.48 0l-2.35 8.36A2 2 0 0 1 4.49 12H2",key:"169zse"}]],Lo=ue("activity",Gj);/**
86
+ * @license lucide-react v0.511.0 - ISC
87
+ *
88
+ * This source code is licensed under the ISC license.
89
+ * See the LICENSE file in the root directory of this source tree.
90
+ */const Yj=[["path",{d:"M12 5v14",key:"s699le"}],["path",{d:"m19 12-7 7-7-7",key:"1idqje"}]],Vj=ue("arrow-down",Yj);/**
91
+ * @license lucide-react v0.511.0 - ISC
92
+ *
93
+ * This source code is licensed under the ISC license.
94
+ * See the LICENSE file in the root directory of this source tree.
95
+ */const Xj=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Qj=ue("arrow-left",Xj);/**
96
+ * @license lucide-react v0.511.0 - ISC
97
+ *
98
+ * This source code is licensed under the ISC license.
99
+ * See the LICENSE file in the root directory of this source tree.
100
+ */const Zj=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],Ll=ue("arrow-right",Zj);/**
101
+ * @license lucide-react v0.511.0 - ISC
102
+ *
103
+ * This source code is licensed under the ISC license.
104
+ * See the LICENSE file in the root directory of this source tree.
105
+ */const Kj=[["path",{d:"M7 7h10v10",key:"1tivn9"}],["path",{d:"M7 17 17 7",key:"1vkiza"}]],Jj=ue("arrow-up-right",Kj);/**
106
+ * @license lucide-react v0.511.0 - ISC
107
+ *
108
+ * This source code is licensed under the ISC license.
109
+ * See the LICENSE file in the root directory of this source tree.
110
+ */const Pj=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M17 17H4a1 1 0 0 1-.74-1.673C4.59 13.956 6 12.499 6 8a6 6 0 0 1 .258-1.742",key:"178tsu"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M8.668 3.01A6 6 0 0 1 18 8c0 2.687.77 4.653 1.707 6.05",key:"1hqiys"}]],Fj=ue("bell-off",Pj);/**
111
+ * @license lucide-react v0.511.0 - ISC
112
+ *
113
+ * This source code is licensed under the ISC license.
114
+ * See the LICENSE file in the root directory of this source tree.
115
+ */const Ij=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M22 8c0-2.3-.8-4.3-2-6",key:"5bb3ad"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}],["path",{d:"M4 2C2.8 3.7 2 5.7 2 8",key:"tap9e0"}]],og=ue("bell-ring",Ij);/**
116
+ * @license lucide-react v0.511.0 - ISC
117
+ *
118
+ * This source code is licensed under the ISC license.
119
+ * See the LICENSE file in the root directory of this source tree.
120
+ */const Wj=[["path",{d:"M10.268 21a2 2 0 0 0 3.464 0",key:"vwvbt9"}],["path",{d:"M3.262 15.326A1 1 0 0 0 4 17h16a1 1 0 0 0 .74-1.673C19.41 13.956 18 12.499 18 8A6 6 0 0 0 6 8c0 4.499-1.411 5.956-2.738 7.326",key:"11g9vi"}]],cf=ue("bell",Wj);/**
121
+ * @license lucide-react v0.511.0 - ISC
122
+ *
123
+ * This source code is licensed under the ISC license.
124
+ * See the LICENSE file in the root directory of this source tree.
125
+ */const e2=[["path",{d:"M2.97 12.92A2 2 0 0 0 2 14.63v3.24a2 2 0 0 0 .97 1.71l3 1.8a2 2 0 0 0 2.06 0L12 19v-5.5l-5-3-4.03 2.42Z",key:"lc1i9w"}],["path",{d:"m7 16.5-4.74-2.85",key:"1o9zyk"}],["path",{d:"m7 16.5 5-3",key:"va8pkn"}],["path",{d:"M7 16.5v5.17",key:"jnp8gn"}],["path",{d:"M12 13.5V19l3.97 2.38a2 2 0 0 0 2.06 0l3-1.8a2 2 0 0 0 .97-1.71v-3.24a2 2 0 0 0-.97-1.71L17 10.5l-5 3Z",key:"8zsnat"}],["path",{d:"m17 16.5-5-3",key:"8arw3v"}],["path",{d:"m17 16.5 4.74-2.85",key:"8rfmw"}],["path",{d:"M17 16.5v5.17",key:"k6z78m"}],["path",{d:"M7.97 4.42A2 2 0 0 0 7 6.13v4.37l5 3 5-3V6.13a2 2 0 0 0-.97-1.71l-3-1.8a2 2 0 0 0-2.06 0l-3 1.8Z",key:"1xygjf"}],["path",{d:"M12 8 7.26 5.15",key:"1vbdud"}],["path",{d:"m12 8 4.74-2.85",key:"3rx089"}],["path",{d:"M12 13.5V8",key:"1io7kd"}]],vy=ue("boxes",e2);/**
126
+ * @license lucide-react v0.511.0 - ISC
127
+ *
128
+ * This source code is licensed under the ISC license.
129
+ * See the LICENSE file in the root directory of this source tree.
130
+ */const t2=[["path",{d:"M17 21v-2a1 1 0 0 1-1-1v-1a2 2 0 0 1 2-2h2a2 2 0 0 1 2 2v1a1 1 0 0 1-1 1",key:"10bnsj"}],["path",{d:"M19 15V6.5a1 1 0 0 0-7 0v11a1 1 0 0 1-7 0V9",key:"1eqmu1"}],["path",{d:"M21 21v-2h-4",key:"14zm7j"}],["path",{d:"M3 5h4V3",key:"z442eg"}],["path",{d:"M7 5a1 1 0 0 1 1 1v1a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2V6a1 1 0 0 1 1-1V3",key:"ebdjd7"}]],n2=ue("cable",t2);/**
131
+ * @license lucide-react v0.511.0 - ISC
132
+ *
133
+ * This source code is licensed under the ISC license.
134
+ * See the LICENSE file in the root directory of this source tree.
135
+ */const a2=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],uf=ue("check",a2);/**
136
+ * @license lucide-react v0.511.0 - ISC
137
+ *
138
+ * This source code is licensed under the ISC license.
139
+ * See the LICENSE file in the root directory of this source tree.
140
+ */const s2=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],l2=ue("chevron-down",s2);/**
141
+ * @license lucide-react v0.511.0 - ISC
142
+ *
143
+ * This source code is licensed under the ISC license.
144
+ * See the LICENSE file in the root directory of this source tree.
145
+ */const i2=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],r2=ue("chevron-right",i2);/**
146
+ * @license lucide-react v0.511.0 - ISC
147
+ *
148
+ * This source code is licensed under the ISC license.
149
+ * See the LICENSE file in the root directory of this source tree.
150
+ */const o2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],c2=ue("circle-alert",o2);/**
151
+ * @license lucide-react v0.511.0 - ISC
152
+ *
153
+ * This source code is licensed under the ISC license.
154
+ * See the LICENSE file in the root directory of this source tree.
155
+ */const u2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],_s=ue("circle-check",u2);/**
156
+ * @license lucide-react v0.511.0 - ISC
157
+ *
158
+ * This source code is licensed under the ISC license.
159
+ * See the LICENSE file in the root directory of this source tree.
160
+ */const d2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m15 9-6 6",key:"1uzhvr"}],["path",{d:"m9 9 6 6",key:"z0biqf"}]],Vd=ue("circle-x",d2);/**
161
+ * @license lucide-react v0.511.0 - ISC
162
+ *
163
+ * This source code is licensed under the ISC license.
164
+ * See the LICENSE file in the root directory of this source tree.
165
+ */const f2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],h2=ue("circle",f2);/**
166
+ * @license lucide-react v0.511.0 - ISC
167
+ *
168
+ * This source code is licensed under the ISC license.
169
+ * See the LICENSE file in the root directory of this source tree.
170
+ */const m2=[["path",{d:"m18 16 4-4-4-4",key:"1inbqp"}],["path",{d:"m6 8-4 4 4 4",key:"15zrgr"}],["path",{d:"m14.5 4-5 16",key:"e7oirm"}]],x2=ue("code-xml",m2);/**
171
+ * @license lucide-react v0.511.0 - ISC
172
+ *
173
+ * This source code is licensed under the ISC license.
174
+ * See the LICENSE file in the root directory of this source tree.
175
+ */const p2=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",key:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],g2=ue("compass",p2);/**
176
+ * @license lucide-react v0.511.0 - ISC
177
+ *
178
+ * This source code is licensed under the ISC license.
179
+ * See the LICENSE file in the root directory of this source tree.
180
+ */const y2=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],v2=ue("copy",y2);/**
181
+ * @license lucide-react v0.511.0 - ISC
182
+ *
183
+ * This source code is licensed under the ISC license.
184
+ * See the LICENSE file in the root directory of this source tree.
185
+ */const b2=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],Xd=ue("download",b2);/**
186
+ * @license lucide-react v0.511.0 - ISC
187
+ *
188
+ * This source code is licensed under the ISC license.
189
+ * See the LICENSE file in the root directory of this source tree.
190
+ */const j2=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],rs=ue("earth",j2);/**
191
+ * @license lucide-react v0.511.0 - ISC
192
+ *
193
+ * This source code is licensed under the ISC license.
194
+ * See the LICENSE file in the root directory of this source tree.
195
+ */const N2=[["path",{d:"M10.733 5.076a10.744 10.744 0 0 1 11.205 6.575 1 1 0 0 1 0 .696 10.747 10.747 0 0 1-1.444 2.49",key:"ct8e1f"}],["path",{d:"M14.084 14.158a3 3 0 0 1-4.242-4.242",key:"151rxh"}],["path",{d:"M17.479 17.499a10.75 10.75 0 0 1-15.417-5.151 1 1 0 0 1 0-.696 10.75 10.75 0 0 1 4.446-5.143",key:"13bj9a"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],w2=ue("eye-off",N2);/**
196
+ * @license lucide-react v0.511.0 - ISC
197
+ *
198
+ * This source code is licensed under the ISC license.
199
+ * See the LICENSE file in the root directory of this source tree.
200
+ */const S2=[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],k2=ue("eye",S2);/**
201
+ * @license lucide-react v0.511.0 - ISC
202
+ *
203
+ * This source code is licensed under the ISC license.
204
+ * See the LICENSE file in the root directory of this source tree.
205
+ */const T2=[["path",{d:"M14 2v6a2 2 0 0 0 .245.96l5.51 10.08A2 2 0 0 1 18 22H6a2 2 0 0 1-1.755-2.96l5.51-10.08A2 2 0 0 0 10 8V2",key:"18mbvz"}],["path",{d:"M6.453 15h11.094",key:"3shlmq"}],["path",{d:"M8.5 2h7",key:"csnxdl"}]],C2=ue("flask-conical",T2);/**
206
+ * @license lucide-react v0.511.0 - ISC
207
+ *
208
+ * This source code is licensed under the ISC license.
209
+ * See the LICENSE file in the root directory of this source tree.
210
+ */const E2=[["path",{d:"M2 9V5a2 2 0 0 1 2-2h3.9a2 2 0 0 1 1.69.9l.81 1.2a2 2 0 0 0 1.67.9H20a2 2 0 0 1 2 2v10a2 2 0 0 1-2 2H4a2 2 0 0 1-2-2v-1",key:"fm4g5t"}],["path",{d:"M2 13h10",key:"pgb2dq"}],["path",{d:"m9 16 3-3-3-3",key:"6m91ic"}]],z2=ue("folder-input",E2);/**
211
+ * @license lucide-react v0.511.0 - ISC
212
+ *
213
+ * This source code is licensed under the ISC license.
214
+ * See the LICENSE file in the root directory of this source tree.
215
+ */const R2=[["path",{d:"m12 14 4-4",key:"9kzdfg"}],["path",{d:"M3.34 19a10 10 0 1 1 17.32 0",key:"19p75a"}]],A2=ue("gauge",R2);/**
216
+ * @license lucide-react v0.511.0 - ISC
217
+ *
218
+ * This source code is licensed under the ISC license.
219
+ * See the LICENSE file in the root directory of this source tree.
220
+ */const D2=[["line",{x1:"6",x2:"6",y1:"3",y2:"15",key:"17qcm7"}],["circle",{cx:"18",cy:"6",r:"3",key:"1h7g24"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["path",{d:"M18 9a9 9 0 0 1-9 9",key:"n2h4wq"}]],_2=ue("git-branch",D2);/**
221
+ * @license lucide-react v0.511.0 - ISC
222
+ *
223
+ * This source code is licensed under the ISC license.
224
+ * See the LICENSE file in the root directory of this source tree.
225
+ */const O2=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M12 7v5l4 2",key:"1fdv2h"}]],M2=ue("history",O2);/**
226
+ * @license lucide-react v0.511.0 - ISC
227
+ *
228
+ * This source code is licensed under the ISC license.
229
+ * See the LICENSE file in the root directory of this source tree.
230
+ */const L2=[["polyline",{points:"22 12 16 12 14 15 10 15 8 12 2 12",key:"o97t9d"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}]],U2=ue("inbox",L2);/**
231
+ * @license lucide-react v0.511.0 - ISC
232
+ *
233
+ * This source code is licensed under the ISC license.
234
+ * See the LICENSE file in the root directory of this source tree.
235
+ */const H2=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],by=ue("info",H2);/**
236
+ * @license lucide-react v0.511.0 - ISC
237
+ *
238
+ * This source code is licensed under the ISC license.
239
+ * See the LICENSE file in the root directory of this source tree.
240
+ */const B2=[["path",{d:"M2.586 17.414A2 2 0 0 0 2 18.828V21a1 1 0 0 0 1 1h3a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h1a1 1 0 0 0 1-1v-1a1 1 0 0 1 1-1h.172a2 2 0 0 0 1.414-.586l.814-.814a6.5 6.5 0 1 0-4-4z",key:"1s6t7t"}],["circle",{cx:"16.5",cy:"7.5",r:".5",fill:"currentColor",key:"w0ekpg"}]],Zi=ue("key-round",B2);/**
241
+ * @license lucide-react v0.511.0 - ISC
242
+ *
243
+ * This source code is licensed under the ISC license.
244
+ * See the LICENSE file in the root directory of this source tree.
245
+ */const q2=[["rect",{width:"7",height:"9",x:"3",y:"3",rx:"1",key:"10lvy0"}],["rect",{width:"7",height:"5",x:"14",y:"3",rx:"1",key:"16une8"}],["rect",{width:"7",height:"9",x:"14",y:"12",rx:"1",key:"1hutg5"}],["rect",{width:"7",height:"5",x:"3",y:"16",rx:"1",key:"ldoo1y"}]],$2=ue("layout-dashboard",q2);/**
246
+ * @license lucide-react v0.511.0 - ISC
247
+ *
248
+ * This source code is licensed under the ISC license.
249
+ * See the LICENSE file in the root directory of this source tree.
250
+ */const G2=[["path",{d:"M9 17H7A5 5 0 0 1 7 7",key:"10o201"}],["path",{d:"M15 7h2a5 5 0 0 1 4 8",key:"1d3206"}],["line",{x1:"8",x2:"12",y1:"12",y2:"12",key:"rvw6j4"}],["line",{x1:"2",x2:"22",y1:"2",y2:"22",key:"a6p6uj"}]],Y2=ue("link-2-off",G2);/**
251
+ * @license lucide-react v0.511.0 - ISC
252
+ *
253
+ * This source code is licensed under the ISC license.
254
+ * See the LICENSE file in the root directory of this source tree.
255
+ */const V2=[["path",{d:"M9 17H7A5 5 0 0 1 7 7h2",key:"8i5ue5"}],["path",{d:"M15 7h2a5 5 0 1 1 0 10h-2",key:"1b9ql8"}],["line",{x1:"8",x2:"16",y1:"12",y2:"12",key:"1jonct"}]],X2=ue("link-2",V2);/**
256
+ * @license lucide-react v0.511.0 - ISC
257
+ *
258
+ * This source code is licensed under the ISC license.
259
+ * See the LICENSE file in the root directory of this source tree.
260
+ */const Q2=[["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M3 18h.01",key:"1tta3j"}],["path",{d:"M3 6h.01",key:"1rqtza"}],["path",{d:"M8 12h13",key:"1za7za"}],["path",{d:"M8 18h13",key:"1lx6n3"}],["path",{d:"M8 6h13",key:"ik3vkj"}]],Z2=ue("list",Q2);/**
261
+ * @license lucide-react v0.511.0 - ISC
262
+ *
263
+ * This source code is licensed under the ISC license.
264
+ * See the LICENSE file in the root directory of this source tree.
265
+ */const K2=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],ia=ue("loader-circle",K2);/**
266
+ * @license lucide-react v0.511.0 - ISC
267
+ *
268
+ * This source code is licensed under the ISC license.
269
+ * See the LICENSE file in the root directory of this source tree.
270
+ */const J2=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],df=ue("lock",J2);/**
271
+ * @license lucide-react v0.511.0 - ISC
272
+ *
273
+ * This source code is licensed under the ISC license.
274
+ * See the LICENSE file in the root directory of this source tree.
275
+ */const P2=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],F2=ue("log-out",P2);/**
276
+ * @license lucide-react v0.511.0 - ISC
277
+ *
278
+ * This source code is licensed under the ISC license.
279
+ * See the LICENSE file in the root directory of this source tree.
280
+ */const I2=[["path",{d:"M4 12h16",key:"1lakjw"}],["path",{d:"M4 18h16",key:"19g7jn"}],["path",{d:"M4 6h16",key:"1o0s65"}]],W2=ue("menu",I2);/**
281
+ * @license lucide-react v0.511.0 - ISC
282
+ *
283
+ * This source code is licensed under the ISC license.
284
+ * See the LICENSE file in the root directory of this source tree.
285
+ */const eN=[["path",{d:"M12 3a6 6 0 0 0 9 9 9 9 0 1 1-9-9Z",key:"a7tn18"}]],jy=ue("moon",eN);/**
286
+ * @license lucide-react v0.511.0 - ISC
287
+ *
288
+ * This source code is licensed under the ISC license.
289
+ * See the LICENSE file in the root directory of this source tree.
290
+ */const tN=[["path",{d:"m16 16 2 2 4-4",key:"gfu2re"}],["path",{d:"M21 10V8a2 2 0 0 0-1-1.73l-7-4a2 2 0 0 0-2 0l-7 4A2 2 0 0 0 3 8v8a2 2 0 0 0 1 1.73l7 4a2 2 0 0 0 2 0l2-1.14",key:"e7tb2h"}],["path",{d:"m7.5 4.27 9 5.15",key:"1c824w"}],["polyline",{points:"3.29 7 12 12 20.71 7",key:"ousv84"}],["line",{x1:"12",x2:"12",y1:"22",y2:"12",key:"a4e8g8"}]],cg=ue("package-check",tN);/**
291
+ * @license lucide-react v0.511.0 - ISC
292
+ *
293
+ * This source code is licensed under the ISC license.
294
+ * See the LICENSE file in the root directory of this source tree.
295
+ */const nN=[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]],Ny=ue("pause",nN);/**
296
+ * @license lucide-react v0.511.0 - ISC
297
+ *
298
+ * This source code is licensed under the ISC license.
299
+ * See the LICENSE file in the root directory of this source tree.
300
+ */const aN=[["path",{d:"M21.174 6.812a1 1 0 0 0-3.986-3.987L3.842 16.174a2 2 0 0 0-.5.83l-1.321 4.352a.5.5 0 0 0 .623.622l4.353-1.32a2 2 0 0 0 .83-.497z",key:"1a8usu"}],["path",{d:"m15 5 4 4",key:"1mk7zo"}]],ff=ue("pencil",aN);/**
301
+ * @license lucide-react v0.511.0 - ISC
302
+ *
303
+ * This source code is licensed under the ISC license.
304
+ * See the LICENSE file in the root directory of this source tree.
305
+ */const sN=[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]],Ki=ue("play",sN);/**
306
+ * @license lucide-react v0.511.0 - ISC
307
+ *
308
+ * This source code is licensed under the ISC license.
309
+ * See the LICENSE file in the root directory of this source tree.
310
+ */const lN=[["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m18 3-4 4h6l-4 4",key:"16psg9"}]],iN=ue("plug-zap",lN);/**
311
+ * @license lucide-react v0.511.0 - ISC
312
+ *
313
+ * This source code is licensed under the ISC license.
314
+ * See the LICENSE file in the root directory of this source tree.
315
+ */const rN=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],ra=ue("plus",rN);/**
316
+ * @license lucide-react v0.511.0 - ISC
317
+ *
318
+ * This source code is licensed under the ISC license.
319
+ * See the LICENSE file in the root directory of this source tree.
320
+ */const oN=[["path",{d:"M18.36 6.64A9 9 0 0 1 20.77 15",key:"dxknvb"}],["path",{d:"M6.16 6.16a9 9 0 1 0 12.68 12.68",key:"1x7qb5"}],["path",{d:"M12 2v4",key:"3427ic"}],["path",{d:"m2 2 20 20",key:"1ooewy"}]],cN=ue("power-off",oN);/**
321
+ * @license lucide-react v0.511.0 - ISC
322
+ *
323
+ * This source code is licensed under the ISC license.
324
+ * See the LICENSE file in the root directory of this source tree.
325
+ */const uN=[["path",{d:"M12 2v10",key:"mnfbl"}],["path",{d:"M18.4 6.6a9 9 0 1 1-12.77.04",key:"obofu9"}]],dN=ue("power",uN);/**
326
+ * @license lucide-react v0.511.0 - ISC
327
+ *
328
+ * This source code is licensed under the ISC license.
329
+ * See the LICENSE file in the root directory of this source tree.
330
+ */const fN=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],bt=ue("refresh-cw",fN);/**
331
+ * @license lucide-react v0.511.0 - ISC
332
+ *
333
+ * This source code is licensed under the ISC license.
334
+ * See the LICENSE file in the root directory of this source tree.
335
+ */const hN=[["path",{d:"M4.5 16.5c-1.5 1.26-2 5-2 5s3.74-.5 5-2c.71-.84.7-2.13-.09-2.91a2.18 2.18 0 0 0-2.91-.09z",key:"m3kijz"}],["path",{d:"m12 15-3-3a22 22 0 0 1 2-3.95A12.88 12.88 0 0 1 22 2c0 2.72-.78 7.5-6 11a22.35 22.35 0 0 1-4 2z",key:"1fmvmk"}],["path",{d:"M9 12H4s.55-3.03 2-4c1.62-1.08 5 0 5 0",key:"1f8sc4"}],["path",{d:"M12 15v5s3.03-.55 4-2c1.08-1.62 0-5 0-5",key:"qeys4"}]],qi=ue("rocket",hN);/**
336
+ * @license lucide-react v0.511.0 - ISC
337
+ *
338
+ * This source code is licensed under the ISC license.
339
+ * See the LICENSE file in the root directory of this source tree.
340
+ */const mN=[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]],xN=ue("rotate-ccw",mN);/**
341
+ * @license lucide-react v0.511.0 - ISC
342
+ *
343
+ * This source code is licensed under the ISC license.
344
+ * See the LICENSE file in the root directory of this source tree.
345
+ */const pN=[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]],hf=ue("rotate-cw",pN);/**
346
+ * @license lucide-react v0.511.0 - ISC
347
+ *
348
+ * This source code is licensed under the ISC license.
349
+ * See the LICENSE file in the root directory of this source tree.
350
+ */const gN=[["path",{d:"M15.2 3a2 2 0 0 1 1.4.6l3.8 3.8a2 2 0 0 1 .6 1.4V19a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2z",key:"1c8476"}],["path",{d:"M17 21v-7a1 1 0 0 0-1-1H8a1 1 0 0 0-1 1v7",key:"1ydtos"}],["path",{d:"M7 3v4a1 1 0 0 0 1 1h7",key:"t51u73"}]],Qd=ue("save",gN);/**
351
+ * @license lucide-react v0.511.0 - ISC
352
+ *
353
+ * This source code is licensed under the ISC license.
354
+ * See the LICENSE file in the root directory of this source tree.
355
+ */const yN=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],$i=ue("scroll-text",yN);/**
356
+ * @license lucide-react v0.511.0 - ISC
357
+ *
358
+ * This source code is licensed under the ISC license.
359
+ * See the LICENSE file in the root directory of this source tree.
360
+ */const vN=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],bN=ue("search",vN);/**
361
+ * @license lucide-react v0.511.0 - ISC
362
+ *
363
+ * This source code is licensed under the ISC license.
364
+ * See the LICENSE file in the root directory of this source tree.
365
+ */const jN=[["path",{d:"M14.536 21.686a.5.5 0 0 0 .937-.024l6.5-19a.496.496 0 0 0-.635-.635l-19 6.5a.5.5 0 0 0-.024.937l7.93 3.18a2 2 0 0 1 1.112 1.11z",key:"1ffxy3"}],["path",{d:"m21.854 2.147-10.94 10.939",key:"12cjpa"}]],wy=ue("send",jN);/**
366
+ * @license lucide-react v0.511.0 - ISC
367
+ *
368
+ * This source code is licensed under the ISC license.
369
+ * See the LICENSE file in the root directory of this source tree.
370
+ */const NN=[["path",{d:"m10.852 14.772-.383.923",key:"11vil6"}],["path",{d:"M13.148 14.772a3 3 0 1 0-2.296-5.544l-.383-.923",key:"1v3clb"}],["path",{d:"m13.148 9.228.383-.923",key:"t2zzyc"}],["path",{d:"m13.53 15.696-.382-.924a3 3 0 1 1-2.296-5.544",key:"1bxfiv"}],["path",{d:"m14.772 10.852.923-.383",key:"k9m8cz"}],["path",{d:"m14.772 13.148.923.383",key:"1xvhww"}],["path",{d:"M4.5 10H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v4a2 2 0 0 1-2 2h-.5",key:"tn8das"}],["path",{d:"M4.5 14H4a2 2 0 0 0-2 2v4a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-4a2 2 0 0 0-2-2h-.5",key:"1g2pve"}],["path",{d:"M6 18h.01",key:"uhywen"}],["path",{d:"M6 6h.01",key:"1utrut"}],["path",{d:"m9.228 10.852-.923-.383",key:"1wtb30"}],["path",{d:"m9.228 13.148-.923.383",key:"1a830x"}]],Sy=ue("server-cog",NN);/**
371
+ * @license lucide-react v0.511.0 - ISC
372
+ *
373
+ * This source code is licensed under the ISC license.
374
+ * See the LICENSE file in the root directory of this source tree.
375
+ */const wN=[["path",{d:"M20 7h-9",key:"3s1dr2"}],["path",{d:"M14 17H5",key:"gfn3mx"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],mf=ue("settings-2",wN);/**
376
+ * @license lucide-react v0.511.0 - ISC
377
+ *
378
+ * This source code is licensed under the ISC license.
379
+ * See the LICENSE file in the root directory of this source tree.
380
+ */const SN=[["rect",{width:"20",height:"8",x:"2",y:"2",rx:"2",ry:"2",key:"ngkwjq"}],["rect",{width:"20",height:"8",x:"2",y:"14",rx:"2",ry:"2",key:"iecqi9"}],["line",{x1:"6",x2:"6.01",y1:"6",y2:"6",key:"16zg32"}],["line",{x1:"6",x2:"6.01",y1:"18",y2:"18",key:"nzw8ys"}]],Ul=ue("server",SN);/**
381
+ * @license lucide-react v0.511.0 - ISC
382
+ *
383
+ * This source code is licensed under the ISC license.
384
+ * See the LICENSE file in the root directory of this source tree.
385
+ */const kN=[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]],TN=ue("settings",kN);/**
386
+ * @license lucide-react v0.511.0 - ISC
387
+ *
388
+ * This source code is licensed under the ISC license.
389
+ * See the LICENSE file in the root directory of this source tree.
390
+ */const CN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Aa=ue("shield-alert",CN);/**
391
+ * @license lucide-react v0.511.0 - ISC
392
+ *
393
+ * This source code is licensed under the ISC license.
394
+ * See the LICENSE file in the root directory of this source tree.
395
+ */const EN=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],oa=ue("shield-check",EN);/**
396
+ * @license lucide-react v0.511.0 - ISC
397
+ *
398
+ * This source code is licensed under the ISC license.
399
+ * See the LICENSE file in the root directory of this source tree.
400
+ */const zN=[["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M5 5a1 1 0 0 0-1 1v7c0 5 3.5 7.5 7.67 8.94a1 1 0 0 0 .67.01c2.35-.82 4.48-1.97 5.9-3.71",key:"1jlk70"}],["path",{d:"M9.309 3.652A12.252 12.252 0 0 0 11.24 2.28a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1v7a9.784 9.784 0 0 1-.08 1.264",key:"18rp1v"}]],RN=ue("shield-off",zN);/**
401
+ * @license lucide-react v0.511.0 - ISC
402
+ *
403
+ * This source code is licensed under the ISC license.
404
+ * See the LICENSE file in the root directory of this source tree.
405
+ */const AN=[["path",{d:"M9.937 15.5A2 2 0 0 0 8.5 14.063l-6.135-1.582a.5.5 0 0 1 0-.962L8.5 9.936A2 2 0 0 0 9.937 8.5l1.582-6.135a.5.5 0 0 1 .963 0L14.063 8.5A2 2 0 0 0 15.5 9.937l6.135 1.581a.5.5 0 0 1 0 .964L15.5 14.063a2 2 0 0 0-1.437 1.437l-1.582 6.135a.5.5 0 0 1-.963 0z",key:"4pj2yx"}],["path",{d:"M20 3v4",key:"1olli1"}],["path",{d:"M22 5h-4",key:"1gvqau"}],["path",{d:"M4 17v2",key:"vumght"}],["path",{d:"M5 18H3",key:"zchphs"}]],ky=ue("sparkles",AN);/**
406
+ * @license lucide-react v0.511.0 - ISC
407
+ *
408
+ * This source code is licensed under the ISC license.
409
+ * See the LICENSE file in the root directory of this source tree.
410
+ */const DN=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],xf=ue("square",DN);/**
411
+ * @license lucide-react v0.511.0 - ISC
412
+ *
413
+ * This source code is licensed under the ISC license.
414
+ * See the LICENSE file in the root directory of this source tree.
415
+ */const _N=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],Ty=ue("sun",_N);/**
416
+ * @license lucide-react v0.511.0 - ISC
417
+ *
418
+ * This source code is licensed under the ISC license.
419
+ * See the LICENSE file in the root directory of this source tree.
420
+ */const ON=[["path",{d:"M9 3H5a2 2 0 0 0-2 2v4m6-6h10a2 2 0 0 1 2 2v4M9 3v18m0 0h10a2 2 0 0 0 2-2V9M9 21H5a2 2 0 0 1-2-2V9m0 0h18",key:"gugj83"}]],MN=ue("table-2",ON);/**
421
+ * @license lucide-react v0.511.0 - ISC
422
+ *
423
+ * This source code is licensed under the ISC license.
424
+ * See the LICENSE file in the root directory of this source tree.
425
+ */const LN=[["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M19 6v14c0 1-1 2-2 2H7c-1 0-2-1-2-2V6",key:"4alrt4"}],["path",{d:"M8 6V4c0-1 1-2 2-2h4c1 0 2 1 2 2v2",key:"v07s0e"}],["line",{x1:"10",x2:"10",y1:"11",y2:"17",key:"1uufr5"}],["line",{x1:"14",x2:"14",y1:"11",y2:"17",key:"xtxkd"}]],Hs=ue("trash-2",LN);/**
426
+ * @license lucide-react v0.511.0 - ISC
427
+ *
428
+ * This source code is licensed under the ISC license.
429
+ * See the LICENSE file in the root directory of this source tree.
430
+ */const UN=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],_l=ue("triangle-alert",UN);/**
431
+ * @license lucide-react v0.511.0 - ISC
432
+ *
433
+ * This source code is licensed under the ISC license.
434
+ * See the LICENSE file in the root directory of this source tree.
435
+ */const HN=[["path",{d:"M9 14 4 9l5-5",key:"102s5s"}],["path",{d:"M4 9h10.5a5.5 5.5 0 0 1 5.5 5.5a5.5 5.5 0 0 1-5.5 5.5H11",key:"f3b9sd"}]],BN=ue("undo-2",HN);/**
436
+ * @license lucide-react v0.511.0 - ISC
437
+ *
438
+ * This source code is licensed under the ISC license.
439
+ * See the LICENSE file in the root directory of this source tree.
440
+ */const qN=[["path",{d:"m19 5 3-3",key:"yk6iyv"}],["path",{d:"m2 22 3-3",key:"19mgm9"}],["path",{d:"M6.3 20.3a2.4 2.4 0 0 0 3.4 0L12 18l-6-6-2.3 2.3a2.4 2.4 0 0 0 0 3.4Z",key:"goz73y"}],["path",{d:"M7.5 13.5 10 11",key:"7xgeeb"}],["path",{d:"M10.5 16.5 13 14",key:"10btkg"}],["path",{d:"m12 6 6 6 2.3-2.3a2.4 2.4 0 0 0 0-3.4l-2.6-2.6a2.4 2.4 0 0 0-3.4 0Z",key:"1snsnr"}]],$N=ue("unplug",qN);/**
441
+ * @license lucide-react v0.511.0 - ISC
442
+ *
443
+ * This source code is licensed under the ISC license.
444
+ * See the LICENSE file in the root directory of this source tree.
445
+ */const GN=[["path",{d:"M12 3v12",key:"1x0j5s"}],["path",{d:"m17 8-5-5-5 5",key:"7q97r8"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}]],YN=ue("upload",GN);/**
446
+ * @license lucide-react v0.511.0 - ISC
447
+ *
448
+ * This source code is licensed under the ISC license.
449
+ * See the LICENSE file in the root directory of this source tree.
450
+ */const VN=[["path",{d:"m21.64 3.64-1.28-1.28a1.21 1.21 0 0 0-1.72 0L2.36 18.64a1.21 1.21 0 0 0 0 1.72l1.28 1.28a1.2 1.2 0 0 0 1.72 0L21.64 5.36a1.2 1.2 0 0 0 0-1.72",key:"ul74o6"}],["path",{d:"m14 7 3 3",key:"1r5n42"}],["path",{d:"M5 6v4",key:"ilb8ba"}],["path",{d:"M19 14v4",key:"blhpug"}],["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M7 8H3",key:"zfb6yr"}],["path",{d:"M21 16h-4",key:"1cnmox"}],["path",{d:"M11 3H9",key:"1obp7u"}]],XN=ue("wand-sparkles",VN);/**
451
+ * @license lucide-react v0.511.0 - ISC
452
+ *
453
+ * This source code is licensed under the ISC license.
454
+ * See the LICENSE file in the root directory of this source tree.
455
+ */const QN=[["path",{d:"M18 16.98h-5.99c-1.1 0-1.95.94-2.48 1.9A4 4 0 0 1 2 17c.01-.7.2-1.4.57-2",key:"q3hayz"}],["path",{d:"m6 17 3.13-5.78c.53-.97.1-2.18-.5-3.1a4 4 0 1 1 6.89-4.06",key:"1go1hn"}],["path",{d:"m12 6 3.13 5.73C15.66 12.7 16.9 13 18 13a4 4 0 0 1 0 8",key:"qlwsc0"}]],Uo=ue("webhook",QN);/**
456
+ * @license lucide-react v0.511.0 - ISC
457
+ *
458
+ * This source code is licensed under the ISC license.
459
+ * See the LICENSE file in the root directory of this source tree.
460
+ */const ZN=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Hl=ue("x",ZN);function le(...l){return l.filter(Boolean).join(" ")}const Cy=g.createContext(null),KN={success:{icon:_s,iconClass:"text-ok"},error:{icon:c2,iconClass:"text-bad"},warning:{icon:_l,iconClass:"text-warn"},info:{icon:by,iconClass:"text-info"}},JN=6e3;let ug=0;function PN(){return ug+=1,`toast-${Date.now().toString(36)}-${ug}`}function FN({children:l}){const[o,c]=g.useState([]),u=g.useRef(new Map),d=m=>{const p=u.current.get(m);p&&clearTimeout(p),u.current.delete(m),c(b=>b.filter(j=>j.id!==m))},h=m=>{const p=PN(),b={id:p,title:m.title,description:m.description,tone:m.tone??"info"};c(y=>{const N=[...y,b];return N.length>5?N.slice(N.length-5):N});const j=setTimeout(()=>d(p),m.durationMs??JN);return u.current.set(p,j),p},x=g.useMemo(()=>({push:h,dismiss:d,success:(m,p)=>h({title:m,description:p,tone:"success"}),error:(m,p)=>h({title:m,description:p,tone:"error"}),warning:(m,p)=>h({title:m,description:p,tone:"warning"}),info:(m,p)=>h({title:m,description:p,tone:"info"})}),[]);return g.useEffect(()=>{const m=u.current;return()=>{for(const p of m.values())clearTimeout(p);m.clear()}},[]),a.jsxs(Cy.Provider,{value:x,children:[l,a.jsx("div",{className:"pointer-events-none fixed inset-x-3 bottom-3 z-[70] flex flex-col items-end gap-2 sm:inset-x-auto sm:right-4 sm:bottom-4 sm:w-[380px]","aria-live":"polite","aria-atomic":"false",children:o.map(m=>{const{icon:p,iconClass:b}=KN[m.tone];return a.jsxs("div",{role:m.tone==="error"?"alert":"status",className:"toast-enter pointer-events-auto flex w-full items-start gap-3 rounded-md border border-line bg-raised px-3.5 py-3 shadow-pop",children:[a.jsx(p,{className:le("mt-0.5 size-4 shrink-0",b),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:m.title}),m.description&&a.jsx("div",{className:"mt-0.5 break-words text-xs text-muted",children:m.description})]}),a.jsx("button",{type:"button",onClick:()=>d(m.id),"aria-label":"Dismiss notification",className:"-mr-1 -mt-1 rounded-sm p-1 text-faint transition-colors hover:bg-inset hover:text-ink",children:a.jsx(Hl,{className:"size-3.5","aria-hidden":"true"})})]},m.id)})})]})}function jt(){const l=g.useContext(Cy);if(!l)throw new Error("useToast must be used inside ToastProvider");return l}const IN={primary:"bg-accent text-accent-ink border border-transparent hover:bg-accent-hover shadow-sm",secondary:"bg-raised text-ink border border-line hover:border-line-strong hover:bg-inset",ghost:"bg-transparent text-muted border border-transparent hover:text-ink hover:bg-inset",danger:"bg-bad text-white border border-transparent hover:opacity-90 shadow-sm",dangerGhost:"bg-bad-soft text-bad border border-transparent hover:border-bad/40 hover:bg-bad/15"},WN={sm:"h-8 px-3 text-xs gap-1.5 rounded-sm",md:"h-9 px-4 text-sm gap-2 rounded-md",lg:"h-10 px-5 text-sm gap-2 rounded-md"};function Yn(l="secondary",o="md",c){return le("inline-flex select-none items-center justify-center whitespace-nowrap font-medium transition-colors duration-[var(--ez-motion-fast)] disabled:pointer-events-none disabled:opacity-50",IN[l],WN[o],c)}const W=g.forwardRef(function({variant:o="secondary",size:c="md",loading:u=!1,icon:d,className:h,children:x,disabled:m,...p},b){return a.jsxs("button",{ref:b,type:"button",className:Yn(o,c,h),disabled:m||u,"aria-busy":u||void 0,...p,children:[u?a.jsx(ia,{className:"spin size-4","aria-hidden":"true"}):d,x]})}),at=g.forwardRef(function({label:o,variant:c="ghost",size:u="md",className:d,children:h,...x},m){return a.jsx("button",{ref:m,type:"button","aria-label":o,title:o,className:Yn(c,u==="sm"?"sm":"md",le("!px-0",u==="sm"?"size-8":"size-9",d)),...x,children:h})}),ew={sm:"sm:max-w-sm",md:"sm:max-w-lg",lg:"sm:max-w-2xl",xl:"sm:max-w-4xl"},tw='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function bn({open:l,onClose:o,title:c,description:u,children:d,footer:h,size:x="md",preventClose:m=!1,bodyClassName:p}){const b=g.useId(),j=g.useId(),y=g.useRef(null),N=g.useRef(null),C=g.useRef(o);C.current=o;const U=g.useRef(m);return U.current=m,g.useEffect(()=>{if(!l)return;N.current=document.activeElement;const S=document.body.style.overflow;document.body.style.overflow="hidden";const k=window.setTimeout(()=>{const T=y.current;if(!T)return;(T.querySelector("[data-autofocus]")??T).focus()},0),E=T=>{if(T.key==="Escape"&&!U.current){T.stopPropagation(),C.current();return}if(T.key!=="Tab")return;const Y=y.current;if(!Y)return;const z=Array.from(Y.querySelectorAll(tw)).filter(Q=>Q.offsetParent!==null);if(z.length===0){T.preventDefault(),Y.focus();return}const D=z[0],te=z[z.length-1],L=document.activeElement;T.shiftKey&&(L===D||L===Y)?(T.preventDefault(),te.focus()):!T.shiftKey&&L===te&&(T.preventDefault(),D.focus())};return document.addEventListener("keydown",E,!0),()=>{window.clearTimeout(k),document.removeEventListener("keydown",E,!0),document.body.style.overflow=S,N.current?.focus()}},[l]),l?Oj.createPortal(a.jsx("div",{className:"fade-enter fixed inset-0 z-[60] flex items-end justify-center bg-[var(--ez-overlay)] p-0 backdrop-blur-[2px] sm:items-center sm:p-6",onMouseDown:S=>{S.target===S.currentTarget&&!m&&o()},children:a.jsxs("div",{ref:y,role:"dialog","aria-modal":"true","aria-labelledby":b,"aria-describedby":u?j:void 0,tabIndex:-1,className:le("panel-enter flex max-h-[92vh] w-full flex-col overflow-hidden rounded-t-xl border border-line bg-surface shadow-pop outline-none sm:rounded-xl",ew[x]),children:[a.jsxs("div",{className:"flex items-start justify-between gap-4 border-b border-line px-5 py-4",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{id:b,className:"text-base font-semibold text-ink",children:c}),u&&a.jsx("p",{id:j,className:"mt-1 text-sm text-muted",children:u})]}),a.jsx(at,{label:"Close",size:"sm",onClick:o,disabled:m,className:"-mr-1 -mt-1",children:a.jsx(Hl,{className:"size-4","aria-hidden":"true"})})]}),d&&a.jsx("div",{className:le("min-h-0 flex-1 overflow-y-auto px-5 py-4",p),children:d}),h&&a.jsx("div",{className:"flex flex-wrap items-center justify-end gap-2 border-t border-line bg-raised/40 px-5 py-3",children:h})]})}),document.body):null}class Le extends Error{status;payload;constructor(o,c,u){super(u??nw(o,c)),this.name="ApiError",this.status=o,this.payload=c}get code(){const{error:o}=this.payload;if(typeof o=="string")return o;if(o&&typeof o=="object")return o.step}get blockedReason(){return this.status!==403?null:this.payload.reason??null}}function nw(l,o){const{error:c}=o;return typeof c=="string"&&c&&c!=="Forbidden"?c:c&&typeof c=="object"?c.cause||c.consequence||"The request failed.":l===403?"Request blocked by the dashboard.":l===401?"Your session ended. Please sign in again.":l===0?"Cannot reach the dashboard.":`Request failed (HTTP ${l}).`}function aw(l){if(l instanceof Le)return l;const o=l instanceof Error?l.message:"Something went wrong.";return new Le(0,{error:o})}function xt(l,o=[],c={}){const u=c.enabled??!0,d=g.useRef(l);d.current=l;const[h,x]=g.useState(0),m=g.useRef(!1),[p,b]=g.useState({data:null,error:null,loading:u});g.useEffect(()=>{if(!u){m.current=!1,b({data:null,error:null,loading:!1});return}const C=new AbortController,U=m.current;return m.current=!1,U||b(S=>({...S,loading:!0,error:null})),d.current(C.signal).then(S=>{C.signal.aborted||b({data:S,error:null,loading:!1})}).catch(S=>{C.signal.aborted||S?.name!=="AbortError"&&b(k=>({...k,error:aw(S),loading:!1}))}),()=>C.abort()},[...o,u,h]);const j=g.useCallback(()=>x(C=>C+1),[]),y=g.useCallback(()=>{m.current=!0,x(C=>C+1)},[]),N=g.useCallback(C=>{b(U=>({...U,data:typeof C=="function"?C(U.data):C}))},[]);return{data:p.data,error:p.error,loading:p.loading,reload:j,reloadSilent:y,setData:N}}function Os(l,o,c=!0){const u=g.useRef(l);u.current=l,g.useEffect(()=>{if(!c)return;const d=setInterval(()=>u.current(),o);return()=>clearInterval(d)},[o,c])}function Bs(l){const o=g.useRef(l);o.current=l,g.useEffect(()=>{const c=()=>{document.visibilityState==="visible"&&o.current()};return document.addEventListener("visibilitychange",c),()=>document.removeEventListener("visibilitychange",c)},[])}function Xn(l){g.useEffect(()=>{document.title=l?`${l} · Easy DevOps`:"Easy DevOps"},[l])}let Zd=null;function dg(l){Zd=l}function sn(){return g.useCallback(l=>Zd?Zd(l):Promise.resolve(!1),[])}function sw({children:l}){const[o,c]=g.useState(null),u=g.useRef(null),d=g.useCallback(m=>(u.current?.resolve(!1),new Promise(p=>{u.current={resolve:p},c(m)})),[]);g.useEffect(()=>(dg(d),()=>dg(null)),[d]);const h=g.useCallback(m=>{c(null);const p=u.current;u.current=null,p?.resolve(m)},[]),x=o?.tone==="danger";return a.jsxs(a.Fragment,{children:[l,a.jsx(bn,{open:o!==null,onClose:()=>h(!1),title:o?.title??"",size:"sm",bodyClassName:"px-5 py-4",footer:a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"ghost",onClick:()=>h(!1),"data-autofocus":!0,children:o?.cancelLabel??"Cancel"}),a.jsx(W,{variant:x?"danger":"primary",onClick:()=>h(!0),children:o?.confirmLabel??"Confirm"})]}),children:a.jsx("div",{className:"text-sm text-muted",children:o?.body})})]})}const lw="modulepreload",iw=function(l,o){return new URL(l,o).href},fg={},rw=function(o,c,u){let d=Promise.resolve();if(c&&c.length>0){let x=function(j){return Promise.all(j.map(y=>Promise.resolve(y).then(N=>({status:"fulfilled",value:N}),N=>({status:"rejected",reason:N}))))};const m=document.getElementsByTagName("link"),p=document.querySelector("meta[property=csp-nonce]"),b=p?.nonce||p?.getAttribute("nonce");d=x(c.map(j=>{if(j=iw(j,u),j in fg)return;fg[j]=!0;const y=j.endsWith(".css"),N=y?'[rel="stylesheet"]':"";if(!!u)for(let S=m.length-1;S>=0;S--){const k=m[S];if(k.href===j&&(!y||k.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${j}"]${N}`))return;const U=document.createElement("link");if(U.rel=y?"stylesheet":lw,y||(U.as="script"),U.crossOrigin="",U.href=j,b&&U.setAttribute("nonce",b),document.head.appendChild(U),y)return new Promise((S,k)=>{U.addEventListener("load",S),U.addEventListener("error",()=>k(new Error(`Unable to preload CSS for ${j}`)))})}))}function h(x){const m=new Event("vite:preloadError",{cancelable:!0});if(m.payload=x,window.dispatchEvent(m),!m.defaultPrevented)throw x}return d.then(x=>{for(const m of x||[])m.status==="rejected"&&h(m.reason);return o().catch(h)})},ow="/api",cw=new Set(["POST","PUT","PATCH","DELETE"]),uw=!1,dw="Your session ended. Please sign in again.",Kd=new Set,Jd=new Set;function fw(l){return Kd.add(l),()=>Kd.delete(l)}function hw(l){return Jd.add(l),()=>Jd.delete(l)}function mw(l){if(!l)return"";const o=new URLSearchParams;for(const[u,d]of Object.entries(l))d!=null&&o.set(u,String(d));const c=o.toString();return c?`?${c}`:""}async function xw(l){const o=await l.text();if(!o)return{};try{const c=JSON.parse(o);return c&&typeof c=="object"?c:{error:String(c)}}catch{return{error:o.replace(/<[^>]+>/g," ").replace(/\s+/g," ").trim().slice(0,240)}}}async function de(l,o={}){const c=o.method??"GET",u={Accept:"application/json"};let d;o.body!==void 0&&(u["Content-Type"]="application/json",d=JSON.stringify(o.body)),cw.has(c)&&(u["X-EZ-Request"]="1");let h;try{h=await fetch(`${ow}${l}${mw(o.query)}`,{method:c,headers:u,body:d,credentials:"same-origin",signal:o.signal})}catch(m){throw m?.name==="AbortError"?m:new Le(0,{error:"Cannot reach the dashboard."})}if(h.status===204)return;if(!h.ok){const m=await xw(h),p=new Le(h.status,m);if(!o.skipAuthEvents){if(h.status===401)for(const b of Kd)b(dw);else if(h.status===403)for(const b of Jd)b(p)}throw p}const x=await h.text();if(x)return JSON.parse(x)}function Ye(l){return encodeURIComponent(l)}const ie={auth:{status:l=>de("/auth",{signal:l}),login:l=>de("/login",{method:"POST",body:{password:l},skipAuthEvents:!0}),setup:l=>de("/setup",{method:"POST",body:l,skipAuthEvents:!0}),logout:()=>de("/logout",{method:"POST"})},domains:{list:l=>de("/domains",{signal:l}),create:l=>de("/domains",{method:"POST",body:l}),update:(l,o)=>de(`/domains/${Ye(l)}`,{method:"PUT",body:o}),remove:(l,o)=>de(`/domains/${Ye(l)}`,{method:"DELETE",query:{deleteCert:o}}),toggle:l=>de(`/domains/${Ye(l)}/toggle`,{method:"PUT"}),reload:l=>de(`/domains/${Ye(l)}/reload`,{method:"POST"}),notifications:(l,o)=>de(`/domains/${Ye(l)}/notifications`,{signal:o}),saveNotifications:(l,o)=>de(`/domains/${Ye(l)}/notifications`,{method:"PUT",body:o})},ssl:{list:l=>de("/ssl",{signal:l}),create:l=>de("/ssl/create",{method:"POST",body:l}),confirmDns:l=>de("/ssl/create-confirm",{method:"POST",body:{domain:l}}),cancelDns:l=>de("/ssl/create-cancel",{method:"POST",body:{domain:l}}),renew:l=>de(`/ssl/renew/${Ye(l)}`,{method:"POST"}),renewAll:()=>de("/ssl/renew-all",{method:"POST"}),remove:l=>de(`/ssl/${Ye(l)}`,{method:"DELETE"})},nginx:{status:l=>de("/nginx/status",{signal:l}),reload:()=>de("/nginx/reload",{method:"POST"}),restart:()=>de("/nginx/restart",{method:"POST"}),start:()=>de("/nginx/start",{method:"POST"}),stop:()=>de("/nginx/stop",{method:"POST"}),test:()=>de("/nginx/test",{method:"POST"}),configs:l=>de("/nginx/configs",{signal:l}),getConfig:(l,o)=>de(`/nginx/config/${Ye(l)}`,{signal:o}),saveConfig:(l,o)=>de(`/nginx/config/${Ye(l)}`,{method:"POST",body:{content:o}}),logs:l=>de("/nginx/logs",{signal:l})},processes:{list:l=>de("/processes",{signal:l}),action:(l,o)=>de(`/processes/${Ye(l)}/${o}`,{method:"POST"}),logs:(l,o=200,c)=>de(`/processes/${Ye(l)}/logs`,{signal:c,query:{lines:o}})},deployments:{list:l=>de("/deployments",{signal:l}),get:(l,o)=>de(`/deployments/${Ye(l)}`,{signal:o}),create:l=>de("/deployments",{method:"POST",body:l}),update:(l,o)=>de(`/deployments/${Ye(l)}`,{method:"PUT",body:o}),remove:(l,o={})=>de(`/deployments/${Ye(l)}`,{method:"DELETE",query:{deleteDomain:o.deleteDomain?1:void 0,purgeData:o.purgeData?1:void 0}}),linkDomain:(l,o,c=!1)=>de(`/deployments/${Ye(l)}/domain`,{method:"PUT",body:{domain:o,ssl:c}}),unlinkDomain:l=>de(`/deployments/${Ye(l)}/domain`,{method:"DELETE"}),move:(l,o)=>de(`/deployments/${Ye(l)}/move`,{method:"POST",body:{path:o}}),deploy:(l,o)=>de(`/deployments/${Ye(l)}/deploy`,{method:"POST",body:o?{ref:o}:{}}),rollback:(l,o)=>de(`/deployments/${Ye(l)}/rollback`,{method:"POST",body:o?{releaseId:o}:{}}),removeRelease:(l,o)=>de(`/deployments/${Ye(l)}/releases/${Ye(o)}`,{method:"DELETE"}),run:(l,o,c)=>de(`/deployments/${Ye(l)}/runs/${Ye(o)}`,{signal:c}),issueHookToken:l=>de(`/deployments/${Ye(l)}/hook-token`,{method:"POST"}),revokeHookToken:l=>de(`/deployments/${Ye(l)}/hook-token`,{method:"DELETE"}),generateDeployKey:l=>de(`/deployments/${Ye(l)}/deploy-key`,{method:"POST"}),github:(l,o)=>de(`/deployments/${Ye(l)}/github`,{signal:o}),applyGithub:(l,o)=>de(`/deployments/${Ye(l)}/github/apply`,{method:"POST",body:o}),hook:l=>de("/deployments/hook",{signal:l}),updateHook:l=>de("/deployments/hook",{method:"PUT",body:l})},service:{status:l=>de("/service",{signal:l}),start:()=>de("/service/start",{method:"POST"}),stop:()=>de("/service/stop",{method:"POST"}),restart:()=>de("/service/restart",{method:"POST"})},settings:{get:l=>de("/settings",{signal:l}),update:l=>de("/settings",{method:"POST",body:l}),permissions:l=>de("/settings/permissions",{signal:l}),setupPermissions:l=>de("/settings/permissions/setup",{method:"POST",body:{password:l},skipAuthEvents:!0}),backup:l=>de("/settings/backup",{signal:l}),restore:l=>de("/settings/restore",{method:"POST",body:l}),channels:{list:l=>de("/settings/channels",{signal:l}),create:l=>de("/settings/channels",{method:"POST",body:l}),update:(l,o)=>de(`/settings/channels/${Ye(l)}`,{method:"PUT",body:o}),remove:l=>de(`/settings/channels/${Ye(l)}`,{method:"DELETE"}),test:l=>de(`/settings/channels/${Ye(l)}/test`,{method:"POST"})}},hub:{status:l=>de("/hub/status",{signal:l}),connect:l=>de("/hub/connect",{method:"POST",body:{connectionString:l}}),unlink:()=>de("/hub/link",{method:"DELETE"}),updatePermissions:l=>de("/hub/permissions",{method:"PUT",body:l})},update:{check:l=>de("/update",{signal:l}),status:l=>de("/update/status",{signal:l}),start:l=>de("/update",{method:"POST",body:{version:l}})}},Ey=g.createContext(null);function pw(l){if(l instanceof Le)return l;const o=l instanceof Error?l.message:"Cannot reach the dashboard.";return new Le(0,{error:o})}function gw({children:l}){const[o,c]=g.useState("loading"),[u,d]=g.useState(null),[h,x]=g.useState(null),[m,p]=g.useState(null),[b,j]=g.useState(null),y=g.useRef("loading");y.current=o;const N=g.useCallback(D=>{d(D),x(null),c(D.authenticated?"authenticated":"unauthenticated")},[]),C=g.useCallback(async()=>{c("loading");try{N(await ie.auth.status())}catch(D){x(pw(D)),c("error")}},[N]);g.useEffect(()=>{C()},[C]);const U=g.useCallback(D=>{p(D??"Your session ended. Please sign in again."),j(null),d(te=>te&&{...te,authenticated:!1}),c("unauthenticated")},[]);g.useEffect(()=>{const D=fw(L=>{y.current==="authenticated"&&U(L)}),te=hw(L=>j(L));return()=>{D(),te()}},[U]);const S=g.useCallback(async()=>{try{N(await ie.auth.status())}catch{d(D=>D&&{...D,authenticated:!0}),c("authenticated")}p(null),j(null)},[N]),k=g.useCallback(async D=>{await ie.auth.login(D),await S()},[S]),E=g.useCallback(async D=>{await ie.auth.setup(D),await S()},[S]),T=g.useCallback(async()=>{try{await ie.auth.logout()}catch{}d(D=>D&&{...D,authenticated:!1}),p(null),j(null),c("unauthenticated")},[]),Y=g.useCallback(()=>j(null),[]),z=g.useMemo(()=>({phase:o,auth:u,bootError:h,sessionMessage:m,blocked:b,login:k,setup:E,logout:T,retryBoot:C,dismissBlocked:Y,reportUnauthorized:U}),[o,u,h,m,b,k,E,T,C,Y,U]);return a.jsx(Ey.Provider,{value:z,children:l})}function Qn(){const l=g.useContext(Ey);if(!l)throw new Error("useAuth must be used inside AuthProvider");return l}const hg=50,zy=g.createContext(null);function yw({children:l}){const{phase:o,reportUnauthorized:c}=Qn(),u=o==="authenticated",[d,h]=g.useState(null),[x,m]=g.useState(!1),[p,b]=g.useState(null),[j,y]=g.useState(null),[N,C]=g.useState(null),[U,S]=g.useState([]),[k,E]=g.useState(0),[T,Y]=g.useState(null),[z,D]=g.useState(0),te=g.useCallback(()=>E(0),[]),L=g.useCallback(()=>{S([]),E(0)},[]);g.useEffect(()=>{if(!u){h(null),m(!1),b(null),y(null),C(null),S([]),E(0),Y(null);return}let re=!1,K=null;const ae=()=>{m(!0),b(null)},M=()=>m(!1),_=V=>{m(!1);const ce=V.data;if(V.message==="UNAUTHORIZED"||ce?.reason==="unauthorized"){c();return}if(V.message==="FORBIDDEN"||ce?.reason){b(ce?.detail??"Live updates were blocked by the dashboard.");return}b("Live updates are unavailable. Data still refreshes on the page.")},se=V=>y(V),F=V=>C(V),ne=V=>{S(ce=>{const Se=ce.filter(Ve=>Ve.id!==V.id),ke=[V,...Se];return ke.length>hg?ke.slice(0,hg):ke}),E(ce=>Math.min(ce+1,99))},fe=V=>{Y(V),D(ce=>ce+1)};return(async()=>{try{if(!uw){const{createRealtimeClient:V}=await rw(async()=>{const{createRealtimeClient:ce}=await import("./socket-DwLPrgsr.js");return{createRealtimeClient:ce}},[],import.meta.url);K=V()}if(re){K.disconnect();return}K.on("connect",ae),K.on("disconnect",M),K.on("connect_error",_),K.on("nginx:status",se),K.on("domain:health",F),K.on("notification:new",ne),K.on("local:changed",fe),h(K),K.connect()}catch{re||b("Could not start the live connection.")}})(),()=>{re=!0,K&&(K.off("connect",ae),K.off("disconnect",M),K.off("connect_error",_),K.off("nginx:status",se),K.off("domain:health",F),K.off("notification:new",ne),K.off("local:changed",fe),K.disconnect()),m(!1)}},[u,c]);const Q=g.useMemo(()=>({client:d,connected:x,connectionError:p,nginxStatus:j,domainHealth:N,notifications:U,unread:k,markAllRead:te,clearNotifications:L,lastChange:T,changeSeq:z}),[d,x,p,j,N,U,k,te,L,T,z]);return a.jsx(zy.Provider,{value:Q,children:l})}function ua(){const l=g.useContext(zy);if(!l)throw new Error("useRealtime must be used inside RealtimeProvider");return l}const Ry=g.createContext(null);function vw({children:l}){const{phase:o}=Qn(),c=o==="authenticated",{client:u,connected:d}=ua(),h=xt(k=>ie.service.status(k),[c],{enabled:c}),{setData:x,reload:m}=h;Os(m,6e4,c);const p=g.useCallback(k=>{x(E=>E&&{...E,backgroundService:{...E.backgroundService,...k}})},[x]),b=g.useRef(null),j=g.useRef(!1),y=g.useRef(!1);y.current=h.loading;const N=g.useCallback(()=>{b.current&&clearTimeout(b.current),b.current=setTimeout(()=>{if(b.current=null,y.current){j.current=!0;return}m()},250)},[m]);g.useEffect(()=>{!h.loading&&j.current&&(j.current=!1,m())},[h.loading,m]),g.useEffect(()=>()=>{b.current&&clearTimeout(b.current)},[]),g.useEffect(()=>{if(!c||!u)return;const k=E=>{p(E),N()};return u.on("service:changed",k),()=>u.off("service:changed",k)},[c,u,p,N]);const C=g.useRef(!1),U=g.useRef(!1);g.useEffect(()=>{if(!c){C.current=!1,U.current=!1;return}d&&!C.current&&(U.current&&N(),U.current=!0),C.current=d},[c,d,N]);const S=g.useMemo(()=>({service:h.data,loading:h.loading,error:h.error,reload:h.reload,applyBackgroundService:p}),[h.data,h.loading,h.error,h.reload,p]);return a.jsx(Ry.Provider,{value:S,children:l})}function Ji(){const l=g.useContext(Ry);if(!l)throw new Error("useService must be used inside ServiceProvider");return l}const Ay=[{label:"Manage",items:[{to:"/",label:"Overview",title:"Overview",description:"The state of nginx, your domains and their certificates at a glance.",icon:$2},{to:"/domains",label:"Domains",title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",icon:rs},{to:"/ssl",label:"SSL certificates",title:"SSL certificates",description:"Issue and renew Let’s Encrypt certificates for your domains.",icon:oa},{to:"/nginx",label:"Nginx",title:"Nginx",description:"Service status, configuration files and live logs.",icon:Ul},{to:"/deployments",label:"Deployments",title:"Deployments",description:"Put a project from a git repository on this server and keep it deployed.",icon:qi}]},{label:"Monitor",items:[{to:"/notifications",label:"Notifications",title:"Notifications",description:"Delivery channels, test messages and recent events.",icon:cf},{to:"/processes",label:"Processes",title:"Processes",description:"The Easy DevOps background service and your own PM2 apps.",icon:vy},{to:"/logs",label:"Logs",title:"Logs",description:"nginx access and error output as it is written.",icon:$i}]},{label:"System",items:[{to:"/settings",label:"Settings",title:"Settings",description:"Access, authentication, Hub pairing and backup.",icon:TN}]}],bw=Ay.flatMap(l=>l.items);function Dy(l){return bw.find(o=>o.to==="/"?l==="/":l===o.to||l.startsWith(`${o.to}/`))}function _y({className:l}){return a.jsxs("span",{className:le("inline-flex shrink-0 items-center",l),"aria-hidden":"true",children:[a.jsx("img",{src:"/brand/mark-dark.png",alt:"",className:"brand-logo-dark h-full w-auto"}),a.jsx("img",{src:"/brand/mark-light.png",alt:"",className:"brand-logo-light h-full w-auto"})]})}const jw=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",year:"numeric"}),Nw=new Intl.DateTimeFormat(void 0,{day:"numeric",month:"short",hour:"2-digit",minute:"2-digit"});function pf(l){if(l==null||l==="")return"—";const o=typeof l=="number"?new Date(l):new Date(l);return Number.isNaN(o.getTime())?"—":jw.format(o)}function gf(l){if(l==null||l==="")return"—";const o=typeof l=="number"?new Date(l):new Date(l);return Number.isNaN(o.getTime())?"—":Nw.format(o)}function Pi(l){const o=Math.max(0,Math.round((Date.now()-l)/1e3));if(o<10)return"just now";if(o<60)return`${o}s ago`;const c=Math.floor(o/60);if(c<60)return`${c}m ago`;const u=Math.floor(c/60);return u<24?`${u}h ago`:`${Math.floor(u/24)}d ago`}function Oy(){return new Date().getFullYear()}function My(l){if(l==null)return"—";if(l<1024)return`${l} B`;const o=["KB","MB","GB","TB"];let c=l/1024,u=0;for(;c>=1024&&u<o.length-1;)c/=1024,u+=1;return`${c.toFixed(c<10?1:0)} ${o[u]}`}function Qo(l){if(l==null||l<0)return"—";const o=Math.floor(l/6e4);if(o<1)return"<1m";if(o<60)return`${o}m`;const c=Math.floor(o/60);return c<24?`${c}h ${o%60}m`:`${Math.floor(c/24)}d ${c%24}h`}function Ol(l){return l===null?"Unknown":l<0?`Expired ${Math.abs(l)} day${Math.abs(l)===1?"":"s"} ago`:l===0?"Expires today":`${l} day${l===1?"":"s"} left`}function ww(l){return l==null?"—":`${l.toFixed(1)}%`}function _n(l,o,c=`${o}s`){return`${l} ${l===1?o:c}`}function Sw(l,o=48){if(l.length<=o)return l;const c=Math.ceil((o-1)/2),u=Math.floor((o-1)/2);return`${l.slice(0,c)}…${l.slice(-u)}`}const kw={personal:"Personal","windows-service":"Windows service",systemd:"systemd",unknown:"Unknown"},Tw={personal:"Startup supervisor · runs as you, starts at logon","windows-service":"WinSW service · NT SERVICE\\EasyDevOps",systemd:"systemd unit · starts at boot",unknown:"Not reported by this API"},Cw={personal:"No administrator needed — run it in a normal PowerShell. Personal mode starts at logon and stops when you sign out.","windows-service":"Run it in an Administrator PowerShell. It creates a Windows service that runs as NT SERVICE\\EasyDevOps and never asks for an account password.",systemd:"Run it once with sudo; the unit then starts at boot.",unknown:"Run it in a terminal with the rights your platform requires."};function Ew(l){switch(l.backgroundService.mechanism){case"startup-supervisor":return"personal";case"winsw":return"windows-service";case"systemd":return"systemd";default:return"unknown"}}function zw(l){return l==="logon"?"At logon":l==="boot"?"At boot":"Unknown"}function Rw(l){return l.jobsRunningHere?"This dashboard":l.jobsOwnerRole==="daemon"?"Background service":l.jobsOwnerRole==="dashboard"?"Another dashboard process":l.running?"Background service":"Paused — no owner"}function Fi(l){if(!l)return null;const o=l.backgroundService,c=Ew(l),u=o.startsAt==="logon"||o.startsAt==="boot"?o.startsAt:"unknown",d=o.runtime??null,h=o.stoppedAt??null,x=Array.from(new Set([...o.warnings??[],...d?.warnings??[]]));return{running:o.running,connected:o.connected,jobsRunningHere:o.jobsRunningHere,jobsOwnerLabel:Rw(o),pid:o.pid,version:o.version,startedAt:o.startedAt,uptimeMs:o.startedAt?Math.max(0,Date.now()-o.startedAt):null,heartbeatAgeMs:o.heartbeatAgeMs??null,mechanism:c,mechanismLabel:kw[c],mechanismDetail:Tw[c],startsAt:u,startsAtLabel:zw(u),installed:o.installed===!0,stoppedByUser:o.stoppedByUser===!0,stoppedAt:h,stoppedAtLabel:h?gf(h):null,state:o.state??null,detail:o.detail??null,enabledOnBoot:o.enabledOnBoot??null,restarts:o.restarts??0,crashLooping:o.crashLooping===!0,dataDir:o.dataDir,installCommand:l.install.command,installGuidance:Cw[c],runtime:d,warnings:x}}function Ho(l){return l?l.running?"Running":l.stoppedByUser?"Stopped by you":l.installed?"Not running":"Not installed":"Unknown"}function Aw(l){if(!l)return null;const o=l.pinned,c=o?.version??null,u=l.systemNode.version??null,d=!!(o&&o.kind!=="none"&&o.exists!==!1),h=d&&!!(c&&u)&&c===u&&!o?.differsFromSystem;return{serviceVersion:c,servicePath:o?.path??null,systemVersion:u,systemPath:l.systemNode.path??null,sameAsSystem:h,broken:o?.broken===!0,pinned:d,kind:o?.kind??null,manager:l.manager?.managed?l.manager.manager??null:null}}const Dw={neutral:"bg-inset text-muted",accent:"bg-accent-soft text-accent-text",ok:"bg-ok-soft text-ok",warn:"bg-warn-soft text-warn",bad:"bg-bad-soft text-bad",info:"bg-info-soft text-info"},Ly={neutral:"bg-faint",accent:"bg-accent",ok:"bg-ok",warn:"bg-warn",bad:"bg-bad",info:"bg-info"};function ge({tone:l="neutral",children:o,className:c,dot:u=!1}){return a.jsxs("span",{className:le("inline-flex items-center gap-1.5 rounded-pill px-2 py-0.5 text-2xs font-medium tracking-wide",Dw[l],c),children:[u&&a.jsx("span",{className:le("size-1.5 rounded-full",Ly[l]),"aria-hidden":"true"}),o]})}function Jt({tone:l="ok",pulse:o=!1,className:c}){return a.jsx("span",{className:le("inline-block size-2 shrink-0 rounded-full",Ly[l],o&&"live-dot",c),"aria-hidden":"true"})}const _w='a[href], button:not([disabled]), textarea:not([disabled]), input:not([disabled]), select:not([disabled]), [tabindex]:not([tabindex="-1"])';function mg({onNavigate:l}){const{service:o}=Ji(),c=Fi(o),u=c?c.running?{tone:"ok",label:"Service running"}:c.stoppedByUser?{tone:"warn",label:"Service stopped by you"}:{tone:"warn",label:"Service stopped"}:{tone:"neutral",label:"Checking service…"};return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:le("flex h-[var(--ez-topbar-height)] shrink-0 items-center gap-2.5 border-b border-line px-4",l&&"pr-12"),children:[a.jsx(_y,{className:"h-5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate text-sm font-semibold tracking-tight text-ink",children:"Easy DevOps"}),a.jsx("div",{className:"text-2xs text-faint",children:"Server control plane"})]})]}),a.jsx("nav",{"aria-label":"Main navigation",className:"flex-1 overflow-y-auto px-3 py-4",children:Ay.map((d,h)=>a.jsxs("div",{className:le(h>0&&"mt-5"),children:[a.jsx("div",{className:"mb-1.5 px-2 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:d.label}),a.jsx("div",{className:"space-y-0.5",children:d.items.map(x=>{const m=x.icon;return a.jsx(hy,{to:x.to,end:x.to==="/",onClick:l,className:({isActive:p})=>le("group relative flex items-center gap-2.5 rounded-md px-2.5 py-2 text-[13px] font-medium transition-colors duration-[var(--ez-motion-fast)]",p?"bg-accent-soft text-ink":"text-muted hover:bg-inset hover:text-ink"),children:({isActive:p})=>a.jsxs(a.Fragment,{children:[a.jsx("span",{className:le("absolute left-0 top-1/2 h-4 w-0.5 -translate-y-1/2 rounded-pill bg-accent transition-opacity duration-[var(--ez-motion-fast)]",p?"opacity-100":"opacity-0"),"aria-hidden":"true"}),a.jsx(m,{className:le("size-4 shrink-0 transition-colors",p?"text-accent-text":"text-faint group-hover:text-muted"),"aria-hidden":"true"}),x.label]})},x.to)})})]},d.label))}),a.jsx("div",{className:"border-t border-line p-3",children:a.jsxs(mt,{to:"/processes",onClick:l,className:"flex items-center gap-2.5 rounded-md border border-line bg-raised/60 px-2.5 py-2 transition-colors hover:border-line-strong hover:bg-inset","aria-label":`Background service: ${u.label}. Open Processes.`,children:[a.jsx(Jt,{tone:u.tone,pulse:u.tone==="ok"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-2xs font-medium text-ink",children:"Background service"}),a.jsx("div",{className:"truncate text-2xs text-faint",children:u.label})]})]})})]})}function Ow({open:l,onClose:o}){const c=g.useRef(null),u=g.useRef(null);return g.useEffect(()=>{if(!l)return;const d=document.activeElement,h=document.body.style.overflow;document.body.style.overflow="hidden";const x=window.setTimeout(()=>u.current?.focus(),0),m=p=>{if(p.key==="Escape"){p.preventDefault(),o();return}if(p.key!=="Tab")return;const b=c.current;if(!b)return;const j=Array.from(b.querySelectorAll(_w)).filter(U=>U.offsetParent!==null);if(j.length===0)return;const y=j[0],N=j[j.length-1],C=document.activeElement;p.shiftKey&&(C===y||C===b)?(p.preventDefault(),N.focus()):!p.shiftKey&&C===N&&(p.preventDefault(),y.focus())};return document.addEventListener("keydown",m,!0),()=>{window.clearTimeout(x),document.removeEventListener("keydown",m,!0),document.body.style.overflow=h,d?.focus()}},[l,o]),a.jsxs(a.Fragment,{children:[a.jsx("aside",{className:"hidden w-[var(--ez-sidebar-width)] shrink-0 flex-col border-r border-line bg-surface lg:flex",children:a.jsx(mg,{})}),l&&a.jsxs("div",{className:"fixed inset-0 z-50 lg:hidden",children:[a.jsx("div",{className:"fade-enter absolute inset-0 bg-[var(--ez-overlay)] backdrop-blur-[1px]",onClick:o,"aria-hidden":"true"}),a.jsxs("aside",{ref:c,role:"dialog","aria-modal":"true","aria-label":"Main navigation",tabIndex:-1,className:"drawer-enter absolute inset-y-0 left-0 flex w-[276px] flex-col border-r border-line bg-surface shadow-pop outline-none",children:[a.jsx(at,{ref:u,label:"Close navigation",size:"sm",onClick:o,className:"absolute right-2 top-2 z-10",children:a.jsx(Hl,{className:"size-4","aria-hidden":"true"})}),a.jsx(mg,{onNavigate:o})]})]})]})}function Mw(l){return l.type==="nginx_down"?Ul:l.type==="cert_expiry"?Aa:l.type==="domain_health"?Lo:l.type==="deploy"?qi:ky}function Lw(l){return l==="danger"?"text-bad":l==="warning"?"text-warn":l==="success"?"text-ok":l==="info"?"text-info":"text-muted"}function Uw(){const{notifications:l,unread:o,markAllRead:c,clearNotifications:u}=ua(),[d,h]=g.useState(!1),[,x]=g.useState(0),m=g.useRef(null),p=g.useRef(null);g.useEffect(()=>{if(!d)return;c();const j=N=>{m.current&&!m.current.contains(N.target)&&h(!1)},y=N=>{N.key==="Escape"&&(h(!1),p.current?.focus())};return document.addEventListener("pointerdown",j),document.addEventListener("keydown",y),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("keydown",y)}},[d,c]),g.useEffect(()=>{d&&c()},[d,l.length,c]),g.useEffect(()=>{if(!d)return;const j=setInterval(()=>x(y=>y+1),3e4);return()=>clearInterval(j)},[d]);const b=o>0?`Notifications, ${o} unread`:"Notifications";return a.jsxs("div",{ref:m,className:"sm:relative",children:[a.jsxs("div",{className:"relative",children:[a.jsx(at,{ref:p,label:b,onClick:()=>h(j=>!j),"aria-expanded":d,"aria-haspopup":"dialog","aria-controls":"notifications-panel",className:le(d&&"bg-inset text-ink"),children:a.jsx(cf,{className:"size-4.5","aria-hidden":"true"})}),o>0&&a.jsx("span",{className:"pointer-events-none absolute -right-0.5 -top-0.5 flex h-4 min-w-4 items-center justify-center rounded-pill bg-accent px-1 text-[10px] font-semibold leading-none text-accent-ink","aria-hidden":"true",children:o>9?"9+":o})]}),d&&a.jsxs("div",{id:"notifications-panel",role:"dialog","aria-label":"Notifications",className:"panel-enter absolute right-3 top-[calc(100%+10px)] z-50 w-[min(92vw,360px)] overflow-hidden rounded-lg border border-line bg-surface shadow-pop sm:right-0",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-2.5",children:[a.jsx("span",{className:"text-sm font-semibold text-ink",children:"Notifications"}),l.length>0&&a.jsx("button",{type:"button",onClick:u,className:"text-2xs text-muted transition-colors hover:text-ink",children:"Clear all"})]}),a.jsx("div",{className:"max-h-[min(60vh,320px)] overflow-y-auto",children:l.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-2 px-4 py-8 text-center",children:[a.jsx(Fj,{className:"size-5 text-faint","aria-hidden":"true"}),a.jsx("div",{className:"text-xs text-muted",children:"All clear — no notifications yet."})]}):l.map(j=>{const y=Mw(j);return a.jsxs("div",{className:"flex items-start gap-2.5 border-b border-line/70 px-4 py-2.5 last:border-0",children:[a.jsx(y,{className:le("mt-0.5 size-4 shrink-0",Lw(j.severity)),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs leading-snug text-ink",children:j.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:Pi(j.timestamp)})]})]},j.id)})}),a.jsx("div",{className:"border-t border-line bg-raised/50 px-4 py-2",children:a.jsx(mt,{to:"/notifications",onClick:()=>h(!1),className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Open notification settings"})})]})]})}function Hw({onMenu:l}){const{pathname:o}=jn(),{theme:c,toggleTheme:u}=gy(),{nginxStatus:d,connected:h,connectionError:x}=ua(),{logout:m}=Qn(),p=jt(),[b,j]=g.useState(!1),y=Dy(o)?.title??"Easy DevOps",N=d?.running===!0,C=d===null?"Unknown":N?"Running":"Stopped",U=async()=>{if(!b){j(!0);try{await m(),p.success("Signed out","Your dashboard session has ended.")}finally{j(!1)}}};return a.jsxs("header",{className:"sticky top-0 z-30 flex h-[var(--ez-topbar-height)] shrink-0 items-center justify-between gap-3 border-b border-line bg-canvas/85 px-3 backdrop-blur sm:px-5",children:[a.jsxs("div",{className:"flex min-w-0 items-center gap-2",children:[a.jsx(at,{label:"Open navigation",size:"sm",onClick:l,className:"lg:hidden",children:a.jsx(W2,{className:"size-4.5","aria-hidden":"true"})}),a.jsx("div",{className:"truncate text-sm font-semibold text-ink",children:y})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1 sm:gap-1.5",children:[a.jsxs(mt,{to:"/nginx","aria-label":`Nginx is ${C.toLowerCase()}. Open Nginx.`,className:"hidden items-center gap-1.5 rounded-pill border border-line bg-raised px-2.5 py-1 text-2xs transition-colors hover:border-line-strong hover:bg-inset sm:inline-flex",children:[a.jsx(Jt,{tone:d===null?"neutral":N?"ok":"bad",pulse:N&&h}),a.jsx("span",{className:"font-medium text-ink",children:"nginx"}),a.jsx("span",{className:"text-faint",children:C})]}),a.jsx(mt,{to:"/nginx","aria-label":`Nginx is ${C.toLowerCase()}. Open Nginx.`,className:"flex size-9 items-center justify-center rounded-md transition-colors hover:bg-inset sm:hidden",children:a.jsx(Jt,{tone:d===null?"neutral":N?"ok":"bad",pulse:N&&h})}),a.jsxs("span",{className:"hidden items-center gap-1.5 pl-1 pr-2 text-2xs text-faint md:flex",title:x??(h?"Live updates are connected.":"Reconnecting to live updates…"),children:[a.jsx("span",{className:le("size-1.5 rounded-full",x?"bg-bad":h?"bg-ok live-dot":"bg-faint"),"aria-hidden":"true"}),x?"Live blocked":h?"Live":"Connecting"]}),a.jsx(Uw,{}),a.jsx(at,{label:c==="dark"?"Switch to light theme":"Switch to dark theme",onClick:u,children:c==="dark"?a.jsx(Ty,{className:"size-4.5","aria-hidden":"true"}):a.jsx(jy,{className:"size-4.5","aria-hidden":"true"})}),a.jsx(at,{label:"Sign out",onClick:U,disabled:b,className:"hover:text-bad",children:a.jsx(F2,{className:"size-4.5","aria-hidden":"true"})})]})]})}function Qe({className:l,children:o,...c}){return a.jsx("div",{className:le("rounded-lg border border-line bg-surface shadow-card",l),...c,children:o})}function Zt({title:l,description:o,actions:c,className:u,icon:d}){return a.jsxs("div",{className:le("flex flex-wrap items-start justify-between gap-3 border-b border-line px-4 py-3.5 sm:px-5",u),children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[d&&a.jsx("div",{className:"mt-0.5 text-muted",children:d}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:l}),o&&a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:o})]})]}),c&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:c})]})}function Kt({className:l,children:o,...c}){return a.jsx("div",{className:le("px-4 py-4 sm:px-5",l),...c,children:o})}function Do({className:l,children:o}){return a.jsx("div",{className:le("flex flex-wrap items-center justify-between gap-2 border-t border-line bg-raised/50 px-4 py-3 sm:px-5",l),children:o})}function Ms({className:l}){return a.jsx(ia,{className:le("spin size-4 text-muted",l),"aria-hidden":"true"})}function Ze({className:l}){return a.jsx("div",{className:le("skeleton",l),"aria-hidden":"true"})}function Ra({children:l}){return a.jsx("div",{className:"page-enter space-y-5","aria-busy":"true","aria-label":"Loading",children:l})}function Bw(){return a.jsx("div",{className:"flex min-h-full items-center justify-center bg-canvas",children:a.jsxs("div",{className:"flex items-center gap-3 text-muted",children:[a.jsx(ia,{className:"spin size-5 text-accent-text","aria-hidden":"true"}),a.jsx("span",{className:"text-sm",children:"Loading Easy DevOps…"})]})})}function Vn({title:l,description:o,action:c,icon:u,className:d}){return a.jsxs("div",{className:le("flex flex-col items-center justify-center px-6 py-12 text-center",d),children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-inset text-faint",children:u??a.jsx(U2,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-medium text-ink",children:l}),o&&a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:o}),c&&a.jsx("div",{className:"mt-4",children:c})]})}function ye({tone:l="info",title:o,children:c,action:u,className:d}){const h={info:"border-info/25 bg-info-soft text-info",warning:"border-warn/30 bg-warn-soft text-warn",danger:"border-bad/30 bg-bad-soft text-bad",success:"border-ok/30 bg-ok-soft text-ok"}[l],x={info:by,warning:_l,danger:_l,success:_s}[l];return a.jsx("div",{className:le("rounded-md border px-3.5 py-3 text-xs",h,d),role:"status",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(x,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 text-muted",children:[o&&a.jsx("div",{className:"font-medium text-ink",children:o}),c&&a.jsx("div",{className:le(o?"mt-0.5":void 0,"break-words"),children:c})]}),u&&a.jsx("div",{className:"shrink-0",children:u})]})})}function St({error:l,onRetry:o,title:c,className:u}){const d=l instanceof Le?l:null,h=d?.status===403,x=typeof d?.payload?.detail=="string"?d.payload.detail:void 0,m=d?.message??(l instanceof Error?l.message:"Something went wrong while loading this section.");return a.jsx(Qe,{className:le("border-bad/25",u),children:a.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-10 text-center",children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-bad-soft text-bad",children:h?a.jsx(Aa,{className:"size-5","aria-hidden":"true"}):a.jsx(_l,{className:"size-5","aria-hidden":"true"})}),a.jsx("h3",{className:"text-sm font-semibold text-ink",children:c??(h?"Request blocked":"Could not load this section")}),a.jsx("p",{className:"mt-1 max-w-md text-xs text-muted",children:m}),x&&a.jsx("p",{className:"mt-1 max-w-md break-all font-mono text-2xs text-faint",children:x}),d&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",d.status,d.code?` · ${d.code}`:""]}),o&&a.jsx(W,{className:"mt-4",variant:"secondary",size:"sm",icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:o,children:"Try again"})]})})}const xg="ez-service-banner-dismissed";function Md({children:l}){return a.jsx("code",{className:"font-mono text-ink",children:l})}function qw(l){return l.startsAt==="logon"?"at your next logon":l.startsAt==="boot"?"at the next boot":"when the service starts"}function $w(l){return l.running?{code:"running",tone:"info",title:"Background service is running",body:"This dashboard is the interface only.",action:"Open Processes"}:l.stoppedByUser?{code:"stopped_by_user",tone:"warning",title:"The background service is stopped",body:a.jsxs(a.Fragment,{children:["You stopped it",l.stoppedAtLabel?` on ${l.stoppedAtLabel}`:"",", so monitoring and notifications are paused. It starts again ",qw(l),", or run"," ",a.jsx(Md,{children:"ezz service start"})," to start it now."]}),action:"Open Processes"}:{code:"not_running",tone:"warning",title:"The background service is not running",body:l.installed?a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Start the service with ",a.jsx(Md,{children:"ezz service start"}),"."]}):a.jsxs(a.Fragment,{children:["Monitoring and notifications would run in this dashboard and stop when it closes. Set up the service with ",a.jsx(Md,{children:l.installCommand}),"."]}),action:"Open Processes"}}function Gw(){const{service:l}=Ji(),{pathname:o}=jn(),[c,u]=g.useState(()=>{try{return sessionStorage.getItem(xg)}catch{return null}}),d=Fi(l),h=d?$w(d):null,x=o!=="/processes",m=g.useMemo(()=>!d||!h?"":[h.code,d.pid,d.startedAt,d.stoppedByUser,d.stoppedAt,d.startsAt,d.installed].join("|"),[d,h]);if(!d||!h||c===m)return null;const p=()=>{u(m);try{sessionStorage.setItem(xg,m)}catch{}};return a.jsx("div",{className:"fade-enter mb-5",children:a.jsx(ye,{tone:h.tone,title:h.title,action:a.jsxs("div",{className:"flex items-center gap-1",children:[x&&a.jsxs(mt,{to:"/processes",className:le("inline-flex items-center gap-1 rounded-sm px-2 py-1 text-xs font-medium text-ink","border border-line bg-raised transition-colors hover:border-line-strong hover:bg-inset"),children:[h.action,a.jsx(Ll,{className:"size-3","aria-hidden":"true"})]}),a.jsx(at,{label:"Dismiss banner",size:"sm",onClick:p,children:a.jsx(Hl,{className:"size-3.5","aria-hidden":"true"})})]}),children:h.body})})}const Yw={host_missing:"The request arrived without a Host header.",host_port_mismatch:"The request was addressed to a different port.",host_not_local:"The request hostname does not mean this machine.",origin_malformed:"The request carried an unreadable Origin.",origin_port_mismatch:"The request came from a different port.",origin_not_local:"The request came from another site.",origin_cross_site:"The request came from another site.",missing_request_header:"The request was missing the dashboard’s safety header."};function Vw(){const{blocked:l,dismissBlocked:o}=Qn();if(!l)return null;const c=l.blockedReason,u=typeof l.payload.detail=="string"?l.payload.detail:void 0;return a.jsx("div",{className:"fade-enter mb-5 rounded-md border border-bad/30 bg-bad-soft px-3.5 py-3 text-xs",role:"alert",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(Aa,{className:"mt-0.5 size-4 shrink-0 text-bad","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"font-medium text-ink",children:"Request blocked"}),a.jsx("div",{className:"mt-0.5 text-muted",children:c?Yw[c]??"The dashboard refused this request.":l.message}),u&&a.jsx("div",{className:"mt-1 break-all font-mono text-2xs text-faint",children:u}),a.jsx("div",{className:"mt-1.5 text-2xs text-faint",children:"This happens when a request comes from another site or through a different port. Try reloading the dashboard from its own address."})]}),a.jsx(W,{variant:"ghost",size:"sm",onClick:o,className:"-mr-1 -mt-1 shrink-0",children:"Dismiss"})]})})}class Xw extends g.Component{state={error:null};static getDerivedStateFromError(o){return{error:o}}componentDidCatch(o,c){console.error(`[ui] ${this.props.area??"page"} crashed`,o,c.componentStack)}render(){return this.state.error?a.jsx(Qe,{className:"border-bad/30",children:a.jsxs("div",{className:"flex flex-col items-center justify-center px-6 py-12 text-center",children:[a.jsx("div",{className:"mb-3 flex size-10 items-center justify-center rounded-full bg-bad-soft text-bad",children:a.jsx(Aa,{className:"size-5","aria-hidden":"true"})}),a.jsx("h2",{className:"text-sm font-semibold text-ink",children:this.props.area?`${this.props.area} hit an error`:"This page hit an error"}),a.jsx("p",{className:"mt-1 max-w-lg text-xs text-muted",children:"The rest of the dashboard still works. Try again, or reload the page if it keeps happening."}),a.jsx("p",{className:"mt-2 max-w-lg break-all font-mono text-2xs text-faint",children:this.state.error.message}),a.jsx(W,{className:"mt-4",size:"sm",icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>this.setState({error:null}),children:"Try again"})]})}):this.props.children}}function Qw(){const[l,o]=g.useState(!1),{pathname:c}=jn(),u=g.useRef(null),d=g.useCallback(()=>o(!1),[]);g.useEffect(()=>{o(!1),u.current?.scrollTo({top:0}),u.current?.focus({preventScroll:!0})},[c]),g.useEffect(()=>{const x=window.matchMedia("(min-width: 1024px)"),m=()=>{x.matches&&o(!1)};return x.addEventListener("change",m),()=>x.removeEventListener("change",m)},[]);const h=Dy(c);return a.jsxs("div",{className:"flex h-full min-h-0 bg-canvas",children:[a.jsx("a",{href:"#main-content",className:"sr-only focus:not-sr-only focus:absolute focus:left-3 focus:top-3 focus:z-[80] focus:rounded-md focus:border focus:border-line focus:bg-surface focus:px-3 focus:py-2 focus:text-sm focus:text-ink focus:shadow-pop",children:"Skip to content"}),a.jsx(Ow,{open:l,onClose:d}),a.jsxs("div",{className:"flex min-w-0 flex-1 flex-col",children:[a.jsx(Hw,{onMenu:()=>o(!0)}),a.jsx("main",{ref:u,id:"main-content",tabIndex:-1,className:"min-h-0 flex-1 overflow-y-auto outline-none",children:a.jsxs("div",{className:"relative isolate mx-auto w-full max-w-[var(--ez-content-max)] px-3 py-4 sm:px-5 sm:py-5 lg:px-7 lg:py-6",children:[a.jsx("div",{className:"dashboard-ambient -z-10","aria-hidden":"true"}),a.jsx(Gw,{}),a.jsx(Vw,{}),a.jsx("div",{className:"page-enter",children:a.jsx(Xw,{area:h?.title,children:a.jsx(I1,{})})},c)]})}),a.jsxs("footer",{className:"shrink-0 border-t border-line bg-canvas px-3 py-1.5 text-center text-[10px] text-faint sm:px-5",children:["© ",Oy()," Easy DevOps · provided by"," ",a.jsx("a",{href:"https://devxor.team",target:"_blank",rel:"noopener noreferrer",className:"text-muted underline-offset-2 transition-colors hover:text-ink hover:underline",children:"DevXor Team"})]})]})]})}function Zw(){const{bootError:l,retryBoot:o}=Qn(),[c,u]=g.useState(!1),d=async()=>{u(!0),await o(),u(!1)};return a.jsx("div",{className:"flex min-h-full items-center justify-center bg-canvas px-4 py-10",children:a.jsxs("div",{className:"w-full max-w-md rounded-xl border border-line bg-surface p-6 shadow-card",children:[a.jsx("div",{className:"mb-4 flex size-10 items-center justify-center rounded-full bg-bad-soft text-bad",children:a.jsx(iN,{className:"size-5","aria-hidden":"true"})}),a.jsx("h1",{className:"text-lg font-semibold text-ink",children:"Cannot reach the dashboard"}),a.jsxs("p",{className:"mt-1 text-sm text-muted",children:[l?.message??"The dashboard did not answer."," Check that Easy DevOps is running, then try again."]}),l&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["HTTP ",l.status===0?"connection failed":l.status]}),a.jsx(W,{variant:"primary",loading:c,onClick:d,icon:a.jsx(bt,{className:"size-4","aria-hidden":"true"}),className:"mt-5",children:"Try again"})]})})}const yf="w-full rounded-md border border-line bg-canvas px-3 text-sm text-ink placeholder:text-faint transition-colors duration-[var(--ez-motion-fast)] hover:border-line-strong focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/25 disabled:opacity-60",Zo="border-bad/60 hover:border-bad focus:border-bad focus:ring-bad/25";function Ko({htmlFor:l,children:o,optional:c,trailing:u}){return a.jsxs("div",{className:"mb-1.5 flex items-baseline justify-between gap-2",children:[a.jsxs("label",{htmlFor:l,className:"flex items-baseline gap-2 text-xs font-medium text-muted",children:[a.jsx("span",{children:o}),c&&a.jsx("span",{className:"text-2xs font-normal text-faint",children:"Optional"})]}),u]})}function Jo({id:l,children:o}){return a.jsx("p",{id:l,className:"mt-1.5 text-xs text-bad",role:"alert",children:o})}function Ls({id:l,children:o}){return a.jsx("p",{id:l,className:"mt-1.5 text-xs text-faint",children:o})}function Ee({label:l,hint:o,error:c,optional:u,trailing:d,id:h,className:x,...m}){const p=g.useId(),b=h??p,j=`${b}-error`,y=`${b}-hint`;return a.jsxs("div",{className:x,children:[l&&a.jsx(Ko,{htmlFor:b,optional:u,children:l}),a.jsxs("div",{className:"relative",children:[a.jsx("input",{id:b,className:le(yf,"h-9",!!d&&"pr-10",c&&Zo),"aria-invalid":c?!0:void 0,"aria-describedby":c?j:o?y:void 0,...m}),d&&a.jsx("div",{className:"absolute inset-y-0 right-0 flex items-center pr-1.5",children:d})]}),c?a.jsx(Jo,{id:j,children:c}):o?a.jsx(Ls,{id:y,children:o}):null]})}function Bo({label:l,hint:o,error:c,optional:u,id:d,className:h,...x}){const m=g.useId(),p=d??m,b=`${p}-error`,j=`${p}-hint`;return a.jsxs("div",{className:h,children:[l&&a.jsx(Ko,{htmlFor:p,optional:u,children:l}),a.jsx("textarea",{id:p,className:le(yf,"min-h-24 py-2 leading-relaxed",c&&Zo),"aria-invalid":c?!0:void 0,"aria-describedby":c?b:o?j:void 0,...x}),c?a.jsx(Jo,{id:b,children:c}):o?a.jsx(Ls,{id:j,children:o}):null]})}function os({label:l,hint:o,error:c,optional:u,id:d,className:h,children:x,...m}){const p=g.useId(),b=d??p,j=`${b}-error`,y=`${b}-hint`;return a.jsxs("div",{className:h,children:[l&&a.jsx(Ko,{htmlFor:b,optional:u,children:l}),a.jsx("select",{id:b,className:le(yf,"h-9 cursor-pointer pr-8",c&&Zo),"aria-invalid":c?!0:void 0,"aria-describedby":c?j:o?y:void 0,...m,children:x}),c?a.jsx(Jo,{id:j,children:c}):o?a.jsx(Ls,{id:y,children:o}):null]})}function Kw({label:l,hint:o,error:c,optional:u,value:d,onChange:h,normalize:x,max:m,placeholder:p,className:b,id:j}){const y=g.useId(),N=j??y,[C,U]=g.useState(""),[S,k]=g.useState(null),E=`${N}-error`,T=`${N}-hint`,Y=S??c??null,z=()=>{const D=C.trim();if(!D)return;let te=d;for(const L of D.split(/[\n,]/)){if(!L.trim())continue;const Q=x(L,te);if(Q.error||!Q.value){k(Q.error??"This path cannot be added."),U(L.trim());return}te.includes(Q.value)||(te=[...te,Q.value])}h(te),U(""),k(null)};return a.jsxs("div",{className:b,children:[l&&a.jsx(Ko,{htmlFor:N,optional:u,trailing:m?a.jsxs("span",{className:"text-2xs font-normal text-faint",children:[d.length,"/",m]}):void 0,children:l}),a.jsxs("div",{className:le("flex min-h-9 w-full flex-wrap items-center gap-1.5 rounded-md border bg-canvas px-2 py-1.5 transition-colors duration-[var(--ez-motion-fast)]",Y?Zo:"border-line hover:border-line-strong focus-within:border-accent focus-within:ring-2 focus-within:ring-accent/25"),children:[d.map(D=>a.jsxs("span",{className:"inline-flex max-w-full items-center gap-1 rounded-sm border border-line bg-inset py-0.5 pl-2 pr-1 font-mono text-xs text-ink",children:[a.jsx("span",{className:"truncate",children:D}),a.jsx("button",{type:"button",onClick:()=>{h(d.filter(te=>te!==D)),k(null)},className:"shrink-0 rounded-sm p-0.5 text-faint transition-colors hover:bg-canvas hover:text-bad focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50","aria-label":`Remove ${D}`,children:a.jsx(Hl,{className:"size-3","aria-hidden":"true"})})]},D)),a.jsx("input",{id:N,value:C,onChange:D=>{U(D.target.value),S&&k(null)},onKeyDown:D=>{(D.key==="Enter"||D.key===",")&&(D.preventDefault(),z()),D.key==="Backspace"&&!C&&d.length>0&&h(d.slice(0,-1))},onBlur:z,placeholder:d.length===0?p:void 0,"aria-invalid":Y?!0:void 0,"aria-describedby":Y?E:o?T:void 0,className:"h-6 min-w-24 flex-1 bg-transparent font-mono text-sm text-ink placeholder:text-faint focus:outline-none",spellCheck:!1,autoComplete:"off"}),a.jsx("button",{type:"button",onClick:z,disabled:!C.trim(),className:"shrink-0 rounded-sm p-1 text-faint transition-colors hover:bg-inset hover:text-ink focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent/50 disabled:pointer-events-none disabled:opacity-40","aria-label":"Add path",children:a.jsx(ra,{className:"size-3.5","aria-hidden":"true"})})]}),Y?a.jsx(Jo,{id:E,children:Y}):o?a.jsx(Ls,{id:T,children:o}):null]})}function is({label:l,hint:o,checked:c,onChange:u,disabled:d,className:h,id:x}){const m=g.useId(),p=x??m;return a.jsxs("div",{className:le("flex items-start gap-2.5",h),children:[a.jsx("input",{id:p,type:"checkbox",checked:c,disabled:d,onChange:b=>u(b.target.checked),className:"mt-0.5 size-4 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("label",{htmlFor:p,className:le("cursor-pointer text-sm text-ink",d&&"cursor-not-allowed opacity-60"),children:l}),o&&a.jsx("p",{className:"mt-0.5 text-xs text-faint",children:o})]})]})}function qt({checked:l,onChange:o,label:c,description:u,disabled:d,className:h}){const x=g.useId();return a.jsxs("div",{className:le("flex items-start justify-between gap-4",h),children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{id:x,className:"text-sm text-ink",children:c}),u&&a.jsx("div",{className:"mt-0.5 text-xs text-faint",children:u})]}),a.jsx("button",{type:"button",role:"switch","aria-checked":l,"aria-labelledby":x,disabled:d,onClick:()=>o(!l),className:le("relative mt-0.5 inline-flex h-5 w-9 shrink-0 items-center rounded-pill border transition-colors duration-[var(--ez-motion-fast)] disabled:opacity-50",l?"border-accent bg-accent":"border-line-strong bg-inset","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent/50"),children:a.jsx("span",{className:le("inline-block size-3.5 rounded-full bg-white shadow-sm transition-transform duration-[var(--ez-motion-fast)]",l?"translate-x-[18px]":"translate-x-[3px]")})})]})}function Ea({children:l,className:o}){return a.jsx("div",{className:le("grid gap-4 sm:grid-cols-2",o),children:l})}const Jw=["Domains, certificates and nginx configs in one flow","Live nginx status, health checks and log tails","Processes, notifications and Hub pairing built in","Local-first: no Docker, no cloud account"],Pw="This code has expired. Get a new one with: ezz dashboard setup-code";function pg(l){return l?.setupCodeRequired!==!0?!1:l.setupCodeExpiresAt===null||l.setupCodeExpiresAt<=Date.now()}function gg({compact:l=!1}){return a.jsxs("div",{className:"flex items-center gap-2.5",children:[a.jsx(_y,{className:"h-6"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-semibold tracking-tight text-ink",children:"Easy DevOps"}),!l&&a.jsx("div",{className:"text-2xs text-faint",children:"Server control plane"})]})]})}function Fw({children:l}){const{theme:o,toggleTheme:c}=gy();return a.jsxs("div",{className:"relative flex min-h-full flex-col overflow-hidden bg-canvas px-4 py-8 sm:py-12",children:[a.jsxs("div",{className:"pointer-events-none absolute inset-0","aria-hidden":"true",children:[a.jsx("div",{className:"absolute -top-48 left-1/2 h-[420px] w-[760px] -translate-x-1/2 rounded-full bg-accent-soft blur-3xl"}),a.jsx("div",{className:"absolute -bottom-56 right-[-120px] h-[380px] w-[520px] rounded-full bg-info-soft blur-3xl"})]}),a.jsxs("div",{className:"relative my-auto grid w-full max-w-4xl self-center overflow-hidden rounded-xl border border-line bg-surface shadow-card lg:grid-cols-[1.02fr_1fr]",children:[a.jsxs("aside",{className:"hidden flex-col justify-between gap-8 border-r border-line bg-raised/40 p-8 lg:flex",children:[a.jsx(gg,{}),a.jsxs("div",{children:[a.jsx("h2",{className:"max-w-sm text-2xl font-semibold leading-snug tracking-tight text-ink",children:"nginx, certificates and processes — one calm console."}),a.jsx("ul",{className:"mt-6 space-y-3",children:Jw.map(u=>a.jsxs("li",{className:"flex items-start gap-2.5 text-sm text-muted",children:[a.jsx("span",{className:"mt-0.5 flex size-4 shrink-0 items-center justify-center rounded-full bg-ok-soft text-ok",children:a.jsx(uf,{className:"size-2.5","aria-hidden":"true"})}),u]},u))})]}),a.jsxs("div",{className:"flex items-center gap-2 text-2xs text-faint",children:[a.jsx(df,{className:"size-3.5","aria-hidden":"true"}),"Runs on this server. Nothing leaves it."]})]}),a.jsxs("section",{className:"relative p-6 sm:p-8",children:[a.jsxs("div",{className:"mb-6 flex items-start justify-between gap-4 lg:justify-end",children:[a.jsx("div",{className:"lg:hidden",children:a.jsx(gg,{compact:!0})}),a.jsx(at,{label:o==="dark"?"Switch to light theme":"Switch to dark theme",onClick:c,children:o==="dark"?a.jsx(Ty,{className:"size-4.5","aria-hidden":"true"}):a.jsx(jy,{className:"size-4.5","aria-hidden":"true"})})]}),l]})]}),a.jsxs("footer",{className:"relative py-4 text-center text-2xs text-faint",children:["© ",Oy()," Easy DevOps · provided by"," ",a.jsx("a",{href:"https://devxor.team",target:"_blank",rel:"noopener noreferrer",className:"text-muted underline-offset-2 transition-colors hover:text-ink hover:underline",children:"DevXor Team"})]})]})}function Uy({show:l,onToggle:o}){return a.jsx(at,{label:l?"Hide password":"Show password",size:"sm",onClick:o,className:"text-faint hover:text-ink",children:l?a.jsx(w2,{className:"size-4","aria-hidden":"true"}):a.jsx(k2,{className:"size-4","aria-hidden":"true"})})}function Hy({error:l}){if(!l)return null;const o=typeof l.payload.hint=="string"?l.payload.hint:void 0;return a.jsx(ye,{tone:"danger",title:l.message,className:"mb-4",children:o??(l.status===429?"Wait a moment before trying again.":void 0)})}function Iw(){const{login:l,retryBoot:o,sessionMessage:c}=Qn(),[u,d]=g.useState(""),[h,x]=g.useState(!1),[m,p]=g.useState(null),[b,j]=g.useState(null),[y,N]=g.useState(!1),C=async U=>{if(U.preventDefault(),!u){p("Enter your password.");return}p(null),j(null),N(!0);try{await l(u)}catch(S){const k=S instanceof Le?S:null;if(k?.payload.needsSetup){await o();return}if(k?.status===409){await o();return}j(k)}finally{N(!1)}};return a.jsxs("div",{className:"mx-auto w-full max-w-sm",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"Dashboard"}),a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:"Welcome back"}),a.jsx("p",{className:"mt-1 text-sm text-muted",children:"Sign in to manage this server."})]}),c&&a.jsx(ye,{tone:"info",title:"You were signed out",className:"mb-4",children:c}),a.jsx(Hy,{error:b}),a.jsxs("form",{onSubmit:C,noValidate:!0,children:[a.jsx(Ee,{label:"Password",type:h?"text":"password",value:u,onChange:U=>{d(U.target.value),m&&p(null)},error:m,autoComplete:"current-password",autoFocus:!0,trailing:a.jsx(Uy,{show:h,onToggle:()=>x(U=>!U)})}),a.jsxs(W,{type:"submit",variant:"primary",size:"lg",loading:y,className:"mt-5 w-full",children:["Sign in",!y&&a.jsx(Ll,{className:"size-4","aria-hidden":"true"})]})]})]})}function Ww(){const{auth:l,setup:o,retryBoot:c}=Qn(),u=l?.minPasswordLength??8,d=l?.canUseNoPassword===!0,h=l?.setupCodeRequired===!0,x=pg(l),[m,p]=g.useState("password"),[b,j]=g.useState(""),[y,N]=g.useState(""),[C,U]=g.useState(""),[S,k]=g.useState(!1),[E,T]=g.useState({}),[Y,z]=g.useState(null),[D,te]=g.useState(!1),L=async Q=>{Q.preventDefault();const re={};if(h&&!b.trim()&&(re.code="Enter the setup code shown by the server."),m==="password"&&(y.length<u&&(re.password=`Use at least ${u} characters.`),C!==y&&(re.confirm="The two passwords do not match.")),T(re),!(Object.keys(re).length>0)){z(null),te(!0);try{if(m==="none")await o({mode:"none"});else{const K=b.trim();await o({password:y,mode:"password",...K?{setupCode:K}:{}})}}catch(K){const ae=K instanceof Le?K:null;if(ae?.status===409){await c();return}if(ae?.status===400&&pg(l)){z(null);return}z(ae)}finally{te(!1)}}};return a.jsxs("div",{className:"mx-auto w-full max-w-sm",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"First run"}),a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:"Set up this dashboard"}),a.jsx("p",{className:"mt-1 text-sm text-muted",children:"Choose how Easy DevOps protects itself. You can change this later in Settings."})]}),a.jsx(Hy,{error:Y}),a.jsxs("form",{onSubmit:L,noValidate:!0,children:[a.jsxs("div",{className:le("grid gap-2",d&&"grid-cols-2"),role:"group","aria-label":"Authentication method",children:[a.jsxs("button",{type:"button","aria-pressed":m==="password",onClick:()=>p("password"),className:le("rounded-md border p-3 text-left transition-colors duration-[var(--ez-motion-fast)]",m==="password"?"border-accent bg-accent-soft":"border-line bg-raised hover:border-line-strong hover:bg-inset"),children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[a.jsx(Zi,{className:"size-3.5 text-accent-text","aria-hidden":"true"}),"Password"]}),a.jsx("span",{className:"mt-1 block text-2xs text-muted",children:"Required to sign in from any browser."})]}),d&&a.jsxs("button",{type:"button","aria-pressed":m==="none",onClick:()=>p("none"),className:le("rounded-md border p-3 text-left transition-colors duration-[var(--ez-motion-fast)]",m==="none"?"border-accent bg-accent-soft":"border-line bg-raised hover:border-line-strong hover:bg-inset"),children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[a.jsx(RN,{className:"size-3.5 text-warn","aria-hidden":"true"}),"No password"]}),a.jsx("span",{className:"mt-1 block text-2xs text-muted",children:"Only from this machine, while bound to loopback."})]})]}),h&&x&&a.jsx(ye,{tone:"warning",title:Pw,className:"mt-4",children:"Run that on the server, then reload this page to enter the new code."}),h&&a.jsx(Ee,{className:"mt-4",label:"Setup code",value:b,onChange:Q=>{j(Q.target.value),E.code&&T(re=>({...re,code:void 0}))},error:E.code,hint:"Printed in the terminal where the dashboard was started.",autoComplete:"one-time-code"}),m==="password"?a.jsxs(a.Fragment,{children:[a.jsx(Ee,{className:"mt-4",label:"Password",type:S?"text":"password",value:y,onChange:Q=>{N(Q.target.value),E.password&&T(re=>({...re,password:void 0}))},error:E.password,hint:`At least ${u} characters. Stored as a scrypt hash on this server.`,autoComplete:"new-password",autoFocus:!h,trailing:a.jsx(Uy,{show:S,onToggle:()=>k(Q=>!Q)})}),a.jsx(Ee,{className:"mt-4",label:"Confirm password",type:S?"text":"password",value:C,onChange:Q=>{U(Q.target.value),E.confirm&&T(re=>({...re,confirm:void 0}))},error:E.confirm,autoComplete:"new-password"})]}):a.jsxs(ye,{tone:"warning",title:"The dashboard will have no password",className:"mt-4",children:["Anyone who can reach ",l?.bindAddress??"this machine"," can manage nginx, domains and certificates. Keep the dashboard bound to 127.0.0.1. Adding a password later in Settings is recommended if you ever expose it."]}),a.jsxs(W,{type:"submit",variant:"primary",size:"lg",loading:D,className:"mt-5 w-full",children:[m==="password"?"Save password and sign in":"Start without a password",!D&&a.jsx(Ll,{className:"size-4","aria-hidden":"true"})]})]})]})}function eS(){const{auth:l,retryBoot:o}=Qn(),[c,u]=g.useState(!1),d=async()=>{u(!0),await o(),u(!1)};return a.jsxs("div",{className:"mx-auto w-full max-w-sm",children:[a.jsxs("div",{className:"mb-6",children:[a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"No password"}),a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:"Open the dashboard"}),a.jsxs("p",{className:"mt-1 text-sm text-muted",children:["This dashboard is configured without a password. It only accepts requests from"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-2xs text-ink",children:l?.bindAddress??"this machine"}),"."]})]}),a.jsxs(W,{variant:"primary",size:"lg",loading:c,onClick:d,className:"w-full",children:["Continue to dashboard",!c&&a.jsx(Ll,{className:"size-4","aria-hidden":"true"})]})]})}function tS(){const{auth:l}=Qn();return Xn(l?.needsSetup?"Set up this dashboard":l?.authMode==="none"?"Open the dashboard":"Sign in"),a.jsxs(Fw,{children:[l?.needsSetup?a.jsx(Ww,{}):l?.authMode==="none"?a.jsx(eS,{}):a.jsx(Iw,{}),a.jsxs("div",{className:"mx-auto mt-6 w-full max-w-sm border-t border-line pt-4 text-2xs text-faint",children:[a.jsxs("div",{className:"flex items-center justify-between gap-3",children:[a.jsxs("span",{className:"inline-flex min-w-0 items-center gap-1.5",children:[a.jsx(df,{className:"size-3 shrink-0","aria-hidden":"true"}),a.jsxs("span",{className:"truncate",children:["Listening on"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-2xs text-muted",children:l?.bindAddress??"…"})]})]}),a.jsx("span",{children:"Easy DevOps"})]}),!1]})]})}function Bl(l,o){const{lastChange:c,changeSeq:u}=ua(),d=g.useRef(o);d.current=o,g.useEffect(()=>{if(!c)return;(Array.isArray(l)?l:[l]).includes(c.section)&&d.current()},[u])}function da({title:l,description:o,actions:c,meta:u,eyebrow:d}){return a.jsxs("div",{className:"mb-5 flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between sm:gap-6",children:[a.jsxs("div",{className:"min-w-0",children:[d&&a.jsx("div",{className:"mb-1 text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:d}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx("h1",{className:"text-xl font-semibold tracking-tight text-ink",children:l}),u]}),o&&a.jsx("p",{className:"mt-1 max-w-2xl text-sm text-muted",children:o})]}),c&&a.jsx("div",{className:"flex shrink-0 flex-wrap items-center gap-2",children:c})]})}function nS(l){return Promise.all([ie.domains.list(l),ie.ssl.list(l),ie.nginx.status(l)]).then(([o,c,u])=>({domains:o,certs:c,nginx:u}))}const aS={neutral:"text-muted",accent:"text-accent-text",ok:"text-ok",warn:"text-warn",bad:"text-bad",info:"text-info"},sS={neutral:"border-line/70 bg-inset text-muted group-hover:text-ink",accent:"border-accent/25 bg-accent-soft text-accent-text",ok:"border-ok/25 bg-ok-soft text-ok",warn:"border-warn/25 bg-warn-soft text-warn",bad:"border-bad/25 bg-bad-soft text-bad",info:"border-info/25 bg-info-soft text-info"};function Co({label:l,value:o,hint:c,icon:u,tone:d="neutral",pulse:h=!1,to:x}){return a.jsx(mt,{to:x,className:"group block rounded-lg",children:a.jsxs(Qe,{className:"stat-card h-full px-4 py-3.5",children:[a.jsxs("div",{className:"flex items-start justify-between gap-3",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"text-2xs font-semibold uppercase tracking-[0.12em] text-faint",children:l}),a.jsxs("div",{className:"mt-1.5 flex items-center gap-2",children:[a.jsx("span",{className:le("text-2xl font-semibold tracking-tight",aS[d]),children:o}),(d==="ok"||d==="bad"||d==="warn")&&a.jsx(Jt,{tone:d,pulse:h})]})]}),a.jsx("div",{className:le("flex size-9 shrink-0 items-center justify-center rounded-lg border transition-transform duration-[var(--ez-motion-base)] group-hover:scale-105",sS[d]),children:a.jsx(u,{className:"size-4","aria-hidden":"true"})})]}),a.jsxs("div",{className:"mt-2.5 flex items-center justify-between gap-2",children:[a.jsx("div",{className:"truncate text-2xs text-muted",children:c}),a.jsxs("span",{className:"inline-flex shrink-0 items-center gap-0.5 text-2xs font-medium text-faint opacity-0 transition-opacity group-hover:opacity-100 group-focus-visible:opacity-100",children:["Open",a.jsx(Jj,{className:"size-3","aria-hidden":"true"})]})]})]})})}function lS(l,o,c,u){const d=[];l&&!l.running&&d.push({id:"nginx-down",tone:"bad",title:"nginx is not running",detail:"No domain is being proxied until nginx is started.",to:"/nginx"});for(const h of c)h.status==="error"?d.push({id:`cert-error-${h.domain}`,tone:"bad",title:`Certificate for ${h.domain} cannot be read`,detail:"The certificate files are missing or unreadable.",to:"/ssl"}):h.status==="expired"||h.daysLeft!==null&&h.daysLeft<0?d.push({id:`cert-expired-${h.domain}`,tone:"bad",title:`Certificate for ${h.domain} has expired`,detail:Ol(h.daysLeft),to:"/ssl"}):h.status==="expiring"&&d.push({id:`cert-expiring-${h.domain}`,tone:"warn",title:`Certificate for ${h.domain} expires soon`,detail:Ol(h.daysLeft),to:"/ssl"});for(const h of o)u.get(h.name)?.up===!1&&d.push({id:`domain-down-${h.name}`,tone:"bad",title:`${h.name} is not responding`,detail:`The backend ${h.backendHost}:${h.port} did not answer a health check.`,to:"/domains"});return d}function iS({entry:l}){return l?l.up===null?a.jsx(ge,{tone:"neutral",dot:!0,children:"External"}):l.up?a.jsx(ge,{tone:"ok",dot:!0,children:"Up"}):a.jsx(ge,{tone:"bad",dot:!0,children:"Down"}):a.jsx("span",{className:"text-2xs text-faint",children:"Awaiting check"})}function rS({days:l}){const o=l<=0?"bg-bad":l<30?"bg-warn":"bg-ok",c=l<=0?100:Math.max(8,Math.min(l,90)/90*100);return a.jsxs("span",{className:"flex items-center gap-2",children:[a.jsx("span",{className:le("text-2xs tabular-nums",l<30?"text-warn":"text-muted"),children:Ol(l)}),a.jsx("span",{className:"h-1 w-10 shrink-0 overflow-hidden rounded-full bg-inset","aria-hidden":"true",children:a.jsx("span",{className:le("block h-full rounded-full",o),style:{width:`${c}%`}})})]})}function oS(l){return l.type==="nginx_down"?{icon:Ul,tone:"text-muted"}:l.type==="cert_expiry"?{icon:Aa,tone:"text-warn"}:l.type==="domain_health"?{icon:Lo,tone:"text-info"}:{icon:Lo,tone:"text-muted"}}function cS(){Xn("Overview");const l=jt(),o=sn(),{nginxStatus:c,domainHealth:u,notifications:d}=ua(),{service:h}=Ji(),x=Fi(h),m=xt(nS),[p,b]=g.useState(!1);Bs(m.reload),Bl(["domains","ssl","nginx"],m.reload);const j=m.data,y=c??j?.nginx??null,N=j?.domains??[],C=j?.certs??[],U=new Map((u??[]).map(L=>[L.name,L])),S=N.filter(L=>L.enabled).length,k=C.filter(L=>L.status==="expiring"),E=C.filter(L=>L.status==="expired"||L.status==="error"),T=j?lS(y,N,C,U):[],Y=T.filter(L=>L.tone==="bad").length,z=j!==null&&y?.running===!0&&T.length===0,D=E.length>0?`${_n(E.length,"certificate")} expired or unreadable`:k.length>0?`${k.length} expiring within 30 days`:C.length>0?"All certificates healthy":"No certificates yet",te=async()=>{if(await o({title:"Reload nginx?",body:"Reloading applies configuration changes. Existing connections are kept open.",confirmLabel:"Reload nginx"})){b(!0);try{const Q=await ie.nginx.reload();Q.success?(l.success("Nginx reloaded",Q.output.trim()||"Configuration reloaded."),m.reload()):l.error("Nginx reload failed",Q.output.trim()||"nginx refused the reload.")}catch(Q){l.error("Nginx reload failed",Q instanceof Le?Q.message:"The dashboard could not complete the reload.")}finally{b(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(da,{title:"Overview",description:"The state of nginx, your domains and their certificates, live.",actions:a.jsx(W,{variant:"secondary",size:"sm",loading:m.loading,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:m.reload,children:"Refresh"})}),m.error&&!j?a.jsx(St,{error:m.error,onRetry:m.reload}):j?a.jsxs("div",{className:"space-y-4",children:[m.error&&a.jsx(ye,{tone:"warning",title:"Showing the last known state",action:a.jsx(W,{variant:"ghost",size:"sm",onClick:m.reload,children:"Try again"}),children:m.error.message}),a.jsxs(Qe,{className:"relative overflow-hidden",children:[a.jsx("div",{className:"status-sheen pointer-events-none absolute inset-x-0 top-0 h-px overflow-hidden","aria-hidden":"true"}),a.jsxs("div",{className:"flex flex-col gap-5 px-5 py-5 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"flex items-start gap-4",children:[a.jsxs("div",{className:le("relative isolate mt-0.5 flex size-11 shrink-0 items-center justify-center rounded-full border",Y>0?"border-bad/30 bg-bad-soft text-bad":T.length>0?"border-warn/30 bg-warn-soft text-warn":"border-ok/30 bg-ok-soft text-ok"),children:[a.jsx("span",{className:le("pointer-events-none absolute -inset-3 -z-10 rounded-full blur-lg",Y>0?"bg-bad/25":T.length>0?"bg-warn/25":"bg-ok/25"),"aria-hidden":"true"}),Y>0||T.length>0?a.jsx(_l,{className:"size-5","aria-hidden":"true"}):a.jsx(_s,{className:"size-5","aria-hidden":"true"}),a.jsx("span",{className:le("absolute -inset-px rounded-full border",Y>0?"border-bad/20":T.length>0?"border-warn/20":"border-ok/20"),"aria-hidden":"true"})]}),a.jsxs("div",{"aria-live":"polite",children:[a.jsx("div",{className:"text-2xs font-semibold uppercase tracking-[0.14em] text-faint",children:"System status"}),a.jsx("div",{className:"mt-0.5 text-lg font-semibold tracking-tight text-ink",children:Y>0?"Attention needed":T.length>0?"A few things to check":"All systems healthy"}),a.jsxs("div",{className:"mt-0.5 text-xs text-muted",children:[y?.running?"nginx running":"nginx stopped"," · ",_n(N.length,"domain")," · ",_n(C.length,"certificate"),T.length>0&&a.jsxs(a.Fragment,{children:[" · ",a.jsxs("span",{className:Y>0?"text-bad":"text-warn",children:[_n(T.length,"item")," need attention"]})]})]})]})]}),a.jsxs("div",{className:"flex items-center gap-3 sm:flex-col sm:items-end",children:[a.jsx(ge,{tone:z?"ok":Y>0?"bad":"warn",dot:!0,children:z?"Healthy":Y>0?"Degraded":"Check"}),a.jsxs("span",{className:"text-2xs text-faint",children:["Checked ",j.nginx?"live":"—",y?.version?` · ${y.version}`:""]})]})]})]}),a.jsxs("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[a.jsx(Co,{label:"Nginx",value:y?y.running?"Active":"Offline":"Unknown",hint:y?.running?`PID ${y.pid??"—"}${y.version?` · ${y.version}`:""}`:"Traffic is not being proxied.",icon:Ul,tone:y?y.running?"ok":"bad":"neutral",pulse:y?.running===!0,to:"/nginx"}),a.jsx(Co,{label:"Domains",value:`${S}/${N.length}`,hint:N.length===0?"No domains configured yet.":S===N.length?"All domains enabled.":`${N.length-S} disabled.`,icon:rs,tone:N.length===0?"neutral":S>0?"accent":"warn",to:"/domains"}),a.jsx(Co,{label:"Certificates",value:String(C.length),hint:D,icon:oa,tone:E.length>0?"bad":k.length>0?"warn":C.length>0?"ok":"neutral",to:"/ssl"}),a.jsx(Co,{label:"Background service",value:x?x.running?"Running":"Stopped":"Unknown",hint:x?x.running?x.startsAt==="unknown"?x.mechanismDetail:`${x.mechanismLabel} · starts ${x.startsAtLabel.toLowerCase()}`:x.stoppedByUser?x.installed?`You stopped it${x.stoppedAtLabel?` on ${x.stoppedAtLabel}`:""}; it starts again automatically.`:"You stopped it; start it to resume monitoring.":x.installed?"Monitoring runs in this window.":"Not installed; monitoring runs in this window.":"Checking…",icon:vy,tone:x?x.running?"ok":"warn":"neutral",pulse:x?.running===!0,to:"/processes"})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(mt,{to:"/domains?new=1",className:Yn("primary","sm"),children:[a.jsx(ra,{className:"size-3.5","aria-hidden":"true"}),"Add domain"]}),a.jsxs(mt,{to:"/ssl?new=1",className:Yn("secondary","sm"),children:[a.jsx(oa,{className:"size-3.5","aria-hidden":"true"}),"Issue certificate"]}),a.jsx(W,{variant:"secondary",size:"sm",loading:p,disabled:!y?.running,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:te,children:"Reload nginx"})]}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsxs(Qe,{className:"xl:col-span-2",children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-3 sm:px-5",children:[a.jsxs("div",{children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Domain health"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Backends are checked on connect and every 60 seconds."})]}),a.jsx(mt,{to:"/domains",className:"text-2xs font-medium text-muted hover:text-ink",children:"Manage"})]}),N.length===0?a.jsxs("div",{className:"flex flex-col items-center gap-3 px-5 py-10 text-center",children:[a.jsx(rs,{className:"size-5 text-faint","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"No domains yet"}),a.jsx("p",{className:"mt-1 text-xs text-muted",children:"Add a domain to put a backend behind nginx."})]}),a.jsx(mt,{to:"/domains?new=1",className:Yn("primary","sm"),children:"Add your first domain"})]}):a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full text-xs",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-line text-left text-2xs uppercase tracking-wider text-faint",children:[a.jsx("th",{className:"px-4 py-2 font-medium sm:px-5",children:"Domain"}),a.jsx("th",{className:"hidden px-3 py-2 font-medium sm:table-cell",children:"Target"}),a.jsx("th",{className:"px-3 py-2 font-medium",children:"Health"}),a.jsx("th",{className:"hidden px-3 py-2 font-medium md:table-cell",children:"Certificate"})]})}),a.jsx("tbody",{children:N.map(L=>{const Q=U.get(L.name);return a.jsxs("tr",{className:"border-b border-line/60 last:border-0 hover:bg-raised/40",children:[a.jsx("td",{className:"px-4 py-2.5 sm:px-5",children:a.jsxs(mt,{to:`/domains?domain=${encodeURIComponent(L.name)}`,className:"flex items-center gap-2 font-medium text-ink hover:text-accent-text",children:[a.jsx("span",{className:"truncate",children:L.name}),!L.enabled&&a.jsx(ge,{tone:"neutral",children:"Disabled"})]})}),a.jsxs("td",{className:"hidden px-3 py-2.5 font-mono text-2xs text-muted sm:table-cell",children:[L.backendHost,":",L.port]}),a.jsx("td",{className:"px-3 py-2.5",children:a.jsx(iS,{entry:Q})}),a.jsx("td",{className:"hidden px-3 py-2.5 text-2xs md:table-cell",children:L.ssl.enabled?L.daysLeft!==null?a.jsx(rS,{days:L.daysLeft}):a.jsx("span",{className:"text-muted",children:"Unknown"}):a.jsx("span",{className:"text-faint",children:"Not enabled"})})]},L.name)})})]})}),u===null&&N.length>0&&a.jsx("div",{className:"border-t border-line px-4 py-2 text-2xs text-faint sm:px-5",children:"Waiting for the first health check…"})]}),a.jsxs("div",{className:"space-y-4",children:[a.jsxs(Qe,{children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Needs attention"}),a.jsx("span",{className:"text-2xs text-faint",children:T.length})]}),T.length===0?a.jsxs("div",{className:"flex items-center gap-2.5 px-4 py-5 text-xs text-muted",children:[a.jsx(_s,{className:"size-4 text-ok","aria-hidden":"true"}),"Nothing needs attention right now."]}):a.jsx("div",{className:"max-h-[280px] overflow-y-auto",children:T.map(L=>a.jsxs(mt,{to:L.to,className:"group flex items-start gap-2.5 border-b border-line/60 px-4 py-2.5 last:border-0 hover:bg-raised/50",children:[a.jsx(Jt,{tone:L.tone,className:"mt-1"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:L.title}),a.jsx("div",{className:"mt-0.5 text-2xs text-muted",children:L.detail})]}),a.jsx(r2,{className:"mt-0.5 size-3.5 shrink-0 text-faint transition-transform group-hover:translate-x-0.5","aria-hidden":"true"})]},L.id))})]}),a.jsxs(Qe,{children:[a.jsxs("div",{className:"flex items-center justify-between border-b border-line px-4 py-3",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Recent events"}),a.jsx(mt,{to:"/notifications",className:"text-2xs font-medium text-muted hover:text-ink",children:"All events"})]}),d.length===0?a.jsx("div",{className:"px-4 py-5 text-xs text-muted",children:"No events since this tab opened. Alerts from nginx, certificates and domain health appear here live."}):a.jsx("div",{className:"event-timeline",children:d.slice(0,6).map(L=>{const{icon:Q,tone:re}=oS(L);return a.jsxs("div",{className:"flex items-start gap-2.5 border-b border-line/60 px-4 py-2.5 last:border-0",children:[a.jsx("span",{className:"relative z-10 mt-0.5 flex size-6 shrink-0 items-center justify-center rounded-full border border-line bg-raised",children:a.jsx(Q,{className:le("size-3",re),"aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"text-xs leading-snug text-ink",children:L.message}),a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:Pi(L.timestamp)})]})]},L.id)})})]})]})]})]}):a.jsxs(Ra,{children:[a.jsx(Ze,{className:"h-28 w-full rounded-lg"}),a.jsx("div",{className:"grid gap-3 sm:grid-cols-2 xl:grid-cols-4",children:[0,1,2,3].map(L=>a.jsx(Ze,{className:"h-[92px] rounded-lg"},L))}),a.jsxs("div",{className:"grid gap-4 xl:grid-cols-3",children:[a.jsx(Ze,{className:"h-64 rounded-lg xl:col-span-2"}),a.jsx(Ze,{className:"h-64 rounded-lg"})]})]})]})}function vf(l){if(!l||!l.trim())return"A domain name is required.";const c=(l.startsWith("*.")?l.slice(2):l).split(".");if(c.length<2)return"Use at least two labels, for example example.com.";const u=/^[a-zA-Z0-9]([a-zA-Z0-9-]*[a-zA-Z0-9])?$/;return c.some(d=>!d||!u.test(d))?"Use letters, digits and hyphens only; each label must start and end with a letter or digit.":null}function Po(l){const o=Number(l);return!Number.isInteger(o)||o<1||o>65535?"Port must be a whole number between 1 and 65535.":null}function By(l){return l&&(!l.includes("@")||l.trim()!==l)?"Enter a valid email address.":null}function uS(l){return l?/^\d+[kmgKMG]?$/.test(l)?null:"Use a size like 10m, 1g or 512k.":null}function Li(l,o){const c=Number(l);return!Number.isInteger(c)||c<1?`${o} must be a positive whole number.`:null}function yg(l,o){return l?l.length<o?`Use at least ${o} characters.`:null:"Enter a password."}const dS=2048,vg=/^[A-Za-z0-9._~-]{1,200}$/;function fS(l){if(!l)return"The Hub URL is missing.";if(l!==l.trim())return"The Hub URL must not have spaces around it.";if(l.includes("://")&&!/^https?:\/\//i.test(l))return"The Hub URL must use http or https.";const o=/^https?:\/\//i.test(l)?l:`https://${l}`;let c;try{c=new URL(o)}catch{return"The Hub URL is not valid."}return c.protocol!=="http:"&&c.protocol!=="https:"?"The Hub URL must use http or https.":c.hostname?c.username||c.password?"The Hub URL must not contain credentials.":null:"The Hub URL is missing a host."}function hS(l){const o=l.trim();if(!o)return"Paste the connection string the Hub gave you.";if(o.length>dS)return"That connection string is too long.";if(!o.toLowerCase().startsWith("ezops://"))return"The connection string must start with ezops://.";const c=o.slice(8).split("|");if(c.length!==3)return"Expected the form ezops://hubUrl|serverId|secret.";const[u,d,h]=c.map(m=>m.trim()),x=fS(u);return x||(d?h?vg.test(d)?vg.test(h)?null:"The secret has characters the Hub does not use.":"The server ID has characters the Hub does not use.":"The secret is missing.":"The server ID is missing.")}function mS(l){const o=document.activeElement,c=document.getSelection(),u=[];if(c)for(let x=0;x<c.rangeCount;x+=1)u.push(c.getRangeAt(x));const d=document.createElement("textarea");d.value=l,d.setAttribute("readonly",""),d.style.position="fixed",d.style.top="0",d.style.left="0",d.style.opacity="0",d.style.pointerEvents="none",document.body.appendChild(d);let h;try{d.select(),d.setSelectionRange(0,l.length),h=document.execCommand("copy")}catch{h=!1}finally{if(d.remove(),c){c.removeAllRanges();for(const x of u)c.addRange(x)}o?.focus({preventScroll:!0})}return h}async function xS(l){if(navigator.clipboard?.writeText)try{return await navigator.clipboard.writeText(l),!0}catch{}return mS(l)}function wt({value:l,label:o="Copy",withText:c=!1,className:u}){const[d,h]=g.useState("idle"),x=g.useRef(null),m=jt();g.useEffect(()=>()=>{x.current&&clearTimeout(x.current)},[]);const p=async()=>{const y=await xS(l);h(y?"copied":"failed"),y||m.error("Could not copy","The browser blocked clipboard access. Select the text and copy it manually."),x.current&&clearTimeout(x.current),x.current=setTimeout(()=>h("idle"),1600)},b=d==="copied"?a.jsx(uf,{className:"size-3.5 text-ok","aria-hidden":"true"}):d==="failed"?a.jsx(_l,{className:"size-3.5 text-bad","aria-hidden":"true"}):a.jsx(v2,{className:"size-3.5","aria-hidden":"true"}),j=d==="copied"?"Copied":d==="failed"?"Copy failed":o;return c?a.jsx(W,{size:"sm",variant:"secondary",icon:b,onClick:p,className:u,children:a.jsx("span",{"aria-live":"polite",children:j})}):a.jsx(at,{label:j,size:"sm",variant:"ghost",onClick:p,className:le(d==="copied"&&"text-ok",d==="failed"&&"text-bad",u),children:b})}const pS="text/plain text/css application/json application/javascript text/xml application/xml application/xml+rss text/javascript",qy=[{id:"domain_health",label:"Port / health check",description:"The backend stops answering its health check."},{id:"cert_expiry",label:"SSL / certificate expiry",description:"A certificate is expired or close to expiry."},{id:"nginx_down",label:"nginx stopped",description:"nginx itself is not serving requests."}],$y=()=>({domain_health:{enabled:!0,channelIds:[]},cert_expiry:{enabled:!0,channelIds:[]},nginx_down:{enabled:!0,channelIds:[]}});function gS(){return{name:"",port:3e3,backendHost:"127.0.0.1",upstreamType:"http",www:!1,wildcard:!1,enabled:!0,ssl:{enabled:!1,certPath:"",keyPath:"",redirect:!0,hsts:!1,hstsMaxAge:31536e3},performance:{maxBodySize:"10m",readTimeout:60,connectTimeout:10,proxyBuffers:!1,gzip:!0,gzipTypes:pS},security:{rateLimit:!1,rateLimitRate:10,rateLimitBurst:20,securityHeaders:!1,custom404:!1,custom50x:!1},advanced:{accessLog:!0,customLocations:""},notifications:$y()}}function yS(l){const o=$y();for(const c of qy){const u=l.notifications?.[c.id];u&&(o[c.id]={enabled:u.enabled,channelIds:[...u.channelIds??[]]})}return{name:l.name,port:l.port,backendHost:l.backendHost||"127.0.0.1",upstreamType:l.upstreamType||"http",www:l.www,wildcard:l.wildcard,enabled:l.enabled,ssl:{enabled:!!l.ssl?.enabled,certPath:l.ssl?.certPath??"",keyPath:l.ssl?.keyPath??"",redirect:l.ssl?.redirect??!0,hsts:l.ssl?.hsts??!1,hstsMaxAge:l.ssl?.hstsMaxAge||31536e3},performance:{...l.performance},security:{...l.security},advanced:{...l.advanced},notifications:o}}const bg={http:"HTTP",https:"HTTPS",ws:"WebSocket"};function Pd(l){return l.trim().replace(/^\*\./,"")}function vS(l){return"status"in l&&l.status==="waiting_dns"}function bS(l,o){const c={};if(o){const m=vf(Pd(l.name));m&&(c["domain-name"]=m)}if(l.backendHost.trim()||(c["backend-host"]="A backend host or URL is required."),!/^https?:\/\//i.test(l.backendHost.trim())){const m=Po(l.port);m&&(c["backend-port"]=m)}const d=uS(l.performance.maxBodySize);d&&(c["max-body"]=d);const h=Li(l.performance.readTimeout,"Read timeout");h&&(c["read-timeout"]=h);const x=Li(l.performance.connectTimeout,"Connect timeout");if(x&&(c["connect-timeout"]=x),l.ssl.enabled&&l.ssl.hsts){const m=Li(l.ssl.hstsMaxAge,"HSTS max-age");m&&(c["hsts-max-age"]=m)}if(l.security.rateLimit){const m=Li(l.security.rateLimitRate,"Rate");m&&(c["rate-limit-rate"]=m);const p=Li(l.security.rateLimitBurst,"Burst");p&&(c["rate-limit-burst"]=p)}return c}function jg(l){if(l instanceof Le){const o=l.payload.error;if(o&&typeof o=="object")return{message:"Certificate creation failed",detail:[o.step?`Step: ${o.step}`:"",o.cause?`Cause: ${o.cause}`:"",o.consequence?`Note: ${o.consequence}`:""].filter(Boolean).join(`
461
+ `)||"The certificate authority did not issue a certificate.",hint:"nginx is left as it was."};const c=l.code==="email_required"?"Set the ACME email in Settings → General, then try again.":typeof l.payload.hint=="string"?l.payload.hint:void 0;return{message:"Certificate creation failed",detail:(typeof l.payload.detail=="string"?l.payload.detail:typeof l.payload.output=="string"?l.payload.output:void 0)??l.message,hint:c}}return{message:"Certificate creation failed",detail:l instanceof Error?l.message:"The request could not be completed."}}function zl({id:l,title:o,description:c,icon:u,open:d,onToggle:h,children:x}){return a.jsxs("section",{className:"border-b border-line last:border-b-0",children:[a.jsx("h3",{children:a.jsxs("button",{type:"button","aria-expanded":d,"aria-controls":`section-${l}`,onClick:h,className:"group flex w-full items-center gap-3 px-5 py-3.5 text-left transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/50",children:[a.jsx("span",{className:"flex size-7 shrink-0 items-center justify-center rounded-md bg-inset text-muted transition-colors group-hover:text-ink",children:a.jsx(u,{className:"size-3.5","aria-hidden":"true"})}),a.jsxs("span",{className:"min-w-0 flex-1",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:o}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:c})]}),a.jsx(l2,{className:le("size-4 shrink-0 text-faint transition-transform duration-[var(--ez-motion-fast)]",d&&"rotate-180"),"aria-hidden":"true"})]})}),d&&a.jsx("div",{id:`section-${l}`,className:"px-5 pb-5 pt-1",children:x})]})}function jS({channel:l,checked:o,onChange:c}){return a.jsxs("label",{className:le("flex cursor-pointer items-center gap-2 rounded-md border px-2.5 py-1.5 text-xs transition-colors duration-[var(--ez-motion-fast)]",o?"border-accent/50 bg-accent-soft/50 text-ink":"border-line text-muted hover:border-line-strong hover:text-ink"),children:[a.jsx("input",{type:"checkbox",checked:o,onChange:u=>c(u.target.checked),className:"size-3.5 shrink-0 accent-[var(--ez-accent)]"}),a.jsx("span",{className:"font-medium",children:l.name}),a.jsx("span",{className:"text-2xs text-faint",children:l.type})]})}const Rl=l=>Number.isFinite(l)&&l!==0?l:"";function Ng({wildcard:l,certMethod:o,onMethodChange:c,certFailure:u,dnsPending:d,certAction:h,onCreate:x,onConfirmDns:m,onCancelDns:p,disabledReason:b,extraActions:j}){const y=h!==null;return a.jsxs("div",{className:"space-y-3",children:[u&&a.jsxs(ye,{tone:"danger",title:u.message,children:[u.hint&&a.jsx("div",{children:u.hint}),u.detail&&a.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:u.detail})]}),d?a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"Add this DNS TXT record, then continue"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:d.hint??"The certificate authority checks this record before issuing the certificate."})]}),a.jsxs("div",{className:"space-y-2 rounded-md border border-line bg-canvas p-3 font-mono text-2xs",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-sans text-2xs uppercase tracking-wider text-faint",children:"Name"}),a.jsx("div",{className:"mt-0.5 break-all text-ink",children:d.txtName})]}),a.jsx(wt,{value:d.txtName,label:"Copy record name"})]}),a.jsxs("div",{className:"flex items-center justify-between gap-2 border-t border-line pt-2",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"font-sans text-2xs uppercase tracking-wider text-faint",children:"Value"}),a.jsx("div",{className:"mt-0.5 break-all text-ink",children:d.txtValue})]}),a.jsx(wt,{value:d.txtValue,label:"Copy record value"})]})]}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(W,{variant:"primary",size:"sm",loading:h==="confirm",onClick:m,children:"I added the record, continue"}),a.jsx(W,{variant:"secondary",size:"sm",onClick:p,disabled:y,children:"Cancel issuance"})]})]}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("fieldset",{children:[a.jsx("legend",{className:"mb-2 text-xs font-medium text-muted",children:"Validation method"}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsxs("label",{className:le("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",o==="http"?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong",l&&"cursor-not-allowed opacity-50"),children:[a.jsx("input",{type:"radio",name:"cert-method",value:"http",checked:o==="http",disabled:l||y,onChange:()=>c("http"),className:"mt-0.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{children:[a.jsx("span",{className:"block font-medium text-ink",children:"HTTP challenge"}),a.jsx("span",{className:"block text-2xs text-faint",children:"DNS already points here"})]})]}),a.jsxs("label",{className:le("flex cursor-pointer items-start gap-2 rounded-md border px-3 py-2 text-xs",o==="dns"?"border-accent/50 bg-accent-soft/40":"border-line hover:border-line-strong"),children:[a.jsx("input",{type:"radio",name:"cert-method",value:"dns",checked:o==="dns",disabled:y,onChange:()=>c("dns"),className:"mt-0.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{children:[a.jsx("span",{className:"block font-medium text-ink",children:"DNS challenge"}),a.jsx("span",{className:"block text-2xs text-faint",children:"Add a TXT record"})]})]})]}),l&&a.jsx("p",{className:"mt-2 text-2xs text-warn",children:"Wildcard certificates require the DNS challenge."})]}),b&&a.jsx("p",{className:"text-2xs text-warn",children:b}),a.jsxs("div",{className:"flex flex-wrap gap-2",children:[a.jsx(W,{variant:"primary",size:"sm",loading:h==="issue",onClick:x,disabled:!!b,icon:a.jsx(oa,{className:"size-3.5","aria-hidden":"true"}),children:"Create certificate"}),j]})]})]})}function NS({editor:l,onClose:o,onSaved:c}){const u=l.mode==="edit"?l.domain:null,d=jt(),h=sn(),x=Xi(),m=g.useId(),[p,b]=g.useState(()=>u?yS(u):gS()),j=g.useRef(JSON.stringify(p)),y=JSON.stringify(p)!==j.current,[N,C]=g.useState(()=>u?{basic:!0,ssl:!0,performance:!0,security:!0,advanced:!0,notifications:!0}:{basic:!0,ssl:!0,performance:!1,security:!1,advanced:!1,notifications:!1}),[U,S]=g.useState({}),[k,E]=g.useState(null),[T,Y]=g.useState(!1),[z,D]=g.useState(null),[te,L]=g.useState("http"),[Q,re]=g.useState(null),[K,ae]=g.useState(null),[M,_]=g.useState(null),se=xt(X=>ie.settings.channels.list(X),[],{enabled:!!u}),F=xt(X=>ie.ssl.list(X),[],{enabled:p.ssl.enabled});g.useEffect(()=>{if(!y)return;const X=pe=>{pe.preventDefault(),pe.returnValue=""};return window.addEventListener("beforeunload",X),()=>window.removeEventListener("beforeunload",X)},[y]),g.useEffect(()=>{z&&p.wildcard&&L("dns")},[z,p.wildcard]);const ne=/^https?:\/\//i.test(p.backendHost.trim()),fe=u?u.name:Pd(p.name),V=vf(fe),ce=p.ssl.certPath.trim()===""&&p.ssl.keyPath.trim()==="",Se=F.data?.some(X=>X.domain===fe)??!1,ke=p.ssl.enabled&&ce&&!F.loading&&!Se&&!z;function Ve(X,pe){b(Ae=>({...Ae,[X]:pe}))}function $e(X,pe){b(Ae=>({...Ae,ssl:{...Ae.ssl,[X]:pe}}))}function R(X,pe){b(Ae=>({...Ae,performance:{...Ae.performance,[X]:pe}}))}function I(X,pe){b(Ae=>({...Ae,security:{...Ae.security,[X]:pe}}))}function J(X,pe){b(Ae=>({...Ae,advanced:{...Ae.advanced,[X]:pe}}))}function ee(X,pe){b(Ae=>({...Ae,notifications:{...Ae.notifications,[X]:{...Ae.notifications[X],...pe}}}))}function Ne(X,pe,Ae){b(Ft=>{const kt=Ft.notifications[X],We=Ae?Array.from(new Set([...kt.channelIds,pe])):kt.channelIds.filter(cs=>cs!==pe);return{...Ft,notifications:{...Ft.notifications,[X]:{...kt,channelIds:We}}}})}const Ce=X=>C(pe=>({...pe,[X]:!0})),De=X=>({...p,...X,ssl:{...p.ssl,...X?.ssl??{}},name:u?u.name:Pd(p.name)}),he=X=>{const pe=bS(X,!u);if(Object.keys(pe).length===0)return!0;S(pe),E({message:"Check the highlighted fields before saving."}),(pe["domain-name"]||pe["backend-host"]||pe["backend-port"])&&Ce("basic"),(pe["max-body"]||pe["read-timeout"]||pe["connect-timeout"])&&Ce("performance"),(pe["rate-limit-rate"]||pe["rate-limit-burst"])&&Ce("security"),pe["hsts-max-age"]&&Ce("ssl");const Ae=Object.keys(pe)[0];return queueMicrotask(()=>document.getElementById(Ae)?.focus()),!1},be=async X=>{const pe=De(X);if(!he(pe))return;const Ae=u?.name??pe.name;S({}),E(null),Y(!0);let Ft;try{Ft=u?await ie.domains.update(u.name,pe):await ie.domains.create(pe)}catch(kt){const We=kt instanceof Le?kt:null;if(!We){D(null),ae(null),re(null),d.warning("The dashboard’s reply could not be read","The domain list was reloaded. Check that the change is there before saving again."),c();return}We.status===422&&We.code==="cert_missing"?(D({certPath:typeof We.payload.certPath=="string"?We.payload.certPath:"",keyPath:typeof We.payload.keyPath=="string"?We.payload.keyPath:"",hint:typeof We.payload.hint=="string"?We.payload.hint:"The SSL certificate files do not exist at the configured paths."}),re(null),ae(null),E(null),L(p.wildcard?"dns":"http"),Ce("ssl")):We.status===0?(E({message:"The dashboard did not answer.",detail:We.message,hint:"Saving may still have worked: check the domain list before trying again."}),d.error("The dashboard did not answer","The change may already have been saved.")):(E({message:We.message??"The domain could not be saved.",detail:typeof We.payload.detail=="string"?We.payload.detail:typeof We.payload.output=="string"?We.payload.output:void 0,hint:typeof We.payload.hint=="string"?We.payload.hint:void 0}),d.error("Could not save the domain",We.message??void 0));return}finally{Y(!1)}D(null),ae(null),re(null),d.success(u?"Domain saved":"Domain created",u?`${Ft?.name??Ae} was updated and its nginx config regenerated.`:`${Ft?.name??Ae} is configured; nginx will start serving it on the next reload.`),c()},$t=async()=>{if(he(De({ssl:{...p.ssl,enabled:!0}}))){_("issue"),re(null);try{const X=await ie.ssl.create({domain:fe,www:p.www,validationMethod:p.wildcard?"dns":te});if(vS(X)){ae(X);return}const pe={...p.ssl,enabled:!0,certPath:X.certPath,keyPath:X.keyPath};b(Ae=>({...Ae,ssl:pe})),D(null),ae(null),await be({ssl:pe})}catch(X){re(jg(X))}finally{_(null)}}},Zn=async()=>{if(K){_("confirm"),re(null);try{const X=await ie.ssl.confirmDns(K.domain),pe={...p.ssl,enabled:!0,certPath:X.certPath,keyPath:X.keyPath};b(Ae=>({...Ae,ssl:pe})),ae(null),D(null),await be({ssl:pe})}catch(X){re(jg(X)),ae(null)}finally{_(null)}}},ln=async()=>{if(K){_("confirm");try{await ie.ssl.cancelDns(K.domain),d.info("DNS challenge cancelled","No certificate was requested.")}catch{d.warning("Could not cancel the DNS challenge")}finally{ae(null),_(null)}}},Gt=()=>{const X={...p.ssl,enabled:!1};b(pe=>({...pe,ssl:X})),D(null),re(null),ae(null),be({ssl:X})},rt=()=>{D(null),re(null),ae(null)},Ue=T||M!==null,Ut=async()=>y?h({title:"Discard changes?",body:"The changes to this domain have not been saved.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}):!0,Nn=()=>{K&&ie.ssl.cancelDns(K.domain).catch(()=>{})},Pt=async()=>{Ue||await Ut()&&(Nn(),o())},fa=g.useRef(Pt);fa.current=Pt;const Kn=g.useCallback(()=>{fa.current()},[]),rn=async()=>{Ue||await Ut()&&(Nn(),o(),x("/settings"))};return a.jsxs(bn,{open:!0,onClose:Kn,title:u?`Edit ${u.name}`:"New domain",description:"Changes are written to nginx, tested, and rolled back automatically if nginx rejects them.",size:"xl",preventClose:Ue,bodyClassName:"px-0 py-0",footer:a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"mr-auto hidden text-2xs text-faint sm:block",children:u?"The domain name cannot change after creation.":"The domain is enabled as soon as it is created."}),a.jsx(W,{variant:"ghost",onClick:Kn,disabled:Ue,children:"Cancel"}),a.jsx(W,{variant:"primary",type:"submit",form:m,loading:T,disabled:M!==null,children:u?"Save changes":"Create domain"})]}),children:[(k||z)&&a.jsxs("div",{className:"space-y-3 border-b border-line px-5 py-4",children:[k&&!z&&a.jsxs(ye,{tone:"danger",title:k.message,children:[k.hint&&a.jsx("div",{children:k.hint}),k.detail&&a.jsx("pre",{className:"mt-2 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:k.detail})]}),z&&a.jsxs(a.Fragment,{children:[a.jsx(ye,{tone:"warning",title:"SSL certificate not found",action:a.jsx(W,{variant:"ghost",size:"sm",onClick:rt,disabled:Ue,children:"Keep editing"}),children:a.jsxs("div",{className:"space-y-1",children:[a.jsx("div",{className:"break-all font-mono text-2xs",children:z.certPath||z.keyPath}),a.jsx("div",{children:z.hint}),a.jsx("div",{children:"Issue a certificate now, disable SSL for this domain, or point the paths at files that already exist."})]})}),a.jsx("div",{className:"rounded-md border border-line bg-raised/40 p-3",children:a.jsx(Ng,{wildcard:p.wildcard,certMethod:te,onMethodChange:L,certFailure:Q,dnsPending:K,certAction:M,onCreate:$t,onConfirmDns:Zn,onCancelDns:ln,extraActions:a.jsx(W,{variant:"dangerGhost",size:"sm",onClick:Gt,disabled:M!==null,children:"Disable SSL and save"})})})]})]}),a.jsxs("form",{id:m,onSubmit:X=>{X.preventDefault(),Ue||be()},children:[a.jsx(zl,{id:"basic",title:"Basic configuration",description:"What nginx serves and where traffic goes.",icon:rs,open:N.basic??!1,onToggle:()=>C(X=>({...X,basic:!X.basic})),children:a.jsxs(Ea,{children:[a.jsx(Ee,{id:"domain-name",className:"sm:col-span-2",label:"Domain name",placeholder:"api.example.com",value:p.name,disabled:!!u,onChange:X=>Ve("name",X.target.value),error:U["domain-name"],hint:p.wildcard?"Enter the bare domain — the *. prefix is added automatically.":u?"The domain name cannot be changed after creation.":void 0,autoComplete:"off",spellCheck:!1}),a.jsx(Ee,{id:"backend-host",className:"sm:col-span-2",label:"Backend host or URL",placeholder:"127.0.0.1 or https://app.vercel.app",value:p.backendHost,onChange:X=>Ve("backendHost",X.target.value),error:U["backend-host"],hint:"A host and port, or a full http(s) URL to proxy to.",autoComplete:"off",spellCheck:!1}),a.jsx(Ee,{id:"backend-port",label:"Backend port",type:"number",inputMode:"numeric",min:1,max:65535,value:Rl(p.port),disabled:ne,onChange:X=>Ve("port",Number(X.target.value)),error:U["backend-port"],hint:ne?"Taken from the URL.":void 0}),a.jsx(os,{label:"Upstream type",value:p.upstreamType,onChange:X=>Ve("upstreamType",X.target.value),children:Object.keys(bg).map(X=>a.jsx("option",{value:X,children:bg[X]},X))}),a.jsxs("div",{className:"sm:col-span-2 space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(qt,{checked:p.wildcard,onChange:X=>b(pe=>({...pe,wildcard:X,www:X?!1:pe.www})),label:"Wildcard domain",description:"Serve *.example.com. Requires a DNS-01 certificate."}),!p.wildcard&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(qt,{checked:p.www,onChange:X=>Ve("www",X),label:"Include www subdomain",description:"Adds www.example.com to server_name."})})]})]})}),a.jsx(zl,{id:"ssl",title:"SSL",description:"Serve this domain over HTTPS.",icon:oa,open:N.ssl??!1,onToggle:()=>C(X=>({...X,ssl:!X.ssl})),children:a.jsxs("div",{className:"space-y-4",children:[p.ssl.enabled?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(Ee,{label:"Certificate path",value:p.ssl.certPath,onChange:X=>$e("certPath",X.target.value),placeholder:"fullchain.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"}),a.jsx(Ee,{label:"Private key path",value:p.ssl.keyPath,onChange:X=>$e("keyPath",X.target.value),placeholder:"privkey.pem",hint:"Leave blank to use the dashboard's certificate directory.",autoComplete:"off",spellCheck:!1,className:"font-mono"})]}),ke&&a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-sm font-medium text-ink",children:"No certificate paths set"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Create a certificate for ",fe||"this domain"," now. On success, the certificate and key paths are filled in automatically."]})]}),a.jsx(Ng,{wildcard:p.wildcard,certMethod:te,onMethodChange:L,certFailure:Q,dnsPending:K,certAction:M,onCreate:$t,onConfirmDns:Zn,onCancelDns:ln,disabledReason:fe?V??null:"Enter the domain name above to create a certificate."})]}),a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(qt,{checked:p.ssl.redirect,onChange:X=>$e("redirect",X),label:"Redirect HTTP to HTTPS",description:"Port 80 requests are sent to the HTTPS address."}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(qt,{checked:p.ssl.hsts,onChange:X=>$e("hsts",X),label:"Enable HSTS",description:"Tells browsers to use HTTPS for this domain only."})}),p.ssl.hsts&&a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(Ee,{id:"hsts-max-age",label:"HSTS max-age",type:"number",inputMode:"numeric",min:1,value:Rl(p.ssl.hstsMaxAge),onChange:X=>$e("hstsMaxAge",Number(X.target.value)),error:U["hsts-max-age"],hint:"Seconds. 31536000 is one year.",className:"max-w-56"})})]})]}):a.jsx(qt,{checked:p.ssl.enabled,onChange:X=>$e("enabled",X),label:"Enable SSL / HTTPS",description:"Adds a 443 server block with the certificate below."}),p.ssl.enabled&&a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(Aa,{className:"mt-0.5 size-3.5 shrink-0 text-warn","aria-hidden":"true"}),a.jsx("span",{children:"The certificate files must exist before this domain can be saved. If they are missing, you will be offered to issue one."})]})]})}),a.jsx(zl,{id:"performance",title:"Performance",description:"Request limits, timeouts and compression.",icon:A2,open:N.performance??!1,onToggle:()=>C(X=>({...X,performance:!X.performance})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsxs("div",{className:"grid gap-4 sm:grid-cols-3",children:[a.jsx(Ee,{id:"max-body",label:"Max body size",value:p.performance.maxBodySize,onChange:X=>R("maxBodySize",X.target.value),error:U["max-body"],placeholder:"10m",hint:"For uploads: 10m, 512k or 1g.",autoComplete:"off"}),a.jsx(Ee,{id:"read-timeout",label:"Read timeout",type:"number",inputMode:"numeric",min:1,value:Rl(p.performance.readTimeout),onChange:X=>R("readTimeout",Number(X.target.value)),error:U["read-timeout"],hint:"Seconds."}),a.jsx(Ee,{id:"connect-timeout",label:"Connect timeout",type:"number",inputMode:"numeric",min:1,value:Rl(p.performance.connectTimeout),onChange:X=>R("connectTimeout",Number(X.target.value)),error:U["connect-timeout"],hint:"Seconds."})]}),a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(qt,{checked:p.performance.proxyBuffers,onChange:X=>R("proxyBuffers",X),label:"Proxy buffering",description:"Buffer upstream responses on disk for slow clients."}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(qt,{checked:p.performance.gzip,onChange:X=>R("gzip",X),label:"Gzip compression",description:"Compress text responses before sending them."})}),p.performance.gzip&&a.jsxs("div",{className:"border-t border-line pt-3",children:[a.jsx(Bo,{label:"Gzip MIME types",value:p.performance.gzipTypes,onChange:X=>R("gzipTypes",X.target.value),rows:3,spellCheck:!1,className:"font-mono"}),a.jsx(Ls,{children:"Space-separated list of content types."})]})]})]})}),a.jsx(zl,{id:"security",title:"Security",description:"Rate limiting and response headers.",icon:df,open:N.security??!1,onToggle:()=>C(X=>({...X,security:!X.security})),children:a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(qt,{checked:p.security.rateLimit,onChange:X=>I("rateLimit",X),label:"Rate limiting",description:"Limit requests per IP address."}),p.security.rateLimit&&a.jsxs("div",{className:"grid gap-4 border-t border-line pt-3 sm:grid-cols-2",children:[a.jsx(Ee,{id:"rate-limit-rate",label:"Requests per second",type:"number",inputMode:"numeric",min:1,value:Rl(p.security.rateLimitRate),onChange:X=>I("rateLimitRate",Number(X.target.value)),error:U["rate-limit-rate"]}),a.jsx(Ee,{id:"rate-limit-burst",label:"Burst",type:"number",inputMode:"numeric",min:1,value:Rl(p.security.rateLimitBurst),onChange:X=>I("rateLimitBurst",Number(X.target.value)),error:U["rate-limit-burst"],hint:"Requests allowed to exceed the rate briefly."})]}),a.jsx("div",{className:"border-t border-line pt-3",children:a.jsx(qt,{checked:p.security.securityHeaders,onChange:X=>I("securityHeaders",X),label:"Security headers",description:"Adds X-Frame-Options and X-Content-Type-Options."})}),a.jsxs("div",{className:"grid gap-3 border-t border-line pt-3 sm:grid-cols-2",children:[a.jsx(qt,{checked:p.security.custom404,onChange:X=>I("custom404",X),label:"Custom 404 form",description:"Return the dashboard's 404 page."}),a.jsx(qt,{checked:p.security.custom50x,onChange:X=>I("custom50x",X),label:"Custom 50x page",description:"Return the dashboard's error page when the backend fails."})]})]})}),a.jsx(zl,{id:"advanced",title:"Advanced",description:"Raw nginx additions for this domain.",icon:x2,open:N.advanced??!1,onToggle:()=>C(X=>({...X,advanced:!X.advanced})),children:a.jsxs("div",{className:"space-y-4",children:[a.jsx(qt,{checked:p.advanced.accessLog,onChange:X=>J("accessLog",X),label:"Domain-specific access log",description:"Writes this domain's requests to its own log file."}),a.jsx(Bo,{label:"Custom location blocks",value:p.advanced.customLocations,onChange:X=>J("customLocations",X.target.value),rows:6,spellCheck:!1,placeholder:`location /api/v2 {
462
+ proxy_pass http://localhost:8080;
463
+ }`,className:"font-mono"}),a.jsx(Ls,{children:"Appended verbatim inside the server block. nginx tests the result before it is kept."})]})}),u&&a.jsx(zl,{id:"notifications",title:"Notifications",description:"Which channels hear about this domain.",icon:cf,open:N.notifications??!1,onToggle:()=>C(X=>({...X,notifications:!X.notifications})),children:se.loading&&!se.data?a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ze,{className:"h-14 rounded-md"}),a.jsx(Ze,{className:"h-14 rounded-md"}),a.jsx(Ze,{className:"h-14 rounded-md"})]}):se.error&&!se.data?a.jsx(ye,{tone:"warning",title:"Could not load notification channels",action:a.jsx(W,{variant:"ghost",size:"sm",onClick:se.reload,children:"Retry"}),children:se.error.message}):(se.data??[]).length===0?a.jsxs(ye,{tone:"info",title:"No notification channels configured",children:["Add a Discord or Telegram channel in Settings first; this domain's alerts are recorded either way.",a.jsx("div",{className:"mt-2",children:a.jsx(W,{variant:"secondary",size:"sm",icon:a.jsx(mf,{className:"size-3.5","aria-hidden":"true"}),onClick:rn,children:"Open settings"})})]}):a.jsx("div",{className:"space-y-3",children:qy.map(X=>{const pe=p.notifications[X.id];return a.jsxs("div",{className:"rounded-md border border-line bg-raised/30 p-3.5",children:[a.jsx(qt,{checked:pe.enabled,onChange:Ae=>ee(X.id,{enabled:Ae}),label:X.label,description:X.description}),pe.enabled&&a.jsx("div",{className:"mt-3 flex flex-wrap gap-1.5 border-t border-line pt-3",children:(se.data??[]).map(Ae=>a.jsx(jS,{channel:Ae,checked:pe.channelIds.includes(Ae.id),onChange:Ft=>Ne(X.id,Ae.id,Ft)},Ae.id))}),pe.enabled&&pe.channelIds.length===0&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"No channels selected — the event is recorded but not delivered."})]},X.id)})})})]})]})}function wS(l){return/^https?:\/\//i.test(l.backendHost||"")?l.backendHost:`${l.upstreamType||"http"}://${l.backendHost||"127.0.0.1"}:${l.port}`}function SS({domain:l}){if(!l.ssl?.enabled)return a.jsx(ge,{tone:"neutral",children:"HTTP only"});const o=l.daysLeft;return o==null?a.jsx(ge,{tone:"neutral",children:"SSL"}):o<0?a.jsx(ge,{tone:"bad",children:"SSL expired"}):o<30?a.jsx(ge,{tone:"warn",children:Ol(o)}):a.jsx(ge,{tone:"ok",children:Ol(o)})}function kS({entry:l}){return l?l.up===null?a.jsx(ge,{tone:"neutral",dot:!0,children:"External"}):l.up?a.jsx(ge,{tone:"ok",dot:!0,children:"Up"}):a.jsx(ge,{tone:"bad",dot:!0,children:"Down"}):null}function TS(){Xn("Domains");const l=jt(),o=sn(),{domainHealth:c}=ua(),u=xt(V=>ie.domains.list(V)),[d,h]=Xo(),[x,m]=g.useState(""),[p,b]=g.useState("all"),[j,y]=g.useState(null),[N,C]=g.useState(null),[U,S]=g.useState(!1),[k,E]=g.useState(!1);Bs(u.reload),Bl("domains",u.reload);const T=u.data,Y=g.useMemo(()=>new Map((c??[]).map(V=>[V.name,V])),[c]),z=d.get("new")==="1",D=d.get("domain"),te=D?(T??[]).find(V=>V.name===D):void 0,L=z?{mode:"create"}:te?{mode:"edit",domain:te}:null,Q=g.useRef(null);g.useEffect(()=>{if(!T||!D){Q.current=null;return}if(te){Q.current=null;return}Q.current!==D&&(Q.current=D,l.error("Domain not found",D),h({},{replace:!0}))},[T,D,te,h,l]);const re=()=>h({new:"1"}),K=V=>h({domain:V}),ae=()=>h({},{replace:!0}),M=g.useMemo(()=>{const V=T??[];return{all:V.length,enabled:V.filter(ce=>ce.enabled).length,disabled:V.filter(ce=>!ce.enabled).length}},[T]),_=g.useMemo(()=>{const V=x.trim().toLowerCase();return(T??[]).filter(ce=>p==="enabled"&&!ce.enabled||p==="disabled"&&ce.enabled?!1:V?[ce.name,ce.backendHost,String(ce.port)].join(" ").toLowerCase().includes(V):!0)},[T,p,x]),se=async V=>{const ce=!V.enabled;if(await o({title:`${ce?"Enable":"Disable"} "${V.name}"?`,body:ce?"nginx resumes serving this domain with its saved configuration.":"nginx stops serving this domain until you enable it again. The config file is kept.",confirmLabel:ce?"Enable":"Disable",tone:ce?"accent":"danger"})){y({name:V.name,action:"toggle"});try{const ke=await ie.domains.toggle(V.name);u.setData(Ve=>Ve&&Ve.map($e=>$e.name===V.name?{...$e,enabled:ke.enabled}:$e)),l.success(ke.enabled?"Domain enabled":"Domain disabled",ke.enabled?`${V.name} is being served again.`:`${V.name} is no longer served by nginx.`)}catch(ke){l.error(`Could not ${ce?"enable":"disable"} the domain`,ke instanceof Le?ke.message:void 0)}finally{y(null)}}},F=async V=>{y({name:V.name,action:"reload"});try{const ce=await ie.domains.reload(V.name);l.success("nginx reloaded",ce.message||`${V.name} is live with its current configuration.`)}catch(ce){l.error("Could not reload nginx",ce instanceof Le?ce.message:void 0)}finally{y(null)}},ne=V=>{S(!1),C(V)},fe=async()=>{if(N){E(!0);try{const V=await ie.domains.remove(N.name,N.ssl.enabled&&U);l.success("Domain deleted",V.certDeleted?`${N.name}, its nginx config and its certificate files were removed.`:`${N.name} and its nginx config were removed. The certificate files were kept.`),C(null),u.reload()}catch(V){l.error("Could not delete the domain",V instanceof Le?V.message:void 0)}finally{E(!1)}}};return a.jsxs(a.Fragment,{children:[a.jsx(da,{title:"Domains",description:"Reverse-proxy hosts, their backends and their nginx configuration.",meta:T?a.jsxs("span",{className:"text-2xs text-faint",children:[M.all," total · ",M.enabled," enabled"]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"secondary",size:"sm",loading:u.loading,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:u.reload,children:"Refresh"}),a.jsx(W,{variant:"primary",size:"sm",icon:a.jsx(ra,{className:"size-3.5","aria-hidden":"true"}),onClick:re,children:"Add domain"})]})}),u.error&&!T?a.jsx(St,{error:u.error,onRetry:u.reload}):T?T.length===0?a.jsx(Qe,{children:a.jsx(Vn,{icon:a.jsx(rs,{className:"size-5","aria-hidden":"true"}),title:"No domains yet",description:"Add a domain and Easy DevOps writes its nginx config, tests it, and reloads nginx.",action:a.jsx(W,{variant:"primary",size:"sm",icon:a.jsx(ra,{className:"size-3.5","aria-hidden":"true"}),onClick:re,children:"Add your first domain"})})}):a.jsxs("div",{className:"space-y-3",children:[u.error&&a.jsxs("div",{className:"rounded-md border border-warn/30 bg-warn-soft px-3.5 py-2.5 text-xs text-muted",children:["Showing the last known list. ",u.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:u.reload,children:"Try again"})]}),a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-col gap-3 border-b border-line p-3 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"relative w-full sm:max-w-xs",children:[a.jsx(bN,{className:"pointer-events-none absolute left-2.5 top-1/2 size-3.5 -translate-y-1/2 text-faint","aria-hidden":"true"}),a.jsx("input",{type:"search","aria-label":"Search domains",placeholder:"Search domain or backend…",value:x,onChange:V=>m(V.target.value),className:"h-9 w-full rounded-md border border-line bg-canvas pl-8 pr-3 text-sm text-ink placeholder:text-faint transition-colors duration-[var(--ez-motion-fast)] hover:border-line-strong focus:border-accent focus:outline-none focus:ring-2 focus:ring-accent/25"})]}),a.jsx("div",{role:"group","aria-label":"Filter domains",className:"flex flex-wrap gap-1.5",children:[["all","All",M.all],["enabled","Enabled",M.enabled],["disabled","Disabled",M.disabled]].map(([V,ce,Se])=>a.jsxs("button",{type:"button","aria-pressed":p===V,onClick:()=>b(V),className:le("inline-flex items-center gap-1.5 rounded-pill border px-2.5 py-1 text-xs transition-colors duration-[var(--ez-motion-fast)]",p===V?"border-accent/50 bg-accent-soft text-accent-text":"border-line text-muted hover:border-line-strong hover:text-ink"),children:[ce,a.jsx("span",{className:le("rounded-pill px-1 text-2xs",p===V?"bg-accent/15":"bg-inset text-faint"),children:Se})]},V))})]}),_.length===0?a.jsx(Vn,{title:"No domains match",description:"Try a different search or show all domains.",action:a.jsx(W,{variant:"secondary",size:"sm",onClick:()=>{m(""),b("all")},children:"Clear filters"})}):a.jsx("ul",{className:"divide-y divide-line",children:_.map(V=>{const ce=Y.get(V.name),Se=ce?.up===!1,ke=j?.name===V.name,Ve=ke?j?.action:null;return a.jsxs("li",{className:le("group flex flex-col gap-2.5 px-4 py-3 transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/40 sm:flex-row sm:items-center sm:gap-4",!V.enabled&&"opacity-60"),children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[a.jsx(Jt,{tone:V.enabled?Se?"bad":"ok":"neutral",pulse:V.enabled&&!Se,className:"mt-1.5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[a.jsx("button",{type:"button",onClick:()=>K(V.name),className:"max-w-full truncate text-left font-mono text-sm font-semibold text-ink transition-colors hover:text-accent-text",children:V.name}),V.wildcard&&a.jsx(ge,{tone:"accent",children:"wildcard"}),V.www&&a.jsx(ge,{tone:"neutral",children:"www"}),!V.enabled&&a.jsx(ge,{tone:"neutral",children:"disabled"}),V.sslPathWarning&&a.jsx("span",{className:"inline-flex",title:"Certificate paths contain backslashes, which nginx on Windows can fail to load. Open and save this domain to regenerate them with forward slashes.",children:a.jsxs(ge,{tone:"warn",children:[a.jsx(Aa,{className:"size-3","aria-hidden":"true"}),"Backslash cert paths"]})})]}),a.jsxs("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-muted",children:[a.jsx("span",{className:"max-w-full truncate font-mono",children:wS(V)}),V.ssl.enabled&&V.ssl.redirect&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{children:"HTTP redirects to HTTPS"})]})]})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pl-7 sm:w-52 sm:shrink-0 sm:pl-0",children:[a.jsx(SS,{domain:V}),a.jsx(kS,{entry:ce})]}),a.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-1 pl-7 sm:pl-0",children:[a.jsx(at,{label:V.enabled?`Disable ${V.name}`:`Enable ${V.name}`,size:"sm",disabled:ke,onClick:()=>se(V),className:"text-muted hover:text-ink",children:Ve==="toggle"?a.jsx(ia,{className:"spin size-3.5","aria-hidden":"true"}):V.enabled?a.jsx(cN,{className:"size-3.5","aria-hidden":"true"}):a.jsx(dN,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(at,{label:`Reload nginx for ${V.name}`,size:"sm",disabled:ke,onClick:()=>F(V),className:"text-muted hover:text-ink",children:Ve==="reload"?a.jsx(ia,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(bt,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(at,{label:`Edit ${V.name}`,size:"sm",onClick:()=>K(V.name),className:"text-muted hover:text-accent-text",children:a.jsx(ff,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(at,{label:`Delete ${V.name}`,size:"sm",onClick:()=>ne(V),className:"text-muted hover:text-bad",children:a.jsx(Hs,{className:"size-3.5","aria-hidden":"true"})})]})]},V.name)})})]})]}):a.jsxs(Ra,{children:[a.jsx(Ze,{className:"h-14 rounded-lg"}),a.jsx(Ze,{className:"h-[320px] rounded-lg"})]}),L&&a.jsx(NS,{editor:L,onClose:ae,onSaved:()=>{ae(),u.reload()}},L.mode==="edit"?`edit:${L.domain.name}`:"create"),a.jsx(bn,{open:N!==null,onClose:()=>{k||C(null)},title:N?`Delete "${N.name}"?`:"Delete domain",description:"This also removes the domain's nginx config. It cannot be undone.",size:"sm",preventClose:k,footer:a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"ghost",onClick:()=>C(null),disabled:k,children:"Cancel"}),a.jsx(W,{variant:"danger",loading:k,onClick:fe,children:"Delete domain"})]}),children:N&&a.jsxs("div",{className:"space-y-4",children:[a.jsxs("p",{className:"text-sm text-muted",children:["nginx stops serving ",a.jsx("span",{className:"font-mono text-ink",children:N.name})," ","as soon as the config is removed."]}),N.ssl.enabled&&a.jsx("div",{className:"rounded-md border border-line bg-raised/40 p-3",children:a.jsx(is,{checked:U,onChange:S,label:"Also delete the SSL certificate files",hint:`Otherwise ${N.name}'s certificate stays on disk and can be reused.`})})]})})]})}function CS(l,o){if(l instanceof Le){const c=l.payload.error;if(c&&typeof c=="object")return{title:o,step:c.step,cause:c.cause,consequence:c.consequence,nginxRunning:c.nginxRunning};const u=l.code==="email_required"?"Set the ACME email in Settings → General, or provide an email with this request.":typeof l.payload.hint=="string"?l.payload.hint:void 0,d=typeof l.payload.detail=="string"?l.payload.detail:typeof l.payload.output=="string"?l.payload.output:l.message;return{title:o,summary:u,detail:d}}if(l&&typeof l=="object"){const c=l;return{title:c.step==="email configuration"?"ACME email is not configured":o,step:c.step,cause:c.cause,consequence:c.consequence,nginxRunning:c.nginxRunning}}return typeof l=="string"&&l?{title:o,detail:l}:{title:o,summary:"No certificate was issued."}}function Gy(l){return l==null?"unknown":l<1e3?`${Math.round(l)} ms`:l<6e4?`${(l/1e3).toFixed(1)} s`:`${Math.round(l/6e4)} min`}function ES(l){return l?l==="proxy"?"The HTTP-01 challenge was answered through nginx, so nginx stayed running.":l==="standalone"?"The challenge ran in standalone mode.":l==="dns"?"Validated with a DNS TXT record.":`Validation mode: ${l}.`:null}function Fd({value:l,title:o="Certificate issuance failed"}){const c=CS(l,o),u=!!(c.step||c.cause||c.consequence);return a.jsxs(ye,{tone:"danger",title:c.title,children:[c.summary&&a.jsx("p",{children:c.summary}),u&&a.jsxs("dl",{className:"mt-2 grid grid-cols-[auto_1fr] gap-x-3 gap-y-1 text-2xs",children:[c.step&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Step"}),a.jsx("dd",{className:"text-muted",children:c.step})]}),c.cause&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Cause"}),a.jsx("dd",{className:"text-muted",children:c.cause})]}),c.consequence&&a.jsxs(a.Fragment,{children:[a.jsx("dt",{className:"text-faint",children:"Note"}),a.jsx("dd",{className:"text-muted",children:c.consequence})]})]}),c.nginxRunning===!1&&a.jsx("p",{className:"mt-2 text-2xs",children:"nginx is not running right now."}),c.detail&&a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:c.detail})]})}function zS({result:l,title:o="Certificate issued"}){const c=ES(l.mode);return a.jsxs("div",{className:"rounded-md border border-ok/30 bg-ok-soft/40 px-3.5 py-3",children:[a.jsxs("div",{className:"flex items-center gap-2 text-sm font-medium text-ink",children:[a.jsx(_s,{className:"size-4 shrink-0 text-ok","aria-hidden":"true"}),o]}),l.summary&&a.jsx("p",{className:"mt-1 text-xs text-muted",children:l.summary}),l.fellBack&&a.jsxs(ye,{tone:"warning",className:"mt-2.5",children:["The HTTP challenge could not be answered through nginx, so the standalone challenge was used. nginx was stopped for ",Gy(l.nginxDownMs),"."]}),l.staging&&a.jsx(ye,{tone:"warning",className:"mt-2.5",children:"This is a staging certificate. Browsers will not trust it; issue again against production before relying on it."}),a.jsxs("dl",{className:"mt-2.5 space-y-1.5",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Certificate"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-2xs text-muted",children:l.certPath}),a.jsx(wt,{value:l.certPath,label:"Copy certificate path"})]}),a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Private key"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-2xs text-muted",children:l.keyPath}),a.jsx(wt,{value:l.keyPath,label:"Copy private key path"})]})]}),c&&a.jsx("p",{className:"mt-2 text-2xs text-faint",children:c})]})}const wg="ssl-known-domains";function RS(l){return"status"in l&&l.status==="waiting_dns"}function AS({error:l}){const o=Array.isArray(l.payload.found)?l.payload.found.filter(u=>typeof u=="string"):[],c=typeof l.payload.hint=="string"?l.payload.hint:l.message;return a.jsxs(ye,{tone:"warning",title:"The TXT record was not found yet",children:[a.jsx("p",{children:c}),o.length>0&&a.jsxs("p",{className:"mt-1.5 break-all",children:["Records currently visible:"," ",a.jsx("span",{className:"font-mono text-ink",children:o.join(" · ")})]})]})}function DS({domains:l,initialDomain:o="",onClose:c,onIssued:u}){const d=jt(),h=sn(),x=Xi(),[m,p]=g.useState(o),[b,j]=g.useState(""),[y,N]=g.useState(!1),[C,U]=g.useState("http"),[S,k]=g.useState("form"),[E,T]=g.useState({}),[Y,z]=g.useState(null),[D,te]=g.useState(!1),[L,Q]=g.useState(null),[re,K]=g.useState(!1),[ae,M]=g.useState(null),[_,se]=g.useState(null),F=m.trim().startsWith("*.");g.useEffect(()=>{F&&(U("dns"),N(!1))},[F]);const ne=m.trim()!==o||b.trim()!==""||y||C!=="http",fe=async()=>{const ee={},Ne=vf(m.trim());Ne&&(ee.domain=Ne);const Ce=By(b.trim());if(Ce&&(ee.email=Ce),ee.domain||ee.email){T(ee),queueMicrotask(()=>document.getElementById(ee.domain?"ssl-domain":"ssl-email")?.focus());return}T({}),z(null),M(null),te(!0);const De=m.trim();try{const he=await ie.ssl.create({domain:De,www:F?!1:y,validationMethod:F?"dns":C,email:b.trim()||void 0});if(RS(he)){Q(he),k("dns");return}se({result:he,domain:De}),k("success"),u(he,De)}catch(he){z(he)}finally{te(!1)}},V=async()=>{if(L){M(null),K(!0);try{const ee=await ie.ssl.confirmDns(L.domain),Ne=L.domain;Q(null),se({result:ee,domain:Ne}),k("success"),u(ee,Ne)}catch(ee){ee instanceof Le&&(ee.code==="dns_not_propagated"||ee.code==="dns_lookup_failed")?M(ee):(Q(null),k("form"),z(ee))}finally{K(!1)}}},ce=async()=>{if(L){K(!0);try{await ie.ssl.cancelDns(L.domain),d.info("DNS challenge cancelled","No certificate was issued.")}catch{d.warning("Could not cancel the DNS challenge","It will expire on its own after ten minutes.")}finally{Q(null),M(null),k("form"),K(!1)}}},Se=()=>{p(""),j(""),N(!1),U("http"),T({}),z(null),M(null),se(null),k("form")},ke=D||re,Ve=async()=>{if(!ke){if(S==="dns"&&L){if(!await h({title:"Cancel the pending DNS challenge?",body:`No certificate will be issued for ${L.domain}. The TXT record can be removed afterwards.`,confirmLabel:"Cancel challenge",cancelLabel:"Keep waiting",tone:"danger"}))return;ie.ssl.cancelDns(L.domain).catch(()=>{}),c();return}S==="form"&&ne&&!await h({title:"Discard this certificate request?",body:"The form has not been submitted, so nothing has been issued.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"})||c()}},$e=g.useRef(Ve);$e.current=Ve;const R=g.useCallback(()=>{$e.current()},[]),I=Y instanceof Le&&Y.code==="email_required",J=S==="success"?"Certificate issued":S==="dns"?"DNS validation":"New certificate";return a.jsxs(bn,{open:!0,onClose:R,title:J,description:S==="form"?"Let’s Encrypt issues 90-day certificates. nginx keeps running unless the HTTP challenge has to fall back to standalone mode.":void 0,size:"lg",preventClose:ke,footer:S==="form"?a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"ghost",onClick:R,disabled:ke,children:"Cancel"}),a.jsx(W,{variant:"primary",loading:D,icon:a.jsx(oa,{className:"size-3.5","aria-hidden":"true"}),onClick:fe,children:"Issue certificate"})]}):S==="dns"?a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"ghost",onClick:ce,disabled:ke,children:"Cancel challenge"}),a.jsx(W,{variant:"primary",loading:re,onClick:V,children:"I’ve added the record"})]}):a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"ghost",onClick:Se,children:"Issue another"}),a.jsx(W,{variant:"primary",onClick:R,children:"Done"})]}),children:[S==="form"&&a.jsxs("div",{className:"space-y-4",children:[Y!=null&&a.jsxs("div",{className:"space-y-2",children:[a.jsx(Fd,{value:Y}),I&&a.jsx(W,{variant:"secondary",size:"sm",onClick:()=>{c(),x("/settings")},children:"Open settings"})]}),a.jsx(Ee,{id:"ssl-domain",label:"Domain name",placeholder:"example.com",value:m,onChange:ee=>p(ee.target.value),error:E.domain,hint:"An A or AAAA record for this name must point at this server for an HTTP challenge.",list:wg,autoComplete:"off",spellCheck:!1,disabled:ke}),a.jsx("datalist",{id:wg,children:l.map(ee=>a.jsx("option",{value:ee.name},ee.name))}),a.jsx(Ee,{id:"ssl-email",label:"ACME email",optional:!0,type:"email",placeholder:"admin@example.com",value:b,onChange:ee=>j(ee.target.value),error:E.email,hint:"Used by Let’s Encrypt for expiry notices. Falls back to the email saved in Settings.",autoComplete:"email",disabled:ke}),F&&a.jsxs(ye,{tone:"info",title:"Wildcard certificate",children:["Wildcard names like ",a.jsx("span",{className:"font-mono",children:"*.example.com"})," can only be validated with a DNS TXT record, so the DNS challenge is selected."]}),a.jsxs("fieldset",{className:"rounded-md border border-line p-3.5",disabled:ke,children:[a.jsx("legend",{className:"px-1 text-xs font-medium text-muted",children:"Challenge method"}),a.jsxs("div",{className:"mt-1 space-y-2",children:[a.jsxs("label",{className:le("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",C==="http"&&!F?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",(F||ke)&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"http",checked:C==="http"&&!F,disabled:F||ke,onChange:()=>U("http"),className:"mt-0.5 size-4 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm text-ink",children:"HTTP challenge"}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:"nginx answers the ACME challenge on port 80, so it can keep running."})]})]}),a.jsxs("label",{className:le("flex cursor-pointer items-start gap-3 rounded-md border px-3.5 py-3 transition-colors",C==="dns"?"border-accent/60 bg-accent-soft":"border-line hover:border-line-strong",ke&&"cursor-not-allowed opacity-60"),children:[a.jsx("input",{type:"radio",name:"ssl-method",value:"dns",checked:C==="dns",disabled:ke,onChange:()=>U("dns"),className:"mt-0.5 size-4 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm text-ink",children:"DNS challenge"}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:"You add a TXT record at your DNS provider. Works for names that do not point at this server yet."})]})]})]})]}),a.jsx(is,{checked:y&&!F,onChange:N,disabled:F||ke,label:m.trim()?`Also cover www.${m.trim().replace(/^\*\./,"")}`:"Also cover the www subdomain",hint:F?"A wildcard certificate already covers every subdomain.":"Both names are added to the same certificate."})]}),S==="dns"&&L&&a.jsxs("div",{className:"space-y-4",children:[a.jsx(ye,{tone:"warning",title:"Add this DNS TXT record",children:"Create the record at your DNS provider, then confirm. The challenge waits up to ten minutes; nothing is written to nginx while it waits."}),a.jsxs("dl",{className:"space-y-2.5 rounded-md border border-line bg-raised/40 p-3.5",children:[a.jsxs("div",{className:"flex items-start gap-2",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Name"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-xs text-ink",children:L.txtName}),a.jsx(wt,{value:L.txtName,label:"Copy record name"})]}),a.jsxs("div",{className:"flex items-start gap-2 border-t border-line pt-2.5",children:[a.jsx("dt",{className:"w-16 shrink-0 pt-0.5 text-2xs text-faint",children:"Value"}),a.jsx("dd",{className:"min-w-0 flex-1 break-all font-mono text-xs text-ink",children:L.txtValue}),a.jsx(wt,{value:L.txtValue,label:"Copy record value"})]})]}),a.jsx("p",{className:"text-xs text-faint",children:"DNS changes can take a few minutes to propagate. Confirming checks that the value is publicly visible before Let’s Encrypt does."}),ae&&a.jsx(AS,{error:ae})]}),S==="success"&&_&&a.jsxs("div",{className:"space-y-4",children:[a.jsx(zS,{result:_.result,title:`Certificate issued for ${_.domain}`}),a.jsxs("div",{className:"flex items-start gap-2 text-xs text-muted",children:[a.jsx(Ll,{className:"mt-0.5 size-3.5 shrink-0 text-faint","aria-hidden":"true"}),a.jsx("p",{children:"The files are on disk. To serve them, edit a domain, enable SSL and use these paths."})]}),a.jsxs("div",{className:"flex items-center gap-2 rounded-md border border-line bg-raised/40 px-3.5 py-2.5 text-xs text-muted",children:[a.jsx(Zi,{className:"size-3.5 shrink-0 text-faint","aria-hidden":"true"}),"Rename or move these files only after updating the domain config; nginx reads them by path."]})]})]})}const _S={valid:{label:"Valid",tone:"ok"},expiring:{label:"Expiring",tone:"warn"},expired:{label:"Expired",tone:"bad"},error:{label:"Unreadable",tone:"bad"}};function OS(l){return l===null?"text-faint":l<0?"text-bad":l<30?"text-warn":"text-ink"}function Sg(l){const o=[];return l.summary&&o.push(l.summary),l.fellBack&&o.push(`nginx was stopped for ${Gy(l.nginxDownMs)} while the challenge ran.`),l.staging&&o.push("This is a staging certificate that browsers will not trust."),o.join(" ")||"The certificate was renewed."}function MS(l){return l.error&&typeof l.error=="object"?l.error:typeof l.error=="string"?{step:l.error,cause:l.detail}:l.detail??"No certificate was issued."}function LS(){Xn("SSL certificates");const l=jt(),o=sn(),c=Xi(),u=xt(_=>ie.ssl.list(_)),[d,h]=Xo(),x=d.get("new")==="1"||!!d.get("domain"),m=d.get("domain")??"",p=xt(_=>ie.domains.list(_),[],{enabled:x}),[b,j]=g.useState(null),[y,N]=g.useState(null),[C,U]=g.useState(null),[S,k]=g.useState(null),[E,T]=g.useState(null);Bs(u.reload),Bl(["ssl","domains"],u.reload);const Y=u.data,z=g.useMemo(()=>{const _=Y??[];return{total:_.length,valid:_.filter(se=>se.status==="valid").length,expiring:_.filter(se=>se.status==="expiring"||se.daysLeft!==null&&se.daysLeft>=0&&se.daysLeft<30).length,expired:_.filter(se=>se.status==="expired"||se.daysLeft!==null&&se.daysLeft<0).length,error:_.filter(se=>se.status==="error").length}},[Y]),D=g.useMemo(()=>(Y??[]).filter(_=>_.daysLeft!==null&&_.daysLeft<30),[Y]),te=z.expiring>0||z.expired>0||z.error>0,L=()=>h({},{replace:!0}),Q=()=>h({new:"1"}),re=async _=>{if(!(b||y)){j(_.domain);try{const se=await ie.ssl.renew(_.domain);l.success(`${_.domain} renewed`,Sg(se)),u.reload()}catch(se){U({domain:_.domain,error:se})}finally{j(null)}}},K=async _=>{if(!(b||y||!await o({title:`Delete the certificate for ${_.domain}?`,body:"Its files are removed from disk and this cannot be undone. The deletion is refused if any nginx configuration still references the certificate.",confirmLabel:"Delete certificate",tone:"danger"}))){N(_.domain);try{const F=await ie.ssl.remove(_.domain);l.success(`${_.domain} deleted`,`Removed ${F.directory}.`),u.reload()}catch(F){if(F instanceof Le&&F.code==="cert_in_use")T({domain:_.domain,directory:typeof F.payload.directory=="string"?F.payload.directory:null,references:Array.isArray(F.payload.references)?F.payload.references:[]});else{const ne=F instanceof Le&&typeof F.payload.detail=="string"?F.payload.detail:F instanceof Error?F.message:void 0;l.error(`Could not delete ${_.domain}`,ne)}}finally{N(null)}}},ae=async()=>{if(!(b||y||D.length===0||!await o({title:`Renew ${_n(D.length,"certificate")}?`,body:"Every certificate expiring within 30 days is renewed one at a time. nginx keeps running unless a challenge has to fall back to standalone mode, which stops it briefly.",confirmLabel:"Renew now",tone:"accent"}))){j("all");try{const se=await ie.ssl.renewAll();k(se);const F=se.filter(ne=>!ne.success).length;se.length===0?l.info("Nothing to renew","No certificate expires within 30 days."):F===0?l.success(`${_n(se.length,"certificate")} renewed`,"The new certificates are already on disk."):l.warning("Some certificates were not renewed",`${se.length-F} renewed, ${F} failed.`),u.reload()}catch(se){U({domain:null,error:se})}finally{j(null)}}},M=C?.error instanceof Le&&C.error.code==="email_required";return a.jsxs(a.Fragment,{children:[a.jsx(da,{title:"SSL certificates",description:"Let’s Encrypt certificates managed by this installation. Renewals keep nginx running where possible.",meta:Y?a.jsxs("span",{className:"text-2xs text-faint",children:[_n(z.total,"certificate")," · ",z.valid," valid"]}):void 0,actions:a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"secondary",size:"sm",loading:u.loading,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:u.reload,children:"Refresh"}),a.jsxs(W,{variant:"secondary",size:"sm",disabled:D.length===0||b!==null||y!==null,loading:b==="all",onClick:ae,children:["Renew expiring",D.length>0?` (${D.length})`:""]}),a.jsx(W,{variant:"primary",size:"sm",icon:a.jsx(ra,{className:"size-3.5","aria-hidden":"true"}),onClick:Q,children:"New certificate"})]})}),te&&a.jsxs(ye,{tone:z.expired>0||z.error>0?"danger":"warning",title:"Certificates need attention",className:"mb-4",children:[[z.expired>0?`${z.expired} expired`:null,z.expiring>0?`${z.expiring} expiring within 30 days`:null,z.error>0?`${z.error} unreadable`:null].filter(Boolean).join(" · "),". Renewing uses the same domain; an unreadable certificate is replaced by a freshly issued one."]}),u.error&&!Y?a.jsx(St,{error:u.error,onRetry:u.reload}):Y?Y.length===0?a.jsx(Qe,{children:a.jsx(Vn,{icon:a.jsx(oa,{className:"size-5","aria-hidden":"true"}),title:"No certificates yet",description:"Issue a Let’s Encrypt certificate for a domain, then point the domain’s SSL settings at its files.",action:a.jsx(W,{variant:"primary",size:"sm",icon:a.jsx(ra,{className:"size-3.5","aria-hidden":"true"}),onClick:Q,children:"Issue a certificate"})})}):a.jsxs("div",{className:"space-y-3",children:[u.error&&a.jsxs("div",{className:"rounded-md border border-warn/30 bg-warn-soft px-3.5 py-2.5 text-xs text-muted",children:["Showing the last known list. ",u.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:u.reload,children:"Try again"})]}),a.jsx(Qe,{className:"overflow-hidden",children:a.jsx("ul",{className:"divide-y divide-line",children:Y.map(_=>{const se=_S[_.status]??{label:_.status,tone:"neutral"},F=b===_.domain;return a.jsxs("li",{className:"flex flex-col gap-2.5 px-4 py-3 transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/40 sm:flex-row sm:items-center sm:gap-4",children:[a.jsxs("div",{className:"flex min-w-0 flex-1 items-start gap-3",children:[a.jsx(Jt,{tone:se.tone,pulse:_.status==="valid",className:"mt-1.5"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate font-mono text-sm font-semibold text-ink",children:_.domain}),a.jsx("div",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-1 text-2xs text-muted",children:_.status==="error"?a.jsx("span",{children:"Certificate files are missing or unreadable"}):a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:["Expires ",pf(_.expiry)]}),a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{className:le("font-mono font-medium",OS(_.daysLeft)),children:_.daysLeft!==null?_.daysLeft<0?`${Math.abs(_.daysLeft)}d overdue`:`${_.daysLeft}d`:Ol(_.daysLeft)}),_.autoRenew&&_.autoRenew!=="off"&&a.jsxs(a.Fragment,{children:[a.jsx("span",{className:"text-faint","aria-hidden":"true",children:"·"}),a.jsx("span",{title:_.autoRenew==="auto"?"The background service renews this certificate on its own.":_.autoRenew==="manual"?"DNS-validated (wildcard) certificates need a TXT record added by hand, so they are not renewed automatically.":"No enabled domain serves this certificate, so it is not renewed automatically.",className:_.autoRenew==="manual"?"text-warn":void 0,children:_.autoRenew==="auto"?`Auto-renews ${_.autoRenewDays??7}d before expiry`:_.autoRenew==="manual"?"Manual renewal (DNS)":"Not in use"})]})]})})]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-1.5 pl-7 sm:w-28 sm:shrink-0 sm:pl-0",children:a.jsx(ge,{tone:se.tone,dot:!0,children:se.label})}),a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center justify-end gap-1.5 pl-7 sm:pl-0",children:[a.jsx(W,{variant:"secondary",size:"sm",loading:F,disabled:b!==null||y!==null,onClick:()=>re(_),children:"Renew"}),_.status==="error"&&a.jsx(W,{variant:"dangerGhost",size:"sm",icon:a.jsx(Hs,{className:"size-3.5","aria-hidden":"true"}),loading:y===_.domain,disabled:b!==null||y!==null,onClick:()=>K(_),children:"Delete"})]})]},_.domain)})})})]}):a.jsxs(Ra,{children:[a.jsx(Ze,{className:"h-14 rounded-lg"}),a.jsx(Ze,{className:"h-[280px] rounded-lg"})]}),x&&a.jsx(DS,{domains:p.data??[],initialDomain:m,onClose:L,onIssued:()=>u.reload()},m||"new"),a.jsx(bn,{open:C!==null,onClose:()=>U(null),title:C?.domain?`${C.domain} was not renewed`:"Renewal failed",description:"The certificate already on disk was not replaced.",size:"md",footer:a.jsxs(a.Fragment,{children:[M&&a.jsx(W,{variant:"secondary",onClick:()=>{U(null),c("/settings")},children:"Open settings"}),a.jsx(W,{variant:"primary",onClick:()=>U(null),children:"Close"})]}),children:C&&a.jsx(Fd,{value:C.error,title:"The certificate could not be renewed"})}),a.jsx(bn,{open:S!==null,onClose:()=>k(null),title:"Renewal results",description:S?`${S.filter(_=>_.success).length} of ${S.length} certificates renewed.`:void 0,size:"lg",footer:a.jsx(W,{variant:"secondary",onClick:()=>k(null),children:"Close"}),children:S&&S.length===0?a.jsx(Vn,{icon:a.jsx(oa,{className:"size-5","aria-hidden":"true"}),title:"Nothing to renew",description:"No certificate expires within 30 days."}):a.jsx("ul",{className:"space-y-2.5",children:(S??[]).map(_=>a.jsx("li",{className:"rounded-md border border-line bg-raised/30 px-3.5 py-3",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[_.success?a.jsx(_s,{className:"mt-0.5 size-4 shrink-0 text-ok","aria-hidden":"true"}):a.jsx(Vd,{className:"mt-0.5 size-4 shrink-0 text-bad","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("div",{className:"truncate font-mono text-sm font-medium text-ink",children:_.domain}),_.success?a.jsxs(a.Fragment,{children:[a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:Sg(_)}),_.configRegenerated&&a.jsx("p",{className:"mt-1 text-2xs text-faint",children:"The nginx config was regenerated so it can answer the ACME challenge."})]}):a.jsx("div",{className:"mt-2",children:a.jsx(Fd,{value:MS(_),title:`${_.domain} was not renewed`})})]})]})},_.domain))})}),a.jsx(bn,{open:E!==null,onClose:()=>T(null),title:E?`${E.domain} is still referenced`:"Certificate is still referenced",description:"Nothing was deleted. At least one nginx configuration file still points at this certificate.",size:"md",footer:a.jsx(W,{variant:"secondary",onClick:()=>T(null),children:"Close"}),children:E&&a.jsxs("div",{className:"space-y-3",children:[a.jsx("p",{className:"text-xs text-muted",children:"Disable SSL on the domain that uses this certificate — or remove the matching lines — then try deleting it again."}),E.directory&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:E.directory}),E.references.length>0&&a.jsx("ul",{className:"space-y-2",children:E.references.map(_=>a.jsxs("li",{className:"rounded-md border border-line bg-raised/30 px-3 py-2",children:[a.jsxs("div",{className:"break-all font-mono text-2xs font-medium text-ink",children:[_.file,":",_.line]}),a.jsx("pre",{className:"mt-1 whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:_.text})]},`${_.file}:${_.line}`))})]})})]})}function Yy(l,o={}){const{client:c,connected:u}=ua(),d=o.enabled??!0,h=o.limit??500,[x,m]=g.useState([]),[p,b]=g.useState(!1),[j,y]=g.useState(0),N=g.useRef(p);N.current=p,g.useEffect(()=>{if(!c||!d)return;const k=E=>{if(E.logFile===l){if(N.current){y(T=>Math.min(T+1,999));return}m(T=>{const Y=[...T,E.line];return Y.length>h?Y.slice(Y.length-h):Y})}};return c.on("logs:line",k),()=>c.off("logs:line",k)},[c,d,h,l]),g.useEffect(()=>{m([]),y(0)},[d,l]),g.useEffect(()=>{if(!(!c||!d||!u))return m([]),y(0),c.emit("logs:subscribe",{logFile:l}),()=>c.emit("logs:unsubscribe")},[c,u,d,l]);const C=g.useCallback(()=>{m([]),y(0)},[]),U=g.useCallback(()=>{m([]),y(0),!(!c||!d)&&(c.emit("logs:unsubscribe"),c.emit("logs:subscribe",{logFile:l}))},[c,d,l]),S=g.useCallback(k=>{b(k),k||y(0)},[]);return{lines:x,paused:p,missed:j,connected:u,clear:C,restart:U,setPaused:S}}const Eo={start:"Start nginx",stop:"Stop nginx",restart:"Restart nginx",reload:"Reload nginx",test:"Test configuration"},US={start:()=>ie.nginx.start(),stop:()=>ie.nginx.stop(),restart:()=>ie.nginx.restart(),reload:()=>ie.nginx.reload(),test:()=>ie.nginx.test()};function kg(l){return l instanceof Le?typeof l.payload.output=="string"&&l.payload.output?l.payload.output:typeof l.payload.error=="string"&&l.payload.error?l.payload.error:l.message:l instanceof Error?l.message:"The action failed."}function HS(l){return/\[(error|crit|emerg|alert)\]/i.test(l)?"text-bad":/\[warn(ing)?\]/i.test(l)?"text-warn":"text-muted"}function BS(){Xn("Nginx");const l=jt(),o=sn(),{nginxStatus:c,connectionError:u}=ua(),d=xt(J=>ie.nginx.status(J)),h=xt(J=>ie.nginx.configs(J)),[x,m]=g.useState(null),[p,b]=g.useState(null),[j,y]=g.useState(null),[N,C]=g.useState(null),[U,S]=g.useState(""),[k,E]=g.useState(""),[T,Y]=g.useState(!1),[z,D]=g.useState(!1),[te,L]=g.useState(null),[Q,re]=g.useState(null),K=g.useRef(null),ae=g.useRef(null),M=Yy("error",{limit:300}),_=g.useRef(null),[se,F]=g.useState(!0);g.useEffect(()=>{d.data&&m(d.data)},[d.data]),g.useEffect(()=>{c&&m(c)},[c]),g.useEffect(()=>{const J=_.current;J&&se&&(J.scrollTop=J.scrollHeight)},[M.lines,se]);const ne=N!==null&&U!==k;g.useEffect(()=>{if(!ne)return;const J=ee=>{ee.preventDefault(),ee.returnValue=""};return window.addEventListener("beforeunload",J),()=>window.removeEventListener("beforeunload",J)},[ne]);const fe=()=>{d.reload(),h.reload()};Bs(fe),Bl("nginx",fe);async function V(J){if(!(!J||J===N||T||z)&&!(ne&&!await o({title:"Discard unsaved changes?",body:`${N} has edits that were not saved.`,confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}))){C(J),Y(!0),L(null),re(null);try{const ee=await ie.nginx.getConfig(J);S(ee.content),E(ee.content)}catch(ee){L(ee),S(""),E("")}finally{Y(!1)}}}g.useEffect(()=>{N||!h.data?.length||V(h.data[0])},[h.data,N]);const ce=async J=>{if(!p&&!((J==="stop"||J==="restart")&&!await o({title:J==="stop"?"Stop nginx?":"Restart nginx?",body:J==="stop"?"Every site nginx serves goes offline until it is started again.":"Open connections are dropped for a moment while nginx restarts.",confirmLabel:J==="stop"?"Stop nginx":"Restart nginx",tone:"danger"}))){b(J),y(null);try{const ee=await US[J]();y({action:J,ok:ee.success,output:ee.output}),ee.success?(l.success(`${Eo[J]} succeeded`,J==="test"?"nginx -t accepted the configuration.":void 0),J!=="test"&&d.reload()):l.error(`${Eo[J]} failed`,ee.output||void 0)}catch(ee){const Ne=kg(ee);y({action:J,ok:!1,output:Ne}),l.error(`${Eo[J]} failed`,Ne)}finally{b(null)}}},Se=async()=>{if(!(!N||z||T||!ne)){D(!0),re(null);try{const J=await ie.nginx.saveConfig(N,U);E(U),re({ok:!0,output:J.output||"Saved and tested successfully."}),l.success("Configuration saved","nginx -t passed. Reload nginx to apply it.")}catch(J){re({ok:!1,output:kg(J)}),l.error("Configuration rejected","The previous file was restored.")}finally{D(!1)}}},ke=()=>{S(k),re(null)},Ve=g.useMemo(()=>{const J=U.split(`
464
+ `).length;return Array.from({length:Math.max(J,1)},(ee,Ne)=>Ne+1)},[U]),$e=!!x?.running,R=!x&&(d.loading||!!d.error),I=M.lines.join(`
465
+ `);return a.jsxs(a.Fragment,{children:[a.jsx(da,{title:"Nginx",description:"Service controls, configuration files and the error log, without leaving the dashboard.",actions:a.jsx(W,{variant:"secondary",size:"sm",loading:d.loading||h.loading,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>{fe(),M.restart()},children:"Refresh"})}),d.error&&!x?a.jsx(St,{error:d.error,onRetry:d.reload}):R?a.jsxs(Ra,{children:[a.jsx(Ze,{className:"h-24 rounded-lg"}),a.jsx(Ze,{className:"h-[380px] rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[d.error&&x&&a.jsxs("div",{className:"rounded-md border border-warn/30 bg-warn-soft px-3.5 py-2.5 text-xs text-muted",children:["Showing the last known status. ",d.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:d.reload,children:"Try again"})]}),a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx("div",{className:le("h-0.5 w-full",$e?"bg-ok/60":"bg-bad/60"),"aria-hidden":"true"}),a.jsxs(Kt,{className:"flex flex-col gap-4 sm:flex-row sm:items-center sm:justify-between",children:[a.jsxs("div",{className:"flex items-center gap-3.5",children:[a.jsxs("div",{className:"relative flex size-11 shrink-0 items-center justify-center rounded-lg border border-line bg-raised",children:[a.jsx(Ul,{className:"size-5 text-ink","aria-hidden":"true"}),a.jsx(Jt,{tone:$e?"ok":"bad",pulse:$e,className:"absolute -right-0.5 -top-0.5 ring-2 ring-surface"})]}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-base font-semibold text-ink",children:$e?"nginx is running":"nginx is stopped"}),x?.pid!==null&&x?.pid!==void 0&&$e&&a.jsxs(ge,{tone:"neutral",children:["pid ",x.pid]})]}),a.jsx("p",{className:"mt-0.5 font-mono text-xs text-muted",children:x?.version??"Version unavailable"}),x?.error&&a.jsx("p",{className:"mt-1 text-xs text-bad",children:x.error})]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[$e?a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"secondary",size:"sm",loading:p==="reload",disabled:p!==null&&p!=="reload",onClick:()=>ce("reload"),children:"Reload"}),a.jsx(W,{variant:"secondary",size:"sm",loading:p==="restart",disabled:p!==null&&p!=="restart",onClick:()=>ce("restart"),children:"Restart"}),a.jsx(W,{variant:"danger",size:"sm",loading:p==="stop",disabled:p!==null&&p!=="stop",onClick:()=>ce("stop"),children:"Stop"})]}):a.jsx(W,{variant:"primary",size:"sm",loading:p==="start",disabled:p!==null&&p!=="start",onClick:()=>ce("start"),children:"Start nginx"}),a.jsx("span",{className:"mx-0.5 hidden h-6 w-px bg-line sm:block","aria-hidden":"true"}),a.jsx(W,{variant:"secondary",size:"sm",loading:p==="test",disabled:p!==null&&p!=="test",onClick:()=>ce("test"),children:"Test config"})]})]}),j&&a.jsx("div",{className:"border-t border-line px-4 py-3 sm:px-5",children:a.jsx(ye,{tone:j.ok?"success":"danger",title:`${Eo[j.action]} ${j.ok?"succeeded":"failed"}`,children:j.output&&a.jsx("pre",{className:"mt-1 max-h-48 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs",children:j.output})})})]}),a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-col gap-3 border-b border-line px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Configuration"}),ne&&a.jsx(ge,{tone:"warn",children:"Unsaved changes"})]}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Every save is written, tested with nginx -t, and rolled back if nginx rejects it."})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsxs(os,{"aria-label":"Configuration file",value:N??"",disabled:z||T||!h.data?.length,onChange:J=>void V(J.target.value),className:"w-full sm:w-60",children:[a.jsx("option",{value:"",disabled:!0,children:"Select a config file…"}),(h.data??[]).map(J=>a.jsx("option",{value:J,children:J},J))]}),a.jsx(W,{variant:"ghost",size:"sm",disabled:!ne||z,icon:a.jsx(BN,{className:"size-3.5","aria-hidden":"true"}),onClick:ke,children:"Revert"}),a.jsx(W,{variant:"primary",size:"sm",disabled:!N||!ne,loading:z,icon:a.jsx(Qd,{className:"size-3.5","aria-hidden":"true"}),onClick:Se,children:"Save"})]})]}),h.error&&!h.data?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx(St,{error:h.error,onRetry:h.reload})}):h.data?h.data.length===0?a.jsx("div",{className:"px-4 py-14 text-center text-sm text-muted sm:px-5",children:"No configuration files were found."}):T?a.jsxs("div",{className:"flex h-[360px] items-center justify-center gap-2 text-sm text-muted",children:[a.jsx(bt,{className:"spin size-4","aria-hidden":"true"}),"Loading configuration…"]}):te?a.jsx("div",{className:"p-4 sm:p-5",children:a.jsx(St,{error:te,title:"Could not load this configuration",onRetry:()=>N?void V(N):void 0})}):N?a.jsxs("div",{className:"relative flex h-[min(56vh,520px)] min-h-[280px] overflow-hidden bg-canvas",children:[a.jsx("div",{ref:ae,"aria-hidden":"true",className:"config-editor pointer-events-none w-12 shrink-0 overflow-hidden border-r border-line bg-inset/40 py-3 pr-2 text-right text-faint",children:Ve.map(J=>a.jsx("div",{children:J},J))}),a.jsx("textarea",{ref:K,value:U,onChange:J=>S(J.target.value),onScroll:()=>{ae.current&&K.current&&(ae.current.scrollTop=K.current.scrollTop)},onKeyDown:J=>{(J.metaKey||J.ctrlKey)&&J.key.toLowerCase()==="s"&&(J.preventDefault(),Se())},wrap:"off",spellCheck:!1,"aria-label":N?`${N} contents`:"nginx configuration",className:"config-editor h-full w-full resize-none bg-transparent py-3 pl-4 pr-4 text-ink caret-accent outline-none"})]}):a.jsx("div",{className:"px-4 py-14 text-center text-sm text-muted sm:px-5",children:"Select a configuration file to start editing."}):a.jsxs("div",{className:"space-y-2 p-4 sm:p-5",children:[a.jsx(Ze,{className:"h-5 w-48"}),a.jsx(Ze,{className:"h-[300px]"})]}),Q&&a.jsxs("div",{className:le("border-t px-4 py-3 sm:px-5",Q.ok?"border-ok/25 bg-ok-soft":"border-bad/25 bg-bad-soft"),children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("p",{className:le("text-xs font-medium",Q.ok?"text-ok":"text-bad"),children:Q.ok?"Saved — nginx test passed":"Save rejected — the previous file was restored"}),Q.ok&&a.jsx(W,{variant:"secondary",size:"sm",loading:p==="reload",disabled:p!==null&&p!=="reload",onClick:()=>ce("reload"),children:"Reload nginx"})]}),Q.output&&a.jsx("pre",{className:"mt-1.5 max-h-40 overflow-auto whitespace-pre-wrap break-all font-mono text-2xs text-muted",children:Q.output})]})]}),a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 border-b border-line px-4 py-3 sm:px-5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("h2",{className:"text-sm font-semibold text-ink",children:"Error log"}),a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-faint",children:[a.jsx(Jt,{tone:M.paused?"warn":M.connected?"ok":"neutral",pulse:!M.paused&&M.connected}),M.paused?"Paused":M.connected?"Live":"Connecting…"]}),M.paused&&M.missed>0&&a.jsxs(ge,{tone:"warn",children:[M.missed," new"]})]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[I&&a.jsx(wt,{value:I,label:"Copy lines",withText:!0}),a.jsx(at,{label:M.paused?"Resume the log stream":"Pause the log stream",size:"sm",onClick:()=>M.setPaused(!M.paused),children:M.paused?a.jsx(Ki,{className:"size-3.5","aria-hidden":"true"}):a.jsx(Ny,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(at,{label:"Clear the log view",size:"sm",onClick:M.clear,disabled:M.lines.length===0,children:a.jsx(bt,{className:"size-3.5 rotate-45","aria-hidden":"true"})})]})]}),a.jsx("div",{ref:_,"aria-label":"Recent nginx error log",onScroll:J=>{const ee=J.currentTarget;F(ee.scrollHeight-ee.scrollTop-ee.clientHeight<40)},className:"h-64 overflow-y-auto bg-canvas px-4 py-3 font-mono text-2xs leading-relaxed sm:px-5",children:!M.connected&&M.lines.length===0?a.jsx("p",{className:"text-faint",children:"Waiting for the live stream…"}):M.lines.length===0?a.jsx("p",{className:"text-faint",children:"No errors logged."}):M.lines.map((J,ee)=>a.jsx("div",{className:le("whitespace-pre-wrap break-all py-0.5",HS(J)),children:J},ee))}),u&&a.jsxs("div",{className:"border-t border-line px-4 py-2 text-2xs text-muted sm:px-5",children:["The live log stream is disconnected. New lines appear once the dashboard socket reconnects."," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:M.restart,children:"Try again"})]})]})]})]})}const qS=[{value:"discord",label:"Discord",description:"Post alerts to a channel through a webhook URL.",icon:Uo},{value:"telegram",label:"Telegram",description:"Send alerts through a bot to a chat or group.",icon:wy}];function $S(l){return{name:l?.name??"",type:l?.type??"discord",webhookUrl:l?.webhookUrl??"",botToken:l?.botToken??"",chatId:l?.chatId??"",message:l?.message??""}}function GS(l){if(l instanceof Le){const o=typeof l.payload.detail=="string"?l.payload.detail:null;return o||l.message}return l instanceof Error?l.message:"The channel could not be saved."}function YS({channel:l,onClose:o,onSaved:c}){const u=sn(),d=l!==null,h=g.useRef($S(l)),[x,m]=g.useState(h.current),[p,b]=g.useState({}),[j,y]=g.useState(null),[N,C]=g.useState(!1),U=Object.keys(x).some(T=>x[T]!==h.current[T]),S=(T,Y)=>{m(z=>({...z,[T]:Y})),b(z=>({...z,[T]:void 0})),y(null)},k=()=>{if(!N){if(!U){o();return}u({title:d?"Discard channel changes?":"Discard this channel?",body:"Nothing has been sent to the server yet.",confirmLabel:"Discard",cancelLabel:"Keep editing",tone:"danger"}).then(T=>{T&&o()})}},E=async()=>{if(N)return;const T={};if(x.name.trim()||(T.name="Give the channel a name."),x.type==="discord"){const z=x.webhookUrl.trim();z?/^https:\/\/\S+$/i.test(z)||(T.webhookUrl="Enter an https:// URL without spaces."):T.webhookUrl="A Discord webhook URL is required."}else x.botToken.trim()||(T.botToken="The bot token is required."),x.chatId.trim()||(T.chatId="The chat ID is required.");if(b(T),Object.keys(T).length>0)return;const Y={name:x.name.trim(),type:x.type,...x.type==="discord"?{webhookUrl:x.webhookUrl.trim(),message:x.message.trim()}:{botToken:x.botToken.trim(),chatId:x.chatId.trim()}};C(!0),y(null);try{const z=l?await ie.settings.channels.update(l.id,Y):await ie.settings.channels.create(Y);c(z,!d)}catch(z){y(GS(z))}finally{C(!1)}};return a.jsx(bn,{open:!0,onClose:k,title:d?`Edit ${l.name}`:"New notification channel",description:d?"Change where this channel delivers, or how its messages look.":"Add a Discord webhook or a Telegram bot. Domains choose their channels per event.",preventClose:N,footer:a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"secondary",onClick:k,disabled:N,children:"Cancel"}),a.jsx(W,{variant:"primary",type:"submit",form:"channel-form",loading:N,children:d?"Save channel":"Create channel"})]}),children:a.jsxs("form",{id:"channel-form",onSubmit:T=>{T.preventDefault(),E()},className:"space-y-4",children:[j&&a.jsx(ye,{tone:"danger",title:"Could not save the channel",children:j}),a.jsx(Ee,{label:"Name",value:x.name,onChange:T=>S("name",T.target.value),placeholder:"Production Discord",error:p.name,autoFocus:!0}),a.jsxs("fieldset",{disabled:d||N,children:[a.jsx("legend",{className:"mb-1.5 text-xs font-medium text-muted",children:"Type"}),a.jsx("div",{className:"grid gap-2 sm:grid-cols-2",children:qS.map(T=>{const Y=x.type===T.value;return a.jsxs("label",{className:le("flex cursor-pointer items-start gap-2.5 rounded-md border p-3 transition-colors duration-[var(--ez-motion-fast)]",Y?"border-accent bg-accent-soft":"border-line bg-canvas hover:border-line-strong",(d||N)&&"cursor-not-allowed opacity-70"),children:[a.jsx("input",{type:"radio",name:"channel-type",value:T.value,checked:Y,onChange:()=>S("type",T.value),className:"mt-0.5 size-3.5 accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"flex items-center gap-1.5 text-sm font-medium text-ink",children:[a.jsx(T.icon,{className:"size-3.5 text-muted","aria-hidden":"true"}),T.label]}),a.jsx("span",{className:"mt-0.5 block text-2xs text-faint",children:T.description})]})]},T.value)})}),d&&a.jsx(Ls,{children:"The channel type cannot be changed after it is created."})]}),x.type==="discord"?a.jsxs(a.Fragment,{children:[a.jsx(Ee,{label:"Webhook URL",value:x.webhookUrl,onChange:T=>S("webhookUrl",T.target.value),placeholder:"https://discord.com/api/webhooks/…",error:p.webhookUrl,hint:"Create one in Discord under Channel settings → Integrations → Webhooks.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsxs("div",{children:[a.jsx(Ee,{label:"Message prefix",optional:!0,value:x.message,onChange:T=>S("message",T.target.value),placeholder:"<@&1280907071813976196> or @team",hint:"Prepended to every alert in this channel.",spellCheck:!1}),a.jsxs("div",{className:"mt-2 rounded-md border border-info/25 bg-info-soft px-3 py-2 text-2xs text-muted",children:["Tip: to ping a Discord role, paste its mention as"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-[10px] text-ink",children:"<@&RoleId>"})," ","— for example"," ",a.jsx("code",{className:"rounded bg-inset px-1 py-0.5 font-mono text-[10px] text-ink",children:"<@&1280907071813976196>"}),". The role is mentioned on every alert."]})]})]}):a.jsxs("div",{className:"grid gap-4 sm:grid-cols-2",children:[a.jsx(Ee,{label:"Bot token",value:x.botToken,onChange:T=>S("botToken",T.target.value),placeholder:"123456:ABC…",error:p.botToken,hint:"From @BotFather.",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(Ee,{label:"Chat ID",value:x.chatId,onChange:T=>S("chatId",T.target.value),placeholder:"-1001234567890",error:p.chatId,hint:"Groups start with a minus sign.",className:"font-mono",spellCheck:!1,autoComplete:"off"})]})]})})}const VS={nginx_down:"nginx",cert_expiry:"Certificate",domain_health:"Health check",test:"Test message"};function XS(l){return l.type==="nginx_down"?Ul:l.type==="cert_expiry"?Aa:l.type==="domain_health"?Lo:ky}function QS(l){return l==="danger"?"text-bad":l==="warning"?"text-warn":l==="success"?"text-ok":l==="info"?"text-info":"text-muted"}function Tg(l,o){return l instanceof Le?(typeof l.payload.detail=="string"?l.payload.detail:null)??l.message:l instanceof Error?l.message:o}function ZS(l){if(!l)return"Webhook URL not set";try{const o=new URL(l),c=o.pathname.split("/").filter(Boolean).pop()??"";return`${o.host}/…${c.slice(-4)}`}catch{return"Webhook URL configured"}}function KS(l){return l.type==="discord"?ZS(l.webhookUrl):`Chat ${l.chatId??"—"} · bot token saved`}function JS(){Xn("Notifications");const l=jt(),o=sn(),{notifications:c,clearNotifications:u,connected:d,connectionError:h}=ua(),x=xt(z=>ie.settings.channels.list(z)),m=xt(z=>ie.domains.list(z)),[p,b]=g.useState(null),[j,y]=g.useState(null),[N,C]=g.useState(null),[,U]=g.useState(0);g.useEffect(()=>{const z=setInterval(()=>U(D=>D+1),3e4);return()=>clearInterval(z)},[]);const S=()=>{x.reload(),m.reload()};Bs(S),Bl(["settings","domains"],S);const k=g.useMemo(()=>{const z=new Map;for(const D of m.data??[]){if(!D.enabled)continue;const te=new Map;for(const L of Object.values(D.notifications))if(L.enabled)for(const Q of L.channelIds)te.set(Q,(te.get(Q)??0)+1);for(const[L,Q]of te){const re=z.get(L)??{domains:0,rules:0};re.domains+=1,re.rules+=Q,z.set(L,re)}}return z},[m.data]),E=async z=>{if(!j){y(z.id);try{await ie.settings.channels.test(z.id),l.success(`Test sent to ${z.name}`,"Check the channel to confirm the message arrived.")}catch(D){l.error(`Test failed for ${z.name}`,Tg(D,"The test message could not be delivered."))}finally{y(null)}}},T=async z=>{if(!(N||!await o({title:`Delete ${z.name}?`,body:"Domains routed to this channel stop delivering alerts there. The domains themselves are not changed.",confirmLabel:"Delete channel",tone:"danger"}))){C(z.id);try{await ie.settings.channels.remove(z.id),l.success("Channel deleted",`${z.name} will no longer receive alerts.`),x.reload()}catch(te){l.error("Could not delete the channel",Tg(te,"The channel is still configured."))}finally{C(null)}}},Y=x.data;return a.jsxs(a.Fragment,{children:[a.jsx(da,{title:"Notifications",description:"Delivery channels for alerts, and the events received in this session.",actions:a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"secondary",size:"sm",loading:x.loading||m.loading,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:S,children:"Refresh"}),a.jsx(W,{variant:"primary",size:"sm",icon:a.jsx(ra,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>b({channel:null}),children:"New channel"})]})}),x.error&&!Y?a.jsx(St,{error:x.error,onRetry:x.reload}):Y?a.jsxs("div",{className:"grid items-start gap-5 xl:grid-cols-[minmax(0,1fr)_380px]",children:[a.jsx("div",{className:"space-y-5",children:a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx(Zt,{title:"Channels",description:"Named Discord and Telegram destinations. Domains choose which channels receive their events.",actions:Y.length>0?a.jsx(ge,{tone:"neutral",children:_n(Y.length,"channel")}):void 0}),x.error&&a.jsxs("div",{className:"border-b border-line px-4 py-2 text-2xs text-muted sm:px-5",children:["Showing the last known list. ",x.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:x.reload,children:"Try again"})]}),Y.length===0?a.jsx(Vn,{icon:a.jsx(Uo,{className:"size-5","aria-hidden":"true"}),title:"No channels yet",description:"Add a Discord webhook or a Telegram bot, then route domain events to it. Until then, alerts stay in the dashboard only.",action:a.jsx(W,{variant:"primary",size:"sm",icon:a.jsx(ra,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>b({channel:null}),children:"New channel"})}):a.jsx("ul",{className:"divide-y divide-line/70",children:Y.map(z=>{const D=z.type==="discord"?Uo:wy,te=k.get(z.id),L=N===z.id;return a.jsxs("li",{className:"flex flex-col gap-3 px-4 py-3.5 sm:flex-row sm:items-center sm:justify-between sm:px-5",children:[a.jsxs("div",{className:"flex min-w-0 items-start gap-3",children:[a.jsx("div",{className:le("flex size-9 shrink-0 items-center justify-center rounded-md border border-line",z.type==="discord"?"bg-info-soft text-info":"bg-accent-soft text-accent-text"),children:a.jsx(D,{className:"size-4","aria-hidden":"true"})}),a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:z.name}),a.jsx(ge,{tone:"neutral",children:z.type==="discord"?"Discord":"Telegram"}),m.data&&(te?a.jsxs(ge,{tone:"ok",dot:!0,className:"cursor-default",children:[te.domains," ",te.domains===1?"domain":"domains"]}):a.jsx(ge,{tone:"neutral",children:"Not routed yet"}))]}),a.jsx("p",{className:"mt-0.5 truncate font-mono text-xs text-muted",children:KS(z)}),z.type==="discord"&&z.message&&a.jsxs("p",{className:"mt-0.5 truncate text-2xs text-faint",children:["Prefix: ",z.message]})]})]}),a.jsxs("div",{className:"flex shrink-0 items-center gap-1.5 pl-12 sm:pl-0",children:[a.jsx(W,{variant:"secondary",size:"sm",loading:j===z.id,disabled:j!==null&&j!==z.id,icon:a.jsx(C2,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void E(z),children:"Test"}),a.jsx(W,{variant:"ghost",size:"sm",disabled:L,icon:a.jsx(ff,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>b({channel:z}),children:"Edit"}),a.jsx(at,{label:`Delete ${z.name}`,size:"sm",disabled:L,className:"hover:text-bad",onClick:()=>void T(z),children:a.jsx(Hs,{className:"size-3.5","aria-hidden":"true"})})]})]},z.id)})}),Y.length>0&&a.jsx("div",{className:"border-t border-line bg-raised/40 px-4 py-2.5 text-2xs text-faint sm:px-5",children:m.error?"Domain routing could not be loaded, so usage counts are hidden.":"Counts include enabled domains that route at least one event to a channel."})]})}),a.jsxs("div",{className:"space-y-5",children:[a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx(Zt,{icon:a.jsx(og,{className:"size-4","aria-hidden":"true"}),title:"Recent events",description:"Received live while this page is open.",actions:a.jsxs("span",{className:"inline-flex items-center gap-1.5 text-2xs text-faint",children:[a.jsx(Jt,{tone:d?"ok":"warn",pulse:d}),d?"Live":"Reconnecting…"]})}),h&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(ye,{tone:"warning",children:h})}),c.length===0?a.jsx(Vn,{icon:a.jsx(og,{className:"size-5","aria-hidden":"true"}),title:"No events yet",description:"Alerts appear here as they happen. The bell in the header keeps the same list between pages.",className:"py-9"}):a.jsxs(a.Fragment,{children:[a.jsx("ul",{className:"max-h-[420px] divide-y divide-line/70 overflow-y-auto",children:c.map(z=>{const D=XS(z);return a.jsxs("li",{className:"flex items-start gap-2.5 px-4 py-2.5 sm:px-5",children:[a.jsx(D,{className:le("mt-0.5 size-4 shrink-0",QS(z.severity)),"aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsx("p",{className:"text-xs leading-snug text-ink",children:z.message}),a.jsxs("p",{className:"mt-0.5 flex flex-wrap items-center gap-x-1.5 text-2xs text-faint",children:[a.jsx("span",{children:VS[z.type]??"Notification"}),z.domain&&a.jsxs("span",{children:["· ",z.domain]}),a.jsxs("span",{children:["· ",Pi(z.timestamp)]})]})]})]},z.id)})}),a.jsx("div",{className:"border-t border-line bg-raised/40 px-4 py-2 sm:px-5",children:a.jsx("button",{type:"button",onClick:u,className:"text-2xs font-medium text-muted transition-colors hover:text-ink",children:"Clear all events"})})]})]}),a.jsxs(Qe,{children:[a.jsx(Zt,{title:"How routing works",description:"Channels do nothing until a domain sends to them."}),a.jsxs(Kt,{className:"space-y-3",children:[a.jsx("ol",{className:"space-y-2.5",children:["Create a channel here and send it a test message.","Open a domain and pick channels for nginx downtime, certificate expiry and health events.","Toggle each event separately — turning one off keeps the others delivering."].map((z,D)=>a.jsxs("li",{className:"flex gap-2.5 text-xs text-muted",children:[a.jsx("span",{className:"mt-0.5 flex size-4.5 shrink-0 items-center justify-center rounded-full bg-inset text-2xs font-semibold text-muted",children:D+1}),a.jsx("span",{children:z})]},z))}),a.jsxs(mt,{to:"/domains",className:Yn("secondary","sm","w-full"),children:["Open domains",a.jsx(Ll,{className:"size-3.5","aria-hidden":"true"})]})]})]})]})]}):a.jsxs(Ra,{children:[a.jsx(Ze,{className:"h-40 rounded-lg"}),a.jsx(Ze,{className:"h-64 rounded-lg"})]}),p&&a.jsx(YS,{channel:p.channel,onClose:()=>b(null),onSaved:(z,D)=>{b(null),x.reload(),l.success(D?"Channel created":"Channel updated",D?`${z.name} is ready to receive alerts.`:`${z.name} was saved.`)}},p.channel?.id??"new")]})}function Cg(l,o){return l instanceof Le?typeof l.payload.detail=="string"?l.payload.detail:typeof l.payload.message=="string"?l.payload.message:l.message:l instanceof Error?l.message:o}function qo(l){return l==="online"?"ok":l==="errored"?"bad":l==="stopping"||l==="launching"?"warn":"neutral"}function Vy(l){return l===null||l===0?"—":ww(l)}function Xy(l){return l===null||l===0?"—":My(l)}function Eg(l,o){const c=o?.replace(/\\/g,"/").replace(/\/+$/,"").toLowerCase()??null;return[l.execPath,l.cwd].some(u=>{if(!u)return!1;const d=u.replace(/\\/g,"/").toLowerCase();return c&&d.startsWith(`${c}/modules/`)?!0:/(^|\/)(\.pm2|pm2)\/modules\//.test(d)})}function zo({label:l,value:o}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:l}),a.jsx("div",{className:"mt-0.5 text-xs tabular-nums text-muted",children:o})]})}function ls({label:l,value:o,detail:c,tone:u}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:l}),a.jsx("div",{className:le("mt-0.5 text-sm font-medium",u??"text-ink"),children:o}),c&&a.jsx("div",{className:"mt-0.5 text-2xs text-faint",children:c})]})}function PS({command:l,guidance:o}){return a.jsxs("div",{className:"rounded-md border border-line bg-canvas p-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("code",{className:"break-all font-mono text-xs text-ink",children:l}),a.jsx(wt,{value:l,label:"Copy command",withText:!0})]}),a.jsx("p",{className:"mt-2 text-2xs leading-relaxed text-muted",children:o})]})}function zg({label:l,version:o,path:c,broken:u=!1,emptyLabel:d="Unknown"}){return a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs text-faint",children:l}),a.jsx("div",{className:le("text-xs font-medium",u?"text-warn":"text-ink"),children:o??(u?"Missing":d)}),a.jsx("div",{className:"break-all font-mono text-2xs text-faint",children:c??"—"})]})}function FS({runtime:l}){const o=Aw(l);return o?a.jsxs("div",{className:"rounded-md border border-line bg-canvas/40 px-3.5 py-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Node runtime"}),o.broken?a.jsx(ge,{tone:"warn",children:"service runtime missing"}):o.pinned?o.sameAsSystem?a.jsx(ge,{tone:"neutral",children:"same as system"}):a.jsx(ge,{tone:"info",children:"pinned copy"}):a.jsx(ge,{tone:"warn",children:"not pinned"})]}),a.jsxs("div",{className:"mt-2 grid gap-3 sm:grid-cols-2",children:[a.jsx(zg,{label:"Service Node",version:o.serviceVersion,path:o.servicePath,broken:o.broken,emptyLabel:o.pinned?"Unknown":"Not pinned"}),a.jsx(zg,{label:"System Node",version:o.systemVersion,path:o.systemPath})]}),o.manager&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["The system Node is managed by ",o.manager,". The service uses its own pinned binary so switching versions cannot break it."]}),!o.pinned&&!o.broken&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["No pinned Node was found. The service will start with whatever"," ",a.jsx("code",{className:"font-mono",children:"node"})," its launcher resolves;"," ",a.jsx("code",{className:"font-mono",children:"ezz service repair"})," pins one."]}),o.pinned&&!o.sameAsSystem&&!o.broken&&o.serviceVersion&&a.jsxs("p",{className:"mt-2 text-2xs text-faint",children:["The service is pinned to a different Node than this dashboard. That is normal after an upgrade; ",a.jsx("code",{className:"font-mono",children:"ezz service repair"})," re-pins it."]})]}):null}function IS({app:l,onClose:o}){const c=xt(d=>ie.processes.logs(l.name,200,d)),u=(c.data?.lines??[]).join(`
466
+ `);return a.jsx(bn,{open:!0,onClose:o,title:`Logs — ${l.name}`,description:"The last 200 lines PM2 has written for this process.",size:"lg",footer:a.jsxs(a.Fragment,{children:[u.trim()&&a.jsx(wt,{value:u,label:"Copy logs",withText:!0}),a.jsx(W,{variant:"secondary",onClick:o,children:"Close"})]}),children:c.error&&!c.data?a.jsx(St,{error:c.error,title:"Could not read the logs",onRetry:c.reload,className:"border-0"}):c.data?a.jsx("pre",{className:"max-h-[55vh] overflow-auto whitespace-pre-wrap break-all rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-muted",children:u.trim()?u:"(no output)"}):a.jsxs("div",{className:"flex items-center justify-center gap-2 py-10 text-sm text-muted",children:[a.jsx(Ms,{}),"Reading logs…"]})})}function Rg({app:l,isModule:o,busy:c,currentUser:u,onAction:d,onLogs:h}){const x=c?.name===l.name,m=!!(l.user&&u&&l.user!==u);return a.jsxs("li",{className:"px-4 py-3.5 sm:px-5",children:[a.jsxs("div",{className:"flex flex-col gap-3 sm:flex-row sm:items-start sm:justify-between",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(Jt,{tone:qo(l.status),pulse:l.status==="online"}),a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:l.name}),a.jsx(ge,{tone:qo(l.status),children:l.status}),o&&a.jsx(ge,{tone:"info",children:"module"}),m&&a.jsx(ge,{tone:"warn",children:l.user})]}),(l.execPath||l.cwd)&&a.jsx("p",{className:"mt-0.5 truncate font-mono text-2xs text-faint",children:l.execPath??l.cwd})]}),a.jsxs("div",{className:"flex shrink-0 flex-wrap items-center gap-1.5",children:[l.status==="online"?a.jsx(W,{variant:"secondary",size:"sm",loading:x&&c?.action==="stop",disabled:x||m,icon:a.jsx(xf,{className:"size-3","aria-hidden":"true"}),onClick:()=>d(l,"stop",o),children:"Stop"}):a.jsx(W,{variant:"secondary",size:"sm",loading:x&&c?.action==="start",disabled:x||m,icon:a.jsx(Ki,{className:"size-3","aria-hidden":"true"}),onClick:()=>d(l,"start",o),children:"Start"}),a.jsx(W,{variant:"ghost",size:"sm",loading:x&&c?.action==="restart",disabled:x||m,icon:a.jsx(hf,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>d(l,"restart",o),children:"Restart"}),a.jsx(W,{variant:"ghost",size:"sm",disabled:x,icon:a.jsx($i,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>h(l),children:"Logs"})]})]}),a.jsxs("div",{className:"mt-3 grid grid-cols-2 gap-3 sm:grid-cols-4",children:[a.jsx(zo,{label:"CPU",value:Vy(l.cpu)}),a.jsx(zo,{label:"Memory",value:Xy(l.memoryBytes)}),a.jsx(zo,{label:"Uptime",value:Qo(l.uptimeMs)}),a.jsx(zo,{label:"Restarts",value:l.unstableRestarts>0?`${l.restarts} · ${l.unstableRestarts} unstable`:String(l.restarts)})]})]})}const Qy="ez.processes.view";function WS(){try{return localStorage.getItem(Qy)==="table"?"table":"list"}catch{return"list"}}function e5({view:l,onChange:o}){const c=[{id:"list",label:"List view",icon:Z2},{id:"table",label:"Table view",icon:MN}];return a.jsx("div",{role:"group","aria-label":"Process layout",className:"inline-flex items-center gap-0.5 rounded-md border border-line bg-raised p-0.5",children:c.map(({id:u,label:d,icon:h})=>a.jsxs("button",{type:"button","aria-pressed":l===u,title:d,onClick:()=>o(u),className:le("inline-flex size-7 items-center justify-center rounded-sm transition-colors duration-[var(--ez-motion-fast)]",l===u?"bg-surface text-ink shadow-sm":"text-faint hover:text-ink"),children:[a.jsx(h,{className:"size-3.5","aria-hidden":"true"}),a.jsx("span",{className:"sr-only",children:d})]},u))})}function t5({app:l}){return l.unstableRestarts>0?`${l.restarts} · ${l.unstableRestarts} unstable`:String(l.restarts)}function Ag({apps:l,isModule:o,busy:c,currentUser:u,onAction:d,onLogs:h}){return a.jsx("div",{className:"overflow-x-auto",children:a.jsxs("table",{className:"w-full min-w-[42rem] text-left text-sm",children:[a.jsx("thead",{children:a.jsxs("tr",{className:"border-b border-line text-2xs uppercase tracking-wider text-faint",children:[a.jsx("th",{scope:"col",className:"px-4 py-2 font-medium sm:px-5",children:"Process"}),a.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Status"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"CPU"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Memory"}),a.jsx("th",{scope:"col",className:"px-3 py-2 font-medium",children:"Uptime"}),a.jsx("th",{scope:"col",className:"px-3 py-2 text-right font-medium",children:"Restarts"}),a.jsx("th",{scope:"col",className:"px-4 py-2 text-right font-medium sm:px-5",children:a.jsx("span",{className:"sr-only",children:"Actions"})})]})}),a.jsx("tbody",{children:l.map(x=>{const m=c?.name===x.name,p=!!(x.user&&u&&x.user!==u);return a.jsxs("tr",{className:"border-b border-line/70 last:border-0",children:[a.jsx("td",{className:"px-4 py-2 sm:px-5",children:a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(Jt,{tone:qo(x.status),pulse:x.status==="online"}),a.jsx("span",{className:"truncate text-sm font-medium text-ink",children:x.name}),o&&a.jsx(ge,{tone:"info",children:"module"}),p&&a.jsx(ge,{tone:"warn",children:x.user})]})}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2",children:a.jsx(ge,{tone:qo(x.status),children:x.status})}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:Vy(x.cpu)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:Xy(x.memoryBytes)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 tabular-nums text-muted",children:Qo(x.uptimeMs)}),a.jsx("td",{className:"whitespace-nowrap px-3 py-2 text-right tabular-nums text-muted",children:a.jsx(t5,{app:x})}),a.jsx("td",{className:"px-4 py-2 sm:px-5",children:a.jsxs("div",{className:"flex items-center justify-end gap-1",children:[x.status==="online"?a.jsx(at,{label:`Stop ${x.name}`,size:"sm",disabled:m||p,onClick:()=>d(x,"stop",o),children:m&&c?.action==="stop"?a.jsx(ia,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(xf,{className:"size-3","aria-hidden":"true"})}):a.jsx(at,{label:`Start ${x.name}`,size:"sm",disabled:m||p,onClick:()=>d(x,"start",o),children:m&&c?.action==="start"?a.jsx(ia,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(Ki,{className:"size-3","aria-hidden":"true"})}),a.jsx(at,{label:`Restart ${x.name}`,size:"sm",disabled:m||p,onClick:()=>d(x,"restart",o),children:m&&c?.action==="restart"?a.jsx(ia,{className:"spin size-3.5","aria-hidden":"true"}):a.jsx(hf,{className:"size-3.5","aria-hidden":"true"})}),a.jsx(at,{label:`View logs for ${x.name}`,size:"sm",disabled:m,onClick:()=>h(x),children:a.jsx($i,{className:"size-3.5","aria-hidden":"true"})})]})})]},`${x.name}-${x.pmId??"x"}`)})})]})})}function n5(){Xn("Processes");const l=jt(),o=sn(),{service:c,loading:u,error:d,reload:h,applyBackgroundService:x}=Ji(),m=Fi(c),p=xt(M=>ie.processes.list(M)),[b,j]=g.useState(null),[y,N]=g.useState(null),[C,U]=g.useState(null),[S,k]=g.useState(null),[E,T]=g.useState(WS),Y=M=>{T(M);try{localStorage.setItem(Qy,M)}catch{}},z=()=>{p.reload(),h()};Os(p.reload,15e3),Os(()=>{u||h()},15e3),Bs(z);const D=async(M,_,se)=>{if(!b){if(_==="stop"||_==="restart"){const F=se?_==="stop"?M.name.toLowerCase().includes("logrotate")?`${M.name} rotates PM2's logs. Stopping it lets PM2 logs grow without limit until you start it again. It is a PM2 module, not one of your apps.`:`${M.name} is a PM2 module, not one of your apps. Stopping it changes how PM2 itself behaves.`:`${M.name} is a PM2 module. Restarting it briefly stops the behaviour it adds to PM2.`:`${M.name} is one of your own PM2 apps. ${_==="stop"?"Stopping":"Restarting"} it affects whatever else relies on it.`;if(!await o({title:`${_==="stop"?"Stop":"Restart"} ${M.name}?`,body:F,confirmLabel:se&&_==="stop"?"Stop module anyway":`${_==="stop"?"Stop":"Restart"} anyway`,tone:"danger"}))return}j({name:M.name,action:_});try{const F=await ie.processes.action(M.name,_);l.success(`${M.name}: ${_} done`,F.output||void 0),z()}catch(F){l.error(`Could not ${_} ${M.name}`,Cg(F,"PM2 refused the action. Check the PM2 log for details."))}finally{j(null)}}},te=async M=>{if(!m||C)return;const _=m.startsAt==="logon"?"at your next logon":m.startsAt==="boot"?"at the next boot":"when the service starts";if(await o(M==="start"?{title:"Start the background service?",body:m.installed?`Monitoring and notifications keep running after this dashboard closes. From now on it also starts ${_}.`:"The service is not installed; if it cannot start, the exact install command is shown instead.",confirmLabel:"Start service"}:M==="stop"?{title:"Stop the background service?",body:m.installed?`Monitoring and notifications pause while it is down. It returns ${_} or as soon as you start it again.`:"Monitoring and notifications pause while it is down. It will not restart until you start it, because it is not installed.",confirmLabel:"Stop service",tone:"danger"}:{title:"Restart the background service?",body:"Monitoring pauses for a moment while the service restarts. Jobs resume when it is back up.",confirmLabel:"Restart service",tone:"danger"})){U(M),k(null);try{const F=await ie.service[M]();x(F.backgroundService),l.success(M==="start"?"Background service started":M==="stop"?"Background service stopped":"Background service restarted",F.output?.trim()||void 0),h()}catch(F){if(F instanceof Le){if(F.payload.backgroundService&&x(F.payload.backgroundService),F.status===403&&F.code==="elevation_required"){k({kind:"elevation",action:M,command:typeof F.payload.command=="string"?F.payload.command:`ezz service ${M}`,shell:typeof F.payload.shell=="string"?F.payload.shell:null,message:typeof F.payload.message=="string"?F.payload.message:null});return}if(F.status===409&&F.code==="not_installed"){k({kind:"install",action:M,command:typeof F.payload.command=="string"?F.payload.command:c?.install.command??"ezz service install",shell:c?.install.shell??null,message:typeof F.payload.message=="string"?F.payload.message:null});return}if(F.status===409&&F.code==="already_running"){l.info("The background service is already running.",typeof F.payload.message=="string"?F.payload.message:void 0),h();return}l.error(`Could not ${M} the background service`,Cg(F,"The service manager refused the action.")),h();return}l.error(`Could not ${M} the background service`,F instanceof Error?F.message:"The dashboard could not complete the action.")}finally{U(null)}}},L=(p.data?.apps??[]).filter(M=>!M.managed),Q=p.data?.currentUser??null,re=p.data?.pm2Home??null,K=L.filter(M=>Eg(M,re)),ae=L.filter(M=>!Eg(M,re));return a.jsxs(a.Fragment,{children:[a.jsx(da,{title:"Processes",description:"The Easy DevOps background service, plus every PM2 app you run for yourself.",actions:a.jsx(W,{variant:"secondary",size:"sm",loading:p.loading||u,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:z,children:"Refresh"})}),p.error&&!p.data?a.jsx(St,{error:p.error,onRetry:p.reload}):p.data?a.jsxs("div",{className:"space-y-5",children:[a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx("div",{className:le("h-0.5 w-full",m?.running?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(Zt,{icon:a.jsx(Sy,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Background service",m&&a.jsx(ge,{tone:m.running?"ok":"warn",dot:!0,children:Ho(m)}),c?.dev&&a.jsx(ge,{tone:"warn",children:"dev data dir"})]}),description:"Runs monitoring and notifications in the background, independent of this dashboard.",actions:m?m.running?a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"secondary",size:"sm",loading:C==="stop",disabled:C!==null,icon:a.jsx(xf,{className:"size-3","aria-hidden":"true"}),onClick:()=>void te("stop"),children:"Stop"}),a.jsx(W,{variant:"secondary",size:"sm",loading:C==="restart",disabled:C!==null,icon:a.jsx(hf,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void te("restart"),children:"Restart"})]}):a.jsx(W,{variant:"primary",size:"sm",loading:C==="start",disabled:C!==null,icon:a.jsx(Ki,{className:"size-3","aria-hidden":"true"}),onClick:()=>void te("start"),children:"Start"}):void 0}),a.jsxs(Kt,{className:"space-y-4",children:[S&&a.jsxs(ye,{tone:"warning",title:S.kind==="install"?"The background service is not installed":`${S.action==="start"?"Starting":S.action==="stop"?"Stopping":"Restarting"} needs ${S.shell??"a terminal with extra rights"}`,action:a.jsx(at,{label:"Dismiss",size:"sm",onClick:()=>k(null),children:a.jsx(Hl,{className:"size-3.5","aria-hidden":"true"})}),children:[S.message&&a.jsx("p",{children:S.message}),a.jsxs("div",{className:"mt-2 rounded-md border border-line bg-canvas p-2.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("code",{className:"break-all font-mono text-xs text-ink",children:S.command}),a.jsx(wt,{value:S.command,label:"Copy command",withText:!0})]}),S.shell&&a.jsxs("p",{className:"mt-1.5 text-2xs text-faint",children:["Run it in ",S.shell,"."]})]}),a.jsx("p",{className:"mt-2 text-2xs text-faint",children:S.kind==="elevation"?"The dashboard cannot elevate itself or ask for a password. Run the command in a terminal you control.":"The command is run in a terminal, not from this dashboard."})]}),d&&!c?a.jsx(St,{error:d,title:"Could not read the service state",onRetry:h,className:"border-0"}):m?a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"grid grid-cols-2 gap-x-4 gap-y-5 sm:grid-cols-4",children:[a.jsx(ls,{label:"Status",value:Ho(m),tone:m.running?"text-ok":"text-warn",detail:m.stoppedByUser&&m.stoppedAtLabel?`Stopped ${m.stoppedAtLabel}`:m.detail??void 0}),a.jsx(ls,{label:"PID",value:m.pid===null?"—":String(m.pid)}),a.jsx(ls,{label:"Uptime",value:Qo(m.uptimeMs)}),a.jsx(ls,{label:"Installed",value:m.installed?"Yes":"No"}),a.jsx(ls,{label:"Mode",value:m.mechanismLabel,detail:m.mechanismDetail}),a.jsx(ls,{label:"Starts",value:m.startsAtLabel}),a.jsx(ls,{label:"Monitoring runs in",value:m.jobsOwnerLabel}),a.jsx(ls,{label:"Live channel",value:m.connected?"Connected":"Not connected"})]}),a.jsxs("div",{className:"flex flex-wrap gap-x-5 gap-y-1 text-2xs text-faint",children:[a.jsxs("span",{className:"min-w-0",children:["Data directory"," ",a.jsx("code",{className:"break-all font-mono text-muted",children:c?.dataDir??"—"})]}),m.version&&a.jsxs("span",{children:["Daemon ",a.jsx("code",{className:"font-mono text-muted",children:m.version})]})]}),m.runtime?a.jsx(FS,{runtime:m.runtime}):a.jsx("p",{className:"text-2xs text-faint",children:"The service and system Node versions are not available for this install."}),m.warnings.map(M=>a.jsx(ye,{tone:"warning",children:a.jsx("span",{className:"whitespace-pre-line",children:M})},M)),!m.running&&a.jsx(ye,{tone:"warning",title:m.stoppedByUser?"The background service is stopped":m.installed?"The background service is not running":"The background service is not set up",children:m.stoppedByUser?a.jsxs(a.Fragment,{children:["You stopped it",m.stoppedAtLabel?` on ${m.stoppedAtLabel}`:"",". Monitoring and notifications are paused until it starts again"," ",m.startsAt==="logon"?"at your next logon":m.startsAt==="boot"?"at the next boot":"when the service starts",". Use Start above, or run"," ",a.jsx("code",{className:"font-mono",children:"ezz service start"}),"."]}):m.installed?a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Start the service with ",a.jsx("code",{className:"font-mono",children:"ezz service start"}),", or use Start above."]}):a.jsxs(a.Fragment,{children:["Monitoring and notifications run in this dashboard and stop when it closes. Set up the service with"," ",a.jsx("code",{className:"font-mono",children:m.installCommand}),"."]})}),a.jsxs("details",{className:"rounded-md border border-line bg-canvas/40 px-3.5 py-3",children:[a.jsx("summary",{className:"cursor-pointer select-none text-xs font-medium text-ink",children:"Install or repair the service"}),a.jsxs("div",{className:"mt-3 space-y-2.5",children:[a.jsx(PS,{command:m.installCommand,guidance:m.installGuidance}),a.jsxs("p",{className:"text-2xs text-faint",children:["The command is run in a terminal, not from this dashboard."," ",m.startsAt==="logon"?"It starts the service at logon.":m.startsAt==="boot"?"It starts the service at boot.":"It sets the service up to start automatically."," ","It never asks for an account password."]})]})]})]}):a.jsxs("div",{className:"flex items-center gap-2 py-6 text-sm text-muted",children:[a.jsx(Ms,{}),"Checking the background service…"]})]})]}),a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx(Zt,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Your PM2 apps",ae.length>0&&a.jsx(ge,{tone:"neutral",children:_n(ae.length,"app")})]}),description:Q?`Apps PM2 is supervising for ${Q}. Easy DevOps itself is not one of them.`:"Apps PM2 is supervising for you. Easy DevOps itself is not one of them.",actions:ae.length>0||K.length>0?a.jsx(e5,{view:E,onChange:Y}):void 0}),p.data.pm2.installed&&p.data.hint&&a.jsx("div",{className:"border-b border-line px-4 py-2.5 sm:px-5",children:a.jsx(ye,{tone:"warning",children:p.data.hint})}),p.error&&a.jsxs("div",{className:"border-b border-line px-4 py-2 text-2xs text-muted sm:px-5",children:["Showing the last known list. ",p.error.message," ",a.jsx("button",{type:"button",className:"font-medium text-ink underline-offset-2 hover:underline",onClick:p.reload,children:"Try again"})]}),p.data.pm2.installed?ae.length===0?a.jsx(Vn,{icon:a.jsx($i,{className:"size-5","aria-hidden":"true"}),title:"No PM2 apps of your own",description:"Start an app with PM2 and it will appear here. Easy DevOps does not run itself under PM2."}):a.jsx("div",{className:"panel-enter",children:E==="table"?a.jsx(Ag,{apps:ae,isModule:!1,busy:b,currentUser:Q,onAction:D,onLogs:N}):a.jsx("ul",{className:"divide-y divide-line/70",children:ae.map(M=>a.jsx(Rg,{app:M,isModule:!1,busy:b,currentUser:Q,onAction:D,onLogs:N},`${M.name}-${M.pmId??"x"}`))})},E):a.jsx(Vn,{icon:a.jsx($i,{className:"size-5","aria-hidden":"true"}),title:"PM2 is not installed",description:"PM2 is optional. It is only for apps you run yourself; Easy DevOps uses its own background service."})]}),K.length>0&&a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx(Zt,{title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["PM2 modules",a.jsx(ge,{tone:"neutral",children:_n(K.length,"module")})]}),description:"Modules extend PM2 itself and are not your apps. Stopping pm2-logrotate lets PM2 logs grow without limit."}),a.jsx("div",{className:"panel-enter",children:E==="table"?a.jsx(Ag,{apps:K,isModule:!0,busy:b,currentUser:Q,onAction:D,onLogs:N}):a.jsx("ul",{className:"divide-y divide-line/70",children:K.map(M=>a.jsx(Rg,{app:M,isModule:!0,busy:b,currentUser:Q,onAction:D,onLogs:N},`${M.name}-${M.pmId??"x"}`))})},E)]})]}):a.jsxs(Ra,{children:[a.jsx(Ze,{className:"h-56 rounded-lg"}),a.jsx(Ze,{className:"h-72 rounded-lg"})]}),y&&a.jsx(IS,{app:y,onClose:()=>N(null)})]})}function a5(l){return l?!/^[a-z0-9][a-z0-9-]{0,39}$/.test(l)||l.endsWith("-")?"Lower-case letters, digits and dashes, up to 40 characters.":null:"A name is required."}function s5(l){return/^ssh:\/\//.test(l)||/^[A-Za-z0-9._-]+@[A-Za-z0-9.-]+:/.test(l)}function l5(l){const o={},c=l.split(/\r?\n/);for(let u=0;u<c.length;u++){const d=c[u];if(!d.trim()||d.trim().startsWith("#"))continue;const h=d.indexOf("=");if(h===-1)return{env:o,error:`Line ${u+1}: expected NAME=value.`};const x=d.slice(0,h).trim().replace(/^export\s+/,"");if(!/^[A-Za-z_][A-Za-z0-9_]*$/.test(x))return{env:o,error:`Line ${u+1}: "${x}" is not a valid variable name.`};let m=d.slice(h+1).trim();m.length>=2&&(m.startsWith('"')&&m.endsWith('"')||m.startsWith("'")&&m.endsWith("'"))&&(m=m.slice(1,-1)),o[x]=m}return{env:o,error:null}}function i5(l){return Object.keys(l).sort().map(o=>`${o}=${l[o]}`).join(`
467
+ `)}function Dg(l){return l===void 0||l===!1?"":Array.isArray(l)?l.join(" && "):l}function Zy(l){return{install:Dg(l.install),build:Dg(l.build),start:l.start??"",port:l.port?String(l.port):"",healthPath:l.healthPath??"",persist:Array.isArray(l.persist)?[...l.persist]:l.persist?[l.persist]:[],skipInstall:l.install===!1||Array.isArray(l.install)&&l.install.length===0,skipBuild:l.build===!1||Array.isArray(l.build)&&l.build.length===0}}function r5(l){const o=l.trim(),c=o.replace(/\\/g,"/").replace(/^\.\/+/,"").replace(/\/+$/,"");if(!c)return{path:null,error:"Enter a folder or file path."};if(c.length>200)return{path:null,error:`"${o}" is longer than 200 characters.`};if(c.startsWith("/")||/^[A-Za-z]:/.test(c))return{path:null,error:`"${o}" must be relative to the project folder.`};const u=c.split("/");return u.some(d=>d===""||d==="."||d==="..")?{path:null,error:`"${o}" must be a relative path without "." or "..".`}:u.includes(".git")?{path:null,error:`"${o}" cannot be ".git".`}:u.includes("node_modules")?{path:null,error:`"${o}" cannot include node_modules.`}:/[<>:"|?*]/.test(c)?{path:null,error:`"${o}" contains characters that are not allowed.`}:{path:c,error:null}}function o5(l,o){const c=r5(l);if(c.error||!c.path)return c;const u=c.path;if(o.includes(u))return{path:null,error:`"${u}" is already listed.`};if(o.length>=20)return{path:null,error:"Use at most 20 paths."};const d=u.toLowerCase();for(const h of o){const x=h.toLowerCase();if(x.startsWith(`${d}/`))return{path:null,error:`"${u}" contains "${h}" — keep only "${u}".`};if(d.startsWith(`${x}/`))return{path:null,error:`"${u}" is inside "${h}" — keep only "${h}".`}}return{path:u,error:null}}function c5(l){const o={};return l.skipInstall?o.install=!1:l.install.trim()&&(o.install=l.install.trim()),l.skipBuild?o.build=!1:l.build.trim()&&(o.build=l.build.trim()),l.start.trim()&&(o.start=l.start.trim()),l.port.trim()&&(o.port=Number(l.port)),l.healthPath.trim()&&(o.healthPath=l.healthPath.trim()),l.persist.length>0&&(o.persist=[...l.persist]),o}const Ky={running:{label:"Deploying",tone:"info"},success:{label:"Succeeded",tone:"ok"},failed:{label:"Failed",tone:"bad"},rolled_back:{label:"Rolled back",tone:"warn"}},u5={fetch:"Fetching the code",settings:"Reading project settings",pre:"Pre-deploy hook",install:"Installing",build:"Building",start:"Starting",health:"Health check",post:"Post-deploy hook",finish:"Finishing",done:"Done"};function bf(l){return u5[l]??l}const d5={manual:"Dashboard",webhook:"GitHub Actions",hub:"Hub",rollback:"Rollback"};function Gi(l){return l?l.slice(0,7):"—"}function f5(l){const o=l.finishedAt??Date.now(),c=Math.max(0,Math.round((o-l.startedAt)/1e3));return c<60?`${c}s`:`${Math.floor(c/60)}m ${c%60}s`}function h5(l){return l==="online"?"ok":l==="errored"?"bad":l==="stopped"||l==="stopping"?"warn":"neutral"}function m5(l){const o=(x,m)=>x===!1?!1:Array.isArray(x)?x.length===0?!1:x.length===1?x[0]:x:x&&x.trim()?x:m,c={install:o(l.install,"npm ci"),build:o(l.build,"npm run build"),start:l.start?.trim()||"npm start",port:l.port??3e3,health:l.healthPath?.trim()||"/"},u=Array.isArray(l.persist)?l.persist:l.persist?.trim()?[l.persist.trim()]:[];u.length>0&&(c.persist=u);const d=o(l.pre,""),h=o(l.post,"");return(d&&d!==""||h&&h!=="")&&(c.hooks={...d&&d!==""?{pre:d}:{},...h&&h!==""?{post:h}:{}}),`${JSON.stringify(c,null,2)}
468
+ `}const x5=`${JSON.stringify({install:"pip install -r requirements.txt",build:!1,start:"python app.py",port:8e3,health:"/health"},null,2)}
469
+ `,p5=[{name:"install",meaning:"Run first, in a fresh checkout. A command, a list of commands, or false to skip.",without:"npm ci (yarn and pnpm are detected from the lockfile)"},{name:"build",meaning:"Run after install. Same forms.",without:'the "build" script, if package.json has one'},{name:"start",meaning:"The long-running process. One command, any language.",without:'the "start" script, else node <main>'},{name:"port",meaning:"The port the app listens on. Passed to it as PORT and used for the health check.",without:"no HTTP check; the process only has to stay up"},{name:"health",meaning:'A path that must answer before the deployment counts: "/healthz", or { "path": "/healthz", "timeout": 60 }.',without:'"/" with a 60-second limit'},{name:"persist",meaning:"Folders or single files your app writes to and you need to keep: uploads, SQLite data, logs. A folder is usually the right unit — SQLite creates -wal and -shm files next to its database; list a file only when that file is all there is.",without:"nothing is kept; each deployment starts from the repository"},{name:"hooks.pre",meaning:"Run before install — check the environment, fetch something.",without:"nothing"},{name:"hooks.post",meaning:"Run once the new release is live — warm a cache, notify someone. A failure is a warning; the release stays.",without:"nothing"}];function g5({items:l,value:o,onChange:c,ariaLabel:u,className:d}){const h=g.useRef(new Map),x=p=>{const b=l[p];b&&(c(b.id),h.current.get(b.id)?.focus())},m=(p,b)=>{p.key==="ArrowRight"?(p.preventDefault(),x((b+1)%l.length)):p.key==="ArrowLeft"?(p.preventDefault(),x((b-1+l.length)%l.length)):p.key==="Home"?(p.preventDefault(),x(0)):p.key==="End"&&(p.preventDefault(),x(l.length-1))};return a.jsx("div",{role:"tablist","aria-label":u,className:le("flex gap-1 overflow-x-auto border-b border-line",d),children:l.map((p,b)=>{const j=p.id===o;return a.jsxs("button",{ref:y=>{y?h.current.set(p.id,y):h.current.delete(p.id)},id:`tab-${p.id}`,role:"tab",type:"button","aria-selected":j,"aria-controls":`panel-${p.id}`,tabIndex:j?0:-1,onClick:()=>c(p.id),onKeyDown:y=>m(y,b),className:le("relative -mb-px flex items-center gap-1.5 whitespace-nowrap border-b-2 px-3 py-2.5 text-sm font-medium transition-colors duration-[var(--ez-motion-fast)]",j?"border-accent text-ink":"border-transparent text-muted hover:border-line-strong hover:text-ink"),children:[p.label,p.count!==void 0&&a.jsx("span",{className:le("rounded-pill px-1.5 py-0.5 text-2xs",j?"bg-accent-soft text-accent-text":"bg-inset text-faint"),children:p.count})]},p.id)})})}function Ui({id:l,value:o,children:c}){return l!==o?null:a.jsx("div",{role:"tabpanel",id:`panel-${l}`,"aria-labelledby":`tab-${l}`,className:"page-enter",children:c})}function _o(l,o){return l instanceof Le||l instanceof Error?l.message:o}function y5({app:l,onClose:o,onDeleted:c}){const u=jt(),[d,h]=g.useState(!1),[x,m]=g.useState(!1),[p,b]=g.useState(!1);g.useEffect(()=>{l&&(h(!1),m(!1))},[l]);const j=!!(l&&(l.hasSharedData||(Array.isArray(l.settings.persist)?l.settings.persist.length>0:l.settings.persist))),y=async()=>{if(!(!l||p)){b(!0);try{const N=await ie.deployments.remove(l.id,{deleteDomain:d&&!!l.domain,purgeData:x}),C=N.sharedKept&&N.sharedPath?`Persistent data was kept in ${N.sharedPath}.`:"";N.warning?u.warning(`${l.id} deleted`,`${N.warning} ${C}`.trim()):u.success(`${l.id} deleted`,[N.domainDeleted?`${l.domain} was removed too.`:"",C].filter(Boolean).join(" ")||void 0),c()}catch(N){u.error(`Could not delete ${l.id}`,_o(N,"Nothing was changed."))}finally{b(!1)}}};return a.jsx(bn,{open:l!==null,onClose:o,preventClose:p,size:"sm",title:`Delete ${l?.id??""}?`,footer:a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"secondary",onClick:o,disabled:p,children:"Cancel"}),a.jsx(W,{variant:"danger",onClick:()=>void y(),loading:p,children:"Delete app"})]}),children:a.jsxs("div",{className:"space-y-4 text-sm text-muted",children:[a.jsx("p",{children:"Its process is stopped and removed from PM2, and every release, log and its deploy key are deleted from this server. The repository is not touched."}),l?.dir&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:l.dir}),j&&l&&a.jsxs("div",{className:"space-y-2 rounded-md border border-line bg-inset/40 p-3",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:"Persistent data"}),a.jsx("p",{className:"text-xs",children:"Folders this app writes to are kept by default, so a later app with the same name can pick up its database and uploads."}),l.sharedDir&&a.jsx("p",{className:"break-all font-mono text-2xs text-faint",children:l.sharedDir}),a.jsx(is,{label:"Also delete the persistent data",hint:"The shared folders are deleted too and cannot be recovered.",checked:x,onChange:m})]}),l?.domain&&a.jsx(is,{label:a.jsxs(a.Fragment,{children:["Also delete the domain ",a.jsx("span",{className:"font-mono text-ink",children:l.domain})]}),hint:"Its nginx config is removed and the site stops answering. Leave this off to keep the domain.",checked:d,onChange:h})]})})}function v5({app:l,meta:o,onChanged:c,onDelete:u}){const d=jt(),[h,x]=g.useState(""),[m,p]=g.useState(!1),[b,j]=g.useState(!1),[y,N]=g.useState(""),[C,U]=g.useState(!1),S=h.trim().toLowerCase(),k=o.domains.find(D=>D.name===S),E=l.settings.port??null,T=async()=>{if(!(!S||b)){j(!0);try{const D=await ie.deployments.linkDomain(l.id,S,m&&!k?.ssl),te=D.created?`${D.domain} was created and proxies to port ${D.port}.`:`${D.domain} now proxies to port ${D.port}.`;D.ssl&&!D.ssl.ok?d.warning("Linked, without a certificate",`${te} ${D.ssl.detail}`):D.nginxReloaded?d.success("Domain linked",D.ssl?.ok?`${te} ${D.ssl.detail}`:te):d.warning("Linked, but nginx was not reloaded",`${te} Reload nginx for it to take effect.`),x(""),p(!1),c()}catch(D){d.error("Could not link the domain",_o(D,"Nothing was changed."))}finally{j(!1)}}},Y=async()=>{try{await ie.deployments.unlinkDomain(l.id),d.success("Link removed",`${l.domain} is still configured; only the link is gone.`),c()}catch(D){d.error("Could not remove the link",_o(D,"Nothing was changed."))}},z=async()=>{if(!(!y.trim()||C)){U(!0);try{const D=await ie.deployments.move(l.id,y.trim());D.warning?d.warning("Moved",D.warning):d.success("App moved",`${D.to}${D.restarted?" — and started again.":""}`),N(""),c()}catch(D){d.error("Could not move the app",_o(D,"It is still where it was."))}finally{U(!1)}}};return a.jsxs("div",{className:"space-y-7",children:[a.jsxs("section",{className:"space-y-3",children:[a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(rs,{className:"mt-0.5 size-4 shrink-0 text-muted","aria-hidden":"true"}),a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Domain"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Point a domain at this app. nginx proxies it to the app’s port, and a deployment that changes the port takes the domain with it."})]})]}),l.domain?a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 rounded-md border border-line bg-inset/40 px-3.5 py-2.5",children:[a.jsxs("div",{className:"min-w-0",children:[a.jsx("div",{className:"truncate font-mono text-sm text-ink",children:l.domain}),a.jsxs("div",{className:"text-2xs text-faint",children:[E?`Proxies to port ${E}.`:"Proxies to the app’s port."," Edit it on the Domains page."]})]}),a.jsx(W,{size:"sm",icon:a.jsx(Y2,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void Y(),children:"Remove link"})]}):null,a.jsxs("div",{className:"space-y-2.5",children:[a.jsxs("div",{children:[a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(Ee,{label:l.domain?"Link a different domain":"Domain name",value:h,onChange:D=>x(D.target.value),placeholder:"app.example.com",list:"deploy-domain-options","aria-describedby":"deploy-domain-hint",className:"min-w-56 flex-1 font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(W,{variant:"primary",onClick:()=>void T(),loading:b,disabled:!S,children:"Link domain"})]}),a.jsx("p",{id:"deploy-domain-hint",className:"mt-1.5 text-xs text-faint",children:S?k?"This domain exists. It will be re-pointed at this app.":"This domain will be created.":"Type a new name, or pick one of your domains."})]}),a.jsx("datalist",{id:"deploy-domain-options",children:o.domains.map(D=>a.jsx("option",{value:D.name},D.name))}),S&&!k?.ssl&&a.jsx(is,{label:"Request an SSL certificate",hint:"Over HTTP-01, so the domain’s DNS must already point at this server. If it cannot be issued the domain still works over HTTP, and you can issue it later from the SSL page.",checked:m,onChange:p}),!E&&!l.currentRelease&&a.jsxs(ye,{tone:"info",children:["The app needs a port first: set one in Edit, or put ",a.jsx("code",{className:"font-mono",children:"port"})," ","in ez.json and deploy once."]})]})]}),a.jsxs("section",{className:"space-y-3 border-t border-line pt-6",children:[a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(z2,{className:"mt-0.5 size-4 shrink-0 text-muted","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0",children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Folder"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Where this app’s releases, logs and deploy key live. It stays here even if the deployments folder in Settings changes."}),a.jsx("p",{className:"mt-1.5 break-all font-mono text-2xs text-ink",children:l.dir??"—"})]})]}),a.jsxs("div",{children:[a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(Ee,{label:"Move to",value:y,onChange:D=>N(D.target.value),placeholder:o.deployDir??"/srv/ez_deploys","aria-describedby":"deploy-move-hint",className:"min-w-56 flex-1 font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(W,{onClick:()=>void z(),loading:C,disabled:!y.trim()||!!l.deploying,children:"Move app"})]}),a.jsx("p",{id:"deploy-move-hint",className:"mt-1.5 text-xs text-faint",children:y.trim()?`The app will be in ${y.trim().replace(/[\\/]+$/,"")}/${l.id}`:"A folder on this server. The app goes into a subfolder named after it."})]}),a.jsx("p",{className:"text-2xs text-faint",children:"The app is stopped, its folder is moved, and it is started again from the new place. To another disk this copies every release, and can take a while."})]}),a.jsxs("section",{className:"flex flex-wrap items-center justify-between gap-3 border-t border-line pt-6",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-semibold text-ink",children:"Delete this app"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Stops it and removes its folder. You are asked what to do with its domain."})]}),a.jsx(W,{variant:"danger",icon:a.jsx(Hs,{className:"size-4","aria-hidden":"true"}),onClick:u,disabled:!!l.deploying,children:"Delete app"})]})]})}function b5(l,o){const c=URL.createObjectURL(new Blob([o],{type:"application/json"})),u=document.createElement("a");u.href=c,u.download=l,document.body.appendChild(u),u.click(),u.remove(),URL.revokeObjectURL(c)}function j5({app:l,locations:o}){const c=m5(l.settings);return a.jsxs("div",{className:"space-y-6",children:[a.jsxs("div",{className:"space-y-2 text-xs text-muted",children:[a.jsxs("p",{children:[a.jsx("code",{className:"font-mono text-ink",children:"ez.json"})," is an optional file in your repository that says how the project is installed, built and started. Keeping it with the code means the commands are reviewed and versioned like everything else, and a new server needs no setup."]}),a.jsxs("p",{children:[a.jsx("strong",{className:"font-medium text-ink",children:"You do not need one for a Node project"})," — without it, the scripts in ",a.jsx("code",{className:"font-mono",children:"package.json"})," are used. You do need one for any other language."]})]}),a.jsxs("ol",{className:"space-y-5",children:[a.jsxs("li",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"1. Create the file"}),a.jsxs("p",{className:"text-xs text-muted",children:["This is what ",a.jsx("span",{className:"font-mono",children:l.id})," deploys with today. Change the commands to match your project."]}),a.jsx("pre",{className:"overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-ink",children:c}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(wt,{value:c,label:"Copy ez.json",withText:!0}),a.jsx(W,{size:"sm",icon:a.jsx(Xd,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>b5("ez.json",c),children:"Download ez.json"})]})]}),a.jsxs("li",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"2. Put it in the repository"}),a.jsxs("p",{className:"text-xs text-muted",children:["At the top of the repository, next to ",a.jsx("code",{className:"font-mono",children:"package.json"}),". It is looked for in this order:"," ",o.map((u,d)=>a.jsxs("span",{children:[a.jsx("code",{className:"font-mono text-ink",children:u}),d<o.length-1?", ":"."]},u))]})]}),a.jsxs("li",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"3. Commit, push, deploy"}),a.jsxs("p",{className:"text-xs text-muted",children:["The next deployment reads it. Its log shows where each value came from —"," ",a.jsx("code",{className:"font-mono",children:"[ez.json]"}),", ",a.jsx("code",{className:"font-mono",children:"[package.json]"})," ","or ",a.jsx("code",{className:"font-mono",children:"[override]"})," — so you can see that it was picked up."]})]})]}),a.jsxs("div",{children:[a.jsx("h4",{className:"mb-2 text-sm font-medium text-ink",children:"What each field means"}),a.jsx("div",{className:"overflow-x-auto rounded-md border border-line",children:a.jsxs("table",{className:"w-full text-left text-2xs",children:[a.jsx("thead",{className:"border-b border-line bg-inset/50 text-faint",children:a.jsxs("tr",{children:[a.jsx("th",{className:"px-3 py-2 font-semibold uppercase tracking-wider",children:"Field"}),a.jsx("th",{className:"px-3 py-2 font-semibold uppercase tracking-wider",children:"Meaning"}),a.jsx("th",{className:"px-3 py-2 font-semibold uppercase tracking-wider",children:"If you leave it out"})]})}),a.jsx("tbody",{className:"divide-y divide-line",children:p5.map(u=>a.jsxs("tr",{children:[a.jsx("td",{className:"whitespace-nowrap px-3 py-2 align-top font-mono text-ink",children:u.name}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:u.meaning}),a.jsx("td",{className:"px-3 py-2 align-top text-muted",children:u.without})]},u.name))})]})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"Not a Node project?"}),a.jsx("p",{className:"text-xs text-muted",children:"The commands are run exactly as written, so any language works. A Python app:"}),a.jsx("pre",{className:"overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-ink",children:x5})]}),a.jsxs(ye,{tone:"info",title:"Which one wins",children:["A value set on the app (Edit) overrides ",a.jsx("code",{className:"font-mono",children:"ez.json"}),", which overrides ",a.jsx("code",{className:"font-mono",children:"package.json"}),". To let the file decide, leave that field empty in Edit. A mistake in the file stops the deployment before anything that is running is touched."]})]})}function $o(l,o){return l instanceof Le||l instanceof Error?l.message:o}function N5({appId:l,run:o}){const c=xt(p=>ie.deployments.run(l,o.id,p),[l,o.id]),u=(c.data?.status??o.status)==="running";Os(c.reload,1500,u);const d=g.useRef(null),h=g.useRef(!0),x=c.data?.log??"";g.useEffect(()=>{const p=d.current;p&&h.current&&(p.scrollTop=p.scrollHeight)},[x]);const m=c.data??o;return a.jsxs("div",{className:"space-y-2.5",children:[m.error&&a.jsx(ye,{tone:m.status==="rolled_back"?"warning":"danger",title:m.status==="rolled_back"?"The new release was not healthy — the previous one is running again":`Failed while: ${bf(m.step).toLowerCase()}`,children:m.error}),m.warnings?.map(p=>a.jsx(ye,{tone:"warning",children:p},p)),c.error&&!c.data?a.jsx(St,{error:c.error,onRetry:c.reload,title:"Could not load the log"}):a.jsxs("pre",{ref:d,onScroll:p=>{const b=p.currentTarget;h.current=b.scrollHeight-b.scrollTop-b.clientHeight<24},className:"h-[42vh] overflow-auto whitespace-pre-wrap break-all rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-muted","aria-label":"Deployment log","aria-busy":u,children:[c.data?.logTruncated&&`… earlier output is not shown …
470
+ `,x||(c.loading?"Loading…":"No output yet.")]})]})}function w5({app:l,initialRunId:o}){const[c,u]=g.useState(o);if(g.useEffect(()=>{l.activeRunId&&u(l.activeRunId)},[l.activeRunId]),l.runs.length===0)return a.jsx(Vn,{icon:a.jsx(M2,{className:"size-5","aria-hidden":"true"}),title:"No deployments yet",description:"Press Deploy to build and start this app for the first time."});const d=l.runs.find(h=>h.id===c)??l.runs[0];return a.jsxs("div",{className:"grid gap-4 lg:grid-cols-[17rem_minmax(0,1fr)]",children:[a.jsx("ul",{className:"max-h-[52vh] space-y-1 overflow-y-auto pr-1","aria-label":"Deployments",children:l.runs.map(h=>{const x=Ky[h.status],m=h.id===d.id;return a.jsx("li",{children:a.jsxs("button",{type:"button",onClick:()=>u(h.id),"aria-current":m?"true":void 0,className:le("w-full rounded-md border px-3 py-2 text-left transition-colors duration-[var(--ez-motion-fast)]",m?"border-accent/40 bg-accent-soft":"border-transparent hover:bg-inset"),children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx(ge,{tone:x.tone,dot:!0,children:h.status==="running"?bf(h.step):x.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:Gi(h.sha)})]}),a.jsxs("div",{className:"mt-1 flex items-center justify-between gap-2 text-2xs text-muted",children:[a.jsx("span",{children:d5[h.trigger]??h.trigger}),a.jsxs("span",{title:gf(h.startedAt),children:[Pi(h.startedAt)," · ",f5(h)]})]})]})},h.id)})}),a.jsx(N5,{appId:l.id,run:d},d.id)]})}function S5({app:l,onRollback:o,onDelete:c,deleting:u,busy:d}){return l.releases.length===0?a.jsx(Vn,{title:"No releases on disk",description:"Each successful deployment leaves a release here to roll back to."}):a.jsxs("div",{className:"space-y-3",children:[a.jsxs("p",{className:"text-xs text-muted",children:["A rollback starts an earlier release exactly as it was built — nothing is fetched or rebuilt. The newest ",l.keepReleases," are kept."]}),a.jsx("ul",{className:"divide-y divide-line rounded-md border border-line",children:l.releases.map(h=>a.jsxs("li",{className:"flex flex-wrap items-center gap-3 px-3.5 py-2.5",children:[a.jsxs("div",{className:"min-w-0 flex-1",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"font-mono text-xs text-ink",children:h.id}),h.current&&a.jsx(ge,{tone:"ok",children:"Live"}),h.previous&&a.jsx(ge,{tone:"neutral",children:"Previous"})]}),a.jsxs("div",{className:"mt-0.5 font-mono text-2xs text-faint",children:[Gi(h.sha),h.ref?` · ${h.ref}`:""]})]}),!h.current&&a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(W,{size:"sm",icon:a.jsx(xN,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>o(h),disabled:d||!h.startable,title:h.startable?void 0:"This release never got as far as starting.",children:"Roll back to this"}),a.jsx(W,{variant:"dangerGhost",size:"sm",icon:a.jsx(Hs,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>c(h),loading:u===h.id,disabled:d||h.previous,title:h.previous?"An automatic rollback would return to this release. Delete it after the next deployment.":`Delete the files of release ${h.id}`,children:"Delete"})]})]},h.id))})]})}function Hi({n:l,title:o,children:c}){return a.jsxs("li",{className:"flex gap-3",children:[a.jsx("span",{className:"mt-0.5 flex size-5 shrink-0 items-center justify-center rounded-pill bg-inset font-mono text-2xs font-semibold text-muted","aria-hidden":"true",children:l}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:o}),c]})]})}function _g({name:l,value:o,note:c}){return a.jsxs("div",{className:"rounded-md border border-line bg-inset/50 p-2.5",children:[a.jsxs("div",{className:"flex items-center justify-between gap-2",children:[a.jsx("code",{className:"font-mono text-xs font-semibold text-ink",children:l}),a.jsx(wt,{value:l,label:`Copy the name ${l}`})]}),o?a.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[a.jsx("code",{className:"min-w-0 break-all font-mono text-2xs text-muted",children:o}),a.jsx(wt,{value:o,label:`Copy the value of ${l}`,withText:!0})]}):c&&a.jsx("p",{className:"mt-1.5 text-2xs text-faint",children:c})]})}function k5({app:l,hook:o,onConfigureHook:c,onChanged:u}){const d=jt(),h=sn(),x=xt(_=>ie.deployments.github(l.id,_),[l.id,o.enabled,o.domain,o.bind,o.port,l.branch]),[m,p]=g.useState(null),[b,j]=g.useState(!1),[y,N]=g.useState(null),[C,U]=g.useState(""),[S,k]=g.useState(!1),[E,T]=g.useState(null),Y=async()=>{if(!b&&!(l.hook.hasToken&&!await h({title:"Replace the deploy token?",body:"The current token stops working immediately. The repository’s EZ_DEPLOY_TOKEN secret has to be updated before the next push can deploy.",confirmLabel:"Replace token",tone:"danger"}))){j(!0);try{const _=await ie.deployments.issueHookToken(l.id);p(_.token),u()}catch(_){d.error("Could not create the token",$o(_,"Try again."))}finally{j(!1)}}};if(x.error&&!x.data)return a.jsx(St,{error:x.error,onRetry:x.reload});if(!x.data)return a.jsx(Ze,{className:"h-64 rounded-lg"});const z=x.data,D=l.hook.hasToken||m!==null,te=z.targets??[{id:"hook",label:"This server’s deploy hook",url:z.hookUrl,secure:z.hookSecure,note:z.hookNote}],L=_=>!!_.url&&(_.id!=="hub"||_.ready!==!1),Q=te.find(_=>_.id===y)??te.find(L)??te[0],re=L(Q),K=/github\.com[:/]/.test(l.repoUrl),ae=l.authType==="deployKey"?1:0,M=async()=>{if(!S&&!(l.hook.hasToken&&!await h({title:"Set up GitHub automatically?",body:"A new deploy token is created and stored straight into the repository’s secrets; the current one stops working. The workflow file is committed to the branch, which starts a deployment.",confirmLabel:"Set up",tone:"accent"}))){k(!0),T(null);try{const _=await ie.deployments.applyGithub(l.id,{target:Q.id,...C.trim()?{token:C.trim()}:{}});T(_),U(""),p(null),u(),_.ok?d.success("GitHub is set up",`${_.repo} deploys on every push to ${l.branch}.`):d.warning("Partly set up","Some steps need a token with more access. They are listed below.")}catch(_){const se=_ instanceof Le?_.payload:null;se&&Array.isArray(se.steps)&&T(se),d.error("Could not set up GitHub",$o(_,"Nothing was changed on GitHub."))}finally{k(!1)}}};return a.jsxs("div",{className:"space-y-5",children:[a.jsxs("div",{className:"rounded-md border border-line bg-inset/40 p-3.5",children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"How it works"}),a.jsxs("ol",{className:"mt-2 list-decimal space-y-1 pl-4 text-xs text-muted",children:[a.jsxs("li",{children:["You push to ",a.jsx("code",{className:"font-mono text-ink",children:l.branch}),"."]}),a.jsx("li",{children:"GitHub runs the workflow file in your repository. It makes one request: “deploy this commit”, with the app’s deploy token."}),a.jsx("li",{children:"This server fetches that commit, builds it and starts it — the same steps as the Deploy button, with the log in the Deployments tab."}),a.jsx("li",{children:"The workflow waits for the result. A green check means the new version is live; a red one means it failed, and the previous version is still running."})]}),a.jsx("p",{className:"mt-2 text-xs text-muted",children:"GitHub never gets access to the server: it holds a URL and a token that can start a deployment of this one app, and nothing else."})]}),te.length>1&&a.jsx(os,{label:"How GitHub reaches this server",value:Q.id,onChange:_=>N(_.target.value),hint:Q.note,children:te.map(_=>a.jsxs("option",{value:_.id,children:[_.label,L(_)?"":" — not available yet"]},_.id))}),re?!Q.secure&&a.jsx(ye,{tone:"warning",title:"The deploy token would be sent unencrypted",action:Q.id==="hook"?a.jsx(W,{size:"sm",onClick:c,children:"Change"}):void 0,children:Q.note}):a.jsx(ye,{tone:"warning",title:Q.id==="hub"?"Not available through the Hub yet":"GitHub cannot reach this server yet",action:Q.id==="hook"?a.jsx(W,{size:"sm",onClick:c,children:"Set up the deploy hook"}):void 0,children:Q.note}),K&&a.jsx("div",{className:"rounded-md border border-line bg-inset/40 p-3.5",children:a.jsxs("div",{className:"flex items-start gap-2.5",children:[a.jsx(XN,{className:"mt-0.5 size-4 shrink-0 text-accent-text","aria-hidden":"true"}),a.jsxs("div",{className:"min-w-0 flex-1 space-y-2.5",children:[a.jsxs("div",{children:[a.jsx("h4",{className:"text-sm font-medium text-ink",children:"Do it for me"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["Stores both secrets, commits the workflow file",l.authType==="deployKey"?" and adds the deploy key":"",". Needs a GitHub token that may write this repository’s ",a.jsx("em",{children:"secrets"}),", ",a.jsx("em",{children:"contents"})," and"," ",a.jsx("em",{children:"workflows"}),l.authType==="deployKey"?", and administer it (for the deploy key)":"",". A token typed here is used once and not stored."]})]}),a.jsxs("div",{className:"flex flex-wrap items-end gap-2",children:[a.jsx(Ee,{label:"GitHub token",optional:l.authType==="token"&&l.hasToken,type:"password",value:C,onChange:_=>U(_.target.value),placeholder:l.authType==="token"&&l.hasToken?"leave empty to try the app’s token":"github_pat_…",autoComplete:"off",spellCheck:!1,className:"min-w-56 flex-1"}),a.jsx(W,{variant:"primary",onClick:()=>void M(),loading:S,disabled:!re||!C.trim()&&!(l.authType==="token"&&l.hasToken),children:"Set up on GitHub"})]}),E&&a.jsxs("ul",{className:"space-y-1.5","aria-label":"Setup result",children:[E.error&&a.jsxs("li",{className:"flex items-start gap-2 text-xs text-bad",children:[a.jsx(Vd,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:E.error})]}),E.steps.map(_=>a.jsxs("li",{className:le("flex items-start gap-2 text-xs",_.ok?"text-muted":"text-bad"),children:[_.ok?a.jsx(_s,{className:"mt-0.5 size-3.5 shrink-0 text-ok","aria-hidden":"true"}):a.jsx(Vd,{className:"mt-0.5 size-3.5 shrink-0","aria-hidden":"true"}),a.jsx("span",{children:_.detail})]},_.id))]})]})]})}),a.jsx("h4",{className:"text-xs font-semibold uppercase tracking-[0.14em] text-faint",children:K?"Or by hand":"Steps"}),a.jsxs("ol",{className:"space-y-5",children:[z.deployKey!==null&&a.jsxs(Hi,{n:1,title:"Let this server read the repository",children:[a.jsx("p",{className:"text-xs text-muted",children:"In the repository: Settings → Deploy keys → Add deploy key. Paste this, and leave “Allow write access” off."}),a.jsxs("div",{className:"flex items-start justify-between gap-2 rounded-md border border-line bg-inset/50 p-2.5",children:[a.jsx("code",{className:"min-w-0 break-all font-mono text-2xs text-muted",children:z.deployKey}),a.jsx(wt,{value:z.deployKey,label:"Copy the deploy key",withText:!0})]})]}),l.authType==="deployKey"&&z.deployKey===null&&a.jsx(Hi,{n:1,title:"Let this server read the repository",children:a.jsx(ye,{tone:"warning",children:"This app uses a deploy key but none has been generated. Open Edit and press “Generate key”."})}),a.jsxs(Hi,{n:ae+1,title:"Create the deploy token",children:[a.jsx("p",{className:"text-xs text-muted",children:"It can start a deployment of this app and nothing else. Only a hash of it is stored here, so it is shown once."}),m?a.jsx(ye,{tone:"success",title:"Copy it now — it will not be shown again",children:a.jsxs("div",{className:"mt-1.5 flex items-center justify-between gap-2",children:[a.jsx("code",{className:"min-w-0 break-all font-mono text-2xs",children:m}),a.jsx(wt,{value:m,label:"Copy the deploy token",withText:!0})]})}):a.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx(W,{size:"sm",icon:a.jsx(Zi,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void Y(),loading:b,children:l.hook.hasToken?"Replace the token":"Create token"}),l.hook.hasToken&&a.jsxs("span",{className:"text-2xs text-faint",children:["One exists, ending in"," ",a.jsx("code",{className:"font-mono",children:l.hook.tokenHint}),l.hook.createdAt?`, created ${gf(l.hook.createdAt)}`:"","."]})]})]}),a.jsxs(Hi,{n:ae+2,title:"Add two repository secrets",children:[a.jsx("p",{className:"text-xs text-muted",children:"In the repository: Settings → Secrets and variables → Actions → New repository secret."}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(_g,{name:"EZ_DEPLOY_URL",value:re?Q.url:null,note:"Available once GitHub can reach this server (see above)."}),a.jsx(_g,{name:"EZ_DEPLOY_TOKEN",value:m,note:D?"The token from the step above. If you no longer have it, replace it.":"Create the token in the step above first."})]})]}),a.jsxs(Hi,{n:ae+3,title:"Add the workflow file",children:[a.jsxs("p",{className:"text-xs text-muted",children:["Commit this to the repository as"," ",a.jsx("code",{className:"break-all font-mono text-ink",children:z.workflowPath}),". It contains no secrets, and it is the same file whichever way GitHub reaches the server."]}),a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(wt,{value:z.workflowPath,label:"Copy the file path",withText:!0}),a.jsx(wt,{value:z.workflow,label:"Copy the workflow",withText:!0})]}),a.jsx("pre",{className:"max-h-64 overflow-auto rounded-md border border-line bg-canvas p-3.5 font-mono text-2xs leading-relaxed text-muted",children:z.workflow})]})]}),a.jsxs(ye,{tone:"info",title:"Optional: ez.json",children:["To keep the install, build and start commands with the code, add an"," ",a.jsx("code",{className:"font-mono",children:"ez.json"})," to the repository. Without one, a Node project is deployed from its ",a.jsx("code",{className:"font-mono",children:"package.json"})," scripts."]})]})}function T5({appId:l,hook:o,meta:c,initialTab:u="activity",onClose:d,onConfigureHook:h,onChanged:x,onDelete:m}){const p=jt(),b=sn(),j=l!==null,[y,N]=g.useState(u),[C,U]=g.useState(!1),[S,k]=g.useState(null),E=xt(D=>ie.deployments.get(l??"",D),[l],{enabled:j}),T=E.data&&E.data.id===l?E.data:null;g.useEffect(()=>{j&&N(u)},[j,l,u]),Os(E.reload,2e3,j&&!!T?.deploying),Os(E.reload,8e3,j&&!!T&&!T?.deploying);const Y=async D=>{if(!(!T||C||!await b({title:`Roll back ${T.id}?`,body:`Release ${D.id} (${Gi(D.sha)}) will be started in place of the live one. The app restarts.`,confirmLabel:"Roll back",tone:"danger"}))){U(!0);try{await ie.deployments.rollback(T.id,D.id),p.info("Rollback started"),N("activity"),E.reload(),x()}catch(L){p.error("Could not roll back",$o(L,"Nothing was changed."))}finally{U(!1)}}},z=async D=>{if(!(!T||C||S||!await b({title:`Delete release ${D.id}?`,body:`Its files (${Gi(D.sha)}) are removed from this server. The deployment log stays. The live release and the one an automatic rollback would return to cannot be deleted.`,confirmLabel:"Delete release",tone:"danger"}))){k(D.id);try{await ie.deployments.removeRelease(T.id,D.id),p.success("Release deleted"),E.reload(),x()}catch(L){p.error("Could not delete the release",$o(L,"Nothing was changed."))}finally{k(null)}}};return a.jsx(bn,{open:j,onClose:d,size:"xl",title:a.jsxs("span",{className:"flex flex-wrap items-center gap-2.5",children:[a.jsx("span",{className:"font-mono",children:l}),T?.deploying&&a.jsx(ge,{tone:"info",dot:!0,children:"Deploying"})]}),description:T?`${T.repoUrl} · ${T.branch}`:void 0,children:E.error&&!T?a.jsx(St,{error:E.error,onRetry:E.reload}):T?a.jsxs("div",{className:"space-y-4",children:[a.jsx(g5,{ariaLabel:"App sections",value:y,onChange:N,items:[{id:"activity",label:"Deployments",count:T.runs.length},{id:"releases",label:"Releases",count:T.releases.length},{id:"setup",label:"Domain & folder"},{id:"github",label:"GitHub Actions"},{id:"ezjson",label:"ez.json"}]}),a.jsx(Ui,{id:"activity",value:y,children:a.jsx(w5,{app:T,initialRunId:T.activeRunId??null})}),a.jsx(Ui,{id:"releases",value:y,children:a.jsx(S5,{app:T,onRollback:D=>void Y(D),onDelete:D=>void z(D),deleting:S,busy:C||!!T.deploying})}),a.jsx(Ui,{id:"setup",value:y,children:a.jsx(v5,{app:T,meta:c,onChanged:()=>{E.reload(),x()},onDelete:()=>m(T)})}),a.jsx(Ui,{id:"ezjson",value:y,children:a.jsx(j5,{app:T,locations:c.ezFileLocations})}),a.jsx(Ui,{id:"github",value:y,children:a.jsx(k5,{app:T,hook:o,onConfigureHook:h,onChanged:()=>{E.reload(),x()}})}),!o.enabled&&y!=="github"&&T.hook.hasToken&&a.jsx(ye,{tone:"warning",title:"The deploy hook is switched off",children:a.jsxs("span",{className:"inline-flex items-center gap-1.5",children:[a.jsx(Aa,{className:"size-3.5","aria-hidden":"true"}),"This app has a deploy token, but nothing is listening for it."]})})]}):a.jsxs("div",{className:"flex items-center gap-2.5 py-10 text-sm text-muted",children:[a.jsx(Ms,{})," Loading…"]})})}function Og(l){return{id:"",repoUrl:"",branch:"main",authType:"none",token:"",settings:Zy({}),envText:"",keepReleases:String(l),autoRollback:!0,notifyChannelIds:[]}}function C5(l){return{id:l.id,repoUrl:l.repoUrl,branch:l.branch,authType:l.authType,token:"",settings:Zy(l.settings),envText:i5(l.env),keepReleases:String(l.keepReleases),autoRollback:l.autoRollback,notifyChannelIds:l.notifyChannelIds}}function Mg(l,o){return l instanceof Le||l instanceof Error?l.message:o}function E5({open:l,app:o,meta:c,onClose:u,onSaved:d}){const h=jt(),x=o!==null,[m,p]=g.useState(()=>Og(c.limits.keepReleasesDefault)),[b,j]=g.useState(!1),[y,N]=g.useState(!1),[C,U]=g.useState(null),[S,k]=g.useState(!1);g.useEffect(()=>{l&&(p(o?C5(o):Og(c.limits.keepReleasesDefault)),U(o?.deployKey??null),j(!1))},[l,o?.id]);const E=M=>p(_=>({..._,...M})),T=M=>p(_=>({..._,settings:{..._.settings,...M}})),Y=m.repoUrl.trim(),z=s5(Y),D=l5(m.envText),te=Number(m.keepReleases),L={id:x?null:a5(m.id.trim()),repoUrl:Y?m.authType==="token"&&z?"Token access needs an https:// URL.":m.authType==="deployKey"&&!z?"A deploy key needs an SSH URL, like git@github.com:owner/repo.git.":null:"A repository URL is required.",token:m.authType==="token"&&!m.token.trim()&&!(x&&o?.hasToken)?"A token is required.":null,port:m.settings.port.trim()?Po(m.settings.port):null,healthPath:m.settings.healthPath.trim()&&!m.settings.healthPath.trim().startsWith("/")?'Must start with "/".':null,env:D.error,keepReleases:!Number.isInteger(te)||te<c.limits.keepReleasesMin||te>c.limits.keepReleasesMax?`A whole number from ${c.limits.keepReleasesMin} to ${c.limits.keepReleasesMax}.`:null},Q=Object.values(L).some(Boolean),re=async()=>{if(y||(j(!0),Q))return;const M={repoUrl:Y,branch:m.branch.trim()||"main",authType:m.authType,settings:c5(m.settings),env:D.env,keepReleases:te,autoRollback:m.autoRollback,notifyChannelIds:m.notifyChannelIds};m.token.trim()&&(M.token=m.token.trim()),N(!0);try{const _=x?await ie.deployments.update(o.id,M):await ie.deployments.create({...M,id:m.id.trim()});d(_,!x)}catch(_){h.error(x?"Could not save the app":"Could not create the app",Mg(_,"Nothing was changed."))}finally{N(!1)}},K=async()=>{if(!(!o||S)){k(!0);try{const M=await ie.deployments.generateDeployKey(o.id);U(M.publicKey),h.success("Deploy key generated","Add the public key to the repository, read-only.")}catch(M){h.error("Could not generate the key",Mg(M,"Try again."))}finally{k(!1)}}},ae=M=>b?L[M]:null;return a.jsx(bn,{open:l,onClose:u,preventClose:y,size:"lg",title:x?`Edit ${o.id}`:"New app",description:x?"Changes apply to the next deployment. The running release is not touched.":"Where the code lives and how this server may read it. Everything else can be left to the project.",footer:a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"secondary",onClick:u,disabled:y,children:"Cancel"}),a.jsx(W,{variant:"primary",type:"submit",form:"deploy-app-form",loading:y,children:x?"Save app":"Create app"})]}),children:a.jsxs("form",{id:"deploy-app-form",className:"space-y-6",onSubmit:M=>{M.preventDefault(),re()},noValidate:!0,children:[a.jsxs("section",{className:"space-y-4",children:[a.jsxs(Ea,{children:[a.jsx(Ee,{label:"Name",value:m.id,onChange:M=>E({id:M.target.value.toLowerCase()}),disabled:x,error:ae("id"),hint:x?"The name cannot be changed.":"Used for its folder and its PM2 process (ez-<name>).",placeholder:"my-api",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsx(Ee,{label:"Branch",value:m.branch,onChange:M=>E({branch:M.target.value}),hint:"Deployed when no specific commit is named.",placeholder:"main",className:"font-mono",spellCheck:!1})]}),a.jsx(Ee,{label:"Repository URL",value:m.repoUrl,onChange:M=>E({repoUrl:M.target.value}),error:ae("repoUrl"),hint:"https://github.com/owner/repo.git, or git@github.com:owner/repo.git for a deploy key.",placeholder:"https://github.com/owner/repo.git",className:"font-mono",spellCheck:!1,autoComplete:"off"}),a.jsxs(os,{label:"Repository access",value:m.authType,onChange:M=>E({authType:M.target.value}),hint:m.authType==="none"?"For a public repository.":m.authType==="deployKey"?"An SSH key generated here; you add its public half to the repository. Nothing secret leaves this server.":"A personal access token stored on this server and sent only to the repository host.",children:[a.jsx("option",{value:"none",children:"Public — no credentials"}),a.jsx("option",{value:"deployKey",children:"Private — deploy key (SSH)"}),a.jsx("option",{value:"token",children:"Private — access token (HTTPS)"})]}),m.authType==="token"&&a.jsx(Ee,{label:"Access token",type:"password",value:m.token,onChange:M=>E({token:M.target.value}),error:ae("token"),hint:x&&o.hasToken?"A token is stored. Leave this empty to keep it.":"Read-only access to this one repository is enough.",placeholder:x&&o.hasToken?"••••••••":"github_pat_…",autoComplete:"off",spellCheck:!1}),m.authType==="deployKey"&&(x?a.jsxs("div",{className:"rounded-md border border-line bg-inset/50 p-3.5",children:[a.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[a.jsx("div",{className:"text-xs font-medium text-ink",children:"Deploy key"}),a.jsx(W,{size:"sm",icon:a.jsx(Zi,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void K(),loading:S,children:C?"Generate a new key":"Generate key"})]}),C?a.jsxs(a.Fragment,{children:[a.jsx("pre",{className:"mt-2.5 max-h-24 overflow-auto whitespace-pre-wrap break-all rounded border border-line bg-canvas p-2.5 font-mono text-2xs text-muted",children:C}),a.jsxs("div",{className:"mt-2 flex flex-wrap items-center justify-between gap-2",children:[a.jsx("p",{className:"text-2xs text-faint",children:"Add it under the repository’s Settings → Deploy keys. Leave “Allow write access” off."}),a.jsx(wt,{value:C,label:"Copy public key",withText:!0})]})]}):a.jsx("p",{className:"mt-2 text-2xs text-faint",children:"No key yet. The private half stays on this server and is never shown."})]}):a.jsx(ye,{tone:"info",children:"Create the app first; the key is generated from its settings afterwards."}))]}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-ink",children:"How it runs"}),a.jsxs("p",{className:"mt-0.5 text-xs text-muted",children:["All optional. An empty field is read from the repository’s"," ",a.jsx("code",{className:"font-mono",children:"ez.json"}),", and failing that from"," ",a.jsx("code",{className:"font-mono",children:"package.json"}),"."]})]}),a.jsxs(Ea,{children:[a.jsx(Ee,{label:"Port",optional:!0,type:"number",min:1,max:65535,inputMode:"numeric",value:m.settings.port,onChange:M=>T({port:M.target.value}),error:ae("port"),hint:"The port the app listens on. Passed to it as PORT, and used for the health check.",placeholder:"3000"}),a.jsx(Ee,{label:"Health check path",optional:!0,value:m.settings.healthPath,onChange:M=>T({healthPath:M.target.value}),error:ae("healthPath"),hint:"Must answer before a deployment counts. Defaults to /.",placeholder:"/healthz",className:"font-mono",spellCheck:!1})]}),a.jsx(Ee,{label:"Start command",optional:!0,value:m.settings.start,onChange:M=>T({start:M.target.value}),hint:"The long-running process. Any language: node server.js, python app.py, ./server.",placeholder:"from ez.json, or npm start",className:"font-mono",spellCheck:!1}),a.jsxs(Ea,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ee,{label:"Install command",optional:!0,value:m.settings.install,onChange:M=>T({install:M.target.value}),disabled:m.settings.skipInstall,placeholder:"from ez.json, or npm ci",className:"font-mono",spellCheck:!1}),a.jsx(is,{label:"Skip the install step",checked:m.settings.skipInstall,onChange:M=>T({skipInstall:M})})]}),a.jsxs("div",{className:"space-y-2",children:[a.jsx(Ee,{label:"Build command",optional:!0,value:m.settings.build,onChange:M=>T({build:M.target.value}),disabled:m.settings.skipBuild,placeholder:"from ez.json, or npm run build",className:"font-mono",spellCheck:!1}),a.jsx(is,{label:"Skip the build step",checked:m.settings.skipBuild,onChange:M=>T({skipBuild:M})})]})]})]}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-semibold text-ink",children:"Persistent data"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Each deployment runs from a fresh copy of your code. Files written to at runtime are lost on the next deploy — and on rollback. Every path listed here, a folder or a single file, lives in a shared location that every deployment and every rollback reuses."})]}),a.jsx(Kw,{label:"Folders and files to keep",optional:!0,value:m.settings.persist,onChange:M=>T({persist:M}),normalize:(M,_)=>{const se=o5(M,_);return{value:se.path,error:se.error}},max:20,hint:"Add folders your app writes to: uploads, SQLite data, logs — or one file, such as prisma/app.db. Press Enter after each path.",placeholder:"data, uploads, prisma/app.db"}),a.jsxs("div",{className:"space-y-1 text-2xs text-faint",children:[a.jsxs("p",{children:["The first deployment copies the current contents into the shared location; after that, the shared copy is what counts — changes to it in the repository are ignored. A folder is usually the safer unit: SQLite creates ",a.jsx("code",{className:"font-mono",children:"-wal"})," and"," ",a.jsx("code",{className:"font-mono",children:"-shm"})," files next to its database. Left empty, the list is read from ",a.jsx("code",{className:"font-mono",children:"ez.json"}),"."]}),x&&o?.sharedDir&&a.jsxs("p",{className:"break-all",children:["Kept in ",a.jsx("span",{className:"font-mono",children:o.sharedDir})]})]})]}),a.jsx("section",{className:"space-y-4 border-t border-line pt-5",children:a.jsx(Bo,{label:"Environment variables",optional:!0,rows:5,value:m.envText,onChange:M=>E({envText:M.target.value}),error:ae("env"),hint:"One NAME=value per line; a pasted .env file works. Stored on this server only, and available to the build and the running app.",placeholder:`DATABASE_URL=postgres://…
471
+ NODE_ENV=production`,className:"font-mono",spellCheck:!1})}),a.jsxs("section",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(qt,{checked:m.autoRollback,onChange:M=>E({autoRollback:M}),label:"Roll back automatically",description:"If a new release starts but fails its health check, the previous release is started again."}),a.jsx(Ea,{children:a.jsx(Ee,{label:"Releases to keep",type:"number",min:c.limits.keepReleasesMin,max:c.limits.keepReleasesMax,inputMode:"numeric",value:m.keepReleases,onChange:M=>E({keepReleases:M.target.value}),error:ae("keepReleases"),hint:"Older ones are deleted. The live release and the one before it are always kept."})}),c.channels.length>0&&a.jsxs("div",{children:[a.jsx("div",{className:"mb-1.5 text-xs font-medium text-ink",children:"Notify on every deployment"}),a.jsx("div",{className:"space-y-1.5",children:c.channels.map(M=>a.jsx(is,{label:`${M.name} (${M.type})`,checked:m.notifyChannelIds.includes(M.id),onChange:_=>E({notifyChannelIds:_?[...m.notifyChannelIds,M.id]:m.notifyChannelIds.filter(se=>se!==M.id)})},M.id))})]})]})]})})}function Lg(l){return l.domain?"domain":l.bind==="0.0.0.0"?"direct":"local"}function z5({open:l,hook:o,domains:c,onClose:u,onSaved:d}){const h=jt(),[x,m]=g.useState(o.enabled),[p,b]=g.useState(Lg(o)),[j,y]=g.useState(o.domain??""),[N,C]=g.useState(String(o.port)),[U,S]=g.useState(!1),[k,E]=g.useState(!1);g.useEffect(()=>{l&&(m(o.enabled),b(Lg(o)),y(o.domain??""),C(String(o.port)),E(!1))},[l]);const T=c.filter(L=>L.enabled),Y=T.find(L=>L.name===j),z=Po(N),D=x&&p==="domain"&&!Y?"Choose a domain.":null,te=async()=>{if(!U&&(E(!0),!(z||D))){S(!0);try{const L=await ie.deployments.updateHook({enabled:x,port:Number(N),bind:p==="direct"?"0.0.0.0":"127.0.0.1",domain:p==="domain"?j:null});L.nginxReloaded===!1?h.warning("Saved, but nginx was not reloaded","The domain’s config was written. Reload nginx for the deploy hook to be reachable."):h.success("Deploy hook saved",x?`The background service picks it up within ${L.appliesWithinSeconds??10} seconds.`:"Nothing is listening for deployments now."),d(L)}catch(L){const Q=L instanceof Le&&typeof L.payload.detail=="string"?L.payload.detail:null;h.error("Could not save the deploy hook",Q??(L instanceof Error?L.message:"Nothing was changed."))}finally{S(!1)}}};return a.jsx(bn,{open:l,onClose:u,preventClose:U,size:"md",title:"Deploy hook",description:"Lets a GitHub Action tell this server to deploy. Each app has its own token; the hook can do nothing else.",footer:a.jsxs(a.Fragment,{children:[a.jsx(W,{variant:"secondary",onClick:u,disabled:U,children:"Cancel"}),a.jsx(W,{variant:"primary",onClick:()=>void te(),loading:U,children:"Save"})]}),children:a.jsxs("div",{className:"space-y-5",children:[a.jsx(qt,{checked:x,onChange:m,label:"Accept deployments from CI",description:"Off by default. While it is off nothing listens, and apps can only be deployed from this dashboard."}),x&&a.jsxs(a.Fragment,{children:[a.jsxs(os,{label:"How CI reaches it",value:p,onChange:L=>b(L.target.value),children:[a.jsx("option",{value:"domain",children:"Through one of my domains (recommended)"}),a.jsx("option",{value:"direct",children:"Directly, on its own port"}),a.jsx("option",{value:"local",children:"This machine only"})]}),p==="domain"&&a.jsxs(a.Fragment,{children:[a.jsxs(os,{label:"Domain",value:j,onChange:L=>y(L.target.value),error:k?D:null,hint:"One path, /.ez-deploy/, is added to this domain’s nginx config. Nothing else becomes reachable.",children:[a.jsx("option",{value:"",children:"Choose a domain…"}),T.map(L=>a.jsxs("option",{value:L.name,children:[L.name,L.ssl?"":" — no SSL"]},L.name))]}),T.length===0&&a.jsx(ye,{tone:"warning",children:"There is no enabled domain yet. Add one on the Domains page, or reach the hook directly."}),Y&&!Y.ssl&&a.jsx(ye,{tone:"warning",title:"This domain has no certificate",children:"The deploy token would travel over plain HTTP. Issue a certificate for it on the SSL page first."})]}),p==="direct"&&a.jsx(ye,{tone:"warning",title:"Plain HTTP, on every network interface",children:"The deploy token is sent unencrypted, and the port has to be opened in your firewall. Use a domain with SSL unless this server sits on a private network."}),p==="local"&&a.jsx(ye,{tone:"info",children:"Only programs on this server can call the hook — useful with your own tunnel or reverse proxy. GitHub cannot reach it."}),a.jsx(Ea,{children:a.jsx(Ee,{label:"Listener port",type:"number",min:1,max:65535,inputMode:"numeric",value:N,onChange:L=>C(L.target.value),error:k?z:null,hint:p==="direct"?"The port CI connects to.":"Internal. nginx forwards to it; it is not opened to the network."})})]})]})})}function R5(l,o){return l instanceof Le||l instanceof Error?l.message:o}function A5({data:l,onConfigure:o}){const{hook:c}=l,u=c.enabled&&(c.domain!==null||c.bind==="0.0.0.0"),h=!!(c.domain?l.domains.find(b=>b.name===c.domain):void 0)?.ssl;let x="neutral",m="Off",p="Apps are deployed from this dashboard only. Turn it on to deploy from GitHub Actions.";return c.enabled&&!c.listening?(x="warn",m="Not listening",p="It is switched on, but nothing answers on its port yet. The background service starts it within a few seconds; if it stays like this, check that the service is running."):c.enabled&&!u?(x="neutral",m="This machine only",p="Listening, but only programs on this server can call it. GitHub cannot reach it."):c.enabled&&c.domain?(x=h?"ok":"warn",m=h?"On":"On — no SSL",p=h?`Reached through https://${c.domain}${c.path}`:`Reached through http://${c.domain}${c.path} — the deploy token travels unencrypted. Issue a certificate for that domain.`):c.enabled&&(x="warn",m="On — plain HTTP",p=`Listening on every interface, port ${c.port}. The deploy token travels unencrypted; prefer a domain with SSL.`),a.jsx(Qe,{children:a.jsx(Zt,{icon:a.jsx(Uo,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"flex flex-wrap items-center gap-2",children:["Deploy hook",a.jsx(ge,{tone:x,dot:!0,children:m})]}),description:p,actions:a.jsx(W,{size:"sm",icon:a.jsx(mf,{className:"size-3.5","aria-hidden":"true"}),onClick:o,children:"Configure"})})})}function D5({app:l,canDeploy:o,busy:c,onDeploy:u,onOpen:d,onEdit:h,onDelete:x}){const m=l.lastRun??null,p=l.process??null,b=m?Ky[m.status]:null;return a.jsxs("li",{className:"flex flex-col gap-3 px-4 py-3.5 transition-colors duration-[var(--ez-motion-fast)] hover:bg-raised/40 lg:flex-row lg:items-center lg:gap-4",children:[a.jsxs("button",{type:"button",onClick:()=>d("activity"),className:"flex min-w-0 flex-1 items-start gap-3 rounded text-left focus-visible:outline-2 focus-visible:outline-offset-2 focus-visible:outline-accent",children:[a.jsx(Jt,{tone:p?h5(p.status):"neutral",pulse:p?.status==="online",className:"mt-1.5"}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block truncate font-mono text-sm font-semibold text-ink",children:l.id}),a.jsxs("span",{className:"mt-0.5 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-muted",children:[a.jsx("span",{className:"truncate font-mono",title:l.repoUrl,children:Sw(l.repoUrl,44)}),a.jsxs("span",{className:"inline-flex items-center gap-1",children:[a.jsx(_2,{className:"size-3","aria-hidden":"true"}),l.branch]}),l.domain&&a.jsxs("span",{className:"inline-flex items-center gap-1 text-accent-text",children:[a.jsx(rs,{className:"size-3","aria-hidden":"true"}),l.domain]})]}),a.jsx("span",{className:"mt-1 flex flex-wrap items-center gap-x-2 gap-y-0.5 text-2xs text-faint",children:p?a.jsxs(a.Fragment,{children:[a.jsxs("span",{children:[p.status,p.status==="online"&&p.uptimeMs!==null?` · up ${Qo(p.uptimeMs)}`:""]}),p.memoryBytes!==null&&a.jsxs("span",{children:["· ",My(p.memoryBytes)]}),p.restarts>0&&a.jsxs("span",{children:["· ",_n(p.restarts,"restart")]})]}):a.jsx("span",{children:l.currentRelease?"Not running":"Never deployed"})})]})]}),a.jsx("div",{className:"flex flex-wrap items-center gap-2 pl-7 lg:w-56 lg:shrink-0 lg:pl-0",children:l.deploying?a.jsx(ge,{tone:"info",dot:!0,children:m?.status==="running"?bf(m.step):"Deploying"}):b&&m?a.jsxs(a.Fragment,{children:[a.jsx(ge,{tone:b.tone,dot:!0,children:b.label}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:Gi(m.sha)}),a.jsx("span",{className:"text-2xs text-faint",children:Pi(m.finishedAt??m.startedAt)})]}):a.jsx("span",{className:"text-2xs text-faint",children:"No deployments yet"})}),a.jsxs("div",{className:"flex shrink-0 items-center justify-end gap-1.5 pl-7 lg:pl-0",children:[a.jsx(W,{variant:"primary",size:"sm",icon:a.jsx(qi,{className:"size-3.5","aria-hidden":"true"}),onClick:u,loading:c,disabled:!o||!!l.deploying,children:"Deploy"}),a.jsx(W,{size:"sm",onClick:()=>d("setup"),children:"Domain"}),a.jsx(W,{size:"sm",onClick:()=>d("github"),children:"GitHub"}),a.jsx(at,{label:`Edit ${l.id}`,size:"sm",onClick:h,children:a.jsx(ff,{className:"size-4","aria-hidden":"true"})}),a.jsx(at,{label:`Delete ${l.id}`,size:"sm",variant:"dangerGhost",onClick:x,disabled:!!l.deploying,children:a.jsx(Hs,{className:"size-4","aria-hidden":"true"})})]})]})}function _5(){Xn("Deployments");const l=jt(),o=xt(z=>ie.deployments.list(z),[]),c=o.data,u=!!c?.apps.some(z=>z.deploying);Bs(o.reload),Os(o.reload,u?2e3:1e4);const[d,h]=g.useState(!1),[x,m]=g.useState(null),[p,b]=g.useState(!1),[j,y]=g.useState(null),[N,C]=g.useState(null),[U,S]=g.useState(null),k=()=>{m(null),h(!0)},E=async z=>{if(!N){C(z.id);try{await ie.deployments.deploy(z.id),y({id:z.id,tab:"activity"}),o.reload()}catch(D){l.error(`Could not deploy ${z.id}`,R5(D,"Nothing was started."))}finally{C(null)}}},T=a.jsx(da,{title:"Deployments",description:"Put a project from a git repository on this server: fetched, built and started here, with earlier releases kept to roll back to.",actions:a.jsxs(a.Fragment,{children:[a.jsx(at,{label:"Refresh",onClick:o.reload,children:a.jsx(bt,{className:"size-4","aria-hidden":"true"})}),a.jsx(W,{variant:"primary",icon:a.jsx(ra,{className:"size-4","aria-hidden":"true"}),onClick:k,disabled:!c,children:"New app"})]})});if(o.error&&!c)return a.jsxs(a.Fragment,{children:[T,a.jsx(St,{error:o.error,onRetry:o.reload})]});if(!c)return a.jsxs(a.Fragment,{children:[T,a.jsxs(Ra,{children:[a.jsx(Ze,{className:"h-20 rounded-lg"}),a.jsx(Ze,{className:"h-56 rounded-lg"})]})]});const Y=c.requirements.git&&c.requirements.pm2;return a.jsxs(a.Fragment,{children:[T,a.jsxs("div",{className:"space-y-5",children:[!c.requirements.git&&a.jsx(ye,{tone:"danger",title:"git is not installed on this server",children:"Deployments fetch the code with git. Install it, and make sure it is on the PATH of the Easy DevOps service."}),!c.requirements.pm2&&a.jsxs(ye,{tone:"warning",title:"PM2 is not installed",action:a.jsx(mt,{to:"/processes",className:Yn("secondary","sm"),children:"Open Processes"}),children:["Deployed apps are kept running by PM2. Install it from the Processes page, or with"," ",a.jsx("code",{className:"font-mono",children:"npm install -g pm2"}),"."]}),a.jsx(A5,{data:c,onConfigure:()=>b(!0)}),a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx(Zt,{icon:a.jsx(qi,{className:"size-4","aria-hidden":"true"}),title:"Apps",description:c.apps.length===0?"Nothing is deployed from here yet.":`${_n(c.apps.length,"app")}. Each runs under PM2 as ez-<name>.`}),c.apps.length===0?a.jsx(Kt,{children:a.jsx(Vn,{icon:a.jsx(qi,{className:"size-5","aria-hidden":"true"}),title:"Deploy your first app",description:a.jsxs(a.Fragment,{children:["Give it a repository. A Node project needs nothing else; for any other language, add an ",a.jsx("code",{className:"font-mono",children:"ez.json"})," with its install, build and start commands."]}),action:a.jsx(W,{variant:"primary",icon:a.jsx(ra,{className:"size-4","aria-hidden":"true"}),onClick:k,children:"New app"})})}):a.jsx("ul",{className:"divide-y divide-line",children:c.apps.map(z=>a.jsx(D5,{app:z,canDeploy:Y,busy:N===z.id,onDeploy:()=>void E(z),onOpen:D=>y({id:z.id,tab:D}),onEdit:()=>{m(z),h(!0)},onDelete:()=>S(z)},z.id))})]})]}),a.jsx(E5,{open:d,app:x,meta:c,onClose:()=>h(!1),onSaved:(z,D)=>{h(!1),o.reload(),D?(l.success(`${z.id} created`,"Press Deploy to build and start it."),z.authType==="deployKey"&&(m(z),h(!0))):l.success(`${z.id} saved`,"It applies to the next deployment.")}}),a.jsx(z5,{open:p,hook:c.hook,domains:c.domains,onClose:()=>b(!1),onSaved:()=>{b(!1),o.reload()}}),a.jsx(T5,{appId:j?.id??null,initialTab:j?.tab,hook:c.hook,meta:c,onClose:()=>y(null),onConfigureHook:()=>b(!0),onChanged:o.reload,onDelete:z=>S(z)}),a.jsx(y5,{app:U,onClose:()=>S(null),onDeleted:()=>{S(null),y(null),o.reload()}})]})}const Ug=[{id:"error",label:"Error",fileName:"error.log"},{id:"access",label:"Access",fileName:"access.log"}];function O5(l){return/\[(error|crit|emerg|alert)\]/.test(l)?"text-bad":/\[(warn|warning)\]/.test(l)?"text-warn":/\s(2\d\d|3\d\d)\s/.test(l)?"text-ok":"text-muted"}function M5(){Xn("Logs");const{connectionError:l}=ua(),[o,c]=Xo(),d=o.get("file")==="access"?"access":"error",h=Ug.find(C=>C.id===d),x=C=>{const U=new URLSearchParams(o);C==="error"?U.delete("file"):U.set("file",C),c(U,{replace:!0})},m=Yy(d,{limit:500}),p=g.useRef(null),[b,j]=g.useState(!0);g.useEffect(()=>{const C=p.current;C&&b&&(C.scrollTop=C.scrollHeight)},[m.lines,b]);const y=m.paused,N=m.connected&&!y;return a.jsxs(a.Fragment,{children:[a.jsx(da,{title:"Logs",description:"nginx output as it is written. The stream follows the file; switching tabs does not restart nginx.",meta:a.jsx(ge,{tone:y?"warn":m.connected?"ok":"bad",dot:!0,children:y?"Paused":m.connected?"Live":"Reconnecting"}),actions:a.jsxs(a.Fragment,{children:[a.jsx("div",{className:"flex items-center gap-1 rounded-md border border-line bg-raised/60 p-1",role:"group","aria-label":"Log file",children:Ug.map(C=>a.jsx("button",{type:"button","aria-pressed":d===C.id,onClick:()=>x(C.id),className:le("rounded-sm px-3 py-1 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",d===C.id?"bg-surface text-ink shadow-sm":"text-muted hover:text-ink"),children:C.label},C.id))}),a.jsx(W,{variant:"secondary",size:"sm",icon:y?a.jsx(Ki,{className:"size-3.5","aria-hidden":"true"}):a.jsx(Ny,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>m.setPaused(!y),children:y?"Resume":"Pause"}),a.jsx(W,{variant:"ghost",size:"sm",icon:a.jsx(Hs,{className:"size-3.5","aria-hidden":"true"}),onClick:m.clear,disabled:m.lines.length===0,children:"Clear"}),a.jsx(W,{variant:"ghost",size:"sm",icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:m.restart,disabled:!m.connected,children:"Reload tail"}),a.jsx(wt,{value:m.lines.join(`
472
+ `),label:"Copy logs",withText:!0})]})}),l&&a.jsx(ye,{tone:"warning",title:"The live stream is disconnected",className:"mb-4",children:"New lines appear once the dashboard socket reconnects. nginx itself is unaffected."}),a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-3 gap-y-1.5 border-b border-line bg-raised/40 px-4 py-2 sm:px-5",children:[a.jsxs("span",{className:"inline-flex items-center gap-2 font-mono text-2xs text-muted",children:[a.jsx(Jt,{tone:y?"warn":m.connected?"ok":"bad",pulse:N}),y?"Paused":m.connected?"Live":"Reconnecting"]}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:h.fileName}),a.jsx("span",{className:"font-mono text-2xs text-faint",children:m.lines.length===1?"1 line":`${m.lines.length} lines`}),y&&m.missed>0&&a.jsxs(ge,{tone:"warn",children:[m.missed===999?"999+":m.missed," new while paused"]}),a.jsx("span",{className:"ml-auto text-2xs text-faint",children:b?"Following the tail":"Scrolled back"})]}),a.jsxs("div",{className:"relative",children:[a.jsx("div",{ref:p,role:"log","aria-label":`nginx ${h.label.toLowerCase()} log`,"aria-live":"off",onScroll:()=>{const C=p.current;C&&j(C.scrollHeight-C.scrollTop-C.clientHeight<40)},className:"h-[calc(100dvh-20rem)] min-h-72 overflow-y-auto bg-canvas p-4 font-mono text-xs leading-relaxed",children:m.lines.length===0?a.jsx("p",{className:"italic text-faint",children:m.connected?d==="access"?"No access lines yet. They appear here as nginx writes them.":"No error lines yet.":"Waiting for the live stream…"}):m.lines.map((C,U)=>a.jsx("div",{className:le("whitespace-pre-wrap break-all py-0.5",O5(C)),children:C},`${U}-${C}`))}),!b&&a.jsxs("button",{type:"button",onClick:()=>{const C=p.current;C&&(C.scrollTop=C.scrollHeight),j(!0)},className:"absolute bottom-3 right-3 inline-flex items-center gap-1.5 rounded-pill border border-line bg-surface px-3 py-1.5 text-2xs font-medium text-ink shadow-pop transition-colors hover:bg-inset",children:[a.jsx(Vj,{className:"size-3","aria-hidden":"true"}),"Jump to latest"]})]})]}),a.jsx("p",{className:"mt-3 text-2xs text-faint",children:"The dashboard keeps the last 500 lines in memory for this tab. Pausing only stops the display — lines keep being written to disk."})]})}const Hg={not_linked:"Not linked",connecting:"Connecting…",connected:"Connected",rejected:"Rejected by the Hub",unreachable:"Hub unreachable"},Bg={connected:"ok",connecting:"warn",unreachable:"warn",rejected:"bad",not_linked:"neutral"};function Ld(l,o){return l instanceof Le?(typeof l.payload.detail=="string"?l.payload.detail:null)??l.message:l instanceof Error?l.message:o}function L5({checked:l,indeterminate:o,disabled:c,label:u,onChange:d}){const h=g.useRef(null);return g.useEffect(()=>{h.current&&(h.current.indeterminate=o)},[o]),a.jsx("input",{ref:h,type:"checkbox","aria-label":`All ${u} permissions`,checked:l,disabled:c,onChange:x=>d(x.target.checked),className:"mt-0.5 size-4 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"})}function Ud(l,o){return!!l.comingSoon||o.includes(l.id)}function U5(){const l=jt(),o=sn(),c=xt(K=>ie.hub.status(K)),[u,d]=g.useState(""),[h,x]=g.useState(null),[m,p]=g.useState(!1),[b,j]=g.useState(!1),[y,N]=g.useState(!1),C=c.data?.status??"not_linked";g.useEffect(()=>{if(!c.data?.linked)return;const K=C==="connecting"?2e3:C==="unreachable"?5e3:15e3,ae=window.setTimeout(c.reloadSilent,K);return()=>window.clearTimeout(ae)},[c.data,c.reloadSilent,C]);const U=async()=>{if(m)return;const K=hS(u);if(K){x(K);return}x(null),p(!0);try{const ae=await ie.hub.connect(u.trim());c.setData(ae.status),d(""),l.success("Connection string saved",ae.status.status==="connecting"?"Connecting to the Hub…":"This server is now linked to the Hub.")}catch(ae){x(Ld(ae,"The Hub did not accept that connection string."))}finally{p(!1)}},S=async()=>{if(!(b||!await o({title:"Unlink this server from the Hub?",body:"The Hub stops receiving data from this server. Domains and certificates are not affected.",confirmLabel:"Unlink",tone:"danger"}))){j(!0);try{await ie.hub.unlink(),c.setData(ae=>ae&&{...ae,linked:!1,hubUrl:null,serverId:null,connected:!1,status:"not_linked",permissions:{},lastError:null,attempts:0}),d(""),x(null),l.success("Unlinked from the Hub")}catch(ae){l.error("Could not unlink",Ld(ae,"The link is still in place."))}finally{j(!1)}}},k=c.data?.permissions??{},E=c.data?.tree??[],T=c.data?.comingSoon??[],Y=async(K,ae)=>{if(!y){N(!0),c.setData(M=>{if(!M)return M;const _={...M.permissions};for(const se of K)_[se]=ae;return{...M,permissions:_}});try{const M={};for(const se of K)M[se]=ae;const _=await ie.hub.updatePermissions(M);c.setData(se=>se&&{...se,permissions:_.permissions,tree:_.tree,comingSoon:_.comingSoon})}catch(M){l.error("Could not save permissions",Ld(M,"The change was not kept.")),c.reload()}finally{N(!1)}}},z=K=>{const ae=K.children.filter(_=>!Ud(_,T));if(ae.length===0)return"off";const M=ae.filter(_=>k[_.id]===!0).length;return M===0?"off":M===ae.length?"on":"partial"},D=(K,ae)=>{const M=K.children.filter(_=>!Ud(_,T)).map(_=>_.id);M.length!==0&&Y(M,ae)},te=Object.values(k).filter(Boolean).length,L=K=>a.jsxs("div",{className:"w-full max-w-md space-y-3",children:[a.jsx(Bo,{label:"Connection string",value:u,onChange:ae=>{d(ae.target.value),h&&x(null)},placeholder:"ezops://https://hub.example.com|server-id|secret",hint:"Shown only once by the Hub. Treat it like a password.",error:h,className:"font-mono",spellCheck:!1,autoComplete:"off",rows:3}),a.jsx(W,{variant:"primary",loading:m,disabled:!u.trim(),icon:a.jsx(X2,{className:"size-4","aria-hidden":"true"}),onClick:()=>void U(),children:K})]}),Q=Bg[C]??"neutral",re=(()=>{if(c.error&&!c.data)return a.jsx(Kt,{children:a.jsx(St,{error:c.error,title:"Could not read the Hub status",onRetry:c.reload,className:"border-0"})});if(!c.data)return a.jsxs(Kt,{className:"space-y-3",children:[a.jsx(Ze,{className:"h-5 w-48"}),a.jsx(Ze,{className:"h-24 rounded-md"}),a.jsx(Ze,{className:"h-40 rounded-md"})]});const K=c.data,ae=Hg[K.status]??"Unknown state",M=Bg[K.status]??"neutral";return a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 border-b border-line bg-raised/40 px-4 py-3 sm:px-5",children:[a.jsx(Jt,{tone:M,pulse:K.status==="connecting"}),a.jsx("span",{className:"text-sm font-medium text-ink",children:ae}),K.hubUrl&&a.jsx("code",{className:"break-all font-mono text-xs text-muted",children:K.hubUrl}),K.serverId&&a.jsxs("span",{className:"text-2xs text-faint",children:["Server ID ",a.jsx("code",{className:"font-mono text-muted",children:K.serverId})]}),K.linked&&a.jsx("span",{className:"text-2xs text-faint",title:K.agentOwner==="daemon"?"The Hub connection is held by the background service, which keeps it alive with no browser open.":"The Hub connection is held by this dashboard and stops when it closes.",children:K.agentOwner==="daemon"&&!K.agentReported?"waiting for the background service…":K.agentOwner==="daemon"?"via the background service":"via this dashboard"}),K.status==="unreachable"&&K.attempts>0&&a.jsxs("span",{className:"text-2xs text-faint",children:[K.attempts," reconnect attempt",K.attempts===1?"":"s"]})]}),a.jsxs("div",{className:"flex flex-wrap items-start gap-x-2 gap-y-1 border-b border-line px-4 py-2.5 text-2xs sm:px-5",children:[a.jsx("span",{className:"font-medium uppercase tracking-wider text-faint",children:"Data directory"}),a.jsx("code",{className:"break-all font-mono text-muted",children:K.dataDir}),K.devDataDir&&a.jsx(ge,{tone:"warn",children:"dev override"}),K.devDataDir&&a.jsx("span",{className:"w-full text-faint",children:"This is not the normal data directory. The CLI must run with the same override, or it reads and writes a different domain list."})]}),a.jsxs(Kt,{className:"space-y-5",children:[K.lastError&&a.jsx(ye,{tone:K.status==="rejected"?"danger":"warning",title:K.status==="rejected"?"The Hub rejected this server":"The Hub cannot be reached right now",children:K.lastError}),K.linked?a.jsxs(a.Fragment,{children:[K.status==="rejected"&&a.jsxs("div",{className:"space-y-3 border-t border-line pt-4",children:[a.jsx("p",{className:"text-sm text-muted",children:"This link cannot recover by itself. Paste a fresh connection string from the Hub to replace it."}),L("Reconnect")]}),a.jsxs("section",{className:"space-y-3","aria-labelledby":"hub-permissions-heading",children:[a.jsxs("div",{className:"flex flex-wrap items-end justify-between gap-2",children:[a.jsxs("div",{children:[a.jsx("h3",{id:"hub-permissions-heading",className:"text-sm font-semibold text-ink",children:"Allow the Hub to"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Monitoring — metrics, nginx status, domains and certificate expiry — is always on. These toggles are enforced on this server; the Hub cannot grant itself anything."})]}),a.jsxs(ge,{tone:te>0?"accent":"neutral",children:[te," granted"]})]}),a.jsx("div",{className:"space-y-2.5",children:E.map(_=>{const se=z(_);return a.jsxs("div",{className:"overflow-hidden rounded-md border border-line",children:[a.jsxs("label",{className:"flex cursor-pointer items-start gap-3 bg-raised/60 px-3.5 py-2.5",children:[a.jsx(L5,{checked:se==="on",indeterminate:se==="partial",disabled:y,label:_.label,onChange:F=>D(_,F)}),a.jsxs("span",{className:"min-w-0",children:[a.jsx("span",{className:"block text-sm font-medium text-ink",children:_.label}),a.jsx("span",{className:"mt-0.5 block text-xs text-muted",children:_.description})]})]}),a.jsx("ul",{className:"divide-y divide-line/60",children:_.children.map(F=>{const ne=Ud(F,T),fe=k[F.id]===!0;return a.jsx("li",{children:a.jsxs("label",{className:le("flex items-start gap-3 px-3.5 py-2.5 pl-8",ne?"cursor-not-allowed opacity-60":"cursor-pointer hover:bg-inset/60"),children:[a.jsx("input",{type:"checkbox",checked:fe,disabled:ne||y,onChange:()=>void Y([F.id],!fe),className:"mt-0.5 size-3.5 shrink-0 cursor-pointer rounded border-line accent-[var(--ez-accent)]"}),a.jsxs("span",{className:"min-w-0",children:[a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2 text-sm text-ink",children:[F.label,ne&&a.jsx(ge,{tone:"warn",children:"Coming soon"})]}),a.jsx("span",{className:"mt-0.5 block text-xs text-faint",children:F.description})]})]})},F.id)})})]},_.id)})})]}),a.jsx("div",{className:"border-t border-line pt-4",children:a.jsx(W,{variant:"dangerGhost",loading:b,icon:a.jsx($N,{className:"size-4","aria-hidden":"true"}),onClick:()=>void S(),children:"Unlink from Hub"})})]}):a.jsxs(a.Fragment,{children:[a.jsxs("div",{className:"space-y-2",children:[a.jsx("p",{className:"text-sm text-muted",children:"Add this server in the Hub first, then paste the connection string it gives you."}),a.jsxs("ol",{className:"list-decimal space-y-1 pl-5 text-sm text-muted",children:[a.jsxs("li",{children:["Open your Hub dashboard → ",a.jsx("span",{className:"text-ink",children:"Add Server"})]}),a.jsx("li",{children:"Enter a display name and submit"}),a.jsx("li",{children:"Copy the connection string the Hub shows you"}),a.jsx("li",{children:"Paste it below and click Connect"})]})]}),L("Connect")]})]})]})})();return a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx("div",{className:le("h-0.5 w-full",Q==="ok"?"bg-ok/60":Q==="bad"?"bg-bad/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(Zt,{icon:a.jsx(n2,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Easy DevOps Hub",c.data&&a.jsx(ge,{tone:Q,dot:!0,children:Hg[c.data.status]??"Unknown"}),c.data?.devDataDir&&a.jsx(ge,{tone:"warn",children:"dev data dir"})]}),description:"Monitor and control this server from a central dashboard.",actions:a.jsx(W,{variant:"secondary",size:"sm",loading:c.loading,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:c.reload,children:"Refresh"})}),re,c.loading&&c.data&&a.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-2 text-2xs text-faint sm:px-5",children:[a.jsx(Ms,{}),"Refreshing the Hub state…"]})]})}const H5=["starting","stopping","updating","restarting"],Hd=[{id:"starting",label:"Hand over to the update worker"},{id:"stopping",label:"Stop the dashboard and the service"},{id:"updating",label:"Install the new version"},{id:"restarting",label:"Start the dashboard again"}],qg={starting:"Starting…",stopping:"Stopping…",updating:"Updating…",restarting:"Restarting…",done:"Completed",failed:"Failed",interrupted:"Interrupted"},B5={starting:"warn",stopping:"warn",updating:"warn",restarting:"warn",done:"ok",failed:"bad",interrupted:"warn"};function q5(l,o){return l instanceof Le?(typeof l.payload.detail=="string"?l.payload.detail:null)??l.message:l instanceof Error?l.message:o}function $g(l){return l!==void 0&&H5.includes(l)}function Gg({run:l}){const o=[];return l.serviceInstalled?o.push({label:"Background service",value:l.versionConfirmed?`Running v${l.runningVersion} (reported by the daemon)`:`Restarted, reporting ${l.runningVersion?`v${l.runningVersion}`:"an unknown version"}`}):o.push({label:"Background service",value:"Not installed — the package was updated on its own"}),l.refreshedCopy&&o.push({label:"Runtime copy",value:"Refreshed, so the service runs the new code"}),l.dashboardRestarted===!1?o.push({label:"Dashboard",value:"Did not come back automatically — start it from the CLI"}):l.dashboardPort&&o.push({label:"Dashboard",value:`Running again on port ${l.dashboardPort}`}),a.jsx("dl",{className:"grid gap-x-6 gap-y-2 text-xs sm:grid-cols-[auto_1fr]",children:o.map(c=>a.jsxs("div",{className:"contents",children:[a.jsx("dt",{className:"font-medium uppercase tracking-wider text-faint",children:c.label}),a.jsx("dd",{className:"text-muted",children:c.value})]},c.label))})}function $5({run:l}){const o=l.finishedAt?pf(new Date(l.finishedAt).toISOString()):null;return l.phase==="done"?a.jsxs("div",{className:"space-y-3",children:[a.jsxs(ye,{tone:"success",title:`Updated v${l.from} → v${l.to}`,children:[o?`Finished ${o}. `:"","The dashboard runs the new version from now on."]}),a.jsx(Gg,{run:l}),l.dashboardRestarted===!1&&a.jsxs(ye,{tone:"warning",title:"The dashboard did not come back by itself",children:["Start it again with ",a.jsx("code",{className:"font-mono",children:"ezz dashboard"})," in a terminal."]})]}):l.phase==="interrupted"?a.jsxs("div",{className:"space-y-3",children:[a.jsxs(ye,{tone:"warning",title:"The update was interrupted",children:["The worker that performs the update stopped reporting",l.step?` during “${l.step}”`:"",". Nothing here can say what state the files are in — run ",a.jsx("code",{className:"font-mono",children:"ezz update"})," in a terminal; it checks the source, reinstalls and verifies the service from the beginning."]}),a.jsx(W,{variant:"secondary",size:"sm",icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>window.location.reload(),children:"Reload the page"})]}):a.jsxs("div",{className:"space-y-3",children:[a.jsx(ye,{tone:"danger",title:`The update failed${l.step?` (${l.step})`:""}`,children:a.jsx("span",{className:"whitespace-pre-wrap break-words",children:l.reason??"No reason was reported."})}),l.rolledBack?a.jsx(ye,{tone:"success",title:`Rolled back to v${l.from}`,children:l.restored?"The background service is running again on the version you had.":"The service did not come back — start it from Processes."}):l.serviceInstalled?a.jsx(ye,{tone:"warning",title:"The service may not be running",children:"Start it again from Processes once you have checked the log below."}):null,a.jsx(Gg,{run:l})]})}function G5(){const l=jt(),o=sn(),c=xt(k=>ie.update.check(k)),[u,d]=g.useState(null),[h,x]=g.useState(null),[m,p]=g.useState(!1),[b,j]=g.useState(!1),y=g.useRef(null),N=c.reload;g.useEffect(()=>{const k=c.data;k&&(d(k.current),x(E=>E??k.run))},[c.data]);const C=$g(h?.phase);g.useEffect(()=>{if(!C)return;let k=!1,E;const T=async()=>{try{const Y=await ie.update.status();if(k)return;j(!1),d(Y.current),x(Y.run)}catch(Y){if(k)return;Y instanceof Le&&Y.status===0&&j(!0)}k||(E=window.setTimeout(T,b?3e3:1500))};return E=window.setTimeout(T,1200),()=>{k=!0,E&&window.clearTimeout(E)}},[C,b]),g.useEffect(()=>{!h||$g(h.phase)||y.current!==h.id&&(y.current=h.id,N())},[h,N]);const U=async()=>{const k=c.data?.latest;if(!(!k||m||!await o({title:`Update to v${k}?`,body:"The dashboard stops, installs the new version and starts again on this port. This page loses its connection while that happens and comes back by itself — one or two minutes is normal. Do not close the tab.",confirmLabel:"Update now",tone:"accent"}))){p(!0);try{const T=await ie.update.start(k);j(!1),x(T.run),l.success("Update started","The dashboard will stop for a moment and come back on its own.")}catch(T){l.error("Could not start the update",q5(T,"Nothing was changed.")),c.reload()}finally{p(!1)}}},S=(()=>{if(c.error&&!c.data)return a.jsx(Kt,{children:a.jsx(St,{error:c.error,title:"Could not check for updates",onRetry:c.reload,className:"border-0"})});if(!c.data)return a.jsxs(Kt,{className:"space-y-3",children:[a.jsx(Ze,{className:"h-5 w-56"}),a.jsx(Ze,{className:"h-20 rounded-md"})]});const{source:k,latest:E,reachable:T,updateAvailable:Y}=c.data,z=C&&h;return a.jsxs(Kt,{className:"space-y-5",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-x-6 gap-y-2",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Installed"}),a.jsxs("div",{className:"mt-0.5 font-mono text-sm font-medium text-ink",children:["v",u??c.data.current]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Latest"}),a.jsx("div",{className:"mt-0.5 font-mono text-sm font-medium text-ink",children:T&&E?`v${E}`:"—"})]}),a.jsx("div",{className:"pt-4",children:T?Y?a.jsx(ge,{tone:"accent",dot:!0,children:"Update available"}):a.jsx(ge,{tone:"ok",dot:!0,children:"Up to date"}):a.jsx(ge,{tone:"warn",dot:!0,children:"Registry unreachable"})})]}),!k.npmUpdatable&&a.jsxs(ye,{tone:"warning",title:"This copy is not managed by npm",children:["This installation is ",k.reason,". Running"," ",a.jsx("code",{className:"font-mono",children:"npm install -g"})," would install a second copy and leave this one running, so updates have to be done by hand:",a.jsx("pre",{className:"mt-2 overflow-x-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-ink",children:k.howToUpdate.join(`
473
+ `)})]}),z&&a.jsxs("div",{className:"space-y-3 rounded-md border border-line bg-raised/40 px-4 py-3",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx(ia,{className:"spin size-4 text-accent-text","aria-hidden":"true"}),a.jsxs("span",{className:"text-sm font-medium text-ink",children:["Updating v",z.from," → v",z.to]}),a.jsx(ge,{tone:"warn",dot:!0,children:qg[z.phase]})]}),a.jsx("ol",{className:"space-y-1.5",children:Hd.map(D=>{const te=Hd.findIndex(re=>re.id===z.phase),L=Hd.findIndex(re=>re.id===D.id),Q=L<te?"done":L===te?"current":"pending";return a.jsxs("li",{className:le("flex items-center gap-2 text-xs",Q==="pending"?"text-faint":"text-muted"),children:[Q==="done"?a.jsx(uf,{className:"size-3.5 text-ok","aria-hidden":"true"}):Q==="current"?a.jsx(ia,{className:"spin size-3.5 text-accent-text","aria-hidden":"true"}):a.jsx(h2,{className:"size-3.5","aria-hidden":"true"}),D.label]},D.id)})}),b&&a.jsx(ye,{tone:"info",title:"The dashboard is restarting",children:"This page cannot reach it at the moment. It keeps reconnecting and shows the result here as soon as the dashboard is back."}),z.logTail.length>0&&a.jsx("pre",{className:"max-h-36 overflow-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-muted",children:z.logTail.join(`
474
+ `)})]}),h&&!C&&a.jsxs("div",{className:"space-y-3 border-t border-line pt-4",children:[a.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[a.jsx("span",{className:"text-sm font-medium text-ink",children:h.phase==="done"?`Last update: v${h.from} → v${h.to}`:`Last update attempt (v${h.to})`}),a.jsx(ge,{tone:B5[h.phase],dot:!0,children:qg[h.phase]})]}),a.jsx($5,{run:h}),h.logTail.length>0&&a.jsxs("details",{className:"text-xs text-muted",children:[a.jsx("summary",{className:"cursor-pointer select-none font-medium text-ink",children:"Update log"}),a.jsx("pre",{className:"mt-2 max-h-48 overflow-auto rounded-sm bg-inset/70 px-3 py-2 font-mono text-2xs text-muted",children:h.logTail.join(`
475
+ `)})]})]}),!z&&k.npmUpdatable&&a.jsxs("div",{className:"flex flex-wrap items-center gap-3 border-t border-line pt-4",children:[Y&&E?a.jsxs(W,{variant:"primary",loading:m,icon:a.jsx(cg,{className:"size-4","aria-hidden":"true"}),onClick:()=>void U(),children:["Update to v",E]}):h?.phase==="done"?a.jsx(W,{variant:"secondary",icon:a.jsx(bt,{className:"size-4","aria-hidden":"true"}),onClick:()=>window.location.reload(),children:"Reload the page"}):null,a.jsx("p",{className:"text-xs text-muted",children:"The dashboard stops while the update runs and starts again on this port by itself."})]})]})})();return a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(Zt,{icon:a.jsx(cg,{className:"size-4","aria-hidden":"true"}),title:"Easy DevOps version",description:"Update the package this dashboard and its service run on. Nothing is installed unless you ask for it.",actions:a.jsx(W,{variant:"secondary",size:"sm",loading:c.loading,disabled:C,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:c.reload,children:"Check again"})}),S,c.loading&&c.data&&a.jsxs("div",{className:"flex items-center gap-2 border-t border-line px-4 py-2 text-2xs text-faint sm:px-5",children:[a.jsx(Ms,{}),"Checking the npm registry…"]}),a.jsx(Do,{children:a.jsxs("span",{className:"text-2xs text-faint",children:["Same flow as ",a.jsx("code",{className:"font-mono",children:"ezz update"})," — stop the service, replace the package, verify, and roll back if the new version does not come up."]})})]})}const Yg=[{id:"general",label:"General"},{id:"access",label:"Access"},{id:"hub",label:"Hub"},{id:"backup",label:"Backup"},{id:"update",label:"Update"}],Id=[{value:"127.0.0.1",label:"This machine only (127.0.0.1)"},{value:"0.0.0.0",label:"All interfaces (0.0.0.0)"}];function Y5(l){return l==="::1"?"This machine only (::1)":Id.find(o=>o.value===l)?.label??l}const Oo={days:7,min:1,max:30};function Bd(l){return{port:String(l.dashboardPort),nginxDir:l.nginxDir,sslDir:l.sslDir,acmeEmail:l.acmeEmail,autoRenew:l.sslAutoRenew??!0,autoRenewDays:String(l.sslAutoRenewDays??Oo.days),deployDir:l.deployDir??""}}function qd(l){return{bind:l.dashboardBindAddress,auth:l.dashboardAuth,password:"",confirm:""}}function Bi(l,o){return l instanceof Le?(typeof l.payload.detail=="string"?l.payload.detail:null)??l.message:l instanceof Error?l.message:o}function V5(l){if(l instanceof Le){const o=l.payload.reason;if(o==="no_auth_requires_loopback")return"Running without a password requires the dashboard to listen on this machine only.";if(o==="bind_requires_password")return"Set a password before opening the dashboard to the network.";if(o==="no_auth_requires_local_request")return"Turning the password off is only allowed from this machine itself."}return Bi(l,"The previous access settings are still in force.")}function X5(){Xn("Settings");const l=jt(),o=sn(),{auth:c}=Qn(),u=c?.minPasswordLength??8,[d,h]=Xo(),x=d.get("tab"),m=Yg.some(je=>je.id===x)?x:"general",p=je=>{const ot=new URLSearchParams(d);je==="general"?ot.delete("tab"):ot.set("tab",je),h(ot,{replace:!0})},b=xt(je=>ie.settings.get(je)),j=xt(je=>ie.settings.permissions(je),[],{enabled:!!b.data&&b.data?.platform!=="win32"}),{service:y,error:N,reload:C}=Ji(),U=Fi(y);Bl("settings",()=>{b.reload(),j.reload()});const[S,k]=g.useState(null),[E,T]=g.useState(null),[Y,z]=g.useState(!1),[D,te]=g.useState(!1),[L,Q]=g.useState(!1),[re,K]=g.useState(!1),[ae,M]=g.useState(!1),[_,se]=g.useState(null),[F,ne]=g.useState(null);g.useEffect(()=>{b.data&&!S&&k(Bd(b.data))},[b.data,S]),g.useEffect(()=>{b.data&&!E&&T(qd(b.data))},[b.data,E]);const fe=S?Po(S.port):null,V=S?By(S.acmeEmail):null,ce=S&&!S.nginxDir.trim()?"This directory is required.":null,Se=S&&!S.sslDir.trim()?"This directory is required.":null,ke=b.data?.deployDir!==void 0,Ve=!!S&&ke&&S.deployDir.trim()!==(b.data?.deployDir??""),$e=b.data?.sslAutoRenew!==void 0,R=b.data?.sslAutoRenewDaysMin??Oo.min,I=b.data?.sslAutoRenewDaysMax??Oo.max,J=S?Number(S.autoRenewDays):NaN,ee=S&&$e&&S.autoRenew&&(!/^\d+$/.test(S.autoRenewDays.trim())||J<R||J>I)?`Enter a whole number from ${R} to ${I}.`:null,Ne=!!(S&&b.data&&(Number(S.port)!==b.data.dashboardPort||S.nginxDir!==b.data.nginxDir||S.sslDir!==b.data.sslDir||S.acmeEmail!==b.data.acmeEmail||ke&&S.deployDir.trim()!==(b.data.deployDir??"")||$e&&(S.autoRenew!==(b.data.sslAutoRenew??!0)||S.autoRenew&&J!==(b.data.sslAutoRenewDays??Oo.days)))),Ce=!!(E&&b.data&&(E.bind!==b.data.dashboardBindAddress||E.auth!==b.data.dashboardAuth||E.password!=="")),De=async()=>{if(!(!S||L)&&(z(!0),!(fe||V||ce||Se||ee))){Q(!0);try{const je=await ie.settings.update({dashboardPort:Number(S.port),nginxDir:S.nginxDir.trim(),sslDir:S.sslDir.trim(),acmeEmail:S.acmeEmail.trim(),...Ve?{deployDir:S.deployDir.trim()}:{},...$e?{sslAutoRenew:S.autoRenew,...S.autoRenew?{sslAutoRenewDays:J}:{}}:{}});M(je.needsRestart),l.success("Settings saved",je.needsRestart?"Restart the dashboard for the new port to take effect.":void 0),b.reload()}catch(je){l.error("Could not save settings",Bi(je,"The previous settings are still in force."))}finally{Q(!1)}}},he=async()=>{if(!E||!b.data||re)return;if(te(!0),se(null),ne(null),E.auth==="none"&&E.bind==="0.0.0.0"){se("Running without a password requires the dashboard to listen here only.");return}if(E.password){const ot=yg(E.password,u)??(E.password!==E.confirm?"The two passwords do not match.":null);if(ot){ne(ot);return}}else if(E.auth==="password"&&!b.data.hasPassword){ne("Set a password before requiring a password to sign in.");return}const je=E.password?"password":E.auth;K(!0);try{const ot={dashboardBindAddress:E.bind,dashboardAuth:je};E.password&&(ot.dashboardPassword=E.password);const Ht=await ie.settings.update(ot);M(Ht.needsRestart),T(ft=>ft&&{...ft,auth:Ht.dashboardAuth,password:"",confirm:""}),l.success("Access settings saved",Ht.needsRestart?"Restart the dashboard for the new listening address to take effect.":void 0),b.reload()}catch(ot){se(V5(ot))}finally{K(!1)}},[be,$t]=g.useState(""),[Zn,ln]=g.useState(null),[Gt,rt]=g.useState(!1),Ue=async()=>{if(!(!be||Gt)){rt(!0),ln(null);try{await ie.settings.setupPermissions(be),$t(""),j.setData({configured:!0}),l.success("Permissions configured","nginx and systemctl no longer prompt for a password.")}catch(je){ln(Bi(je,"The sudoers file was not written."))}finally{rt(!1)}}},Ut=g.useRef(null),[Nn,Pt]=g.useState(!1),[fa,Kn]=g.useState(!1),[rn,X]=g.useState(null),pe=async()=>{if(!Nn){Pt(!0);try{const je=await ie.settings.backup(),ot=new Blob([JSON.stringify(je,null,2)],{type:"application/json"}),Ht=URL.createObjectURL(ot),ft=document.createElement("a");ft.href=Ht,ft.download=`easy-devops-backup-${new Date().toISOString().slice(0,10)}.json`,document.body.appendChild(ft),ft.click(),ft.remove(),window.setTimeout(()=>URL.revokeObjectURL(Ht),1e3),l.success("Backup downloaded")}catch(je){l.error("Could not create the backup",Bi(je,"Nothing was downloaded."))}finally{Pt(!1)}}},Ae=async je=>{const ot=je.target.files?.[0];if(!ot)return;X(null);let Ht;try{Ht=JSON.parse(await ot.text())}catch{X({tone:"danger",title:"That file is not valid JSON",body:"Pick the .json file produced by Export backup."}),je.target.value="";return}const ft=Ht;if(!ft||typeof ft!="object"||typeof ft.config!="object"||ft.config===null){X({tone:"danger",title:"That file is not an Easy DevOps backup",body:"A backup always contains a config section and a domains list."}),je.target.value="";return}const ct=await o({title:"Restore this backup?",body:"This replaces your current configuration and domain list. Passwords and the listen address stored in the file are ignored.",confirmLabel:"Restore",tone:"danger"});if(je.target.value="",!!ct){Kn(!0);try{await ie.settings.restore(Ht);const on=await ie.settings.get();b.setData(on),k(Bd(on)),T(qd(on)),z(!1),te(!1),M(!1),j.reload(),X({tone:"success",title:"Backup restored",body:`Configuration from ${pf(ft.exportedAt??null)} is now in force. Reload any other open dashboard tabs to pick it up.`}),l.success("Backup restored")}catch(on){X({tone:"danger",title:"The restore failed",body:Bi(on,"Nothing was changed.")})}finally{Kn(!1)}}},Ft=()=>{b.reload(),j.reload(),m==="general"&&C()},kt=ae&&a.jsx(ye,{tone:"info",title:"Restart needed",children:"The port or listening address changed. It takes effect after the dashboard restarts."}),We=()=>b.error&&!b.data?a.jsx(St,{error:b.error,title:"Could not read the settings",onRetry:b.reload}):!b.data||!S?a.jsxs(Ra,{children:[a.jsx(Ze,{className:"h-64 rounded-lg"}),a.jsx(Ze,{className:"h-40 rounded-lg"})]}):a.jsxs("div",{className:"space-y-5",children:[a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(Zt,{icon:a.jsx(mf,{className:"size-4","aria-hidden":"true"}),title:"Application configuration",description:"Where nginx lives, which port the dashboard answers on, and the address Let’s Encrypt knows you by."}),a.jsxs(Kt,{className:"space-y-5",children:[kt,a.jsxs(Ea,{children:[a.jsx(Ee,{label:"Dashboard port",type:"number",min:1,max:65535,inputMode:"numeric",value:S.port,onChange:je=>k({...S,port:je.target.value}),error:Y?fe:null,hint:"Takes effect after the dashboard restarts."}),a.jsx(Ee,{label:"ACME email",type:"email",value:S.acmeEmail,onChange:je=>k({...S,acmeEmail:je.target.value}),error:Y?V:null,hint:"Used when ordering certificates. Usually not shown to anyone.",placeholder:"admin@example.com"}),a.jsx(Ee,{label:"Nginx directory",value:S.nginxDir,onChange:je=>k({...S,nginxDir:je.target.value}),error:Y?ce:null,hint:"Where nginx.conf is located.",className:"font-mono",spellCheck:!1}),a.jsx(Ee,{label:"SSL settings directory",value:S.sslDir,onChange:je=>k({...S,sslDir:je.target.value}),error:Y?Se:null,hint:"Default directory for certificates the dashboard manages.",className:"font-mono",spellCheck:!1}),ke&&a.jsx(Ee,{label:"Deployments folder",value:S.deployDir,onChange:je=>k({...S,deployDir:je.target.value}),hint:a.jsxs(a.Fragment,{children:["Where ",a.jsx("strong",{className:"font-medium",children:"new"})," deployed apps are created. Apps that already exist stay where they are — move one from its “Domain & folder” tab. Leave empty for the default",b.data.deployDirDefault?` (${b.data.deployDirDefault})`:"","."]}),placeholder:b.data.deployDirDefault,className:"font-mono",spellCheck:!1})]}),$e&&a.jsxs("div",{className:"space-y-4 border-t border-line pt-5",children:[a.jsx(qt,{checked:S.autoRenew,onChange:je=>k({...S,autoRenew:je}),label:"Renew certificates automatically",description:a.jsx(a.Fragment,{children:"The background service renews HTTP-validated certificates before they expire, without stopping nginx. Wildcard and other DNS-validated certificates need a TXT record added by hand, so they only get a warning."})}),S.autoRenew&&a.jsx(Ea,{children:a.jsx(Ee,{label:"Renew this many days before expiry",type:"number",min:R,max:I,inputMode:"numeric",value:S.autoRenewDays,onChange:je=>k({...S,autoRenewDays:je.target.value}),error:Y?ee:null,hint:S.acmeEmail.trim()?"A failed attempt is retried on the next check, and you are notified either way.":"Set an ACME email above — renewal cannot run without one."})})]})]}),a.jsxs(Do,{children:[a.jsx("span",{className:"text-2xs text-faint",children:Ne?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(W,{variant:"ghost",size:"sm",disabled:!Ne,onClick:()=>{k(Bd(b.data)),z(!1)},children:"Revert"}),a.jsx(W,{variant:"primary",size:"sm",loading:L,disabled:!Ne,icon:a.jsx(Qd,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void De(),children:"Save settings"})]})]})]}),a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx(Zt,{icon:a.jsx(Sy,{className:"size-4","aria-hidden":"true"}),title:a.jsxs("span",{className:"inline-flex flex-wrap items-center gap-2",children:["Background service",U&&a.jsx(ge,{tone:U.running?"ok":"warn",dot:!0,children:Ho(U)}),y?.dev&&a.jsx(ge,{tone:"warn",children:"dev data dir"})]}),description:"Runs monitoring and notifications without this dashboard open.",actions:a.jsx(mt,{to:"/processes",className:Yn("secondary","sm"),children:"Open Processes"})}),a.jsx(Kt,{children:N&&!y?a.jsxs(ye,{tone:"warning",title:"Could not read the service state",children:[N.message," ",a.jsx("button",{type:"button",className:"font-medium underline underline-offset-2",onClick:C,children:"Try again"})]}):y?U?a.jsxs("div",{className:"grid grid-cols-2 gap-4 sm:grid-cols-4",children:[a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Status"}),a.jsx("div",{className:le("mt-0.5 text-sm font-medium",U.running?"text-ok":"text-warn"),children:Ho(U)}),U.stoppedByUser&&U.stoppedAtLabel&&a.jsxs("div",{className:"mt-0.5 text-2xs text-faint",children:["Stopped ",U.stoppedAtLabel]})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Mode"}),a.jsx("div",{className:"mt-0.5 text-sm font-medium text-ink",title:U.mechanismDetail,children:U.mechanismLabel})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"Starts"}),a.jsx("div",{className:"mt-0.5 text-sm font-medium text-ink",children:U.startsAtLabel})]}),a.jsxs("div",{children:[a.jsx("div",{className:"text-2xs font-medium uppercase tracking-wider text-faint",children:"PM2 (your apps)"}),a.jsx("div",{className:"mt-0.5 text-sm font-medium text-ink",children:y.pm2.installed?y.pm2.version??"Installed":"Not installed"})]})]}):null:a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(Ms,{}),"Checking the background service…"]})})]})]}),cs=()=>{if(b.error&&!b.data)return a.jsx(St,{error:b.error,title:"Could not read the settings",onRetry:b.reload});if(!b.data||!E)return a.jsxs(Ra,{children:[a.jsx(Ze,{className:"h-72 rounded-lg"}),a.jsx(Ze,{className:"h-40 rounded-lg"})]});const je=E.bind!=="0.0.0.0",ot=b.data.canUseNoPassword||je,Ht=E.password?yg(E.password,u)??(E.confirm&&E.password!==E.confirm?"The two passwords do not match.":null):null,ft=F??(D?Ht:null);return a.jsxs("div",{className:"space-y-5",children:[a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(Zt,{icon:a.jsx(Zi,{className:"size-4","aria-hidden":"true"}),title:"Access and authentication",description:"Who can reach the dashboard, and how they prove who they are."}),a.jsxs(Kt,{className:"space-y-5",children:[kt,_&&a.jsx(ye,{tone:"danger",title:"Could not save access settings",children:_}),a.jsxs(Ea,{children:[a.jsxs(os,{label:"Listen on",value:E.bind,onChange:ct=>{const on=ct.target.value;T({...E,bind:on,auth:on==="0.0.0.0"?"password":E.auth})},hint:E.auth==="none"?"Locked to this machine while there is no password.":"Changing this needs a dashboard restart.",children:[Id.map(ct=>a.jsx("option",{value:ct.value,disabled:ct.value==="0.0.0.0"&&E.auth==="none",children:ct.label},ct.value)),!Id.some(ct=>ct.value===E.bind)&&a.jsx("option",{value:E.bind,children:Y5(E.bind)})]}),a.jsxs(os,{label:"Authentication",value:E.auth,onChange:ct=>{const on=ct.target.value;T({...E,auth:on,bind:on==="none"?"127.0.0.1":E.bind}),ne(null)},hint:E.auth==="none"?"No login — reachable from this machine only.":!b.data.hasPassword&&!E.password?"No password set yet — set one below.":"A password is required to sign in.",children:[a.jsx("option",{value:"password",children:"Password required"}),a.jsx("option",{value:"none",disabled:!ot,children:"No password (this machine only)"})]})]}),E.auth==="none"&&a.jsx(ye,{tone:"warning",title:"No login",children:"Anyone who can reach this machine can open the dashboard. Listening is fixed to 127.0.0.1 so that is only this machine, not the network."}),a.jsxs("div",{className:"max-w-md space-y-4 border-t border-line pt-4",children:[a.jsx(Ee,{label:"New password",type:"password",autoComplete:"new-password",value:E.password,onChange:ct=>{T({...E,password:ct.target.value}),ne(null)},error:ft,hint:`Leave blank to keep the current password. At least ${u} characters.`}),a.jsx(Ee,{label:"Confirm new password",type:"password",autoComplete:"new-password",value:E.confirm,onChange:ct=>{T({...E,confirm:ct.target.value}),ne(null)}})]})]}),a.jsxs(Do,{children:[a.jsx("span",{className:"text-2xs text-faint",children:Ce?"Unsaved changes":"All changes saved"}),a.jsxs("div",{className:"flex items-center gap-2",children:[a.jsx(W,{variant:"ghost",size:"sm",disabled:!Ce,onClick:()=>{T(qd(b.data)),te(!1),se(null),ne(null)},children:"Revert"}),a.jsx(W,{variant:"primary",size:"sm",loading:re,disabled:!Ce,icon:a.jsx(Qd,{className:"size-3.5","aria-hidden":"true"}),onClick:()=>void he(),children:"Save access"})]})]})]}),b.data.platform!=="win32"&&a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx("div",{className:le("h-0.5 w-full",j.data?.configured?"bg-ok/60":"bg-warn/60"),"aria-hidden":"true"}),a.jsx(Zt,{icon:a.jsx(oa,{className:"size-4","aria-hidden":"true"}),title:"Linux permissions",description:"Passwordless sudo for nginx and systemctl.",actions:j.data?a.jsx(ge,{tone:j.data.configured?"ok":"warn",dot:!0,children:j.data.configured?"Configured":"Required"}):void 0}),a.jsx(Kt,{children:j.error&&!j.data?a.jsx(St,{error:j.error,title:"Could not read the permission state",onRetry:j.reload,className:"border-0"}):j.data?j.data.configured?a.jsx("p",{className:"text-sm text-muted",children:"Passwordless sudo is configured. The dashboard can reload nginx and call systemctl without stopping to ask for a password."}):a.jsxs("div",{className:"max-w-md space-y-4",children:[a.jsx("p",{className:"text-sm text-muted",children:"The dashboard needs passwordless sudo to control nginx and systemctl. Enter your sudo password once and it writes the sudoers entry for you."}),Zn&&a.jsx(ye,{tone:"danger",title:"Permissions were not configured",children:Zn}),a.jsx(Ee,{label:"Sudo password",type:"password",autoComplete:"current-password",placeholder:"Enter your sudo password",value:be,onChange:ct=>{$t(ct.target.value),Zn&&ln(null)},onKeyDown:ct=>{ct.key==="Enter"&&Ue()}}),a.jsx(W,{variant:"primary",loading:Gt,disabled:!be,onClick:()=>void Ue(),children:"Set up permissions"})]}):a.jsxs("div",{className:"flex items-center gap-2 py-4 text-sm text-muted",children:[a.jsx(Ms,{}),"Checking sudoers…"]})})]})]})},Fo=()=>a.jsxs(Qe,{className:"overflow-hidden",children:[a.jsx("div",{className:"h-0.5 w-full bg-accent/50","aria-hidden":"true"}),a.jsx(Zt,{icon:a.jsx(Xd,{className:"size-4","aria-hidden":"true"}),title:"Backup and restore",description:"Export or restore settings and domains as JSON."}),a.jsxs(Kt,{className:"space-y-5",children:[a.jsxs("div",{className:"grid gap-5 sm:grid-cols-2",children:[a.jsxs("div",{className:"space-y-3",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-ink",children:"Export"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Download every setting and domain as one JSON file. Passwords are excluded from the export."})]}),a.jsx(W,{variant:"secondary",loading:Nn,icon:a.jsx(Xd,{className:"size-4","aria-hidden":"true"}),onClick:()=>void pe(),children:"Export backup"})]}),a.jsxs("div",{className:"space-y-3 border-t border-line pt-5 sm:border-l sm:border-t-0 sm:pl-5 sm:pt-0",children:[a.jsxs("div",{children:[a.jsx("h3",{className:"text-sm font-medium text-ink",children:"Restore"}),a.jsx("p",{className:"mt-0.5 text-xs text-muted",children:"Replace the current configuration and domain list with a previously exported file. Passwords and the listen address stored in the file are ignored."})]}),a.jsx("input",{ref:Ut,type:"file",accept:".json,application/json",className:"sr-only",onChange:je=>void Ae(je)}),a.jsx(W,{variant:"secondary",loading:fa,disabled:Nn,icon:a.jsx(YN,{className:"size-4","aria-hidden":"true"}),onClick:()=>Ut.current?.click(),children:"Choose backup file…"})]})]}),rn&&a.jsx(ye,{tone:rn.tone,title:rn.title,children:rn.body})]}),a.jsx(Do,{children:a.jsx("span",{className:"text-2xs text-faint",children:"Exported backups never contain the dashboard password."})})]});return a.jsxs(a.Fragment,{children:[a.jsx(da,{title:"Settings",description:"Configuration, access, Hub pairing and backups for this dashboard.",actions:m!=="hub"&&m!=="update"?a.jsx(W,{variant:"secondary",size:"sm",loading:b.loading||j.loading,icon:a.jsx(bt,{className:"size-3.5","aria-hidden":"true"}),onClick:Ft,children:"Refresh"}):void 0}),a.jsx("div",{role:"tablist","aria-label":"Settings sections",className:"mb-5 flex flex-wrap gap-1 rounded-lg border border-line bg-raised/60 p-1",children:Yg.map(je=>a.jsx("button",{type:"button",role:"tab",id:`settings-tab-${je.id}`,"aria-selected":m===je.id,"aria-controls":`settings-panel-${je.id}`,onClick:()=>p(je.id),className:le("rounded-sm border px-3 py-1.5 text-xs font-medium transition-colors duration-[var(--ez-motion-fast)]",m===je.id?"border-line bg-surface text-ink shadow-sm":"border-transparent text-muted hover:text-ink"),children:je.label},je.id))}),a.jsxs("div",{role:"tabpanel",id:`settings-panel-${m}`,"aria-labelledby":`settings-tab-${m}`,tabIndex:-1,className:"outline-none",children:[m==="general"&&We(),m==="access"&&cs(),m==="hub"&&a.jsx(U5,{}),m==="backup"&&Fo(),m==="update"&&a.jsx(G5,{})]})]})}function Q5(){return Xn("Page not found"),a.jsxs(a.Fragment,{children:[a.jsx(da,{title:"Page not found",description:"That address does not match a dashboard section."}),a.jsxs(Qe,{className:"relative overflow-hidden",children:[a.jsx("div",{className:"pointer-events-none absolute inset-x-0 top-0 h-px bg-linear-to-r from-transparent via-accent/60 to-transparent","aria-hidden":"true"}),a.jsx("div",{className:"pointer-events-none absolute -top-28 left-1/2 size-72 -translate-x-1/2 rounded-full bg-accent-soft blur-3xl","aria-hidden":"true"}),a.jsxs("div",{className:"relative flex flex-col items-center px-6 py-14 text-center",children:[a.jsx("span",{className:"font-mono text-2xs font-semibold uppercase tracking-[0.22em] text-faint",children:"HTTP 404 · route not found"}),a.jsx("span",{className:"mt-3 bg-linear-to-b from-ink to-ink/25 bg-clip-text font-mono text-6xl font-bold tracking-tighter text-transparent",children:"404"}),a.jsx("span",{className:"mt-5 flex size-11 items-center justify-center rounded-full border border-line-strong bg-raised text-muted",children:a.jsx(g2,{className:"size-5","aria-hidden":"true"})}),a.jsx("h2",{className:"mt-4 text-lg font-semibold tracking-tight text-ink",children:"This section isn't in the dashboard"}),a.jsx("p",{className:"mt-1.5 max-w-md text-sm leading-6 text-muted",children:"The link may be old, or the page moved. Everything else is one click away — nginx, domains and certificates are untouched."}),a.jsxs("div",{className:"mt-6 flex flex-wrap items-center justify-center gap-2",children:[a.jsxs(mt,{to:"/",className:Yn("primary","sm"),children:[a.jsx(Qj,{className:"size-3.5","aria-hidden":"true"}),"Back to Overview"]}),a.jsxs(mt,{to:"/domains",className:Yn("secondary","sm"),children:[a.jsx(rs,{className:"size-3.5","aria-hidden":"true"}),"Domains"]}),a.jsxs(mt,{to:"/ssl",className:Yn("secondary","sm"),children:[a.jsx(oa,{className:"size-3.5","aria-hidden":"true"}),"Certificates"]})]})]})]})]})}function Z5(){const{phase:l}=Qn();return l==="loading"?a.jsx(Bw,{}):l==="error"?a.jsx(Zw,{}):l==="unauthenticated"?a.jsx(tS,{}):a.jsx(ej,{children:a.jsxs(Dn,{element:a.jsx(Qw,{}),children:[a.jsx(Dn,{index:!0,element:a.jsx(cS,{})}),a.jsx(Dn,{path:"domains",element:a.jsx(TS,{})}),a.jsx(Dn,{path:"ssl",element:a.jsx(LS,{})}),a.jsx(Dn,{path:"nginx",element:a.jsx(BS,{})}),a.jsx(Dn,{path:"notifications",element:a.jsx(JS,{})}),a.jsx(Dn,{path:"deployments",element:a.jsx(_5,{})}),a.jsx(Dn,{path:"processes",element:a.jsx(n5,{})}),a.jsx(Dn,{path:"logs",element:a.jsx(M5,{})}),a.jsx(Dn,{path:"settings",element:a.jsx(X5,{})}),a.jsx(Dn,{path:"*",element:a.jsx(Q5,{})})]})})}function K5(){return a.jsx(Lj,{children:a.jsx(FN,{children:a.jsx(sw,{children:a.jsx(gw,{children:a.jsx(yw,{children:a.jsx(vw,{children:a.jsx(kj,{children:a.jsx(Z5,{})})})})})})})})}const Jy=document.getElementById("root");if(!Jy)throw new Error("Missing #root element");F0.createRoot(Jy).render(a.jsx(g.StrictMode,{children:a.jsx(K5,{})}));