<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>MOADIM</title>
<script>
(function () {
if (localStorage.getItem("moadim.client.theme") === "light") {
document.documentElement.classList.add("theme-light");
}
})();
</script>
<script type="module" crossorigin>var e=Object.create,t=Object.defineProperty,n=Object.getOwnPropertyDescriptor,r=Object.getOwnPropertyNames,i=Object.getPrototypeOf,a=Object.prototype.hasOwnProperty,o=(e,t)=>()=>(t||(e((t={exports:{}}).exports,t),e=null),t.exports),s=(e,i,o,s)=>{if(i&&typeof i==`object`||typeof i==`function`)for(var c=r(i),l=0,u=c.length,d;l<u;l++)d=c[l],!a.call(e,d)&&d!==o&&t(e,d,{get:(e=>i[e]).bind(null,d),enumerable:!(s=n(i,d))||s.enumerable});return e},c=(n,r,o)=>(o=n==null?{}:e(i(n)),s(r||!n||!n.__esModule||!a.call(n,`default`)?t(o,`default`,{value:n,enumerable:!0}):o,n));(function(){let e=document.createElement(`link`).relList;if(e&&e.supports&&e.supports(`modulepreload`))return;for(let e of document.querySelectorAll(`link[rel="modulepreload"]`))n(e);new MutationObserver(e=>{for(let t of e)if(t.type===`childList`)for(let e of t.addedNodes)e.tagName===`LINK`&&e.rel===`modulepreload`&&n(e)}).observe(document,{childList:!0,subtree:!0});function t(e){let t={};return e.integrity&&(t.integrity=e.integrity),e.referrerPolicy&&(t.referrerPolicy=e.referrerPolicy),t.credentials=e.crossOrigin===`use-credentials`?`include`:e.crossOrigin===`anonymous`?`omit`:`same-origin`,t}function n(e){if(e.ep)return;e.ep=!0;let n=t(e);fetch(e.href,n)}})();var l=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.portal`),r=Symbol.for(`react.fragment`),i=Symbol.for(`react.strict_mode`),a=Symbol.for(`react.profiler`),o=Symbol.for(`react.consumer`),s=Symbol.for(`react.context`),c=Symbol.for(`react.forward_ref`),l=Symbol.for(`react.suspense`),u=Symbol.for(`react.memo`),d=Symbol.for(`react.lazy`),f=Symbol.for(`react.activity`),p=Symbol.iterator;function m(e){return typeof e!=`object`||!e?null:(e=p&&e[p]||e[`@@iterator`],typeof e==`function`?e:null)}var h={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},g=Object.assign,_={};function v(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}v.prototype.isReactComponent={},v.prototype.setState=function(e,t){if(typeof e!=`object`&&typeof e!=`function`&&e!=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,e,t,`setState`)},v.prototype.forceUpdate=function(e){this.updater.enqueueForceUpdate(this,e,`forceUpdate`)};function y(){}y.prototype=v.prototype;function b(e,t,n){this.props=e,this.context=t,this.refs=_,this.updater=n||h}var x=b.prototype=new y;x.constructor=b,g(x,v.prototype),x.isPureReactComponent=!0;var S=Array.isArray;function C(){}var w={H:null,A:null,T:null,S:null},T=Object.prototype.hasOwnProperty;function ee(e,n,r){var i=r.ref;return{$$typeof:t,type:e,key:n,ref:i===void 0?null:i,props:r}}function te(e,t){return ee(e.type,t,e.props)}function E(e){return typeof e==`object`&&!!e&&e.$$typeof===t}function D(e){var t={"=":`=0`,":":`=2`};return`$`+e.replace(/[=:]/g,function(e){return t[e]})}var ne=/\/+/g;function re(e,t){return typeof e==`object`&&e&&e.key!=null?D(``+e.key):t.toString(36)}function ie(e){switch(e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason;default:switch(typeof e.status==`string`?e.then(C,C):(e.status=`pending`,e.then(function(t){e.status===`pending`&&(e.status=`fulfilled`,e.value=t)},function(t){e.status===`pending`&&(e.status=`rejected`,e.reason=t)})),e.status){case`fulfilled`:return e.value;case`rejected`:throw e.reason}}throw e}function ae(e,r,i,a,o){var s=typeof e;(s===`undefined`||s===`boolean`)&&(e=null);var c=!1;if(e===null)c=!0;else switch(s){case`bigint`:case`string`:case`number`:c=!0;break;case`object`:switch(e.$$typeof){case t:case n:c=!0;break;case d:return c=e._init,ae(c(e._payload),r,i,a,o)}}if(c)return o=o(e),c=a===``?`.`+re(e,0):a,S(o)?(i=``,c!=null&&(i=c.replace(ne,`$&/`)+`/`),ae(o,r,i,``,function(e){return e})):o!=null&&(E(o)&&(o=te(o,i+(o.key==null||e&&e.key===o.key?``:(``+o.key).replace(ne,`$&/`)+`/`)+c)),r.push(o)),1;c=0;var l=a===``?`.`:a+`:`;if(S(e))for(var u=0;u<e.length;u++)a=e[u],s=l+re(a,u),c+=ae(a,r,i,s,o);else if(u=m(e),typeof u==`function`)for(e=u.call(e),u=0;!(a=e.next()).done;)a=a.value,s=l+re(a,u++),c+=ae(a,r,i,s,o);else if(s===`object`){if(typeof e.then==`function`)return ae(ie(e),r,i,a,o);throw r=String(e),Error(`Objects are not valid as a React child (found: `+(r===`[object Object]`?`object with keys {`+Object.keys(e).join(`, `)+`}`:r)+`). If you meant to render a collection of children, use an array instead.`)}return c}function O(e,t,n){if(e==null)return e;var r=[],i=0;return ae(e,r,``,``,function(e){return t.call(n,e,i++)}),r}function oe(e){if(e._status===-1){var t=e._result;t=t(),t.then(function(t){(e._status===0||e._status===-1)&&(e._status=1,e._result=t)},function(t){(e._status===0||e._status===-1)&&(e._status=2,e._result=t)}),e._status===-1&&(e._status=0,e._result=t)}if(e._status===1)return e._result.default;throw e._result}var k=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&&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)},A={map:O,forEach:function(e,t,n){O(e,function(){t.apply(this,arguments)},n)},count:function(e){var t=0;return O(e,function(){t++}),t},toArray:function(e){return O(e,function(e){return e})||[]},only:function(e){if(!E(e))throw Error(`React.Children.only expected to receive a single React element child.`);return e}};e.Activity=f,e.Children=A,e.Component=v,e.Fragment=r,e.Profiler=a,e.PureComponent=b,e.StrictMode=i,e.Suspense=l,e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=w,e.__COMPILER_RUNTIME={__proto__:null,c:function(e){return w.H.useMemoCache(e)}},e.cache=function(e){return function(){return e.apply(null,arguments)}},e.cacheSignal=function(){return null},e.cloneElement=function(e,t,n){if(e==null)throw Error(`The argument must be a React element, but you passed `+e+`.`);var r=g({},e.props),i=e.key;if(t!=null)for(a in t.key!==void 0&&(i=``+t.key),t)!T.call(t,a)||a===`key`||a===`__self`||a===`__source`||a===`ref`&&t.ref===void 0||(r[a]=t[a]);var a=arguments.length-2;if(a===1)r.children=n;else if(1<a){for(var o=Array(a),s=0;s<a;s++)o[s]=arguments[s+2];r.children=o}return ee(e.type,i,r)},e.createContext=function(e){return e={$$typeof:s,_currentValue:e,_currentValue2:e,_threadCount:0,Provider:null,Consumer:null},e.Provider=e,e.Consumer={$$typeof:o,_context:e},e},e.createElement=function(e,t,n){var r,i={},a=null;if(t!=null)for(r in t.key!==void 0&&(a=``+t.key),t)T.call(t,r)&&r!==`key`&&r!==`__self`&&r!==`__source`&&(i[r]=t[r]);var o=arguments.length-2;if(o===1)i.children=n;else if(1<o){for(var s=Array(o),c=0;c<o;c++)s[c]=arguments[c+2];i.children=s}if(e&&e.defaultProps)for(r in o=e.defaultProps,o)i[r]===void 0&&(i[r]=o[r]);return ee(e,a,i)},e.createRef=function(){return{current:null}},e.forwardRef=function(e){return{$$typeof:c,render:e}},e.isValidElement=E,e.lazy=function(e){return{$$typeof:d,_payload:{_status:-1,_result:e},_init:oe}},e.memo=function(e,t){return{$$typeof:u,type:e,compare:t===void 0?null:t}},e.startTransition=function(e){var t=w.T,n={};w.T=n;try{var r=e(),i=w.S;i!==null&&i(n,r),typeof r==`object`&&r&&typeof r.then==`function`&&r.then(C,k)}catch(e){k(e)}finally{t!==null&&n.types!==null&&(t.types=n.types),w.T=t}},e.unstable_useCacheRefresh=function(){return w.H.useCacheRefresh()},e.use=function(e){return w.H.use(e)},e.useActionState=function(e,t,n){return w.H.useActionState(e,t,n)},e.useCallback=function(e,t){return w.H.useCallback(e,t)},e.useContext=function(e){return w.H.useContext(e)},e.useDebugValue=function(){},e.useDeferredValue=function(e,t){return w.H.useDeferredValue(e,t)},e.useEffect=function(e,t){return w.H.useEffect(e,t)},e.useEffectEvent=function(e){return w.H.useEffectEvent(e)},e.useId=function(){return w.H.useId()},e.useImperativeHandle=function(e,t,n){return w.H.useImperativeHandle(e,t,n)},e.useInsertionEffect=function(e,t){return w.H.useInsertionEffect(e,t)},e.useLayoutEffect=function(e,t){return w.H.useLayoutEffect(e,t)},e.useMemo=function(e,t){return w.H.useMemo(e,t)},e.useOptimistic=function(e,t){return w.H.useOptimistic(e,t)},e.useReducer=function(e,t,n){return w.H.useReducer(e,t,n)},e.useRef=function(e){return w.H.useRef(e)},e.useState=function(e){return w.H.useState(e)},e.useSyncExternalStore=function(e,t,n){return w.H.useSyncExternalStore(e,t,n)},e.useTransition=function(){return w.H.useTransition()},e.version=`19.2.8`})),u=o(((e,t)=>{t.exports=l()})),d=o((e=>{function t(e,t){var n=e.length;e.push(t);a:for(;0<n;){var r=n-1>>>1,a=e[r];if(0<i(a,t))e[r]=t,e[n]=a,n=r;else break a}}function n(e){return e.length===0?null:e[0]}function r(e){if(e.length===0)return null;var t=e[0],n=e.pop();if(n!==t){e[0]=n;a:for(var r=0,a=e.length,o=a>>>1;r<o;){var s=2*(r+1)-1,c=e[s],l=s+1,u=e[l];if(0>i(c,n))l<a&&0>i(u,c)?(e[r]=u,e[l]=n,r=l):(e[r]=c,e[s]=n,r=s);else if(l<a&&0>i(u,n))e[r]=u,e[l]=n,r=l;else break a}}return t}function i(e,t){var n=e.sortIndex-t.sortIndex;return n===0?e.id-t.id:n}if(e.unstable_now=void 0,typeof performance==`object`&&typeof performance.now==`function`){var a=performance;e.unstable_now=function(){return a.now()}}else{var o=Date,s=o.now();e.unstable_now=function(){return o.now()-s}}var c=[],l=[],u=1,d=null,f=3,p=!1,m=!1,h=!1,g=!1,_=typeof setTimeout==`function`?setTimeout:null,v=typeof clearTimeout==`function`?clearTimeout:null,y=typeof setImmediate<`u`?setImmediate:null;function b(e){for(var i=n(l);i!==null;){if(i.callback===null)r(l);else if(i.startTime<=e)r(l),i.sortIndex=i.expirationTime,t(c,i);else break;i=n(l)}}function x(e){if(h=!1,b(e),!m){if(n(c)!==null)m=!0,S||(S=!0,E());else{var t=n(l);t!==null&&re(x,t.startTime-e)}}}var S=!1,C=-1,w=5,T=-1;function ee(){return g?!0:!(e.unstable_now()-T<w)}function te(){if(g=!1,S){var t=e.unstable_now();T=t;var i=!0;try{a:{m=!1,h&&(h=!1,v(C),C=-1),p=!0;var a=f;try{b:{for(b(t),d=n(c);d!==null&&!(d.expirationTime>t&&ee());){var o=d.callback;if(typeof o==`function`){d.callback=null,f=d.priorityLevel;var s=o(d.expirationTime<=t);if(t=e.unstable_now(),typeof s==`function`){d.callback=s,b(t),i=!0;break b}d===n(c)&&r(c),b(t)}else r(c);d=n(c)}if(d!==null)i=!0;else{var u=n(l);u!==null&&re(x,u.startTime-t),i=!1}}break a}finally{d=null,f=a,p=!1}i=void 0}}finally{i?E():S=!1}}}var E;if(typeof y==`function`)E=function(){y(te)};else if(typeof MessageChannel<`u`){var D=new MessageChannel,ne=D.port2;D.port1.onmessage=te,E=function(){ne.postMessage(null)}}else E=function(){_(te,0)};function re(t,n){C=_(function(){t(e.unstable_now())},n)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(e){e.callback=null},e.unstable_forceFrameRate=function(e){0>e||125<e?console.error(`forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported`):w=0<e?Math.floor(1e3/e):5},e.unstable_getCurrentPriorityLevel=function(){return f},e.unstable_next=function(e){switch(f){case 1:case 2:case 3:var t=3;break;default:t=f}var n=f;f=t;try{return e()}finally{f=n}},e.unstable_requestPaint=function(){g=!0},e.unstable_runWithPriority=function(e,t){switch(e){case 1:case 2:case 3:case 4:case 5:break;default:e=3}var n=f;f=e;try{return t()}finally{f=n}},e.unstable_scheduleCallback=function(r,i,a){var o=e.unstable_now();switch(typeof a==`object`&&a?(a=a.delay,a=typeof a==`number`&&0<a?o+a:o):a=o,r){case 1:var s=-1;break;case 2:s=250;break;case 5:s=1073741823;break;case 4:s=1e4;break;default:s=5e3}return s=a+s,r={id:u++,callback:i,priorityLevel:r,startTime:a,expirationTime:s,sortIndex:-1},a>o?(r.sortIndex=a,t(l,r),n(c)===null&&r===n(l)&&(h?(v(C),C=-1):h=!0,re(x,a-o))):(r.sortIndex=s,t(c,r),m||p||(m=!0,S||(S=!0,E()))),r},e.unstable_shouldYield=ee,e.unstable_wrapCallback=function(e){var t=f;return function(){var n=f;f=t;try{return e.apply(this,arguments)}finally{f=n}}}})),f=o(((e,t)=>{t.exports=d()})),p=o((e=>{var t=u();function n(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 r(){}var i={d:{f:r,r:function(){throw Error(n(522))},D:r,C:r,L:r,m:r,X:r,S:r,M:r},p:0,findDOMNode:null},a=Symbol.for(`react.portal`);function o(e,t,n){var r=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:a,key:r==null?null:``+r,children:e,containerInfo:t,implementation:n}}var s=t.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function c(e,t){if(e===`font`)return``;if(typeof t==`string`)return t===`use-credentials`?t:``}e.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=i,e.createPortal=function(e,t){var r=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)throw Error(n(299));return o(e,t,null,r)},e.flushSync=function(e){var t=s.T,n=i.p;try{if(s.T=null,i.p=2,e)return e()}finally{s.T=t,i.p=n,i.d.f()}},e.preconnect=function(e,t){typeof e==`string`&&(t?(t=t.crossOrigin,t=typeof t==`string`?t===`use-credentials`?t:``:void 0):t=null,i.d.C(e,t))},e.prefetchDNS=function(e){typeof e==`string`&&i.d.D(e)},e.preinit=function(e,t){if(typeof e==`string`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin),a=typeof t.integrity==`string`?t.integrity:void 0,o=typeof t.fetchPriority==`string`?t.fetchPriority:void 0;n===`style`?i.d.S(e,typeof t.precedence==`string`?t.precedence:void 0,{crossOrigin:r,integrity:a,fetchPriority:o}):n===`script`&&i.d.X(e,{crossOrigin:r,integrity:a,fetchPriority:o,nonce:typeof t.nonce==`string`?t.nonce:void 0})}},e.preinitModule=function(e,t){if(typeof e==`string`){if(typeof t==`object`&&t){if(t.as==null||t.as===`script`){var n=c(t.as,t.crossOrigin);i.d.M(e,{crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0})}}else t??i.d.M(e)}},e.preload=function(e,t){if(typeof e==`string`&&typeof t==`object`&&t&&typeof t.as==`string`){var n=t.as,r=c(n,t.crossOrigin);i.d.L(e,n,{crossOrigin:r,integrity:typeof t.integrity==`string`?t.integrity:void 0,nonce:typeof t.nonce==`string`?t.nonce:void 0,type:typeof t.type==`string`?t.type:void 0,fetchPriority:typeof t.fetchPriority==`string`?t.fetchPriority:void 0,referrerPolicy:typeof t.referrerPolicy==`string`?t.referrerPolicy:void 0,imageSrcSet:typeof t.imageSrcSet==`string`?t.imageSrcSet:void 0,imageSizes:typeof t.imageSizes==`string`?t.imageSizes:void 0,media:typeof t.media==`string`?t.media:void 0})}},e.preloadModule=function(e,t){if(typeof e==`string`){if(t){var n=c(t.as,t.crossOrigin);i.d.m(e,{as:typeof t.as==`string`&&t.as!==`script`?t.as:void 0,crossOrigin:n,integrity:typeof t.integrity==`string`?t.integrity:void 0})}else i.d.m(e)}},e.requestFormReset=function(e){i.d.r(e)},e.unstable_batchedUpdates=function(e,t){return e(t)},e.useFormState=function(e,t,n){return s.H.useFormState(e,t,n)},e.useFormStatus=function(){return s.H.useHostTransitionStatus()},e.version=`19.2.8`})),m=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=p()})),h=o((e=>{var t=f(),n=u(),r=m();function i(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 a(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,n=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,t.flags&4098&&(n=t.return),e=t.return;while(e)}return t.tag===3?n:null}function s(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 c(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 l(e){if(o(e)!==e)throw Error(i(188))}function d(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(i(188));return t===e?e:null}for(var n=e,r=t;;){var a=n.return;if(a===null)break;var s=a.alternate;if(s===null){if(r=a.return,r!==null){n=r;continue}break}if(a.child===s.child){for(s=a.child;s;){if(s===n)return l(a),e;if(s===r)return l(a),t;s=s.sibling}throw Error(i(188))}if(n.return!==r.return)n=a,r=s;else{for(var c=!1,u=a.child;u;){if(u===n){c=!0,n=a,r=s;break}if(u===r){c=!0,r=a,n=s;break}u=u.sibling}if(!c){for(u=s.child;u;){if(u===n){c=!0,n=s,r=a;break}if(u===r){c=!0,r=s,n=a;break}u=u.sibling}if(!c)throw Error(i(189))}}if(n.alternate!==r)throw Error(i(190))}if(n.tag!==3)throw Error(i(188));return n.stateNode.current===n?e:t}function p(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=p(e),t!==null)return t;e=e.sibling}return null}var h=Object.assign,g=Symbol.for(`react.element`),_=Symbol.for(`react.transitional.element`),v=Symbol.for(`react.portal`),y=Symbol.for(`react.fragment`),b=Symbol.for(`react.strict_mode`),x=Symbol.for(`react.profiler`),S=Symbol.for(`react.consumer`),C=Symbol.for(`react.context`),w=Symbol.for(`react.forward_ref`),T=Symbol.for(`react.suspense`),ee=Symbol.for(`react.suspense_list`),te=Symbol.for(`react.memo`),E=Symbol.for(`react.lazy`),D=Symbol.for(`react.activity`),ne=Symbol.for(`react.memo_cache_sentinel`),re=Symbol.iterator;function ie(e){return typeof e!=`object`||!e?null:(e=re&&e[re]||e[`@@iterator`],typeof e==`function`?e:null)}var ae=Symbol.for(`react.client.reference`);function O(e){if(e==null)return null;if(typeof e==`function`)return e.$$typeof===ae?null:e.displayName||e.name||null;if(typeof e==`string`)return e;switch(e){case y:return`Fragment`;case x:return`Profiler`;case b:return`StrictMode`;case T:return`Suspense`;case ee:return`SuspenseList`;case D:return`Activity`}if(typeof e==`object`)switch(e.$$typeof){case v:return`Portal`;case C:return e.displayName||`Context`;case S:return(e._context.displayName||`Context`)+`.Consumer`;case w:var t=e.render;return e=e.displayName,e||=(e=t.displayName||t.name||``,e===``?`ForwardRef`:`ForwardRef(`+e+`)`),e;case te:return t=e.displayName||null,t===null?O(e.type)||`Memo`:t;case E:t=e._payload,e=e._init;try{return O(e(t))}catch{}}return null}var oe=Array.isArray,k=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,A=r.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,se={pending:!1,data:null,method:null,action:null},ce=[],le=-1;function ue(e){return{current:e}}function de(e){0>le||(e.current=ce[le],ce[le]=null,le--)}function j(e,t){le++,ce[le]=e.current,e.current=t}var fe=ue(null),pe=ue(null),me=ue(null),he=ue(null);function ge(e,t){switch(j(me,t),j(pe,e),j(fe,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Hd(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Hd(t),e=Ud(t,e);else switch(e){case`svg`:e=1;break;case`math`:e=2;break;default:e=0}}de(fe),j(fe,e)}function _e(){de(fe),de(pe),de(me)}function ve(e){e.memoizedState!==null&&j(he,e);var t=fe.current,n=Ud(t,e.type);t!==n&&(j(pe,e),j(fe,n))}function ye(e){pe.current===e&&(de(fe),de(pe)),he.current===e&&(de(he),Qf._currentValue=se)}var be,xe;function Se(e){if(be===void 0)try{throw Error()}catch(e){var t=e.stack.trim().match(/\n( *(at )?)/);be=t&&t[1]||``,xe=-1<e.stack.indexOf(`
at`)?` (<anonymous>)`:-1<e.stack.indexOf(`@`)?`@unknown:0:0`:``}return`
`+be+e+xe}var Ce=!1;function we(e,t){if(!e||Ce)return``;Ce=!0;var n=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var n=function(){throw Error()};if(Object.defineProperty(n.prototype,"props",{set:function(){throw Error()}}),typeof Reflect==`object`&&Reflect.construct){try{Reflect.construct(n,[])}catch(e){var r=e}Reflect.construct(e,[],n)}else{try{n.call()}catch(e){r=e}e.call(n.prototype)}}else{try{throw Error()}catch(e){r=e}(n=e())&&typeof n.catch==`function`&&n.catch(function(){})}}catch(e){if(e&&r&&typeof e.stack==`string`)return[e.stack,r.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName=`DetermineComponentFrameRoot`;var i=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,`name`);i&&i.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:`DetermineComponentFrameRoot`});var a=r.DetermineComponentFrameRoot(),o=a[0],s=a[1];if(o&&s){var c=o.split(`
`),l=s.split(`
`);for(i=r=0;r<c.length&&!c[r].includes(`DetermineComponentFrameRoot`);)r++;for(;i<l.length&&!l[i].includes(`DetermineComponentFrameRoot`);)i++;if(r===c.length||i===l.length)for(r=c.length-1,i=l.length-1;1<=r&&0<=i&&c[r]!==l[i];)i--;for(;1<=r&&0<=i;r--,i--)if(c[r]!==l[i]){if(r!==1||i!==1)do if(r--,i--,0>i||c[r]!==l[i]){var u=`
`+c[r].replace(` at new `,` at `);return e.displayName&&u.includes(`<anonymous>`)&&(u=u.replace(`<anonymous>`,e.displayName)),u}while(1<=r&&0<=i);break}}}finally{Ce=!1,Error.prepareStackTrace=n}return(n=e?e.displayName||e.name:``)?Se(n):``}function Te(e,t){switch(e.tag){case 26:case 27:case 5:return Se(e.type);case 16:return Se(`Lazy`);case 13:return e.child!==t&&t!==null?Se(`Suspense Fallback`):Se(`Suspense`);case 19:return Se(`SuspenseList`);case 0:case 15:return we(e.type,!1);case 11:return we(e.type.render,!1);case 1:return we(e.type,!0);case 31:return Se(`Activity`);default:return``}}function Ee(e){try{var t=``,n=null;do t+=Te(e,n),n=e,e=e.return;while(e);return t}catch(e){return`
Error generating stack: `+e.message+`
`+e.stack}}var De=Object.prototype.hasOwnProperty,Oe=t.unstable_scheduleCallback,ke=t.unstable_cancelCallback,Ae=t.unstable_shouldYield,je=t.unstable_requestPaint,Me=t.unstable_now,Ne=t.unstable_getCurrentPriorityLevel,Pe=t.unstable_ImmediatePriority,Fe=t.unstable_UserBlockingPriority,M=t.unstable_NormalPriority,Ie=t.unstable_LowPriority,Le=t.unstable_IdlePriority,Re=t.log,ze=t.unstable_setDisableYieldValue,Be=null,Ve=null;function He(e){if(typeof Re==`function`&&ze(e),Ve&&typeof Ve.setStrictMode==`function`)try{Ve.setStrictMode(Be,e)}catch{}}var Ue=Math.clz32?Math.clz32:Ke,We=Math.log,Ge=Math.LN2;function Ke(e){return e>>>=0,e===0?32:31-(We(e)/Ge|0)|0}var qe=256,Je=262144,Ye=4194304;function Xe(e){var t=e&42;if(t!==0)return t;switch(e&-e){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return e&261888;case 262144:case 524288:case 1048576:case 2097152:return e&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return e&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return e}}function Ze(e,t,n){var r=e.pendingLanes;if(r===0)return 0;var i=0,a=e.suspendedLanes,o=e.pingedLanes;e=e.warmLanes;var s=r&134217727;return s===0?(s=r&~a,s===0?o===0?n||(n=r&~e,n!==0&&(i=Xe(n))):i=Xe(o):i=Xe(s)):(r=s&~a,r===0?(o&=s,o===0?n||(n=s&~e,n!==0&&(i=Xe(n))):i=Xe(o)):i=Xe(r)),i===0?0:t!==0&&t!==i&&(t&a)===0&&(a=i&-i,n=t&-t,a>=n||a===32&&n&4194048)?t:i}function Qe(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function $e(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 et(){var e=Ye;return Ye<<=1,!(Ye&62914560)&&(Ye=4194304),e}function N(e){for(var t=[],n=0;31>n;n++)t.push(e);return t}function tt(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function nt(e,t,n,r,i,a){var o=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 s=e.entanglements,c=e.expirationTimes,l=e.hiddenUpdates;for(n=o&~n;0<n;){var u=31-Ue(n),d=1<<u;s[u]=0,c[u]=-1;var f=l[u];if(f!==null)for(l[u]=null,u=0;u<f.length;u++){var p=f[u];p!==null&&(p.lane&=-536870913)}n&=~d}r!==0&&rt(e,r,0),a!==0&&i===0&&e.tag!==0&&(e.suspendedLanes|=a&~(o&~t))}function rt(e,t,n){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ue(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|n&261930}function it(e,t){var n=e.entangledLanes|=t;for(e=e.entanglements;n;){var r=31-Ue(n),i=1<<r;i&t|e[r]&t&&(e[r]|=t),n&=~i}}function at(e,t){var n=t&-t;return n=n&42?1:ot(n),(n&(e.suspendedLanes|t))===0?n:0}function ot(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 st(e){return e&=-e,2<e?8<e?e&134217727?32:268435456:8:2}function ct(){var e=A.p;return e===0?(e=window.event,e===void 0?32:mp(e.type)):e}function lt(e,t){var n=A.p;try{return A.p=e,t()}finally{A.p=n}}var ut=Math.random().toString(36).slice(2),dt=`__reactFiber$`+ut,ft=`__reactProps$`+ut,pt=`__reactContainer$`+ut,mt=`__reactEvents$`+ut,ht=`__reactListeners$`+ut,gt=`__reactHandles$`+ut,_t=`__reactResources$`+ut,P=`__reactMarker$`+ut;function vt(e){delete e[dt],delete e[ft],delete e[mt],delete e[ht],delete e[gt]}function yt(e){var t=e[dt];if(t)return t;for(var n=e.parentNode;n;){if(t=n[pt]||n[dt]){if(n=t.alternate,t.child!==null||n!==null&&n.child!==null)for(e=ff(e);e!==null;){if(n=e[dt])return n;e=ff(e)}return t}e=n,n=e.parentNode}return null}function bt(e){if(e=e[dt]||e[pt]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function xt(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(i(33))}function St(e){var t=e[_t];return t||=e[_t]={hoistableStyles:new Map,hoistableScripts:new Map},t}function Ct(e){e[P]=!0}var wt=new Set,Tt={};function Et(e,t){Dt(e,t),Dt(e+`Capture`,t)}function Dt(e,t){for(Tt[e]=t,e=0;e<t.length;e++)wt.add(t[e])}var Ot=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]*$`),kt={},At={};function jt(e){return De.call(At,e)?!0:De.call(kt,e)?!1:Ot.test(e)?At[e]=!0:(kt[e]=!0,!1)}function Mt(e,t,n){if(jt(t)){if(n===null)e.removeAttribute(t);else{switch(typeof n){case`undefined`:case`function`:case`symbol`:e.removeAttribute(t);return;case`boolean`:var r=t.toLowerCase().slice(0,5);if(r!==`data-`&&r!==`aria-`){e.removeAttribute(t);return}}e.setAttribute(t,``+n)}}}function Nt(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 Pt(e,t,n,r){if(r===null)e.removeAttribute(n);else{switch(typeof r){case`undefined`:case`function`:case`symbol`:case`boolean`:e.removeAttribute(n);return}e.setAttributeNS(t,n,``+r)}}function Ft(e){switch(typeof e){case`bigint`:case`boolean`:case`number`:case`string`:case`undefined`:return e;case`object`:return e;default:return``}}function It(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()===`input`&&(t===`checkbox`||t===`radio`)}function Lt(e,t,n){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&r!==void 0&&typeof r.get==`function`&&typeof r.set==`function`){var i=r.get,a=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return i.call(this)},set:function(e){n=``+e,a.call(this,e)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return n},setValue:function(e){n=``+e},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function Rt(e){if(!e._valueTracker){var t=It(e)?`checked`:`value`;e._valueTracker=Lt(e,t,``+e[t])}}function zt(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var n=t.getValue(),r=``;return e&&(r=It(e)?e.checked?`true`:`false`:e.value),e=r,e!==n&&(t.setValue(e),!0)}function Bt(e){if(e||=typeof document<`u`?document:void 0,e===void 0)return null;try{return e.activeElement||e.body}catch{return e.body}}var Vt=/[\n"\\]/g;function Ht(e){return e.replace(Vt,function(e){return`\\`+e.charCodeAt(0).toString(16)+` `})}function Ut(e,t,n,r,i,a,o,s){e.name=``,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`?e.type=o:e.removeAttribute(`type`),t==null?o!==`submit`&&o!==`reset`||e.removeAttribute(`value`):o===`number`?(t===0&&e.value===``||e.value!=t)&&(e.value=``+Ft(t)):e.value!==``+Ft(t)&&(e.value=``+Ft(t)),t==null?n==null?r!=null&&e.removeAttribute(`value`):Gt(e,o,Ft(n)):Gt(e,o,Ft(t)),i==null&&a!=null&&(e.defaultChecked=!!a),i!=null&&(e.checked=i&&typeof i!=`function`&&typeof i!=`symbol`),s!=null&&typeof s!=`function`&&typeof s!=`symbol`&&typeof s!=`boolean`?e.name=``+Ft(s):e.removeAttribute(`name`)}function Wt(e,t,n,r,i,a,o,s){if(a!=null&&typeof a!=`function`&&typeof a!=`symbol`&&typeof a!=`boolean`&&(e.type=a),t!=null||n!=null){if(!(a!==`submit`&&a!==`reset`||t!=null)){Rt(e);return}n=n==null?``:``+Ft(n),t=t==null?n:``+Ft(t),s||t===e.value||(e.value=t),e.defaultValue=t}r??=i,r=typeof r!=`function`&&typeof r!=`symbol`&&!!r,e.checked=s?e.checked:!!r,e.defaultChecked=!!r,o!=null&&typeof o!=`function`&&typeof o!=`symbol`&&typeof o!=`boolean`&&(e.name=o),Rt(e)}function Gt(e,t,n){t===`number`&&Bt(e.ownerDocument)===e||e.defaultValue===``+n||(e.defaultValue=``+n)}function Kt(e,t,n,r){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&&r&&(e[n].defaultSelected=!0)}else{for(n=``+Ft(n),t=null,i=0;i<e.length;i++){if(e[i].value===n){e[i].selected=!0,r&&(e[i].defaultSelected=!0);return}t!==null||e[i].disabled||(t=e[i])}t!==null&&(t.selected=!0)}}function qt(e,t,n){if(t!=null&&(t=``+Ft(t),t!==e.value&&(e.value=t),n==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=n==null?``:``+Ft(n)}function Jt(e,t,n,r){if(t==null){if(r!=null){if(n!=null)throw Error(i(92));if(oe(r)){if(1<r.length)throw Error(i(93));r=r[0]}n=r}n??=``,t=n}n=Ft(t),e.defaultValue=n,r=e.textContent,r===n&&r!==``&&r!==null&&(e.value=r),Rt(e)}function Yt(e,t){if(t){var n=e.firstChild;if(n&&n===e.lastChild&&n.nodeType===3){n.nodeValue=t;return}}e.textContent=t}var Xt=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 Zt(e,t,n){var r=t.indexOf(`--`)===0;n==null||typeof n==`boolean`||n===``?r?e.setProperty(t,``):t===`float`?e.cssFloat=``:e[t]=``:r?e.setProperty(t,n):typeof n!=`number`||n===0||Xt.has(t)?t===`float`?e.cssFloat=n:e[t]=(``+n).trim():e[t]=n+`px`}function Qt(e,t,n){if(t!=null&&typeof t!=`object`)throw Error(i(62));if(e=e.style,n!=null){for(var r in n)!n.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf(`--`)===0?e.setProperty(r,``):r===`float`?e.cssFloat=``:e[r]=``);for(var a in t)r=t[a],t.hasOwnProperty(a)&&n[a]!==r&&Zt(e,a,r)}else for(var o in t)t.hasOwnProperty(o)&&Zt(e,o,t[o])}function $t(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 en=new Map([[`acceptCharset`,`accept-charset`],[`htmlFor`,`for`],[`httpEquiv`,`http-equiv`],[`crossOrigin`,`crossorigin`],[`accentHeight`,`accent-height`],[`alignmentBaseline`,`alignment-baseline`],[`arabicForm`,`arabic-form`],[`baselineShift`,`baseline-shift`],[`capHeight`,`cap-height`],[`clipPath`,`clip-path`],[`clipRule`,`clip-rule`],[`colorInterpolation`,`color-interpolation`],[`colorInterpolationFilters`,`color-interpolation-filters`],[`colorProfile`,`color-profile`],[`colorRendering`,`color-rendering`],[`dominantBaseline`,`dominant-baseline`],[`enableBackground`,`enable-background`],[`fillOpacity`,`fill-opacity`],[`fillRule`,`fill-rule`],[`floodColor`,`flood-color`],[`floodOpacity`,`flood-opacity`],[`fontFamily`,`font-family`],[`fontSize`,`font-size`],[`fontSizeAdjust`,`font-size-adjust`],[`fontStretch`,`font-stretch`],[`fontStyle`,`font-style`],[`fontVariant`,`font-variant`],[`fontWeight`,`font-weight`],[`glyphName`,`glyph-name`],[`glyphOrientationHorizontal`,`glyph-orientation-horizontal`],[`glyphOrientationVertical`,`glyph-orientation-vertical`],[`horizAdvX`,`horiz-adv-x`],[`horizOriginX`,`horiz-origin-x`],[`imageRendering`,`image-rendering`],[`letterSpacing`,`letter-spacing`],[`lightingColor`,`lighting-color`],[`markerEnd`,`marker-end`],[`markerMid`,`marker-mid`],[`markerStart`,`marker-start`],[`overlinePosition`,`overline-position`],[`overlineThickness`,`overline-thickness`],[`paintOrder`,`paint-order`],[`panose-1`,`panose-1`],[`pointerEvents`,`pointer-events`],[`renderingIntent`,`rendering-intent`],[`shapeRendering`,`shape-rendering`],[`stopColor`,`stop-color`],[`stopOpacity`,`stop-opacity`],[`strikethroughPosition`,`strikethrough-position`],[`strikethroughThickness`,`strikethrough-thickness`],[`strokeDasharray`,`stroke-dasharray`],[`strokeDashoffset`,`stroke-dashoffset`],[`strokeLinecap`,`stroke-linecap`],[`strokeLinejoin`,`stroke-linejoin`],[`strokeMiterlimit`,`stroke-miterlimit`],[`strokeOpacity`,`stroke-opacity`],[`strokeWidth`,`stroke-width`],[`textAnchor`,`text-anchor`],[`textDecoration`,`text-decoration`],[`textRendering`,`text-rendering`],[`transformOrigin`,`transform-origin`],[`underlinePosition`,`underline-position`],[`underlineThickness`,`underline-thickness`],[`unicodeBidi`,`unicode-bidi`],[`unicodeRange`,`unicode-range`],[`unitsPerEm`,`units-per-em`],[`vAlphabetic`,`v-alphabetic`],[`vHanging`,`v-hanging`],[`vIdeographic`,`v-ideographic`],[`vMathematical`,`v-mathematical`],[`vectorEffect`,`vector-effect`],[`vertAdvY`,`vert-adv-y`],[`vertOriginX`,`vert-origin-x`],[`vertOriginY`,`vert-origin-y`],[`wordSpacing`,`word-spacing`],[`writingMode`,`writing-mode`],[`xmlnsXlink`,`xmlns:xlink`],[`xHeight`,`x-height`]]),tn=/^[\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 nn(e){return tn.test(``+e)?`javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')`:e}function rn(){}var an=null;function on(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var sn=null,cn=null;function ln(e){var t=bt(e);if(t&&(e=t.stateNode)){var n=e[ft]||null;a:switch(e=t.stateNode,t.type){case`input`:if(Ut(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="`+Ht(``+t)+`"][type="radio"]`),t=0;t<n.length;t++){var r=n[t];if(r!==e&&r.form===e.form){var a=r[ft]||null;if(!a)throw Error(i(90));Ut(r,a.value,a.defaultValue,a.defaultValue,a.checked,a.defaultChecked,a.type,a.name)}}for(t=0;t<n.length;t++)r=n[t],r.form===e.form&&zt(r)}break a;case`textarea`:qt(e,n.value,n.defaultValue);break a;case`select`:t=n.value,t!=null&&Kt(e,!!n.multiple,t,!1)}}}var un=!1;function dn(e,t,n){if(un)return e(t,n);un=!0;try{return e(t)}finally{if(un=!1,(sn!==null||cn!==null)&&(Su(),sn&&(t=sn,e=cn,cn=sn=null,ln(t),e)))for(t=0;t<e.length;t++)ln(e[t])}}function fn(e,t){var n=e.stateNode;if(n===null)return null;var r=n[ft]||null;if(r===null)return null;n=r[t];a:switch(t){case`onClick`:case`onClickCapture`:case`onDoubleClick`:case`onDoubleClickCapture`:case`onMouseDown`:case`onMouseDownCapture`:case`onMouseMove`:case`onMouseMoveCapture`:case`onMouseUp`:case`onMouseUpCapture`:case`onMouseEnter`:(r=!r.disabled)||(e=e.type,r=e!==`button`&&e!==`input`&&e!==`select`&&e!==`textarea`),e=!r;break a;default:e=!1}if(e)return null;if(n&&typeof n!=`function`)throw Error(i(231,t,typeof n));return n}var pn=!(typeof window>`u`||window.document===void 0||window.document.createElement===void 0),mn=!1;if(pn)try{var hn={};Object.defineProperty(hn,"passive",{get:function(){mn=!0}}),window.addEventListener(`test`,hn,hn),window.removeEventListener(`test`,hn,hn)}catch{mn=!1}var gn=null,_n=null,vn=null;function yn(){if(vn)return vn;var e,t=_n,n=t.length,r,i=`value`in gn?gn.value:gn.textContent,a=i.length;for(e=0;e<n&&t[e]===i[e];e++);var o=n-e;for(r=1;r<=o&&t[n-r]===i[a-r];r++);return vn=i.slice(e,1<r?1-r:void 0)}function bn(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 xn(){return!0}function Sn(){return!1}function Cn(e){function t(t,n,r,i,a){for(var o in this._reactName=t,this._targetInst=r,this.type=n,this.nativeEvent=i,this.target=a,this.currentTarget=null,e)e.hasOwnProperty(o)&&(t=e[o],this[o]=t?t(i):i[o]);return this.isDefaultPrevented=(i.defaultPrevented==null?!1===i.returnValue:i.defaultPrevented)?xn:Sn,this.isPropagationStopped=Sn,this}return h(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var e=this.nativeEvent;e&&(e.preventDefault?e.preventDefault():typeof e.returnValue!=`unknown`&&(e.returnValue=!1),this.isDefaultPrevented=xn)},stopPropagation:function(){var e=this.nativeEvent;e&&(e.stopPropagation?e.stopPropagation():typeof e.cancelBubble!=`unknown`&&(e.cancelBubble=!0),this.isPropagationStopped=xn)},persist:function(){},isPersistent:xn}),t}var wn={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Tn=Cn(wn),En=h({},wn,{view:0,detail:0}),Dn=Cn(En),On,kn,An,jn=h({},En,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Hn,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!==An&&(An&&e.type===`mousemove`?(On=e.screenX-An.screenX,kn=e.screenY-An.screenY):kn=On=0,An=e),On)},movementY:function(e){return`movementY`in e?e.movementY:kn}}),Mn=Cn(jn),Nn=Cn(h({},jn,{dataTransfer:0})),Pn=Cn(h({},En,{relatedTarget:0})),Fn=Cn(h({},wn,{animationName:0,elapsedTime:0,pseudoElement:0})),In=Cn(h({},wn,{clipboardData:function(e){return`clipboardData`in e?e.clipboardData:window.clipboardData}})),Ln=Cn(h({},wn,{data:0})),Rn={Esc:`Escape`,Spacebar:` `,Left:`ArrowLeft`,Up:`ArrowUp`,Right:`ArrowRight`,Down:`ArrowDown`,Del:`Delete`,Win:`OS`,Menu:`ContextMenu`,Apps:`ContextMenu`,Scroll:`ScrollLock`,MozPrintableKey:`Unidentified`},zn={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`},Bn={Alt:`altKey`,Control:`ctrlKey`,Meta:`metaKey`,Shift:`shiftKey`};function Vn(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Bn[e])?!!t[e]:!1}function Hn(){return Vn}var Un=Cn(h({},En,{key:function(e){if(e.key){var t=Rn[e.key]||e.key;if(t!==`Unidentified`)return t}return e.type===`keypress`?(e=bn(e),e===13?`Enter`:String.fromCharCode(e)):e.type===`keydown`||e.type===`keyup`?zn[e.keyCode]||`Unidentified`:``},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Hn,charCode:function(e){return e.type===`keypress`?bn(e):0},keyCode:function(e){return e.type===`keydown`||e.type===`keyup`?e.keyCode:0},which:function(e){return e.type===`keypress`?bn(e):e.type===`keydown`||e.type===`keyup`?e.keyCode:0}})),Wn=Cn(h({},jn,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0})),Gn=Cn(h({},En,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Hn})),Kn=Cn(h({},wn,{propertyName:0,elapsedTime:0,pseudoElement:0})),qn=Cn(h({},jn,{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})),Jn=Cn(h({},wn,{newState:0,oldState:0})),Yn=[9,13,27,32],Xn=pn&&`CompositionEvent`in window,Zn=null;pn&&`documentMode`in document&&(Zn=document.documentMode);var Qn=pn&&`TextEvent`in window&&!Zn,$n=pn&&(!Xn||Zn&&8<Zn&&11>=Zn),er=` `,tr=!1;function nr(e,t){switch(e){case`keyup`:return Yn.indexOf(t.keyCode)!==-1;case`keydown`:return t.keyCode!==229;case`keypress`:case`mousedown`:case`focusout`:return!0;default:return!1}}function rr(e){return e=e.detail,typeof e==`object`&&`data`in e?e.data:null}var ir=!1;function ar(e,t){switch(e){case`compositionend`:return rr(t);case`keypress`:return t.which===32?(tr=!0,er):null;case`textInput`:return e=t.data,e===er&&tr?null:e;default:return null}}function or(e,t){if(ir)return e===`compositionend`||!Xn&&nr(e,t)?(e=yn(),vn=_n=gn=null,ir=!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 $n&&t.locale!==`ko`?null:t.data;default:return null}}var sr={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 cr(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t===`input`?!!sr[e.type]:t===`textarea`}function lr(e,t,n,r){sn?cn?cn.push(r):cn=[r]:sn=r,t=Ed(t,`onChange`),0<t.length&&(n=new Tn(`onChange`,`change`,null,n,r),e.push({event:n,listeners:t}))}var ur=null,dr=null;function fr(e){yd(e,0)}function pr(e){if(zt(xt(e)))return e}function mr(e,t){if(e===`change`)return t}var hr=!1;if(pn){var gr;if(pn){var _r=`oninput`in document;if(!_r){var vr=document.createElement(`div`);vr.setAttribute(`oninput`,`return;`),_r=typeof vr.oninput==`function`}gr=_r}else gr=!1;hr=gr&&(!document.documentMode||9<document.documentMode)}function yr(){ur&&(ur.detachEvent(`onpropertychange`,br),dr=ur=null)}function br(e){if(e.propertyName===`value`&&pr(dr)){var t=[];lr(t,dr,e,on(e)),dn(fr,t)}}function xr(e,t,n){e===`focusin`?(yr(),ur=t,dr=n,ur.attachEvent(`onpropertychange`,br)):e===`focusout`&&yr()}function Sr(e){if(e===`selectionchange`||e===`keyup`||e===`keydown`)return pr(dr)}function Cr(e,t){if(e===`click`)return pr(t)}function wr(e,t){if(e===`input`||e===`change`)return pr(t)}function Tr(e,t){return e===t&&(e!==0||1/e==1/t)||e!==e&&t!==t}var Er=typeof Object.is==`function`?Object.is:Tr;function Dr(e,t){if(Er(e,t))return!0;if(typeof e!=`object`||!e||typeof t!=`object`||!t)return!1;var n=Object.keys(e),r=Object.keys(t);if(n.length!==r.length)return!1;for(r=0;r<n.length;r++){var i=n[r];if(!De.call(t,i)||!Er(e[i],t[i]))return!1}return!0}function Or(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kr(e,t){var n=Or(e);e=0;for(var r;n;){if(n.nodeType===3){if(r=e+n.textContent.length,e<=t&&r>=t)return{node:n,offset:t-e};e=r}a:{for(;n;){if(n.nextSibling){n=n.nextSibling;break a}n=n.parentNode}n=void 0}n=Or(n)}}function Ar(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?Ar(e,t.parentNode):`contains`in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function jr(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Bt(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=Bt(e.document)}return t}function Mr(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 Nr=pn&&`documentMode`in document&&11>=document.documentMode,Pr=null,Fr=null,Ir=null,Lr=!1;function F(e,t,n){var r=n.window===n?n.document:n.nodeType===9?n:n.ownerDocument;Lr||Pr==null||Pr!==Bt(r)||(r=Pr,`selectionStart`in r&&Mr(r)?r={start:r.selectionStart,end:r.selectionEnd}:(r=(r.ownerDocument&&r.ownerDocument.defaultView||window).getSelection(),r={anchorNode:r.anchorNode,anchorOffset:r.anchorOffset,focusNode:r.focusNode,focusOffset:r.focusOffset}),Ir&&Dr(Ir,r)||(Ir=r,r=Ed(Fr,`onSelect`),0<r.length&&(t=new Tn(`onSelect`,`select`,null,t,n),e.push({event:t,listeners:r}),t.target=Pr)))}function Rr(e,t){var n={};return n[e.toLowerCase()]=t.toLowerCase(),n[`Webkit`+e]=`webkit`+t,n[`Moz`+e]=`moz`+t,n}var zr={animationend:Rr(`Animation`,`AnimationEnd`),animationiteration:Rr(`Animation`,`AnimationIteration`),animationstart:Rr(`Animation`,`AnimationStart`),transitionrun:Rr(`Transition`,`TransitionRun`),transitionstart:Rr(`Transition`,`TransitionStart`),transitioncancel:Rr(`Transition`,`TransitionCancel`),transitionend:Rr(`Transition`,`TransitionEnd`)},Br={},Vr={};pn&&(Vr=document.createElement(`div`).style,`AnimationEvent`in window||(delete zr.animationend.animation,delete zr.animationiteration.animation,delete zr.animationstart.animation),`TransitionEvent`in window||delete zr.transitionend.transition);function Hr(e){if(Br[e])return Br[e];if(!zr[e])return e;var t=zr[e],n;for(n in t)if(t.hasOwnProperty(n)&&n in Vr)return Br[e]=t[n];return e}var Ur=Hr(`animationend`),Wr=Hr(`animationiteration`),Gr=Hr(`animationstart`),Kr=Hr(`transitionrun`),qr=Hr(`transitionstart`),Jr=Hr(`transitioncancel`),Yr=Hr(`transitionend`),I=new Map,Xr=`abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel`.split(` `);Xr.push(`scrollEnd`);function Zr(e,t){I.set(e,t),Et(t,[e])}var Qr=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&&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)},$r=[],ei=0,ti=0;function ni(){for(var e=ei,t=ti=ei=0;t<e;){var n=$r[t];$r[t++]=null;var r=$r[t];$r[t++]=null;var i=$r[t];$r[t++]=null;var a=$r[t];if($r[t++]=null,r!==null&&i!==null){var o=r.pending;o===null?i.next=i:(i.next=o.next,o.next=i),r.pending=i}a!==0&&oi(n,i,a)}}function ri(e,t,n,r){$r[ei++]=e,$r[ei++]=t,$r[ei++]=n,$r[ei++]=r,ti|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function ii(e,t,n,r){return ri(e,t,n,r),si(e)}function ai(e,t){return ri(e,null,null,t),si(e)}function oi(e,t,n){e.lanes|=n;var r=e.alternate;r!==null&&(r.lanes|=n);for(var i=!1,a=e.return;a!==null;)a.childLanes|=n,r=a.alternate,r!==null&&(r.childLanes|=n),a.tag===22&&(e=a.stateNode,e===null||e._visibility&1||(i=!0)),e=a,a=a.return;return e.tag===3?(a=e.stateNode,i&&t!==null&&(i=31-Ue(n),e=a.hiddenUpdates,r=e[i],r===null?e[i]=[t]:r.push(t),t.lane=n|536870912),a):null}function si(e){if(50<pu)throw pu=0,mu=null,Error(i(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var ci={};function li(e,t,n,r){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=r,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ui(e,t,n,r){return new li(e,t,n,r)}function di(e){return e=e.prototype,!(!e||!e.isReactComponent)}function fi(e,t){var n=e.alternate;return n===null?(n=ui(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&65011712,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 pi(e,t){e.flags&=65011714;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 mi(e,t,n,r,a,o){var s=0;if(r=e,typeof e==`function`)di(e)&&(s=1);else if(typeof e==`string`)s=Uf(e,n,fe.current)?26:e===`html`||e===`head`||e===`body`?27:5;else a:switch(e){case D:return e=ui(31,n,t,a),e.elementType=D,e.lanes=o,e;case y:return hi(n.children,a,o,t);case b:s=8,a|=24;break;case x:return e=ui(12,n,t,a|2),e.elementType=x,e.lanes=o,e;case T:return e=ui(13,n,t,a),e.elementType=T,e.lanes=o,e;case ee:return e=ui(19,n,t,a),e.elementType=ee,e.lanes=o,e;default:if(typeof e==`object`&&e)switch(e.$$typeof){case C:s=10;break a;case S:s=9;break a;case w:s=11;break a;case te:s=14;break a;case E:s=16,r=null;break a}s=29,n=Error(i(130,e===null?`null`:typeof e,``)),r=null}return t=ui(s,n,t,a),t.elementType=e,t.type=r,t.lanes=o,t}function hi(e,t,n,r){return e=ui(7,e,r,t),e.lanes=n,e}function gi(e,t,n){return e=ui(6,e,null,t),e.lanes=n,e}function _i(e){var t=ui(18,null,null,0);return t.stateNode=e,t}function vi(e,t,n){return t=ui(4,e.children===null?[]:e.children,e.key,t),t.lanes=n,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var yi=new WeakMap;function bi(e,t){if(typeof e==`object`&&e){var n=yi.get(e);return n===void 0?(t={value:e,source:t,stack:Ee(t)},yi.set(e,t),t):n}return{value:e,source:t,stack:Ee(t)}}var xi=[],Si=0,Ci=null,wi=0,Ti=[],Ei=0,Di=null,Oi=1,ki=``;function Ai(e,t){xi[Si++]=wi,xi[Si++]=Ci,Ci=e,wi=t}function L(e,t,n){Ti[Ei++]=Oi,Ti[Ei++]=ki,Ti[Ei++]=Di,Di=e;var r=Oi;e=ki;var i=32-Ue(r)-1;r&=~(1<<i),n+=1;var a=32-Ue(t)+i;if(30<a){var o=i-i%5;a=(r&(1<<o)-1).toString(32),r>>=o,i-=o,Oi=1<<32-Ue(t)+i|n<<i|r,ki=a+e}else Oi=1<<a|n<<i|r,ki=e}function ji(e){e.return!==null&&(Ai(e,1),L(e,1,0))}function R(e){for(;e===Ci;)Ci=xi[--Si],xi[Si]=null,wi=xi[--Si],xi[Si]=null;for(;e===Di;)Di=Ti[--Ei],Ti[Ei]=null,ki=Ti[--Ei],Ti[Ei]=null,Oi=Ti[--Ei],Ti[Ei]=null}function Mi(e,t){Ti[Ei++]=Oi,Ti[Ei++]=ki,Ti[Ei++]=Di,Oi=t.id,ki=t.overflow,Di=e}var Ni=null,Pi=null,z=!1,Fi=null,Ii=!1,Li=Error(i(519));function Ri(e){throw Wi(bi(Error(i(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?`text`:`HTML`,``)),e)),Li}function zi(e){var t=e.stateNode,n=e.type,r=e.memoizedProps;switch(t[dt]=e,t[ft]=r,n){case`dialog`:Q(`cancel`,t),Q(`close`,t);break;case`iframe`:case`object`:case`embed`:Q(`load`,t);break;case`video`:case`audio`:for(n=0;n<_d.length;n++)Q(_d[n],t);break;case`source`:Q(`error`,t);break;case`img`:case`image`:case`link`:Q(`error`,t),Q(`load`,t);break;case`details`:Q(`toggle`,t);break;case`input`:Q(`invalid`,t),Wt(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case`select`:Q(`invalid`,t);break;case`textarea`:Q(`invalid`,t),Jt(t,r.value,r.defaultValue,r.children)}n=r.children,typeof n!=`string`&&typeof n!=`number`&&typeof n!=`bigint`||t.textContent===``+n||!0===r.suppressHydrationWarning||Md(t.textContent,n)?(r.popover!=null&&(Q(`beforetoggle`,t),Q(`toggle`,t)),r.onScroll!=null&&Q(`scroll`,t),r.onScrollEnd!=null&&Q(`scrollend`,t),r.onClick!=null&&(t.onclick=rn),t=!0):t=!1,t||Ri(e,!0)}function Bi(e){for(Ni=e.return;Ni;)switch(Ni.tag){case 5:case 31:case 13:Ii=!1;return;case 27:case 3:Ii=!0;return;default:Ni=Ni.return}}function Vi(e){if(e!==Ni)return!1;if(!z)return Bi(e),z=!0,!1;var t=e.tag,n;if((n=t!==3&&t!==27)&&((n=t===5)&&(n=e.type,n=n===`form`||n===`button`||Wd(e.type,e.memoizedProps)),n=!n),n&&Pi&&Ri(e),Bi(e),t===13){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=df(e)}else if(t===31){if(e=e.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(317));Pi=df(e)}else t===27?(t=Pi,Qd(e.type)?(e=uf,uf=null,Pi=e):Pi=t):Pi=Ni?lf(e.stateNode.nextSibling):null;return!0}function Hi(){Pi=Ni=null,z=!1}function Ui(){var e=Fi;return e!==null&&($l===null?$l=e:$l.push.apply($l,e),Fi=null),e}function Wi(e){Fi===null?Fi=[e]:Fi.push(e)}var Gi=ue(null),Ki=null,qi=null;function Ji(e,t,n){j(Gi,t._currentValue),t._currentValue=n}function Yi(e){e._currentValue=Gi.current,de(Gi)}function Xi(e,t,n){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)===t?r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t):(e.childLanes|=t,r!==null&&(r.childLanes|=t)),e===n)break;e=e.return}}function Zi(e,t,n,r){var a=e.child;for(a!==null&&(a.return=e);a!==null;){var o=a.dependencies;if(o!==null){var s=a.child;o=o.firstContext;a:for(;o!==null;){var c=o;o=a;for(var l=0;l<t.length;l++)if(c.context===t[l]){o.lanes|=n,c=o.alternate,c!==null&&(c.lanes|=n),Xi(o.return,n,e),r||(s=null);break a}o=c.next}}else if(a.tag===18){if(s=a.return,s===null)throw Error(i(341));s.lanes|=n,o=s.alternate,o!==null&&(o.lanes|=n),Xi(s,n,e),s=null}else s=a.child;if(s!==null)s.return=a;else for(s=a;s!==null;){if(s===e){s=null;break}if(a=s.sibling,a!==null){a.return=s.return,s=a;break}s=s.return}a=s}}function Qi(e,t,n,r){e=null;for(var a=t,o=!1;a!==null;){if(!o){if(a.flags&524288)o=!0;else if(a.flags&262144)break}if(a.tag===10){var s=a.alternate;if(s===null)throw Error(i(387));if(s=s.memoizedProps,s!==null){var c=a.type;Er(a.pendingProps.value,s.value)||(e===null?e=[c]:e.push(c))}}else if(a===he.current){if(s=a.alternate,s===null)throw Error(i(387));s.memoizedState.memoizedState!==a.memoizedState.memoizedState&&(e===null?e=[Qf]:e.push(Qf))}a=a.return}e!==null&&Zi(t,e,n,r),t.flags|=262144}function $i(e){for(e=e.firstContext;e!==null;){if(!Er(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function ea(e){Ki=e,qi=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function ta(e){return ra(Ki,e)}function na(e,t){return Ki===null&&ea(e),ra(e,t)}function ra(e,t){var n=t._currentValue;if(t={context:t,memoizedValue:n,next:null},qi===null){if(e===null)throw Error(i(308));qi=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else qi=qi.next=t;return n}var ia=typeof AbortController<`u`?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(t,n){e.push(n)}};this.abort=function(){t.aborted=!0,e.forEach(function(e){return e()})}},aa=t.unstable_scheduleCallback,oa=t.unstable_NormalPriority,sa={$$typeof:C,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function ca(){return{controller:new ia,data:new Map,refCount:0}}function la(e){e.refCount--,e.refCount===0&&aa(oa,function(){e.controller.abort()})}var ua=null,da=0,fa=0,pa=null;function ma(e,t){if(ua===null){var n=ua=[];da=0,fa=dd(),pa={status:`pending`,value:void 0,then:function(e){n.push(e)}}}return da++,t.then(ha,ha),t}function ha(){if(--da===0&&ua!==null){pa!==null&&(pa.status=`fulfilled`);var e=ua;ua=null,fa=0,pa=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function ga(e,t){var n=[],r={status:`pending`,value:null,reason:null,then:function(e){n.push(e)}};return e.then(function(){r.status=`fulfilled`,r.value=t;for(var e=0;e<n.length;e++)(0,n[e])(t)},function(e){for(r.status=`rejected`,r.reason=e,e=0;e<n.length;e++)(0,n[e])(void 0)}),r}var _a=k.S;k.S=function(e,t){nu=Me(),typeof t==`object`&&t&&typeof t.then==`function`&&ma(e,t),_a!==null&&_a(e,t)};var va=ue(null);function ya(){var e=va.current;return e===null?zl.pooledCache:e}function ba(e,t){t===null?j(va,va.current):j(va,t.pool)}function xa(){var e=ya();return e===null?null:{parent:sa._currentValue,pool:e}}var Sa=Error(i(460)),Ca=Error(i(474)),wa=Error(i(542)),Ta={then:function(){}};function Ea(e){return e=e.status,e===`fulfilled`||e===`rejected`}function Da(e,t,n){switch(n=e[n],n===void 0?e.push(t):n!==t&&(t.then(rn,rn),t=n),t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e;default:if(typeof t.status==`string`)t.then(rn,rn);else{if(e=zl,e!==null&&100<e.shellSuspendCounter)throw Error(i(482));e=t,e.status=`pending`,e.then(function(e){if(t.status===`pending`){var n=t;n.status=`fulfilled`,n.value=e}},function(e){if(t.status===`pending`){var n=t;n.status=`rejected`,n.reason=e}})}switch(t.status){case`fulfilled`:return t.value;case`rejected`:throw e=t.reason,ja(e),e}throw ka=t,Sa}}function Oa(e){try{var t=e._init;return t(e._payload)}catch(e){throw typeof e==`object`&&e&&typeof e.then==`function`?(ka=e,Sa):e}}var ka=null;function Aa(){if(ka===null)throw Error(i(459));var e=ka;return ka=null,e}function ja(e){if(e===Sa||e===wa)throw Error(i(483))}var Ma=null,Na=0;function Pa(e){var t=Na;return Na+=1,Ma===null&&(Ma=[]),Da(Ma,e,t)}function Fa(e,t){t=t.props.ref,e.ref=t===void 0?null:t}function Ia(e,t){throw t.$$typeof===g?Error(i(525)):(e=Object.prototype.toString.call(t),Error(i(31,e===`[object Object]`?`object with keys {`+Object.keys(t).join(`, `)+`}`:e)))}function La(e){function t(t,n){if(e){var r=t.deletions;r===null?(t.deletions=[n],t.flags|=16):r.push(n)}}function n(n,r){if(!e)return null;for(;r!==null;)t(n,r),r=r.sibling;return null}function r(e){for(var t=new Map;e!==null;)e.key===null?t.set(e.index,e):t.set(e.key,e),e=e.sibling;return t}function a(e,t){return e=fi(e,t),e.index=0,e.sibling=null,e}function o(t,n,r){return t.index=r,e?(r=t.alternate,r===null?(t.flags|=67108866,n):(r=r.index,r<n?(t.flags|=67108866,n):r)):(t.flags|=1048576,n)}function s(t){return e&&t.alternate===null&&(t.flags|=67108866),t}function c(e,t,n,r){return t===null||t.tag!==6?(t=gi(n,e.mode,r),t.return=e,t):(t=a(t,n),t.return=e,t)}function l(e,t,n,r){var i=n.type;return i===y?d(e,t,n.props.children,r,n.key):t!==null&&(t.elementType===i||typeof i==`object`&&i&&i.$$typeof===E&&Oa(i)===t.type)?(t=a(t,n.props),Fa(t,n),t.return=e,t):(t=mi(n.type,n.key,n.props,null,e.mode,r),Fa(t,n),t.return=e,t)}function u(e,t,n,r){return t===null||t.tag!==4||t.stateNode.containerInfo!==n.containerInfo||t.stateNode.implementation!==n.implementation?(t=vi(n,e.mode,r),t.return=e,t):(t=a(t,n.children||[]),t.return=e,t)}function d(e,t,n,r,i){return t===null||t.tag!==7?(t=hi(n,e.mode,r,i),t.return=e,t):(t=a(t,n),t.return=e,t)}function f(e,t,n){if(typeof t==`string`&&t!==``||typeof t==`number`||typeof t==`bigint`)return t=gi(``+t,e.mode,n),t.return=e,t;if(typeof t==`object`&&t){switch(t.$$typeof){case _:return n=mi(t.type,t.key,t.props,null,e.mode,n),Fa(n,t),n.return=e,n;case v:return t=vi(t,e.mode,n),t.return=e,t;case E:return t=Oa(t),f(e,t,n)}if(oe(t)||ie(t))return t=hi(t,e.mode,n,null),t.return=e,t;if(typeof t.then==`function`)return f(e,Pa(t),n);if(t.$$typeof===C)return f(e,na(e,t),n);Ia(e,t)}return null}function p(e,t,n,r){var i=t===null?null:t.key;if(typeof n==`string`&&n!==``||typeof n==`number`||typeof n==`bigint`)return i===null?c(e,t,``+n,r):null;if(typeof n==`object`&&n){switch(n.$$typeof){case _:return n.key===i?l(e,t,n,r):null;case v:return n.key===i?u(e,t,n,r):null;case E:return n=Oa(n),p(e,t,n,r)}if(oe(n)||ie(n))return i===null?d(e,t,n,r,null):null;if(typeof n.then==`function`)return p(e,t,Pa(n),r);if(n.$$typeof===C)return p(e,t,na(e,n),r);Ia(e,n)}return null}function m(e,t,n,r,i){if(typeof r==`string`&&r!==``||typeof r==`number`||typeof r==`bigint`)return e=e.get(n)||null,c(t,e,``+r,i);if(typeof r==`object`&&r){switch(r.$$typeof){case _:return e=e.get(r.key===null?n:r.key)||null,l(t,e,r,i);case v:return e=e.get(r.key===null?n:r.key)||null,u(t,e,r,i);case E:return r=Oa(r),m(e,t,n,r,i)}if(oe(r)||ie(r))return e=e.get(n)||null,d(t,e,r,i,null);if(typeof r.then==`function`)return m(e,t,n,Pa(r),i);if(r.$$typeof===C)return m(e,t,n,na(t,r),i);Ia(t,r)}return null}function h(i,a,s,c){for(var l=null,u=null,d=a,h=a=0,g=null;d!==null&&h<s.length;h++){d.index>h?(g=d,d=null):g=d.sibling;var _=p(i,d,s[h],c);if(_===null){d===null&&(d=g);break}e&&d&&_.alternate===null&&t(i,d),a=o(_,a,h),u===null?l=_:u.sibling=_,u=_,d=g}if(h===s.length)return n(i,d),z&&Ai(i,h),l;if(d===null){for(;h<s.length;h++)d=f(i,s[h],c),d!==null&&(a=o(d,a,h),u===null?l=d:u.sibling=d,u=d);return z&&Ai(i,h),l}for(d=r(d);h<s.length;h++)g=m(d,i,h,s[h],c),g!==null&&(e&&g.alternate!==null&&d.delete(g.key===null?h:g.key),a=o(g,a,h),u===null?l=g:u.sibling=g,u=g);return e&&d.forEach(function(e){return t(i,e)}),z&&Ai(i,h),l}function g(a,s,c,l){if(c==null)throw Error(i(151));for(var u=null,d=null,h=s,g=s=0,_=null,v=c.next();h!==null&&!v.done;g++,v=c.next()){h.index>g?(_=h,h=null):_=h.sibling;var y=p(a,h,v.value,l);if(y===null){h===null&&(h=_);break}e&&h&&y.alternate===null&&t(a,h),s=o(y,s,g),d===null?u=y:d.sibling=y,d=y,h=_}if(v.done)return n(a,h),z&&Ai(a,g),u;if(h===null){for(;!v.done;g++,v=c.next())v=f(a,v.value,l),v!==null&&(s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return z&&Ai(a,g),u}for(h=r(h);!v.done;g++,v=c.next())v=m(h,a,g,v.value,l),v!==null&&(e&&v.alternate!==null&&h.delete(v.key===null?g:v.key),s=o(v,s,g),d===null?u=v:d.sibling=v,d=v);return e&&h.forEach(function(e){return t(a,e)}),z&&Ai(a,g),u}function b(e,r,o,c){if(typeof o==`object`&&o&&o.type===y&&o.key===null&&(o=o.props.children),typeof o==`object`&&o){switch(o.$$typeof){case _:a:{for(var l=o.key;r!==null;){if(r.key===l){if(l=o.type,l===y){if(r.tag===7){n(e,r.sibling),c=a(r,o.props.children),c.return=e,e=c;break a}}else if(r.elementType===l||typeof l==`object`&&l&&l.$$typeof===E&&Oa(l)===r.type){n(e,r.sibling),c=a(r,o.props),Fa(c,o),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}o.type===y?(c=hi(o.props.children,e.mode,c,o.key),c.return=e,e=c):(c=mi(o.type,o.key,o.props,null,e.mode,c),Fa(c,o),c.return=e,e=c)}return s(e);case v:a:{for(l=o.key;r!==null;){if(r.key===l){if(r.tag===4&&r.stateNode.containerInfo===o.containerInfo&&r.stateNode.implementation===o.implementation){n(e,r.sibling),c=a(r,o.children||[]),c.return=e,e=c;break a}n(e,r);break}t(e,r),r=r.sibling}c=vi(o,e.mode,c),c.return=e,e=c}return s(e);case E:return o=Oa(o),b(e,r,o,c)}if(oe(o))return h(e,r,o,c);if(ie(o)){if(l=ie(o),typeof l!=`function`)throw Error(i(150));return o=l.call(o),g(e,r,o,c)}if(typeof o.then==`function`)return b(e,r,Pa(o),c);if(o.$$typeof===C)return b(e,r,na(e,o),c);Ia(e,o)}return typeof o==`string`&&o!==``||typeof o==`number`||typeof o==`bigint`?(o=``+o,r!==null&&r.tag===6?(n(e,r.sibling),c=a(r,o),c.return=e,e=c):(n(e,r),c=gi(o,e.mode,c),c.return=e,e=c),s(e)):n(e,r)}return function(e,t,n,r){try{Na=0;var i=b(e,t,n,r);return Ma=null,i}catch(t){if(t===Sa||t===wa)throw t;var a=ui(29,t,null,e.mode);return a.lanes=r,a.return=e,a}}}var Ra=La(!0),za=La(!1),Ba=!1;function Va(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Ha(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 Ua(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function Wa(e,t,n){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,K&2){var i=r.pending;return i===null?t.next=t:(t.next=i.next,i.next=t),r.pending=t,t=si(e),oi(e,null,n),t}return ri(e,r,t,n),si(e)}function Ga(e,t,n){if(t=t.updateQueue,t!==null&&(t=t.shared,n&4194048)){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}function Ka(e,t){var n=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,n===r)){var i=null,a=null;if(n=n.firstBaseUpdate,n!==null){do{var o={lane:n.lane,tag:n.tag,payload:n.payload,callback:null,next:null};a===null?i=a=o:a=a.next=o,n=n.next}while(n!==null);a===null?i=a=t:a=a.next=t}else i=a=t;n={baseState:r.baseState,firstBaseUpdate:i,lastBaseUpdate:a,shared:r.shared,callbacks:r.callbacks},e.updateQueue=n;return}e=n.lastBaseUpdate,e===null?n.firstBaseUpdate=t:e.next=t,n.lastBaseUpdate=t}var qa=!1;function Ja(){if(qa){var e=pa;if(e!==null)throw e}}function Ya(e,t,n,r){qa=!1;var i=e.updateQueue;Ba=!1;var a=i.firstBaseUpdate,o=i.lastBaseUpdate,s=i.shared.pending;if(s!==null){i.shared.pending=null;var c=s,l=c.next;c.next=null,o===null?a=l:o.next=l,o=c;var u=e.alternate;u!==null&&(u=u.updateQueue,s=u.lastBaseUpdate,s!==o&&(s===null?u.firstBaseUpdate=l:s.next=l,u.lastBaseUpdate=c))}if(a!==null){var d=i.baseState;o=0,u=l=c=null,s=a;do{var f=s.lane&-536870913,p=f!==s.lane;if(p?(J&f)===f:(r&f)===f){f!==0&&f===fa&&(qa=!0),u!==null&&(u=u.next={lane:0,tag:s.tag,payload:s.payload,callback:null,next:null});a:{var m=e,g=s;f=t;var _=n;switch(g.tag){case 1:if(m=g.payload,typeof m==`function`){d=m.call(_,d,f);break a}d=m;break a;case 3:m.flags=m.flags&-65537|128;case 0:if(m=g.payload,f=typeof m==`function`?m.call(_,d,f):m,f==null)break a;d=h({},d,f);break a;case 2:Ba=!0}}f=s.callback,f!==null&&(e.flags|=64,p&&(e.flags|=8192),p=i.callbacks,p===null?i.callbacks=[f]:p.push(f))}else p={lane:f,tag:s.tag,payload:s.payload,callback:s.callback,next:null},u===null?(l=u=p,c=d):u=u.next=p,o|=f;if(s=s.next,s===null){if(s=i.shared.pending,s===null)break;p=s,s=p.next,p.next=null,i.lastBaseUpdate=p,i.shared.pending=null}}while(1);u===null&&(c=d),i.baseState=c,i.firstBaseUpdate=l,i.lastBaseUpdate=u,a===null&&(i.shared.lanes=0),ql|=o,e.lanes=o,e.memoizedState=d}}function Xa(e,t){if(typeof e!=`function`)throw Error(i(191,e));e.call(t)}function Za(e,t){var n=e.callbacks;if(n!==null)for(e.callbacks=null,e=0;e<n.length;e++)Xa(n[e],t)}var Qa=ue(null),$a=ue(0);function eo(e,t){e=Gl,j($a,e),j(Qa,t),Gl=e|t.baseLanes}function to(){j($a,Gl),j(Qa,Qa.current)}function no(){Gl=$a.current,de(Qa),de($a)}var ro=ue(null),io=null;function ao(e){var t=e.alternate;j(uo,uo.current&1),j(ro,e),io===null&&(t===null||Qa.current!==null||t.memoizedState!==null)&&(io=e)}function oo(e){j(uo,uo.current),j(ro,e),io===null&&(io=e)}function so(e){e.tag===22?(j(uo,uo.current),j(ro,e),io===null&&(io=e)):co(e)}function co(){j(uo,uo.current),j(ro,ro.current)}function lo(e){de(ro),io===e&&(io=null),de(uo)}var uo=ue(0);function fo(e){for(var t=e;t!==null;){if(t.tag===13){var n=t.memoizedState;if(n!==null&&(n=n.dehydrated,n===null||of(n)||sf(n)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder===`forwards`||t.memoizedProps.revealOrder===`backwards`||t.memoizedProps.revealOrder===`unstable_legacy-backwards`||t.memoizedProps.revealOrder===`together`)){if(t.flags&128)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 po=0,B=null,mo=null,ho=null,go=!1,_o=!1,vo=!1,yo=0,bo=0,xo=null,So=0;function Co(){throw Error(i(321))}function wo(e,t){if(t===null)return!1;for(var n=0;n<t.length&&n<e.length;n++)if(!Er(e[n],t[n]))return!1;return!0}function To(e,t,n,r,i,a){return po=a,B=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,k.H=e===null||e.memoizedState===null?Hs:Us,vo=!1,a=n(r,i),vo=!1,_o&&(a=Do(t,n,r,i)),Eo(e),a}function Eo(e){k.H=Vs;var t=mo!==null&&mo.next!==null;if(po=0,ho=mo=B=null,go=!1,bo=0,xo=null,t)throw Error(i(300));e===null||oc||(e=e.dependencies,e!==null&&$i(e)&&(oc=!0))}function Do(e,t,n,r){B=e;var a=0;do{if(_o&&(xo=null),bo=0,_o=!1,25<=a)throw Error(i(301));if(a+=1,ho=mo=null,e.updateQueue!=null){var o=e.updateQueue;o.lastEffect=null,o.events=null,o.stores=null,o.memoCache!=null&&(o.memoCache.index=0)}k.H=Ws,o=t(n,r)}while(_o);return o}function Oo(){var e=k.H,t=e.useState()[0];return t=typeof t.then==`function`?Fo(t):t,e=e.useState()[0],(mo===null?null:mo.memoizedState)!==e&&(B.flags|=1024),t}function ko(){var e=yo!==0;return yo=0,e}function Ao(e,t,n){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~n}function jo(e){if(go){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}go=!1}po=0,ho=mo=B=null,_o=!1,bo=yo=0,xo=null}function Mo(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return ho===null?B.memoizedState=ho=e:ho=ho.next=e,ho}function No(){if(mo===null){var e=B.alternate;e=e===null?null:e.memoizedState}else e=mo.next;var t=ho===null?B.memoizedState:ho.next;if(t!==null)ho=t,mo=e;else{if(e===null)throw B.alternate===null?Error(i(467)):Error(i(310));mo=e,e={memoizedState:mo.memoizedState,baseState:mo.baseState,baseQueue:mo.baseQueue,queue:mo.queue,next:null},ho===null?B.memoizedState=ho=e:ho=ho.next=e}return ho}function Po(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Fo(e){var t=bo;return bo+=1,xo===null&&(xo=[]),e=Da(xo,e,t),t=B,(ho===null?t.memoizedState:ho.next)===null&&(t=t.alternate,k.H=t===null||t.memoizedState===null?Hs:Us),e}function Io(e){if(typeof e==`object`&&e){if(typeof e.then==`function`)return Fo(e);if(e.$$typeof===C)return ta(e)}throw Error(i(438,String(e)))}function Lo(e){var t=null,n=B.updateQueue;if(n!==null&&(t=n.memoCache),t==null){var r=B.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(e){return e.slice()}),index:0})))}if(t??={data:[],index:0},n===null&&(n=Po(),B.updateQueue=n),n.memoCache=t,n=t.data[t.index],n===void 0)for(n=t.data[t.index]=Array(e),r=0;r<e;r++)n[r]=ne;return t.index++,n}function Ro(e,t){return typeof t==`function`?t(e):t}function zo(e){return Bo(No(),mo,e)}function Bo(e,t,n){var r=e.queue;if(r===null)throw Error(i(311));r.lastRenderedReducer=n;var a=e.baseQueue,o=r.pending;if(o!==null){if(a!==null){var s=a.next;a.next=o.next,o.next=s}t.baseQueue=a=o,r.pending=null}if(o=e.baseState,a===null)e.memoizedState=o;else{t=a.next;var c=s=null,l=null,u=t,d=!1;do{var f=u.lane&-536870913;if(f===u.lane?(po&f)===f:(J&f)===f){var p=u.revertLane;if(p===0)l!==null&&(l=l.next={lane:0,revertLane:0,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null}),f===fa&&(d=!0);else if((po&p)===p){u=u.next,p===fa&&(d=!0);continue}else f={lane:0,revertLane:u.revertLane,gesture:null,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=f,s=o):l=l.next=f,B.lanes|=p,ql|=p;f=u.action,vo&&n(o,f),o=u.hasEagerState?u.eagerState:n(o,f)}else p={lane:f,revertLane:u.revertLane,gesture:u.gesture,action:u.action,hasEagerState:u.hasEagerState,eagerState:u.eagerState,next:null},l===null?(c=l=p,s=o):l=l.next=p,B.lanes|=f,ql|=f;u=u.next}while(u!==null&&u!==t);if(l===null?s=o:l.next=c,!Er(o,e.memoizedState)&&(oc=!0,d&&(n=pa,n!==null)))throw n;e.memoizedState=o,e.baseState=s,e.baseQueue=l,r.lastRenderedState=o}return a===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function Vo(e){var t=No(),n=t.queue;if(n===null)throw Error(i(311));n.lastRenderedReducer=e;var r=n.dispatch,a=n.pending,o=t.memoizedState;if(a!==null){n.pending=null;var s=a=a.next;do o=e(o,s.action),s=s.next;while(s!==a);Er(o,t.memoizedState)||(oc=!0),t.memoizedState=o,t.baseQueue===null&&(t.baseState=o),n.lastRenderedState=o}return[o,r]}function Ho(e,t,n){var r=B,a=No(),o=z;if(o){if(n===void 0)throw Error(i(407));n=n()}else n=t();var s=!Er((mo||a).memoizedState,n);if(s&&(a.memoizedState=n,oc=!0),a=a.queue,ps(Go.bind(null,r,a,e),[e]),a.getSnapshot!==t||s||ho!==null&&ho.memoizedState.tag&1){if(r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,a,n,t),null),zl===null)throw Error(i(349));o||po&127||Uo(r,t,n)}return n}function Uo(e,t,n){e.flags|=16384,e={getSnapshot:t,value:n},t=B.updateQueue,t===null?(t=Po(),B.updateQueue=t,t.stores=[e]):(n=t.stores,n===null?t.stores=[e]:n.push(e))}function Wo(e,t,n,r){t.value=n,t.getSnapshot=r,Ko(t)&&qo(e)}function Go(e,t,n){return n(function(){Ko(t)&&qo(e)})}function Ko(e){var t=e.getSnapshot;e=e.value;try{var n=t();return!Er(e,n)}catch{return!0}}function qo(e){var t=ai(e,2);t!==null&&_u(t,e,2)}function Jo(e){var t=Mo();if(typeof e==`function`){var n=e;if(e=n(),vo){He(!0);try{n()}finally{He(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:e},t}function Yo(e,t,n,r){return e.baseState=n,Bo(e,mo,typeof r==`function`?r:Ro)}function Xo(e,t,n,r,a){if(Rs(e))throw Error(i(485));if(e=t.action,e!==null){var o={payload:a,action:e,next:null,isTransition:!0,status:`pending`,value:null,reason:null,listeners:[],then:function(e){o.listeners.push(e)}};k.T===null?o.isTransition=!1:n(!0),r(o),n=t.pending,n===null?(o.next=t.pending=o,Zo(t,o)):(o.next=n.next,t.pending=n.next=o)}}function Zo(e,t){var n=t.action,r=t.payload,i=e.state;if(t.isTransition){var a=k.T,o={};k.T=o;try{var s=n(i,r),c=k.S;c!==null&&c(o,s),Qo(e,t,s)}catch(n){es(e,t,n)}finally{a!==null&&o.types!==null&&(a.types=o.types),k.T=a}}else try{a=n(i,r),Qo(e,t,a)}catch(n){es(e,t,n)}}function Qo(e,t,n){typeof n==`object`&&n&&typeof n.then==`function`?n.then(function(n){$o(e,t,n)},function(n){return es(e,t,n)}):$o(e,t,n)}function $o(e,t,n){t.status=`fulfilled`,t.value=n,ts(t),e.state=n,t=e.pending,t!==null&&(n=t.next,n===t?e.pending=null:(n=n.next,t.next=n,Zo(e,n)))}function es(e,t,n){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status=`rejected`,t.reason=n,ts(t),t=t.next;while(t!==r)}e.action=null}function ts(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function ns(e,t){return t}function rs(e,t){if(z){var n=zl.formState;if(n!==null){a:{var r=B;if(z){if(Pi){b:{for(var i=Pi,a=Ii;i.nodeType!==8;){if(!a){i=null;break b}if(i=lf(i.nextSibling),i===null){i=null;break b}}a=i.data,i=a===`F!`||a===`F`?i:null}if(i){Pi=lf(i.nextSibling),r=i.data===`F!`;break a}}Ri(r)}r=!1}r&&(t=n[0])}}return n=Mo(),n.memoizedState=n.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ns,lastRenderedState:t},n.queue=r,n=Fs.bind(null,B,r),r.dispatch=n,r=Jo(!1),a=Ls.bind(null,B,!1,r.queue),r=Mo(),i={state:t,dispatch:null,action:e,pending:null},r.queue=i,n=Xo.bind(null,B,i,a,n),i.dispatch=n,r.memoizedState=e,[t,n,!1]}function is(e){return as(No(),mo,e)}function as(e,t,n){if(t=Bo(e,t,ns)[0],e=zo(Ro)[0],typeof t==`object`&&t&&typeof t.then==`function`)try{var r=Fo(t)}catch(e){throw e===Sa?wa:e}else r=t;t=No();var i=t.queue,a=i.dispatch;return n!==t.memoizedState&&(B.flags|=2048,cs(9,{destroy:void 0},os.bind(null,i,n),null)),[r,a,e]}function os(e,t){e.action=t}function ss(e){var t=No(),n=mo;if(n!==null)return as(t,n,e);No(),t=t.memoizedState,n=No();var r=n.queue.dispatch;return n.memoizedState=e,[t,r,!1]}function cs(e,t,n,r){return e={tag:e,create:n,deps:r,inst:t,next:null},t=B.updateQueue,t===null&&(t=Po(),B.updateQueue=t),n=t.lastEffect,n===null?t.lastEffect=e.next=e:(r=n.next,n.next=e,e.next=r,t.lastEffect=e),e}function ls(){return No().memoizedState}function us(e,t,n,r){var i=Mo();B.flags|=e,i.memoizedState=cs(1|t,{destroy:void 0},n,r===void 0?null:r)}function ds(e,t,n,r){var i=No();r=r===void 0?null:r;var a=i.memoizedState.inst;mo!==null&&r!==null&&wo(r,mo.memoizedState.deps)?i.memoizedState=cs(t,a,n,r):(B.flags|=e,i.memoizedState=cs(1|t,a,n,r))}function fs(e,t){us(8390656,8,e,t)}function ps(e,t){ds(2048,8,e,t)}function ms(e){B.flags|=4;var t=B.updateQueue;if(t===null)t=Po(),B.updateQueue=t,t.events=[e];else{var n=t.events;n===null?t.events=[e]:n.push(e)}}function hs(e){var t=No().memoizedState;return ms({ref:t,nextImpl:e}),function(){if(K&2)throw Error(i(440));return t.impl.apply(void 0,arguments)}}function gs(e,t){return ds(4,2,e,t)}function _s(e,t){return ds(4,4,e,t)}function vs(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 ys(e,t,n){n=n==null?null:n.concat([e]),ds(4,4,vs.bind(null,t,e),n)}function bs(){}function xs(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;return t!==null&&wo(t,r[1])?r[0]:(n.memoizedState=[e,t],e)}function Ss(e,t){var n=No();t=t===void 0?null:t;var r=n.memoizedState;if(t!==null&&wo(t,r[1]))return r[0];if(r=e(),vo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r}function Cs(e,t,n){return n===void 0||po&1073741824&&!(J&261930)?e.memoizedState=t:(e.memoizedState=n,e=gu(),B.lanes|=e,ql|=e,n)}function ws(e,t,n,r){return Er(n,t)?n:Qa.current===null?!(po&42)||po&1073741824&&!(J&261930)?(oc=!0,e.memoizedState=n):(e=gu(),B.lanes|=e,ql|=e,t):(e=Cs(e,n,r),Er(e,t)||(oc=!0),e)}function Ts(e,t,n,r,i){var a=A.p;A.p=a!==0&&8>a?a:8;var o=k.T,s={};k.T=s,Ls(e,!1,t,n);try{var c=i(),l=k.S;l!==null&&l(s,c),typeof c==`object`&&c&&typeof c.then==`function`?Is(e,t,ga(c,r),hu(e)):Is(e,t,r,hu(e))}catch(n){Is(e,t,{then:function(){},status:`rejected`,reason:n},hu())}finally{A.p=a,o!==null&&s.types!==null&&(o.types=s.types),k.T=o}}function Es(){}function Ds(e,t,n,r){if(e.tag!==5)throw Error(i(476));var a=Os(e).queue;Ts(e,a,t,se,n===null?Es:function(){return ks(e),n(r)})}function Os(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:se,baseState:se,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:se},next:null};var n={};return t.next={memoizedState:n,baseState:n,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ro,lastRenderedState:n},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function ks(e){var t=Os(e);t.next===null&&(t=e.alternate.memoizedState),Is(e,t.next.queue,{},hu())}function As(){return ta(Qf)}function js(){return No().memoizedState}function Ms(){return No().memoizedState}function Ns(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var n=hu();e=Ua(n);var r=Wa(t,e,n);r!==null&&(_u(r,t,n),Ga(r,t,n)),t={cache:ca()},e.payload=t;return}t=t.return}}function Ps(e,t,n){var r=hu();n={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null},Rs(e)?zs(t,n):(n=ii(e,t,n,r),n!==null&&(_u(n,e,r),Bs(n,t,r)))}function Fs(e,t,n){Is(e,t,n,hu())}function Is(e,t,n,r){var i={lane:r,revertLane:0,gesture:null,action:n,hasEagerState:!1,eagerState:null,next:null};if(Rs(e))zs(t,i);else{var a=e.alternate;if(e.lanes===0&&(a===null||a.lanes===0)&&(a=t.lastRenderedReducer,a!==null))try{var o=t.lastRenderedState,s=a(o,n);if(i.hasEagerState=!0,i.eagerState=s,Er(s,o))return ri(e,t,i,0),zl===null&&ni(),!1}catch{}if(n=ii(e,t,i,r),n!==null)return _u(n,e,r),Bs(n,t,r),!0}return!1}function Ls(e,t,n,r){if(r={lane:2,revertLane:dd(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},Rs(e)){if(t)throw Error(i(479))}else t=ii(e,n,r,2),t!==null&&_u(t,e,2)}function Rs(e){var t=e.alternate;return e===B||t!==null&&t===B}function zs(e,t){_o=go=!0;var n=e.pending;n===null?t.next=t:(t.next=n.next,n.next=t),e.pending=t}function Bs(e,t,n){if(n&4194048){var r=t.lanes;r&=e.pendingLanes,n|=r,t.lanes=n,it(e,n)}}var Vs={readContext:ta,use:Io,useCallback:Co,useContext:Co,useEffect:Co,useImperativeHandle:Co,useLayoutEffect:Co,useInsertionEffect:Co,useMemo:Co,useReducer:Co,useRef:Co,useState:Co,useDebugValue:Co,useDeferredValue:Co,useTransition:Co,useSyncExternalStore:Co,useId:Co,useHostTransitionStatus:Co,useFormState:Co,useActionState:Co,useOptimistic:Co,useMemoCache:Co,useCacheRefresh:Co};Vs.useEffectEvent=Co;var Hs={readContext:ta,use:Io,useCallback:function(e,t){return Mo().memoizedState=[e,t===void 0?null:t],e},useContext:ta,useEffect:fs,useImperativeHandle:function(e,t,n){n=n==null?null:n.concat([e]),us(4194308,4,vs.bind(null,t,e),n)},useLayoutEffect:function(e,t){return us(4194308,4,e,t)},useInsertionEffect:function(e,t){us(4,2,e,t)},useMemo:function(e,t){var n=Mo();t=t===void 0?null:t;var r=e();if(vo){He(!0);try{e()}finally{He(!1)}}return n.memoizedState=[r,t],r},useReducer:function(e,t,n){var r=Mo();if(n!==void 0){var i=n(t);if(vo){He(!0);try{n(t)}finally{He(!1)}}}else i=t;return r.memoizedState=r.baseState=i,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:i},r.queue=e,e=e.dispatch=Ps.bind(null,B,e),[r.memoizedState,e]},useRef:function(e){var t=Mo();return e={current:e},t.memoizedState=e},useState:function(e){e=Jo(e);var t=e.queue,n=Fs.bind(null,B,t);return t.dispatch=n,[e.memoizedState,n]},useDebugValue:bs,useDeferredValue:function(e,t){return Cs(Mo(),e,t)},useTransition:function(){var e=Jo(!1);return e=Ts.bind(null,B,e.queue,!0,!1),Mo().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,n){var r=B,a=Mo();if(z){if(n===void 0)throw Error(i(407));n=n()}else{if(n=t(),zl===null)throw Error(i(349));J&127||Uo(r,t,n)}a.memoizedState=n;var o={value:n,getSnapshot:t};return a.queue=o,fs(Go.bind(null,r,o,e),[e]),r.flags|=2048,cs(9,{destroy:void 0},Wo.bind(null,r,o,n,t),null),n},useId:function(){var e=Mo(),t=zl.identifierPrefix;if(z){var n=ki,r=Oi;n=(r&~(1<<32-Ue(r)-1)).toString(32)+n,t=`_`+t+`R_`+n,n=yo++,0<n&&(t+=`H`+n.toString(32)),t+=`_`}else n=So++,t=`_`+t+`r_`+n.toString(32)+`_`;return e.memoizedState=t},useHostTransitionStatus:As,useFormState:rs,useActionState:rs,useOptimistic:function(e){var t=Mo();t.memoizedState=t.baseState=e;var n={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=n,t=Ls.bind(null,B,!0,n),n.dispatch=t,[e,t]},useMemoCache:Lo,useCacheRefresh:function(){return Mo().memoizedState=Ns.bind(null,B)},useEffectEvent:function(e){var t=Mo(),n={impl:e};return t.memoizedState=n,function(){if(K&2)throw Error(i(440));return n.impl.apply(void 0,arguments)}}},Us={readContext:ta,use:Io,useCallback:xs,useContext:ta,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:zo,useRef:ls,useState:function(){return zo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){return ws(No(),mo.memoizedState,e,t)},useTransition:function(){var e=zo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:is,useActionState:is,useOptimistic:function(e,t){return Yo(No(),mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Us.useEffectEvent=hs;var Ws={readContext:ta,use:Io,useCallback:xs,useContext:ta,useEffect:ps,useImperativeHandle:ys,useInsertionEffect:gs,useLayoutEffect:_s,useMemo:Ss,useReducer:Vo,useRef:ls,useState:function(){return Vo(Ro)},useDebugValue:bs,useDeferredValue:function(e,t){var n=No();return mo===null?Cs(n,e,t):ws(n,mo.memoizedState,e,t)},useTransition:function(){var e=Vo(Ro)[0],t=No().memoizedState;return[typeof e==`boolean`?e:Fo(e),t]},useSyncExternalStore:Ho,useId:js,useHostTransitionStatus:As,useFormState:ss,useActionState:ss,useOptimistic:function(e,t){var n=No();return mo===null?(n.baseState=e,[e,n.queue.dispatch]):Yo(n,mo,e,t)},useMemoCache:Lo,useCacheRefresh:Ms};Ws.useEffectEvent=hs;function Gs(e,t,n,r){t=e.memoizedState,n=n(r,t),n=n==null?t:h({},t,n),e.memoizedState=n,e.lanes===0&&(e.updateQueue.baseState=n)}var Ks={enqueueSetState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ua(r);i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(_u(t,e,r),Ga(t,e,r))},enqueueReplaceState:function(e,t,n){e=e._reactInternals;var r=hu(),i=Ua(r);i.tag=1,i.payload=t,n!=null&&(i.callback=n),t=Wa(e,i,r),t!==null&&(_u(t,e,r),Ga(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var n=hu(),r=Ua(n);r.tag=2,t!=null&&(r.callback=t),t=Wa(e,r,n),t!==null&&(_u(t,e,n),Ga(t,e,n))}};function qs(e,t,n,r,i,a,o){return e=e.stateNode,typeof e.shouldComponentUpdate==`function`?e.shouldComponentUpdate(r,a,o):t.prototype&&t.prototype.isPureReactComponent?!Dr(n,r)||!Dr(i,a):!0}function Js(e,t,n,r){e=t.state,typeof t.componentWillReceiveProps==`function`&&t.componentWillReceiveProps(n,r),typeof t.UNSAFE_componentWillReceiveProps==`function`&&t.UNSAFE_componentWillReceiveProps(n,r),t.state!==e&&Ks.enqueueReplaceState(t,t.state,null)}function Ys(e,t){var n=t;if(`ref`in t)for(var r in n={},t)r!==`ref`&&(n[r]=t[r]);if(e=e.defaultProps)for(var i in n===t&&(n=h({},n)),e)n[i]===void 0&&(n[i]=e[i]);return n}function Xs(e){Qr(e)}function Zs(e){console.error(e)}function Qs(e){Qr(e)}function $s(e,t){try{var n=e.onUncaughtError;n(t.value,{componentStack:t.stack})}catch(e){setTimeout(function(){throw e})}}function ec(e,t,n){try{var r=e.onCaughtError;r(n.value,{componentStack:n.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(e){setTimeout(function(){throw e})}}function tc(e,t,n){return n=Ua(n),n.tag=3,n.payload={element:null},n.callback=function(){$s(e,t)},n}function nc(e){return e=Ua(e),e.tag=3,e}function rc(e,t,n,r){var i=n.type.getDerivedStateFromError;if(typeof i==`function`){var a=r.value;e.payload=function(){return i(a)},e.callback=function(){ec(t,n,r)}}var o=n.stateNode;o!==null&&typeof o.componentDidCatch==`function`&&(e.callback=function(){ec(t,n,r),typeof i!=`function`&&(au===null?au=new Set([this]):au.add(this));var e=r.stack;this.componentDidCatch(r.value,{componentStack:e===null?``:e})})}function ic(e,t,n,r,a){if(n.flags|=32768,typeof r==`object`&&r&&typeof r.then==`function`){if(t=n.alternate,t!==null&&Qi(t,n,a,!0),n=ro.current,n!==null){switch(n.tag){case 31:case 13:return io===null?ku():n.alternate===null&&Kl===0&&(Kl=3),n.flags&=-257,n.flags|=65536,n.lanes=a,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?n.updateQueue=new Set([r]):t.add(r),Ku(e,r,a)),!1;case 22:return n.flags|=65536,r===Ta?n.flags|=16384:(t=n.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},n.updateQueue=t):(n=t.retryQueue,n===null?t.retryQueue=new Set([r]):n.add(r)),Ku(e,r,a)),!1}throw Error(i(435,n.tag))}return Ku(e,r,a),ku(),!1}if(z)return t=ro.current,t===null?(r!==Li&&(t=Error(i(423),{cause:r}),Wi(bi(t,n))),e=e.current.alternate,e.flags|=65536,a&=-a,e.lanes|=a,r=bi(r,n),a=tc(e.stateNode,r,a),Ka(e,a),Kl!==4&&(Kl=2)):(!(t.flags&65536)&&(t.flags|=256),t.flags|=65536,t.lanes=a,r!==Li&&(e=Error(i(422),{cause:r}),Wi(bi(e,n)))),!1;var o=Error(i(520),{cause:r});if(o=bi(o,n),Ql===null?Ql=[o]:Ql.push(o),Kl!==4&&(Kl=2),t===null)return!0;r=bi(r,n),n=t;do{switch(n.tag){case 3:return n.flags|=65536,e=a&-a,n.lanes|=e,e=tc(n.stateNode,r,e),Ka(n,e),!1;case 1:if(t=n.type,o=n.stateNode,!(n.flags&128)&&(typeof t.getDerivedStateFromError==`function`||o!==null&&typeof o.componentDidCatch==`function`&&(au===null||!au.has(o))))return n.flags|=65536,a&=-a,n.lanes|=a,a=nc(a),rc(a,e,n,r),Ka(n,a),!1}n=n.return}while(n!==null);return!1}var ac=Error(i(461)),oc=!1;function sc(e,t,n,r){t.child=e===null?za(t,null,n,r):Ra(t,e.child,n,r)}function cc(e,t,n,r,i){n=n.render;var a=t.ref;if(`ref`in r){var o={};for(var s in r)s!==`ref`&&(o[s]=r[s])}else o=r;return ea(t),r=To(e,t,n,o,a,i),s=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(z&&s&&ji(t),t.flags|=1,sc(e,t,r,i),t.child)}function lc(e,t,n,r,i){if(e===null){var a=n.type;return typeof a==`function`&&!di(a)&&a.defaultProps===void 0&&n.compare===null?(t.tag=15,t.type=a,uc(e,t,a,r,i)):(e=mi(n.type,null,r,t,t.mode,i),e.ref=t.ref,e.return=t,t.child=e)}if(a=e.child,!Nc(e,i)){var o=a.memoizedProps;if(n=n.compare,n=n===null?Dr:n,n(o,r)&&e.ref===t.ref)return Mc(e,t,i)}return t.flags|=1,e=fi(a,r),e.ref=t.ref,e.return=t,t.child=e}function uc(e,t,n,r,i){if(e!==null){var a=e.memoizedProps;if(Dr(a,r)&&e.ref===t.ref){if(oc=!1,t.pendingProps=r=a,Nc(e,i))e.flags&131072&&(oc=!0);else return t.lanes=e.lanes,Mc(e,t,i)}}return vc(e,t,n,r,i)}function dc(e,t,n,r){var i=r.children,a=e===null?null:e.memoizedState;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode===`hidden`){if(t.flags&128){if(a=a===null?n:a.baseLanes|n,e!==null){for(r=t.child=e.child,i=0;r!==null;)i=i|r.lanes|r.childLanes,r=r.sibling;r=i&~a}else r=0,t.child=null;return pc(e,t,a,n,r)}if(n&536870912)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&ba(t,a===null?null:a.cachePool),a===null?to():eo(t,a),so(t);else return r=t.lanes=536870912,pc(e,t,a===null?n:a.baseLanes|n,n,r)}else a===null?(e!==null&&ba(t,null),to(),co(t)):(ba(t,a.cachePool),eo(t,a),co(t),t.memoizedState=null);return sc(e,t,i,n),t.child}function fc(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function pc(e,t,n,r,i){var a=ya();return a=a===null?null:{parent:sa._currentValue,pool:a},t.memoizedState={baseLanes:n,cachePool:a},e!==null&&ba(t,null),to(),so(t),e!==null&&Qi(e,t,r,!0),t.childLanes=i,null}function mc(e,t){return t=Dc({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function hc(e,t,n){return Ra(t,e.child,null,n),e=mc(t,t.pendingProps),e.flags|=2,lo(t),t.memoizedState=null,e}function gc(e,t,n){var r=t.pendingProps,a=!!(t.flags&128);if(t.flags&=-129,e===null){if(z){if(r.mode===`hidden`)return e=mc(t,r),t.lanes=536870912,fc(null,e);if(oo(t),(e=Pi)?(e=af(e,Ii),e=e!==null&&e.data===`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di===null?null:{id:Oi,overflow:ki},retryLane:536870912,hydrationErrors:null},n=_i(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw Ri(t);return t.lanes=536870912,null}return mc(t,r)}var o=e.memoizedState;if(o!==null){var s=o.dehydrated;if(oo(t),a){if(t.flags&256)t.flags&=-257,t=hc(e,t,n);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(i(558))}else if(oc||Qi(e,t,n,!1),a=(n&e.childLanes)!==0,oc||a){if(r=zl,r!==null&&(s=at(r,n),s!==0&&s!==o.retryLane))throw o.retryLane=s,ai(e,s),_u(r,e,s),ac;ku(),t=hc(e,t,n)}else e=o.treeContext,Pi=lf(s.nextSibling),Ni=t,z=!0,Fi=null,Ii=!1,e!==null&&Mi(t,e),t=mc(t,r),t.flags|=4096;return t}return e=fi(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function _c(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(i(284));(e===null||e.ref!==n)&&(t.flags|=4194816)}}function vc(e,t,n,r,i){return ea(t),n=To(e,t,n,r,void 0,i),r=ko(),e!==null&&!oc?(Ao(e,t,i),Mc(e,t,i)):(z&&r&&ji(t),t.flags|=1,sc(e,t,n,i),t.child)}function yc(e,t,n,r,i,a){return ea(t),t.updateQueue=null,n=Do(t,r,n,i),Eo(e),r=ko(),e!==null&&!oc?(Ao(e,t,a),Mc(e,t,a)):(z&&r&&ji(t),t.flags|=1,sc(e,t,n,a),t.child)}function bc(e,t,n,r,i){if(ea(t),t.stateNode===null){var a=ci,o=n.contextType;typeof o==`object`&&o&&(a=ta(o)),a=new n(r,a),t.memoizedState=a.state!==null&&a.state!==void 0?a.state:null,a.updater=Ks,t.stateNode=a,a._reactInternals=t,a=t.stateNode,a.props=r,a.state=t.memoizedState,a.refs={},Va(t),o=n.contextType,a.context=typeof o==`object`&&o?ta(o):ci,a.state=t.memoizedState,o=n.getDerivedStateFromProps,typeof o==`function`&&(Gs(t,n,o,r),a.state=t.memoizedState),typeof n.getDerivedStateFromProps==`function`||typeof a.getSnapshotBeforeUpdate==`function`||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(o=a.state,typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount(),o!==a.state&&Ks.enqueueReplaceState(a,a.state,null),Ya(t,r,a,i),Ja(),a.state=t.memoizedState),typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!0}else if(e===null){a=t.stateNode;var s=t.memoizedProps,c=Ys(n,s);a.props=c;var l=a.context,u=n.contextType;o=ci,typeof u==`object`&&u&&(o=ta(u));var d=n.getDerivedStateFromProps;u=typeof d==`function`||typeof a.getSnapshotBeforeUpdate==`function`,s=t.pendingProps!==s,u||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(s||l!==o)&&Js(t,a,r,o),Ba=!1;var f=t.memoizedState;a.state=f,Ya(t,r,a,i),Ja(),l=t.memoizedState,s||f!==l||Ba?(typeof d==`function`&&(Gs(t,n,d,r),l=t.memoizedState),(c=Ba||qs(t,n,c,r,f,l,o))?(u||typeof a.UNSAFE_componentWillMount!=`function`&&typeof a.componentWillMount!=`function`||(typeof a.componentWillMount==`function`&&a.componentWillMount(),typeof a.UNSAFE_componentWillMount==`function`&&a.UNSAFE_componentWillMount()),typeof a.componentDidMount==`function`&&(t.flags|=4194308)):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=l),a.props=r,a.state=l,a.context=o,r=c):(typeof a.componentDidMount==`function`&&(t.flags|=4194308),r=!1)}else{a=t.stateNode,Ha(e,t),o=t.memoizedProps,u=Ys(n,o),a.props=u,d=t.pendingProps,f=a.context,l=n.contextType,c=ci,typeof l==`object`&&l&&(c=ta(l)),s=n.getDerivedStateFromProps,(l=typeof s==`function`||typeof a.getSnapshotBeforeUpdate==`function`)||typeof a.UNSAFE_componentWillReceiveProps!=`function`&&typeof a.componentWillReceiveProps!=`function`||(o!==d||f!==c)&&Js(t,a,r,c),Ba=!1,f=t.memoizedState,a.state=f,Ya(t,r,a,i),Ja();var p=t.memoizedState;o!==d||f!==p||Ba||e!==null&&e.dependencies!==null&&$i(e.dependencies)?(typeof s==`function`&&(Gs(t,n,s,r),p=t.memoizedState),(u=Ba||qs(t,n,u,r,f,p,c)||e!==null&&e.dependencies!==null&&$i(e.dependencies))?(l||typeof a.UNSAFE_componentWillUpdate!=`function`&&typeof a.componentWillUpdate!=`function`||(typeof a.componentWillUpdate==`function`&&a.componentWillUpdate(r,p,c),typeof a.UNSAFE_componentWillUpdate==`function`&&a.UNSAFE_componentWillUpdate(r,p,c)),typeof a.componentDidUpdate==`function`&&(t.flags|=4),typeof a.getSnapshotBeforeUpdate==`function`&&(t.flags|=1024)):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=p),a.props=r,a.state=p,a.context=c,r=u):(typeof a.componentDidUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=4),typeof a.getSnapshotBeforeUpdate!=`function`||o===e.memoizedProps&&f===e.memoizedState||(t.flags|=1024),r=!1)}return a=r,_c(e,t),r=!!(t.flags&128),a||r?(a=t.stateNode,n=r&&typeof n.getDerivedStateFromError!=`function`?null:a.render(),t.flags|=1,e!==null&&r?(t.child=Ra(t,e.child,null,i),t.child=Ra(t,null,n,i)):sc(e,t,n,i),t.memoizedState=a.state,e=t.child):e=Mc(e,t,i),e}function xc(e,t,n,r){return Hi(),t.flags|=256,sc(e,t,n,r),t.child}var Sc={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Cc(e){return{baseLanes:e,cachePool:xa()}}function wc(e,t,n){return e=e===null?0:e.childLanes&~n,t&&(e|=Xl),e}function Tc(e,t,n){var r=t.pendingProps,a=!1,o=!!(t.flags&128),s;if((s=o)||(s=e!==null&&e.memoizedState===null?!1:!!(uo.current&2)),s&&(a=!0,t.flags&=-129),s=!!(t.flags&32),t.flags&=-33,e===null){if(z){if(a?ao(t):co(t),(e=Pi)?(e=af(e,Ii),e=e!==null&&e.data!==`&`?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Di===null?null:{id:Oi,overflow:ki},retryLane:536870912,hydrationErrors:null},n=_i(e),n.return=t,t.child=n,Ni=t,Pi=null)):e=null,e===null)throw Ri(t);return sf(e)?t.lanes=32:t.lanes=536870912,null}var c=r.children;return r=r.fallback,a?(co(t),a=t.mode,c=Dc({mode:`hidden`,children:c},a),r=hi(r,a,n,null),c.return=t,r.return=t,c.sibling=r,t.child=c,r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(null,r)):(ao(t),Ec(t,c))}var l=e.memoizedState;if(l!==null&&(c=l.dehydrated,c!==null)){if(o)t.flags&256?(ao(t),t.flags&=-257,t=Oc(e,t,n)):t.memoizedState===null?(co(t),c=r.fallback,a=t.mode,r=Dc({mode:`visible`,children:r.children},a),c=hi(c,a,n,null),c.flags|=2,r.return=t,c.return=t,r.sibling=c,t.child=r,Ra(t,e.child,null,n),r=t.child,r.memoizedState=Cc(n),r.childLanes=wc(e,s,n),t.memoizedState=Sc,t=fc(null,r)):(co(t),t.child=e.child,t.flags|=128,t=null);else if(ao(t),sf(c)){if(s=c.nextSibling&&c.nextSibling.dataset,s)var u=s.dgst;s=u,r=Error(i(419)),r.stack=``,r.digest=s,Wi({value:r,source:null,stack:null}),t=Oc(e,t,n)}else if(oc||Qi(e,t,n,!1),s=(n&e.childLanes)!==0,oc||s){if(s=zl,s!==null&&(r=at(s,n),r!==0&&r!==l.retryLane))throw l.retryLane=r,ai(e,r),_u(s,e,r),ac;of(c)||ku(),t=Oc(e,t,n)}else of(c)?(t.flags|=192,t.child=e.child,t=null):(e=l.treeContext,Pi=lf(c.nextSibling),Ni=t,z=!0,Fi=null,Ii=!1,e!==null&&Mi(t,e),t=Ec(t,r.children),t.flags|=4096);return t}return a?(co(t),c=r.fallback,a=t.mode,l=e.child,u=l.sibling,r=fi(l,{mode:`hidden`,children:r.children}),r.subtreeFlags=l.subtreeFlags&65011712,u===null?(c=hi(c,a,n,null),c.flags|=2):c=fi(u,c),c.return=t,r.return=t,r.sibling=c,t.child=r,fc(null,r),r=t.child,c=e.child.memoizedState,c===null?c=Cc(n):(a=c.cachePool,a===null?a=xa():(l=sa._currentValue,a=a.parent===l?a:{parent:l,pool:l}),c={baseLanes:c.baseLanes|n,cachePool:a}),r.memoizedState=c,r.childLanes=wc(e,s,n),t.memoizedState=Sc,fc(e.child,r)):(ao(t),n=e.child,e=n.sibling,n=fi(n,{mode:`visible`,children:r.children}),n.return=t,n.sibling=null,e!==null&&(s=t.deletions,s===null?(t.deletions=[e],t.flags|=16):s.push(e)),t.child=n,t.memoizedState=null,n)}function Ec(e,t){return t=Dc({mode:`visible`,children:t},e.mode),t.return=e,e.child=t}function Dc(e,t){return e=ui(22,e,null,t),e.lanes=0,e}function Oc(e,t,n){return Ra(t,e.child,null,n),e=Ec(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function kc(e,t,n){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Xi(e.return,t,n)}function Ac(e,t,n,r,i,a){var o=e.memoizedState;o===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:n,tailMode:i,treeForkCount:a}:(o.isBackwards=t,o.rendering=null,o.renderingStartTime=0,o.last=r,o.tail=n,o.tailMode=i,o.treeForkCount=a)}function jc(e,t,n){var r=t.pendingProps,i=r.revealOrder,a=r.tail;r=r.children;var o=uo.current,s=!!(o&2);if(s?(o=o&1|2,t.flags|=128):o&=1,j(uo,o),sc(e,t,r,n),r=z?wi:0,!s&&e!==null&&e.flags&128)a:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&kc(e,n,t);else if(e.tag===19)kc(e,n,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break a;for(;e.sibling===null;){if(e.return===null||e.return===t)break a;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(i){case`forwards`:for(n=t.child,i=null;n!==null;)e=n.alternate,e!==null&&fo(e)===null&&(i=n),n=n.sibling;n=i,n===null?(i=t.child,t.child=null):(i=n.sibling,n.sibling=null),Ac(t,!1,i,n,a,r);break;case`backwards`:case`unstable_legacy-backwards`:for(n=null,i=t.child,t.child=null;i!==null;){if(e=i.alternate,e!==null&&fo(e)===null){t.child=i;break}e=i.sibling,i.sibling=n,n=i,i=e}Ac(t,!0,n,null,a,r);break;case`together`:Ac(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function Mc(e,t,n){if(e!==null&&(t.dependencies=e.dependencies),ql|=t.lanes,(n&t.childLanes)===0){if(e!==null){if(Qi(e,t,n,!1),(n&t.childLanes)===0)return null}else return null}if(e!==null&&t.child!==e.child)throw Error(i(153));if(t.child!==null){for(e=t.child,n=fi(e,e.pendingProps),t.child=n,n.return=t;e.sibling!==null;)e=e.sibling,n=n.sibling=fi(e,e.pendingProps),n.return=t;n.sibling=null}return t.child}function Nc(e,t){return(e.lanes&t)!==0||(e=e.dependencies,!!(e!==null&&$i(e)))}function Pc(e,t,n){switch(t.tag){case 3:ge(t,t.stateNode.containerInfo),Ji(t,sa,e.memoizedState.cache),Hi();break;case 27:case 5:ve(t);break;case 4:ge(t,t.stateNode.containerInfo);break;case 10:Ji(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,oo(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated===null?(n&t.child.childLanes)===0?(ao(t),e=Mc(e,t,n),e===null?null:e.sibling):Tc(e,t,n):(ao(t),t.flags|=128,null);ao(t);break;case 19:var i=!!(e.flags&128);if(r=(n&t.childLanes)!==0,r||=(Qi(e,t,n,!1),(n&t.childLanes)!==0),i){if(r)return jc(e,t,n);t.flags|=128}if(i=t.memoizedState,i!==null&&(i.rendering=null,i.tail=null,i.lastEffect=null),j(uo,uo.current),r)break;return null;case 22:return t.lanes=0,dc(e,t,n,t.pendingProps);case 24:Ji(t,sa,e.memoizedState.cache)}return Mc(e,t,n)}function Fc(e,t,n){if(e!==null){if(e.memoizedProps!==t.pendingProps)oc=!0;else{if(!Nc(e,n)&&!(t.flags&128))return oc=!1,Pc(e,t,n);oc=!!(e.flags&131072)}}else oc=!1,z&&t.flags&1048576&&L(t,wi,t.index);switch(t.lanes=0,t.tag){case 16:a:{var r=t.pendingProps;if(e=Oa(t.elementType),t.type=e,typeof e==`function`)di(e)?(r=Ys(e,r),t.tag=1,t=bc(null,t,e,r,n)):(t.tag=0,t=vc(null,t,e,r,n));else{if(e!=null){var a=e.$$typeof;if(a===w){t.tag=11,t=cc(null,t,e,r,n);break a}if(a===te){t.tag=14,t=lc(null,t,e,r,n);break a}}throw t=O(e)||e,Error(i(306,t,``))}}return t;case 0:return vc(e,t,t.type,t.pendingProps,n);case 1:return r=t.type,a=Ys(r,t.pendingProps),bc(e,t,r,a,n);case 3:a:{if(ge(t,t.stateNode.containerInfo),e===null)throw Error(i(387));r=t.pendingProps;var o=t.memoizedState;a=o.element,Ha(e,t),Ya(t,r,null,n);var s=t.memoizedState;if(r=s.cache,Ji(t,sa,r),r!==o.cache&&Zi(t,[sa],n,!0),Ja(),r=s.element,o.isDehydrated){if(o={element:r,isDehydrated:!1,cache:s.cache},t.updateQueue.baseState=o,t.memoizedState=o,t.flags&256){t=xc(e,t,r,n);break a}if(r!==a){a=bi(Error(i(424)),t),Wi(a),t=xc(e,t,r,n);break a}switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName===`HTML`?e.ownerDocument.body:e}for(Pi=lf(e.firstChild),Ni=t,z=!0,Fi=null,Ii=!0,n=za(t,null,r,n),t.child=n;n;)n.flags=n.flags&-3|4096,n=n.sibling}else{if(Hi(),r===a){t=Mc(e,t,n);break a}sc(e,t,r,n)}t=t.child}return t;case 26:return _c(e,t),e===null?(n=kf(t.type,null,t.pendingProps,null))?t.memoizedState=n:z||(n=t.type,e=t.pendingProps,r=Vd(me.current).createElement(n),r[dt]=t,r[ft]=e,Fd(r,n,e),Ct(r),t.stateNode=r):t.memoizedState=kf(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return ve(t),e===null&&z&&(r=t.stateNode=pf(t.type,t.pendingProps,me.current),Ni=t,Ii=!0,a=Pi,Qd(t.type)?(uf=a,Pi=lf(r.firstChild)):Pi=a),sc(e,t,t.pendingProps.children,n),_c(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&z&&((a=r=Pi)&&(r=nf(r,t.type,t.pendingProps,Ii),r===null?a=!1:(t.stateNode=r,Ni=t,Pi=lf(r.firstChild),Ii=!1,a=!0)),a||Ri(t)),ve(t),a=t.type,o=t.pendingProps,s=e===null?null:e.memoizedProps,r=o.children,Wd(a,o)?r=null:s!==null&&Wd(a,s)&&(t.flags|=32),t.memoizedState!==null&&(a=To(e,t,Oo,null,null,n),Qf._currentValue=a),_c(e,t),sc(e,t,r,n),t.child;case 6:return e===null&&z&&((e=n=Pi)&&(n=rf(n,t.pendingProps,Ii),n===null?e=!1:(t.stateNode=n,Ni=t,Pi=null,e=!0)),e||Ri(t)),null;case 13:return Tc(e,t,n);case 4:return ge(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Ra(t,null,r,n):sc(e,t,r,n),t.child;case 11:return cc(e,t,t.type,t.pendingProps,n);case 7:return sc(e,t,t.pendingProps,n),t.child;case 8:return sc(e,t,t.pendingProps.children,n),t.child;case 12:return sc(e,t,t.pendingProps.children,n),t.child;case 10:return r=t.pendingProps,Ji(t,t.type,r.value),sc(e,t,r.children,n),t.child;case 9:return a=t.type._context,r=t.pendingProps.children,ea(t),a=ta(a),r=r(a),t.flags|=1,sc(e,t,r,n),t.child;case 14:return lc(e,t,t.type,t.pendingProps,n);case 15:return uc(e,t,t.type,t.pendingProps,n);case 19:return jc(e,t,n);case 31:return gc(e,t,n);case 22:return dc(e,t,n,t.pendingProps);case 24:return ea(t),r=ta(sa),e===null?(a=ya(),a===null&&(a=zl,o=ca(),a.pooledCache=o,o.refCount++,o!==null&&(a.pooledCacheLanes|=n),a=o),t.memoizedState={parent:r,cache:a},Va(t),Ji(t,sa,a)):((e.lanes&n)!==0&&(Ha(e,t),Ya(t,null,null,n),Ja()),a=e.memoizedState,o=t.memoizedState,a.parent===r?(r=o.cache,Ji(t,sa,r),r!==a.cache&&Zi(t,[sa],n,!0)):(a={parent:r,cache:r},t.memoizedState=a,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=a),Ji(t,sa,r))),sc(e,t,t.pendingProps.children,n),t.child;case 29:throw t.pendingProps}throw Error(i(156,t.tag))}function Ic(e){e.flags|=4}function Lc(e,t,n,r,i){if((t=!!(e.mode&32))&&(t=!1),t){if(e.flags|=16777216,(i&335544128)===i){if(e.stateNode.complete)e.flags|=8192;else if(Eu())e.flags|=8192;else throw ka=Ta,Ca}}else e.flags&=-16777217}function Rc(e,t){if(t.type!==`stylesheet`||t.state.loading&4)e.flags&=-16777217;else if(e.flags|=16777216,!Wf(t)){if(Eu())e.flags|=8192;else throw ka=Ta,Ca}}function zc(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag===22?536870912:et(),e.lanes|=t,Zl|=t)}function Bc(e,t){if(!z)switch(e.tailMode){case`hidden`:t=e.tail;for(var n=null;t!==null;)t.alternate!==null&&(n=t),t=t.sibling;n===null?e.tail=null:n.sibling=null;break;case`collapsed`:n=e.tail;for(var r=null;n!==null;)n.alternate!==null&&(r=n),n=n.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Vc(e){var t=e.alternate!==null&&e.alternate.child===e.child,n=0,r=0;if(t)for(var i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags&65011712,r|=i.flags&65011712,i.return=e,i=i.sibling;else for(i=e.child;i!==null;)n|=i.lanes|i.childLanes,r|=i.subtreeFlags,r|=i.flags,i.return=e,i=i.sibling;return e.subtreeFlags|=r,e.childLanes=n,t}function Hc(e,t,n){var r=t.pendingProps;switch(R(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vc(t),null;case 1:return Vc(t),null;case 3:return n=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Yi(sa),_e(),n.pendingContext&&(n.context=n.pendingContext,n.pendingContext=null),(e===null||e.child===null)&&(Vi(t)?Ic(t):e===null||e.memoizedState.isDehydrated&&!(t.flags&256)||(t.flags|=1024,Ui())),Vc(t),null;case 26:var a=t.type,o=t.memoizedState;return e===null?(Ic(t),o===null?(Vc(t),Lc(t,a,null,r,n)):(Vc(t),Rc(t,o))):o?o===e.memoizedState?(Vc(t),t.flags&=-16777217):(Ic(t),Vc(t),Rc(t,o)):(e=e.memoizedProps,e!==r&&Ic(t),Vc(t),Lc(t,a,e,r,n)),null;case 27:if(ye(t),n=me.current,a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}e=fe.current,Vi(t)?zi(t,e):(e=pf(a,r,n),t.stateNode=e,Ic(t))}return Vc(t),null;case 5:if(ye(t),a=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(!r){if(t.stateNode===null)throw Error(i(166));return Vc(t),null}if(o=fe.current,Vi(t))zi(t,o);else{var s=Vd(me.current);switch(o){case 1:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case 2:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;default:switch(a){case`svg`:o=s.createElementNS(`http://www.w3.org/2000/svg`,a);break;case`math`:o=s.createElementNS(`http://www.w3.org/1998/Math/MathML`,a);break;case`script`:o=s.createElement(`div`),o.innerHTML=`<script><\/script>`,o=o.removeChild(o.firstChild);break;case`select`:o=typeof r.is==`string`?s.createElement(`select`,{is:r.is}):s.createElement(`select`),r.multiple?o.multiple=!0:r.size&&(o.size=r.size);break;default:o=typeof r.is==`string`?s.createElement(a,{is:r.is}):s.createElement(a)}}o[dt]=t,o[ft]=r;a:for(s=t.child;s!==null;){if(s.tag===5||s.tag===6)o.appendChild(s.stateNode);else if(s.tag!==4&&s.tag!==27&&s.child!==null){s.child.return=s,s=s.child;continue}if(s===t)break a;for(;s.sibling===null;){if(s.return===null||s.return===t)break a;s=s.return}s.sibling.return=s.return,s=s.sibling}t.stateNode=o;a:switch(Fd(o,a,r),a){case`button`:case`input`:case`select`:case`textarea`:r=!!r.autoFocus;break a;case`img`:r=!0;break a;default:r=!1}r&&Ic(t)}}return Vc(t),Lc(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,n),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&Ic(t);else{if(typeof r!=`string`&&t.stateNode===null)throw Error(i(166));if(e=me.current,Vi(t)){if(e=t.stateNode,n=t.memoizedProps,r=null,a=Ni,a!==null)switch(a.tag){case 27:case 5:r=a.memoizedProps}e[dt]=t,e=!!(e.nodeValue===n||r!==null&&!0===r.suppressHydrationWarning||Md(e.nodeValue,n)),e||Ri(t,!0)}else e=Vd(e).createTextNode(r),e[dt]=t,t.stateNode=e}return Vc(t),null;case 31:if(n=t.memoizedState,e===null||e.memoizedState!==null){if(r=Vi(t),n!==null){if(e===null){if(!r)throw Error(i(318));if(e=t.memoizedState,e=e===null?null:e.dehydrated,!e)throw Error(i(557));e[dt]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),e=!1}else n=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=n),e=!0;if(!e)return t.flags&256?(lo(t),t):(lo(t),null);if(t.flags&128)throw Error(i(558))}return Vc(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(a=Vi(t),r!==null&&r.dehydrated!==null){if(e===null){if(!a)throw Error(i(318));if(a=t.memoizedState,a=a===null?null:a.dehydrated,!a)throw Error(i(317));a[dt]=t}else Hi(),!(t.flags&128)&&(t.memoizedState=null),t.flags|=4;Vc(t),a=!1}else a=Ui(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=a),a=!0;if(!a)return t.flags&256?(lo(t),t):(lo(t),null)}return lo(t),t.flags&128?(t.lanes=n,t):(n=r!==null,e=e!==null&&e.memoizedState!==null,n&&(r=t.child,a=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(a=r.alternate.memoizedState.cachePool.pool),o=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(o=r.memoizedState.cachePool.pool),o!==a&&(r.flags|=2048)),n!==e&&n&&(t.child.flags|=8192),zc(t,t.updateQueue),Vc(t),null);case 4:return _e(),e===null&&Sd(t.stateNode.containerInfo),Vc(t),null;case 10:return Yi(t.type),Vc(t),null;case 19:if(de(uo),r=t.memoizedState,r===null)return Vc(t),null;if(a=!!(t.flags&128),o=r.rendering,o===null){if(a)Bc(r,!1);else{if(Kl!==0||e!==null&&e.flags&128)for(e=t.child;e!==null;){if(o=fo(e),o!==null){for(t.flags|=128,Bc(r,!1),e=o.updateQueue,t.updateQueue=e,zc(t,e),t.subtreeFlags=0,e=n,n=t.child;n!==null;)pi(n,e),n=n.sibling;return j(uo,uo.current&1|2),z&&Ai(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Me()>ru&&(t.flags|=128,a=!0,Bc(r,!1),t.lanes=4194304)}}else{if(!a){if(e=fo(o),e!==null){if(t.flags|=128,a=!0,e=e.updateQueue,t.updateQueue=e,zc(t,e),Bc(r,!0),r.tail===null&&r.tailMode===`hidden`&&!o.alternate&&!z)return Vc(t),null}else 2*Me()-r.renderingStartTime>ru&&n!==536870912&&(t.flags|=128,a=!0,Bc(r,!1),t.lanes=4194304)}r.isBackwards?(o.sibling=t.child,t.child=o):(e=r.last,e===null?t.child=o:e.sibling=o,r.last=o)}return r.tail===null?(Vc(t),null):(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Me(),e.sibling=null,n=uo.current,j(uo,a?n&1|2:n&1),z&&Ai(t,r.treeForkCount),e);case 22:case 23:return lo(t),no(),r=t.memoizedState!==null,e===null?r&&(t.flags|=8192):e.memoizedState!==null!==r&&(t.flags|=8192),r?n&536870912&&!(t.flags&128)&&(Vc(t),t.subtreeFlags&6&&(t.flags|=8192)):Vc(t),n=t.updateQueue,n!==null&&zc(t,n.retryQueue),n=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(n=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==n&&(t.flags|=2048),e!==null&&de(va),null;case 24:return n=null,e!==null&&(n=e.memoizedState.cache),t.memoizedState.cache!==n&&(t.flags|=2048),Yi(sa),Vc(t),null;case 25:return null;case 30:return null}throw Error(i(156,t.tag))}function Uc(e,t){switch(R(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Yi(sa),_e(),e=t.flags,e&65536&&!(e&128)?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return ye(t),null;case 31:if(t.memoizedState!==null){if(lo(t),t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(lo(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(i(340));Hi()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return de(uo),null;case 4:return _e(),null;case 10:return Yi(t.type),null;case 22:case 23:return lo(t),no(),e!==null&&de(va),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Yi(sa),null;case 25:return null;default:return null}}function Wc(e,t){switch(R(t),t.tag){case 3:Yi(sa),_e();break;case 26:case 27:case 5:ye(t);break;case 4:_e();break;case 31:t.memoizedState!==null&&lo(t);break;case 13:lo(t);break;case 19:de(uo);break;case 10:Yi(t.type);break;case 22:case 23:lo(t),no(),e!==null&&de(va);break;case 24:Yi(sa)}}function Gc(e,t){try{var n=t.updateQueue,r=n===null?null:n.lastEffect;if(r!==null){var i=r.next;n=i;do{if((n.tag&e)===e){r=void 0;var a=n.create,o=n.inst;r=a(),o.destroy=r}n=n.next}while(n!==i)}}catch(e){X(t,t.return,e)}}function Kc(e,t,n){try{var r=t.updateQueue,i=r===null?null:r.lastEffect;if(i!==null){var a=i.next;r=a;do{if((r.tag&e)===e){var o=r.inst,s=o.destroy;if(s!==void 0){o.destroy=void 0,i=t;var c=n,l=s;try{l()}catch(e){X(i,c,e)}}}r=r.next}while(r!==a)}}catch(e){X(t,t.return,e)}}function qc(e){var t=e.updateQueue;if(t!==null){var n=e.stateNode;try{Za(t,n)}catch(t){X(e,e.return,t)}}}function Jc(e,t,n){n.props=Ys(e.type,e.memoizedProps),n.state=e.memoizedState;try{n.componentWillUnmount()}catch(n){X(e,t,n)}}function Yc(e,t){try{var n=e.ref;if(n!==null){switch(e.tag){case 26:case 27:case 5:var r=e.stateNode;break;case 30:r=e.stateNode;break;default:r=e.stateNode}typeof n==`function`?e.refCleanup=n(r):n.current=r}}catch(n){X(e,t,n)}}function Xc(e,t){var n=e.ref,r=e.refCleanup;if(n!==null){if(typeof r==`function`)try{r()}catch(n){X(e,t,n)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof n==`function`)try{n(null)}catch(n){X(e,t,n)}else n.current=null}}function Zc(e){var t=e.type,n=e.memoizedProps,r=e.stateNode;try{a:switch(t){case`button`:case`input`:case`select`:case`textarea`:n.autoFocus&&r.focus();break a;case`img`:n.src?r.src=n.src:n.srcSet&&(r.srcset=n.srcSet)}}catch(t){X(e,e.return,t)}}function Qc(e,t,n){try{var r=e.stateNode;Id(r,e.type,n,t),r[ft]=t}catch(t){X(e,e.return,t)}}function $c(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Qd(e.type)||e.tag===4}function el(e){a:for(;;){for(;e.sibling===null;){if(e.return===null||$c(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&&Qd(e.type)||e.flags&2||e.child===null||e.tag===4)continue a;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function tl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n).insertBefore(e,t):(t=n.nodeType===9?n.body:n.nodeName===`HTML`?n.ownerDocument.body:n,t.appendChild(e),n=n._reactRootContainer,n!=null||t.onclick!==null||(t.onclick=rn));else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode,t=null),e=e.child,e!==null))for(tl(e,t,n),e=e.sibling;e!==null;)tl(e,t,n),e=e.sibling}function nl(e,t,n){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?n.insertBefore(e,t):n.appendChild(e);else if(r!==4&&(r===27&&Qd(e.type)&&(n=e.stateNode),e=e.child,e!==null))for(nl(e,t,n),e=e.sibling;e!==null;)nl(e,t,n),e=e.sibling}function rl(e){var t=e.stateNode,n=e.memoizedProps;try{for(var r=e.type,i=t.attributes;i.length;)t.removeAttributeNode(i[0]);Fd(t,r,n),t[dt]=e,t[ft]=n}catch(t){X(e,e.return,t)}}var il=!1,V=!1,al=!1,ol=typeof WeakSet==`function`?WeakSet:Set,sl=null;function cl(e,t){if(e=e.containerInfo,zd=sp,e=jr(e),Mr(e)){if(`selectionStart`in e)var n={start:e.selectionStart,end:e.selectionEnd};else a:{n=(n=e.ownerDocument)&&n.defaultView||window;var r=n.getSelection&&n.getSelection();if(r&&r.rangeCount!==0){n=r.anchorNode;var a=r.anchorOffset,o=r.focusNode;r=r.focusOffset;try{n.nodeType,o.nodeType}catch{n=null;break a}var s=0,c=-1,l=-1,u=0,d=0,f=e,p=null;b:for(;;){for(var m;f!==n||a!==0&&f.nodeType!==3||(c=s+a),f!==o||r!==0&&f.nodeType!==3||(l=s+r),f.nodeType===3&&(s+=f.nodeValue.length),(m=f.firstChild)!==null;)p=f,f=m;for(;;){if(f===e)break b;if(p===n&&++u===a&&(c=s),p===o&&++d===r&&(l=s),(m=f.nextSibling)!==null)break;f=p,p=f.parentNode}f=m}n=c===-1||l===-1?null:{start:c,end:l}}else n=null}n||={start:0,end:0}}else n=null;for(Bd={focusedElem:e,selectionRange:n},sp=!1,sl=t;sl!==null;)if(t=sl,e=t.child,t.subtreeFlags&1028&&e!==null)e.return=t,sl=e;else for(;sl!==null;){switch(t=sl,o=t.alternate,e=t.flags,t.tag){case 0:if(e&4&&(e=t.updateQueue,e=e===null?null:e.events,e!==null))for(n=0;n<e.length;n++)a=e[n],a.ref.impl=a.nextImpl;break;case 11:case 15:break;case 1:if(e&1024&&o!==null){e=void 0,n=t,a=o.memoizedProps,o=o.memoizedState,r=n.stateNode;try{var h=Ys(n.type,a);e=r.getSnapshotBeforeUpdate(h,o),r.__reactInternalSnapshotBeforeUpdate=e}catch(e){X(n,n.return,e)}}break;case 3:if(e&1024){if(e=t.stateNode.containerInfo,n=e.nodeType,n===9)tf(e);else if(n===1)switch(e.nodeName){case`HEAD`:case`HTML`:case`BODY`:tf(e);break;default:e.textContent=``}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(e&1024)throw Error(i(163))}if(e=t.sibling,e!==null){e.return=t.return,sl=e;break}sl=t.return}}function ll(e,t,n){var r=n.flags;switch(n.tag){case 0:case 11:case 15:bl(e,n),r&4&&Gc(5,n);break;case 1:if(bl(e,n),r&4){if(e=n.stateNode,t===null)try{e.componentDidMount()}catch(e){X(n,n.return,e)}else{var i=Ys(n.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(i,t,e.__reactInternalSnapshotBeforeUpdate)}catch(e){X(n,n.return,e)}}}r&64&&qc(n),r&512&&Yc(n,n.return);break;case 3:if(bl(e,n),r&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{Za(e,t)}catch(e){X(n,n.return,e)}}break;case 27:t===null&&r&4&&rl(n);case 26:case 5:bl(e,n),t===null&&r&4&&Zc(n),r&512&&Yc(n,n.return);break;case 12:bl(e,n);break;case 31:bl(e,n),r&4&&W(e,n);break;case 13:bl(e,n),r&4&&pl(e,n),r&64&&(e=n.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(n=Yu.bind(null,n),cf(e,n))));break;case 22:if(r=n.memoizedState!==null||il,!r){t=t!==null&&t.memoizedState!==null||V,i=il;var a=V;il=r,(V=t)&&!a?Sl(e,n,!!(n.subtreeFlags&8772)):bl(e,n),il=i,V=a}break;case 30:break;default:bl(e,n)}}function ul(e){var t=e.alternate;t!==null&&(e.alternate=null,ul(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&vt(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 H=null,U=!1;function dl(e,t,n){for(n=n.child;n!==null;)fl(e,t,n),n=n.sibling}function fl(e,t,n){if(Ve&&typeof Ve.onCommitFiberUnmount==`function`)try{Ve.onCommitFiberUnmount(Be,n)}catch{}switch(n.tag){case 26:V||Xc(n,t),dl(e,t,n),n.memoizedState?n.memoizedState.count--:n.stateNode&&(n=n.stateNode,n.parentNode.removeChild(n));break;case 27:V||Xc(n,t);var r=H,i=U;Qd(n.type)&&(H=n.stateNode,U=!1),dl(e,t,n),mf(n.stateNode),H=r,U=i;break;case 5:V||Xc(n,t);case 6:if(r=H,i=U,H=null,dl(e,t,n),H=r,U=i,H!==null){if(U)try{(H.nodeType===9?H.body:H.nodeName===`HTML`?H.ownerDocument.body:H).removeChild(n.stateNode)}catch(e){X(n,t,e)}else try{H.removeChild(n.stateNode)}catch(e){X(n,t,e)}}break;case 18:H!==null&&(U?(e=H,$d(e.nodeType===9?e.body:e.nodeName===`HTML`?e.ownerDocument.body:e,n.stateNode),Np(e)):$d(H,n.stateNode));break;case 4:r=H,i=U,H=n.stateNode.containerInfo,U=!0,dl(e,t,n),H=r,U=i;break;case 0:case 11:case 14:case 15:Kc(2,n,t),V||Kc(4,n,t),dl(e,t,n);break;case 1:V||(Xc(n,t),r=n.stateNode,typeof r.componentWillUnmount==`function`&&Jc(n,t,r)),dl(e,t,n);break;case 21:dl(e,t,n);break;case 22:V=(r=V)||n.memoizedState!==null,dl(e,t,n),V=r;break;default:dl(e,t,n)}}function W(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Np(e)}catch(e){X(t,t.return,e)}}}function pl(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Np(e)}catch(e){X(t,t.return,e)}}function ml(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new ol),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new ol),t;default:throw Error(i(435,e.tag))}}function G(e,t){var n=ml(e);t.forEach(function(t){if(!n.has(t)){n.add(t);var r=Xu.bind(null,e,t);t.then(r,r)}})}function hl(e,t){var n=t.deletions;if(n!==null)for(var r=0;r<n.length;r++){var a=n[r],o=e,s=t,c=s;a:for(;c!==null;){switch(c.tag){case 27:if(Qd(c.type)){H=c.stateNode,U=!1;break a}break;case 5:H=c.stateNode,U=!1;break a;case 3:case 4:H=c.stateNode.containerInfo,U=!0;break a}c=c.return}if(H===null)throw Error(i(160));fl(o,s,a),H=null,U=!1,o=a.alternate,o!==null&&(o.return=null),a.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)_l(t,e),t=t.sibling}var gl=null;function _l(e,t){var n=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:hl(t,e),vl(e),r&4&&(Kc(3,e,e.return),Gc(3,e),Kc(5,e,e.return));break;case 1:hl(t,e),vl(e),r&512&&(V||n===null||Xc(n,n.return)),r&64&&il&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(n=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=n===null?r:n.concat(r))));break;case 26:var a=gl;if(hl(t,e),vl(e),r&512&&(V||n===null||Xc(n,n.return)),r&4){var o=n===null?null:n.memoizedState;if(r=e.memoizedState,n===null){if(r===null){if(e.stateNode===null){a:{r=e.type,n=e.memoizedProps,a=a.ownerDocument||a;b:switch(r){case`title`:o=a.getElementsByTagName(`title`)[0],(!o||o[P]||o[dt]||o.namespaceURI===`http://www.w3.org/2000/svg`||o.hasAttribute(`itemprop`))&&(o=a.createElement(r),a.head.insertBefore(o,a.querySelector(`head > title`))),Fd(o,r,n),o[dt]=e,Ct(o),r=o;break a;case`link`:var s=Vf(`link`,`href`,a).get(r+(n.href||``));if(s){for(var c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`href`)===(n.href==null||n.href===``?null:n.href)&&o.getAttribute(`rel`)===(n.rel==null?null:n.rel)&&o.getAttribute(`title`)===(n.title==null?null:n.title)&&o.getAttribute(`crossorigin`)===(n.crossOrigin==null?null:n.crossOrigin)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;case`meta`:if(s=Vf(`meta`,`content`,a).get(r+(n.content||``))){for(c=0;c<s.length;c++)if(o=s[c],o.getAttribute(`content`)===(n.content==null?null:``+n.content)&&o.getAttribute(`name`)===(n.name==null?null:n.name)&&o.getAttribute(`property`)===(n.property==null?null:n.property)&&o.getAttribute(`http-equiv`)===(n.httpEquiv==null?null:n.httpEquiv)&&o.getAttribute(`charset`)===(n.charSet==null?null:n.charSet)){s.splice(c,1);break b}}o=a.createElement(r),Fd(o,r,n),a.head.appendChild(o);break;default:throw Error(i(468,r))}o[dt]=e,Ct(o),r=o}e.stateNode=r}else Hf(a,e.type,e.stateNode)}else e.stateNode=If(a,r,e.memoizedProps)}else o===r?r===null&&e.stateNode!==null&&Qc(e,e.memoizedProps,n.memoizedProps):(o===null?n.stateNode!==null&&(n=n.stateNode,n.parentNode.removeChild(n)):o.count--,r===null?Hf(a,e.type,e.stateNode):If(a,r,e.memoizedProps))}break;case 27:hl(t,e),vl(e),r&512&&(V||n===null||Xc(n,n.return)),n!==null&&r&4&&Qc(e,e.memoizedProps,n.memoizedProps);break;case 5:if(hl(t,e),vl(e),r&512&&(V||n===null||Xc(n,n.return)),e.flags&32){a=e.stateNode;try{Yt(a,``)}catch(t){X(e,e.return,t)}}r&4&&e.stateNode!=null&&(a=e.memoizedProps,Qc(e,a,n===null?a:n.memoizedProps)),r&1024&&(al=!0);break;case 6:if(hl(t,e),vl(e),r&4){if(e.stateNode===null)throw Error(i(162));r=e.memoizedProps,n=e.stateNode;try{n.nodeValue=r}catch(t){X(e,e.return,t)}}break;case 3:if(Bf=null,a=gl,gl=_f(t.containerInfo),hl(t,e),gl=a,vl(e),r&4&&n!==null&&n.memoizedState.isDehydrated)try{Np(t.containerInfo)}catch(t){X(e,e.return,t)}al&&(al=!1,yl(e));break;case 4:r=gl,gl=_f(e.stateNode.containerInfo),hl(t,e),vl(e),gl=r;break;case 12:hl(t,e),vl(e);break;case 31:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,G(e,r)));break;case 13:hl(t,e),vl(e),e.child.flags&8192&&e.memoizedState!==null!=(n!==null&&n.memoizedState!==null)&&(tu=Me()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,G(e,r)));break;case 22:a=e.memoizedState!==null;var l=n!==null&&n.memoizedState!==null,u=il,d=V;if(il=u||a,V=d||l,hl(t,e),V=d,il=u,vl(e),r&8192)a:for(t=e.stateNode,t._visibility=a?t._visibility&-2:t._visibility|1,a&&(n===null||l||il||V||xl(e)),n=null,t=e;;){if(t.tag===5||t.tag===26){if(n===null){l=n=t;try{if(o=l.stateNode,a)s=o.style,typeof s.setProperty==`function`?s.setProperty(`display`,`none`,`important`):s.display=`none`;else{c=l.stateNode;var f=l.memoizedProps.style,p=f!=null&&f.hasOwnProperty(`display`)?f.display:null;c.style.display=p==null||typeof p==`boolean`?``:(``+p).trim()}}catch(e){X(l,l.return,e)}}}else if(t.tag===6){if(n===null){l=t;try{l.stateNode.nodeValue=a?``:l.memoizedProps}catch(e){X(l,l.return,e)}}}else if(t.tag===18){if(n===null){l=t;try{var m=l.stateNode;a?ef(m,!0):ef(l.stateNode,!1)}catch(e){X(l,l.return,e)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break a;for(;t.sibling===null;){if(t.return===null||t.return===e)break a;n===t&&(n=null),t=t.return}n===t&&(n=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(n=r.retryQueue,n!==null&&(r.retryQueue=null,G(e,n))));break;case 19:hl(t,e),vl(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,G(e,r)));break;case 30:break;case 21:break;default:hl(t,e),vl(e)}}function vl(e){var t=e.flags;if(t&2){try{for(var n,r=e.return;r!==null;){if($c(r)){n=r;break}r=r.return}if(n==null)throw Error(i(160));switch(n.tag){case 27:var a=n.stateNode;nl(e,el(e),a);break;case 5:var o=n.stateNode;n.flags&32&&(Yt(o,``),n.flags&=-33),nl(e,el(e),o);break;case 3:case 4:var s=n.stateNode.containerInfo;tl(e,el(e),s);break;default:throw Error(i(161))}}catch(t){X(e,e.return,t)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function yl(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;yl(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function bl(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)ll(e,t.alternate,t),t=t.sibling}function xl(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:Kc(4,t,t.return),xl(t);break;case 1:Xc(t,t.return);var n=t.stateNode;typeof n.componentWillUnmount==`function`&&Jc(t,t.return,n),xl(t);break;case 27:mf(t.stateNode);case 26:case 5:Xc(t,t.return),xl(t);break;case 22:t.memoizedState===null&&xl(t);break;case 30:xl(t);break;default:xl(t)}e=e.sibling}}function Sl(e,t,n){for(n&&=!!(t.subtreeFlags&8772),t=t.child;t!==null;){var r=t.alternate,i=e,a=t,o=a.flags;switch(a.tag){case 0:case 11:case 15:Sl(i,a,n),Gc(4,a);break;case 1:if(Sl(i,a,n),r=a,i=r.stateNode,typeof i.componentDidMount==`function`)try{i.componentDidMount()}catch(e){X(r,r.return,e)}if(r=a,i=r.updateQueue,i!==null){var s=r.stateNode;try{var c=i.shared.hiddenCallbacks;if(c!==null)for(i.shared.hiddenCallbacks=null,i=0;i<c.length;i++)Xa(c[i],s)}catch(e){X(r,r.return,e)}}n&&o&64&&qc(a),Yc(a,a.return);break;case 27:rl(a);case 26:case 5:Sl(i,a,n),n&&r===null&&o&4&&Zc(a),Yc(a,a.return);break;case 12:Sl(i,a,n);break;case 31:Sl(i,a,n),n&&o&4&&W(i,a);break;case 13:Sl(i,a,n),n&&o&4&&pl(i,a);break;case 22:a.memoizedState===null&&Sl(i,a,n),Yc(a,a.return);break;case 30:break;default:Sl(i,a,n)}t=t.sibling}}function Cl(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&&la(n))}function wl(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e))}function Tl(e,t,n,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)El(e,t,n,r),t=t.sibling}function El(e,t,n,r){var i=t.flags;switch(t.tag){case 0:case 11:case 15:Tl(e,t,n,r),i&2048&&Gc(9,t);break;case 1:Tl(e,t,n,r);break;case 3:Tl(e,t,n,r),i&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&la(e)));break;case 12:if(i&2048){Tl(e,t,n,r),e=t.stateNode;try{var a=t.memoizedProps,o=a.id,s=a.onPostCommit;typeof s==`function`&&s(o,t.alternate===null?`mount`:`update`,e.passiveEffectDuration,-0)}catch(e){X(t,t.return,e)}}else Tl(e,t,n,r);break;case 31:Tl(e,t,n,r);break;case 13:Tl(e,t,n,r);break;case 23:break;case 22:a=t.stateNode,o=t.alternate,t.memoizedState===null?a._visibility&2?Tl(e,t,n,r):(a._visibility|=2,Dl(e,t,n,r,!!(t.subtreeFlags&10256)||!1)):a._visibility&2?Tl(e,t,n,r):Ol(e,t),i&2048&&Cl(o,t);break;case 24:Tl(e,t,n,r),i&2048&&wl(t.alternate,t);break;default:Tl(e,t,n,r)}}function Dl(e,t,n,r,i){for(i&&=!!(t.subtreeFlags&10256)||!1,t=t.child;t!==null;){var a=e,o=t,s=n,c=r,l=o.flags;switch(o.tag){case 0:case 11:case 15:Dl(a,o,s,c,i),Gc(8,o);break;case 23:break;case 22:var u=o.stateNode;o.memoizedState===null?(u._visibility|=2,Dl(a,o,s,c,i)):u._visibility&2?Dl(a,o,s,c,i):Ol(a,o),i&&l&2048&&Cl(o.alternate,o);break;case 24:Dl(a,o,s,c,i),i&&l&2048&&wl(o.alternate,o);break;default:Dl(a,o,s,c,i)}t=t.sibling}}function Ol(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var n=e,r=t,i=r.flags;switch(r.tag){case 22:Ol(n,r),i&2048&&Cl(r.alternate,r);break;case 24:Ol(n,r),i&2048&&wl(r.alternate,r);break;default:Ol(n,r)}t=t.sibling}}var kl=8192;function Al(e,t,n){if(e.subtreeFlags&kl)for(e=e.child;e!==null;)jl(e,t,n),e=e.sibling}function jl(e,t,n){switch(e.tag){case 26:Al(e,t,n),e.flags&kl&&e.memoizedState!==null&&Gf(n,gl,e.memoizedState,e.memoizedProps);break;case 5:Al(e,t,n);break;case 3:case 4:var r=gl;gl=_f(e.stateNode.containerInfo),Al(e,t,n),gl=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=kl,kl=16777216,Al(e,t,n),kl=r):Al(e,t,n));break;default:Al(e,t,n)}}function Ml(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 Nl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Il(r,e)}Ml(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Pl(e),e=e.sibling}function Pl(e){switch(e.tag){case 0:case 11:case 15:Nl(e),e.flags&2048&&Kc(9,e,e.return);break;case 3:Nl(e);break;case 12:Nl(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,Fl(e)):Nl(e);break;default:Nl(e)}}function Fl(e){var t=e.deletions;if(e.flags&16){if(t!==null)for(var n=0;n<t.length;n++){var r=t[n];sl=r,Il(r,e)}Ml(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:Kc(8,t,t.return),Fl(t);break;case 22:n=t.stateNode,n._visibility&2&&(n._visibility&=-3,Fl(t));break;default:Fl(t)}e=e.sibling}}function Il(e,t){for(;sl!==null;){var n=sl;switch(n.tag){case 0:case 11:case 15:Kc(8,n,t);break;case 23:case 22:if(n.memoizedState!==null&&n.memoizedState.cachePool!==null){var r=n.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:la(n.memoizedState.cache)}if(r=n.child,r!==null)r.return=n,sl=r;else a:for(n=e;sl!==null;){r=sl;var i=r.sibling,a=r.return;if(ul(r),r===n){sl=null;break a}if(i!==null){i.return=a,sl=i;break a}sl=a}}}var Ll={getCacheForType:function(e){var t=ta(sa),n=t.data.get(e);return n===void 0&&(n=e(),t.data.set(e,n)),n},cacheSignal:function(){return ta(sa).controller.signal}},Rl=typeof WeakMap==`function`?WeakMap:Map,K=0,zl=null,q=null,J=0,Bl=0,Vl=null,Hl=!1,Ul=!1,Wl=!1,Gl=0,Kl=0,ql=0,Jl=0,Yl=0,Xl=0,Zl=0,Ql=null,$l=null,eu=!1,tu=0,nu=0,ru=1/0,iu=null,au=null,ou=0,su=null,cu=null,lu=0,uu=0,du=null,fu=null,pu=0,mu=null;function hu(){return K&2&&J!==0?J&-J:k.T===null?ct():dd()}function gu(){if(Xl===0){if(!(J&536870912)||z){var e=Je;Je<<=1,!(Je&3932160)&&(Je=262144),Xl=e}else Xl=536870912}return e=ro.current,e!==null&&(e.flags|=32),Xl}function _u(e,t,n){(e===zl&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)&&(wu(e,0),xu(e,J,Xl,!1)),tt(e,n),(!(K&2)||e!==zl)&&(e===zl&&(!(K&2)&&(Jl|=n),Kl===4&&xu(e,J,Xl,!1)),rd(e))}function vu(e,t,n){if(K&6)throw Error(i(327));var r=!n&&!(t&127)&&(t&e.expiredLanes)===0||Qe(e,t),a=r?Mu(e,t):Au(e,t,!0),o=r;do{if(a===0){Ul&&!r&&xu(e,t,0,!1);break}if(n=e.current.alternate,o&&!bu(n)){a=Au(e,t,!1),o=!1;continue}if(a===2){if(o=t,e.errorRecoveryDisabledLanes&o)var s=0;else s=e.pendingLanes&-536870913,s=s===0?s&536870912?536870912:0:s;if(s!==0){t=s;a:{var c=e;a=Ql;var l=c.current.memoizedState.isDehydrated;if(l&&(wu(c,s).flags|=256),s=Au(c,s,!1),s!==2){if(Wl&&!l){c.errorRecoveryDisabledLanes|=o,Jl|=o,a=4;break a}o=$l,$l=a,o!==null&&($l===null?$l=o:$l.push.apply($l,o))}a=s}if(o=!1,a!==2)continue}}if(a===1){wu(e,0),xu(e,t,0,!0);break}a:{switch(r=e,o=a,o){case 0:case 1:throw Error(i(345));case 4:if((t&4194048)!==t)break;case 6:xu(r,t,Xl,!Hl);break a;case 2:$l=null;break;case 3:case 5:break;default:throw Error(i(329))}if((t&62914560)===t&&(a=tu+300-Me(),10<a)){if(xu(r,t,Xl,!Hl),Ze(r,0,!0)!==0)break a;lu=t,r.timeoutHandle=qd(yu.bind(null,r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,`Throttled`,-0,0),a);break a}yu(r,n,$l,iu,eu,t,Xl,Jl,Zl,Hl,o,null,-0,0)}break}while(1);rd(e)}function yu(e,t,n,r,i,a,o,s,c,l,u,d,f,p){if(e.timeoutHandle=-1,d=t.subtreeFlags,d&8192||(d&16785408)==16785408){d={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:rn},jl(t,a,d);var m=(a&62914560)===a?tu-Me():(a&4194048)===a?nu-Me():0;if(m=qf(d,m),m!==null){lu=a,e.cancelPendingCommit=m(zu.bind(null,e,t,a,n,r,i,o,s,c,u,d,null,f,p)),xu(e,a,o,!l);return}}zu(e,t,a,n,r,i,o,s,c)}function bu(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 r=0;r<n.length;r++){var i=n[r],a=i.getSnapshot;i=i.value;try{if(!Er(a(),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 xu(e,t,n,r){t&=~Yl,t&=~Jl,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var i=t;0<i;){var a=31-Ue(i),o=1<<a;r[a]=-1,i&=~o}n!==0&&rt(e,n,t)}function Su(){return K&6?!0:(id(0,!1),!1)}function Cu(){if(q!==null){if(Bl===0)var e=q.return;else e=q,qi=Ki=null,jo(e),Ma=null,Na=0,e=q;for(;e!==null;)Wc(e.alternate,e),e=e.return;q=null}}function wu(e,t){var n=e.timeoutHandle;n!==-1&&(e.timeoutHandle=-1,Jd(n)),n=e.cancelPendingCommit,n!==null&&(e.cancelPendingCommit=null,n()),lu=0,Cu(),zl=e,q=n=fi(e.current,null),J=t,Bl=0,Vl=null,Hl=!1,Ul=Qe(e,t),Wl=!1,Zl=Xl=Yl=Jl=ql=Kl=0,$l=Ql=null,eu=!1,t&8&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var i=31-Ue(r),a=1<<i;t|=e[i],r&=~a}return Gl=t,ni(),n}function Tu(e,t){B=null,k.H=Vs,t===Sa||t===wa?(t=Aa(),Bl=3):t===Ca?(t=Aa(),Bl=4):Bl=t===ac?8:typeof t==`object`&&t&&typeof t.then==`function`?6:1,Vl=t,q===null&&(Kl=1,$s(e,bi(t,e.current)))}function Eu(){var e=ro.current;return e===null?!0:(J&4194048)===J?io===null:(J&62914560)===J||J&536870912?e===io:!1}function Du(){var e=k.H;return k.H=Vs,e===null?Vs:e}function Ou(){var e=k.A;return k.A=Ll,e}function ku(){Kl=4,Hl||(J&4194048)!==J&&ro.current!==null||(Ul=!0),!(ql&134217727)&&!(Jl&134217727)||zl===null||xu(zl,J,Xl,!1)}function Au(e,t,n){var r=K;K|=2;var i=Du(),a=Ou();(zl!==e||J!==t)&&(iu=null,wu(e,t)),t=!1;var o=Kl;a:do try{if(Bl!==0&&q!==null){var s=q,c=Vl;switch(Bl){case 8:Cu(),o=6;break a;case 3:case 2:case 9:case 6:ro.current===null&&(t=!0);var l=Bl;if(Bl=0,Vl=null,Iu(e,s,c,l),n&&Ul){o=0;break a}break;default:l=Bl,Bl=0,Vl=null,Iu(e,s,c,l)}}ju(),o=Kl;break}catch(t){Tu(e,t)}while(1);return t&&e.shellSuspendCounter++,qi=Ki=null,K=r,k.H=i,k.A=a,q===null&&(zl=null,J=0,ni()),o}function ju(){for(;q!==null;)Pu(q)}function Mu(e,t){var n=K;K|=2;var r=Du(),a=Ou();zl!==e||J!==t?(iu=null,ru=Me()+500,wu(e,t)):Ul=Qe(e,t);a:do try{if(Bl!==0&&q!==null){t=q;var o=Vl;b:switch(Bl){case 1:Bl=0,Vl=null,Iu(e,t,o,1);break;case 2:case 9:if(Ea(o)){Bl=0,Vl=null,Fu(t);break}t=function(){Bl!==2&&Bl!==9||zl!==e||(Bl=7),rd(e)},o.then(t,t);break a;case 3:Bl=7;break a;case 4:Bl=5;break a;case 7:Ea(o)?(Bl=0,Vl=null,Fu(t)):(Bl=0,Vl=null,Iu(e,t,o,7));break;case 5:var s=null;switch(q.tag){case 26:s=q.memoizedState;case 5:case 27:var c=q;if(s?Wf(s):c.stateNode.complete){Bl=0,Vl=null;var l=c.sibling;if(l!==null)q=l;else{var u=c.return;u===null?q=null:(q=u,Lu(u))}break b}}Bl=0,Vl=null,Iu(e,t,o,5);break;case 6:Bl=0,Vl=null,Iu(e,t,o,6);break;case 8:Cu(),Kl=6;break a;default:throw Error(i(462))}}Nu();break}catch(t){Tu(e,t)}while(1);return qi=Ki=null,k.H=r,k.A=a,K=n,q===null?(zl=null,J=0,ni(),Kl):0}function Nu(){for(;q!==null&&!Ae();)Pu(q)}function Pu(e){var t=Fc(e.alternate,e,Gl);e.memoizedProps=e.pendingProps,t===null?Lu(e):q=t}function Fu(e){var t=e,n=t.alternate;switch(t.tag){case 15:case 0:t=yc(n,t,t.pendingProps,t.type,void 0,J);break;case 11:t=yc(n,t,t.pendingProps,t.type.render,t.ref,J);break;case 5:jo(t);default:Wc(n,t),t=q=pi(t,Gl),t=Fc(n,t,Gl)}e.memoizedProps=e.pendingProps,t===null?Lu(e):q=t}function Iu(e,t,n,r){qi=Ki=null,jo(t),Ma=null,Na=0;var i=t.return;try{if(ic(e,i,t,n,J)){Kl=1,$s(e,bi(n,e.current)),q=null;return}}catch(t){if(i!==null)throw q=i,t;Kl=1,$s(e,bi(n,e.current)),q=null;return}t.flags&32768?(z||r===1?e=!0:Ul||J&536870912?e=!1:(Hl=e=!0,(r===2||r===9||r===3||r===6)&&(r=ro.current,r!==null&&r.tag===13&&(r.flags|=16384))),Ru(t,e)):Lu(t)}function Lu(e){var t=e;do{if(t.flags&32768){Ru(t,Hl);return}e=t.return;var n=Hc(t.alternate,t,Gl);if(n!==null){q=n;return}if(t=t.sibling,t!==null){q=t;return}q=t=e}while(t!==null);Kl===0&&(Kl=5)}function Ru(e,t){do{var n=Uc(e.alternate,e);if(n!==null){n.flags&=32767,q=n;return}if(n=e.return,n!==null&&(n.flags|=32768,n.subtreeFlags=0,n.deletions=null),!t&&(e=e.sibling,e!==null)){q=e;return}q=e=n}while(e!==null);Kl=6,q=null}function zu(e,t,n,r,a,o,s,c,l){e.cancelPendingCommit=null;do Uu();while(ou!==0);if(K&6)throw Error(i(327));if(t!==null){if(t===e.current)throw Error(i(177));if(o=t.lanes|t.childLanes,o|=ti,nt(e,n,o,s,c,l),e===zl&&(q=zl=null,J=0),cu=t,su=e,lu=n,uu=o,du=a,fu=r,t.subtreeFlags&10256||t.flags&10256?(e.callbackNode=null,e.callbackPriority=0,Zu(M,function(){return Wu(),null})):(e.callbackNode=null,e.callbackPriority=0),r=!!(t.flags&13878),t.subtreeFlags&13878||r){r=k.T,k.T=null,a=A.p,A.p=2,s=K,K|=4;try{cl(e,t,n)}finally{K=s,A.p=a,k.T=r}}ou=1,Bu(),Y(),Vu()}}function Bu(){if(ou===1){ou=0;var e=su,t=cu,n=!!(t.flags&13878);if(t.subtreeFlags&13878||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=K;K|=4;try{_l(t,e);var a=Bd,o=jr(e.containerInfo),s=a.focusedElem,c=a.selectionRange;if(o!==s&&s&&s.ownerDocument&&Ar(s.ownerDocument.documentElement,s)){if(c!==null&&Mr(s)){var l=c.start,u=c.end;if(u===void 0&&(u=l),`selectionStart`in s)s.selectionStart=l,s.selectionEnd=Math.min(u,s.value.length);else{var d=s.ownerDocument||document,f=d&&d.defaultView||window;if(f.getSelection){var p=f.getSelection(),m=s.textContent.length,h=Math.min(c.start,m),g=c.end===void 0?h:Math.min(c.end,m);!p.extend&&h>g&&(o=g,g=h,h=o);var _=kr(s,h),v=kr(s,g);if(_&&v&&(p.rangeCount!==1||p.anchorNode!==_.node||p.anchorOffset!==_.offset||p.focusNode!==v.node||p.focusOffset!==v.offset)){var y=d.createRange();y.setStart(_.node,_.offset),p.removeAllRanges(),h>g?(p.addRange(y),p.extend(v.node,v.offset)):(y.setEnd(v.node,v.offset),p.addRange(y))}}}}for(d=[],p=s;p=p.parentNode;)p.nodeType===1&&d.push({element:p,left:p.scrollLeft,top:p.scrollTop});for(typeof s.focus==`function`&&s.focus(),s=0;s<d.length;s++){var b=d[s];b.element.scrollLeft=b.left,b.element.scrollTop=b.top}}sp=!!zd,Bd=zd=null}finally{K=i,A.p=r,k.T=n}}e.current=t,ou=2}}function Y(){if(ou===2){ou=0;var e=su,t=cu,n=!!(t.flags&8772);if(t.subtreeFlags&8772||n){n=k.T,k.T=null;var r=A.p;A.p=2;var i=K;K|=4;try{ll(e,t.alternate,t)}finally{K=i,A.p=r,k.T=n}}ou=3}}function Vu(){if(ou===4||ou===3){ou=0,je();var e=su,t=cu,n=lu,r=fu;t.subtreeFlags&10256||t.flags&10256?ou=5:(ou=0,cu=su=null,Hu(e,e.pendingLanes));var i=e.pendingLanes;if(i===0&&(au=null),st(n),t=t.stateNode,Ve&&typeof Ve.onCommitFiberRoot==`function`)try{Ve.onCommitFiberRoot(Be,t,void 0,(t.current.flags&128)==128)}catch{}if(r!==null){t=k.T,i=A.p,A.p=2,k.T=null;try{for(var a=e.onRecoverableError,o=0;o<r.length;o++){var s=r[o];a(s.value,{componentStack:s.stack})}}finally{k.T=t,A.p=i}}lu&3&&Uu(),rd(e),i=e.pendingLanes,n&261930&&i&42?e===mu?pu++:(pu=0,mu=e):pu=0,id(0,!1)}}function Hu(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,la(t)))}function Uu(){return Bu(),Y(),Vu(),Wu()}function Wu(){if(ou!==5)return!1;var e=su,t=uu;uu=0;var n=st(lu),r=k.T,a=A.p;try{A.p=32>n?32:n,k.T=null,n=du,du=null;var o=su,s=lu;if(ou=0,cu=su=null,lu=0,K&6)throw Error(i(331));var c=K;if(K|=4,Pl(o.current),El(o,o.current,s,n),K=c,id(0,!1),Ve&&typeof Ve.onPostCommitFiberRoot==`function`)try{Ve.onPostCommitFiberRoot(Be,o)}catch{}return!0}finally{A.p=a,k.T=r,Hu(e,t)}}function Gu(e,t,n){t=bi(n,t),t=tc(e.stateNode,t,2),e=Wa(e,t,2),e!==null&&(tt(e,2),rd(e))}function X(e,t,n){if(e.tag===3)Gu(e,e,n);else for(;t!==null;){if(t.tag===3){Gu(t,e,n);break}if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError==`function`||typeof r.componentDidCatch==`function`&&(au===null||!au.has(r))){e=bi(n,e),n=nc(2),r=Wa(t,n,2),r!==null&&(rc(n,r,t,e),tt(r,2),rd(r));break}}t=t.return}}function Ku(e,t,n){var r=e.pingCache;if(r===null){r=e.pingCache=new Rl;var i=new Set;r.set(t,i)}else i=r.get(t),i===void 0&&(i=new Set,r.set(t,i));i.has(n)||(Wl=!0,i.add(n),e=qu.bind(null,e,t,n),t.then(e,e))}function qu(e,t,n){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&n,e.warmLanes&=~n,zl===e&&(J&n)===n&&(Kl===4||Kl===3&&(J&62914560)===J&&300>Me()-tu?!(K&2)&&wu(e,0):Yl|=n,Zl===J&&(Zl=0)),rd(e)}function Ju(e,t){t===0&&(t=et()),e=ai(e,t),e!==null&&(tt(e,t),rd(e))}function Yu(e){var t=e.memoizedState,n=0;t!==null&&(n=t.retryLane),Ju(e,n)}function Xu(e,t){var n=0;switch(e.tag){case 31:case 13:var r=e.stateNode,a=e.memoizedState;a!==null&&(n=a.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(i(314))}r!==null&&r.delete(t),Ju(e,n)}function Zu(e,t){return Oe(e,t)}var Qu=null,$u=null,ed=!1,td=!1,nd=!1,Z=0;function rd(e){e!==$u&&e.next===null&&($u===null?Qu=$u=e:$u=$u.next=e),td=!0,ed||(ed=!0,ud())}function id(e,t){if(!nd&&td){nd=!0;do for(var n=!1,r=Qu;r!==null;){if(!t){if(e!==0){var i=r.pendingLanes;if(i===0)var a=0;else{var o=r.suspendedLanes,s=r.pingedLanes;a=(1<<31-Ue(42|e)+1)-1,a&=i&~(o&~s),a=a&201326741?a&201326741|1:a?a|2:0}a!==0&&(n=!0,ld(r,a))}else a=J,a=Ze(r,r===zl?a:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),!(a&3)||Qe(r,a)||(n=!0,ld(r,a))}r=r.next}while(n);nd=!1}}function ad(){od()}function od(){td=ed=!1;var e=0;Z!==0&&Kd()&&(e=Z);for(var t=Me(),n=null,r=Qu;r!==null;){var i=r.next,a=sd(r,t);a===0?(r.next=null,n===null?Qu=i:n.next=i,i===null&&($u=n)):(n=r,(e!==0||a&3)&&(td=!0)),r=i}ou!==0&&ou!==5||id(e,!1),Z!==0&&(Z=0)}function sd(e,t){for(var n=e.suspendedLanes,r=e.pingedLanes,i=e.expirationTimes,a=e.pendingLanes&-62914561;0<a;){var o=31-Ue(a),s=1<<o,c=i[o];c===-1?((s&n)===0||(s&r)!==0)&&(i[o]=$e(s,t)):c<=t&&(e.expiredLanes|=s),a&=~s}if(t=zl,n=J,n=Ze(e,e===t?n:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,n===0||e===t&&(Bl===2||Bl===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&ke(r),e.callbackNode=null,e.callbackPriority=0;if(!(n&3)||Qe(e,n)){if(t=n&-n,t===e.callbackPriority)return t;switch(r!==null&&ke(r),st(n)){case 2:case 8:n=Fe;break;case 32:n=M;break;case 268435456:n=Le;break;default:n=M}return r=cd.bind(null,e),n=Oe(n,r),e.callbackPriority=t,e.callbackNode=n,t}return r!==null&&r!==null&&ke(r),e.callbackPriority=2,e.callbackNode=null,2}function cd(e,t){if(ou!==0&&ou!==5)return e.callbackNode=null,e.callbackPriority=0,null;var n=e.callbackNode;if(Uu()&&e.callbackNode!==n)return null;var r=J;return r=Ze(e,e===zl?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(vu(e,r,t),sd(e,Me()),e.callbackNode!=null&&e.callbackNode===n?cd.bind(null,e):null)}function ld(e,t){if(Uu())return null;vu(e,t,!0)}function ud(){Xd(function(){K&6?Oe(Pe,ad):od()})}function dd(){if(Z===0){var e=fa;e===0&&(e=qe,qe<<=1,!(qe&261888)&&(qe=256)),Z=e}return Z}function fd(e){return e==null||typeof e==`symbol`||typeof e==`boolean`?null:typeof e==`function`?e:nn(``+e)}function pd(e,t){var n=t.ownerDocument.createElement(`input`);return n.name=t.name,n.value=t.value,e.id&&n.setAttribute(`form`,e.id),t.parentNode.insertBefore(n,t),e=new FormData(e),n.parentNode.removeChild(n),e}function md(e,t,n,r,i){if(t===`submit`&&n&&n.stateNode===i){var a=fd((i[ft]||null).action),o=r.submitter;o&&(t=(t=o[ft]||null)?fd(t.formAction):o.getAttribute(`formAction`),t!==null&&(a=t,o=null));var s=new Tn(`action`,`action`,null,r,i);e.push({event:s,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(Z!==0){var e=o?pd(i,o):new FormData(i);Ds(n,{pending:!0,data:e,method:i.method,action:a},null,e)}}else typeof a==`function`&&(s.preventDefault(),e=o?pd(i,o):new FormData(i),Ds(n,{pending:!0,data:e,method:i.method,action:a},a,e))},currentTarget:i}]})}}for(var hd=0;hd<Xr.length;hd++){var gd=Xr[hd];Zr(gd.toLowerCase(),`on`+(gd[0].toUpperCase()+gd.slice(1)))}Zr(Ur,`onAnimationEnd`),Zr(Wr,`onAnimationIteration`),Zr(Gr,`onAnimationStart`),Zr(`dblclick`,`onDoubleClick`),Zr(`focusin`,`onFocus`),Zr(`focusout`,`onBlur`),Zr(Kr,`onTransitionRun`),Zr(qr,`onTransitionStart`),Zr(Jr,`onTransitionCancel`),Zr(Yr,`onTransitionEnd`),Dt(`onMouseEnter`,[`mouseout`,`mouseover`]),Dt(`onMouseLeave`,[`mouseout`,`mouseover`]),Dt(`onPointerEnter`,[`pointerout`,`pointerover`]),Dt(`onPointerLeave`,[`pointerout`,`pointerover`]),Et(`onChange`,`change click focusin focusout input keydown keyup selectionchange`.split(` `)),Et(`onSelect`,`focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange`.split(` `)),Et(`onBeforeInput`,[`compositionend`,`keypress`,`textInput`,`paste`]),Et(`onCompositionEnd`,`compositionend focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionStart`,`compositionstart focusout keydown keypress keyup mousedown`.split(` `)),Et(`onCompositionUpdate`,`compositionupdate focusout keydown keypress keyup mousedown`.split(` `));var _d=`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(` `),vd=new Set(`beforetoggle cancel close invalid load scroll scrollend toggle`.split(` `).concat(_d));function yd(e,t){t=!!(t&4);for(var n=0;n<e.length;n++){var r=e[n],i=r.event;r=r.listeners;a:{var a=void 0;if(t)for(var o=r.length-1;0<=o;o--){var s=r[o],c=s.instance,l=s.currentTarget;if(s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Qr(e)}i.currentTarget=null,a=c}else for(o=0;o<r.length;o++){if(s=r[o],c=s.instance,l=s.currentTarget,s=s.listener,c!==a&&i.isPropagationStopped())break a;a=s,i.currentTarget=l;try{a(i)}catch(e){Qr(e)}i.currentTarget=null,a=c}}}}function Q(e,t){var n=t[mt];n===void 0&&(n=t[mt]=new Set);var r=e+`__bubble`;n.has(r)||(Cd(t,e,2,!1),n.add(r))}function bd(e,t,n){var r=0;t&&(r|=4),Cd(n,e,r,t)}var xd=`_reactListening`+Math.random().toString(36).slice(2);function Sd(e){if(!e[xd]){e[xd]=!0,wt.forEach(function(t){t!==`selectionchange`&&(vd.has(t)||bd(t,!1,e),bd(t,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[xd]||(t[xd]=!0,bd(`selectionchange`,!1,t))}}function Cd(e,t,n,r){switch(mp(t)){case 2:var i=cp;break;case 8:i=lp;break;default:i=up}n=i.bind(null,t,n,e),i=void 0,!mn||t!==`touchstart`&&t!==`touchmove`&&t!==`wheel`||(i=!0),r?i===void 0?e.addEventListener(t,n,!0):e.addEventListener(t,n,{capture:!0,passive:i}):i===void 0?e.addEventListener(t,n,!1):e.addEventListener(t,n,{passive:i})}function wd(e,t,n,r,i){var a=r;if(!(t&1)&&!(t&2)&&r!==null)a:for(;;){if(r===null)return;var s=r.tag;if(s===3||s===4){var c=r.stateNode.containerInfo;if(c===i)break;if(s===4)for(s=r.return;s!==null;){var l=s.tag;if((l===3||l===4)&&s.stateNode.containerInfo===i)return;s=s.return}for(;c!==null;){if(s=yt(c),s===null)return;if(l=s.tag,l===5||l===6||l===26||l===27){r=a=s;continue a}c=c.parentNode}}r=r.return}dn(function(){var r=a,i=on(n),s=[];a:{var c=I.get(e);if(c!==void 0){var l=Tn,u=e;switch(e){case`keypress`:if(bn(n)===0)break a;case`keydown`:case`keyup`:l=Un;break;case`focusin`:u=`focus`,l=Pn;break;case`focusout`:u=`blur`,l=Pn;break;case`beforeblur`:case`afterblur`:l=Pn;break;case`click`:if(n.button===2)break a;case`auxclick`:case`dblclick`:case`mousedown`:case`mousemove`:case`mouseup`:case`mouseout`:case`mouseover`:case`contextmenu`:l=Mn;break;case`drag`:case`dragend`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`dragstart`:case`drop`:l=Nn;break;case`touchcancel`:case`touchend`:case`touchmove`:case`touchstart`:l=Gn;break;case Ur:case Wr:case Gr:l=Fn;break;case Yr:l=Kn;break;case`scroll`:case`scrollend`:l=Dn;break;case`wheel`:l=qn;break;case`copy`:case`cut`:case`paste`:l=In;break;case`gotpointercapture`:case`lostpointercapture`:case`pointercancel`:case`pointerdown`:case`pointermove`:case`pointerout`:case`pointerover`:case`pointerup`:l=Wn;break;case`toggle`:case`beforetoggle`:l=Jn}var d=!!(t&4),f=!d&&(e===`scroll`||e===`scrollend`),p=d?c===null?null:c+`Capture`:c;d=[];for(var m=r,h;m!==null;){var g=m;if(h=g.stateNode,g=g.tag,g!==5&&g!==26&&g!==27||h===null||p===null||(g=fn(m,p),g!=null&&d.push(Td(m,g,h))),f)break;m=m.return}0<d.length&&(c=new l(c,u,null,n,i),s.push({event:c,listeners:d}))}}if(!(t&7)){a:{if(c=e===`mouseover`||e===`pointerover`,l=e===`mouseout`||e===`pointerout`,c&&n!==an&&(u=n.relatedTarget||n.fromElement)&&(yt(u)||u[pt]))break a;if((l||c)&&(c=i.window===i?i:(c=i.ownerDocument)?c.defaultView||c.parentWindow:window,l?(u=n.relatedTarget||n.toElement,l=r,u=u?yt(u):null,u!==null&&(f=o(u),d=u.tag,u!==f||d!==5&&d!==27&&d!==6)&&(u=null)):(l=null,u=r),l!==u)){if(d=Mn,g=`onMouseLeave`,p=`onMouseEnter`,m=`mouse`,(e===`pointerout`||e===`pointerover`)&&(d=Wn,g=`onPointerLeave`,p=`onPointerEnter`,m=`pointer`),f=l==null?c:xt(l),h=u==null?c:xt(u),c=new d(g,m+`leave`,l,n,i),c.target=f,c.relatedTarget=h,g=null,yt(i)===r&&(d=new d(p,m+`enter`,u,n,i),d.target=h,d.relatedTarget=f,g=d),f=g,l&&u)b:{for(d=Dd,p=l,m=u,h=0,g=p;g;g=d(g))h++;g=0;for(var _=m;_;_=d(_))g++;for(;0<h-g;)p=d(p),h--;for(;0<g-h;)m=d(m),g--;for(;h--;){if(p===m||m!==null&&p===m.alternate){d=p;break b}p=d(p),m=d(m)}d=null}else d=null;l!==null&&Od(s,c,l,d,!1),u!==null&&f!==null&&Od(s,f,u,d,!0)}}a:{if(c=r?xt(r):window,l=c.nodeName&&c.nodeName.toLowerCase(),l===`select`||l===`input`&&c.type===`file`)var v=mr;else if(cr(c)){if(hr)v=wr;else{v=Sr;var y=xr}}else l=c.nodeName,!l||l.toLowerCase()!==`input`||c.type!==`checkbox`&&c.type!==`radio`?r&&$t(r.elementType)&&(v=mr):v=Cr;if(v&&=v(e,r)){lr(s,v,n,i);break a}y&&y(e,c,r),e===`focusout`&&r&&c.type===`number`&&r.memoizedProps.value!=null&&Gt(c,`number`,c.value)}switch(y=r?xt(r):window,e){case`focusin`:(cr(y)||y.contentEditable===`true`)&&(Pr=y,Fr=r,Ir=null);break;case`focusout`:Ir=Fr=Pr=null;break;case`mousedown`:Lr=!0;break;case`contextmenu`:case`mouseup`:case`dragend`:Lr=!1,F(s,n,i);break;case`selectionchange`:if(Nr)break;case`keydown`:case`keyup`:F(s,n,i)}var b;if(Xn)b:{switch(e){case`compositionstart`:var x=`onCompositionStart`;break b;case`compositionend`:x=`onCompositionEnd`;break b;case`compositionupdate`:x=`onCompositionUpdate`;break b}x=void 0}else ir?nr(e,n)&&(x=`onCompositionEnd`):e===`keydown`&&n.keyCode===229&&(x=`onCompositionStart`);x&&($n&&n.locale!==`ko`&&(ir||x!==`onCompositionStart`?x===`onCompositionEnd`&&ir&&(b=yn()):(gn=i,_n=`value`in gn?gn.value:gn.textContent,ir=!0)),y=Ed(r,x),0<y.length&&(x=new Ln(x,e,null,n,i),s.push({event:x,listeners:y}),b?x.data=b:(b=rr(n),b!==null&&(x.data=b)))),(b=Qn?ar(e,n):or(e,n))&&(x=Ed(r,`onBeforeInput`),0<x.length&&(y=new Ln(`onBeforeInput`,`beforeinput`,null,n,i),s.push({event:y,listeners:x}),y.data=b)),md(s,e,r,n,i)}yd(s,t)})}function Td(e,t,n){return{instance:e,listener:t,currentTarget:n}}function Ed(e,t){for(var n=t+`Capture`,r=[];e!==null;){var i=e,a=i.stateNode;if(i=i.tag,i!==5&&i!==26&&i!==27||a===null||(i=fn(e,n),i!=null&&r.unshift(Td(e,i,a)),i=fn(e,t),i!=null&&r.push(Td(e,i,a))),e.tag===3)return r;e=e.return}return[]}function Dd(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function Od(e,t,n,r,i){for(var a=t._reactName,o=[];n!==null&&n!==r;){var s=n,c=s.alternate,l=s.stateNode;if(s=s.tag,c!==null&&c===r)break;s!==5&&s!==26&&s!==27||l===null||(c=l,i?(l=fn(n,a),l!=null&&o.unshift(Td(n,l,c))):i||(l=fn(n,a),l!=null&&o.push(Td(n,l,c)))),n=n.return}o.length!==0&&e.push({event:t,listeners:o})}var kd=/\r\n?/g,Ad=/\u0000|\uFFFD/g;function jd(e){return(typeof e==`string`?e:``+e).replace(kd,`
`).replace(Ad,``)}function Md(e,t){return t=jd(t),jd(e)===t}function Nd(e,t,n,r,a,o){switch(n){case`children`:typeof r==`string`?t===`body`||t===`textarea`&&r===``||Yt(e,r):(typeof r==`number`||typeof r==`bigint`)&&t!==`body`&&Yt(e,``+r);break;case`className`:Nt(e,`class`,r);break;case`tabIndex`:Nt(e,`tabindex`,r);break;case`dir`:case`role`:case`viewBox`:case`width`:case`height`:Nt(e,n,r);break;case`style`:Qt(e,r,o);break;case`data`:if(t!==`object`){Nt(e,`data`,r);break}case`src`:case`href`:if(r===``&&(t!==`a`||n!==`href`)){e.removeAttribute(n);break}if(r==null||typeof r==`function`||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=nn(``+r),e.setAttribute(n,r);break;case`action`:case`formAction`:if(typeof r==`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}if(typeof o==`function`&&(n===`formAction`?(t!==`input`&&Nd(e,t,`name`,a.name,a,null),Nd(e,t,`formEncType`,a.formEncType,a,null),Nd(e,t,`formMethod`,a.formMethod,a,null),Nd(e,t,`formTarget`,a.formTarget,a,null)):(Nd(e,t,`encType`,a.encType,a,null),Nd(e,t,`method`,a.method,a,null),Nd(e,t,`target`,a.target,a,null))),r==null||typeof r==`symbol`||typeof r==`boolean`){e.removeAttribute(n);break}r=nn(``+r),e.setAttribute(n,r);break;case`onClick`:r!=null&&(e.onclick=rn);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`multiple`:e.multiple=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`muted`:e.muted=r&&typeof r!=`function`&&typeof r!=`symbol`;break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`defaultValue`:case`defaultChecked`:case`innerHTML`:case`ref`:break;case`autoFocus`:break;case`xlinkHref`:if(r==null||typeof r==`function`||typeof r==`boolean`||typeof r==`symbol`){e.removeAttribute(`xlink:href`);break}n=nn(``+r),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`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``+r):e.removeAttribute(n);break;case`inert`:case`allowFullScreen`:case`async`:case`autoPlay`:case`controls`:case`default`:case`defer`:case`disabled`:case`disablePictureInPicture`:case`disableRemotePlayback`:case`formNoValidate`:case`hidden`:case`loop`:case`noModule`:case`noValidate`:case`open`:case`playsInline`:case`readOnly`:case`required`:case`reversed`:case`scoped`:case`seamless`:case`itemScope`:r&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,``):e.removeAttribute(n);break;case`capture`:case`download`:!0===r?e.setAttribute(n,``):!1!==r&&r!=null&&typeof r!=`function`&&typeof r!=`symbol`?e.setAttribute(n,r):e.removeAttribute(n);break;case`cols`:case`rows`:case`size`:case`span`:r!=null&&typeof r!=`function`&&typeof r!=`symbol`&&!isNaN(r)&&1<=r?e.setAttribute(n,r):e.removeAttribute(n);break;case`rowSpan`:case`start`:r==null||typeof r==`function`||typeof r==`symbol`||isNaN(r)?e.removeAttribute(n):e.setAttribute(n,r);break;case`popover`:Q(`beforetoggle`,e),Q(`toggle`,e),Mt(e,`popover`,r);break;case`xlinkActuate`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:actuate`,r);break;case`xlinkArcrole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:arcrole`,r);break;case`xlinkRole`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:role`,r);break;case`xlinkShow`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:show`,r);break;case`xlinkTitle`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:title`,r);break;case`xlinkType`:Pt(e,`http://www.w3.org/1999/xlink`,`xlink:type`,r);break;case`xmlBase`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:base`,r);break;case`xmlLang`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:lang`,r);break;case`xmlSpace`:Pt(e,`http://www.w3.org/XML/1998/namespace`,`xml:space`,r);break;case`is`:Mt(e,`is`,r);break;case`innerText`:case`textContent`:break;default:(!(2<n.length)||n[0]!==`o`&&n[0]!==`O`||n[1]!==`n`&&n[1]!==`N`)&&(n=en.get(n)||n,Mt(e,n,r))}}function Pd(e,t,n,r,a,o){switch(n){case`style`:Qt(e,r,o);break;case`dangerouslySetInnerHTML`:if(r!=null){if(typeof r!=`object`||!(`__html`in r))throw Error(i(61));if(n=r.__html,n!=null){if(a.children!=null)throw Error(i(60));e.innerHTML=n}}break;case`children`:typeof r==`string`?Yt(e,r):(typeof r==`number`||typeof r==`bigint`)&&Yt(e,``+r);break;case`onScroll`:r!=null&&Q(`scroll`,e);break;case`onScrollEnd`:r!=null&&Q(`scrollend`,e);break;case`onClick`:r!=null&&(e.onclick=rn);break;case`suppressContentEditableWarning`:case`suppressHydrationWarning`:case`innerHTML`:case`ref`:break;case`innerText`:case`textContent`:break;default:if(!Tt.hasOwnProperty(n))a:{if(n[0]===`o`&&n[1]===`n`&&(a=n.endsWith(`Capture`),t=n.slice(2,a?n.length-7:void 0),o=e[ft]||null,o=o==null?null:o[n],typeof o==`function`&&e.removeEventListener(t,o,a),typeof r==`function`)){typeof o!=`function`&&o!==null&&(n in e?e[n]=null:e.hasAttribute(n)&&e.removeAttribute(n)),e.addEventListener(t,r,a);break a}n in e?e[n]=r:!0===r?e.setAttribute(n,``):Mt(e,n,r)}}}function Fd(e,t,n){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`img`:Q(`error`,e),Q(`load`,e);var r=!1,a=!1,o;for(o in n)if(n.hasOwnProperty(o)){var s=n[o];if(s!=null)switch(o){case`src`:r=!0;break;case`srcSet`:a=!0;break;case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,o,s,n,null)}}a&&Nd(e,t,`srcSet`,n.srcSet,n,null),r&&Nd(e,t,`src`,n.src,n,null);return;case`input`:Q(`invalid`,e);var c=o=s=a=null,l=null,u=null;for(r in n)if(n.hasOwnProperty(r)){var d=n[r];if(d!=null)switch(r){case`name`:a=d;break;case`type`:s=d;break;case`checked`:l=d;break;case`defaultChecked`:u=d;break;case`value`:o=d;break;case`defaultValue`:c=d;break;case`children`:case`dangerouslySetInnerHTML`:if(d!=null)throw Error(i(137,t));break;default:Nd(e,t,r,d,n,null)}}Wt(e,o,c,l,u,s,a,!1);return;case`select`:for(a in Q(`invalid`,e),r=s=o=null,n)if(n.hasOwnProperty(a)&&(c=n[a],c!=null))switch(a){case`value`:o=c;break;case`defaultValue`:s=c;break;case`multiple`:r=c;default:Nd(e,t,a,c,n,null)}t=o,n=s,e.multiple=!!r,t==null?n!=null&&Kt(e,!!r,n,!0):Kt(e,!!r,t,!1);return;case`textarea`:for(s in Q(`invalid`,e),o=a=r=null,n)if(n.hasOwnProperty(s)&&(c=n[s],c!=null))switch(s){case`value`:r=c;break;case`defaultValue`:a=c;break;case`children`:o=c;break;case`dangerouslySetInnerHTML`:if(c!=null)throw Error(i(91));break;default:Nd(e,t,s,c,n,null)}Jt(e,r,a,o);return;case`option`:for(l in n)if(n.hasOwnProperty(l)&&(r=n[l],r!=null))switch(l){case`selected`:e.selected=r&&typeof r!=`function`&&typeof r!=`symbol`;break;default:Nd(e,t,l,r,n,null)}return;case`dialog`:Q(`beforetoggle`,e),Q(`toggle`,e),Q(`cancel`,e),Q(`close`,e);break;case`iframe`:case`object`:Q(`load`,e);break;case`video`:case`audio`:for(r=0;r<_d.length;r++)Q(_d[r],e);break;case`image`:Q(`error`,e),Q(`load`,e);break;case`details`:Q(`toggle`,e);break;case`embed`:case`source`:case`link`:Q(`error`,e),Q(`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(u in n)if(n.hasOwnProperty(u)&&(r=n[u],r!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:throw Error(i(137,t));default:Nd(e,t,u,r,n,null)}return;default:if($t(t)){for(d in n)n.hasOwnProperty(d)&&(r=n[d],r!==void 0&&Pd(e,t,d,r,n,void 0));return}}for(c in n)n.hasOwnProperty(c)&&(r=n[c],r!=null&&Nd(e,t,c,r,n,null))}function Id(e,t,n,r){switch(t){case`div`:case`span`:case`svg`:case`path`:case`a`:case`g`:case`p`:case`li`:break;case`input`:var a=null,o=null,s=null,c=null,l=null,u=null,d=null;for(m in n){var f=n[m];if(n.hasOwnProperty(m)&&f!=null)switch(m){case`checked`:break;case`value`:break;case`defaultValue`:l=f;default:r.hasOwnProperty(m)||Nd(e,t,m,null,r,f)}}for(var p in r){var m=r[p];if(f=n[p],r.hasOwnProperty(p)&&(m!=null||f!=null))switch(p){case`type`:o=m;break;case`name`:a=m;break;case`checked`:u=m;break;case`defaultChecked`:d=m;break;case`value`:s=m;break;case`defaultValue`:c=m;break;case`children`:case`dangerouslySetInnerHTML`:if(m!=null)throw Error(i(137,t));break;default:m!==f&&Nd(e,t,p,m,r,f)}}Ut(e,s,c,l,u,d,o,a);return;case`select`:for(o in m=s=c=p=null,n)if(l=n[o],n.hasOwnProperty(o)&&l!=null)switch(o){case`value`:break;case`multiple`:m=l;default:r.hasOwnProperty(o)||Nd(e,t,o,null,r,l)}for(a in r)if(o=r[a],l=n[a],r.hasOwnProperty(a)&&(o!=null||l!=null))switch(a){case`value`:p=o;break;case`defaultValue`:c=o;break;case`multiple`:s=o;default:o!==l&&Nd(e,t,a,o,r,l)}t=c,n=s,r=m,p==null?!!r!=!!n&&(t==null?Kt(e,!!n,n?[]:``,!1):Kt(e,!!n,t,!0)):Kt(e,!!n,p,!1);return;case`textarea`:for(c in m=p=null,n)if(a=n[c],n.hasOwnProperty(c)&&a!=null&&!r.hasOwnProperty(c))switch(c){case`value`:break;case`children`:break;default:Nd(e,t,c,null,r,a)}for(s in r)if(a=r[s],o=n[s],r.hasOwnProperty(s)&&(a!=null||o!=null))switch(s){case`value`:p=a;break;case`defaultValue`:m=a;break;case`children`:break;case`dangerouslySetInnerHTML`:if(a!=null)throw Error(i(91));break;default:a!==o&&Nd(e,t,s,a,r,o)}qt(e,p,m);return;case`option`:for(var h in n)if(p=n[h],n.hasOwnProperty(h)&&p!=null&&!r.hasOwnProperty(h))switch(h){case`selected`:e.selected=!1;break;default:Nd(e,t,h,null,r,p)}for(l in r)if(p=r[l],m=n[l],r.hasOwnProperty(l)&&p!==m&&(p!=null||m!=null))switch(l){case`selected`:e.selected=p&&typeof p!=`function`&&typeof p!=`symbol`;break;default:Nd(e,t,l,p,r,m)}return;case`img`:case`link`:case`area`:case`base`:case`br`:case`col`:case`embed`:case`hr`:case`keygen`:case`meta`:case`param`:case`source`:case`track`:case`wbr`:case`menuitem`:for(var g in n)p=n[g],n.hasOwnProperty(g)&&p!=null&&!r.hasOwnProperty(g)&&Nd(e,t,g,null,r,p);for(u in r)if(p=r[u],m=n[u],r.hasOwnProperty(u)&&p!==m&&(p!=null||m!=null))switch(u){case`children`:case`dangerouslySetInnerHTML`:if(p!=null)throw Error(i(137,t));break;default:Nd(e,t,u,p,r,m)}return;default:if($t(t)){for(var _ in n)p=n[_],n.hasOwnProperty(_)&&p!==void 0&&!r.hasOwnProperty(_)&&Pd(e,t,_,void 0,r,p);for(d in r)p=r[d],m=n[d],!r.hasOwnProperty(d)||p===m||p===void 0&&m===void 0||Pd(e,t,d,p,r,m);return}}for(var v in n)p=n[v],n.hasOwnProperty(v)&&p!=null&&!r.hasOwnProperty(v)&&Nd(e,t,v,null,r,p);for(f in r)p=r[f],m=n[f],!r.hasOwnProperty(f)||p===m||p==null&&m==null||Nd(e,t,f,p,r,m)}function Ld(e){switch(e){case`css`:case`script`:case`font`:case`img`:case`image`:case`input`:case`link`:return!0;default:return!1}}function Rd(){if(typeof performance.getEntriesByType==`function`){for(var e=0,t=0,n=performance.getEntriesByType(`resource`),r=0;r<n.length;r++){var i=n[r],a=i.transferSize,o=i.initiatorType,s=i.duration;if(a&&s&&Ld(o)){for(o=0,s=i.responseEnd,r+=1;r<n.length;r++){var c=n[r],l=c.startTime;if(l>s)break;var u=c.transferSize,d=c.initiatorType;u&&Ld(d)&&(c=c.responseEnd,o+=u*(c<s?1:(s-l)/(c-l)))}if(--r,t+=8*(a+o)/(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 zd=null,Bd=null;function Vd(e){return e.nodeType===9?e:e.ownerDocument}function Hd(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 Ud(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 Wd(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 Gd=null;function Kd(){var e=window.event;return e&&e.type===`popstate`?e!==Gd&&(Gd=e,!0):(Gd=null,!1)}var qd=typeof setTimeout==`function`?setTimeout:void 0,Jd=typeof clearTimeout==`function`?clearTimeout:void 0,Yd=typeof Promise==`function`?Promise:void 0,Xd=typeof queueMicrotask==`function`?queueMicrotask:Yd===void 0?qd:function(e){return Yd.resolve(null).then(e).catch(Zd)};function Zd(e){setTimeout(function(){throw e})}function Qd(e){return e===`head`}function $d(e,t){var n=t,r=0;do{var i=n.nextSibling;if(e.removeChild(n),i&&i.nodeType===8){if(n=i.data,n===`/$`||n===`/&`){if(r===0){e.removeChild(i),Np(t);return}r--}else if(n===`$`||n===`$?`||n===`$~`||n===`$!`||n===`&`)r++;else if(n===`html`)mf(e.ownerDocument.documentElement);else if(n===`head`){n=e.ownerDocument.head,mf(n);for(var a=n.firstChild;a;){var o=a.nextSibling,s=a.nodeName;a[P]||s===`SCRIPT`||s===`STYLE`||s===`LINK`&&a.rel.toLowerCase()===`stylesheet`||n.removeChild(a),a=o}}else n===`body`&&mf(e.ownerDocument.body)}n=i}while(n);Np(t)}function ef(e,t){var n=e;e=0;do{var r=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||``),r&&r.nodeType===8){if(n=r.data,n===`/$`){if(e===0)break;e--}else n!==`$`&&n!==`$?`&&n!==`$~`&&n!==`$!`||e++}n=r}while(n)}function tf(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`:tf(n),vt(n);continue;case`SCRIPT`:case`STYLE`:continue;case`LINK`:if(n.rel.toLowerCase()===`stylesheet`)continue}e.removeChild(n)}}function nf(e,t,n,r){for(;e.nodeType===1;){var i=n;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!==`INPUT`||e.type!==`hidden`))break}else if(!r){if(t===`input`&&e.type===`hidden`){var a=i.name==null?null:``+i.name;if(i.type===`hidden`&&e.getAttribute(`name`)===a)return e}else return e}else if(!e[P])switch(t){case`meta`:if(!e.hasAttribute(`itemprop`))break;return e;case`link`:if(a=e.getAttribute(`rel`),a===`stylesheet`&&e.hasAttribute(`data-precedence`)||a!==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(a=e.getAttribute(`src`),(a!==(i.src==null?null:i.src)||e.getAttribute(`type`)!==(i.type==null?null:i.type)||e.getAttribute(`crossorigin`)!==(i.crossOrigin==null?null:i.crossOrigin))&&a&&e.hasAttribute(`async`)&&!e.hasAttribute(`itemprop`))break;return e;default:return e}if(e=lf(e.nextSibling),e===null)break}return null}function rf(e,t,n){if(t===``)return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!n||(e=lf(e.nextSibling),e===null))return null;return e}function af(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!==`INPUT`||e.type!==`hidden`)&&!t||(e=lf(e.nextSibling),e===null))return null;return e}function of(e){return e.data===`$?`||e.data===`$~`}function sf(e){return e.data===`$!`||e.data===`$?`&&e.ownerDocument.readyState!==`loading`}function cf(e,t){var n=e.ownerDocument;if(e.data===`$~`)e._reactRetry=t;else if(e.data!==`$?`||n.readyState!==`loading`)t();else{var r=function(){t(),n.removeEventListener(`DOMContentLoaded`,r)};n.addEventListener(`DOMContentLoaded`,r),e._reactRetry=r}}function lf(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 uf=null;function df(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var n=e.data;if(n===`/$`||n===`/&`){if(t===0)return lf(e.nextSibling);t--}else n!==`$`&&n!==`$!`&&n!==`$?`&&n!==`$~`&&n!==`&`||t++}e=e.nextSibling}return null}function ff(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 pf(e,t,n){switch(t=Vd(n),e){case`html`:if(e=t.documentElement,!e)throw Error(i(452));return e;case`head`:if(e=t.head,!e)throw Error(i(453));return e;case`body`:if(e=t.body,!e)throw Error(i(454));return e;default:throw Error(i(451))}}function mf(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);vt(e)}var hf=new Map,gf=new Set;function _f(e){return typeof e.getRootNode==`function`?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var $=A.d;A.d={f:vf,r:yf,D:Sf,C:Cf,L:wf,m:Tf,X:Df,S:Ef,M:Of};function vf(){var e=$.f(),t=Su();return e||t}function yf(e){var t=bt(e);t!==null&&t.tag===5&&t.type===`form`?ks(t):$.r(e)}var bf=typeof document>`u`?null:document;function xf(e,t,n){var r=bf;if(r&&typeof t==`string`&&t){var i=Ht(t);i=`link[rel="`+e+`"][href="`+i+`"]`,typeof n==`string`&&(i+=`[crossorigin="`+n+`"]`),gf.has(i)||(gf.add(i),e={rel:e,crossOrigin:n,href:t},r.querySelector(i)===null&&(t=r.createElement(`link`),Fd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Sf(e){$.D(e),xf(`dns-prefetch`,e,null)}function Cf(e,t){$.C(e,t),xf(`preconnect`,e,t)}function wf(e,t,n){$.L(e,t,n);var r=bf;if(r&&e&&t){var i=`link[rel="preload"][as="`+Ht(t)+`"]`;t===`image`&&n&&n.imageSrcSet?(i+=`[imagesrcset="`+Ht(n.imageSrcSet)+`"]`,typeof n.imageSizes==`string`&&(i+=`[imagesizes="`+Ht(n.imageSizes)+`"]`)):i+=`[href="`+Ht(e)+`"]`;var a=i;switch(t){case`style`:a=Af(e);break;case`script`:a=Pf(e)}hf.has(a)||(e=h({rel:`preload`,href:t===`image`&&n&&n.imageSrcSet?void 0:e,as:t},n),hf.set(a,e),r.querySelector(i)!==null||t===`style`&&r.querySelector(jf(a))||t===`script`&&r.querySelector(Ff(a))||(t=r.createElement(`link`),Fd(t,`link`,e),Ct(t),r.head.appendChild(t)))}}function Tf(e,t){$.m(e,t);var n=bf;if(n&&e){var r=t&&typeof t.as==`string`?t.as:`script`,i=`link[rel="modulepreload"][as="`+Ht(r)+`"][href="`+Ht(e)+`"]`,a=i;switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:a=Pf(e)}if(!hf.has(a)&&(e=h({rel:`modulepreload`,href:e},t),hf.set(a,e),n.querySelector(i)===null)){switch(r){case`audioworklet`:case`paintworklet`:case`serviceworker`:case`sharedworker`:case`worker`:case`script`:if(n.querySelector(Ff(a)))return}r=n.createElement(`link`),Fd(r,`link`,e),Ct(r),n.head.appendChild(r)}}}function Ef(e,t,n){$.S(e,t,n);var r=bf;if(r&&e){var i=St(r).hoistableStyles,a=Af(e);t||=`default`;var o=i.get(a);if(!o){var s={loading:0,preload:null};if(o=r.querySelector(jf(a)))s.loading=5;else{e=h({rel:`stylesheet`,href:e,"data-precedence":t},n),(n=hf.get(a))&&Rf(e,n);var c=o=r.createElement(`link`);Ct(c),Fd(c,`link`,e),c._p=new Promise(function(e,t){c.onload=e,c.onerror=t}),c.addEventListener(`load`,function(){s.loading|=1}),c.addEventListener(`error`,function(){s.loading|=2}),s.loading|=4,Lf(o,t,r)}o={type:`stylesheet`,instance:o,count:1,state:s},i.set(a,o)}}}function Df(e,t){$.X(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0},t),(t=hf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function Of(e,t){$.M(e,t);var n=bf;if(n&&e){var r=St(n).hoistableScripts,i=Pf(e),a=r.get(i);a||(a=n.querySelector(Ff(i)),a||(e=h({src:e,async:!0,type:`module`},t),(t=hf.get(i))&&zf(e,t),a=n.createElement(`script`),Ct(a),Fd(a,`link`,e),n.head.appendChild(a)),a={type:`script`,instance:a,count:1,state:null},r.set(i,a))}}function kf(e,t,n,r){var a=(a=me.current)?_f(a):null;if(!a)throw Error(i(446));switch(e){case`meta`:case`title`:return null;case`style`:return typeof n.precedence==`string`&&typeof n.href==`string`?(t=Af(n.href),n=St(a).hoistableStyles,r=n.get(t),r||(r={type:`style`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};case`link`:if(n.rel===`stylesheet`&&typeof n.href==`string`&&typeof n.precedence==`string`){e=Af(n.href);var o=St(a).hoistableStyles,s=o.get(e);if(s||(a=a.ownerDocument||a,s={type:`stylesheet`,instance:null,count:0,state:{loading:0,preload:null}},o.set(e,s),(o=a.querySelector(jf(e)))&&!o._p&&(s.instance=o,s.state.loading=5),hf.has(e)||(n={rel:`preload`,as:`style`,href:n.href,crossOrigin:n.crossOrigin,integrity:n.integrity,media:n.media,hrefLang:n.hrefLang,referrerPolicy:n.referrerPolicy},hf.set(e,n),o||Nf(a,e,n,s.state))),t&&r===null)throw Error(i(528,``));return s}if(t&&r!==null)throw Error(i(529,``));return null;case`script`:return t=n.async,n=n.src,typeof n==`string`&&t&&typeof t!=`function`&&typeof t!=`symbol`?(t=Pf(n),n=St(a).hoistableScripts,r=n.get(t),r||(r={type:`script`,instance:null,count:0,state:null},n.set(t,r)),r):{type:`void`,instance:null,count:0,state:null};default:throw Error(i(444,e))}}function Af(e){return`href="`+Ht(e)+`"`}function jf(e){return`link[rel="stylesheet"][`+e+`]`}function Mf(e){return h({},e,{"data-precedence":e.precedence,precedence:null})}function Nf(e,t,n,r){e.querySelector(`link[rel="preload"][as="style"][`+t+`]`)?r.loading=1:(t=e.createElement(`link`),r.preload=t,t.addEventListener(`load`,function(){return r.loading|=1}),t.addEventListener(`error`,function(){return r.loading|=2}),Fd(t,`link`,n),Ct(t),e.head.appendChild(t))}function Pf(e){return`[src="`+Ht(e)+`"]`}function Ff(e){return`script[async]`+e}function If(e,t,n){if(t.count++,t.instance===null)switch(t.type){case`style`:var r=e.querySelector(`style[data-href~="`+Ht(n.href)+`"]`);if(r)return t.instance=r,Ct(r),r;var a=h({},n,{"data-href":n.href,"data-precedence":n.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement(`style`),Ct(r),Fd(r,`style`,a),Lf(r,n.precedence,e),t.instance=r;case`stylesheet`:a=Af(n.href);var o=e.querySelector(jf(a));if(o)return t.state.loading|=4,t.instance=o,Ct(o),o;r=Mf(n),(a=hf.get(a))&&Rf(r,a),o=(e.ownerDocument||e).createElement(`link`),Ct(o);var s=o;return s._p=new Promise(function(e,t){s.onload=e,s.onerror=t}),Fd(o,`link`,r),t.state.loading|=4,Lf(o,n.precedence,e),t.instance=o;case`script`:return o=Pf(n.src),(a=e.querySelector(Ff(o)))?(t.instance=a,Ct(a),a):(r=n,(a=hf.get(o))&&(r=h({},n),zf(r,a)),e=e.ownerDocument||e,a=e.createElement(`script`),Ct(a),Fd(a,`link`,r),e.head.appendChild(a),t.instance=a);case`void`:return null;default:throw Error(i(443,t.type))}else t.type===`stylesheet`&&!(t.state.loading&4)&&(r=t.instance,t.state.loading|=4,Lf(r,n.precedence,e));return t.instance}function Lf(e,t,n){for(var r=n.querySelectorAll(`link[rel="stylesheet"][data-precedence],style[data-precedence]`),i=r.length?r[r.length-1]:null,a=i,o=0;o<r.length;o++){var s=r[o];if(s.dataset.precedence===t)a=s;else if(a!==i)break}a?a.parentNode.insertBefore(e,a.nextSibling):(t=n.nodeType===9?n.head:n,t.insertBefore(e,t.firstChild))}function Rf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.title??=t.title}function zf(e,t){e.crossOrigin??=t.crossOrigin,e.referrerPolicy??=t.referrerPolicy,e.integrity??=t.integrity}var Bf=null;function Vf(e,t,n){if(Bf===null){var r=new Map,i=Bf=new Map;i.set(n,r)}else i=Bf,r=i.get(n),r||(r=new Map,i.set(n,r));if(r.has(e))return r;for(r.set(e,null),n=n.getElementsByTagName(e),i=0;i<n.length;i++){var a=n[i];if(!(a[P]||a[dt]||e===`link`&&a.getAttribute(`rel`)===`stylesheet`)&&a.namespaceURI!==`http://www.w3.org/2000/svg`){var o=a.getAttribute(t)||``;o=e+o;var s=r.get(o);s?s.push(a):r.set(o,[a])}}return r}function Hf(e,t,n){e=e.ownerDocument||e,e.head.insertBefore(n,t===`title`?e.querySelector(`head > title`):null)}function Uf(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 Wf(e){return!(e.type===`stylesheet`&&!(e.state.loading&3))}function Gf(e,t,n,r){if(n.type===`stylesheet`&&(typeof r.media!=`string`||!1!==matchMedia(r.media).matches)&&!(n.state.loading&4)){if(n.instance===null){var i=Af(r.href),a=t.querySelector(jf(i));if(a){t=a._p,typeof t==`object`&&t&&typeof t.then==`function`&&(e.count++,e=Jf.bind(e),t.then(e,e)),n.state.loading|=4,n.instance=a,Ct(a);return}a=t.ownerDocument||t,r=Mf(r),(i=hf.get(i))&&Rf(r,i),a=a.createElement(`link`),Ct(a);var o=a;o._p=new Promise(function(e,t){o.onload=e,o.onerror=t}),Fd(a,`link`,r),n.instance=a}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(n,t),(t=n.state.preload)&&!(n.state.loading&3)&&(e.count++,n=Jf.bind(e),t.addEventListener(`load`,n),t.addEventListener(`error`,n))}}var Kf=0;function qf(e,t){return e.stylesheets&&e.count===0&&Xf(e,e.stylesheets),0<e.count||0<e.imgCount?function(n){var r=setTimeout(function(){if(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend){var t=e.unsuspend;e.unsuspend=null,t()}},6e4+t);0<e.imgBytes&&Kf===0&&(Kf=62500*Rd());var i=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Xf(e,e.stylesheets),e.unsuspend)){var t=e.unsuspend;e.unsuspend=null,t()}},(e.imgBytes>Kf?50:800)+t);return e.unsuspend=n,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(i)}}:null}function Jf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Xf(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Yf=null;function Xf(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Yf=new Map,t.forEach(Zf,e),Yf=null,Jf.call(e))}function Zf(e,t){if(!(t.state.loading&4)){var n=Yf.get(e);if(n)var r=n.get(null);else{n=new Map,Yf.set(e,n);for(var i=e.querySelectorAll(`link[data-precedence],style[data-precedence]`),a=0;a<i.length;a++){var o=i[a];(o.nodeName===`LINK`||o.getAttribute(`media`)!==`not all`)&&(n.set(o.dataset.precedence,o),r=o)}r&&n.set(null,r)}i=t.instance,o=i.getAttribute(`data-precedence`),a=n.get(o)||r,a===r&&n.set(null,i),n.set(o,i),this.count++,r=Jf.bind(this),i.addEventListener(`load`,r),i.addEventListener(`error`,r),a?a.parentNode.insertBefore(i,a.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(i,e.firstChild)),t.state.loading|=4}}var Qf={$$typeof:C,Provider:null,Consumer:null,_currentValue:se,_currentValue2:se,_threadCount:0};function $f(e,t,n,r,i,a,o,s,c){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=N(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=N(0),this.hiddenUpdates=N(null),this.identifierPrefix=r,this.onUncaughtError=i,this.onCaughtError=a,this.onRecoverableError=o,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=c,this.incompleteTransitions=new Map}function ep(e,t,n,r,i,a,o,s,c,l,u,d){return e=new $f(e,t,n,o,c,l,u,d,s),t=1,!0===a&&(t|=24),a=ui(3,null,null,t),e.current=a,a.stateNode=e,t=ca(),t.refCount++,e.pooledCache=t,t.refCount++,a.memoizedState={element:r,isDehydrated:n,cache:t},Va(a),e}function tp(e){return e?(e=ci,e):ci}function np(e,t,n,r,i,a){i=tp(i),r.context===null?r.context=i:r.pendingContext=i,r=Ua(t),r.payload={element:n},a=a===void 0?null:a,a!==null&&(r.callback=a),n=Wa(e,r,t),n!==null&&(_u(n,e,t),Ga(n,e,t))}function rp(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var n=e.retryLane;e.retryLane=n!==0&&n<t?n:t}}function ip(e,t){rp(e,t),(e=e.alternate)&&rp(e,t)}function ap(e){if(e.tag===13||e.tag===31){var t=ai(e,67108864);t!==null&&_u(t,e,67108864),ip(e,67108864)}}function op(e){if(e.tag===13||e.tag===31){var t=hu();t=ot(t);var n=ai(e,t);n!==null&&_u(n,e,t),ip(e,t)}}var sp=!0;function cp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=2,up(e,t,n,r)}finally{A.p=a,k.T=i}}function lp(e,t,n,r){var i=k.T;k.T=null;var a=A.p;try{A.p=8,up(e,t,n,r)}finally{A.p=a,k.T=i}}function up(e,t,n,r){if(sp){var i=dp(r);if(i===null)wd(e,t,r,fp,n),Cp(e,r);else if(Tp(i,e,t,n,r))r.stopPropagation();else if(Cp(e,r),t&4&&-1<Sp.indexOf(e)){for(;i!==null;){var a=bt(i);if(a!==null)switch(a.tag){case 3:if(a=a.stateNode,a.current.memoizedState.isDehydrated){var o=Xe(a.pendingLanes);if(o!==0){var s=a;for(s.pendingLanes|=2,s.entangledLanes|=2;o;){var c=1<<31-Ue(o);s.entanglements[1]|=c,o&=~c}rd(a),!(K&6)&&(ru=Me()+500,id(0,!1))}}break;case 31:case 13:s=ai(a,2),s!==null&&_u(s,a,2),Su(),ip(a,2)}if(a=dp(r),a===null&&wd(e,t,r,fp,n),a===i)break;i=a}i!==null&&r.stopPropagation()}else wd(e,t,r,null,n)}}function dp(e){return e=on(e),pp(e)}var fp=null;function pp(e){if(fp=null,e=yt(e),e!==null){var t=o(e);if(t===null)e=null;else{var n=t.tag;if(n===13){if(e=s(t),e!==null)return e;e=null}else if(n===31){if(e=c(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 fp=e,null}function mp(e){switch(e){case`beforetoggle`:case`cancel`:case`click`:case`close`:case`contextmenu`:case`copy`:case`cut`:case`auxclick`:case`dblclick`:case`dragend`:case`dragstart`:case`drop`:case`focusin`:case`focusout`:case`input`:case`invalid`:case`keydown`:case`keypress`:case`keyup`:case`mousedown`:case`mouseup`:case`paste`:case`pause`:case`play`:case`pointercancel`:case`pointerdown`:case`pointerup`:case`ratechange`:case`reset`:case`resize`:case`seeked`:case`submit`:case`toggle`:case`touchcancel`:case`touchend`:case`touchstart`:case`volumechange`:case`change`:case`selectionchange`:case`textInput`:case`compositionstart`:case`compositionend`:case`compositionupdate`:case`beforeblur`:case`afterblur`:case`beforeinput`:case`blur`:case`fullscreenchange`:case`focus`:case`hashchange`:case`popstate`:case`select`:case`selectstart`:return 2;case`drag`:case`dragenter`:case`dragexit`:case`dragleave`:case`dragover`:case`mousemove`:case`mouseout`:case`mouseover`:case`pointermove`:case`pointerout`:case`pointerover`:case`scroll`:case`touchmove`:case`wheel`:case`mouseenter`:case`mouseleave`:case`pointerenter`:case`pointerleave`:return 8;case`message`:switch(Ne()){case Pe:return 2;case Fe:return 8;case M:case Ie:return 32;case Le:return 268435456;default:return 32}default:return 32}}var hp=!1,gp=null,_p=null,vp=null,yp=new Map,bp=new Map,xp=[],Sp=`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 Cp(e,t){switch(e){case`focusin`:case`focusout`:gp=null;break;case`dragenter`:case`dragleave`:_p=null;break;case`mouseover`:case`mouseout`:vp=null;break;case`pointerover`:case`pointerout`:yp.delete(t.pointerId);break;case`gotpointercapture`:case`lostpointercapture`:bp.delete(t.pointerId)}}function wp(e,t,n,r,i,a){return e===null||e.nativeEvent!==a?(e={blockedOn:t,domEventName:n,eventSystemFlags:r,nativeEvent:a,targetContainers:[i]},t!==null&&(t=bt(t),t!==null&&ap(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,i!==null&&t.indexOf(i)===-1&&t.push(i),e)}function Tp(e,t,n,r,i){switch(t){case`focusin`:return gp=wp(gp,e,t,n,r,i),!0;case`dragenter`:return _p=wp(_p,e,t,n,r,i),!0;case`mouseover`:return vp=wp(vp,e,t,n,r,i),!0;case`pointerover`:var a=i.pointerId;return yp.set(a,wp(yp.get(a)||null,e,t,n,r,i)),!0;case`gotpointercapture`:return a=i.pointerId,bp.set(a,wp(bp.get(a)||null,e,t,n,r,i)),!0}return!1}function Ep(e){var t=yt(e.target);if(t!==null){var n=o(t);if(n!==null){if(t=n.tag,t===13){if(t=s(n),t!==null){e.blockedOn=t,lt(e.priority,function(){op(n)});return}}else if(t===31){if(t=c(n),t!==null){e.blockedOn=t,lt(e.priority,function(){op(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 Dp(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var n=dp(e.nativeEvent);if(n===null){n=e.nativeEvent;var r=new n.constructor(n.type,n);an=r,n.target.dispatchEvent(r),an=null}else return t=bt(n),t!==null&&ap(t),e.blockedOn=n,!1;t.shift()}return!0}function Op(e,t,n){Dp(e)&&n.delete(t)}function kp(){hp=!1,gp!==null&&Dp(gp)&&(gp=null),_p!==null&&Dp(_p)&&(_p=null),vp!==null&&Dp(vp)&&(vp=null),yp.forEach(Op),bp.forEach(Op)}function Ap(e,n){e.blockedOn===n&&(e.blockedOn=null,hp||(hp=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,kp)))}var jp=null;function Mp(e){jp!==e&&(jp=e,t.unstable_scheduleCallback(t.unstable_NormalPriority,function(){jp===e&&(jp=null);for(var t=0;t<e.length;t+=3){var n=e[t],r=e[t+1],i=e[t+2];if(typeof r!=`function`){if(pp(r||n)===null)continue;break}var a=bt(n);a!==null&&(e.splice(t,3),t-=3,Ds(a,{pending:!0,data:i,method:n.method,action:r},r,i))}}))}function Np(e){function t(t){return Ap(t,e)}gp!==null&&Ap(gp,e),_p!==null&&Ap(_p,e),vp!==null&&Ap(vp,e),yp.forEach(t),bp.forEach(t);for(var n=0;n<xp.length;n++){var r=xp[n];r.blockedOn===e&&(r.blockedOn=null)}for(;0<xp.length&&(n=xp[0],n.blockedOn===null);)Ep(n),n.blockedOn===null&&xp.shift();if(n=(e.ownerDocument||e).$$reactFormReplay,n!=null)for(r=0;r<n.length;r+=3){var i=n[r],a=n[r+1],o=i[ft]||null;if(typeof a==`function`)o||Mp(n);else if(o){var s=null;if(a&&a.hasAttribute(`formAction`)){if(i=a,o=a[ft]||null)s=o.formAction;else if(pp(i)!==null)continue}else s=o.action;typeof s==`function`?n[r+1]=s:(n.splice(r,3),r-=3),Mp(n)}}}function Pp(){function e(e){e.canIntercept&&e.info===`react-transition`&&e.intercept({handler:function(){return new Promise(function(e){return i=e})},focusReset:`manual`,scroll:`manual`})}function t(){i!==null&&(i(),i=null),r||setTimeout(n,20)}function n(){if(!r&&!navigation.transition){var e=navigation.currentEntry;e&&e.url!=null&&navigation.navigate(e.url,{state:e.getState(),info:`react-transition`,history:`replace`})}}if(typeof navigation==`object`){var r=!1,i=null;return navigation.addEventListener(`navigate`,e),navigation.addEventListener(`navigatesuccess`,t),navigation.addEventListener(`navigateerror`,t),setTimeout(n,100),function(){r=!0,navigation.removeEventListener(`navigate`,e),navigation.removeEventListener(`navigatesuccess`,t),navigation.removeEventListener(`navigateerror`,t),i!==null&&(i(),i=null)}}}function Fp(e){this._internalRoot=e}Ip.prototype.render=Fp.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(i(409));var n=t.current;np(n,hu(),e,t,null,null)},Ip.prototype.unmount=Fp.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;np(e.current,2,null,e,null,null),Su(),t[pt]=null}};function Ip(e){this._internalRoot=e}Ip.prototype.unstable_scheduleHydration=function(e){if(e){var t=ct();e={blockedOn:null,target:e,priority:t};for(var n=0;n<xp.length&&t!==0&&t<xp[n].priority;n++);xp.splice(n,0,e),n===0&&Ep(e)}};var Lp=n.version;if(Lp!==`19.2.8`)throw Error(i(527,Lp,`19.2.8`));A.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render==`function`?Error(i(188)):(e=Object.keys(e).join(`,`),Error(i(268,e)));return e=d(t),e=e===null?null:p(e),e=e===null?null:e.stateNode,e};var Rp={bundleType:0,version:`19.2.8`,rendererPackageName:`react-dom`,currentDispatcherRef:k,reconcilerVersion:`19.2.8`};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<`u`){var zp=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!zp.isDisabled&&zp.supportsFiber)try{Be=zp.inject(Rp),Ve=zp}catch{}}e.createRoot=function(e,t){if(!a(e))throw Error(i(299));var n=!1,r=``,o=Xs,s=Zs,c=Qs;return t!=null&&(!0===t.unstable_strictMode&&(n=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(o=t.onUncaughtError),t.onCaughtError!==void 0&&(s=t.onCaughtError),t.onRecoverableError!==void 0&&(c=t.onRecoverableError)),t=ep(e,1,!1,null,null,n,r,null,o,s,c,Pp),e[pt]=t.current,Sd(e),new Fp(t)}})),g=o(((e,t)=>{function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>`u`||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!=`function`))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}n(),t.exports=h()})),_=`modulepreload`,v=function(e,t){return new URL(e,t).href},y={},b=function(e,t,n){let r=Promise.resolve();if(t&&t.length>0){let e=document.getElementsByTagName(`link`),i=document.querySelector(`meta[property=csp-nonce]`),a=i?.nonce||i?.getAttribute(`nonce`);function o(e){return Promise.all(e.map(e=>Promise.resolve(e).then(e=>({status:`fulfilled`,value:e}),e=>({status:`rejected`,reason:e}))))}function s(e){return import.meta.resolve?import.meta.resolve(e):new URL(e,import.meta.url).href}r=o(t.map(t=>{if(t=v(t,n),t=s(t),t in y)return;y[t]=!0;let r=t.endsWith(`.css`);for(let n=e.length-1;n>=0;n--){let i=e[n];if(i.href===t&&(!r||i.rel===`stylesheet`))return}let i=document.createElement(`link`);if(i.rel=r?`stylesheet`:_,r||(i.as=`script`),i.crossOrigin=``,i.href=t,a&&i.setAttribute(`nonce`,a),document.head.appendChild(i),r)return new Promise((e,n)=>{i.addEventListener(`load`,e),i.addEventListener(`error`,()=>n(Error(`Unable to preload CSS for ${t}`)))})}))}function i(e){let t=new Event(`vite:preloadError`,{cancelable:!0});if(t.payload=e,window.dispatchEvent(t),!t.defaultPrevented)throw e}return r.then(t=>{for(let e of t||[])e.status===`rejected`&&i(e.reason);return e().catch(i)})},x=c(u(),1),S=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,C=/^[\\/]{2}/;function w(e,t){return t+e.replace(/\\/g,`/`)}var T=`popstate`;function ee(e){return typeof e==`object`&&!!e&&`pathname`in e&&`search`in e&&`hash`in e&&`state`in e&&`key`in e}function te(e={}){function t(e,t){let n=t.state?.masked,{pathname:r,search:i,hash:a}=n||e.location;return ie(``,{pathname:r,search:i,hash:a},t.state&&t.state.usr||null,t.state&&t.state.key||`default`,n?{pathname:e.location.pathname,search:e.location.search,hash:e.location.hash}:void 0)}function n(e,t){return typeof t==`string`?t:ae(t)}return oe(t,n,null,e)}function E(e,t){if(e===!1||e==null)throw Error(t)}function D(e,t){if(!e){typeof console<`u`&&console.warn(t);try{throw Error(t)}catch{}}}function ne(){return Math.random().toString(36).substring(2,10)}function re(e,t){return{usr:e.state,key:e.key,idx:t,masked:e.mask?{pathname:e.pathname,search:e.search,hash:e.hash}:void 0}}function ie(e,t,n=null,r,i){return{pathname:typeof e==`string`?e:e.pathname,search:``,hash:``,...typeof t==`string`?O(t):t,state:n,key:t&&t.key||r||ne(),mask:i}}function ae({pathname:e=`/`,search:t=``,hash:n=``}){return t&&t!==`?`&&(e+=t.charAt(0)===`?`?t:`?`+t),n&&n!==`#`&&(e+=n.charAt(0)===`#`?n:`#`+n),e}function O(e){let t={};if(e){let n=e.indexOf(`#`);n>=0&&(t.hash=e.substring(n),e=e.substring(0,n));let r=e.indexOf(`?`);r>=0&&(t.search=e.substring(r),e=e.substring(0,r)),e&&(t.pathname=e)}return t}function oe(e,t,n,r={}){let{window:i=document.defaultView,v5Compat:a=!1}=r,o=i.history,s=`POP`,c=null,l=u();l??(l=0,o.replaceState({...o.state,idx:l},``));function u(){return(o.state||{idx:null}).idx}function d(){s=`POP`;let e=u(),t=e==null?null:e-l;l=e,c&&c({action:s,location:h.location,delta:t})}function f(e,t){s=`PUSH`;let r=ee(e)?e:ie(h.location,e,t);n&&n(r,e),l=u()+1;let d=re(r,l),f=h.createHref(r.mask||r);try{o.pushState(d,``,f)}catch(e){if(e instanceof DOMException&&e.name===`DataCloneError`)throw e;i.location.assign(f)}a&&c&&c({action:s,location:h.location,delta:1})}function p(e,t){s=`REPLACE`;let r=ee(e)?e:ie(h.location,e,t);n&&n(r,e),l=u();let i=re(r,l),d=h.createHref(r.mask||r);o.replaceState(i,``,d),a&&c&&c({action:s,location:h.location,delta:0})}function m(e){return k(i,e)}let h={get action(){return s},get location(){return e(i,o)},listen(e){if(c)throw Error(`A history only accepts one active listener`);return i.addEventListener(T,d),c=e,()=>{i.removeEventListener(T,d),c=null}},createHref(e){return t(i,e)},createURL:m,encodeLocation(e){let t=m(e);return{pathname:t.pathname,search:t.search,hash:t.hash}},push:f,replace:p,go(e){return o.go(e)}};return h}function k(e,t,n=!1){let r=`http://localhost`;e&&(r=e.location.origin===`null`?e.location.href:e.location.origin),E(r,`No window.location.(origin|href) available to create URL`);let i=typeof t==`string`?t:ae(t);return i=i.replace(/ $/,`%20`),!n&&C.test(i)&&(i=r+i),new URL(i,r)}function A(e,t,n=`/`){return se(e,t,n,!1)}function se(e,t,n,r,i){let a=Te((typeof t==`string`?O(t):t).pathname||`/`,n);if(a==null)return null;let o=i??ce(e),s=null,c=we(a);for(let e=0;s==null&&e<o.length;++e)s=be(o[e],c,r);return s}function ce(e){let t=le(e);return de(t),t}function le(e,t=[],n=[],r=``,i=!1){let a=(e,a,o=i,s)=>{let c={relativePath:s===void 0?e.path||``:s,caseSensitive:e.caseSensitive===!0,childrenIndex:a,route:e};if(c.relativePath.startsWith(`/`)){if(!c.relativePath.startsWith(r)&&o)return;E(c.relativePath.startsWith(r),`Absolute route path "${c.relativePath}" nested under path "${r}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),c.relativePath=c.relativePath.slice(r.length)}let l=Ne([r,c.relativePath]),u=n.concat(c);e.children&&e.children.length>0&&(E(e.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${l}".`),le(e.children,t,u,l,o)),!(e.path==null&&!e.index)&&t.push({path:l,score:ve(l,e.index),routesMeta:u.map((e,t)=>{let[n,r]=Ce(e.relativePath,e.caseSensitive,t===u.length-1);return{...e,matcher:n,compiledParams:r}})})};return e.forEach((e,t)=>{if(e.path===``||!e.path?.includes(`?`))a(e,t);else for(let n of ue(e.path))a(e,t,!0,n)}),t}function ue(e){let t=e.split(`/`);if(t.length===0)return[];let[n,...r]=t,i=n.endsWith(`?`),a=n.replace(/\?$/,``);if(r.length===0)return i?[a,``]:[a];let o=ue(r.join(`/`)),s=[];return s.push(...o.map(e=>e===``?a:[a,e].join(`/`))),i&&s.push(...o),s.map(t=>e.startsWith(`/`)&&t===``?`/`:t)}function de(e){e.sort((e,t)=>e.score===t.score?ye(e.routesMeta.map(e=>e.childrenIndex),t.routesMeta.map(e=>e.childrenIndex)):t.score-e.score)}var j=/^:[\w-]+$/,fe=3,pe=2,me=1,he=10,ge=-2,_e=e=>e===`*`;function ve(e,t){let n=e.split(`/`),r=n.length;return n.some(_e)&&(r+=ge),t&&(r+=pe),n.filter(e=>!_e(e)).reduce((e,t)=>e+(j.test(t)?fe:t===``?me:he),r)}function ye(e,t){return e.length===t.length&&e.slice(0,-1).every((e,n)=>e===t[n])?e[e.length-1]-t[t.length-1]:0}function be(e,t,n=!1){let{routesMeta:r}=e,i={},a=`/`,o=[];for(let e=0;e<r.length;++e){let s=r[e],c=e===r.length-1,l=a===`/`?t:t.slice(a.length)||`/`,u={path:s.relativePath,caseSensitive:s.caseSensitive,end:c},d=s.matcher&&s.compiledParams?Se(u,l,s.matcher,s.compiledParams):xe(u,l),f=s.route;if(!d&&c&&n&&!r[r.length-1].route.index&&(d=xe({path:s.relativePath,caseSensitive:s.caseSensitive,end:!1},l)),!d)return null;Object.assign(i,d.params),o.push({params:i,pathname:Ne([a,d.pathname]),pathnameBase:Fe(Ne([a,d.pathnameBase])),route:f}),d.pathnameBase!==`/`&&(a=Ne([a,d.pathnameBase]))}return o}function xe(e,t){typeof e==`string`&&(e={path:e,caseSensitive:!1,end:!0});let[n,r]=Ce(e.path,e.caseSensitive,e.end);return Se(e,t,n,r)}function Se(e,t,n,r){let i=t.match(n);if(!i)return null;let a=i[0],o=a.replace(/(.)\/+$/,`$1`),s=i.slice(1);return{params:r.reduce((e,{paramName:t,isOptional:n},r)=>{if(t===`*`){let e=s[r]||``;o=a.slice(0,a.length-e.length).replace(/(.)\/+$/,`$1`)}let i=s[r];return e[t]=n&&!i?void 0:(i||``).replace(/%2F/g,`/`),e},{}),pathname:a,pathnameBase:o,pattern:e}}function Ce(e,t=!1,n=!0){D(e===`*`||!e.endsWith(`*`)||e.endsWith(`/*`),`Route path "${e}" will be treated as if it were "${e.replace(/\*$/,`/*`)}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${e.replace(/\*$/,`/*`)}".`);let r=[],i=`^`+e.replace(/\/*\*?$/,``).replace(/^\/*/,`/`).replace(/[\\.*+^${}|()[\]]/g,`\\$&`).replace(/\/:([\w-]+)(\?)?/g,(e,t,n,i,a)=>{if(r.push({paramName:t,isOptional:n!=null}),n){let t=a.charAt(i+e.length);return t&&t!==`/`?`/([^\\/]*)`:`(?:/([^\\/]*))?`}return`/([^\\/]+)`}).replace(/\/([\w-]+)\?(\/|$)/g,`(/$1)?$2`);return e.endsWith(`*`)?(r.push({paramName:`*`}),i+=e===`*`||e===`/*`?`(.*)$`:`(?:\\/(.+)|\\/*)$`):n?i+=`\\/*$`:e!==``&&e!==`/`&&(i+=`(?:(?=\\/|$))`),[new RegExp(i,t?void 0:`i`),r]}function we(e){try{return e.split(`/`).map(e=>decodeURIComponent(e).replace(/\//g,`%2F`)).join(`/`)}catch(t){return D(!1,`The URL path "${e}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${t}).`),e}}function Te(e,t){if(t===`/`)return e;if(!e.toLowerCase().startsWith(t.toLowerCase()))return null;let n=t.endsWith(`/`)?t.length-1:t.length,r=e.charAt(n);return r&&r!==`/`?null:e.slice(n)||`/`}function Ee(e,t=`/`){let{pathname:n,search:r=``,hash:i=``}=typeof e==`string`?O(e):e,a;return n?(n=Me(n),a=n.startsWith(`/`)?De(n.substring(1),`/`):De(n,t)):a=t,{pathname:a,search:M(r),hash:Ie(i)}}function De(e,t){let n=Pe(t).split(`/`);return e.split(`/`).forEach(e=>{e===`..`?n.length>1&&n.pop():e!==`.`&&n.push(e)}),n.length>1?n.join(`/`):`/`}function Oe(e,t,n,r){return`Cannot include a '${e}' character in a manually specified \`to.${t}\` field [${JSON.stringify(r)}]. Please separate it out to the \`to.${n}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function ke(e){return e.filter((e,t)=>t===0||e.route.path&&e.route.path.length>0)}function Ae(e){let t=ke(e);return t.map((e,n)=>n===t.length-1?e.pathname:e.pathnameBase)}function je(e,t,n,r=!1){let i;typeof e==`string`?i=O(e):(i={...e},E(!i.pathname||!i.pathname.includes(`?`),Oe(`?`,`pathname`,`search`,i)),E(!i.pathname||!i.pathname.includes(`#`),Oe(`#`,`pathname`,`hash`,i)),E(!i.search||!i.search.includes(`#`),Oe(`#`,`search`,`hash`,i)));let a=e===``||i.pathname===``,o=a?`/`:i.pathname,s;if(o==null)s=n;else{let e=t.length-1;if(!r&&o.startsWith(`..`)){let t=o.split(`/`);for(;t[0]===`..`;)t.shift(),--e;i.pathname=t.join(`/`)}s=e>=0?t[e]:`/`}let c=Ee(i,s),l=o&&o!==`/`&&o.endsWith(`/`),u=(a||o===`.`)&&n.endsWith(`/`);return!c.pathname.endsWith(`/`)&&(l||u)&&(c.pathname+=`/`),c}var Me=e=>e.replace(/[\\/]{2,}/g,`/`),Ne=e=>Me(e.join(`/`)),Pe=e=>e.replace(/\/+$/,``),Fe=e=>Pe(e).replace(/^\/*/,`/`),M=e=>!e||e===`?`?``:e.startsWith(`?`)?e:`?`+e,Ie=e=>!e||e===`#`?``:e.startsWith(`#`)?e:`#`+e,Le=class{constructor(e,t,n,r=!1){this.status=e,this.statusText=t||``,this.internal=r,n instanceof Error?(this.data=n.toString(),this.error=n):this.data=n}};function Re(e){return e!=null&&typeof e.status==`number`&&typeof e.statusText==`string`&&typeof e.internal==`boolean`&&`data`in e}function ze(e){return Ne(e.map(e=>e.route.path).filter(Boolean))||`/`}var Be=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;function Ve(e,t){let n=e;if(typeof n!=`string`||!S.test(n))return{absoluteURL:void 0,isExternal:!1,to:n};let r=n,i=!1;if(Be)try{let e=new URL(window.location.href),r=C.test(n)?new URL(w(n,e.protocol)):new URL(n),a=Te(r.pathname,t);r.origin===e.origin&&a!=null?n=a+r.search+r.hash:i=!0}catch{D(!1,`<Link to="${n}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:r,isExternal:i,to:n}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);var He=[`POST`,`PUT`,`PATCH`,`DELETE`];new Set(He);var Ue=[`GET`,...He];new Set(Ue);var We=[`about:`,`blob:`,`chrome:`,`chrome-untrusted:`,`content:`,`data:`,`devtools:`,`file:`,`filesystem:`,`javascript:`];function Ge(e){try{return We.includes(new URL(e).protocol)}catch{return!1}}var Ke=x.createContext(null);Ke.displayName=`DataRouter`;var qe=x.createContext(null);qe.displayName=`DataRouterState`;var Je=x.createContext(!1);function Ye(){return x.useContext(Je)}var Xe=x.createContext({isTransitioning:!1});Xe.displayName=`ViewTransition`;var Ze=x.createContext(new Map);Ze.displayName=`Fetchers`;var Qe=x.createContext(null);Qe.displayName=`Await`;var $e=x.createContext(null);$e.displayName=`Navigation`;var et=x.createContext(null);et.displayName=`Location`;var N=x.createContext({outlet:null,matches:[],isDataRoute:!1});N.displayName=`Route`;var tt=x.createContext(null);tt.displayName=`RouteError`;var nt=`REACT_ROUTER_ERROR`,rt=`REDIRECT`,it=`ROUTE_ERROR_RESPONSE`;function at(e){if(e.startsWith(`${nt}:${rt}:{`))try{let t=JSON.parse(e.slice(28));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`&&typeof t.location==`string`&&typeof t.reloadDocument==`boolean`&&typeof t.replace==`boolean`)return t}catch{}}function ot(e){if(e.startsWith(`${nt}:${it}:{`))try{let t=JSON.parse(e.slice(40));if(typeof t==`object`&&t&&typeof t.status==`number`&&typeof t.statusText==`string`)return new Le(t.status,t.statusText,t.data)}catch{}}function st(e,{relative:t}={}){E(ct(),`useHref() may be used only in the context of a <Router> component.`);let{basename:n,navigator:r}=x.useContext($e),{hash:i,pathname:a,search:o}=_t(e,{relative:t}),s=a;return n!==`/`&&(s=a===`/`?n:Ne([n,a])),r.createHref({pathname:s,search:o,hash:i})}function ct(){return x.useContext(et)!=null}function lt(){return E(ct(),`useLocation() may be used only in the context of a <Router> component.`),x.useContext(et).location}var ut=`You should call navigate() in a React.useEffect(), not when your component is first rendered.`;function dt(e){x.useContext($e).static||x.useLayoutEffect(e)}function ft(){let{isDataRoute:e}=x.useContext(N);return e?Nt():pt()}function pt(){E(ct(),`useNavigate() may be used only in the context of a <Router> component.`);let e=x.useContext(Ke),{basename:t,navigator:n}=x.useContext($e),{matches:r}=x.useContext(N),{pathname:i}=lt(),a=JSON.stringify(Ae(r)),o=x.useRef(!1);return dt(()=>{o.current=!0}),x.useCallback((r,s={})=>{if(D(o.current,ut),!o.current)return;if(typeof r==`number`){n.go(r);return}let c=je(r,JSON.parse(a),i,s.relative===`path`);e==null&&t!==`/`&&(c.pathname=c.pathname===`/`?t:Ne([t,c.pathname])),(s.replace?n.replace:n.push)(c,s.state,s)},[t,n,a,i,e])}var mt=x.createContext(null);function ht(e){let t=x.useContext(N).outlet;return x.useMemo(()=>t&&x.createElement(mt.Provider,{value:e},t),[t,e])}function gt(){let{matches:e}=x.useContext(N);return e[e.length-1]?.params??{}}function _t(e,{relative:t}={}){let{matches:n}=x.useContext(N),{pathname:r}=lt(),i=JSON.stringify(Ae(n));return x.useMemo(()=>je(e,JSON.parse(i),r,t===`path`),[e,i,r,t])}function P(e,t){return vt(e,t)}function vt(e,t,n){E(ct(),`useRoutes() may be used only in the context of a <Router> component.`);let{navigator:r}=x.useContext($e),{matches:i}=x.useContext(N),a=i[i.length-1],o=a?a.params:{},s=a?a.pathname:`/`,c=a?a.pathnameBase:`/`,l=a&&a.route;{let e=l&&l.path||``;Ft(s,!l||e.endsWith(`*`)||e.endsWith(`*?`),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${s}" (under <Route path="${e}">) but the parent route path has no trailing "*". This means if you navigate deeper, the parent won't match anymore and therefore the child routes will never render.
Please change the parent <Route path="${e}"> to <Route path="${e===`/`?`*`:`${e}/*`}">.`)}let u=lt(),d;if(t){let e=typeof t==`string`?O(t):t;E(c===`/`||e.pathname?.startsWith(c),`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 "${c}" but pathname "${e.pathname}" was given in the \`location\` prop.`),d=e}else d=u;let f=d.pathname||`/`,p=f;if(c!==`/`){let e=c.replace(/^\//,``).split(`/`);p=`/`+f.replace(/^\//,``).split(`/`).slice(e.length).join(`/`)}let m=n&&n.state.matches.length?n.state.matches.map(e=>Object.assign(e,{route:n.manifest[e.route.id]||e.route})):A(e,{pathname:p});D(l||m!=null,`No routes matched location "${d.pathname}${d.search}${d.hash}" `),D(m==null||m[m.length-1].route.element!==void 0||m[m.length-1].route.Component!==void 0||m[m.length-1].route.lazy!==void 0,`Matched leaf route at location "${d.pathname}${d.search}${d.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 h=Tt(m&&m.map(e=>Object.assign({},e,{params:Object.assign({},o,e.params),pathname:Ne([c,r.encodeLocation?r.encodeLocation(e.pathname.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathname]),pathnameBase:e.pathnameBase===`/`?c:Ne([c,r.encodeLocation?r.encodeLocation(e.pathnameBase.replace(/%/g,`%25`).replace(/\?/g,`%3F`).replace(/#/g,`%23`)).pathname:e.pathnameBase])})),i,n);return t&&h?x.createElement(et.Provider,{value:{location:{pathname:`/`,search:``,hash:``,state:null,key:`default`,mask:void 0,...d},navigationType:`POP`}},h):h}function yt(){let e=Mt(),t=Re(e)?`${e.status} ${e.statusText}`:e instanceof Error?e.message:JSON.stringify(e),n=e instanceof Error?e.stack:null,r=`rgba(200,200,200, 0.5)`,i={padding:`0.5rem`,backgroundColor:r},a={padding:`2px 4px`,backgroundColor:r},o=null;return console.error(`Error handled by React Router default ErrorBoundary:`,e),o=x.createElement(x.Fragment,null,x.createElement(`p`,null,`💿 Hey developer 👋`),x.createElement(`p`,null,`You can provide a way better UX than this when your app throws errors by providing your own `,x.createElement(`code`,{style:a},`ErrorBoundary`),` or`,` `,x.createElement(`code`,{style:a},`errorElement`),` prop on your route.`)),x.createElement(x.Fragment,null,x.createElement(`h2`,null,`Unexpected Application Error!`),x.createElement(`h3`,{style:{fontStyle:`italic`}},t),n?x.createElement(`pre`,{style:i},n):null,o)}var bt=x.createElement(yt,null),xt=class extends x.Component{constructor(e){super(e),this.state={location:e.location,revalidation:e.revalidation,error:e.error}}static getDerivedStateFromError(e){return{error:e}}static getDerivedStateFromProps(e,t){return t.location!==e.location||t.revalidation!==`idle`&&e.revalidation===`idle`?{error:e.error,location:e.location,revalidation:e.revalidation}:{error:e.error===void 0?t.error:e.error,location:t.location,revalidation:e.revalidation||t.revalidation}}componentDidCatch(e,t){this.props.onError?this.props.onError(e,t):console.error(`React Router caught the following error during render`,e)}render(){let e=this.state.error;if(this.context&&typeof e==`object`&&e&&`digest`in e&&typeof e.digest==`string`){let t=ot(e.digest);t&&(e=t)}let t=e===void 0?this.props.children:x.createElement(N.Provider,{value:this.props.routeContext},x.createElement(tt.Provider,{value:e,children:this.props.component}));return this.context?x.createElement(Ct,{error:e},t):t}};xt.contextType=Je;var St=new WeakMap;function Ct({children:e,error:t}){let{basename:n}=x.useContext($e);if(typeof t==`object`&&t&&`digest`in t&&typeof t.digest==`string`){let e=at(t.digest);if(e){let r=St.get(t);if(r)throw r;let i=Ve(e.location,n),a=i.absoluteURL||i.to;if(Ge(a))throw Error(`Invalid redirect location`);if(Be&&!St.get(t)){if(i.isExternal||e.reloadDocument)window.location.href=a;else{let n=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(i.to,{replace:e.replace}));throw St.set(t,n),n}}return x.createElement(`meta`,{httpEquiv:`refresh`,content:`0;url=${a}`})}}return e}function wt({routeContext:e,match:t,children:n}){let r=x.useContext(Ke);return r&&r.static&&r.staticContext&&(t.route.errorElement||t.route.ErrorBoundary)&&(r.staticContext._deepestRenderedBoundaryId=t.route.id),x.createElement(N.Provider,{value:e},n)}function Tt(e,t=[],n){let r=n?.state;if(e==null){if(!r)return null;if(r.errors)e=r.matches;else if(t.length===0&&!r.initialized&&r.matches.length>0)e=r.matches;else return null}let i=e,a=r?.errors;if(a!=null){let e=i.findIndex(e=>e.route.id&&a?.[e.route.id]!==void 0);E(e>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(a).join(`,`)}`),i=i.slice(0,Math.min(i.length,e+1))}let o=!1,s=-1;if(n&&r){o=r.renderFallback;for(let e=0;e<i.length;e++){let t=i[e];if((t.route.HydrateFallback||t.route.hydrateFallbackElement)&&(s=e),t.route.id){let{loaderData:e,errors:a}=r,c=t.route.loader&&!e.hasOwnProperty(t.route.id)&&(!a||a[t.route.id]===void 0);if(t.route.lazy||c){n.isStatic&&(o=!0),i=s>=0?i.slice(0,s+1):[i[0]];break}}}}let c=n?.onError,l=r&&c?(e,t)=>{c(e,{location:r.location,params:r.matches?.[0]?.params??{},pattern:ze(r.matches),errorInfo:t})}:void 0;return i.reduceRight((e,n,c)=>{let u,d=!1,f=null,p=null;r&&(u=a&&n.route.id?a[n.route.id]:void 0,f=n.route.errorElement||bt,o&&(s<0&&c===0?(Ft(`route-fallback`,!1,"No `HydrateFallback` element provided to render during initial hydration"),d=!0,p=null):s===c&&(d=!0,p=n.route.hydrateFallbackElement||null)));let m=t.concat(i.slice(0,c+1)),h=()=>{let t;return t=u?f:d?p:n.route.Component?x.createElement(n.route.Component,null):n.route.element?n.route.element:e,x.createElement(wt,{match:n,routeContext:{outlet:e,matches:m,isDataRoute:r!=null},children:t})};return r&&(n.route.ErrorBoundary||n.route.errorElement||c===0)?x.createElement(xt,{location:r.location,revalidation:r.revalidation,component:f,error:u,children:h(),routeContext:{outlet:null,matches:m,isDataRoute:!0},onError:l}):h()},null)}function Et(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Dt(e){let t=x.useContext(Ke);return E(t,Et(e)),t}function Ot(e){let t=x.useContext(qe);return E(t,Et(e)),t}function kt(e){let t=x.useContext(N);return E(t,Et(e)),t}function At(e){let t=kt(e),n=t.matches[t.matches.length-1];return E(n.route.id,`${e} can only be used on routes that contain a unique "id"`),n.route.id}function jt(){return At(`useRouteId`)}function Mt(){let e=x.useContext(tt),t=Ot(`useRouteError`),n=At(`useRouteError`);return e===void 0?t.errors?.[n]:e}function Nt(){let{router:e}=Dt(`useNavigate`),t=At(`useNavigate`),n=x.useRef(!1);return dt(()=>{n.current=!0}),x.useCallback(async(r,i={})=>{D(n.current,ut),n.current&&(typeof r==`number`?await e.navigate(r):await e.navigate(r,{fromRouteId:t,...i}))},[e,t])}var Pt={};function Ft(e,t,n){!t&&!Pt[e]&&(Pt[e]=!0,D(!1,n))}x.memo(It);function It({routes:e,manifest:t,future:n,state:r,isStatic:i,onError:a}){return vt(e,void 0,{manifest:t,state:r,isStatic:i,onError:a,future:n})}function Lt({to:e,replace:t,state:n,relative:r}){E(ct(),`<Navigate> may be used only in the context of a <Router> component.`);let{static:i}=x.useContext($e);D(!i,`<Navigate> must not be used on the initial render in a <StaticRouter>. This is a no-op, but you should modify your code so the <Navigate> is only ever rendered in response to some user interaction or state change.`);let{matches:a}=x.useContext(N),{pathname:o}=lt(),s=ft(),c=je(e,Ae(a),o,r===`path`),l=JSON.stringify(c);return x.useEffect(()=>{s(JSON.parse(l),{replace:t,state:n,relative:r})},[s,l,r,t,n]),null}function Rt(e){return ht(e.context)}function zt(e){E(!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 Bt({basename:e=`/`,children:t=null,location:n,navigationType:r=`POP`,navigator:i,static:a=!1,useTransitions:o}){E(!ct(),`You cannot render a <Router> inside another <Router>. You should never have more than one in your app.`);let s=e.replace(/^\/*/,`/`),c=x.useMemo(()=>({basename:s,navigator:i,static:a,useTransitions:o,future:{}}),[s,i,a,o]);typeof n==`string`&&(n=O(n));let{pathname:l=`/`,search:u=``,hash:d=``,state:f=null,key:p=`default`,mask:m}=n,h=x.useMemo(()=>{let e=Te(l,s);return e==null?null:{location:{pathname:e,search:u,hash:d,state:f,key:p,mask:m},navigationType:r}},[s,l,u,d,f,p,r,m]);return D(h!=null,`<Router basename="${s}"> is not able to match the URL "${l}${u}${d}" because it does not start with the basename, so the <Router> won't render anything.`),h==null?null:x.createElement($e.Provider,{value:c},x.createElement(et.Provider,{children:t,value:h}))}function Vt({children:e,location:t}){return P(Ht(e),t)}x.Component;function Ht(e,t=[]){let n=[];return x.Children.forEach(e,(e,r)=>{if(!x.isValidElement(e))return;let i=[...t,r];if(e.type===x.Fragment){n.push.apply(n,Ht(e.props.children,i));return}E(e.type===zt,`[${typeof e.type==`string`?e.type:e.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),E(!e.props.index||!e.props.children,`An index route cannot have child routes.`);let a={id:e.props.id||i.join(`-`),caseSensitive:e.props.caseSensitive,element:e.props.element,Component:e.props.Component,index:e.props.index,path:e.props.path,middleware:e.props.middleware,loader:e.props.loader,action:e.props.action,hydrateFallbackElement:e.props.hydrateFallbackElement,HydrateFallback:e.props.HydrateFallback,errorElement:e.props.errorElement,ErrorBoundary:e.props.ErrorBoundary,hasErrorBoundary:e.props.hasErrorBoundary===!0||e.props.ErrorBoundary!=null||e.props.errorElement!=null,shouldRevalidate:e.props.shouldRevalidate,handle:e.props.handle,lazy:e.props.lazy};e.props.children&&(a.children=Ht(e.props.children,i)),n.push(a)}),n}var Ut=`get`,Wt=`application/x-www-form-urlencoded`;function Gt(e){return typeof HTMLElement<`u`&&e instanceof HTMLElement}function Kt(e){return Gt(e)&&e.tagName.toLowerCase()===`button`}function qt(e){return Gt(e)&&e.tagName.toLowerCase()===`form`}function Jt(e){return Gt(e)&&e.tagName.toLowerCase()===`input`}function Yt(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}function Xt(e,t){return e.button===0&&(!t||t===`_self`)&&!Yt(e)}function Zt(e=``){return new URLSearchParams(typeof e==`string`||Array.isArray(e)||e instanceof URLSearchParams?e:Object.keys(e).reduce((t,n)=>{let r=e[n];return t.concat(Array.isArray(r)?r.map(e=>[n,e]):[[n,r]])},[]))}function Qt(e,t){let n=Zt(e);return t&&t.forEach((e,r)=>{n.has(r)||t.getAll(r).forEach(e=>{n.append(r,e)})}),n}var $t=null;function en(){if($t===null)try{new FormData(document.createElement(`form`),0),$t=!1}catch{$t=!0}return $t}var tn=new Set([`application/x-www-form-urlencoded`,`multipart/form-data`,`text/plain`]);function nn(e){return e!=null&&!tn.has(e)?(D(!1,`"${e}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${Wt}"`),null):e}function rn(e,t){let n,r,i,a,o;if(qt(e)){let o=e.getAttribute(`action`);r=o?Te(o,t):null,n=e.getAttribute(`method`)||Ut,i=nn(e.getAttribute(`enctype`))||Wt,a=new FormData(e)}else if(Kt(e)||Jt(e)&&(e.type===`submit`||e.type===`image`)){let o=e.form;if(o==null)throw Error(`Cannot submit a <button> or <input type="submit"> without a <form>`);let s=e.getAttribute(`formaction`)||o.getAttribute(`action`);if(r=s?Te(s,t):null,n=e.getAttribute(`formmethod`)||o.getAttribute(`method`)||Ut,i=nn(e.getAttribute(`formenctype`))||nn(o.getAttribute(`enctype`))||Wt,a=new FormData(o,e),!en()){let{name:t,type:n,value:r}=e;if(n===`image`){let e=t?`${t}.`:``;a.append(`${e}x`,`0`),a.append(`${e}y`,`0`)}else t&&a.append(t,r)}}else if(Gt(e))throw Error(`Cannot submit element that is not <form>, <button>, or <input type="submit|image">`);else n=Ut,r=null,i=Wt,o=e;return a&&i===`text/plain`&&(o=a,a=void 0),{action:r,method:n.toLowerCase(),encType:i,formData:a,body:o}}Object.getOwnPropertyNames(Object.prototype).sort().join(`\0`);function an(e,t){if(e===!1||e==null)throw Error(t)}function on(e,t,n,r){let i=typeof e==`string`?new URL(e,typeof window>`u`?`server://singlefetch/`:window.location.origin):e;return i.pathname=n?i.pathname.endsWith(`/`)?`${i.pathname}_.${r}`:`${i.pathname}.${r}`:i.pathname===`/`?`_root.${r}`:t&&Te(i.pathname,t)===`/`?`${Pe(t)}/_root.${r}`:`${Pe(i.pathname)}.${r}`,i}async function sn(e,t){if(e.id in t)return t[e.id];try{let n=await b(()=>import(e.module),void 0,import.meta.url);return t[e.id]=n,n}catch(t){return console.error(`Error loading route module \`${e.module}\`, reloading page...`),console.error(t),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function cn(e){return e!=null&&typeof e.page==`string`}function ln(e){return e==null?!1:e.href==null?e.rel===`preload`&&typeof e.imageSrcSet==`string`&&typeof e.imageSizes==`string`:typeof e.rel==`string`&&typeof e.href==`string`}async function un(e,t,n){return hn((await Promise.all(e.map(async e=>{let r=t.routes[e.route.id];if(r){let e=await sn(r,n);return e.links?e.links():[]}return[]}))).flat(1).filter(ln).filter(e=>e.rel===`stylesheet`||e.rel===`preload`).map(e=>e.rel===`stylesheet`?{...e,rel:`prefetch`,as:`style`}:{...e,rel:`prefetch`}))}function dn(e,t,n,r,i,a){let o=(e,t)=>!n[t]||e.route.id!==n[t].route.id,s=(e,t)=>n[t].pathname!==e.pathname||n[t].route.path?.endsWith(`*`)&&n[t].params[`*`]!==e.params[`*`];return a===`assets`?t.filter((e,t)=>o(e,t)||s(e,t)):a===`data`?t.filter((t,a)=>{let c=r.routes[t.route.id];if(!c||!c.hasLoader)return!1;if(o(t,a)||s(t,a))return!0;if(t.route.shouldRevalidate){let r=t.route.shouldRevalidate({currentUrl:new URL(i.pathname+i.search+i.hash,window.origin),currentParams:n[0]?.params||{},nextUrl:new URL(e,window.origin),nextParams:t.params,defaultShouldRevalidate:!0});if(typeof r==`boolean`)return r}return!0}):[]}function fn(e,t,{includeHydrateFallback:n}={}){return pn(e.map(e=>{let r=t.routes[e.route.id];if(!r)return[];let i=[r.module];return r.clientActionModule&&(i=i.concat(r.clientActionModule)),r.clientLoaderModule&&(i=i.concat(r.clientLoaderModule)),n&&r.hydrateFallbackModule&&(i=i.concat(r.hydrateFallbackModule)),r.imports&&(i=i.concat(r.imports)),i}).flat(1))}function pn(e){return[...new Set(e)]}function mn(e){let t={},n=Object.keys(e).sort();for(let r of n)t[r]=e[r];return t}function hn(e,t){let n=new Set,r=new Set(t);return e.reduce((e,i)=>{if(t&&!cn(i)&&i.as===`script`&&i.href&&r.has(i.href))return e;let a=JSON.stringify(mn(i));return n.has(a)||(n.add(a),e.push({key:a,link:i})),e},[])}function gn(){let e=x.useContext(Ke);return an(e,`You must render this element inside a <DataRouterContext.Provider> element`),e}function _n(){let e=x.useContext(qe);return an(e,`You must render this element inside a <DataRouterStateContext.Provider> element`),e}var vn=x.createContext(void 0);vn.displayName=`FrameworkContext`;function yn(){let e=x.useContext(vn);return an(e,`You must render this element inside a <HydratedRouter> element`),e}function bn(e,t){let n=x.useContext(vn),[r,i]=x.useState(!1),[a,o]=x.useState(!1),{onFocus:s,onBlur:c,onMouseEnter:l,onMouseLeave:u,onTouchStart:d}=t,f=x.useRef(null);x.useEffect(()=>{if(e===`render`&&o(!0),e===`viewport`){let e=new IntersectionObserver(e=>{e.forEach(e=>{o(e.isIntersecting)})},{threshold:.5});return f.current&&e.observe(f.current),()=>{e.disconnect()}}},[e]),x.useEffect(()=>{if(r){let e=setTimeout(()=>{o(!0)},100);return()=>{clearTimeout(e)}}},[r]);let p=()=>{i(!0)},m=()=>{i(!1),o(!1)};return n?e===`intent`?[a,f,{onFocus:xn(s,p),onBlur:xn(c,m),onMouseEnter:xn(l,p),onMouseLeave:xn(u,m),onTouchStart:xn(d,p)}]:[a,f,{}]:[!1,f,{}]}function xn(e,t){return n=>{e&&e(n),n.defaultPrevented||t(n)}}function Sn({page:e,...t}){let n=Ye(),{nonce:r}=yn(),{router:i}=gn(),a=x.useMemo(()=>A(i.routes,e,i.basename),[i.routes,e,i.basename]);return a?(t.nonce==null&&r&&(t={...t,nonce:r}),n?x.createElement(wn,{page:e,matches:a,...t}):x.createElement(Tn,{page:e,matches:a,...t})):null}function Cn(e){let{manifest:t,routeModules:n}=yn(),[r,i]=x.useState([]);return x.useEffect(()=>{let r=!1;return un(e,t,n).then(e=>{r||i(e)}),()=>{r=!0}},[e,t,n]),r}function wn({page:e,matches:t,...n}){let r=lt(),{future:i}=yn(),{basename:a}=gn(),o=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=on(e,a,i.v8_trailingSlashAwareDataRequests,`rsc`),o=!1,s=[];for(let e of t)typeof e.route.shouldRevalidate==`function`?o=!0:s.push(e.route.id);return o&&s.length>0&&n.searchParams.set(`_routes`,s.join(`,`)),[n.pathname+n.search]},[a,i.v8_trailingSlashAwareDataRequests,e,r,t]);return x.createElement(x.Fragment,null,o.map(e=>x.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})))}function Tn({page:e,matches:t,...n}){let r=lt(),{future:i,manifest:a,routeModules:o}=yn(),{basename:s}=gn(),{loaderData:c,matches:l}=_n(),u=x.useMemo(()=>dn(e,t,l,a,r,`data`),[e,t,l,a,r]),d=x.useMemo(()=>dn(e,t,l,a,r,`assets`),[e,t,l,a,r]),f=x.useMemo(()=>{if(e===r.pathname+r.search+r.hash)return[];let n=new Set,l=!1;if(t.forEach(e=>{let t=a.routes[e.route.id];!t||!t.hasLoader||(!u.some(t=>t.route.id===e.route.id)&&e.route.id in c&&o[e.route.id]?.shouldRevalidate||t.hasClientLoader?l=!0:n.add(e.route.id))}),n.size===0)return[];let d=on(e,s,i.v8_trailingSlashAwareDataRequests,`data`);return l&&n.size>0&&d.searchParams.set(`_routes`,t.filter(e=>n.has(e.route.id)).map(e=>e.route.id).join(`,`)),[d.pathname+d.search]},[s,i.v8_trailingSlashAwareDataRequests,c,r,a,u,t,e,o]),p=x.useMemo(()=>fn(d,a),[d,a]),m=Cn(d);return x.createElement(x.Fragment,null,f.map(e=>x.createElement(`link`,{key:e,rel:`prefetch`,as:`fetch`,href:e,...n})),p.map(e=>x.createElement(`link`,{key:e,rel:`modulepreload`,href:e,...n})),m.map(({key:e,link:t})=>x.createElement(`link`,{key:e,nonce:n.nonce,...t,crossOrigin:t.crossOrigin??n.crossOrigin})))}function En(...e){return t=>{e.forEach(e=>{typeof e==`function`?e(t):e!=null&&(e.current=t)})}}x.Component;var Dn=typeof window<`u`&&window.document!==void 0&&window.document.createElement!==void 0;try{Dn&&(window.__reactRouterVersion=`7.18.2`)}catch{}function On({basename:e,children:t,useTransitions:n,window:r}){let i=x.useRef();i.current??=te({window:r,v5Compat:!0});let a=i.current,[o,s]=x.useState({action:a.action,location:a.location}),c=x.useCallback(e=>{n===!1?s(e):x.startTransition(()=>s(e))},[n]);return x.useLayoutEffect(()=>a.listen(c),[a,c]),x.createElement(Bt,{basename:e,children:t,location:o.location,navigationType:o.action,navigator:a,useTransitions:n})}var kn=x.forwardRef(function({onClick:e,discover:t=`render`,prefetch:n=`none`,relative:r,reloadDocument:i,replace:a,mask:o,state:s,target:c,to:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m){let{basename:h,navigator:g,useTransitions:_}=x.useContext($e),v=typeof l==`string`&&S.test(l),y=Ve(l,h);l=y.to;let b=st(l,{relative:r}),C=lt(),w=null;if(o){let e=je(o,[],C.mask?C.mask.pathname:`/`,!0);h!==`/`&&(e.pathname=e.pathname===`/`?h:Ne([h,e.pathname])),w=g.createHref(e)}let[T,ee,te]=bn(n,p),E=Pn(l,{replace:a,mask:o,state:s,target:c,preventScrollReset:u,relative:r,viewTransition:d,defaultShouldRevalidate:f,useTransitions:_});function D(t){e&&e(t),t.defaultPrevented||E(t)}let ne=!(y.isExternal||i),re=x.createElement(`a`,{...p,...te,href:(ne?w:void 0)||y.absoluteURL||b,onClick:ne?D:e,ref:En(m,ee),target:c,"data-discover":!v&&t===`render`?`true`:void 0});return T&&!v?x.createElement(x.Fragment,null,re,x.createElement(Sn,{page:b})):re});kn.displayName=`Link`;var An=x.forwardRef(function({"aria-current":e=`page`,caseSensitive:t=!1,className:n=``,end:r=!1,style:i,to:a,viewTransition:o,children:s,...c},l){let u=_t(a,{relative:c.relative}),d=lt(),f=x.useContext(qe),{navigator:p,basename:m}=x.useContext($e),h=f!=null&&Bn(u)&&o===!0,g=p.encodeLocation?p.encodeLocation(u).pathname:u.pathname,_=d.pathname,v=f&&f.navigation&&f.navigation.location?f.navigation.location.pathname:null;t||(_=_.toLowerCase(),v=v?v.toLowerCase():null,g=g.toLowerCase()),v&&m&&(v=Te(v,m)||v);let y=g!==`/`&&g.endsWith(`/`)?g.length-1:g.length,b=_===g||!r&&_.startsWith(g)&&_.charAt(y)===`/`,S=v!=null&&(v===g||!r&&v.startsWith(g)&&v.charAt(g.length)===`/`),C={isActive:b,isPending:S,isTransitioning:h},w=b?e:void 0,T;T=typeof n==`function`?n(C):[n,b?`active`:null,S?`pending`:null,h?`transitioning`:null].filter(Boolean).join(` `);let ee=typeof i==`function`?i(C):i;return x.createElement(kn,{...c,"aria-current":w,className:T,ref:l,style:ee,to:a,viewTransition:o},typeof s==`function`?s(C):s)});An.displayName=`NavLink`;var jn=x.forwardRef(({discover:e=`render`,fetcherKey:t,navigate:n,reloadDocument:r,replace:i,state:a,method:o=Ut,action:s,onSubmit:c,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f,...p},m)=>{let{useTransitions:h}=x.useContext($e),g=Rn(),_=zn(s,{relative:l}),v=o.toLowerCase()===`get`?`get`:`post`,y=typeof s==`string`&&S.test(s);return x.createElement(`form`,{ref:m,method:v,action:_,onSubmit:r?c:e=>{if(c&&c(e),e.defaultPrevented)return;e.preventDefault();let r=e.nativeEvent.submitter,s=r?.getAttribute(`formmethod`)||o,p=()=>g(r||e.currentTarget,{fetcherKey:t,method:s,navigate:n,replace:i,state:a,relative:l,preventScrollReset:u,viewTransition:d,defaultShouldRevalidate:f});h&&n!==!1?x.startTransition(()=>p()):p()},...p,"data-discover":!y&&e===`render`?`true`:void 0})});jn.displayName=`Form`;function Mn(e){return`${e} must be used within a data router. See https://reactrouter.com/en/main/routers/picking-a-router.`}function Nn(e){let t=x.useContext(Ke);return E(t,Mn(e)),t}function Pn(e,{target:t,replace:n,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c,useTransitions:l}={}){let u=ft(),d=lt(),f=_t(e,{relative:o});return x.useCallback(p=>{if(Xt(p,t)){p.preventDefault();let t=n===void 0?ae(d)===ae(f):n,m=()=>u(e,{replace:t,mask:r,state:i,preventScrollReset:a,relative:o,viewTransition:s,defaultShouldRevalidate:c});l?x.startTransition(()=>m()):m()}},[d,u,f,n,r,i,t,e,a,o,s,c,l])}function Fn(e){D(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 t=x.useRef(Zt(e)),n=x.useRef(!1),r=lt(),i=x.useMemo(()=>Qt(r.search,n.current?null:t.current),[r.search]),a=ft();return[i,x.useCallback((e,t)=>{let r=Zt(typeof e==`function`?e(new URLSearchParams(i)):e);n.current=!0,a(`?`+r,t)},[a,i])]}var In=0,Ln=()=>`__${String(++In)}__`;function Rn(){let{router:e}=Nn(`useSubmit`),{basename:t}=x.useContext($e),n=jt(),r=e.fetch,i=e.navigate;return x.useCallback(async(e,a={})=>{let{action:o,method:s,encType:c,formData:l,body:u}=rn(e,t);if(a.navigate===!1){let e=a.fetcherKey||Ln();await r(e,n,a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,flushSync:a.flushSync})}else await i(a.action||o,{defaultShouldRevalidate:a.defaultShouldRevalidate,preventScrollReset:a.preventScrollReset,formData:l,body:u,formMethod:a.method||s,formEncType:a.encType||c,replace:a.replace,state:a.state,fromRouteId:n,flushSync:a.flushSync,viewTransition:a.viewTransition})},[r,i,t,n])}function zn(e,{relative:t}={}){let{basename:n}=x.useContext($e),r=x.useContext(N);E(r,`useFormAction must be used inside a RouteContext`);let[i]=r.matches.slice(-1),a={..._t(e||`.`,{relative:t})},o=lt();if(e==null){a.search=o.search;let e=new URLSearchParams(a.search),t=e.getAll(`index`);if(t.some(e=>e===``)){e.delete(`index`),t.filter(e=>e).forEach(t=>e.append(`index`,t));let n=e.toString();a.search=n?`?${n}`:``}}return(!e||e===`.`)&&i.route.index&&(a.search=a.search?a.search.replace(/^\?/,`?index&`):`?index`),n!==`/`&&(a.pathname=a.pathname===`/`?n:Ne([n,a.pathname])),ae(a)}function Bn(e,{relative:t}={}){let n=x.useContext(Xe);E(n!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`. Did you accidentally import `RouterProvider` from `react-router`?");let{basename:r}=Nn(`useViewTransitionState`),i=_t(e,{relative:t});if(!n.isTransitioning)return!1;let a=Te(n.currentLocation.pathname,r)||n.currentLocation.pathname,o=Te(n.nextLocation.pathname,r)||n.nextLocation.pathname;return xe(i.pathname,o)!=null||xe(i.pathname,a)!=null}var Vn=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(e){return this.listeners.add(e),this.onSubscribe(),()=>{this.listeners.delete(e),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},Hn=new class extends Vn{#e;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e();return window.addEventListener(`visibilitychange`,t,!1),()=>{window.removeEventListener(`visibilitychange`,t)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(e=>{typeof e==`boolean`?this.setFocused(e):this.onFocus()})}setFocused(e){this.#e!==e&&(this.#e=e,this.onFocus())}onFocus(){let e=this.isFocused();this.listeners.forEach(t=>{t(e)})}isFocused(){return typeof this.#e==`boolean`?this.#e:globalThis.document?.visibilityState!==`hidden`}},Un={setTimeout:(e,t)=>setTimeout(e,t),clearTimeout:e=>clearTimeout(e),setInterval:(e,t)=>setInterval(e,t),clearInterval:e=>clearInterval(e)},Wn=new class{#e=Un;setTimeoutProvider(e){this.#e=e}setTimeout(e,t){return this.#e.setTimeout(e,t)}clearTimeout(e){this.#e.clearTimeout(e)}setInterval(e,t){return this.#e.setInterval(e,t)}clearInterval(e){this.#e.clearInterval(e)}};function Gn(e){setTimeout(e,0)}var Kn=typeof window>`u`||`Deno`in globalThis;function qn(){}function Jn(e,t){return typeof e==`function`?e(t):e}function Yn(e){return typeof e==`number`&&e>=0&&e!==1/0}function Xn(e,t){return Math.max(e+(t||0)-Date.now(),0)}function Zn(e,t){return typeof e==`function`?e(t):e}function Qn(e,t){return typeof e==`function`?e(t):e}function $n(e,t){let{type:n=`all`,exact:r,fetchStatus:i,predicate:a,queryKey:o,stale:s}=e;if(o){if(r){if(t.queryHash!==tr(o,t.options))return!1}else if(!rr(t.queryKey,o))return!1}if(n!==`all`){let e=t.isActive();if(n===`active`&&!e||n===`inactive`&&e)return!1}return!(typeof s==`boolean`&&t.isStale()!==s||i&&i!==t.state.fetchStatus||a&&!a(t))}function er(e,t){let{exact:n,status:r,predicate:i,mutationKey:a}=e;if(a){if(!t.options.mutationKey)return!1;if(n){if(nr(t.options.mutationKey)!==nr(a))return!1}else if(!rr(t.options.mutationKey,a))return!1}return!(r&&t.state.status!==r||i&&!i(t))}function tr(e,t){return(t?.queryKeyHashFn||nr)(e)}function nr(e){return JSON.stringify(e,(e,t)=>cr(t)?Object.keys(t).sort().reduce((e,n)=>(e[n]=t[n],e),{}):t)}function rr(e,t){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(e&&t&&typeof e==`object`&&typeof t==`object`){if(Array.isArray(e)&&Array.isArray(t)){for(let n=0;n<t.length;n++)if(!rr(e[n],t[n]))return!1;return!0}let n=Object.keys(t);for(let r of n)if(!rr(e[r],t[r]))return!1;return!0}return!1}var ir=Object.prototype.hasOwnProperty;function ar(e,t,n=0){if(e===t)return e;if(n>500)return t;let r=sr(e)&&sr(t);if(!r&&!(cr(e)&&cr(t)))return t;let i=(r?e:Object.keys(e)).length,a=r?t:Object.keys(t),o=a.length,s=r?Array(o):{},c=0;for(let l=0;l<o;l++){let o=r?l:a[l],u=e[o],d=t[o];if(u===d){s[o]=u,(r?l<i:ir.call(e,o))&&c++;continue}if(u===null||d===null||typeof u!=`object`||typeof d!=`object`){s[o]=d;continue}let f=ar(u,d,n+1);s[o]=f,f===u&&c++}return i===o&&c===i?e:s}function or(e,t){if(!t||Object.keys(e).length!==Object.keys(t).length)return!1;for(let n in e)if(e[n]!==t[n])return!1;return!0}function sr(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function cr(e){if(!lr(e))return!1;let t=e.constructor;if(t===void 0)return!0;let n=t.prototype;return!(!lr(n)||!n.hasOwnProperty(`isPrototypeOf`)||Object.getPrototypeOf(e)!==Object.prototype)}function lr(e){return Object.prototype.toString.call(e)===`[object Object]`}function ur(e){return new Promise(t=>{Wn.setTimeout(t,e)})}function dr(e,t,n){return typeof n.structuralSharing==`function`?n.structuralSharing(e,t):n.structuralSharing===!1?t:ar(e,t)}function fr(e,t,n=0){let r=[...e,t];return n&&r.length>n?r.slice(1):r}function pr(e,t,n=0){let r=[t,...e];return n&&r.length>n?r.slice(0,-1):r}var mr=Symbol();function hr(e,t){return!e.queryFn&&t?.initialPromise?()=>t.initialPromise:!e.queryFn||e.queryFn===mr?()=>Promise.reject(Error(`Missing queryFn: '${e.queryHash}'`)):e.queryFn}function gr(e,t){return typeof e==`function`?e(...t):!!e}function _r(e,t,n){let r=!1,i;return Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(i??=t(),r?i:(r=!0,i.aborted?n():i.addEventListener(`abort`,n,{once:!0}),i))}),e}var vr=(()=>{let e=()=>Kn;return{isServer(){return e()},setIsServer(t){e=t}}})();function yr(){let e,t,n=new Promise((n,r)=>{e=n,t=r});n.status=`pending`,n.catch(()=>{});function r(e){Object.assign(n,e),delete n.resolve,delete n.reject}return n.resolve=t=>{r({status:`fulfilled`,value:t}),e(t)},n.reject=e=>{r({status:`rejected`,reason:e}),t(e)},n}var br=Gn;function xr(){let e=[],t=0,n=e=>{e()},r=e=>{e()},i=br,a=r=>{t?e.push(r):i(()=>{n(r)})},o=()=>{let t=e;e=[],t.length&&i(()=>{r(()=>{t.forEach(e=>{n(e)})})})};return{batch:e=>{let n;t++;try{n=e()}finally{t--,t||o()}return n},batchCalls:e=>(...t)=>{a(()=>{e(...t)})},schedule:a,setNotifyFunction:e=>{n=e},setBatchNotifyFunction:e=>{r=e},setScheduler:e=>{i=e}}}var Sr=xr(),Cr=new class extends Vn{#e=!0;#t;#n;constructor(){super(),this.#n=e=>{if(typeof window<`u`&&window.addEventListener){let t=()=>e(!0),n=()=>e(!1);return window.addEventListener(`online`,t,!1),window.addEventListener(`offline`,n,!1),()=>{window.removeEventListener(`online`,t),window.removeEventListener(`offline`,n)}}}}onSubscribe(){this.#t||this.setEventListener(this.#n)}onUnsubscribe(){this.hasListeners()||(this.#t?.(),this.#t=void 0)}setEventListener(e){this.#n=e,this.#t?.(),this.#t=e(this.setOnline.bind(this))}setOnline(e){this.#e!==e&&(this.#e=e,this.listeners.forEach(t=>{t(e)}))}isOnline(){return this.#e}};function wr(e){return Math.min(1e3*2**e,3e4)}function Tr(e){return(e??`online`)!==`online`||Cr.isOnline()}var Er=class extends Error{constructor(e){super(`CancelledError`),this.revert=e?.revert,this.silent=e?.silent}};function Dr(e){let t=!1,n=0,r,i=yr(),a=()=>i.status!==`pending`,o=t=>{if(!a()){let n=new Er(t);f(n),e.onCancel?.(n)}},s=()=>{t=!0},c=()=>{t=!1},l=()=>Hn.isFocused()&&(e.networkMode===`always`||Cr.isOnline())&&e.canRun(),u=()=>Tr(e.networkMode)&&e.canRun(),d=e=>{a()||(r?.(),i.resolve(e))},f=e=>{a()||(r?.(),i.reject(e))},p=()=>new Promise(t=>{r=e=>{(a()||l())&&t(e)},e.onPause?.()}).then(()=>{r=void 0,a()||e.onContinue?.()}),m=()=>{if(a())return;let r,i=n===0?e.initialPromise:void 0;try{r=i??e.fn()}catch(e){r=Promise.reject(e)}Promise.resolve(r).then(d).catch(r=>{if(a())return;let i=e.retry??(vr.isServer()?0:3),o=e.retryDelay??wr,s=typeof o==`function`?o(n,r):o,c=i===!0||typeof i==`number`&&n<i||typeof i==`function`&&i(n,r);if(t||!c){f(r);return}n++,e.onFail?.(n,r),ur(s).then(()=>l()?void 0:p()).then(()=>{t?f(r):m()})})};return{promise:i,status:()=>i.status,cancel:o,continue:()=>(r?.(),i),cancelRetry:s,continueRetry:c,canStart:u,start:()=>(u()?m():p().then(m),i)}}var Or=class{#e;destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Yn(this.gcTime)&&(this.#e=Wn.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(e){this.gcTime=Math.max(this.gcTime||0,e??(vr.isServer()?1/0:3e5))}clearGcTimeout(){this.#e!==void 0&&(Wn.clearTimeout(this.#e),this.#e=void 0)}};function kr(e){return{onFetch:(t,n)=>{let r=t.options,i=t.fetchOptions?.meta?.fetchMore?.direction,a=t.state.data?.pages||[],o=t.state.data?.pageParams||[],s={pages:[],pageParams:[]},c=0,l=async()=>{let n=!1,l=e=>{_r(e,()=>t.signal,()=>n=!0)},u=hr(t.options,t.fetchOptions),d=async(e,r,i)=>{if(n)return Promise.reject(t.signal.reason);if(r==null&&e.pages.length)return Promise.resolve(e);let a=(()=>{let e={client:t.client,queryKey:t.queryKey,pageParam:r,direction:i?`backward`:`forward`,meta:t.options.meta};return l(e),e})(),o=await u(a),{maxPages:s}=t.options,c=i?pr:fr;return{pages:c(e.pages,o,s),pageParams:c(e.pageParams,r,s)}};if(i&&a.length){let e=i===`backward`,t=e?jr:Ar,n={pages:a,pageParams:o};s=await d(n,t(r,n),e)}else{let t=e??a.length;do{let e=c===0?o[0]??r.initialPageParam:Ar(r,s);if(c>0&&e==null)break;s=await d(s,e),c++}while(c<t)}return s};t.fetchFn=t.options.persister?()=>t.options.persister?.(l,{client:t.client,queryKey:t.queryKey,meta:t.options.meta,signal:t.signal},n):l}}}function Ar(e,{pages:t,pageParams:n}){let r=t.length-1;return t.length>0?e.getNextPageParam(t[r],t,n[r],n):void 0}function jr(e,{pages:t,pageParams:n}){return t.length>0?e.getPreviousPageParam?.(t[0],t,n[0],n):void 0}var Mr=class extends Or{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e){super(),this.#s=!1,this.#o=e.defaultOptions,this.setOptions(e.options),this.observers=[],this.#i=e.client,this.#r=this.#i.getQueryCache(),this.queryKey=e.queryKey,this.queryHash=e.queryHash,this.#t=Fr(this.options),this.state=e.state??this.#t,this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return this.#e}get promise(){return this.#a?.promise}setOptions(e){if(this.options={...this.#o,...e},e?._type&&(this.#e=e._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){let e=Fr(this.options);e.data!==void 0&&(this.setState(Pr(e.data,e.dataUpdatedAt)),this.#t=e)}}optionalRemove(){!this.observers.length&&this.state.fetchStatus===`idle`&&this.#r.remove(this)}setData(e,t){let n=dr(this.state.data,e,this.options);return this.#l({data:n,type:`success`,dataUpdatedAt:t?.updatedAt,manual:t?.manual}),n}setState(e){this.#l({type:`setState`,state:e})}cancel(e){let t=this.#a?.promise;return this.#a?.cancel(e),t?t.then(qn).catch(qn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return this.#t}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(e=>Qn(e.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===mr||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0&&this.observers.some(e=>Zn(e.options.staleTime,this)===`static`)}isStale(){return this.getObserversCount()>0?this.observers.some(e=>e.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(e=0){return this.state.data===void 0?!0:e===`static`?!1:this.state.isInvalidated?!0:!Xn(this.state.dataUpdatedAt,e)}onFocus(){this.observers.find(e=>e.shouldFetchOnWindowFocus())?.refetch({cancelRefetch:!1}),this.#a?.continue()}onOnline(){this.observers.find(e=>e.shouldFetchOnReconnect())?.refetch({cancelRefetch:!1}),this.#a?.continue()}addObserver(e){this.observers.includes(e)||(this.observers.push(e),this.clearGcTimeout(),this.#r.notify({type:`observerAdded`,query:this,observer:e}))}removeObserver(e){this.observers.includes(e)&&(this.observers=this.observers.filter(t=>t!==e),this.observers.length||(this.#a&&(this.#s||this.#c()?this.#a.cancel({revert:!0}):this.#a.cancelRetry()),this.scheduleGc()),this.#r.notify({type:`observerRemoved`,query:this,observer:e}))}getObserversCount(){return this.observers.length}#c(){return this.state.fetchStatus===`paused`&&this.state.status===`pending`}invalidate(){this.state.isInvalidated||this.#l({type:`invalidate`})}async fetch(e,t){if(this.state.fetchStatus!==`idle`&&this.#a?.status()!==`rejected`){if(this.state.data!==void 0&&t?.cancelRefetch)this.cancel({silent:!0});else if(this.#a)return this.#a.continueRetry(),this.#a.promise}if(e&&this.setOptions(e),!this.options.queryFn){let e=this.observers.find(e=>e.options.queryFn);e&&this.setOptions(e.options)}let n=new AbortController,r=e=>{Object.defineProperty(e,"signal",{enumerable:!0,get:()=>(this.#s=!0,n.signal)})},i=()=>{let e=hr(this.options,t),n=(()=>{let e={client:this.#i,queryKey:this.queryKey,meta:this.meta};return r(e),e})();return this.#s=!1,this.options.persister?this.options.persister(e,n,this):e(n)},a=(()=>{let e={fetchOptions:t,options:this.options,queryKey:this.queryKey,client:this.#i,state:this.state,fetchFn:i};return r(e),e})();(this.#e===`infinite`?kr(this.options.pages):this.options.behavior)?.onFetch(a,this),this.#n=this.state,(this.state.fetchStatus===`idle`||this.state.fetchMeta!==a.fetchOptions?.meta)&&this.#l({type:`fetch`,meta:a.fetchOptions?.meta}),this.#a=Dr({initialPromise:t?.initialPromise,fn:a.fetchFn,onCancel:e=>{e instanceof Er&&e.revert&&this.setState({...this.#n,fetchStatus:`idle`}),n.abort()},onFail:(e,t)=>{this.#l({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#l({type:`pause`})},onContinue:()=>{this.#l({type:`continue`})},retry:a.options.retry,retryDelay:a.options.retryDelay,networkMode:a.options.networkMode,canRun:()=>!0});try{let e=await this.#a.start();if(e===void 0)throw Error(`${this.queryHash} data is undefined`);return this.setData(e),this.#r.config.onSuccess?.(e,this),this.#r.config.onSettled?.(e,this.state.error,this),e}catch(e){if(e instanceof Er){if(e.silent)return this.#a.promise;if(e.revert){if(this.state.data===void 0)throw e;return this.state.data}}throw this.#l({type:`error`,error:e}),this.#r.config.onError?.(e,this),this.#r.config.onSettled?.(this.state.data,e,this),e}finally{this.scheduleGc()}}#l(e){let t=t=>{switch(e.type){case`failed`:return{...t,fetchFailureCount:e.failureCount,fetchFailureReason:e.error};case`pause`:return{...t,fetchStatus:`paused`};case`continue`:return{...t,fetchStatus:`fetching`};case`fetch`:return{...t,...Nr(t.data,this.options),fetchMeta:e.meta??null};case`success`:let n={...t,...Pr(e.data,e.dataUpdatedAt),dataUpdateCount:t.dataUpdateCount+1,...!e.manual&&{fetchStatus:`idle`,fetchFailureCount:0,fetchFailureReason:null}};return this.#n=e.manual?n:void 0,n;case`error`:let r=e.error;return{...t,error:r,errorUpdateCount:t.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:t.fetchFailureCount+1,fetchFailureReason:r,fetchStatus:`idle`,status:`error`,isInvalidated:!0};case`invalidate`:return{...t,isInvalidated:!0};case`setState`:return{...t,...e.state}}};this.state=t(this.state),Sr.batch(()=>{this.observers.forEach(e=>{e.onQueryUpdate()}),this.#r.notify({query:this,type:`updated`,action:e})})}};function Nr(e,t){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:Tr(t.networkMode)?`fetching`:`paused`,...e===void 0&&{error:null,status:`pending`}}}function Pr(e,t){return{data:e,dataUpdatedAt:t??Date.now(),error:null,isInvalidated:!1,status:`success`}}function Fr(e){let t=typeof e.initialData==`function`?e.initialData():e.initialData,n=t!==void 0,r=n?typeof e.initialDataUpdatedAt==`function`?e.initialDataUpdatedAt():e.initialDataUpdatedAt:0;return{data:t,dataUpdateCount:0,dataUpdatedAt:n?r??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:n?`success`:`pending`,fetchStatus:`idle`}}var Ir=class extends Vn{constructor(e,t){super(),this.options=t,this.#e=e,this.#s=null,this.#o=yr(),this.bindMethods(),this.setOptions(t)}#e;#t=void 0;#n=void 0;#r=void 0;#i;#a;#o;#s;#c;#l;#u;#d;#f;#p;#m=new Set;bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(this.#t.addObserver(this),F(this.#t,this.options)?this.#h():this.updateResult(),this.#y())}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return Rr(this.#t,this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return Rr(this.#t,this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,this.#b(),this.#x(),this.#t.removeObserver(this)}setOptions(e){let t=this.options,n=this.#t;if(this.options=this.#e.defaultQueryOptions(e),this.options.enabled!==void 0&&typeof this.options.enabled!=`boolean`&&typeof this.options.enabled!=`function`&&typeof Qn(this.options.enabled,this.#t)!=`boolean`)throw Error(`Expected enabled to be a boolean or a callback that returns a boolean`);this.#S(),this.#t.setOptions(this.options),t._defaulted&&!or(this.options,t)&&this.#e.getQueryCache().notify({type:`observerOptionsUpdated`,query:this.#t,observer:this});let r=this.hasListeners();r&&zr(this.#t,n,this.options,t)&&this.#h(),this.updateResult(),r&&(this.#t!==n||Qn(this.options.enabled,this.#t)!==Qn(t.enabled,this.#t)||Zn(this.options.staleTime,this.#t)!==Zn(t.staleTime,this.#t))&&this.#g();let i=this.#_();r&&(this.#t!==n||Qn(this.options.enabled,this.#t)!==Qn(t.enabled,this.#t)||i!==this.#p)&&this.#v(i)}getOptimisticResult(e){let t=this.#e.getQueryCache().build(this.#e,e),n=this.createResult(t,e);return Vr(this,n)&&(this.#r=n,this.#a=this.options,this.#i=this.#t.state),n}getCurrentResult(){return this.#r}trackResult(e,t){return new Proxy(e,{get:(e,n)=>(this.trackProp(n),t?.(n),n===`promise`&&(this.trackProp(`data`),!this.options.experimental_prefetchInRender&&this.#o.status===`pending`&&this.#o.reject(Error(`experimental_prefetchInRender feature flag is not enabled`))),Reflect.get(e,n))})}trackProp(e){this.#m.add(e)}getCurrentQuery(){return this.#t}refetch({...e}={}){return this.fetch({...e})}fetchOptimistic(e){let t=this.#e.defaultQueryOptions(e),n=this.#e.getQueryCache().build(this.#e,t);return n.fetch().then(()=>this.createResult(n,t))}fetch(e){return this.#h({...e,cancelRefetch:e.cancelRefetch??!0}).then(()=>(this.updateResult(),this.#r))}#h(e){this.#S();let t=this.#t.fetch(this.options,e);return e?.throwOnError||(t=t.catch(qn)),t}#g(){this.#b();let e=Zn(this.options.staleTime,this.#t);if(vr.isServer()||this.#r.isStale||!Yn(e))return;let t=Xn(this.#r.dataUpdatedAt,e)+1;this.#d=Wn.setTimeout(()=>{this.#r.isStale||this.updateResult()},t)}#_(){return(typeof this.options.refetchInterval==`function`?this.options.refetchInterval(this.#t):this.options.refetchInterval)??!1}#v(e){this.#x(),this.#p=e,!(vr.isServer()||Qn(this.options.enabled,this.#t)===!1||!Yn(this.#p)||this.#p===0)&&(this.#f=Wn.setInterval(()=>{(this.options.refetchIntervalInBackground||Hn.isFocused())&&this.#h()},this.#p))}#y(){this.#g(),this.#v(this.#_())}#b(){this.#d!==void 0&&(Wn.clearTimeout(this.#d),this.#d=void 0)}#x(){this.#f!==void 0&&(Wn.clearInterval(this.#f),this.#f=void 0)}createResult(e,t){let n=this.#t,r=this.options,i=this.#r,a=this.#i,o=this.#a,s=e===n?this.#n:e.state,{state:c}=e,l={...c},u=!1,d;if(t._optimisticResults){let i=this.hasListeners(),a=!i&&F(e,t),o=i&&zr(e,n,t,r);(a||o)&&(l={...l,...Nr(c.data,e.options)}),t._optimisticResults===`isRestoring`&&(l.fetchStatus=`idle`)}let{error:f,errorUpdatedAt:p,status:m}=l;d=l.data;let h=!1;if(t.placeholderData!==void 0&&d===void 0&&m===`pending`){let e;i?.isPlaceholderData&&t.placeholderData===o?.placeholderData?(e=i.data,h=!0):e=typeof t.placeholderData==`function`?t.placeholderData(this.#u?.state.data,this.#u):t.placeholderData,e!==void 0&&(m=`success`,d=dr(i?.data,e,t),u=!0)}if(t.select&&d!==void 0&&!h){if(i&&d===a?.data&&t.select===this.#c)d=this.#l;else try{this.#c=t.select,d=t.select(d),d=dr(i?.data,d,t),this.#l=d,this.#s=null}catch(e){this.#s=e}}this.#s&&(f=this.#s,d=this.#l,p=Date.now(),m=`error`);let g=l.fetchStatus===`fetching`,_=m===`pending`,v=m===`error`,y=_&&g,b=d!==void 0,x={status:m,fetchStatus:l.fetchStatus,isPending:_,isSuccess:m===`success`,isError:v,isInitialLoading:y,isLoading:y,data:d,dataUpdatedAt:l.dataUpdatedAt,error:f,errorUpdatedAt:p,failureCount:l.fetchFailureCount,failureReason:l.fetchFailureReason,errorUpdateCount:l.errorUpdateCount,isFetched:e.isFetched(),isFetchedAfterMount:l.dataUpdateCount>s.dataUpdateCount||l.errorUpdateCount>s.errorUpdateCount,isFetching:g,isRefetching:g&&!_,isLoadingError:v&&!b,isPaused:l.fetchStatus===`paused`,isPlaceholderData:u,isRefetchError:v&&b,isStale:Br(e,t),refetch:this.refetch,promise:this.#o,isEnabled:Qn(t.enabled,e)!==!1};if(this.options.experimental_prefetchInRender){let t=x.data!==void 0,r=x.status===`error`&&!t,i=e=>{r?e.reject(x.error):t&&e.resolve(x.data)},a=()=>{let e=this.#o=x.promise=yr();i(e)},o=this.#o;switch(o.status){case`pending`:e.queryHash===n.queryHash&&i(o);break;case`fulfilled`:(r||x.data!==o.value)&&a();break;case`rejected`:(!r||x.error!==o.reason)&&a()}}return x}updateResult(){let e=this.#r,t=this.createResult(this.#t,this.options);this.#i=this.#t.state,this.#a=this.options,this.#i.data!==void 0&&(this.#u=this.#t),!or(t,e)&&(this.#r=t,this.#C({listeners:(()=>{if(!e)return!0;let{notifyOnChangeProps:t}=this.options,n=typeof t==`function`?t():t;if(n===`all`||!n&&!this.#m.size)return!0;let r=new Set(n??this.#m);return this.options.throwOnError&&r.add(`error`),Object.keys(this.#r).some(t=>{let n=t;return this.#r[n]!==e[n]&&r.has(n)})})()}))}#S(){let e=this.#e.getQueryCache().build(this.#e,this.options);if(e===this.#t)return;let t=this.#t;this.#t=e,this.#n=e.state,this.hasListeners()&&(t?.removeObserver(this),e.addObserver(this))}onQueryUpdate(){this.updateResult(),this.hasListeners()&&this.#y()}#C(e){Sr.batch(()=>{e.listeners&&this.listeners.forEach(e=>{e(this.#r)}),this.#e.getQueryCache().notify({query:this.#t,type:`observerResultsUpdated`})})}};function Lr(e,t){return Qn(t.enabled,e)!==!1&&e.state.data===void 0&&(e.state.status!==`error`||Qn(t.retryOnMount,e)!==!1)}function F(e,t){return Lr(e,t)||e.state.data!==void 0&&Rr(e,t,t.refetchOnMount)}function Rr(e,t,n){if(Qn(t.enabled,e)!==!1&&Zn(t.staleTime,e)!==`static`){let r=typeof n==`function`?n(e):n;return r===`always`||r!==!1&&Br(e,t)}return!1}function zr(e,t,n,r){return(e!==t||Qn(r.enabled,e)===!1)&&(!n.suspense||e.state.status!==`error`)&&Br(e,n)}function Br(e,t){return Qn(t.enabled,e)!==!1&&e.isStaleByTime(Zn(t.staleTime,e))}function Vr(e,t){return!or(e.getCurrentResult(),t)}var Hr=class extends Or{#e;#t;#n;#r;constructor(e){super(),this.#e=e.client,this.mutationId=e.mutationId,this.#n=e.mutationCache,this.#t=[],this.state=e.state||Ur(),this.setOptions(e.options),this.scheduleGc()}setOptions(e){this.options=e,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(e){this.#t.includes(e)||(this.#t.push(e),this.clearGcTimeout(),this.#n.notify({type:`observerAdded`,mutation:this,observer:e}))}removeObserver(e){this.#t=this.#t.filter(t=>t!==e),this.scheduleGc(),this.#n.notify({type:`observerRemoved`,mutation:this,observer:e})}optionalRemove(){this.#t.length||(this.state.status===`pending`?this.scheduleGc():this.#n.remove(this))}continue(){return this.#r?.continue()??this.execute(this.state.variables)}async execute(e){let t=()=>{this.#i({type:`continue`})},n={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};this.#r=Dr({fn:()=>this.options.mutationFn?this.options.mutationFn(e,n):Promise.reject(Error(`No mutationFn found`)),onFail:(e,t)=>{this.#i({type:`failed`,failureCount:e,error:t})},onPause:()=>{this.#i({type:`pause`})},onContinue:t,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>this.#n.canRun(this)});let r=this.state.status===`pending`,i=!this.#r.canStart();try{if(r)t();else{this.#i({type:`pending`,variables:e,isPaused:i}),this.#n.config.onMutate&&await this.#n.config.onMutate(e,this,n);let t=await this.options.onMutate?.(e,n);t!==this.state.context&&this.#i({type:`pending`,context:t,variables:e,isPaused:i})}let a=await this.#r.start();return await this.#n.config.onSuccess?.(a,e,this.state.context,this,n),await this.options.onSuccess?.(a,e,this.state.context,n),await this.#n.config.onSettled?.(a,null,this.state.variables,this.state.context,this,n),await this.options.onSettled?.(a,null,e,this.state.context,n),this.#i({type:`success`,data:a}),a}catch(t){try{await this.#n.config.onError?.(t,e,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onError?.(t,e,this.state.context,n)}catch(e){Promise.reject(e)}try{await this.#n.config.onSettled?.(void 0,t,this.state.variables,this.state.context,this,n)}catch(e){Promise.reject(e)}try{await this.options.onSettled?.(void 0,t,e,this.state.context,n)}catch(e){Promise.reject(e)}throw this.#i({type:`error`,error:t}),t}finally{this.#n.runNext(this)}}#i(e){let t=t=>{switch(e.type){case`failed`:return{...t,failureCount:e.failureCount,failureReason:e.error};case`pause`:return{...t,isPaused:!0};case`continue`:return{...t,isPaused:!1};case`pending`:return{...t,context:e.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:e.isPaused,status:`pending`,variables:e.variables,submittedAt:Date.now()};case`success`:return{...t,data:e.data,failureCount:0,failureReason:null,error:null,status:`success`,isPaused:!1};case`error`:return{...t,data:void 0,error:e.error,failureCount:t.failureCount+1,failureReason:e.error,isPaused:!1,status:`error`}}};this.state=t(this.state),Sr.batch(()=>{this.#t.forEach(t=>{t.onMutationUpdate(e)}),this.#n.notify({mutation:this,type:`updated`,action:e})})}};function Ur(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:`idle`,variables:void 0,submittedAt:0}}var Wr=class extends Vn{constructor(e={}){super(),this.config=e,this.#e=new Set,this.#t=new Map,this.#n=0}#e;#t;#n;build(e,t,n){let r=new Hr({client:e,mutationCache:this,mutationId:++this.#n,options:e.defaultMutationOptions(t),state:n});return this.add(r),r}add(e){this.#e.add(e);let t=Gr(e);if(typeof t==`string`){let n=this.#t.get(t);n?n.push(e):this.#t.set(t,[e])}this.notify({type:`added`,mutation:e})}remove(e){if(this.#e.delete(e)){let t=Gr(e);if(typeof t==`string`){let n=this.#t.get(t);if(n){if(n.length>1){let t=n.indexOf(e);t!==-1&&n.splice(t,1)}else n[0]===e&&this.#t.delete(t)}}}this.notify({type:`removed`,mutation:e})}canRun(e){let t=Gr(e);if(typeof t==`string`){let n=this.#t.get(t)?.find(e=>e.state.status===`pending`);return!n||n===e}return!0}runNext(e){let t=Gr(e);return typeof t==`string`?(this.#t.get(t)?.find(t=>t!==e&&t.state.isPaused))?.continue()??Promise.resolve():Promise.resolve()}clear(){Sr.batch(()=>{this.#e.forEach(e=>{this.notify({type:`removed`,mutation:e})}),this.#e.clear(),this.#t.clear()})}getAll(){return Array.from(this.#e)}find(e){let t={exact:!0,...e};return this.getAll().find(e=>er(t,e))}findAll(e={}){return this.getAll().filter(t=>er(e,t))}notify(e){Sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}resumePausedMutations(){let e=this.getAll().filter(e=>e.state.isPaused);return Sr.batch(()=>Promise.all(e.map(e=>e.continue().catch(qn))))}};function Gr(e){return e.options.scope?.id}var Kr=class extends Vn{#e;#t=void 0;#n;#r;constructor(e,t){super(),this.#e=e,this.setOptions(t),this.bindMethods(),this.#i()}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(e){let t=this.options;this.options=this.#e.defaultMutationOptions(e),or(this.options,t)||this.#e.getMutationCache().notify({type:`observerOptionsUpdated`,mutation:this.#n,observer:this}),t?.mutationKey&&this.options.mutationKey&&nr(t.mutationKey)!==nr(this.options.mutationKey)?this.reset():this.#n?.state.status===`pending`&&this.#n.setOptions(this.options)}onUnsubscribe(){this.hasListeners()||this.#n?.removeObserver(this)}onMutationUpdate(e){this.#i(),this.#a(e)}getCurrentResult(){return this.#t}reset(){this.#n?.removeObserver(this),this.#n=void 0,this.#i(),this.#a()}mutate(e,t){return this.#r=t,this.#n?.removeObserver(this),this.#n=this.#e.getMutationCache().build(this.#e,this.options),this.#n.addObserver(this),this.#n.execute(e)}#i(){let e=this.#n?.state??Ur();this.#t={...e,isPending:e.status===`pending`,isSuccess:e.status===`success`,isError:e.status===`error`,isIdle:e.status===`idle`,mutate:this.mutate,reset:this.reset}}#a(e){Sr.batch(()=>{if(this.#r&&this.hasListeners()){let t=this.#t.variables,n=this.#t.context,r={client:this.#e,meta:this.options.meta,mutationKey:this.options.mutationKey};if(e?.type===`success`){try{this.#r.onSuccess?.(e.data,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(e.data,null,t,n,r)}catch(e){Promise.reject(e)}}else if(e?.type===`error`){try{this.#r.onError?.(e.error,t,n,r)}catch(e){Promise.reject(e)}try{this.#r.onSettled?.(void 0,e.error,t,n,r)}catch(e){Promise.reject(e)}}}this.listeners.forEach(e=>{e(this.#t)})})}},qr=class extends Vn{constructor(e={}){super(),this.config=e,this.#e=new Map}#e;build(e,t,n){let r=t.queryKey,i=t.queryHash??tr(r,t),a=this.get(i);return a||(a=new Mr({client:e,queryKey:r,queryHash:i,options:e.defaultQueryOptions(t),state:n,defaultOptions:e.getQueryDefaults(r)}),this.add(a)),a}add(e){this.#e.has(e.queryHash)||(this.#e.set(e.queryHash,e),this.notify({type:`added`,query:e}))}remove(e){let t=this.#e.get(e.queryHash);t&&(e.destroy(),t===e&&this.#e.delete(e.queryHash),this.notify({type:`removed`,query:e}))}clear(){Sr.batch(()=>{this.getAll().forEach(e=>{this.remove(e)})})}get(e){return this.#e.get(e)}getAll(){return[...this.#e.values()]}find(e){let t={exact:!0,...e};return this.getAll().find(e=>$n(t,e))}findAll(e={}){let t=this.getAll();return Object.keys(e).length>0?t.filter(t=>$n(e,t)):t}notify(e){Sr.batch(()=>{this.listeners.forEach(t=>{t(e)})})}onFocus(){Sr.batch(()=>{this.getAll().forEach(e=>{e.onFocus()})})}onOnline(){Sr.batch(()=>{this.getAll().forEach(e=>{e.onOnline()})})}},Jr=class{#e;#t;#n;#r;#i;#a;#o;#s;constructor(e={}){this.#e=e.queryCache||new qr,this.#t=e.mutationCache||new Wr,this.#n=e.defaultOptions||{},this.#r=new Map,this.#i=new Map,this.#a=0}mount(){this.#a++,this.#a===1&&(this.#o=Hn.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onFocus())}),this.#s=Cr.subscribe(async e=>{e&&(await this.resumePausedMutations(),this.#e.onOnline())}))}unmount(){this.#a--,this.#a===0&&(this.#o?.(),this.#o=void 0,this.#s?.(),this.#s=void 0)}isFetching(e){return this.#e.findAll({...e,fetchStatus:`fetching`}).length}isMutating(e){return this.#t.findAll({...e,status:`pending`}).length}getQueryData(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state.data}ensureQueryData(e){let t=this.defaultQueryOptions(e),n=this.#e.build(this,t),r=n.state.data;return r===void 0?this.fetchQuery(e):(e.revalidateIfStale&&n.isStaleByTime(Zn(t.staleTime,n))&&this.prefetchQuery(t),Promise.resolve(r))}getQueriesData(e){return this.#e.findAll(e).map(({queryKey:e,state:t})=>[e,t.data])}setQueryData(e,t,n){let r=this.defaultQueryOptions({queryKey:e}),i=this.#e.get(r.queryHash)?.state.data,a=Jn(t,i);if(a!==void 0)return this.#e.build(this,r).setData(a,{...n,manual:!0})}setQueriesData(e,t,n){return Sr.batch(()=>this.#e.findAll(e).map(({queryKey:e})=>[e,this.setQueryData(e,t,n)]))}getQueryState(e){let t=this.defaultQueryOptions({queryKey:e});return this.#e.get(t.queryHash)?.state}removeQueries(e){let t=this.#e;Sr.batch(()=>{t.findAll(e).forEach(e=>{t.remove(e)})})}resetQueries(e,t){let n=this.#e;return Sr.batch(()=>(n.findAll(e).forEach(e=>{e.reset()}),this.refetchQueries({type:`active`,...e},t)))}cancelQueries(e,t={}){let n={revert:!0,...t},r=Sr.batch(()=>this.#e.findAll(e).map(e=>e.cancel(n)));return Promise.all(r).then(qn).catch(qn)}invalidateQueries(e,t={}){return Sr.batch(()=>(this.#e.findAll(e).forEach(e=>{e.invalidate()}),e?.refetchType===`none`?Promise.resolve():this.refetchQueries({...e,type:e?.refetchType??e?.type??`active`},t)))}refetchQueries(e,t={}){let n={...t,cancelRefetch:t.cancelRefetch??!0},r=Sr.batch(()=>this.#e.findAll(e).filter(e=>!e.isDisabled()&&!e.isStatic()).map(e=>{let t=e.fetch(void 0,n);return n.throwOnError||(t=t.catch(qn)),e.state.fetchStatus===`paused`?Promise.resolve():t}));return Promise.all(r).then(qn)}fetchQuery(e){let t=this.defaultQueryOptions(e);t.retry===void 0&&(t.retry=!1);let n=this.#e.build(this,t);return n.isStaleByTime(Zn(t.staleTime,n))?n.fetch(t):Promise.resolve(n.state.data)}prefetchQuery(e){return this.fetchQuery(e).then(qn).catch(qn)}fetchInfiniteQuery(e){return e._type=`infinite`,this.fetchQuery(e)}prefetchInfiniteQuery(e){return this.fetchInfiniteQuery(e).then(qn).catch(qn)}ensureInfiniteQueryData(e){return e._type=`infinite`,this.ensureQueryData(e)}resumePausedMutations(){return Cr.isOnline()?this.#t.resumePausedMutations():Promise.resolve()}getQueryCache(){return this.#e}getMutationCache(){return this.#t}getDefaultOptions(){return this.#n}setDefaultOptions(e){this.#n=e}setQueryDefaults(e,t){this.#r.set(nr(e),{queryKey:e,defaultOptions:t})}getQueryDefaults(e){let t=[...this.#r.values()],n={};return t.forEach(t=>{rr(e,t.queryKey)&&Object.assign(n,t.defaultOptions)}),n}setMutationDefaults(e,t){this.#i.set(nr(e),{mutationKey:e,defaultOptions:t})}getMutationDefaults(e){let t=[...this.#i.values()],n={};return t.forEach(t=>{rr(e,t.mutationKey)&&Object.assign(n,t.defaultOptions)}),n}defaultQueryOptions(e){if(e._defaulted)return e;let t={...this.#n.queries,...this.getQueryDefaults(e.queryKey),...e,_defaulted:!0};return t.queryHash||=tr(t.queryKey,t),t.refetchOnReconnect===void 0&&(t.refetchOnReconnect=t.networkMode!==`always`),t.throwOnError===void 0&&(t.throwOnError=!!t.suspense),!t.networkMode&&t.persister&&(t.networkMode=`offlineFirst`),t.queryFn===mr&&(t.enabled=!1),t}defaultMutationOptions(e){return e?._defaulted?e:{...this.#n.mutations,...e?.mutationKey&&this.getMutationDefaults(e.mutationKey),...e,_defaulted:!0}}clear(){this.#e.clear(),this.#t.clear()}},Yr=o((e=>{var t=Symbol.for(`react.transitional.element`),n=Symbol.for(`react.fragment`);function r(e,n,r){var i=null;if(r!==void 0&&(i=``+r),n.key!==void 0&&(i=``+n.key),`key`in n)for(var a in r={},n)a!==`key`&&(r[a]=n[a]);else r=n;return n=r.ref,{$$typeof:t,type:e,key:i,ref:n===void 0?null:n,props:r}}e.Fragment=n,e.jsx=r,e.jsxs=r})),I=o(((e,t)=>{t.exports=Yr()}))(),Xr=x.createContext(void 0),Zr=e=>{let t=x.useContext(Xr);if(e)return e;if(!t)throw Error(`No QueryClient set, use QueryClientProvider to set one`);return t},Qr=({client:e,children:t})=>(x.useEffect(()=>(e.mount(),()=>{e.unmount()}),[e]),(0,I.jsx)(Xr.Provider,{value:e,children:t})),$r=x.createContext(!1),ei=()=>x.useContext($r);$r.Provider;function ti(){let e=!1;return{clearReset:()=>{e=!1},reset:()=>{e=!0},isReset:()=>e}}var ni=x.createContext(ti()),ri=()=>x.useContext(ni),ii=(e,t,n)=>{let r=n?.state.error&&typeof e.throwOnError==`function`?gr(e.throwOnError,[n.state.error,n]):e.throwOnError;(e.suspense||e.experimental_prefetchInRender||r)&&(t.isReset()||(e.retryOnMount=!1))},ai=e=>{x.useEffect(()=>{e.clearReset()},[e])},oi=({result:e,errorResetBoundary:t,throwOnError:n,query:r,suspense:i})=>e.isError&&!t.isReset()&&!e.isFetching&&r&&(i&&e.data===void 0||gr(n,[e.error,r])),si=e=>{if(e.suspense){let t=1e3,n=e=>e===`static`?e:Math.max(e??t,t),r=e.staleTime;e.staleTime=typeof r==`function`?(...e)=>n(r(...e)):n(r),typeof e.gcTime==`number`&&(e.gcTime=Math.max(e.gcTime,t))}},ci=(e,t)=>e.isLoading&&e.isFetching&&!t,li=(e,t)=>e?.suspense&&t.isPending,ui=(e,t,n)=>t.fetchOptimistic(e).catch(()=>{n.clearReset()});function di(e,t,n){let r=ei(),i=ri(),a=Zr(n),o=a.defaultQueryOptions(e);a.getDefaultOptions().queries?._experimental_beforeQuery?.(o);let s=a.getQueryCache().get(o.queryHash),c=e.subscribed!==!1;o._optimisticResults=r?`isRestoring`:c?`optimistic`:void 0,si(o),ii(o,i,s),ai(i);let l=!a.getQueryCache().get(o.queryHash),[u]=x.useState(()=>new t(a,o)),d=u.getOptimisticResult(o),f=!r&&c;if(x.useSyncExternalStore(x.useCallback(e=>{let t=f?u.subscribe(Sr.batchCalls(e)):qn;return u.updateResult(),t},[u,f]),()=>u.getCurrentResult(),()=>u.getCurrentResult()),x.useEffect(()=>{u.setOptions(o)},[o,u]),li(o,d))throw ui(o,u,i);if(oi({result:d,errorResetBoundary:i,throwOnError:o.throwOnError,query:s,suspense:o.suspense}))throw d.error;return a.getDefaultOptions().queries?._experimental_afterQuery?.(o,d),o.experimental_prefetchInRender&&!vr.isServer()&&ci(d,r)&&(l?ui(o,u,i):s?.promise)?.catch(qn).finally(()=>{u.updateResult()}),o.notifyOnChangeProps?d:u.trackResult(d)}function fi(e,t){return di(e,Ir,t)}function pi(e,t){let n=Zr(t),[r]=x.useState(()=>new Kr(n,e));x.useEffect(()=>{r.setOptions(e)},[r,e]);let i=x.useSyncExternalStore(x.useCallback(e=>r.subscribe(Sr.batchCalls(e)),[r]),()=>r.getCurrentResult(),()=>r.getCurrentResult()),a=x.useCallback((e,t)=>{r.mutate(e,t).catch(qn)},[r]);if(i.error&&gr(r.options.throwOnError,[i.error]))throw i.error;return{...i,mutate:a,mutateAsync:i.mutate}}var mi=g(),hi=/\{[^{}]+\}/g,gi=()=>typeof process==`object`&&Number.parseInt(process?.versions?.node?.substring(0,2))>=18&&process.versions.undici;function _i(){return Math.random().toString(36).slice(2,11)}function vi(e){let{baseUrl:t=``,Request:n=globalThis.Request,fetch:r=globalThis.fetch,querySerializer:i,bodySerializer:a,pathSerializer:o,headers:s,requestInitExt:c=void 0,...l}={...e};c=gi()?c:void 0,t=Di(t);let u=[];async function d(e,d){let{baseUrl:f,fetch:p=r,Request:m=n,headers:h,params:g={},parseAs:_=`json`,querySerializer:v,bodySerializer:y=a??wi,pathSerializer:b,body:x,middleware:S=[],...C}=d||{},w=t;f&&(w=Di(f)??t);let T=typeof i==`function`?i:Si(i);v&&(T=typeof v==`function`?v:Si({...typeof i==`object`?i:{},...v}));let ee=b||o||Ci,te=x===void 0?void 0:y(x,Ei(s,h,g.header)),E=Ei(te===void 0||te instanceof FormData?{}:{"Content-Type":`application/json`},s,h,g.header),D=[...u,...S],ne={redirect:`follow`,...l,...C,body:te,headers:E},re,ie,ae=new m(Ti(e,{baseUrl:w,params:g,querySerializer:T,pathSerializer:ee}),ne),O;for(let e in C)e in ae||(ae[e]=C[e]);if(D.length){re=_i(),ie=Object.freeze({baseUrl:w,fetch:p,parseAs:_,querySerializer:T,bodySerializer:y,pathSerializer:ee});for(let t of D)if(t&&typeof t==`object`&&typeof t.onRequest==`function`){let n=await t.onRequest({request:ae,schemaPath:e,params:g,options:ie,id:re});if(n){if(n instanceof m)ae=n;else if(n instanceof Response){O=n;break}else throw Error(`onRequest: must return new Request() or Response() when modifying the request`)}}}if(!O){try{O=await p(ae,c)}catch(t){let n=t;if(D.length)for(let t=D.length-1;t>=0;t--){let r=D[t];if(r&&typeof r==`object`&&typeof r.onError==`function`){let t=await r.onError({request:ae,error:n,schemaPath:e,params:g,options:ie,id:re});if(t){if(t instanceof Response){n=void 0,O=t;break}if(t instanceof Error){n=t;continue}throw Error(`onError: must return new Response() or instance of Error`)}}}if(n)throw n}if(D.length)for(let t=D.length-1;t>=0;t--){let n=D[t];if(n&&typeof n==`object`&&typeof n.onResponse==`function`){let t=await n.onResponse({request:ae,response:O,schemaPath:e,params:g,options:ie,id:re});if(t){if(!(t instanceof Response))throw Error(`onResponse: must return new Response() when modifying the response`);O=t}}}}let oe=O.headers.get(`Content-Length`);if(O.status===204||ae.method===`HEAD`||oe===`0`&&!O.headers.get(`Transfer-Encoding`)?.includes(`chunked`))return O.ok?{data:void 0,response:O}:{error:void 0,response:O};if(O.ok)return{data:await(async()=>{if(_===`stream`)return O.body;if(_===`json`&&!oe){let e=await O.text();return e?JSON.parse(e):void 0}return await O[_]()})(),response:O};let k=await O.text();try{k=JSON.parse(k)}catch{}return{error:k,response:O}}return{request(e,t,n){return d(t,{...n,method:e.toUpperCase()})},GET(e,t){return d(e,{...t,method:`GET`})},PUT(e,t){return d(e,{...t,method:`PUT`})},POST(e,t){return d(e,{...t,method:`POST`})},DELETE(e,t){return d(e,{...t,method:`DELETE`})},OPTIONS(e,t){return d(e,{...t,method:`OPTIONS`})},HEAD(e,t){return d(e,{...t,method:`HEAD`})},PATCH(e,t){return d(e,{...t,method:`PATCH`})},TRACE(e,t){return d(e,{...t,method:`TRACE`})},use(...e){for(let t of e)if(t){if(typeof t!=`object`||!(`onRequest`in t||`onResponse`in t||`onError`in t))throw Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");u.push(t)}},eject(...e){for(let t of e){let e=u.indexOf(t);e!==-1&&u.splice(e,1)}}}}function yi(e,t,n){if(t==null)return``;if(typeof t==`object`)throw Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${e}=${n?.allowReserved===!0?t:encodeURIComponent(t)}`}function bi(e,t,n){if(!t||typeof t!=`object`)return``;let r=[],i={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`;if(n.style!==`deepObject`&&n.explode===!1){for(let e in t)r.push(e,n.allowReserved===!0?t[e]:encodeURIComponent(t[e]));let i=r.join(`,`);switch(n.style){case`form`:return`${e}=${i}`;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return i}}for(let i in t){let a=n.style===`deepObject`?`${e}[${i}]`:i;r.push(yi(a,t[i],n))}let a=r.join(i);return n.style===`label`||n.style===`matrix`?`${i}${a}`:a}function xi(e,t,n){if(!Array.isArray(t))return``;if(n.explode===!1){let r={form:`,`,spaceDelimited:`%20`,pipeDelimited:`|`}[n.style]||`,`,i=(n.allowReserved===!0?t:t.map(e=>encodeURIComponent(e))).join(r);switch(n.style){case`simple`:return i;case`label`:return`.${i}`;case`matrix`:return`;${e}=${i}`;default:return`${e}=${i}`}}let r={simple:`,`,label:`.`,matrix:`;`}[n.style]||`&`,i=[];for(let r of t)n.style===`simple`||n.style===`label`?i.push(n.allowReserved===!0?r:encodeURIComponent(r)):i.push(yi(e,r,n));return n.style===`label`||n.style===`matrix`?`${r}${i.join(r)}`:i.join(r)}function Si(e){return function(t){let n=[];if(t&&typeof t==`object`)for(let r in t){let i=t[r];if(i!=null){if(Array.isArray(i)){if(i.length===0)continue;n.push(xi(r,i,{style:`form`,explode:!0,...e?.array,allowReserved:e?.allowReserved||!1}));continue}if(typeof i==`object`){n.push(bi(r,i,{style:`deepObject`,explode:!0,...e?.object,allowReserved:e?.allowReserved||!1}));continue}n.push(yi(r,i,e))}}return n.join(`&`)}}function Ci(e,t){let n=e;for(let r of e.match(hi)??[]){let e=r.substring(1,r.length-1),i=!1,a=`simple`;if(e.endsWith(`*`)&&(i=!0,e=e.substring(0,e.length-1)),e.startsWith(`.`)?(a=`label`,e=e.substring(1)):e.startsWith(`;`)&&(a=`matrix`,e=e.substring(1)),!t||t[e]===void 0||t[e]===null)continue;let o=t[e];if(Array.isArray(o)){n=n.replace(r,xi(e,o,{style:a,explode:i}));continue}if(typeof o==`object`){n=n.replace(r,bi(e,o,{style:a,explode:i}));continue}if(a===`matrix`){n=n.replace(r,`;${yi(e,o)}`);continue}n=n.replace(r,a===`label`?`.${encodeURIComponent(o)}`:encodeURIComponent(o))}return n}function wi(e,t){return e instanceof FormData?e:t&&(t.get instanceof Function?t.get(`Content-Type`)??t.get(`content-type`):t[`Content-Type`]??t[`content-type`])===`application/x-www-form-urlencoded`?new URLSearchParams(e).toString():JSON.stringify(e)}function Ti(e,t){let n=`${t.baseUrl}${e}`;t.params?.path&&(n=t.pathSerializer(n,t.params.path));let r=t.querySerializer(t.params.query??{});return r.startsWith(`?`)&&(r=r.substring(1)),r&&(n+=`?${r}`),n}function Ei(...e){let t=new Headers;for(let n of e){if(!n||typeof n!=`object`)continue;let e=n instanceof Headers?n.entries():Object.entries(n);for(let[n,r]of e)if(r===null)t.delete(n);else if(Array.isArray(r))for(let e of r)t.append(n,e);else r!==void 0&&t.set(n,r)}return t}function Di(e){return e.endsWith(`/`)?e.substring(0,e.length-1):e}var Oi=class extends Error{status;constructor(e,t){super(e),this.status=t,this.name=`ApiError`}};function ki(){try{return localStorage.getItem(`moadim.apiToken`)?.trim()||void 0}catch{return}}function Ai(e,t={}){let n=ki();if(!n)return fetch(e,t);let r=new Headers(t.headers);return!r.has(`authorization`)&&!r.has(`x-moadim-token`)&&r.set(`authorization`,`Bearer ${n}`),fetch(e,{...t,headers:r})}var L=vi({baseUrl:`/api/v1`,fetch:Ai});function ji(e){return e===401?` Set the UI token with localStorage.setItem('moadim.apiToken', '<MOADIM_API_TOKEN>').`:``}function R({data:e,error:t,response:n}){if(t!==void 0||!n.ok)throw new Oi((t?.error??`HTTP ${n.status}`)+ji(n.status),n.status);if(e===void 0)throw new Oi(`empty response body`,n.status);return e}function Mi({error:e,response:t}){if(e!==void 0||!t.ok)throw new Oi((e?.error??`HTTP ${t.status}`)+ji(t.status),t.status)}function Ni(e=1e4){return fi({queryKey:[`health`],queryFn:async()=>R(await L.GET(`/health`)),refetchInterval:e,retry:!1})}function Pi(){let e=Zr();return pi({mutationFn:async()=>R(await L.POST(`/crontab-sync/retry`)),onSuccess:t=>e.setQueryData([`health`],t)})}function z(){return pi({mutationFn:async()=>R(await L.POST(`/shutdown`))})}function Fi(){return fi({queryKey:[`machine`],queryFn:async()=>R(await L.GET(`/machine`))})}function Ii(){return fi({queryKey:[`machines`],queryFn:async()=>R(await L.GET(`/machines`))})}function Li(){let e=Zr();return pi({mutationFn:async e=>R(await L.PUT(`/machine`,{body:{name:e}})),onSuccess:()=>{e.invalidateQueries({queryKey:[`machine`]}),e.invalidateQueries({queryKey:[`machines`]})}})}function Ri(){return fi({queryKey:[`agents`],queryFn:async()=>R(await L.GET(`/agents`))})}function zi(){return fi({queryKey:[`config`,`user-prompt`],queryFn:async()=>{let{data:e,error:t,response:n}=await L.GET(`/config/user-prompt`,{parseAs:`text`});return R({data:e,error:t,response:n})}})}function Bi(){let e=Zr();return pi({mutationFn:async e=>Mi(await L.PUT(`/config/user-prompt`,{body:{content:e}})),onSuccess:()=>{e.invalidateQueries({queryKey:[`config`,`user-prompt`]})}})}function Vi(){return fi({queryKey:[`config`,`max-concurrent-runs`],queryFn:async()=>R(await L.GET(`/config/max-concurrent-runs`))})}function Hi(){let e=Zr();return pi({mutationFn:async e=>R(await L.PUT(`/config/max-concurrent-runs`,{body:{value:e}})),onSuccess:t=>{e.setQueryData([`config`,`max-concurrent-runs`],t)}})}function Ui(e={},t){return fi({queryKey:[`routines`,e],queryFn:async()=>R(await L.GET(`/routines`,{params:{query:e}})),...t})}function Wi(e,t=!0){return fi({queryKey:[`routines`,e],queryFn:async()=>R(await L.GET(`/routines/{id}`,{params:{path:{id:e}}})),enabled:t&&e.length>0})}function Gi(e,t){e.invalidateQueries({queryKey:[`routines`]}),t&&e.invalidateQueries({queryKey:[`routines`,t]})}function Ki(){let e=Zr();return pi({mutationFn:async e=>R(await L.POST(`/routines`,{body:e})),onSuccess:()=>Gi(e)})}function qi(){let e=Zr();return pi({mutationFn:async({id:e,body:t})=>R(await L.PATCH(`/routines/{id}`,{params:{path:{id:e}},body:t})),onSuccess:(t,{id:n})=>Gi(e,n)})}function Ji(){let e=Zr();return pi({mutationFn:async({id:e,body:t})=>R(await L.POST(`/routines/{id}/move`,{params:{path:{id:e}},body:t})),onSuccess:(t,{id:n})=>Gi(e,n)})}function Yi(){let e=Zr();return pi({mutationFn:async e=>R(await L.DELETE(`/routines/{id}`,{params:{path:{id:e}}})),onSuccess:(t,n)=>Gi(e,n)})}function Xi(){let e=Zr();return pi({mutationFn:async e=>{try{return await Zi(e,!1)}catch(t){if(!Qi(t)||!window.confirm(`System power saving is active. Run this routine anyway?`))throw t;return Zi(e,!0)}},onSuccess:(t,n)=>Gi(e,n)})}async function Zi(e,t){return R(await L.POST(`/routines/{id}/trigger`,{params:{path:{id:e}},body:{override_system_power_saving:t}}))}function Qi(e){return e instanceof Oi&&e.status===423&&e.message===`locked: system power saving is active`}function $i(){let e=Zr();return pi({mutationFn:async()=>R(await L.POST(`/routines/cleanup`)),onSuccess:()=>Gi(e)})}function ea(){return fi({queryKey:[`routines`,`lock`],queryFn:async()=>R(await L.GET(`/routines/lock`))})}function ta(){let e=Zr();return pi({mutationFn:async e=>R(await L.DELETE(`/routines/lock`,{params:{query:{scope:e}}})),onSuccess:()=>void e.invalidateQueries({queryKey:[`routines`,`lock`]})})}function na(e,t){return fi({queryKey:[`routines`,`runs`,e],queryFn:async()=>R(await L.GET(`/routines/runs`,{params:{query:{limit:e}}})),...t})}function ra(e,t=!0){return fi({queryKey:[`routines`,e,`runs`],queryFn:async()=>R(await L.GET(`/routines/{id}/runs`,{params:{path:{id:e}}})),enabled:t&&e.length>0})}async function ia(e){let{data:t,error:n,response:r}=await e;return R({data:t,error:n,response:r})}function aa(e,t=!0){return fi({queryKey:[`routines`,e,`logs`],queryFn:()=>ia(L.GET(`/routines/{id}/logs`,{params:{path:{id:e}},parseAs:`text`})),enabled:t&&e.length>0})}function oa(e,t,n=!0){return fi({queryKey:[`routines`,e,`runs`,t,`log`],queryFn:()=>ia(L.GET(`/routines/{id}/runs/{workbench}/log`,{params:{path:{id:e,workbench:t}},parseAs:`text`})),enabled:n&&e.length>0&&t.length>0})}function sa(e,t=!0){return fi({queryKey:[`routines`,e,`flags`],queryFn:async()=>R(await L.GET(`/routines/{id}/flags`,{params:{path:{id:e}}})),enabled:t&&e.length>0})}function ca(){let e=Zr();return pi({mutationFn:async({id:e,filename:t})=>Mi(await L.DELETE(`/routines/{id}/flags/{filename}`,{params:{path:{id:e,filename:t}}})),onSuccess:(t,{id:n})=>void e.invalidateQueries({queryKey:[`routines`,n,`flags`]})})}function la(e){return e?`/api/v1/routines.ics?routine=${encodeURIComponent(e)}`:`/api/v1/routines.ics`}var ua=`moadim.notify-failures`;function da(){try{return localStorage.getItem(ua)===`1`}catch{return!1}}function fa(e){try{localStorage.setItem(ua,e?`1`:`0`)}catch{}}function pa(){return typeof Notification<`u`}function ma(){return pa()?Notification.permission:`unsupported`}async function ha(){return pa()?Notification.permission==="default"?Notification.requestPermission():Notification.permission:`unsupported`}function ga(e){return new Map(e.map(e=>[e.workbench,e.status]))}function _a(e,t){return e.filter(e=>e.status===`failed`&&t.get(e.workbench)!==`failed`)}function va(e){return{title:`${e.routine_title} failed`,body:e.exit_code==null?`Run failed`:`Exit code ${e.exit_code}`}}function ya(e){if(ma()!==`granted`)return;let{title:t,body:n}=va(e);new Notification(t,{body:n,tag:e.workbench})}var ba=`moadim.notification-log`;function xa(e){if(typeof e!=`object`||!e)return!1;let t=e;return typeof t.id==`string`&&typeof t.routineId==`string`&&typeof t.routineTitle==`string`&&typeof t.message==`string`&&typeof t.atSecs==`number`&&typeof t.read==`boolean`}function Sa(){try{let e=localStorage.getItem(ba);if(e===null)return[];let t=JSON.parse(e);return Array.isArray(t)?t.filter(xa):[]}catch{return[]}}function Ca(e){try{localStorage.setItem(ba,JSON.stringify(e))}catch{}}function wa(e,t){let n=new Set(e.map(e=>e.id)),r=t.filter(e=>!n.has(e.workbench)).map(e=>({id:e.workbench,routineId:e.routine_id,routineTitle:e.routine_title,message:e.exit_code==null?`Run failed`:`Run failed (exit ${e.exit_code})`,atSecs:e.finished_at??e.started_at,read:!1}));return r.length===0?e:[...r,...e].slice(0,50)}function Ta(e){return e.missed_scheduled_run_at==null?void 0:`missed:${e.id}:${e.missed_scheduled_run_at}`}function Ea(e,t){let n=new Set(e.map(e=>e.id)),r=t.flatMap(e=>{let t=Ta(e);return t===void 0||n.has(t)?[]:[{id:t,routineId:e.id,routineTitle:e.title,message:`Scheduled run was missed — review or run manually`,atSecs:e.missed_scheduled_run_at??0,read:!1}]});return r.length===0?e:(r.sort((e,t)=>t.atSecs-e.atSecs||e.routineTitle.localeCompare(t.routineTitle)),[...r,...e].slice(0,50))}function Da(e){return e.filter(e=>!e.read).length}function Oa(e){return e.some(e=>!e.read)?e.map(e=>({...e,read:!0})):e}var ka=`moadim.client.theme`,Aa=`moadim-theme-change`;function ja(){try{return localStorage.getItem(ka)!==`dark`}catch{return!0}}function Ma(e){try{localStorage.setItem(ka,e?`light`:`dark`)}catch{}window.dispatchEvent(new CustomEvent(Aa,{detail:{light:e}}))}function Na(e){document.documentElement.classList.toggle(`theme-light`,e)}var Pa=[{key:`o`,route:`/`,label:`Overview`},{key:`r`,route:`/routines`,label:`Routines`},{key:`u`,route:`/runs`,label:`Runs`},{key:`h`,route:`/heatmap`,label:`Heatmap`},{key:`l`,route:`/reliability`,label:`Reliability`},{key:`m`,route:`/machines`,label:`Machines`},{key:`s`,route:`/settings`,label:`Settings`}];function Fa(e){return Pa.find(t=>t.key===e.toLowerCase())?.route}function Ia(e){if(!(e instanceof HTMLElement))return!1;let t=e.tagName;return t===`INPUT`||t===`TEXTAREA`||t===`SELECT`||e.closest(`[contenteditable]:not([contenteditable="false"])`)!==null}var La=o(((e,t)=>{(function(n,r){typeof e==`object`&&typeof t==`object`?t.exports=r():typeof define==`function`&&define.amd?define(`cronstrue`,[],r):typeof e==`object`?e.cronstrue=r():n.cronstrue=r()})(globalThis,()=>(()=>{var e={949(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.CronParser=void 0;var r=n(515);t.CronParser=function(){function e(e,t,n){t===void 0&&(t=!0),n===void 0&&(n=!1),this.expression=e,this.dayOfWeekStartIndexZero=t,this.monthStartIndexZero=n}return e.prototype.parse=function(){var e,t=this.expression??``;if(t===`@reboot`)return e=[`@reboot`,``,``,``,``,``,``],e;if(t.startsWith(`@`)){var n=this.parseSpecial(this.expression);e=this.extractParts(n)}else e=this.extractParts(this.expression);return this.normalize(e),this.validate(e),e},e.prototype.parseSpecial=function(e){var t={"@yearly":`0 0 1 1 *`,"@annually":`0 0 1 1 *`,"@monthly":`0 0 1 * *`,"@weekly":`0 0 * * 0`,"@daily":`0 0 * * *`,"@midnight":`0 0 * * *`,"@hourly":`0 * * * *`,"@reboot":`@reboot`}[e];if(!t)throw Error(`Unknown special expression.`);return t},e.prototype.extractParts=function(e){if(!this.expression)throw Error(`cron expression is empty`);for(var t=e.trim().split(/[ ]+/),n=0;n<t.length;n++)if(t[n].includes(`,`)){var r=t[n].split(`,`).map(function(e){return e.trim()}).filter(function(e){return e!==``}).map(function(e){return isNaN(Number(e))?e:Number(e)}).filter(function(e){return e!==null&&e!==``});r.length===0&&r.push(`*`),r.sort(function(e,t){return e!==null&&t!==null?e-t:0}),t[n]=r.map(function(e){return e===null?``:e.toString()}).join(`,`)}if(t.length<5)throw Error(`Expression has only ${t.length} part${t.length==1?``:`s`}. At least 5 parts are required.`);if(t.length==5)t.unshift(``),t.push(``);else if(t.length==6)/\d{4}$/.test(t[5])||t[4]==`?`||t[2]==`?`?t.unshift(``):t.push(``);else if(t.length>7)throw Error(`Expression has ${t.length} parts; too many!`);return t},e.prototype.normalize=function(e){var t=this;if(e[3]=e[3].replace(`?`,`*`),e[5]=e[5].replace(`?`,`*`),e[2]=e[2].replace(`?`,`*`),e[0].indexOf(`0/`)==0&&(e[0]=e[0].replace(`0/`,`*/`)),e[1].indexOf(`0/`)==0&&(e[1]=e[1].replace(`0/`,`*/`)),e[2].indexOf(`0/`)==0&&(e[2]=e[2].replace(`0/`,`*/`)),e[3].indexOf(`1/`)==0&&(e[3]=e[3].replace(`1/`,`*/`)),e[4].indexOf(`1/`)==0&&(e[4]=e[4].replace(`1/`,`*/`)),e[6].indexOf(`1/`)==0&&(e[6]=e[6].replace(`1/`,`*/`)),e[5]=e[5].replace(/(^\d)|([^#/\s]\d)/g,function(e){var n=e.replace(/\D/,``),r=n;return t.dayOfWeekStartIndexZero?n==`7`&&(r=`0`):r=(parseInt(n)-1).toString(),e.replace(n,r)}),e[5]==`L`&&(e[5]=`6`),e[3]==`?`&&(e[3]=`*`),e[3].indexOf(`W`)>-1&&(e[3].indexOf(`,`)>-1||e[3].indexOf(`-`)>-1))throw Error(`The 'W' character can be specified only when the day-of-month is a single day, not a range or list of days.`);var n={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var r in n)e[5]=e[5].replace(new RegExp(r,`gi`),n[r].toString());e[4]=e[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(e){var n=e.replace(/\D/,``),r=n;return t.monthStartIndexZero&&(r=(parseInt(n)+1).toString()),e.replace(n,r)});var i={JAN:1,FEB:2,MAR:3,APR:4,MAY:5,JUN:6,JUL:7,AUG:8,SEP:9,OCT:10,NOV:11,DEC:12};for(var a in i)e[4]=e[4].replace(new RegExp(a,`gi`),i[a].toString());e[0]==`0`&&(e[0]=``),!/\*|\-|\,|\//.test(e[2])&&(/\*|\//.test(e[1])||/\*|\//.test(e[0]))&&(e[2]+=`-${e[2]}`);for(var o=0;o<e.length;o++)if(e[o].indexOf(`,`)!=-1&&(e[o]=e[o].split(`,`).filter(function(e){return e!==``}).join(`,`)||`*`),e[o]==`*/1`&&(e[o]=`*`),e[o].indexOf(`/`)>-1&&!/^\*|\-|\,/.test(e[o])){var s=null;switch(o){case 4:s=`12`;break;case 5:s=`6`;break;case 6:s=`9999`;break;default:s=null}if(s!==null){var c=e[o].split(`/`);e[o]=`${c[0]}-${s}/${c[1]}`}}},e.prototype.validate=function(e){var t=`0-9,\\-*/`;this.validateOnlyExpectedCharactersFound(e[0],t),this.validateOnlyExpectedCharactersFound(e[1],t),this.validateOnlyExpectedCharactersFound(e[2],t),this.validateOnlyExpectedCharactersFound(e[3],`0-9,\\-*/LW`),this.validateOnlyExpectedCharactersFound(e[4],t),this.validateOnlyExpectedCharactersFound(e[5],`0-9,\\-*/L#`),this.validateOnlyExpectedCharactersFound(e[6],t),this.validateAnyRanges(e)},e.prototype.validateAnyRanges=function(e){r.default.secondRange(e[0]),r.default.minuteRange(e[1]),r.default.hourRange(e[2]),r.default.dayOfMonthRange(e[3]),r.default.monthRange(e[4],this.monthStartIndexZero),r.default.dayOfWeekRange(e[5],this.dayOfWeekStartIndexZero)},e.prototype.validateOnlyExpectedCharactersFound=function(e,t){var n=e.match(RegExp(`[^${t}]+`,`gi`));if(n&&n.length)throw Error(`Expression contains invalid values: '${n.toString()}'`)},e}()},333(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.ExpressionDescriptor=void 0;var r=n(823),i=n(949);t.ExpressionDescriptor=function(){function e(t,n){if(this.expression=t,this.options=n,this.expressionParts=[,,,,,],!this.options.locale&&e.defaultLocale&&(this.options.locale=e.defaultLocale),!e.locales[this.options.locale]){var r=Object.keys(e.locales)[0];console.warn(`Locale '${this.options.locale}' could not be found; falling back to '${r}'.`),this.options.locale=r}this.i18n=e.locales[this.options.locale],n.use24HourTimeFormat===void 0&&(n.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return e.toString=function(t,n){var r=n===void 0?{}:n,i=r.throwExceptionOnParseError,a=i===void 0||i,o=r.verbose,s=o!==void 0&&o,c=r.dayOfWeekStartIndexZero,l=c===void 0||c,u=r.monthStartIndexZero,d=u!==void 0&&u,f=r.use24HourTimeFormat,p=r.trimHoursLeadingZero,m=p!==void 0&&p,h=r.locale,g=h===void 0?null:h,_=r.logicalAndDayFields,v={throwExceptionOnParseError:a,verbose:s,dayOfWeekStartIndexZero:l,monthStartIndexZero:d,use24HourTimeFormat:f,trimHoursLeadingZero:m,locale:g,logicalAndDayFields:_!==void 0&&_};return v.tzOffset&&console.warn(`'tzOffset' option has been deprecated and is no longer supported.`),new e(t,v).getFullDescription()},e.initialize=function(t,n){n===void 0&&(n=`en`),e.specialCharacters=[`/`,`-`,`,`,`*`],e.defaultLocale=n,t.load(e.locales)},e.prototype.getFullDescription=function(){var e,t=``;try{var n=new i.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=n.parse(),this.expressionParts[0]===`@reboot`)return(e=this.i18n).atReboot?.call(e)||`Run once, at startup`;var r=this.getTimeOfDayDescription(),a=this.getDayOfMonthDescription(),o=this.getMonthDescription(),s=this.getDayOfWeekDescription(),c=this.getYearDescription();t+=r+a+s+o+c,t=this.transformVerbosity(t,!!this.options.verbose),t=t.charAt(0).toLocaleUpperCase()+t.substr(1)}catch(e){if(!this.options.throwExceptionOnParseError)t=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw`${e}`}return t},e.prototype.getTimeOfDayDescription=function(){var t=this.expressionParts[0],n=this.expressionParts[1],i=this.expressionParts[2],a=``;if(!r.StringUtilities.containsAny(n,e.specialCharacters)&&!r.StringUtilities.containsAny(i,e.specialCharacters)&&!r.StringUtilities.containsAny(t,e.specialCharacters))a+=this.i18n.atSpace()+this.formatTime(i,n,t);else if(!t&&n.indexOf(`-`)>-1&&!(n.indexOf(`,`)>-1)&&!(n.indexOf(`/`)>-1)&&!r.StringUtilities.containsAny(i,e.specialCharacters)){var o=n.split(`-`);a+=r.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(i,o[0],``),this.formatTime(i,o[1],``))}else if(!t&&i.indexOf(`,`)>-1&&i.indexOf(`-`)==-1&&i.indexOf(`/`)==-1&&!r.StringUtilities.containsAny(n,e.specialCharacters)){var s=i.split(`,`);a+=this.i18n.at();for(var c=0;c<s.length;c++)a&&(a+=` `),a+=this.formatTime(s[c],n,``),c<s.length-2&&(a+=`,`),c==s.length-2&&(a+=this.i18n.spaceAnd())}else{var l=this.getSecondsDescription(),u=this.getMinutesDescription(),d=this.getHoursDescription();if(a+=l,a&&u&&(a+=`, `),a+=u,u===d)return a;a&&d&&(a+=`, `),a+=d}return a},e.prototype.getSecondsDescription=function(){var e=this;return this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(e){return e},function(t){return r.StringUtilities.format(e.i18n.everyX0Seconds(t),t)},function(t){return e.i18n.secondsX0ThroughX1PastTheMinute()},function(t){return t==`0`?``:parseInt(t)<20?e.i18n.atX0SecondsPastTheMinute(t):e.i18n.atX0SecondsPastTheMinuteGt20()||e.i18n.atX0SecondsPastTheMinute(t)})},e.prototype.getMinutesDescription=function(){var e=this,t=this.expressionParts[0],n=this.expressionParts[2];return this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(e){return e},function(t){return r.StringUtilities.format(e.i18n.everyX0Minutes(t),t)},function(t){return e.i18n.minutesX0ThroughX1PastTheHour()},function(r){var i;try{return r==`0`&&n.indexOf(`/`)==-1&&t==``?e.i18n.everyHour():r==`0`?(i=e.i18n).onTheHour?.call(i)||e.i18n.atX0MinutesPastTheHour(r):parseInt(r)<20?e.i18n.atX0MinutesPastTheHour(r):e.i18n.atX0MinutesPastTheHourGt20()||e.i18n.atX0MinutesPastTheHour(r)}catch{return e.i18n.atX0MinutesPastTheHour(r)}})},e.prototype.getHoursDescription=function(){var e=this,t=this.expressionParts[2],n=0,i=[];t.split(`/`)[0].split(`,`).forEach(function(e){var t=e.split(`-`);t.length===2&&i.push({value:t[1],index:n+1}),n+=t.length});var a=0;return this.getSegmentDescription(t,this.i18n.everyHour(),function(t){var n=i.find(function(e){return e.value===t&&e.index===a})&&e.expressionParts[1]!==`0`;return a++,n?e.formatTime(t,`59`,``):e.formatTime(t,`0`,``)},function(t){return r.StringUtilities.format(e.i18n.everyX0Hours(t),t)},function(t){return e.i18n.betweenX0AndX1()},function(t){return e.i18n.atX0()})},e.prototype.getDayOfWeekDescription=function(){var e=this,t=this.i18n.daysOfTheWeek(),n=null;return n=this.expressionParts[5]==`*`?``:this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(n,r){var i=n;n.indexOf(`#`)>-1?i=n.substring(0,n.indexOf(`#`)):n.indexOf(`L`)>-1&&(i=i.replace(`L`,``));var a=parseInt(i),o=e.i18n.daysOfTheWeekInCase?e.i18n.daysOfTheWeekInCase(r)[a]:t[a];if(n.indexOf(`#`)>-1){var s=null,c=n.substring(n.indexOf(`#`)+1),l=n.substring(0,n.indexOf(`#`));switch(c){case`1`:s=e.i18n.first(l);break;case`2`:s=e.i18n.second(l);break;case`3`:s=e.i18n.third(l);break;case`4`:s=e.i18n.fourth(l);break;case`5`:s=e.i18n.fifth(l)}o=s+` `+o}return o},function(t){return parseInt(t)==1?``:r.StringUtilities.format(e.i18n.commaEveryX0DaysOfTheWeek(t),t)},function(t){var n=t.substring(0,t.indexOf(`-`));return e.expressionParts[3]==`*`?e.i18n.commaX0ThroughX1(n):e.i18n.commaAndX0ThroughX1(n)},function(t){var n=null;if(t.indexOf(`#`)>-1){var r=t.substring(t.indexOf(`#`)+1),i=t.substring(0,t.indexOf(`#`));n=e.i18n.commaOnThe(r,i).trim()+e.i18n.spaceX0OfTheMonth()}else n=t.indexOf(`L`)>-1?e.i18n.commaOnTheLastX0OfTheMonth(t.replace(`L`,``)):e.expressionParts[3]==`*`||e.options.logicalAndDayFields?e.i18n.commaOnlyOnX0(t):e.i18n.commaAndOnX0();return n}),n},e.prototype.getMonthDescription=function(){var e=this,t=this.i18n.monthsOfTheYear();return this.getSegmentDescription(this.expressionParts[4],``,function(n,r){return r&&e.i18n.monthsOfTheYearInCase?e.i18n.monthsOfTheYearInCase(r)[parseInt(n)-1]:t[parseInt(n)-1]},function(t){return parseInt(t)==1?``:r.StringUtilities.format(e.i18n.commaEveryX0Months(t),t)},function(t){return e.i18n.commaMonthX0ThroughMonthX1()||e.i18n.commaX0ThroughX1()},function(t){return e.i18n.commaOnlyInMonthX0?e.i18n.commaOnlyInMonthX0():e.i18n.commaOnlyInX0()})},e.prototype.getDayOfMonthDescription=function(){var e=this,t=null,n=this.expressionParts[3];switch(n){case`L`:t=this.i18n.commaOnTheLastDayOfTheMonth();break;case`WL`:case`LW`:t=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var i=n.match(/(\d{1,2}W)|(W\d{1,2})/);if(i){var a=parseInt(i[0].replace(`W`,``)),o=a==1?this.i18n.firstWeekday():r.StringUtilities.format(this.i18n.weekdayNearestDayX0(),a.toString());t=r.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),o);break}var s=n.match(/L-(\d{1,2})/);if(s){var c=s[1];t=r.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(c),c);break}if(n==`*`&&this.expressionParts[5]!=`*`)return``;t=this.getSegmentDescription(n,this.i18n.commaEveryDay(),function(t){return t==`L`?e.i18n.lastDay():e.i18n.dayX0?r.StringUtilities.format(e.i18n.dayX0(),t):t},function(t){return t==`1`?e.i18n.commaEveryDay():e.i18n.commaEveryX0Days(t)},function(t){return e.i18n.commaBetweenDayX0AndX1OfTheMonth(t)},function(t){return e.i18n.commaOnDayX0OfTheMonth(t)})}return t},e.prototype.getYearDescription=function(){var e=this;return this.getSegmentDescription(this.expressionParts[6],``,function(e){return/^\d+$/.test(e)?new Date(parseInt(e),1).getFullYear().toString():e},function(t){return r.StringUtilities.format(e.i18n.commaEveryX0Years(t),t)},function(t){return e.i18n.commaYearX0ThroughYearX1()||e.i18n.commaX0ThroughX1()},function(t){return e.i18n.commaOnlyInYearX0?e.i18n.commaOnlyInYearX0():e.i18n.commaOnlyInX0()})},e.prototype.getSegmentDescription=function(e,t,n,i,a,o){var s=null,c=e.indexOf(`/`)>-1,l=e.indexOf(`-`)>-1,u=e.indexOf(`,`)>-1;if(!e)s=``;else if(e===`*`)s=t;else if(!c&&!l&&!u)s=r.StringUtilities.format(o(e),n(e));else if(u){for(var d=e.split(`,`),f=``,p=this.i18n.spaceAnd(),m=0;m<d.length;m++)if(m>0&&d.length>2&&(f+=`,`,m<d.length-1&&(f+=` `)),m>0&&d.length>1&&(m==d.length-1||d.length==2)&&(f+=p==`,`&&d.length>2?` `:`${p} `),d[m].indexOf(`/`)>-1||d[m].indexOf(`-`)>-1){var h=d[m].indexOf(`-`)>-1&&d[m].indexOf(`/`)==-1,g=this.getSegmentDescription(d[m],t,n,i,h?this.i18n.commaX0ThroughX1:a,o);h&&(g=g.replace(`, `,``)),f+=g}else if(!c)f+=n(d[m]);else{var _=this.getSegmentDescription(d[m],t,n,i,a,o);_&&_.startsWith(`, `)&&(_=_.substring(2)),f+=_}s=c?f:r.StringUtilities.format(o(e),f)}else if(c){var d=e.split(`/`);if(s=r.StringUtilities.format(i(d[1]),d[1]),d[0].indexOf(`-`)>-1){var v=this.generateRangeSegmentDescription(d[0],a,n);v.indexOf(`, `)!=0&&(s+=`, `),s+=v}else if(d[0].indexOf(`*`)==-1){var y=r.StringUtilities.format(o(d[0]),n(d[0]));y=y.replace(`, `,``),s+=r.StringUtilities.format(this.i18n.commaStartingX0(),y)}}else l&&(s=this.generateRangeSegmentDescription(e,a,n));return s},e.prototype.generateRangeSegmentDescription=function(e,t,n){var i=``,a=e.split(`-`),o=n(a[0],1),s=n(a[1],2),c=t(e);return i+=r.StringUtilities.format(c,o,s),i},e.prototype.formatTime=function(e,t,n){var r=0,i=0,a=parseInt(e)+r,o=parseInt(t)+i;o>=60?(o-=60,a+=1):o<0&&(o+=60,--a),a>=24?a-=24:a<0&&(a=24+a);var s=``,c=!1;this.options.use24HourTimeFormat||(c=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),s=c?`${this.getPeriod(a)} `:` ${this.getPeriod(a)}`,a>12&&(a-=12),a===0&&(a=12));var l=``;n&&(l=`:${(`00`+n).substring(n.length)}`);var u=a.toString(),d=(`00`+u).substring(u.length),f=o.toString(),p=(`00`+f).substring(f.length),m=this.options.trimHoursLeadingZero?u:d;return`${c?s:``}${m}:${p}${l}${c?``:s}`},e.prototype.transformVerbosity=function(e,t){if(!t&&(e=e.replace(RegExp(`, ${this.i18n.everyMinute()}`,`g`),``),e=e.replace(RegExp(`, ${this.i18n.everyHour()}`,`g`),``),e=e.replace(new RegExp(this.i18n.commaEveryDay(),`g`),``),e=e.replace(/\, ?$/,``),this.i18n.conciseVerbosityReplacements))for(var n=0,r=Object.entries(this.i18n.conciseVerbosityReplacements());n<r.length;n++){var i=r[n],a=i[0],o=i[1];e=e.replace(new RegExp(a,`g`),o)}return e},e.prototype.getPeriod=function(e){return e>=12?this.i18n.pm&&this.i18n.pm()||`PM`:this.i18n.am&&this.i18n.am()||`AM`},e.locales={},e}()},747(e,t,n){Object.defineProperty(t,"__esModule",{value:!0}),t.enLocaleLoader=void 0;var r=n(486);t.enLocaleLoader=function(){function e(){}return e.prototype.load=function(e){e.en=new r.en},e}()},486(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.en=void 0,t.en=function(){function e(){}return e.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},e.prototype.atX0MinutesPastTheHourGt20=function(){return null},e.prototype.commaMonthX0ThroughMonthX1=function(){return null},e.prototype.commaYearX0ThroughYearX1=function(){return null},e.prototype.use24HourTimeFormatByDefault=function(){return!1},e.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return`An error occurred when generating the expression description. Check the cron expression syntax.`},e.prototype.everyMinute=function(){return`every minute`},e.prototype.everyHour=function(){return`every hour`},e.prototype.atSpace=function(){return`At `},e.prototype.everyMinuteBetweenX0AndX1=function(){return`Every minute between %s and %s`},e.prototype.at=function(){return`At`},e.prototype.spaceAnd=function(){return` and`},e.prototype.everySecond=function(){return`every second`},e.prototype.everyX0Seconds=function(){return`every %s seconds`},e.prototype.secondsX0ThroughX1PastTheMinute=function(){return`seconds %s through %s past the minute`},e.prototype.atX0SecondsPastTheMinute=function(){return`at %s seconds past the minute`},e.prototype.everyX0Minutes=function(){return`every %s minutes`},e.prototype.minutesX0ThroughX1PastTheHour=function(){return`minutes %s through %s past the hour`},e.prototype.atX0MinutesPastTheHour=function(){return`at %s minutes past the hour`},e.prototype.everyX0Hours=function(){return`every %s hours`},e.prototype.betweenX0AndX1=function(){return`between %s and %s`},e.prototype.atX0=function(){return`at %s`},e.prototype.commaEveryDay=function(){return`, every day`},e.prototype.commaEveryX0DaysOfTheWeek=function(){return`, every %s days of the week`},e.prototype.commaX0ThroughX1=function(){return`, %s through %s`},e.prototype.commaAndX0ThroughX1=function(){return`, %s through %s`},e.prototype.first=function(){return`first`},e.prototype.second=function(){return`second`},e.prototype.third=function(){return`third`},e.prototype.fourth=function(){return`fourth`},e.prototype.fifth=function(){return`fifth`},e.prototype.commaOnThe=function(){return`, on the `},e.prototype.spaceX0OfTheMonth=function(){return` %s of the month`},e.prototype.lastDay=function(){return`the last day`},e.prototype.commaOnTheLastX0OfTheMonth=function(){return`, on the last %s of the month`},e.prototype.commaOnlyOnX0=function(){return`, only on %s`},e.prototype.commaAndOnX0=function(){return`, and on %s`},e.prototype.commaEveryX0Months=function(){return`, every %s months`},e.prototype.commaOnlyInX0=function(){return`, only in %s`},e.prototype.commaOnTheLastDayOfTheMonth=function(){return`, on the last day of the month`},e.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return`, on the last weekday of the month`},e.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return`, %s days before the last day of the month`},e.prototype.firstWeekday=function(){return`first weekday`},e.prototype.weekdayNearestDayX0=function(){return`weekday nearest day %s`},e.prototype.commaOnTheX0OfTheMonth=function(){return`, on the %s of the month`},e.prototype.commaEveryX0Days=function(){return`, every %s days in a month`},e.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return`, between day %s and %s of the month`},e.prototype.commaOnDayX0OfTheMonth=function(){return`, on day %s of the month`},e.prototype.commaEveryHour=function(){return`, every hour`},e.prototype.commaEveryX0Years=function(){return`, every %s years`},e.prototype.commaStartingX0=function(){return`, starting %s`},e.prototype.daysOfTheWeek=function(){return[`Sunday`,`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`]},e.prototype.monthsOfTheYear=function(){return[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`]},e.prototype.atReboot=function(){return`Run once, at startup`},e.prototype.onTheHour=function(){return`on the hour`},e}()},515(e,t){Object.defineProperty(t,"__esModule",{value:!0});function n(e,t){if(!e)throw Error(t)}t.default=function(){function e(){}return e.secondRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=0&&i<=59,`seconds part must be >= 0 and <= 59`)}},e.minuteRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=0&&i<=59,`minutes part must be >= 0 and <= 59`)}},e.hourRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=0&&i<=23,`hours part must be >= 0 and <= 23`)}},e.dayOfMonthRange=function(e){for(var t=e.split(`,`),r=0;r<t.length;r++)if(!isNaN(parseInt(t[r],10))){var i=parseInt(t[r],10);n(i>=1&&i<=31,`DOM part must be >= 1 and <= 31`)}},e.monthRange=function(e,t){for(var r=e.split(`,`),i=0;i<r.length;i++)if(!isNaN(parseInt(r[i],10))){var a=parseInt(r[i],10);n(a>=1&&a<=12,t?`month part must be >= 0 and <= 11`:`month part must be >= 1 and <= 12`)}},e.dayOfWeekRange=function(e,t){for(var r=e.split(`,`),i=0;i<r.length;i++)if(!isNaN(parseInt(r[i],10))){var a=parseInt(r[i],10);n(a>=0&&a<=6,t?`DOW part must be >= 0 and <= 6`:`DOW part must be >= 1 and <= 7`)}},e}()},823(e,t){Object.defineProperty(t,"__esModule",{value:!0}),t.StringUtilities=void 0,t.StringUtilities=function(){function e(){}return e.format=function(e){var t=[...arguments].slice(1);return e.replace(/%s/g,function(e){return t.shift()})},e.containsAny=function(e,t){return t.some(function(t){return e.indexOf(t)>-1})},e}()}},t={};function n(r){var i=t[r];if(i!==void 0)return i.exports;var a=t[r]={exports:{}};return e[r](a,a.exports,n),a.exports}var r={};return(()=>{var e=r;Object.defineProperty(e,"__esModule",{value:!0}),e.toString=void 0;var t=n(333),i=n(747);t.ExpressionDescriptor.initialize(new i.enLocaleLoader),e.default=t.ExpressionDescriptor,e.toString=t.ExpressionDescriptor.toString})(),r})())}))();function Ra(e){let t=e.trim();if(t===``||t.startsWith(`@`))return t;let n=t.split(/\s+/);return n.length===7?n.slice(1,6).join(` `):t}function za(e){if(e.trim()===``)return[!1,`— enter a cron expression —`];try{return[!0,(0,La.toString)(Ra(e),{throwExceptionOnParseError:!0})]}catch{return[!1,`Invalid cron expression`]}}function Ba(e){if(e===0)return`—`;let t=Math.floor(Date.now()/1e3),n=Math.max(0,t-e);return n<60?`just now`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}var Va=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function Ha(e){if(e===0)return`—`;let t=new Date(e*1e3);if(Number.isNaN(t.getTime()))return`—`;let n=String(t.getDate()).padStart(2,`0`),r=`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`;return`${Va[t.getMonth()]} ${n}, ${t.getFullYear()} ${r}`}function Ua({entries:e,onMarkAllRead:t,onClear:n}){let[r,i]=(0,x.useState)(!1),a=(0,x.useRef)(null),o=Da(e);return(0,x.useEffect)(()=>{if(!r)return;let e=e=>{a.current&&!a.current.contains(e.target)&&i(!1)},t=e=>{e.key===`Escape`&&i(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[r]),(0,I.jsxs)(`div`,{className:`notif-root`,ref:a,children:[(0,I.jsxs)(`button`,{type:`button`,className:`icon-btn notif-bell`,title:o>0?`${o} unread notification${o===1?``:`s`}`:`Notifications`,"aria-label":o>0?`${o} unread notification${o===1?``:`s`}`:`Notifications`,"aria-haspopup":`true`,"aria-expanded":r,onClick:()=>i(e=>!e),children:[`🔔`,o>0&&(0,I.jsx)(`span`,{className:`notif-badge`,children:o>99?`99+`:o})]}),r&&(0,I.jsxs)(`div`,{className:`notif-panel`,role:`menu`,children:[(0,I.jsxs)(`div`,{className:`notif-panel-hd`,children:[(0,I.jsx)(`span`,{className:`notif-panel-title`,children:`NOTIFICATIONS`}),(0,I.jsxs)(`div`,{className:`notif-panel-acts`,children:[o>0&&(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:t,children:`MARK READ`}),e.length>0&&(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`CLEAR`})]})]}),e.length===0?(0,I.jsx)(`div`,{className:`notif-empty`,children:`No notifications yet`}):(0,I.jsx)(`ul`,{className:`notif-list`,children:e.map(e=>(0,I.jsx)(`li`,{className:e.read?`notif-item`:`notif-item unread`,children:(0,I.jsxs)(kn,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,onClick:()=>i(!1),children:[(0,I.jsx)(`span`,{className:`notif-item-title`,children:e.routineTitle}),(0,I.jsx)(`span`,{className:`notif-item-msg`,children:e.message}),(0,I.jsx)(`span`,{className:`notif-item-time`,children:Ba(e.atSecs)})]})},e.id))})]})]})}function Wa(e){return e<60?`${e}s`:e<3600?`${Math.floor(e/60)}m`:`${Math.floor(e/3600)}h ${Math.floor(e%3600/60)}m`}function Ga(e){let{health:t}=e,n=t?.status.toUpperCase()??`UNKNOWN`,r=t?.version?`/ v${t.version}`:``,i=t?.git_sha&&t.git_sha!==`unknown`?`build: ${t.git_sha}`:void 0,a=t?.uptime_secs!==void 0&&t.uptime_secs!==null?`/ UP ${Wa(t.uptime_secs)}`:``,o=t?.dependencies?!t.dependencies.tmux:!1,s=t?.dependencies?!t.dependencies.python3:!1,c=t?.crontab_sync?!t.crontab_sync.ok:!1,l=t?.crontab_sync?.last_error?`OS crontab sync failed: ${t.crontab_sync.last_error}`:`OS crontab sync failed — scheduled routine changes may not be installed`;return(0,I.jsxs)(`header`,{className:`app-header`,children:[(0,I.jsxs)(`span`,{className:`brand`,children:[`MOADIM`,(0,I.jsx)(`span`,{className:`brand-sub`,children:`/ control`}),r&&(0,I.jsx)(`span`,{className:`brand-sub`,title:i,children:r})]}),(0,I.jsx)(`div`,{className:`header-spacer`}),(0,I.jsxs)(`div`,{className:`header-right`,children:[o&&(0,I.jsx)(`span`,{className:`dep-warn`,title:`tmux is not on the daemon's PATH — all routine runs will silently fail`,children:`⚠ NO TMUX`}),s&&(0,I.jsx)(`span`,{className:`dep-warn`,title:`python3 is not on the daemon's PATH — the claude agent setup step will fail silently`,children:`⚠ NO PYTHON3`}),c&&(0,I.jsx)(`span`,{className:`dep-warn`,title:l,children:`⚠ CRON STALE`}),(0,I.jsxs)(`div`,{className:`health`,children:[(0,I.jsx)(`div`,{className:`health-dot ${e.healthOk?`ok`:`error`}`}),(0,I.jsx)(`span`,{children:n}),(0,I.jsx)(`span`,{children:a})]}),e.machineName&&(0,I.jsx)(`button`,{className:`machine-badge`,title:`Click to rename this machine`,onClick:e.onRenameMachine,children:e.machineName}),(0,I.jsx)(Ua,{...e.notifications}),(0,I.jsx)(`button`,{className:`icon-btn`,title:`Command palette (⌘K)`,onClick:e.onPalette,children:`⌘K`}),(0,I.jsx)(`button`,{className:`icon-btn`,title:`Keyboard shortcuts (?)`,onClick:e.onShortcuts,children:`?`}),(0,I.jsx)(`button`,{className:`icon-btn`,title:`Refresh`,onClick:e.onRefresh,children:`↻`}),(0,I.jsx)(`button`,{className:`icon-btn danger`,title:`Stop the server`,disabled:!e.healthOk,onClick:e.onStop,children:`⏻ Stop`})]})]})}var Ka=[{to:`/`,label:`Overview`,end:!0},{to:`/routines`,label:`Routines`,end:!1},{to:`/runs`,label:`Runs`,end:!1},{to:`/heatmap`,label:`Heatmap`,end:!1},{to:`/reliability`,label:`Reliability`,end:!1},{to:`/machines`,label:`Machines`,end:!1},{to:`/settings`,label:`Settings`,end:!1}];function qa(){return(0,I.jsx)(`nav`,{className:`app-nav`,children:Ka.map(e=>(0,I.jsx)(An,{to:e.to,end:e.end,className:({isActive:e})=>`nav-link${e?` active`:``}`,children:e.label},e.to))})}var Ja=(0,x.createContext)(null);function Ya({children:e}){let[t,n]=(0,x.useState)([]),r=(0,x.useRef)(0),i=(0,x.useCallback)((e,t)=>{let i=r.current++;n(n=>[...n,{id:i,msg:e,kind:t}]),setTimeout(()=>n(e=>e.filter(e=>e.id!==i)),5e3)},[]);return(0,I.jsx)(Ja.Provider,{value:{toasts:t,addToast:i},children:e})}function Xa(){let e=(0,x.useContext)(Ja);if(!e)throw Error(`useToasts must be used within a ToastProvider`);return e}var Za=o((e=>{Object.defineProperty(e,"__esModule",{value:!0})})),Qa=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronField=void 0,e.CronField=class e{#e=!1;#t=!1;#n=!1;#r=[];options={rawValue:``};static get min(){throw Error(`min must be overridden`)}static get max(){throw Error(`max must be overridden`)}static get chars(){return Object.freeze([])}static get validChars(){return/^[?,*\dH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}static get constraints(){return{min:this.min,max:this.max,chars:this.chars,validChars:this.validChars}}constructor(t,n={rawValue:``}){if(!Array.isArray(t))throw Error(`${this.constructor.name} Validation error, values is not an array`);if(!(t.length>0))throw Error(`${this.constructor.name} Validation error, values contains no values`);this.options={...n,rawValue:n.rawValue??``},this.#r=[...t].sort(e.sorter),this.#n=this.options.wildcard===void 0?this.#i():this.options.wildcard,this.#e=this.options.rawValue.includes(`L`)||t.includes(`L`),this.#t=this.options.rawValue.includes(`?`)||t.includes(`?`)}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return this.#e}get hasQuestionMarkChar(){return this.#t}get isWildcard(){return this.#n}get values(){return this.#r}static sorter(e,t){let n=typeof e==`number`,r=typeof t==`number`;return n&&r?e-t:!n&&!r?e.localeCompare(t):n?-1:1}static findNearestValueInList(e,t,n){if(n){for(let n=e.length-1;n>=0;n--)if(e[n]<t)return e[n];return null}for(let n=0;n<e.length;n++)if(e[n]>t)return e[n];return null}findNearestValue(e,t){return this.constructor.findNearestValueInList(this.values,e,t)}serialize(){return{wildcard:this.#n,values:this.#r}}validate(){let e,t=this.chars.length>0?` or chars ${this.chars.join(``)}`:``,n=e=>t=>RegExp(`^\\d{0,2}${t}$`).test(e);if(!this.#r.every(t=>(e=t,typeof t==`number`?t>=this.min&&t<=this.max:this.chars.some(n(t)))))throw Error(`${this.constructor.name} Validation error, got value ${e} expected range ${this.min}-${this.max}${t}`);let r=this.#r.find((e,t)=>this.#r.indexOf(e)!==t);if(r)throw Error(`${this.constructor.name} Validation error, duplicate values found: ${r}`)}#i(){return this.options.rawValue.length>0?[`*`,`?`].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(e,t)=>t+this.min).every(e=>this.#r.includes(e))}}})),$a=o((e=>{Object.defineProperty(e,"__esModule",{value:!0});var t=class extends Error{},n=class extends t{constructor(e){super(`Invalid DateTime: ${e.toMessage()}`)}},r=class extends t{constructor(e){super(`Invalid Interval: ${e.toMessage()}`)}},i=class extends t{constructor(e){super(`Invalid Duration: ${e.toMessage()}`)}},a=class extends t{},o=class extends t{constructor(e){super(`Invalid unit ${e}`)}},s=class extends t{},c=class extends t{constructor(){super(`Zone is an abstract class`)}},l=`numeric`,u=`short`,d=`long`,f={year:l,month:l,day:l},p={year:l,month:u,day:l},m={year:l,month:u,day:l,weekday:u},h={year:l,month:d,day:l},g={year:l,month:d,day:l,weekday:d},_={hour:l,minute:l},v={hour:l,minute:l,second:l},y={hour:l,minute:l,second:l,timeZoneName:u},b={hour:l,minute:l,second:l,timeZoneName:d},x={hour:l,minute:l,hourCycle:`h23`},S={hour:l,minute:l,second:l,hourCycle:`h23`},C={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:u},w={hour:l,minute:l,second:l,hourCycle:`h23`,timeZoneName:d},T={year:l,month:l,day:l,hour:l,minute:l},ee={year:l,month:l,day:l,hour:l,minute:l,second:l},te={year:l,month:u,day:l,hour:l,minute:l},E={year:l,month:u,day:l,hour:l,minute:l,second:l},D={year:l,month:u,day:l,weekday:u,hour:l,minute:l},ne={year:l,month:d,day:l,hour:l,minute:l,timeZoneName:u},re={year:l,month:d,day:l,hour:l,minute:l,second:l,timeZoneName:u},ie={year:l,month:d,day:l,weekday:d,hour:l,minute:l,timeZoneName:d},ae={year:l,month:d,day:l,weekday:d,hour:l,minute:l,second:l,timeZoneName:d},O=class{get type(){throw new c}get name(){throw new c}get ianaName(){return this.name}get isUniversal(){throw new c}offsetName(e,t){throw new c}formatOffset(e,t){throw new c}offset(e){throw new c}equals(e){throw new c}get isValid(){throw new c}},oe=null,k=class e extends O{static get instance(){return oe===null&&(oe=new e),oe}get type(){return`system`}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Ut(e,t,n)}formatOffset(e,t){return qt(this.offset(e),t)}offset(e){return-new Date(e).getTimezoneOffset()}equals(e){return e.type===`system`}get isValid(){return!0}},A=new Map;function se(e){let t=A.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(`en-US`,{hour12:!1,timeZone:e,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`,second:`2-digit`,era:`short`}),A.set(e,t)),t}var ce={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function le(e,t){let n=e.format(t).replace(/\u200E/g,``),[,r,i,a,o,s,c,l]=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(n);return[a,r,i,o,s,c,l]}function ue(e,t){let n=e.formatToParts(t),r=[];for(let e=0;e<n.length;e++){let{type:t,value:i}=n[e],a=ce[t];t===`era`?r[a]=i:P(a)||(r[a]=parseInt(i,10))}return r}var de=new Map,j=class e extends O{static create(t){let n=de.get(t);return n===void 0&&de.set(t,n=new e(t)),n}static resetCache(){de.clear(),A.clear()}static isValidSpecifier(e){return this.isValidZone(e)}static isValidZone(e){if(!e)return!1;try{return new Intl.DateTimeFormat(`en-US`,{timeZone:e}).format(),!0}catch{return!1}}constructor(t){super(),this.zoneName=t,this.valid=e.isValidZone(t)}get type(){return`iana`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(e,{format:t,locale:n}){return Ut(e,t,n,this.name)}formatOffset(e,t){return qt(this.offset(e),t)}offset(e){if(!this.valid)return NaN;let t=new Date(e);if(isNaN(t))return NaN;let n=se(this.name),[r,i,a,o,s,c,l]=n.formatToParts?ue(n,t):le(n,t);o===`BC`&&(r=-Math.abs(r)+1);let u=zt({year:r,month:i,day:a,hour:s===24?0:s,minute:c,second:l,millisecond:0}),d=+t,f=d%1e3;return d-=f>=0?f:1e3+f,(u-d)/6e4}equals(e){return e.type===`iana`&&e.name===this.name}get isValid(){return this.valid}},fe={};function pe(e,t={}){let n=JSON.stringify([e,t]),r=fe[n];return r||(r=new Intl.ListFormat(e,t),fe[n]=r),r}var me=new Map;function he(e,t={}){let n=JSON.stringify([e,t]),r=me.get(n);return r===void 0&&(r=new Intl.DateTimeFormat(e,t),me.set(n,r)),r}var ge=new Map;function _e(e,t={}){let n=JSON.stringify([e,t]),r=ge.get(n);return r===void 0&&(r=new Intl.NumberFormat(e,t),ge.set(n,r)),r}var ve=new Map;function ye(e,t={}){let{base:n,...r}=t,i=JSON.stringify([e,r]),a=ve.get(i);return a===void 0&&(a=new Intl.RelativeTimeFormat(e,t),ve.set(i,a)),a}var be=null;function xe(){return be||(be=new Intl.DateTimeFormat().resolvedOptions().locale,be)}var Se=new Map;function Ce(e){let t=Se.get(e);return t===void 0&&(t=new Intl.DateTimeFormat(e).resolvedOptions(),Se.set(e,t)),t}var we=new Map;function Te(e){let t=we.get(e);if(!t){let n=new Intl.Locale(e);t=`getWeekInfo`in n?n.getWeekInfo():n.weekInfo,`minimalDays`in t||(t={...Fe,...t}),we.set(e,t)}return t}function Ee(e){let t=e.indexOf(`-x-`);t!==-1&&(e=e.substring(0,t));let n=e.indexOf(`-u-`);if(n===-1)return[e];{let t,r;try{t=he(e).resolvedOptions(),r=e}catch{let i=e.substring(0,n);t=he(i).resolvedOptions(),r=i}let{numberingSystem:i,calendar:a}=t;return[r,i,a]}}function De(e,t,n){return n||t?(e.includes(`-u-`)||(e+=`-u`),n&&(e+=`-ca-${n}`),t&&(e+=`-nu-${t}`),e):e}function Oe(e){let t=[];for(let n=1;n<=12;n++){let r=R.utc(2009,n,1);t.push(e(r))}return t}function ke(e){let t=[];for(let n=1;n<=7;n++){let r=R.utc(2016,11,13+n);t.push(e(r))}return t}function Ae(e,t,n,r){let i=e.listingMode();return i===`error`?null:i===`en`?n(t):r(t)}function je(e){return e.numberingSystem&&e.numberingSystem!==`latn`?!1:e.numberingSystem===`latn`||!e.locale||e.locale.startsWith(`en`)||Ce(e.locale).numberingSystem===`latn`}var Me=class{constructor(e,t,n){this.padTo=n.padTo||0,this.floor=n.floor||!1;let{padTo:r,floor:i,...a}=n;if(!t||Object.keys(a).length>0){let t={useGrouping:!1,...n};n.padTo>0&&(t.minimumIntegerDigits=n.padTo),this.inf=_e(e,t)}}format(e){if(this.inf){let t=this.floor?Math.floor(e):e;return this.inf.format(t)}return jt(this.floor?Math.floor(e):Ft(e,3),this.padTo)}},Ne=class{constructor(e,t,n){this.opts=n,this.originalZone=void 0;let r;if(this.opts.timeZone)this.dt=e;else if(e.zone.type===`fixed`){let t=-1*(e.offset/60),n=t>=0?`Etc/GMT+${t}`:`Etc/GMT${t}`;e.offset!==0&&j.create(n).valid?(r=n,this.dt=e):(r=`UTC`,this.dt=e.offset===0?e:e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone)}else e.zone.type===`system`?this.dt=e:e.zone.type===`iana`?(this.dt=e,r=e.zone.name):(r=`UTC`,this.dt=e.setZone(`UTC`).plus({minutes:e.offset}),this.originalZone=e.zone);let i={...this.opts};i.timeZone=i.timeZone||r,this.dtf=he(t,i)}format(){return this.originalZone?this.formatToParts().map(({value:e})=>e).join(``):this.dtf.format(this.dt.toJSDate())}formatToParts(){let e=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?e.map(e=>{if(e.type===`timeZoneName`){let t=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...e,value:t}}return e}):e}resolvedOptions(){return this.dtf.resolvedOptions()}},Pe=class{constructor(e,t,n){this.opts={style:`long`,...n},!t&&St()&&(this.rtf=ye(e,n))}format(e,t){return this.rtf?this.rtf.format(e,t):pn(t,e,this.opts.numeric,this.opts.style!==`long`)}formatToParts(e,t){return this.rtf?this.rtf.formatToParts(e,t):[]}},Fe={firstDay:1,minimalDays:4,weekend:[6,7]},M=class e{static fromOpts(t){return e.create(t.locale,t.numberingSystem,t.outputCalendar,t.weekSettings,t.defaultToEN)}static create(t,n,r,i,a=!1){let o=t||N.defaultLocale,s=o||(a?`en-US`:xe()),c=n||N.defaultNumberingSystem,l=r||N.defaultOutputCalendar,u=Ot(i)||N.defaultWeekSettings;return new e(s,c,l,u,o)}static resetCache(){be=null,me.clear(),ge.clear(),ve.clear(),Se.clear(),we.clear()}static fromObject({locale:t,numberingSystem:n,outputCalendar:r,weekSettings:i}={}){return e.create(t,n,r,i)}constructor(e,t,n,r,i){let[a,o,s]=Ee(e);this.locale=a,this.numberingSystem=t||o||null,this.outputCalendar=n||s||null,this.weekSettings=r,this.intl=De(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=i,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached??=je(this),this.fastNumbersCached}listingMode(){let e=this.isEnglish(),t=(this.numberingSystem===null||this.numberingSystem===`latn`)&&(this.outputCalendar===null||this.outputCalendar===`gregory`);return e&&t?`en`:`intl`}clone(t){return!t||Object.getOwnPropertyNames(t).length===0?this:e.create(t.locale||this.specifiedLocale,t.numberingSystem||this.numberingSystem,t.outputCalendar||this.outputCalendar,Ot(t.weekSettings)||this.weekSettings,t.defaultToEN||!1)}redefaultToEN(e={}){return this.clone({...e,defaultToEN:!0})}redefaultToSystem(e={}){return this.clone({...e,defaultToEN:!1})}months(e,t=!1){return Ae(this,e,Qt,()=>{let n=this.intl===`ja`||this.intl.startsWith(`ja-`);t&=!n;let r=t?{month:e,day:`numeric`}:{month:e},i=t?`format`:`standalone`;if(!this.monthsCache[i][e]){let t=n?e=>this.dtFormatter(e,r).format():e=>this.extract(e,r,`month`);this.monthsCache[i][e]=Oe(t)}return this.monthsCache[i][e]})}weekdays(e,t=!1){return Ae(this,e,nn,()=>{let n=t?{weekday:e,year:`numeric`,month:`long`,day:`numeric`}:{weekday:e},r=t?`format`:`standalone`;return this.weekdaysCache[r][e]||(this.weekdaysCache[r][e]=ke(e=>this.extract(e,n,`weekday`))),this.weekdaysCache[r][e]})}meridiems(){return Ae(this,void 0,()=>rn,()=>{if(!this.meridiemCache){let e={hour:`numeric`,hourCycle:`h12`};this.meridiemCache=[R.utc(2016,11,13,9),R.utc(2016,11,13,19)].map(t=>this.extract(t,e,`dayperiod`))}return this.meridiemCache})}eras(e){return Ae(this,e,cn,()=>{let t={era:e};return this.eraCache[e]||(this.eraCache[e]=[R.utc(-40,1,1),R.utc(2017,1,1)].map(e=>this.extract(e,t,`era`))),this.eraCache[e]})}extract(e,t,n){let r=this.dtFormatter(e,t).formatToParts().find(e=>e.type.toLowerCase()===n);return r?r.value:null}numberFormatter(e={}){return new Me(this.intl,e.forceSimple||this.fastNumbers,e)}dtFormatter(e,t={}){return new Ne(e,this.intl,t)}relFormatter(e={}){return new Pe(this.intl,this.isEnglish(),e)}listFormatter(e={}){return pe(this.intl,e)}isEnglish(){return this.locale===`en`||this.locale.toLowerCase()===`en-us`||Ce(this.intl).locale.startsWith(`en-us`)}getWeekSettings(){return this.weekSettings?this.weekSettings:Ct()?Te(this.locale):Fe}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(e){return this.locale===e.locale&&this.numberingSystem===e.numberingSystem&&this.outputCalendar===e.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}},Ie=null,Le=class e extends O{static get utcInstance(){return Ie===null&&(Ie=new e(0)),Ie}static instance(t){return t===0?e.utcInstance:new e(t)}static parseSpecifier(t){if(t){let n=t.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(n)return new e(Wt(n[1],n[2]))}return null}constructor(e){super(),this.fixed=e}get type(){return`fixed`}get name(){return this.fixed===0?`UTC`:`UTC${qt(this.fixed,`narrow`)}`}get ianaName(){return this.fixed===0?`Etc/UTC`:`Etc/GMT${qt(-this.fixed,`narrow`)}`}offsetName(){return this.name}formatOffset(e,t){return qt(this.fixed,t)}get isUniversal(){return!0}offset(){return this.fixed}equals(e){return e.type===`fixed`&&e.fixed===this.fixed}get isValid(){return!0}},Re=class extends O{constructor(e){super(),this.zoneName=e}get type(){return`invalid`}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(){return null}formatOffset(){return``}offset(){return NaN}equals(){return!1}get isValid(){return!1}};function ze(e,t){if(P(e)||e===null)return t;if(e instanceof O)return e;if(bt(e)){let n=e.toLowerCase();return n==="default"?t:n===`local`||n===`system`?k.instance:n===`utc`||n===`gmt`?Le.utcInstance:Le.parseSpecifier(n)||j.create(e)}return vt(e)?Le.instance(e):typeof e==`object`&&`offset`in e&&typeof e.offset==`function`?e:new Re(e)}var Be={arab:`[٠-٩]`,arabext:`[۰-۹]`,bali:`[᭐-᭙]`,beng:`[০-৯]`,deva:`[०-९]`,fullwide:`[0-9]`,gujr:`[૦-૯]`,hanidec:`[〇|一|二|三|四|五|六|七|八|九]`,khmr:`[០-៩]`,knda:`[೦-೯]`,laoo:`[໐-໙]`,limb:`[᥆-᥏]`,mlym:`[൦-൯]`,mong:`[᠐-᠙]`,mymr:`[၀-၉]`,orya:`[୦-୯]`,tamldec:`[௦-௯]`,telu:`[౦-౯]`,thai:`[๐-๙]`,tibt:`[༠-༩]`,latn:`\\d`},Ve={arab:[1632,1641],arabext:[1776,1785],bali:[6992,7001],beng:[2534,2543],deva:[2406,2415],fullwide:[65296,65303],gujr:[2790,2799],khmr:[6112,6121],knda:[3302,3311],laoo:[3792,3801],limb:[6470,6479],mlym:[3430,3439],mong:[6160,6169],mymr:[4160,4169],orya:[2918,2927],tamldec:[3046,3055],telu:[3174,3183],thai:[3664,3673],tibt:[3872,3881]},He=Be.hanidec.replace(/[\[|\]]/g,``).split(``);function Ue(e){let t=parseInt(e,10);if(isNaN(t)){t=``;for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(e[n].search(Be.hanidec)!==-1)t+=He.indexOf(e[n]);else for(let e in Ve){let[n,i]=Ve[e];r>=n&&r<=i&&(t+=r-n)}}return parseInt(t,10)}return t}var We=new Map;function Ge(){We.clear()}function Ke({numberingSystem:e},t=``){let n=e||`latn`,r=We.get(n);r===void 0&&(r=new Map,We.set(n,r));let i=r.get(t);return i===void 0&&(i=RegExp(`${Be[n]}${t}`),r.set(t,i)),i}var qe=()=>Date.now(),Je=`system`,Ye=null,Xe=null,Ze=null,Qe=60,$e,et=null,N=class{static get now(){return qe}static set now(e){qe=e}static set defaultZone(e){Je=e}static get defaultZone(){return ze(Je,k.instance)}static get defaultLocale(){return Ye}static set defaultLocale(e){Ye=e}static get defaultNumberingSystem(){return Xe}static set defaultNumberingSystem(e){Xe=e}static get defaultOutputCalendar(){return Ze}static set defaultOutputCalendar(e){Ze=e}static get defaultWeekSettings(){return et}static set defaultWeekSettings(e){et=Ot(e)}static get twoDigitCutoffYear(){return Qe}static set twoDigitCutoffYear(e){Qe=e%100}static get throwOnInvalid(){return $e}static set throwOnInvalid(e){$e=e}static resetCaches(){M.resetCache(),j.resetCache(),R.resetCache(),Ge()}},tt=class{constructor(e,t){this.reason=e,this.explanation=t}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}},nt=[0,31,59,90,120,151,181,212,243,273,304,334],rt=[0,31,60,91,121,152,182,213,244,274,305,335];function it(e,t){return new tt(`unit out of range`,`you specified ${t} (of type ${typeof t}) as a ${e}, which is invalid`)}function at(e,t,n){let r=new Date(Date.UTC(e,t-1,n));e<100&&e>=0&&r.setUTCFullYear(r.getUTCFullYear()-1900);let i=r.getUTCDay();return i===0?7:i}function ot(e,t,n){return n+(It(e)?rt:nt)[t-1]}function st(e,t){let n=It(e)?rt:nt,r=n.findIndex(e=>e<t),i=t-n[r];return{month:r+1,day:i}}function ct(e,t){return(e-t+7)%7+1}function lt(e,t=4,n=1){let{year:r,month:i,day:a}=e,o=ot(r,i,a),s=ct(at(r,i,a),n),c=Math.floor((o-s+14-t)/7),l;return c<1?(l=r-1,c=Vt(l,t,n)):c>Vt(r,t,n)?(l=r+1,c=1):l=r,{weekYear:l,weekNumber:c,weekday:s,...Jt(e)}}function ut(e,t=4,n=1){let{weekYear:r,weekNumber:i,weekday:a}=e,o=ct(at(r,1,t),n),s=Lt(r),c=i*7+a-o-7+t,l;c<1?(l=r-1,c+=Lt(l)):c>s?(l=r+1,c-=Lt(r)):l=r;let{month:u,day:d}=st(l,c);return{year:l,month:u,day:d,...Jt(e)}}function dt(e){let{year:t,month:n,day:r}=e;return{year:t,ordinal:ot(t,n,r),...Jt(e)}}function ft(e){let{year:t,ordinal:n}=e,{month:r,day:i}=st(t,n);return{year:t,month:r,day:i,...Jt(e)}}function pt(e,t){if(!P(e.localWeekday)||!P(e.localWeekNumber)||!P(e.localWeekYear)){if(!P(e.weekday)||!P(e.weekNumber)||!P(e.weekYear))throw new a(`Cannot mix locale-based week fields with ISO-based week fields`);return P(e.localWeekday)||(e.weekday=e.localWeekday),P(e.localWeekNumber)||(e.weekNumber=e.localWeekNumber),P(e.localWeekYear)||(e.weekYear=e.localWeekYear),delete e.localWeekday,delete e.localWeekNumber,delete e.localWeekYear,{minDaysInFirstWeek:t.getMinDaysInFirstWeek(),startOfWeek:t.getStartOfWeek()}}return{minDaysInFirstWeek:4,startOfWeek:1}}function mt(e,t=4,n=1){let r=yt(e.weekYear),i=kt(e.weekNumber,1,Vt(e.weekYear,t,n)),a=kt(e.weekday,1,7);return r?i?!a&&it(`weekday`,e.weekday):it(`week`,e.weekNumber):it(`weekYear`,e.weekYear)}function ht(e){let t=yt(e.year),n=kt(e.ordinal,1,Lt(e.year));return t?!n&&it(`ordinal`,e.ordinal):it(`year`,e.year)}function gt(e){let t=yt(e.year),n=kt(e.month,1,12),r=kt(e.day,1,Rt(e.year,e.month));return t?n?!r&&it(`day`,e.day):it(`month`,e.month):it(`year`,e.year)}function _t(e){let{hour:t,minute:n,second:r,millisecond:i}=e,a=kt(t,0,23)||t===24&&n===0&&r===0&&i===0,o=kt(n,0,59),s=kt(r,0,59),c=kt(i,0,999);return a?o?s?!c&&it(`millisecond`,i):it(`second`,r):it(`minute`,n):it(`hour`,t)}function P(e){return e===void 0}function vt(e){return typeof e==`number`}function yt(e){return typeof e==`number`&&e%1==0}function bt(e){return typeof e==`string`}function xt(e){return Object.prototype.toString.call(e)===`[object Date]`}function St(){try{return typeof Intl<`u`&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ct(){try{return typeof Intl<`u`&&!!Intl.Locale&&(`weekInfo`in Intl.Locale.prototype||`getWeekInfo`in Intl.Locale.prototype)}catch{return!1}}function wt(e){return Array.isArray(e)?e:[e]}function Tt(e,t,n){if(e.length!==0)return e.reduce((e,r)=>{let i=[t(r),r];return e&&n(e[0],i[0])===e[0]?e:i},null)[1]}function Et(e,t){return t.reduce((t,n)=>(t[n]=e[n],t),{})}function Dt(e,t){return Object.prototype.hasOwnProperty.call(e,t)}function Ot(e){if(e==null)return null;if(typeof e!=`object`)throw new s(`Week settings must be an object`);if(!kt(e.firstDay,1,7)||!kt(e.minimalDays,1,7)||!Array.isArray(e.weekend)||e.weekend.some(e=>!kt(e,1,7)))throw new s(`Invalid week settings`);return{firstDay:e.firstDay,minimalDays:e.minimalDays,weekend:Array.from(e.weekend)}}function kt(e,t,n){return yt(e)&&e>=t&&e<=n}function At(e,t){return e-t*Math.floor(e/t)}function jt(e,t=2){let n=e<0,r;return r=n?`-`+(``+-e).padStart(t,`0`):(``+e).padStart(t,`0`),r}function Mt(e){if(!(P(e)||e===null||e===``))return parseInt(e,10)}function Nt(e){if(!(P(e)||e===null||e===``))return parseFloat(e)}function Pt(e){if(!(P(e)||e===null||e===``)){let t=parseFloat(`0.`+e)*1e3;return Math.floor(t)}}function Ft(e,t,n=`round`){let r=10**t;switch(n){case`expand`:return e>0?Math.ceil(e*r)/r:Math.floor(e*r)/r;case`trunc`:return Math.trunc(e*r)/r;case`round`:return Math.round(e*r)/r;case`floor`:return Math.floor(e*r)/r;case`ceil`:return Math.ceil(e*r)/r;default:throw RangeError(`Value rounding ${n} is out of range`)}}function It(e){return e%4==0&&(e%100!=0||e%400==0)}function Lt(e){return It(e)?366:365}function Rt(e,t){let n=At(t-1,12)+1,r=e+(t-n)/12;return n===2?It(r)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][n-1]}function zt(e){let t=Date.UTC(e.year,e.month-1,e.day,e.hour,e.minute,e.second,e.millisecond);return e.year<100&&e.year>=0&&(t=new Date(t),t.setUTCFullYear(e.year,e.month-1,e.day)),+t}function Bt(e,t,n){return-ct(at(e,1,t),n)+t-1}function Vt(e,t=4,n=1){let r=Bt(e,t,n),i=Bt(e+1,t,n);return(Lt(e)-r+i)/7}function Ht(e){return e>99?e:e>N.twoDigitCutoffYear?1900+e:2e3+e}function Ut(e,t,n,r=null){let i=new Date(e),a={hourCycle:`h23`,year:`numeric`,month:`2-digit`,day:`2-digit`,hour:`2-digit`,minute:`2-digit`};r&&(a.timeZone=r);let o={timeZoneName:t,...a},s=new Intl.DateTimeFormat(n,o).formatToParts(i).find(e=>e.type.toLowerCase()===`timezonename`);return s?s.value:null}function Wt(e,t){let n=parseInt(e,10);Number.isNaN(n)&&(n=0);let r=parseInt(t,10)||0,i=n<0||Object.is(n,-0)?-r:r;return n*60+i}function Gt(e){let t=Number(e);if(typeof e==`boolean`||e===``||!Number.isFinite(t))throw new s(`Invalid unit value ${e}`);return t}function Kt(e,t){let n={};for(let r in e)if(Dt(e,r)){let i=e[r];if(i==null)continue;n[t(r)]=Gt(i)}return n}function qt(e,t){let n=Math.trunc(Math.abs(e/60)),r=Math.trunc(Math.abs(e%60)),i=e>=0?`+`:`-`;switch(t){case`short`:return`${i}${jt(n,2)}:${jt(r,2)}`;case`narrow`:return`${i}${n}${r>0?`:${r}`:``}`;case`techie`:return`${i}${jt(n,2)}${jt(r,2)}`;default:throw RangeError(`Value format ${t} is out of range for property format`)}}function Jt(e){return Et(e,[`hour`,`minute`,`second`,`millisecond`])}var Yt=[`January`,`February`,`March`,`April`,`May`,`June`,`July`,`August`,`September`,`October`,`November`,`December`],Xt=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`],Zt=[`J`,`F`,`M`,`A`,`M`,`J`,`J`,`A`,`S`,`O`,`N`,`D`];function Qt(e){switch(e){case`narrow`:return[...Zt];case`short`:return[...Xt];case`long`:return[...Yt];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`,`8`,`9`,`10`,`11`,`12`];case`2-digit`:return[`01`,`02`,`03`,`04`,`05`,`06`,`07`,`08`,`09`,`10`,`11`,`12`];default:return null}}var $t=[`Monday`,`Tuesday`,`Wednesday`,`Thursday`,`Friday`,`Saturday`,`Sunday`],en=[`Mon`,`Tue`,`Wed`,`Thu`,`Fri`,`Sat`,`Sun`],tn=[`M`,`T`,`W`,`T`,`F`,`S`,`S`];function nn(e){switch(e){case`narrow`:return[...tn];case`short`:return[...en];case`long`:return[...$t];case`numeric`:return[`1`,`2`,`3`,`4`,`5`,`6`,`7`];default:return null}}var rn=[`AM`,`PM`],an=[`Before Christ`,`Anno Domini`],on=[`BC`,`AD`],sn=[`B`,`A`];function cn(e){switch(e){case`narrow`:return[...sn];case`short`:return[...on];case`long`:return[...an];default:return null}}function ln(e){return rn[e.hour<12?0:1]}function un(e,t){return nn(t)[e.weekday-1]}function dn(e,t){return Qt(t)[e.month-1]}function fn(e,t){return cn(t)[e.year<0?0:1]}function pn(e,t,n=`always`,r=!1){let i={years:[`year`,`yr.`],quarters:[`quarter`,`qtr.`],months:[`month`,`mo.`],weeks:[`week`,`wk.`],days:[`day`,`day`,`days`],hours:[`hour`,`hr.`],minutes:[`minute`,`min.`],seconds:[`second`,`sec.`]},a=[`hours`,`minutes`,`seconds`].indexOf(e)===-1;if(n===`auto`&&a){let n=e===`days`;switch(t){case 1:return n?`tomorrow`:`next ${i[e][0]}`;case-1:return n?`yesterday`:`last ${i[e][0]}`;case 0:return n?`today`:`this ${i[e][0]}`}}let o=Object.is(t,-0)||t<0,s=Math.abs(t),c=s===1,l=i[e],u=r?c?l[1]:l[2]||l[1]:c?i[e][0]:e;return o?`${s} ${u} ago`:`in ${s} ${u}`}function mn(e,t){let n=``;for(let r of e)r.literal?n+=r.val:n+=t(r.val);return n}var hn={D:f,DD:p,DDD:h,DDDD:g,t:_,tt:v,ttt:y,tttt:b,T:x,TT:S,TTT:C,TTTT:w,f:T,ff:te,fff:ne,ffff:ie,F:ee,FF:E,FFF:re,FFFF:ae},gn=class e{static create(t,n={}){return new e(t,n)}static parseFormat(e){let t=null,n=``,r=!1,i=[];for(let a=0;a<e.length;a++){let o=e.charAt(a);o===`'`?((n.length>0||r)&&i.push({literal:r||/^\s+$/.test(n),val:n===``?`'`:n}),t=null,n=``,r=!r):r||o===t?n+=o:(n.length>0&&i.push({literal:/^\s+$/.test(n),val:n}),n=o,t=o)}return n.length>0&&i.push({literal:r||/^\s+$/.test(n),val:n}),i}static macroTokenToFormatOpts(e){return hn[e]}constructor(e,t){this.opts=t,this.loc=e,this.systemLoc=null}formatWithSystemDefault(e,t){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(e,{...this.opts,...t}).format()}dtFormatter(e,t={}){return this.loc.dtFormatter(e,{...this.opts,...t})}formatDateTime(e,t){return this.dtFormatter(e,t).format()}formatDateTimeParts(e,t){return this.dtFormatter(e,t).formatToParts()}formatInterval(e,t){return this.dtFormatter(e.start,t).dtf.formatRange(e.start.toJSDate(),e.end.toJSDate())}resolvedOptions(e,t){return this.dtFormatter(e,t).resolvedOptions()}num(e,t=0,n=void 0){if(this.opts.forceSimple)return jt(e,t);let r={...this.opts};return t>0&&(r.padTo=t),n&&(r.signDisplay=n),this.loc.numberFormatter(r).format(e)}formatDateTimeFromString(t,n){let r=this.loc.listingMode()===`en`,i=this.loc.outputCalendar&&this.loc.outputCalendar!==`gregory`,a=(e,n)=>this.loc.extract(t,e,n),o=e=>t.isOffsetFixed&&t.offset===0&&e.allowZ?`Z`:t.isValid?t.zone.formatOffset(t.ts,e.format):``,s=()=>r?ln(t):a({hour:`numeric`,hourCycle:`h12`},`dayperiod`),c=(e,n)=>r?dn(t,e):a(n?{month:e}:{month:e,day:`numeric`},`month`),l=(e,n)=>r?un(t,e):a(n?{weekday:e}:{weekday:e,month:`long`,day:`numeric`},`weekday`),u=n=>{let r=e.macroTokenToFormatOpts(n);return r?this.formatWithSystemDefault(t,r):n},d=e=>r?fn(t,e):a({era:e},`era`);return mn(e.parseFormat(n),e=>{switch(e){case`S`:return this.num(t.millisecond);case`u`:case`SSS`:return this.num(t.millisecond,3);case`s`:return this.num(t.second);case`ss`:return this.num(t.second,2);case`uu`:return this.num(Math.floor(t.millisecond/10),2);case`uuu`:return this.num(Math.floor(t.millisecond/100));case`m`:return this.num(t.minute);case`mm`:return this.num(t.minute,2);case`h`:return this.num(t.hour%12==0?12:t.hour%12);case`hh`:return this.num(t.hour%12==0?12:t.hour%12,2);case`H`:return this.num(t.hour);case`HH`:return this.num(t.hour,2);case`Z`:return o({format:`narrow`,allowZ:this.opts.allowZ});case`ZZ`:return o({format:`short`,allowZ:this.opts.allowZ});case`ZZZ`:return o({format:`techie`,allowZ:this.opts.allowZ});case`ZZZZ`:return t.zone.offsetName(t.ts,{format:`short`,locale:this.loc.locale});case`ZZZZZ`:return t.zone.offsetName(t.ts,{format:`long`,locale:this.loc.locale});case`z`:return t.zoneName;case`a`:return s();case`d`:return i?a({day:`numeric`},`day`):this.num(t.day);case`dd`:return i?a({day:`2-digit`},`day`):this.num(t.day,2);case`c`:return this.num(t.weekday);case`ccc`:return l(`short`,!0);case`cccc`:return l(`long`,!0);case`ccccc`:return l(`narrow`,!0);case`E`:return this.num(t.weekday);case`EEE`:return l(`short`,!1);case`EEEE`:return l(`long`,!1);case`EEEEE`:return l(`narrow`,!1);case`L`:return i?a({month:`numeric`,day:`numeric`},`month`):this.num(t.month);case`LL`:return i?a({month:`2-digit`,day:`numeric`},`month`):this.num(t.month,2);case`LLL`:return c(`short`,!0);case`LLLL`:return c(`long`,!0);case`LLLLL`:return c(`narrow`,!0);case`M`:return i?a({month:`numeric`},`month`):this.num(t.month);case`MM`:return i?a({month:`2-digit`},`month`):this.num(t.month,2);case`MMM`:return c(`short`,!1);case`MMMM`:return c(`long`,!1);case`MMMMM`:return c(`narrow`,!1);case`y`:return i?a({year:`numeric`},`year`):this.num(t.year);case`yy`:return i?a({year:`2-digit`},`year`):this.num(t.year.toString().slice(-2),2);case`yyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,4);case`yyyyyy`:return i?a({year:`numeric`},`year`):this.num(t.year,6);case`G`:return d(`short`);case`GG`:return d(`long`);case`GGGGG`:return d(`narrow`);case`kk`:return this.num(t.weekYear.toString().slice(-2),2);case`kkkk`:return this.num(t.weekYear,4);case`W`:return this.num(t.weekNumber);case`WW`:return this.num(t.weekNumber,2);case`n`:return this.num(t.localWeekNumber);case`nn`:return this.num(t.localWeekNumber,2);case`ii`:return this.num(t.localWeekYear.toString().slice(-2),2);case`iiii`:return this.num(t.localWeekYear,4);case`o`:return this.num(t.ordinal);case`ooo`:return this.num(t.ordinal,3);case`q`:return this.num(t.quarter);case`qq`:return this.num(t.quarter,2);case`X`:return this.num(Math.floor(t.ts/1e3));case`x`:return this.num(t.ts);default:return u(e)}})}formatDurationFromString(t,n){let r=this.opts.signMode===`negativeLargestOnly`?-1:1,i=e=>{switch(e[0]){case`S`:return`milliseconds`;case`s`:return`seconds`;case`m`:return`minutes`;case`h`:return`hours`;case`d`:return`days`;case`w`:return`weeks`;case`M`:return`months`;case`y`:return`years`;default:return null}},a=(e,t)=>n=>{let a=i(n);if(a){let i=t.isNegativeDuration&&a!==t.largestUnit?r:1,o;return o=this.opts.signMode===`negativeLargestOnly`&&a!==t.largestUnit?`never`:this.opts.signMode===`all`?`always`:`auto`,this.num(e.get(a)*i,n.length,o)}return n},o=e.parseFormat(n),s=o.reduce((e,{literal:t,val:n})=>t?e:e.concat(n),[]),c=t.shiftTo(...s.map(i).filter(e=>e));return mn(o,a(c,{isNegativeDuration:c<0,largestUnit:Object.keys(c.values)[0]}))}},_n=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function vn(...e){let t=e.reduce((e,t)=>e+t.source,``);return RegExp(`^${t}$`)}function yn(...e){return t=>e.reduce(([e,n,r],i)=>{let[a,o,s]=i(t,r);return[{...e,...a},o||n,s]},[{},null,1]).slice(0,2)}function bn(e,...t){if(e==null)return[null,null];for(let[n,r]of t){let t=n.exec(e);if(t)return r(t)}return[null,null]}function xn(...e){return(t,n)=>{let r={},i;for(i=0;i<e.length;i++)r[e[i]]=Mt(t[n+i]);return[r,null,n+i]}}var Sn=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Cn=`(?:${Sn.source}?(?:\\[(${_n.source})\\])?)?`,wn=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,Tn=RegExp(`${wn.source}${Cn}`),En=RegExp(`(?:[Tt]${Tn.source})?`),Dn=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,On=/(\d{4})-?W(\d\d)(?:-?(\d))?/,kn=/(\d{4})-?(\d{3})/,An=xn(`weekYear`,`weekNumber`,`weekDay`),jn=xn(`year`,`ordinal`),Mn=/(\d{4})-(\d\d)-(\d\d)/,Nn=RegExp(`${wn.source} ?(?:${Sn.source}|(${_n.source}))?`),Pn=RegExp(`(?: ${Nn.source})?`);function Fn(e,t,n){let r=e[t];return P(r)?n:Mt(r)}function In(e,t){return[{year:Fn(e,t),month:Fn(e,t+1,1),day:Fn(e,t+2,1)},null,t+3]}function Ln(e,t){return[{hours:Fn(e,t,0),minutes:Fn(e,t+1,0),seconds:Fn(e,t+2,0),milliseconds:Pt(e[t+3])},null,t+4]}function Rn(e,t){let n=!e[t]&&!e[t+1],r=Wt(e[t+1],e[t+2]);return[{},n?null:Le.instance(r),t+3]}function zn(e,t){return[{},e[t]?j.create(e[t]):null,t+1]}var Bn=RegExp(`^T?${wn.source}$`),Vn=/^-?P(?:(?:(-?\d{1,20}(?:\.\d{1,20})?)Y)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20}(?:\.\d{1,20})?)W)?(?:(-?\d{1,20}(?:\.\d{1,20})?)D)?(?:T(?:(-?\d{1,20}(?:\.\d{1,20})?)H)?(?:(-?\d{1,20}(?:\.\d{1,20})?)M)?(?:(-?\d{1,20})(?:[.,](-?\d{1,20}))?S)?)?)$/;function Hn(e){let[t,n,r,i,a,o,s,c,l]=e,u=t[0]===`-`,d=c&&c[0]===`-`,f=(e,t=!1)=>e!==void 0&&(t||e&&u)?-e:e;return[{years:f(Nt(n)),months:f(Nt(r)),weeks:f(Nt(i)),days:f(Nt(a)),hours:f(Nt(o)),minutes:f(Nt(s)),seconds:f(Nt(c),c===`-0`),milliseconds:f(Pt(l),d)}]}var Un={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Wn(e,t,n,r,i,a,o){let s={year:t.length===2?Ht(Mt(t)):Mt(t),month:Xt.indexOf(n)+1,day:Mt(r),hour:Mt(i),minute:Mt(a)};return o&&(s.second=Mt(o)),e&&(s.weekday=e.length>3?$t.indexOf(e)+1:en.indexOf(e)+1),s}var Gn=/^(?:(Mon|Tue|Wed|Thu|Fri|Sat|Sun),\s)?(\d{1,2})\s(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)\s(\d{2,4})\s(\d\d):(\d\d)(?::(\d\d))?\s(?:(UT|GMT|[ECMP][SD]T)|([Zz])|(?:([+-]\d\d)(\d\d)))$/;function Kn(e){let[,t,n,r,i,a,o,s,c,l,u,d]=e,f=Wn(t,i,r,n,a,o,s),p;return p=c?Un[c]:l?0:Wt(u,d),[f,new Le(p)]}function qn(e){return e.replace(/\([^()]*\)|[\n\t]/g,` `).replace(/(\s\s+)/g,` `).trim()}var Jn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun), (\d\d) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) (\d{4}) (\d\d):(\d\d):(\d\d) GMT$/,Yn=/^(Monday|Tuesday|Wednesday|Thursday|Friday|Saturday|Sunday), (\d\d)-(Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec)-(\d\d) (\d\d):(\d\d):(\d\d) GMT$/,Xn=/^(Mon|Tue|Wed|Thu|Fri|Sat|Sun) (Jan|Feb|Mar|Apr|May|Jun|Jul|Aug|Sep|Oct|Nov|Dec) ( \d|\d\d) (\d\d):(\d\d):(\d\d) (\d{4})$/;function Zn(e){let[,t,n,r,i,a,o,s]=e;return[Wn(t,i,r,n,a,o,s),Le.utcInstance]}function Qn(e){let[,t,n,r,i,a,o,s]=e;return[Wn(t,s,n,r,i,a,o),Le.utcInstance]}var $n=vn(Dn,En),er=vn(On,En),tr=vn(kn,En),nr=vn(Tn),rr=yn(In,Ln,Rn,zn),ir=yn(An,Ln,Rn,zn),ar=yn(jn,Ln,Rn,zn),or=yn(Ln,Rn,zn);function sr(e){return bn(e,[$n,rr],[er,ir],[tr,ar],[nr,or])}function cr(e){return bn(qn(e),[Gn,Kn])}function lr(e){return bn(e,[Jn,Zn],[Yn,Zn],[Xn,Qn])}function ur(e){return bn(e,[Vn,Hn])}var dr=yn(Ln);function fr(e){return bn(e,[Bn,dr])}var pr=vn(Mn,Pn),mr=vn(Nn),hr=yn(Ln,Rn,zn);function gr(e){return bn(e,[pr,rr],[mr,hr])}var _r=`Invalid Duration`,vr={weeks:{days:7,hours:168,minutes:10080,seconds:604800,milliseconds:6048e5},days:{hours:24,minutes:1440,seconds:86400,milliseconds:864e5},hours:{minutes:60,seconds:3600,milliseconds:36e5},minutes:{seconds:60,milliseconds:6e4},seconds:{milliseconds:1e3}},yr={years:{quarters:4,months:12,weeks:52,days:365,hours:8760,minutes:525600,seconds:31536e3,milliseconds:31536e6},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:131040,seconds:7862400,milliseconds:78624e5},months:{weeks:4,days:30,hours:720,minutes:43200,seconds:2592e3,milliseconds:2592e6},...vr},br=146097/400,xr=146097/4800,Sr={years:{quarters:4,months:12,weeks:br/7,days:br,hours:br*24,minutes:br*24*60,seconds:br*24*60*60,milliseconds:br*24*60*60*1e3},quarters:{months:3,weeks:br/28,days:br/4,hours:br*24/4,minutes:br*24*60/4,seconds:br*24*60*60/4,milliseconds:br*24*60*60*1e3/4},months:{weeks:xr/7,days:xr,hours:xr*24,minutes:xr*24*60,seconds:xr*24*60*60,milliseconds:xr*24*60*60*1e3},...vr},Cr=[`years`,`quarters`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`],wr=Cr.slice(0).reverse();function Tr(e,t,n=!1){return new kr({values:n?t.values:{...e.values,...t.values||{}},loc:e.loc.clone(t.loc),conversionAccuracy:t.conversionAccuracy||e.conversionAccuracy,matrix:t.matrix||e.matrix})}function Er(e,t){let n=t.milliseconds??0;for(let r of wr.slice(1))t[r]&&(n+=t[r]*e[r].milliseconds);return n}function Dr(e,t){let n=Er(e,t)<0?-1:1;Cr.reduceRight((r,i)=>{if(P(t[i]))return r;if(r){let a=t[r]*n,o=e[i][r],s=Math.floor(a/o);t[i]+=s*n,t[r]-=s*o*n}return i},null),Cr.reduce((n,r)=>{if(P(t[r]))return n;if(n){let i=t[n]%1;t[n]-=i,t[r]+=i*e[n][r]}return r},null)}function Or(e){let t={};for(let[n,r]of Object.entries(e))r!==0&&(t[n]=r);return t}var kr=class e{constructor(e){let t=e.conversionAccuracy===`longterm`||!1,n=t?Sr:yr;e.matrix&&(n=e.matrix),this.values=e.values,this.loc=e.loc||M.create(),this.conversionAccuracy=t?`longterm`:`casual`,this.invalid=e.invalid||null,this.matrix=n,this.isLuxonDuration=!0}static fromMillis(t,n){return e.fromObject({milliseconds:t},n)}static fromObject(t,n={}){if(typeof t!=`object`||!t)throw new s(`Duration.fromObject: argument expected to be an object, got ${t===null?`null`:typeof t}`);return new e({values:Kt(t,e.normalizeUnit),loc:M.fromObject(n),conversionAccuracy:n.conversionAccuracy,matrix:n.matrix})}static fromDurationLike(t){if(vt(t))return e.fromMillis(t);if(e.isDuration(t))return t;if(typeof t==`object`)return e.fromObject(t);throw new s(`Unknown duration argument ${t} of type ${typeof t}`)}static fromISO(t,n){let[r]=ur(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static fromISOTime(t,n){let[r]=fr(t);return r?e.fromObject(r,n):e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Duration is invalid`);let r=t instanceof tt?t:new tt(t,n);if(N.throwOnInvalid)throw new i(r);return new e({invalid:r})}static normalizeUnit(e){let t={year:`years`,years:`years`,quarter:`quarters`,quarters:`quarters`,month:`months`,months:`months`,week:`weeks`,weeks:`weeks`,day:`days`,days:`days`,hour:`hours`,hours:`hours`,minute:`minutes`,minutes:`minutes`,second:`seconds`,seconds:`seconds`,millisecond:`milliseconds`,milliseconds:`milliseconds`}[e&&e.toLowerCase()];if(!t)throw new o(e);return t}static isDuration(e){return e&&e.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(e,t={}){let n={...t,floor:t.round!==!1&&t.floor!==!1};return this.isValid?gn.create(this.loc,n).formatDurationFromString(this,e):_r}toHuman(e={}){if(!this.isValid)return _r;let t=e.showZeros!==!1,n=Cr.map(n=>{let r=this.values[n];return P(r)||r===0&&!t?null:this.loc.numberFormatter({style:`unit`,unitDisplay:`long`,...e,unit:n.slice(0,-1)}).format(r)}).filter(e=>e);return this.loc.listFormatter({type:`conjunction`,style:e.listStyle||`narrow`,...e}).format(n)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let e=`P`;return this.years!==0&&(e+=this.years+`Y`),(this.months!==0||this.quarters!==0)&&(e+=this.months+this.quarters*3+`M`),this.weeks!==0&&(e+=this.weeks+`W`),this.days!==0&&(e+=this.days+`D`),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(e+=`T`),this.hours!==0&&(e+=this.hours+`H`),this.minutes!==0&&(e+=this.minutes+`M`),(this.seconds!==0||this.milliseconds!==0)&&(e+=Ft(this.seconds+this.milliseconds/1e3,3)+`S`),e===`P`&&(e+=`T0S`),e}toISOTime(e={}){if(!this.isValid)return null;let t=this.toMillis();return t<0||t>=864e5?null:(e={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:`extended`,...e,includeOffset:!1},R.fromMillis(t,{zone:`UTC`}).toISOTime(e))}toJSON(){return this.toISO()}toString(){return this.toISO()}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Duration { values: ${JSON.stringify(this.values)} }`:`Duration { Invalid, reason: ${this.invalidReason} }`}toMillis(){return this.isValid?Er(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t),r={};for(let e of Cr)(Dt(n.values,e)||Dt(this.values,e))&&(r[e]=n.get(e)+this.get(e));return Tr(this,{values:r},!0)}minus(t){if(!this.isValid)return this;let n=e.fromDurationLike(t);return this.plus(n.negate())}mapUnits(e){if(!this.isValid)return this;let t={};for(let n of Object.keys(this.values))t[n]=Gt(e(this.values[n],n));return Tr(this,{values:t},!0)}get(t){return this[e.normalizeUnit(t)]}set(t){if(!this.isValid)return this;let n={...this.values,...Kt(t,e.normalizeUnit)};return Tr(this,{values:n})}reconfigure({locale:e,numberingSystem:t,conversionAccuracy:n,matrix:r}={}){let i={loc:this.loc.clone({locale:e,numberingSystem:t}),matrix:r,conversionAccuracy:n};return Tr(this,i)}as(e){return this.isValid?this.shiftTo(e).get(e):NaN}normalize(){if(!this.isValid)return this;let e=this.toObject();return Dr(this.matrix,e),Tr(this,{values:e},!0)}rescale(){if(!this.isValid)return this;let e=Or(this.normalize().shiftToAll().toObject());return Tr(this,{values:e},!0)}shiftTo(...t){if(!this.isValid||t.length===0)return this;t=t.map(t=>e.normalizeUnit(t));let n={},r={},i=this.toObject(),a;for(let e of Cr)if(t.indexOf(e)>=0){a=e;let t=0;for(let n in r)t+=this.matrix[n][e]*r[n],r[n]=0;vt(i[e])&&(t+=i[e]);let o=Math.trunc(t);n[e]=o,r[e]=(t*1e3-o*1e3)/1e3}else vt(i[e])&&(r[e]=i[e]);for(let e in r)r[e]!==0&&(n[a]+=e===a?r[e]:r[e]/this.matrix[a][e]);return Dr(this.matrix,n),Tr(this,{values:n},!0)}shiftToAll(){return this.isValid?this.shiftTo(`years`,`months`,`weeks`,`days`,`hours`,`minutes`,`seconds`,`milliseconds`):this}negate(){if(!this.isValid)return this;let e={};for(let t of Object.keys(this.values))e[t]=this.values[t]===0?0:-this.values[t];return Tr(this,{values:e},!0)}removeZeros(){if(!this.isValid)return this;let e=Or(this.values);return Tr(this,{values:e},!0)}get years(){return this.isValid?this.values.years||0:NaN}get quarters(){return this.isValid?this.values.quarters||0:NaN}get months(){return this.isValid?this.values.months||0:NaN}get weeks(){return this.isValid?this.values.weeks||0:NaN}get days(){return this.isValid?this.values.days||0:NaN}get hours(){return this.isValid?this.values.hours||0:NaN}get minutes(){return this.isValid?this.values.minutes||0:NaN}get seconds(){return this.isValid?this.values.seconds||0:NaN}get milliseconds(){return this.isValid?this.values.milliseconds||0:NaN}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}equals(e){if(!this.isValid||!e.isValid||!this.loc.equals(e.loc))return!1;function t(e,t){return e===void 0||e===0?t===void 0||t===0:e===t}for(let n of Cr)if(!t(this.values[n],e.values[n]))return!1;return!0}},Ar=`Invalid Interval`;function jr(e,t){return!e||!e.isValid?Mr.invalid(`missing or invalid start`):!t||!t.isValid?Mr.invalid(`missing or invalid end`):t<e?Mr.invalid(`end before start`,`The end of an interval must be after its start, but you had start=${e.toISO()} and end=${t.toISO()}`):null}var Mr=class e{constructor(e){this.s=e.start,this.e=e.end,this.invalid=e.invalid||null,this.isLuxonInterval=!0}static invalid(t,n=null){if(!t)throw new s(`need to specify a reason the Interval is invalid`);let i=t instanceof tt?t:new tt(t,n);if(N.throwOnInvalid)throw new r(i);return new e({invalid:i})}static fromDateTimes(t,n){let r=Mi(t),i=Mi(n);return jr(r,i)??new e({start:r,end:i})}static after(t,n){let r=kr.fromDurationLike(n),i=Mi(t);return e.fromDateTimes(i,i.plus(r))}static before(t,n){let r=kr.fromDurationLike(n),i=Mi(t);return e.fromDateTimes(i.minus(r),i)}static fromISO(t,n){let[r,i]=(t||``).split(`/`,2);if(r&&i){let t,a;try{t=R.fromISO(r,n),a=t.isValid}catch{a=!1}let o,s;try{o=R.fromISO(i,n),s=o.isValid}catch{s=!1}if(a&&s)return e.fromDateTimes(t,o);if(a){let r=kr.fromISO(i,n);if(r.isValid)return e.after(t,r)}else if(s){let t=kr.fromISO(r,n);if(t.isValid)return e.before(o,t)}}return e.invalid(`unparsable`,`the input "${t}" can't be parsed as ISO 8601`)}static isInterval(e){return e&&e.isLuxonInterval||!1}get start(){return this.isValid?this.s:null}get end(){return this.isValid?this.e:null}get lastDateTime(){return this.isValid&&this.e?this.e.minus(1):null}get isValid(){return this.invalidReason===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}length(e=`milliseconds`){return this.isValid?this.toDuration(e).get(e):NaN}count(e=`milliseconds`,t){if(!this.isValid)return NaN;let n=this.start.startOf(e,t),r;return r=t!=null&&t.useLocaleWeeks?this.end.reconfigure({locale:n.locale}):this.end,r=r.startOf(e,t),Math.floor(r.diff(n,e).get(e))+(r.valueOf()!==this.end.valueOf())}hasSame(e){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,e):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(e){return this.isValid?this.s>e:!1}isBefore(e){return this.isValid?this.e<=e:!1}contains(e){return this.isValid?this.s<=e&&this.e>e:!1}set({start:t,end:n}={}){return this.isValid?e.fromDateTimes(t||this.s,n||this.e):this}splitAt(...t){if(!this.isValid)return[];let n=t.map(Mi).filter(e=>this.contains(e)).sort((e,t)=>e.toMillis()-t.toMillis()),r=[],{s:i}=this,a=0;for(;i<this.e;){let t=n[a]||this.e,o=+t>+this.e?this.e:t;r.push(e.fromDateTimes(i,o)),i=o,a+=1}return r}splitBy(t){let n=kr.fromDurationLike(t);if(!this.isValid||!n.isValid||n.as(`milliseconds`)===0)return[];let{s:r}=this,i=1,a,o=[];for(;r<this.e;){let t=this.start.plus(n.mapUnits(e=>e*i));a=+t>+this.e?this.e:t,o.push(e.fromDateTimes(r,a)),r=a,i+=1}return o}divideEqually(e){return this.isValid?this.splitBy(this.length()/e).slice(0,e):[]}overlaps(e){return this.e>e.s&&this.s<e.e}abutsStart(e){return this.isValid?+this.e==+e.s:!1}abutsEnd(e){return this.isValid?+e.e==+this.s:!1}engulfs(e){return this.isValid?this.s<=e.s&&this.e>=e.e:!1}equals(e){return!this.isValid||!e.isValid?!1:this.s.equals(e.s)&&this.e.equals(e.e)}intersection(t){if(!this.isValid)return this;let n=this.s>t.s?this.s:t.s,r=this.e<t.e?this.e:t.e;return n>=r?null:e.fromDateTimes(n,r)}union(t){if(!this.isValid)return this;let n=this.s<t.s?this.s:t.s,r=this.e>t.e?this.e:t.e;return e.fromDateTimes(n,r)}static merge(e){let[t,n]=e.sort((e,t)=>e.s-t.s).reduce(([e,t],n)=>t?t.overlaps(n)||t.abutsStart(n)?[e,t.union(n)]:[e.concat([t]),n]:[e,n],[[],null]);return n&&t.push(n),t}static xor(t){let n=null,r=0,i=[],a=t.map(e=>[{time:e.s,type:`s`},{time:e.e,type:`e`}]),o=Array.prototype.concat(...a).sort((e,t)=>e.time-t.time);for(let t of o)r+=t.type===`s`?1:-1,r===1?n=t.time:(n&&+n!=+t.time&&i.push(e.fromDateTimes(n,t.time)),n=null);return e.merge(i)}difference(...t){return e.xor([this].concat(t)).map(e=>this.intersection(e)).filter(e=>e&&!e.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:Ar}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(e=f,t={}){return this.isValid?gn.create(this.s.loc.clone(t),e).formatInterval(this):Ar}toISO(e){return this.isValid?`${this.s.toISO(e)}/${this.e.toISO(e)}`:Ar}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:Ar}toISOTime(e){return this.isValid?`${this.s.toISOTime(e)}/${this.e.toISOTime(e)}`:Ar}toFormat(e,{separator:t=` – `}={}){return this.isValid?`${this.s.toFormat(e)}${t}${this.e.toFormat(e)}`:Ar}toDuration(e,t){return this.isValid?this.e.diff(this.s,e,t):kr.invalid(this.invalidReason)}mapEndpoints(t){return e.fromDateTimes(t(this.s),t(this.e))}},Nr=class{static hasDST(e=N.defaultZone){let t=R.now().setZone(e).set({month:12});return!e.isUniversal&&t.offset!==t.set({month:6}).offset}static isValidIANAZone(e){return j.isValidZone(e)}static normalizeZone(e){return ze(e,N.defaultZone)}static getStartOfWeek({locale:e=null,locObj:t=null}={}){return(t||M.create(e)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:e=null,locObj:t=null}={}){return(t||M.create(e)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:e=null,locObj:t=null}={}){return(t||M.create(e)).getWeekendDays().slice()}static months(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||M.create(t,n,i)).months(e)}static monthsFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null,outputCalendar:i=`gregory`}={}){return(r||M.create(t,n,i)).months(e,!0)}static weekdays(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||M.create(t,n,null)).weekdays(e)}static weekdaysFormat(e=`long`,{locale:t=null,numberingSystem:n=null,locObj:r=null}={}){return(r||M.create(t,n,null)).weekdays(e,!0)}static meridiems({locale:e=null}={}){return M.create(e).meridiems()}static eras(e=`short`,{locale:t=null}={}){return M.create(t,null,`gregory`).eras(e)}static features(){return{relative:St(),localeWeek:Ct()}}};function Pr(e,t){let n=e=>e.toUTC(0,{keepLocalTime:!0}).startOf(`day`).valueOf(),r=n(t)-n(e);return Math.floor(kr.fromMillis(r).as(`days`))}function Fr(e,t,n){let r=[[`years`,(e,t)=>t.year-e.year],[`quarters`,(e,t)=>t.quarter-e.quarter+(t.year-e.year)*4],[`months`,(e,t)=>t.month-e.month+(t.year-e.year)*12],[`weeks`,(e,t)=>{let n=Pr(e,t);return(n-n%7)/7}],[`days`,Pr]],i={},a=e,o,s;for(let[c,l]of r)n.indexOf(c)>=0&&(o=c,i[c]=l(e,t),s=a.plus(i),s>t?(i[c]--,e=a.plus(i),e>t&&(s=e,i[c]--,e=a.plus(i))):e=s);return[e,i,s,o]}function Ir(e,t,n,r){let[i,a,o,s]=Fr(e,t,n),c=t-i,l=n.filter(e=>[`hours`,`minutes`,`seconds`,`milliseconds`].indexOf(e)>=0);l.length===0&&(o<t&&(o=i.plus({[s]:1})),o!==i&&(a[s]=(a[s]||0)+c/(o-i)));let u=kr.fromObject(a,r);return l.length>0?kr.fromMillis(c,r).shiftTo(...l).plus(u):u}var Lr=`missing Intl.DateTimeFormat.formatToParts support`;function F(e,t=e=>e){return{regex:e,deser:([e])=>t(Ue(e))}}var Rr=`[ \xA0]`,zr=new RegExp(Rr,`g`);function Br(e){return e.replace(/\./g,`\\.?`).replace(zr,Rr)}function Vr(e){return e.replace(/\./g,``).replace(zr,` `).toLowerCase()}function Hr(e,t){return e===null?null:{regex:RegExp(e.map(Br).join(`|`)),deser:([n])=>e.findIndex(e=>Vr(n)===Vr(e))+t}}function Ur(e,t){return{regex:e,deser:([,e,t])=>Wt(e,t),groups:t}}function Wr(e){return{regex:e,deser:([e])=>e}}function Gr(e){return e.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,`\\$&`)}function Kr(e,t){let n=Ke(t),r=Ke(t,`{2}`),i=Ke(t,`{3}`),a=Ke(t,`{4}`),o=Ke(t,`{6}`),s=Ke(t,`{1,2}`),c=Ke(t,`{1,3}`),l=Ke(t,`{1,6}`),u=Ke(t,`{1,9}`),d=Ke(t,`{2,4}`),f=Ke(t,`{4,6}`),p=e=>({regex:RegExp(Gr(e.val)),deser:([e])=>e,literal:!0}),m=(m=>{if(e.literal)return p(m);switch(m.val){case`G`:return Hr(t.eras(`short`),0);case`GG`:return Hr(t.eras(`long`),0);case`y`:return F(l);case`yy`:return F(d,Ht);case`yyyy`:return F(a);case`yyyyy`:return F(f);case`yyyyyy`:return F(o);case`M`:return F(s);case`MM`:return F(r);case`MMM`:return Hr(t.months(`short`,!0),1);case`MMMM`:return Hr(t.months(`long`,!0),1);case`L`:return F(s);case`LL`:return F(r);case`LLL`:return Hr(t.months(`short`,!1),1);case`LLLL`:return Hr(t.months(`long`,!1),1);case`d`:return F(s);case`dd`:return F(r);case`o`:return F(c);case`ooo`:return F(i);case`HH`:return F(r);case`H`:return F(s);case`hh`:return F(r);case`h`:return F(s);case`mm`:return F(r);case`m`:return F(s);case`q`:return F(s);case`qq`:return F(r);case`s`:return F(s);case`ss`:return F(r);case`S`:return F(c);case`SSS`:return F(i);case`u`:return Wr(u);case`uu`:return Wr(s);case`uuu`:return F(n);case`a`:return Hr(t.meridiems(),0);case`kkkk`:return F(a);case`kk`:return F(d,Ht);case`W`:return F(s);case`WW`:return F(r);case`E`:case`c`:return F(n);case`EEE`:return Hr(t.weekdays(`short`,!1),1);case`EEEE`:return Hr(t.weekdays(`long`,!1),1);case`ccc`:return Hr(t.weekdays(`short`,!0),1);case`cccc`:return Hr(t.weekdays(`long`,!0),1);case`Z`:case`ZZ`:return Ur(RegExp(`([+-]${s.source})(?::(${r.source}))?`),2);case`ZZZ`:return Ur(RegExp(`([+-]${s.source})(${r.source})?`),2);case`z`:return Wr(/[a-z_+-/]{1,256}?/i);case` `:return Wr(/[^\S\n\r]/);default:return p(m)}})(e)||{invalidReason:Lr};return m.token=e,m}var qr={year:{"2-digit":`yy`,numeric:`yyyyy`},month:{numeric:`M`,"2-digit":`MM`,short:`MMM`,long:`MMMM`},day:{numeric:`d`,"2-digit":`dd`},weekday:{short:`EEE`,long:`EEEE`},dayperiod:`a`,dayPeriod:`a`,hour12:{numeric:`h`,"2-digit":`hh`},hour24:{numeric:`H`,"2-digit":`HH`},minute:{numeric:`m`,"2-digit":`mm`},second:{numeric:`s`,"2-digit":`ss`},timeZoneName:{long:`ZZZZZ`,short:`ZZZ`}};function Jr(e,t,n){let{type:r,value:i}=e;if(r===`literal`){let e=/^\s+$/.test(i);return{literal:!e,val:e?` `:i}}let a=t[r],o=r;r===`hour`&&(o=t.hour12==null?t.hourCycle==null?n.hour12?`hour12`:`hour24`:t.hourCycle===`h11`||t.hourCycle===`h12`?`hour12`:`hour24`:t.hour12?`hour12`:`hour24`);let s=qr[o];if(typeof s==`object`&&(s=s[a]),s)return{literal:!1,val:s}}function Yr(e){return[`^${e.map(e=>e.regex).reduce((e,t)=>`${e}(${t.source})`,``)}$`,e]}function I(e,t,n){let r=e.match(t);if(r){let e={},t=1;for(let i in n)if(Dt(n,i)){let a=n[i],o=a.groups?a.groups+1:1;!a.literal&&a.token&&(e[a.token.val[0]]=a.deser(r.slice(t,t+o))),t+=o}return[r,e]}return[r,{}]}function Xr(e){let t=e=>{switch(e){case`S`:return`millisecond`;case`s`:return`second`;case`m`:return`minute`;case`h`:case`H`:return`hour`;case`d`:return`day`;case`o`:return`ordinal`;case`L`:case`M`:return`month`;case`y`:return`year`;case`E`:case`c`:return`weekday`;case`W`:return`weekNumber`;case`k`:return`weekYear`;case`q`:return`quarter`;default:return null}},n=null,r;return P(e.z)||(n=j.create(e.z)),P(e.Z)||(n||=new Le(e.Z),r=e.Z),P(e.q)||(e.M=(e.q-1)*3+1),P(e.h)||(e.h<12&&e.a===1?e.h+=12:e.h===12&&e.a===0&&(e.h=0)),e.G===0&&e.y&&(e.y=-e.y),P(e.u)||(e.S=Pt(e.u)),[Object.keys(e).reduce((n,r)=>{let i=t(r);return i&&(n[i]=e[r]),n},{}),n,r]}var Zr=null;function Qr(){return Zr||=R.fromMillis(1555555555555),Zr}function $r(e,t){if(e.literal)return e;let n=ii(gn.macroTokenToFormatOpts(e.val),t);return n==null||n.includes(void 0)?e:n}function ei(e,t){return Array.prototype.concat(...e.map(e=>$r(e,t)))}var ti=class{constructor(e,t){if(this.locale=e,this.format=t,this.tokens=ei(gn.parseFormat(t),e),this.units=this.tokens.map(t=>Kr(t,e)),this.disqualifyingUnit=this.units.find(e=>e.invalidReason),!this.disqualifyingUnit){let[e,t]=Yr(this.units);this.regex=RegExp(e,`i`),this.handlers=t}}explainFromTokens(e){if(this.isValid){let[t,n]=I(e,this.regex,this.handlers),[r,i,o]=n?Xr(n):[null,null,void 0];if(Dt(n,`a`)&&Dt(n,`H`))throw new a(`Can't include meridiem when specifying 24-hour format`);return{input:e,tokens:this.tokens,regex:this.regex,rawMatches:t,matches:n,result:r,zone:i,specificOffset:o}}return{input:e,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}};function ni(e,t,n){return new ti(e,n).explainFromTokens(t)}function ri(e,t,n){let{result:r,zone:i,specificOffset:a,invalidReason:o}=ni(e,t,n);return[r,i,a,o]}function ii(e,t){if(!e)return null;let n=gn.create(t,e).dtFormatter(Qr()),r=n.formatToParts(),i=n.resolvedOptions();return r.map(t=>Jr(t,e,i))}var ai=`Invalid DateTime`,oi=864e13;function si(e){return new tt(`unsupported zone`,`the zone "${e.name}" is not supported`)}function ci(e){return e.weekData===null&&(e.weekData=lt(e.c)),e.weekData}function li(e){return e.localWeekData===null&&(e.localWeekData=lt(e.c,e.loc.getMinDaysInFirstWeek(),e.loc.getStartOfWeek())),e.localWeekData}function ui(e,t){let n={ts:e.ts,zone:e.zone,c:e.c,o:e.o,loc:e.loc,invalid:e.invalid};return new R({...n,...t,old:n})}function di(e,t,n){let r=e-t*60*1e3,i=n.offset(r);if(t===i)return[r,t];r-=(i-t)*60*1e3;let a=n.offset(r);return i===a?[r,i]:[e-Math.min(i,a)*60*1e3,Math.max(i,a)]}function fi(e,t){e+=t*60*1e3;let n=new Date(e);return{year:n.getUTCFullYear(),month:n.getUTCMonth()+1,day:n.getUTCDate(),hour:n.getUTCHours(),minute:n.getUTCMinutes(),second:n.getUTCSeconds(),millisecond:n.getUTCMilliseconds()}}function pi(e,t,n){return di(zt(e),t,n)}function mi(e,t){let n=e.o,r=e.c.year+Math.trunc(t.years),i=e.c.month+Math.trunc(t.months)+Math.trunc(t.quarters)*3,a={...e.c,year:r,month:i,day:Math.min(e.c.day,Rt(r,i))+Math.trunc(t.days)+Math.trunc(t.weeks)*7},o=kr.fromObject({years:t.years-Math.trunc(t.years),quarters:t.quarters-Math.trunc(t.quarters),months:t.months-Math.trunc(t.months),weeks:t.weeks-Math.trunc(t.weeks),days:t.days-Math.trunc(t.days),hours:t.hours,minutes:t.minutes,seconds:t.seconds,milliseconds:t.milliseconds}).as(`milliseconds`),[s,c]=di(zt(a),n,e.zone);return o!==0&&(s+=o,c=e.zone.offset(s)),{ts:s,o:c}}function hi(e,t,n,r,i,a){let{setZone:o,zone:s}=n;if(e&&Object.keys(e).length!==0||t){let r=t||s,i=R.fromObject(e,{...n,zone:r,specificOffset:a});return o?i:i.setZone(s)}return R.invalid(new tt(`unparsable`,`the input "${i}" can't be parsed as ${r}`))}function gi(e,t,n=!0){return e.isValid?gn.create(M.create(`en-US`),{allowZ:n,forceSimple:!0}).formatDateTimeFromString(e,t):null}function _i(e,t,n){let r=e.c.year>9999||e.c.year<0,i=``;if(r&&e.c.year>=0&&(i+=`+`),i+=jt(e.c.year,r?6:4),n===`year`)return i;if(t){if(i+=`-`,i+=jt(e.c.month),n===`month`)return i;i+=`-`}else if(i+=jt(e.c.month),n===`month`)return i;return i+=jt(e.c.day),i}function vi(e,t,n,r,i,a,o){let s=!n||e.c.millisecond!==0||e.c.second!==0,c=``;switch(o){case`day`:case`month`:case`year`:break;default:if(c+=jt(e.c.hour),o===`hour`)break;if(t){if(c+=`:`,c+=jt(e.c.minute),o===`minute`)break;s&&(c+=`:`,c+=jt(e.c.second))}else{if(c+=jt(e.c.minute),o===`minute`)break;s&&(c+=jt(e.c.second))}if(o===`second`)break;s&&(!r||e.c.millisecond!==0)&&(c+=`.`,c+=jt(e.c.millisecond,3))}return i&&(e.isOffsetFixed&&e.offset===0&&!a?c+=`Z`:e.o<0?(c+=`-`,c+=jt(Math.trunc(-e.o/60)),c+=`:`,c+=jt(Math.trunc(-e.o%60))):(c+=`+`,c+=jt(Math.trunc(e.o/60)),c+=`:`,c+=jt(Math.trunc(e.o%60)))),a&&(c+=`[`+e.zone.ianaName+`]`),c}var yi={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},bi={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},xi={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Si=[`year`,`month`,`day`,`hour`,`minute`,`second`,`millisecond`],Ci=[`weekYear`,`weekNumber`,`weekday`,`hour`,`minute`,`second`,`millisecond`],wi=[`year`,`ordinal`,`hour`,`minute`,`second`,`millisecond`];function Ti(e){let t={year:`year`,years:`year`,month:`month`,months:`month`,day:`day`,days:`day`,hour:`hour`,hours:`hour`,minute:`minute`,minutes:`minute`,quarter:`quarter`,quarters:`quarter`,second:`second`,seconds:`second`,millisecond:`millisecond`,milliseconds:`millisecond`,weekday:`weekday`,weekdays:`weekday`,weeknumber:`weekNumber`,weeksnumber:`weekNumber`,weeknumbers:`weekNumber`,weekyear:`weekYear`,weekyears:`weekYear`,ordinal:`ordinal`}[e.toLowerCase()];if(!t)throw new o(e);return t}function Ei(e){switch(e.toLowerCase()){case`localweekday`:case`localweekdays`:return`localWeekday`;case`localweeknumber`:case`localweeknumbers`:return`localWeekNumber`;case`localweekyear`:case`localweekyears`:return`localWeekYear`;default:return Ti(e)}}function Di(e){if(L===void 0&&(L=N.now()),e.type!==`iana`)return e.offset(L);let t=e.name,n=ji.get(t);return n===void 0&&(n=e.offset(L),ji.set(t,n)),n}function Oi(e,t){let n=ze(t.zone,N.defaultZone);if(!n.isValid)return R.invalid(si(n));let r=M.fromObject(t),i,a;if(P(e.year))i=N.now();else{for(let t of Si)P(e[t])&&(e[t]=yi[t]);let t=gt(e)||_t(e);if(t)return R.invalid(t);let r=Di(n);[i,a]=pi(e,r,n)}return new R({ts:i,zone:n,loc:r,o:a})}function ki(e,t,n){let r=P(n.round)?!0:n.round,i=P(n.rounding)?`trunc`:n.rounding,a=(e,a)=>(e=Ft(e,r||n.calendary?0:2,n.calendary?`round`:i),t.loc.clone(n).relFormatter(n).format(e,a)),o=r=>n.calendary?t.hasSame(e,r)?0:t.startOf(r).diff(e.startOf(r),r).get(r):t.diff(e,r).get(r);if(n.unit)return a(o(n.unit),n.unit);for(let e of n.units){let t=o(e);if(Math.abs(t)>=1)return a(t,e)}return a(e>t?-0:0,n.units[n.units.length-1])}function Ai(e){let t={},n;return e.length>0&&typeof e[e.length-1]==`object`?(t=e[e.length-1],n=Array.from(e).slice(0,e.length-1)):n=Array.from(e),[t,n]}var L,ji=new Map,R=class e{constructor(e){let t=e.zone||N.defaultZone,n=e.invalid||(Number.isNaN(e.ts)?new tt(`invalid input`):null)||(t.isValid?null:si(t));this.ts=P(e.ts)?N.now():e.ts;let r=null,i=null;if(!n){if(e.old&&e.old.ts===this.ts&&e.old.zone.equals(t))[r,i]=[e.old.c,e.old.o];else{let a=vt(e.o)&&!e.old?e.o:t.offset(this.ts);r=fi(this.ts,a),n=Number.isNaN(r.year)?new tt(`invalid input`):null,r=n?null:r,i=n?null:a}}this._zone=t,this.loc=e.loc||M.create(),this.invalid=n,this.weekData=null,this.localWeekData=null,this.c=r,this.o=i,this.isLuxonDateTime=!0}static now(){return new e({})}static local(){let[e,t]=Ai(arguments),[n,r,i,a,o,s,c]=t;return Oi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static utc(){let[e,t]=Ai(arguments),[n,r,i,a,o,s,c]=t;return e.zone=Le.utcInstance,Oi({year:n,month:r,day:i,hour:a,minute:o,second:s,millisecond:c},e)}static fromJSDate(t,n={}){let r=xt(t)?t.valueOf():NaN;if(Number.isNaN(r))return e.invalid(`invalid input`);let i=ze(n.zone,N.defaultZone);return i.isValid?new e({ts:r,zone:i,loc:M.fromObject(n)}):e.invalid(si(i))}static fromMillis(t,n={}){if(!vt(t))throw new s(`fromMillis requires a numerical input, but received a ${typeof t} with value ${t}`);return t<-864e13||t>oi?e.invalid(`Timestamp out of range`):new e({ts:t,zone:ze(n.zone,N.defaultZone),loc:M.fromObject(n)})}static fromSeconds(t,n={}){if(vt(t))return new e({ts:t*1e3,zone:ze(n.zone,N.defaultZone),loc:M.fromObject(n)});throw new s(`fromSeconds requires a numerical input`)}static fromObject(t,n={}){t||={};let r=ze(n.zone,N.defaultZone);if(!r.isValid)return e.invalid(si(r));let i=M.fromObject(n),o=Kt(t,Ei),{minDaysInFirstWeek:s,startOfWeek:c}=pt(o,i),l=N.now(),u=P(n.specificOffset)?r.offset(l):n.specificOffset,d=!P(o.ordinal),f=!P(o.year),p=!P(o.month)||!P(o.day),m=f||p,h=o.weekYear||o.weekNumber;if((m||d)&&h)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(p&&d)throw new a(`Can't mix ordinal dates with month/day`);let g=h||o.weekday&&!m,_,v,y=fi(l,u);g?(_=Ci,v=bi,y=lt(y,s,c)):d?(_=wi,v=xi,y=dt(y)):(_=Si,v=yi);let b=!1;for(let e of _){let t=o[e];P(t)?o[e]=b?v[e]:y[e]:b=!0}let x=(g?mt(o,s,c):d?ht(o):gt(o))||_t(o);if(x)return e.invalid(x);let[S,C]=pi(g?ut(o,s,c):d?ft(o):o,u,r),w=new e({ts:S,zone:r,o:C,loc:i});return o.weekday&&m&&t.weekday!==w.weekday?e.invalid(`mismatched weekday`,`you can't specify both a weekday of ${o.weekday} and a date of ${w.toISO()}`):w.isValid?w:e.invalid(w.invalid)}static fromISO(e,t={}){let[n,r]=sr(e);return hi(n,r,t,`ISO 8601`,e)}static fromRFC2822(e,t={}){let[n,r]=cr(e);return hi(n,r,t,`RFC 2822`,e)}static fromHTTP(e,t={}){let[n,r]=lr(e);return hi(n,r,t,`HTTP`,t)}static fromFormat(t,n,r={}){if(P(t)||P(n))throw new s(`fromFormat requires an input string and a format`);let{locale:i=null,numberingSystem:a=null}=r,[o,c,l,u]=ri(M.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0}),t,n);return u?e.invalid(u):hi(o,c,r,`format ${n}`,t,l)}static fromString(t,n,r={}){return e.fromFormat(t,n,r)}static fromSQL(e,t={}){let[n,r]=gr(e);return hi(n,r,t,`SQL`,e)}static invalid(t,r=null){if(!t)throw new s(`need to specify a reason the DateTime is invalid`);let i=t instanceof tt?t:new tt(t,r);if(N.throwOnInvalid)throw new n(i);return new e({invalid:i})}static isDateTime(e){return e&&e.isLuxonDateTime||!1}static parseFormatForOpts(e,t={}){let n=ii(e,M.fromObject(t));return n?n.map(e=>e?e.val:null).join(``):null}static expandFormat(e,t={}){return ei(gn.parseFormat(e),M.fromObject(t)).map(e=>e.val).join(``)}static resetCache(){L=void 0,ji.clear()}get(e){return this[e]}get isValid(){return this.invalid===null}get invalidReason(){return this.invalid?this.invalid.reason:null}get invalidExplanation(){return this.invalid?this.invalid.explanation:null}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}get outputCalendar(){return this.isValid?this.loc.outputCalendar:null}get zone(){return this._zone}get zoneName(){return this.isValid?this.zone.name:null}get year(){return this.isValid?this.c.year:NaN}get quarter(){return this.isValid?Math.ceil(this.c.month/3):NaN}get month(){return this.isValid?this.c.month:NaN}get day(){return this.isValid?this.c.day:NaN}get hour(){return this.isValid?this.c.hour:NaN}get minute(){return this.isValid?this.c.minute:NaN}get second(){return this.isValid?this.c.second:NaN}get millisecond(){return this.isValid?this.c.millisecond:NaN}get weekYear(){return this.isValid?ci(this).weekYear:NaN}get weekNumber(){return this.isValid?ci(this).weekNumber:NaN}get weekday(){return this.isValid?ci(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?li(this).weekday:NaN}get localWeekNumber(){return this.isValid?li(this).weekNumber:NaN}get localWeekYear(){return this.isValid?li(this).weekYear:NaN}get ordinal(){return this.isValid?dt(this.c).ordinal:NaN}get monthShort(){return this.isValid?Nr.months(`short`,{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Nr.months(`long`,{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Nr.weekdays(`short`,{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Nr.weekdays(`long`,{locObj:this.loc})[this.weekday-1]:null}get offset(){return this.isValid?+this.o:NaN}get offsetNameShort(){return this.isValid?this.zone.offsetName(this.ts,{format:`short`,locale:this.locale}):null}get offsetNameLong(){return this.isValid?this.zone.offsetName(this.ts,{format:`long`,locale:this.locale}):null}get isOffsetFixed(){return this.isValid?this.zone.isUniversal:null}get isInDST(){return this.isOffsetFixed?!1:this.offset>this.set({month:1,day:1}).offset||this.offset>this.set({month:5}).offset}getPossibleOffsets(){if(!this.isValid||this.isOffsetFixed)return[this];let e=864e5,t=6e4,n=zt(this.c),r=this.zone.offset(n-e),i=this.zone.offset(n+e),a=this.zone.offset(n-r*t),o=this.zone.offset(n-i*t);if(a===o)return[this];let s=n-a*t,c=n-o*t,l=fi(s,a),u=fi(c,o);return l.hour===u.hour&&l.minute===u.minute&&l.second===u.second&&l.millisecond===u.millisecond?[ui(this,{ts:s}),ui(this,{ts:c})]:[this]}get isInLeapYear(){return It(this.year)}get daysInMonth(){return Rt(this.year,this.month)}get daysInYear(){return this.isValid?Lt(this.year):NaN}get weeksInWeekYear(){return this.isValid?Vt(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Vt(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(e={}){let{locale:t,numberingSystem:n,calendar:r}=gn.create(this.loc.clone(e),e).resolvedOptions(this);return{locale:t,numberingSystem:n,outputCalendar:r}}toUTC(e=0,t={}){return this.setZone(Le.instance(e),t)}toLocal(){return this.setZone(N.defaultZone)}setZone(t,{keepLocalTime:n=!1,keepCalendarTime:r=!1}={}){if(t=ze(t,N.defaultZone),t.equals(this.zone))return this;if(t.isValid){let e=this.ts;if(n||r){let n=t.offset(this.ts),r=this.toObject();[e]=pi(r,n,t)}return ui(this,{ts:e,zone:t})}return e.invalid(si(t))}reconfigure({locale:e,numberingSystem:t,outputCalendar:n}={}){let r=this.loc.clone({locale:e,numberingSystem:t,outputCalendar:n});return ui(this,{loc:r})}setLocale(e){return this.reconfigure({locale:e})}set(e){if(!this.isValid)return this;let t=Kt(e,Ei),{minDaysInFirstWeek:n,startOfWeek:r}=pt(t,this.loc),i=!P(t.weekYear)||!P(t.weekNumber)||!P(t.weekday),o=!P(t.ordinal),s=!P(t.year),c=!P(t.month)||!P(t.day),l=s||c,u=t.weekYear||t.weekNumber;if((l||o)&&u)throw new a(`Can't mix weekYear/weekNumber units with year/month/day or ordinals`);if(c&&o)throw new a(`Can't mix ordinal dates with month/day`);let d;i?d=ut({...lt(this.c,n,r),...t},n,r):P(t.ordinal)?(d={...this.toObject(),...t},P(t.day)&&(d.day=Math.min(Rt(d.year,d.month),d.day))):d=ft({...dt(this.c),...t});let[f,p]=pi(d,this.o,this.zone);return ui(this,{ts:f,o:p})}plus(e){if(!this.isValid)return this;let t=kr.fromDurationLike(e);return ui(this,mi(this,t))}minus(e){if(!this.isValid)return this;let t=kr.fromDurationLike(e).negate();return ui(this,mi(this,t))}startOf(e,{useLocaleWeeks:t=!1}={}){if(!this.isValid)return this;let n={},r=kr.normalizeUnit(e);switch(r){case`years`:n.month=1;case`quarters`:case`months`:n.day=1;case`weeks`:case`days`:n.hour=0;case`hours`:n.minute=0;case`minutes`:n.second=0;case`seconds`:n.millisecond=0}if(r===`weeks`){if(t){let e=this.loc.getStartOfWeek(),{weekday:t}=this;t<e&&(n.weekNumber=this.weekNumber-1),n.weekday=e}else n.weekday=1}return r===`quarters`&&(n.month=(Math.ceil(this.month/3)-1)*3+1),this.set(n)}endOf(e,t){return this.isValid?this.plus({[e]:1}).startOf(e,t).minus(1):this}toFormat(e,t={}){return this.isValid?gn.create(this.loc.redefaultToEN(t)).formatDateTimeFromString(this,e):ai}toLocaleString(e=f,t={}){return this.isValid?gn.create(this.loc.clone(t),e).formatDateTime(this):ai}toLocaleParts(e={}){return this.isValid?gn.create(this.loc.clone(e),e).formatDateTimeParts(this):[]}toISO({format:e=`extended`,suppressSeconds:t=!1,suppressMilliseconds:n=!1,includeOffset:r=!0,extendedZone:i=!1,precision:a=`milliseconds`}={}){if(!this.isValid)return null;a=Ti(a);let o=e===`extended`,s=_i(this,o,a);return Si.indexOf(a)>=3&&(s+=`T`),s+=vi(this,o,t,n,r,i,a),s}toISODate({format:e=`extended`,precision:t=`day`}={}){return this.isValid?_i(this,e===`extended`,Ti(t)):null}toISOWeekDate(){return gi(this,`kkkk-'W'WW-c`)}toISOTime({suppressMilliseconds:e=!1,suppressSeconds:t=!1,includeOffset:n=!0,includePrefix:r=!1,extendedZone:i=!1,format:a=`extended`,precision:o=`milliseconds`}={}){return this.isValid?(o=Ti(o),(r&&Si.indexOf(o)>=3?`T`:``)+vi(this,a===`extended`,t,e,n,i,o)):null}toRFC2822(){return gi(this,`EEE, dd LLL yyyy HH:mm:ss ZZZ`,!1)}toHTTP(){return gi(this.toUTC(),`EEE, dd LLL yyyy HH:mm:ss 'GMT'`)}toSQLDate(){return this.isValid?_i(this,!0):null}toSQLTime({includeOffset:e=!0,includeZone:t=!1,includeOffsetSpace:n=!0}={}){let r=`HH:mm:ss.SSS`;return(t||e)&&(n&&(r+=` `),t?r+=`z`:e&&(r+=`ZZ`)),gi(this,r,!0)}toSQL(e={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(e)}`:null}toString(){return this.isValid?this.toISO():ai}[Symbol.for(`nodejs.util.inspect.custom`)](){return this.isValid?`DateTime { ts: ${this.toISO()}, zone: ${this.zone.name}, locale: ${this.locale} }`:`DateTime { Invalid, reason: ${this.invalidReason} }`}valueOf(){return this.toMillis()}toMillis(){return this.isValid?this.ts:NaN}toSeconds(){return this.isValid?this.ts/1e3:NaN}toUnixInteger(){return this.isValid?Math.floor(this.ts/1e3):NaN}toJSON(){return this.toISO()}toBSON(){return this.toJSDate()}toObject(e={}){if(!this.isValid)return{};let t={...this.c};return e.includeConfig&&(t.outputCalendar=this.outputCalendar,t.numberingSystem=this.loc.numberingSystem,t.locale=this.loc.locale),t}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(e,t=`milliseconds`,n={}){if(!this.isValid||!e.isValid)return kr.invalid(`created by diffing an invalid DateTime`);let r={locale:this.locale,numberingSystem:this.numberingSystem,...n},i=wt(t).map(kr.normalizeUnit),a=e.valueOf()>this.valueOf(),o=Ir(a?this:e,a?e:this,i,r);return a?o.negate():o}diffNow(t=`milliseconds`,n={}){return this.diff(e.now(),t,n)}until(e){return this.isValid?Mr.fromDateTimes(this,e):this}hasSame(e,t,n){if(!this.isValid)return!1;let r=e.valueOf(),i=this.setZone(e.zone,{keepLocalTime:!0});return i.startOf(t,n)<=r&&r<=i.endOf(t,n)}equals(e){return this.isValid&&e.isValid&&this.valueOf()===e.valueOf()&&this.zone.equals(e.zone)&&this.loc.equals(e.loc)}toRelative(t={}){if(!this.isValid)return null;let n=t.base||e.fromObject({},{zone:this.zone}),r=t.padding?this<n?-t.padding:t.padding:0,i=[`years`,`months`,`days`,`hours`,`minutes`,`seconds`],a=t.unit;return Array.isArray(t.unit)&&(i=t.unit,a=void 0),ki(n,this.plus(r),{...t,numeric:`always`,units:i,unit:a})}toRelativeCalendar(t={}){return this.isValid?ki(t.base||e.fromObject({},{zone:this.zone}),this,{...t,numeric:`auto`,units:[`years`,`months`,`days`],calendary:!0}):null}static min(...t){if(!t.every(e.isDateTime))throw new s(`min requires all arguments be DateTimes`);return Tt(t,e=>e.valueOf(),Math.min)}static max(...t){if(!t.every(e.isDateTime))throw new s(`max requires all arguments be DateTimes`);return Tt(t,e=>e.valueOf(),Math.max)}static fromFormatExplain(e,t,n={}){let{locale:r=null,numberingSystem:i=null}=n;return ni(M.fromOpts({locale:r,numberingSystem:i,defaultToEN:!0}),e,t)}static fromStringExplain(t,n,r={}){return e.fromFormatExplain(t,n,r)}static buildFormatParser(e,t={}){let{locale:n=null,numberingSystem:r=null}=t;return new ti(M.fromOpts({locale:n,numberingSystem:r,defaultToEN:!0}),e)}static fromFormatParser(t,n,r={}){if(P(t)||P(n))throw new s(`fromFormatParser requires an input string and a format parser`);let{locale:i=null,numberingSystem:a=null}=r,o=M.fromOpts({locale:i,numberingSystem:a,defaultToEN:!0});if(!o.equals(n.locale))throw new s(`fromFormatParser called with a locale of ${o}, but the format parser was created for ${n.locale}`);let{result:c,zone:l,specificOffset:u,invalidReason:d}=n.explainFromTokens(t);return d?e.invalid(d):hi(c,l,r,`format ${n.format}`,t,u)}static get DATE_SHORT(){return f}static get DATE_MED(){return p}static get DATE_MED_WITH_WEEKDAY(){return m}static get DATE_FULL(){return h}static get DATE_HUGE(){return g}static get TIME_SIMPLE(){return _}static get TIME_WITH_SECONDS(){return v}static get TIME_WITH_SHORT_OFFSET(){return y}static get TIME_WITH_LONG_OFFSET(){return b}static get TIME_24_SIMPLE(){return x}static get TIME_24_WITH_SECONDS(){return S}static get TIME_24_WITH_SHORT_OFFSET(){return C}static get TIME_24_WITH_LONG_OFFSET(){return w}static get DATETIME_SHORT(){return T}static get DATETIME_SHORT_WITH_SECONDS(){return ee}static get DATETIME_MED(){return te}static get DATETIME_MED_WITH_SECONDS(){return E}static get DATETIME_MED_WITH_WEEKDAY(){return D}static get DATETIME_FULL(){return ne}static get DATETIME_FULL_WITH_SECONDS(){return re}static get DATETIME_HUGE(){return ie}static get DATETIME_HUGE_WITH_SECONDS(){return ae}};function Mi(e){if(R.isDateTime(e))return e;if(e&&e.valueOf&&vt(e.valueOf()))return R.fromJSDate(e);if(e&&typeof e==`object`)return R.fromObject(e);throw new s(`Unknown datetime argument: ${e}, of type ${typeof e}`)}e.DateTime=R,e.Duration=kr,e.FixedOffsetZone=Le,e.IANAZone=j,e.Info=Nr,e.Interval=Mr,e.InvalidZone=Re,e.Settings=N,e.SystemZone=k,e.VERSION=`3.7.2`,e.Zone=O})),eo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDate=e.DAYS_IN_MONTH=e.DateMathOp=e.TimeUnit=void 0;var t=$a(),n;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.Day=`Day`,e.Month=`Month`,e.Year=`Year`})(n||(e.TimeUnit=n={}));var r;(function(e){e.Add=`Add`,e.Subtract=`Subtract`})(r||(e.DateMathOp=r={})),e.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);var i=class i{#e;#t=null;#n=null;#r=null;constructor(e,n){let r={zone:n};if(e?e instanceof i?(this.#e=e.#e,this.#t=e.#t,this.#n=e.#n,this.#r=e.#r):e instanceof Date?this.#e=t.DateTime.fromJSDate(e,r):typeof e==`number`?this.#e=t.DateTime.fromMillis(e,r):(this.#e=t.DateTime.fromISO(e,r),this.#e.isValid||(this.#e=t.DateTime.fromRFC2822(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromSQL(e,r)),this.#e.isValid||(this.#e=t.DateTime.fromFormat(e,`EEE, d MMM yyyy HH:mm:ss`,r))):this.#e=t.DateTime.local(),!this.#e.isValid)throw Error(`CronDate: unhandled timestamp: ${e}`);n&&n!==this.#e.zoneName&&(this.#e=this.#e.setZone(n))}static#i(e){return e%4==0&&e%100!=0||e%400==0}get dstStart(){return this.#t}get dstStartLandingHour(){return this.#n}clearDstStart(){this.#t=null,this.#n=null}get dstEnd(){return this.#r}set dstEnd(e){this.#r=e}addYear(){this.#e=this.#e.plus({years:1})}addMonth(){this.#e=this.#e.plus({months:1}).startOf(`month`)}addDay(){this.#e=this.#e.plus({days:1}).startOf(`day`)}addHour(){this.#e=this.#e.plus({hours:1}).startOf(`hour`)}addMinute(){this.#e=this.#e.plus({minutes:1}).startOf(`minute`)}addSecond(){this.#e=this.#e.plus({seconds:1})}subtractYear(){this.#e=this.#e.minus({years:1})}subtractMonth(){this.#e=this.#e.minus({months:1}).endOf(`month`).startOf(`second`)}subtractDay(){this.#e=this.#e.minus({days:1}).endOf(`day`).startOf(`second`)}subtractHour(){this.#e=this.#e.minus({hours:1}).endOf(`hour`).startOf(`second`)}subtractMinute(){this.#e=this.#e.minus({minutes:1}).endOf(`minute`).startOf(`second`)}subtractSecond(){this.#e=this.#e.minus({seconds:1})}addUnit(e){switch(e){case n.Year:return this.addYear();case n.Month:return this.addMonth();case n.Day:return this.addDay();case n.Hour:return this.addHour();case n.Minute:return this.addMinute();case n.Second:return this.addSecond()}}subtractUnit(e){switch(e){case n.Year:return this.subtractYear();case n.Month:return this.subtractMonth();case n.Day:return this.subtractDay();case n.Hour:return this.subtractHour();case n.Minute:return this.subtractMinute();case n.Second:return this.subtractSecond()}}invokeDateOperation(e,t){if(e===r.Add){this.addUnit(t);return}if(e===r.Subtract){this.subtractUnit(t);return}throw Error(`Invalid verb: ${e}`)}getDate(){return this.#e.day}getFullYear(){return this.#e.year}getDay(){let e=this.#e.weekday;return e===7?0:e}getMonth(){return this.#e.month-1}getHours(){return this.#e.hour}getMinutes(){return this.#e.minute}getSeconds(){return this.#e.second}getMilliseconds(){return this.#e.millisecond}getUTCOffset(){return this.#e.offset}setStartOfDay(){this.#e=this.#e.startOf(`day`)}setEndOfDay(){this.#e=this.#e.endOf(`day`)}getTime(){return this.#e.valueOf()}getUTCDate(){return this.#a().day}getUTCFullYear(){return this.#a().year}getUTCDay(){let e=this.#a().weekday;return e===7?0:e}getUTCMonth(){return this.#a().month-1}getUTCHours(){return this.#a().hour}getUTCMinutes(){return this.#a().minute}getUTCSeconds(){return this.#a().second}toISOString(){return this.#e.toUTC().toISO()}toJSON(){return this.#e.toJSON()}setDate(e){this.#e=this.#e.set({day:e})}setFullYear(e){this.#e=this.#e.set({year:e})}setDay(e){this.#e=this.#e.set({weekday:e})}setMonth(e){this.#e=this.#e.set({month:e+1})}setHours(e){this.#e=this.#e.set({hour:e})}setMinutes(e){this.#e=this.#e.set({minute:e})}setSeconds(e){this.#e=this.#e.set({second:e})}setMilliseconds(e){this.#e=this.#e.set({millisecond:e})}toString(){return this.toDate().toString()}toDate(){return this.#e.toJSDate()}isLastDayOfMonth(){let{day:t,month:n}=this.#e;if(n===2){let r=i.#i(this.#e.year);return t===e.DAYS_IN_MONTH[n-1]-+!r}return t===e.DAYS_IN_MONTH[n-1]}isLastWeekdayOfMonth(){let{day:t,month:n}=this.#e,r;return r=n===2?e.DAYS_IN_MONTH[n-1]-+!i.#i(this.#e.year):e.DAYS_IN_MONTH[n-1],t>r-7}applyDateOperation(e,t,i){if(t===n.Month||t===n.Day){this.invokeDateOperation(e,t);return}let a=this.getHours(),o=this.getUTCOffset();this.invokeDateOperation(e,t);let s=this.getHours(),c=(s-a+24)%24;e===r.Add&&this.getUTCOffset()>o&&c>=2?i!==24&&(this.#t=(a+1)%24,this.#n=s):c===0&&this.getMinutes()===0&&this.getSeconds()===0&&i!==24&&(this.dstEnd=s)}#a(){return this.#e.toUTC()}};e.CronDate=i,e.default=i})),to=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMonth=void 0;var t=eo(),n=Qa(),r=1,i=12,a=Object.freeze([]);e.CronMonth=class extends n.CronField{static get min(){return r}static get max(){return i}static get chars(){return a}static get daysInMonth(){return t.DAYS_IN_MONTH}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),no=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfMonth=void 0;var t=Qa(),n=to(),r=1,i=31,a=Object.freeze([`L`]);e.CronDayOfMonth=class e extends t.CronField{static fromMonth(t,r,i){if(t.length!==1)return new e(r,i);let a=n.CronMonth.daysInMonth[t[0]-1],o=r.filter(e=>typeof e!=`number`||e<=a);return new e(o.length>0?o:r,i)}static get min(){return r}static get max(){return i}static get chars(){return a}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),ro=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronDayOfWeek=void 0;var t=Qa(),n=0,r=7,i=Object.freeze([`L`]);e.CronDayOfWeek=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(e,t){if(super(e,t),this.validate(),this.values.some(e=>e===`L`))throw Error(`${this.constructor.name} Validation error, unexpected standalone L`)}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}}})),io=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronHour=void 0;var t=Qa(),n=0,r=23,i=Object.freeze([]);e.CronHour=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),ao=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronMinute=void 0;var t=Qa(),n=0,r=59,i=Object.freeze([]);e.CronMinute=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),oo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronSecond=void 0;var t=Qa(),n=0,r=59,i=Object.freeze([]);e.CronSecond=class extends t.CronField{static get min(){return n}static get max(){return r}static get chars(){return i}constructor(e,t){super(e,t),this.validate()}get values(){return super.values}}})),so=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),n(Za(),e),n(no(),e),n(ro(),e),n(Qa(),e),n(io(),e),n(ao(),e),n(to(),e),n(oo(),e)})),co=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFieldCollection=void 0;var t=so();e.CronFieldCollection=class e{#e;#t;#n;#r;#i;#a;static from(n,r){return new e({second:this.resolveField(t.CronSecond,n.second,r.second),minute:this.resolveField(t.CronMinute,n.minute,r.minute),hour:this.resolveField(t.CronHour,n.hour,r.hour),dayOfMonth:this.resolveField(t.CronDayOfMonth,n.dayOfMonth,r.dayOfMonth),month:this.resolveField(t.CronMonth,n.month,r.month),dayOfWeek:this.resolveField(t.CronDayOfWeek,n.dayOfWeek,r.dayOfWeek)})}static resolveField(e,n,r){return r?r instanceof t.CronField?r:new e(r):n}constructor({second:e,minute:n,hour:r,dayOfMonth:i,month:a,dayOfWeek:o}){if(!e)throw Error(`Validation error, Field second is missing`);if(!n)throw Error(`Validation error, Field minute is missing`);if(!r)throw Error(`Validation error, Field hour is missing`);if(!i)throw Error(`Validation error, Field dayOfMonth is missing`);if(!a)throw Error(`Validation error, Field month is missing`);if(!o)throw Error(`Validation error, Field dayOfWeek is missing`);if(a.values.length===1&&!i.hasLastChar&&o.isWildcard&&!(parseInt(i.values[0],10)<=t.CronMonth.daysInMonth[a.values[0]-1]))throw Error(`Invalid explicit day of month definition`);this.#e=e,this.#t=n,this.#n=r,this.#i=a,this.#a=o,this.#r=i}get second(){return this.#e}get minute(){return this.#t}get hour(){return this.#n}get dayOfMonth(){return this.#r}get month(){return this.#i}get dayOfWeek(){return this.#a}static compactField(e){if(e.length===0)return[];let t=[],n;return e.forEach((e,r,i)=>{if(n===void 0){n={start:e,count:1};return}let a=i[r-1]||n.start,o=i[r+1];if(e===`L`||e===`W`){t.push(n),t.push({start:e,count:1}),n=void 0;return}if(n.step===void 0&&o!==void 0){let t=e-a;if(t<=o-e){n={...n,count:2,end:e,step:t};return}n.step=1}e-(n.end??0)===n.step?(n.count++,n.end=e):(n.count===1?t.push({start:n.start,count:1}):n.count===2?(t.push({start:n.start,count:1}),t.push({start:n.end??a,count:1})):t.push(n),n={start:e,count:1})}),n&&t.push(n),t}static#o(e,n,r){let i=n.step;return i?i===1&&n.start===e.min&&n.end&&n.end>=r?(e instanceof t.CronDayOfMonth||e instanceof t.CronDayOfWeek)&&!e.isWildcard?null:e.hasQuestionMarkChar?`?`:`*`:i!==1&&n.start===e.min&&n.end&&n.end>=r-i+1?`*/${i}`:null:null}static#s(e){let t=e.step;if(t===1)return`${e.start}-${e.end}`;let n=e.start===0?e.count-1:e.count;if(!t)throw Error(`Unexpected range step`);if(!e.end)throw Error(`Unexpected range end`);if(t*n>e.end){let n=(n,r)=>{if(typeof e.start!=`number`)throw Error(`Unexpected range start`);return r%t===0?e.start+r:null};if(typeof e.start!=`number`)throw Error(`Unexpected range start`);let r={length:e.end-e.start+1};return Array.from(r,n).filter(e=>e!==null).join(`,`)}return`${e.start}-${e.end}/${t}`}stringifyField(n){let r=n.max,i=n.values;if(n instanceof t.CronDayOfWeek){r=6;let e=this.#a.values;i=e[e.length-1]===7?e.slice(0,-1):e}n instanceof t.CronDayOfMonth&&(r=this.#i.values.length===1?t.CronMonth.daysInMonth[this.#i.values[0]-1]:n.max);let a=e.compactField(i);if(a.length===1){let t=e.#o(n,a[0],r);if(t)return t}return a.map(r=>{let i=r.count===1?r.start.toString():e.#s(r);return n instanceof t.CronDayOfWeek&&n.nthDay>0?`${i}#${n.nthDay}`:i}).join(`,`)}stringify(e=!1){let t=[];return e&&t.push(this.stringifyField(this.#e)),t.push(this.stringifyField(this.#t),this.stringifyField(this.#n),this.stringifyField(this.#r),this.stringifyField(this.#i),this.stringifyField(this.#a)),t.join(` `)}serialize(){return{second:this.#e.serialize(),minute:this.#t.serialize(),hour:this.#n.serialize(),dayOfMonth:this.#r.serialize(),month:this.#i.serialize(),dayOfWeek:this.#a.serialize()}}}})),lo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpression=e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;var t=eo();e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=`Out of the time span range`,e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=`Invalid expression, loop limit exceeded`;var n=1e4,r=class r{#e;#t;#n;#r;#i;#a;#o=null;#s=!1;constructor(e,n){this.#e=n,this.#t=n.tz,this.#r=n.startDate?new t.CronDate(n.startDate,this.#t):null,this.#i=n.endDate?new t.CronDate(n.endDate,this.#t):null;let r=n.currentDate??n.startDate;if(r){let e=new t.CronDate(r,this.#t);this.#r&&e.getTime()<this.#r.getTime()?r=this.#r:this.#i&&e.getTime()>this.#i.getTime()&&(r=this.#i)}this.#n=new t.CronDate(r,this.#t),this.#a=e}get fields(){return this.#a}static fieldsToExpression(e,t){return new r(e,t||{})}static#c(e,t){return t.some(t=>t===e)}#l(e,t){return e[t?e.length-1:0]}#u(e){let n=`${e.getFullYear()}-${e.getMonth()+1}-${e.getDate()}`;if(this.#o===n)return this.#s;let r=new t.CronDate(e);r.setStartOfDay();let i=new t.CronDate(e);return i.setEndOfDay(),this.#o=n,this.#s=r.getUTCOffset()!==i.getUTCOffset(),this.#s}#d(e,n,r){let i=this.#a.second.values,a=e.getSeconds(),o=this.#a.second.findNearestValue(a,r);if(o!==null){e.setSeconds(o);return}e.applyDateOperation(n,t.TimeUnit.Minute,this.#a.hour.values.length),e.setSeconds(this.#l(i,r))}#f(e,n,r){let i=this.#a.minute.values,a=this.#a.second.values,o=e.getMinutes(),s=this.#a.minute.findNearestValue(o,r);if(s!==null){e.setMinutes(s),e.setSeconds(this.#l(a,r));return}e.applyDateOperation(n,t.TimeUnit.Hour,this.#a.hour.values.length),e.setMinutes(this.#l(i,r)),e.setSeconds(this.#l(a,r))}static#p(e,t){if(!t.isLastWeekdayOfMonth())return!1;let n=t.getDay();return e.some(e=>n===parseInt(e.toString().charAt(0),10)%7)}static#m(e,t){return e<=0||Math.ceil(t.getDate()/7)===e}next(){return this.#v()}prev(){return this.#v(!0)}hasNext(){let e=this.#n;try{return this.#v(),!0}catch{return!1}finally{this.#n=e}}hasPrev(){let e=this.#n;try{return this.#v(!0),!0}catch{return!1}finally{this.#n=e}}take(e){let t=[];if(e>=0)for(let n=0;n<e;n++)try{t.push(this.next())}catch{return t}else for(let n=0;n>e;n--)try{t.push(this.prev())}catch{return t}return t}reset(e){this.#n=new t.CronDate(e||this.#e.currentDate,this.#t)}stringify(e=!1){return this.#a.stringify(e)}includesDate(e){let{second:n,minute:r,hour:i,month:a}=this.#a,o=new t.CronDate(e,this.#t);return!(!n.values.includes(o.getSeconds())||!r.values.includes(o.getMinutes())||!i.values.includes(o.getHours())||!a.values.includes(o.getMonth()+1)||!this.#h(o))}toString(){return this.#e.expression||this.stringify(!0)}#h(e){let t=this.#a.dayOfMonth.isWildcard,n=!t,i=this.#a.dayOfWeek.isWildcard,a=!i,o=r.#c(e.getDate(),this.#a.dayOfMonth.values)||this.#a.dayOfMonth.hasLastChar&&e.isLastDayOfMonth(),s=this.#a.dayOfWeek.nthDay,c=r.#c(e.getDay(),this.#a.dayOfWeek.values)&&r.#m(s,e)||this.#a.dayOfWeek.hasLastChar&&r.#p(this.#a.dayOfWeek.values,e);return!!(n&&a&&(o||c)||o&&!a||t&&!i&&c)}#g(e,n,i){let a=this.#a.hour.values,o=a,s=e.getHours(),c=r.#c(s,a),l=e.dstEnd===s;if(e.dstStart!==null&&e.dstStartLandingHour===s){for(let t=e.dstStart;t!==s;t=(t+1)%24)if(r.#c(t,a))return!0}if(l&&!i)return e.dstEnd=null,e.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Hour,o.length),!1;if(c)return!0;e.clearDstStart();let u=this.#a.hour.findNearestValue(s,i);if(u===null)return e.applyDateOperation(n,t.TimeUnit.Day,o.length),!1;if(this.#u(e)){let r=i?s-u:u-s;for(let a=0;a<r&&(e.applyDateOperation(n,t.TimeUnit.Hour,o.length),!(!i&&e.getHours()>=u||i&&e.getHours()<=u));a++);}else e.setHours(u);return e.setMinutes(this.#l(this.#a.minute.values,i)),e.setSeconds(this.#l(this.#a.second.values,i)),!1}#_(t){if(!this.#r&&!this.#i)return;let n=t.getTime();if(this.#r&&n<this.#r.getTime()||this.#i&&n>this.#i.getTime())throw Error(e.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)}#v(i=!1){let a=i?t.DateMathOp.Subtract:t.DateMathOp.Add,o=new t.CronDate(this.#n),s=o.getTime();o.getMilliseconds()>0&&(o.setMilliseconds(0),i||o.applyDateOperation(t.DateMathOp.Add,t.TimeUnit.Second,this.#a.hour.values.length));let c=0;for(;++c<n;){if(this.#_(o),!this.#h(o)){o.applyDateOperation(a,t.TimeUnit.Day,this.#a.hour.values.length);continue}if(!r.#c(o.getMonth()+1,this.#a.month.values)){o.applyDateOperation(a,t.TimeUnit.Month,this.#a.hour.values.length);continue}if(this.#g(o,a,i)){if(!r.#c(o.getMinutes(),this.#a.minute.values)){this.#f(o,a,i);continue}if(!r.#c(o.getSeconds(),this.#a.second.values)){this.#d(o,a,i);continue}if(s===o.getTime()){o.applyDateOperation(a,t.TimeUnit.Second,this.#a.hour.values.length);continue}break}}if(c>=n)throw Error(e.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return this.#n=o,o}[Symbol.iterator](){return{next:()=>{try{return{value:this.#v(),done:!1}}catch{return{value:void 0,done:!0}}}}}};e.CronExpression=r,e.default=r})),uo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.seededRandom=r;function t(e){let t=2166136261;for(let n=0;n<e.length;n++)t^=e.charCodeAt(n),t=Math.imul(t,16777619);return()=>t>>>0}function n(e){return()=>{let t=e+=1831565813;return t=Math.imul(t^t>>>15,t|1),t^=t+Math.imul(t^t>>>7,t|61),((t^t>>>14)>>>0)/4294967296}}function r(e){return n(e?t(e)():Math.floor(Math.random()*1e10))}})),fo=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronExpressionParser=e.DayOfWeek=e.Months=e.CronUnit=e.PredefinedExpressions=void 0;var t=co(),n=lo(),r=uo(),i=so(),a;(function(e){e[`@yearly`]=`0 0 0 1 1 *`,e[`@annually`]=`0 0 0 1 1 *`,e[`@monthly`]=`0 0 0 1 * *`,e[`@weekly`]=`0 0 0 * * 0`,e[`@daily`]=`0 0 0 * * *`,e[`@hourly`]=`0 0 * * * *`,e[`@minutely`]=`0 * * * * *`,e[`@secondly`]=`* * * * * *`,e[`@weekdays`]=`0 0 0 * * 1-5`,e[`@weekends`]=`0 0 0 * * 0,6`})(a||(e.PredefinedExpressions=a={}));var o;(function(e){e.Second=`Second`,e.Minute=`Minute`,e.Hour=`Hour`,e.DayOfMonth=`DayOfMonth`,e.Month=`Month`,e.DayOfWeek=`DayOfWeek`})(o||(e.CronUnit=o={}));var s;(function(e){e[e.jan=1]=`jan`,e[e.feb=2]=`feb`,e[e.mar=3]=`mar`,e[e.apr=4]=`apr`,e[e.may=5]=`may`,e[e.jun=6]=`jun`,e[e.jul=7]=`jul`,e[e.aug=8]=`aug`,e[e.sep=9]=`sep`,e[e.oct=10]=`oct`,e[e.nov=11]=`nov`,e[e.dec=12]=`dec`})(s||(e.Months=s={}));var c;(function(e){e[e.sun=0]=`sun`,e[e.mon=1]=`mon`,e[e.tue=2]=`tue`,e[e.wed=3]=`wed`,e[e.thu=4]=`thu`,e[e.fri=5]=`fri`,e[e.sat=6]=`sat`})(c||(e.DayOfWeek=c={})),e.CronExpressionParser=class e{static parse(s,c={}){let{strict:l=!1,hashSeed:u}=c,d=(0,r.seededRandom)(u);s=a[s]||s;let f=e.#e(s,l);if(!(f.dayOfMonth===`*`||f.dayOfWeek===`*`||!l))throw Error(`Cannot use both dayOfMonth and dayOfWeek together in strict mode!`);let p=e.#t(o.Second,f.second,i.CronSecond.constraints,d,l),m=e.#t(o.Minute,f.minute,i.CronMinute.constraints,d,l),h=e.#t(o.Hour,f.hour,i.CronHour.constraints,d,l),g=e.#t(o.Month,f.month,i.CronMonth.constraints,d,l),_=e.#t(o.DayOfMonth,f.dayOfMonth,i.CronDayOfMonth.constraints,d,l),{dayOfWeek:v,nthDayOfWeek:y}=e.#m(f.dayOfWeek),b=e.#t(o.DayOfWeek,v,i.CronDayOfWeek.constraints,d,l),x=new t.CronFieldCollection({second:new i.CronSecond(p,{rawValue:f.second}),minute:new i.CronMinute(m,{rawValue:f.minute}),hour:new i.CronHour(h,{rawValue:f.hour}),dayOfMonth:i.CronDayOfMonth.fromMonth(g,_,{rawValue:f.dayOfMonth}),month:new i.CronMonth(g,{rawValue:f.month}),dayOfWeek:new i.CronDayOfWeek(b,{rawValue:f.dayOfWeek,nthDayOfWeek:y})});return new n.CronExpression(x,{...c,expression:s})}static#e(e,t){if(t&&!e.length)throw Error(`Invalid cron expression`);e||=`0 * * * * *`;let n=e.trim().split(/\s+/);if(t&&n.length<6)throw Error(`Invalid cron expression, expected 6 fields`);if(n.length>6)throw Error(`Invalid cron expression, too many fields`);let r=[`0`,`*`,`*`,`*`,`*`,`*`];n.length<r.length&&n.unshift(...r.slice(0,r.length-n.length));let[i,a,o,s,c,l]=n;return{second:i,minute:a,hour:o,dayOfMonth:s,month:c,dayOfWeek:l}}static#t(e,t,n,r,i){if((e===o.Month||e===o.DayOfWeek)&&(t=t.replace(/[a-z]{3}/gi,e=>{e=e.toLowerCase();let t=s[e]||c[e];if(t===void 0)throw Error(`Validation error, cannot resolve alias "${e}"`);return t.toString()})),!n.validChars.test(t))throw Error(`Invalid characters, got value: ${t}`);return t=this.#n(t,n),t=this.#r(t,n,r,e,i),this.#c(e,t,n)}static#n(e,t){return e.replace(/[*?]/g,t.min+`-`+t.max)}static#r(t,n,r,i,a){let o=r();return t.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(t,r,s,c)=>{if(r&&s&&c){let t=parseInt(r,10),l=parseInt(s,10),u=parseInt(c,10);if(u<=0)throw Error(`Invalid step: ${u}, must be positive`);let d=e.#o(t,l,n,i,a);return e.#s(o,d.min,d.max,u,i,a)}if(r&&s){let t=parseInt(r,10),c=parseInt(s,10),l=e.#o(t,c,n,i,a);return String(e.#i(o,l.min,l.max))}if(c){let t=parseInt(c,10);if(t<=0)throw Error(`Invalid step: ${t}, must be positive`);return e.#s(o,n.min,n.max,t,i,a)}return String(e.#i(o,n.min,n.max))})}static#i(e,t,n){return Math.floor(e*(n-t+1))+t}static#a(e){return e.charAt(0).toLowerCase()+e.slice(1)}static#o(t,n,r,i,a){if(t>n)throw Error(`Invalid range: ${t}-${n}, min > max`);if(a&&(t<r.min||n>r.max))throw Error(`Invalid range: ${t}-${n}, outside the ${r.min}-${r.max} range of the ${e.#a(i)} field`);let o=Math.max(t,r.min),s=Math.min(n,r.max);if(o>s)throw Error(`Invalid range: ${t}-${n}, no usable value in the ${e.#a(i)} field`);return{min:o,max:s}}static#s(t,n,r,i,a,o){if(o&&i>r-n+1)throw Error(`Invalid step: ${i}, wider than the ${n}-${r} range of the ${e.#a(a)} field`);let s=Math.floor(t*i),c=[];for(let e=Math.floor(n/i)*i+s;e<=r;e+=i)e>=n&&c.push(e);return c.length===0?String(e.#i(t,n,r)):c.join(`,`)}static#c(t,n,r){let i=[];function a(n,r){if(Array.isArray(n))i.push(...n);else if(e.#h(r,n))i.push(n);else{let e=parseInt(n.toString(),10);if(!(e>=r.min&&e<=r.max))throw Error(`Constraint error, got value ${n} expected range ${r.min}-${r.max}`);i.push(t===o.DayOfWeek?e%7:n)}}return n.split(`,`).forEach(n=>{if(!(n.length>0))throw Error(`Invalid list value format`);a(e.#l(t,n,r),r)}),i}static#l(t,n,r){let i=n.split(`/`);if(i.length>2)throw Error(`Invalid repeat: ${n}`);return i.length===2?(i[0].includes(`-`)||(i[0]=`${i[0]}-${r.max}`),e.#p(t,i[0],parseInt(i[1],10),r)):e.#p(t,n,1,r)}static#u(e,t,n){if(!(!isNaN(e)&&!isNaN(t)&&e>=n.min&&t<=n.max))throw Error(`Constraint error, got range ${e}-${t} expected range ${n.min}-${n.max}`);if(e>t)throw Error(`Invalid range: ${e}-${t}, min(${e}) > max(${t})`)}static#d(e){if(!(!isNaN(e)&&e>0))throw Error(`Constraint error, cannot repeat at every ${e} time.`)}static#f(e,t,n,r){let i=[];e===o.DayOfWeek&&n%7==0&&(n-t)%r===0&&i.push(0);for(let e=t;e<=n;e+=r)i.indexOf(e)===-1&&i.push(e);return i}static#p(e,t,n,r){let i=t.split(`-`);if(i.length<=1)return isNaN(+t)?t:+t;let[a,o]=i.map(e=>parseInt(e,10));return this.#u(a,o,r),this.#d(n),this.#f(e,a,o,n)}static#m(e){let t=e.split(`#`);if(t.length<=1)return{dayOfWeek:t[0]};let n=+t[t.length-1],r=e.match(/([,\-/])/);if(r!==null)throw Error(`Constraint error, invalid dayOfWeek \`#\` and \`${r?.[0]}\` special characters are incompatible`);if(!(t.length<=2&&!isNaN(n)&&n>=1&&n<=5))throw Error(`Constraint error, invalid dayOfWeek occurrence number (#)`);return{dayOfWeek:t[0],nthDayOfWeek:n}}static#h(e,t){return e.chars.some(e=>t.toString().includes(e))}}})),po=o(((e,t)=>{t.exports={}})),B=o((e=>{Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=void 0;var t=fo();e.CronFileParser=class e{static async parseFile(t){let{readFile:n}=po(),r=await n(t,`utf8`);return e.#e(r)}static parseFileSync(t){let{readFileSync:n}=po(),r=n(t,`utf8`);return e.#e(r)}static#e(t){let n=t.split(`
`),r={variables:{},expressions:[],errors:{}};for(let t of n){let n=t.trim();if(n.length===0||n.startsWith(`#`))continue;let i=n.match(/^(.*)=(.*)$/);if(i){let[,e,t]=i;r.variables[e]=t.replace(/["']/g,``);continue}try{let t=e.#t(n);r.expressions.push(t.interval)}catch(e){r.errors[n]=e}}return r}static#t(e){let n=e.split(` `);return{interval:t.CronExpressionParser.parse(n.slice(0,5).join(` `)),command:n.slice(5,n.length)}}}})),mo=o((e=>{var t=e&&e.__createBinding||(Object.create?(function(e,t,n,r){r===void 0&&(r=n);var i=Object.getOwnPropertyDescriptor(t,n);(!i||(`get`in i?!t.__esModule:i.writable||i.configurable))&&(i={enumerable:!0,get:function(){return t[n]}}),Object.defineProperty(e,r,i)}):(function(e,t,n,r){r===void 0&&(r=n),e[r]=t[n]})),n=e&&e.__exportStar||function(e,n){for(var r in e)r!=="default"&&!Object.prototype.hasOwnProperty.call(n,r)&&t(n,e,r)};Object.defineProperty(e,"__esModule",{value:!0}),e.CronFileParser=e.CronExpressionParser=e.CronExpression=e.CronFieldCollection=e.CronDate=void 0;var r=fo(),i=eo();Object.defineProperty(e,"CronDate",{enumerable:!0,get:function(){return i.CronDate}});var a=co();Object.defineProperty(e,"CronFieldCollection",{enumerable:!0,get:function(){return a.CronFieldCollection}});var o=lo();Object.defineProperty(e,"CronExpression",{enumerable:!0,get:function(){return o.CronExpression}});var s=fo();Object.defineProperty(e,"CronExpressionParser",{enumerable:!0,get:function(){return s.CronExpressionParser}});var c=B();Object.defineProperty(e,"CronFileParser",{enumerable:!0,get:function(){return c.CronFileParser}}),n(so(),e),e.default=r.CronExpressionParser}))(),ho=[`Jan`,`Feb`,`Mar`,`Apr`,`May`,`Jun`,`Jul`,`Aug`,`Sep`,`Oct`,`Nov`,`Dec`];function go(e,t){let n=Ra(e);if(n!==``)try{return mo.CronExpressionParser.parse(n,{currentDate:t})}catch{return}}function _o(e,t){let n=go(e,t);if(n?.hasNext())return n.next().toDate()}function vo(e,t,n){let r=go(e,t);if(!r)return[];let i=[];for(;i.length<n&&r.hasNext();)i.push(r.next().toDate());return i}function yo(e){return e.schedules&&e.schedules.length>0?e.schedules:[e.schedule]}function bo(e,t){return e.map(e=>_o(e,t)).filter(e=>e!==void 0).sort((e,t)=>e.getTime()-t.getTime())[0]}function xo(e,t,n){let r=e.flatMap(e=>vo(e,t,n)),i=new Set;return r.sort((e,t)=>e.getTime()-t.getTime()).filter(e=>{let t=e.getTime();return!i.has(t)&&(i.add(t),!0)}).slice(0,n)}function So(e,t,n){let r=_o(e,t);return r!==void 0&&r.getTime()-t.getTime()<=n}function Co(e,t){let n=Math.floor((t.getTime()-e.getTime())/1e3);if(n<=0)return`now`;let r=Math.floor(n/60);if(r<1)return`in <1m`;if(r<60)return`in ${r}m`;let i=Math.floor(r/60);if(i<24){let e=r%60;return e===0?`in ${i}h`:`in ${i}h ${e}m`}return`in ${Math.floor(i/24)}d`}function wo(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function To(e,t){let n=`${String(t.getHours()).padStart(2,`0`)}:${String(t.getMinutes()).padStart(2,`0`)}`,r=Math.round((wo(t).getTime()-wo(e).getTime())/864e5);return r===0?n:r===1?`tomorrow ${n}`:`${ho[t.getMonth()]} ${t.getDate()}, ${n}`}var Eo=[`SUN`,`MON`,`TUE`,`WED`,`THU`,`FRI`,`SAT`],Do=[`JANUARY`,`FEBRUARY`,`MARCH`,`APRIL`,`MAY`,`JUNE`,`JULY`,`AUGUST`,`SEPTEMBER`,`OCTOBER`,`NOVEMBER`,`DECEMBER`];function Oo(e,t){let n=e.getFullYear()*12+e.getMonth()+t,r=Math.floor(n/12),i=(n%12+12)%12;return new Date(r,i,1)}var ko=2e3;function Ao(e,t){let n=wo(t),r=go(e,new Date(n.getTime()-1e3));if(!r)return[];let i=new Date(n.getTime()+864e5),a=[];for(let e=0;e<ko&&r.hasNext();e++){let e=r.next().toDate();if(!(e.getTime()<n.getTime())){if(e.getTime()>=i.getTime())break;a.push(e)}}return a}function jo(e,t){let n=go(e,new Date(t.getTime()-1e3));if(!n)return;let r=Array(42).fill(0),i=wo(t).getTime();for(let e=0;e<4e3&&n.hasNext();e++){let e=n.next().toDate(),t=Math.floor((wo(e).getTime()-i)/864e5);if(!(t<0)){if(t>=42)break;r[t]=(r[t]??0)+1}}return r}function Mo(e){switch(e){case`nav-overview`:return`home`;case`nav-routines`:case`routine`:return`routines`;case`nav-runs`:return`runs`;case`nav-heatmap`:return`heatmap`;case`nav-reliability`:return`reliability`;case`nav-machines`:return`machines`;case`nav-settings`:return`settings`;default:return}}function No(e){switch(e){case`nav-overview`:case`nav-routines`:case`nav-runs`:case`nav-heatmap`:case`nav-reliability`:case`nav-machines`:case`nav-settings`:return`GO`;case`routine`:return`ROUTINE`;default:return`ACTION`}}function Po(e,t){let n=t.trim();if(n===``)return 0;let r=[...e.toLowerCase()],i=[...n.toLowerCase()],a=0,o=0,s;for(let e of i){let t;for(;o<r.length;){let n=r[o];if(o+=1,n===e){t=o-1;break}}if(t===void 0)return;a+=1,t===0?a+=10:/[a-z0-9]/i.test(r[t-1]??``)||(a+=6),s!==void 0&&t===s+1&&(a+=8),s=t}return a-=Math.floor(r.length/16),a}function Fo(e,t){let n=Po(e.title,t),r=Po(e.keywords,t),i=r===void 0?void 0:r-4;return n!==void 0&&i!==void 0?Math.max(n,i):n??i}function Io(e,t){let n=[];return e.forEach((e,r)=>{let i=Fo(e,t);i!==void 0&&n.push([r,i])}),n.sort(([e,t],[n,r])=>r-t||e-n),n.map(([e])=>e)}function Lo(e,t){return e||(t.trim()===``?`—`:t)}function Ro(e){let t=Lo(e.schedule_description,yo(e).join(`, `)),n=[];return e.enabled?(e.skip_runs??0)>0?n.push(`SNOOZED`):e.agent_registered||n.push(`AGENT MISSING`):n.push(`DISABLED`),e.flag_count>0&&n.push(`FLAGS`),n.length===0?t:`${t} — ${n.join(`, `)}`}function zo(e){let t=[{kind:`nav-overview`,title:`Overview`,subtitle:`Fleet summary & upcoming runs`,keywords:`home dashboard kpi summary landing`},{kind:`nav-routines`,title:`Routines`,subtitle:`Manage agent-driven routines`,keywords:`agents automation`},{kind:`nav-runs`,title:`Runs`,subtitle:`Fleet-wide filterable run history`,keywords:`history activity feed builds jobs log runs`},{kind:`nav-heatmap`,title:`Heatmap`,subtitle:`7-day x 24-hour fire-density grid`,keywords:`schedule density grid busy collisions calendar`},{kind:`nav-reliability`,title:`Reliability`,subtitle:`Success rate, streaks & duration regressions`,keywords:`flaky failing streak p50 p95 duration regression health`},{kind:`nav-machines`,title:`Machines`,subtitle:`Per-host fleet inventory`,keywords:`fleet hosts inventory nodes servers`},{kind:`nav-settings`,title:`Settings`,subtitle:`Preferences, appearance, refresh cadence, and prompt`,keywords:`config preferences user prompt theme light dark appearance refresh cadence`},{kind:`action-refresh`,title:`Refresh`,subtitle:`Re-poll server health`,keywords:`reload health status action`},{kind:`action-stop`,title:`Stop Server`,subtitle:`Shut the moadim server down`,keywords:`shutdown halt kill quit action`},{kind:`action-shortcuts`,title:`Keyboard Shortcuts`,subtitle:`View all shortcuts, including go-to navigation chords`,keywords:`help cheatsheet hotkeys nav chord action`}];for(let n of e)t.push({kind:`routine`,title:n.title,subtitle:Ro(n),keywords:`${n.id} ${n.agent} ${yo(n).join(` `)} ${(n.tags??[]).join(` `)} routine`,routineId:n.id});return t}function Bo(e,t){return t===0?0:Math.min(e,t-1)}function Vo(e,t){return t===0?0:Math.min(e+1,t-1)}function Ho(e){return Math.max(0,e-1)}function Uo(e){return Math.max(0,e-1)}var Wo={home:`/`,routines:`/routines`,runs:`/runs`,heatmap:`/heatmap`,reliability:`/reliability`,machines:`/machines`,settings:`/settings`};function Go({open:e,onClose:t,onRefresh:n,onStop:r,onShortcuts:i}){let a=ft(),o=Xi(),{addToast:s}=Xa(),[c,l]=(0,x.useState)(``),[u,d]=(0,x.useState)(0),f=(0,x.useRef)(null),{data:p}=fi({queryKey:[`command-palette`,`routines`],queryFn:async()=>R(await L.GET(`/routines`)),enabled:e}),[m,h]=(0,x.useState)(e);if(e!==m&&(h(e),e&&(l(``),d(0))),(0,x.useEffect)(()=>{e&&f.current?.focus()},[e]),!e)return null;let g=zo(p??[]),_=Io(g,c),v=Bo(u,_.length),y=e=>{let o=g[_[e]??-1];if(o)switch(o.kind){case`action-refresh`:n();break;case`action-stop`:r();break;case`action-shortcuts`:i();break;case`routine`:a(`/routines?history=${encodeURIComponent(o.routineId??``)}`);break;default:{let e=Mo(o.kind);e&&a(Wo[e]??`/`)}}t()},b=e=>{let n=g[_[e]??-1];if(!n||n.kind!==`routine`||!n.routineId)return;let r=n.routineId,i=n.title;o.mutate(r,{onSuccess:()=>s(`Triggered "${i}"`,`ok`),onError:e=>s(`Trigger failed: ${e.message}`,`err`)}),t()},S=e=>{switch(e.key){case`ArrowDown`:e.preventDefault(),d(Vo(v,_.length));break;case`ArrowUp`:e.preventDefault(),d(Ho(v));break;case`Home`:e.preventDefault(),d(0);break;case`End`:e.preventDefault(),d(Uo(_.length));break;case`Enter`:e.preventDefault(),e.metaKey||e.ctrlKey?b(v):y(v);break;case`Escape`:e.preventDefault(),t()}},C=_.length>0?`cmdk-opt-${v}`:void 0;return(0,I.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,I.jsxs)(`div`,{className:`cmdk`,role:`dialog`,"aria-modal":`true`,"aria-label":`Command palette`,onClick:e=>e.stopPropagation(),children:[(0,I.jsxs)(`div`,{className:`cmdk-search`,children:[(0,I.jsx)(`span`,{"aria-hidden":`true`,children:`›`}),(0,I.jsx)(`input`,{ref:f,className:`cmdk-input`,type:`text`,placeholder:`Search pages, routines…`,autoComplete:`off`,spellCheck:!1,role:`combobox`,"aria-expanded":`true`,"aria-controls":`cmdk-listbox`,"aria-autocomplete":`list`,"aria-activedescendant":C,value:c,onChange:e=>{l(e.target.value),d(0)},onKeyDown:S}),(0,I.jsx)(`span`,{className:`cmdk-hint`,"aria-hidden":`true`,children:`ESC`})]}),_.length===0?(0,I.jsxs)(`div`,{className:`cmdk-empty`,children:[(0,I.jsx)(`div`,{children:`NO MATCHES`}),(0,I.jsx)(`div`,{children:`no page or routine matches`})]}):(0,I.jsx)(`ul`,{id:`cmdk-listbox`,className:`cmdk-list`,role:`listbox`,"aria-label":`Results`,children:_.map((e,t)=>{let n=g[e];if(!n)return null;let r=t===v;return(0,I.jsxs)(`li`,{id:`cmdk-opt-${t}`,className:`cmdk-row${r?` active`:``}`,role:`option`,"aria-selected":r,onClick:()=>y(t),onMouseEnter:()=>d(t),children:[(0,I.jsx)(`span`,{className:`kind-badge`,children:No(n.kind)}),(0,I.jsxs)(`span`,{className:`cmdk-row-text`,children:[(0,I.jsx)(`span`,{className:`cmdk-row-title`,children:n.title}),(0,I.jsx)(`span`,{className:`cmdk-row-sub`,children:n.subtitle})]}),n.kind===`routine`&&(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm cmdk-row-action`,title:`Trigger now (⌘⏎)`,"aria-label":`Trigger ${n.title} now`,onClick:e=>{e.stopPropagation(),b(t)},children:`⚡`})]},e)})}),(0,I.jsxs)(`div`,{className:`cmdk-foot`,"aria-hidden":`true`,children:[(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:`cmdk-key`,children:`↑↓`}),` navigate`]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:`cmdk-key`,children:`↵`}),` open`]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:`cmdk-key`,children:`⌘↵`}),` trigger routine`]}),(0,I.jsxs)(`span`,{children:[(0,I.jsx)(`span`,{className:`cmdk-key`,children:`esc`}),` close`]})]})]})})}function Ko({current:e,onCancel:t,onConfirm:n}){let[r,i]=(0,x.useState)(e),[a,o]=(0,x.useState)(!1),s=r.trim(),c=async()=>{if(s!==``){o(!0);try{await n(s)}finally{o(!1)}}};return(0,I.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,I.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`rename-machine-title`,onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`div`,{id:`rename-machine-title`,className:`dialog-title`,children:`Rename machine`}),(0,I.jsxs)(`div`,{className:`dialog-msg`,children:[(0,I.jsx)(`label`,{className:`form-label`,htmlFor:`rename-machine-input`,children:`Machine name`}),(0,I.jsx)(`input`,{id:`rename-machine-input`,className:`form-input`,type:`text`,value:r,onChange:e=>i(e.target.value),disabled:a,autoComplete:`off`,spellCheck:!1})]}),(0,I.jsxs)(`div`,{className:`dialog-actions`,children:[(0,I.jsx)(`button`,{className:`btn btn-ghost`,onClick:t,disabled:a,children:`Cancel`}),(0,I.jsx)(`button`,{className:`btn btn-primary`,onClick:()=>void c(),disabled:a||s===``,children:a?`Saving…`:`Rename`})]})]})})}function qo({onClose:e}){return(0,I.jsx)(`div`,{className:`overlay`,onClick:e,children:(0,I.jsxs)(`div`,{className:`dialog shortcuts-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`shortcuts-dialog-title`,onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`div`,{id:`shortcuts-dialog-title`,className:`dialog-title`,children:`⌨ Keyboard shortcuts`}),(0,I.jsxs)(`ul`,{className:`shortcuts-list`,children:[(0,I.jsxs)(`li`,{children:[(0,I.jsx)(`span`,{className:`cmdk-key`,children:`⌘K`}),(0,I.jsx)(`span`,{className:`cmdk-key`,children:`Ctrl K`}),(0,I.jsx)(`span`,{children:`Open command palette`})]}),(0,I.jsxs)(`li`,{children:[(0,I.jsx)(`span`,{className:`cmdk-key`,children:`?`}),(0,I.jsx)(`span`,{children:`Toggle this help`})]}),(0,I.jsxs)(`li`,{children:[(0,I.jsx)(`span`,{className:`cmdk-key`,children:`Esc`}),(0,I.jsx)(`span`,{children:`Close any open dialog`})]}),Pa.map(e=>(0,I.jsxs)(`li`,{children:[(0,I.jsx)(`span`,{className:`cmdk-key`,children:`G`}),(0,I.jsx)(`span`,{className:`cmdk-key`,children:e.key.toUpperCase()}),(0,I.jsxs)(`span`,{children:[`Go to `,e.label]})]},e.key))]}),(0,I.jsx)(`div`,{className:`dialog-actions`,children:(0,I.jsx)(`button`,{className:`btn btn-ghost`,onClick:e,children:`Close`})})]})})}function Jo({onCancel:e,onConfirm:t}){return(0,I.jsx)(`div`,{className:`overlay`,onClick:e,children:(0,I.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`shutdown-dialog-title`,onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`div`,{id:`shutdown-dialog-title`,className:`dialog-title`,children:`⏻ Stop server`}),(0,I.jsx)(`div`,{className:`dialog-msg`,children:`Stop the moadim server? Scheduled jobs and routines will not run until it is started again.`}),(0,I.jsxs)(`div`,{className:`dialog-actions`,children:[(0,I.jsx)(`button`,{className:`btn btn-ghost`,onClick:e,children:`Cancel`}),(0,I.jsx)(`button`,{className:`btn btn-danger`,onClick:t,children:`Stop server`})]})]})})}function Yo(){let{toasts:e}=Xa();return(0,I.jsx)(`div`,{className:`toast-wrap`,role:`status`,"aria-live":`polite`,"aria-atomic":`false`,children:e.map(e=>(0,I.jsx)(`div`,{className:`toast ${e.kind}`,children:e.msg},e.id))})}var Xo=900,Zo=50,Qo=15e3;function $o(){let[e,t]=(0,x.useState)(ja),[n,r]=(0,x.useState)(!1),[i,a]=(0,x.useState)(!1),[o,s]=(0,x.useState)(!1),[c,l]=(0,x.useState)(!1),u=ft(),d=Zr(),{addToast:f}=Xa(),p=Ni(3e4),m=Fi(),h=z(),g=Li(),_=na(Zo,{refetchInterval:Qo}),v=Ui({local_only:!0},{refetchInterval:Qo}),[y,b]=(0,x.useState)(Sa),S=(0,x.useRef)(null),C=()=>l(e=>!e);return(0,x.useEffect)(()=>{let e=_.data;if(e===void 0)return;if(S.current===null){S.current=ga(e);return}let t=_a(e,S.current);S.current=ga(e),t.length!==0&&b(e=>{let n=wa(e,t);return Ca(n),n})},[_.data]),(0,x.useEffect)(()=>{let e=v.data;e!==void 0&&queueMicrotask(()=>{b(t=>{let n=Ea(t,e);return n!==t&&Ca(n),n})})},[v.data]),(0,x.useEffect)(()=>{Na(e)},[e]),(0,x.useEffect)(()=>{let e=()=>t(ja());return window.addEventListener(Aa,e),window.addEventListener(`storage`,e),()=>{window.removeEventListener(Aa,e),window.removeEventListener(`storage`,e)}},[]),(0,x.useEffect)(()=>{let e=!1,t,n=()=>{e=!1,clearTimeout(t)},i=i=>{if((i.metaKey||i.ctrlKey)&&i.key.toLowerCase()===`k`){i.preventDefault(),a(e=>!e);return}if(i.key===`Escape`){r(!1),s(!1),l(!1),n();return}if(!(i.metaKey||i.ctrlKey||i.altKey||Ia(i.target))){if(e){n();let e=Fa(i.key);e&&(i.preventDefault(),u(e));return}i.key.toLowerCase()===`g`?(e=!0,t=setTimeout(n,Xo)):i.key===`?`&&(i.preventDefault(),C())}};return window.addEventListener(`keydown`,i),()=>{window.removeEventListener(`keydown`,i),clearTimeout(t)}},[u]),(0,I.jsxs)(`div`,{className:`app-shell`,children:[(0,I.jsx)(Ga,{health:p.data,healthOk:p.data?.running??!1,machineName:m.data?.name,onRefresh:()=>void p.refetch(),onStop:()=>r(!0),onPalette:()=>a(e=>!e),onRenameMachine:()=>s(!0),onShortcuts:C,notifications:{entries:y,onMarkAllRead:()=>{b(e=>{let t=Oa(e);return t!==e&&Ca(t),t})},onClear:()=>{b([]),Ca([])}}}),(0,I.jsx)(qa,{}),(0,I.jsx)(`div`,{className:`page`,children:(0,I.jsx)(Rt,{})}),(0,I.jsx)(Go,{open:i,onClose:()=>a(!1),onRefresh:()=>void p.refetch(),onStop:()=>r(!0),onShortcuts:C}),c&&(0,I.jsx)(qo,{onClose:()=>l(!1)}),o&&(0,I.jsx)(Ko,{current:m.data?.name??``,onCancel:()=>s(!1),onConfirm:async e=>{try{await g.mutateAsync(e),s(!1),f(`Machine renamed to "${e}"`,`ok`)}catch(e){throw f(`Rename failed: ${e instanceof Error?e.message:String(e)}`,`err`),e}}}),n&&(0,I.jsx)(Jo,{onCancel:()=>r(!1),onConfirm:()=>{r(!1),h.mutate(void 0,{onSuccess:()=>{f(`Server stopping…`,`ok`),d.invalidateQueries({queryKey:[`health`]})},onError:e=>f(`Stop failed: ${e.message}`,`err`)})}}),(0,I.jsx)(Yo,{})]})}function es({status:e,onUnlock:t}){return!e||!e.locked?null:(0,I.jsxs)(`div`,{className:`card`,style:{display:`flex`,alignItems:`center`,justifyContent:`space-between`,padding:`10px 14px`,marginBottom:16,borderColor:`var(--warn)`},children:[(0,I.jsxs)(`div`,{style:{fontSize:13,fontWeight:600},children:[`⚠ Routines globally locked — scheduling and manual triggers paused`,e.shared&&(0,I.jsx)(`span`,{style:{marginLeft:8,fontSize:11,color:`var(--text-faint)`},children:`SHARED .lock`}),e.local&&(0,I.jsx)(`span`,{style:{marginLeft:8,fontSize:11,color:`var(--text-faint)`},children:`LOCAL .local.lock`})]}),(0,I.jsx)(`button`,{className:`btn btn-ghost`,onClick:t,children:`Unlock all`})]})}function ts(e=1e3){let[t,n]=(0,x.useState)(()=>Date.now());return(0,x.useEffect)(()=>{let t=setInterval(()=>n(Date.now()),e);return()=>clearInterval(t)},[e]),t}var ns=[{token:`off`,label:`Off`,ms:void 0},{token:`5`,label:`5s`,ms:5e3},{token:`15`,label:`15s`,ms:15e3},{token:`30`,label:`30s`,ms:3e4},{token:`60`,label:`60s`,ms:6e4}],rs=`moadim.refresh-interval`,is=`moadim-refresh-interval-change`;function as(e){return e===`off`||e===`5`||e===`15`||e===`30`||e===`60`}function os(e){return ns.find(t=>t.token===e)?.ms}function ss(){try{let e=localStorage.getItem(rs);return as(e)?e:`off`}catch{return`off`}}function cs(e){try{localStorage.setItem(rs,e),window.dispatchEvent(new CustomEvent(is))}catch{}}function ls(e){return e<60?`updated just now`:e<3600?`updated ${Math.floor(e/60)}m ago`:`updated ${Math.floor(e/3600)}h ago`}function us(){let[e,t]=(0,x.useState)(ss);return(0,x.useEffect)(()=>{let e=()=>t(ss()),n=t=>{t.key===`moadim.refresh-interval`&&e()};return window.addEventListener(is,e),window.addEventListener(`storage`,n),()=>{window.removeEventListener(is,e),window.removeEventListener(`storage`,n)}},[]),e}function ds({token:e,updatedAtMs:t,onChange:n}){let r=ts(),i=t>0?ls(Math.max(0,Math.floor((r-t)/1e3))):void 0;return(0,I.jsxs)(`div`,{className:`refresh-control`,children:[(0,I.jsx)(`label`,{className:`refresh-lbl`,htmlFor:`refresh-interval`,children:`AUTO`}),(0,I.jsx)(`select`,{id:`refresh-interval`,className:`refresh-select`,value:e,"aria-label":`Auto-refresh interval`,onChange:e=>n(e.target.value),children:ns.map(e=>(0,I.jsx)(`option`,{value:e.token,children:e.label},e.token))}),i!==void 0&&(0,I.jsx)(`span`,{className:`refresh-fresh`,title:`Time since the list last refreshed`,children:i})]})}function fs({updatedAtMs:e}){let t=ts();if(e<=0)return null;let n=ls(Math.max(0,Math.floor((t-e)/1e3)));return(0,I.jsx)(`span`,{className:`refresh-fresh`,title:`Time since the list last refreshed`,children:n})}var ps=36e5,ms={"auto-disabled":0,dormant:1,"dead-schedule":2,"agent-unregistered":3,"has-open-flags":4},hs={"auto-disabled":`AUTO-DISABLED`,dormant:`DORMANT`,"dead-schedule":`DEAD SCHEDULE`,"agent-unregistered":`AGENT MISSING`,"has-open-flags":`OPEN FLAGS`},gs={"auto-disabled":`the failure circuit-breaker disabled this — investigate and re-enable`,dormant:`assigned to no machine — fires nowhere`,"dead-schedule":`schedule has no future fire — never runs again`,"agent-unregistered":`agent not registered — every run errors`,"has-open-flags":`agent raised flags during a run — needs review`};function _s(e,t){return e<t?-1:+(e>t)}function vs(e,t){if(!e.enabled)return e.autoDisabledReason===void 0?void 0:`auto-disabled`;if(e.machinesEmpty)return`dormant`;if(bo(yo(e),t)===void 0)return`dead-schedule`;if(e.agentRegistered===!1)return`agent-unregistered`;if(e.flagCount>0)return`has-open-flags`}function ys(e,t){let n=[];for(let r of e){let e=vs(r,t);e!==void 0&&n.push({kind:r.kind,label:r.label,reason:e,flagCount:r.flagCount})}return n.sort((e,t)=>ms[e.reason]-ms[t.reason]||_s(e.label,t.label)),n}function bs(e,t){let n=e.length,r=e.filter(e=>e.enabled).length,i=e.filter(e=>e.enabled&&!e.snoozed&&yo(e).some(e=>So(e,t,36e5))).length,a=e.reduce((e,t)=>e+t.flagCount,0),o=e.filter(e=>e.enabled&&e.snoozed).length,s=e.filter(e=>e.enabled&&e.machinesEmpty).length;return{total:n,enabled:r,disabled:n-r,dueSoon:i,attention:ys(e,t).length,flags:a,snoozed:o,dormant:s}}function xs(e,t){let n=[];for(let r of e){if(!r.enabled||r.snoozed)continue;let e=bo(yo(r),t);e!==void 0&&n.push({kind:r.kind,id:r.id,label:r.label,human:r.human,schedule:r.schedule,at:e,soon:e.getTime()-t.getTime()<=ps,flagCount:r.flagCount})}return n.sort((e,t)=>e.at.getTime()-t.at.getTime()||_s(e.label,t.label)),n.slice(0,8)}function Ss(e,t){return e[0]===void 0?void 0:Co(t,e[0].at)}function Cs(e){return(e??[]).every(e=>e.trim()===``)}function ws(e,t){let n=e.snoozed_until!=null&&e.snoozed_until>Math.floor(t.getTime()/1e3),r=e.skip_runs!=null&&e.skip_runs>0;return n||r}function Ts(e,t){return{kind:`routine`,id:e.id,label:e.title,schedule:e.schedule,schedules:yo(e),human:e.schedule_description??void 0,enabled:e.enabled,machinesEmpty:Cs(e.machines),agentRegistered:e.agent_registered,flagCount:e.flag_count,snoozed:ws(e,t),autoDisabledReason:e.auto_disabled_reason??void 0}}function Es(e,t){return e.map(e=>Ts(e,t))}function Ds({items:e}){return(0,I.jsx)(`div`,{className:`table-wrap attn-wrap`,children:(0,I.jsxs)(`table`,{children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{children:`TYPE`}),(0,I.jsx)(`th`,{children:`NAME`}),(0,I.jsx)(`th`,{children:`ISSUE`}),(0,I.jsx)(`th`,{children:`DETAIL`})]})}),(0,I.jsx)(`tbody`,{children:e.map((e,t)=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`kind-badge routine`,children:`ROUTINE`})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(kn,{className:`ov-name-link`,to:`/routines`,children:e.label})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`attn-badge`,children:hs[e.reason]})}),(0,I.jsx)(`td`,{className:`attn-detail`,children:e.reason===`has-open-flags`&&e.flagCount>0?`${e.flagCount} open flag${e.flagCount===1?``:`s`} — needs review`:gs[e.reason]})]},t))})]})})}function Os({enabled:e,onToggle:t}){return(0,I.jsx)(`button`,{type:`button`,className:e?`btn btn-sm btn-ghost notify-toggle active`:`btn btn-sm btn-ghost notify-toggle`,title:e?`Desktop notifications on failure: on (click to turn off)`:`Get a desktop notification when a run fails`,"aria-pressed":e,onClick:()=>t(!e),children:e?`🔔 Notify on failure`:`🔕 Notify on failure`})}function ks({kpis:e,nextRun:t}){return(0,I.jsxs)(`div`,{className:`stats`,children:[(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`SCHEDULED`}),(0,I.jsx)(`div`,{className:`stat-val`,children:e.total})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`ENABLED`}),(0,I.jsx)(`div`,{className:`stat-val c-accent`,children:e.enabled})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`DUE SOON`}),(0,I.jsx)(`div`,{className:`stat-val c-red`,children:e.dueSoon})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`ATTENTION`}),(0,I.jsx)(`div`,{className:`stat-val ${e.attention>0?`c-red`:`c-accent`}`,children:e.attention})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`DISABLED`}),(0,I.jsx)(`div`,{className:`stat-val c-amber`,children:e.disabled})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`DORMANT`}),(0,I.jsx)(`div`,{className:`stat-val ${e.dormant>0?`c-amber`:``}`,children:e.dormant})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`FLAGS`}),(0,I.jsx)(`div`,{className:`stat-val ${e.flags>0?`c-red`:`c-accent`}`,children:e.flags})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`SNOOZED`}),(0,I.jsx)(`div`,{className:`stat-val ${e.snoozed>0?`c-amber`:`c-accent`}`,children:e.snoozed})]}),(0,I.jsxs)(`div`,{className:`stat-card stat-card-wide`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`NEXT RUN`}),(0,I.jsx)(`div`,{className:`stat-val stat-val-sm`,children:t??`—`})]})]})}function As(e){return`run-status ${e}`}function js(e){switch(e){case`running`:return`RUNNING`;case`success`:return`SUCCESS`;case`failed`:return`FAILED`;default:return`UNKNOWN`}}function Ms(e,t){let n=Math.max(0,t-e);return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}function Ns(e,t){if(e>=t)return`expired`;let n=t-e;return n<60?`expires in <1m`:n<3600?`expires in ${Math.floor(n/60)}m`:`expires in ${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}function Ps({runs:e,loading:t}){return t?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})}):e.length===0?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NO RUNS YET`})]})}):(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`table`,{children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{children:`ROUTINE`}),(0,I.jsx)(`th`,{children:`STARTED`}),(0,I.jsx)(`th`,{children:`DURATION`}),(0,I.jsx)(`th`,{children:`STATUS`}),(0,I.jsx)(`th`,{children:`EXIT CODE`})]})}),(0,I.jsx)(`tbody`,{children:e.map(e=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(kn,{to:`/routines?history=${encodeURIComponent(e.routine_id)}`,children:e.routine_title})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`div`,{className:`cell-time`,title:Ha(e.started_at),children:Ba(e.started_at)})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`cell-meta`,children:e.finished_at==null?`—`:Ms(e.started_at,e.finished_at)})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:As(e.status),children:js(e.status)})}),(0,I.jsx)(`td`,{children:e.exit_code==null?`—`:e.exit_code})]},e.workbench))})]})})}function Fs({runs:e,now:t,loading:n,error:r,onTrigger:i}){return r===void 0?n?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})}):e.length===0?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`◷`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NO UPCOMING RUNS`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:`no enabled routine is scheduled to fire`})]})}):(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`table`,{children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{children:`TYPE`}),(0,I.jsx)(`th`,{children:`NAME`}),(0,I.jsx)(`th`,{children:`SCHEDULE`}),(0,I.jsx)(`th`,{children:`NEXT RUN`}),(0,I.jsx)(`th`,{})]})}),(0,I.jsx)(`tbody`,{children:e.map((e,n)=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`kind-badge routine`,children:`ROUTINE`})}),(0,I.jsxs)(`td`,{children:[(0,I.jsx)(kn,{className:`ov-name-link`,to:`/routines`,children:e.label}),e.flagCount>0&&(0,I.jsx)(`span`,{className:`ov-flag-badge`,title:`${e.flagCount} open flag${e.flagCount===1?``:`s`}`,children:`⚑ ${e.flagCount}`})]}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`div`,{className:`cell-schedule-human`,children:e.human??e.schedule})}),(0,I.jsxs)(`td`,{className:`cell-next`,children:[(0,I.jsx)(`div`,{className:`cell-next-when`,children:To(t,e.at)}),(0,I.jsx)(`div`,{className:e.soon?`cell-next-until soon`:`cell-next-until`,children:Co(t,e.at)})]}),(0,I.jsx)(`td`,{className:`cell-act`,children:(0,I.jsx)(`button`,{className:`btn btn-sm btn-ghost run-now-btn`,title:`Trigger now`,onClick:()=>i(e.id),children:`▶ RUN`})})]},n))})]})}):(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:r})]})})}var Is=8,Ls=1e4;function Rs(){let e=Zr(),{addToast:t}=Xa(),n=Ui(),r=na(Is),i=ea(),a=ta(),o=Xi(),[s,c]=(0,x.useState)(()=>new Date),l=us(),[u,d]=(0,x.useState)(da),f=(0,x.useRef)(null);(0,x.useEffect)(()=>{let e=setInterval(()=>c(new Date),Ls);return()=>clearInterval(e)},[]),(0,x.useEffect)(()=>{let t=os(l);if(t===void 0)return;let n=setInterval(()=>{e.invalidateQueries({queryKey:[`routines`]})},t);return()=>clearInterval(n)},[l,e]),(0,x.useEffect)(()=>{if(!u){f.current=null;return}let e=r.data;if(e!==void 0){if(f.current===null){f.current=ga(e);return}for(let t of _a(e,f.current))ya(t);f.current=ga(e)}},[r.data,u]);let p=(0,x.useCallback)(e=>{if(!e){fa(!1),d(!1);return}ha().then(e=>{e===`granted`?(fa(!0),d(!0)):t(e===`unsupported`?`Desktop notifications aren't supported in this browser`:`Notification permission was denied`,`err`)})},[t]),m=(0,x.useCallback)(e=>{o.mutate(e,{onSuccess:()=>t(`Triggered`,`ok`),onError:e=>t(`Trigger failed: ${e instanceof Error?e.message:String(e)}`,`err`)})},[o,t]),h=(0,x.useCallback)(()=>{a.mutate(`all`)},[a]),g=Es(n.data??[],s),_=bs(g,s),v=ys(g,s),y=xs(g,s),b=Ss(y,s),S=Math.max(n.dataUpdatedAt,r.dataUpdatedAt,i.dataUpdatedAt),C=n.error instanceof Error?n.error.message:void 0;return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`page-title`,children:`Overview`}),(0,I.jsx)(es,{status:i.data,onUnlock:h}),(0,I.jsx)(ks,{kpis:_,nextRun:b}),v.length>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`section-hd`,children:(0,I.jsx)(`span`,{className:`section-label attn`,children:`NEEDS ATTENTION`})}),(0,I.jsx)(Ds,{items:v})]}),(0,I.jsxs)(`div`,{className:`section-hd`,children:[(0,I.jsx)(`span`,{className:`section-label`,children:`UPCOMING RUNS`}),(0,I.jsx)(`div`,{className:`section-acts`,children:(0,I.jsx)(fs,{updatedAtMs:S})})]}),(0,I.jsx)(Fs,{runs:y,now:s,loading:n.isLoading,error:C,onTrigger:m}),(0,I.jsxs)(`div`,{className:`section-hd`,children:[(0,I.jsx)(`span`,{className:`section-label`,children:`RECENT RUNS`}),(0,I.jsx)(`div`,{className:`section-acts`,children:(0,I.jsx)(Os,{enabled:u,onToggle:p})})]}),(0,I.jsx)(Ps,{runs:r.data??[],loading:r.isLoading})]})}function zs({count:e,onEnable:t,onDisable:n,onDelete:r,onClear:i}){return e===0?null:(0,I.jsxs)(`div`,{className:`bulk-bar`,children:[(0,I.jsxs)(`span`,{className:`bulk-count`,children:[e,` SELECTED`]}),(0,I.jsxs)(`div`,{className:`bulk-acts`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:t,children:`ENABLE`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`DISABLE`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-danger btn-sm`,onClick:r,children:`DELETE`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:i,children:`CLEAR`})]})]})}function Bs({count:e,onCancel:t,onConfirm:n}){return(0,I.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,I.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`div`,{className:`dialog-title`,children:`⚠ DELETE ROUTINES`}),(0,I.jsxs)(`div`,{className:`dialog-msg`,children:[`Delete `,e,` selected routine`,e===1?``:`s`,`? This cannot be undone.`]}),(0,I.jsxs)(`div`,{className:`dialog-actions`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:t,children:`Cancel`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-danger`,onClick:n,children:`Delete`})]})]})})}function Vs({title:e,onCancel:t,onConfirm:n}){return(0,I.jsx)(`div`,{className:`overlay`,onClick:t,children:(0,I.jsxs)(`div`,{className:`dialog`,role:`dialog`,"aria-modal":`true`,onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`div`,{className:`dialog-title`,children:`⚠ DELETE ROUTINE`}),(0,I.jsxs)(`div`,{className:`dialog-msg`,children:[`Delete the routine "`,e,`"? This cannot be undone.`]}),(0,I.jsxs)(`div`,{className:`dialog-actions`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:t,children:`Cancel`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-danger`,onClick:n,children:`Delete`})]})]})})}var Hs=[`B`,`KB`,`MB`,`GB`,`TB`];function Us(e){if(e<1024)return`${e} B`;let t=e,n=0;for(;t>=1024&&n<Hs.length-1;)t/=1024,n++;return`${t.toFixed(1)} ${Hs[n]}`}var Ws=[`id`,`title`,`enabled`,`status`,`schedule`,`schedule_description`,`timezone`,`agent`,`model`,`machines`,`tags`,`flag_count`,`next_run_at`,`last_scheduled_trigger_at`,`last_manual_trigger_at`];function Gs(e){if(e==null)return``;let t=new Date(e*1e3);return Number.isNaN(t.getTime())?``:t.toISOString()}function Ks(e){return e.enabled?e.is_running?`running`:`enabled`:`disabled`}function qs(e){return/[",\n\r]/.test(e)?`"${e.replace(/"/g,`""`)}"`:e}function Js(e){return e.map(qs).join(`,`)}function Ys(e){let t=[Js([...Ws])];for(let n of e)t.push(Js([n.id,n.title,String(n.enabled),Ks(n),yo(n).join(`
`),(n.schedule_descriptions??[n.schedule_description]).filter(Boolean).join(`
`),n.timezone??``,n.agent,n.model??``,(n.machines??[]).join(`;`),(n.tags??[]).join(`;`),String(n.flag_count),Gs(n.next_run_at),Gs(n.last_scheduled_trigger_at),Gs(n.last_manual_trigger_at)]));return t.join(`\r
`)+`\r
`}function Xs(e,t){let n=new Blob([t],{type:`text/csv;charset=utf-8;`}),r=URL.createObjectURL(n),i=document.createElement(`a`);i.href=r,i.download=e,i.click(),URL.revokeObjectURL(r)}var Zs=[40,140,300,600],Qs=Do.map(e=>e.slice(0,3));function $s({items:e,loading:t,onClick:n}){let[r,i]=(0,x.useState)(0),[a,o]=(0,x.useState)(0),s=(0,x.useRef)(null);if((0,x.useEffect)(()=>{s.current?.scrollIntoView({block:`center`})},[r,a]),t)return(0,I.jsx)(`div`,{className:`day-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})});let c=wo(new Date),l=new Date(c);l.setDate(l.getDate()+r);let u=r===0?new Date().getHours():-1,d=Array.from({length:24},()=>[]),f=0;for(let t of e)for(let e of yo(t))for(let n of Ao(e,l))d[n.getHours()]?.push({time:n,label:t.label,id:t.id,snoozed:t.snoozed,flagCount:t.flagCount}),f++;for(let e of d)e.sort((e,t)=>e.time.getTime()-t.time.getTime());let p=`${Eo[l.getDay()]} · ${Qs[l.getMonth()]} ${l.getDate()} ${l.getFullYear()}`,m=a>0,h=Zs[a]??Zs[0];return(0,I.jsxs)(`div`,{className:`day-wrap`,children:[(0,I.jsxs)(`div`,{className:`day-nav`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Previous day`,"aria-label":`Previous day`,onClick:()=>i(e=>e-1),children:`‹`}),(0,I.jsx)(`div`,{className:`day-date`,children:p}),(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Next day`,"aria-label":`Next day`,onClick:()=>i(e=>e+1),children:`›`}),(0,I.jsxs)(`div`,{className:`day-zoom`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Zoom out`,"aria-label":`Zoom out`,disabled:a===0,onClick:()=>o(e=>Math.max(0,e-1)),children:`−`}),(0,I.jsxs)(`span`,{className:`day-zoom-level`,children:[a+1,`×`]}),(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Zoom into the hour`,"aria-label":`Zoom in`,disabled:a===Zs.length-1,onClick:()=>o(e=>Math.min(Zs.length-1,e+1)),children:`+`})]}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>i(0),children:`TODAY`})]}),f===0?(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`🗓`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:`no fire times on this day`})]}):(0,I.jsx)(`div`,{className:m?`day-scroll detail`:`day-scroll`,style:{"--dh":`${h}px`},children:d.map((e,t)=>(0,I.jsxs)(`div`,{className:t===u?`day-hour now`:`day-hour`,ref:t===u?s:void 0,children:[m?(0,I.jsxs)(`div`,{className:`day-hour-label`,children:[(0,I.jsxs)(`span`,{children:[String(t).padStart(2,`0`),`:00`]}),(0,I.jsxs)(`span`,{className:`qt`,children:[String(t).padStart(2,`0`),`:15`]}),(0,I.jsxs)(`span`,{className:`qt`,children:[String(t).padStart(2,`0`),`:30`]}),(0,I.jsxs)(`span`,{className:`qt`,children:[String(t).padStart(2,`0`),`:45`]}),(0,I.jsx)(`span`,{className:`qt-end`})]}):(0,I.jsxs)(`div`,{className:`day-hour-label`,children:[String(t).padStart(2,`0`),`:00`]}),(0,I.jsx)(`div`,{className:`day-hour-slot`,children:e.map((e,t)=>{let r=(e.time.getMinutes()+e.time.getSeconds()/60)/60,i=m?{top:`${(r*100).toFixed(3)}%`}:void 0,a=`day-chip`;n&&e.id&&(a+=` clickable`),e.snoozed&&(a+=` snoozed`);let o=n&&e.id,s=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`span`,{className:`day-chip-time`,children:[String(e.time.getHours()).padStart(2,`0`),`:`,String(e.time.getMinutes()).padStart(2,`0`)]}),(0,I.jsx)(`span`,{className:`day-chip-label`,children:e.label}),e.flagCount>0&&(0,I.jsxs)(`span`,{className:`day-chip-flag`,children:[`⚑`,e.flagCount]})]});return o?(0,I.jsx)(`button`,{type:`button`,className:a,style:i,title:e.label,"aria-label":`Edit ${e.label}`,onClick:()=>n(e.id),children:s},t):(0,I.jsx)(`div`,{className:a,style:i,title:e.label,children:s},t)})})]},t))})]})}var ec=36e5,tc=[`all`,`enabled`,`disabled`,`auto-disabled`,`dormant`,`due`,`snoozed`,`flagged`,`agent-unreg`];function nc(e){return tc.includes(e)?e:`all`}var rc=`\0all`;function ic(e){return e.kind===`all`?rc:e.value}function ac(e){return e===rc?{kind:`all`}:{kind:`named`,value:e}}var oc=`\0any`,sc=`\0unassigned`;function cc(e){switch(e.kind){case`any`:return oc;case`unassigned`:return sc;case`machine`:return e.value}}function lc(e){return e===oc?{kind:`any`}:e===sc?{kind:`unassigned`}:{kind:`machine`,value:e}}function uc(){return{query:``,status:`all`,agent:{kind:`all`},machine:{kind:`any`},repository:{kind:`all`},tag:{kind:`all`}}}function dc(e){return e.query.trim()!==``||e.status!==`all`||e.agent.kind!==`all`||e.machine.kind!==`any`||e.repository.kind!==`all`||e.tag.kind!==`all`}function fc(e,t,n,r){let i=t.machines??[];switch(e.status){case`enabled`:if(!t.enabled)return!1;break;case`disabled`:if(t.enabled)return!1;break;case`auto-disabled`:if(t.enabled||t.auto_disabled_reason==null)return!1;break;case`dormant`:if(!(t.enabled&&i.every(e=>e.trim()===``)))return!1;break;case`due`:if(!(t.enabled&&So(t.schedule,n,r)))return!1;break;case`snoozed`:if(!bc(t,n))return!1;break;case`flagged`:if((t.flag_count??0)===0)return!1;break;case`agent-unreg`:if(t.agent_registered)return!1}if(e.agent.kind===`named`&&t.agent!==e.agent.value||e.machine.kind===`unassigned`&&!i.every(e=>e.trim()===``)||e.machine.kind===`machine`&&!i.includes(e.machine.value))return!1;let a=e.repository;if(a.kind===`named`&&!(t.repositories??[]).some(e=>e.repository===a.value)||e.tag.kind===`named`&&!(t.tags??[]).includes(e.tag.value))return!1;let o=e.query.trim().toLowerCase();if(o!==``){let e=(t.repositories??[]).map(e=>e.repository.toLowerCase()).join(` `),n=(t.schedule_description??``).toLowerCase(),r=(t.tags??[]).map(e=>e.toLowerCase()).join(` `);if(![t.title.toLowerCase(),t.agent.toLowerCase(),t.schedule.toLowerCase(),e,n,r].join(` `).includes(o))return!1}return!0}function pc(e,t,n,r){return e.filter(e=>fc(t,e,n,r))}function mc(e){let t=e.last_manual_trigger_at??void 0,n=e.last_scheduled_trigger_at??void 0;return t===void 0?n:n===void 0?t:Math.max(t,n)}var hc=[`dormant`,`dead-schedule`,`agent-missing`,`auto-disabled`,`disabled`,`power-saving`,`snoozed`,`healthy`];function gc(e){switch(e){case`dormant`:return 0;case`dead-schedule`:return 1;case`agent-missing`:return 2;case`auto-disabled`:return 3;case`disabled`:return 4;case`power-saving`:return 5;case`snoozed`:return 6;case`healthy`:return 7}}function _c(e){switch(e){case`dormant`:return`DORMANT`;case`dead-schedule`:return`DEAD SCHEDULE`;case`agent-missing`:return`AGENT MISSING`;case`auto-disabled`:return`AUTO-DISABLED`;case`disabled`:return`DISABLED`;case`power-saving`:return`POWER SAVING`;case`snoozed`:return`SNOOZED`;case`healthy`:return`HEALTHY`}}function vc(e){switch(e){case`dormant`:return`health-badge dormant`;case`dead-schedule`:return`health-badge dead`;case`agent-missing`:return`health-badge agent-missing`;case`auto-disabled`:return`health-badge auto-disabled`;case`disabled`:return`health-badge disabled`;case`power-saving`:return`health-badge power-saving`;case`snoozed`:return`health-badge snoozed`;case`healthy`:return`health-badge healthy`}}function yc(e,t){return t===`auto-disabled`?e.auto_disabled_reason??_c(t):_c(t)}function bc(e,t){let n=e.snoozed_until;return n!=null&&n*1e3>t.getTime()||(e.skip_runs??0)>0}function xc(e,t){let n=e.snoozed_until;if(n!=null){let e=n*1e3;if(e>t.getTime()){let n=Math.floor((e-t.getTime())/1e3);return n<3600?`${Math.floor(n/60)}m left`:n<86400?`${Math.floor(n/3600)}h left`:`${Math.floor(n/86400)}d left`}}let r=e.skip_runs;return r!=null&&r>0?`${r} run${r===1?``:`s`} skipped`:``}function Sc(e,t){return e.enabled?e.power_saving?`power-saving`:(e.machines??[]).every(e=>e.trim()===``)?`dormant`:_o(e.schedule,t)===void 0?`dead-schedule`:!e.agent_registered||!e.agent_setup_available?`agent-missing`:bc(e,t)?`snoozed`:`healthy`:e.auto_disabled_reason==null?`disabled`:`auto-disabled`}function Cc(e){let t=e.failure_threshold,n=e.consecutive_failures??0;return!e.enabled||t==null||t<=0||n<=0?`none`:n+1>=t?`critical`:`warning`}function wc(e){return e.enabled?e.power_saving?`Routine is in power-saving mode`:`Run now`:`Routine is disabled`}function Tc(e){return[...new Set(e.map(e=>e.agent))].sort()}function Ec(e){return[...new Set(e.flatMap(e=>(e.machines??[]).filter(e=>e.trim()!==``)))].sort()}function Dc(e){return[...new Set(e.flatMap(e=>(e.repositories??[]).map(e=>e.repository)))].sort()}function Oc(e){return[...new Set(e.flatMap(e=>e.tags??[]))].sort()}var kc=[[`all`,`All`],[`enabled`,`Enabled`],[`disabled`,`Disabled`],[`auto-disabled`,`Auto-disabled`],[`dormant`,`Dormant`],[`due`,`Due soon`],[`snoozed`,`Snoozed`],[`flagged`,`Flagged`],[`agent-unreg`,`Agent unregistered`]];function Ac({filter:e,agents:t,machines:n,repositories:r,tags:i,shown:a,total:o,searchRef:s,onQuery:c,onStatus:l,onAgent:u,onMachine:d,onRepository:f,onTag:p,onClear:m}){return(0,I.jsxs)(`div`,{className:`filter-bar`,children:[(0,I.jsxs)(`div`,{className:`filter-field`,children:[(0,I.jsx)(`input`,{ref:s,type:`text`,className:`filter-input`,placeholder:`Search routines… ( / )`,"aria-label":`Search routines`,value:e.query,onChange:e=>c(e.target.value)}),(0,I.jsx)(`span`,{className:`filter-label`,children:`STATUS`}),(0,I.jsx)(`select`,{className:`filter-select`,"aria-label":`Status filter`,value:e.status,onChange:e=>l(nc(e.target.value)),children:kc.map(([e,t])=>(0,I.jsx)(`option`,{value:e,children:t},e))}),(0,I.jsx)(`span`,{className:`filter-label`,children:`AGENT`}),(0,I.jsxs)(`select`,{className:`filter-select`,"aria-label":`Agent filter`,value:ic(e.agent),onChange:e=>u(ac(e.target.value)),children:[(0,I.jsx)(`option`,{value:ic({kind:`all`}),children:`Any`}),t.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]}),(0,I.jsx)(`span`,{className:`filter-label`,children:`MACHINE`}),(0,I.jsxs)(`select`,{className:`filter-select`,"aria-label":`Machine filter`,value:cc(e.machine),onChange:e=>d(lc(e.target.value)),children:[(0,I.jsx)(`option`,{value:cc({kind:`any`}),children:`Any`}),(0,I.jsx)(`option`,{value:cc({kind:`unassigned`}),children:`None`}),n.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]}),(0,I.jsx)(`span`,{className:`filter-label`,children:`REPOSITORY`}),(0,I.jsxs)(`select`,{className:`filter-select`,"aria-label":`Repository filter`,value:ic(e.repository),onChange:e=>f(ac(e.target.value)),children:[(0,I.jsx)(`option`,{value:ic({kind:`all`}),children:`Any`}),r.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]}),i.length>0&&(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`filter-label`,children:`TAG`}),(0,I.jsxs)(`select`,{className:`filter-select`,"aria-label":`Tag filter`,value:ic(e.tag),onChange:e=>p(ac(e.target.value)),children:[(0,I.jsx)(`option`,{value:ic({kind:`all`}),children:`Any`}),i.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))]})]})]}),(0,I.jsxs)(`div`,{className:`filter-field`,children:[(0,I.jsxs)(`span`,{className:`filter-count`,children:[`Showing `,a,` of `,o]}),dc(e)&&(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Clear all filters`,onClick:m,children:`CLEAR`})]})]})}var jc=[`title`,`next_run`,`last_fire`,`agent`,`health`,`enabled`,`updated`];function Mc(e){return jc.includes(e)?e:void 0}function Nc(e){return e===`asc`?`desc`:`asc`}function Pc(e){return e===`desc`?`desc`:`asc`}var Fc=[`none`,`agent`,`machine`,`status`,`health`,`folder`];function Ic(e){return Fc.includes(e)?e:`none`}function Lc(e){switch(e){case`none`:return`None`;case`agent`:return`Agent`;case`machine`:return`Machine`;case`status`:return`Status`;case`health`:return`Health`;case`folder`:return`Folder`}}function Rc(e){return e.folder?.trim()||`(root)`}function zc(e,t){switch(t){case`none`:return``;case`agent`:return e.agent;case`machine`:return e.machines?.[0]??`(unassigned)`;case`status`:return e.enabled?`Enabled`:`Disabled`;case`health`:return _c(Sc(e,new Date));case`folder`:return Rc(e)}}function Bc(e,t){let n=new Map(hc.map(e=>[e,0]));for(let r of e){let e=Sc(r,t);n.set(e,(n.get(e)??0)+1)}return n}function Vc(e,t){if(t===`none`)return[[``,e]];let n=new Map;for(let r of e){let e=zc(r,t),i=n.get(e);i?i.push(r):n.set(e,[r])}return[...n.entries()].sort(([e],[t])=>e<t?-1:+(e>t))}function Hc(e,t,n,r){if(t===void 0)return e;let i=(e,i)=>{let a;switch(t){case`title`:a=e.title.toLowerCase().localeCompare(i.title.toLowerCase());break;case`agent`:a=e.agent.toLowerCase().localeCompare(i.agent.toLowerCase());break;case`enabled`:a=Number(e.enabled)-Number(i.enabled);break;case`updated`:a=e.updated_at-i.updated_at;break;case`health`:a=gc(Sc(e,r))-gc(Sc(i,r));break;case`last_fire`:{let t=mc(e),n=mc(i);a=(t??-1)-(n??-1);break}case`next_run`:{let t=e=>e.enabled?_o(e.schedule,r)?.getTime():void 0,n=t(e),o=t(i);a=n!==void 0&&o!==void 0?n-o:n===void 0?o===void 0?0:1:-1;break}}let o=n===`desc`?-a:a;return o===0?e.id.localeCompare(i.id):o};return[...e].sort(i)}var Uc=[`none`,`agent`,`machine`,`status`,`health`,`folder`];function Wc({groupBy:e,onChange:t}){return(0,I.jsxs)(`div`,{className:`group-by-ctrl`,children:[(0,I.jsx)(`label`,{htmlFor:`routine-group-by-select`,children:`GROUP BY`}),(0,I.jsx)(`select`,{id:`routine-group-by-select`,className:`filter-select`,"aria-label":`Group routines by`,value:e,onChange:e=>t(Ic(e.target.value)),children:Uc.map(e=>(0,I.jsx)(`option`,{value:e,children:Lc(e)},e))})]})}function Gc(e){return e.toLocaleDateString(void 0,{weekday:`short`,month:`short`,day:`numeric`,year:`numeric`})}function Kc(e){return`${String(e.getHours()).padStart(2,`0`)}:${String(e.getMinutes()).padStart(2,`0`)}`}function qc(e,t,n){return e.filter(e=>e.enabled).map(e=>{let r=new Set,i=yo(e).flatMap(e=>Ao(e,t)).sort((e,t)=>e.getTime()-t.getTime()).filter(e=>{let t=e.getTime();return!r.has(t)&&(r.add(t),!0)});return{id:e.id,title:e.title,times:i,snoozed:bc(e,n)}}).filter(e=>e.times.length>0).sort((e,t)=>(e.times[0]?.getTime()??0)-(t.times[0]?.getTime()??0)||e.title.localeCompare(t.title))}function Jc({routines:e,loading:t,onEdit:n,onTrigger:r}){let[i,a]=(0,x.useState)(0),[o,s]=(0,x.useState)(void 0),{addToast:c}=Xa();if((0,x.useEffect)(()=>{if(o===void 0)return;let e=e=>{e.key===`Escape`&&s(void 0)};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[o]),t)return(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})});let l=()=>{let e=`${window.location.origin}${la()}`;navigator.clipboard.writeText(e).then(()=>c(`Calendar feed URL copied`,`ok`)).catch(()=>c(`Copy failed`,`err`))},u=new Date;u.setHours(0,0,0,0);let d=Oo(u,i),f=new Date(d);f.setDate(f.getDate()-d.getDay());let p=new Date,m=Array.from({length:42},()=>[]),h=0;for(let t of e.filter(e=>e.enabled)){let e=yo(t).map(e=>jo(e,f)).filter(e=>e!==void 0);if(e.length===0)continue;h++;let n=bc(t,p);e.reduce((e,t)=>e.map((e,n)=>e+(t[n]??0))).forEach((e,r)=>{e>0&&m[r]?.push({id:t.id,title:t.title,count:e,snoozed:n})})}let g=`${Do[d.getMonth()]} ${d.getFullYear()}`,_=o?qc(e,o,p):[];return(0,I.jsxs)(`div`,{className:`cal-wrap`,children:[(0,I.jsxs)(`div`,{className:`cal-nav`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Previous month`,"aria-label":`Previous month`,onClick:()=>a(e=>e-1),children:`‹`}),(0,I.jsx)(`div`,{className:`cal-month`,children:g}),(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Next month`,"aria-label":`Next month`,onClick:()=>a(e=>e+1),children:`›`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>a(0),children:`TODAY`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Copy the routines.ics feed URL`,onClick:l,children:`SUBSCRIBE`})]}),h===0?(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`🗓`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:`enabled routines with a valid schedule appear here`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`cal-weekdays`,children:Eo.map(e=>(0,I.jsx)(`div`,{className:`cal-weekday`,children:e},e))}),(0,I.jsx)(`div`,{className:`cal-grid`,children:m.map((e,t)=>{let r=new Date(f);r.setDate(r.getDate()+t);let i=wo(r),a=`cal-day`;r.getMonth()!==d.getMonth()&&(a+=` other-month`),r.getTime()===u.getTime()&&(a+=` today`);let o=Gc(i);return(0,I.jsxs)(`div`,{className:a,role:`button`,tabIndex:0,"aria-label":`Open schedule details for ${o}`,onClick:()=>s(i),onKeyDown:e=>{(e.key===`Enter`||e.key===` `)&&(e.preventDefault(),s(i))},children:[(0,I.jsx)(`div`,{className:`cal-daynum`,children:r.getDate()}),(0,I.jsxs)(`div`,{className:`cal-hits`,children:[e.slice(0,4).map((e,t)=>{let r=e.count>1?`${e.title} ×${e.count}`:e.title,i=`cal-chip clickable`;return e.snoozed&&(i+=` snoozed`),(0,I.jsx)(`button`,{type:`button`,className:i,"aria-label":`Edit ${e.title}`,title:r,onClick:t=>{t.stopPropagation(),n(e.id)},children:r},`${e.id}-${t}`)}),e.length>4&&(0,I.jsxs)(`div`,{className:`cal-more`,children:[`+`,e.length-4,` more`]})]})]},t)})})]}),o&&(0,I.jsx)(`div`,{className:`overlay`,onClick:()=>s(void 0),children:(0,I.jsxs)(`div`,{className:`dialog cal-day-dialog`,role:`dialog`,"aria-modal":`true`,"aria-label":`Calendar day details`,onClick:e=>e.stopPropagation(),children:[(0,I.jsx)(`div`,{className:`dialog-title`,children:Gc(o)}),(0,I.jsx)(`div`,{className:`dialog-msg`,children:`Scheduled routine fires for this local day.`}),_.length===0?(0,I.jsx)(`div`,{className:`cal-day-empty`,children:`No routine fires on this day.`}):(0,I.jsx)(`div`,{className:`cal-day-fire-list`,children:_.map(e=>(0,I.jsxs)(`div`,{className:`cal-day-fire`,children:[(0,I.jsxs)(`div`,{className:`cal-day-fire-main`,children:[(0,I.jsx)(`div`,{className:`cal-day-fire-title`,children:e.title}),(0,I.jsx)(`div`,{className:`cal-day-fire-times`,children:e.times.map(e=>(0,I.jsx)(`span`,{className:`cal-time-chip`,children:Kc(e)},e.getTime()))})]}),(0,I.jsx)(`button`,{type:`button`,className:`act-btn run`,"aria-label":`Run ${e.title} now`,disabled:e.snoozed,title:e.snoozed?`Routine is snoozed`:`Trigger this routine now`,onClick:()=>r(e.id),children:`RUN NOW`})]},e.id))}),(0,I.jsx)(`div`,{className:`dialog-actions`,children:(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>s(void 0),children:`Close`})})]})})]})}function Yc({id:e,title:t,onBack:n}){let r=sa(e),i=ca(),a=ts(),o=r.data??[];return(0,I.jsxs)(`main`,{className:`logs-page`,children:[(0,I.jsxs)(`div`,{className:`page-hd`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`← BACK`}),(0,I.jsxs)(`div`,{className:`page-title`,children:[`FLAGS / `,t]}),r.dataUpdatedAt>0&&(0,I.jsx)(`span`,{className:`page-freshness`,children:ls(Math.max(0,(a-r.dataUpdatedAt)/1e3))}),(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void r.refetch(),children:`↻`})]}),r.isLoading?(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})}):r.isError?(0,I.jsx)(`div`,{className:`logs-error`,children:r.error.message}):o.length===0?(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⚑`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NO OPEN FLAGS`})]}):(0,I.jsxs)(`div`,{className:`flags-list`,children:[(0,I.jsxs)(`div`,{className:`flags-count`,children:[o.length,` open flag`,o.length===1?``:`s`]}),o.map(t=>(0,I.jsxs)(`div`,{className:`flag-item`,children:[(0,I.jsxs)(`div`,{className:`flag-item-hd`,children:[(0,I.jsx)(`span`,{className:`flag-type`,children:t.type}),(0,I.jsx)(`span`,{className:`flag-scope`,children:t.scope===`general`?`general`:`local`}),(0,I.jsx)(`span`,{className:`flag-age`,title:t.filename,children:Ba(t.created_at)}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:i.isPending,onClick:()=>i.mutate({id:e,filename:t.filename}),children:`RESOLVE`})]}),(0,I.jsx)(`div`,{className:`flag-desc`,children:t.description})]},t.filename))]})]})}var Xc=e=>e.type===`checkbox`,Zc=e=>e.type===`file`,Qc=e=>e instanceof Date,$c=e=>e==null,el=e=>typeof e==`object`,tl=e=>!$c(e)&&!Array.isArray(e)&&el(e)&&!Qc(e),nl=e=>tl(e)&&e.target?Xc(e.target)?e.target.checked:Zc(e.target)?e.target.files:e.target.value:e,rl=(e,t)=>t.split(`.`).some((t,n,r)=>!isNaN(Number(t))&&e.has(r.slice(0,n).join(`.`))),il=typeof window<`u`&&window.HTMLElement!==void 0&&typeof document<`u`;function V(e){if(typeof e!=`object`||!e)return e;if(e instanceof Date)return new Date(e);let t=typeof FileList<`u`&&e instanceof FileList;if(il&&(e instanceof Blob||t))return e;let n=Array.isArray(e);if(!n&&e.constructor!==Object)return e;let r=n?[]:Object.create(Object.getPrototypeOf(e));for(let t in e)Object.prototype.hasOwnProperty.call(e,t)&&(r[t]=V(e[t]));return r}var al={BLUR:`blur`,FOCUS_OUT:`focusout`,CHANGE:`change`,SUBMIT:`submit`,TRIGGER:`trigger`,VALID:`valid`},ol={onBlur:`onBlur`,onChange:`onChange`,onSubmit:`onSubmit`,onTouched:`onTouched`,all:`all`},sl={max:`max`,min:`min`,maxLength:`maxLength`,minLength:`minLength`,pattern:`pattern`,required:`required`,validate:`validate`},cl=`root`,ll=[`__proto__`,`constructor`,`prototype`],ul=/^\w*$/,H=e=>ul.test(e),U=e=>e===void 0,dl=/[.[\]'"]/,fl=e=>e.split(dl).filter(Boolean),W=(e,t,n)=>{if(!t||!tl(e))return n;let r=H(t)?[t]:fl(t);if(r.some(e=>ll.includes(e)))return n;let i=r.reduce((e,t)=>$c(e)?void 0:e[t],e);return U(i)||i===e?U(e[t])?n:e[t]:i},pl=e=>typeof e==`boolean`,ml=e=>typeof e==`function`,G=(e,t,n)=>{let r=-1,i=H(t)?[t]:fl(t),a=i.length,o=a-1;for(;++r<a;){let t=i[r],a=n;if(r!==o){let n=e[t];a=tl(n)||Array.isArray(n)?n:isNaN(+i[r+1])?{}:[]}if(ll.includes(t))return;e[t]=a,e=e[t]}},hl=x.createContext(null);hl.displayName=`HookFormControlContext`;var gl=()=>x.useContext(hl),_l=(e,t,n,r=!0)=>{let i={};for(let a in e)Object.defineProperty(i,a,{get:()=>{let i=a;return t._proxyFormState[i]!==ol.all&&(t._proxyFormState[i]=!r||ol.all),n&&(n[i]=!0),e[i]}});return i},vl=il?x.useLayoutEffect:x.useEffect,yl=e=>{let t=e.constructor&&e.constructor.prototype;return tl(t)&&t.hasOwnProperty(`isPrototypeOf`)},bl=e=>$c(e)||!el(e),xl=(e,t)=>t.length===0&&!Array.isArray(e)&&!yl(e);function Sl(e,t,n=new WeakMap){if(e===t)return!0;if(bl(e)||bl(t))return Object.is(e,t);if(Qc(e)&&Qc(t))return Object.is(e.getTime(),t.getTime());let r=Object.keys(e),i=Object.keys(t);if(r.length!==i.length)return!1;if(xl(e,r)||xl(t,i))return Object.is(e,t);if(!r.length&&Array.isArray(e)!==Array.isArray(t))return!1;let a=n.get(e);if(a&&a.has(t))return!0;if(a)a.add(t);else{let r=new WeakSet;r.add(t),n.set(e,r)}for(let i of r){let r=e[i];if(!(i in t))return!1;if(i!==`ref`){let e=t[i];if(Qc(r)&&Qc(e)||(tl(r)||Array.isArray(r))&&(tl(e)||Array.isArray(e))?!Sl(r,e,n):!Object.is(r,e))return!1}}return!0}function Cl(){let e=x.useRef(!1),t=x.useRef(void 0);return{resyncIfNeeded:x.useCallback((n,r,i)=>{if(n&&e.current){let e=r();Sl(t.current,e)||i(e)}e.current=!0},[]),snapshot:x.useCallback((e,n)=>{e&&(t.current=V(n()))},[])}}var wl=e=>typeof e==`string`,Tl=(e,t,n,r,i)=>wl(e)?(r&&t.watch.add(e),W(n,e,i)):Array.isArray(e)?e.map(e=>(r&&t.watch.add(e),W(n,e))):(r&&(t.watchAll=!0),n);function El(e){let t=gl(),{control:n=t,name:r,defaultValue:i,disabled:a,exact:o,compute:s}=e||{},c=x.useRef(i),l=x.useRef(s),u=x.useRef(void 0),d=x.useRef(n),f=x.useRef(r);l.current=s;let[p,m]=x.useState(()=>{let e=n._getWatch(r,c.current);return l.current?l.current(e):e}),h=x.useCallback(e=>{let t=Tl(r,n._names,e||n._formValues,!1,c.current);return l.current?l.current(t):t},[n._formValues,n._names,r]),g=x.useCallback(e=>{if(!a){let t=Tl(r,n._names,e||n._formValues,!1,c.current);if(l.current){let e=l.current(t);Sl(e,u.current)||(m(e),u.current=e)}else m(t)}},[n._formValues,n._names,a,r]),{resyncIfNeeded:_,snapshot:v}=Cl(),y=x.useRef(g);y.current=g;let b=x.useRef(h);b.current=h,vl(()=>{d.current!==n||!Sl(f.current,r)?(d.current=n,f.current=r,y.current()):_(!a,()=>b.current(),e=>{m(e),u.current=e});let e=n._subscribe({name:r,formState:{values:!0},exact:o,callback:e=>{y.current(e.values)}});return()=>{e(),v(!a,()=>b.current())}},[n,o,r,a,_,v]),x.useEffect(()=>n._removeUnmounted());let S=d.current!==n,C=f.current;return x.useMemo(()=>{if(a)return!1;let e=!S&&!Sl(C,r);return S||e},[a,S,r,C])?h():p}var Dl=()=>typeof crypto<`u`&&crypto.randomUUID?crypto.randomUUID():`xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx`.replace(/[xy]/g,e=>{let t=Math.random()*16|0;return(e===`x`?t:t&3|8).toString(16)}),Ol=(e,t,n={})=>n.shouldFocus||U(n.shouldFocus)?n.focusName||`${e}.${U(n.focusIndex)?t:n.focusIndex}.`:``,kl=e=>({isOnSubmit:!e||e===ol.onSubmit,isOnBlur:e===ol.onBlur,isOnChange:e===ol.onChange,isOnAll:e===ol.all,isOnTouch:e===ol.onTouched}),Al=(e,t,n)=>{if(n)return!1;if(t.watchAll||t.watch.has(e))return!0;for(let n of t.watch)if(e.startsWith(n)&&e.charAt(n.length)===`.`)return!0;return!1},jl=(e,t,n,r)=>{for(let i of n||Object.keys(e)){if(i===`_f`)continue;let a=n?W(e,i):e[i];if(a){let{_f:e}=a;if(e){if(e.refs&&e.refs[0]&&t(e.refs[0],i)&&!r||e.ref&&t(e.ref,e.name)&&!r)return!0;if(jl(a,t))break}else if((tl(a)||Array.isArray(a))&&jl(a,t))break}}},Ml=(e,t,n)=>{let r=W(e,n),i=Array.isArray(r)?r:[];return G(i,cl,t[n]),G(e,n,i),e},Nl=e=>tl(e)&&!Object.keys(e).length,Pl=e=>{if(!il)return!1;let t=e?e.ownerDocument:0;return e instanceof(t&&t.defaultView?t.defaultView.HTMLElement:HTMLElement)},Fl=e=>e.type===`radio`,Il=e=>e instanceof RegExp,Ll=(e,t,n,r,i)=>t?{...n[e],types:{...n[e]&&n[e].types?n[e].types:{},[r]:i||!0}}:{},Rl={value:!1,isValid:!1},K={value:!0,isValid:!0},zl=e=>{if(!Array.isArray(e))return Rl;if(e.length>1){let t=e.filter(e=>e&&e.checked&&!e.disabled).map(e=>e.value);return{value:t,isValid:!!t.length}}let t=e[0];return!t||!t.checked||t.disabled?Rl:!t.attributes||!(`value`in t.attributes)||U(t.value)||t.value===``?K:{value:t.value,isValid:!0}},q={isValid:!1,value:null},J=e=>Array.isArray(e)?e.reduce((e,t)=>t&&t.checked&&!t.disabled?{isValid:!0,value:t.value}:e,q):q;function Bl(e,t,n=`validate`){if(wl(e)||Array.isArray(e)&&e.every(wl)||pl(e)&&!e)return{type:n,message:wl(e)?e:``,ref:t}}var Vl=e=>tl(e)&&!Il(e)?e:{value:e,message:``},Hl=async(e,t,n,r,i,a)=>{let{ref:o,refs:s,required:c,maxLength:l,minLength:u,min:d,max:f,pattern:p,validate:m,name:h,valueAsNumber:g,mount:_}=e._f,v=W(n,h);if(!_||t.has(h))return{};let y=s?s[0]:o,b=e=>{if(i&&y.reportValidity){let t=pl(e)?``:e||``;s?s.forEach(e=>e.setCustomValidity(t)):y.setCustomValidity(t),y.reportValidity()}},x={},S=Fl(o),C=Xc(o),w=S||C,T=(g||Zc(o))&&U(o.value)&&U(v)||Pl(o)&&o.value===``||v===``||Array.isArray(v)&&!v.length,ee=Ll.bind(null,h,r,x),te=(e,t,n,r=sl.maxLength,i=sl.minLength)=>{let a=e?t:n;x[h]={type:e?r:i,message:a,ref:o,...ee(e?r:i,a)}};if(a?!Array.isArray(v)||!v.length:c&&(!w&&(T||$c(v))||pl(v)&&!v||C&&!zl(s).isValid||S&&!J(s).isValid)){let{value:e,message:t}=wl(c)?{value:!!c,message:c}:Vl(c);if(e&&(x[h]={type:sl.required,message:t,ref:y,...ee(sl.required,t)},!r))return b(t),x}if(!T&&(!$c(d)||!$c(f))){let e,t,n=Vl(f),i=Vl(d);if(!$c(v)&&!Qc(v)&&!isNaN(v)){let r=o.valueAsNumber||v&&+v;$c(n.value)||(e=r>n.value),$c(i.value)||(t=r<i.value)}else{let r=o.valueAsDate||new Date(v),a=e=>new Date(new Date().toDateString()+` `+e),s=o.type==`time`,c=o.type==`week`;wl(n.value)&&v&&(e=s?a(v)>a(n.value):c?v>n.value:r>new Date(n.value)),wl(i.value)&&v&&(t=s?a(v)<a(i.value):c?v<i.value:r<new Date(i.value))}if((e||t)&&(te(!!e,n.message,i.message,sl.max,sl.min),!r))return b(x[h].message),x}if((l||u)&&!T&&(wl(v)||a&&Array.isArray(v))){let e=Vl(l),t=Vl(u),n=!$c(e.value)&&v.length>+e.value,i=!$c(t.value)&&v.length<+t.value;if((n||i)&&(te(n,e.message,t.message),!r))return b(x[h].message),x}if(p&&!T&&wl(v)){let{value:e,message:t}=Vl(p);if(Il(e)&&!v.match(e)&&(x[h]={type:sl.pattern,message:t,ref:o,...ee(sl.pattern,t)},!r))return b(t),x}if(m){if(ml(m)){let e=Bl(await m(v,n),y);if(e&&(x[h]={...e,...ee(sl.validate,e.message)},!r))return b(e.message),x}else if(tl(m)){let e={};for(let t in m){if(!Nl(e)&&!r)break;let i=Bl(await m[t](v,n),y,t);i&&(e={...i,...ee(t,i.message)},b(i.message),r&&(x[h]=e))}if(!Nl(e)&&(x[h]={ref:y,...e},!r))return x}}let E=x[h];return b(!E||E.message),x},Ul=e=>Array.isArray(e)?e:[e],Wl=(e,t)=>[...e,...Ul(t)],Gl=e=>Array.isArray(e)?e.map(()=>void 0):void 0;function Kl(e,t,n){return[...e.slice(0,t),...Ul(n),...e.slice(t)]}var ql=(e,t,n)=>Array.isArray(e)?(U(e[n])&&(e[n]=void 0),e.splice(n,0,e.splice(t,1)[0]),e):[],Jl=(e,t)=>[...Ul(t),...Ul(e)],Yl=e=>Array.isArray(e)?e.filter(Boolean):[];function Xl(e,t){let n=0,r=[...e];for(let e of t)r.splice(e-n,1),n++;return Yl(r).length?r:[]}var Zl=(e,t)=>U(t)?[]:Xl(e,Ul(t).sort((e,t)=>e-t)),Ql=(e,t,n)=>{[e[t],e[n]]=[e[n],e[t]]};function $l(e,t){let n=t.length-1,r=0;for(;r<n;){if($c(e)){e=void 0;break}e=e[t[r]],r++}return e}function eu(e){for(let t in e)if(e.hasOwnProperty(t)&&!U(e[t]))return!1;return!0}function tu(e,t){if(wl(t)&&Object.prototype.hasOwnProperty.call(e,t))return delete e[t],e;let n=Array.isArray(t)?t:H(t)?[t]:fl(t);if(n.some(e=>ll.includes(String(e))))return e;let r=n.length===1?e:$l(e,n),i=n.length-1,a=n[i];return r&&delete r[a],i!==0&&(tl(r)&&Nl(r)||Array.isArray(r)&&eu(r))&&tu(e,n.slice(0,-1)),e}var nu=(e,t,n)=>(e[t]=n,e);function ru(e){let t=gl(),{control:n=t,name:r,keyName:i=`id`,disabled:a,shouldUnregister:o,rules:s}=e,[c,l]=x.useState(n._getFieldArray(r)),u=x.useRef(n._getFieldArray(r).map(Dl)),d=x.useRef(!1);a||n._names.array.add(r),x.useMemo(()=>!a&&s&&c.length>=0&&n.register(r,s),[n,r,c.length,s,a]),vl(()=>{if(!a)return n._subjects.array.subscribe({next:({values:e,name:t})=>{if(t===r||!t){let n=W(e,r);Array.isArray(n)?(l(n),u.current=n.map(Dl)):t||(l([]),u.current=[])}}}).unsubscribe},[n,r,a]);let f=x.useCallback(e=>{d.current=!0,n._setFieldArray(r,e)},[n,r]);return x.useEffect(()=>{if(a){n._state.actionArrayLengths.delete(r);return}n._state.action=!1,n._state.actionArrayLengths.delete(r),Al(r,n._names)&&n._subjects.state.next({...n._formState});let e=kl(n._options.mode);if(d.current&&(!e.isOnSubmit||n._formState.isSubmitted)&&!kl(n._options.reValidateMode).isOnSubmit&&!e.isOnBlur){if(n._options.resolver)n._runSchema([r]).then(e=>{n._updateIsValidating([r]);let t=W(e.errors,r),i=W(n._formState.errors,r),a=i&&(i.type||i.root?.type),o=i&&(i.message||i.root?.message);(i?!t&&a||t&&(a!==t.type||o!==t.message):t&&t.type)&&(t?tl(t)&&!Object.keys(t).some(e=>!Number.isNaN(+e))?Ml(n._formState.errors,{[r]:t},r):G(n._formState.errors,r,t):tu(n._formState.errors,r),n._subjects.state.next({errors:n._formState.errors}))});else{let e=W(n._fields,r);e&&e._f&&Hl(e,n._names.disabled,n._formValues,n._options.criteriaMode===ol.all,n._options.shouldUseNativeValidation,!0).then(e=>!Nl(e)&&n._subjects.state.next({errors:Ml(n._formState.errors,e,r)}))}}d.current&&n._subjects.state.next({name:r,values:V(n._formValues)}),n._names.focus&&jl(n._fields,(e,t)=>{if(n._names.focus&&t.startsWith(n._names.focus)&&e.focus)return e.focus(),1}),n._names.focus=``,n._setValid(),d.current=!1},[c,r,n,a]),x.useEffect(()=>(a||!W(n._formValues,r)&&n._setFieldArray(r),()=>{if(n._state.actionArrayLengths.delete(r),a)return;let e=!(n._options.shouldUnregister||o);d.current&&e&&n._subjects.state.next({name:r,values:V(n._formValues)}),e?((e,t)=>{let r=W(n._fields,e);r&&r._f&&(r._f.mount=t)})(r,!1):n.unregister(r)}),[r,n,i,o,a]),{swap:x.useCallback((e,t)=>{if(a)return;let i=n._getFieldArray(r);Ql(i,e,t),Ql(u.current,e,t),f(i),l(i),n._setFieldArray(r,i,Ql,{argA:e,argB:t},!1)},[f,r,n,a]),move:x.useCallback((e,t)=>{if(a)return;let i=n._getFieldArray(r);ql(i,e,t),ql(u.current,e,t),f(i),l(i),n._setFieldArray(r,i,ql,{argA:e,argB:t},!1)},[f,r,n,a]),prepend:x.useCallback((e,t)=>{if(a)return;let i=Ul(V(e)),o=Jl(n._getFieldArray(r),i);n._names.focus=Ol(r,0,t),u.current=Jl(u.current,i.map(Dl)),f(o),l(o),n._setFieldArray(r,o,Jl,{argA:Gl(e)})},[f,r,n,a]),append:x.useCallback((e,t)=>{if(a)return;let i=Ul(V(e)),o=Wl(n._getFieldArray(r),i);n._names.focus=Ol(r,o.length-1,t),u.current=Wl(u.current,i.map(Dl)),f(o),l(o),n._setFieldArray(r,o,Wl,{argA:Gl(e)})},[f,r,n,a]),remove:x.useCallback(e=>{if(a)return;let t=Zl(n._getFieldArray(r),e);u.current=Zl(u.current,e),f(t),l(t),!Array.isArray(W(n._fields,r))&&G(n._fields,r,void 0),n._setFieldArray(r,t,Zl,{argA:e})},[f,r,n,a]),insert:x.useCallback((e,t,i)=>{if(a)return;let o=Ul(V(t)),s=Kl(n._getFieldArray(r),e,o);n._names.focus=Ol(r,e,i),u.current=Kl(u.current,e,o.map(Dl)),f(s),l(s),n._setFieldArray(r,s,Kl,{argA:e,argB:Gl(t)})},[f,r,n,a]),update:x.useCallback((e,t)=>{if(a)return;let i=V(t),o=nu(n._getFieldArray(r),e,i);u.current=[...o].map((t,n)=>!t||n===e?Dl():u.current[n]),f(o),l([...o]),n._setFieldArray(r,o,nu,{argA:e,argB:Gl(t)})},[f,r,n,a]),replace:x.useCallback(e=>{if(a)return;let t=Ul(V(e));u.current=t.map(Dl),f([...t]),l([...t]),n._setFieldArray(r,[...t],e=>e,{},!0,!1)},[f,r,n,a]),fields:x.useMemo(()=>c.map((e,t)=>({...e,...pl(a)?{disabled:a}:{},[i]:u.current[t]||Dl()})),[c,i,a])}}var iu=x.createContext(null);iu.displayName=`HookFormContext`;var au=()=>{let e=[];return{get observers(){return e},next:t=>{for(let n of e)n.next&&n.next(t)},subscribe:t=>(e.push(t),{unsubscribe:()=>{e=e.filter(e=>e!==t)}}),unsubscribe:()=>{e=[]}}};function ou(e,t){let n={};for(let r in e)if(e.hasOwnProperty(r)){let i=e[r],a=t[r];if(i&&tl(i)&&a){let e=ou(i,a);tl(e)&&(n[r]=e)}else e[r]&&(n[r]=a)}return n}var su=(e,t)=>e!==null&&el(e)&&Object.prototype.hasOwnProperty.call(e,t),cu=(e,t)=>{if(!t)return!1;let n=e;for(let r of H(t)?[t]:fl(t)){if(!su(n,r))return su(e,t);n=n[r]}return!0},lu=e=>e.type===`select-multiple`,uu=e=>Fl(e)||Xc(e),du=e=>Pl(e)&&e.isConnected;function fu(e){return Array.isArray(e)||tl(e)}function pu(e,t,n=``,r=[]){for(let i in e){let a=n?`${n}.${i}`:i,o=e[i];fu(o)&&fu(W(t,a))?pu(o,t,a,r):r.push(a)}return r}var mu=e=>{for(let t in e)if(ml(e[t]))return!0;return!1};function hu(e){return Array.isArray(e)||tl(e)&&!mu(e)}function gu(e){return!!(e&&`_f`in e)}function _u(e){return Array.isArray(e)?!e.some(e=>!U(e)):!Object.keys(e).length}function vu(e,t){Array.isArray(e)?e[t]=void 0:delete e[t]}function yu(e,t={},n){for(let r in e){let i=e[r],a=n&&n[r];hu(i)&&(!Array.isArray(i)||!gu(a))?(t[r]=Array.isArray(i)?[]:{},yu(i,t[r],a),_u(t[r])&&vu(t,r)):U(i)||(t[r]=!0)}return t}function bu(e,t,n,r){n||=yu(t,{},r);for(let i in e){let a=e[i],o=r&&r[i];hu(a)&&(!Array.isArray(a)||!gu(o))?(U(t)||bl(n[i])?n[i]=yu(a,Array.isArray(a)?[]:{},o):bu(a,$c(t)?{}:t[i],n[i],o),_u(n[i])&&vu(n,i)):Sl(a,t[i])?vu(n,i):n[i]=!0}return n}var xu=(e,t)=>{let n=t.split(`.`),r=[],i=n[0];for(let t=1;t<n.length;i+=`.`+n[t++])!isNaN(+n[t])&&e.has(i)&&r.push(`${i}.${n[t]}`);return r},Su=(e,{valueAsNumber:t,valueAsDate:n,setValueAs:r})=>U(e)?e:t?e===``?NaN:e&&+e:n&&wl(e)?new Date(e):r?r(e):e;function Cu(e){let t=e.ref;return Zc(t)?t.files:Fl(t)?J(e.refs).value:lu(t)?[...t.selectedOptions].map(({value:e})=>e):Xc(t)?zl(e.refs).value:Su(t.value,e)}var wu=(e,t,n,r)=>{let i={};for(let n of e){let e=W(t,n);e&&G(i,n,e._f)}return{criteriaMode:n,names:[...e],fields:i,shouldUseNativeValidation:r}},Tu=e=>U(e)?e:Il(e)?e.source:tl(e)?Il(e.value)?e.value.source:e.value:e,Eu=`AsyncFunction`,Du=e=>{if(!e||!e.validate)return!1;if(ml(e.validate))return e.validate.constructor.name===Eu;if(tl(e.validate)){for(let t in e.validate)if(e.validate[t].constructor.name===Eu)return!0}return!1},Ou=e=>e.mount&&(e.required||!U(e.required)&&e.required!==!1||!U(e.min)||!U(e.max)||!U(e.maxLength)||!U(e.minLength)||e.pattern||e.validate);function ku(e,t,n){let r=W(e,n);if(r||H(n))return{error:r,name:n};let i=n.split(`.`);for(;i.length;){let r=i.join(`.`),a=W(t,r),o=W(e,r);if(a&&!Array.isArray(a)&&n!==r)return{name:n};if(o&&o.type)return{name:r,error:o};if(o&&o.root&&o.root.type)return{name:`${r}.root`,error:o.root};i.pop()}return{name:n}}var Au=(e,t,n,r)=>{n(e);let i=Object.keys(e).filter(e=>e!==`name`);return!i.length||r&&i.length>=Object.keys(t).length||i.find(e=>t[e]===(!r||ol.all))},ju=(e,t,n)=>!e||!t||e===t||Ul(e).some(e=>e&&(n?e===t||e.startsWith(t+`.`):e.startsWith(t)||t.startsWith(e))),Mu=(e,t,n,r,i)=>i.isOnAll?!1:!n&&i.isOnTouch?!(t||e):(n?r.isOnBlur:i.isOnBlur)?!e:!(n?r.isOnChange:i.isOnChange)||e,Nu=(e,t)=>{let n=W(e,t);!Yl(n).length&&!(n!=null&&n.root)&&tu(e,t)},Pu={mode:ol.onSubmit,reValidateMode:ol.onChange,shouldFocusError:!0},Fu=`form`,Iu=(e,t)=>{for(let n in e)n in t||delete e[n];Object.assign(e,t)},Lu={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Ru(e={}){let t={...Pu,...e},n={...V(Lu),isLoading:ml(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1},r={},i=(tl(t.defaultValues)||tl(t.values))&&V(t.defaultValues||t.values)||{},a=t.shouldUnregister?{}:V(i),o={action:!1,actionArrayLengths:new Map,mount:!1,watch:!1,keepIsValid:!1},s={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},c={},l={},u=0,d=kl(t.mode),f=kl(t.reValidateMode),p={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},m={...p},h={...m},g={array:au(),state:au()},_=0,v=t.criteriaMode===ol.all,y=(e,t)=>n=>{clearTimeout(l[e]),l[e]=setTimeout(t,n)},b=async e=>{if(!o.keepIsValid&&!t.disabled&&(m.isValid||h.isValid||e)){let e=++_,i;t.resolver?(i=Nl((await re()).errors),e===_&&x()):i=await O({fields:r,onlyCheckValid:!0,eventType:al.VALID}),e===_&&i!==n.isValid&&g.state.next({isValid:i})}},x=(e,r)=>{!t.disabled&&(m.isValidating||m.validatingFields||h.isValidating||h.validatingFields)&&((e||s.mount).forEach(e=>{e&&(r?G(n.validatingFields,e,r):tu(n.validatingFields,e))}),g.state.next({validatingFields:n.validatingFields,isValidating:!Nl(n.validatingFields)}))},S=()=>{n.dirtyFields=bu(i,a,void 0,r)},C=(e,i=[],s,c,l=!0,u=!0)=>{if(c&&s&&!t.disabled){o.action=!0;let t=W(r,e);if(o.actionArrayLengths.has(e)||o.actionArrayLengths.set(e,Array.isArray(t)?t.length:0),u&&Array.isArray(t)){let n=s(t,c.argA,c.argB);l&&G(r,e,n)}let a=W(n.errors,e);if(u&&Array.isArray(a)){let t=a.root,r=s(a,c.argA,c.argB)||a;t&&(r.root=t),l&&G(n.errors,e,r),Nu(n.errors,e)}let d=W(n.touchedFields,e);if((m.touchedFields||h.touchedFields)&&u&&Array.isArray(d)){let t=s(d,c.argA,c.argB);l&&G(n.touchedFields,e,t)}(m.dirtyFields||h.dirtyFields)&&S(),g.state.next({name:e,isDirty:k(e,i),dirtyFields:n.dirtyFields,errors:n.errors,isValid:n.isValid})}else G(a,e,i)},w=(e,t)=>{G(n.errors,e,t),n.errors={...n.errors},g.state.next({errors:n.errors})},T=e=>{n.errors=e,g.state.next({errors:n.errors,isValid:!1})},ee=e=>{let t=H(e)?[e]:fl(e),n=a,r=i;for(let e=0;e<t.length-1;e++){let i=t[e];if(n=$c(n)?n:n[i],r=$c(r)?r:r[i],n===null&&r!==null)return!0}return!1},te=e=>{if(!o.actionArrayLengths.size)return!1;let t=H(e)?[e]:fl(e),n=a,r=``,i=-1,s=0;for(let e=0;e<t.length;e++){if($c(n))return!1;let a=t[e];if(r=r?`${r}.${a}`:a,Array.isArray(n)&&+a>=n.length)return i===-1?!1:e!==i||+a<s;o.actionArrayLengths.has(r)&&(i=e+1,s=o.actionArrayLengths.get(r)),n=n[a]}return!1},E=(t,c,l,u)=>{let d=W(r,t);if(d){if(ee(t)||te(t))return;let r=U(W(a,t)),f=W(a,t,U(l)?W(i,t):l);U(f)||u&&u.defaultChecked||c?G(a,t,c?f:Cu(d._f)):ce(t,f),o.mount&&!o.action&&(b(),r&&n.isDirty&&(m.isDirty||h.isDirty)&&(k()||(n.isDirty=!1,g.state.next({...n}))),e.shouldUnregister&&r&&!U(W(a,t))&&Al(t,s)&&(o.watch=!0))}},D=(e,o,s,c,l)=>{let u=!1,d=!1,f={name:e};if(!t.disabled||c===!0){if(!s||c){let t=Sl(W(i,e),o);(m.isDirty||h.isDirty)&&(d=n.isDirty,n.isDirty=f.isDirty=!t||k(),u=d!==f.isDirty),d=!!W(n.dirtyFields,e),t===n.isDirty?t?tu(n.dirtyFields,e):G(n.dirtyFields,e,!0):Iu(n.dirtyFields,bu(i,a,void 0,r)),f.dirtyFields=n.dirtyFields,u||=(m.dirtyFields||h.dirtyFields)&&d!==!t}if(s){let t=W(n.touchedFields,e);t||(G(n.touchedFields,e,s),f.touchedFields=n.touchedFields,u||=(m.touchedFields||h.touchedFields)&&t!==s)}u&&l&&g.state.next(f)}return u?f:{}},ne=(e,r,i,a)=>{let o=W(n.errors,e),s=(m.isValid||h.isValid)&&pl(r)&&n.isValid!==r;if(t.delayError&&i?(c[e]=y(e,()=>w(e,i)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e],i?G(n.errors,e,i):tu(n.errors,e),n.errors={...n.errors}),(i?!Sl(o,i):o)||!Nl(a)||s){let t={...a,...s&&pl(r)?{isValid:r}:{},errors:n.errors,name:e};g.state.next(t)}},re=async e=>(x(e,!0),await t.resolver(a,t.context,wu(e||s.mount,r,t.criteriaMode,t.shouldUseNativeValidation))),ie=async e=>{let{errors:t}=await re(e);if(x(e),e){for(let r of e){let e=W(t,r);e?s.array.has(r)&&tl(e)&&!Object.keys(e).some(e=>!Number.isNaN(Number(e)))?Ml(n.errors,{[r]:e},r):G(n.errors,r,e):tu(n.errors,r)}n.errors={...n.errors}}else n.errors=t;return t},ae=async({name:t,eventType:r})=>{if(e.validate){let i=await e.validate({formValues:a,formState:n,name:t,eventType:r});if(tl(i))for(let e in i){let t=i[e];t&&ye(`${Fu}.${e}`,{message:wl(t.message)?t.message:``,type:t.type||sl.validate})}else wl(i)||!i?ye(Fu,{message:i||``,type:sl.validate}):ve(Fu);return i}return!0},O=async({fields:r,onlyCheckValid:i,name:o,eventType:c,context:l={valid:!0,runRootValidation:!1}})=>{if(e.validate&&(l.runRootValidation=!0,!await ae({name:o,eventType:c})&&(l.valid=!1,i)))return l.valid;for(let o in r){let u=r[o];if(u){let{_f:r,...d}=u;if(r){let o=s.array.has(r.name),c=u._f&&Du(u._f),d=m.validatingFields||m.isValidating||h.validatingFields||h.isValidating;c&&d&&x([r.name],!0);let f=await Hl(u,s.disabled,a,v,t.shouldUseNativeValidation&&!i,o);if(c&&d&&x([r.name]),f[r.name]&&(l.valid=!1,i)||(!i&&(W(f,r.name)?o?Ml(n.errors,f,r.name):G(n.errors,r.name,f[r.name]):tu(n.errors,r.name)),e.shouldUseNativeValidation&&f[r.name]))break}!Nl(d)&&await O({context:l,onlyCheckValid:i,fields:d,name:o,eventType:c})}}return l.valid},oe=()=>{for(let e of s.unMount){let t=W(r,e);t&&(t._f.refs?t._f.refs.every(e=>!du(e)):!du(t._f.ref))&&Ce(e)}s.unMount=new Set},k=(e,t)=>(e&&t&&G(a,e,t),!Sl(o.mount?a:i,i)),A=(e,t,n)=>Tl(e,s,{...o.mount?a:U(t)||wl(e)?i:t},n,t),se=e=>Yl(W(o.mount?a:i,e,t.shouldUnregister?W(i,e,[]):[])),ce=(e,t,n={},i=!1,o=!1,s=!1)=>{let c=W(r,e),l=t;if(c){let n=c._f;n&&(!n.disabled&&G(a,e,Su(t,n)),l=Pl(n.ref)&&$c(t)?``:t,lu(n.ref)?[...n.ref.options].forEach(e=>e.selected=l.includes(e.value)):n.refs?Xc(n.ref)?n.refs.forEach(e=>{(!e.defaultChecked||!e.disabled)&&(e.checked=Array.isArray(l)?!!l.find(t=>t===e.value):l===e.value||!!l)}):n.refs.forEach(e=>e.checked=e.value===l):Zc(n.ref)?n.ref.value=``:(n.ref.value=l,!n.ref.type&&!o&&!s&&g.state.next({name:e,values:i?a:V(a)})))}(n.shouldDirty||n.shouldTouch)&&D(e,l,n.shouldTouch,n.shouldDirty,!o),n.shouldValidate&&me(e,{delayError:n.delayError})},le=(e,t,n,i=!1,o=!1,c=!1)=>{s.array.has(e)&&g.array.next({name:e,values:i?a:V(a)});for(let a in t){if(!t.hasOwnProperty(a))return;let l=t[a],u=e+`.`+a,d=W(r,u);(s.array.has(e)||tl(l)||d&&!d._f)&&!Qc(l)?le(u,l,n,i,o,c):ce(u,l,n,i,o,c)}},ue=(e,t,i,c,l=!1)=>{let u=W(r,e),d=s.array.has(e),f=c?t:V(t),p=Sl(W(a,e),f);if(p||G(a,e,f),d)g.array.next({name:e,values:c?a:V(a)}),(m.isDirty||m.dirtyFields||h.isDirty||h.dirtyFields)&&i.shouldDirty&&(S(),l||g.state.next({name:e,dirtyFields:n.dirtyFields,isDirty:k(e,f)}));else{let t=Array.isArray(f)&&!f.length||Nl(f),n=!p&&!l;!u||u._f||$c(f)||t?ce(e,f,i,c,l,n):le(e,f,i,c,l,n)}if(!p&&!l){let t=Al(e,s),r=c?a:V(a);if(g.state.next({...t&&n,name:o.mount||t?e:void 0,values:r}),!d)for(let t of xu(s.array,e))g.state.next({name:t,values:r})}},de=(e,t,n={})=>ue(e,t,n,!1),j=(e,t={})=>{let r=ml(e)?e(a):e;if(!Sl(a,r)){a={...a,...r};for(let e of s.mount)cu(r,e)&&ue(e,W(r,e),t,!0,!0);g.state.next({...n,name:void 0,type:void 0,...u?{values:a}:{}}),t.shouldValidate&&b()}},fe=async i=>{o.mount=!0;let l=i.target,p=l.name,_=!0,y=W(r,p),S=e=>{_=Number.isNaN(e)||Qc(e)&&isNaN(e.getTime())||Sl(e,W(a,p,e))};if(y){let o,C,w=l.type?Cu(y._f):nl(i),T=i.type===al.BLUR||i.type===al.FOCUS_OUT,ee=!Ou(y._f)&&!e.validate&&!t.resolver&&!W(n.errors,p)&&!y._f.deps,te=ee||Mu(T,W(n.touchedFields,p),n.isSubmitted,f,d),E=Al(p,s,T);if(G(a,p,w),T){if(!l||!l.readOnly){y._f.onBlur&&y._f.onBlur(i);let e=c[p];e&&e(0)}}else y._f.onChange&&y._f.onChange(i);let ie=D(p,w,T),oe=!Nl(ie)||E;if(!T&&g.state.next({name:p,type:i.type,...u?{values:V(a)}:{}}),te)return(!ee||!n.isValid)&&(m.isValid||h.isValid)&&(t.mode===`onBlur`?T&&b():T||b()),oe&&g.state.next({name:p,...E?{}:ie});if(!t.resolver&&e.validate&&await ae({name:p,eventType:i.type}),!T&&E&&g.state.next({...n}),t.resolver){let{errors:e}=await re([p]);if(x([p]),S(w),!_){!Nl(ie)&&g.state.next(ie);return}let t=ku(n.errors,r,p),i=ku(e,r,t.name||p);o=i.error,p=i.name,C=Nl(e)}else x([p],!0),o=(await Hl(y,s.disabled,a,v,t.shouldUseNativeValidation))[p],x([p]),S(w),_&&(o?C=!1:(m.isValid||h.isValid)&&(C=await O({fields:r,onlyCheckValid:!0,name:p,eventType:i.type})));_&&(y._f.deps&&(!Array.isArray(y._f.deps)||y._f.deps.length>0)&&me(y._f.deps),ne(p,C,o,ie))}},pe=(e,t)=>{if(W(n.errors,t)&&e.focus)return e.focus(),1},me=async(e,i={})=>{let a,o,u=Ul(e);if(t.resolver){let t=await ie(U(e)?e:u);a=Nl(t),o=e?!u.some(e=>W(t,e)):a}else e?(o=(await Promise.all(u.map(async e=>{let t=W(r,e);return await O({fields:t&&t._f?{[e]:t}:t,eventType:al.TRIGGER})}))).every(Boolean),!(!o&&!n.isValid)&&b()):o=a=await O({fields:r,name:e,eventType:al.TRIGGER});if(i.delayError&&t.delayError&&wl(e)){let r=W(n.errors,e);r?(tu(n.errors,e),c[e]=y(e,()=>w(e,r)),c[e](t.delayError)):(clearTimeout(l[e]),delete c[e])}return g.state.next({...!wl(e)||(m.isValid||h.isValid)&&a!==n.isValid?{}:{name:e},...t.resolver||!e?{isValid:a}:{},errors:n.errors}),i.shouldFocus&&!o&&jl(r,pe,e?u:s.mount),o},he=(e,t)=>{let r={...o.mount?a:i};return t&&(r=ou(t.dirtyFields?n.dirtyFields:n.touchedFields,r)),U(e)?r:wl(e)?W(r,e):e.map(e=>W(r,e))},ge=e=>U(e)?{...n.errors}:wl(e)?W(n.errors,e):e.map(e=>W(n.errors,e)),_e=(e,t)=>{let r=t||n,i=W(r.errors,e);return{invalid:!!i,isDirty:!!W(r.dirtyFields,e),error:i,isValidating:!!W(n.validatingFields,e),isTouched:!!W(r.touchedFields,e)}},ve=e=>{let t=e?Ul(e):void 0;t?.forEach(e=>tu(n.errors,e)),t?t.forEach(e=>{g.state.next({name:e,errors:n.errors})}):(n.errors={},g.state.next({errors:n.errors}))},ye=(e,t,i)=>{let a=(W(r,e,{_f:{}})._f||{}).ref,{ref:o,message:s,type:c,...l}=W(n.errors,e)||{};G(n.errors,e,{...l,...t,ref:a}),g.state.next({name:e,errors:n.errors,isValid:!1}),i&&i.shouldFocus&&a&&a.focus&&a.focus()},be=(e,t)=>{if(ml(e)){u++;let{unsubscribe:n}=g.state.subscribe({next:n=>`values`in n&&e(n.values||A(void 0,t),n)}),r=!1;return{unsubscribe:()=>{r||(r=!0,u--,n())}}}return A(e,t,!0)},xe=e=>{let t=!!e.formState?.values;t&&u++;let{unsubscribe:r}=g.state.subscribe({next:t=>{if(ju(e.name,t.name,e.exact)&&Au(t,e.formState||m,Ne,e.reRenderRoot)){let r={...a};e.callback({values:r,...n,...t,defaultValues:i})}}});if(!t)return r;let o=!1;return()=>{o||(o=!0,u--,r())}},Se=e=>(o.mount=!0,h={...h,...e.formState},xe({...e,formState:{...p,...e.formState}})),Ce=(e,o={})=>{for(let c of e?Ul(e):s.mount)s.mount.delete(c),s.array.delete(c),o.keepValue||(tu(r,c),tu(a,c)),!o.keepError&&tu(n.errors,c),!o.keepDirty&&tu(n.dirtyFields,c),!o.keepTouched&&tu(n.touchedFields,c),!o.keepIsValidating&&tu(n.validatingFields,c),!t.shouldUnregister&&!o.keepDefaultValue&&tu(i,c);u&&g.state.next({values:V(a)}),g.state.next({...n,...o.keepDirty?{}:{isDirty:k()}}),!o.keepIsValid&&b()},we=({disabled:e,name:t})=>{if(pl(e)&&o.mount||e||s.disabled.has(t)){let n=s.disabled.has(t)!==!!e;e?s.disabled.add(t):s.disabled.delete(t),n&&o.mount&&!o.action&&b()}},Te=(e,n={})=>{let a=W(r,e),c=pl(n.disabled)||pl(t.disabled),l=!s.registerName.has(e)&&a&&a._f&&!a._f.mount;return G(r,e,{...a||{},_f:{...a&&a._f?a._f:{ref:{name:e}},name:e,mount:!0,...n}}),s.mount.add(e),a&&!l?we({disabled:pl(n.disabled)?n.disabled:t.disabled,name:e}):E(e,!0,n.value),{...c?{disabled:n.disabled||t.disabled}:{},...t.progressive?{required:!!n.required,min:Tu(n.min),max:Tu(n.max),minLength:Tu(n.minLength),maxLength:Tu(n.maxLength),pattern:Tu(n.pattern)}:{},name:e,onChange:fe,onBlur:fe,ref:c=>{if(c){s.registerName.add(e),Te(e,n),s.registerName.delete(e),a=W(r,e);let t=U(c.value)&&c.querySelectorAll&&c.querySelectorAll(`input,select,textarea`)[0]||c,o=uu(t),l=a._f.refs||[];if(o?l.find(e=>e===t):t===a._f.ref)return;let u={...a._f};o?(u.refs=[...l.filter(du),t,...Array.isArray(W(i,e))?[{}]:[]],u.ref={type:t.type,name:e}):(u.ref=t,delete u.refs),G(r,e,{_f:u}),E(e,!1,void 0,t)}else a=W(r,e,{}),a._f&&(a._f.mount=!1),(t.shouldUnregister||n.shouldUnregister)&&!(rl(s.array,e)&&o.action)&&s.unMount.add(e)}}},Ee=()=>t.shouldFocusError&&!t.shouldUseNativeValidation&&jl(r,pe,s.mount),De=e=>{pl(e)&&(g.state.next({disabled:e}),jl(r,(t,n)=>{let i=W(r,n);i&&(t.disabled=i._f.disabled||e,Array.isArray(i._f.refs)&&i._f.refs.forEach(t=>{t.disabled=i._f.disabled||e}))},0,!1))},Oe=(e,i)=>async o=>{let c,l;o&&(o.preventDefault&&o.preventDefault(),o.persist&&o.persist());let u=V(a);if(g.state.next({isSubmitting:!0}),t.resolver){let{errors:e,values:t}=await re();x(),n.errors=e,u=V(t)}else await O({fields:r,eventType:al.SUBMIT});if(s.disabled.size)for(let e of s.disabled)tu(u,e);if(tu(n.errors,cl),Nl(n.errors)){g.state.next({errors:{}});try{c=await e(u,o)}catch(e){l=e}}else i&&await i({...n.errors},o),Ee(),setTimeout(Ee);if(g.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:Nl(n.errors)&&!l,submitCount:n.submitCount+1,errors:n.errors}),l)throw l;return c},ke=(e,t={})=>{W(r,e)&&(U(t.defaultValue)?de(e,V(W(i,e))):(de(e,t.defaultValue),G(i,e,V(t.defaultValue))),t.keepTouched||tu(n.touchedFields,e),t.keepDirty||(tu(n.dirtyFields,e),n.isDirty=t.defaultValue?k(e,V(W(i,e))):k()),t.keepError||(tu(n.errors,e),m.isValid&&b()),g.state.next({...n}))},Ae=(e,c={})=>{let l=e?V(e):i,u=V(l),d=Nl(e),f=u,p=r;if(c.keepDefaultValues||(i=l),!c.keepValues){if(c.keepDirtyValues){let e=new Set([...s.mount,...pu(bu(i,a,void 0,p),n.dirtyFields)]);for(let t of e){let e=W(n.dirtyFields,t),r=W(a,t),i=W(f,t);e&&!U(r)?G(f,t,r):!e&&!U(i)&&de(t,i)}}else{if(il&&U(e))for(let e of s.mount){let t=W(r,e);if(t&&t._f){let e=Array.isArray(t._f.refs)?t._f.refs[0]:t._f.ref;if(Pl(e)){let t=e.closest(`form`);if(t){t.reset();break}}}}if(c.keepFieldsRef)for(let e of s.mount)de(e,W(f,e));else r={}}if(t.shouldUnregister){if(a=c.keepDefaultValues?V(i):{},c.keepFieldsRef)for(let e of s.mount)G(a,e,W(f,e))}else a=V(f);g.array.next({values:{...f}}),g.state.next({name:void 0,type:void 0,values:{...f}})}s={mount:c.keepDirtyValues?s.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:``},o.mount=!m.isValid||!!c.keepIsValid||!!c.keepDirtyValues||!t.shouldUnregister&&!Nl(f),o.watch=!!t.shouldUnregister,o.keepIsValid=!!c.keepIsValid,o.action=!1,o.actionArrayLengths.clear(),c.keepErrors||(n.errors={}),g.state.next({submitCount:c.keepSubmitCount?n.submitCount:0,isDirty:d?!1:c.keepDirty?n.isDirty:c.keepValues?k():!!(c.keepDefaultValues&&!Sl(e,i)),isSubmitted:c.keepIsSubmitted?n.isSubmitted:!1,dirtyFields:d?{}:c.keepDirtyValues?c.keepDefaultValues&&a?bu(i,a,void 0,p):n.dirtyFields:c.keepDefaultValues&&e?bu(i,e,void 0,p):c.keepDirty?n.dirtyFields:{},touchedFields:c.keepTouched?n.touchedFields:{},errors:c.keepErrors?n.errors:{},isSubmitSuccessful:c.keepIsSubmitSuccessful?n.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:i})},je=(e,n)=>Ae(ml(e)?e(a):e,{...t.resetOptions,...n}),Me=(e,t={})=>{let n=W(r,e),i=n&&n._f;if(i){let e=i.refs?i.refs[0]:i.ref;e.focus&&setTimeout(()=>{e.focus(),t.shouldSelect&&ml(e.select)&&e.select()})}},Ne=e=>{let{name:t,type:r,values:i,...a}=e;n={...n,...a}};g.state.subscribe({next:Ne});let Pe={control:{register:Te,unregister:Ce,getFieldState:_e,handleSubmit:Oe,setError:ye,_subscribe:xe,_runSchema:re,_updateIsValidating:x,_focusError:Ee,_getWatch:A,_getDirty:k,_setValid:b,_setFieldArray:C,_setDisabledField:we,_setErrors:T,_getFieldArray:se,_reset:Ae,_resetDefaultValues:()=>ml(t.defaultValues)&&t.defaultValues().then(e=>{je(e,t.resetOptions),g.state.next({isLoading:!1})}),_removeUnmounted:oe,_disableForm:De,_subjects:g,_proxyFormState:m,get _fields(){return r},get _formValues(){return a},get _state(){return o},set _state(e){o=e},get _defaultValues(){return i},get _names(){return s},set _names(e){s=e},get _formState(){return n},get _options(){return t},set _options(e){t={...t,...e},d=kl(t.mode),f=kl(t.reValidateMode)}},subscribe:Se,trigger:me,register:Te,handleSubmit:Oe,watch:be,setValue:de,setValues:j,getValues:he,getErrors:ge,reset:je,resetField:ke,resetDefaultValues:(e,t={})=>{if(i=V(e),!t.keepDirty){let e=bu(i,a,void 0,r);n.dirtyFields=e,n.isDirty=!Nl(e)}t.keepIsValid||b(),g.state.next({...n,defaultValues:i})},clearErrors:ve,unregister:Ce,setError:ye,setFocus:Me,getFieldState:_e};return{...Pe,formControl:Pe}}function zu(e={}){let t=x.useRef(void 0),n=x.useRef(void 0),r=x.useRef(e.formControl),[i,a]=x.useState(()=>({...V(Lu),isLoading:ml(e.defaultValues),errors:e.errors||{},disabled:e.disabled||!1,defaultValues:ml(e.defaultValues)?void 0:e.defaultValues}));if(!t.current||e.formControl&&r.current!==e.formControl){if(r.current=e.formControl,e.formControl)t.current={...e.formControl,formState:i},e.defaultValues&&!ml(e.defaultValues)&&e.formControl.reset(e.defaultValues,e.resetOptions);else{let{formControl:n,...r}=Ru(e);t.current={...r,formState:i}}}let o=t.current.control;o._options=e;let{resyncIfNeeded:s,snapshot:c}=Cl();return vl(()=>{let e=()=>({...o._formState,defaultValues:o._defaultValues});s(!0,e,a);let t=o._subscribe({formState:o._proxyFormState,callback:()=>a({...o._formState,defaultValues:o._defaultValues}),reRenderRoot:!0});return a(e=>({...e,isReady:!0})),o._formState.isReady=!0,()=>{t(),c(!0,e)}},[o,s,c]),x.useEffect(()=>o._disableForm(e.disabled),[o,e.disabled]),x.useEffect(()=>{e.mode&&(o._options.mode=e.mode),e.reValidateMode&&(o._options.reValidateMode=e.reValidateMode)},[o,e.mode,e.reValidateMode]),x.useEffect(()=>{e.errors&&(o._setErrors(e.errors),o._focusError())},[o,e.errors]),x.useEffect(()=>{e.shouldUnregister&&o._subjects.state.next({values:o._getWatch()})},[o,e.shouldUnregister]),x.useEffect(()=>{if(o._proxyFormState.isDirty){let e=o._getDirty();e!==i.isDirty&&o._subjects.state.next({isDirty:e})}},[o,i.isDirty]),x.useEffect(()=>{e.values&&!Sl(e.values,n.current)?(o._reset(e.values,{keepFieldsRef:!0,...o._options.resetOptions}),o._options.resetOptions?.keepIsValid||o._setValid(),n.current=e.values,a(e=>({...e}))):o._resetDefaultValues()},[o,e.values]),x.useEffect(()=>{o._state.mount||(o._setValid(),o._state.mount=!0),o._state.watch&&(o._state.watch=!1,o._subjects.state.next({...o._formState})),o._removeUnmounted()}),t.current.formState=x.useMemo(()=>_l(i,o),[o,i]),t.current}var Bu;function Y(e,t,n){function r(n,r){if(n._zod||Object.defineProperty(n,"_zod",{value:{def:r,constr:o,traits:new Set},enumerable:!1}),n._zod.traits.has(e))return;n._zod.traits.add(e),t(n,r);let i=o.prototype,a=Object.keys(i);for(let e=0;e<a.length;e++){let t=a[e];t in n||(n[t]=i[t].bind(n))}}let i=n?.Parent??Object;class a extends i{}Object.defineProperty(a,"name",{value:e});function o(e){var t;let i=n?.Parent?new a:this;r(i,e),(t=i._zod).deferred??(t.deferred=[]);for(let e of i._zod.deferred)e();return i}return Object.defineProperty(o,"init",{value:r}),Object.defineProperty(o,Symbol.hasInstance,{value:t=>n?.Parent&&t instanceof n.Parent?!0:t?._zod?.traits?.has(e)}),Object.defineProperty(o,"name",{value:e}),o}var Vu=class extends Error{constructor(){super(`Encountered Promise during synchronous parse. Use .parseAsync() instead.`)}},Hu=class extends Error{constructor(e){super(`Encountered unidirectional transform during encode: ${e}`),this.name=`ZodEncodeError`}};(Bu=globalThis).__zod_globalConfig??(Bu.__zod_globalConfig={});var Uu=globalThis.__zod_globalConfig;function Wu(e){return e&&Object.assign(Uu,e),Uu}function Gu(e,t){return typeof t==`bigint`?t.toString():t}function X(e){return e==null}function Ku(e){let t=+!!e.startsWith(`^`),n=e.endsWith(`$`)?e.length-1:e.length;return e.slice(t,n)}var qu=Symbol(`evaluating`);function Ju(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==qu)return r===void 0&&(r=qu,r=n()),r},set(n){Object.defineProperty(e,t,{value:n})},configurable:!0})}function Yu(...e){let t={};for(let n of e){let e=Object.getOwnPropertyDescriptors(n);Object.assign(t,e)}return Object.defineProperties({},t)}function Xu(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,``).replace(/[\s_-]+/g,`-`).replace(/^-+|-+$/g,``)}var Zu=`captureStackTrace`in Error?Error.captureStackTrace:(...e)=>{};function Qu(e){return typeof e==`object`&&!!e&&!Array.isArray(e)}function $u(e){if(Qu(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!=`function`)return!0;let n=t.prototype;return Qu(n)!==!1&&Object.prototype.hasOwnProperty.call(n,`isPrototypeOf`)!==!1}function ed(e){return $u(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function td(e){return e.replace(/[.*+?^${}()|[\]\\]/g,`\\$&`)}function nd(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function Z(e){let t=e;if(!t)return{};if(typeof t==`string`)return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error==`string`?{...t,error:()=>t.error}:t}-Number.MAX_VALUE,Number.MAX_VALUE;function rd(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function id(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function ad(e,t){return t.map(t=>{var n;return(n=t).path??(n.path=[]),t.path.unshift(e),t})}function od(e){return typeof e==`string`?e:e?.message}function sd(e,t,n){let r=e.message?e.message:od(e.inst?._zod.def?.error?.(e))??od(t?.error?.(e))??od(n.customError?.(e))??od(n.localeError?.(e))??`Invalid input`,{inst:i,continue:a,input:o,...s}=e;return s.path??=[],s.message=r,t?.reportInput&&(s.input=o),s}function cd(e){return Array.isArray(e)?`array`:typeof e==`string`?`string`:`unknown`}function ld(...e){let[t,n,r]=e;return typeof t==`string`?{message:t,code:`custom`,input:n,inst:r}:{...t}}var ud=(e,t)=>{e.name=`$ZodError`,Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,Gu,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},dd=Y(`$ZodError`,ud),fd=Y(`$ZodError`,ud,{Parent:Error});function pd(e,t=e=>e.message){let n={},r=[];for(let i of e.issues)i.path.length>0?(n[i.path[0]]=n[i.path[0]]||[],n[i.path[0]].push(t(i))):r.push(t(i));return{formErrors:r,fieldErrors:n}}function md(e,t=e=>e.message){let n={_errors:[]},r=(e,i=[])=>{for(let a of e.issues)if(a.code===`invalid_union`&&a.errors.length)a.errors.map(e=>r({issues:e},[...i,...a.path]));else if(a.code===`invalid_key`)r({issues:a.issues},[...i,...a.path]);else if(a.code===`invalid_element`)r({issues:a.issues},[...i,...a.path]);else{let e=[...i,...a.path];if(e.length===0)n._errors.push(t(a));else{let r=n,i=0;for(;i<e.length;){let n=e[i];i===e.length-1?(r[n]=r[n]||{_errors:[]},r[n]._errors.push(t(a))):r[n]=r[n]||{_errors:[]},r=r[n],i++}}}};return r(e),n}var hd=e=>(t,n,r,i)=>{let a=r?{...r,async:!1}:{async:!1},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise)throw new Vu;if(o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>sd(e,a,Wu())));throw Zu(t,i?.callee),t}return o.value},gd=e=>async(t,n,r,i)=>{let a=r?{...r,async:!0}:{async:!0},o=t._zod.run({value:n,issues:[]},a);if(o instanceof Promise&&(o=await o),o.issues.length){let t=new((i?.Err)??e)(o.issues.map(e=>sd(e,a,Wu())));throw Zu(t,i?.callee),t}return o.value},_d=e=>(t,n,r)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new Vu;return a.issues.length?{success:!1,error:new(e??dd)(a.issues.map(e=>sd(e,i,Wu())))}:{success:!0,data:a.value}},vd=_d(fd),yd=e=>async(t,n,r)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);return a instanceof Promise&&(a=await a),a.issues.length?{success:!1,error:new e(a.issues.map(e=>sd(e,i,Wu())))}:{success:!0,data:a.value}},Q=yd(fd),bd=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return hd(e)(t,n,i)},xd=e=>(t,n,r)=>hd(e)(t,n,r),Sd=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return gd(e)(t,n,i)},Cd=e=>async(t,n,r)=>gd(e)(t,n,r),wd=e=>(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return _d(e)(t,n,i)},Td=e=>(t,n,r)=>_d(e)(t,n,r),Ed=e=>async(t,n,r)=>{let i=r?{...r,direction:`backward`}:{direction:`backward`};return yd(e)(t,n,i)},Dd=e=>async(t,n,r)=>yd(e)(t,n,r),Od=/^[cC][0-9a-z]{6,}$/,kd=/^[0-9a-z]+$/,Ad=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,jd=/^[0-9a-vA-V]{20}$/,Md=/^[A-Za-z0-9]{27}$/,Nd=/^[a-zA-Z0-9_-]{21}$/,Pd=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,Fd=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Id=e=>e?RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,Ld=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,Rd=`^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;function zd(){return new RegExp(Rd,`u`)}var Bd=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,Vd=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,Hd=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,Ud=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,Wd=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,Gd=/^[A-Za-z0-9_-]*$/,Kd=/^https?$/,qd=/^\+[1-9]\d{6,14}$/,Jd=`(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))`,Yd=RegExp(`^${Jd}$`);function Xd(e){let t=`(?:[01]\\d|2[0-3]):[0-5]\\d`;return typeof e.precision==`number`?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function Zd(e){return RegExp(`^${Xd(e)}$`)}function Qd(e){let t=Xd({precision:e.precision}),n=[`Z`];e.local&&n.push(``),e.offset&&n.push(`([+-](?:[01]\\d|2[0-3]):[0-5]\\d)`);let r=`${t}(?:${n.join(`|`)})`;return RegExp(`^${Jd}T(?:${r})$`)}var $d=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??``}}`:`[\\s\\S]*`;return RegExp(`^${t}$`)},ef=/^[^A-Z]*$/,tf=/^[^a-z]*$/,nf=Y(`$ZodCheck`,(e,t)=>{var n;e._zod??={},e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),rf=Y(`$ZodCheckMaxLength`,(e,t)=>{var n;nf.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!X(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.maximum??1/0;t.maximum<n&&(e._zod.bag.maximum=t.maximum)}),e._zod.check=n=>{let r=n.value;if(r.length<=t.maximum)return;let i=cd(r);n.issues.push({origin:i,code:`too_big`,maximum:t.maximum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),af=Y(`$ZodCheckMinLength`,(e,t)=>{var n;nf.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!X(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag.minimum??-1/0;t.minimum>n&&(e._zod.bag.minimum=t.minimum)}),e._zod.check=n=>{let r=n.value;if(r.length>=t.minimum)return;let i=cd(r);n.issues.push({origin:i,code:`too_small`,minimum:t.minimum,inclusive:!0,input:r,inst:e,continue:!t.abort})}}),of=Y(`$ZodCheckLengthEquals`,(e,t)=>{var n;nf.init(e,t),(n=e._zod.def).when??(n.when=e=>{let t=e.value;return!X(t)&&t.length!==void 0}),e._zod.onattach.push(e=>{let n=e._zod.bag;n.minimum=t.length,n.maximum=t.length,n.length=t.length}),e._zod.check=n=>{let r=n.value,i=r.length;if(i===t.length)return;let a=cd(r),o=i>t.length;n.issues.push({origin:a,...o?{code:`too_big`,maximum:t.length}:{code:`too_small`,minimum:t.length},inclusive:!0,exact:!0,input:n.value,inst:e,continue:!t.abort})}}),sf=Y(`$ZodCheckStringFormat`,(e,t)=>{var n,r;nf.init(e,t),e._zod.onattach.push(e=>{let n=e._zod.bag;n.format=t.format,t.pattern&&(n.patterns??=new Set,n.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:t.format,input:n.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),cf=Y(`$ZodCheckRegex`,(e,t)=>{sf.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:`string`,code:`invalid_format`,format:`regex`,input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),lf=Y(`$ZodCheckLowerCase`,(e,t)=>{t.pattern??=ef,sf.init(e,t)}),uf=Y(`$ZodCheckUpperCase`,(e,t)=>{t.pattern??=tf,sf.init(e,t)}),df=Y(`$ZodCheckIncludes`,(e,t)=>{nf.init(e,t);let n=td(t.includes),r=new RegExp(typeof t.position==`number`?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(r)}),e._zod.check=n=>{n.value.includes(t.includes,t.position)||n.issues.push({origin:`string`,code:`invalid_format`,format:`includes`,includes:t.includes,input:n.value,inst:e,continue:!t.abort})}}),ff=Y(`$ZodCheckStartsWith`,(e,t)=>{nf.init(e,t);let n=RegExp(`^${td(t.prefix)}.*`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.startsWith(t.prefix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`starts_with`,prefix:t.prefix,input:n.value,inst:e,continue:!t.abort})}}),pf=Y(`$ZodCheckEndsWith`,(e,t)=>{nf.init(e,t);let n=RegExp(`.*${td(t.suffix)}$`);t.pattern??=n,e._zod.onattach.push(e=>{let t=e._zod.bag;t.patterns??=new Set,t.patterns.add(n)}),e._zod.check=n=>{n.value.endsWith(t.suffix)||n.issues.push({origin:`string`,code:`invalid_format`,format:`ends_with`,suffix:t.suffix,input:n.value,inst:e,continue:!t.abort})}}),mf=Y(`$ZodCheckOverwrite`,(e,t)=>{nf.init(e,t),e._zod.check=e=>{e.value=t.tx(e.value)}}),hf={major:4,minor:4,patch:3},gf=Y(`$ZodType`,(e,t)=>{var n;e??={},e._zod.def=t,e._zod.bag=e._zod.bag||{},e._zod.version=hf;let r=[...e._zod.def.checks??[]];e._zod.traits.has(`$ZodCheck`)&&r.unshift(e);for(let t of r)for(let n of t._zod.onattach)n(e);if(r.length===0)(n=e._zod).deferred??(n.deferred=[]),e._zod.deferred?.push(()=>{e._zod.run=e._zod.parse});else{let t=(e,t,n)=>{let r=rd(e),i;for(let a of t){if(a._zod.def.when){if(id(e)||!a._zod.def.when(e))continue}else if(r)continue;let t=e.issues.length,o=a._zod.check(e);if(o instanceof Promise&&n?.async===!1)throw new Vu;if(i||o instanceof Promise)i=(i??Promise.resolve()).then(async()=>{await o,e.issues.length!==t&&(r||=rd(e,t))});else{if(e.issues.length===t)continue;r||=rd(e,t)}}return i?i.then(()=>e):e},n=(n,i,a)=>{if(rd(n))return n.aborted=!0,n;let o=t(i,r,a);if(o instanceof Promise){if(a.async===!1)throw new Vu;return o.then(t=>e._zod.parse(t,a))}return e._zod.parse(o,a)};e._zod.run=(i,a)=>{if(a.skipChecks)return e._zod.parse(i,a);if(a.direction===`backward`){let t=e._zod.parse({value:i.value,issues:[]},{...a,skipChecks:!0});return t instanceof Promise?t.then(e=>n(e,i,a)):n(t,i,a)}let o=e._zod.parse(i,a);if(o instanceof Promise){if(a.async===!1)throw new Vu;return o.then(e=>t(e,r,a))}return t(o,r,a)}}Ju(e,`~standard`,()=>({validate:t=>{try{let n=vd(e,t);return n.success?{value:n.data}:{issues:n.error?.issues}}catch{return Q(e,t).then(e=>e.success?{value:e.data}:{issues:e.error?.issues})}},vendor:`zod`,version:1}))}),_f=Y(`$ZodString`,(e,t)=>{gf.init(e,t),e._zod.pattern=[...e?._zod.bag?.patterns??[]].pop()??$d(e._zod.bag),e._zod.parse=(n,r)=>{if(t.coerce)try{n.value=String(n.value)}catch{}return typeof n.value==`string`||n.issues.push({expected:`string`,code:`invalid_type`,input:n.value,inst:e}),n}}),$=Y(`$ZodStringFormat`,(e,t)=>{sf.init(e,t),_f.init(e,t)}),vf=Y(`$ZodGUID`,(e,t)=>{t.pattern??=Fd,$.init(e,t)}),yf=Y(`$ZodUUID`,(e,t)=>{if(t.version){let e={v1:1,v2:2,v3:3,v4:4,v5:5,v6:6,v7:7,v8:8}[t.version];if(e===void 0)throw Error(`Invalid UUID version: "${t.version}"`);t.pattern??=Id(e)}else t.pattern??=Id();$.init(e,t)}),bf=Y(`$ZodEmail`,(e,t)=>{t.pattern??=Ld,$.init(e,t)}),xf=Y(`$ZodURL`,(e,t)=>{$.init(e,t),e._zod.check=n=>{try{let r=n.value.trim();if(!t.normalize&&t.protocol?.source===Kd.source&&!/^https?:\/\//i.test(r)){n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid URL format`,input:n.value,inst:e,continue:!t.abort});return}let i=new URL(r);t.hostname&&(t.hostname.lastIndex=0,t.hostname.test(i.hostname)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid hostname`,pattern:t.hostname.source,input:n.value,inst:e,continue:!t.abort})),t.protocol&&(t.protocol.lastIndex=0,t.protocol.test(i.protocol.endsWith(`:`)?i.protocol.slice(0,-1):i.protocol)||n.issues.push({code:`invalid_format`,format:`url`,note:`Invalid protocol`,pattern:t.protocol.source,input:n.value,inst:e,continue:!t.abort})),n.value=t.normalize?i.href:r;return}catch{n.issues.push({code:`invalid_format`,format:`url`,input:n.value,inst:e,continue:!t.abort})}}}),Sf=Y(`$ZodEmoji`,(e,t)=>{t.pattern??=zd(),$.init(e,t)}),Cf=Y(`$ZodNanoID`,(e,t)=>{t.pattern??=Nd,$.init(e,t)}),wf=Y(`$ZodCUID`,(e,t)=>{t.pattern??=Od,$.init(e,t)}),Tf=Y(`$ZodCUID2`,(e,t)=>{t.pattern??=kd,$.init(e,t)}),Ef=Y(`$ZodULID`,(e,t)=>{t.pattern??=Ad,$.init(e,t)}),Df=Y(`$ZodXID`,(e,t)=>{t.pattern??=jd,$.init(e,t)}),Of=Y(`$ZodKSUID`,(e,t)=>{t.pattern??=Md,$.init(e,t)}),kf=Y(`$ZodISODateTime`,(e,t)=>{t.pattern??=Qd(t),$.init(e,t)}),Af=Y(`$ZodISODate`,(e,t)=>{t.pattern??=Yd,$.init(e,t)}),jf=Y(`$ZodISOTime`,(e,t)=>{t.pattern??=Zd(t),$.init(e,t)}),Mf=Y(`$ZodISODuration`,(e,t)=>{t.pattern??=Pd,$.init(e,t)}),Nf=Y(`$ZodIPv4`,(e,t)=>{t.pattern??=Bd,$.init(e,t),e._zod.bag.format=`ipv4`}),Pf=Y(`$ZodIPv6`,(e,t)=>{t.pattern??=Vd,$.init(e,t),e._zod.bag.format=`ipv6`,e._zod.check=n=>{try{new URL(`http://[${n.value}]`)}catch{n.issues.push({code:`invalid_format`,format:`ipv6`,input:n.value,inst:e,continue:!t.abort})}}}),Ff=Y(`$ZodCIDRv4`,(e,t)=>{t.pattern??=Hd,$.init(e,t)}),If=Y(`$ZodCIDRv6`,(e,t)=>{t.pattern??=Ud,$.init(e,t),e._zod.check=n=>{let r=n.value.split(`/`);try{if(r.length!==2)throw Error();let[e,t]=r;if(!t)throw Error();let n=Number(t);if(`${n}`!==t||n<0||n>128)throw Error();new URL(`http://[${e}]`)}catch{n.issues.push({code:`invalid_format`,format:`cidrv6`,input:n.value,inst:e,continue:!t.abort})}}});function Lf(e){if(e===``)return!0;if(/\s/.test(e)||e.length%4!=0)return!1;try{return atob(e),!0}catch{return!1}}var Rf=Y(`$ZodBase64`,(e,t)=>{t.pattern??=Wd,$.init(e,t),e._zod.bag.contentEncoding=`base64`,e._zod.check=n=>{Lf(n.value)||n.issues.push({code:`invalid_format`,format:`base64`,input:n.value,inst:e,continue:!t.abort})}});function zf(e){if(!Gd.test(e))return!1;let t=e.replace(/[-_]/g,e=>e===`-`?`+`:`/`);return Lf(t.padEnd(Math.ceil(t.length/4)*4,`=`))}var Bf=Y(`$ZodBase64URL`,(e,t)=>{t.pattern??=Gd,$.init(e,t),e._zod.bag.contentEncoding=`base64url`,e._zod.check=n=>{zf(n.value)||n.issues.push({code:`invalid_format`,format:`base64url`,input:n.value,inst:e,continue:!t.abort})}}),Vf=Y(`$ZodE164`,(e,t)=>{t.pattern??=qd,$.init(e,t)});function Hf(e,t=null){try{let n=e.split(`.`);if(n.length!==3)return!1;let[r]=n;if(!r)return!1;let i=JSON.parse(atob(r));return!(`typ`in i&&i?.typ!==`JWT`||!i.alg||t&&(!(`alg`in i)||i.alg!==t))}catch{return!1}}var Uf=Y(`$ZodJWT`,(e,t)=>{$.init(e,t),e._zod.check=n=>{Hf(n.value,t.alg)||n.issues.push({code:`invalid_format`,format:`jwt`,input:n.value,inst:e,continue:!t.abort})}});function Wf(e,t,n){e.issues.length&&t.issues.push(...ad(n,e.issues)),t.value[n]=e.value}var Gf=Y(`$ZodArray`,(e,t)=>{gf.init(e,t),e._zod.parse=(n,r)=>{let i=n.value;if(!Array.isArray(i))return n.issues.push({expected:`array`,code:`invalid_type`,input:i,inst:e}),n;n.value=Array(i.length);let a=[];for(let e=0;e<i.length;e++){let o=i[e],s=t.element._zod.run({value:o,issues:[]},r);s instanceof Promise?a.push(s.then(t=>Wf(t,n,e))):Wf(s,n,e)}return a.length?Promise.all(a).then(()=>n):n}});function Kf(e,t,n,r){for(let n of e)if(n.issues.length===0)return t.value=n.value,t;let i=e.filter(e=>!rd(e));return i.length===1?(t.value=i[0].value,i[0]):(t.issues.push({code:`invalid_union`,input:t.value,inst:n,errors:e.map(e=>e.issues.map(e=>sd(e,r,Wu())))}),t)}var qf=Y(`$ZodUnion`,(e,t)=>{gf.init(e,t),Ju(e._zod,`optin`,()=>t.options.some(e=>e._zod.optin===`optional`)?`optional`:void 0),Ju(e._zod,`optout`,()=>t.options.some(e=>e._zod.optout===`optional`)?`optional`:void 0),Ju(e._zod,`values`,()=>{if(t.options.every(e=>e._zod.values))return new Set(t.options.flatMap(e=>Array.from(e._zod.values)))}),Ju(e._zod,`pattern`,()=>{if(t.options.every(e=>e._zod.pattern)){let e=t.options.map(e=>e._zod.pattern);return RegExp(`^(${e.map(e=>Ku(e.source)).join(`|`)})$`)}});let n=t.options.length===1?t.options[0]._zod.run:null;e._zod.parse=(r,i)=>{if(n)return n(r,i);let a=!1,o=[];for(let e of t.options){let t=e._zod.run({value:r.value,issues:[]},i);if(t instanceof Promise)o.push(t),a=!0;else{if(t.issues.length===0)return t;o.push(t)}}return a?Promise.all(o).then(t=>Kf(t,r,e,i)):Kf(o,r,e,i)}}),Jf=Y(`$ZodIntersection`,(e,t)=>{gf.init(e,t),e._zod.parse=(e,n)=>{let r=e.value,i=t.left._zod.run({value:r,issues:[]},n),a=t.right._zod.run({value:r,issues:[]},n);return i instanceof Promise||a instanceof Promise?Promise.all([i,a]).then(([t,n])=>Xf(e,t,n)):Xf(e,i,a)}});function Yf(e,t){if(e===t||e instanceof Date&&t instanceof Date&&+e==+t)return{valid:!0,data:e};if($u(e)&&$u(t)){let n=Object.keys(t),r=Object.keys(e).filter(e=>n.indexOf(e)!==-1),i={...e,...t};for(let n of r){let r=Yf(e[n],t[n]);if(!r.valid)return{valid:!1,mergeErrorPath:[n,...r.mergeErrorPath]};i[n]=r.data}return{valid:!0,data:i}}if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return{valid:!1,mergeErrorPath:[]};let n=[];for(let r=0;r<e.length;r++){let i=e[r],a=t[r],o=Yf(i,a);if(!o.valid)return{valid:!1,mergeErrorPath:[r,...o.mergeErrorPath]};n.push(o.data)}return{valid:!0,data:n}}return{valid:!1,mergeErrorPath:[]}}function Xf(e,t,n){let r=new Map,i;for(let n of t.issues)if(n.code===`unrecognized_keys`){i??=n;for(let e of n.keys)r.has(e)||r.set(e,{}),r.get(e).l=!0}else e.issues.push(n);for(let t of n.issues)if(t.code===`unrecognized_keys`)for(let e of t.keys)r.has(e)||r.set(e,{}),r.get(e).r=!0;else e.issues.push(t);let a=[...r].filter(([,e])=>e.l&&e.r).map(([e])=>e);if(a.length&&i&&e.issues.push({...i,keys:a}),rd(e))return e;let o=Yf(t.value,n.value);if(!o.valid)throw Error(`Unmergable intersection. Error path: ${JSON.stringify(o.mergeErrorPath)}`);return e.value=o.data,e}var Zf=Y(`$ZodTransform`,(e,t)=>{gf.init(e,t),e._zod.optin=`optional`,e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Hu(e.constructor.name);let i=t.transform(n.value,n);if(r.async)return(i instanceof Promise?i:Promise.resolve(i)).then(e=>(n.value=e,n.fallback=!0,n));if(i instanceof Promise)throw new Vu;return n.value=i,n.fallback=!0,n}});function Qf(e,t){return t===void 0&&(e.issues.length||e.fallback)?{issues:[],value:void 0}:e}var $f=Y(`$ZodOptional`,(e,t)=>{gf.init(e,t),e._zod.optin=`optional`,e._zod.optout=`optional`,Ju(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,void 0]):void 0),Ju(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ku(e.source)})?$`):void 0}),e._zod.parse=(e,n)=>{if(t.innerType._zod.optin===`optional`){let r=e.value,i=t.innerType._zod.run(e,n);return i instanceof Promise?i.then(e=>Qf(e,r)):Qf(i,r)}return e.value===void 0?e:t.innerType._zod.run(e,n)}}),ep=Y(`$ZodExactOptional`,(e,t)=>{$f.init(e,t),Ju(e._zod,`values`,()=>t.innerType._zod.values),Ju(e._zod,`pattern`,()=>t.innerType._zod.pattern),e._zod.parse=(e,n)=>t.innerType._zod.run(e,n)}),tp=Y(`$ZodNullable`,(e,t)=>{gf.init(e,t),Ju(e._zod,`optin`,()=>t.innerType._zod.optin),Ju(e._zod,`optout`,()=>t.innerType._zod.optout),Ju(e._zod,`pattern`,()=>{let e=t.innerType._zod.pattern;return e?RegExp(`^(${Ku(e.source)}|null)$`):void 0}),Ju(e._zod,`values`,()=>t.innerType._zod.values?new Set([...t.innerType._zod.values,null]):void 0),e._zod.parse=(e,n)=>e.value===null?e:t.innerType._zod.run(e,n)}),np=Y(`$ZodDefault`,(e,t)=>{gf.init(e,t),e._zod.optin=`optional`,Ju(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);if(e.value===void 0)return e.value=t.defaultValue,e;let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(e=>rp(e,t)):rp(r,t)}});function rp(e,t){return e.value===void 0&&(e.value=t.defaultValue),e}var ip=Y(`$ZodPrefault`,(e,t)=>{gf.init(e,t),e._zod.optin=`optional`,Ju(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>(n.direction===`backward`||e.value===void 0&&(e.value=t.defaultValue),t.innerType._zod.run(e,n))}),ap=Y(`$ZodNonOptional`,(e,t)=>{gf.init(e,t),Ju(e._zod,`values`,()=>{let e=t.innerType._zod.values;return e?new Set([...e].filter(e=>e!==void 0)):void 0}),e._zod.parse=(n,r)=>{let i=t.innerType._zod.run(n,r);return i instanceof Promise?i.then(t=>op(t,e)):op(i,e)}});function op(e,t){return!e.issues.length&&e.value===void 0&&e.issues.push({code:`invalid_type`,expected:`nonoptional`,input:e.value,inst:t}),e}var sp=Y(`$ZodCatch`,(e,t)=>{gf.init(e,t),e._zod.optin=`optional`,Ju(e._zod,`optout`,()=>t.innerType._zod.optout),Ju(e._zod,`values`,()=>t.innerType._zod.values),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(r=>(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>sd(e,n,Wu()))},input:e.value}),e.issues=[],e.fallback=!0),e)):(e.value=r.value,r.issues.length&&(e.value=t.catchValue({...e,error:{issues:r.issues.map(e=>sd(e,n,Wu()))},input:e.value}),e.issues=[],e.fallback=!0),e)}}),cp=Y(`$ZodPipe`,(e,t)=>{gf.init(e,t),Ju(e._zod,`values`,()=>t.in._zod.values),Ju(e._zod,`optin`,()=>t.in._zod.optin),Ju(e._zod,`optout`,()=>t.out._zod.optout),Ju(e._zod,`propValues`,()=>t.in._zod.propValues),e._zod.parse=(e,n)=>{if(n.direction===`backward`){let r=t.out._zod.run(e,n);return r instanceof Promise?r.then(e=>lp(e,t.in,n)):lp(r,t.in,n)}let r=t.in._zod.run(e,n);return r instanceof Promise?r.then(e=>lp(e,t.out,n)):lp(r,t.out,n)}});function lp(e,t,n){return e.issues.length?(e.aborted=!0,e):t._zod.run({value:e.value,issues:e.issues,fallback:e.fallback},n)}var up=Y(`$ZodReadonly`,(e,t)=>{gf.init(e,t),Ju(e._zod,`propValues`,()=>t.innerType._zod.propValues),Ju(e._zod,`values`,()=>t.innerType._zod.values),Ju(e._zod,`optin`,()=>t.innerType?._zod?.optin),Ju(e._zod,`optout`,()=>t.innerType?._zod?.optout),e._zod.parse=(e,n)=>{if(n.direction===`backward`)return t.innerType._zod.run(e,n);let r=t.innerType._zod.run(e,n);return r instanceof Promise?r.then(dp):dp(r)}});function dp(e){return e.value=Object.freeze(e.value),e}var fp=Y(`$ZodCustom`,(e,t)=>{nf.init(e,t),gf.init(e,t),e._zod.parse=(e,t)=>e,e._zod.check=n=>{let r=n.value,i=t.fn(r);if(i instanceof Promise)return i.then(t=>pp(t,n,r,e));pp(i,n,r,e)}});function pp(e,t,n,r){if(!e){let e={code:`custom`,input:n,inst:r,path:[...r._zod.def.path??[]],continue:!r._zod.def.abort};r._zod.def.params&&(e.params=r._zod.def.params),t.issues.push(ld(e))}}var mp,hp=class{constructor(){this._map=new WeakMap,this._idmap=new Map}add(e,...t){let n=t[0];return this._map.set(e,n),n&&typeof n==`object`&&`id`in n&&this._idmap.set(n.id,e),this}clear(){return this._map=new WeakMap,this._idmap=new Map,this}remove(e){let t=this._map.get(e);return t&&typeof t==`object`&&`id`in t&&this._idmap.delete(t.id),this._map.delete(e),this}get(e){let t=e._zod.parent;if(t){let n={...this.get(t)??{}};delete n.id;let r={...n,...this._map.get(e)};return Object.keys(r).length?r:void 0}return this._map.get(e)}has(e){return this._map.has(e)}};function gp(){return new hp}(mp=globalThis).__zod_globalRegistry??(mp.__zod_globalRegistry=gp());var _p=globalThis.__zod_globalRegistry;function vp(e,t){return new e({type:`string`,...Z(t)})}function yp(e,t){return new e({type:`string`,format:`email`,check:`string_format`,abort:!1,...Z(t)})}function bp(e,t){return new e({type:`string`,format:`guid`,check:`string_format`,abort:!1,...Z(t)})}function xp(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,...Z(t)})}function Sp(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v4`,...Z(t)})}function Cp(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v6`,...Z(t)})}function wp(e,t){return new e({type:`string`,format:`uuid`,check:`string_format`,abort:!1,version:`v7`,...Z(t)})}function Tp(e,t){return new e({type:`string`,format:`url`,check:`string_format`,abort:!1,...Z(t)})}function Ep(e,t){return new e({type:`string`,format:`emoji`,check:`string_format`,abort:!1,...Z(t)})}function Dp(e,t){return new e({type:`string`,format:`nanoid`,check:`string_format`,abort:!1,...Z(t)})}function Op(e,t){return new e({type:`string`,format:`cuid`,check:`string_format`,abort:!1,...Z(t)})}function kp(e,t){return new e({type:`string`,format:`cuid2`,check:`string_format`,abort:!1,...Z(t)})}function Ap(e,t){return new e({type:`string`,format:`ulid`,check:`string_format`,abort:!1,...Z(t)})}function jp(e,t){return new e({type:`string`,format:`xid`,check:`string_format`,abort:!1,...Z(t)})}function Mp(e,t){return new e({type:`string`,format:`ksuid`,check:`string_format`,abort:!1,...Z(t)})}function Np(e,t){return new e({type:`string`,format:`ipv4`,check:`string_format`,abort:!1,...Z(t)})}function Pp(e,t){return new e({type:`string`,format:`ipv6`,check:`string_format`,abort:!1,...Z(t)})}function Fp(e,t){return new e({type:`string`,format:`cidrv4`,check:`string_format`,abort:!1,...Z(t)})}function Ip(e,t){return new e({type:`string`,format:`cidrv6`,check:`string_format`,abort:!1,...Z(t)})}function Lp(e,t){return new e({type:`string`,format:`base64`,check:`string_format`,abort:!1,...Z(t)})}function Rp(e,t){return new e({type:`string`,format:`base64url`,check:`string_format`,abort:!1,...Z(t)})}function zp(e,t){return new e({type:`string`,format:`e164`,check:`string_format`,abort:!1,...Z(t)})}function Bp(e,t){return new e({type:`string`,format:`jwt`,check:`string_format`,abort:!1,...Z(t)})}function Vp(e,t){return new e({type:`string`,format:`datetime`,check:`string_format`,offset:!1,local:!1,precision:null,...Z(t)})}function Hp(e,t){return new e({type:`string`,format:`date`,check:`string_format`,...Z(t)})}function Up(e,t){return new e({type:`string`,format:`time`,check:`string_format`,precision:null,...Z(t)})}function Wp(e,t){return new e({type:`string`,format:`duration`,check:`string_format`,...Z(t)})}function Gp(e,t){return new rf({check:`max_length`,...Z(t),maximum:e})}function Kp(e,t){return new af({check:`min_length`,...Z(t),minimum:e})}function qp(e,t){return new of({check:`length_equals`,...Z(t),length:e})}function Jp(e,t){return new cf({check:`string_format`,format:`regex`,...Z(t),pattern:e})}function Yp(e){return new lf({check:`string_format`,format:`lowercase`,...Z(e)})}function Xp(e){return new uf({check:`string_format`,format:`uppercase`,...Z(e)})}function Zp(e,t){return new df({check:`string_format`,format:`includes`,...Z(t),includes:e})}function Qp(e,t){return new ff({check:`string_format`,format:`starts_with`,...Z(t),prefix:e})}function $p(e,t){return new pf({check:`string_format`,format:`ends_with`,...Z(t),suffix:e})}function em(e){return new mf({check:`overwrite`,tx:e})}function tm(e){return em(t=>t.normalize(e))}function nm(){return em(e=>e.trim())}function rm(){return em(e=>e.toLowerCase())}function im(){return em(e=>e.toUpperCase())}function am(){return em(e=>Xu(e))}function om(e,t,n){return new e({type:`array`,element:t,...Z(n)})}function sm(e,t,n){return new e({type:`custom`,check:`custom`,fn:t,...Z(n)})}function cm(e,t){let n=lm(t=>(t.addIssue=e=>{if(typeof e==`string`)t.issues.push(ld(e,t.value,n._zod.def));else{let r=e;r.fatal&&(r.continue=!1),r.code??=`custom`,r.input??=t.value,r.inst??=n,r.continue??=!n._zod.def.abort,t.issues.push(ld(r))}},e(t.value,t)),t);return n}function lm(e,t){let n=new nf({check:`custom`,...Z(t)});return n._zod.check=e,n}function um(e){let t=e?.target??`draft-2020-12`;return t===`draft-4`&&(t=`draft-04`),t===`draft-7`&&(t=`draft-07`),{processors:e.processors??{},metadataRegistry:e?.metadata??_p,target:t,unrepresentable:e?.unrepresentable??`throw`,override:e?.override??(()=>{}),io:e?.io??`output`,counter:0,seen:new Map,cycles:e?.cycles??`ref`,reused:e?.reused??`inline`,external:e?.external??void 0}}function dm(e,t,n={path:[],schemaPath:[]}){var r;let i=e._zod.def,a=t.seen.get(e);if(a)return a.count++,n.schemaPath.includes(e)&&(a.cycle=n.path),a.schema;let o={schema:{},count:1,cycle:void 0,path:n.path};t.seen.set(e,o);let s=e._zod.toJSONSchema?.();if(s)o.schema=s;else{let r={...n,schemaPath:[...n.schemaPath,e],path:n.path};if(e._zod.processJSONSchema)e._zod.processJSONSchema(t,o.schema,r);else{let n=o.schema,a=t.processors[i.type];if(!a)throw Error(`[toJSONSchema]: Non-representable type encountered: ${i.type}`);a(e,t,n,r)}let a=e._zod.parent;a&&(o.ref||=a,dm(a,t,r),t.seen.get(a).isParent=!0)}let c=t.metadataRegistry.get(e);return c&&Object.assign(o.schema,c),t.io===`input`&&mm(e)&&(delete o.schema.examples,delete o.schema.default),t.io===`input`&&`_prefault`in o.schema&&((r=o.schema).default??(r.default=o.schema._prefault)),delete o.schema._prefault,t.seen.get(e).schema}function fm(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=new Map;for(let t of e.seen.entries()){let n=e.metadataRegistry.get(t[0])?.id;if(n){let e=r.get(n);if(e&&e!==t[0])throw Error(`Duplicate schema id "${n}" detected during JSON Schema conversion. Two different schemas cannot share the same id when converted together.`);r.set(n,t[0])}}let i=t=>{let r=e.target===`draft-2020-12`?`$defs`:`definitions`;if(e.external){let n=e.external.registry.get(t[0])?.id,i=e.external.uri??(e=>e);if(n)return{ref:i(n)};let a=t[1].defId??t[1].schema.id??`schema${e.counter++}`;return t[1].defId=a,{defId:a,ref:`${i(`__shared`)}#/${r}/${a}`}}if(t[1]===n)return{ref:`#`};let i=`#/${r}/`,a=t[1].schema.id??`__schema${e.counter++}`;return{defId:a,ref:i+a}},a=e=>{if(e[1].schema.$ref)return;let t=e[1],{ref:n,defId:r}=i(e);t.def={...t.schema},r&&(t.defId=r);let a=t.schema;for(let e in a)delete a[e];a.$ref=n};if(e.cycles===`throw`)for(let t of e.seen.entries()){let e=t[1];if(e.cycle)throw Error(`Cycle detected: #/${e.cycle?.join(`/`)}/<root>
Set the \`cycles\` parameter to \`"ref"\` to resolve cyclical schemas with defs.`)}for(let n of e.seen.entries()){let r=n[1];if(t===n[0]){a(n);continue}if(e.external){let r=e.external.registry.get(n[0])?.id;if(t!==n[0]&&r){a(n);continue}}if(e.metadataRegistry.get(n[0])?.id){a(n);continue}if(r.cycle){a(n);continue}if(r.count>1&&e.reused===`ref`){a(n);continue}}}function pm(e,t){let n=e.seen.get(t);if(!n)throw Error(`Unprocessed schema. This is a bug in Zod.`);let r=t=>{let n=e.seen.get(t);if(n.ref===null)return;let i=n.def??n.schema,a={...i},o=n.ref;if(n.ref=null,o){r(o);let n=e.seen.get(o),s=n.schema;if(s.$ref&&(e.target===`draft-07`||e.target===`draft-04`||e.target===`openapi-3.0`)?(i.allOf=i.allOf??[],i.allOf.push(s)):Object.assign(i,s),Object.assign(i,a),t._zod.parent===o)for(let e in i)e!==`$ref`&&e!==`allOf`&&(e in a||delete i[e]);if(s.$ref&&n.def)for(let e in i)e!==`$ref`&&e!==`allOf`&&e in n.def&&JSON.stringify(i[e])===JSON.stringify(n.def[e])&&delete i[e]}let s=t._zod.parent;if(s&&s!==o){r(s);let t=e.seen.get(s);if(t?.schema.$ref&&(i.$ref=t.schema.$ref,t.def))for(let e in i)e!==`$ref`&&e!==`allOf`&&e in t.def&&JSON.stringify(i[e])===JSON.stringify(t.def[e])&&delete i[e]}e.override({zodSchema:t,jsonSchema:i,path:n.path??[]})};for(let t of[...e.seen.entries()].reverse())r(t[0]);let i={};if(e.target===`draft-2020-12`?i.$schema=`https://json-schema.org/draft/2020-12/schema`:e.target===`draft-07`?i.$schema=`http://json-schema.org/draft-07/schema#`:e.target===`draft-04`?i.$schema=`http://json-schema.org/draft-04/schema#`:e.target,e.external?.uri){let n=e.external.registry.get(t)?.id;if(!n)throw Error("Schema is missing an `id` property");i.$id=e.external.uri(n)}Object.assign(i,n.def??n.schema);let a=e.metadataRegistry.get(t)?.id;a!==void 0&&i.id===a&&delete i.id;let o=e.external?.defs??{};for(let t of e.seen.entries()){let e=t[1];e.def&&e.defId&&(e.def.id===e.defId&&delete e.def.id,o[e.defId]=e.def)}e.external||Object.keys(o).length>0&&(e.target===`draft-2020-12`?i.$defs=o:i.definitions=o);try{let n=JSON.parse(JSON.stringify(i));return Object.defineProperty(n,"~standard",{value:{...t[`~standard`],jsonSchema:{input:gm(t,`input`,e.processors),output:gm(t,`output`,e.processors)}},enumerable:!1,writable:!1}),n}catch{throw Error(`Error converting schema to JSON.`)}}function mm(e,t){let n=t??{seen:new Set};if(n.seen.has(e))return!1;n.seen.add(e);let r=e._zod.def;if(r.type===`transform`)return!0;if(r.type===`array`)return mm(r.element,n);if(r.type===`set`)return mm(r.valueType,n);if(r.type===`lazy`)return mm(r.getter(),n);if(r.type===`promise`||r.type===`optional`||r.type===`nonoptional`||r.type===`nullable`||r.type===`readonly`||r.type==="default"||r.type===`prefault`)return mm(r.innerType,n);if(r.type===`intersection`)return mm(r.left,n)||mm(r.right,n);if(r.type===`record`||r.type===`map`)return mm(r.keyType,n)||mm(r.valueType,n);if(r.type===`pipe`)return e._zod.traits.has(`$ZodCodec`)?!0:mm(r.in,n)||mm(r.out,n);if(r.type===`object`){for(let e in r.shape)if(mm(r.shape[e],n))return!0;return!1}if(r.type===`union`){for(let e of r.options)if(mm(e,n))return!0;return!1}if(r.type===`tuple`){for(let e of r.items)if(mm(e,n))return!0;return!!(r.rest&&mm(r.rest,n))}return!1}var hm=(e,t={})=>n=>{let r=um({...n,processors:t});return dm(e,r),fm(r,e),pm(r,e)},gm=(e,t,n={})=>r=>{let{libraryOptions:i,target:a}=r??{},o=um({...i??{},target:a,io:t,processors:n});return dm(e,o),fm(o,e),pm(o,e)},_m={guid:`uuid`,url:`uri`,datetime:`date-time`,json_string:`json-string`,regex:``},vm=(e,t,n,r)=>{let i=n;i.type=`string`;let{minimum:a,maximum:o,format:s,patterns:c,contentEncoding:l}=e._zod.bag;if(typeof a==`number`&&(i.minLength=a),typeof o==`number`&&(i.maxLength=o),s&&(i.format=_m[s]??s,i.format===``&&delete i.format,s===`time`&&delete i.format),l&&(i.contentEncoding=l),c&&c.size>0){let e=[...c];e.length===1?i.pattern=e[0].source:e.length>1&&(i.allOf=[...e.map(e=>({...t.target===`draft-07`||t.target===`draft-04`||t.target===`openapi-3.0`?{type:`string`}:{},pattern:e.source}))])}},ym=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Custom types cannot be represented in JSON Schema`)},bm=(e,t,n,r)=>{if(t.unrepresentable===`throw`)throw Error(`Transforms cannot be represented in JSON Schema`)},xm=(e,t,n,r)=>{let i=n,a=e._zod.def,{minimum:o,maximum:s}=e._zod.bag;typeof o==`number`&&(i.minItems=o),typeof s==`number`&&(i.maxItems=s),i.type=`array`,i.items=dm(a.element,t,{...r,path:[...r.path,`items`]})},Sm=(e,t,n,r)=>{let i=e._zod.def,a=i.inclusive===!1,o=i.options.map((e,n)=>dm(e,t,{...r,path:[...r.path,a?`oneOf`:`anyOf`,n]}));a?n.oneOf=o:n.anyOf=o},Cm=(e,t,n,r)=>{let i=e._zod.def,a=dm(i.left,t,{...r,path:[...r.path,`allOf`,0]}),o=dm(i.right,t,{...r,path:[...r.path,`allOf`,1]}),s=e=>`allOf`in e&&Object.keys(e).length===1;n.allOf=[...s(a)?a.allOf:[a],...s(o)?o.allOf:[o]]},wm=(e,t,n,r)=>{let i=e._zod.def,a=dm(i.innerType,t,r),o=t.seen.get(e);t.target===`openapi-3.0`?(o.ref=i.innerType,n.nullable=!0):n.anyOf=[a,{type:`null`}]},Tm=(e,t,n,r)=>{let i=e._zod.def;dm(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Em=(e,t,n,r)=>{let i=e._zod.def;dm(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.default=JSON.parse(JSON.stringify(i.defaultValue))},Dm=(e,t,n,r)=>{let i=e._zod.def;dm(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,t.io===`input`&&(n._prefault=JSON.parse(JSON.stringify(i.defaultValue)))},Om=(e,t,n,r)=>{let i=e._zod.def;dm(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType;let o;try{o=i.catchValue(void 0)}catch{throw Error(`Dynamic catch values are not supported in JSON Schema`)}n.default=o},km=(e,t,n,r)=>{let i=e._zod.def,a=i.in._zod.traits.has(`$ZodTransform`),o=t.io===`input`?a?i.out:i.in:i.out;dm(o,t,r);let s=t.seen.get(e);s.ref=o},Am=(e,t,n,r)=>{let i=e._zod.def;dm(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType,n.readOnly=!0},jm=(e,t,n,r)=>{let i=e._zod.def;dm(i.innerType,t,r);let a=t.seen.get(e);a.ref=i.innerType},Mm=Y(`ZodISODateTime`,(e,t)=>{kf.init(e,t),ah.init(e,t)});function Nm(e){return Vp(Mm,e)}var Pm=Y(`ZodISODate`,(e,t)=>{Af.init(e,t),ah.init(e,t)});function Fm(e){return Hp(Pm,e)}var Im=Y(`ZodISOTime`,(e,t)=>{jf.init(e,t),ah.init(e,t)});function Lm(e){return Up(Im,e)}var Rm=Y(`ZodISODuration`,(e,t)=>{Mf.init(e,t),ah.init(e,t)});function zm(e){return Wp(Rm,e)}var Bm=Y(`ZodError`,(e,t)=>{dd.init(e,t),e.name=`ZodError`,Object.defineProperties(e,{format:{value:t=>md(e,t)},flatten:{value:t=>pd(e,t)},addIssue:{value:t=>{e.issues.push(t),e.message=JSON.stringify(e.issues,Gu,2)}},addIssues:{value:t=>{e.issues.push(...t),e.message=JSON.stringify(e.issues,Gu,2)}},isEmpty:{get(){return e.issues.length===0}}})},{Parent:Error}),Vm=hd(Bm),Hm=gd(Bm),Um=_d(Bm),Wm=yd(Bm),Gm=bd(Bm),Km=xd(Bm),qm=Sd(Bm),Jm=Cd(Bm),Ym=wd(Bm),Xm=Td(Bm),Zm=Ed(Bm),Qm=Dd(Bm),$m=new WeakMap;function eh(e,t,n){let r=Object.getPrototypeOf(e),i=$m.get(r);if(i||(i=new Set,$m.set(r,i)),!i.has(t)){i.add(t);for(let e in n){let t=n[e];Object.defineProperty(r,e,{configurable:!0,enumerable:!1,get(){let n=t.bind(this);return Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:n}),n},set(t){Object.defineProperty(this,e,{configurable:!0,writable:!0,enumerable:!0,value:t})}})}}}var th=Y(`ZodType`,(e,t)=>(gf.init(e,t),Object.assign(e[`~standard`],{jsonSchema:{input:gm(e,`input`),output:gm(e,`output`)}}),e.toJSONSchema=hm(e,{}),e.def=t,e.type=t.type,Object.defineProperty(e,"_def",{value:t}),e.parse=(t,n)=>Vm(e,t,n,{callee:e.parse}),e.safeParse=(t,n)=>Um(e,t,n),e.parseAsync=async(t,n)=>Hm(e,t,n,{callee:e.parseAsync}),e.safeParseAsync=async(t,n)=>Wm(e,t,n),e.spa=e.safeParseAsync,e.encode=(t,n)=>Gm(e,t,n),e.decode=(t,n)=>Km(e,t,n),e.encodeAsync=async(t,n)=>qm(e,t,n),e.decodeAsync=async(t,n)=>Jm(e,t,n),e.safeEncode=(t,n)=>Ym(e,t,n),e.safeDecode=(t,n)=>Xm(e,t,n),e.safeEncodeAsync=async(t,n)=>Zm(e,t,n),e.safeDecodeAsync=async(t,n)=>Qm(e,t,n),eh(e,`ZodType`,{check(...e){let t=this.def;return this.clone(Yu(t,{checks:[...t.checks??[],...e.map(e=>typeof e==`function`?{_zod:{check:e,def:{check:`custom`},onattach:[]}}:e)]}),{parent:!0})},with(...e){return this.check(...e)},clone(e,t){return nd(this,e,t)},brand(){return this},register(e,t){return e.add(this,t),this},refine(e,t){return this.check(Qh(e,t))},superRefine(e,t){return this.check($h(e,t))},overwrite(e){return this.check(em(e))},optional(){return Ph(this)},exactOptional(){return Ih(this)},nullable(){return Rh(this)},nullish(){return Ph(Rh(this))},nonoptional(e){return Wh(this,e)},array(){return Eh(this)},or(e){return Oh([this,e])},and(e){return Ah(this,e)},transform(e){return Jh(this,Mh(e))},default(e){return Bh(this,e)},prefault(e){return Hh(this,e)},catch(e){return Kh(this,e)},pipe(e){return Jh(this,e)},readonly(){return Xh(this)},describe(e){let t=this.clone();return _p.add(t,{description:e}),t},meta(...e){if(e.length===0)return _p.get(this);let t=this.clone();return _p.add(t,e[0]),t},isOptional(){return this.safeParse(void 0).success},isNullable(){return this.safeParse(null).success},apply(e){return e(this)}}),Object.defineProperty(e,"description",{get(){return _p.get(e)?.description},configurable:!0}),e)),nh=Y(`_ZodString`,(e,t)=>{_f.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>vm(e,t,n,r);let n=e._zod.bag;e.format=n.format??null,e.minLength=n.minimum??null,e.maxLength=n.maximum??null,eh(e,`_ZodString`,{regex(...e){return this.check(Jp(...e))},includes(...e){return this.check(Zp(...e))},startsWith(...e){return this.check(Qp(...e))},endsWith(...e){return this.check($p(...e))},min(...e){return this.check(Kp(...e))},max(...e){return this.check(Gp(...e))},length(...e){return this.check(qp(...e))},nonempty(...e){return this.check(Kp(1,...e))},lowercase(e){return this.check(Yp(e))},uppercase(e){return this.check(Xp(e))},trim(){return this.check(nm())},normalize(...e){return this.check(tm(...e))},toLowerCase(){return this.check(rm())},toUpperCase(){return this.check(im())},slugify(){return this.check(am())}})}),rh=Y(`ZodString`,(e,t)=>{_f.init(e,t),nh.init(e,t),e.email=t=>e.check(yp(oh,t)),e.url=t=>e.check(Tp(lh,t)),e.jwt=t=>e.check(Bp(wh,t)),e.emoji=t=>e.check(Ep(uh,t)),e.guid=t=>e.check(bp(sh,t)),e.uuid=t=>e.check(xp(ch,t)),e.uuidv4=t=>e.check(Sp(ch,t)),e.uuidv6=t=>e.check(Cp(ch,t)),e.uuidv7=t=>e.check(wp(ch,t)),e.nanoid=t=>e.check(Dp(dh,t)),e.guid=t=>e.check(bp(sh,t)),e.cuid=t=>e.check(Op(fh,t)),e.cuid2=t=>e.check(kp(ph,t)),e.ulid=t=>e.check(Ap(mh,t)),e.base64=t=>e.check(Lp(xh,t)),e.base64url=t=>e.check(Rp(Sh,t)),e.xid=t=>e.check(jp(hh,t)),e.ksuid=t=>e.check(Mp(gh,t)),e.ipv4=t=>e.check(Np(_h,t)),e.ipv6=t=>e.check(Pp(vh,t)),e.cidrv4=t=>e.check(Fp(yh,t)),e.cidrv6=t=>e.check(Ip(bh,t)),e.e164=t=>e.check(zp(Ch,t)),e.datetime=t=>e.check(Nm(t)),e.date=t=>e.check(Fm(t)),e.time=t=>e.check(Lm(t)),e.duration=t=>e.check(zm(t))});function ih(e){return vp(rh,e)}var ah=Y(`ZodStringFormat`,(e,t)=>{$.init(e,t),nh.init(e,t)}),oh=Y(`ZodEmail`,(e,t)=>{bf.init(e,t),ah.init(e,t)}),sh=Y(`ZodGUID`,(e,t)=>{vf.init(e,t),ah.init(e,t)}),ch=Y(`ZodUUID`,(e,t)=>{yf.init(e,t),ah.init(e,t)}),lh=Y(`ZodURL`,(e,t)=>{xf.init(e,t),ah.init(e,t)}),uh=Y(`ZodEmoji`,(e,t)=>{Sf.init(e,t),ah.init(e,t)}),dh=Y(`ZodNanoID`,(e,t)=>{Cf.init(e,t),ah.init(e,t)}),fh=Y(`ZodCUID`,(e,t)=>{wf.init(e,t),ah.init(e,t)}),ph=Y(`ZodCUID2`,(e,t)=>{Tf.init(e,t),ah.init(e,t)}),mh=Y(`ZodULID`,(e,t)=>{Ef.init(e,t),ah.init(e,t)}),hh=Y(`ZodXID`,(e,t)=>{Df.init(e,t),ah.init(e,t)}),gh=Y(`ZodKSUID`,(e,t)=>{Of.init(e,t),ah.init(e,t)}),_h=Y(`ZodIPv4`,(e,t)=>{Nf.init(e,t),ah.init(e,t)}),vh=Y(`ZodIPv6`,(e,t)=>{Pf.init(e,t),ah.init(e,t)}),yh=Y(`ZodCIDRv4`,(e,t)=>{Ff.init(e,t),ah.init(e,t)}),bh=Y(`ZodCIDRv6`,(e,t)=>{If.init(e,t),ah.init(e,t)}),xh=Y(`ZodBase64`,(e,t)=>{Rf.init(e,t),ah.init(e,t)}),Sh=Y(`ZodBase64URL`,(e,t)=>{Bf.init(e,t),ah.init(e,t)}),Ch=Y(`ZodE164`,(e,t)=>{Vf.init(e,t),ah.init(e,t)}),wh=Y(`ZodJWT`,(e,t)=>{Uf.init(e,t),ah.init(e,t)}),Th=Y(`ZodArray`,(e,t)=>{Gf.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>xm(e,t,n,r),e.element=t.element,eh(e,`ZodArray`,{min(e,t){return this.check(Kp(e,t))},nonempty(e){return this.check(Kp(1,e))},max(e,t){return this.check(Gp(e,t))},length(e,t){return this.check(qp(e,t))},unwrap(){return this.element}})});function Eh(e,t){return om(Th,e,t)}var Dh=Y(`ZodUnion`,(e,t)=>{qf.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Sm(e,t,n,r),e.options=t.options});function Oh(e,t){return new Dh({type:`union`,options:e,...Z(t)})}var kh=Y(`ZodIntersection`,(e,t)=>{Jf.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Cm(e,t,n,r)});function Ah(e,t){return new kh({type:`intersection`,left:e,right:t})}var jh=Y(`ZodTransform`,(e,t)=>{Zf.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>bm(e,t,n,r),e._zod.parse=(n,r)=>{if(r.direction===`backward`)throw new Hu(e.constructor.name);n.addIssue=r=>{if(typeof r==`string`)n.issues.push(ld(r,n.value,t));else{let t=r;t.fatal&&(t.continue=!1),t.code??=`custom`,t.input??=n.value,t.inst??=e,n.issues.push(ld(t))}};let i=t.transform(n.value,n);return i instanceof Promise?i.then(e=>(n.value=e,n.fallback=!0,n)):(n.value=i,n.fallback=!0,n)}});function Mh(e){return new jh({type:`transform`,transform:e})}var Nh=Y(`ZodOptional`,(e,t)=>{$f.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ph(e){return new Nh({type:`optional`,innerType:e})}var Fh=Y(`ZodExactOptional`,(e,t)=>{ep.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>jm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Ih(e){return new Fh({type:`optional`,innerType:e})}var Lh=Y(`ZodNullable`,(e,t)=>{tp.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>wm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Rh(e){return new Lh({type:`nullable`,innerType:e})}var zh=Y(`ZodDefault`,(e,t)=>{np.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Em(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeDefault=e.unwrap});function Bh(e,t){return new zh({type:`default`,innerType:e,get defaultValue(){return typeof t==`function`?t():ed(t)}})}var Vh=Y(`ZodPrefault`,(e,t)=>{ip.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Dm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Hh(e,t){return new Vh({type:`prefault`,innerType:e,get defaultValue(){return typeof t==`function`?t():ed(t)}})}var Uh=Y(`ZodNonOptional`,(e,t)=>{ap.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Tm(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Wh(e,t){return new Uh({type:`nonoptional`,innerType:e,...Z(t)})}var Gh=Y(`ZodCatch`,(e,t)=>{sp.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Om(e,t,n,r),e.unwrap=()=>e._zod.def.innerType,e.removeCatch=e.unwrap});function Kh(e,t){return new Gh({type:`catch`,innerType:e,catchValue:typeof t==`function`?t:()=>t})}var qh=Y(`ZodPipe`,(e,t)=>{cp.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>km(e,t,n,r),e.in=t.in,e.out=t.out});function Jh(e,t){return new qh({type:`pipe`,in:e,out:t})}var Yh=Y(`ZodReadonly`,(e,t)=>{up.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>Am(e,t,n,r),e.unwrap=()=>e._zod.def.innerType});function Xh(e){return new Yh({type:`readonly`,innerType:e})}var Zh=Y(`ZodCustom`,(e,t)=>{fp.init(e,t),th.init(e,t),e._zod.processJSONSchema=(t,n,r)=>ym(e,t,n,r)});function Qh(e,t={}){return sm(Zh,e,t)}function $h(e,t){return cm(e,t)}function eg({value:e,onChange:t}){let n=Ii(),[r,i]=(0,x.useState)(``),a=n.data??[],o=[...new Set([...a,...e])].sort(),s=n=>{e.includes(n)?t(e.filter(e=>e!==n)):t([...e,n].sort())};return(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsxs)(`label`,{className:`form-label`,children:[`MACHINES `,(0,I.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(pick targets; none = runs nowhere)`})]}),o.length===0?(0,I.jsx)(`div`,{className:`machine-empty`,children:`No machines known yet — add one below.`}):(0,I.jsx)(`div`,{className:`machine-chips`,children:o.map(t=>(0,I.jsx)(`button`,{type:`button`,className:e.includes(t)?`machine-chip on`:`machine-chip`,onClick:()=>s(t),children:t},t))}),(0,I.jsxs)(`div`,{className:`machine-add`,children:[(0,I.jsx)(`input`,{type:`text`,className:`form-input`,placeholder:`add a machine name`,autoComplete:`off`,spellCheck:!1,value:r,onChange:e=>i(e.target.value)}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>{let n=r.trim();n!==``&&!e.includes(n)&&t([...e,n].sort()),i(``)},children:`ADD`})]})]})}var tg=`Copy of `;function ng(e){return e.startsWith(tg)?e:`${tg}${e}`}function rg(e){return e.map(e=>{let t=[e.repository];return e.branch&&e.branch.trim()!==``&&t.push(e.branch),e.auto_pull===!1&&t.push(`auto_pull=false`),t.join(` `)}).join(`
`)}function ig(e){let t=[];for(let n of e.split(`
`)){let e=n.trim().split(/\s+/).filter(Boolean),r=e.shift();if(!r)continue;let i=e.findIndex(e=>e===`auto_pull=false`||e===`auto-pull=false`),a=i===-1;i!==-1&&e.splice(i,1),t.push({repository:r,branch:e[0]??null,auto_pull:a})}return t}function ag(e){return e.join(`, `)}function og(e){return e.split(`,`).map(e=>e.trim()).filter(e=>e!==``)}function sg(e){let t=e.trim();return t===``||!/^\d+$/.test(t)?null:Number(t)}var cg=[[`3600`,`1h`],[`86400`,`1d`],[`604800`,`7d`],[`2592000`,`30d`]];function lg(e){return e==null?`default`:e===0?`0s`:e%86400==0?`${e/86400}d`:e%3600==0?`${e/3600}h`:e%60==0?`${e/60}m`:`${e}s`}function ug({schedule:e,...t}){return t}var dg=ih().trim().min(1),fg=[`claude`,`codex`],pg=[[`@daily`,`@daily`],[`@hourly`,`@hourly`],[`@weekly`,`@weekly`],[`@monthly`,`@monthly`],[`0 0 9 * * 1-5 *`,`weekdays 9am`],[`0 0 * * * * *`,`every hour`]];function mg(e){let t=e?.schedules&&e.schedules.length>0?e.schedules:e?.schedule?[e.schedule]:[``];return{title:e?.title??``,schedules:t.map(e=>({expression:e})),agent:e?.agent??`claude`,model:e?.model??``,prompt:e?.prompt??``,goal:e?.goal??``,reposRaw:rg(e?.repositories??[]),machines:e?.machines??[],tagsRaw:ag(e?.tags??[]),ttlRaw:e?.ttl_secs==null?``:String(e.ttl_secs),enabled:e?.enabled??!0,power_saving_exempt:e?.power_saving_exempt??!1}}function hg({initial:e,mode:t,saving:n,onCancel:r,onSave:i}){let a=Ri(),o=a.data&&a.data.length>0?a.data:fg,{register:s,control:c,setValue:l,handleSubmit:u,reset:d}=zu({defaultValues:mg(e)}),{fields:f,append:p,remove:m}=ru({control:c,name:`schedules`});(0,x.useEffect)(()=>{d(mg(e))},[e]);let h=El({control:c,name:`title`}),g=El({control:c,name:`schedules`})??[],_=g.map(e=>e.expression.trim()).filter(Boolean),v=El({control:c,name:`agent`}),y=El({control:c,name:`prompt`}),b=El({control:c,name:`machines`}),S=dg.safeParse(h).success&&_.length>0&&dg.safeParse(v).success&&dg.safeParse(y).success,C=(e=``)=>{if(f.length===1&&(g[0]?.expression??``).trim()===``){l(`schedules.0.expression`,e);return}p({expression:e})},w=u(e=>{i({schedule:_[0]??``,schedules:_,title:e.title,agent:e.agent,model:e.model.trim()===``?null:e.model,prompt:e.prompt,goal:e.goal.trim()===``?null:e.goal,repositories:ig(e.reposRaw),machines:e.machines,enabled:e.enabled,power_saving_exempt:e.power_saving_exempt,ttl_secs:sg(e.ttlRaw),tags:og(e.tagsRaw)})}),T=t===`edit`,ee=n?`…`:T?`SAVE CHANGES`:`CREATE ROUTINE`,te=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsx)(`label`,{className:`form-label`,children:`TITLE*`}),(0,I.jsx)(`input`,{className:`form-input`,placeholder:`ops/nightly triage`,autoComplete:`off`,spellCheck:!1,...s(`title`)}),(0,I.jsx)(`div`,{className:`form-hint`,children:`Display name only. Use MOVE to change the filesystem folder.`})]}),(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsx)(`label`,{className:`form-label`,children:`SCHEDULES*`}),(0,I.jsx)(`div`,{className:`cron-schedule-list`,children:f.map((e,t)=>{let n=g[t]?.expression??``,[r,i]=za(n),a=n.trim()===``?`cron-preview`:r?`cron-preview ok`:`cron-preview bad`;return(0,I.jsxs)(`div`,{className:`cron-schedule-row`,children:[(0,I.jsxs)(`div`,{className:`cron-schedule-input`,children:[(0,I.jsx)(`input`,{className:`form-input`,placeholder:`cron expression`,"aria-label":`Cron expression ${t+1}`,...s(`schedules.${t}.expression`)}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,"aria-label":`Remove cron expression ${t+1}`,onClick:()=>m(t),children:`REMOVE`})]}),(0,I.jsx)(`div`,{className:a,children:i})]},e.id)})}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm add-cron-btn`,onClick:()=>C(),children:`+ ADD CRON EXPRESSION`}),(0,I.jsx)(`div`,{className:`cron-presets`,children:pg.map(([e,t])=>(0,I.jsx)(`button`,{type:`button`,className:`preset-btn`,onClick:()=>C(e),children:t},e))})]}),(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsx)(`label`,{className:`form-label`,children:`AGENT*`}),(0,I.jsx)(`select`,{className:`form-select`,...s(`agent`),children:o.map(e=>(0,I.jsx)(`option`,{value:e,children:e},e))})]}),(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsxs)(`label`,{className:`form-label`,children:[`MODEL `,(0,I.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(optional; blank = agent default)`})]}),(0,I.jsx)(`input`,{className:`form-input`,placeholder:`claude-sonnet-4-6`,...s(`model`)})]}),(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsx)(`label`,{className:`form-label`,children:`PROMPT*`}),(0,I.jsx)(`textarea`,{className:`form-textarea`,rows:6,placeholder:`Review open PRs and summarize…`,...s(`prompt`)})]}),(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsxs)(`label`,{className:`form-label`,children:[`GOAL `,(0,I.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(optional; ≤5 lines — the why)`})]}),(0,I.jsx)(`textarea`,{className:`form-textarea`,rows:3,placeholder:`Keep the PR backlog under control…`,...s(`goal`)})]}),(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsxs)(`label`,{className:`form-label`,children:[`REPOSITORIES `,(0,I.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(one url [branch] [auto_pull=false] per line)`})]}),(0,I.jsx)(`textarea`,{className:`form-textarea`,rows:3,placeholder:`https://github.com/org/repo main
https://github.com/org/pinned auto_pull=false`,...s(`reposRaw`)})]}),(0,I.jsx)(eg,{value:b,onChange:e=>l(`machines`,e)}),(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsxs)(`label`,{className:`form-label`,children:[`TAGS `,(0,I.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(comma-separated)`})]}),(0,I.jsx)(`input`,{className:`form-input`,placeholder:`triage, nightly`,...s(`tagsRaw`)})]}),(0,I.jsxs)(`div`,{className:`form-group`,children:[(0,I.jsxs)(`label`,{className:`form-label`,children:[`WORKBENCH TTL `,(0,I.jsx)(`span`,{style:{color:`var(--text-faint)`},children:`(seconds; blank = server default)`})]}),(0,I.jsx)(`input`,{className:`form-input`,type:`number`,min:0,placeholder:`604800`,...s(`ttlRaw`)}),(0,I.jsx)(`div`,{className:`ttl-presets`,children:cg.map(([e,t])=>(0,I.jsx)(`button`,{type:`button`,className:`preset-btn`,onClick:()=>l(`ttlRaw`,e),children:t},e))})]}),(0,I.jsxs)(`div`,{className:`toggle-row`,children:[(0,I.jsx)(`span`,{children:`ENABLED`}),(0,I.jsxs)(`label`,{className:`toggle`,children:[(0,I.jsx)(`input`,{type:`checkbox`,...s(`enabled`)}),(0,I.jsx)(`div`,{className:`toggle-track`})]})]}),(0,I.jsxs)(`div`,{className:`toggle-row`,children:[(0,I.jsx)(`span`,{title:`Allow this routine to launch while the host is on battery or Low Power Mode`,children:`POWER-SAVING EXEMPT`}),(0,I.jsxs)(`label`,{className:`toggle`,children:[(0,I.jsx)(`input`,{type:`checkbox`,...s(`power_saving_exempt`)}),(0,I.jsx)(`div`,{className:`toggle-track`})]})]})]}),E=(0,I.jsxs)(`div`,{className:`modal-ft`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:r,children:`CANCEL`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:n||!S,onClick:w,children:ee})]});return T?(0,I.jsx)(`div`,{className:`overlay open`,children:(0,I.jsxs)(`div`,{className:`dialog modal`,children:[(0,I.jsxs)(`div`,{className:`modal-hd`,children:[(0,I.jsx)(`div`,{className:`modal-title`,children:`EDIT ROUTINE`}),(0,I.jsx)(`button`,{type:`button`,className:`modal-x`,title:`Close`,"aria-label":`Close`,onClick:r,children:`✕`})]}),(0,I.jsx)(`div`,{className:`modal-body`,children:te}),E]})}):(0,I.jsxs)(`main`,{className:`create-page`,children:[(0,I.jsxs)(`div`,{className:`page-hd`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:r,children:`← BACK`}),(0,I.jsx)(`div`,{className:`page-title`,children:t===`clone`?`NEW ROUTINE (FROM CLONE)`:`NEW ROUTINE`})]}),(0,I.jsxs)(`div`,{className:`page-card card`,children:[(0,I.jsx)(`div`,{className:`modal-body`,children:te}),E]})]})}function gg(e){if(e===``)return[];let t=e.split(`
`);return t.length>0&&t[t.length-1]===``&&t.pop(),t}function _g(e,t){let n=t.trim().toLowerCase(),r=[],i=gg(e);for(let e=0;e<i.length;e++){let t=i[e]??``;(n===``||t.toLowerCase().includes(n))&&r.push([e+1,t])}return r}function vg(e,t){let n=gg(e),r=n.length,i=t.trim().toLowerCase();return i===``?[r,r]:[n.filter(e=>e.toLowerCase().includes(i)).length,r]}function yg(e,t){let n=t.trim().toLowerCase();if(n===``)return[[!1,e]];let r=Array.from(e),i=r.map(e=>e.toLowerCase()[0]??e),a=Array.from(n).length,o=[],s=0,c=0;for(;s<r.length;){let e=i.slice(s,s+a).join(``);e===n&&e.length>0?(s>c&&o.push([!1,r.slice(c,s).join(``)]),o.push([!0,r.slice(s,s+a).join(``)]),s+=a,c=s):s++}return c<r.length&&o.push([!1,r.slice(c).join(``)]),o}function bg({text:e,query:t}){return(0,I.jsx)(I.Fragment,{children:yg(e,t).map(([e,t],n)=>e?(0,I.jsx)(`mark`,{className:`log-hl`,children:t},n):(0,I.jsx)(`span`,{children:t},n))})}function xg({content:e,loading:t,err:n}){let[r,i]=(0,x.useState)(``),a=(0,x.useRef)(null);(0,x.useEffect)(()=>{let e=a.current;e&&(e.scrollTop=e.scrollHeight)},[e?.length]);let o=null;if(t)o=(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})});else if(n!==void 0)o=(0,I.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,n]});else if(e!==void 0){if(e===``)o=(0,I.jsx)(`div`,{className:`logs-empty`,children:`— no logs yet —`});else{let t=_g(e,r),[n,a]=vg(e,r),s=r.trim()===``?`${a} lines`:`${n} / ${a} matches`;o=(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`log-search`,children:[(0,I.jsx)(`input`,{type:`search`,className:`log-search-input`,placeholder:`Search logs…`,"aria-label":`Search log lines`,value:r,onChange:e=>i(e.target.value)}),r!==``&&(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Clear search`,"aria-label":`Clear search`,onClick:()=>i(``),children:`✕`}),(0,I.jsx)(`span`,{className:`log-match-count`,children:s})]}),(0,I.jsx)(`div`,{className:`log-lines`,children:t.map(([e,t])=>(0,I.jsxs)(`div`,{className:`log-line`,children:[(0,I.jsx)(`span`,{className:`log-ln`,children:e}),(0,I.jsx)(`span`,{className:`log-lc`,children:(0,I.jsx)(bg,{text:t,query:r})})]},e))})]})}}return(0,I.jsx)(`div`,{className:`logs-wrap`,ref:a,children:o})}function Sg(e){let t=e.map(e=>e.finished_at==null?null:Math.max(0,e.finished_at-e.started_at)),n=Math.max(1,...t.filter(e=>e!==null));return e.map((e,r)=>{let i=t[r]??null;return{workbench:e.workbench,startedAt:e.started_at,status:e.status,exitCode:e.exit_code,durationSecs:i,widthPct:i===null?4:Math.max(4,i/n*100)}})}function Cg({runs:e,selected:t,onSelect:n}){if(e.length===0)return null;let r=Sg(e);return(0,I.jsx)(`div`,{className:`duration-chart`,role:`list`,"aria-label":`Run duration chart`,children:r.map(e=>{let r=e.durationSecs===null?`in progress`:Ms(0,e.durationSecs),i=t===e.workbench;return(0,I.jsxs)(`button`,{type:`button`,role:`listitem`,className:`duration-row${i?` row-selected`:``}`,title:`${js(e.status)} · ${r} · ${Ha(e.startedAt)}${e.exitCode==null?``:` · exit ${e.exitCode}`}`,onClick:()=>n(e.workbench),children:[(0,I.jsx)(`span`,{className:`duration-row-time`,children:Ba(e.startedAt)}),(0,I.jsx)(`span`,{className:`duration-row-track`,children:(0,I.jsx)(`span`,{className:`duration-bar ${e.status}`,style:{width:`${e.widthPct}%`}})}),(0,I.jsx)(`span`,{className:`duration-row-dur`,children:r})]},e.workbench)})})}function wg({id:e,title:t,onBack:n}){let r=ra(e),[i,a]=(0,x.useState)(void 0),o=oa(e,i??``,i!==void 0),s=r.data??[],c=ts(),l=Math.floor(c/1e3);return(0,I.jsxs)(`main`,{className:`logs-page`,children:[(0,I.jsxs)(`div`,{className:`page-hd`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`← BACK`}),(0,I.jsxs)(`div`,{className:`page-title`,children:[`HISTORY / `,t]}),r.dataUpdatedAt>0&&(0,I.jsx)(`span`,{className:`page-freshness`,children:ls(Math.max(0,(c-r.dataUpdatedAt)/1e3))}),(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void r.refetch(),children:`↻`})]}),r.isLoading?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})}):r.isError?(0,I.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,r.error.message]}):s.length===0?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NO RUNS YET`})]})}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(Cg,{runs:s,selected:i,onSelect:e=>a(i===e?void 0:e)}),(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`table`,{children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{children:`STARTED`}),(0,I.jsx)(`th`,{children:`STATUS`}),(0,I.jsx)(`th`,{children:`DURATION`}),(0,I.jsx)(`th`,{children:`EXIT CODE`}),(0,I.jsx)(`th`,{children:`RETENTION`}),(0,I.jsx)(`th`,{})]})}),(0,I.jsx)(`tbody`,{children:s.map(t=>{let n=i===t.workbench;return(0,I.jsxs)(`tr`,{className:n?`row-selected`:``,children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(`div`,{className:`cell-time`,title:`${t.workbench} · ${Ha(t.started_at)}`,children:Ba(t.started_at)})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:As(t.status),children:js(t.status)})}),(0,I.jsx)(`td`,{children:t.finished_at==null?`—`:Ms(t.started_at,t.finished_at)}),(0,I.jsx)(`td`,{children:t.exit_code??`—`}),(0,I.jsx)(`td`,{children:t.retention_expires_at==null?`—`:(0,I.jsx)(`span`,{className:`cell-meta`,children:Ns(l,t.retention_expires_at)})}),(0,I.jsxs)(`td`,{children:[(0,I.jsx)(`button`,{type:`button`,className:`act-btn logs`,onClick:()=>a(n?void 0:t.workbench),children:n?`HIDE LOG`:`VIEW LOG`}),(0,I.jsx)(kn,{to:`/runs/${encodeURIComponent(e)}/${encodeURIComponent(t.workbench)}`,className:`act-btn`,children:`PERMALINK`})]})]},t.workbench)})})]})})]}),i!==void 0&&(0,I.jsx)(xg,{content:o.data,loading:o.isLoading,err:o.isError?o.error.message:void 0})]})}function Tg({id:e,title:t,onBack:n}){let r=us(),i=aa(e);return(0,x.useEffect)(()=>{let e=os(r);if(e===void 0)return;let t=window.setInterval(()=>void i.refetch(),e);return()=>window.clearInterval(t)},[r,e]),(0,I.jsxs)(`main`,{className:`logs-page`,children:[(0,I.jsxs)(`div`,{className:`page-hd`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:n,children:`← BACK`}),(0,I.jsxs)(`div`,{className:`page-title`,children:[`LOGS / `,t]}),(0,I.jsx)(fs,{updatedAtMs:i.dataUpdatedAt}),(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void i.refetch(),children:`↻`})]}),(0,I.jsx)(xg,{content:i.data,loading:i.isLoading,err:i.isError?i.error.message:void 0})]})}function Eg(e){return e?.trim()??``}function Dg(e){return e?.trim()??``}function Og(e,t){return e===``?t:`${e}/${t}`}function kg({routine:e,saving:t,onCancel:n,onConfirm:r}){let[i,a]=(0,x.useState)(Eg(e.folder)),[o,s]=(0,x.useState)(Dg(e.slug)),c=i.trim(),l=o.trim(),u=(0,x.useMemo)(()=>Og(c,l),[c,l]),d=(0,x.useMemo)(()=>Og(Eg(e.folder),Dg(e.slug)),[e.folder,e.slug]),f=c===Eg(e.folder)&&l===Dg(e.slug),p=l===``||l.includes(`/`)||l.includes(`\\`);return(0,I.jsx)(`div`,{className:`overlay`,onClick:n,children:(0,I.jsxs)(`div`,{className:`dialog move-dialog`,role:`dialog`,"aria-modal":`true`,"aria-labelledby":`move-dialog-title`,onClick:e=>e.stopPropagation(),children:[(0,I.jsxs)(`div`,{className:`move-dialog-hd`,children:[(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`div`,{id:`move-dialog-title`,className:`dialog-title move-dialog-title`,children:`FOLDER MANAGEMENT`}),(0,I.jsx)(`div`,{className:`move-dialog-sub`,children:`Move routine files without changing the display title.`})]}),(0,I.jsx)(`div`,{className:`move-dialog-badge`,children:`FILES`})]}),(0,I.jsxs)(`div`,{className:`move-current-card`,"aria-label":`Current path ${d}`,children:[(0,I.jsx)(`div`,{className:`move-current-label`,children:`CURRENT LOCATION`}),(0,I.jsxs)(`div`,{className:`move-current-row`,children:[(0,I.jsx)(`span`,{className:`routine-fs-icon`,"aria-hidden":`true`,children:`📄`}),(0,I.jsxs)(`div`,{className:`move-current-copy`,children:[(0,I.jsx)(`strong`,{children:e.title}),(0,I.jsx)(`span`,{children:d||`root`})]})]})]}),(0,I.jsxs)(`div`,{className:`move-path-grid`,children:[(0,I.jsxs)(`div`,{className:`form-group move-form-group`,children:[(0,I.jsx)(`label`,{className:`form-label`,htmlFor:`move-folder`,children:`FOLDER`}),(0,I.jsx)(`input`,{id:`move-folder`,className:`form-input move-input`,placeholder:`maintenance`,autoComplete:`off`,spellCheck:!1,value:i,onChange:e=>a(e.target.value)}),(0,I.jsx)(`div`,{className:`form-hint`,children:`Blank keeps the routine at root. Use / for nested folders.`})]}),(0,I.jsxs)(`div`,{className:`form-group move-form-group`,children:[(0,I.jsx)(`label`,{className:`form-label`,htmlFor:`move-slug`,children:`SLUG*`}),(0,I.jsx)(`input`,{id:`move-slug`,className:`form-input move-input`,placeholder:`daily-maintenance-digest`,autoComplete:`off`,spellCheck:!1,value:o,onChange:e=>s(e.target.value)}),(0,I.jsx)(`div`,{className:`form-hint`,children:`One path segment only. Title remains display-only.`})]})]}),(0,I.jsxs)(`div`,{className:`move-preview`,"aria-label":`Destination path routines/${u||`…`}/routine.toml`,children:[(0,I.jsx)(`div`,{className:`move-preview-label`,children:`DESTINATION PREVIEW`}),(0,I.jsxs)(`div`,{className:`move-preview-path`,children:[`routines/`,u||`…`,`/routine.toml`]})]}),(0,I.jsxs)(`div`,{className:`dialog-actions move-dialog-actions`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:n,children:`CANCEL`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:t||p||f,onClick:()=>r(c===``?void 0:c,l),children:t?`MOVING…`:`MOVE`})]})]})})}var Ag=c(m(),1),jg=6,Mg=2,Ng=14,Pg={running:`var(--warn)`,success:`var(--ok)`,failed:`var(--err)`,unknown:`var(--text-faint)`};function Fg({runs:e}){if(e.length===0)return(0,I.jsx)(`span`,{className:`spark-empty muted`,children:`—`});let t=e.length*jg-Mg;return(0,I.jsx)(`svg`,{className:`spark`,role:`img`,"aria-label":`Last ${e.length} runs`,width:t,height:Ng,viewBox:`0 0 ${t} ${Ng}`,children:e.map((e,t)=>(0,I.jsx)(`rect`,{x:t*jg,y:0,width:4,height:Ng,rx:1,fill:Pg[e.status],className:`spark-tick ${e.status}`,children:(0,I.jsx)(`title`,{children:`${js(e.status)} · ${Ba(e.started_at)} (${Ha(e.started_at)})`})},`${e.workbench}-${t}`))})}function Ig({routine:e,now:t}){if(!e.enabled)return(0,I.jsx)(`span`,{className:`cell-next muted`,children:`paused`});if(bc(e,t)){let n=xc(e,t);return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:`cell-next muted`,children:`snoozed`}),n!==``&&(0,I.jsx)(`div`,{className:`cell-next-until muted`,children:n})]})}let n=bo(yo(e),t);if(n===void 0)return(0,I.jsx)(`span`,{className:`cell-next muted`,children:`—`});let r=n.getTime()-t.getTime()<=ec;return(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`cell-next-when`,children:To(t,n)}),(0,I.jsx)(`div`,{className:r?`cell-next-until soon`:`cell-next-until`,children:Co(t,n)})]})}function Lg({routine:e,now:t,runs:n,selected:r,onSelect:i,onEdit:a,onClone:o,onDelete:s,onMove:c,onToggle:l,onTrigger:u,onLogs:d,onHistory:f,onFlags:p}){let[m,h]=(0,x.useState)(!1),[g,_]=(0,x.useState)(!1),[v,y]=(0,x.useState)({}),b=(0,x.useRef)(null),S=(0,x.useRef)(null),C=yo(e),w=(e.schedule_descriptions??[e.schedule_description]).filter(Boolean).join(` · `)||`—`,T=Ba(e.updated_at),ee=e.repositories??[],te=(e.machines??[]).filter(e=>e.trim()!==``),E=e.tags??[],D=e.goal?.trim()?e.goal.split(`
`)[0]:void 0,ne=mc(e),re=e.last_manual_trigger_at!=null&&(e.last_scheduled_trigger_at==null||e.last_manual_trigger_at>=e.last_scheduled_trigger_at),ie=Sc(e,t),ae=Cc(e);(0,x.useEffect)(()=>{if(!g)return;let e=e=>{let t=e.target;b.current?.contains(t)||S.current?.contains(t)||_(!1)},t=e=>{e.key===`Escape`&&_(!1)};return document.addEventListener(`mousedown`,e),document.addEventListener(`keydown`,t),()=>{document.removeEventListener(`mousedown`,e),document.removeEventListener(`keydown`,t)}},[g]);let O=()=>_(!1),oe=()=>{if(g){_(!1);return}let e=b.current?.getBoundingClientRect();if(e!==void 0){let t=e.bottom+6+260<=window.innerHeight;y({left:Math.max(8,Math.min(e.right-168,window.innerWidth-168-8)),top:t?e.bottom+6:Math.max(8,e.top-260-6)})}_(!0)},k=g?(0,Ag.createPortal)((0,I.jsxs)(`div`,{className:`actions-menu`,id:`routine-actions-${e.id}`,ref:S,role:`menu`,style:v,children:[(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{O(),d(e.id)},children:`Logs`}),(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{O(),f(e.id)},children:`History`}),(0,I.jsxs)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{O(),p(e.id)},children:[`Flags`,(e.flag_count??0)>0&&(0,I.jsx)(`span`,{className:`flag-badge`,children:e.flag_count})]}),(0,I.jsx)(`div`,{className:`actions-menu-sep`,role:`separator`}),(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{O(),a(e.id)},children:`Edit`}),(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{O(),c(e.id)},children:`Move folder`}),(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item`,onClick:()=>{O(),o(e.id)},children:`Clone`}),(0,I.jsx)(`div`,{className:`actions-menu-sep`,role:`separator`}),(0,I.jsx)(`button`,{type:`button`,role:`menuitem`,className:`actions-menu-item danger`,onClick:()=>{O(),s(e.id,e.title)},children:`Delete`})]}),document.body):null;return(0,I.jsxs)(`tr`,{className:r?`row-selected`:``,children:[(0,I.jsx)(`td`,{className:`col-select`,"data-label":`Select`,children:(0,I.jsx)(`input`,{type:`checkbox`,checked:r,onChange:()=>i(e.id),"aria-label":`Select ${e.title}`})}),(0,I.jsxs)(`td`,{className:`routine-title-cell`,"data-label":`Title`,children:[(0,I.jsx)(`div`,{className:`cell-schedule`,title:e.title,children:(0,I.jsx)(Rg,{title:e.title})}),(0,I.jsx)(`div`,{className:`cell-goal`,title:e.rel_path,children:e.folder?`/${e.folder}/${e.slug}`:`/${e.slug}`}),D!==void 0&&(0,I.jsx)(`div`,{className:`cell-goal`,title:e.goal??``,children:D})]}),(0,I.jsxs)(`td`,{className:`routine-schedule-cell`,"data-label":`Schedule`,children:[(0,I.jsx)(`div`,{className:`cell-schedule`,children:C.join(`
`)}),(0,I.jsx)(`div`,{className:`cell-schedule-human`,children:w}),(0,I.jsx)(`button`,{type:`button`,className:m?`sched-preview-btn open`:`sched-preview-btn`,"aria-expanded":m,onClick:e=>{e.stopPropagation(),h(e=>!e)},children:`▸ fires`}),m&&(0,I.jsx)(zg,{schedules:C,now:t})]}),(0,I.jsx)(`td`,{"data-label":`Next run`,children:(0,I.jsx)(Ig,{routine:e,now:t})}),(0,I.jsx)(`td`,{"data-label":`Last fire`,children:ne===void 0?(0,I.jsx)(`span`,{className:`muted`,children:`—`}):(0,I.jsxs)(`div`,{className:`cell-triggered`,children:[re?`↻`:`⏱`,` `,Ba(ne)]})}),(0,I.jsx)(`td`,{"data-label":`Run history`,children:(0,I.jsx)(Fg,{runs:n})}),(0,I.jsxs)(`td`,{"data-label":`Agent`,children:[(0,I.jsxs)(`span`,{className:`cell-handler`,title:e.agent_registered?`agent registered`:`agent config missing`,children:[(0,I.jsx)(`span`,{className:e.agent_registered?`handler-dot ok`:`handler-dot warn`}),e.agent]}),e.model&&(0,I.jsx)(`div`,{className:`cell-goal`,children:e.model})]}),(0,I.jsx)(`td`,{"data-label":`Repos`,children:ee.length===0?`—`:(0,I.jsx)(`span`,{title:ee.map(e=>e.repository).join(`
`),children:ee.length})}),(0,I.jsx)(`td`,{"data-label":`Machines`,className:te.length===0?`cell-meta cell-no-machines`:`cell-meta`,children:te.length===0?`—`:(0,I.jsx)(`span`,{title:te.join(`
`),children:te.length})}),(0,I.jsx)(`td`,{"data-label":`Tags`,children:E.length===0?`—`:(0,I.jsx)(`span`,{title:E.join(`, `),children:E.join(`, `)})}),(0,I.jsx)(`td`,{"data-label":`TTL`,children:(0,I.jsx)(`span`,{className:`cell-meta`,title:`workbench retention for finished runs`,children:lg(e.ttl_secs)})}),(0,I.jsxs)(`td`,{"data-label":`Health`,children:[(0,I.jsx)(`span`,{className:vc(ie),title:yc(e,ie),children:_c(ie)}),e.power_saving_exempt&&(0,I.jsx)(`div`,{className:`failure-chip low`,title:`Runs even when system power saving is active`,children:`EXEMPT`}),ae!==`none`&&(0,I.jsxs)(`div`,{className:`failure-chip ${ae}`,title:`${e.consecutive_failures} consecutive failure(s) — auto-disables at ${e.failure_threshold}`,children:[e.consecutive_failures,`/`,e.failure_threshold]})]}),(0,I.jsx)(`td`,{"data-label":`Enabled`,children:(0,I.jsxs)(`label`,{className:`toggle`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:t=>l(e.id,t.target.checked)}),(0,I.jsx)(`div`,{className:`toggle-track`})]})}),(0,I.jsx)(`td`,{"data-label":`Updated`,children:(0,I.jsx)(`div`,{className:`cell-time`,title:Ha(e.updated_at),children:T})}),(0,I.jsx)(`td`,{className:`routine-actions-cell`,"data-label":`Actions`,children:(0,I.jsxs)(`div`,{className:`row-actions`,children:[(0,I.jsx)(`button`,{type:`button`,className:`act-btn run`,title:wc(e),"aria-label":`Run now`,disabled:!e.enabled||e.power_saving,onClick:()=>u(e.id),children:`RUN`}),(0,I.jsxs)(`div`,{className:`actions-menu-root`,ref:b,children:[(0,I.jsx)(`button`,{type:`button`,className:`act-btn actions-menu-trigger`,"aria-haspopup":`menu`,"aria-expanded":g,"aria-controls":`routine-actions-${e.id}`,onClick:oe,children:`ACTIONS ▾`}),k]})]})})]})}function Rg({title:e}){let t=e.split(`/`).filter(Boolean);return t.length<=1?(0,I.jsx)(I.Fragment,{children:e}):(0,I.jsx)(`span`,{className:`cell-title-path`,children:t.map((e,n)=>(0,I.jsxs)(`span`,{children:[n>0&&(0,I.jsx)(`span`,{className:`cell-title-sep`,children:`/`}),(0,I.jsx)(`span`,{className:n===t.length-1?`cell-title-leaf`:`cell-title-folder`,children:e})]},`${e}-${n}`))})}function zg({schedules:e,now:t}){let n=xo(e,t,10);return n.length===0?(0,I.jsx)(`div`,{className:`fires-panel`,children:(0,I.jsx)(`div`,{className:`fires-empty`,children:`— no future fires —`})}):(0,I.jsxs)(`div`,{className:`fires-panel`,children:[(0,I.jsx)(`div`,{className:`fires-hd`,children:`NEXT 10 FIRES`}),n.map((e,n)=>(0,I.jsxs)(`div`,{className:`fires-item`,children:[(0,I.jsx)(`span`,{className:`fires-when`,children:To(t,e)}),(0,I.jsx)(`span`,{className:`fires-until`,children:Co(t,e)})]},n))]})}function Bg(e){let t=e.slug?.trim()||e.title.trim()||e.id,n=e.folder?.trim();return n?`${n}/${t}`:t}function Vg(e){let t={name:``,path:``,folders:new Map,routines:[]};for(let n of e){let e=(n.folder??``).split(`/`).map(e=>e.trim()).filter(Boolean),r=t;for(let t of e){let e=r.path===``?t:`${r.path}/${t}`,n=r.folders.get(t);n===void 0&&(n={name:t,path:e,folders:new Map,routines:[]},r.folders.set(t,n)),r=n}r.routines.push(n)}return Hg(t),t}function Hg(e){e.routines.sort((e,t)=>Bg(e).localeCompare(Bg(t))||e.id.localeCompare(t.id));for(let t of e.folders.values())Hg(t)}function Ug(e){return[...e.folders.values()].sort((e,t)=>e.name.localeCompare(t.name))}function Wg(e){return{"--depth":e}}function Gg({routines:e,loading:t,filterActive:n,now:r,onClearFilters:i,...a}){let o=(0,x.useMemo)(()=>Vg(e),[e]),[s,c]=(0,x.useState)(new Set),l=e=>{c(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n})};return t?(0,I.jsx)(`div`,{className:`routine-fs-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})}):e.length===0?(0,I.jsx)(`div`,{className:`routine-fs-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:n?`⊘`:`⧗`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:n?`NO ROUTINES MATCH`:`NO ROUTINES SCHEDULED`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:n?(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:i,children:`CLEAR FILTERS`}):`press + NEW ROUTINE to create one`})]})}):(0,I.jsxs)(`div`,{className:`routine-fs-wrap`,children:[(0,I.jsxs)(`div`,{className:`routine-fs-summary`,children:[e.length,` routine(s) shown by filesystem location`]}),(0,I.jsxs)(`div`,{className:`routine-fs-tree`,role:`tree`,"aria-label":`Routine filesystem`,children:[o.routines.map(e=>(0,I.jsx)(Jg,{routine:e,now:r,depth:0,...a},e.id)),Ug(o).map(e=>(0,I.jsx)(Kg,{node:e,now:r,depth:0,collapsed:s,onToggle:l,actions:a},e.path))]})]})}function Kg({node:e,now:t,depth:n,collapsed:r,onToggle:i,actions:a}){let o=r.has(e.path),s=qg(e);return(0,I.jsxs)(`div`,{className:`routine-fs-branch`,children:[(0,I.jsx)(`div`,{className:`routine-fs-folder`,role:`treeitem`,"aria-expanded":!o,"aria-label":`${e.name} folder, ${s} routine${s===1?``:`s`}`,style:Wg(n),children:(0,I.jsxs)(`button`,{type:`button`,className:`routine-fs-folder-toggle`,"aria-label":`${o?`Expand`:`Collapse`} ${e.name} folder`,onClick:()=>i(e.path),children:[(0,I.jsx)(`span`,{className:`routine-fs-caret`,children:o?`▸`:`▾`}),(0,I.jsx)(`span`,{className:`routine-fs-icon`,children:`📁`}),(0,I.jsx)(`span`,{className:`routine-fs-folder-name`,children:e.name}),(0,I.jsx)(`span`,{className:`routine-fs-count`,children:s})]})}),!o&&(0,I.jsxs)(`div`,{role:`group`,children:[e.routines.map(e=>(0,I.jsx)(Jg,{routine:e,now:t,depth:n+1,...a},e.id)),Ug(e).map(e=>(0,I.jsx)(Kg,{node:e,now:t,depth:n+1,collapsed:r,onToggle:i,actions:a},e.path))]})]})}function qg(e){let t=e.routines.length;for(let n of e.folders.values())t+=qg(n);return t}function Jg({routine:e,now:t,depth:n,onEdit:r,onClone:i,onDelete:a,onMove:o,onToggle:s,onTrigger:c,onLogs:l,onHistory:u,onFlags:d}){let f=Bg(e),p=Sc(e,t),m=yo(e);return(0,I.jsxs)(`div`,{className:`routine-fs-file`,role:`treeitem`,"aria-label":`${f} routine`,style:Wg(n),children:[(0,I.jsxs)(`div`,{className:`routine-fs-file-main`,children:[(0,I.jsx)(`span`,{className:`routine-fs-icon`,children:`📄`}),(0,I.jsxs)(`div`,{className:`routine-fs-file-copy`,children:[(0,I.jsx)(`div`,{className:`routine-fs-file-title`,children:e.title}),(0,I.jsx)(`div`,{className:`routine-fs-file-path`,title:e.rel_path,children:f})]})]}),(0,I.jsxs)(`div`,{className:`routine-fs-meta`,children:[(0,I.jsx)(`span`,{children:m.join(` · `)}),(0,I.jsx)(Ig,{routine:e,now:t})]}),(0,I.jsxs)(`div`,{className:`routine-fs-status`,children:[(0,I.jsx)(`span`,{className:vc(p),title:yc(e,p),children:_c(p)}),(0,I.jsxs)(`label`,{className:`toggle`,children:[(0,I.jsx)(`input`,{type:`checkbox`,checked:e.enabled,onChange:t=>s(e.id,t.target.checked)}),(0,I.jsx)(`div`,{className:`toggle-track`})]})]}),(0,I.jsxs)(`div`,{className:`routine-fs-actions`,children:[(0,I.jsx)(`button`,{type:`button`,className:`act-btn run`,"aria-label":`Run now`,title:wc(e),disabled:!e.enabled||e.power_saving,onClick:()=>c(e.id),children:`RUN`}),(0,I.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>l(e.id),children:`Logs`}),(0,I.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>u(e.id),children:`History`}),(0,I.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>d(e.id),children:`Flags`}),(0,I.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>r(e.id),children:`Edit`}),(0,I.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>o(e.id),children:`Move folder`}),(0,I.jsx)(`button`,{type:`button`,className:`act-btn`,onClick:()=>i(e.id),children:`Clone`}),(0,I.jsx)(`button`,{type:`button`,className:`act-btn danger`,onClick:()=>a(e.id,e.title),children:`Delete`})]})]})}var Yg=`moadim.routines.collapsedGroups`;function Xg(){try{let e=localStorage.getItem(Yg);if(!e)return new Set;let t=JSON.parse(e);return Array.isArray(t)?new Set(t.filter(e=>typeof e==`string`)):new Set}catch{return new Set}}function Zg(e){try{localStorage.setItem(Yg,JSON.stringify([...e]))}catch{}}function Qg({label:e,col:t,current:n,dir:r,onSort:i}){let a=n===t;return(0,I.jsxs)(`th`,{className:a?`th-sort th-sort-active`:`th-sort`,onClick:()=>i(t),children:[e,a?r===`asc`?` ▲`:` ▼`:``]})}function $g(e){let{routines:t,loading:n,filterActive:r,onClearFilters:i}=e,[a,o]=(0,x.useState)(Xg),s=e=>{o(t=>{let n=new Set(t);return n.delete(e)||n.add(e),Zg(n),n})},c=e=>{let t=new Set(e);Zg(t),o(t)};if(n)return(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})});if(t.length===0)return(0,I.jsx)(`div`,{className:`table-wrap`,children:r?(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⊘`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NO ROUTINES MATCH`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:i,children:`CLEAR FILTERS`})})]}):(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NO ROUTINES SCHEDULED`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:`press + NEW ROUTINE to create one`})]})});let l=t.length>0&&t.every(t=>e.selected.has(t.id)),u=Vc(t,e.groupBy),d=t=>`${e.groupBy}:${t}`;return(0,I.jsxs)(`div`,{className:`table-wrap`,children:[e.groupBy!==`none`&&u.length>1&&(0,I.jsxs)(`div`,{className:`group-controls`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>c(u.map(([e])=>d(e))),children:`COLLAPSE ALL`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>c([]),children:`EXPAND ALL`})]}),(0,I.jsxs)(`table`,{className:`routine-table`,children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{className:`col-select`,children:(0,I.jsx)(`input`,{type:`checkbox`,checked:l,onChange:e.onSelectAll,"aria-label":`Select all visible routines`,title:`Select all visible`})}),(0,I.jsx)(Qg,{label:`TITLE`,col:`title`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,I.jsx)(`th`,{children:`SCHEDULE`}),(0,I.jsx)(Qg,{label:`NEXT RUN`,col:`next_run`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,I.jsx)(Qg,{label:`LAST FIRE`,col:`last_fire`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,I.jsx)(`th`,{children:`RUN HISTORY`}),(0,I.jsx)(Qg,{label:`AGENT`,col:`agent`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,I.jsx)(`th`,{children:`REPOS`}),(0,I.jsx)(`th`,{children:`MACHINES`}),(0,I.jsx)(`th`,{children:`TAGS`}),(0,I.jsx)(`th`,{children:`TTL`}),(0,I.jsx)(Qg,{label:`HEALTH`,col:`health`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,I.jsx)(Qg,{label:`ENABLED`,col:`enabled`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,I.jsx)(Qg,{label:`UPDATED`,col:`updated`,current:e.sortCol,dir:e.sortDir,onSort:e.onSort}),(0,I.jsx)(`th`,{})]})}),(0,I.jsx)(`tbody`,{children:u.map(([t,n])=>{let r=d(t),i=e.groupBy!==`none`&&a.has(r),o=Bc(n,e.now);return(0,I.jsxs)(x.Fragment,{children:[e.groupBy!==`none`&&(0,I.jsx)(`tr`,{className:`group-hd`,children:(0,I.jsx)(`td`,{colSpan:15,"data-label":`Group`,children:(0,I.jsxs)(`div`,{className:`group-hd-row`,children:[(0,I.jsxs)(`button`,{type:`button`,className:`group-hd-toggle`,onClick:()=>s(r),"aria-expanded":!i,children:[(0,I.jsx)(`span`,{className:`group-caret`,children:i?`▶`:`▼`}),(0,I.jsx)(`span`,{className:`group-label`,children:t}),(0,I.jsxs)(`span`,{className:`group-count`,children:[`(`,n.length,`)`]})]}),(0,I.jsx)(`span`,{className:`group-health-chips`,children:hc.filter(e=>(o.get(e)??0)>0).map(e=>(0,I.jsx)(`span`,{className:`${vc(e)} chip`,children:o.get(e)},e))})]})})},`hd-${t}`),!i&&n.map(t=>(0,I.jsx)(Lg,{routine:t,now:e.now,runs:e.runHistory.get(t.id)??[],selected:e.selected.has(t.id),onSelect:e.onSelect,onEdit:e.onEdit,onClone:e.onClone,onDelete:e.onDelete,onMove:e.onMove,onToggle:e.onToggle,onTrigger:e.onTrigger,onLogs:e.onLogs,onHistory:e.onHistory,onFlags:e.onFlags},t.id))]},`grp-${t}`)})})]})]})}var e_=`moadim.routines.saved_views`,t_=`moadim.routines.last_view`;function n_(e,t,n,r){return{query:e.query,status:e.status,agent:ic(e.agent),machine:cc(e.machine),repository:ic(e.repository),tag:ic(e.tag),sortCol:t,sortDir:n,groupBy:r}}function r_(e){return{filter:{query:e.query,status:nc(e.status),agent:ac(e.agent),machine:lc(e.machine),repository:ac(e.repository),tag:ac(e.tag)},sortCol:e.sortCol===void 0?void 0:Mc(e.sortCol),sortDir:Pc(e.sortDir),groupBy:Ic(e.groupBy)}}function i_(e){try{let t=window.localStorage.getItem(e);return t===null?void 0:JSON.parse(t)}catch{return}}function a_(e,t){try{window.localStorage.setItem(e,JSON.stringify(t))}catch{}}function o_(){return i_(e_)??[]}function s_(e){a_(e_,e)}function c_(){return i_(t_)}function l_(e){a_(t_,e)}function u_({views:e,onApply:t,onSave:n,onDelete:r}){let{addToast:i}=Xa(),[a,o]=(0,x.useState)(!1),[s,c]=(0,x.useState)(``),[l,u]=(0,x.useState)(``),d=n=>{let r=e.find(e=>e.name===n);r&&t(r.snapshot),u(n)};return(0,I.jsx)(`div`,{className:`filter-bar saved-views-bar`,children:(0,I.jsxs)(`div`,{className:`filter-field`,children:[(0,I.jsx)(`span`,{className:`filter-label`,children:`VIEWS`}),(0,I.jsxs)(`select`,{className:`filter-select`,"aria-label":`Saved views`,value:l,onChange:e=>d(e.target.value),children:[(0,I.jsx)(`option`,{value:``,children:`— select —`}),e.map(e=>(0,I.jsx)(`option`,{value:e.name,children:e.name},e.name))]}),a?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`input`,{type:`text`,className:`filter-input`,placeholder:`View name…`,"aria-label":`New view name`,value:s,onChange:e=>c(e.target.value)}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,disabled:s.trim()===``,onClick:()=>{let e=s.trim();e!==``&&(n(e),u(e),o(!1))},children:`SAVE`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,onClick:()=>o(!1),children:`CANCEL`})]}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Save current filters, sort, and grouping as a named view`,onClick:()=>{o(!0),c(``)},children:`☆ SAVE VIEW`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Copy a shareable link to this filtered/sorted/grouped view`,onClick:()=>{navigator.clipboard.writeText(window.location.href).then(()=>i(`Link copied — includes current filters, sort, and grouping`,`ok`)).catch(()=>i(`Copy failed`,`err`))},children:`🔗 COPY LINK`}),l!==``&&(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Delete this saved view`,onClick:()=>{l!==``&&(r(l),u(``))},children:`DELETE`})]})]})})}function d_(e){let t=new Map;for(let n of e){let e=t.get(n.routine_id);e||(e=[],t.set(n.routine_id,e)),e.length<10&&e.push(n)}for(let e of t.values())e.reverse();return t}var f_=n_(uc(),void 0,`asc`,`none`),p_={query:`q`,status:`status`,agent:`agent`,machine:`machine`,repository:`repo`,tag:`tag`,sortCol:`sort`,sortDir:`dir`,groupBy:`group`},m_=Object.values(p_);function h_(e){let t=new URLSearchParams;for(let n of Object.keys(p_)){let r=e[n];r!==void 0&&r!==f_[n]&&t.set(p_[n],r)}return t}function g_(e,t){let n=new URLSearchParams(e);for(let e of m_)n.delete(e);for(let[e,r]of h_(t))n.set(e,r);return n}function __(e){if(m_.some(t=>e.has(t)))return{query:e.get(p_.query)??f_.query,status:e.get(p_.status)??f_.status,agent:e.get(p_.agent)??f_.agent,machine:e.get(p_.machine)??f_.machine,repository:e.get(p_.repository)??f_.repository,tag:e.get(p_.tag)??f_.tag,sortCol:e.get(p_.sortCol)??void 0,sortDir:e.get(p_.sortDir)??f_.sortDir,groupBy:e.get(p_.groupBy)??f_.groupBy}}function v_({routines:e,now:t,active:n,onStatus:r}){let i=e.length,a=e.filter(e=>e.enabled).length,o=i-a,s=e.filter(e=>!e.enabled&&e.auto_disabled_reason!=null).length,c=e.filter(e=>e.enabled&&!bc(e,t)&&So(e.schedule,t,36e5)).length,l=e.filter(e=>e.enabled&&bc(e,t)).length,u=e.filter(e=>e.enabled&&(e.machines??[]).length===0).length,d=e.reduce((e,t)=>e+(t.flag_count??0),0),f=e.filter(e=>!e.agent_registered).length;return(0,I.jsx)(`div`,{className:`stats`,children:[[`all`,`TOTAL`,i,``],[`enabled`,`ENABLED`,a,``],[`disabled`,`DISABLED`,o,``],[`auto-disabled`,`AUTO-DISABLED`,s,s>0?`has-auto-disabled`:``],[`dormant`,`DORMANT`,u,u>0?`has-dormant`:``],[`due`,`DUE SOON`,c,``],[`snoozed`,`SNOOZED`,l,``],[`flagged`,`FLAGS`,d,d>0?`has-flags`:``],[`agent-unreg`,`UNREGISTERED AGENT`,f,f>0?`has-unreg`:``]].map(([e,t,i,a])=>{let o=n===e;return(0,I.jsxs)(`button`,{type:`button`,className:`stat-card ${a}${o?` active`:``}`.trim(),"aria-pressed":o,onClick:()=>r(o?`all`:e),children:[(0,I.jsx)(`div`,{className:`stat-label`,children:t}),(0,I.jsx)(`div`,{className:`stat-val`,children:i})]},e)})})}var y_=[[`table`,`LIST`],[`files`,`FILES`],[`calendar`,`CALENDAR`],[`day`,`DAY`]];function b_({view:e,onSetView:t}){return(0,I.jsx)(`div`,{className:`view-toggle`,children:y_.map(([n,r])=>(0,I.jsx)(`button`,{type:`button`,className:e===n?`view-btn active`:`view-btn`,onClick:()=>t(n),children:r},n))})}var x_=3e4;function S_(){let{addToast:e}=Xa(),[t,n]=Fn(),r=(0,x.useMemo)(()=>__(t)??c_(),[]),i=r?r_(r):void 0,[a,o]=(0,x.useState)(()=>{let e=t.get(`history`);return e?{kind:`history`,id:e}:{kind:`list`}}),[s,c]=(0,x.useState)({kind:`none`}),[l,u]=(0,x.useState)(`table`),[d,f]=(0,x.useState)(i?.filter??uc()),[p,m]=(0,x.useState)(i?.sortCol),[h,g]=(0,x.useState)(i?.sortDir??`asc`),[_,v]=(0,x.useState)(i?.groupBy??`none`),[y,b]=(0,x.useState)(new Set),[S,C]=(0,x.useState)(o_),w=us(),[T,ee]=(0,x.useState)(()=>new Date),te=(0,x.useRef)(null);(0,x.useEffect)(()=>{if(t.get(`history`)){let e=new URLSearchParams(t);e.delete(`history`),n(e,{replace:!0})}},[]),(0,x.useEffect)(()=>{let e=setInterval(()=>ee(new Date),x_);return()=>clearInterval(e)},[]),(0,x.useEffect)(()=>{let e=n_(d,p,h,_);l_(e),n(t=>g_(t,e),{replace:!0})},[d,p,h,_]),(0,x.useEffect)(()=>{let e=e=>{if(e.key===`Escape`&&s.kind!==`none`){c({kind:`none`});return}let t=e.target,n=t&&[`INPUT`,`TEXTAREA`,`SELECT`].includes(t.tagName);e.key===`/`&&!n&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&(e.preventDefault(),te.current?.focus())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[s.kind]);let E=os(w),D=Ui({},{refetchInterval:E}),ne=na(300),re=ea(),ie=Fi(),ae=Ii();(0,x.useEffect)(()=>{if(E===void 0)return;let e=setInterval(()=>void ne.refetch(),E);return()=>clearInterval(e)},[E]);let O=(0,x.useMemo)(()=>D.data??[],[D.data]),oe=(0,x.useMemo)(()=>d_(ne.data??[]),[ne.data]),k=(0,x.useRef)(!1);(0,x.useEffect)(()=>{let e=ie.data?.name;!e||k.current||(k.current=!0,f(t=>t.machine.kind===`any`?{...t,machine:{kind:`machine`,value:e}}:t))},[ie.data]);let[A,se]=(0,x.useState)(O);if(O!==A){se(O);let e=new Set(O.map(e=>e.id));b(t=>{let n=new Set([...t].filter(t=>e.has(t)));return n.size===t.size?t:n})}let ce=Ki(),le=qi(),ue=Ji(),de=Yi(),j=Xi(),fe=$i(),pe=ta(),me=()=>o({kind:`list`}),he=()=>c({kind:`none`}),ge=()=>{pe.mutate(`all`,{onSuccess:()=>e(`Routines unlocked`,`ok`),onError:t=>e(`Unlock failed: ${t.message}`,`err`)})},_e=t=>{ce.mutate({...t},{onSuccess:()=>{me(),e(`Routine created`,`ok`)},onError:t=>e(`Create failed: ${t.message}`,`err`)})},ve=(t,n)=>{le.mutate({id:t,body:ug(n)},{onSuccess:()=>{he(),e(`Routine updated`,`ok`)},onError:t=>e(`Update failed: ${t.message}`,`err`)})},ye=(t,n,r)=>{ue.mutate({id:t,body:{folder:n,slug:r}},{onSuccess:()=>{he(),e(`Routine moved`,`ok`)},onError:t=>e(`Move failed: ${t.message}`,`err`)})},be=t=>{de.mutate(t,{onSuccess:()=>{he(),e(`Routine deleted`,`ok`)},onError:t=>e(`Delete failed: ${t.message}`,`err`)})},xe=(t,n)=>{le.mutate({id:t,body:{enabled:n}},{onSuccess:()=>e(n?`Routine enabled`:`Routine disabled`,`ok`),onError:t=>e(`Toggle failed: ${t.message}`,`err`)})},Se=t=>{j.mutate(t,{onSuccess:()=>e(`Routine triggered`,`ok`),onError:t=>e(`Trigger failed: ${t.message}`,`err`)})},Ce=()=>{fe.mutate(void 0,{onSuccess:t=>{let n=t.removed;e(`Cleanup removed ${n} workbench${n===1?``:`es`} (freed ${Us(t.freed_bytes)})`,`ok`)},onError:t=>e(`Cleanup failed: ${t.message}`,`err`)})},we=async t=>{let n=[...y];if(n.length===0)return;let r=0,i=0;for(let e of n)try{await le.mutateAsync({id:e,body:{enabled:t}}),r++}catch{i++}let a=t?`enabled`:`disabled`;i===0?e(`${r} routine(s) ${a}`,`ok`):e(`${r} ${a}, ${i} failed`,`err`)},Te=async()=>{let t=[...y],n=0,r=0,i=[];for(let e of t)try{await de.mutateAsync(e),n++,i.push(e)}catch{r++}b(e=>{let t=new Set(e);for(let e of i)t.delete(e);return t}),he(),r===0?e(`${n} routine(s) deleted`,`ok`):e(`${n} deleted, ${r} failed`,`err`)},Ee=e=>{let t=r_(e);f(t.filter),m(t.sortCol),g(t.sortDir),v(t.groupBy)},De=e=>{let t=n_(d,p,h,_);C(n=>{let r=[...n.filter(t=>t.name!==e),{name:e,snapshot:t}];return s_(r),r})},Oe=e=>{C(t=>{let n=t.filter(t=>t.name!==e);return s_(n),n})},ke=(0,x.useMemo)(()=>Tc(O),[O]),Ae=(0,x.useMemo)(()=>Dc(O),[O]),je=(0,x.useMemo)(()=>Oc(O),[O]),Me=(0,x.useMemo)(()=>[...new Set([...Ec(O),...ae.data??[]])].sort(),[O,ae.data]),Ne=dc(d),Pe=(0,x.useMemo)(()=>Hc(pc(O,d,T,ec),p,h,T),[O,d,T,p,h]),Fe=()=>{Xs(`routines-${new Date().toISOString().slice(0,10)}.csv`,Ys(Pe)),e(`Exported ${Pe.length} routine(s) to CSV`,`ok`)},M=Wi(s.kind===`edit`?s.id:``,s.kind===`edit`),Ie=s.kind===`edit`?M.data:void 0,Le=e=>b(t=>{let n=new Set(t);return n.delete(e)||n.add(e),n}),Re=()=>{let e=Pe.map(e=>e.id),t=e.length>0&&e.every(e=>y.has(e));b(t?new Set:new Set(e))},ze=e=>{p===e?g(e=>Nc(e)):(m(e),g(`asc`))},Be=e=>O.find(t=>t.id===e)?.title??``;if(a.kind===`new`)return(0,I.jsx)(hg,{mode:`create`,saving:ce.isPending,onCancel:me,onSave:_e});if(a.kind===`clone`){let e={schedule:a.source.schedule,schedules:yo(a.source),title:ng(a.source.title),agent:a.source.agent,model:a.source.model??null,prompt:a.source.prompt??``,goal:a.source.goal??null,repositories:a.source.repositories??[],machines:a.source.machines??[],enabled:a.source.enabled,power_saving_exempt:a.source.power_saving_exempt??!1,ttl_secs:a.source.ttl_secs??null,tags:a.source.tags??[]};return(0,I.jsx)(hg,{mode:`clone`,initial:e,saving:ce.isPending,onCancel:me,onSave:_e})}if(a.kind===`logs`)return(0,I.jsx)(Tg,{id:a.id,title:Be(a.id),onBack:me});if(a.kind===`history`)return(0,I.jsx)(wg,{id:a.id,title:Be(a.id),onBack:me});if(a.kind===`flags`)return(0,I.jsx)(Yc,{id:a.id,title:Be(a.id),onBack:me});let Ve=Pe.filter(e=>e.enabled).map(e=>({id:e.id,label:e.title,schedule:e.schedule,schedules:yo(e),snoozed:bc(e,T),flagCount:e.flag_count??0}));return(0,I.jsxs)(`div`,{className:`page`,children:[(0,I.jsx)(`h1`,{className:`page-title`,children:`Routines`}),(0,I.jsx)(es,{status:re.data,onUnlock:ge}),(0,I.jsx)(v_,{routines:O,now:T,active:d.status,onStatus:e=>f(t=>({...t,status:e}))}),(0,I.jsxs)(`div`,{className:`section-hd`,children:[(0,I.jsx)(`div`,{className:`section-label`,children:`SCHEDULED ROUTINES`}),(0,I.jsxs)(`div`,{className:`section-acts`,children:[(0,I.jsx)(fs,{updatedAtMs:D.dataUpdatedAt}),l===`table`&&(0,I.jsx)(Wc,{groupBy:_,onChange:v}),(0,I.jsx)(b_,{view:l,onSetView:u}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Reap finished, expired run workbenches now`,onClick:Ce,children:`CLEANUP NOW`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,title:`Export the currently filtered/sorted routines to a CSV file`,disabled:Pe.length===0,onClick:Fe,children:`EXPORT CSV`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-primary btn-sm`,onClick:()=>o({kind:`new`}),children:`+ NEW ROUTINE`})]})]}),(0,I.jsx)(Ac,{filter:d,agents:ke,machines:Me,repositories:Ae,tags:je,shown:Pe.length,total:O.length,searchRef:te,onQuery:e=>f(t=>({...t,query:e})),onStatus:e=>f(t=>({...t,status:e})),onAgent:e=>f(t=>({...t,agent:e})),onMachine:e=>f(t=>({...t,machine:e})),onRepository:e=>f(t=>({...t,repository:e})),onTag:e=>f(t=>({...t,tag:e})),onClear:()=>f(uc())}),(0,I.jsx)(u_,{views:S,onApply:Ee,onSave:De,onDelete:Oe}),(0,I.jsx)(zs,{count:y.size,onEnable:()=>void we(!0),onDisable:()=>void we(!1),onDelete:()=>c({kind:`confirmBulkDelete`}),onClear:()=>b(new Set)}),l===`table`&&(0,I.jsx)($g,{routines:Pe,loading:D.isLoading,filterActive:Ne,now:T,selected:y,onSelect:Le,onSelectAll:Re,sortCol:p,sortDir:h,groupBy:_,runHistory:oe,onSort:ze,onEdit:e=>c({kind:`edit`,id:e}),onClone:e=>{let t=O.find(t=>t.id===e);t&&o({kind:`clone`,source:t})},onDelete:(e,t)=>c({kind:`confirmDelete`,id:e,title:t}),onMove:e=>c({kind:`move`,id:e}),onToggle:xe,onTrigger:Se,onLogs:e=>o({kind:`logs`,id:e}),onHistory:e=>o({kind:`history`,id:e}),onFlags:e=>o({kind:`flags`,id:e}),onClearFilters:()=>f(uc())}),l===`files`&&(0,I.jsx)(Gg,{routines:Pe,loading:D.isLoading,filterActive:Ne,now:T,onEdit:e=>c({kind:`edit`,id:e}),onClone:e=>{let t=O.find(t=>t.id===e);t&&o({kind:`clone`,source:t})},onDelete:(e,t)=>c({kind:`confirmDelete`,id:e,title:t}),onMove:e=>c({kind:`move`,id:e}),onToggle:xe,onTrigger:Se,onLogs:e=>o({kind:`logs`,id:e}),onHistory:e=>o({kind:`history`,id:e}),onFlags:e=>o({kind:`flags`,id:e}),onClearFilters:()=>f(uc())}),l===`calendar`&&(0,I.jsx)(Jc,{routines:Pe,loading:D.isLoading,onEdit:e=>c({kind:`edit`,id:e}),onTrigger:Se}),l===`day`&&(0,I.jsx)($s,{items:Ve,loading:D.isLoading,onClick:e=>c({kind:`edit`,id:e})}),s.kind===`edit`&&M.isLoading&&(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})}),s.kind===`edit`&&Ie&&(0,I.jsx)(hg,{mode:`edit`,initial:Ie&&{schedule:Ie.schedule,schedules:yo(Ie),title:Ie.title,agent:Ie.agent,model:Ie.model??null,prompt:Ie.prompt??``,goal:Ie.goal??null,repositories:Ie.repositories??[],machines:Ie.machines??[],enabled:Ie.enabled,power_saving_exempt:Ie.power_saving_exempt??!1,ttl_secs:Ie.ttl_secs??null,tags:Ie.tags??[]},saving:le.isPending,onCancel:he,onSave:e=>ve(s.id,e)}),s.kind===`move`&&(()=>{let e=O.find(e=>e.id===s.id);return e?(0,I.jsx)(kg,{routine:e,saving:ue.isPending,onCancel:he,onConfirm:(e,t)=>ye(s.id,e,t)}):null})(),s.kind===`confirmDelete`&&(0,I.jsx)(Vs,{title:s.title,onCancel:he,onConfirm:()=>be(s.id)}),s.kind===`confirmBulkDelete`&&(0,I.jsx)(Bs,{count:y.size,onCancel:he,onConfirm:()=>void Te()})]})}var C_={query:``,status:`all`,time:`all`},w_={"1h":3600,"24h":86400,"7d":604800};function T_(e,t,n){let r=t.query.trim().toLowerCase(),i=t.time===`all`?void 0:n-w_[t.time];return e.filter(e=>!(t.status!==`all`&&e.status!==t.status||i!==void 0&&e.started_at<i||r!==``&&!e.routine_title.toLowerCase().includes(r)))}function E_(e){let t={running:0,success:0,failed:0,unknown:0};for(let n of e)t[n.status]+=1;return t}var D_=100,O_=100,k_=1e3,A_=[[`all`,`All`],[`success`,`Success`],[`failed`,`Failed`],[`running`,`Running`],[`unknown`,`Unknown`]],j_=[[`all`,`All time`],[`1h`,`Last hour`],[`24h`,`Last 24h`],[`7d`,`Last 7 days`]];function M_(){let e=os(us()),t=Math.floor(ts(3e4)/1e3),[n,r]=(0,x.useState)(D_),[i,a]=(0,x.useState)(C_),o=na(n,{refetchInterval:e}),s=(0,x.useMemo)(()=>o.data??[],[o.data]),c=(0,x.useMemo)(()=>T_(s,i,t),[s,i,t]),l=(0,x.useMemo)(()=>E_(s),[s]),u=s.length>=n&&n<k_;return(0,I.jsxs)(`div`,{className:`page`,children:[(0,I.jsxs)(`div`,{className:`section-hd`,children:[(0,I.jsx)(`h1`,{className:`page-title`,children:`Runs`}),(0,I.jsx)(`div`,{className:`section-acts`,children:(0,I.jsx)(fs,{updatedAtMs:o.dataUpdatedAt})})]}),(0,I.jsxs)(`div`,{className:`stats`,children:[(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`FETCHED`}),(0,I.jsx)(`div`,{className:`stat-val`,children:s.length})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`RUNNING`}),(0,I.jsx)(`div`,{className:l.running>0?`stat-val c-accent`:`stat-val`,children:l.running})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`SUCCESS`}),(0,I.jsx)(`div`,{className:`stat-val`,children:l.success})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`FAILED`}),(0,I.jsx)(`div`,{className:l.failed>0?`stat-val c-red`:`stat-val`,children:l.failed})]})]}),(0,I.jsxs)(`div`,{className:`filter-bar`,children:[(0,I.jsxs)(`div`,{className:`filter-field`,children:[(0,I.jsx)(`input`,{type:`text`,className:`filter-input`,placeholder:`Search runs by routine…`,"aria-label":`Search runs`,value:i.query,onChange:e=>a({...i,query:e.target.value})}),(0,I.jsx)(`span`,{className:`filter-label`,children:`STATUS`}),(0,I.jsx)(`select`,{className:`filter-select`,"aria-label":`Status filter`,value:i.status,onChange:e=>a({...i,status:e.target.value}),children:A_.map(([e,t])=>(0,I.jsx)(`option`,{value:e,children:t},e))}),(0,I.jsx)(`span`,{className:`filter-label`,children:`WHEN`}),(0,I.jsx)(`select`,{className:`filter-select`,"aria-label":`Time range filter`,value:i.time,onChange:e=>a({...i,time:e.target.value}),children:j_.map(([e,t])=>(0,I.jsx)(`option`,{value:e,children:t},e))})]}),(0,I.jsx)(`div`,{className:`filter-field`,children:(0,I.jsxs)(`span`,{className:`filter-count`,children:[`Showing `,c.length,` of `,s.length,` fetched`]})})]}),o.error?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:o.error.message})]})}):o.isLoading?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})}):c.length===0?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NO RUNS`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:s.length===0?`no runs yet`:`no runs match the current filters`})]})}):(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`table`,{children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{children:`ROUTINE`}),(0,I.jsx)(`th`,{children:`STARTED`}),(0,I.jsx)(`th`,{children:`DURATION`}),(0,I.jsx)(`th`,{children:`STATUS`}),(0,I.jsx)(`th`,{children:`EXIT CODE`}),(0,I.jsx)(`th`,{})]})}),(0,I.jsx)(`tbody`,{children:c.map(e=>(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`td`,{children:(0,I.jsx)(kn,{to:`/routines?history=${encodeURIComponent(e.routine_id)}`,children:e.routine_title})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`div`,{className:`cell-time`,title:Ha(e.started_at),children:Ba(e.started_at)})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`cell-meta`,children:e.finished_at==null?`—`:Ms(e.started_at,e.finished_at)})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:As(e.status),children:js(e.status)})}),(0,I.jsx)(`td`,{children:e.exit_code==null?`—`:e.exit_code}),(0,I.jsx)(`td`,{children:(0,I.jsx)(kn,{to:`/runs/${encodeURIComponent(e.routine_id)}/${encodeURIComponent(e.workbench)}`,className:`act-btn logs`,children:`VIEW RUN`})})]},e.workbench))})]})}),u&&(0,I.jsx)(`div`,{className:`section-acts`,children:(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,onClick:()=>r(e=>Math.min(k_,e+O_)),children:`Load more`})})]})}function N_(){let{routineId:e=``,workbench:t=``}=gt(),n=ft(),r=ts(),i=Math.floor(r/1e3),a=Wi(e),o=ra(e),s=oa(e,t),c=o.data??[],l=c.findIndex(e=>e.workbench===t),u=l>=0?c[l]:void 0,d=l>=0?c[l+1]:void 0,f=l>=0?c[l-1]:void 0,p=a.data?.title??e;return(0,I.jsxs)(`main`,{className:`logs-page`,children:[(0,I.jsxs)(`div`,{className:`page-hd`,children:[(0,I.jsxs)(kn,{to:`/routines?history=${encodeURIComponent(e)}`,className:`btn btn-ghost btn-sm`,children:[`← `,p]}),(0,I.jsxs)(`div`,{className:`page-title`,children:[`RUN / `,t]}),o.dataUpdatedAt>0&&(0,I.jsx)(`span`,{className:`page-freshness`,children:ls(Math.max(0,(r-o.dataUpdatedAt)/1e3))}),(0,I.jsx)(`button`,{type:`button`,className:`btn-refresh`,title:`Refresh`,"aria-label":`Refresh`,onClick:()=>void o.refetch(),children:`↻`})]}),o.isLoading?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})}):o.isError?(0,I.jsxs)(`div`,{className:`logs-error`,children:[`Error: `,o.error.message]}):u===void 0?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⧗`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`RUN NOT FOUND`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:`it may have been reaped, or the link is stale`})]})}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`stats`,children:[(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`STATUS`}),(0,I.jsx)(`span`,{className:As(u.status),children:js(u.status)})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`STARTED`}),(0,I.jsx)(`div`,{className:`stat-val stat-val-sm`,title:Ha(u.started_at),children:Ba(u.started_at)})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`DURATION`}),(0,I.jsx)(`div`,{className:`stat-val stat-val-sm`,children:u.finished_at==null?`—`:Ms(u.started_at,u.finished_at)})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`EXIT CODE`}),(0,I.jsx)(`div`,{className:`stat-val stat-val-sm`,children:u.exit_code??`—`})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`RETENTION`}),(0,I.jsx)(`div`,{className:`stat-val stat-val-sm`,children:u.retention_expires_at==null?`—`:Ns(i,u.retention_expires_at)})]})]}),(0,I.jsxs)(`div`,{className:`section-acts`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:d===void 0,onClick:()=>d&&n(`/runs/${e}/${d.workbench}`),children:`← Older run`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost btn-sm`,disabled:f===void 0,onClick:()=>f&&n(`/runs/${e}/${f.workbench}`),children:`Newer run →`})]}),(0,I.jsx)(xg,{content:s.data,loading:s.isLoading,err:s.isError?s.error.message:void 0})]})]})}function P_(e,t){let n=Array.from({length:24},()=>[]);for(let r of e)for(let e of Ao(r.schedule,t))n[e.getHours()]?.push({time:e,label:r.label,snoozed:r.snoozed,flagCount:r.flagCount});for(let e of n)e.sort((e,t)=>e.time.getTime()-t.time.getTime());return n}function F_(e,t){let n=e.snoozed_until;return n!=null&&n>Math.floor(t.getTime()/1e3)||(e.skip_runs??0)>0}function I_(e,t){return e.filter(e=>e.enabled).map(e=>({label:e.title,schedule:e.schedule,snoozed:F_(e,t),flagCount:e.flag_count}))}function L_(e){return`${Eo[e.getDay()]} · ${Do[e.getMonth()]?.slice(0,3)} ${e.getDate()} ${e.getFullYear()}`}function R_({day:e,items:t,loading:n,isToday:r,currentHour:i,onPrev:a,onNext:o,onToday:s,onClose:c}){let l=P_(t,e),u=l.reduce((e,t)=>e+t.length,0);return(0,I.jsxs)(`section`,{className:`hm-day card`,children:[(0,I.jsxs)(`div`,{className:`hm-day-nav`,children:[(0,I.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:a,"aria-label":`Previous day`,children:`‹`}),(0,I.jsx)(`div`,{className:`hm-day-title`,children:L_(e)}),(0,I.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:o,"aria-label":`Next day`,children:`›`}),(0,I.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:s,children:`TODAY`}),(0,I.jsx)(`div`,{className:`hm-day-spacer`}),(0,I.jsx)(`button`,{className:`btn btn-ghost btn-sm`,onClick:c,"aria-label":`Close day view`,children:`✕`})]}),n?(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})}):u===0?(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`🗓`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:`no fire times on this day`})]}):(0,I.jsx)(`div`,{className:`hm-day-hours`,children:l.map((e,t)=>(0,I.jsxs)(`div`,{className:r&&t===i?`hm-day-hour now`:`hm-day-hour`,children:[(0,I.jsxs)(`div`,{className:`hm-day-hour-label`,children:[String(t).padStart(2,`0`),`:00`]}),(0,I.jsx)(`div`,{className:`hm-day-hour-slot`,children:e.map((e,t)=>(0,I.jsxs)(`div`,{className:e.snoozed?`hm-day-chip snoozed`:`hm-day-chip`,title:e.label,children:[(0,I.jsxs)(`span`,{className:`hm-day-chip-time`,children:[String(e.time.getHours()).padStart(2,`0`),`:`,String(e.time.getMinutes()).padStart(2,`0`)]}),(0,I.jsx)(`span`,{className:`hm-day-chip-label`,children:e.label}),e.flagCount>0&&(0,I.jsx)(`span`,{className:`hm-day-chip-flag`,children:`⚑${e.flagCount}`})]},t))})]},t))})]})}var z_=2e4;function B_(e){return e===`all`?`ALL`:`ROUTINES`}function V_(e,t){return e===`all`||e===t}function H_(e,t,n){let r=wo(t),i=new Date(r.getFullYear(),r.getMonth(),r.getDate()+7),a=Array.from({length:7},()=>Array(24).fill(0)),o=0;for(let s of e){if(!s.enabled||!V_(n,s.kind))continue;let e=!1;for(let n of yo(s)){let o=go(n,t);if(o)for(let t=0;t<z_&&o.hasNext();t++){let t=o.next().toDate(),n=wo(t);if(n.getTime()>=i.getTime())break;let s=a[Math.round((n.getTime()-r.getTime())/864e5)];s&&(s[t.getHours()]=(s[t.getHours()]??0)+1,e=!0)}}e&&o++}let s=0,c=0,l;for(let e=0;e<7;e++){let t=a[e];if(t)for(let n=0;n<24;n++){let r=t[n]??0;s+=r,r>c&&(c=r,l=[e,n])}}return{grid:a,total:s,maxCell:c,peak:l,sources:o}}function U_(e,t){if(e===0||t===0)return 0;let n=e/t;return Math.min(4,Math.max(1,Math.ceil(n*4)))}function W_(e){return e.grid.map(e=>e.reduce((e,t)=>e+t,0))}function G_(e){return Array.from({length:24},(t,n)=>e.grid.reduce((e,t)=>e+(t[n]??0),0))}function K_(e){return e.grid.flat().filter(e=>e>0).length}function q_(e){return e.getDay()}function J_(e,t){return Eo[q_(new Date(e.getFullYear(),e.getMonth(),e.getDate()+t))]??``}function Y_(e,t){if(!e.peak)return;let[n,r]=e.peak,i=e.grid[n]?.[r]??0,a=i===1?`run`:`runs`;return`${J_(t,n)} ${String(r).padStart(2,`0`)}:00 · ${i} ${a}`}function X_(e,t){let n=new Date(e.getFullYear(),e.getMonth(),e.getDate()+t);return`${Eo[q_(n)]} ${n.getDate()}`}function Z_(e){return e.map(e=>({kind:`routine`,schedule:e.schedule,schedules:yo(e),enabled:e.enabled}))}var Q_=6e4,$_=[`all`,`routine`];function ev(e,t){return new Date(e.getFullYear(),e.getMonth(),e.getDate()+t)}function tv(e){return`${e.getFullYear()}-${String(e.getMonth()+1).padStart(2,`0`)}-${String(e.getDate()).padStart(2,`0`)}`}function nv(e){let t=e?/^(\d{4})-(\d{2})-(\d{2})$/.exec(e):null;if(!t)return;let[,n,r,i]=t;return new Date(Number(n),Number(r)-1,Number(i))}function rv(e){if(e!==0)return`color-mix(in srgb, var(--accent) ${10+e*20}%, var(--surface))`}function iv(){let{data:e,isLoading:t,error:n,dataUpdatedAt:r}=Ui({},{refetchInterval:os(us())}),[i,a]=(0,x.useState)(()=>new Date),[o,s]=(0,x.useState)(`all`),[c,l]=Fn();(0,x.useEffect)(()=>{let e=setInterval(()=>a(new Date),Q_);return()=>clearInterval(e)},[]);let u=wo(i),d=i.getHours(),f=(0,x.useMemo)(()=>Z_(e??[]),[e]),p=(0,x.useMemo)(()=>H_(f,i,o),[f,i,o]),m=nv(c.get(`day`)),h=e=>{l(t=>{let n=new URLSearchParams(t);return n.set(`day`,tv(e)),n})},g=()=>{l(e=>{let t=new URLSearchParams(e);return t.delete(`day`),t})},_=(0,x.useMemo)(()=>I_(e??[],i),[e,i]),v=n?.message,y=Array.from({length:7},(e,t)=>t),b=Array.from({length:24},(e,t)=>t),S=W_(p),C=G_(p),w=168-K_(p);return(0,I.jsxs)(`div`,{className:`page`,children:[(0,I.jsxs)(`div`,{className:`hm-hd`,children:[(0,I.jsx)(`h1`,{className:`page-title`,children:`Heatmap`}),(0,I.jsxs)(`div`,{className:`hm-hd-acts`,children:[(0,I.jsx)(`div`,{className:`hm-filter`,role:`group`,"aria-label":`Source filter`,children:$_.map(e=>(0,I.jsx)(`button`,{className:e===o?`hm-filter-btn active`:`hm-filter-btn`,"aria-pressed":e===o,onClick:()=>s(e),children:B_(e)},e))}),(0,I.jsx)(fs,{updatedAtMs:r})]})]}),(0,I.jsxs)(`div`,{className:`stats`,children:[(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`FIRES / 7 DAYS`}),(0,I.jsx)(`div`,{className:`stat-val`,children:p.total})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`BUSIEST WINDOW`}),(0,I.jsx)(`div`,{className:`stat-val stat-val-sm c-accent`,children:Y_(p,u)??`—`})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`PEAK / HOUR`}),(0,I.jsx)(`div`,{className:`stat-val`,children:p.maxCell})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`SOURCES`}),(0,I.jsx)(`div`,{className:`stat-val`,children:p.sources})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`OPEN SLOTS`}),(0,I.jsxs)(`div`,{className:`stat-val stat-val-sm`,children:[w,` / `,168]})]})]}),v?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:v})]})}):t?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})}):p.total===0?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`▦`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NOTHING SCHEDULED`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:`no enabled routine fires in the next 7 days`})]})}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`div`,{className:`hm-grid-wrap`,children:(0,I.jsxs)(`div`,{className:`hm-grid`,role:`grid`,"aria-label":`Fire density by day and hour`,children:[(0,I.jsx)(`div`,{className:`hm-corner`,role:`columnheader`,children:`DAY \\ HR`}),b.map(e=>(0,I.jsx)(`div`,{className:e===d?`hm-hcol now`:`hm-hcol`,role:`columnheader`,children:String(e).padStart(2,`0`)},e)),(0,I.jsx)(`div`,{className:`hm-rowtot hm-corner`,role:`columnheader`,children:`Σ`}),y.map(e=>{let t=ev(u,e);return(0,I.jsxs)(x.Fragment,{children:[(0,I.jsx)(`button`,{className:e===0?`hm-daylabel today`:`hm-daylabel`,onClick:()=>h(t),title:`View ${X_(u,e)}`,children:X_(u,e)}),b.map(n=>{let r=p.grid[e]?.[n]??0,i=U_(r,p.maxCell),a=p.peak?.[0]===e&&p.peak[1]===n,o=e===0&&n===d,s=`hm-cell`;return a&&(s+=` peak`),o&&(s+=` now`),(0,I.jsx)(`button`,{className:s,style:{backgroundColor:rv(i)},onClick:()=>h(t),title:`${X_(u,e)} ${String(n).padStart(2,`0`)}:00 — ${r} run${r===1?``:`s`}`,children:r>0?(0,I.jsx)(`span`,{className:`hm-n`,children:r}):null},`${e}-${n}`)}),(0,I.jsx)(`div`,{className:`hm-rowtot`,children:S[e]})]},e)}),(0,I.jsx)(`div`,{className:`hm-daylabel hm-foot`,children:`Σ`}),b.map(e=>(0,I.jsx)(`div`,{className:`hm-rowtot hm-foot`,children:C[e]},`hourtot-${e}`)),(0,I.jsx)(`div`,{className:`hm-rowtot hm-foot grand`,children:p.total})]})}),(0,I.jsxs)(`div`,{className:`hm-legend`,children:[(0,I.jsx)(`span`,{className:`hm-legend-label`,children:`LESS`}),[0,1,2,3,4].map(e=>(0,I.jsx)(`span`,{className:`hm-cell hm-legend-swatch`,style:{backgroundColor:rv(e)}},e)),(0,I.jsx)(`span`,{className:`hm-legend-label`,children:`MORE`}),(0,I.jsx)(`span`,{className:`hm-legend-note`,children:`fires per weekday · hour across the next 7 days`})]})]}),m&&(0,I.jsx)(R_,{day:m,items:_,loading:t,isToday:wo(m).getTime()===u.getTime(),currentHour:d,onPrev:()=>h(ev(m,-1)),onNext:()=>h(ev(m,1)),onToday:()=>h(u),onClose:g})]})}var av=5,ov=.4,sv=8,cv=1.25;function lv(e){return e.sampleSize===0?null:e.successes/e.sampleSize}function uv(e){if(e.sampleSize<av)return!1;let t=e.sampleSize-1;return t>0&&e.flips/t>=ov}function dv(e){return e.kind===`failure`?e.count:0}function fv(e){let t=e[0];if(t===void 0)return{kind:`none`};let n=0;for(let r of e){if(r!==t)break;n+=1}return t===`success`?{kind:`success`,count:n}:{kind:`failure`,count:n}}function pv(e){let t=0;for(let n=1;n<e.length;n++)e[n]!==e[n-1]&&(t+=1);return t}function mv(e,t){return e.length===0?null:e[Math.min(e.length-1,Math.max(0,Math.ceil(t*e.length)-1))]??null}function hv(e){return mv([...e].sort((e,t)=>e-t),.5)}function gv(e){if(e.length<sv)return!1;let t=Math.floor(e.length/2),n=hv(e.slice(0,t)),r=hv(e.slice(t));return n===null||r===null||r<=0?!1:n>r*cv}function _v(e){let t=new Map;for(let n of e){if(n.status!==`success`&&n.status!==`failed`)continue;let e=t.get(n.routine_id);e||(e={title:n.routine_title,statuses:[],durationsSecs:[]},t.set(n.routine_id,e)),e.statuses.length<20&&e.statuses.push(n.status),e.durationsSecs.length<20&&n.finished_at!=null&&n.finished_at>=n.started_at&&e.durationsSecs.push(n.finished_at-n.started_at)}return t}function vv(e){let t=[];for(let[n,r]of _v(e)){let e=[...r.durationsSecs].sort((e,t)=>e-t);t.push({routineId:n,routineTitle:r.title,sampleSize:r.statuses.length,successes:r.statuses.filter(e=>e===`success`).length,streak:fv(r.statuses),flips:pv(r.statuses),durationsSecs:r.durationsSecs,p50Secs:mv(e,.5),p95Secs:mv(e,.95),regressing:gv(r.durationsSecs)})}return t.sort((e,t)=>{let n=dv(t.streak)-dv(e.streak);if(n!==0)return n;let r=lv(e)??1,i=lv(t)??1;return r===i?e.routineTitle.localeCompare(t.routineTitle):r-i}),t}function yv(e){let t=e.flatMap(e=>e.durationsSecs).sort((e,t)=>e-t);return{sampleSize:e.reduce((e,t)=>e+t.sampleSize,0),successes:e.reduce((e,t)=>e+t.successes,0),failingCount:e.filter(e=>dv(e.streak)>0).length,flakyCount:e.filter(uv).length,p50Secs:mv(t,.5),p95Secs:mv(t,.95),regressingCount:e.filter(e=>e.regressing).length}}function bv(e){switch(e.kind){case`success`:return`run-status success`;case`failure`:return`run-status failed`;default:return`run-status unknown`}}function xv(e){switch(e.kind){case`success`:return`${e.count} OK`;case`failure`:return`${e.count} FAILING`;default:return`—`}}function Sv(e){return e===null?`run-status unknown`:e>=.9?`run-status success`:e>=.7?`run-status running`:`run-status failed`}function Cv(e){return e===null?`—`:`${Math.round(e*100)}%`}var wv=300;function Tv(e){return e===null?`—`:Ms(0,e)}function Ev(){let{data:e,isLoading:t,error:n,dataUpdatedAt:r}=na(wv,{refetchInterval:os(us())}),i=vv(e??[]),a=yv(i),o=a.sampleSize===0?null:a.successes/a.sampleSize,s=n?.message;return(0,I.jsxs)(`div`,{className:`page`,children:[(0,I.jsxs)(`div`,{className:`section-hd`,children:[(0,I.jsx)(`h1`,{className:`page-title`,children:`Reliability`}),(0,I.jsx)(`div`,{className:`section-acts`,children:(0,I.jsx)(fs,{updatedAtMs:r})})]}),(0,I.jsxs)(`div`,{className:`stats`,children:[(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`FLEET SUCCESS RATE`}),(0,I.jsx)(`div`,{className:`stat-val`,children:Cv(o)})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`FAILING`}),(0,I.jsx)(`div`,{className:a.failingCount>0?`stat-val c-red`:`stat-val`,children:a.failingCount})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`FLAKY`}),(0,I.jsx)(`div`,{className:a.flakyCount>0?`stat-val c-amber`:`stat-val`,children:a.flakyCount})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`FLEET P50`}),(0,I.jsx)(`div`,{className:`stat-val stat-val-sm`,children:Tv(a.p50Secs)})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`FLEET P95`}),(0,I.jsx)(`div`,{className:`stat-val stat-val-sm`,children:Tv(a.p95Secs)})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`SLOWER TREND`}),(0,I.jsx)(`div`,{className:a.regressingCount>0?`stat-val c-amber`:`stat-val`,children:a.regressingCount})]})]}),s?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:s})]})}):t?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})}):i.length===0?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`✓`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NO FINISHED RUNS YET`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:`reliability metrics need at least one success or failure`})]})}):(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`table`,{children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{children:`ROUTINE`}),(0,I.jsx)(`th`,{children:`STREAK`}),(0,I.jsx)(`th`,{children:`SUCCESS RATE`}),(0,I.jsx)(`th`,{children:`P50`}),(0,I.jsx)(`th`,{children:`P95`}),(0,I.jsx)(`th`,{children:`TREND`})]})}),(0,I.jsx)(`tbody`,{children:i.map(e=>(0,I.jsx)(Dv,{item:e},e.routineId))})]})})]})}function Dv({item:e}){return(0,I.jsxs)(`tr`,{children:[(0,I.jsxs)(`td`,{children:[(0,I.jsx)(kn,{to:`/routines?history=${encodeURIComponent(e.routineId)}`,children:e.routineTitle}),uv(e)?(0,I.jsxs)(`span`,{className:`run-status running`,title:`Alternating pass/fail over the recent sample`,children:[` `,`FLAKY`]}):null]}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:bv(e.streak),children:xv(e.streak)})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:Sv(lv(e)),children:Cv(lv(e))})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`cell-meta`,children:Tv(e.p50Secs)})}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:`cell-meta`,children:Tv(e.p95Secs)})}),(0,I.jsx)(`td`,{children:e.regressing?(0,I.jsx)(`span`,{className:`run-status failed`,title:`Recent runs are meaningfully slower than the baseline`,children:`SLOWER`}):(0,I.jsx)(`span`,{className:`cell-meta`,children:`—`})})]})}function Ov(e,t,n,r,i){return e.map(e=>{let a=t.filter(t=>(t.machines??[]).includes(e)),o=new Set(a.map(e=>e.id)),s=n.filter(e=>o.has(e.routine_id)),c=s.filter(e=>e.status===`success`||e.status===`failed`),l=s.reduce((e,t)=>e===null||t.started_at>e.started_at?t:e,null);return{name:e,isCurrent:e===r,routines:a.map(e=>({id:e.id,title:e.title})).sort((e,t)=>e.title.localeCompare(t.title)),total:a.length,enabled:a.filter(e=>e.enabled).length,runningNow:a.filter(e=>e.is_running).length,powerSaving:a.filter(e=>e.power_saving).length,needsAttention:a.filter(e=>{let t=Sc(e,i);return t===`agent-missing`||t===`dead-schedule`}).length,successCount:c.filter(e=>e.status===`success`).length,finishedCount:c.length,lastRun:l?{label:l.started_at_local,status:l.status}:null}})}function kv(e){return e.finishedCount===0?null:e.successCount/e.finishedCount}function Av(e){return e.filter(e=>(e.machines??[]).every(e=>e.trim()===``)).length}var jv=300;function Mv(){let e=os(us()),t=Ii(),n=Fi(),r=Ui({},{refetchInterval:e}),i=na(jv,{refetchInterval:e}),a=(0,x.useMemo)(()=>r.data??[],[r.data]),o=(0,x.useMemo)(()=>i.data??[],[i.data]),s=(0,x.useMemo)(()=>[...new Set([...t.data??[],...Ec(a)])].sort(),[t.data,a]),c=(0,x.useMemo)(()=>Ov(s,a,o,n.data?.name,new Date),[s,a,o,n.data?.name]),l=t.isLoading||r.isLoading||i.isLoading,u=t.error?.message??r.error?.message??i.error?.message,d=Math.min(t.dataUpdatedAt||1/0,r.dataUpdatedAt||1/0,i.dataUpdatedAt||1/0),f=Av(a),p=c.reduce((e,t)=>e+t.runningNow,0);return(0,I.jsxs)(`div`,{className:`page`,children:[(0,I.jsxs)(`div`,{className:`section-hd`,children:[(0,I.jsx)(`h1`,{className:`page-title`,children:`Machines`}),(0,I.jsx)(`div`,{className:`section-acts`,children:(0,I.jsx)(fs,{updatedAtMs:Number.isFinite(d)?d:0})})]}),(0,I.jsxs)(`div`,{className:`stats`,children:[(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`MACHINES`}),(0,I.jsx)(`div`,{className:`stat-val`,children:s.length})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`RUNNING NOW`}),(0,I.jsx)(`div`,{className:p>0?`stat-val c-accent`:`stat-val`,children:p})]}),(0,I.jsxs)(`div`,{className:`stat-card`,children:[(0,I.jsx)(`div`,{className:`stat-label`,children:`UNASSIGNED ROUTINES`}),(0,I.jsx)(`div`,{className:f>0?`stat-val c-amber`:`stat-val`,children:f})]})]}),u?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`⚠`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`FAILED TO LOAD`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:u})]})}):l?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsx)(`div`,{className:`empty`,children:(0,I.jsx)(`div`,{className:`spinner`})})}):c.length===0?(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`div`,{className:`empty`,children:[(0,I.jsx)(`div`,{className:`empty-icon`,children:`🖥`}),(0,I.jsx)(`div`,{className:`empty-msg`,children:`NO MACHINES YET`}),(0,I.jsx)(`div`,{className:`empty-sub`,children:`no routine targets a machine, and this daemon has no resolved identity`})]})}):(0,I.jsx)(`div`,{className:`table-wrap`,children:(0,I.jsxs)(`table`,{children:[(0,I.jsx)(`thead`,{children:(0,I.jsxs)(`tr`,{children:[(0,I.jsx)(`th`,{children:`MACHINE`}),(0,I.jsx)(`th`,{children:`ROUTINES`}),(0,I.jsx)(`th`,{children:`ENABLED`}),(0,I.jsx)(`th`,{children:`RUNNING NOW`}),(0,I.jsx)(`th`,{children:`POWER SAVING`}),(0,I.jsx)(`th`,{children:`ATTENTION`}),(0,I.jsx)(`th`,{children:`SUCCESS RATE`}),(0,I.jsx)(`th`,{children:`LAST ACTIVITY`})]})}),(0,I.jsx)(`tbody`,{children:c.map(e=>(0,I.jsx)(Nv,{m:e},e.name))})]})})]})}function Nv({m:e}){return(0,I.jsxs)(`tr`,{children:[(0,I.jsxs)(`td`,{children:[e.name,e.isCurrent?(0,I.jsx)(`span`,{className:`cell-meta`,children:` (this machine)`}):null,e.routines.length>0?(0,I.jsxs)(`details`,{children:[(0,I.jsxs)(`summary`,{className:`cell-meta`,children:[e.routines.length,` routine`,e.routines.length===1?``:`s`]}),(0,I.jsx)(`ul`,{children:e.routines.map(e=>(0,I.jsx)(`li`,{children:(0,I.jsx)(kn,{to:`/routines?history=${encodeURIComponent(e.id)}`,children:e.title})},e.id))})]}):null]}),(0,I.jsx)(`td`,{children:e.total}),(0,I.jsx)(`td`,{children:e.enabled}),(0,I.jsx)(`td`,{className:e.runningNow>0?`c-accent`:void 0,children:e.runningNow}),(0,I.jsx)(`td`,{children:e.powerSaving}),(0,I.jsx)(`td`,{className:e.needsAttention>0?`c-red`:`cell-meta`,children:e.needsAttention||`—`}),(0,I.jsx)(`td`,{children:(0,I.jsx)(`span`,{className:Sv(kv(e)),children:Cv(kv(e))})}),(0,I.jsx)(`td`,{children:e.lastRun?(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`span`,{className:As(e.lastRun.status),children:js(e.lastRun.status)}),` `,(0,I.jsx)(`span`,{className:`cell-meta`,children:e.lastRun.label})]}):(0,I.jsx)(`span`,{className:`cell-meta`,children:`—`})})]})}function Pv({health:e,loading:t,retrying:n,onRefresh:r,onRetry:i}){let a=e?.crontab_sync;return t&&!a?(0,I.jsx)(`p`,{className:`settings-card-copy`,children:`Checking OS crontab sync…`}):a?a.ok?(0,I.jsxs)(`div`,{className:`settings-health settings-health-ok`,children:[(0,I.jsx)(`div`,{className:`settings-health-main`,children:`OS crontab sync is healthy`}),(0,I.jsx)(`p`,{className:`settings-card-copy`,children:`Scheduled routine changes are installed in the OS crontab.`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:r,children:`Refresh status`})]}):(0,I.jsxs)(`div`,{className:`settings-health settings-health-warn`,children:[(0,I.jsx)(`div`,{className:`settings-health-main`,children:`⚠ OS crontab sync needs attention`}),(0,I.jsx)(`p`,{className:`settings-card-copy`,children:`Scheduled routine changes may not fire until macOS allows Moadim to write the crontab again.`}),a.last_error&&(0,I.jsx)(`div`,{className:`settings-health-error`,children:a.last_error}),a.last_error_at&&(0,I.jsxs)(`div`,{className:`settings-health-meta`,children:[`Last failed: `,Fv(a.last_error_at)]}),(0,I.jsxs)(`ol`,{className:`settings-recovery-list`,"aria-label":`Crontab sync recovery steps`,children:[(0,I.jsx)(`li`,{children:`Open macOS System Settings → Privacy & Security → Full Disk Access.`}),(0,I.jsx)(`li`,{children:`Allow the Moadim daemon or the launcher that starts it.`}),(0,I.jsx)(`li`,{children:`Restart Moadim if you changed permissions, then click Retry sync now.`})]}),(0,I.jsxs)(`div`,{className:`settings-health-actions`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn btn-primary`,disabled:n,onClick:i,children:n?`Retrying…`:`Retry sync now`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:r,children:`Refresh status`})]})]}):(0,I.jsxs)(`div`,{className:`settings-health settings-health-unknown`,children:[(0,I.jsx)(`div`,{className:`settings-health-main`,children:`Health details unavailable`}),(0,I.jsx)(`p`,{className:`settings-card-copy`,children:`Refresh status once the daemon is reachable.`}),(0,I.jsx)(`button`,{type:`button`,className:`btn btn-secondary`,onClick:r,children:`Refresh status`})]})}function Fv(e){return new Date(e*1e3).toLocaleString()}function Iv(){let{addToast:e}=Xa(),t=zi(),n=Bi(),r=Ni(3e4),i=Pi(),a=Vi(),o=Hi(),[s,c]=(0,x.useState)(``),[l,u]=(0,x.useState)(``),[d,f]=(0,x.useState)(ss),[p,m]=(0,x.useState)(ja),[h,g]=(0,x.useState)(``),[_,v]=(0,x.useState)(void 0);t.data!==void 0&&t.data!==_&&(v(t.data),c(t.data),u(t.data));let y=s!==l,[b,S]=(0,x.useState)(void 0);a.data!==void 0&&a.data.override_value!==b&&(S(a.data.override_value),g(a.data.override_value===null?``:String(a.data.override_value)));let C=h!==(b===null?``:String(b??``)),w=h.trim()===``||/^\d+$/.test(h.trim()),T=()=>{let t=h.trim(),n=t===``?null:Number.parseInt(t,10);o.mutate(n,{onSuccess:()=>e(`Concurrency cap saved`,`ok`),onError:t=>e(`Save failed: ${t.message}`,`err`)})},ee=()=>{n.mutate(s,{onSuccess:()=>{u(s),e(`Prompt saved`,`ok`)},onError:t=>e(`Save failed: ${t.message}`,`err`)})},te=t=>{cs(t),f(t),e(`Refresh cadence saved`,`ok`)},E=t=>{Ma(t),m(t),e(`Theme saved`,`ok`)};return(0,I.jsxs)(`div`,{children:[(0,I.jsx)(`h1`,{className:`page-title`,children:`Settings`}),(0,I.jsxs)(`div`,{className:`card settings-card`,children:[(0,I.jsx)(`div`,{className:`settings-card-title`,children:`Appearance`}),(0,I.jsx)(`p`,{className:`settings-card-copy`,children:`Choose the app theme. This replaces the header theme toggle so appearance lives with the rest of Settings.`}),(0,I.jsxs)(`div`,{className:`settings-segmented`,role:`group`,"aria-label":`Theme`,children:[(0,I.jsx)(`button`,{type:`button`,className:`btn ${p?`btn-primary`:`btn-secondary`}`,"aria-pressed":p,onClick:()=>E(!0),children:`Light`}),(0,I.jsx)(`button`,{type:`button`,className:`btn ${p?`btn-secondary`:`btn-primary`}`,"aria-pressed":!p,onClick:()=>E(!1),children:`Dark`})]})]}),(0,I.jsxs)(`div`,{className:`card settings-card`,children:[(0,I.jsx)(`div`,{className:`settings-card-title`,children:`Data refresh`}),(0,I.jsx)(`p`,{className:`settings-card-copy`,children:`Choose how often the app pulls fresh daemon data. The same cadence is used by overview, routines, logs, heatmap, machines, and reliability views.`}),(0,I.jsx)(ds,{token:d,updatedAtMs:0,onChange:te})]}),(0,I.jsxs)(`div`,{className:`card settings-card`,children:[(0,I.jsx)(`div`,{className:`settings-card-title`,children:`Concurrency`}),(0,I.jsxs)(`p`,{className:`settings-card-copy`,children:[`The most routines this daemon will run at once fleet-wide. Extra due routines wait for a slot instead of starting immediately. Takes effect on the next trigger check — no restart required. Leave blank to fall back to the `,(0,I.jsx)(`code`,{children:`MOADIM_MAX_CONCURRENT_RUNS`}),` env var, or the built-in default if that isn't set either.`]}),a.isLoading?(0,I.jsx)(`div`,{children:`Loading…`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsxs)(`div`,{className:`settings-card-copy`,children:[`Effective cap right now:`,` `,(0,I.jsx)(`strong`,{children:a.data?.value===0?`unbounded`:a.data?.value})]}),(0,I.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginTop:8},children:[(0,I.jsx)(`input`,{type:`number`,min:0,step:1,className:`form-input`,style:{width:120},placeholder:`unset`,"aria-label":`Max concurrent runs override`,value:h,onChange:e=>g(e.target.value)}),(0,I.jsx)(`button`,{className:`btn btn-primary`,disabled:!C||!w||o.isPending,onClick:T,children:o.isPending?`Saving…`:`Save`}),h.trim()!==``&&(0,I.jsx)(`button`,{type:`button`,className:`btn btn-ghost`,disabled:o.isPending,onClick:()=>g(``),children:`Clear`}),C&&w&&(0,I.jsx)(`span`,{style:{color:`var(--text-faint)`,fontSize:12},children:`unsaved changes`}),!w&&(0,I.jsx)(`span`,{style:{color:`var(--err)`,fontSize:12},children:`must be a whole number ≥ 0`})]})]})]}),(0,I.jsxs)(`div`,{className:`card settings-card settings-health-card`,children:[(0,I.jsx)(`div`,{className:`settings-card-title`,children:`System health`}),(0,I.jsx)(Pv,{health:r.data,loading:r.isLoading,retrying:i.isPending,onRefresh:()=>void r.refetch(),onRetry:()=>{i.mutate(void 0,{onSuccess:t=>{t.crontab_sync.ok?e(`Crontab sync recovered`,`ok`):e(`Crontab sync still needs attention`,`err`)},onError:t=>e(`Retry failed: ${t.message}`,`err`)})}})]}),(0,I.jsxs)(`div`,{className:`card`,style:{padding:16},children:[(0,I.jsx)(`div`,{style:{fontWeight:700,marginBottom:4},children:`Persistent prompt`}),(0,I.jsx)(`p`,{style:{color:`var(--text-dim)`,fontSize:13,marginTop:0},children:`Appended to every routine's agent instructions file (CLAUDE.md/AGENTS.md), alongside the moadim-managed preamble, on every run.`}),t.isLoading?(0,I.jsx)(`div`,{children:`Loading…`}):(0,I.jsxs)(I.Fragment,{children:[(0,I.jsx)(`textarea`,{className:`form-textarea`,rows:12,placeholder:"e.g. always run `cargo fmt` before finishing a task",value:s,onChange:e=>c(e.target.value)}),(0,I.jsxs)(`div`,{style:{display:`flex`,alignItems:`center`,gap:10,marginTop:10},children:[(0,I.jsx)(`button`,{className:`btn btn-primary`,disabled:!y||n.isPending,onClick:ee,children:n.isPending?`Saving…`:`Save`}),y&&(0,I.jsx)(`span`,{style:{color:`var(--text-faint)`,fontSize:12},children:`unsaved changes`})]})]})]})]})}function Lv(){return(0,I.jsx)(Vt,{children:(0,I.jsxs)(zt,{element:(0,I.jsx)($o,{}),children:[(0,I.jsx)(zt,{index:!0,element:(0,I.jsx)(Rs,{})}),(0,I.jsx)(zt,{path:`routines`,element:(0,I.jsx)(S_,{})}),(0,I.jsx)(zt,{path:`runs`,element:(0,I.jsx)(M_,{})}),(0,I.jsx)(zt,{path:`runs/:routineId/:workbench`,element:(0,I.jsx)(N_,{})}),(0,I.jsx)(zt,{path:`heatmap`,element:(0,I.jsx)(iv,{})}),(0,I.jsx)(zt,{path:`reliability`,element:(0,I.jsx)(Ev,{})}),(0,I.jsx)(zt,{path:`machines`,element:(0,I.jsx)(Mv,{})}),(0,I.jsx)(zt,{path:`settings`,element:(0,I.jsx)(Iv,{})}),(0,I.jsx)(zt,{path:`*`,element:(0,I.jsx)(Lt,{to:`/`,replace:!0})})]})})}function Rv(){return(0,I.jsx)(Ya,{children:(0,I.jsx)(Lv,{})})}var zv=new Jr({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Bv=document.getElementById(`root`);if(!Bv)throw Error(`#root element missing`);(0,mi.createRoot)(Bv).render((0,I.jsx)(x.StrictMode,{children:(0,I.jsx)(Qr,{client:zv,children:(0,I.jsx)(On,{children:(0,I.jsx)(Rv,{})})})}));</script>
<style rel="stylesheet" crossorigin>:root,html.theme-light{--bg:#f4f1e8;--surface:#fff;--surface-2:#f9f5df;--border:#0a0a0a;--border-strong:#0a0a0a;--text:#0a0a0a;--text-dim:#332f24;--text-faint:#5f5744;--accent:#ffd400;--accent-ink:#0a0a0a;--ok:#16833a;--ok-bg:#dff8e7;--err:#d02f21;--err-bg:#ffe0db;--warn:#9f6800;--warn-bg:#fff0b8;--sans:Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;--mono:"SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;--radius:0;--shadow:6px 6px 0 0 var(--border);--shadow-lg:10px 10px 0 0 var(--border);--shadow-hover:8px 8px 0 0 var(--border);--shadow-active:2px 2px 0 0 var(--border);--grid-line:color-mix(in srgb, var(--text) 6%, var(--bg));--lightningcss-light:initial;--lightningcss-dark: ;color-scheme:light}html:not(.theme-light){--bg:#0a0a0a;--surface:#181818;--surface-2:#24210e;--border:#f4f1e8;--border-strong:#f4f1e8;--text:#f4f1e8;--text-dim:#d8d0bb;--text-faint:#a89f88;--accent:#ffd400;--accent-ink:#0a0a0a;--ok:#7ee68f;--ok-bg:#102515;--err:#ff7a68;--err-bg:#2d130f;--warn:#ffd400;--warn-bg:#2a2200;--grid-line:color-mix(in srgb, var(--text) 9%, var(--bg));--lightningcss-light: ;--lightningcss-dark:initial;color-scheme:dark}*{box-sizing:border-box}html,body,#root{height:100%}body{background:var(--bg);color:var(--text);font-family:var(--sans);-webkit-font-smoothing:antialiased;margin:0;font-size:14px;line-height:1.5;overflow-x:hidden}a{color:inherit}button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}.app-shell{flex-direction:column;min-height:100%;display:flex}.app-header{border-bottom:1px solid var(--border);background:var(--surface);align-items:center;gap:16px;padding:12px 20px;display:flex}.brand{letter-spacing:.02em;font-size:15px;font-weight:700}.brand-sub{color:var(--text-faint);margin-left:6px;font-weight:500}.header-spacer{flex:1}.header-right{align-items:center;gap:10px;display:flex}.dep-warn{border-radius:var(--radius);background:var(--warn-bg);color:var(--warn);padding:3px 8px;font-size:12px;font-weight:600}.health{color:var(--text-dim);align-items:center;gap:6px;font-size:12px;display:flex}.health-dot{background:var(--text-faint);border-radius:50%;width:8px;height:8px}.health-dot.ok{background:var(--ok)}.health-dot.error{background:var(--err)}.machine-badge,.icon-btn{border:1px solid var(--border);background:var(--surface);border-radius:var(--radius);cursor:pointer;padding:6px 10px;font-size:12px;font-weight:600}.machine-badge:hover,.icon-btn:hover{border-color:var(--border-strong)}.icon-btn.danger{color:var(--err);border-color:var(--err)}.icon-btn.danger:disabled{opacity:.4;cursor:not-allowed}.notif-root,.notif-bell{position:relative}.notif-badge{background:var(--err);color:#fff;text-align:center;border-radius:999px;min-width:16px;height:16px;padding:0 4px;font-size:10px;font-weight:700;line-height:16px;position:absolute;top:-6px;right:-6px}.notif-panel{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);width:320px;max-height:420px;box-shadow:var(--shadow);z-index:150;flex-direction:column;display:flex;position:absolute;top:calc(100% + 6px);right:0}.notif-panel-hd{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:10px 12px;display:flex}.notif-panel-title{letter-spacing:.04em;color:var(--text-dim);font-size:11px;font-weight:700}.notif-panel-acts{gap:4px;display:flex}.notif-empty{text-align:center;color:var(--text-faint);padding:24px 12px;font-size:13px}.notif-list{margin:0;padding:4px;list-style:none;overflow-y:auto}.notif-item a{border-radius:var(--radius);color:inherit;flex-direction:column;gap:2px;padding:8px 10px;text-decoration:none;display:flex}.notif-item a:hover{background:var(--surface-2)}.notif-item.unread a{background:var(--err-bg)}.notif-item-title{font-size:13px;font-weight:700}.notif-item-msg{color:var(--text-dim);font-size:12px}.notif-item-time{color:var(--text-faint);font-size:11px}.app-nav{border-bottom:1px solid var(--border);background:var(--surface);gap:4px;padding:0 20px;display:flex}.nav-link{color:var(--text-dim);border-bottom:2px solid #0000;padding:10px 12px;font-size:13px;font-weight:600;text-decoration:none}.nav-link:hover{color:var(--text)}.nav-link.active{color:var(--accent);border-bottom-color:var(--accent)}.page{flex:1;width:100%;max-width:1200px;margin:0 auto;padding:24px 20px 60px}.page-title{margin:0 0 16px;font-size:20px;font-weight:700}.card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow)}.btn{border-radius:var(--radius);border:1px solid var(--border-strong);background:var(--surface);cursor:pointer;padding:7px 14px;font-size:13px;font-weight:600}.btn:hover{border-color:var(--accent)}.btn-danger{background:var(--err);border-color:var(--err);color:#fff}.btn-ghost{background:0 0;border-color:#0000}.btn:disabled{opacity:.5;cursor:not-allowed}.overlay{z-index:100;background:#14130f66;justify-content:center;align-items:flex-start;padding-top:12vh;display:flex;position:fixed;inset:0}.dialog{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);min-width:340px;max-width:90vw;padding:20px}.dialog-title{margin-bottom:8px;font-weight:700}.dialog-msg{color:var(--text-dim);margin-bottom:16px;font-size:13px}.dialog-actions{justify-content:flex-end;gap:8px;display:flex}.move-dialog{border:4px solid var(--border-strong);box-shadow:8px 8px 0 var(--border-strong);gap:14px;width:min(680px,92vw);padding:0;display:grid}.move-dialog-hd{background:var(--accent);border-bottom:4px solid var(--border-strong);color:var(--accent-ink);justify-content:space-between;align-items:flex-start;gap:16px;padding:16px 18px;display:flex}.move-dialog-title{letter-spacing:.08em;margin-bottom:4px;font-size:18px;font-weight:950}.move-dialog-sub{letter-spacing:.04em;text-transform:uppercase;font-size:12px;font-weight:800}.move-dialog-badge,.move-current-label,.move-preview-label{letter-spacing:.1em;text-transform:uppercase;font-size:11px;font-weight:950}.move-dialog-badge{background:var(--surface);border:3px solid var(--border-strong);color:var(--text);padding:5px 9px}.move-current-card,.move-path-grid,.move-preview,.move-dialog-actions{margin-left:18px;margin-right:18px}.move-current-card,.move-preview{background:var(--surface-2);border:3px solid var(--border-strong);box-shadow:4px 4px 0 var(--border-strong);padding:12px}.move-current-label,.move-preview-label{color:var(--text-faint);margin-bottom:8px}.move-current-row{align-items:center;gap:10px;display:flex}.move-current-copy{gap:2px;min-width:0;display:grid}.move-current-copy strong{text-overflow:ellipsis;white-space:nowrap;font-weight:950;overflow:hidden}.move-current-copy span,.move-preview-path{color:var(--text-dim);font-family:var(--mono);overflow-wrap:anywhere;font-size:12px}.move-path-grid{grid-template-columns:minmax(0,1fr) minmax(180px,.7fr);gap:12px;display:grid}.move-form-group{margin:0}.move-input{font-family:var(--mono);border-width:3px;font-weight:700}.move-preview{margin-bottom:2px}.move-dialog-actions{border-top:3px solid var(--border-strong);padding:14px 0 18px}.shortcuts-dialog{width:360px}.shortcuts-list{flex-direction:column;gap:10px;margin:0 0 16px;padding:0;list-style:none;display:flex}.shortcuts-list li{align-items:center;gap:6px;font-size:13px;display:flex}.shortcuts-list li>span:last-child{color:var(--text-dim);margin-left:6px}.form-label{color:var(--text-dim);letter-spacing:.02em;margin-bottom:6px;font-size:12px;font-weight:700;display:block}.form-input,.form-textarea,.form-select{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);width:100%;padding:8px 10px;font-size:13px}.form-textarea{font-family:var(--mono);resize:vertical}.toast-wrap{z-index:200;flex-direction:column;gap:8px;display:flex;position:fixed;bottom:16px;right:16px}.toast{border-radius:var(--radius);box-shadow:var(--shadow);padding:10px 14px;font-size:13px;font-weight:600}.toast.ok{background:var(--ok-bg);color:var(--ok)}.toast.err{background:var(--err-bg);color:var(--err)}.cmdk{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);width:560px;max-width:92vw;box-shadow:var(--shadow);overflow:hidden}.cmdk-search{border-bottom:1px solid var(--border);align-items:center;gap:8px;padding:12px 14px;display:flex}.cmdk-input{background:0 0;border:none;outline:none;flex:1;font-size:14px}.cmdk-hint{color:var(--text-faint);border:1px solid var(--border);border-radius:4px;padding:1px 5px;font-size:11px}.cmdk-list{max-height:50vh;margin:0;padding:6px;list-style:none;overflow-y:auto}.cmdk-row{border-radius:var(--radius);cursor:pointer;align-items:center;gap:10px;padding:8px 10px;display:flex}.cmdk-row.active{background:var(--surface-2)}.kind-badge{background:var(--surface-2);color:var(--text-dim);border-radius:4px;flex-shrink:0;padding:2px 6px;font-size:10px;font-weight:700}.cmdk-row-text{flex-direction:column;flex:1;min-width:0;display:flex}.cmdk-row-action{opacity:0;flex-shrink:0}.cmdk-row:hover .cmdk-row-action,.cmdk-row.active .cmdk-row-action{opacity:1}.cmdk-row-title{font-size:13px;font-weight:600}.cmdk-row-sub{color:var(--text-faint);white-space:nowrap;text-overflow:ellipsis;font-size:12px;overflow:hidden}.cmdk-empty{text-align:center;color:var(--text-faint);padding:24px}.cmdk-foot{border-top:1px solid var(--border);color:var(--text-faint);gap:14px;padding:8px 14px;font-size:11px;display:flex}.cmdk-key{border:1px solid var(--border);border-radius:4px;margin-right:3px;padding:0 4px}.stats{grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;margin-bottom:20px;display:grid}.stat-card{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px}.stat-card-wide{grid-column:span 2}.stat-label{letter-spacing:.04em;color:var(--text-faint);margin-bottom:6px;font-size:11px;font-weight:700}.stat-val{color:var(--text);font-size:24px;font-weight:700}.stat-val-sm{font-size:16px}.c-accent{color:var(--accent)}.c-red{color:var(--err)}.c-amber{color:var(--warn)}.section-hd{justify-content:space-between;align-items:center;margin:24px 0 8px;display:flex}.section-label{letter-spacing:.05em;color:var(--text-dim);font-size:12px;font-weight:700}.section-label.attn{color:var(--err)}.section-acts{align-items:center;gap:10px;display:flex}.table-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow-x:auto}.table-wrap table{border-collapse:collapse;width:100%;font-size:13px}.table-wrap th{text-align:left;letter-spacing:.04em;color:var(--text-faint);border-bottom:1px solid var(--border);white-space:nowrap;padding:10px 14px;font-size:11px;font-weight:700}.table-wrap td{border-bottom:1px solid var(--border);vertical-align:middle;padding:10px 14px}.table-wrap tbody tr:last-child td{border-bottom:none}.table-wrap tbody tr:hover{background:var(--surface-2)}.empty{text-align:center;flex-direction:column;justify-content:center;align-items:center;gap:4px;padding:36px 14px;display:flex}.empty-icon{color:var(--text-faint);font-size:22px}.empty-msg{letter-spacing:.04em;color:var(--text-dim);font-size:12px;font-weight:700}.empty-sub{color:var(--text-faint);font-size:12px}.spinner{border:2px solid var(--border);border-top-color:var(--accent);border-radius:50%;width:20px;height:20px;animation:.7s linear infinite spin}@keyframes spin{to{transform:rotate(360deg)}}.ov-name-link{font-weight:600;text-decoration:none}.ov-name-link:hover{color:var(--accent);text-decoration:underline}.ov-flag-badge{color:var(--warn);background:var(--warn-bg);border-radius:4px;margin-left:8px;padding:1px 6px;font-size:11px;font-weight:700}.kind-badge.routine{background:var(--surface-2);color:var(--text-dim)}.attn-badge{color:var(--err);background:var(--err-bg);letter-spacing:.02em;border-radius:4px;padding:2px 7px;font-size:11px;font-weight:700}.attn-detail,.cell-schedule-human,.cell-time,.cell-meta{color:var(--text-dim)}.cell-next-when{font-weight:600}.cell-next-until{color:var(--text-faint);font-size:12px}.cell-next-until.soon{color:var(--err);font-weight:600}.cell-act{text-align:right}.btn-sm{padding:4px 10px;font-size:12px}.run-now-btn{border:1px solid var(--border-strong)}.refresh-control{align-items:center;gap:8px;display:flex}.refresh-lbl{letter-spacing:.04em;color:var(--text-faint);font-size:11px;font-weight:700}.refresh-select{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:5px 8px;font-size:12px}.refresh-fresh{color:var(--text-faint);font-size:11px}.settings-card{gap:8px;margin-bottom:16px;padding:16px;display:grid}.settings-card-title{font-weight:700}.settings-card-copy{color:var(--text-dim);max-width:70ch;margin:0;font-size:13px}.settings-segmented{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.settings-health{border:1px solid var(--border);border-radius:var(--radius);gap:8px;padding:12px;display:grid}.settings-health-ok{background:color-mix(in srgb, var(--ok) 10%, var(--surface));border-color:color-mix(in srgb, var(--ok) 45%, var(--border))}.settings-health-warn{background:color-mix(in srgb, var(--warn) 12%, var(--surface));border-color:color-mix(in srgb, var(--warn) 55%, var(--border))}.settings-health-unknown{background:var(--surface-2)}.settings-health-main{font-weight:700}.settings-health-error{font-family:var(--mono);overflow-wrap:anywhere;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius-sm);padding:8px;font-size:12px}.settings-health-meta{color:var(--text-faint);font-size:12px}.settings-recovery-list{color:var(--text-dim);margin:0;padding-left:20px;font-size:13px}.settings-health-actions{flex-wrap:wrap;gap:8px;display:flex}.hm-hd{justify-content:space-between;align-items:center;gap:12px;margin-bottom:16px;display:flex}.hm-hd-acts{align-items:center;gap:14px;display:flex}.hm-filter{gap:4px;display:flex}.hm-filter-btn{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);cursor:pointer;color:var(--text-dim);padding:5px 12px;font-size:12px;font-weight:600}.hm-filter-btn:hover{border-color:var(--accent);color:var(--text)}.hm-filter-btn.active{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.hm-grid-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:14px;overflow-x:auto}.hm-grid{grid-template-columns:64px repeat(24,minmax(26px,1fr)) 44px;gap:3px;min-width:760px;display:grid}.hm-corner,.hm-hcol{letter-spacing:.03em;color:var(--text-faint);text-align:center;padding:4px 0;font-size:10px;font-weight:700}.hm-corner{text-align:left}.hm-hcol.now{color:var(--accent)}.hm-daylabel{color:var(--text-dim);text-align:left;cursor:pointer;border-radius:var(--radius);background:0 0;border:none;padding:0 6px;font-size:11px;font-weight:700}.hm-daylabel:hover{color:var(--accent);background:var(--surface-2)}.hm-daylabel.today{color:var(--accent)}.hm-daylabel.hm-foot{cursor:default;color:var(--text-faint);border-top:1px solid var(--border);padding-top:6px;font-weight:700}.hm-daylabel.hm-foot:hover{color:var(--text-faint);background:0 0}.hm-cell{border:1px solid var(--border);background:var(--surface-2);aspect-ratio:1;cursor:pointer;border-radius:3px;justify-content:center;align-items:center;min-height:22px;padding:0;display:flex}.hm-cell:hover{border-color:var(--accent)}.hm-cell.now{border-color:var(--accent);border-width:2px}.hm-cell.peak{box-shadow:0 0 0 2px var(--accent) inset}.hm-n{color:var(--text);font-size:10px;font-weight:700}.hm-rowtot{color:var(--text-faint);text-align:center;padding:2px 0;font-size:11px}.hm-rowtot.hm-foot{border-top:1px solid var(--border);color:var(--text-dim);padding-top:6px;font-weight:700}.hm-rowtot.grand{color:var(--accent)}.hm-legend{color:var(--text-faint);align-items:center;gap:6px;margin-top:12px;font-size:11px;display:flex}.hm-legend-label{letter-spacing:.03em;font-weight:700}.hm-legend-swatch{aspect-ratio:auto;cursor:default;border-radius:3px;width:14px;height:14px;min-height:0}.hm-legend-note{margin-left:8px}.hm-day{margin-top:20px;padding:16px}.hm-day-nav{align-items:center;gap:8px;margin-bottom:12px;display:flex}.hm-day-title{letter-spacing:.03em;font-size:13px;font-weight:700}.hm-day-spacer{flex:1}.hm-day-hours{flex-direction:column;gap:2px;max-height:520px;display:flex;overflow-y:auto}.hm-day-hour{border-bottom:1px solid var(--border);grid-template-columns:56px 1fr;gap:10px;padding:4px 6px;display:grid}.hm-day-hour.now{background:var(--surface-2);border-radius:var(--radius)}.hm-day-hour-label{color:var(--text-faint);padding-top:3px;font-size:11px}.hm-day-hour-slot{flex-wrap:wrap;gap:6px;display:flex}.hm-day-chip{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);align-items:center;gap:6px;padding:3px 8px;font-size:12px;display:flex}.hm-day-chip.snoozed{opacity:.55}.hm-day-chip-time{font-family:var(--mono);color:var(--text-dim);font-size:11px}.hm-day-chip-label{font-weight:600}.hm-day-chip-flag{color:var(--warn);font-size:11px}.filter-bar{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);flex-wrap:wrap;justify-content:space-between;align-items:center;gap:10px 14px;margin-bottom:12px;padding:12px 14px;display:flex}.filter-field{flex-wrap:wrap;align-items:center;gap:8px;display:flex}.filter-label{letter-spacing:.03em;color:var(--text-faint);font-size:11px;font-weight:700}.filter-input,.filter-select{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:6px 9px;font-size:12px}.filter-input{min-width:200px}.filter-count{color:var(--text-faint);font-size:12px}.saved-views-bar{margin-top:-4px}.group-by-ctrl{letter-spacing:.03em;color:var(--text-faint);align-items:center;gap:6px;font-size:11px;font-weight:700;display:flex}.view-toggle{border:1px solid var(--border-strong);border-radius:var(--radius);display:flex;overflow:hidden}.view-btn{background:var(--surface);color:var(--text-dim);cursor:pointer;border:none;padding:6px 10px;font-size:12px;font-weight:600}.view-btn+.view-btn{border-left:1px solid var(--border-strong)}.view-btn.active{background:var(--accent);color:var(--accent-ink)}.notify-toggle.active{border-color:var(--accent);color:var(--accent)}.btn-refresh{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);cursor:pointer;width:26px;height:26px;font-size:14px;line-height:1}.btn-refresh:hover{border-color:var(--accent)}.btn-refresh:disabled{opacity:.4;cursor:not-allowed}.stat-card{cursor:pointer;text-align:left;font:inherit;color:inherit}.stat-card.active{border-color:var(--accent);box-shadow:inset 0 0 0 1px var(--accent)}.stat-card.has-dormant .stat-val,.stat-card.has-flags .stat-val,.stat-card.has-unreg .stat-val,.stat-card.has-auto-disabled .stat-val{color:var(--warn)}.col-select{width:28px}.routine-table{table-layout:fixed;min-width:1180px}.routine-table th,.routine-table td{padding-left:10px;padding-right:10px}.routine-table th{white-space:normal;line-height:1.1}.routine-table td{overflow-wrap:anywhere}.routine-table th:first-child,.routine-table td:first-child{width:3%}.routine-table th:nth-child(2),.routine-table td:nth-child(2){width:14%}.routine-table th:nth-child(3),.routine-table td:nth-child(3){width:13%}.routine-table th:nth-child(4),.routine-table td:nth-child(4),.routine-table th:nth-child(5),.routine-table td:nth-child(5){width:8%}.routine-table th:nth-child(6),.routine-table td:nth-child(6),.routine-table th:nth-child(7),.routine-table td:nth-child(7){width:6%}.routine-table th:nth-child(8),.routine-table td:nth-child(8),.routine-table th:nth-child(9),.routine-table td:nth-child(9),.routine-table th:nth-child(11),.routine-table td:nth-child(11),.routine-table th:nth-child(13),.routine-table td:nth-child(13){width:4%}.routine-table th:nth-child(10),.routine-table td:nth-child(10){width:7%}.routine-table th:nth-child(12),.routine-table td:nth-child(12){width:6%}.routine-table th:nth-child(14),.routine-table td:nth-child(14){width:5%}.routine-table th:nth-child(15),.routine-table td:nth-child(15){width:14%}.th-sort{cursor:pointer;-webkit-user-select:none;user-select:none}.th-sort:hover{color:var(--text-dim)}.th-sort-active{color:var(--accent)!important}.row-selected td{background:var(--surface-2)}.group-hd td{background:var(--surface-2);padding:6px 14px;font-size:11px}.group-hd-row{justify-content:space-between;align-items:center;gap:12px;display:flex}.group-hd-toggle{font:inherit;color:inherit;cursor:pointer;background:0 0;border:none;align-items:center;gap:6px;padding:0;display:flex}.group-caret{color:var(--text-faint);width:8px;font-size:9px}.group-label{letter-spacing:.03em;font-weight:700}.group-count{color:var(--text-faint)}.group-health-chips{flex-wrap:wrap;gap:4px;display:flex}.group-controls{gap:8px;padding:6px 0;display:flex}.routine-fs-wrap{padding:14px}.routine-fs-summary{color:var(--text-faint);letter-spacing:.08em;text-transform:uppercase;margin-bottom:10px;font-size:12px;font-weight:800}.routine-fs-tree{gap:8px;display:grid}.routine-fs-folder,.routine-fs-file{margin-left:calc(var(--depth,0) * 22px)}.routine-fs-folder-toggle,.routine-fs-file{background:var(--surface-2);border:2px solid var(--border);color:inherit;text-align:left;min-width:0;width:calc(100% - (var(--depth,0) * 22px));align-items:center;gap:10px;padding:9px 10px;display:flex}.routine-fs-folder-toggle{cursor:pointer;font:inherit;font-weight:900}.routine-fs-caret{color:var(--text-faint);width:12px}.routine-fs-icon{flex:none}.routine-fs-folder-name,.routine-fs-file-title{text-overflow:ellipsis;white-space:nowrap;font-weight:900;overflow:hidden}.routine-fs-count{background:var(--surface);border:2px solid var(--border);margin-left:auto;padding:1px 6px;font-size:11px}.routine-fs-file{grid-template-columns:minmax(220px,1.2fr) minmax(180px,1fr) auto minmax(300px,1.4fr);display:grid}.routine-fs-file-main,.routine-fs-meta,.routine-fs-status,.routine-fs-actions{align-items:center;gap:8px;min-width:0;display:flex}.routine-fs-file-copy,.routine-fs-meta{min-width:0}.routine-fs-file-path{color:var(--text-faint);font-family:var(--mono);text-overflow:ellipsis;white-space:nowrap;font-size:11px;overflow:hidden}.routine-fs-meta{color:var(--text-dim);font-family:var(--mono);justify-content:space-between;font-size:12px}.routine-fs-status,.routine-fs-actions{justify-content:flex-end}.routine-fs-actions{flex-wrap:wrap}.routine-fs-actions .act-btn{padding:4px 7px;font-size:10px}.routine-fs-actions .act-btn.danger{color:var(--danger)}.cell-schedule{font-family:var(--mono);font-size:12px}.cell-goal{color:var(--text-faint);margin-top:2px;font-size:11px}.cell-next,.cell-no-machines{color:var(--text-faint)}.cell-handler{align-items:center;gap:6px;display:inline-flex}.handler-dot{background:var(--text-faint);border-radius:50%;width:7px;height:7px}.handler-dot.ok{background:var(--ok)}.handler-dot.warn{background:var(--warn)}.cell-triggered{color:var(--text-dim);font-size:12px}.sched-preview-btn{color:var(--text-faint);cursor:pointer;background:0 0;border:none;margin-top:4px;padding:0;font-size:11px;display:block}.sched-preview-btn:hover,.sched-preview-btn.open{color:var(--accent)}.fires-panel{background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);max-width:220px;margin-top:6px;padding:8px 10px;font-size:11px}.fires-hd{letter-spacing:.03em;color:var(--text-faint);margin-bottom:4px;font-weight:700}.fires-item{justify-content:space-between;gap:10px;padding:2px 0;display:flex}.fires-until,.fires-empty{color:var(--text-faint)}.spark{display:block}.spark-empty{font-size:12px}.muted{color:var(--text-faint)}.duration-chart{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);flex-direction:column;max-height:260px;margin-bottom:12px;padding:8px 12px;display:flex;overflow-y:auto}.duration-row{cursor:pointer;width:100%;font:inherit;color:inherit;text-align:left;background:0 0;border:none;border-radius:4px;align-items:center;gap:10px;padding:3px 0;display:flex}.duration-row:hover,.duration-row.row-selected{background:var(--surface-2)}.duration-row-time{color:var(--text-faint);flex:0 0 64px;font-size:11px}.duration-row-track{background:var(--border);border-radius:3px;flex:1;height:10px;overflow:hidden}.duration-bar{border-radius:3px;height:100%;display:block}.duration-bar.success{background:var(--ok)}.duration-bar.failed{background:var(--err)}.duration-bar.running{background:var(--warn)}.duration-bar.unknown{background:var(--text-faint)}.duration-row-dur{text-align:right;color:var(--text-faint);flex:0 0 56px;font-size:11px}.health-badge{letter-spacing:.03em;white-space:nowrap;border-radius:4px;padding:2px 7px;font-size:10px;font-weight:700;display:inline-block}.health-badge.healthy{background:var(--ok-bg);color:var(--ok)}.health-badge.disabled,.health-badge.power-saving,.health-badge.snoozed{background:var(--surface-2);color:var(--text-dim)}.health-badge.dormant,.health-badge.dead,.health-badge.agent-missing,.health-badge.auto-disabled{background:var(--err-bg);color:var(--err)}.health-badge.chip{padding:1px 5px;font-size:9px}.failure-chip{letter-spacing:.02em;white-space:nowrap;background:var(--warn-bg);color:var(--warn);border-radius:4px;margin-top:3px;padding:1px 5px;font-size:9px;font-weight:700;display:inline-block}.failure-chip.critical{background:var(--err-bg);color:var(--err)}.toggle{width:32px;height:18px;display:inline-block;position:relative}.toggle input{opacity:0;width:0;height:0}.toggle-track{background:var(--border-strong);border-radius:999px;transition:background .15s;position:absolute;inset:0}.toggle-track:before{content:"";background:var(--surface);border-radius:50%;width:14px;height:14px;transition:transform .15s;position:absolute;top:2px;left:2px}.toggle input:checked+.toggle-track{background:var(--accent)}.toggle input:checked+.toggle-track:before{transform:translate(14px)}.toggle-row{color:var(--text-dim);justify-content:space-between;align-items:center;padding:8px 0;font-size:12px;font-weight:700;display:flex}.row-actions{white-space:normal;flex-wrap:nowrap;justify-content:center;align-items:center;gap:6px;display:flex}.act-btn{border:2px solid var(--border);background:var(--surface);letter-spacing:.02em;min-height:26px;color:var(--text-dim);cursor:pointer;text-align:center;white-space:nowrap;border-radius:4px;padding:4px 7px;font-size:10px;font-weight:700;line-height:1;position:relative}.act-btn:hover{background:var(--surface-2);color:var(--text)}.act-btn:disabled{opacity:.4;cursor:not-allowed}.act-btn.del:hover{color:var(--err)}.act-btn.run{background:var(--ok-bg);border-color:var(--ok);color:var(--ok)}.actions-menu-root{justify-content:center;display:inline-flex;position:relative}.actions-menu-trigger{min-width:86px}.actions-menu{z-index:20;background:var(--surface);border:3px solid var(--border);min-width:168px;box-shadow:6px 6px 0 var(--border);text-align:left;padding:6px;display:grid;position:fixed}.actions-menu-item{color:var(--text);cursor:pointer;font:inherit;letter-spacing:.04em;text-align:left;text-transform:uppercase;white-space:nowrap;background:0 0;border:0;justify-content:space-between;align-items:center;gap:12px;padding:8px 10px;font-size:11px;font-weight:700;display:flex}.actions-menu-item:hover,.actions-menu-item:focus-visible{background:var(--accent);color:var(--border);outline:none}.actions-menu-item.danger{color:var(--err)}.actions-menu-item.danger:hover,.actions-menu-item.danger:focus-visible{background:var(--err-bg);color:var(--err)}.actions-menu-sep{background:var(--border-soft);height:1px;margin:5px 4px}.routine-actions-cell{text-align:center}.flag-badge{background:var(--warn-bg);color:var(--warn);border-radius:999px;margin-left:3px;padding:0 5px;font-size:9px;font-weight:700}.bulk-bar{background:var(--warn-bg);border:1px solid var(--warn);border-radius:var(--radius);justify-content:space-between;align-items:center;margin-bottom:12px;padding:8px 14px;display:flex}.bulk-count{color:var(--warn);font-size:12px;font-weight:700}.bulk-acts{gap:8px;display:flex}.create-page{max-width:720px;margin:0 auto}.page-card{padding:20px}.page-freshness{color:var(--text-faint);font-size:11px}.modal{flex-direction:column;width:640px;max-width:92vw;max-height:88vh;padding:0;display:flex}.modal-hd{border-bottom:1px solid var(--border);justify-content:space-between;align-items:center;padding:16px 20px;display:flex}.modal-title{font-weight:700}.modal-x{cursor:pointer;color:var(--text-faint);background:0 0;border:none;font-size:14px}.modal-x:hover{color:var(--text)}.modal-body{padding:20px;overflow-y:auto}.modal-ft{border-top:1px solid var(--border);justify-content:flex-end;gap:8px;padding:14px 20px;display:flex}.form-group{margin-bottom:16px}.cron-presets,.ttl-presets{flex-wrap:wrap;gap:6px;margin-top:6px;display:flex}.cron-schedule-list{gap:8px;display:grid}.cron-schedule-input{align-items:center;gap:8px;display:flex}.cron-schedule-input .form-input{min-width:0}.add-cron-btn{margin-top:8px}.preset-btn{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);cursor:pointer;padding:4px 9px;font-size:11px}.preset-btn:hover{border-color:var(--accent)}.cron-preview{color:var(--text-faint);margin-top:6px;font-size:12px}.cron-preview.ok{color:var(--ok)}.cron-preview.bad{color:var(--err)}@media (width<=560px){.cron-schedule-input{flex-direction:column;align-items:stretch}}.machine-chips{flex-wrap:wrap;gap:6px;margin-bottom:8px;display:flex}.machine-chip{border:1px solid var(--border-strong);background:var(--surface);cursor:pointer;border-radius:999px;padding:4px 11px;font-size:12px}.machine-chip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.machine-empty{color:var(--text-faint);margin-bottom:8px;font-size:12px}.machine-add{gap:8px;display:flex}.machine-add .form-input{flex:1}.logs-page{max-width:1000px;margin:0 auto}.page-hd{align-items:center;gap:12px;margin-bottom:16px;display:flex}.page-hd .page-title{flex:1;margin:0}.logs-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);max-height:70vh;overflow-y:auto}.logs-empty,.logs-error{color:var(--text-faint);padding:20px}.logs-error{color:var(--err)}.log-search{border-bottom:1px solid var(--border);background:var(--surface);align-items:center;gap:8px;padding:10px 14px;display:flex;position:sticky;top:0}.log-search-input{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);flex:1;padding:6px 9px;font-size:12px}.log-match-count{color:var(--text-faint);white-space:nowrap;font-size:11px}.log-lines{font-family:var(--mono);padding:4px 0;font-size:12px}.log-line{gap:12px;padding:1px 14px;display:flex}.log-line:hover{background:var(--surface-2)}.log-ln{color:var(--text-faint);text-align:right;-webkit-user-select:none;user-select:none;min-width:3.5em}.log-lc{white-space:pre-wrap;word-break:break-word}.log-hl{background:var(--warn-bg);color:var(--warn);border-radius:2px}.flags-list{flex-direction:column;gap:10px;display:flex}.flags-count{color:var(--text-faint);font-size:12px}.flag-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px}.flag-item-hd{align-items:center;gap:10px;margin-bottom:6px;display:flex}.flag-type{text-transform:uppercase;font-size:12px;font-weight:700}.flag-scope{color:var(--text-faint);border:1px solid var(--border);border-radius:4px;padding:1px 6px;font-size:11px}.flag-age{color:var(--text-faint);flex:1;font-size:11px}.flag-desc{color:var(--text-dim);font-size:13px}.cal-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.cal-nav{border-bottom:1px solid var(--border);align-items:center;gap:10px;padding:12px 14px;display:flex}.cal-month{flex:1;font-weight:700}.cal-weekdays{border-bottom:1px solid var(--border);grid-template-columns:repeat(7,1fr);display:grid}.cal-weekday{text-align:center;letter-spacing:.03em;color:var(--text-faint);padding:6px;font-size:10px;font-weight:700}.cal-grid{grid-template-columns:repeat(7,1fr);display:grid}.cal-day{border-right:1px solid var(--border);border-bottom:1px solid var(--border);cursor:pointer;outline:none;min-height:90px;padding:6px}.cal-day:focus-visible{box-shadow:inset 0 0 0 2px var(--accent)}.cal-day.other-month{background:var(--surface-2);color:var(--text-faint)}.cal-day.today .cal-daynum{color:var(--accent);font-weight:700}.cal-daynum{margin-bottom:4px;font-size:11px}.cal-hits{flex-direction:column;gap:2px;display:flex}.cal-chip{background:var(--surface-2);color:var(--text);font-size:10px;font:inherit;text-align:left;text-overflow:ellipsis;white-space:nowrap;border:0;border-radius:3px;padding:1px 5px;overflow:hidden}.cal-chip.clickable{cursor:pointer}.cal-chip.clickable:hover{background:var(--accent);color:var(--accent-ink)}.cal-chip.snoozed{opacity:.6}.cal-more{color:var(--text-faint);font-size:10px}.cal-day-dialog{width:min(560px,100vw - 32px);max-height:min(680px,100vh - 48px);overflow-y:auto}.cal-day-empty{border:1px dashed var(--border);color:var(--text-dim);text-align:center;margin-top:12px;padding:18px;font-size:13px}.cal-day-fire-list{flex-direction:column;gap:10px;margin:14px 0;display:flex}.cal-day-fire{background:var(--surface-2);border:1px solid var(--border);border-radius:6px;justify-content:space-between;align-items:flex-start;gap:12px;padding:10px;display:flex}.cal-day-fire-main{min-width:0}.cal-day-fire-title{margin-bottom:6px;font-size:13px;font-weight:700}.cal-day-fire-times{flex-wrap:wrap;gap:4px;display:flex}.cal-time-chip{background:var(--surface);border:1px solid var(--border);color:var(--text-dim);border-radius:3px;padding:2px 5px;font-size:11px}@media (width<=640px){.cal-day-fire{flex-direction:column;align-items:stretch}}.day-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.day-nav{border-bottom:1px solid var(--border);align-items:center;gap:10px;padding:12px 14px;display:flex}.day-date{flex:1;font-weight:700}.day-zoom{align-items:center;gap:6px;display:flex}.day-zoom-level{color:var(--text-faint);text-align:center;min-width:2em;font-size:11px}.day-scroll{max-height:70vh;overflow-y:auto}.day-hour{border-bottom:1px solid var(--border);min-height:var(--dh,40px);display:flex}.day-hour.now{background:var(--surface-2)}.day-hour-label{width:60px;color:var(--text-faint);border-right:1px solid var(--border);flex-direction:column;flex-shrink:0;gap:2px;padding:6px;font-size:11px;display:flex}.day-hour-label .qt,.day-hour-label .qt-end{color:var(--text-faint);opacity:.5;font-size:10px}.day-hour-slot{flex-wrap:wrap;flex:1;align-content:flex-start;gap:4px;padding:4px 8px;display:flex;position:relative}.day-scroll.detail .day-hour-slot{display:block}.day-scroll.detail .day-chip{position:absolute;left:8px;right:8px}.day-chip{color:var(--text);font:inherit;background:var(--surface-2);text-align:left;border:0;border-radius:4px;align-items:center;gap:5px;padding:2px 7px;font-size:11px;display:inline-flex}.day-chip.clickable{cursor:pointer}.day-chip.clickable:hover{background:var(--accent);color:var(--accent-ink)}.day-chip.snoozed{opacity:.6}.day-chip-time{font-family:var(--mono);color:var(--text-dim);font-size:10px}.day-chip-label{font-weight:600}.day-chip-flag{color:var(--warn);font-size:10px}@media (width<=720px){.app-header{gap:10px;padding:10px 12px}.brand-sub{display:none}.header-right{gap:6px}.machine-badge,.icon-btn{min-height:40px;padding:8px 10px}.app-nav{-webkit-overflow-scrolling:touch;scrollbar-width:none;padding:0 12px;overflow-x:auto}.app-nav::-webkit-scrollbar{display:none}.nav-link{white-space:nowrap;flex:none;padding:12px 10px}.page{max-width:100vw;padding:16px 12px 40px;overflow-x:hidden}.stats{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.stat-card{min-width:0}.stat-label{overflow-wrap:anywhere}.section-hd,.section-acts,.filter-bar,.filter-field,.saved-views-bar .filter-field,.refresh-control,.group-by-ctrl{flex-direction:column;align-items:stretch;width:100%}.section-hd{gap:10px}.section-acts{gap:8px}.section-acts .btn,.filter-bar .btn,.filter-input,.filter-select,.refresh-select,.view-toggle,.group-by-ctrl,.group-by-ctrl .filter-select{width:100%;max-width:100%}.filter-input{min-width:0}.view-toggle{grid-template-columns:repeat(2,minmax(0,1fr));display:grid}.move-dialog{width:calc(100vw - 24px)}.move-dialog-hd,.move-path-grid{grid-template-columns:1fr;display:grid}.move-dialog-badge{justify-self:start}.move-current-card,.move-path-grid,.move-preview,.move-dialog-actions{margin-left:12px;margin-right:12px}.modal-hd,.modal-body,.modal-ft{padding-left:14px;padding-right:14px}.notif-panel{width:min(320px,92vw)}.routine-table{width:100%;min-width:0;display:block}.routine-table thead{display:none}.routine-table tbody,.routine-table tr,.routine-table td{width:100%;display:block}.routine-table tr{border-bottom:4px solid var(--border);padding:12px;display:grid}.routine-table tr:last-child{border-bottom:0}.routine-table th,.routine-table td{width:auto!important}.routine-table td{border-bottom-width:0;grid-template-columns:minmax(76px,.34fr) minmax(0,1fr);align-items:start;gap:10px;min-width:0;padding:8px 0;display:grid}.routine-table td:before{content:attr(data-label);color:var(--text-faint);letter-spacing:.1em;text-transform:uppercase;font-size:11px;font-weight:950}.routine-table .col-select,.routine-table .routine-title-cell,.routine-table .routine-actions-cell{grid-template-columns:1fr}.routine-table .routine-title-cell{padding-top:0}.routine-table .col-select:before,.routine-table .routine-title-cell:before,.routine-table .routine-actions-cell:before{margin-bottom:4px}.routine-table .col-select{width:100%}.routine-table .group-hd td{display:block}.routine-table .group-hd td:before{display:none}.routine-table .row-actions{white-space:normal;flex-wrap:wrap}.routine-table td:nth-child(6),.routine-table td:nth-child(8),.routine-table td:nth-child(9),.routine-table td:nth-child(10),.routine-table td:nth-child(11),.routine-table td:nth-child(13){display:none}.routine-table .cell-goal{line-height:1.35}.routine-table .health-badge{max-width:100%}.routine-fs-wrap{padding:10px}.routine-fs-file{margin-left:calc(var(--depth,0) * 12px);width:calc(100% - (var(--depth,0) * 12px));grid-template-columns:1fr}.routine-fs-folder{margin-left:calc(var(--depth,0) * 12px)}.routine-fs-folder-toggle{width:calc(100% - (var(--depth,0) * 12px))}.routine-fs-meta,.routine-fs-status,.routine-fs-actions{justify-content:flex-start}}body{background-color:var(--bg);background-image:linear-gradient(var(--grid-line) 1px, transparent 1px), linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);background-position:-1px -1px;background-size:32px 32px}:focus-visible{outline:3px solid var(--border);outline-offset:3px}.app-header,.app-nav{border-color:var(--border);background:var(--surface);border-width:0 0 4px}.app-header{text-transform:uppercase}.brand{background:var(--accent);border:3px solid var(--border);box-shadow:var(--shadow-active);color:var(--accent-ink);letter-spacing:.08em;padding:4px 8px;font-size:16px;font-weight:900}.brand-sub{color:inherit;font-weight:900}.nav-link{color:var(--text);letter-spacing:.08em;text-transform:uppercase;border:0;border-left:3px solid #0000;border-right:3px solid #0000;font-weight:900}.nav-link:hover,.nav-link.active{background:var(--accent);border-left-color:var(--border);border-right-color:var(--border);color:var(--accent-ink)}.page{max-width:1280px;padding-top:34px}.page-title{background:var(--accent);border:4px solid var(--border);box-shadow:var(--shadow);color:var(--accent-ink);letter-spacing:-.04em;text-transform:uppercase;margin:0 0 30px;padding:8px 12px;font-size:clamp(30px,5vw,58px);font-weight:950;line-height:.95;display:inline-block}.card,.stat-card,.table-wrap,.routine-fs-wrap,.settings-section,.reliability-card,.heatmap-card,.cal-wrap,.day-wrap,.modal,.dialog,.cmdk,.notif-panel,.global-lock-banner{background:var(--surface);border:4px solid var(--border);box-shadow:var(--shadow-lg);border-radius:0}.stats{gap:14px;margin-bottom:28px}.stat-card,.settings-section,.reliability-card,.heatmap-card{padding:16px}.section-hd{margin:26px 0 12px}.stat-label,.section-label,.form-label,th,.kind-badge,.view-toggle-label{color:var(--text);letter-spacing:.12em;text-transform:uppercase;font-weight:950}.stat-val{color:var(--text);letter-spacing:-.05em;font-size:34px;font-weight:950}.section-label,.dep-warn,.kind-badge,.status-pill,.pill,.flag-scope,.cmdk-hint,.cmdk-key{background:var(--accent);border:2px solid var(--border);color:var(--accent-ink);border-radius:0}.btn,.machine-badge,.icon-btn,.form-input,.form-textarea,.form-select,.cmdk-input,.search-input{background:var(--surface);border:3px solid var(--border);box-shadow:3px 3px 0 0 var(--border);color:var(--text);border-radius:0;font-weight:800}.btn,.machine-badge,.icon-btn,.nav-link,.cal-chip.clickable,.day-chip.clickable,.cmdk-row{transition:box-shadow .12s,transform .12s,background-color .12s}.btn:hover:not(:disabled),.machine-badge:hover,.icon-btn:hover:not(:disabled),.cal-chip.clickable:hover,.day-chip.clickable:hover,.cmdk-row.active{background:var(--accent);border-color:var(--border);color:var(--accent-ink);box-shadow:var(--shadow);transform:translate(-2px,-2px)}.btn:active:not(:disabled),.machine-badge:active,.icon-btn:active:not(:disabled){box-shadow:var(--shadow-active);transform:translate(2px,2px)}.btn-primary{background:var(--accent);border-color:var(--border);color:var(--accent-ink)}.btn-danger,.icon-btn.danger{background:var(--err-bg);border-color:var(--border);color:var(--err)}.health-dot{border:2px solid var(--border);border-radius:0;width:12px;height:12px}.table-wrap{overflow:auto}table{border-collapse:collapse}th{background:var(--accent);color:var(--accent-ink)}th,td{border-bottom:3px solid var(--border)}tr:last-child td{border-bottom:0}.cmdk-row,.notif-row,.cal-day,.day-hour,.log-line{border-color:var(--border)}.toast{border:3px solid var(--border);box-shadow:var(--shadow);border-radius:0}@media (width<=720px){.app-header{-webkit-overflow-scrolling:touch;overflow-x:auto}.page{box-sizing:border-box;width:100%;max-width:none}.stats{grid-template-columns:repeat(2,minmax(0,1fr))}.stat-card,.table-wrap,.filter-bar{box-sizing:border-box;width:100%}.section-label{width:auto;display:block}.routine-table tr{gap:6px}.routine-table td{grid-template-columns:minmax(0,1fr);gap:5px}.routine-table td:before{display:block}.routine-table .cell-schedule-human{overflow-wrap:normal;word-break:normal;max-width:100%}.routine-table .routine-actions-cell .row-actions{gap:10px 14px}.routine-table .routine-actions-cell .act-btn{padding:4px 0}}@media (prefers-reduced-motion:reduce){*,:before,:after{scroll-behavior:auto!important;transition-duration:.01ms!important;animation-duration:.01ms!important;animation-iteration-count:1!important}}
/*$vite$:1*/</style>
</head>
<body>
<div id="root"></div>
</body>
</html>