moadim 1.6.0

Loop engine for AI agents — routines over REST, MCP, and a built-in web UI
<!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 yE=Object.defineProperty;var e0=n=>{throw TypeError(n)};var gE=(n,a,i)=>a in n?yE(n,a,{enumerable:!0,configurable:!0,writable:!0,value:i}):n[a]=i;var t0=(n,a,i)=>gE(n,typeof a!="symbol"?a+"":a,i),Em=(n,a,i)=>a.has(n)||e0("Cannot "+i);var C=(n,a,i)=>(Em(n,a,"read from private field"),i?i.call(n):a.get(n)),Ce=(n,a,i)=>a.has(n)?e0("Cannot add the same private member more than once"):a instanceof WeakSet?a.add(n):a.set(n,i),oe=(n,a,i,l)=>(Em(n,a,"write to private field"),l?l.call(n,i):a.set(n,i),i),Te=(n,a,i)=>(Em(n,a,"access private method"),i);var Hf=(n,a,i,l)=>({set _(u){oe(n,a,u,i)},get _(){return C(n,a,l)}});(function(){const a=document.createElement("link").relList;if(a&&a.supports&&a.supports("modulepreload"))return;for(const u of document.querySelectorAll('link[rel="modulepreload"]'))l(u);new MutationObserver(u=>{for(const o of u)if(o.type==="childList")for(const m of o.addedNodes)m.tagName==="LINK"&&m.rel==="modulepreload"&&l(m)}).observe(document,{childList:!0,subtree:!0});function i(u){const o={};return u.integrity&&(o.integrity=u.integrity),u.referrerPolicy&&(o.referrerPolicy=u.referrerPolicy),u.crossOrigin==="use-credentials"?o.credentials="include":u.crossOrigin==="anonymous"?o.credentials="omit":o.credentials="same-origin",o}function l(u){if(u.ep)return;u.ep=!0;const o=i(u);fetch(u.href,o)}})();function vE(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}function pE(n){if(Object.prototype.hasOwnProperty.call(n,"__esModule"))return n;var a=n.default;if(typeof a=="function"){var i=function l(){return this instanceof l?Reflect.construct(a,arguments,this.constructor):a.apply(this,arguments)};i.prototype=a.prototype}else i={};return Object.defineProperty(i,"__esModule",{value:!0}),Object.keys(n).forEach(function(l){var u=Object.getOwnPropertyDescriptor(n,l);Object.defineProperty(i,l,u.get?u:{enumerable:!0,get:function(){return n[l]}})}),i}var Tm={exports:{}},wo={};/**
 * @license React
 * react-jsx-runtime.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var n0;function bE(){if(n0)return wo;n0=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.fragment");function i(l,u,o){var m=null;if(o!==void 0&&(m=""+o),u.key!==void 0&&(m=""+u.key),"key"in u){o={};for(var g in u)g!=="key"&&(o[g]=u[g])}else o=u;return u=o.ref,{$$typeof:n,type:l,key:m,ref:u!==void 0?u:null,props:o}}return wo.Fragment=a,wo.jsx=i,wo.jsxs=i,wo}var a0;function SE(){return a0||(a0=1,Tm.exports=bE()),Tm.exports}var h=SE(),Nm={exports:{}},Xe={};/**
 * @license React
 * react.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var s0;function xE(){if(s0)return Xe;s0=1;var n=Symbol.for("react.transitional.element"),a=Symbol.for("react.portal"),i=Symbol.for("react.fragment"),l=Symbol.for("react.strict_mode"),u=Symbol.for("react.profiler"),o=Symbol.for("react.consumer"),m=Symbol.for("react.context"),g=Symbol.for("react.forward_ref"),b=Symbol.for("react.suspense"),y=Symbol.for("react.memo"),_=Symbol.for("react.lazy"),w=Symbol.for("react.activity"),T=Symbol.iterator;function S(q){return q===null||typeof q!="object"?null:(q=T&&q[T]||q["@@iterator"],typeof q=="function"?q:null)}var N={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,j={};function R(q,ue,Oe){this.props=q,this.context=ue,this.refs=j,this.updater=Oe||N}R.prototype.isReactComponent={},R.prototype.setState=function(q,ue){if(typeof q!="object"&&typeof q!="function"&&q!=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,q,ue,"setState")},R.prototype.forceUpdate=function(q){this.updater.enqueueForceUpdate(this,q,"forceUpdate")};function k(){}k.prototype=R.prototype;function H(q,ue,Oe){this.props=q,this.context=ue,this.refs=j,this.updater=Oe||N}var F=H.prototype=new k;F.constructor=H,O(F,R.prototype),F.isPureReactComponent=!0;var J=Array.isArray;function pe(){}var G={H:null,A:null,T:null,S:null},re=Object.prototype.hasOwnProperty;function se(q,ue,Oe){var Ne=Oe.ref;return{$$typeof:n,type:q,key:ue,ref:Ne!==void 0?Ne:null,props:Oe}}function V(q,ue){return se(q.type,ue,q.props)}function K(q){return typeof q=="object"&&q!==null&&q.$$typeof===n}function P(q){var ue={"=":"=0",":":"=2"};return"$"+q.replace(/[=:]/g,function(Oe){return ue[Oe]})}var ie=/\/+/g;function Se(q,ue){return typeof q=="object"&&q!==null&&q.key!=null?P(""+q.key):ue.toString(36)}function be(q){switch(q.status){case"fulfilled":return q.value;case"rejected":throw q.reason;default:switch(typeof q.status=="string"?q.then(pe,pe):(q.status="pending",q.then(function(ue){q.status==="pending"&&(q.status="fulfilled",q.value=ue)},function(ue){q.status==="pending"&&(q.status="rejected",q.reason=ue)})),q.status){case"fulfilled":return q.value;case"rejected":throw q.reason}}throw q}function X(q,ue,Oe,Ne,Me){var Le=typeof q;(Le==="undefined"||Le==="boolean")&&(q=null);var Ie=!1;if(q===null)Ie=!0;else switch(Le){case"bigint":case"string":case"number":Ie=!0;break;case"object":switch(q.$$typeof){case n:case a:Ie=!0;break;case _:return Ie=q._init,X(Ie(q._payload),ue,Oe,Ne,Me)}}if(Ie)return Me=Me(q),Ie=Ne===""?"."+Se(q,0):Ne,J(Me)?(Oe="",Ie!=null&&(Oe=Ie.replace(ie,"$&/")+"/"),X(Me,ue,Oe,"",function(Lt){return Lt})):Me!=null&&(K(Me)&&(Me=V(Me,Oe+(Me.key==null||q&&q.key===Me.key?"":(""+Me.key).replace(ie,"$&/")+"/")+Ie)),ue.push(Me)),1;Ie=0;var ft=Ne===""?".":Ne+":";if(J(q))for(var tt=0;tt<q.length;tt++)Ne=q[tt],Le=ft+Se(Ne,tt),Ie+=X(Ne,ue,Oe,Le,Me);else if(tt=S(q),typeof tt=="function")for(q=tt.call(q),tt=0;!(Ne=q.next()).done;)Ne=Ne.value,Le=ft+Se(Ne,tt++),Ie+=X(Ne,ue,Oe,Le,Me);else if(Le==="object"){if(typeof q.then=="function")return X(be(q),ue,Oe,Ne,Me);throw ue=String(q),Error("Objects are not valid as a React child (found: "+(ue==="[object Object]"?"object with keys {"+Object.keys(q).join(", ")+"}":ue)+"). If you meant to render a collection of children, use an array instead.")}return Ie}function ce(q,ue,Oe){if(q==null)return q;var Ne=[],Me=0;return X(q,Ne,"","",function(Le){return ue.call(Oe,Le,Me++)}),Ne}function ye(q){if(q._status===-1){var ue=q._result;ue=ue(),ue.then(function(Oe){(q._status===0||q._status===-1)&&(q._status=1,q._result=Oe)},function(Oe){(q._status===0||q._status===-1)&&(q._status=2,q._result=Oe)}),q._status===-1&&(q._status=0,q._result=ue)}if(q._status===1)return q._result.default;throw q._result}var De=typeof reportError=="function"?reportError:function(q){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var ue=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof q=="object"&&q!==null&&typeof q.message=="string"?String(q.message):String(q),error:q});if(!window.dispatchEvent(ue))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",q);return}console.error(q)},Re={map:ce,forEach:function(q,ue,Oe){ce(q,function(){ue.apply(this,arguments)},Oe)},count:function(q){var ue=0;return ce(q,function(){ue++}),ue},toArray:function(q){return ce(q,function(ue){return ue})||[]},only:function(q){if(!K(q))throw Error("React.Children.only expected to receive a single React element child.");return q}};return Xe.Activity=w,Xe.Children=Re,Xe.Component=R,Xe.Fragment=i,Xe.Profiler=u,Xe.PureComponent=H,Xe.StrictMode=l,Xe.Suspense=b,Xe.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=G,Xe.__COMPILER_RUNTIME={__proto__:null,c:function(q){return G.H.useMemoCache(q)}},Xe.cache=function(q){return function(){return q.apply(null,arguments)}},Xe.cacheSignal=function(){return null},Xe.cloneElement=function(q,ue,Oe){if(q==null)throw Error("The argument must be a React element, but you passed "+q+".");var Ne=O({},q.props),Me=q.key;if(ue!=null)for(Le in ue.key!==void 0&&(Me=""+ue.key),ue)!re.call(ue,Le)||Le==="key"||Le==="__self"||Le==="__source"||Le==="ref"&&ue.ref===void 0||(Ne[Le]=ue[Le]);var Le=arguments.length-2;if(Le===1)Ne.children=Oe;else if(1<Le){for(var Ie=Array(Le),ft=0;ft<Le;ft++)Ie[ft]=arguments[ft+2];Ne.children=Ie}return se(q.type,Me,Ne)},Xe.createContext=function(q){return q={$$typeof:m,_currentValue:q,_currentValue2:q,_threadCount:0,Provider:null,Consumer:null},q.Provider=q,q.Consumer={$$typeof:o,_context:q},q},Xe.createElement=function(q,ue,Oe){var Ne,Me={},Le=null;if(ue!=null)for(Ne in ue.key!==void 0&&(Le=""+ue.key),ue)re.call(ue,Ne)&&Ne!=="key"&&Ne!=="__self"&&Ne!=="__source"&&(Me[Ne]=ue[Ne]);var Ie=arguments.length-2;if(Ie===1)Me.children=Oe;else if(1<Ie){for(var ft=Array(Ie),tt=0;tt<Ie;tt++)ft[tt]=arguments[tt+2];Me.children=ft}if(q&&q.defaultProps)for(Ne in Ie=q.defaultProps,Ie)Me[Ne]===void 0&&(Me[Ne]=Ie[Ne]);return se(q,Le,Me)},Xe.createRef=function(){return{current:null}},Xe.forwardRef=function(q){return{$$typeof:g,render:q}},Xe.isValidElement=K,Xe.lazy=function(q){return{$$typeof:_,_payload:{_status:-1,_result:q},_init:ye}},Xe.memo=function(q,ue){return{$$typeof:y,type:q,compare:ue===void 0?null:ue}},Xe.startTransition=function(q){var ue=G.T,Oe={};G.T=Oe;try{var Ne=q(),Me=G.S;Me!==null&&Me(Oe,Ne),typeof Ne=="object"&&Ne!==null&&typeof Ne.then=="function"&&Ne.then(pe,De)}catch(Le){De(Le)}finally{ue!==null&&Oe.types!==null&&(ue.types=Oe.types),G.T=ue}},Xe.unstable_useCacheRefresh=function(){return G.H.useCacheRefresh()},Xe.use=function(q){return G.H.use(q)},Xe.useActionState=function(q,ue,Oe){return G.H.useActionState(q,ue,Oe)},Xe.useCallback=function(q,ue){return G.H.useCallback(q,ue)},Xe.useContext=function(q){return G.H.useContext(q)},Xe.useDebugValue=function(){},Xe.useDeferredValue=function(q,ue){return G.H.useDeferredValue(q,ue)},Xe.useEffect=function(q,ue){return G.H.useEffect(q,ue)},Xe.useEffectEvent=function(q){return G.H.useEffectEvent(q)},Xe.useId=function(){return G.H.useId()},Xe.useImperativeHandle=function(q,ue,Oe){return G.H.useImperativeHandle(q,ue,Oe)},Xe.useInsertionEffect=function(q,ue){return G.H.useInsertionEffect(q,ue)},Xe.useLayoutEffect=function(q,ue){return G.H.useLayoutEffect(q,ue)},Xe.useMemo=function(q,ue){return G.H.useMemo(q,ue)},Xe.useOptimistic=function(q,ue){return G.H.useOptimistic(q,ue)},Xe.useReducer=function(q,ue,Oe){return G.H.useReducer(q,ue,Oe)},Xe.useRef=function(q){return G.H.useRef(q)},Xe.useState=function(q){return G.H.useState(q)},Xe.useSyncExternalStore=function(q,ue,Oe){return G.H.useSyncExternalStore(q,ue,Oe)},Xe.useTransition=function(){return G.H.useTransition()},Xe.version="19.2.7",Xe}var i0;function My(){return i0||(i0=1,Nm.exports=xE()),Nm.exports}var z=My();const _t=vE(z);var _m={exports:{}},Co={},Om={exports:{}},wm={};/**
 * @license React
 * scheduler.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var r0;function EE(){return r0||(r0=1,(function(n){function a(X,ce){var ye=X.length;X.push(ce);e:for(;0<ye;){var De=ye-1>>>1,Re=X[De];if(0<u(Re,ce))X[De]=ce,X[ye]=Re,ye=De;else break e}}function i(X){return X.length===0?null:X[0]}function l(X){if(X.length===0)return null;var ce=X[0],ye=X.pop();if(ye!==ce){X[0]=ye;e:for(var De=0,Re=X.length,q=Re>>>1;De<q;){var ue=2*(De+1)-1,Oe=X[ue],Ne=ue+1,Me=X[Ne];if(0>u(Oe,ye))Ne<Re&&0>u(Me,Oe)?(X[De]=Me,X[Ne]=ye,De=Ne):(X[De]=Oe,X[ue]=ye,De=ue);else if(Ne<Re&&0>u(Me,ye))X[De]=Me,X[Ne]=ye,De=Ne;else break e}}return ce}function u(X,ce){var ye=X.sortIndex-ce.sortIndex;return ye!==0?ye:X.id-ce.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var o=performance;n.unstable_now=function(){return o.now()}}else{var m=Date,g=m.now();n.unstable_now=function(){return m.now()-g}}var b=[],y=[],_=1,w=null,T=3,S=!1,N=!1,O=!1,j=!1,R=typeof setTimeout=="function"?setTimeout:null,k=typeof clearTimeout=="function"?clearTimeout:null,H=typeof setImmediate<"u"?setImmediate:null;function F(X){for(var ce=i(y);ce!==null;){if(ce.callback===null)l(y);else if(ce.startTime<=X)l(y),ce.sortIndex=ce.expirationTime,a(b,ce);else break;ce=i(y)}}function J(X){if(O=!1,F(X),!N)if(i(b)!==null)N=!0,pe||(pe=!0,P());else{var ce=i(y);ce!==null&&be(J,ce.startTime-X)}}var pe=!1,G=-1,re=5,se=-1;function V(){return j?!0:!(n.unstable_now()-se<re)}function K(){if(j=!1,pe){var X=n.unstable_now();se=X;var ce=!0;try{e:{N=!1,O&&(O=!1,k(G),G=-1),S=!0;var ye=T;try{t:{for(F(X),w=i(b);w!==null&&!(w.expirationTime>X&&V());){var De=w.callback;if(typeof De=="function"){w.callback=null,T=w.priorityLevel;var Re=De(w.expirationTime<=X);if(X=n.unstable_now(),typeof Re=="function"){w.callback=Re,F(X),ce=!0;break t}w===i(b)&&l(b),F(X)}else l(b);w=i(b)}if(w!==null)ce=!0;else{var q=i(y);q!==null&&be(J,q.startTime-X),ce=!1}}break e}finally{w=null,T=ye,S=!1}ce=void 0}}finally{ce?P():pe=!1}}}var P;if(typeof H=="function")P=function(){H(K)};else if(typeof MessageChannel<"u"){var ie=new MessageChannel,Se=ie.port2;ie.port1.onmessage=K,P=function(){Se.postMessage(null)}}else P=function(){R(K,0)};function be(X,ce){G=R(function(){X(n.unstable_now())},ce)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(X){X.callback=null},n.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):re=0<X?Math.floor(1e3/X):5},n.unstable_getCurrentPriorityLevel=function(){return T},n.unstable_next=function(X){switch(T){case 1:case 2:case 3:var ce=3;break;default:ce=T}var ye=T;T=ce;try{return X()}finally{T=ye}},n.unstable_requestPaint=function(){j=!0},n.unstable_runWithPriority=function(X,ce){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var ye=T;T=X;try{return ce()}finally{T=ye}},n.unstable_scheduleCallback=function(X,ce,ye){var De=n.unstable_now();switch(typeof ye=="object"&&ye!==null?(ye=ye.delay,ye=typeof ye=="number"&&0<ye?De+ye:De):ye=De,X){case 1:var Re=-1;break;case 2:Re=250;break;case 5:Re=1073741823;break;case 4:Re=1e4;break;default:Re=5e3}return Re=ye+Re,X={id:_++,callback:ce,priorityLevel:X,startTime:ye,expirationTime:Re,sortIndex:-1},ye>De?(X.sortIndex=ye,a(y,X),i(b)===null&&X===i(y)&&(O?(k(G),G=-1):O=!0,be(J,ye-De))):(X.sortIndex=Re,a(b,X),N||S||(N=!0,pe||(pe=!0,P()))),X},n.unstable_shouldYield=V,n.unstable_wrapCallback=function(X){var ce=T;return function(){var ye=T;T=ce;try{return X.apply(this,arguments)}finally{T=ye}}}})(wm)),wm}var l0;function TE(){return l0||(l0=1,Om.exports=EE()),Om.exports}var Cm={exports:{}},Nn={};/**
 * @license React
 * react-dom.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var u0;function NE(){if(u0)return Nn;u0=1;var n=My();function a(b){var y="https://react.dev/errors/"+b;if(1<arguments.length){y+="?args[]="+encodeURIComponent(arguments[1]);for(var _=2;_<arguments.length;_++)y+="&args[]="+encodeURIComponent(arguments[_])}return"Minified React error #"+b+"; visit "+y+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function i(){}var l={d:{f:i,r:function(){throw Error(a(522))},D:i,C:i,L:i,m:i,X:i,S:i,M:i},p:0,findDOMNode:null},u=Symbol.for("react.portal");function o(b,y,_){var w=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:u,key:w==null?null:""+w,children:b,containerInfo:y,implementation:_}}var m=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function g(b,y){if(b==="font")return"";if(typeof y=="string")return y==="use-credentials"?y:""}return Nn.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=l,Nn.createPortal=function(b,y){var _=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!y||y.nodeType!==1&&y.nodeType!==9&&y.nodeType!==11)throw Error(a(299));return o(b,y,null,_)},Nn.flushSync=function(b){var y=m.T,_=l.p;try{if(m.T=null,l.p=2,b)return b()}finally{m.T=y,l.p=_,l.d.f()}},Nn.preconnect=function(b,y){typeof b=="string"&&(y?(y=y.crossOrigin,y=typeof y=="string"?y==="use-credentials"?y:"":void 0):y=null,l.d.C(b,y))},Nn.prefetchDNS=function(b){typeof b=="string"&&l.d.D(b)},Nn.preinit=function(b,y){if(typeof b=="string"&&y&&typeof y.as=="string"){var _=y.as,w=g(_,y.crossOrigin),T=typeof y.integrity=="string"?y.integrity:void 0,S=typeof y.fetchPriority=="string"?y.fetchPriority:void 0;_==="style"?l.d.S(b,typeof y.precedence=="string"?y.precedence:void 0,{crossOrigin:w,integrity:T,fetchPriority:S}):_==="script"&&l.d.X(b,{crossOrigin:w,integrity:T,fetchPriority:S,nonce:typeof y.nonce=="string"?y.nonce:void 0})}},Nn.preinitModule=function(b,y){if(typeof b=="string")if(typeof y=="object"&&y!==null){if(y.as==null||y.as==="script"){var _=g(y.as,y.crossOrigin);l.d.M(b,{crossOrigin:_,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0})}}else y==null&&l.d.M(b)},Nn.preload=function(b,y){if(typeof b=="string"&&typeof y=="object"&&y!==null&&typeof y.as=="string"){var _=y.as,w=g(_,y.crossOrigin);l.d.L(b,_,{crossOrigin:w,integrity:typeof y.integrity=="string"?y.integrity:void 0,nonce:typeof y.nonce=="string"?y.nonce:void 0,type:typeof y.type=="string"?y.type:void 0,fetchPriority:typeof y.fetchPriority=="string"?y.fetchPriority:void 0,referrerPolicy:typeof y.referrerPolicy=="string"?y.referrerPolicy:void 0,imageSrcSet:typeof y.imageSrcSet=="string"?y.imageSrcSet:void 0,imageSizes:typeof y.imageSizes=="string"?y.imageSizes:void 0,media:typeof y.media=="string"?y.media:void 0})}},Nn.preloadModule=function(b,y){if(typeof b=="string")if(y){var _=g(y.as,y.crossOrigin);l.d.m(b,{as:typeof y.as=="string"&&y.as!=="script"?y.as:void 0,crossOrigin:_,integrity:typeof y.integrity=="string"?y.integrity:void 0})}else l.d.m(b)},Nn.requestFormReset=function(b){l.d.r(b)},Nn.unstable_batchedUpdates=function(b,y){return b(y)},Nn.useFormState=function(b,y,_){return m.H.useFormState(b,y,_)},Nn.useFormStatus=function(){return m.H.useHostTransitionStatus()},Nn.version="19.2.7",Nn}var o0;function _E(){if(o0)return Cm.exports;o0=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),Cm.exports=NE(),Cm.exports}/**
 * @license React
 * react-dom-client.production.js
 *
 * Copyright (c) Meta Platforms, Inc. and affiliates.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE file in the root directory of this source tree.
 */var c0;function OE(){if(c0)return Co;c0=1;var n=TE(),a=My(),i=_E();function l(e){var t="https://react.dev/errors/"+e;if(1<arguments.length){t+="?args[]="+encodeURIComponent(arguments[1]);for(var s=2;s<arguments.length;s++)t+="&args[]="+encodeURIComponent(arguments[s])}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 u(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function o(e){var t=e,s=e;if(e.alternate)for(;t.return;)t=t.return;else{e=t;do t=e,(t.flags&4098)!==0&&(s=t.return),e=t.return;while(e)}return t.tag===3?s:null}function m(e){if(e.tag===13){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function g(e){if(e.tag===31){var t=e.memoizedState;if(t===null&&(e=e.alternate,e!==null&&(t=e.memoizedState)),t!==null)return t.dehydrated}return null}function b(e){if(o(e)!==e)throw Error(l(188))}function y(e){var t=e.alternate;if(!t){if(t=o(e),t===null)throw Error(l(188));return t!==e?null:e}for(var s=e,r=t;;){var f=s.return;if(f===null)break;var d=f.alternate;if(d===null){if(r=f.return,r!==null){s=r;continue}break}if(f.child===d.child){for(d=f.child;d;){if(d===s)return b(f),e;if(d===r)return b(f),t;d=d.sibling}throw Error(l(188))}if(s.return!==r.return)s=f,r=d;else{for(var x=!1,D=f.child;D;){if(D===s){x=!0,s=f,r=d;break}if(D===r){x=!0,r=f,s=d;break}D=D.sibling}if(!x){for(D=d.child;D;){if(D===s){x=!0,s=d,r=f;break}if(D===r){x=!0,r=d,s=f;break}D=D.sibling}if(!x)throw Error(l(189))}}if(s.alternate!==r)throw Error(l(190))}if(s.tag!==3)throw Error(l(188));return s.stateNode.current===s?e:t}function _(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e;for(e=e.child;e!==null;){if(t=_(e),t!==null)return t;e=e.sibling}return null}var w=Object.assign,T=Symbol.for("react.element"),S=Symbol.for("react.transitional.element"),N=Symbol.for("react.portal"),O=Symbol.for("react.fragment"),j=Symbol.for("react.strict_mode"),R=Symbol.for("react.profiler"),k=Symbol.for("react.consumer"),H=Symbol.for("react.context"),F=Symbol.for("react.forward_ref"),J=Symbol.for("react.suspense"),pe=Symbol.for("react.suspense_list"),G=Symbol.for("react.memo"),re=Symbol.for("react.lazy"),se=Symbol.for("react.activity"),V=Symbol.for("react.memo_cache_sentinel"),K=Symbol.iterator;function P(e){return e===null||typeof e!="object"?null:(e=K&&e[K]||e["@@iterator"],typeof e=="function"?e:null)}var ie=Symbol.for("react.client.reference");function Se(e){if(e==null)return null;if(typeof e=="function")return e.$$typeof===ie?null:e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case O:return"Fragment";case R:return"Profiler";case j:return"StrictMode";case J:return"Suspense";case pe:return"SuspenseList";case se:return"Activity"}if(typeof e=="object")switch(e.$$typeof){case N:return"Portal";case H:return e.displayName||"Context";case k:return(e._context.displayName||"Context")+".Consumer";case F:var t=e.render;return e=e.displayName,e||(e=t.displayName||t.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case G:return t=e.displayName||null,t!==null?t:Se(e.type)||"Memo";case re:t=e._payload,e=e._init;try{return Se(e(t))}catch{}}return null}var be=Array.isArray,X=a.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ce=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ye={pending:!1,data:null,method:null,action:null},De=[],Re=-1;function q(e){return{current:e}}function ue(e){0>Re||(e.current=De[Re],De[Re]=null,Re--)}function Oe(e,t){Re++,De[Re]=e.current,e.current=t}var Ne=q(null),Me=q(null),Le=q(null),Ie=q(null);function ft(e,t){switch(Oe(Le,t),Oe(Me,e),Oe(Ne,null),t.nodeType){case 9:case 11:e=(e=t.documentElement)&&(e=e.namespaceURI)?Tp(e):0;break;default:if(e=t.tagName,t=t.namespaceURI)t=Tp(t),e=Np(t,e);else switch(e){case"svg":e=1;break;case"math":e=2;break;default:e=0}}ue(Ne),Oe(Ne,e)}function tt(){ue(Ne),ue(Me),ue(Le)}function Lt(e){e.memoizedState!==null&&Oe(Ie,e);var t=Ne.current,s=Np(t,e.type);t!==s&&(Oe(Me,e),Oe(Ne,s))}function Gn(e){Me.current===e&&(ue(Ne),ue(Me)),Ie.current===e&&(ue(Ie),To._currentValue=ye)}var Xn,Wa;function jn(e){if(Xn===void 0)try{throw Error()}catch(s){var t=s.stack.trim().match(/\n( *(at )?)/);Xn=t&&t[1]||"",Wa=-1<s.stack.indexOf(`
    at`)?" (<anonymous>)":-1<s.stack.indexOf("@")?"@unknown:0:0":""}return`
`+Xn+e+Wa}var Qn=!1;function Ma(e,t){if(!e||Qn)return"";Qn=!0;var s=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var r={DetermineComponentFrameRoot:function(){try{if(t){var ge=function(){throw Error()};if(Object.defineProperty(ge.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(ge,[])}catch(le){var ae=le}Reflect.construct(e,[],ge)}else{try{ge.call()}catch(le){ae=le}e.call(ge.prototype)}}else{try{throw Error()}catch(le){ae=le}(ge=e())&&typeof ge.catch=="function"&&ge.catch(function(){})}}catch(le){if(le&&ae&&typeof le.stack=="string")return[le.stack,ae.stack]}return[null,null]}};r.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var f=Object.getOwnPropertyDescriptor(r.DetermineComponentFrameRoot,"name");f&&f.configurable&&Object.defineProperty(r.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var d=r.DetermineComponentFrameRoot(),x=d[0],D=d[1];if(x&&D){var L=x.split(`
`),ne=D.split(`
`);for(f=r=0;r<L.length&&!L[r].includes("DetermineComponentFrameRoot");)r++;for(;f<ne.length&&!ne[f].includes("DetermineComponentFrameRoot");)f++;if(r===L.length||f===ne.length)for(r=L.length-1,f=ne.length-1;1<=r&&0<=f&&L[r]!==ne[f];)f--;for(;1<=r&&0<=f;r--,f--)if(L[r]!==ne[f]){if(r!==1||f!==1)do if(r--,f--,0>f||L[r]!==ne[f]){var fe=`
`+L[r].replace(" at new "," at ");return e.displayName&&fe.includes("<anonymous>")&&(fe=fe.replace("<anonymous>",e.displayName)),fe}while(1<=r&&0<=f);break}}}finally{Qn=!1,Error.prepareStackTrace=s}return(s=e?e.displayName||e.name:"")?jn(s):""}function Ka(e,t){switch(e.tag){case 26:case 27:case 5:return jn(e.type);case 16:return jn("Lazy");case 13:return e.child!==t&&t!==null?jn("Suspense Fallback"):jn("Suspense");case 19:return jn("SuspenseList");case 0:case 15:return Ma(e.type,!1);case 11:return Ma(e.type.render,!1);case 1:return Ma(e.type,!0);case 31:return jn("Activity");default:return""}}function da(e){try{var t="",s=null;do t+=Ka(e,s),s=e,e=e.return;while(e);return t}catch(r){return`
Error generating stack: `+r.message+`
`+r.stack}}var Wn=Object.prototype.hasOwnProperty,gs=n.unstable_scheduleCallback,Ja=n.unstable_cancelCallback,er=n.unstable_shouldYield,Ks=n.unstable_requestPaint,Xt=n.unstable_now,Pa=n.unstable_getCurrentPriorityLevel,Js=n.unstable_ImmediatePriority,tr=n.unstable_UserBlockingPriority,Kn=n.unstable_NormalPriority,vs=n.unstable_LowPriority,A=n.unstable_IdlePriority,B=n.log,ee=n.unstable_setDisableYieldValue,he=null,ve=null;function _e(e){if(typeof B=="function"&&ee(e),ve&&typeof ve.setStrictMode=="function")try{ve.setStrictMode(he,e)}catch{}}var Ee=Math.clz32?Math.clz32:Ae,Q=Math.log,de=Math.LN2;function Ae(e){return e>>>=0,e===0?32:31-(Q(e)/de|0)|0}var Pe=256,Ot=262144,yt=4194304;function ln(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 ps(e,t,s){var r=e.pendingLanes;if(r===0)return 0;var f=0,d=e.suspendedLanes,x=e.pingedLanes;e=e.warmLanes;var D=r&134217727;return D!==0?(r=D&~d,r!==0?f=ln(r):(x&=D,x!==0?f=ln(x):s||(s=D&~e,s!==0&&(f=ln(s))))):(D=r&~d,D!==0?f=ln(D):x!==0?f=ln(x):s||(s=r&~e,s!==0&&(f=ln(s)))),f===0?0:t!==0&&t!==f&&(t&d)===0&&(d=f&-f,s=t&-t,d>=s||d===32&&(s&4194048)!==0)?t:f}function Da(e,t){return(e.pendingLanes&~(e.suspendedLanes&~e.pingedLanes)&t)===0}function al(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 Ps(){var e=yt;return yt<<=1,(yt&62914560)===0&&(yt=4194304),e}function sl(e){for(var t=[],s=0;31>s;s++)t.push(e);return t}function ei(e,t){e.pendingLanes|=t,t!==268435456&&(e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0)}function dc(e,t,s,r,f,d){var x=e.pendingLanes;e.pendingLanes=s,e.suspendedLanes=0,e.pingedLanes=0,e.warmLanes=0,e.expiredLanes&=s,e.entangledLanes&=s,e.errorRecoveryDisabledLanes&=s,e.shellSuspendCounter=0;var D=e.entanglements,L=e.expirationTimes,ne=e.hiddenUpdates;for(s=x&~s;0<s;){var fe=31-Ee(s),ge=1<<fe;D[fe]=0,L[fe]=-1;var ae=ne[fe];if(ae!==null)for(ne[fe]=null,fe=0;fe<ae.length;fe++){var le=ae[fe];le!==null&&(le.lane&=-536870913)}s&=~ge}r!==0&&wt(e,r,0),d!==0&&f===0&&e.tag!==0&&(e.suspendedLanes|=d&~(x&~t))}function wt(e,t,s){e.pendingLanes|=t,e.suspendedLanes&=~t;var r=31-Ee(t);e.entangledLanes|=t,e.entanglements[r]=e.entanglements[r]|1073741824|s&261930}function Rn(e,t){var s=e.entangledLanes|=t;for(e=e.entanglements;s;){var r=31-Ee(s),f=1<<r;f&t|e[r]&t&&(e[r]|=t),s&=~f}}function Ou(e,t){var s=t&-t;return s=(s&42)!==0?1:il(s),(s&(e.suspendedLanes|t))!==0?0:s}function il(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 xn(e){return e&=-e,2<e?8<e?(e&134217727)!==0?32:268435456:8:2}function rl(){var e=ce.p;return e!==0?e:(e=window.event,e===void 0?32:Gp(e.type))}function wu(e,t){var s=ce.p;try{return ce.p=e,t()}finally{ce.p=s}}var ja=Math.random().toString(36).slice(2),qt="__reactFiber$"+ja,tn="__reactProps$"+ja,bs="__reactContainer$"+ja,nr="__reactEvents$"+ja,hc="__reactListeners$"+ja,mc="__reactHandles$"+ja,yc="__reactResources$"+ja,ar="__reactMarker$"+ja;function ll(e){delete e[qt],delete e[tn],delete e[nr],delete e[hc],delete e[mc]}function Ss(e){var t=e[qt];if(t)return t;for(var s=e.parentNode;s;){if(t=s[bs]||s[qt]){if(s=t.alternate,t.child!==null||s!==null&&s.child!==null)for(e=jp(e);e!==null;){if(s=e[qt])return s;e=jp(e)}return t}e=s,s=e.parentNode}return null}function Ze(e){if(e=e[qt]||e[bs]){var t=e.tag;if(t===5||t===6||t===13||t===31||t===26||t===27||t===3)return e}return null}function An(e){var t=e.tag;if(t===5||t===26||t===27||t===6)return e.stateNode;throw Error(l(33))}function Ra(e){var t=e[yc];return t||(t=e[yc]={hoistableStyles:new Map,hoistableScripts:new Map}),t}function Qt(e){e[ar]=!0}var gc=new Set,Cu={};function es(e,t){ti(e,t),ti(e+"Capture",t)}function ti(e,t){for(Cu[e]=t,e=0;e<t.length;e++)gc.add(t[e])}var vc=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]*$"),pc={},xs={};function Mu(e){return Wn.call(xs,e)?!0:Wn.call(pc,e)?!1:vc.test(e)?xs[e]=!0:(pc[e]=!0,!1)}function dn(e,t,s){if(Mu(t))if(s===null)e.removeAttribute(t);else{switch(typeof s){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,""+s)}}function ul(e,t,s){if(s===null)e.removeAttribute(t);else{switch(typeof s){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(t);return}e.setAttribute(t,""+s)}}function vt(e,t,s,r){if(r===null)e.removeAttribute(s);else{switch(typeof r){case"undefined":case"function":case"symbol":case"boolean":e.removeAttribute(s);return}e.setAttributeNS(t,s,""+r)}}function Bt(e){switch(typeof e){case"bigint":case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function ts(e){var t=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(t==="checkbox"||t==="radio")}function Du(e,t,s){var r=Object.getOwnPropertyDescriptor(e.constructor.prototype,t);if(!e.hasOwnProperty(t)&&typeof r<"u"&&typeof r.get=="function"&&typeof r.set=="function"){var f=r.get,d=r.set;return Object.defineProperty(e,t,{configurable:!0,get:function(){return f.call(this)},set:function(x){s=""+x,d.call(this,x)}}),Object.defineProperty(e,t,{enumerable:r.enumerable}),{getValue:function(){return s},setValue:function(x){s=""+x},stopTracking:function(){e._valueTracker=null,delete e[t]}}}}function sr(e){if(!e._valueTracker){var t=ts(e)?"checked":"value";e._valueTracker=Du(e,t,""+e[t])}}function ni(e){if(!e)return!1;var t=e._valueTracker;if(!t)return!0;var s=t.getValue(),r="";return e&&(r=ts(e)?e.checked?"true":"false":e.value),e=r,e!==s?(t.setValue(e),!0):!1}function Aa(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}var ol=/[\n"\\]/g;function hn(e){return e.replace(ol,function(t){return"\\"+t.charCodeAt(0).toString(16)+" "})}function cl(e,t,s,r,f,d,x,D){e.name="",x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"?e.type=x:e.removeAttribute("type"),t!=null?x==="number"?(t===0&&e.value===""||e.value!=t)&&(e.value=""+Bt(t)):e.value!==""+Bt(t)&&(e.value=""+Bt(t)):x!=="submit"&&x!=="reset"||e.removeAttribute("value"),t!=null?ir(e,x,Bt(t)):s!=null?ir(e,x,Bt(s)):r!=null&&e.removeAttribute("value"),f==null&&d!=null&&(e.defaultChecked=!!d),f!=null&&(e.checked=f&&typeof f!="function"&&typeof f!="symbol"),D!=null&&typeof D!="function"&&typeof D!="symbol"&&typeof D!="boolean"?e.name=""+Bt(D):e.removeAttribute("name")}function ai(e,t,s,r,f,d,x,D){if(d!=null&&typeof d!="function"&&typeof d!="symbol"&&typeof d!="boolean"&&(e.type=d),t!=null||s!=null){if(!(d!=="submit"&&d!=="reset"||t!=null)){sr(e);return}s=s!=null?""+Bt(s):"",t=t!=null?""+Bt(t):s,D||t===e.value||(e.value=t),e.defaultValue=t}r=r??f,r=typeof r!="function"&&typeof r!="symbol"&&!!r,e.checked=D?e.checked:!!r,e.defaultChecked=!!r,x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(e.name=x),sr(e)}function ir(e,t,s){t==="number"&&Aa(e.ownerDocument)===e||e.defaultValue===""+s||(e.defaultValue=""+s)}function Es(e,t,s,r){if(e=e.options,t){t={};for(var f=0;f<s.length;f++)t["$"+s[f]]=!0;for(s=0;s<e.length;s++)f=t.hasOwnProperty("$"+e[s].value),e[s].selected!==f&&(e[s].selected=f),f&&r&&(e[s].defaultSelected=!0)}else{for(s=""+Bt(s),t=null,f=0;f<e.length;f++){if(e[f].value===s){e[f].selected=!0,r&&(e[f].defaultSelected=!0);return}t!==null||e[f].disabled||(t=e[f])}t!==null&&(t.selected=!0)}}function rr(e,t,s){if(t!=null&&(t=""+Bt(t),t!==e.value&&(e.value=t),s==null)){e.defaultValue!==t&&(e.defaultValue=t);return}e.defaultValue=s!=null?""+Bt(s):""}function ju(e,t,s,r){if(t==null){if(r!=null){if(s!=null)throw Error(l(92));if(be(r)){if(1<r.length)throw Error(l(93));r=r[0]}s=r}s==null&&(s=""),t=s}s=Bt(t),e.defaultValue=s,r=e.textContent,r===s&&r!==""&&r!==null&&(e.value=r),sr(e)}function ka(e,t){if(t){var s=e.firstChild;if(s&&s===e.lastChild&&s.nodeType===3){s.nodeValue=t;return}}e.textContent=t}var lr=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 ur(e,t,s){var r=t.indexOf("--")===0;s==null||typeof s=="boolean"||s===""?r?e.setProperty(t,""):t==="float"?e.cssFloat="":e[t]="":r?e.setProperty(t,s):typeof s!="number"||s===0||lr.has(t)?t==="float"?e.cssFloat=s:e[t]=(""+s).trim():e[t]=s+"px"}function bc(e,t,s){if(t!=null&&typeof t!="object")throw Error(l(62));if(e=e.style,s!=null){for(var r in s)!s.hasOwnProperty(r)||t!=null&&t.hasOwnProperty(r)||(r.indexOf("--")===0?e.setProperty(r,""):r==="float"?e.cssFloat="":e[r]="");for(var f in t)r=t[f],t.hasOwnProperty(f)&&s[f]!==r&&ur(e,f,r)}else for(var d in t)t.hasOwnProperty(d)&&ur(e,d,t[d])}function fl(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 Sd=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"]]),Sc=/^[\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 or(e){return Sc.test(""+e)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":e}function ha(){}var Ru=null;function dl(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var Ts=null,si=null;function xc(e){var t=Ze(e);if(t&&(e=t.stateNode)){var s=e[tn]||null;e:switch(e=t.stateNode,t.type){case"input":if(cl(e,s.value,s.defaultValue,s.defaultValue,s.checked,s.defaultChecked,s.type,s.name),t=s.name,s.type==="radio"&&t!=null){for(s=e;s.parentNode;)s=s.parentNode;for(s=s.querySelectorAll('input[name="'+hn(""+t)+'"][type="radio"]'),t=0;t<s.length;t++){var r=s[t];if(r!==e&&r.form===e.form){var f=r[tn]||null;if(!f)throw Error(l(90));cl(r,f.value,f.defaultValue,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name)}}for(t=0;t<s.length;t++)r=s[t],r.form===e.form&&ni(r)}break e;case"textarea":rr(e,s.value,s.defaultValue);break e;case"select":t=s.value,t!=null&&Es(e,!!s.multiple,t,!1)}}}var Au=!1;function ku(e,t,s){if(Au)return e(t,s);Au=!0;try{var r=e(t);return r}finally{if(Au=!1,(Ts!==null||si!==null)&&(gf(),Ts&&(t=Ts,e=si,si=Ts=null,xc(t),e)))for(t=0;t<e.length;t++)xc(e[t])}}function cr(e,t){var s=e.stateNode;if(s===null)return null;var r=s[tn]||null;if(r===null)return null;s=r[t];e:switch(t){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(r=!r.disabled)||(e=e.type,r=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!r;break e;default:e=!1}if(e)return null;if(s&&typeof s!="function")throw Error(l(231,t,typeof s));return s}var Ua=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uu=!1;if(Ua)try{var fr={};Object.defineProperty(fr,"passive",{get:function(){Uu=!0}}),window.addEventListener("test",fr,fr),window.removeEventListener("test",fr,fr)}catch{Uu=!1}var ns=null,hl=null,ml=null;function nn(){if(ml)return ml;var e,t=hl,s=t.length,r,f="value"in ns?ns.value:ns.textContent,d=f.length;for(e=0;e<s&&t[e]===f[e];e++);var x=s-e;for(r=1;r<=x&&t[s-r]===f[d-r];r++);return ml=f.slice(e,1<r?1-r:void 0)}function dr(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 za(){return!0}function Ns(){return!1}function Zt(e){function t(s,r,f,d,x){this._reactName=s,this._targetInst=f,this.type=r,this.nativeEvent=d,this.target=x,this.currentTarget=null;for(var D in e)e.hasOwnProperty(D)&&(s=e[D],this[D]=s?s(d):d[D]);return this.isDefaultPrevented=(d.defaultPrevented!=null?d.defaultPrevented:d.returnValue===!1)?za:Ns,this.isPropagationStopped=Ns,this}return w(t.prototype,{preventDefault:function(){this.defaultPrevented=!0;var s=this.nativeEvent;s&&(s.preventDefault?s.preventDefault():typeof s.returnValue!="unknown"&&(s.returnValue=!1),this.isDefaultPrevented=za)},stopPropagation:function(){var s=this.nativeEvent;s&&(s.stopPropagation?s.stopPropagation():typeof s.cancelBubble!="unknown"&&(s.cancelBubble=!0),this.isPropagationStopped=za)},persist:function(){},isPersistent:za}),t}var as={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},hr=Zt(as),mr=w({},as,{view:0,detail:0}),zu=Zt(mr),yl,yr,gr,gl=w({},mr,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:pr,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!==gr&&(gr&&e.type==="mousemove"?(yl=e.screenX-gr.screenX,yr=e.screenY-gr.screenY):yr=yl=0,gr=e),yl)},movementY:function(e){return"movementY"in e?e.movementY:yr}}),Ec=Zt(gl),xd=w({},gl,{dataTransfer:0}),Ed=Zt(xd),Td=w({},mr,{relatedTarget:0}),vl=Zt(Td),Nd=w({},as,{animationName:0,elapsedTime:0,pseudoElement:0}),ii=Zt(Nd),_d=w({},as,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),ri=Zt(_d),vr=w({},as,{data:0}),li=Zt(vr),Od={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},wd={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"},Cd={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function Md(e){var t=this.nativeEvent;return t.getModifierState?t.getModifierState(e):(e=Cd[e])?!!t[e]:!1}function pr(){return Md}var Dd=w({},mr,{key:function(e){if(e.key){var t=Od[e.key]||e.key;if(t!=="Unidentified")return t}return e.type==="keypress"?(e=dr(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?wd[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:pr,charCode:function(e){return e.type==="keypress"?dr(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?dr(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),jd=Zt(Dd),Rd=w({},gl,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Tc=Zt(Rd),Ad=w({},mr,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:pr}),kd=Zt(Ad),Nc=w({},as,{propertyName:0,elapsedTime:0,pseudoElement:0}),Ud=Zt(Nc),zd=w({},gl,{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}),Ld=Zt(zd),Hd=w({},as,{newState:0,oldState:0}),Vd=Zt(Hd),_c=[9,13,27,32],Lu=Ua&&"CompositionEvent"in window,br=null;Ua&&"documentMode"in document&&(br=document.documentMode);var Fd=Ua&&"TextEvent"in window&&!br,Oc=Ua&&(!Lu||br&&8<br&&11>=br),wc=" ",Cc=!1;function Mc(e,t){switch(e){case"keyup":return _c.indexOf(t.keyCode)!==-1;case"keydown":return t.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Dc(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var ui=!1;function qd(e,t){switch(e){case"compositionend":return Dc(t);case"keypress":return t.which!==32?null:(Cc=!0,wc);case"textInput":return e=t.data,e===wc&&Cc?null:e;default:return null}}function Bd(e,t){if(ui)return e==="compositionend"||!Lu&&Mc(e,t)?(e=nn(),ml=hl=ns=null,ui=!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 Oc&&t.locale!=="ko"?null:t.data;default:return null}}var Zd={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 jc(e){var t=e&&e.nodeName&&e.nodeName.toLowerCase();return t==="input"?!!Zd[e.type]:t==="textarea"}function Hu(e,t,s,r){Ts?si?si.push(r):si=[r]:Ts=r,t=Tf(t,"onChange"),0<t.length&&(s=new hr("onChange","change",null,s,r),e.push({event:s,listeners:t}))}var oi=null,Sr=null;function kn(e){vp(e,0)}function La(e){var t=An(e);if(ni(t))return e}function Rc(e,t){if(e==="change")return t}var ss=!1;if(Ua){var Vu;if(Ua){var Jn="oninput"in document;if(!Jn){var Fu=document.createElement("div");Fu.setAttribute("oninput","return;"),Jn=typeof Fu.oninput=="function"}Vu=Jn}else Vu=!1;ss=Vu&&(!document.documentMode||9<document.documentMode)}function qu(){oi&&(oi.detachEvent("onpropertychange",Bu),Sr=oi=null)}function Bu(e){if(e.propertyName==="value"&&La(Sr)){var t=[];Hu(t,Sr,e,dl(e)),ku(kn,t)}}function st(e,t,s){e==="focusin"?(qu(),oi=t,Sr=s,oi.attachEvent("onpropertychange",Bu)):e==="focusout"&&qu()}function ci(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return La(Sr)}function $d(e,t){if(e==="click")return La(t)}function Ct(e,t){if(e==="input"||e==="change")return La(t)}function xr(e,t){return e===t&&(e!==0||1/e===1/t)||e!==e&&t!==t}var En=typeof Object.is=="function"?Object.is:xr;function Er(e,t){if(En(e,t))return!0;if(typeof e!="object"||e===null||typeof t!="object"||t===null)return!1;var s=Object.keys(e),r=Object.keys(t);if(s.length!==r.length)return!1;for(r=0;r<s.length;r++){var f=s[r];if(!Wn.call(t,f)||!En(e[f],t[f]))return!1}return!0}function Ac(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function kc(e,t){var s=Ac(e);e=0;for(var r;s;){if(s.nodeType===3){if(r=e+s.textContent.length,e<=t&&r>=t)return{node:s,offset:t-e};e=r}e:{for(;s;){if(s.nextSibling){s=s.nextSibling;break e}s=s.parentNode}s=void 0}s=Ac(s)}}function ot(e,t){return e&&t?e===t?!0:e&&e.nodeType===3?!1:t&&t.nodeType===3?ot(e,t.parentNode):"contains"in e?e.contains(t):e.compareDocumentPosition?!!(e.compareDocumentPosition(t)&16):!1:!1}function Yd(e){e=e!=null&&e.ownerDocument!=null&&e.ownerDocument.defaultView!=null?e.ownerDocument.defaultView:window;for(var t=Aa(e.document);t instanceof e.HTMLIFrameElement;){try{var s=typeof t.contentWindow.location.href=="string"}catch{s=!1}if(s)e=t.contentWindow;else break;t=Aa(e.document)}return t}function pl(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 Uc=Ua&&"documentMode"in document&&11>=document.documentMode,fi=null,bl=null,mn=null,Sl=!1;function Tr(e,t,s){var r=s.window===s?s.document:s.nodeType===9?s:s.ownerDocument;Sl||fi==null||fi!==Aa(r)||(r=fi,"selectionStart"in r&&pl(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}),mn&&Er(mn,r)||(mn=r,r=Tf(bl,"onSelect"),0<r.length&&(t=new hr("onSelect","select",null,t,s),e.push({event:t,listeners:r}),t.target=fi)))}function _s(e,t){var s={};return s[e.toLowerCase()]=t.toLowerCase(),s["Webkit"+e]="webkit"+t,s["Moz"+e]="moz"+t,s}var di={animationend:_s("Animation","AnimationEnd"),animationiteration:_s("Animation","AnimationIteration"),animationstart:_s("Animation","AnimationStart"),transitionrun:_s("Transition","TransitionRun"),transitionstart:_s("Transition","TransitionStart"),transitioncancel:_s("Transition","TransitionCancel"),transitionend:_s("Transition","TransitionEnd")},Zu={},zc={};Ua&&(zc=document.createElement("div").style,"AnimationEvent"in window||(delete di.animationend.animation,delete di.animationiteration.animation,delete di.animationstart.animation),"TransitionEvent"in window||delete di.transitionend.transition);function Os(e){if(Zu[e])return Zu[e];if(!di[e])return e;var t=di[e],s;for(s in t)if(t.hasOwnProperty(s)&&s in zc)return Zu[e]=t[s];return e}var Lc=Os("animationend"),Hc=Os("animationiteration"),xl=Os("animationstart"),Id=Os("transitionrun"),Gd=Os("transitionstart"),Vc=Os("transitioncancel"),$u=Os("transitionend"),Yu=new Map,Iu="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");Iu.push("scrollEnd");function Un(e,t){Yu.set(e,t),es(t,[e])}var hi=typeof reportError=="function"?reportError:function(e){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var t=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof e=="object"&&e!==null&&typeof e.message=="string"?String(e.message):String(e),error:e});if(!window.dispatchEvent(t))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",e);return}console.error(e)},wn=[],ma=0,Nr=0;function mi(){for(var e=ma,t=Nr=ma=0;t<e;){var s=wn[t];wn[t++]=null;var r=wn[t];wn[t++]=null;var f=wn[t];wn[t++]=null;var d=wn[t];if(wn[t++]=null,r!==null&&f!==null){var x=r.pending;x===null?f.next=f:(f.next=x.next,x.next=f),r.pending=f}d!==0&&_r(s,f,d)}}function ya(e,t,s,r){wn[ma++]=e,wn[ma++]=t,wn[ma++]=s,wn[ma++]=r,Nr|=r,e.lanes|=r,e=e.alternate,e!==null&&(e.lanes|=r)}function El(e,t,s,r){return ya(e,t,s,r),Or(e)}function ga(e,t){return ya(e,null,null,t),Or(e)}function _r(e,t,s){e.lanes|=s;var r=e.alternate;r!==null&&(r.lanes|=s);for(var f=!1,d=e.return;d!==null;)d.childLanes|=s,r=d.alternate,r!==null&&(r.childLanes|=s),d.tag===22&&(e=d.stateNode,e===null||e._visibility&1||(f=!0)),e=d,d=d.return;return e.tag===3?(d=e.stateNode,f&&t!==null&&(f=31-Ee(s),e=d.hiddenUpdates,r=e[f],r===null?e[f]=[t]:r.push(t),t.lane=s|536870912),d):null}function Or(e){if(50<go)throw go=0,Ih=null,Error(l(185));for(var t=e.return;t!==null;)e=t,t=e.return;return e.tag===3?e.stateNode:null}var Pn={};function Tl(e,t,s,r){this.tag=e,this.key=s,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 yn(e,t,s,r){return new Tl(e,t,s,r)}function Nl(e){return e=e.prototype,!(!e||!e.isReactComponent)}function va(e,t){var s=e.alternate;return s===null?(s=yn(e.tag,t,e.key,e.mode),s.elementType=e.elementType,s.type=e.type,s.stateNode=e.stateNode,s.alternate=e,e.alternate=s):(s.pendingProps=t,s.type=e.type,s.flags=0,s.subtreeFlags=0,s.deletions=null),s.flags=e.flags&65011712,s.childLanes=e.childLanes,s.lanes=e.lanes,s.child=e.child,s.memoizedProps=e.memoizedProps,s.memoizedState=e.memoizedState,s.updateQueue=e.updateQueue,t=e.dependencies,s.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext},s.sibling=e.sibling,s.index=e.index,s.ref=e.ref,s.refCleanup=e.refCleanup,s}function Fc(e,t){e.flags&=65011714;var s=e.alternate;return s===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=s.childLanes,e.lanes=s.lanes,e.child=s.child,e.subtreeFlags=0,e.deletions=null,e.memoizedProps=s.memoizedProps,e.memoizedState=s.memoizedState,e.updateQueue=s.updateQueue,e.type=s.type,t=s.dependencies,e.dependencies=t===null?null:{lanes:t.lanes,firstContext:t.firstContext}),e}function _l(e,t,s,r,f,d){var x=0;if(r=e,typeof e=="function")Nl(e)&&(x=1);else if(typeof e=="string")x=aE(e,s,Ne.current)?26:e==="html"||e==="head"||e==="body"?27:5;else e:switch(e){case se:return e=yn(31,s,t,f),e.elementType=se,e.lanes=d,e;case O:return pa(s.children,f,d,t);case j:x=8,f|=24;break;case R:return e=yn(12,s,t,f|2),e.elementType=R,e.lanes=d,e;case J:return e=yn(13,s,t,f),e.elementType=J,e.lanes=d,e;case pe:return e=yn(19,s,t,f),e.elementType=pe,e.lanes=d,e;default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case H:x=10;break e;case k:x=9;break e;case F:x=11;break e;case G:x=14;break e;case re:x=16,r=null;break e}x=29,s=Error(l(130,e===null?"null":typeof e,"")),r=null}return t=yn(x,s,t,f),t.elementType=e,t.type=r,t.lanes=d,t}function pa(e,t,s,r){return e=yn(7,e,r,t),e.lanes=s,e}function Gu(e,t,s){return e=yn(6,e,null,t),e.lanes=s,e}function qc(e){var t=yn(18,null,null,0);return t.stateNode=e,t}function yi(e,t,s){return t=yn(4,e.children!==null?e.children:[],e.key,t),t.lanes=s,t.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},t}var Xu=new WeakMap;function zn(e,t){if(typeof e=="object"&&e!==null){var s=Xu.get(e);return s!==void 0?s:(t={value:e,source:t,stack:da(t)},Xu.set(e,t),t)}return{value:e,source:t,stack:da(t)}}var ws=[],Cs=0,wr=null,Ha=0,Tn=[],qe=0,Ln=null,ba=1,p="";function c(e,t){ws[Cs++]=Ha,ws[Cs++]=wr,wr=e,Ha=t}function v(e,t,s){Tn[qe++]=ba,Tn[qe++]=p,Tn[qe++]=Ln,Ln=e;var r=ba;e=p;var f=32-Ee(r)-1;r&=~(1<<f),s+=1;var d=32-Ee(t)+f;if(30<d){var x=f-f%5;d=(r&(1<<x)-1).toString(32),r>>=x,f-=x,ba=1<<32-Ee(t)+f|s<<f|r,p=d+e}else ba=1<<d|s<<f|r,p=e}function E(e){e.return!==null&&(c(e,1),v(e,1,0))}function M(e){for(;e===wr;)wr=ws[--Cs],ws[Cs]=null,Ha=ws[--Cs],ws[Cs]=null;for(;e===Ln;)Ln=Tn[--qe],Tn[qe]=null,p=Tn[--qe],Tn[qe]=null,ba=Tn[--qe],Tn[qe]=null}function U(e,t){Tn[qe++]=ba,Tn[qe++]=p,Tn[qe++]=Ln,ba=t.id,p=t.overflow,Ln=e}var Z=null,$=null,I=!1,xe=null,ke=!1,Ge=Error(l(519));function it(e){var t=Error(l(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw Va(zn(t,e)),Ge}function $e(e){var t=e.stateNode,s=e.type,r=e.memoizedProps;switch(t[qt]=e,t[tn]=r,s){case"dialog":at("cancel",t),at("close",t);break;case"iframe":case"object":case"embed":at("load",t);break;case"video":case"audio":for(s=0;s<po.length;s++)at(po[s],t);break;case"source":at("error",t);break;case"img":case"image":case"link":at("error",t),at("load",t);break;case"details":at("toggle",t);break;case"input":at("invalid",t),ai(t,r.value,r.defaultValue,r.checked,r.defaultChecked,r.type,r.name,!0);break;case"select":at("invalid",t);break;case"textarea":at("invalid",t),ju(t,r.value,r.defaultValue,r.children)}s=r.children,typeof s!="string"&&typeof s!="number"&&typeof s!="bigint"||t.textContent===""+s||r.suppressHydrationWarning===!0||xp(t.textContent,s)?(r.popover!=null&&(at("beforetoggle",t),at("toggle",t)),r.onScroll!=null&&at("scroll",t),r.onScrollEnd!=null&&at("scrollend",t),r.onClick!=null&&(t.onclick=ha),t=!0):t=!1,t||it(e,!0)}function Ut(e){for(Z=e.return;Z;)switch(Z.tag){case 5:case 31:case 13:ke=!1;return;case 27:case 3:ke=!0;return;default:Z=Z.return}}function un(e){if(e!==Z)return!1;if(!I)return Ut(e),I=!0,!1;var t=e.tag,s;if((s=t!==3&&t!==27)&&((s=t===5)&&(s=e.type,s=!(s!=="form"&&s!=="button")||lm(e.type,e.memoizedProps)),s=!s),s&&$&&it(e),Ut(e),t===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));$=Dp(e)}else if(t===31){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(317));$=Dp(e)}else t===27?(t=$,Ci(e.type)?(e=dm,dm=null,$=e):$=t):$=Z?Ta(e.stateNode.nextSibling):null;return!0}function on(){$=Z=null,I=!1}function is(){var e=xe;return e!==null&&(qn===null?qn=e:qn.push.apply(qn,e),xe=null),e}function Va(e){xe===null?xe=[e]:xe.push(e)}var Ol=q(null),Ms=null,Sa=null;function rs(e,t,s){Oe(Ol,t._currentValue),t._currentValue=s}function Fa(e){e._currentValue=Ol.current,ue(Ol)}function Qu(e,t,s){for(;e!==null;){var r=e.alternate;if((e.childLanes&t)!==t?(e.childLanes|=t,r!==null&&(r.childLanes|=t)):r!==null&&(r.childLanes&t)!==t&&(r.childLanes|=t),e===s)break;e=e.return}}function Ds(e,t,s,r){var f=e.child;for(f!==null&&(f.return=e);f!==null;){var d=f.dependencies;if(d!==null){var x=f.child;d=d.firstContext;e:for(;d!==null;){var D=d;d=f;for(var L=0;L<t.length;L++)if(D.context===t[L]){d.lanes|=s,D=d.alternate,D!==null&&(D.lanes|=s),Qu(d.return,s,e),r||(x=null);break e}d=D.next}}else if(f.tag===18){if(x=f.return,x===null)throw Error(l(341));x.lanes|=s,d=x.alternate,d!==null&&(d.lanes|=s),Qu(x,s,e),x=null}else x=f.child;if(x!==null)x.return=f;else for(x=f;x!==null;){if(x===e){x=null;break}if(f=x.sibling,f!==null){f.return=x.return,x=f;break}x=x.return}f=x}}function xa(e,t,s,r){e=null;for(var f=t,d=!1;f!==null;){if(!d){if((f.flags&524288)!==0)d=!0;else if((f.flags&262144)!==0)break}if(f.tag===10){var x=f.alternate;if(x===null)throw Error(l(387));if(x=x.memoizedProps,x!==null){var D=f.type;En(f.pendingProps.value,x.value)||(e!==null?e.push(D):e=[D])}}else if(f===Ie.current){if(x=f.alternate,x===null)throw Error(l(387));x.memoizedState.memoizedState!==f.memoizedState.memoizedState&&(e!==null?e.push(To):e=[To])}f=f.return}e!==null&&Ds(t,e,s,r),t.flags|=262144}function wl(e){for(e=e.firstContext;e!==null;){if(!En(e.context._currentValue,e.memoizedValue))return!0;e=e.next}return!1}function Cr(e){Ms=e,Sa=null,e=e.dependencies,e!==null&&(e.firstContext=null)}function gn(e){return rg(Ms,e)}function Bc(e,t){return Ms===null&&Cr(e),rg(e,t)}function rg(e,t){var s=t._currentValue;if(t={context:t,memoizedValue:s,next:null},Sa===null){if(e===null)throw Error(l(308));Sa=t,e.dependencies={lanes:0,firstContext:t},e.flags|=524288}else Sa=Sa.next=t;return s}var Px=typeof AbortController<"u"?AbortController:function(){var e=[],t=this.signal={aborted:!1,addEventListener:function(s,r){e.push(r)}};this.abort=function(){t.aborted=!0,e.forEach(function(s){return s()})}},e1=n.unstable_scheduleCallback,t1=n.unstable_NormalPriority,Wt={$$typeof:H,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xd(){return{controller:new Px,data:new Map,refCount:0}}function Wu(e){e.refCount--,e.refCount===0&&e1(t1,function(){e.controller.abort()})}var Ku=null,Qd=0,Cl=0,Ml=null;function n1(e,t){if(Ku===null){var s=Ku=[];Qd=0,Cl=Jh(),Ml={status:"pending",value:void 0,then:function(r){s.push(r)}}}return Qd++,t.then(lg,lg),t}function lg(){if(--Qd===0&&Ku!==null){Ml!==null&&(Ml.status="fulfilled");var e=Ku;Ku=null,Cl=0,Ml=null;for(var t=0;t<e.length;t++)(0,e[t])()}}function a1(e,t){var s=[],r={status:"pending",value:null,reason:null,then:function(f){s.push(f)}};return e.then(function(){r.status="fulfilled",r.value=t;for(var f=0;f<s.length;f++)(0,s[f])(t)},function(f){for(r.status="rejected",r.reason=f,f=0;f<s.length;f++)(0,s[f])(void 0)}),r}var ug=X.S;X.S=function(e,t){Yv=Xt(),typeof t=="object"&&t!==null&&typeof t.then=="function"&&n1(e,t),ug!==null&&ug(e,t)};var Mr=q(null);function Wd(){var e=Mr.current;return e!==null?e:Nt.pooledCache}function Zc(e,t){t===null?Oe(Mr,Mr.current):Oe(Mr,t.pool)}function og(){var e=Wd();return e===null?null:{parent:Wt._currentValue,pool:e}}var Dl=Error(l(460)),Kd=Error(l(474)),$c=Error(l(542)),Yc={then:function(){}};function cg(e){return e=e.status,e==="fulfilled"||e==="rejected"}function fg(e,t,s){switch(s=e[s],s===void 0?e.push(t):s!==t&&(t.then(ha,ha),t=s),t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hg(e),e;default:if(typeof t.status=="string")t.then(ha,ha);else{if(e=Nt,e!==null&&100<e.shellSuspendCounter)throw Error(l(482));e=t,e.status="pending",e.then(function(r){if(t.status==="pending"){var f=t;f.status="fulfilled",f.value=r}},function(r){if(t.status==="pending"){var f=t;f.status="rejected",f.reason=r}})}switch(t.status){case"fulfilled":return t.value;case"rejected":throw e=t.reason,hg(e),e}throw jr=t,Dl}}function Dr(e){try{var t=e._init;return t(e._payload)}catch(s){throw s!==null&&typeof s=="object"&&typeof s.then=="function"?(jr=s,Dl):s}}var jr=null;function dg(){if(jr===null)throw Error(l(459));var e=jr;return jr=null,e}function hg(e){if(e===Dl||e===$c)throw Error(l(483))}var jl=null,Ju=0;function Ic(e){var t=Ju;return Ju+=1,jl===null&&(jl=[]),fg(jl,e,t)}function Pu(e,t){t=t.props.ref,e.ref=t!==void 0?t:null}function Gc(e,t){throw t.$$typeof===T?Error(l(525)):(e=Object.prototype.toString.call(t),Error(l(31,e==="[object Object]"?"object with keys {"+Object.keys(t).join(", ")+"}":e)))}function mg(e){function t(W,Y){if(e){var te=W.deletions;te===null?(W.deletions=[Y],W.flags|=16):te.push(Y)}}function s(W,Y){if(!e)return null;for(;Y!==null;)t(W,Y),Y=Y.sibling;return null}function r(W){for(var Y=new Map;W!==null;)W.key!==null?Y.set(W.key,W):Y.set(W.index,W),W=W.sibling;return Y}function f(W,Y){return W=va(W,Y),W.index=0,W.sibling=null,W}function d(W,Y,te){return W.index=te,e?(te=W.alternate,te!==null?(te=te.index,te<Y?(W.flags|=67108866,Y):te):(W.flags|=67108866,Y)):(W.flags|=1048576,Y)}function x(W){return e&&W.alternate===null&&(W.flags|=67108866),W}function D(W,Y,te,me){return Y===null||Y.tag!==6?(Y=Gu(te,W.mode,me),Y.return=W,Y):(Y=f(Y,te),Y.return=W,Y)}function L(W,Y,te,me){var Be=te.type;return Be===O?fe(W,Y,te.props.children,me,te.key):Y!==null&&(Y.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===re&&Dr(Be)===Y.type)?(Y=f(Y,te.props),Pu(Y,te),Y.return=W,Y):(Y=_l(te.type,te.key,te.props,null,W.mode,me),Pu(Y,te),Y.return=W,Y)}function ne(W,Y,te,me){return Y===null||Y.tag!==4||Y.stateNode.containerInfo!==te.containerInfo||Y.stateNode.implementation!==te.implementation?(Y=yi(te,W.mode,me),Y.return=W,Y):(Y=f(Y,te.children||[]),Y.return=W,Y)}function fe(W,Y,te,me,Be){return Y===null||Y.tag!==7?(Y=pa(te,W.mode,me,Be),Y.return=W,Y):(Y=f(Y,te),Y.return=W,Y)}function ge(W,Y,te){if(typeof Y=="string"&&Y!==""||typeof Y=="number"||typeof Y=="bigint")return Y=Gu(""+Y,W.mode,te),Y.return=W,Y;if(typeof Y=="object"&&Y!==null){switch(Y.$$typeof){case S:return te=_l(Y.type,Y.key,Y.props,null,W.mode,te),Pu(te,Y),te.return=W,te;case N:return Y=yi(Y,W.mode,te),Y.return=W,Y;case re:return Y=Dr(Y),ge(W,Y,te)}if(be(Y)||P(Y))return Y=pa(Y,W.mode,te,null),Y.return=W,Y;if(typeof Y.then=="function")return ge(W,Ic(Y),te);if(Y.$$typeof===H)return ge(W,Bc(W,Y),te);Gc(W,Y)}return null}function ae(W,Y,te,me){var Be=Y!==null?Y.key:null;if(typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint")return Be!==null?null:D(W,Y,""+te,me);if(typeof te=="object"&&te!==null){switch(te.$$typeof){case S:return te.key===Be?L(W,Y,te,me):null;case N:return te.key===Be?ne(W,Y,te,me):null;case re:return te=Dr(te),ae(W,Y,te,me)}if(be(te)||P(te))return Be!==null?null:fe(W,Y,te,me,null);if(typeof te.then=="function")return ae(W,Y,Ic(te),me);if(te.$$typeof===H)return ae(W,Y,Bc(W,te),me);Gc(W,te)}return null}function le(W,Y,te,me,Be){if(typeof me=="string"&&me!==""||typeof me=="number"||typeof me=="bigint")return W=W.get(te)||null,D(Y,W,""+me,Be);if(typeof me=="object"&&me!==null){switch(me.$$typeof){case S:return W=W.get(me.key===null?te:me.key)||null,L(Y,W,me,Be);case N:return W=W.get(me.key===null?te:me.key)||null,ne(Y,W,me,Be);case re:return me=Dr(me),le(W,Y,te,me,Be)}if(be(me)||P(me))return W=W.get(te)||null,fe(Y,W,me,Be,null);if(typeof me.then=="function")return le(W,Y,te,Ic(me),Be);if(me.$$typeof===H)return le(W,Y,te,Bc(Y,me),Be);Gc(Y,me)}return null}function Ue(W,Y,te,me){for(var Be=null,dt=null,Ve=Y,Je=Y=0,lt=null;Ve!==null&&Je<te.length;Je++){Ve.index>Je?(lt=Ve,Ve=null):lt=Ve.sibling;var ht=ae(W,Ve,te[Je],me);if(ht===null){Ve===null&&(Ve=lt);break}e&&Ve&&ht.alternate===null&&t(W,Ve),Y=d(ht,Y,Je),dt===null?Be=ht:dt.sibling=ht,dt=ht,Ve=lt}if(Je===te.length)return s(W,Ve),I&&c(W,Je),Be;if(Ve===null){for(;Je<te.length;Je++)Ve=ge(W,te[Je],me),Ve!==null&&(Y=d(Ve,Y,Je),dt===null?Be=Ve:dt.sibling=Ve,dt=Ve);return I&&c(W,Je),Be}for(Ve=r(Ve);Je<te.length;Je++)lt=le(Ve,W,Je,te[Je],me),lt!==null&&(e&&lt.alternate!==null&&Ve.delete(lt.key===null?Je:lt.key),Y=d(lt,Y,Je),dt===null?Be=lt:dt.sibling=lt,dt=lt);return e&&Ve.forEach(function(Ai){return t(W,Ai)}),I&&c(W,Je),Be}function Ye(W,Y,te,me){if(te==null)throw Error(l(151));for(var Be=null,dt=null,Ve=Y,Je=Y=0,lt=null,ht=te.next();Ve!==null&&!ht.done;Je++,ht=te.next()){Ve.index>Je?(lt=Ve,Ve=null):lt=Ve.sibling;var Ai=ae(W,Ve,ht.value,me);if(Ai===null){Ve===null&&(Ve=lt);break}e&&Ve&&Ai.alternate===null&&t(W,Ve),Y=d(Ai,Y,Je),dt===null?Be=Ai:dt.sibling=Ai,dt=Ai,Ve=lt}if(ht.done)return s(W,Ve),I&&c(W,Je),Be;if(Ve===null){for(;!ht.done;Je++,ht=te.next())ht=ge(W,ht.value,me),ht!==null&&(Y=d(ht,Y,Je),dt===null?Be=ht:dt.sibling=ht,dt=ht);return I&&c(W,Je),Be}for(Ve=r(Ve);!ht.done;Je++,ht=te.next())ht=le(Ve,W,Je,ht.value,me),ht!==null&&(e&&ht.alternate!==null&&Ve.delete(ht.key===null?Je:ht.key),Y=d(ht,Y,Je),dt===null?Be=ht:dt.sibling=ht,dt=ht);return e&&Ve.forEach(function(mE){return t(W,mE)}),I&&c(W,Je),Be}function Tt(W,Y,te,me){if(typeof te=="object"&&te!==null&&te.type===O&&te.key===null&&(te=te.props.children),typeof te=="object"&&te!==null){switch(te.$$typeof){case S:e:{for(var Be=te.key;Y!==null;){if(Y.key===Be){if(Be=te.type,Be===O){if(Y.tag===7){s(W,Y.sibling),me=f(Y,te.props.children),me.return=W,W=me;break e}}else if(Y.elementType===Be||typeof Be=="object"&&Be!==null&&Be.$$typeof===re&&Dr(Be)===Y.type){s(W,Y.sibling),me=f(Y,te.props),Pu(me,te),me.return=W,W=me;break e}s(W,Y);break}else t(W,Y);Y=Y.sibling}te.type===O?(me=pa(te.props.children,W.mode,me,te.key),me.return=W,W=me):(me=_l(te.type,te.key,te.props,null,W.mode,me),Pu(me,te),me.return=W,W=me)}return x(W);case N:e:{for(Be=te.key;Y!==null;){if(Y.key===Be)if(Y.tag===4&&Y.stateNode.containerInfo===te.containerInfo&&Y.stateNode.implementation===te.implementation){s(W,Y.sibling),me=f(Y,te.children||[]),me.return=W,W=me;break e}else{s(W,Y);break}else t(W,Y);Y=Y.sibling}me=yi(te,W.mode,me),me.return=W,W=me}return x(W);case re:return te=Dr(te),Tt(W,Y,te,me)}if(be(te))return Ue(W,Y,te,me);if(P(te)){if(Be=P(te),typeof Be!="function")throw Error(l(150));return te=Be.call(te),Ye(W,Y,te,me)}if(typeof te.then=="function")return Tt(W,Y,Ic(te),me);if(te.$$typeof===H)return Tt(W,Y,Bc(W,te),me);Gc(W,te)}return typeof te=="string"&&te!==""||typeof te=="number"||typeof te=="bigint"?(te=""+te,Y!==null&&Y.tag===6?(s(W,Y.sibling),me=f(Y,te),me.return=W,W=me):(s(W,Y),me=Gu(te,W.mode,me),me.return=W,W=me),x(W)):s(W,Y)}return function(W,Y,te,me){try{Ju=0;var Be=Tt(W,Y,te,me);return jl=null,Be}catch(Ve){if(Ve===Dl||Ve===$c)throw Ve;var dt=yn(29,Ve,null,W.mode);return dt.lanes=me,dt.return=W,dt}finally{}}}var Rr=mg(!0),yg=mg(!1),gi=!1;function Jd(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function Pd(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 vi(e){return{lane:e,tag:0,payload:null,callback:null,next:null}}function pi(e,t,s){var r=e.updateQueue;if(r===null)return null;if(r=r.shared,(gt&2)!==0){var f=r.pending;return f===null?t.next=t:(t.next=f.next,f.next=t),r.pending=t,t=Or(e),_r(e,null,s),t}return ya(e,r,t,s),Or(e)}function eo(e,t,s){if(t=t.updateQueue,t!==null&&(t=t.shared,(s&4194048)!==0)){var r=t.lanes;r&=e.pendingLanes,s|=r,t.lanes=s,Rn(e,s)}}function eh(e,t){var s=e.updateQueue,r=e.alternate;if(r!==null&&(r=r.updateQueue,s===r)){var f=null,d=null;if(s=s.firstBaseUpdate,s!==null){do{var x={lane:s.lane,tag:s.tag,payload:s.payload,callback:null,next:null};d===null?f=d=x:d=d.next=x,s=s.next}while(s!==null);d===null?f=d=t:d=d.next=t}else f=d=t;s={baseState:r.baseState,firstBaseUpdate:f,lastBaseUpdate:d,shared:r.shared,callbacks:r.callbacks},e.updateQueue=s;return}e=s.lastBaseUpdate,e===null?s.firstBaseUpdate=t:e.next=t,s.lastBaseUpdate=t}var th=!1;function to(){if(th){var e=Ml;if(e!==null)throw e}}function no(e,t,s,r){th=!1;var f=e.updateQueue;gi=!1;var d=f.firstBaseUpdate,x=f.lastBaseUpdate,D=f.shared.pending;if(D!==null){f.shared.pending=null;var L=D,ne=L.next;L.next=null,x===null?d=ne:x.next=ne,x=L;var fe=e.alternate;fe!==null&&(fe=fe.updateQueue,D=fe.lastBaseUpdate,D!==x&&(D===null?fe.firstBaseUpdate=ne:D.next=ne,fe.lastBaseUpdate=L))}if(d!==null){var ge=f.baseState;x=0,fe=ne=L=null,D=d;do{var ae=D.lane&-536870913,le=ae!==D.lane;if(le?(rt&ae)===ae:(r&ae)===ae){ae!==0&&ae===Cl&&(th=!0),fe!==null&&(fe=fe.next={lane:0,tag:D.tag,payload:D.payload,callback:null,next:null});e:{var Ue=e,Ye=D;ae=t;var Tt=s;switch(Ye.tag){case 1:if(Ue=Ye.payload,typeof Ue=="function"){ge=Ue.call(Tt,ge,ae);break e}ge=Ue;break e;case 3:Ue.flags=Ue.flags&-65537|128;case 0:if(Ue=Ye.payload,ae=typeof Ue=="function"?Ue.call(Tt,ge,ae):Ue,ae==null)break e;ge=w({},ge,ae);break e;case 2:gi=!0}}ae=D.callback,ae!==null&&(e.flags|=64,le&&(e.flags|=8192),le=f.callbacks,le===null?f.callbacks=[ae]:le.push(ae))}else le={lane:ae,tag:D.tag,payload:D.payload,callback:D.callback,next:null},fe===null?(ne=fe=le,L=ge):fe=fe.next=le,x|=ae;if(D=D.next,D===null){if(D=f.shared.pending,D===null)break;le=D,D=le.next,le.next=null,f.lastBaseUpdate=le,f.shared.pending=null}}while(!0);fe===null&&(L=ge),f.baseState=L,f.firstBaseUpdate=ne,f.lastBaseUpdate=fe,d===null&&(f.shared.lanes=0),Ti|=x,e.lanes=x,e.memoizedState=ge}}function gg(e,t){if(typeof e!="function")throw Error(l(191,e));e.call(t)}function vg(e,t){var s=e.callbacks;if(s!==null)for(e.callbacks=null,e=0;e<s.length;e++)gg(s[e],t)}var Rl=q(null),Xc=q(0);function pg(e,t){e=Vs,Oe(Xc,e),Oe(Rl,t),Vs=e|t.baseLanes}function nh(){Oe(Xc,Vs),Oe(Rl,Rl.current)}function ah(){Vs=Xc.current,ue(Rl),ue(Xc)}var ea=q(null),Ea=null;function bi(e){var t=e.alternate;Oe($t,$t.current&1),Oe(ea,e),Ea===null&&(t===null||Rl.current!==null||t.memoizedState!==null)&&(Ea=e)}function sh(e){Oe($t,$t.current),Oe(ea,e),Ea===null&&(Ea=e)}function bg(e){e.tag===22?(Oe($t,$t.current),Oe(ea,e),Ea===null&&(Ea=e)):Si()}function Si(){Oe($t,$t.current),Oe(ea,ea.current)}function ta(e){ue(ea),Ea===e&&(Ea=null),ue($t)}var $t=q(0);function Qc(e){for(var t=e;t!==null;){if(t.tag===13){var s=t.memoizedState;if(s!==null&&(s=s.dehydrated,s===null||cm(s)||fm(s)))return t}else if(t.tag===19&&(t.memoizedProps.revealOrder==="forwards"||t.memoizedProps.revealOrder==="backwards"||t.memoizedProps.revealOrder==="unstable_legacy-backwards"||t.memoizedProps.revealOrder==="together")){if((t.flags&128)!==0)return t}else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break;for(;t.sibling===null;){if(t.return===null||t.return===e)return null;t=t.return}t.sibling.return=t.return,t=t.sibling}return null}var js=0,Ke=null,xt=null,Kt=null,Wc=!1,Al=!1,Ar=!1,Kc=0,ao=0,kl=null,s1=0;function Ht(){throw Error(l(321))}function ih(e,t){if(t===null)return!1;for(var s=0;s<t.length&&s<e.length;s++)if(!En(e[s],t[s]))return!1;return!0}function rh(e,t,s,r,f,d){return js=d,Ke=t,t.memoizedState=null,t.updateQueue=null,t.lanes=0,X.H=e===null||e.memoizedState===null?nv:xh,Ar=!1,d=s(r,f),Ar=!1,Al&&(d=xg(t,s,r,f)),Sg(e),d}function Sg(e){X.H=ro;var t=xt!==null&&xt.next!==null;if(js=0,Kt=xt=Ke=null,Wc=!1,ao=0,kl=null,t)throw Error(l(300));e===null||Jt||(e=e.dependencies,e!==null&&wl(e)&&(Jt=!0))}function xg(e,t,s,r){Ke=e;var f=0;do{if(Al&&(kl=null),ao=0,Al=!1,25<=f)throw Error(l(301));if(f+=1,Kt=xt=null,e.updateQueue!=null){var d=e.updateQueue;d.lastEffect=null,d.events=null,d.stores=null,d.memoCache!=null&&(d.memoCache.index=0)}X.H=av,d=t(s,r)}while(Al);return d}function i1(){var e=X.H,t=e.useState()[0];return t=typeof t.then=="function"?so(t):t,e=e.useState()[0],(xt!==null?xt.memoizedState:null)!==e&&(Ke.flags|=1024),t}function lh(){var e=Kc!==0;return Kc=0,e}function uh(e,t,s){t.updateQueue=e.updateQueue,t.flags&=-2053,e.lanes&=~s}function oh(e){if(Wc){for(e=e.memoizedState;e!==null;){var t=e.queue;t!==null&&(t.pending=null),e=e.next}Wc=!1}js=0,Kt=xt=Ke=null,Al=!1,ao=Kc=0,kl=null}function Cn(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Kt===null?Ke.memoizedState=Kt=e:Kt=Kt.next=e,Kt}function Yt(){if(xt===null){var e=Ke.alternate;e=e!==null?e.memoizedState:null}else e=xt.next;var t=Kt===null?Ke.memoizedState:Kt.next;if(t!==null)Kt=t,xt=e;else{if(e===null)throw Ke.alternate===null?Error(l(467)):Error(l(310));xt=e,e={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},Kt===null?Ke.memoizedState=Kt=e:Kt=Kt.next=e}return Kt}function Jc(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function so(e){var t=ao;return ao+=1,kl===null&&(kl=[]),e=fg(kl,e,t),t=Ke,(Kt===null?t.memoizedState:Kt.next)===null&&(t=t.alternate,X.H=t===null||t.memoizedState===null?nv:xh),e}function Pc(e){if(e!==null&&typeof e=="object"){if(typeof e.then=="function")return so(e);if(e.$$typeof===H)return gn(e)}throw Error(l(438,String(e)))}function ch(e){var t=null,s=Ke.updateQueue;if(s!==null&&(t=s.memoCache),t==null){var r=Ke.alternate;r!==null&&(r=r.updateQueue,r!==null&&(r=r.memoCache,r!=null&&(t={data:r.data.map(function(f){return f.slice()}),index:0})))}if(t==null&&(t={data:[],index:0}),s===null&&(s=Jc(),Ke.updateQueue=s),s.memoCache=t,s=t.data[t.index],s===void 0)for(s=t.data[t.index]=Array(e),r=0;r<e;r++)s[r]=V;return t.index++,s}function Rs(e,t){return typeof t=="function"?t(e):t}function ef(e){var t=Yt();return fh(t,xt,e)}function fh(e,t,s){var r=e.queue;if(r===null)throw Error(l(311));r.lastRenderedReducer=s;var f=e.baseQueue,d=r.pending;if(d!==null){if(f!==null){var x=f.next;f.next=d.next,d.next=x}t.baseQueue=f=d,r.pending=null}if(d=e.baseState,f===null)e.memoizedState=d;else{t=f.next;var D=x=null,L=null,ne=t,fe=!1;do{var ge=ne.lane&-536870913;if(ge!==ne.lane?(rt&ge)===ge:(js&ge)===ge){var ae=ne.revertLane;if(ae===0)L!==null&&(L=L.next={lane:0,revertLane:0,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null}),ge===Cl&&(fe=!0);else if((js&ae)===ae){ne=ne.next,ae===Cl&&(fe=!0);continue}else ge={lane:0,revertLane:ne.revertLane,gesture:null,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},L===null?(D=L=ge,x=d):L=L.next=ge,Ke.lanes|=ae,Ti|=ae;ge=ne.action,Ar&&s(d,ge),d=ne.hasEagerState?ne.eagerState:s(d,ge)}else ae={lane:ge,revertLane:ne.revertLane,gesture:ne.gesture,action:ne.action,hasEagerState:ne.hasEagerState,eagerState:ne.eagerState,next:null},L===null?(D=L=ae,x=d):L=L.next=ae,Ke.lanes|=ge,Ti|=ge;ne=ne.next}while(ne!==null&&ne!==t);if(L===null?x=d:L.next=D,!En(d,e.memoizedState)&&(Jt=!0,fe&&(s=Ml,s!==null)))throw s;e.memoizedState=d,e.baseState=x,e.baseQueue=L,r.lastRenderedState=d}return f===null&&(r.lanes=0),[e.memoizedState,r.dispatch]}function dh(e){var t=Yt(),s=t.queue;if(s===null)throw Error(l(311));s.lastRenderedReducer=e;var r=s.dispatch,f=s.pending,d=t.memoizedState;if(f!==null){s.pending=null;var x=f=f.next;do d=e(d,x.action),x=x.next;while(x!==f);En(d,t.memoizedState)||(Jt=!0),t.memoizedState=d,t.baseQueue===null&&(t.baseState=d),s.lastRenderedState=d}return[d,r]}function Eg(e,t,s){var r=Ke,f=Yt(),d=I;if(d){if(s===void 0)throw Error(l(407));s=s()}else s=t();var x=!En((xt||f).memoizedState,s);if(x&&(f.memoizedState=s,Jt=!0),f=f.queue,yh(_g.bind(null,r,f,e),[e]),f.getSnapshot!==t||x||Kt!==null&&Kt.memoizedState.tag&1){if(r.flags|=2048,Ul(9,{destroy:void 0},Ng.bind(null,r,f,s,t),null),Nt===null)throw Error(l(349));d||(js&127)!==0||Tg(r,t,s)}return s}function Tg(e,t,s){e.flags|=16384,e={getSnapshot:t,value:s},t=Ke.updateQueue,t===null?(t=Jc(),Ke.updateQueue=t,t.stores=[e]):(s=t.stores,s===null?t.stores=[e]:s.push(e))}function Ng(e,t,s,r){t.value=s,t.getSnapshot=r,Og(t)&&wg(e)}function _g(e,t,s){return s(function(){Og(t)&&wg(e)})}function Og(e){var t=e.getSnapshot;e=e.value;try{var s=t();return!En(e,s)}catch{return!0}}function wg(e){var t=ga(e,2);t!==null&&Bn(t,e,2)}function hh(e){var t=Cn();if(typeof e=="function"){var s=e;if(e=s(),Ar){_e(!0);try{s()}finally{_e(!1)}}}return t.memoizedState=t.baseState=e,t.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:e},t}function Cg(e,t,s,r){return e.baseState=s,fh(e,xt,typeof r=="function"?r:Rs)}function r1(e,t,s,r,f){if(af(e))throw Error(l(485));if(e=t.action,e!==null){var d={payload:f,action:e,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(x){d.listeners.push(x)}};X.T!==null?s(!0):d.isTransition=!1,r(d),s=t.pending,s===null?(d.next=t.pending=d,Mg(t,d)):(d.next=s.next,t.pending=s.next=d)}}function Mg(e,t){var s=t.action,r=t.payload,f=e.state;if(t.isTransition){var d=X.T,x={};X.T=x;try{var D=s(f,r),L=X.S;L!==null&&L(x,D),Dg(e,t,D)}catch(ne){mh(e,t,ne)}finally{d!==null&&x.types!==null&&(d.types=x.types),X.T=d}}else try{d=s(f,r),Dg(e,t,d)}catch(ne){mh(e,t,ne)}}function Dg(e,t,s){s!==null&&typeof s=="object"&&typeof s.then=="function"?s.then(function(r){jg(e,t,r)},function(r){return mh(e,t,r)}):jg(e,t,s)}function jg(e,t,s){t.status="fulfilled",t.value=s,Rg(t),e.state=s,t=e.pending,t!==null&&(s=t.next,s===t?e.pending=null:(s=s.next,t.next=s,Mg(e,s)))}function mh(e,t,s){var r=e.pending;if(e.pending=null,r!==null){r=r.next;do t.status="rejected",t.reason=s,Rg(t),t=t.next;while(t!==r)}e.action=null}function Rg(e){e=e.listeners;for(var t=0;t<e.length;t++)(0,e[t])()}function Ag(e,t){return t}function kg(e,t){if(I){var s=Nt.formState;if(s!==null){e:{var r=Ke;if(I){if($){t:{for(var f=$,d=ke;f.nodeType!==8;){if(!d){f=null;break t}if(f=Ta(f.nextSibling),f===null){f=null;break t}}d=f.data,f=d==="F!"||d==="F"?f:null}if(f){$=Ta(f.nextSibling),r=f.data==="F!";break e}}it(r)}r=!1}r&&(t=s[0])}}return s=Cn(),s.memoizedState=s.baseState=t,r={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Ag,lastRenderedState:t},s.queue=r,s=Pg.bind(null,Ke,r),r.dispatch=s,r=hh(!1),d=Sh.bind(null,Ke,!1,r.queue),r=Cn(),f={state:t,dispatch:null,action:e,pending:null},r.queue=f,s=r1.bind(null,Ke,f,d,s),f.dispatch=s,r.memoizedState=e,[t,s,!1]}function Ug(e){var t=Yt();return zg(t,xt,e)}function zg(e,t,s){if(t=fh(e,t,Ag)[0],e=ef(Rs)[0],typeof t=="object"&&t!==null&&typeof t.then=="function")try{var r=so(t)}catch(x){throw x===Dl?$c:x}else r=t;t=Yt();var f=t.queue,d=f.dispatch;return s!==t.memoizedState&&(Ke.flags|=2048,Ul(9,{destroy:void 0},l1.bind(null,f,s),null)),[r,d,e]}function l1(e,t){e.action=t}function Lg(e){var t=Yt(),s=xt;if(s!==null)return zg(t,s,e);Yt(),t=t.memoizedState,s=Yt();var r=s.queue.dispatch;return s.memoizedState=e,[t,r,!1]}function Ul(e,t,s,r){return e={tag:e,create:s,deps:r,inst:t,next:null},t=Ke.updateQueue,t===null&&(t=Jc(),Ke.updateQueue=t),s=t.lastEffect,s===null?t.lastEffect=e.next=e:(r=s.next,s.next=e,e.next=r,t.lastEffect=e),e}function Hg(){return Yt().memoizedState}function tf(e,t,s,r){var f=Cn();Ke.flags|=e,f.memoizedState=Ul(1|t,{destroy:void 0},s,r===void 0?null:r)}function nf(e,t,s,r){var f=Yt();r=r===void 0?null:r;var d=f.memoizedState.inst;xt!==null&&r!==null&&ih(r,xt.memoizedState.deps)?f.memoizedState=Ul(t,d,s,r):(Ke.flags|=e,f.memoizedState=Ul(1|t,d,s,r))}function Vg(e,t){tf(8390656,8,e,t)}function yh(e,t){nf(2048,8,e,t)}function u1(e){Ke.flags|=4;var t=Ke.updateQueue;if(t===null)t=Jc(),Ke.updateQueue=t,t.events=[e];else{var s=t.events;s===null?t.events=[e]:s.push(e)}}function Fg(e){var t=Yt().memoizedState;return u1({ref:t,nextImpl:e}),function(){if((gt&2)!==0)throw Error(l(440));return t.impl.apply(void 0,arguments)}}function qg(e,t){return nf(4,2,e,t)}function Bg(e,t){return nf(4,4,e,t)}function Zg(e,t){if(typeof t=="function"){e=e();var s=t(e);return function(){typeof s=="function"?s():t(null)}}if(t!=null)return e=e(),t.current=e,function(){t.current=null}}function $g(e,t,s){s=s!=null?s.concat([e]):null,nf(4,4,Zg.bind(null,t,e),s)}function gh(){}function Yg(e,t){var s=Yt();t=t===void 0?null:t;var r=s.memoizedState;return t!==null&&ih(t,r[1])?r[0]:(s.memoizedState=[e,t],e)}function Ig(e,t){var s=Yt();t=t===void 0?null:t;var r=s.memoizedState;if(t!==null&&ih(t,r[1]))return r[0];if(r=e(),Ar){_e(!0);try{e()}finally{_e(!1)}}return s.memoizedState=[r,t],r}function vh(e,t,s){return s===void 0||(js&1073741824)!==0&&(rt&261930)===0?e.memoizedState=t:(e.memoizedState=s,e=Gv(),Ke.lanes|=e,Ti|=e,s)}function Gg(e,t,s,r){return En(s,t)?s:Rl.current!==null?(e=vh(e,s,r),En(e,t)||(Jt=!0),e):(js&42)===0||(js&1073741824)!==0&&(rt&261930)===0?(Jt=!0,e.memoizedState=s):(e=Gv(),Ke.lanes|=e,Ti|=e,t)}function Xg(e,t,s,r,f){var d=ce.p;ce.p=d!==0&&8>d?d:8;var x=X.T,D={};X.T=D,Sh(e,!1,t,s);try{var L=f(),ne=X.S;if(ne!==null&&ne(D,L),L!==null&&typeof L=="object"&&typeof L.then=="function"){var fe=a1(L,r);io(e,t,fe,sa(e))}else io(e,t,r,sa(e))}catch(ge){io(e,t,{then:function(){},status:"rejected",reason:ge},sa())}finally{ce.p=d,x!==null&&D.types!==null&&(x.types=D.types),X.T=x}}function o1(){}function ph(e,t,s,r){if(e.tag!==5)throw Error(l(476));var f=Qg(e).queue;Xg(e,f,t,ye,s===null?o1:function(){return Wg(e),s(r)})}function Qg(e){var t=e.memoizedState;if(t!==null)return t;t={memoizedState:ye,baseState:ye,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:ye},next:null};var s={};return t.next={memoizedState:s,baseState:s,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Rs,lastRenderedState:s},next:null},e.memoizedState=t,e=e.alternate,e!==null&&(e.memoizedState=t),t}function Wg(e){var t=Qg(e);t.next===null&&(t=e.alternate.memoizedState),io(e,t.next.queue,{},sa())}function bh(){return gn(To)}function Kg(){return Yt().memoizedState}function Jg(){return Yt().memoizedState}function c1(e){for(var t=e.return;t!==null;){switch(t.tag){case 24:case 3:var s=sa();e=vi(s);var r=pi(t,e,s);r!==null&&(Bn(r,t,s),eo(r,t,s)),t={cache:Xd()},e.payload=t;return}t=t.return}}function f1(e,t,s){var r=sa();s={lane:r,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null},af(e)?ev(t,s):(s=El(e,t,s,r),s!==null&&(Bn(s,e,r),tv(s,t,r)))}function Pg(e,t,s){var r=sa();io(e,t,s,r)}function io(e,t,s,r){var f={lane:r,revertLane:0,gesture:null,action:s,hasEagerState:!1,eagerState:null,next:null};if(af(e))ev(t,f);else{var d=e.alternate;if(e.lanes===0&&(d===null||d.lanes===0)&&(d=t.lastRenderedReducer,d!==null))try{var x=t.lastRenderedState,D=d(x,s);if(f.hasEagerState=!0,f.eagerState=D,En(D,x))return ya(e,t,f,0),Nt===null&&mi(),!1}catch{}finally{}if(s=El(e,t,f,r),s!==null)return Bn(s,e,r),tv(s,t,r),!0}return!1}function Sh(e,t,s,r){if(r={lane:2,revertLane:Jh(),gesture:null,action:r,hasEagerState:!1,eagerState:null,next:null},af(e)){if(t)throw Error(l(479))}else t=El(e,s,r,2),t!==null&&Bn(t,e,2)}function af(e){var t=e.alternate;return e===Ke||t!==null&&t===Ke}function ev(e,t){Al=Wc=!0;var s=e.pending;s===null?t.next=t:(t.next=s.next,s.next=t),e.pending=t}function tv(e,t,s){if((s&4194048)!==0){var r=t.lanes;r&=e.pendingLanes,s|=r,t.lanes=s,Rn(e,s)}}var ro={readContext:gn,use:Pc,useCallback:Ht,useContext:Ht,useEffect:Ht,useImperativeHandle:Ht,useLayoutEffect:Ht,useInsertionEffect:Ht,useMemo:Ht,useReducer:Ht,useRef:Ht,useState:Ht,useDebugValue:Ht,useDeferredValue:Ht,useTransition:Ht,useSyncExternalStore:Ht,useId:Ht,useHostTransitionStatus:Ht,useFormState:Ht,useActionState:Ht,useOptimistic:Ht,useMemoCache:Ht,useCacheRefresh:Ht};ro.useEffectEvent=Ht;var nv={readContext:gn,use:Pc,useCallback:function(e,t){return Cn().memoizedState=[e,t===void 0?null:t],e},useContext:gn,useEffect:Vg,useImperativeHandle:function(e,t,s){s=s!=null?s.concat([e]):null,tf(4194308,4,Zg.bind(null,t,e),s)},useLayoutEffect:function(e,t){return tf(4194308,4,e,t)},useInsertionEffect:function(e,t){tf(4,2,e,t)},useMemo:function(e,t){var s=Cn();t=t===void 0?null:t;var r=e();if(Ar){_e(!0);try{e()}finally{_e(!1)}}return s.memoizedState=[r,t],r},useReducer:function(e,t,s){var r=Cn();if(s!==void 0){var f=s(t);if(Ar){_e(!0);try{s(t)}finally{_e(!1)}}}else f=t;return r.memoizedState=r.baseState=f,e={pending:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:f},r.queue=e,e=e.dispatch=f1.bind(null,Ke,e),[r.memoizedState,e]},useRef:function(e){var t=Cn();return e={current:e},t.memoizedState=e},useState:function(e){e=hh(e);var t=e.queue,s=Pg.bind(null,Ke,t);return t.dispatch=s,[e.memoizedState,s]},useDebugValue:gh,useDeferredValue:function(e,t){var s=Cn();return vh(s,e,t)},useTransition:function(){var e=hh(!1);return e=Xg.bind(null,Ke,e.queue,!0,!1),Cn().memoizedState=e,[!1,e]},useSyncExternalStore:function(e,t,s){var r=Ke,f=Cn();if(I){if(s===void 0)throw Error(l(407));s=s()}else{if(s=t(),Nt===null)throw Error(l(349));(rt&127)!==0||Tg(r,t,s)}f.memoizedState=s;var d={value:s,getSnapshot:t};return f.queue=d,Vg(_g.bind(null,r,d,e),[e]),r.flags|=2048,Ul(9,{destroy:void 0},Ng.bind(null,r,d,s,t),null),s},useId:function(){var e=Cn(),t=Nt.identifierPrefix;if(I){var s=p,r=ba;s=(r&~(1<<32-Ee(r)-1)).toString(32)+s,t="_"+t+"R_"+s,s=Kc++,0<s&&(t+="H"+s.toString(32)),t+="_"}else s=s1++,t="_"+t+"r_"+s.toString(32)+"_";return e.memoizedState=t},useHostTransitionStatus:bh,useFormState:kg,useActionState:kg,useOptimistic:function(e){var t=Cn();t.memoizedState=t.baseState=e;var s={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return t.queue=s,t=Sh.bind(null,Ke,!0,s),s.dispatch=t,[e,t]},useMemoCache:ch,useCacheRefresh:function(){return Cn().memoizedState=c1.bind(null,Ke)},useEffectEvent:function(e){var t=Cn(),s={impl:e};return t.memoizedState=s,function(){if((gt&2)!==0)throw Error(l(440));return s.impl.apply(void 0,arguments)}}},xh={readContext:gn,use:Pc,useCallback:Yg,useContext:gn,useEffect:yh,useImperativeHandle:$g,useInsertionEffect:qg,useLayoutEffect:Bg,useMemo:Ig,useReducer:ef,useRef:Hg,useState:function(){return ef(Rs)},useDebugValue:gh,useDeferredValue:function(e,t){var s=Yt();return Gg(s,xt.memoizedState,e,t)},useTransition:function(){var e=ef(Rs)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:so(e),t]},useSyncExternalStore:Eg,useId:Kg,useHostTransitionStatus:bh,useFormState:Ug,useActionState:Ug,useOptimistic:function(e,t){var s=Yt();return Cg(s,xt,e,t)},useMemoCache:ch,useCacheRefresh:Jg};xh.useEffectEvent=Fg;var av={readContext:gn,use:Pc,useCallback:Yg,useContext:gn,useEffect:yh,useImperativeHandle:$g,useInsertionEffect:qg,useLayoutEffect:Bg,useMemo:Ig,useReducer:dh,useRef:Hg,useState:function(){return dh(Rs)},useDebugValue:gh,useDeferredValue:function(e,t){var s=Yt();return xt===null?vh(s,e,t):Gg(s,xt.memoizedState,e,t)},useTransition:function(){var e=dh(Rs)[0],t=Yt().memoizedState;return[typeof e=="boolean"?e:so(e),t]},useSyncExternalStore:Eg,useId:Kg,useHostTransitionStatus:bh,useFormState:Lg,useActionState:Lg,useOptimistic:function(e,t){var s=Yt();return xt!==null?Cg(s,xt,e,t):(s.baseState=e,[e,s.queue.dispatch])},useMemoCache:ch,useCacheRefresh:Jg};av.useEffectEvent=Fg;function Eh(e,t,s,r){t=e.memoizedState,s=s(r,t),s=s==null?t:w({},t,s),e.memoizedState=s,e.lanes===0&&(e.updateQueue.baseState=s)}var Th={enqueueSetState:function(e,t,s){e=e._reactInternals;var r=sa(),f=vi(r);f.payload=t,s!=null&&(f.callback=s),t=pi(e,f,r),t!==null&&(Bn(t,e,r),eo(t,e,r))},enqueueReplaceState:function(e,t,s){e=e._reactInternals;var r=sa(),f=vi(r);f.tag=1,f.payload=t,s!=null&&(f.callback=s),t=pi(e,f,r),t!==null&&(Bn(t,e,r),eo(t,e,r))},enqueueForceUpdate:function(e,t){e=e._reactInternals;var s=sa(),r=vi(s);r.tag=2,t!=null&&(r.callback=t),t=pi(e,r,s),t!==null&&(Bn(t,e,s),eo(t,e,s))}};function sv(e,t,s,r,f,d,x){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(r,d,x):t.prototype&&t.prototype.isPureReactComponent?!Er(s,r)||!Er(f,d):!0}function iv(e,t,s,r){e=t.state,typeof t.componentWillReceiveProps=="function"&&t.componentWillReceiveProps(s,r),typeof t.UNSAFE_componentWillReceiveProps=="function"&&t.UNSAFE_componentWillReceiveProps(s,r),t.state!==e&&Th.enqueueReplaceState(t,t.state,null)}function kr(e,t){var s=t;if("ref"in t){s={};for(var r in t)r!=="ref"&&(s[r]=t[r])}if(e=e.defaultProps){s===t&&(s=w({},s));for(var f in e)s[f]===void 0&&(s[f]=e[f])}return s}function rv(e){hi(e)}function lv(e){console.error(e)}function uv(e){hi(e)}function sf(e,t){try{var s=e.onUncaughtError;s(t.value,{componentStack:t.stack})}catch(r){setTimeout(function(){throw r})}}function ov(e,t,s){try{var r=e.onCaughtError;r(s.value,{componentStack:s.stack,errorBoundary:t.tag===1?t.stateNode:null})}catch(f){setTimeout(function(){throw f})}}function Nh(e,t,s){return s=vi(s),s.tag=3,s.payload={element:null},s.callback=function(){sf(e,t)},s}function cv(e){return e=vi(e),e.tag=3,e}function fv(e,t,s,r){var f=s.type.getDerivedStateFromError;if(typeof f=="function"){var d=r.value;e.payload=function(){return f(d)},e.callback=function(){ov(t,s,r)}}var x=s.stateNode;x!==null&&typeof x.componentDidCatch=="function"&&(e.callback=function(){ov(t,s,r),typeof f!="function"&&(Ni===null?Ni=new Set([this]):Ni.add(this));var D=r.stack;this.componentDidCatch(r.value,{componentStack:D!==null?D:""})})}function d1(e,t,s,r,f){if(s.flags|=32768,r!==null&&typeof r=="object"&&typeof r.then=="function"){if(t=s.alternate,t!==null&&xa(t,s,f,!0),s=ea.current,s!==null){switch(s.tag){case 31:case 13:return Ea===null?vf():s.alternate===null&&Vt===0&&(Vt=3),s.flags&=-257,s.flags|=65536,s.lanes=f,r===Yc?s.flags|=16384:(t=s.updateQueue,t===null?s.updateQueue=new Set([r]):t.add(r),Qh(e,r,f)),!1;case 22:return s.flags|=65536,r===Yc?s.flags|=16384:(t=s.updateQueue,t===null?(t={transitions:null,markerInstances:null,retryQueue:new Set([r])},s.updateQueue=t):(s=t.retryQueue,s===null?t.retryQueue=new Set([r]):s.add(r)),Qh(e,r,f)),!1}throw Error(l(435,s.tag))}return Qh(e,r,f),vf(),!1}if(I)return t=ea.current,t!==null?((t.flags&65536)===0&&(t.flags|=256),t.flags|=65536,t.lanes=f,r!==Ge&&(e=Error(l(422),{cause:r}),Va(zn(e,s)))):(r!==Ge&&(t=Error(l(423),{cause:r}),Va(zn(t,s))),e=e.current.alternate,e.flags|=65536,f&=-f,e.lanes|=f,r=zn(r,s),f=Nh(e.stateNode,r,f),eh(e,f),Vt!==4&&(Vt=2)),!1;var d=Error(l(520),{cause:r});if(d=zn(d,s),yo===null?yo=[d]:yo.push(d),Vt!==4&&(Vt=2),t===null)return!0;r=zn(r,s),s=t;do{switch(s.tag){case 3:return s.flags|=65536,e=f&-f,s.lanes|=e,e=Nh(s.stateNode,r,e),eh(s,e),!1;case 1:if(t=s.type,d=s.stateNode,(s.flags&128)===0&&(typeof t.getDerivedStateFromError=="function"||d!==null&&typeof d.componentDidCatch=="function"&&(Ni===null||!Ni.has(d))))return s.flags|=65536,f&=-f,s.lanes|=f,f=cv(f),fv(f,e,s,r),eh(s,f),!1}s=s.return}while(s!==null);return!1}var _h=Error(l(461)),Jt=!1;function vn(e,t,s,r){t.child=e===null?yg(t,null,s,r):Rr(t,e.child,s,r)}function dv(e,t,s,r,f){s=s.render;var d=t.ref;if("ref"in r){var x={};for(var D in r)D!=="ref"&&(x[D]=r[D])}else x=r;return Cr(t),r=rh(e,t,s,x,d,f),D=lh(),e!==null&&!Jt?(uh(e,t,f),As(e,t,f)):(I&&D&&E(t),t.flags|=1,vn(e,t,r,f),t.child)}function hv(e,t,s,r,f){if(e===null){var d=s.type;return typeof d=="function"&&!Nl(d)&&d.defaultProps===void 0&&s.compare===null?(t.tag=15,t.type=d,mv(e,t,d,r,f)):(e=_l(s.type,null,r,t,t.mode,f),e.ref=t.ref,e.return=t,t.child=e)}if(d=e.child,!Ah(e,f)){var x=d.memoizedProps;if(s=s.compare,s=s!==null?s:Er,s(x,r)&&e.ref===t.ref)return As(e,t,f)}return t.flags|=1,e=va(d,r),e.ref=t.ref,e.return=t,t.child=e}function mv(e,t,s,r,f){if(e!==null){var d=e.memoizedProps;if(Er(d,r)&&e.ref===t.ref)if(Jt=!1,t.pendingProps=r=d,Ah(e,f))(e.flags&131072)!==0&&(Jt=!0);else return t.lanes=e.lanes,As(e,t,f)}return Oh(e,t,s,r,f)}function yv(e,t,s,r){var f=r.children,d=e!==null?e.memoizedState:null;if(e===null&&t.stateNode===null&&(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.mode==="hidden"){if((t.flags&128)!==0){if(d=d!==null?d.baseLanes|s:s,e!==null){for(r=t.child=e.child,f=0;r!==null;)f=f|r.lanes|r.childLanes,r=r.sibling;r=f&~d}else r=0,t.child=null;return gv(e,t,d,s,r)}if((s&536870912)!==0)t.memoizedState={baseLanes:0,cachePool:null},e!==null&&Zc(t,d!==null?d.cachePool:null),d!==null?pg(t,d):nh(),bg(t);else return r=t.lanes=536870912,gv(e,t,d!==null?d.baseLanes|s:s,s,r)}else d!==null?(Zc(t,d.cachePool),pg(t,d),Si(),t.memoizedState=null):(e!==null&&Zc(t,null),nh(),Si());return vn(e,t,f,s),t.child}function lo(e,t){return e!==null&&e.tag===22||t.stateNode!==null||(t.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),t.sibling}function gv(e,t,s,r,f){var d=Wd();return d=d===null?null:{parent:Wt._currentValue,pool:d},t.memoizedState={baseLanes:s,cachePool:d},e!==null&&Zc(t,null),nh(),bg(t),e!==null&&xa(e,t,r,!0),t.childLanes=f,null}function rf(e,t){return t=uf({mode:t.mode,children:t.children},e.mode),t.ref=e.ref,e.child=t,t.return=e,t}function vv(e,t,s){return Rr(t,e.child,null,s),e=rf(t,t.pendingProps),e.flags|=2,ta(t),t.memoizedState=null,e}function h1(e,t,s){var r=t.pendingProps,f=(t.flags&128)!==0;if(t.flags&=-129,e===null){if(I){if(r.mode==="hidden")return e=rf(t,r),t.lanes=536870912,lo(null,e);if(sh(t),(e=$)?(e=Mp(e,ke),e=e!==null&&e.data==="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ln!==null?{id:ba,overflow:p}:null,retryLane:536870912,hydrationErrors:null},s=qc(e),s.return=t,t.child=s,Z=t,$=null)):e=null,e===null)throw it(t);return t.lanes=536870912,null}return rf(t,r)}var d=e.memoizedState;if(d!==null){var x=d.dehydrated;if(sh(t),f)if(t.flags&256)t.flags&=-257,t=vv(e,t,s);else if(t.memoizedState!==null)t.child=e.child,t.flags|=128,t=null;else throw Error(l(558));else if(Jt||xa(e,t,s,!1),f=(s&e.childLanes)!==0,Jt||f){if(r=Nt,r!==null&&(x=Ou(r,s),x!==0&&x!==d.retryLane))throw d.retryLane=x,ga(e,x),Bn(r,e,x),_h;vf(),t=vv(e,t,s)}else e=d.treeContext,$=Ta(x.nextSibling),Z=t,I=!0,xe=null,ke=!1,e!==null&&U(t,e),t=rf(t,r),t.flags|=4096;return t}return e=va(e.child,{mode:r.mode,children:r.children}),e.ref=t.ref,t.child=e,e.return=t,e}function lf(e,t){var s=t.ref;if(s===null)e!==null&&e.ref!==null&&(t.flags|=4194816);else{if(typeof s!="function"&&typeof s!="object")throw Error(l(284));(e===null||e.ref!==s)&&(t.flags|=4194816)}}function Oh(e,t,s,r,f){return Cr(t),s=rh(e,t,s,r,void 0,f),r=lh(),e!==null&&!Jt?(uh(e,t,f),As(e,t,f)):(I&&r&&E(t),t.flags|=1,vn(e,t,s,f),t.child)}function pv(e,t,s,r,f,d){return Cr(t),t.updateQueue=null,s=xg(t,r,s,f),Sg(e),r=lh(),e!==null&&!Jt?(uh(e,t,d),As(e,t,d)):(I&&r&&E(t),t.flags|=1,vn(e,t,s,d),t.child)}function bv(e,t,s,r,f){if(Cr(t),t.stateNode===null){var d=Pn,x=s.contextType;typeof x=="object"&&x!==null&&(d=gn(x)),d=new s(r,d),t.memoizedState=d.state!==null&&d.state!==void 0?d.state:null,d.updater=Th,t.stateNode=d,d._reactInternals=t,d=t.stateNode,d.props=r,d.state=t.memoizedState,d.refs={},Jd(t),x=s.contextType,d.context=typeof x=="object"&&x!==null?gn(x):Pn,d.state=t.memoizedState,x=s.getDerivedStateFromProps,typeof x=="function"&&(Eh(t,s,x,r),d.state=t.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof d.getSnapshotBeforeUpdate=="function"||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(x=d.state,typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount(),x!==d.state&&Th.enqueueReplaceState(d,d.state,null),no(t,r,d,f),to(),d.state=t.memoizedState),typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!0}else if(e===null){d=t.stateNode;var D=t.memoizedProps,L=kr(s,D);d.props=L;var ne=d.context,fe=s.contextType;x=Pn,typeof fe=="object"&&fe!==null&&(x=gn(fe));var ge=s.getDerivedStateFromProps;fe=typeof ge=="function"||typeof d.getSnapshotBeforeUpdate=="function",D=t.pendingProps!==D,fe||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(D||ne!==x)&&iv(t,d,r,x),gi=!1;var ae=t.memoizedState;d.state=ae,no(t,r,d,f),to(),ne=t.memoizedState,D||ae!==ne||gi?(typeof ge=="function"&&(Eh(t,s,ge,r),ne=t.memoizedState),(L=gi||sv(t,s,L,r,ae,ne,x))?(fe||typeof d.UNSAFE_componentWillMount!="function"&&typeof d.componentWillMount!="function"||(typeof d.componentWillMount=="function"&&d.componentWillMount(),typeof d.UNSAFE_componentWillMount=="function"&&d.UNSAFE_componentWillMount()),typeof d.componentDidMount=="function"&&(t.flags|=4194308)):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),t.memoizedProps=r,t.memoizedState=ne),d.props=r,d.state=ne,d.context=x,r=L):(typeof d.componentDidMount=="function"&&(t.flags|=4194308),r=!1)}else{d=t.stateNode,Pd(e,t),x=t.memoizedProps,fe=kr(s,x),d.props=fe,ge=t.pendingProps,ae=d.context,ne=s.contextType,L=Pn,typeof ne=="object"&&ne!==null&&(L=gn(ne)),D=s.getDerivedStateFromProps,(ne=typeof D=="function"||typeof d.getSnapshotBeforeUpdate=="function")||typeof d.UNSAFE_componentWillReceiveProps!="function"&&typeof d.componentWillReceiveProps!="function"||(x!==ge||ae!==L)&&iv(t,d,r,L),gi=!1,ae=t.memoizedState,d.state=ae,no(t,r,d,f),to();var le=t.memoizedState;x!==ge||ae!==le||gi||e!==null&&e.dependencies!==null&&wl(e.dependencies)?(typeof D=="function"&&(Eh(t,s,D,r),le=t.memoizedState),(fe=gi||sv(t,s,fe,r,ae,le,L)||e!==null&&e.dependencies!==null&&wl(e.dependencies))?(ne||typeof d.UNSAFE_componentWillUpdate!="function"&&typeof d.componentWillUpdate!="function"||(typeof d.componentWillUpdate=="function"&&d.componentWillUpdate(r,le,L),typeof d.UNSAFE_componentWillUpdate=="function"&&d.UNSAFE_componentWillUpdate(r,le,L)),typeof d.componentDidUpdate=="function"&&(t.flags|=4),typeof d.getSnapshotBeforeUpdate=="function"&&(t.flags|=1024)):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),t.memoizedProps=r,t.memoizedState=le),d.props=r,d.state=le,d.context=L,r=fe):(typeof d.componentDidUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(t.flags|=4),typeof d.getSnapshotBeforeUpdate!="function"||x===e.memoizedProps&&ae===e.memoizedState||(t.flags|=1024),r=!1)}return d=r,lf(e,t),r=(t.flags&128)!==0,d||r?(d=t.stateNode,s=r&&typeof s.getDerivedStateFromError!="function"?null:d.render(),t.flags|=1,e!==null&&r?(t.child=Rr(t,e.child,null,f),t.child=Rr(t,null,s,f)):vn(e,t,s,f),t.memoizedState=d.state,e=t.child):e=As(e,t,f),e}function Sv(e,t,s,r){return on(),t.flags|=256,vn(e,t,s,r),t.child}var wh={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function Ch(e){return{baseLanes:e,cachePool:og()}}function Mh(e,t,s){return e=e!==null?e.childLanes&~s:0,t&&(e|=aa),e}function xv(e,t,s){var r=t.pendingProps,f=!1,d=(t.flags&128)!==0,x;if((x=d)||(x=e!==null&&e.memoizedState===null?!1:($t.current&2)!==0),x&&(f=!0,t.flags&=-129),x=(t.flags&32)!==0,t.flags&=-33,e===null){if(I){if(f?bi(t):Si(),(e=$)?(e=Mp(e,ke),e=e!==null&&e.data!=="&"?e:null,e!==null&&(t.memoizedState={dehydrated:e,treeContext:Ln!==null?{id:ba,overflow:p}:null,retryLane:536870912,hydrationErrors:null},s=qc(e),s.return=t,t.child=s,Z=t,$=null)):e=null,e===null)throw it(t);return fm(e)?t.lanes=32:t.lanes=536870912,null}var D=r.children;return r=r.fallback,f?(Si(),f=t.mode,D=uf({mode:"hidden",children:D},f),r=pa(r,f,s,null),D.return=t,r.return=t,D.sibling=r,t.child=D,r=t.child,r.memoizedState=Ch(s),r.childLanes=Mh(e,x,s),t.memoizedState=wh,lo(null,r)):(bi(t),Dh(t,D))}var L=e.memoizedState;if(L!==null&&(D=L.dehydrated,D!==null)){if(d)t.flags&256?(bi(t),t.flags&=-257,t=jh(e,t,s)):t.memoizedState!==null?(Si(),t.child=e.child,t.flags|=128,t=null):(Si(),D=r.fallback,f=t.mode,r=uf({mode:"visible",children:r.children},f),D=pa(D,f,s,null),D.flags|=2,r.return=t,D.return=t,r.sibling=D,t.child=r,Rr(t,e.child,null,s),r=t.child,r.memoizedState=Ch(s),r.childLanes=Mh(e,x,s),t.memoizedState=wh,t=lo(null,r));else if(bi(t),fm(D)){if(x=D.nextSibling&&D.nextSibling.dataset,x)var ne=x.dgst;x=ne,r=Error(l(419)),r.stack="",r.digest=x,Va({value:r,source:null,stack:null}),t=jh(e,t,s)}else if(Jt||xa(e,t,s,!1),x=(s&e.childLanes)!==0,Jt||x){if(x=Nt,x!==null&&(r=Ou(x,s),r!==0&&r!==L.retryLane))throw L.retryLane=r,ga(e,r),Bn(x,e,r),_h;cm(D)||vf(),t=jh(e,t,s)}else cm(D)?(t.flags|=192,t.child=e.child,t=null):(e=L.treeContext,$=Ta(D.nextSibling),Z=t,I=!0,xe=null,ke=!1,e!==null&&U(t,e),t=Dh(t,r.children),t.flags|=4096);return t}return f?(Si(),D=r.fallback,f=t.mode,L=e.child,ne=L.sibling,r=va(L,{mode:"hidden",children:r.children}),r.subtreeFlags=L.subtreeFlags&65011712,ne!==null?D=va(ne,D):(D=pa(D,f,s,null),D.flags|=2),D.return=t,r.return=t,r.sibling=D,t.child=r,lo(null,r),r=t.child,D=e.child.memoizedState,D===null?D=Ch(s):(f=D.cachePool,f!==null?(L=Wt._currentValue,f=f.parent!==L?{parent:L,pool:L}:f):f=og(),D={baseLanes:D.baseLanes|s,cachePool:f}),r.memoizedState=D,r.childLanes=Mh(e,x,s),t.memoizedState=wh,lo(e.child,r)):(bi(t),s=e.child,e=s.sibling,s=va(s,{mode:"visible",children:r.children}),s.return=t,s.sibling=null,e!==null&&(x=t.deletions,x===null?(t.deletions=[e],t.flags|=16):x.push(e)),t.child=s,t.memoizedState=null,s)}function Dh(e,t){return t=uf({mode:"visible",children:t},e.mode),t.return=e,e.child=t}function uf(e,t){return e=yn(22,e,null,t),e.lanes=0,e}function jh(e,t,s){return Rr(t,e.child,null,s),e=Dh(t,t.pendingProps.children),e.flags|=2,t.memoizedState=null,e}function Ev(e,t,s){e.lanes|=t;var r=e.alternate;r!==null&&(r.lanes|=t),Qu(e.return,t,s)}function Rh(e,t,s,r,f,d){var x=e.memoizedState;x===null?e.memoizedState={isBackwards:t,rendering:null,renderingStartTime:0,last:r,tail:s,tailMode:f,treeForkCount:d}:(x.isBackwards=t,x.rendering=null,x.renderingStartTime=0,x.last=r,x.tail=s,x.tailMode=f,x.treeForkCount=d)}function Tv(e,t,s){var r=t.pendingProps,f=r.revealOrder,d=r.tail;r=r.children;var x=$t.current,D=(x&2)!==0;if(D?(x=x&1|2,t.flags|=128):x&=1,Oe($t,x),vn(e,t,r,s),r=I?Ha:0,!D&&e!==null&&(e.flags&128)!==0)e:for(e=t.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Ev(e,s,t);else if(e.tag===19)Ev(e,s,t);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===t)break e;for(;e.sibling===null;){if(e.return===null||e.return===t)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}switch(f){case"forwards":for(s=t.child,f=null;s!==null;)e=s.alternate,e!==null&&Qc(e)===null&&(f=s),s=s.sibling;s=f,s===null?(f=t.child,t.child=null):(f=s.sibling,s.sibling=null),Rh(t,!1,f,s,d,r);break;case"backwards":case"unstable_legacy-backwards":for(s=null,f=t.child,t.child=null;f!==null;){if(e=f.alternate,e!==null&&Qc(e)===null){t.child=f;break}e=f.sibling,f.sibling=s,s=f,f=e}Rh(t,!0,s,null,d,r);break;case"together":Rh(t,!1,null,null,void 0,r);break;default:t.memoizedState=null}return t.child}function As(e,t,s){if(e!==null&&(t.dependencies=e.dependencies),Ti|=t.lanes,(s&t.childLanes)===0)if(e!==null){if(xa(e,t,s,!1),(s&t.childLanes)===0)return null}else return null;if(e!==null&&t.child!==e.child)throw Error(l(153));if(t.child!==null){for(e=t.child,s=va(e,e.pendingProps),t.child=s,s.return=t;e.sibling!==null;)e=e.sibling,s=s.sibling=va(e,e.pendingProps),s.return=t;s.sibling=null}return t.child}function Ah(e,t){return(e.lanes&t)!==0?!0:(e=e.dependencies,!!(e!==null&&wl(e)))}function m1(e,t,s){switch(t.tag){case 3:ft(t,t.stateNode.containerInfo),rs(t,Wt,e.memoizedState.cache),on();break;case 27:case 5:Lt(t);break;case 4:ft(t,t.stateNode.containerInfo);break;case 10:rs(t,t.type,t.memoizedProps.value);break;case 31:if(t.memoizedState!==null)return t.flags|=128,sh(t),null;break;case 13:var r=t.memoizedState;if(r!==null)return r.dehydrated!==null?(bi(t),t.flags|=128,null):(s&t.child.childLanes)!==0?xv(e,t,s):(bi(t),e=As(e,t,s),e!==null?e.sibling:null);bi(t);break;case 19:var f=(e.flags&128)!==0;if(r=(s&t.childLanes)!==0,r||(xa(e,t,s,!1),r=(s&t.childLanes)!==0),f){if(r)return Tv(e,t,s);t.flags|=128}if(f=t.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Oe($t,$t.current),r)break;return null;case 22:return t.lanes=0,yv(e,t,s,t.pendingProps);case 24:rs(t,Wt,e.memoizedState.cache)}return As(e,t,s)}function Nv(e,t,s){if(e!==null)if(e.memoizedProps!==t.pendingProps)Jt=!0;else{if(!Ah(e,s)&&(t.flags&128)===0)return Jt=!1,m1(e,t,s);Jt=(e.flags&131072)!==0}else Jt=!1,I&&(t.flags&1048576)!==0&&v(t,Ha,t.index);switch(t.lanes=0,t.tag){case 16:e:{var r=t.pendingProps;if(e=Dr(t.elementType),t.type=e,typeof e=="function")Nl(e)?(r=kr(e,r),t.tag=1,t=bv(null,t,e,r,s)):(t.tag=0,t=Oh(null,t,e,r,s));else{if(e!=null){var f=e.$$typeof;if(f===F){t.tag=11,t=dv(null,t,e,r,s);break e}else if(f===G){t.tag=14,t=hv(null,t,e,r,s);break e}}throw t=Se(e)||e,Error(l(306,t,""))}}return t;case 0:return Oh(e,t,t.type,t.pendingProps,s);case 1:return r=t.type,f=kr(r,t.pendingProps),bv(e,t,r,f,s);case 3:e:{if(ft(t,t.stateNode.containerInfo),e===null)throw Error(l(387));r=t.pendingProps;var d=t.memoizedState;f=d.element,Pd(e,t),no(t,r,null,s);var x=t.memoizedState;if(r=x.cache,rs(t,Wt,r),r!==d.cache&&Ds(t,[Wt],s,!0),to(),r=x.element,d.isDehydrated)if(d={element:r,isDehydrated:!1,cache:x.cache},t.updateQueue.baseState=d,t.memoizedState=d,t.flags&256){t=Sv(e,t,r,s);break e}else if(r!==f){f=zn(Error(l(424)),t),Va(f),t=Sv(e,t,r,s);break e}else{switch(e=t.stateNode.containerInfo,e.nodeType){case 9:e=e.body;break;default:e=e.nodeName==="HTML"?e.ownerDocument.body:e}for($=Ta(e.firstChild),Z=t,I=!0,xe=null,ke=!0,s=yg(t,null,r,s),t.child=s;s;)s.flags=s.flags&-3|4096,s=s.sibling}else{if(on(),r===f){t=As(e,t,s);break e}vn(e,t,r,s)}t=t.child}return t;case 26:return lf(e,t),e===null?(s=Up(t.type,null,t.pendingProps,null))?t.memoizedState=s:I||(s=t.type,e=t.pendingProps,r=Nf(Le.current).createElement(s),r[qt]=t,r[tn]=e,pn(r,s,e),Qt(r),t.stateNode=r):t.memoizedState=Up(t.type,e.memoizedProps,t.pendingProps,e.memoizedState),null;case 27:return Lt(t),e===null&&I&&(r=t.stateNode=Rp(t.type,t.pendingProps,Le.current),Z=t,ke=!0,f=$,Ci(t.type)?(dm=f,$=Ta(r.firstChild)):$=f),vn(e,t,t.pendingProps.children,s),lf(e,t),e===null&&(t.flags|=4194304),t.child;case 5:return e===null&&I&&((f=r=$)&&(r=$1(r,t.type,t.pendingProps,ke),r!==null?(t.stateNode=r,Z=t,$=Ta(r.firstChild),ke=!1,f=!0):f=!1),f||it(t)),Lt(t),f=t.type,d=t.pendingProps,x=e!==null?e.memoizedProps:null,r=d.children,lm(f,d)?r=null:x!==null&&lm(f,x)&&(t.flags|=32),t.memoizedState!==null&&(f=rh(e,t,i1,null,null,s),To._currentValue=f),lf(e,t),vn(e,t,r,s),t.child;case 6:return e===null&&I&&((e=s=$)&&(s=Y1(s,t.pendingProps,ke),s!==null?(t.stateNode=s,Z=t,$=null,e=!0):e=!1),e||it(t)),null;case 13:return xv(e,t,s);case 4:return ft(t,t.stateNode.containerInfo),r=t.pendingProps,e===null?t.child=Rr(t,null,r,s):vn(e,t,r,s),t.child;case 11:return dv(e,t,t.type,t.pendingProps,s);case 7:return vn(e,t,t.pendingProps,s),t.child;case 8:return vn(e,t,t.pendingProps.children,s),t.child;case 12:return vn(e,t,t.pendingProps.children,s),t.child;case 10:return r=t.pendingProps,rs(t,t.type,r.value),vn(e,t,r.children,s),t.child;case 9:return f=t.type._context,r=t.pendingProps.children,Cr(t),f=gn(f),r=r(f),t.flags|=1,vn(e,t,r,s),t.child;case 14:return hv(e,t,t.type,t.pendingProps,s);case 15:return mv(e,t,t.type,t.pendingProps,s);case 19:return Tv(e,t,s);case 31:return h1(e,t,s);case 22:return yv(e,t,s,t.pendingProps);case 24:return Cr(t),r=gn(Wt),e===null?(f=Wd(),f===null&&(f=Nt,d=Xd(),f.pooledCache=d,d.refCount++,d!==null&&(f.pooledCacheLanes|=s),f=d),t.memoizedState={parent:r,cache:f},Jd(t),rs(t,Wt,f)):((e.lanes&s)!==0&&(Pd(e,t),no(t,null,null,s),to()),f=e.memoizedState,d=t.memoizedState,f.parent!==r?(f={parent:r,cache:r},t.memoizedState=f,t.lanes===0&&(t.memoizedState=t.updateQueue.baseState=f),rs(t,Wt,r)):(r=d.cache,rs(t,Wt,r),r!==f.cache&&Ds(t,[Wt],s,!0))),vn(e,t,t.pendingProps.children,s),t.child;case 29:throw t.pendingProps}throw Error(l(156,t.tag))}function ks(e){e.flags|=4}function kh(e,t,s,r,f){if((t=(e.mode&32)!==0)&&(t=!1),t){if(e.flags|=16777216,(f&335544128)===f)if(e.stateNode.complete)e.flags|=8192;else if(Kv())e.flags|=8192;else throw jr=Yc,Kd}else e.flags&=-16777217}function _v(e,t){if(t.type!=="stylesheet"||(t.state.loading&4)!==0)e.flags&=-16777217;else if(e.flags|=16777216,!Fp(t))if(Kv())e.flags|=8192;else throw jr=Yc,Kd}function of(e,t){t!==null&&(e.flags|=4),e.flags&16384&&(t=e.tag!==22?Ps():536870912,e.lanes|=t,Vl|=t)}function uo(e,t){if(!I)switch(e.tailMode){case"hidden":t=e.tail;for(var s=null;t!==null;)t.alternate!==null&&(s=t),t=t.sibling;s===null?e.tail=null:s.sibling=null;break;case"collapsed":s=e.tail;for(var r=null;s!==null;)s.alternate!==null&&(r=s),s=s.sibling;r===null?t||e.tail===null?e.tail=null:e.tail.sibling=null:r.sibling=null}}function Mt(e){var t=e.alternate!==null&&e.alternate.child===e.child,s=0,r=0;if(t)for(var f=e.child;f!==null;)s|=f.lanes|f.childLanes,r|=f.subtreeFlags&65011712,r|=f.flags&65011712,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)s|=f.lanes|f.childLanes,r|=f.subtreeFlags,r|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=r,e.childLanes=s,t}function y1(e,t,s){var r=t.pendingProps;switch(M(t),t.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Mt(t),null;case 1:return Mt(t),null;case 3:return s=t.stateNode,r=null,e!==null&&(r=e.memoizedState.cache),t.memoizedState.cache!==r&&(t.flags|=2048),Fa(Wt),tt(),s.pendingContext&&(s.context=s.pendingContext,s.pendingContext=null),(e===null||e.child===null)&&(un(t)?ks(t):e===null||e.memoizedState.isDehydrated&&(t.flags&256)===0||(t.flags|=1024,is())),Mt(t),null;case 26:var f=t.type,d=t.memoizedState;return e===null?(ks(t),d!==null?(Mt(t),_v(t,d)):(Mt(t),kh(t,f,null,r,s))):d?d!==e.memoizedState?(ks(t),Mt(t),_v(t,d)):(Mt(t),t.flags&=-16777217):(e=e.memoizedProps,e!==r&&ks(t),Mt(t),kh(t,f,e,r,s)),null;case 27:if(Gn(t),s=Le.current,f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ks(t);else{if(!r){if(t.stateNode===null)throw Error(l(166));return Mt(t),null}e=Ne.current,un(t)?$e(t):(e=Rp(f,r,s),t.stateNode=e,ks(t))}return Mt(t),null;case 5:if(Gn(t),f=t.type,e!==null&&t.stateNode!=null)e.memoizedProps!==r&&ks(t);else{if(!r){if(t.stateNode===null)throw Error(l(166));return Mt(t),null}if(d=Ne.current,un(t))$e(t);else{var x=Nf(Le.current);switch(d){case 1:d=x.createElementNS("http://www.w3.org/2000/svg",f);break;case 2:d=x.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;default:switch(f){case"svg":d=x.createElementNS("http://www.w3.org/2000/svg",f);break;case"math":d=x.createElementNS("http://www.w3.org/1998/Math/MathML",f);break;case"script":d=x.createElement("div"),d.innerHTML="<script><\/script>",d=d.removeChild(d.firstChild);break;case"select":d=typeof r.is=="string"?x.createElement("select",{is:r.is}):x.createElement("select"),r.multiple?d.multiple=!0:r.size&&(d.size=r.size);break;default:d=typeof r.is=="string"?x.createElement(f,{is:r.is}):x.createElement(f)}}d[qt]=t,d[tn]=r;e:for(x=t.child;x!==null;){if(x.tag===5||x.tag===6)d.appendChild(x.stateNode);else if(x.tag!==4&&x.tag!==27&&x.child!==null){x.child.return=x,x=x.child;continue}if(x===t)break e;for(;x.sibling===null;){if(x.return===null||x.return===t)break e;x=x.return}x.sibling.return=x.return,x=x.sibling}t.stateNode=d;e:switch(pn(d,f,r),f){case"button":case"input":case"select":case"textarea":r=!!r.autoFocus;break e;case"img":r=!0;break e;default:r=!1}r&&ks(t)}}return Mt(t),kh(t,t.type,e===null?null:e.memoizedProps,t.pendingProps,s),null;case 6:if(e&&t.stateNode!=null)e.memoizedProps!==r&&ks(t);else{if(typeof r!="string"&&t.stateNode===null)throw Error(l(166));if(e=Le.current,un(t)){if(e=t.stateNode,s=t.memoizedProps,r=null,f=Z,f!==null)switch(f.tag){case 27:case 5:r=f.memoizedProps}e[qt]=t,e=!!(e.nodeValue===s||r!==null&&r.suppressHydrationWarning===!0||xp(e.nodeValue,s)),e||it(t,!0)}else e=Nf(e).createTextNode(r),e[qt]=t,t.stateNode=e}return Mt(t),null;case 31:if(s=t.memoizedState,e===null||e.memoizedState!==null){if(r=un(t),s!==null){if(e===null){if(!r)throw Error(l(318));if(e=t.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(l(557));e[qt]=t}else on(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Mt(t),e=!1}else s=is(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=s),e=!0;if(!e)return t.flags&256?(ta(t),t):(ta(t),null);if((t.flags&128)!==0)throw Error(l(558))}return Mt(t),null;case 13:if(r=t.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(f=un(t),r!==null&&r.dehydrated!==null){if(e===null){if(!f)throw Error(l(318));if(f=t.memoizedState,f=f!==null?f.dehydrated:null,!f)throw Error(l(317));f[qt]=t}else on(),(t.flags&128)===0&&(t.memoizedState=null),t.flags|=4;Mt(t),f=!1}else f=is(),e!==null&&e.memoizedState!==null&&(e.memoizedState.hydrationErrors=f),f=!0;if(!f)return t.flags&256?(ta(t),t):(ta(t),null)}return ta(t),(t.flags&128)!==0?(t.lanes=s,t):(s=r!==null,e=e!==null&&e.memoizedState!==null,s&&(r=t.child,f=null,r.alternate!==null&&r.alternate.memoizedState!==null&&r.alternate.memoizedState.cachePool!==null&&(f=r.alternate.memoizedState.cachePool.pool),d=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(d=r.memoizedState.cachePool.pool),d!==f&&(r.flags|=2048)),s!==e&&s&&(t.child.flags|=8192),of(t,t.updateQueue),Mt(t),null);case 4:return tt(),e===null&&nm(t.stateNode.containerInfo),Mt(t),null;case 10:return Fa(t.type),Mt(t),null;case 19:if(ue($t),r=t.memoizedState,r===null)return Mt(t),null;if(f=(t.flags&128)!==0,d=r.rendering,d===null)if(f)uo(r,!1);else{if(Vt!==0||e!==null&&(e.flags&128)!==0)for(e=t.child;e!==null;){if(d=Qc(e),d!==null){for(t.flags|=128,uo(r,!1),e=d.updateQueue,t.updateQueue=e,of(t,e),t.subtreeFlags=0,e=s,s=t.child;s!==null;)Fc(s,e),s=s.sibling;return Oe($t,$t.current&1|2),I&&c(t,r.treeForkCount),t.child}e=e.sibling}r.tail!==null&&Xt()>mf&&(t.flags|=128,f=!0,uo(r,!1),t.lanes=4194304)}else{if(!f)if(e=Qc(d),e!==null){if(t.flags|=128,f=!0,e=e.updateQueue,t.updateQueue=e,of(t,e),uo(r,!0),r.tail===null&&r.tailMode==="hidden"&&!d.alternate&&!I)return Mt(t),null}else 2*Xt()-r.renderingStartTime>mf&&s!==536870912&&(t.flags|=128,f=!0,uo(r,!1),t.lanes=4194304);r.isBackwards?(d.sibling=t.child,t.child=d):(e=r.last,e!==null?e.sibling=d:t.child=d,r.last=d)}return r.tail!==null?(e=r.tail,r.rendering=e,r.tail=e.sibling,r.renderingStartTime=Xt(),e.sibling=null,s=$t.current,Oe($t,f?s&1|2:s&1),I&&c(t,r.treeForkCount),e):(Mt(t),null);case 22:case 23:return ta(t),ah(),r=t.memoizedState!==null,e!==null?e.memoizedState!==null!==r&&(t.flags|=8192):r&&(t.flags|=8192),r?(s&536870912)!==0&&(t.flags&128)===0&&(Mt(t),t.subtreeFlags&6&&(t.flags|=8192)):Mt(t),s=t.updateQueue,s!==null&&of(t,s.retryQueue),s=null,e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),r=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(r=t.memoizedState.cachePool.pool),r!==s&&(t.flags|=2048),e!==null&&ue(Mr),null;case 24:return s=null,e!==null&&(s=e.memoizedState.cache),t.memoizedState.cache!==s&&(t.flags|=2048),Fa(Wt),Mt(t),null;case 25:return null;case 30:return null}throw Error(l(156,t.tag))}function g1(e,t){switch(M(t),t.tag){case 1:return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 3:return Fa(Wt),tt(),e=t.flags,(e&65536)!==0&&(e&128)===0?(t.flags=e&-65537|128,t):null;case 26:case 27:case 5:return Gn(t),null;case 31:if(t.memoizedState!==null){if(ta(t),t.alternate===null)throw Error(l(340));on()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 13:if(ta(t),e=t.memoizedState,e!==null&&e.dehydrated!==null){if(t.alternate===null)throw Error(l(340));on()}return e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 19:return ue($t),null;case 4:return tt(),null;case 10:return Fa(t.type),null;case 22:case 23:return ta(t),ah(),e!==null&&ue(Mr),e=t.flags,e&65536?(t.flags=e&-65537|128,t):null;case 24:return Fa(Wt),null;case 25:return null;default:return null}}function Ov(e,t){switch(M(t),t.tag){case 3:Fa(Wt),tt();break;case 26:case 27:case 5:Gn(t);break;case 4:tt();break;case 31:t.memoizedState!==null&&ta(t);break;case 13:ta(t);break;case 19:ue($t);break;case 10:Fa(t.type);break;case 22:case 23:ta(t),ah(),e!==null&&ue(Mr);break;case 24:Fa(Wt)}}function oo(e,t){try{var s=t.updateQueue,r=s!==null?s.lastEffect:null;if(r!==null){var f=r.next;s=f;do{if((s.tag&e)===e){r=void 0;var d=s.create,x=s.inst;r=d(),x.destroy=r}s=s.next}while(s!==f)}}catch(D){St(t,t.return,D)}}function xi(e,t,s){try{var r=t.updateQueue,f=r!==null?r.lastEffect:null;if(f!==null){var d=f.next;r=d;do{if((r.tag&e)===e){var x=r.inst,D=x.destroy;if(D!==void 0){x.destroy=void 0,f=t;var L=s,ne=D;try{ne()}catch(fe){St(f,L,fe)}}}r=r.next}while(r!==d)}}catch(fe){St(t,t.return,fe)}}function wv(e){var t=e.updateQueue;if(t!==null){var s=e.stateNode;try{vg(t,s)}catch(r){St(e,e.return,r)}}}function Cv(e,t,s){s.props=kr(e.type,e.memoizedProps),s.state=e.memoizedState;try{s.componentWillUnmount()}catch(r){St(e,t,r)}}function co(e,t){try{var s=e.ref;if(s!==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 s=="function"?e.refCleanup=s(r):s.current=r}}catch(f){St(e,t,f)}}function ls(e,t){var s=e.ref,r=e.refCleanup;if(s!==null)if(typeof r=="function")try{r()}catch(f){St(e,t,f)}finally{e.refCleanup=null,e=e.alternate,e!=null&&(e.refCleanup=null)}else if(typeof s=="function")try{s(null)}catch(f){St(e,t,f)}else s.current=null}function Mv(e){var t=e.type,s=e.memoizedProps,r=e.stateNode;try{e:switch(t){case"button":case"input":case"select":case"textarea":s.autoFocus&&r.focus();break e;case"img":s.src?r.src=s.src:s.srcSet&&(r.srcset=s.srcSet)}}catch(f){St(e,e.return,f)}}function Uh(e,t,s){try{var r=e.stateNode;H1(r,e.type,s,t),r[tn]=t}catch(f){St(e,e.return,f)}}function Dv(e){return e.tag===5||e.tag===3||e.tag===26||e.tag===27&&Ci(e.type)||e.tag===4}function zh(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||Dv(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&&Ci(e.type)||e.flags&2||e.child===null||e.tag===4)continue e;e.child.return=e,e=e.child}if(!(e.flags&2))return e.stateNode}}function Lh(e,t,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?(s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s).insertBefore(e,t):(t=s.nodeType===9?s.body:s.nodeName==="HTML"?s.ownerDocument.body:s,t.appendChild(e),s=s._reactRootContainer,s!=null||t.onclick!==null||(t.onclick=ha));else if(r!==4&&(r===27&&Ci(e.type)&&(s=e.stateNode,t=null),e=e.child,e!==null))for(Lh(e,t,s),e=e.sibling;e!==null;)Lh(e,t,s),e=e.sibling}function cf(e,t,s){var r=e.tag;if(r===5||r===6)e=e.stateNode,t?s.insertBefore(e,t):s.appendChild(e);else if(r!==4&&(r===27&&Ci(e.type)&&(s=e.stateNode),e=e.child,e!==null))for(cf(e,t,s),e=e.sibling;e!==null;)cf(e,t,s),e=e.sibling}function jv(e){var t=e.stateNode,s=e.memoizedProps;try{for(var r=e.type,f=t.attributes;f.length;)t.removeAttributeNode(f[0]);pn(t,r,s),t[qt]=e,t[tn]=s}catch(d){St(e,e.return,d)}}var Us=!1,Pt=!1,Hh=!1,Rv=typeof WeakSet=="function"?WeakSet:Set,cn=null;function v1(e,t){if(e=e.containerInfo,im=jf,e=Yd(e),pl(e)){if("selectionStart"in e)var s={start:e.selectionStart,end:e.selectionEnd};else e:{s=(s=e.ownerDocument)&&s.defaultView||window;var r=s.getSelection&&s.getSelection();if(r&&r.rangeCount!==0){s=r.anchorNode;var f=r.anchorOffset,d=r.focusNode;r=r.focusOffset;try{s.nodeType,d.nodeType}catch{s=null;break e}var x=0,D=-1,L=-1,ne=0,fe=0,ge=e,ae=null;t:for(;;){for(var le;ge!==s||f!==0&&ge.nodeType!==3||(D=x+f),ge!==d||r!==0&&ge.nodeType!==3||(L=x+r),ge.nodeType===3&&(x+=ge.nodeValue.length),(le=ge.firstChild)!==null;)ae=ge,ge=le;for(;;){if(ge===e)break t;if(ae===s&&++ne===f&&(D=x),ae===d&&++fe===r&&(L=x),(le=ge.nextSibling)!==null)break;ge=ae,ae=ge.parentNode}ge=le}s=D===-1||L===-1?null:{start:D,end:L}}else s=null}s=s||{start:0,end:0}}else s=null;for(rm={focusedElem:e,selectionRange:s},jf=!1,cn=t;cn!==null;)if(t=cn,e=t.child,(t.subtreeFlags&1028)!==0&&e!==null)e.return=t,cn=e;else for(;cn!==null;){switch(t=cn,d=t.alternate,e=t.flags,t.tag){case 0:if((e&4)!==0&&(e=t.updateQueue,e=e!==null?e.events:null,e!==null))for(s=0;s<e.length;s++)f=e[s],f.ref.impl=f.nextImpl;break;case 11:case 15:break;case 1:if((e&1024)!==0&&d!==null){e=void 0,s=t,f=d.memoizedProps,d=d.memoizedState,r=s.stateNode;try{var Ue=kr(s.type,f);e=r.getSnapshotBeforeUpdate(Ue,d),r.__reactInternalSnapshotBeforeUpdate=e}catch(Ye){St(s,s.return,Ye)}}break;case 3:if((e&1024)!==0){if(e=t.stateNode.containerInfo,s=e.nodeType,s===9)om(e);else if(s===1)switch(e.nodeName){case"HEAD":case"HTML":case"BODY":om(e);break;default:e.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((e&1024)!==0)throw Error(l(163))}if(e=t.sibling,e!==null){e.return=t.return,cn=e;break}cn=t.return}}function Av(e,t,s){var r=s.flags;switch(s.tag){case 0:case 11:case 15:Ls(e,s),r&4&&oo(5,s);break;case 1:if(Ls(e,s),r&4)if(e=s.stateNode,t===null)try{e.componentDidMount()}catch(x){St(s,s.return,x)}else{var f=kr(s.type,t.memoizedProps);t=t.memoizedState;try{e.componentDidUpdate(f,t,e.__reactInternalSnapshotBeforeUpdate)}catch(x){St(s,s.return,x)}}r&64&&wv(s),r&512&&co(s,s.return);break;case 3:if(Ls(e,s),r&64&&(e=s.updateQueue,e!==null)){if(t=null,s.child!==null)switch(s.child.tag){case 27:case 5:t=s.child.stateNode;break;case 1:t=s.child.stateNode}try{vg(e,t)}catch(x){St(s,s.return,x)}}break;case 27:t===null&&r&4&&jv(s);case 26:case 5:Ls(e,s),t===null&&r&4&&Mv(s),r&512&&co(s,s.return);break;case 12:Ls(e,s);break;case 31:Ls(e,s),r&4&&zv(e,s);break;case 13:Ls(e,s),r&4&&Lv(e,s),r&64&&(e=s.memoizedState,e!==null&&(e=e.dehydrated,e!==null&&(s=O1.bind(null,s),I1(e,s))));break;case 22:if(r=s.memoizedState!==null||Us,!r){t=t!==null&&t.memoizedState!==null||Pt,f=Us;var d=Pt;Us=r,(Pt=t)&&!d?Hs(e,s,(s.subtreeFlags&8772)!==0):Ls(e,s),Us=f,Pt=d}break;case 30:break;default:Ls(e,s)}}function kv(e){var t=e.alternate;t!==null&&(e.alternate=null,kv(t)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(t=e.stateNode,t!==null&&ll(t)),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}var Rt=null,Hn=!1;function zs(e,t,s){for(s=s.child;s!==null;)Uv(e,t,s),s=s.sibling}function Uv(e,t,s){if(ve&&typeof ve.onCommitFiberUnmount=="function")try{ve.onCommitFiberUnmount(he,s)}catch{}switch(s.tag){case 26:Pt||ls(s,t),zs(e,t,s),s.memoizedState?s.memoizedState.count--:s.stateNode&&(s=s.stateNode,s.parentNode.removeChild(s));break;case 27:Pt||ls(s,t);var r=Rt,f=Hn;Ci(s.type)&&(Rt=s.stateNode,Hn=!1),zs(e,t,s),So(s.stateNode),Rt=r,Hn=f;break;case 5:Pt||ls(s,t);case 6:if(r=Rt,f=Hn,Rt=null,zs(e,t,s),Rt=r,Hn=f,Rt!==null)if(Hn)try{(Rt.nodeType===9?Rt.body:Rt.nodeName==="HTML"?Rt.ownerDocument.body:Rt).removeChild(s.stateNode)}catch(d){St(s,t,d)}else try{Rt.removeChild(s.stateNode)}catch(d){St(s,t,d)}break;case 18:Rt!==null&&(Hn?(e=Rt,wp(e.nodeType===9?e.body:e.nodeName==="HTML"?e.ownerDocument.body:e,s.stateNode),Gl(e)):wp(Rt,s.stateNode));break;case 4:r=Rt,f=Hn,Rt=s.stateNode.containerInfo,Hn=!0,zs(e,t,s),Rt=r,Hn=f;break;case 0:case 11:case 14:case 15:xi(2,s,t),Pt||xi(4,s,t),zs(e,t,s);break;case 1:Pt||(ls(s,t),r=s.stateNode,typeof r.componentWillUnmount=="function"&&Cv(s,t,r)),zs(e,t,s);break;case 21:zs(e,t,s);break;case 22:Pt=(r=Pt)||s.memoizedState!==null,zs(e,t,s),Pt=r;break;default:zs(e,t,s)}}function zv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null))){e=e.dehydrated;try{Gl(e)}catch(s){St(t,t.return,s)}}}function Lv(e,t){if(t.memoizedState===null&&(e=t.alternate,e!==null&&(e=e.memoizedState,e!==null&&(e=e.dehydrated,e!==null))))try{Gl(e)}catch(s){St(t,t.return,s)}}function p1(e){switch(e.tag){case 31:case 13:case 19:var t=e.stateNode;return t===null&&(t=e.stateNode=new Rv),t;case 22:return e=e.stateNode,t=e._retryCache,t===null&&(t=e._retryCache=new Rv),t;default:throw Error(l(435,e.tag))}}function ff(e,t){var s=p1(e);t.forEach(function(r){if(!s.has(r)){s.add(r);var f=w1.bind(null,e,r);r.then(f,f)}})}function Vn(e,t){var s=t.deletions;if(s!==null)for(var r=0;r<s.length;r++){var f=s[r],d=e,x=t,D=x;e:for(;D!==null;){switch(D.tag){case 27:if(Ci(D.type)){Rt=D.stateNode,Hn=!1;break e}break;case 5:Rt=D.stateNode,Hn=!1;break e;case 3:case 4:Rt=D.stateNode.containerInfo,Hn=!0;break e}D=D.return}if(Rt===null)throw Error(l(160));Uv(d,x,f),Rt=null,Hn=!1,d=f.alternate,d!==null&&(d.return=null),f.return=null}if(t.subtreeFlags&13886)for(t=t.child;t!==null;)Hv(t,e),t=t.sibling}var qa=null;function Hv(e,t){var s=e.alternate,r=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:Vn(t,e),Fn(e),r&4&&(xi(3,e,e.return),oo(3,e),xi(5,e,e.return));break;case 1:Vn(t,e),Fn(e),r&512&&(Pt||s===null||ls(s,s.return)),r&64&&Us&&(e=e.updateQueue,e!==null&&(r=e.callbacks,r!==null&&(s=e.shared.hiddenCallbacks,e.shared.hiddenCallbacks=s===null?r:s.concat(r))));break;case 26:var f=qa;if(Vn(t,e),Fn(e),r&512&&(Pt||s===null||ls(s,s.return)),r&4){var d=s!==null?s.memoizedState:null;if(r=e.memoizedState,s===null)if(r===null)if(e.stateNode===null){e:{r=e.type,s=e.memoizedProps,f=f.ownerDocument||f;t:switch(r){case"title":d=f.getElementsByTagName("title")[0],(!d||d[ar]||d[qt]||d.namespaceURI==="http://www.w3.org/2000/svg"||d.hasAttribute("itemprop"))&&(d=f.createElement(r),f.head.insertBefore(d,f.querySelector("head > title"))),pn(d,r,s),d[qt]=e,Qt(d),r=d;break e;case"link":var x=Hp("link","href",f).get(r+(s.href||""));if(x){for(var D=0;D<x.length;D++)if(d=x[D],d.getAttribute("href")===(s.href==null||s.href===""?null:s.href)&&d.getAttribute("rel")===(s.rel==null?null:s.rel)&&d.getAttribute("title")===(s.title==null?null:s.title)&&d.getAttribute("crossorigin")===(s.crossOrigin==null?null:s.crossOrigin)){x.splice(D,1);break t}}d=f.createElement(r),pn(d,r,s),f.head.appendChild(d);break;case"meta":if(x=Hp("meta","content",f).get(r+(s.content||""))){for(D=0;D<x.length;D++)if(d=x[D],d.getAttribute("content")===(s.content==null?null:""+s.content)&&d.getAttribute("name")===(s.name==null?null:s.name)&&d.getAttribute("property")===(s.property==null?null:s.property)&&d.getAttribute("http-equiv")===(s.httpEquiv==null?null:s.httpEquiv)&&d.getAttribute("charset")===(s.charSet==null?null:s.charSet)){x.splice(D,1);break t}}d=f.createElement(r),pn(d,r,s),f.head.appendChild(d);break;default:throw Error(l(468,r))}d[qt]=e,Qt(d),r=d}e.stateNode=r}else Vp(f,e.type,e.stateNode);else e.stateNode=Lp(f,r,e.memoizedProps);else d!==r?(d===null?s.stateNode!==null&&(s=s.stateNode,s.parentNode.removeChild(s)):d.count--,r===null?Vp(f,e.type,e.stateNode):Lp(f,r,e.memoizedProps)):r===null&&e.stateNode!==null&&Uh(e,e.memoizedProps,s.memoizedProps)}break;case 27:Vn(t,e),Fn(e),r&512&&(Pt||s===null||ls(s,s.return)),s!==null&&r&4&&Uh(e,e.memoizedProps,s.memoizedProps);break;case 5:if(Vn(t,e),Fn(e),r&512&&(Pt||s===null||ls(s,s.return)),e.flags&32){f=e.stateNode;try{ka(f,"")}catch(Ue){St(e,e.return,Ue)}}r&4&&e.stateNode!=null&&(f=e.memoizedProps,Uh(e,f,s!==null?s.memoizedProps:f)),r&1024&&(Hh=!0);break;case 6:if(Vn(t,e),Fn(e),r&4){if(e.stateNode===null)throw Error(l(162));r=e.memoizedProps,s=e.stateNode;try{s.nodeValue=r}catch(Ue){St(e,e.return,Ue)}}break;case 3:if(wf=null,f=qa,qa=_f(t.containerInfo),Vn(t,e),qa=f,Fn(e),r&4&&s!==null&&s.memoizedState.isDehydrated)try{Gl(t.containerInfo)}catch(Ue){St(e,e.return,Ue)}Hh&&(Hh=!1,Vv(e));break;case 4:r=qa,qa=_f(e.stateNode.containerInfo),Vn(t,e),Fn(e),qa=r;break;case 12:Vn(t,e),Fn(e);break;case 31:Vn(t,e),Fn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ff(e,r)));break;case 13:Vn(t,e),Fn(e),e.child.flags&8192&&e.memoizedState!==null!=(s!==null&&s.memoizedState!==null)&&(hf=Xt()),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ff(e,r)));break;case 22:f=e.memoizedState!==null;var L=s!==null&&s.memoizedState!==null,ne=Us,fe=Pt;if(Us=ne||f,Pt=fe||L,Vn(t,e),Pt=fe,Us=ne,Fn(e),r&8192)e:for(t=e.stateNode,t._visibility=f?t._visibility&-2:t._visibility|1,f&&(s===null||L||Us||Pt||Ur(e)),s=null,t=e;;){if(t.tag===5||t.tag===26){if(s===null){L=s=t;try{if(d=L.stateNode,f)x=d.style,typeof x.setProperty=="function"?x.setProperty("display","none","important"):x.display="none";else{D=L.stateNode;var ge=L.memoizedProps.style,ae=ge!=null&&ge.hasOwnProperty("display")?ge.display:null;D.style.display=ae==null||typeof ae=="boolean"?"":(""+ae).trim()}}catch(Ue){St(L,L.return,Ue)}}}else if(t.tag===6){if(s===null){L=t;try{L.stateNode.nodeValue=f?"":L.memoizedProps}catch(Ue){St(L,L.return,Ue)}}}else if(t.tag===18){if(s===null){L=t;try{var le=L.stateNode;f?Cp(le,!0):Cp(L.stateNode,!1)}catch(Ue){St(L,L.return,Ue)}}}else if((t.tag!==22&&t.tag!==23||t.memoizedState===null||t===e)&&t.child!==null){t.child.return=t,t=t.child;continue}if(t===e)break e;for(;t.sibling===null;){if(t.return===null||t.return===e)break e;s===t&&(s=null),t=t.return}s===t&&(s=null),t.sibling.return=t.return,t=t.sibling}r&4&&(r=e.updateQueue,r!==null&&(s=r.retryQueue,s!==null&&(r.retryQueue=null,ff(e,s))));break;case 19:Vn(t,e),Fn(e),r&4&&(r=e.updateQueue,r!==null&&(e.updateQueue=null,ff(e,r)));break;case 30:break;case 21:break;default:Vn(t,e),Fn(e)}}function Fn(e){var t=e.flags;if(t&2){try{for(var s,r=e.return;r!==null;){if(Dv(r)){s=r;break}r=r.return}if(s==null)throw Error(l(160));switch(s.tag){case 27:var f=s.stateNode,d=zh(e);cf(e,d,f);break;case 5:var x=s.stateNode;s.flags&32&&(ka(x,""),s.flags&=-33);var D=zh(e);cf(e,D,x);break;case 3:case 4:var L=s.stateNode.containerInfo,ne=zh(e);Lh(e,ne,L);break;default:throw Error(l(161))}}catch(fe){St(e,e.return,fe)}e.flags&=-3}t&4096&&(e.flags&=-4097)}function Vv(e){if(e.subtreeFlags&1024)for(e=e.child;e!==null;){var t=e;Vv(t),t.tag===5&&t.flags&1024&&t.stateNode.reset(),e=e.sibling}}function Ls(e,t){if(t.subtreeFlags&8772)for(t=t.child;t!==null;)Av(e,t.alternate,t),t=t.sibling}function Ur(e){for(e=e.child;e!==null;){var t=e;switch(t.tag){case 0:case 11:case 14:case 15:xi(4,t,t.return),Ur(t);break;case 1:ls(t,t.return);var s=t.stateNode;typeof s.componentWillUnmount=="function"&&Cv(t,t.return,s),Ur(t);break;case 27:So(t.stateNode);case 26:case 5:ls(t,t.return),Ur(t);break;case 22:t.memoizedState===null&&Ur(t);break;case 30:Ur(t);break;default:Ur(t)}e=e.sibling}}function Hs(e,t,s){for(s=s&&(t.subtreeFlags&8772)!==0,t=t.child;t!==null;){var r=t.alternate,f=e,d=t,x=d.flags;switch(d.tag){case 0:case 11:case 15:Hs(f,d,s),oo(4,d);break;case 1:if(Hs(f,d,s),r=d,f=r.stateNode,typeof f.componentDidMount=="function")try{f.componentDidMount()}catch(ne){St(r,r.return,ne)}if(r=d,f=r.updateQueue,f!==null){var D=r.stateNode;try{var L=f.shared.hiddenCallbacks;if(L!==null)for(f.shared.hiddenCallbacks=null,f=0;f<L.length;f++)gg(L[f],D)}catch(ne){St(r,r.return,ne)}}s&&x&64&&wv(d),co(d,d.return);break;case 27:jv(d);case 26:case 5:Hs(f,d,s),s&&r===null&&x&4&&Mv(d),co(d,d.return);break;case 12:Hs(f,d,s);break;case 31:Hs(f,d,s),s&&x&4&&zv(f,d);break;case 13:Hs(f,d,s),s&&x&4&&Lv(f,d);break;case 22:d.memoizedState===null&&Hs(f,d,s),co(d,d.return);break;case 30:break;default:Hs(f,d,s)}t=t.sibling}}function Vh(e,t){var s=null;e!==null&&e.memoizedState!==null&&e.memoizedState.cachePool!==null&&(s=e.memoizedState.cachePool.pool),e=null,t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(e=t.memoizedState.cachePool.pool),e!==s&&(e!=null&&e.refCount++,s!=null&&Wu(s))}function Fh(e,t){e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wu(e))}function Ba(e,t,s,r){if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Fv(e,t,s,r),t=t.sibling}function Fv(e,t,s,r){var f=t.flags;switch(t.tag){case 0:case 11:case 15:Ba(e,t,s,r),f&2048&&oo(9,t);break;case 1:Ba(e,t,s,r);break;case 3:Ba(e,t,s,r),f&2048&&(e=null,t.alternate!==null&&(e=t.alternate.memoizedState.cache),t=t.memoizedState.cache,t!==e&&(t.refCount++,e!=null&&Wu(e)));break;case 12:if(f&2048){Ba(e,t,s,r),e=t.stateNode;try{var d=t.memoizedProps,x=d.id,D=d.onPostCommit;typeof D=="function"&&D(x,t.alternate===null?"mount":"update",e.passiveEffectDuration,-0)}catch(L){St(t,t.return,L)}}else Ba(e,t,s,r);break;case 31:Ba(e,t,s,r);break;case 13:Ba(e,t,s,r);break;case 23:break;case 22:d=t.stateNode,x=t.alternate,t.memoizedState!==null?d._visibility&2?Ba(e,t,s,r):fo(e,t):d._visibility&2?Ba(e,t,s,r):(d._visibility|=2,zl(e,t,s,r,(t.subtreeFlags&10256)!==0||!1)),f&2048&&Vh(x,t);break;case 24:Ba(e,t,s,r),f&2048&&Fh(t.alternate,t);break;default:Ba(e,t,s,r)}}function zl(e,t,s,r,f){for(f=f&&((t.subtreeFlags&10256)!==0||!1),t=t.child;t!==null;){var d=e,x=t,D=s,L=r,ne=x.flags;switch(x.tag){case 0:case 11:case 15:zl(d,x,D,L,f),oo(8,x);break;case 23:break;case 22:var fe=x.stateNode;x.memoizedState!==null?fe._visibility&2?zl(d,x,D,L,f):fo(d,x):(fe._visibility|=2,zl(d,x,D,L,f)),f&&ne&2048&&Vh(x.alternate,x);break;case 24:zl(d,x,D,L,f),f&&ne&2048&&Fh(x.alternate,x);break;default:zl(d,x,D,L,f)}t=t.sibling}}function fo(e,t){if(t.subtreeFlags&10256)for(t=t.child;t!==null;){var s=e,r=t,f=r.flags;switch(r.tag){case 22:fo(s,r),f&2048&&Vh(r.alternate,r);break;case 24:fo(s,r),f&2048&&Fh(r.alternate,r);break;default:fo(s,r)}t=t.sibling}}var ho=8192;function Ll(e,t,s){if(e.subtreeFlags&ho)for(e=e.child;e!==null;)qv(e,t,s),e=e.sibling}function qv(e,t,s){switch(e.tag){case 26:Ll(e,t,s),e.flags&ho&&e.memoizedState!==null&&sE(s,qa,e.memoizedState,e.memoizedProps);break;case 5:Ll(e,t,s);break;case 3:case 4:var r=qa;qa=_f(e.stateNode.containerInfo),Ll(e,t,s),qa=r;break;case 22:e.memoizedState===null&&(r=e.alternate,r!==null&&r.memoizedState!==null?(r=ho,ho=16777216,Ll(e,t,s),ho=r):Ll(e,t,s));break;default:Ll(e,t,s)}}function Bv(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 mo(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var r=t[s];cn=r,$v(r,e)}Bv(e)}if(e.subtreeFlags&10256)for(e=e.child;e!==null;)Zv(e),e=e.sibling}function Zv(e){switch(e.tag){case 0:case 11:case 15:mo(e),e.flags&2048&&xi(9,e,e.return);break;case 3:mo(e);break;case 12:mo(e);break;case 22:var t=e.stateNode;e.memoizedState!==null&&t._visibility&2&&(e.return===null||e.return.tag!==13)?(t._visibility&=-3,df(e)):mo(e);break;default:mo(e)}}function df(e){var t=e.deletions;if((e.flags&16)!==0){if(t!==null)for(var s=0;s<t.length;s++){var r=t[s];cn=r,$v(r,e)}Bv(e)}for(e=e.child;e!==null;){switch(t=e,t.tag){case 0:case 11:case 15:xi(8,t,t.return),df(t);break;case 22:s=t.stateNode,s._visibility&2&&(s._visibility&=-3,df(t));break;default:df(t)}e=e.sibling}}function $v(e,t){for(;cn!==null;){var s=cn;switch(s.tag){case 0:case 11:case 15:xi(8,s,t);break;case 23:case 22:if(s.memoizedState!==null&&s.memoizedState.cachePool!==null){var r=s.memoizedState.cachePool.pool;r!=null&&r.refCount++}break;case 24:Wu(s.memoizedState.cache)}if(r=s.child,r!==null)r.return=s,cn=r;else e:for(s=e;cn!==null;){r=cn;var f=r.sibling,d=r.return;if(kv(r),r===s){cn=null;break e}if(f!==null){f.return=d,cn=f;break e}cn=d}}}var b1={getCacheForType:function(e){var t=gn(Wt),s=t.data.get(e);return s===void 0&&(s=e(),t.data.set(e,s)),s},cacheSignal:function(){return gn(Wt).controller.signal}},S1=typeof WeakMap=="function"?WeakMap:Map,gt=0,Nt=null,nt=null,rt=0,bt=0,na=null,Ei=!1,Hl=!1,qh=!1,Vs=0,Vt=0,Ti=0,zr=0,Bh=0,aa=0,Vl=0,yo=null,qn=null,Zh=!1,hf=0,Yv=0,mf=1/0,yf=null,Ni=null,an=0,_i=null,Fl=null,Fs=0,$h=0,Yh=null,Iv=null,go=0,Ih=null;function sa(){return(gt&2)!==0&&rt!==0?rt&-rt:X.T!==null?Jh():rl()}function Gv(){if(aa===0)if((rt&536870912)===0||I){var e=Ot;Ot<<=1,(Ot&3932160)===0&&(Ot=262144),aa=e}else aa=536870912;return e=ea.current,e!==null&&(e.flags|=32),aa}function Bn(e,t,s){(e===Nt&&(bt===2||bt===9)||e.cancelPendingCommit!==null)&&(ql(e,0),Oi(e,rt,aa,!1)),ei(e,s),((gt&2)===0||e!==Nt)&&(e===Nt&&((gt&2)===0&&(zr|=s),Vt===4&&Oi(e,rt,aa,!1)),us(e))}function Xv(e,t,s){if((gt&6)!==0)throw Error(l(327));var r=!s&&(t&127)===0&&(t&e.expiredLanes)===0||Da(e,t),f=r?T1(e,t):Xh(e,t,!0),d=r;do{if(f===0){Hl&&!r&&Oi(e,t,0,!1);break}else{if(s=e.current.alternate,d&&!x1(s)){f=Xh(e,t,!1),d=!1;continue}if(f===2){if(d=t,e.errorRecoveryDisabledLanes&d)var x=0;else x=e.pendingLanes&-536870913,x=x!==0?x:x&536870912?536870912:0;if(x!==0){t=x;e:{var D=e;f=yo;var L=D.current.memoizedState.isDehydrated;if(L&&(ql(D,x).flags|=256),x=Xh(D,x,!1),x!==2){if(qh&&!L){D.errorRecoveryDisabledLanes|=d,zr|=d,f=4;break e}d=qn,qn=f,d!==null&&(qn===null?qn=d:qn.push.apply(qn,d))}f=x}if(d=!1,f!==2)continue}}if(f===1){ql(e,0),Oi(e,t,0,!0);break}e:{switch(r=e,d=f,d){case 0:case 1:throw Error(l(345));case 4:if((t&4194048)!==t)break;case 6:Oi(r,t,aa,!Ei);break e;case 2:qn=null;break;case 3:case 5:break;default:throw Error(l(329))}if((t&62914560)===t&&(f=hf+300-Xt(),10<f)){if(Oi(r,t,aa,!Ei),ps(r,0,!0)!==0)break e;Fs=t,r.timeoutHandle=_p(Qv.bind(null,r,s,qn,yf,Zh,t,aa,zr,Vl,Ei,d,"Throttled",-0,0),f);break e}Qv(r,s,qn,yf,Zh,t,aa,zr,Vl,Ei,d,null,-0,0)}}break}while(!0);us(e)}function Qv(e,t,s,r,f,d,x,D,L,ne,fe,ge,ae,le){if(e.timeoutHandle=-1,ge=t.subtreeFlags,ge&8192||(ge&16785408)===16785408){ge={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:ha},qv(t,d,ge);var Ue=(d&62914560)===d?hf-Xt():(d&4194048)===d?Yv-Xt():0;if(Ue=iE(ge,Ue),Ue!==null){Fs=d,e.cancelPendingCommit=Ue(ap.bind(null,e,t,d,s,r,f,x,D,L,fe,ge,null,ae,le)),Oi(e,d,x,!ne);return}}ap(e,t,d,s,r,f,x,D,L)}function x1(e){for(var t=e;;){var s=t.tag;if((s===0||s===11||s===15)&&t.flags&16384&&(s=t.updateQueue,s!==null&&(s=s.stores,s!==null)))for(var r=0;r<s.length;r++){var f=s[r],d=f.getSnapshot;f=f.value;try{if(!En(d(),f))return!1}catch{return!1}}if(s=t.child,t.subtreeFlags&16384&&s!==null)s.return=t,t=s;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 Oi(e,t,s,r){t&=~Bh,t&=~zr,e.suspendedLanes|=t,e.pingedLanes&=~t,r&&(e.warmLanes|=t),r=e.expirationTimes;for(var f=t;0<f;){var d=31-Ee(f),x=1<<d;r[d]=-1,f&=~x}s!==0&&wt(e,s,t)}function gf(){return(gt&6)===0?(vo(0),!1):!0}function Gh(){if(nt!==null){if(bt===0)var e=nt.return;else e=nt,Sa=Ms=null,oh(e),jl=null,Ju=0,e=nt;for(;e!==null;)Ov(e.alternate,e),e=e.return;nt=null}}function ql(e,t){var s=e.timeoutHandle;s!==-1&&(e.timeoutHandle=-1,q1(s)),s=e.cancelPendingCommit,s!==null&&(e.cancelPendingCommit=null,s()),Fs=0,Gh(),Nt=e,nt=s=va(e.current,null),rt=t,bt=0,na=null,Ei=!1,Hl=Da(e,t),qh=!1,Vl=aa=Bh=zr=Ti=Vt=0,qn=yo=null,Zh=!1,(t&8)!==0&&(t|=t&32);var r=e.entangledLanes;if(r!==0)for(e=e.entanglements,r&=t;0<r;){var f=31-Ee(r),d=1<<f;t|=e[f],r&=~d}return Vs=t,mi(),s}function Wv(e,t){Ke=null,X.H=ro,t===Dl||t===$c?(t=dg(),bt=3):t===Kd?(t=dg(),bt=4):bt=t===_h?8:t!==null&&typeof t=="object"&&typeof t.then=="function"?6:1,na=t,nt===null&&(Vt=1,sf(e,zn(t,e.current)))}function Kv(){var e=ea.current;return e===null?!0:(rt&4194048)===rt?Ea===null:(rt&62914560)===rt||(rt&536870912)!==0?e===Ea:!1}function Jv(){var e=X.H;return X.H=ro,e===null?ro:e}function Pv(){var e=X.A;return X.A=b1,e}function vf(){Vt=4,Ei||(rt&4194048)!==rt&&ea.current!==null||(Hl=!0),(Ti&134217727)===0&&(zr&134217727)===0||Nt===null||Oi(Nt,rt,aa,!1)}function Xh(e,t,s){var r=gt;gt|=2;var f=Jv(),d=Pv();(Nt!==e||rt!==t)&&(yf=null,ql(e,t)),t=!1;var x=Vt;e:do try{if(bt!==0&&nt!==null){var D=nt,L=na;switch(bt){case 8:Gh(),x=6;break e;case 3:case 2:case 9:case 6:ea.current===null&&(t=!0);var ne=bt;if(bt=0,na=null,Bl(e,D,L,ne),s&&Hl){x=0;break e}break;default:ne=bt,bt=0,na=null,Bl(e,D,L,ne)}}E1(),x=Vt;break}catch(fe){Wv(e,fe)}while(!0);return t&&e.shellSuspendCounter++,Sa=Ms=null,gt=r,X.H=f,X.A=d,nt===null&&(Nt=null,rt=0,mi()),x}function E1(){for(;nt!==null;)ep(nt)}function T1(e,t){var s=gt;gt|=2;var r=Jv(),f=Pv();Nt!==e||rt!==t?(yf=null,mf=Xt()+500,ql(e,t)):Hl=Da(e,t);e:do try{if(bt!==0&&nt!==null){t=nt;var d=na;t:switch(bt){case 1:bt=0,na=null,Bl(e,t,d,1);break;case 2:case 9:if(cg(d)){bt=0,na=null,tp(t);break}t=function(){bt!==2&&bt!==9||Nt!==e||(bt=7),us(e)},d.then(t,t);break e;case 3:bt=7;break e;case 4:bt=5;break e;case 7:cg(d)?(bt=0,na=null,tp(t)):(bt=0,na=null,Bl(e,t,d,7));break;case 5:var x=null;switch(nt.tag){case 26:x=nt.memoizedState;case 5:case 27:var D=nt;if(x?Fp(x):D.stateNode.complete){bt=0,na=null;var L=D.sibling;if(L!==null)nt=L;else{var ne=D.return;ne!==null?(nt=ne,pf(ne)):nt=null}break t}}bt=0,na=null,Bl(e,t,d,5);break;case 6:bt=0,na=null,Bl(e,t,d,6);break;case 8:Gh(),Vt=6;break e;default:throw Error(l(462))}}N1();break}catch(fe){Wv(e,fe)}while(!0);return Sa=Ms=null,X.H=r,X.A=f,gt=s,nt!==null?0:(Nt=null,rt=0,mi(),Vt)}function N1(){for(;nt!==null&&!er();)ep(nt)}function ep(e){var t=Nv(e.alternate,e,Vs);e.memoizedProps=e.pendingProps,t===null?pf(e):nt=t}function tp(e){var t=e,s=t.alternate;switch(t.tag){case 15:case 0:t=pv(s,t,t.pendingProps,t.type,void 0,rt);break;case 11:t=pv(s,t,t.pendingProps,t.type.render,t.ref,rt);break;case 5:oh(t);default:Ov(s,t),t=nt=Fc(t,Vs),t=Nv(s,t,Vs)}e.memoizedProps=e.pendingProps,t===null?pf(e):nt=t}function Bl(e,t,s,r){Sa=Ms=null,oh(t),jl=null,Ju=0;var f=t.return;try{if(d1(e,f,t,s,rt)){Vt=1,sf(e,zn(s,e.current)),nt=null;return}}catch(d){if(f!==null)throw nt=f,d;Vt=1,sf(e,zn(s,e.current)),nt=null;return}t.flags&32768?(I||r===1?e=!0:Hl||(rt&536870912)!==0?e=!1:(Ei=e=!0,(r===2||r===9||r===3||r===6)&&(r=ea.current,r!==null&&r.tag===13&&(r.flags|=16384))),np(t,e)):pf(t)}function pf(e){var t=e;do{if((t.flags&32768)!==0){np(t,Ei);return}e=t.return;var s=y1(t.alternate,t,Vs);if(s!==null){nt=s;return}if(t=t.sibling,t!==null){nt=t;return}nt=t=e}while(t!==null);Vt===0&&(Vt=5)}function np(e,t){do{var s=g1(e.alternate,e);if(s!==null){s.flags&=32767,nt=s;return}if(s=e.return,s!==null&&(s.flags|=32768,s.subtreeFlags=0,s.deletions=null),!t&&(e=e.sibling,e!==null)){nt=e;return}nt=e=s}while(e!==null);Vt=6,nt=null}function ap(e,t,s,r,f,d,x,D,L){e.cancelPendingCommit=null;do bf();while(an!==0);if((gt&6)!==0)throw Error(l(327));if(t!==null){if(t===e.current)throw Error(l(177));if(d=t.lanes|t.childLanes,d|=Nr,dc(e,s,d,x,D,L),e===Nt&&(nt=Nt=null,rt=0),Fl=t,_i=e,Fs=s,$h=d,Yh=f,Iv=r,(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?(e.callbackNode=null,e.callbackPriority=0,C1(Kn,function(){return up(),null})):(e.callbackNode=null,e.callbackPriority=0),r=(t.flags&13878)!==0,(t.subtreeFlags&13878)!==0||r){r=X.T,X.T=null,f=ce.p,ce.p=2,x=gt,gt|=4;try{v1(e,t,s)}finally{gt=x,ce.p=f,X.T=r}}an=1,sp(),ip(),rp()}}function sp(){if(an===1){an=0;var e=_i,t=Fl,s=(t.flags&13878)!==0;if((t.subtreeFlags&13878)!==0||s){s=X.T,X.T=null;var r=ce.p;ce.p=2;var f=gt;gt|=4;try{Hv(t,e);var d=rm,x=Yd(e.containerInfo),D=d.focusedElem,L=d.selectionRange;if(x!==D&&D&&D.ownerDocument&&ot(D.ownerDocument.documentElement,D)){if(L!==null&&pl(D)){var ne=L.start,fe=L.end;if(fe===void 0&&(fe=ne),"selectionStart"in D)D.selectionStart=ne,D.selectionEnd=Math.min(fe,D.value.length);else{var ge=D.ownerDocument||document,ae=ge&&ge.defaultView||window;if(ae.getSelection){var le=ae.getSelection(),Ue=D.textContent.length,Ye=Math.min(L.start,Ue),Tt=L.end===void 0?Ye:Math.min(L.end,Ue);!le.extend&&Ye>Tt&&(x=Tt,Tt=Ye,Ye=x);var W=kc(D,Ye),Y=kc(D,Tt);if(W&&Y&&(le.rangeCount!==1||le.anchorNode!==W.node||le.anchorOffset!==W.offset||le.focusNode!==Y.node||le.focusOffset!==Y.offset)){var te=ge.createRange();te.setStart(W.node,W.offset),le.removeAllRanges(),Ye>Tt?(le.addRange(te),le.extend(Y.node,Y.offset)):(te.setEnd(Y.node,Y.offset),le.addRange(te))}}}}for(ge=[],le=D;le=le.parentNode;)le.nodeType===1&&ge.push({element:le,left:le.scrollLeft,top:le.scrollTop});for(typeof D.focus=="function"&&D.focus(),D=0;D<ge.length;D++){var me=ge[D];me.element.scrollLeft=me.left,me.element.scrollTop=me.top}}jf=!!im,rm=im=null}finally{gt=f,ce.p=r,X.T=s}}e.current=t,an=2}}function ip(){if(an===2){an=0;var e=_i,t=Fl,s=(t.flags&8772)!==0;if((t.subtreeFlags&8772)!==0||s){s=X.T,X.T=null;var r=ce.p;ce.p=2;var f=gt;gt|=4;try{Av(e,t.alternate,t)}finally{gt=f,ce.p=r,X.T=s}}an=3}}function rp(){if(an===4||an===3){an=0,Ks();var e=_i,t=Fl,s=Fs,r=Iv;(t.subtreeFlags&10256)!==0||(t.flags&10256)!==0?an=5:(an=0,Fl=_i=null,lp(e,e.pendingLanes));var f=e.pendingLanes;if(f===0&&(Ni=null),xn(s),t=t.stateNode,ve&&typeof ve.onCommitFiberRoot=="function")try{ve.onCommitFiberRoot(he,t,void 0,(t.current.flags&128)===128)}catch{}if(r!==null){t=X.T,f=ce.p,ce.p=2,X.T=null;try{for(var d=e.onRecoverableError,x=0;x<r.length;x++){var D=r[x];d(D.value,{componentStack:D.stack})}}finally{X.T=t,ce.p=f}}(Fs&3)!==0&&bf(),us(e),f=e.pendingLanes,(s&261930)!==0&&(f&42)!==0?e===Ih?go++:(go=0,Ih=e):go=0,vo(0)}}function lp(e,t){(e.pooledCacheLanes&=t)===0&&(t=e.pooledCache,t!=null&&(e.pooledCache=null,Wu(t)))}function bf(){return sp(),ip(),rp(),up()}function up(){if(an!==5)return!1;var e=_i,t=$h;$h=0;var s=xn(Fs),r=X.T,f=ce.p;try{ce.p=32>s?32:s,X.T=null,s=Yh,Yh=null;var d=_i,x=Fs;if(an=0,Fl=_i=null,Fs=0,(gt&6)!==0)throw Error(l(331));var D=gt;if(gt|=4,Zv(d.current),Fv(d,d.current,x,s),gt=D,vo(0,!1),ve&&typeof ve.onPostCommitFiberRoot=="function")try{ve.onPostCommitFiberRoot(he,d)}catch{}return!0}finally{ce.p=f,X.T=r,lp(e,t)}}function op(e,t,s){t=zn(s,t),t=Nh(e.stateNode,t,2),e=pi(e,t,2),e!==null&&(ei(e,2),us(e))}function St(e,t,s){if(e.tag===3)op(e,e,s);else for(;t!==null;){if(t.tag===3){op(t,e,s);break}else if(t.tag===1){var r=t.stateNode;if(typeof t.type.getDerivedStateFromError=="function"||typeof r.componentDidCatch=="function"&&(Ni===null||!Ni.has(r))){e=zn(s,e),s=cv(2),r=pi(t,s,2),r!==null&&(fv(s,r,t,e),ei(r,2),us(r));break}}t=t.return}}function Qh(e,t,s){var r=e.pingCache;if(r===null){r=e.pingCache=new S1;var f=new Set;r.set(t,f)}else f=r.get(t),f===void 0&&(f=new Set,r.set(t,f));f.has(s)||(qh=!0,f.add(s),e=_1.bind(null,e,t,s),t.then(e,e))}function _1(e,t,s){var r=e.pingCache;r!==null&&r.delete(t),e.pingedLanes|=e.suspendedLanes&s,e.warmLanes&=~s,Nt===e&&(rt&s)===s&&(Vt===4||Vt===3&&(rt&62914560)===rt&&300>Xt()-hf?(gt&2)===0&&ql(e,0):Bh|=s,Vl===rt&&(Vl=0)),us(e)}function cp(e,t){t===0&&(t=Ps()),e=ga(e,t),e!==null&&(ei(e,t),us(e))}function O1(e){var t=e.memoizedState,s=0;t!==null&&(s=t.retryLane),cp(e,s)}function w1(e,t){var s=0;switch(e.tag){case 31:case 13:var r=e.stateNode,f=e.memoizedState;f!==null&&(s=f.retryLane);break;case 19:r=e.stateNode;break;case 22:r=e.stateNode._retryCache;break;default:throw Error(l(314))}r!==null&&r.delete(t),cp(e,s)}function C1(e,t){return gs(e,t)}var Sf=null,Zl=null,Wh=!1,xf=!1,Kh=!1,wi=0;function us(e){e!==Zl&&e.next===null&&(Zl===null?Sf=Zl=e:Zl=Zl.next=e),xf=!0,Wh||(Wh=!0,D1())}function vo(e,t){if(!Kh&&xf){Kh=!0;do for(var s=!1,r=Sf;r!==null;){if(e!==0){var f=r.pendingLanes;if(f===0)var d=0;else{var x=r.suspendedLanes,D=r.pingedLanes;d=(1<<31-Ee(42|e)+1)-1,d&=f&~(x&~D),d=d&201326741?d&201326741|1:d?d|2:0}d!==0&&(s=!0,mp(r,d))}else d=rt,d=ps(r,r===Nt?d:0,r.cancelPendingCommit!==null||r.timeoutHandle!==-1),(d&3)===0||Da(r,d)||(s=!0,mp(r,d));r=r.next}while(s);Kh=!1}}function M1(){fp()}function fp(){xf=Wh=!1;var e=0;wi!==0&&F1()&&(e=wi);for(var t=Xt(),s=null,r=Sf;r!==null;){var f=r.next,d=dp(r,t);d===0?(r.next=null,s===null?Sf=f:s.next=f,f===null&&(Zl=s)):(s=r,(e!==0||(d&3)!==0)&&(xf=!0)),r=f}an!==0&&an!==5||vo(e),wi!==0&&(wi=0)}function dp(e,t){for(var s=e.suspendedLanes,r=e.pingedLanes,f=e.expirationTimes,d=e.pendingLanes&-62914561;0<d;){var x=31-Ee(d),D=1<<x,L=f[x];L===-1?((D&s)===0||(D&r)!==0)&&(f[x]=al(D,t)):L<=t&&(e.expiredLanes|=D),d&=~D}if(t=Nt,s=rt,s=ps(e,e===t?s:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r=e.callbackNode,s===0||e===t&&(bt===2||bt===9)||e.cancelPendingCommit!==null)return r!==null&&r!==null&&Ja(r),e.callbackNode=null,e.callbackPriority=0;if((s&3)===0||Da(e,s)){if(t=s&-s,t===e.callbackPriority)return t;switch(r!==null&&Ja(r),xn(s)){case 2:case 8:s=tr;break;case 32:s=Kn;break;case 268435456:s=A;break;default:s=Kn}return r=hp.bind(null,e),s=gs(s,r),e.callbackPriority=t,e.callbackNode=s,t}return r!==null&&r!==null&&Ja(r),e.callbackPriority=2,e.callbackNode=null,2}function hp(e,t){if(an!==0&&an!==5)return e.callbackNode=null,e.callbackPriority=0,null;var s=e.callbackNode;if(bf()&&e.callbackNode!==s)return null;var r=rt;return r=ps(e,e===Nt?r:0,e.cancelPendingCommit!==null||e.timeoutHandle!==-1),r===0?null:(Xv(e,r,t),dp(e,Xt()),e.callbackNode!=null&&e.callbackNode===s?hp.bind(null,e):null)}function mp(e,t){if(bf())return null;Xv(e,t,!0)}function D1(){B1(function(){(gt&6)!==0?gs(Js,M1):fp()})}function Jh(){if(wi===0){var e=Cl;e===0&&(e=Pe,Pe<<=1,(Pe&261888)===0&&(Pe=256)),wi=e}return wi}function yp(e){return e==null||typeof e=="symbol"||typeof e=="boolean"?null:typeof e=="function"?e:or(""+e)}function gp(e,t){var s=t.ownerDocument.createElement("input");return s.name=t.name,s.value=t.value,e.id&&s.setAttribute("form",e.id),t.parentNode.insertBefore(s,t),e=new FormData(e),s.parentNode.removeChild(s),e}function j1(e,t,s,r,f){if(t==="submit"&&s&&s.stateNode===f){var d=yp((f[tn]||null).action),x=r.submitter;x&&(t=(t=x[tn]||null)?yp(t.formAction):x.getAttribute("formAction"),t!==null&&(d=t,x=null));var D=new hr("action","action",null,r,f);e.push({event:D,listeners:[{instance:null,listener:function(){if(r.defaultPrevented){if(wi!==0){var L=x?gp(f,x):new FormData(f);ph(s,{pending:!0,data:L,method:f.method,action:d},null,L)}}else typeof d=="function"&&(D.preventDefault(),L=x?gp(f,x):new FormData(f),ph(s,{pending:!0,data:L,method:f.method,action:d},d,L))},currentTarget:f}]})}}for(var Ph=0;Ph<Iu.length;Ph++){var em=Iu[Ph],R1=em.toLowerCase(),A1=em[0].toUpperCase()+em.slice(1);Un(R1,"on"+A1)}Un(Lc,"onAnimationEnd"),Un(Hc,"onAnimationIteration"),Un(xl,"onAnimationStart"),Un("dblclick","onDoubleClick"),Un("focusin","onFocus"),Un("focusout","onBlur"),Un(Id,"onTransitionRun"),Un(Gd,"onTransitionStart"),Un(Vc,"onTransitionCancel"),Un($u,"onTransitionEnd"),ti("onMouseEnter",["mouseout","mouseover"]),ti("onMouseLeave",["mouseout","mouseover"]),ti("onPointerEnter",["pointerout","pointerover"]),ti("onPointerLeave",["pointerout","pointerover"]),es("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),es("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),es("onBeforeInput",["compositionend","keypress","textInput","paste"]),es("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),es("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var po="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(" "),k1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(po));function vp(e,t){t=(t&4)!==0;for(var s=0;s<e.length;s++){var r=e[s],f=r.event;r=r.listeners;e:{var d=void 0;if(t)for(var x=r.length-1;0<=x;x--){var D=r[x],L=D.instance,ne=D.currentTarget;if(D=D.listener,L!==d&&f.isPropagationStopped())break e;d=D,f.currentTarget=ne;try{d(f)}catch(fe){hi(fe)}f.currentTarget=null,d=L}else for(x=0;x<r.length;x++){if(D=r[x],L=D.instance,ne=D.currentTarget,D=D.listener,L!==d&&f.isPropagationStopped())break e;d=D,f.currentTarget=ne;try{d(f)}catch(fe){hi(fe)}f.currentTarget=null,d=L}}}}function at(e,t){var s=t[nr];s===void 0&&(s=t[nr]=new Set);var r=e+"__bubble";s.has(r)||(pp(t,e,2,!1),s.add(r))}function tm(e,t,s){var r=0;t&&(r|=4),pp(s,e,r,t)}var Ef="_reactListening"+Math.random().toString(36).slice(2);function nm(e){if(!e[Ef]){e[Ef]=!0,gc.forEach(function(s){s!=="selectionchange"&&(k1.has(s)||tm(s,!1,e),tm(s,!0,e))});var t=e.nodeType===9?e:e.ownerDocument;t===null||t[Ef]||(t[Ef]=!0,tm("selectionchange",!1,t))}}function pp(e,t,s,r){switch(Gp(t)){case 2:var f=uE;break;case 8:f=oE;break;default:f=vm}s=f.bind(null,t,s,e),f=void 0,!Uu||t!=="touchstart"&&t!=="touchmove"&&t!=="wheel"||(f=!0),r?f!==void 0?e.addEventListener(t,s,{capture:!0,passive:f}):e.addEventListener(t,s,!0):f!==void 0?e.addEventListener(t,s,{passive:f}):e.addEventListener(t,s,!1)}function am(e,t,s,r,f){var d=r;if((t&1)===0&&(t&2)===0&&r!==null)e:for(;;){if(r===null)return;var x=r.tag;if(x===3||x===4){var D=r.stateNode.containerInfo;if(D===f)break;if(x===4)for(x=r.return;x!==null;){var L=x.tag;if((L===3||L===4)&&x.stateNode.containerInfo===f)return;x=x.return}for(;D!==null;){if(x=Ss(D),x===null)return;if(L=x.tag,L===5||L===6||L===26||L===27){r=d=x;continue e}D=D.parentNode}}r=r.return}ku(function(){var ne=d,fe=dl(s),ge=[];e:{var ae=Yu.get(e);if(ae!==void 0){var le=hr,Ue=e;switch(e){case"keypress":if(dr(s)===0)break e;case"keydown":case"keyup":le=jd;break;case"focusin":Ue="focus",le=vl;break;case"focusout":Ue="blur",le=vl;break;case"beforeblur":case"afterblur":le=vl;break;case"click":if(s.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":le=Ec;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":le=Ed;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":le=kd;break;case Lc:case Hc:case xl:le=ii;break;case $u:le=Ud;break;case"scroll":case"scrollend":le=zu;break;case"wheel":le=Ld;break;case"copy":case"cut":case"paste":le=ri;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":le=Tc;break;case"toggle":case"beforetoggle":le=Vd}var Ye=(t&4)!==0,Tt=!Ye&&(e==="scroll"||e==="scrollend"),W=Ye?ae!==null?ae+"Capture":null:ae;Ye=[];for(var Y=ne,te;Y!==null;){var me=Y;if(te=me.stateNode,me=me.tag,me!==5&&me!==26&&me!==27||te===null||W===null||(me=cr(Y,W),me!=null&&Ye.push(bo(Y,me,te))),Tt)break;Y=Y.return}0<Ye.length&&(ae=new le(ae,Ue,null,s,fe),ge.push({event:ae,listeners:Ye}))}}if((t&7)===0){e:{if(ae=e==="mouseover"||e==="pointerover",le=e==="mouseout"||e==="pointerout",ae&&s!==Ru&&(Ue=s.relatedTarget||s.fromElement)&&(Ss(Ue)||Ue[bs]))break e;if((le||ae)&&(ae=fe.window===fe?fe:(ae=fe.ownerDocument)?ae.defaultView||ae.parentWindow:window,le?(Ue=s.relatedTarget||s.toElement,le=ne,Ue=Ue?Ss(Ue):null,Ue!==null&&(Tt=o(Ue),Ye=Ue.tag,Ue!==Tt||Ye!==5&&Ye!==27&&Ye!==6)&&(Ue=null)):(le=null,Ue=ne),le!==Ue)){if(Ye=Ec,me="onMouseLeave",W="onMouseEnter",Y="mouse",(e==="pointerout"||e==="pointerover")&&(Ye=Tc,me="onPointerLeave",W="onPointerEnter",Y="pointer"),Tt=le==null?ae:An(le),te=Ue==null?ae:An(Ue),ae=new Ye(me,Y+"leave",le,s,fe),ae.target=Tt,ae.relatedTarget=te,me=null,Ss(fe)===ne&&(Ye=new Ye(W,Y+"enter",Ue,s,fe),Ye.target=te,Ye.relatedTarget=Tt,me=Ye),Tt=me,le&&Ue)t:{for(Ye=U1,W=le,Y=Ue,te=0,me=W;me;me=Ye(me))te++;me=0;for(var Be=Y;Be;Be=Ye(Be))me++;for(;0<te-me;)W=Ye(W),te--;for(;0<me-te;)Y=Ye(Y),me--;for(;te--;){if(W===Y||Y!==null&&W===Y.alternate){Ye=W;break t}W=Ye(W),Y=Ye(Y)}Ye=null}else Ye=null;le!==null&&bp(ge,ae,le,Ye,!1),Ue!==null&&Tt!==null&&bp(ge,Tt,Ue,Ye,!0)}}e:{if(ae=ne?An(ne):window,le=ae.nodeName&&ae.nodeName.toLowerCase(),le==="select"||le==="input"&&ae.type==="file")var dt=Rc;else if(jc(ae))if(ss)dt=Ct;else{dt=ci;var Ve=st}else le=ae.nodeName,!le||le.toLowerCase()!=="input"||ae.type!=="checkbox"&&ae.type!=="radio"?ne&&fl(ne.elementType)&&(dt=Rc):dt=$d;if(dt&&(dt=dt(e,ne))){Hu(ge,dt,s,fe);break e}Ve&&Ve(e,ae,ne),e==="focusout"&&ne&&ae.type==="number"&&ne.memoizedProps.value!=null&&ir(ae,"number",ae.value)}switch(Ve=ne?An(ne):window,e){case"focusin":(jc(Ve)||Ve.contentEditable==="true")&&(fi=Ve,bl=ne,mn=null);break;case"focusout":mn=bl=fi=null;break;case"mousedown":Sl=!0;break;case"contextmenu":case"mouseup":case"dragend":Sl=!1,Tr(ge,s,fe);break;case"selectionchange":if(Uc)break;case"keydown":case"keyup":Tr(ge,s,fe)}var Je;if(Lu)e:{switch(e){case"compositionstart":var lt="onCompositionStart";break e;case"compositionend":lt="onCompositionEnd";break e;case"compositionupdate":lt="onCompositionUpdate";break e}lt=void 0}else ui?Mc(e,s)&&(lt="onCompositionEnd"):e==="keydown"&&s.keyCode===229&&(lt="onCompositionStart");lt&&(Oc&&s.locale!=="ko"&&(ui||lt!=="onCompositionStart"?lt==="onCompositionEnd"&&ui&&(Je=nn()):(ns=fe,hl="value"in ns?ns.value:ns.textContent,ui=!0)),Ve=Tf(ne,lt),0<Ve.length&&(lt=new li(lt,e,null,s,fe),ge.push({event:lt,listeners:Ve}),Je?lt.data=Je:(Je=Dc(s),Je!==null&&(lt.data=Je)))),(Je=Fd?qd(e,s):Bd(e,s))&&(lt=Tf(ne,"onBeforeInput"),0<lt.length&&(Ve=new li("onBeforeInput","beforeinput",null,s,fe),ge.push({event:Ve,listeners:lt}),Ve.data=Je)),j1(ge,e,ne,s,fe)}vp(ge,t)})}function bo(e,t,s){return{instance:e,listener:t,currentTarget:s}}function Tf(e,t){for(var s=t+"Capture",r=[];e!==null;){var f=e,d=f.stateNode;if(f=f.tag,f!==5&&f!==26&&f!==27||d===null||(f=cr(e,s),f!=null&&r.unshift(bo(e,f,d)),f=cr(e,t),f!=null&&r.push(bo(e,f,d))),e.tag===3)return r;e=e.return}return[]}function U1(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5&&e.tag!==27);return e||null}function bp(e,t,s,r,f){for(var d=t._reactName,x=[];s!==null&&s!==r;){var D=s,L=D.alternate,ne=D.stateNode;if(D=D.tag,L!==null&&L===r)break;D!==5&&D!==26&&D!==27||ne===null||(L=ne,f?(ne=cr(s,d),ne!=null&&x.unshift(bo(s,ne,L))):f||(ne=cr(s,d),ne!=null&&x.push(bo(s,ne,L)))),s=s.return}x.length!==0&&e.push({event:t,listeners:x})}var z1=/\r\n?/g,L1=/\u0000|\uFFFD/g;function Sp(e){return(typeof e=="string"?e:""+e).replace(z1,`
`).replace(L1,"")}function xp(e,t){return t=Sp(t),Sp(e)===t}function Et(e,t,s,r,f,d){switch(s){case"children":typeof r=="string"?t==="body"||t==="textarea"&&r===""||ka(e,r):(typeof r=="number"||typeof r=="bigint")&&t!=="body"&&ka(e,""+r);break;case"className":ul(e,"class",r);break;case"tabIndex":ul(e,"tabindex",r);break;case"dir":case"role":case"viewBox":case"width":case"height":ul(e,s,r);break;case"style":bc(e,r,d);break;case"data":if(t!=="object"){ul(e,"data",r);break}case"src":case"href":if(r===""&&(t!=="a"||s!=="href")){e.removeAttribute(s);break}if(r==null||typeof r=="function"||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(s);break}r=or(""+r),e.setAttribute(s,r);break;case"action":case"formAction":if(typeof r=="function"){e.setAttribute(s,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof d=="function"&&(s==="formAction"?(t!=="input"&&Et(e,t,"name",f.name,f,null),Et(e,t,"formEncType",f.formEncType,f,null),Et(e,t,"formMethod",f.formMethod,f,null),Et(e,t,"formTarget",f.formTarget,f,null)):(Et(e,t,"encType",f.encType,f,null),Et(e,t,"method",f.method,f,null),Et(e,t,"target",f.target,f,null)));if(r==null||typeof r=="symbol"||typeof r=="boolean"){e.removeAttribute(s);break}r=or(""+r),e.setAttribute(s,r);break;case"onClick":r!=null&&(e.onclick=ha);break;case"onScroll":r!=null&&at("scroll",e);break;case"onScrollEnd":r!=null&&at("scrollend",e);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(s=r.__html,s!=null){if(f.children!=null)throw Error(l(60));e.innerHTML=s}}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}s=or(""+r),e.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",s);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(s,""+r):e.removeAttribute(s);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(s,""):e.removeAttribute(s);break;case"capture":case"download":r===!0?e.setAttribute(s,""):r!==!1&&r!=null&&typeof r!="function"&&typeof r!="symbol"?e.setAttribute(s,r):e.removeAttribute(s);break;case"cols":case"rows":case"size":case"span":r!=null&&typeof r!="function"&&typeof r!="symbol"&&!isNaN(r)&&1<=r?e.setAttribute(s,r):e.removeAttribute(s);break;case"rowSpan":case"start":r==null||typeof r=="function"||typeof r=="symbol"||isNaN(r)?e.removeAttribute(s):e.setAttribute(s,r);break;case"popover":at("beforetoggle",e),at("toggle",e),dn(e,"popover",r);break;case"xlinkActuate":vt(e,"http://www.w3.org/1999/xlink","xlink:actuate",r);break;case"xlinkArcrole":vt(e,"http://www.w3.org/1999/xlink","xlink:arcrole",r);break;case"xlinkRole":vt(e,"http://www.w3.org/1999/xlink","xlink:role",r);break;case"xlinkShow":vt(e,"http://www.w3.org/1999/xlink","xlink:show",r);break;case"xlinkTitle":vt(e,"http://www.w3.org/1999/xlink","xlink:title",r);break;case"xlinkType":vt(e,"http://www.w3.org/1999/xlink","xlink:type",r);break;case"xmlBase":vt(e,"http://www.w3.org/XML/1998/namespace","xml:base",r);break;case"xmlLang":vt(e,"http://www.w3.org/XML/1998/namespace","xml:lang",r);break;case"xmlSpace":vt(e,"http://www.w3.org/XML/1998/namespace","xml:space",r);break;case"is":dn(e,"is",r);break;case"innerText":case"textContent":break;default:(!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(s=Sd.get(s)||s,dn(e,s,r))}}function sm(e,t,s,r,f,d){switch(s){case"style":bc(e,r,d);break;case"dangerouslySetInnerHTML":if(r!=null){if(typeof r!="object"||!("__html"in r))throw Error(l(61));if(s=r.__html,s!=null){if(f.children!=null)throw Error(l(60));e.innerHTML=s}}break;case"children":typeof r=="string"?ka(e,r):(typeof r=="number"||typeof r=="bigint")&&ka(e,""+r);break;case"onScroll":r!=null&&at("scroll",e);break;case"onScrollEnd":r!=null&&at("scrollend",e);break;case"onClick":r!=null&&(e.onclick=ha);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Cu.hasOwnProperty(s))e:{if(s[0]==="o"&&s[1]==="n"&&(f=s.endsWith("Capture"),t=s.slice(2,f?s.length-7:void 0),d=e[tn]||null,d=d!=null?d[s]:null,typeof d=="function"&&e.removeEventListener(t,d,f),typeof r=="function")){typeof d!="function"&&d!==null&&(s in e?e[s]=null:e.hasAttribute(s)&&e.removeAttribute(s)),e.addEventListener(t,r,f);break e}s in e?e[s]=r:r===!0?e.setAttribute(s,""):dn(e,s,r)}}}function pn(e,t,s){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":at("error",e),at("load",e);var r=!1,f=!1,d;for(d in s)if(s.hasOwnProperty(d)){var x=s[d];if(x!=null)switch(d){case"src":r=!0;break;case"srcSet":f=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Et(e,t,d,x,s,null)}}f&&Et(e,t,"srcSet",s.srcSet,s,null),r&&Et(e,t,"src",s.src,s,null);return;case"input":at("invalid",e);var D=d=x=f=null,L=null,ne=null;for(r in s)if(s.hasOwnProperty(r)){var fe=s[r];if(fe!=null)switch(r){case"name":f=fe;break;case"type":x=fe;break;case"checked":L=fe;break;case"defaultChecked":ne=fe;break;case"value":d=fe;break;case"defaultValue":D=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(l(137,t));break;default:Et(e,t,r,fe,s,null)}}ai(e,d,D,L,ne,x,f,!1);return;case"select":at("invalid",e),r=x=d=null;for(f in s)if(s.hasOwnProperty(f)&&(D=s[f],D!=null))switch(f){case"value":d=D;break;case"defaultValue":x=D;break;case"multiple":r=D;default:Et(e,t,f,D,s,null)}t=d,s=x,e.multiple=!!r,t!=null?Es(e,!!r,t,!1):s!=null&&Es(e,!!r,s,!0);return;case"textarea":at("invalid",e),d=f=r=null;for(x in s)if(s.hasOwnProperty(x)&&(D=s[x],D!=null))switch(x){case"value":r=D;break;case"defaultValue":f=D;break;case"children":d=D;break;case"dangerouslySetInnerHTML":if(D!=null)throw Error(l(91));break;default:Et(e,t,x,D,s,null)}ju(e,r,f,d);return;case"option":for(L in s)if(s.hasOwnProperty(L)&&(r=s[L],r!=null))switch(L){case"selected":e.selected=r&&typeof r!="function"&&typeof r!="symbol";break;default:Et(e,t,L,r,s,null)}return;case"dialog":at("beforetoggle",e),at("toggle",e),at("cancel",e),at("close",e);break;case"iframe":case"object":at("load",e);break;case"video":case"audio":for(r=0;r<po.length;r++)at(po[r],e);break;case"image":at("error",e),at("load",e);break;case"details":at("toggle",e);break;case"embed":case"source":case"link":at("error",e),at("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(ne in s)if(s.hasOwnProperty(ne)&&(r=s[ne],r!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":throw Error(l(137,t));default:Et(e,t,ne,r,s,null)}return;default:if(fl(t)){for(fe in s)s.hasOwnProperty(fe)&&(r=s[fe],r!==void 0&&sm(e,t,fe,r,s,void 0));return}}for(D in s)s.hasOwnProperty(D)&&(r=s[D],r!=null&&Et(e,t,D,r,s,null))}function H1(e,t,s,r){switch(t){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var f=null,d=null,x=null,D=null,L=null,ne=null,fe=null;for(le in s){var ge=s[le];if(s.hasOwnProperty(le)&&ge!=null)switch(le){case"checked":break;case"value":break;case"defaultValue":L=ge;default:r.hasOwnProperty(le)||Et(e,t,le,null,r,ge)}}for(var ae in r){var le=r[ae];if(ge=s[ae],r.hasOwnProperty(ae)&&(le!=null||ge!=null))switch(ae){case"type":d=le;break;case"name":f=le;break;case"checked":ne=le;break;case"defaultChecked":fe=le;break;case"value":x=le;break;case"defaultValue":D=le;break;case"children":case"dangerouslySetInnerHTML":if(le!=null)throw Error(l(137,t));break;default:le!==ge&&Et(e,t,ae,le,r,ge)}}cl(e,x,D,L,ne,fe,d,f);return;case"select":le=x=D=ae=null;for(d in s)if(L=s[d],s.hasOwnProperty(d)&&L!=null)switch(d){case"value":break;case"multiple":le=L;default:r.hasOwnProperty(d)||Et(e,t,d,null,r,L)}for(f in r)if(d=r[f],L=s[f],r.hasOwnProperty(f)&&(d!=null||L!=null))switch(f){case"value":ae=d;break;case"defaultValue":D=d;break;case"multiple":x=d;default:d!==L&&Et(e,t,f,d,r,L)}t=D,s=x,r=le,ae!=null?Es(e,!!s,ae,!1):!!r!=!!s&&(t!=null?Es(e,!!s,t,!0):Es(e,!!s,s?[]:"",!1));return;case"textarea":le=ae=null;for(D in s)if(f=s[D],s.hasOwnProperty(D)&&f!=null&&!r.hasOwnProperty(D))switch(D){case"value":break;case"children":break;default:Et(e,t,D,null,r,f)}for(x in r)if(f=r[x],d=s[x],r.hasOwnProperty(x)&&(f!=null||d!=null))switch(x){case"value":ae=f;break;case"defaultValue":le=f;break;case"children":break;case"dangerouslySetInnerHTML":if(f!=null)throw Error(l(91));break;default:f!==d&&Et(e,t,x,f,r,d)}rr(e,ae,le);return;case"option":for(var Ue in s)if(ae=s[Ue],s.hasOwnProperty(Ue)&&ae!=null&&!r.hasOwnProperty(Ue))switch(Ue){case"selected":e.selected=!1;break;default:Et(e,t,Ue,null,r,ae)}for(L in r)if(ae=r[L],le=s[L],r.hasOwnProperty(L)&&ae!==le&&(ae!=null||le!=null))switch(L){case"selected":e.selected=ae&&typeof ae!="function"&&typeof ae!="symbol";break;default:Et(e,t,L,ae,r,le)}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 Ye in s)ae=s[Ye],s.hasOwnProperty(Ye)&&ae!=null&&!r.hasOwnProperty(Ye)&&Et(e,t,Ye,null,r,ae);for(ne in r)if(ae=r[ne],le=s[ne],r.hasOwnProperty(ne)&&ae!==le&&(ae!=null||le!=null))switch(ne){case"children":case"dangerouslySetInnerHTML":if(ae!=null)throw Error(l(137,t));break;default:Et(e,t,ne,ae,r,le)}return;default:if(fl(t)){for(var Tt in s)ae=s[Tt],s.hasOwnProperty(Tt)&&ae!==void 0&&!r.hasOwnProperty(Tt)&&sm(e,t,Tt,void 0,r,ae);for(fe in r)ae=r[fe],le=s[fe],!r.hasOwnProperty(fe)||ae===le||ae===void 0&&le===void 0||sm(e,t,fe,ae,r,le);return}}for(var W in s)ae=s[W],s.hasOwnProperty(W)&&ae!=null&&!r.hasOwnProperty(W)&&Et(e,t,W,null,r,ae);for(ge in r)ae=r[ge],le=s[ge],!r.hasOwnProperty(ge)||ae===le||ae==null&&le==null||Et(e,t,ge,ae,r,le)}function Ep(e){switch(e){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function V1(){if(typeof performance.getEntriesByType=="function"){for(var e=0,t=0,s=performance.getEntriesByType("resource"),r=0;r<s.length;r++){var f=s[r],d=f.transferSize,x=f.initiatorType,D=f.duration;if(d&&D&&Ep(x)){for(x=0,D=f.responseEnd,r+=1;r<s.length;r++){var L=s[r],ne=L.startTime;if(ne>D)break;var fe=L.transferSize,ge=L.initiatorType;fe&&Ep(ge)&&(L=L.responseEnd,x+=fe*(L<D?1:(D-ne)/(L-ne)))}if(--r,t+=8*(d+x)/(f.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 im=null,rm=null;function Nf(e){return e.nodeType===9?e:e.ownerDocument}function Tp(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 Np(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 lm(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 um=null;function F1(){var e=window.event;return e&&e.type==="popstate"?e===um?!1:(um=e,!0):(um=null,!1)}var _p=typeof setTimeout=="function"?setTimeout:void 0,q1=typeof clearTimeout=="function"?clearTimeout:void 0,Op=typeof Promise=="function"?Promise:void 0,B1=typeof queueMicrotask=="function"?queueMicrotask:typeof Op<"u"?function(e){return Op.resolve(null).then(e).catch(Z1)}:_p;function Z1(e){setTimeout(function(){throw e})}function Ci(e){return e==="head"}function wp(e,t){var s=t,r=0;do{var f=s.nextSibling;if(e.removeChild(s),f&&f.nodeType===8)if(s=f.data,s==="/$"||s==="/&"){if(r===0){e.removeChild(f),Gl(t);return}r--}else if(s==="$"||s==="$?"||s==="$~"||s==="$!"||s==="&")r++;else if(s==="html")So(e.ownerDocument.documentElement);else if(s==="head"){s=e.ownerDocument.head,So(s);for(var d=s.firstChild;d;){var x=d.nextSibling,D=d.nodeName;d[ar]||D==="SCRIPT"||D==="STYLE"||D==="LINK"&&d.rel.toLowerCase()==="stylesheet"||s.removeChild(d),d=x}}else s==="body"&&So(e.ownerDocument.body);s=f}while(s);Gl(t)}function Cp(e,t){var s=e;e=0;do{var r=s.nextSibling;if(s.nodeType===1?t?(s._stashedDisplay=s.style.display,s.style.display="none"):(s.style.display=s._stashedDisplay||"",s.getAttribute("style")===""&&s.removeAttribute("style")):s.nodeType===3&&(t?(s._stashedText=s.nodeValue,s.nodeValue=""):s.nodeValue=s._stashedText||""),r&&r.nodeType===8)if(s=r.data,s==="/$"){if(e===0)break;e--}else s!=="$"&&s!=="$?"&&s!=="$~"&&s!=="$!"||e++;s=r}while(s)}function om(e){var t=e.firstChild;for(t&&t.nodeType===10&&(t=t.nextSibling);t;){var s=t;switch(t=t.nextSibling,s.nodeName){case"HTML":case"HEAD":case"BODY":om(s),ll(s);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(s.rel.toLowerCase()==="stylesheet")continue}e.removeChild(s)}}function $1(e,t,s,r){for(;e.nodeType===1;){var f=s;if(e.nodeName.toLowerCase()!==t.toLowerCase()){if(!r&&(e.nodeName!=="INPUT"||e.type!=="hidden"))break}else if(r){if(!e[ar])switch(t){case"meta":if(!e.hasAttribute("itemprop"))break;return e;case"link":if(d=e.getAttribute("rel"),d==="stylesheet"&&e.hasAttribute("data-precedence"))break;if(d!==f.rel||e.getAttribute("href")!==(f.href==null||f.href===""?null:f.href)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin)||e.getAttribute("title")!==(f.title==null?null:f.title))break;return e;case"style":if(e.hasAttribute("data-precedence"))break;return e;case"script":if(d=e.getAttribute("src"),(d!==(f.src==null?null:f.src)||e.getAttribute("type")!==(f.type==null?null:f.type)||e.getAttribute("crossorigin")!==(f.crossOrigin==null?null:f.crossOrigin))&&d&&e.hasAttribute("async")&&!e.hasAttribute("itemprop"))break;return e;default:return e}}else if(t==="input"&&e.type==="hidden"){var d=f.name==null?null:""+f.name;if(f.type==="hidden"&&e.getAttribute("name")===d)return e}else return e;if(e=Ta(e.nextSibling),e===null)break}return null}function Y1(e,t,s){if(t==="")return null;for(;e.nodeType!==3;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!s||(e=Ta(e.nextSibling),e===null))return null;return e}function Mp(e,t){for(;e.nodeType!==8;)if((e.nodeType!==1||e.nodeName!=="INPUT"||e.type!=="hidden")&&!t||(e=Ta(e.nextSibling),e===null))return null;return e}function cm(e){return e.data==="$?"||e.data==="$~"}function fm(e){return e.data==="$!"||e.data==="$?"&&e.ownerDocument.readyState!=="loading"}function I1(e,t){var s=e.ownerDocument;if(e.data==="$~")e._reactRetry=t;else if(e.data!=="$?"||s.readyState!=="loading")t();else{var r=function(){t(),s.removeEventListener("DOMContentLoaded",r)};s.addEventListener("DOMContentLoaded",r),e._reactRetry=r}}function Ta(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 dm=null;function Dp(e){e=e.nextSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="/$"||s==="/&"){if(t===0)return Ta(e.nextSibling);t--}else s!=="$"&&s!=="$!"&&s!=="$?"&&s!=="$~"&&s!=="&"||t++}e=e.nextSibling}return null}function jp(e){e=e.previousSibling;for(var t=0;e;){if(e.nodeType===8){var s=e.data;if(s==="$"||s==="$!"||s==="$?"||s==="$~"||s==="&"){if(t===0)return e;t--}else s!=="/$"&&s!=="/&"||t++}e=e.previousSibling}return null}function Rp(e,t,s){switch(t=Nf(s),e){case"html":if(e=t.documentElement,!e)throw Error(l(452));return e;case"head":if(e=t.head,!e)throw Error(l(453));return e;case"body":if(e=t.body,!e)throw Error(l(454));return e;default:throw Error(l(451))}}function So(e){for(var t=e.attributes;t.length;)e.removeAttributeNode(t[0]);ll(e)}var Na=new Map,Ap=new Set;function _f(e){return typeof e.getRootNode=="function"?e.getRootNode():e.nodeType===9?e:e.ownerDocument}var qs=ce.d;ce.d={f:G1,r:X1,D:Q1,C:W1,L:K1,m:J1,X:eE,S:P1,M:tE};function G1(){var e=qs.f(),t=gf();return e||t}function X1(e){var t=Ze(e);t!==null&&t.tag===5&&t.type==="form"?Wg(t):qs.r(e)}var $l=typeof document>"u"?null:document;function kp(e,t,s){var r=$l;if(r&&typeof t=="string"&&t){var f=hn(t);f='link[rel="'+e+'"][href="'+f+'"]',typeof s=="string"&&(f+='[crossorigin="'+s+'"]'),Ap.has(f)||(Ap.add(f),e={rel:e,crossOrigin:s,href:t},r.querySelector(f)===null&&(t=r.createElement("link"),pn(t,"link",e),Qt(t),r.head.appendChild(t)))}}function Q1(e){qs.D(e),kp("dns-prefetch",e,null)}function W1(e,t){qs.C(e,t),kp("preconnect",e,t)}function K1(e,t,s){qs.L(e,t,s);var r=$l;if(r&&e&&t){var f='link[rel="preload"][as="'+hn(t)+'"]';t==="image"&&s&&s.imageSrcSet?(f+='[imagesrcset="'+hn(s.imageSrcSet)+'"]',typeof s.imageSizes=="string"&&(f+='[imagesizes="'+hn(s.imageSizes)+'"]')):f+='[href="'+hn(e)+'"]';var d=f;switch(t){case"style":d=Yl(e);break;case"script":d=Il(e)}Na.has(d)||(e=w({rel:"preload",href:t==="image"&&s&&s.imageSrcSet?void 0:e,as:t},s),Na.set(d,e),r.querySelector(f)!==null||t==="style"&&r.querySelector(xo(d))||t==="script"&&r.querySelector(Eo(d))||(t=r.createElement("link"),pn(t,"link",e),Qt(t),r.head.appendChild(t)))}}function J1(e,t){qs.m(e,t);var s=$l;if(s&&e){var r=t&&typeof t.as=="string"?t.as:"script",f='link[rel="modulepreload"][as="'+hn(r)+'"][href="'+hn(e)+'"]',d=f;switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":d=Il(e)}if(!Na.has(d)&&(e=w({rel:"modulepreload",href:e},t),Na.set(d,e),s.querySelector(f)===null)){switch(r){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(s.querySelector(Eo(d)))return}r=s.createElement("link"),pn(r,"link",e),Qt(r),s.head.appendChild(r)}}}function P1(e,t,s){qs.S(e,t,s);var r=$l;if(r&&e){var f=Ra(r).hoistableStyles,d=Yl(e);t=t||"default";var x=f.get(d);if(!x){var D={loading:0,preload:null};if(x=r.querySelector(xo(d)))D.loading=5;else{e=w({rel:"stylesheet",href:e,"data-precedence":t},s),(s=Na.get(d))&&hm(e,s);var L=x=r.createElement("link");Qt(L),pn(L,"link",e),L._p=new Promise(function(ne,fe){L.onload=ne,L.onerror=fe}),L.addEventListener("load",function(){D.loading|=1}),L.addEventListener("error",function(){D.loading|=2}),D.loading|=4,Of(x,t,r)}x={type:"stylesheet",instance:x,count:1,state:D},f.set(d,x)}}}function eE(e,t){qs.X(e,t);var s=$l;if(s&&e){var r=Ra(s).hoistableScripts,f=Il(e),d=r.get(f);d||(d=s.querySelector(Eo(f)),d||(e=w({src:e,async:!0},t),(t=Na.get(f))&&mm(e,t),d=s.createElement("script"),Qt(d),pn(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(f,d))}}function tE(e,t){qs.M(e,t);var s=$l;if(s&&e){var r=Ra(s).hoistableScripts,f=Il(e),d=r.get(f);d||(d=s.querySelector(Eo(f)),d||(e=w({src:e,async:!0,type:"module"},t),(t=Na.get(f))&&mm(e,t),d=s.createElement("script"),Qt(d),pn(d,"link",e),s.head.appendChild(d)),d={type:"script",instance:d,count:1,state:null},r.set(f,d))}}function Up(e,t,s,r){var f=(f=Le.current)?_f(f):null;if(!f)throw Error(l(446));switch(e){case"meta":case"title":return null;case"style":return typeof s.precedence=="string"&&typeof s.href=="string"?(t=Yl(s.href),s=Ra(f).hoistableStyles,r=s.get(t),r||(r={type:"style",instance:null,count:0,state:null},s.set(t,r)),r):{type:"void",instance:null,count:0,state:null};case"link":if(s.rel==="stylesheet"&&typeof s.href=="string"&&typeof s.precedence=="string"){e=Yl(s.href);var d=Ra(f).hoistableStyles,x=d.get(e);if(x||(f=f.ownerDocument||f,x={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},d.set(e,x),(d=f.querySelector(xo(e)))&&!d._p&&(x.instance=d,x.state.loading=5),Na.has(e)||(s={rel:"preload",as:"style",href:s.href,crossOrigin:s.crossOrigin,integrity:s.integrity,media:s.media,hrefLang:s.hrefLang,referrerPolicy:s.referrerPolicy},Na.set(e,s),d||nE(f,e,s,x.state))),t&&r===null)throw Error(l(528,""));return x}if(t&&r!==null)throw Error(l(529,""));return null;case"script":return t=s.async,s=s.src,typeof s=="string"&&t&&typeof t!="function"&&typeof t!="symbol"?(t=Il(s),s=Ra(f).hoistableScripts,r=s.get(t),r||(r={type:"script",instance:null,count:0,state:null},s.set(t,r)),r):{type:"void",instance:null,count:0,state:null};default:throw Error(l(444,e))}}function Yl(e){return'href="'+hn(e)+'"'}function xo(e){return'link[rel="stylesheet"]['+e+"]"}function zp(e){return w({},e,{"data-precedence":e.precedence,precedence:null})}function nE(e,t,s,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}),pn(t,"link",s),Qt(t),e.head.appendChild(t))}function Il(e){return'[src="'+hn(e)+'"]'}function Eo(e){return"script[async]"+e}function Lp(e,t,s){if(t.count++,t.instance===null)switch(t.type){case"style":var r=e.querySelector('style[data-href~="'+hn(s.href)+'"]');if(r)return t.instance=r,Qt(r),r;var f=w({},s,{"data-href":s.href,"data-precedence":s.precedence,href:null,precedence:null});return r=(e.ownerDocument||e).createElement("style"),Qt(r),pn(r,"style",f),Of(r,s.precedence,e),t.instance=r;case"stylesheet":f=Yl(s.href);var d=e.querySelector(xo(f));if(d)return t.state.loading|=4,t.instance=d,Qt(d),d;r=zp(s),(f=Na.get(f))&&hm(r,f),d=(e.ownerDocument||e).createElement("link"),Qt(d);var x=d;return x._p=new Promise(function(D,L){x.onload=D,x.onerror=L}),pn(d,"link",r),t.state.loading|=4,Of(d,s.precedence,e),t.instance=d;case"script":return d=Il(s.src),(f=e.querySelector(Eo(d)))?(t.instance=f,Qt(f),f):(r=s,(f=Na.get(d))&&(r=w({},s),mm(r,f)),e=e.ownerDocument||e,f=e.createElement("script"),Qt(f),pn(f,"link",r),e.head.appendChild(f),t.instance=f);case"void":return null;default:throw Error(l(443,t.type))}else t.type==="stylesheet"&&(t.state.loading&4)===0&&(r=t.instance,t.state.loading|=4,Of(r,s.precedence,e));return t.instance}function Of(e,t,s){for(var r=s.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),f=r.length?r[r.length-1]:null,d=f,x=0;x<r.length;x++){var D=r[x];if(D.dataset.precedence===t)d=D;else if(d!==f)break}d?d.parentNode.insertBefore(e,d.nextSibling):(t=s.nodeType===9?s.head:s,t.insertBefore(e,t.firstChild))}function hm(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.title==null&&(e.title=t.title)}function mm(e,t){e.crossOrigin==null&&(e.crossOrigin=t.crossOrigin),e.referrerPolicy==null&&(e.referrerPolicy=t.referrerPolicy),e.integrity==null&&(e.integrity=t.integrity)}var wf=null;function Hp(e,t,s){if(wf===null){var r=new Map,f=wf=new Map;f.set(s,r)}else f=wf,r=f.get(s),r||(r=new Map,f.set(s,r));if(r.has(e))return r;for(r.set(e,null),s=s.getElementsByTagName(e),f=0;f<s.length;f++){var d=s[f];if(!(d[ar]||d[qt]||e==="link"&&d.getAttribute("rel")==="stylesheet")&&d.namespaceURI!=="http://www.w3.org/2000/svg"){var x=d.getAttribute(t)||"";x=e+x;var D=r.get(x);D?D.push(d):r.set(x,[d])}}return r}function Vp(e,t,s){e=e.ownerDocument||e,e.head.insertBefore(s,t==="title"?e.querySelector("head > title"):null)}function aE(e,t,s){if(s===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 Fp(e){return!(e.type==="stylesheet"&&(e.state.loading&3)===0)}function sE(e,t,s,r){if(s.type==="stylesheet"&&(typeof r.media!="string"||matchMedia(r.media).matches!==!1)&&(s.state.loading&4)===0){if(s.instance===null){var f=Yl(r.href),d=t.querySelector(xo(f));if(d){t=d._p,t!==null&&typeof t=="object"&&typeof t.then=="function"&&(e.count++,e=Cf.bind(e),t.then(e,e)),s.state.loading|=4,s.instance=d,Qt(d);return}d=t.ownerDocument||t,r=zp(r),(f=Na.get(f))&&hm(r,f),d=d.createElement("link"),Qt(d);var x=d;x._p=new Promise(function(D,L){x.onload=D,x.onerror=L}),pn(d,"link",r),s.instance=d}e.stylesheets===null&&(e.stylesheets=new Map),e.stylesheets.set(s,t),(t=s.state.preload)&&(s.state.loading&3)===0&&(e.count++,s=Cf.bind(e),t.addEventListener("load",s),t.addEventListener("error",s))}}var ym=0;function iE(e,t){return e.stylesheets&&e.count===0&&Df(e,e.stylesheets),0<e.count||0<e.imgCount?function(s){var r=setTimeout(function(){if(e.stylesheets&&Df(e,e.stylesheets),e.unsuspend){var d=e.unsuspend;e.unsuspend=null,d()}},6e4+t);0<e.imgBytes&&ym===0&&(ym=62500*V1());var f=setTimeout(function(){if(e.waitingForImages=!1,e.count===0&&(e.stylesheets&&Df(e,e.stylesheets),e.unsuspend)){var d=e.unsuspend;e.unsuspend=null,d()}},(e.imgBytes>ym?50:800)+t);return e.unsuspend=s,function(){e.unsuspend=null,clearTimeout(r),clearTimeout(f)}}:null}function Cf(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)Df(this,this.stylesheets);else if(this.unsuspend){var e=this.unsuspend;this.unsuspend=null,e()}}}var Mf=null;function Df(e,t){e.stylesheets=null,e.unsuspend!==null&&(e.count++,Mf=new Map,t.forEach(rE,e),Mf=null,Cf.call(e))}function rE(e,t){if(!(t.state.loading&4)){var s=Mf.get(e);if(s)var r=s.get(null);else{s=new Map,Mf.set(e,s);for(var f=e.querySelectorAll("link[data-precedence],style[data-precedence]"),d=0;d<f.length;d++){var x=f[d];(x.nodeName==="LINK"||x.getAttribute("media")!=="not all")&&(s.set(x.dataset.precedence,x),r=x)}r&&s.set(null,r)}f=t.instance,x=f.getAttribute("data-precedence"),d=s.get(x)||r,d===r&&s.set(null,f),s.set(x,f),this.count++,r=Cf.bind(this),f.addEventListener("load",r),f.addEventListener("error",r),d?d.parentNode.insertBefore(f,d.nextSibling):(e=e.nodeType===9?e.head:e,e.insertBefore(f,e.firstChild)),t.state.loading|=4}}var To={$$typeof:H,Provider:null,Consumer:null,_currentValue:ye,_currentValue2:ye,_threadCount:0};function lE(e,t,s,r,f,d,x,D,L){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=sl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=sl(0),this.hiddenUpdates=sl(null),this.identifierPrefix=r,this.onUncaughtError=f,this.onCaughtError=d,this.onRecoverableError=x,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=L,this.incompleteTransitions=new Map}function qp(e,t,s,r,f,d,x,D,L,ne,fe,ge){return e=new lE(e,t,s,x,L,ne,fe,ge,D),t=1,d===!0&&(t|=24),d=yn(3,null,null,t),e.current=d,d.stateNode=e,t=Xd(),t.refCount++,e.pooledCache=t,t.refCount++,d.memoizedState={element:r,isDehydrated:s,cache:t},Jd(d),e}function Bp(e){return e?(e=Pn,e):Pn}function Zp(e,t,s,r,f,d){f=Bp(f),r.context===null?r.context=f:r.pendingContext=f,r=vi(t),r.payload={element:s},d=d===void 0?null:d,d!==null&&(r.callback=d),s=pi(e,r,t),s!==null&&(Bn(s,e,t),eo(s,e,t))}function $p(e,t){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var s=e.retryLane;e.retryLane=s!==0&&s<t?s:t}}function gm(e,t){$p(e,t),(e=e.alternate)&&$p(e,t)}function Yp(e){if(e.tag===13||e.tag===31){var t=ga(e,67108864);t!==null&&Bn(t,e,67108864),gm(e,67108864)}}function Ip(e){if(e.tag===13||e.tag===31){var t=sa();t=il(t);var s=ga(e,t);s!==null&&Bn(s,e,t),gm(e,t)}}var jf=!0;function uE(e,t,s,r){var f=X.T;X.T=null;var d=ce.p;try{ce.p=2,vm(e,t,s,r)}finally{ce.p=d,X.T=f}}function oE(e,t,s,r){var f=X.T;X.T=null;var d=ce.p;try{ce.p=8,vm(e,t,s,r)}finally{ce.p=d,X.T=f}}function vm(e,t,s,r){if(jf){var f=pm(r);if(f===null)am(e,t,r,Rf,s),Xp(e,r);else if(fE(f,e,t,s,r))r.stopPropagation();else if(Xp(e,r),t&4&&-1<cE.indexOf(e)){for(;f!==null;){var d=Ze(f);if(d!==null)switch(d.tag){case 3:if(d=d.stateNode,d.current.memoizedState.isDehydrated){var x=ln(d.pendingLanes);if(x!==0){var D=d;for(D.pendingLanes|=2,D.entangledLanes|=2;x;){var L=1<<31-Ee(x);D.entanglements[1]|=L,x&=~L}us(d),(gt&6)===0&&(mf=Xt()+500,vo(0))}}break;case 31:case 13:D=ga(d,2),D!==null&&Bn(D,d,2),gf(),gm(d,2)}if(d=pm(r),d===null&&am(e,t,r,Rf,s),d===f)break;f=d}f!==null&&r.stopPropagation()}else am(e,t,r,null,s)}}function pm(e){return e=dl(e),bm(e)}var Rf=null;function bm(e){if(Rf=null,e=Ss(e),e!==null){var t=o(e);if(t===null)e=null;else{var s=t.tag;if(s===13){if(e=m(t),e!==null)return e;e=null}else if(s===31){if(e=g(t),e!==null)return e;e=null}else if(s===3){if(t.stateNode.current.memoizedState.isDehydrated)return t.tag===3?t.stateNode.containerInfo:null;e=null}else t!==e&&(e=null)}}return Rf=e,null}function Gp(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(Pa()){case Js:return 2;case tr:return 8;case Kn:case vs:return 32;case A:return 268435456;default:return 32}default:return 32}}var Sm=!1,Mi=null,Di=null,ji=null,No=new Map,_o=new Map,Ri=[],cE="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 Xp(e,t){switch(e){case"focusin":case"focusout":Mi=null;break;case"dragenter":case"dragleave":Di=null;break;case"mouseover":case"mouseout":ji=null;break;case"pointerover":case"pointerout":No.delete(t.pointerId);break;case"gotpointercapture":case"lostpointercapture":_o.delete(t.pointerId)}}function Oo(e,t,s,r,f,d){return e===null||e.nativeEvent!==d?(e={blockedOn:t,domEventName:s,eventSystemFlags:r,nativeEvent:d,targetContainers:[f]},t!==null&&(t=Ze(t),t!==null&&Yp(t)),e):(e.eventSystemFlags|=r,t=e.targetContainers,f!==null&&t.indexOf(f)===-1&&t.push(f),e)}function fE(e,t,s,r,f){switch(t){case"focusin":return Mi=Oo(Mi,e,t,s,r,f),!0;case"dragenter":return Di=Oo(Di,e,t,s,r,f),!0;case"mouseover":return ji=Oo(ji,e,t,s,r,f),!0;case"pointerover":var d=f.pointerId;return No.set(d,Oo(No.get(d)||null,e,t,s,r,f)),!0;case"gotpointercapture":return d=f.pointerId,_o.set(d,Oo(_o.get(d)||null,e,t,s,r,f)),!0}return!1}function Qp(e){var t=Ss(e.target);if(t!==null){var s=o(t);if(s!==null){if(t=s.tag,t===13){if(t=m(s),t!==null){e.blockedOn=t,wu(e.priority,function(){Ip(s)});return}}else if(t===31){if(t=g(s),t!==null){e.blockedOn=t,wu(e.priority,function(){Ip(s)});return}}else if(t===3&&s.stateNode.current.memoizedState.isDehydrated){e.blockedOn=s.tag===3?s.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Af(e){if(e.blockedOn!==null)return!1;for(var t=e.targetContainers;0<t.length;){var s=pm(e.nativeEvent);if(s===null){s=e.nativeEvent;var r=new s.constructor(s.type,s);Ru=r,s.target.dispatchEvent(r),Ru=null}else return t=Ze(s),t!==null&&Yp(t),e.blockedOn=s,!1;t.shift()}return!0}function Wp(e,t,s){Af(e)&&s.delete(t)}function dE(){Sm=!1,Mi!==null&&Af(Mi)&&(Mi=null),Di!==null&&Af(Di)&&(Di=null),ji!==null&&Af(ji)&&(ji=null),No.forEach(Wp),_o.forEach(Wp)}function kf(e,t){e.blockedOn===t&&(e.blockedOn=null,Sm||(Sm=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,dE)))}var Uf=null;function Kp(e){Uf!==e&&(Uf=e,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){Uf===e&&(Uf=null);for(var t=0;t<e.length;t+=3){var s=e[t],r=e[t+1],f=e[t+2];if(typeof r!="function"){if(bm(r||s)===null)continue;break}var d=Ze(s);d!==null&&(e.splice(t,3),t-=3,ph(d,{pending:!0,data:f,method:s.method,action:r},r,f))}}))}function Gl(e){function t(L){return kf(L,e)}Mi!==null&&kf(Mi,e),Di!==null&&kf(Di,e),ji!==null&&kf(ji,e),No.forEach(t),_o.forEach(t);for(var s=0;s<Ri.length;s++){var r=Ri[s];r.blockedOn===e&&(r.blockedOn=null)}for(;0<Ri.length&&(s=Ri[0],s.blockedOn===null);)Qp(s),s.blockedOn===null&&Ri.shift();if(s=(e.ownerDocument||e).$$reactFormReplay,s!=null)for(r=0;r<s.length;r+=3){var f=s[r],d=s[r+1],x=f[tn]||null;if(typeof d=="function")x||Kp(s);else if(x){var D=null;if(d&&d.hasAttribute("formAction")){if(f=d,x=d[tn]||null)D=x.formAction;else if(bm(f)!==null)continue}else D=x.action;typeof D=="function"?s[r+1]=D:(s.splice(r,3),r-=3),Kp(s)}}}function Jp(){function e(d){d.canIntercept&&d.info==="react-transition"&&d.intercept({handler:function(){return new Promise(function(x){return f=x})},focusReset:"manual",scroll:"manual"})}function t(){f!==null&&(f(),f=null),r||setTimeout(s,20)}function s(){if(!r&&!navigation.transition){var d=navigation.currentEntry;d&&d.url!=null&&navigation.navigate(d.url,{state:d.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var r=!1,f=null;return navigation.addEventListener("navigate",e),navigation.addEventListener("navigatesuccess",t),navigation.addEventListener("navigateerror",t),setTimeout(s,100),function(){r=!0,navigation.removeEventListener("navigate",e),navigation.removeEventListener("navigatesuccess",t),navigation.removeEventListener("navigateerror",t),f!==null&&(f(),f=null)}}}function xm(e){this._internalRoot=e}zf.prototype.render=xm.prototype.render=function(e){var t=this._internalRoot;if(t===null)throw Error(l(409));var s=t.current,r=sa();Zp(s,r,e,t,null,null)},zf.prototype.unmount=xm.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var t=e.containerInfo;Zp(e.current,2,null,e,null,null),gf(),t[bs]=null}};function zf(e){this._internalRoot=e}zf.prototype.unstable_scheduleHydration=function(e){if(e){var t=rl();e={blockedOn:null,target:e,priority:t};for(var s=0;s<Ri.length&&t!==0&&t<Ri[s].priority;s++);Ri.splice(s,0,e),s===0&&Qp(e)}};var Pp=a.version;if(Pp!=="19.2.7")throw Error(l(527,Pp,"19.2.7"));ce.findDOMNode=function(e){var t=e._reactInternals;if(t===void 0)throw typeof e.render=="function"?Error(l(188)):(e=Object.keys(e).join(","),Error(l(268,e)));return e=y(t),e=e!==null?_(e):null,e=e===null?null:e.stateNode,e};var hE={bundleType:0,version:"19.2.7",rendererPackageName:"react-dom",currentDispatcherRef:X,reconcilerVersion:"19.2.7"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var Lf=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!Lf.isDisabled&&Lf.supportsFiber)try{he=Lf.inject(hE),ve=Lf}catch{}}return Co.createRoot=function(e,t){if(!u(e))throw Error(l(299));var s=!1,r="",f=rv,d=lv,x=uv;return t!=null&&(t.unstable_strictMode===!0&&(s=!0),t.identifierPrefix!==void 0&&(r=t.identifierPrefix),t.onUncaughtError!==void 0&&(f=t.onUncaughtError),t.onCaughtError!==void 0&&(d=t.onCaughtError),t.onRecoverableError!==void 0&&(x=t.onRecoverableError)),t=qp(e,1,!1,null,null,s,r,null,f,d,x,Jp),e[bs]=t.current,nm(e),new xm(t)},Co.hydrateRoot=function(e,t,s){if(!u(e))throw Error(l(299));var r=!1,f="",d=rv,x=lv,D=uv,L=null;return s!=null&&(s.unstable_strictMode===!0&&(r=!0),s.identifierPrefix!==void 0&&(f=s.identifierPrefix),s.onUncaughtError!==void 0&&(d=s.onUncaughtError),s.onCaughtError!==void 0&&(x=s.onCaughtError),s.onRecoverableError!==void 0&&(D=s.onRecoverableError),s.formState!==void 0&&(L=s.formState)),t=qp(e,1,!0,t,s??null,r,f,L,d,x,D,Jp),t.context=Bp(null),s=t.current,r=sa(),r=il(r),f=vi(r),f.callback=null,pi(s,f,r),s=r,t.current.lanes=s,ei(t,s),us(t),e[bs]=t.current,nm(e),new zf(t)},Co.version="19.2.7",Co}var f0;function wE(){if(f0)return _m.exports;f0=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(a){console.error(a)}}return n(),_m.exports=OE(),_m.exports}var CE=wE();/**
 * react-router v7.18.1
 *
 * Copyright (c) Remix Software Inc.
 *
 * This source code is licensed under the MIT license found in the
 * LICENSE.md file in the root directory of this source tree.
 *
 * @license MIT
 */var Dy=/^(?:[a-z][a-z0-9+.-]*:|[\\/]{2})/i,Wb=/^[\\/]{2}/;function ME(n,a){return a+n.replace(/\\/g,"/")}var d0="popstate";function h0(n){return typeof n=="object"&&n!=null&&"pathname"in n&&"search"in n&&"hash"in n&&"state"in n&&"key"in n}function DE(n={}){function a(l,u){var y;let o=(y=u.state)==null?void 0:y.masked,{pathname:m,search:g,hash:b}=o||l.location;return Im("",{pathname:m,search:g,hash:b},u.state&&u.state.usr||null,u.state&&u.state.key||"default",o?{pathname:l.location.pathname,search:l.location.search,hash:l.location.hash}:void 0)}function i(l,u){return typeof u=="string"?u:Zo(u)}return RE(a,i,null,n)}function At(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function wa(n,a){if(!n){typeof console<"u"&&console.warn(a);try{throw new Error(a)}catch{}}}function jE(){return Math.random().toString(36).substring(2,10)}function m0(n,a){return{usr:n.state,key:n.key,idx:a,masked:n.mask?{pathname:n.pathname,search:n.search,hash:n.hash}:void 0}}function Im(n,a,i=null,l,u){return{pathname:typeof n=="string"?n:n.pathname,search:"",hash:"",...typeof a=="string"?bu(a):a,state:i,key:a&&a.key||l||jE(),mask:u}}function Zo({pathname:n="/",search:a="",hash:i=""}){return a&&a!=="?"&&(n+=a.charAt(0)==="?"?a:"?"+a),i&&i!=="#"&&(n+=i.charAt(0)==="#"?i:"#"+i),n}function bu(n){let a={};if(n){let i=n.indexOf("#");i>=0&&(a.hash=n.substring(i),n=n.substring(0,i));let l=n.indexOf("?");l>=0&&(a.search=n.substring(l),n=n.substring(0,l)),n&&(a.pathname=n)}return a}function RE(n,a,i,l={}){let{window:u=document.defaultView,v5Compat:o=!1}=l,m=u.history,g="POP",b=null,y=_();y==null&&(y=0,m.replaceState({...m.state,idx:y},""));function _(){return(m.state||{idx:null}).idx}function w(){g="POP";let j=_(),R=j==null?null:j-y;y=j,b&&b({action:g,location:O.location,delta:R})}function T(j,R){g="PUSH";let k=h0(j)?j:Im(O.location,j,R);y=_()+1;let H=m0(k,y),F=O.createHref(k.mask||k);try{m.pushState(H,"",F)}catch(J){if(J instanceof DOMException&&J.name==="DataCloneError")throw J;u.location.assign(F)}o&&b&&b({action:g,location:O.location,delta:1})}function S(j,R){g="REPLACE";let k=h0(j)?j:Im(O.location,j,R);y=_();let H=m0(k,y),F=O.createHref(k.mask||k);m.replaceState(H,"",F),o&&b&&b({action:g,location:O.location,delta:0})}function N(j){return AE(u,j)}let O={get action(){return g},get location(){return n(u,m)},listen(j){if(b)throw new Error("A history only accepts one active listener");return u.addEventListener(d0,w),b=j,()=>{u.removeEventListener(d0,w),b=null}},createHref(j){return a(u,j)},createURL:N,encodeLocation(j){let R=N(j);return{pathname:R.pathname,search:R.search,hash:R.hash}},push:T,replace:S,go(j){return m.go(j)}};return O}function AE(n,a,i=!1){let l="http://localhost";n&&(l=n.location.origin!=="null"?n.location.origin:n.location.href),At(l,"No window.location.(origin|href) available to create URL");let u=typeof a=="string"?a:Zo(a);return u=u.replace(/ $/,"%20"),!i&&Wb.test(u)&&(u=l+u),new URL(u,l)}function Kb(n,a,i="/"){return kE(n,a,i,!1)}function kE(n,a,i,l,u){let o=typeof a=="string"?bu(a):a,m=Qs(o.pathname||"/",i);if(m==null)return null;let g=UE(n),b=null,y=IE(m);for(let _=0;b==null&&_<g.length;++_)b=YE(g[_],y,l);return b}function UE(n){let a=Jb(n);return zE(a),a}function Jb(n,a=[],i=[],l="",u=!1){let o=(m,g,b=u,y)=>{let _={relativePath:y===void 0?m.path||"":y,caseSensitive:m.caseSensitive===!0,childrenIndex:g,route:m};if(_.relativePath.startsWith("/")){if(!_.relativePath.startsWith(l)&&b)return;At(_.relativePath.startsWith(l),`Absolute route path "${_.relativePath}" nested under path "${l}" is not valid. An absolute child route path must start with the combined path of all its parent routes.`),_.relativePath=_.relativePath.slice(l.length)}let w=Ga([l,_.relativePath]),T=i.concat(_);m.children&&m.children.length>0&&(At(m.index!==!0,`Index routes must not have child routes. Please remove all child routes from route path "${w}".`),Jb(m.children,a,T,w,b)),!(m.path==null&&!m.index)&&a.push({path:w,score:ZE(w,m.index),routesMeta:T.map((S,N)=>{let[O,j]=tS(S.relativePath,S.caseSensitive,N===T.length-1);return{...S,matcher:O,compiledParams:j}})})};return n.forEach((m,g)=>{var b;if(m.path===""||!((b=m.path)!=null&&b.includes("?")))o(m,g);else for(let y of Pb(m.path))o(m,g,!0,y)}),a}function Pb(n){let a=n.split("/");if(a.length===0)return[];let[i,...l]=a,u=i.endsWith("?"),o=i.replace(/\?$/,"");if(l.length===0)return u?[o,""]:[o];let m=Pb(l.join("/")),g=[];return g.push(...m.map(b=>b===""?o:[o,b].join("/"))),u&&g.push(...m),g.map(b=>n.startsWith("/")&&b===""?"/":b)}function zE(n){n.sort((a,i)=>a.score!==i.score?i.score-a.score:$E(a.routesMeta.map(l=>l.childrenIndex),i.routesMeta.map(l=>l.childrenIndex)))}var LE=/^:[\w-]+$/,HE=3,VE=2,FE=1,qE=10,BE=-2,y0=n=>n==="*";function ZE(n,a){let i=n.split("/"),l=i.length;return i.some(y0)&&(l+=BE),a&&(l+=VE),i.filter(u=>!y0(u)).reduce((u,o)=>u+(LE.test(o)?HE:o===""?FE:qE),l)}function $E(n,a){return n.length===a.length&&n.slice(0,-1).every((l,u)=>l===a[u])?n[n.length-1]-a[a.length-1]:0}function YE(n,a,i=!1){let{routesMeta:l}=n,u={},o="/",m=[];for(let g=0;g<l.length;++g){let b=l[g],y=g===l.length-1,_=o==="/"?a:a.slice(o.length)||"/",w={path:b.relativePath,caseSensitive:b.caseSensitive,end:y},T=b.matcher&&b.compiledParams?eS(w,_,b.matcher,b.compiledParams):Wf(w,_),S=b.route;if(!T&&y&&i&&!l[l.length-1].route.index&&(T=Wf({path:b.relativePath,caseSensitive:b.caseSensitive,end:!1},_)),!T)return null;Object.assign(u,T.params),m.push({params:u,pathname:Ga([o,T.pathname]),pathnameBase:QE(Ga([o,T.pathnameBase])),route:S}),T.pathnameBase!=="/"&&(o=Ga([o,T.pathnameBase]))}return m}function Wf(n,a){typeof n=="string"&&(n={path:n,caseSensitive:!1,end:!0});let[i,l]=tS(n.path,n.caseSensitive,n.end);return eS(n,a,i,l)}function eS(n,a,i,l){let u=a.match(i);if(!u)return null;let o=u[0],m=o.replace(/(.)\/+$/,"$1"),g=u.slice(1);return{params:l.reduce((y,{paramName:_,isOptional:w},T)=>{if(_==="*"){let N=g[T]||"";m=o.slice(0,o.length-N.length).replace(/(.)\/+$/,"$1")}const S=g[T];return w&&!S?y[_]=void 0:y[_]=(S||"").replace(/%2F/g,"/"),y},{}),pathname:o,pathnameBase:m,pattern:n}}function tS(n,a=!1,i=!0){wa(n==="*"||!n.endsWith("*")||n.endsWith("/*"),`Route path "${n}" will be treated as if it were "${n.replace(/\*$/,"/*")}" because the \`*\` character must always follow a \`/\` in the pattern. To get rid of this warning, please change the route path to "${n.replace(/\*$/,"/*")}".`);let l=[],u="^"+n.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(m,g,b,y,_)=>{if(l.push({paramName:g,isOptional:b!=null}),b){let w=_.charAt(y+m.length);return w&&w!=="/"?"/([^\\/]*)":"(?:/([^\\/]*))?"}return"/([^\\/]+)"}).replace(/\/([\w-]+)\?(\/|$)/g,"(/$1)?$2");return n.endsWith("*")?(l.push({paramName:"*"}),u+=n==="*"||n==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):i?u+="\\/*$":n!==""&&n!=="/"&&(u+="(?:(?=\\/|$))"),[new RegExp(u,a?void 0:"i"),l]}function IE(n){try{return n.split("/").map(a=>decodeURIComponent(a).replace(/\//g,"%2F")).join("/")}catch(a){return wa(!1,`The URL path "${n}" could not be decoded because it is a malformed URL segment. This is probably due to a bad percent encoding (${a}).`),n}}function Qs(n,a){if(a==="/")return n;if(!n.toLowerCase().startsWith(a.toLowerCase()))return null;let i=a.endsWith("/")?a.length-1:a.length,l=n.charAt(i);return l&&l!=="/"?null:n.slice(i)||"/"}function GE(n,a="/"){let{pathname:i,search:l="",hash:u=""}=typeof n=="string"?bu(n):n,o;return i?(i=nS(i),i.startsWith("/")?o=g0(i.substring(1),"/"):o=g0(i,a)):o=a,{pathname:o,search:WE(l),hash:KE(u)}}function g0(n,a){let i=Kf(a).split("/");return n.split("/").forEach(u=>{u===".."?i.length>1&&i.pop():u!=="."&&i.push(u)}),i.length>1?i.join("/"):"/"}function Mm(n,a,i,l){return`Cannot include a '${n}' character in a manually specified \`to.${a}\` field [${JSON.stringify(l)}].  Please separate it out to the \`to.${i}\` field. Alternatively you may provide the full path as a string in <Link to="..."> and the router will parse it for you.`}function XE(n){return n.filter((a,i)=>i===0||a.route.path&&a.route.path.length>0)}function jy(n){let a=XE(n);return a.map((i,l)=>l===a.length-1?i.pathname:i.pathnameBase)}function cd(n,a,i,l=!1){let u;typeof n=="string"?u=bu(n):(u={...n},At(!u.pathname||!u.pathname.includes("?"),Mm("?","pathname","search",u)),At(!u.pathname||!u.pathname.includes("#"),Mm("#","pathname","hash",u)),At(!u.search||!u.search.includes("#"),Mm("#","search","hash",u)));let o=n===""||u.pathname==="",m=o?"/":u.pathname,g;if(m==null)g=i;else{let w=a.length-1;if(!l&&m.startsWith("..")){let T=m.split("/");for(;T[0]==="..";)T.shift(),w-=1;u.pathname=T.join("/")}g=w>=0?a[w]:"/"}let b=GE(u,g),y=m&&m!=="/"&&m.endsWith("/"),_=(o||m===".")&&i.endsWith("/");return!b.pathname.endsWith("/")&&(y||_)&&(b.pathname+="/"),b}var nS=n=>n.replace(/[\\/]{2,}/g,"/"),Ga=n=>nS(n.join("/")),Kf=n=>n.replace(/\/+$/,""),QE=n=>Kf(n).replace(/^\/*/,"/"),WE=n=>!n||n==="?"?"":n.startsWith("?")?n:"?"+n,KE=n=>!n||n==="#"?"":n.startsWith("#")?n:"#"+n,JE=class{constructor(n,a,i,l=!1){this.status=n,this.statusText=a||"",this.internal=l,i instanceof Error?(this.data=i.toString(),this.error=i):this.data=i}};function PE(n){return n!=null&&typeof n.status=="number"&&typeof n.statusText=="string"&&typeof n.internal=="boolean"&&"data"in n}function eT(n){let a=n.map(i=>i.route.path).filter(Boolean);return Ga(a)||"/"}var aS=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";function sS(n,a){let i=n;if(typeof i!="string"||!Dy.test(i))return{absoluteURL:void 0,isExternal:!1,to:i};let l=i,u=!1;if(aS)try{let o=new URL(window.location.href),m=Wb.test(i)?new URL(ME(i,o.protocol)):new URL(i),g=Qs(m.pathname,a);m.origin===o.origin&&g!=null?i=g+m.search+m.hash:u=!0}catch{wa(!1,`<Link to="${i}"> contains an invalid URL which will probably break when clicked - please update to a valid URL path.`)}return{absoluteURL:l,isExternal:u,to:i}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");var iS=["POST","PUT","PATCH","DELETE"];new Set(iS);var tT=["GET",...iS];new Set(tT);var nT=["about:","blob:","chrome:","chrome-untrusted:","content:","data:","devtools:","file:","filesystem:","javascript:"];function aT(n){try{return nT.includes(new URL(n).protocol)}catch{return!1}}var Su=z.createContext(null);Su.displayName="DataRouter";var fd=z.createContext(null);fd.displayName="DataRouterState";var rS=z.createContext(!1);function sT(){return z.useContext(rS)}var lS=z.createContext({isTransitioning:!1});lS.displayName="ViewTransition";var iT=z.createContext(new Map);iT.displayName="Fetchers";var rT=z.createContext(null);rT.displayName="Await";var ca=z.createContext(null);ca.displayName="Navigation";var tc=z.createContext(null);tc.displayName="Location";var Xa=z.createContext({outlet:null,matches:[],isDataRoute:!1});Xa.displayName="Route";var Ry=z.createContext(null);Ry.displayName="RouteError";var uS="REACT_ROUTER_ERROR",lT="REDIRECT",uT="ROUTE_ERROR_RESPONSE";function oT(n){if(n.startsWith(`${uS}:${lT}:{`))try{let a=JSON.parse(n.slice(28));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string"&&typeof a.location=="string"&&typeof a.reloadDocument=="boolean"&&typeof a.replace=="boolean")return a}catch{}}function cT(n){if(n.startsWith(`${uS}:${uT}:{`))try{let a=JSON.parse(n.slice(40));if(typeof a=="object"&&a&&typeof a.status=="number"&&typeof a.statusText=="string")return new JE(a.status,a.statusText,a.data)}catch{}}function fT(n,{relative:a}={}){At(xu(),"useHref() may be used only in the context of a <Router> component.");let{basename:i,navigator:l}=z.useContext(ca),{hash:u,pathname:o,search:m}=nc(n,{relative:a}),g=o;return i!=="/"&&(g=o==="/"?i:Ga([i,o])),l.createHref({pathname:g,search:m,hash:u})}function xu(){return z.useContext(tc)!=null}function Qa(){return At(xu(),"useLocation() may be used only in the context of a <Router> component."),z.useContext(tc).location}var oS="You should call navigate() in a React.useEffect(), not when your component is first rendered.";function cS(n){z.useContext(ca).static||z.useLayoutEffect(n)}function dd(){let{isDataRoute:n}=z.useContext(Xa);return n?OT():dT()}function dT(){At(xu(),"useNavigate() may be used only in the context of a <Router> component.");let n=z.useContext(Su),{basename:a,navigator:i}=z.useContext(ca),{matches:l}=z.useContext(Xa),{pathname:u}=Qa(),o=JSON.stringify(jy(l)),m=z.useRef(!1);return cS(()=>{m.current=!0}),z.useCallback((b,y={})=>{if(wa(m.current,oS),!m.current)return;if(typeof b=="number"){i.go(b);return}let _=cd(b,JSON.parse(o),u,y.relative==="path");n==null&&a!=="/"&&(_.pathname=_.pathname==="/"?a:Ga([a,_.pathname])),(y.replace?i.replace:i.push)(_,y.state,y)},[a,i,o,u,n])}var hT=z.createContext(null);function mT(n){let a=z.useContext(Xa).outlet;return z.useMemo(()=>a&&z.createElement(hT.Provider,{value:n},a),[a,n])}function nc(n,{relative:a}={}){let{matches:i}=z.useContext(Xa),{pathname:l}=Qa(),u=JSON.stringify(jy(i));return z.useMemo(()=>cd(n,JSON.parse(u),l,a==="path"),[n,u,l,a])}function yT(n,a){return fS(n,a)}function fS(n,a,i){var j;At(xu(),"useRoutes() may be used only in the context of a <Router> component.");let{navigator:l}=z.useContext(ca),{matches:u}=z.useContext(Xa),o=u[u.length-1],m=o?o.params:{},g=o?o.pathname:"/",b=o?o.pathnameBase:"/",y=o&&o.route;{let R=y&&y.path||"";hS(g,!y||R.endsWith("*")||R.endsWith("*?"),`You rendered descendant <Routes> (or called \`useRoutes()\`) at "${g}" (under <Route path="${R}">) 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="${R}"> to <Route path="${R==="/"?"*":`${R}/*`}">.`)}let _=Qa(),w;if(a){let R=typeof a=="string"?bu(a):a;At(b==="/"||((j=R.pathname)==null?void 0:j.startsWith(b)),`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 "${b}" but pathname "${R.pathname}" was given in the \`location\` prop.`),w=R}else w=_;let T=w.pathname||"/",S=T;if(b!=="/"){let R=b.replace(/^\//,"").split("/");S="/"+T.replace(/^\//,"").split("/").slice(R.length).join("/")}let N=i&&i.state.matches.length?i.state.matches.map(R=>Object.assign(R,{route:i.manifest[R.route.id]||R.route})):Kb(n,{pathname:S});wa(y||N!=null,`No routes matched location "${w.pathname}${w.search}${w.hash}" `),wa(N==null||N[N.length-1].route.element!==void 0||N[N.length-1].route.Component!==void 0||N[N.length-1].route.lazy!==void 0,`Matched leaf route at location "${w.pathname}${w.search}${w.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 O=ST(N&&N.map(R=>Object.assign({},R,{params:Object.assign({},m,R.params),pathname:Ga([b,l.encodeLocation?l.encodeLocation(R.pathname.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathname]),pathnameBase:R.pathnameBase==="/"?b:Ga([b,l.encodeLocation?l.encodeLocation(R.pathnameBase.replace(/%/g,"%25").replace(/\?/g,"%3F").replace(/#/g,"%23")).pathname:R.pathnameBase])})),u,i);return a&&O?z.createElement(tc.Provider,{value:{location:{pathname:"/",search:"",hash:"",state:null,key:"default",mask:void 0,...w},navigationType:"POP"}},O):O}function gT(){let n=_T(),a=PE(n)?`${n.status} ${n.statusText}`:n instanceof Error?n.message:JSON.stringify(n),i=n instanceof Error?n.stack:null,l="rgba(200,200,200, 0.5)",u={padding:"0.5rem",backgroundColor:l},o={padding:"2px 4px",backgroundColor:l},m=null;return console.error("Error handled by React Router default ErrorBoundary:",n),m=z.createElement(z.Fragment,null,z.createElement("p",null,"💿 Hey developer 👋"),z.createElement("p",null,"You can provide a way better UX than this when your app throws errors by providing your own ",z.createElement("code",{style:o},"ErrorBoundary")," or"," ",z.createElement("code",{style:o},"errorElement")," prop on your route.")),z.createElement(z.Fragment,null,z.createElement("h2",null,"Unexpected Application Error!"),z.createElement("h3",{style:{fontStyle:"italic"}},a),i?z.createElement("pre",{style:u},i):null,m)}var vT=z.createElement(gT,null),dS=class extends z.Component{constructor(n){super(n),this.state={location:n.location,revalidation:n.revalidation,error:n.error}}static getDerivedStateFromError(n){return{error:n}}static getDerivedStateFromProps(n,a){return a.location!==n.location||a.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:a.error,location:a.location,revalidation:n.revalidation||a.revalidation}}componentDidCatch(n,a){this.props.onError?this.props.onError(n,a):console.error("React Router caught the following error during render",n)}render(){let n=this.state.error;if(this.context&&typeof n=="object"&&n&&"digest"in n&&typeof n.digest=="string"){const i=cT(n.digest);i&&(n=i)}let a=n!==void 0?z.createElement(Xa.Provider,{value:this.props.routeContext},z.createElement(Ry.Provider,{value:n,children:this.props.component})):this.props.children;return this.context?z.createElement(pT,{error:n},a):a}};dS.contextType=rS;var Dm=new WeakMap;function pT({children:n,error:a}){let{basename:i}=z.useContext(ca);if(typeof a=="object"&&a&&"digest"in a&&typeof a.digest=="string"){let l=oT(a.digest);if(l){let u=Dm.get(a);if(u)throw u;let o=sS(l.location,i),m=o.absoluteURL||o.to;if(aT(m))throw new Error("Invalid redirect location");if(aS&&!Dm.get(a))if(o.isExternal||l.reloadDocument)window.location.href=m;else{const g=Promise.resolve().then(()=>window.__reactRouterDataRouter.navigate(o.to,{replace:l.replace}));throw Dm.set(a,g),g}return z.createElement("meta",{httpEquiv:"refresh",content:`0;url=${m}`})}}return n}function bT({routeContext:n,match:a,children:i}){let l=z.useContext(Su);return l&&l.static&&l.staticContext&&(a.route.errorElement||a.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=a.route.id),z.createElement(Xa.Provider,{value:n},i)}function ST(n,a=[],i){let l=i==null?void 0:i.state;if(n==null){if(!l)return null;if(l.errors)n=l.matches;else if(a.length===0&&!l.initialized&&l.matches.length>0)n=l.matches;else return null}let u=n,o=l==null?void 0:l.errors;if(o!=null){let _=u.findIndex(w=>w.route.id&&(o==null?void 0:o[w.route.id])!==void 0);At(_>=0,`Could not find a matching route for errors on route IDs: ${Object.keys(o).join(",")}`),u=u.slice(0,Math.min(u.length,_+1))}let m=!1,g=-1;if(i&&l){m=l.renderFallback;for(let _=0;_<u.length;_++){let w=u[_];if((w.route.HydrateFallback||w.route.hydrateFallbackElement)&&(g=_),w.route.id){let{loaderData:T,errors:S}=l,N=w.route.loader&&!T.hasOwnProperty(w.route.id)&&(!S||S[w.route.id]===void 0);if(w.route.lazy||N){i.isStatic&&(m=!0),g>=0?u=u.slice(0,g+1):u=[u[0]];break}}}}let b=i==null?void 0:i.onError,y=l&&b?(_,w)=>{var T,S;b(_,{location:l.location,params:((S=(T=l.matches)==null?void 0:T[0])==null?void 0:S.params)??{},pattern:eT(l.matches),errorInfo:w})}:void 0;return u.reduceRight((_,w,T)=>{let S,N=!1,O=null,j=null;l&&(S=o&&w.route.id?o[w.route.id]:void 0,O=w.route.errorElement||vT,m&&(g<0&&T===0?(hS("route-fallback",!1,"No `HydrateFallback` element provided to render during initial hydration"),N=!0,j=null):g===T&&(N=!0,j=w.route.hydrateFallbackElement||null)));let R=a.concat(u.slice(0,T+1)),k=()=>{let H;return S?H=O:N?H=j:w.route.Component?H=z.createElement(w.route.Component,null):w.route.element?H=w.route.element:H=_,z.createElement(bT,{match:w,routeContext:{outlet:_,matches:R,isDataRoute:l!=null},children:H})};return l&&(w.route.ErrorBoundary||w.route.errorElement||T===0)?z.createElement(dS,{location:l.location,revalidation:l.revalidation,component:O,error:S,children:k(),routeContext:{outlet:null,matches:R,isDataRoute:!0},onError:y}):k()},null)}function Ay(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function xT(n){let a=z.useContext(Su);return At(a,Ay(n)),a}function ET(n){let a=z.useContext(fd);return At(a,Ay(n)),a}function TT(n){let a=z.useContext(Xa);return At(a,Ay(n)),a}function ky(n){let a=TT(n),i=a.matches[a.matches.length-1];return At(i.route.id,`${n} can only be used on routes that contain a unique "id"`),i.route.id}function NT(){return ky("useRouteId")}function _T(){var l;let n=z.useContext(Ry),a=ET("useRouteError"),i=ky("useRouteError");return n!==void 0?n:(l=a.errors)==null?void 0:l[i]}function OT(){let{router:n}=xT("useNavigate"),a=ky("useNavigate"),i=z.useRef(!1);return cS(()=>{i.current=!0}),z.useCallback(async(u,o={})=>{wa(i.current,oS),i.current&&(typeof u=="number"?await n.navigate(u):await n.navigate(u,{fromRouteId:a,...o}))},[n,a])}var v0={};function hS(n,a,i){!a&&!v0[n]&&(v0[n]=!0,wa(!1,i))}z.memo(wT);function wT({routes:n,manifest:a,future:i,state:l,isStatic:u,onError:o}){return fS(n,void 0,{manifest:a,state:l,isStatic:u,onError:o})}function CT({to:n,replace:a,state:i,relative:l}){At(xu(),"<Navigate> may be used only in the context of a <Router> component.");let{static:u}=z.useContext(ca);wa(!u,"<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:o}=z.useContext(Xa),{pathname:m}=Qa(),g=dd(),b=cd(n,jy(o),m,l==="path"),y=JSON.stringify(b);return z.useEffect(()=>{g(JSON.parse(y),{replace:a,state:i,relative:l})},[g,y,l,a,i]),null}function MT(n){return mT(n.context)}function ki(n){At(!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 DT({basename:n="/",children:a=null,location:i,navigationType:l="POP",navigator:u,static:o=!1,useTransitions:m}){At(!xu(),"You cannot render a <Router> inside another <Router>. You should never have more than one in your app.");let g=n.replace(/^\/*/,"/"),b=z.useMemo(()=>({basename:g,navigator:u,static:o,useTransitions:m,future:{}}),[g,u,o,m]);typeof i=="string"&&(i=bu(i));let{pathname:y="/",search:_="",hash:w="",state:T=null,key:S="default",mask:N}=i,O=z.useMemo(()=>{let j=Qs(y,g);return j==null?null:{location:{pathname:j,search:_,hash:w,state:T,key:S,mask:N},navigationType:l}},[g,y,_,w,T,S,l,N]);return wa(O!=null,`<Router basename="${g}"> is not able to match the URL "${y}${_}${w}" because it does not start with the basename, so the <Router> won't render anything.`),O==null?null:z.createElement(ca.Provider,{value:b},z.createElement(tc.Provider,{children:a,value:O}))}function jT({children:n,location:a}){return yT(Gm(n),a)}function Gm(n,a=[]){let i=[];return z.Children.forEach(n,(l,u)=>{if(!z.isValidElement(l))return;let o=[...a,u];if(l.type===z.Fragment){i.push.apply(i,Gm(l.props.children,o));return}At(l.type===ki,`[${typeof l.type=="string"?l.type:l.type.name}] is not a <Route> component. All component children of <Routes> must be a <Route> or <React.Fragment>`),At(!l.props.index||!l.props.children,"An index route cannot have child routes.");let m={id:l.props.id||o.join("-"),caseSensitive:l.props.caseSensitive,element:l.props.element,Component:l.props.Component,index:l.props.index,path:l.props.path,middleware:l.props.middleware,loader:l.props.loader,action:l.props.action,hydrateFallbackElement:l.props.hydrateFallbackElement,HydrateFallback:l.props.HydrateFallback,errorElement:l.props.errorElement,ErrorBoundary:l.props.ErrorBoundary,hasErrorBoundary:l.props.hasErrorBoundary===!0||l.props.ErrorBoundary!=null||l.props.errorElement!=null,shouldRevalidate:l.props.shouldRevalidate,handle:l.props.handle,lazy:l.props.lazy};l.props.children&&(m.children=Gm(l.props.children,o)),i.push(m)}),i}var Yf="get",If="application/x-www-form-urlencoded";function hd(n){return typeof HTMLElement<"u"&&n instanceof HTMLElement}function RT(n){return hd(n)&&n.tagName.toLowerCase()==="button"}function AT(n){return hd(n)&&n.tagName.toLowerCase()==="form"}function kT(n){return hd(n)&&n.tagName.toLowerCase()==="input"}function UT(n){return!!(n.metaKey||n.altKey||n.ctrlKey||n.shiftKey)}function zT(n,a){return n.button===0&&(!a||a==="_self")&&!UT(n)}function Xm(n=""){return new URLSearchParams(typeof n=="string"||Array.isArray(n)||n instanceof URLSearchParams?n:Object.keys(n).reduce((a,i)=>{let l=n[i];return a.concat(Array.isArray(l)?l.map(u=>[i,u]):[[i,l]])},[]))}function LT(n,a){let i=Xm(n);return a&&a.forEach((l,u)=>{i.has(u)||a.getAll(u).forEach(o=>{i.append(u,o)})}),i}var Vf=null;function HT(){if(Vf===null)try{new FormData(document.createElement("form"),0),Vf=!1}catch{Vf=!0}return Vf}var VT=new Set(["application/x-www-form-urlencoded","multipart/form-data","text/plain"]);function jm(n){return n!=null&&!VT.has(n)?(wa(!1,`"${n}" is not a valid \`encType\` for \`<Form>\`/\`<fetcher.Form>\` and will default to "${If}"`),null):n}function FT(n,a){let i,l,u,o,m;if(AT(n)){let g=n.getAttribute("action");l=g?Qs(g,a):null,i=n.getAttribute("method")||Yf,u=jm(n.getAttribute("enctype"))||If,o=new FormData(n)}else if(RT(n)||kT(n)&&(n.type==="submit"||n.type==="image")){let g=n.form;if(g==null)throw new Error('Cannot submit a <button> or <input type="submit"> without a <form>');let b=n.getAttribute("formaction")||g.getAttribute("action");if(l=b?Qs(b,a):null,i=n.getAttribute("formmethod")||g.getAttribute("method")||Yf,u=jm(n.getAttribute("formenctype"))||jm(g.getAttribute("enctype"))||If,o=new FormData(g,n),!HT()){let{name:y,type:_,value:w}=n;if(_==="image"){let T=y?`${y}.`:"";o.append(`${T}x`,"0"),o.append(`${T}y`,"0")}else y&&o.append(y,w)}}else{if(hd(n))throw new Error('Cannot submit element that is not <form>, <button>, or <input type="submit|image">');i=Yf,l=null,u=If,m=n}return o&&u==="text/plain"&&(m=o,o=void 0),{action:l,method:i.toLowerCase(),encType:u,formData:o,body:m}}Object.getOwnPropertyNames(Object.prototype).sort().join("\0");function Uy(n,a){if(n===!1||n===null||typeof n>"u")throw new Error(a)}function mS(n,a,i,l){let u=typeof n=="string"?new URL(n,typeof window>"u"?"server://singlefetch/":window.location.origin):n;return i?u.pathname.endsWith("/")?u.pathname=`${u.pathname}_.${l}`:u.pathname=`${u.pathname}.${l}`:u.pathname==="/"?u.pathname=`_root.${l}`:a&&Qs(u.pathname,a)==="/"?u.pathname=`${Kf(a)}/_root.${l}`:u.pathname=`${Kf(u.pathname)}.${l}`,u}async function qT(n,a){if(n.id in a)return a[n.id];try{let i=await import(n.module);return a[n.id]=i,i}catch(i){return console.error(`Error loading route module \`${n.module}\`, reloading page...`),console.error(i),window.__reactRouterContext&&window.__reactRouterContext.isSpaMode,window.location.reload(),new Promise(()=>{})}}function BT(n){return n==null?!1:n.href==null?n.rel==="preload"&&typeof n.imageSrcSet=="string"&&typeof n.imageSizes=="string":typeof n.rel=="string"&&typeof n.href=="string"}async function ZT(n,a,i){let l=await Promise.all(n.map(async u=>{let o=a.routes[u.route.id];if(o){let m=await qT(o,i);return m.links?m.links():[]}return[]}));return GT(l.flat(1).filter(BT).filter(u=>u.rel==="stylesheet"||u.rel==="preload").map(u=>u.rel==="stylesheet"?{...u,rel:"prefetch",as:"style"}:{...u,rel:"prefetch"}))}function p0(n,a,i,l,u,o){let m=(b,y)=>i[y]?b.route.id!==i[y].route.id:!0,g=(b,y)=>{var _;return i[y].pathname!==b.pathname||((_=i[y].route.path)==null?void 0:_.endsWith("*"))&&i[y].params["*"]!==b.params["*"]};return o==="assets"?a.filter((b,y)=>m(b,y)||g(b,y)):o==="data"?a.filter((b,y)=>{var w;let _=l.routes[b.route.id];if(!_||!_.hasLoader)return!1;if(m(b,y)||g(b,y))return!0;if(b.route.shouldRevalidate){let T=b.route.shouldRevalidate({currentUrl:new URL(u.pathname+u.search+u.hash,window.origin),currentParams:((w=i[0])==null?void 0:w.params)||{},nextUrl:new URL(n,window.origin),nextParams:b.params,defaultShouldRevalidate:!0});if(typeof T=="boolean")return T}return!0}):[]}function $T(n,a,{includeHydrateFallback:i}={}){return YT(n.map(l=>{let u=a.routes[l.route.id];if(!u)return[];let o=[u.module];return u.clientActionModule&&(o=o.concat(u.clientActionModule)),u.clientLoaderModule&&(o=o.concat(u.clientLoaderModule)),i&&u.hydrateFallbackModule&&(o=o.concat(u.hydrateFallbackModule)),u.imports&&(o=o.concat(u.imports)),o}).flat(1))}function YT(n){return[...new Set(n)]}function IT(n){let a={},i=Object.keys(n).sort();for(let l of i)a[l]=n[l];return a}function GT(n,a){let i=new Set;return new Set(a),n.reduce((l,u)=>{let o=JSON.stringify(IT(u));return i.has(o)||(i.add(o),l.push({key:o,link:u})),l},[])}function zy(){let n=z.useContext(Su);return Uy(n,"You must render this element inside a <DataRouterContext.Provider> element"),n}function XT(){let n=z.useContext(fd);return Uy(n,"You must render this element inside a <DataRouterStateContext.Provider> element"),n}var Ly=z.createContext(void 0);Ly.displayName="FrameworkContext";function md(){let n=z.useContext(Ly);return Uy(n,"You must render this element inside a <HydratedRouter> element"),n}function QT(n,a){let i=z.useContext(Ly),[l,u]=z.useState(!1),[o,m]=z.useState(!1),{onFocus:g,onBlur:b,onMouseEnter:y,onMouseLeave:_,onTouchStart:w}=a,T=z.useRef(null);z.useEffect(()=>{if(n==="render"&&m(!0),n==="viewport"){let O=R=>{R.forEach(k=>{m(k.isIntersecting)})},j=new IntersectionObserver(O,{threshold:.5});return T.current&&j.observe(T.current),()=>{j.disconnect()}}},[n]),z.useEffect(()=>{if(l){let O=setTimeout(()=>{m(!0)},100);return()=>{clearTimeout(O)}}},[l]);let S=()=>{u(!0)},N=()=>{u(!1),m(!1)};return i?n!=="intent"?[o,T,{}]:[o,T,{onFocus:Mo(g,S),onBlur:Mo(b,N),onMouseEnter:Mo(y,S),onMouseLeave:Mo(_,N),onTouchStart:Mo(w,S)}]:[!1,T,{}]}function Mo(n,a){return i=>{n&&n(i),i.defaultPrevented||a(i)}}function WT({page:n,...a}){let i=sT(),{nonce:l}=md(),{router:u}=zy(),o=z.useMemo(()=>Kb(u.routes,n,u.basename),[u.routes,n,u.basename]);return o?(a.nonce==null&&l&&(a={...a,nonce:l}),i?z.createElement(JT,{page:n,matches:o,...a}):z.createElement(PT,{page:n,matches:o,...a})):null}function KT(n){let{manifest:a,routeModules:i}=md(),[l,u]=z.useState([]);return z.useEffect(()=>{let o=!1;return ZT(n,a,i).then(m=>{o||u(m)}),()=>{o=!0}},[n,a,i]),l}function JT({page:n,matches:a,...i}){let l=Qa(),{future:u}=md(),{basename:o}=zy(),m=z.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let g=mS(n,o,u.v8_trailingSlashAwareDataRequests,"rsc"),b=!1,y=[];for(let _ of a)typeof _.route.shouldRevalidate=="function"?b=!0:y.push(_.route.id);return b&&y.length>0&&g.searchParams.set("_routes",y.join(",")),[g.pathname+g.search]},[o,u.v8_trailingSlashAwareDataRequests,n,l,a]);return z.createElement(z.Fragment,null,m.map(g=>z.createElement("link",{key:g,rel:"prefetch",as:"fetch",href:g,...i})))}function PT({page:n,matches:a,...i}){let l=Qa(),{future:u,manifest:o,routeModules:m}=md(),{basename:g}=zy(),{loaderData:b,matches:y}=XT(),_=z.useMemo(()=>p0(n,a,y,o,l,"data"),[n,a,y,o,l]),w=z.useMemo(()=>p0(n,a,y,o,l,"assets"),[n,a,y,o,l]),T=z.useMemo(()=>{if(n===l.pathname+l.search+l.hash)return[];let O=new Set,j=!1;if(a.forEach(k=>{var F;let H=o.routes[k.route.id];!H||!H.hasLoader||(!_.some(J=>J.route.id===k.route.id)&&k.route.id in b&&((F=m[k.route.id])!=null&&F.shouldRevalidate)||H.hasClientLoader?j=!0:O.add(k.route.id))}),O.size===0)return[];let R=mS(n,g,u.v8_trailingSlashAwareDataRequests,"data");return j&&O.size>0&&R.searchParams.set("_routes",a.filter(k=>O.has(k.route.id)).map(k=>k.route.id).join(",")),[R.pathname+R.search]},[g,u.v8_trailingSlashAwareDataRequests,b,l,o,_,a,n,m]),S=z.useMemo(()=>$T(w,o),[w,o]),N=KT(w);return z.createElement(z.Fragment,null,T.map(O=>z.createElement("link",{key:O,rel:"prefetch",as:"fetch",href:O,...i})),S.map(O=>z.createElement("link",{key:O,rel:"modulepreload",href:O,...i})),N.map(({key:O,link:j})=>z.createElement("link",{key:O,nonce:i.nonce,...j,crossOrigin:j.crossOrigin??i.crossOrigin})))}function eN(...n){return a=>{n.forEach(i=>{typeof i=="function"?i(a):i!=null&&(i.current=a)})}}var tN=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u";try{tN&&(window.__reactRouterVersion="7.18.1")}catch{}function nN({basename:n,children:a,useTransitions:i,window:l}){let u=z.useRef();u.current==null&&(u.current=DE({window:l,v5Compat:!0}));let o=u.current,[m,g]=z.useState({action:o.action,location:o.location}),b=z.useCallback(y=>{i===!1?g(y):z.startTransition(()=>g(y))},[i]);return z.useLayoutEffect(()=>o.listen(b),[o,b]),z.createElement(DT,{basename:n,children:a,location:m.location,navigationType:m.action,navigator:o,useTransitions:i})}var Eu=z.forwardRef(function({onClick:a,discover:i="render",prefetch:l="none",relative:u,reloadDocument:o,replace:m,mask:g,state:b,target:y,to:_,preventScrollReset:w,viewTransition:T,defaultShouldRevalidate:S,...N},O){let{basename:j,navigator:R,useTransitions:k}=z.useContext(ca),H=typeof _=="string"&&Dy.test(_),F=sS(_,j);_=F.to;let J=fT(_,{relative:u}),pe=Qa(),G=null;if(g){let be=cd(g,[],pe.mask?pe.mask.pathname:"/",!0);j!=="/"&&(be.pathname=be.pathname==="/"?j:Ga([j,be.pathname])),G=R.createHref(be)}let[re,se,V]=QT(l,N),K=iN(_,{replace:m,mask:g,state:b,target:y,preventScrollReset:w,relative:u,viewTransition:T,defaultShouldRevalidate:S,useTransitions:k});function P(be){a&&a(be),be.defaultPrevented||K(be)}let ie=!(F.isExternal||o),Se=z.createElement("a",{...N,...V,href:(ie?G:void 0)||F.absoluteURL||J,onClick:ie?P:a,ref:eN(O,se),target:y,"data-discover":!H&&i==="render"?"true":void 0});return re&&!H?z.createElement(z.Fragment,null,Se,z.createElement(WT,{page:J})):Se});Eu.displayName="Link";var yS=z.forwardRef(function({"aria-current":a="page",caseSensitive:i=!1,className:l="",end:u=!1,style:o,to:m,viewTransition:g,children:b,...y},_){let w=nc(m,{relative:y.relative}),T=Qa(),S=z.useContext(fd),{navigator:N,basename:O}=z.useContext(ca),j=S!=null&&cN(w)&&g===!0,R=N.encodeLocation?N.encodeLocation(w).pathname:w.pathname,k=T.pathname,H=S&&S.navigation&&S.navigation.location?S.navigation.location.pathname:null;i||(k=k.toLowerCase(),H=H?H.toLowerCase():null,R=R.toLowerCase()),H&&O&&(H=Qs(H,O)||H);const F=R!=="/"&&R.endsWith("/")?R.length-1:R.length;let J=k===R||!u&&k.startsWith(R)&&k.charAt(F)==="/",pe=H!=null&&(H===R||!u&&H.startsWith(R)&&H.charAt(R.length)==="/"),G={isActive:J,isPending:pe,isTransitioning:j},re=J?a:void 0,se;typeof l=="function"?se=l(G):se=[l,J?"active":null,pe?"pending":null,j?"transitioning":null].filter(Boolean).join(" ");let V=typeof o=="function"?o(G):o;return z.createElement(Eu,{...y,"aria-current":re,className:se,ref:_,style:V,to:m,viewTransition:g},typeof b=="function"?b(G):b)});yS.displayName="NavLink";var aN=z.forwardRef(({discover:n="render",fetcherKey:a,navigate:i,reloadDocument:l,replace:u,state:o,method:m=Yf,action:g,onSubmit:b,relative:y,preventScrollReset:_,viewTransition:w,defaultShouldRevalidate:T,...S},N)=>{let{useTransitions:O}=z.useContext(ca),j=uN(),R=oN(g,{relative:y}),k=m.toLowerCase()==="get"?"get":"post",H=typeof g=="string"&&Dy.test(g),F=J=>{if(b&&b(J),J.defaultPrevented)return;J.preventDefault();let pe=J.nativeEvent.submitter,G=(pe==null?void 0:pe.getAttribute("formmethod"))||m,re=()=>j(pe||J.currentTarget,{fetcherKey:a,method:G,navigate:i,replace:u,state:o,relative:y,preventScrollReset:_,viewTransition:w,defaultShouldRevalidate:T});O&&i!==!1?z.startTransition(()=>re()):re()};return z.createElement("form",{ref:N,method:k,action:R,onSubmit:l?b:F,...S,"data-discover":!H&&n==="render"?"true":void 0})});aN.displayName="Form";function sN(n){return`${n} must be used within a data router.  See https://reactrouter.com/en/main/routers/picking-a-router.`}function gS(n){let a=z.useContext(Su);return At(a,sN(n)),a}function iN(n,{target:a,replace:i,mask:l,state:u,preventScrollReset:o,relative:m,viewTransition:g,defaultShouldRevalidate:b,useTransitions:y}={}){let _=dd(),w=Qa(),T=nc(n,{relative:m});return z.useCallback(S=>{if(zT(S,a)){S.preventDefault();let N=i!==void 0?i:Zo(w)===Zo(T),O=()=>_(n,{replace:N,mask:l,state:u,preventScrollReset:o,relative:m,viewTransition:g,defaultShouldRevalidate:b});y?z.startTransition(()=>O()):O()}},[w,_,T,i,l,u,a,n,o,m,g,b,y])}function vS(n){wa(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 a=z.useRef(Xm(n)),i=z.useRef(!1),l=Qa(),u=z.useMemo(()=>LT(l.search,i.current?null:a.current),[l.search]),o=dd(),m=z.useCallback((g,b)=>{const y=Xm(typeof g=="function"?g(new URLSearchParams(u)):g);i.current=!0,o("?"+y,b)},[o,u]);return[u,m]}var rN=0,lN=()=>`__${String(++rN)}__`;function uN(){let{router:n}=gS("useSubmit"),{basename:a}=z.useContext(ca),i=NT(),l=n.fetch,u=n.navigate;return z.useCallback(async(o,m={})=>{let{action:g,method:b,encType:y,formData:_,body:w}=FT(o,a);if(m.navigate===!1){let T=m.fetcherKey||lN();await l(T,i,m.action||g,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:_,body:w,formMethod:m.method||b,formEncType:m.encType||y,flushSync:m.flushSync})}else await u(m.action||g,{defaultShouldRevalidate:m.defaultShouldRevalidate,preventScrollReset:m.preventScrollReset,formData:_,body:w,formMethod:m.method||b,formEncType:m.encType||y,replace:m.replace,state:m.state,fromRouteId:i,flushSync:m.flushSync,viewTransition:m.viewTransition})},[l,u,a,i])}function oN(n,{relative:a}={}){let{basename:i}=z.useContext(ca),l=z.useContext(Xa);At(l,"useFormAction must be used inside a RouteContext");let[u]=l.matches.slice(-1),o={...nc(n||".",{relative:a})},m=Qa();if(n==null){o.search=m.search;let g=new URLSearchParams(o.search),b=g.getAll("index");if(b.some(_=>_==="")){g.delete("index"),b.filter(w=>w).forEach(w=>g.append("index",w));let _=g.toString();o.search=_?`?${_}`:""}}return(!n||n===".")&&u.route.index&&(o.search=o.search?o.search.replace(/^\?/,"?index&"):"?index"),i!=="/"&&(o.pathname=o.pathname==="/"?i:Ga([i,o.pathname])),Zo(o)}function cN(n,{relative:a}={}){let i=z.useContext(lS);At(i!=null,"`useViewTransitionState` must be used within `react-router-dom`'s `RouterProvider`.  Did you accidentally import `RouterProvider` from `react-router`?");let{basename:l}=gS("useViewTransitionState"),u=nc(n,{relative:a});if(!i.isTransitioning)return!1;let o=Qs(i.currentLocation.pathname,l)||i.currentLocation.pathname,m=Qs(i.nextLocation.pathname,l)||i.nextLocation.pathname;return Wf(u.pathname,m)!=null||Wf(u.pathname,o)!=null}var Tu=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(n){return this.listeners.add(n),this.onSubscribe(),()=>{this.listeners.delete(n),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},$r,Vi,tu,Vb,fN=(Vb=class extends Tu{constructor(){super();Ce(this,$r);Ce(this,Vi);Ce(this,tu);oe(this,tu,a=>{if(typeof window<"u"&&window.addEventListener){const i=()=>a();return window.addEventListener("visibilitychange",i,!1),()=>{window.removeEventListener("visibilitychange",i)}}})}onSubscribe(){C(this,Vi)||this.setEventListener(C(this,tu))}onUnsubscribe(){var a;this.hasListeners()||((a=C(this,Vi))==null||a.call(this),oe(this,Vi,void 0))}setEventListener(a){var i;oe(this,tu,a),(i=C(this,Vi))==null||i.call(this),oe(this,Vi,a(l=>{typeof l=="boolean"?this.setFocused(l):this.onFocus()}))}setFocused(a){C(this,$r)!==a&&(oe(this,$r,a),this.onFocus())}onFocus(){const a=this.isFocused();this.listeners.forEach(i=>{i(a)})}isFocused(){var a;return typeof C(this,$r)=="boolean"?C(this,$r):((a=globalThis.document)==null?void 0:a.visibilityState)!=="hidden"}},$r=new WeakMap,Vi=new WeakMap,tu=new WeakMap,Vb),Hy=new fN,dN={setTimeout:(n,a)=>setTimeout(n,a),clearTimeout:n=>clearTimeout(n),setInterval:(n,a)=>setInterval(n,a),clearInterval:n=>clearInterval(n)},Fi,Cy,Fb,hN=(Fb=class{constructor(){Ce(this,Fi,dN);Ce(this,Cy,!1)}setTimeoutProvider(n){oe(this,Fi,n)}setTimeout(n,a){return C(this,Fi).setTimeout(n,a)}clearTimeout(n){C(this,Fi).clearTimeout(n)}setInterval(n,a){return C(this,Fi).setInterval(n,a)}clearInterval(n){C(this,Fi).clearInterval(n)}},Fi=new WeakMap,Cy=new WeakMap,Fb),Zr=new hN;function mN(n){setTimeout(n,0)}var yN=typeof window>"u"||"Deno"in globalThis;function Dn(){}function gN(n,a){return typeof n=="function"?n(a):n}function Qm(n){return typeof n=="number"&&n>=0&&n!==1/0}function pS(n,a){return Math.max(n+(a||0)-Date.now(),0)}function Wi(n,a){return typeof n=="function"?n(a):n}function la(n,a){return typeof n=="function"?n(a):n}function b0(n,a){const{type:i="all",exact:l,fetchStatus:u,predicate:o,queryKey:m,stale:g}=n;if(m){if(l){if(a.queryHash!==Vy(m,a.options))return!1}else if(!$o(a.queryKey,m))return!1}if(i!=="all"){const b=a.isActive();if(i==="active"&&!b||i==="inactive"&&b)return!1}return!(typeof g=="boolean"&&a.isStale()!==g||u&&u!==a.state.fetchStatus||o&&!o(a))}function S0(n,a){const{exact:i,status:l,predicate:u,mutationKey:o}=n;if(o){if(!a.options.mutationKey)return!1;if(i){if(Pr(a.options.mutationKey)!==Pr(o))return!1}else if(!$o(a.options.mutationKey,o))return!1}return!(l&&a.state.status!==l||u&&!u(a))}function Vy(n,a){return((a==null?void 0:a.queryKeyHashFn)||Pr)(n)}function Pr(n){return JSON.stringify(n,(a,i)=>Wm(i)?Object.keys(i).sort().reduce((l,u)=>(l[u]=i[u],l),{}):i)}function $o(n,a){return n===a?!0:typeof n!=typeof a?!1:n&&a&&typeof n=="object"&&typeof a=="object"?Object.keys(a).every(i=>$o(n[i],a[i])):!1}var vN=Object.prototype.hasOwnProperty;function bS(n,a,i=0){if(n===a)return n;if(i>500)return a;const l=x0(n)&&x0(a);if(!l&&!(Wm(n)&&Wm(a)))return a;const o=(l?n:Object.keys(n)).length,m=l?a:Object.keys(a),g=m.length,b=l?new Array(g):{};let y=0;for(let _=0;_<g;_++){const w=l?_:m[_],T=n[w],S=a[w];if(T===S){b[w]=T,(l?_<o:vN.call(n,w))&&y++;continue}if(T===null||S===null||typeof T!="object"||typeof S!="object"){b[w]=S;continue}const N=bS(T,S,i+1);b[w]=N,N===T&&y++}return o===g&&y===o?n:b}function Jf(n,a){if(!a||Object.keys(n).length!==Object.keys(a).length)return!1;for(const i in n)if(n[i]!==a[i])return!1;return!0}function x0(n){return Array.isArray(n)&&n.length===Object.keys(n).length}function Wm(n){if(!E0(n))return!1;const a=n.constructor;if(a===void 0)return!0;const i=a.prototype;return!(!E0(i)||!i.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(n)!==Object.prototype)}function E0(n){return Object.prototype.toString.call(n)==="[object Object]"}function pN(n){return new Promise(a=>{Zr.setTimeout(a,n)})}function Km(n,a,i){return typeof i.structuralSharing=="function"?i.structuralSharing(n,a):i.structuralSharing!==!1?bS(n,a):a}function bN(n,a,i=0){const l=[...n,a];return i&&l.length>i?l.slice(1):l}function SN(n,a,i=0){const l=[a,...n];return i&&l.length>i?l.slice(0,-1):l}var Fy=Symbol();function SS(n,a){return!n.queryFn&&(a!=null&&a.initialPromise)?()=>a.initialPromise:!n.queryFn||n.queryFn===Fy?()=>Promise.reject(new Error(`Missing queryFn: '${n.queryHash}'`)):n.queryFn}function qy(n,a){return typeof n=="function"?n(...a):!!n}function xN(n,a,i){let l=!1,u;return Object.defineProperty(n,"signal",{enumerable:!0,get:()=>(u??(u=a()),l||(l=!0,u.aborted?i():u.addEventListener("abort",i,{once:!0})),u)}),n}var Yo=(()=>{let n=()=>yN;return{isServer(){return n()},setIsServer(a){n=a}}})();function Jm(){let n,a;const i=new Promise((u,o)=>{n=u,a=o});i.status="pending",i.catch(()=>{});function l(u){Object.assign(i,u),delete i.resolve,delete i.reject}return i.resolve=u=>{l({status:"fulfilled",value:u}),n(u)},i.reject=u=>{l({status:"rejected",reason:u}),a(u)},i}var EN=mN;function TN(){let n=[],a=0,i=g=>{g()},l=g=>{g()},u=EN;const o=g=>{a?n.push(g):u(()=>{i(g)})},m=()=>{const g=n;n=[],g.length&&u(()=>{l(()=>{g.forEach(b=>{i(b)})})})};return{batch:g=>{let b;a++;try{b=g()}finally{a--,a||m()}return b},batchCalls:g=>(...b)=>{o(()=>{g(...b)})},schedule:o,setNotifyFunction:g=>{i=g},setBatchNotifyFunction:g=>{l=g},setScheduler:g=>{u=g}}}var rn=TN(),nu,qi,au,qb,NN=(qb=class extends Tu{constructor(){super();Ce(this,nu,!0);Ce(this,qi);Ce(this,au);oe(this,au,a=>{if(typeof window<"u"&&window.addEventListener){const i=()=>a(!0),l=()=>a(!1);return window.addEventListener("online",i,!1),window.addEventListener("offline",l,!1),()=>{window.removeEventListener("online",i),window.removeEventListener("offline",l)}}})}onSubscribe(){C(this,qi)||this.setEventListener(C(this,au))}onUnsubscribe(){var a;this.hasListeners()||((a=C(this,qi))==null||a.call(this),oe(this,qi,void 0))}setEventListener(a){var i;oe(this,au,a),(i=C(this,qi))==null||i.call(this),oe(this,qi,a(this.setOnline.bind(this)))}setOnline(a){C(this,nu)!==a&&(oe(this,nu,a),this.listeners.forEach(l=>{l(a)}))}isOnline(){return C(this,nu)}},nu=new WeakMap,qi=new WeakMap,au=new WeakMap,qb),Pf=new NN;function _N(n){return Math.min(1e3*2**n,3e4)}function xS(n){return(n??"online")==="online"?Pf.isOnline():!0}var Pm=class extends Error{constructor(n){super("CancelledError"),this.revert=n==null?void 0:n.revert,this.silent=n==null?void 0:n.silent}};function ES(n){let a=!1,i=0,l;const u=Jm(),o=()=>u.status!=="pending",m=O=>{var j;if(!o()){const R=new Pm(O);T(R),(j=n.onCancel)==null||j.call(n,R)}},g=()=>{a=!0},b=()=>{a=!1},y=()=>Hy.isFocused()&&(n.networkMode==="always"||Pf.isOnline())&&n.canRun(),_=()=>xS(n.networkMode)&&n.canRun(),w=O=>{o()||(l==null||l(),u.resolve(O))},T=O=>{o()||(l==null||l(),u.reject(O))},S=()=>new Promise(O=>{var j;l=R=>{(o()||y())&&O(R)},(j=n.onPause)==null||j.call(n)}).then(()=>{var O;l=void 0,o()||(O=n.onContinue)==null||O.call(n)}),N=()=>{if(o())return;let O;const j=i===0?n.initialPromise:void 0;try{O=j??n.fn()}catch(R){O=Promise.reject(R)}Promise.resolve(O).then(w).catch(R=>{var pe;if(o())return;const k=n.retry??(Yo.isServer()?0:3),H=n.retryDelay??_N,F=typeof H=="function"?H(i,R):H,J=k===!0||typeof k=="number"&&i<k||typeof k=="function"&&k(i,R);if(a||!J){T(R);return}i++,(pe=n.onFail)==null||pe.call(n,i,R),pN(F).then(()=>y()?void 0:S()).then(()=>{a?T(R):N()})})};return{promise:u,status:()=>u.status,cancel:m,continue:()=>(l==null||l(),u),cancelRetry:g,continueRetry:b,canStart:_,start:()=>(_()?N():S().then(N),u)}}var Yr,Bb,TS=(Bb=class{constructor(){Ce(this,Yr)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),Qm(this.gcTime)&&oe(this,Yr,Zr.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(n){this.gcTime=Math.max(this.gcTime||0,n??(Yo.isServer()?1/0:300*1e3))}clearGcTimeout(){C(this,Yr)!==void 0&&(Zr.clearTimeout(C(this,Yr)),oe(this,Yr,void 0))}},Yr=new WeakMap,Bb);function ON(n){return{onFetch:(a,i)=>{var _,w,T,S,N;const l=a.options,u=(T=(w=(_=a.fetchOptions)==null?void 0:_.meta)==null?void 0:w.fetchMore)==null?void 0:T.direction,o=((S=a.state.data)==null?void 0:S.pages)||[],m=((N=a.state.data)==null?void 0:N.pageParams)||[];let g={pages:[],pageParams:[]},b=0;const y=async()=>{let O=!1;const j=H=>{xN(H,()=>a.signal,()=>O=!0)},R=SS(a.options,a.fetchOptions),k=async(H,F,J)=>{if(O)return Promise.reject(a.signal.reason);if(F==null&&H.pages.length)return Promise.resolve(H);const G=(()=>{const K={client:a.client,queryKey:a.queryKey,pageParam:F,direction:J?"backward":"forward",meta:a.options.meta};return j(K),K})(),re=await R(G),{maxPages:se}=a.options,V=J?SN:bN;return{pages:V(H.pages,re,se),pageParams:V(H.pageParams,F,se)}};if(u&&o.length){const H=u==="backward",F=H?wN:T0,J={pages:o,pageParams:m},pe=F(l,J);g=await k(J,pe,H)}else{const H=n??o.length;do{const F=b===0?m[0]??l.initialPageParam:T0(l,g);if(b>0&&F==null)break;g=await k(g,F),b++}while(b<H)}return g};a.options.persister?a.fetchFn=()=>{var O,j;return(j=(O=a.options).persister)==null?void 0:j.call(O,y,{client:a.client,queryKey:a.queryKey,meta:a.options.meta,signal:a.signal},i)}:a.fetchFn=y}}}function T0(n,{pages:a,pageParams:i}){const l=a.length-1;return a.length>0?n.getNextPageParam(a[l],a,i[l],i):void 0}function wN(n,{pages:a,pageParams:i}){var l;return a.length>0?(l=n.getPreviousPageParam)==null?void 0:l.call(n,a[0],a,i[0],i):void 0}var su,Ir,iu,_a,Gr,fn,Wo,Xr,ra,NS,Bs,Zb,CN=(Zb=class extends TS{constructor(a){super();Ce(this,ra);Ce(this,su);Ce(this,Ir);Ce(this,iu);Ce(this,_a);Ce(this,Gr);Ce(this,fn);Ce(this,Wo);Ce(this,Xr);oe(this,Xr,!1),oe(this,Wo,a.defaultOptions),this.setOptions(a.options),this.observers=[],oe(this,Gr,a.client),oe(this,_a,C(this,Gr).getQueryCache()),this.queryKey=a.queryKey,this.queryHash=a.queryHash,oe(this,Ir,_0(this.options)),this.state=a.state??C(this,Ir),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return C(this,su)}get promise(){var a;return(a=C(this,fn))==null?void 0:a.promise}setOptions(a){if(this.options={...C(this,Wo),...a},a!=null&&a._type&&oe(this,su,a._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const i=_0(this.options);i.data!==void 0&&(this.setState(N0(i.data,i.dataUpdatedAt)),oe(this,Ir,i))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&C(this,_a).remove(this)}setData(a,i){const l=Km(this.state.data,a,this.options);return Te(this,ra,Bs).call(this,{data:l,type:"success",dataUpdatedAt:i==null?void 0:i.updatedAt,manual:i==null?void 0:i.manual}),l}setState(a){Te(this,ra,Bs).call(this,{type:"setState",state:a})}cancel(a){var l,u;const i=(l=C(this,fn))==null?void 0:l.promise;return(u=C(this,fn))==null||u.cancel(a),i?i.then(Dn).catch(Dn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return C(this,Ir)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(a=>la(a.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Fy||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(a=>Wi(a.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(a=>a.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(a=0){return this.state.data===void 0?!0:a==="static"?!1:this.state.isInvalidated?!0:!pS(this.state.dataUpdatedAt,a)}onFocus(){var i;const a=this.observers.find(l=>l.shouldFetchOnWindowFocus());a==null||a.refetch({cancelRefetch:!1}),(i=C(this,fn))==null||i.continue()}onOnline(){var i;const a=this.observers.find(l=>l.shouldFetchOnReconnect());a==null||a.refetch({cancelRefetch:!1}),(i=C(this,fn))==null||i.continue()}addObserver(a){this.observers.includes(a)||(this.observers.push(a),this.clearGcTimeout(),C(this,_a).notify({type:"observerAdded",query:this,observer:a}))}removeObserver(a){this.observers.includes(a)&&(this.observers=this.observers.filter(i=>i!==a),this.observers.length||(C(this,fn)&&(C(this,Xr)||Te(this,ra,NS).call(this)?C(this,fn).cancel({revert:!0}):C(this,fn).cancelRetry()),this.scheduleGc()),C(this,_a).notify({type:"observerRemoved",query:this,observer:a}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Te(this,ra,Bs).call(this,{type:"invalidate"})}async fetch(a,i){var y,_,w,T,S,N,O,j,R,k,H;if(this.state.fetchStatus!=="idle"&&((y=C(this,fn))==null?void 0:y.status())!=="rejected"){if(this.state.data!==void 0&&(i!=null&&i.cancelRefetch))this.cancel({silent:!0});else if(C(this,fn))return C(this,fn).continueRetry(),C(this,fn).promise}if(a&&this.setOptions(a),!this.options.queryFn){const F=this.observers.find(J=>J.options.queryFn);F&&this.setOptions(F.options)}const l=new AbortController,u=F=>{Object.defineProperty(F,"signal",{enumerable:!0,get:()=>(oe(this,Xr,!0),l.signal)})},o=()=>{const F=SS(this.options,i),pe=(()=>{const G={client:C(this,Gr),queryKey:this.queryKey,meta:this.meta};return u(G),G})();return oe(this,Xr,!1),this.options.persister?this.options.persister(F,pe,this):F(pe)},g=(()=>{const F={fetchOptions:i,options:this.options,queryKey:this.queryKey,client:C(this,Gr),state:this.state,fetchFn:o};return u(F),F})(),b=C(this,su)==="infinite"?ON(this.options.pages):this.options.behavior;b==null||b.onFetch(g,this),oe(this,iu,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((_=g.fetchOptions)==null?void 0:_.meta))&&Te(this,ra,Bs).call(this,{type:"fetch",meta:(w=g.fetchOptions)==null?void 0:w.meta}),oe(this,fn,ES({initialPromise:i==null?void 0:i.initialPromise,fn:g.fetchFn,onCancel:F=>{F instanceof Pm&&F.revert&&this.setState({...C(this,iu),fetchStatus:"idle"}),l.abort()},onFail:(F,J)=>{Te(this,ra,Bs).call(this,{type:"failed",failureCount:F,error:J})},onPause:()=>{Te(this,ra,Bs).call(this,{type:"pause"})},onContinue:()=>{Te(this,ra,Bs).call(this,{type:"continue"})},retry:g.options.retry,retryDelay:g.options.retryDelay,networkMode:g.options.networkMode,canRun:()=>!0}));try{const F=await C(this,fn).start();if(F===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(F),(S=(T=C(this,_a).config).onSuccess)==null||S.call(T,F,this),(O=(N=C(this,_a).config).onSettled)==null||O.call(N,F,this.state.error,this),F}catch(F){if(F instanceof Pm){if(F.silent)return C(this,fn).promise;if(F.revert){if(this.state.data===void 0)throw F;return this.state.data}}throw Te(this,ra,Bs).call(this,{type:"error",error:F}),(R=(j=C(this,_a).config).onError)==null||R.call(j,F,this),(H=(k=C(this,_a).config).onSettled)==null||H.call(k,this.state.data,F,this),F}finally{this.scheduleGc()}}},su=new WeakMap,Ir=new WeakMap,iu=new WeakMap,_a=new WeakMap,Gr=new WeakMap,fn=new WeakMap,Wo=new WeakMap,Xr=new WeakMap,ra=new WeakSet,NS=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},Bs=function(a){const i=l=>{switch(a.type){case"failed":return{...l,fetchFailureCount:a.failureCount,fetchFailureReason:a.error};case"pause":return{...l,fetchStatus:"paused"};case"continue":return{...l,fetchStatus:"fetching"};case"fetch":return{...l,..._S(l.data,this.options),fetchMeta:a.meta??null};case"success":const u={...l,...N0(a.data,a.dataUpdatedAt),dataUpdateCount:l.dataUpdateCount+1,...!a.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return oe(this,iu,a.manual?u:void 0),u;case"error":const o=a.error;return{...l,error:o,errorUpdateCount:l.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:l.fetchFailureCount+1,fetchFailureReason:o,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...l,isInvalidated:!0};case"setState":return{...l,...a.state}}};this.state=i(this.state),rn.batch(()=>{this.observers.forEach(l=>{l.onQueryUpdate()}),C(this,_a).notify({query:this,type:"updated",action:a})})},Zb);function _S(n,a){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:xS(a.networkMode)?"fetching":"paused",...n===void 0&&{error:null,status:"pending"}}}function N0(n,a){return{data:n,dataUpdatedAt:a??Date.now(),error:null,isInvalidated:!1,status:"success"}}function _0(n){const a=typeof n.initialData=="function"?n.initialData():n.initialData,i=a!==void 0,l=i?typeof n.initialDataUpdatedAt=="function"?n.initialDataUpdatedAt():n.initialDataUpdatedAt:0;return{data:a,dataUpdateCount:0,dataUpdatedAt:i?l??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:i?"success":"pending",fetchStatus:"idle"}}var $n,ut,Ko,Mn,Qr,ru,$s,Bi,Jo,lu,uu,Wr,Kr,Zi,ou,pt,Fo,ey,ty,ny,ay,sy,iy,ry,OS,$b,MN=($b=class extends Tu{constructor(a,i){super();Ce(this,pt);Ce(this,$n);Ce(this,ut);Ce(this,Ko);Ce(this,Mn);Ce(this,Qr);Ce(this,ru);Ce(this,$s);Ce(this,Bi);Ce(this,Jo);Ce(this,lu);Ce(this,uu);Ce(this,Wr);Ce(this,Kr);Ce(this,Zi);Ce(this,ou,new Set);this.options=i,oe(this,$n,a),oe(this,Bi,null),oe(this,$s,Jm()),this.bindMethods(),this.setOptions(i)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(C(this,ut).addObserver(this),O0(C(this,ut),this.options)?Te(this,pt,Fo).call(this):this.updateResult(),Te(this,pt,ay).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return ly(C(this,ut),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return ly(C(this,ut),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Te(this,pt,sy).call(this),Te(this,pt,iy).call(this),C(this,ut).removeObserver(this)}setOptions(a){const i=this.options,l=C(this,ut);if(this.options=C(this,$n).defaultQueryOptions(a),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof la(this.options.enabled,C(this,ut))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Te(this,pt,ry).call(this),C(this,ut).setOptions(this.options),i._defaulted&&!Jf(this.options,i)&&C(this,$n).getQueryCache().notify({type:"observerOptionsUpdated",query:C(this,ut),observer:this});const u=this.hasListeners();u&&w0(C(this,ut),l,this.options,i)&&Te(this,pt,Fo).call(this),this.updateResult(),u&&(C(this,ut)!==l||la(this.options.enabled,C(this,ut))!==la(i.enabled,C(this,ut))||Wi(this.options.staleTime,C(this,ut))!==Wi(i.staleTime,C(this,ut)))&&Te(this,pt,ey).call(this);const o=Te(this,pt,ty).call(this);u&&(C(this,ut)!==l||la(this.options.enabled,C(this,ut))!==la(i.enabled,C(this,ut))||o!==C(this,Zi))&&Te(this,pt,ny).call(this,o)}getOptimisticResult(a){const i=C(this,$n).getQueryCache().build(C(this,$n),a),l=this.createResult(i,a);return jN(this,l)&&(oe(this,Mn,l),oe(this,ru,this.options),oe(this,Qr,C(this,ut).state)),l}getCurrentResult(){return C(this,Mn)}trackResult(a,i){return new Proxy(a,{get:(l,u)=>(this.trackProp(u),i==null||i(u),u==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&C(this,$s).status==="pending"&&C(this,$s).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(l,u))})}trackProp(a){C(this,ou).add(a)}getCurrentQuery(){return C(this,ut)}refetch({...a}={}){return this.fetch({...a})}fetchOptimistic(a){const i=C(this,$n).defaultQueryOptions(a),l=C(this,$n).getQueryCache().build(C(this,$n),i);return l.fetch().then(()=>this.createResult(l,i))}fetch(a){return Te(this,pt,Fo).call(this,{...a,cancelRefetch:a.cancelRefetch??!0}).then(()=>(this.updateResult(),C(this,Mn)))}createResult(a,i){var se;const l=C(this,ut),u=this.options,o=C(this,Mn),m=C(this,Qr),g=C(this,ru),y=a!==l?a.state:C(this,Ko),{state:_}=a;let w={..._},T=!1,S;if(i._optimisticResults){const V=this.hasListeners(),K=!V&&O0(a,i),P=V&&w0(a,l,i,u);(K||P)&&(w={...w,..._S(_.data,a.options)}),i._optimisticResults==="isRestoring"&&(w.fetchStatus="idle")}let{error:N,errorUpdatedAt:O,status:j}=w;S=w.data;let R=!1;if(i.placeholderData!==void 0&&S===void 0&&j==="pending"){let V;o!=null&&o.isPlaceholderData&&i.placeholderData===(g==null?void 0:g.placeholderData)?(V=o.data,R=!0):V=typeof i.placeholderData=="function"?i.placeholderData((se=C(this,uu))==null?void 0:se.state.data,C(this,uu)):i.placeholderData,V!==void 0&&(j="success",S=Km(o==null?void 0:o.data,V,i),T=!0)}if(i.select&&S!==void 0&&!R)if(o&&S===(m==null?void 0:m.data)&&i.select===C(this,Jo))S=C(this,lu);else try{oe(this,Jo,i.select),S=i.select(S),S=Km(o==null?void 0:o.data,S,i),oe(this,lu,S),oe(this,Bi,null)}catch(V){oe(this,Bi,V)}C(this,Bi)&&(N=C(this,Bi),S=C(this,lu),O=Date.now(),j="error");const k=w.fetchStatus==="fetching",H=j==="pending",F=j==="error",J=H&&k,pe=S!==void 0,re={status:j,fetchStatus:w.fetchStatus,isPending:H,isSuccess:j==="success",isError:F,isInitialLoading:J,isLoading:J,data:S,dataUpdatedAt:w.dataUpdatedAt,error:N,errorUpdatedAt:O,failureCount:w.fetchFailureCount,failureReason:w.fetchFailureReason,errorUpdateCount:w.errorUpdateCount,isFetched:a.isFetched(),isFetchedAfterMount:w.dataUpdateCount>y.dataUpdateCount||w.errorUpdateCount>y.errorUpdateCount,isFetching:k,isRefetching:k&&!H,isLoadingError:F&&!pe,isPaused:w.fetchStatus==="paused",isPlaceholderData:T,isRefetchError:F&&pe,isStale:By(a,i),refetch:this.refetch,promise:C(this,$s),isEnabled:la(i.enabled,a)!==!1};if(this.options.experimental_prefetchInRender){const V=re.data!==void 0,K=re.status==="error"&&!V,P=be=>{K?be.reject(re.error):V&&be.resolve(re.data)},ie=()=>{const be=oe(this,$s,re.promise=Jm());P(be)},Se=C(this,$s);switch(Se.status){case"pending":a.queryHash===l.queryHash&&P(Se);break;case"fulfilled":(K||re.data!==Se.value)&&ie();break;case"rejected":(!K||re.error!==Se.reason)&&ie();break}}return re}updateResult(){const a=C(this,Mn),i=this.createResult(C(this,ut),this.options);if(oe(this,Qr,C(this,ut).state),oe(this,ru,this.options),C(this,Qr).data!==void 0&&oe(this,uu,C(this,ut)),Jf(i,a))return;oe(this,Mn,i);const l=()=>{if(!a)return!0;const{notifyOnChangeProps:u}=this.options,o=typeof u=="function"?u():u;if(o==="all"||!o&&!C(this,ou).size)return!0;const m=new Set(o??C(this,ou));return this.options.throwOnError&&m.add("error"),Object.keys(C(this,Mn)).some(g=>{const b=g;return C(this,Mn)[b]!==a[b]&&m.has(b)})};Te(this,pt,OS).call(this,{listeners:l()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Te(this,pt,ay).call(this)}},$n=new WeakMap,ut=new WeakMap,Ko=new WeakMap,Mn=new WeakMap,Qr=new WeakMap,ru=new WeakMap,$s=new WeakMap,Bi=new WeakMap,Jo=new WeakMap,lu=new WeakMap,uu=new WeakMap,Wr=new WeakMap,Kr=new WeakMap,Zi=new WeakMap,ou=new WeakMap,pt=new WeakSet,Fo=function(a){Te(this,pt,ry).call(this);let i=C(this,ut).fetch(this.options,a);return a!=null&&a.throwOnError||(i=i.catch(Dn)),i},ey=function(){Te(this,pt,sy).call(this);const a=Wi(this.options.staleTime,C(this,ut));if(Yo.isServer()||C(this,Mn).isStale||!Qm(a))return;const l=pS(C(this,Mn).dataUpdatedAt,a)+1;oe(this,Wr,Zr.setTimeout(()=>{C(this,Mn).isStale||this.updateResult()},l))},ty=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(C(this,ut)):this.options.refetchInterval)??!1},ny=function(a){Te(this,pt,iy).call(this),oe(this,Zi,a),!(Yo.isServer()||la(this.options.enabled,C(this,ut))===!1||!Qm(C(this,Zi))||C(this,Zi)===0)&&oe(this,Kr,Zr.setInterval(()=>{(this.options.refetchIntervalInBackground||Hy.isFocused())&&Te(this,pt,Fo).call(this)},C(this,Zi)))},ay=function(){Te(this,pt,ey).call(this),Te(this,pt,ny).call(this,Te(this,pt,ty).call(this))},sy=function(){C(this,Wr)!==void 0&&(Zr.clearTimeout(C(this,Wr)),oe(this,Wr,void 0))},iy=function(){C(this,Kr)!==void 0&&(Zr.clearInterval(C(this,Kr)),oe(this,Kr,void 0))},ry=function(){const a=C(this,$n).getQueryCache().build(C(this,$n),this.options);if(a===C(this,ut))return;const i=C(this,ut);oe(this,ut,a),oe(this,Ko,a.state),this.hasListeners()&&(i==null||i.removeObserver(this),a.addObserver(this))},OS=function(a){rn.batch(()=>{a.listeners&&this.listeners.forEach(i=>{i(C(this,Mn))}),C(this,$n).getQueryCache().notify({query:C(this,ut),type:"observerResultsUpdated"})})},$b);function DN(n,a){return la(a.enabled,n)!==!1&&n.state.data===void 0&&!(n.state.status==="error"&&la(a.retryOnMount,n)===!1)}function O0(n,a){return DN(n,a)||n.state.data!==void 0&&ly(n,a,a.refetchOnMount)}function ly(n,a,i){if(la(a.enabled,n)!==!1&&Wi(a.staleTime,n)!=="static"){const l=typeof i=="function"?i(n):i;return l==="always"||l!==!1&&By(n,a)}return!1}function w0(n,a,i,l){return(n!==a||la(l.enabled,n)===!1)&&(!i.suspense||n.state.status!=="error")&&By(n,i)}function By(n,a){return la(a.enabled,n)!==!1&&n.isStaleByTime(Wi(a.staleTime,n))}function jN(n,a){return!Jf(n.getCurrentResult(),a)}var Po,cs,_n,Jr,fs,Ui,Yb,RN=(Yb=class extends TS{constructor(a){super();Ce(this,fs);Ce(this,Po);Ce(this,cs);Ce(this,_n);Ce(this,Jr);oe(this,Po,a.client),this.mutationId=a.mutationId,oe(this,_n,a.mutationCache),oe(this,cs,[]),this.state=a.state||wS(),this.setOptions(a.options),this.scheduleGc()}setOptions(a){this.options=a,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(a){C(this,cs).includes(a)||(C(this,cs).push(a),this.clearGcTimeout(),C(this,_n).notify({type:"observerAdded",mutation:this,observer:a}))}removeObserver(a){oe(this,cs,C(this,cs).filter(i=>i!==a)),this.scheduleGc(),C(this,_n).notify({type:"observerRemoved",mutation:this,observer:a})}optionalRemove(){C(this,cs).length||(this.state.status==="pending"?this.scheduleGc():C(this,_n).remove(this))}continue(){var a;return((a=C(this,Jr))==null?void 0:a.continue())??this.execute(this.state.variables)}async execute(a){var m,g,b,y,_,w,T,S,N,O,j,R,k,H,F,J,pe,G;const i=()=>{Te(this,fs,Ui).call(this,{type:"continue"})},l={client:C(this,Po),meta:this.options.meta,mutationKey:this.options.mutationKey};oe(this,Jr,ES({fn:()=>this.options.mutationFn?this.options.mutationFn(a,l):Promise.reject(new Error("No mutationFn found")),onFail:(re,se)=>{Te(this,fs,Ui).call(this,{type:"failed",failureCount:re,error:se})},onPause:()=>{Te(this,fs,Ui).call(this,{type:"pause"})},onContinue:i,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>C(this,_n).canRun(this)}));const u=this.state.status==="pending",o=!C(this,Jr).canStart();try{if(u)i();else{Te(this,fs,Ui).call(this,{type:"pending",variables:a,isPaused:o}),C(this,_n).config.onMutate&&await C(this,_n).config.onMutate(a,this,l);const se=await((g=(m=this.options).onMutate)==null?void 0:g.call(m,a,l));se!==this.state.context&&Te(this,fs,Ui).call(this,{type:"pending",context:se,variables:a,isPaused:o})}const re=await C(this,Jr).start();return await((y=(b=C(this,_n).config).onSuccess)==null?void 0:y.call(b,re,a,this.state.context,this,l)),await((w=(_=this.options).onSuccess)==null?void 0:w.call(_,re,a,this.state.context,l)),await((S=(T=C(this,_n).config).onSettled)==null?void 0:S.call(T,re,null,this.state.variables,this.state.context,this,l)),await((O=(N=this.options).onSettled)==null?void 0:O.call(N,re,null,a,this.state.context,l)),Te(this,fs,Ui).call(this,{type:"success",data:re}),re}catch(re){try{await((R=(j=C(this,_n).config).onError)==null?void 0:R.call(j,re,a,this.state.context,this,l))}catch(se){Promise.reject(se)}try{await((H=(k=this.options).onError)==null?void 0:H.call(k,re,a,this.state.context,l))}catch(se){Promise.reject(se)}try{await((J=(F=C(this,_n).config).onSettled)==null?void 0:J.call(F,void 0,re,this.state.variables,this.state.context,this,l))}catch(se){Promise.reject(se)}try{await((G=(pe=this.options).onSettled)==null?void 0:G.call(pe,void 0,re,a,this.state.context,l))}catch(se){Promise.reject(se)}throw Te(this,fs,Ui).call(this,{type:"error",error:re}),re}finally{C(this,_n).runNext(this)}}},Po=new WeakMap,cs=new WeakMap,_n=new WeakMap,Jr=new WeakMap,fs=new WeakSet,Ui=function(a){const i=l=>{switch(a.type){case"failed":return{...l,failureCount:a.failureCount,failureReason:a.error};case"pause":return{...l,isPaused:!0};case"continue":return{...l,isPaused:!1};case"pending":return{...l,context:a.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:a.isPaused,status:"pending",variables:a.variables,submittedAt:Date.now()};case"success":return{...l,data:a.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...l,data:void 0,error:a.error,failureCount:l.failureCount+1,failureReason:a.error,isPaused:!1,status:"error"}}};this.state=i(this.state),rn.batch(()=>{C(this,cs).forEach(l=>{l.onMutationUpdate(a)}),C(this,_n).notify({mutation:this,type:"updated",action:a})})},Yb);function wS(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var Ys,Ya,ec,Ib,AN=(Ib=class extends Tu{constructor(a={}){super();Ce(this,Ys);Ce(this,Ya);Ce(this,ec);this.config=a,oe(this,Ys,new Set),oe(this,Ya,new Map),oe(this,ec,0)}build(a,i,l){const u=new RN({client:a,mutationCache:this,mutationId:++Hf(this,ec)._,options:a.defaultMutationOptions(i),state:l});return this.add(u),u}add(a){C(this,Ys).add(a);const i=Ff(a);if(typeof i=="string"){const l=C(this,Ya).get(i);l?l.push(a):C(this,Ya).set(i,[a])}this.notify({type:"added",mutation:a})}remove(a){if(C(this,Ys).delete(a)){const i=Ff(a);if(typeof i=="string"){const l=C(this,Ya).get(i);if(l)if(l.length>1){const u=l.indexOf(a);u!==-1&&l.splice(u,1)}else l[0]===a&&C(this,Ya).delete(i)}}this.notify({type:"removed",mutation:a})}canRun(a){const i=Ff(a);if(typeof i=="string"){const l=C(this,Ya).get(i),u=l==null?void 0:l.find(o=>o.state.status==="pending");return!u||u===a}else return!0}runNext(a){var l;const i=Ff(a);if(typeof i=="string"){const u=(l=C(this,Ya).get(i))==null?void 0:l.find(o=>o!==a&&o.state.isPaused);return(u==null?void 0:u.continue())??Promise.resolve()}else return Promise.resolve()}clear(){rn.batch(()=>{C(this,Ys).forEach(a=>{this.notify({type:"removed",mutation:a})}),C(this,Ys).clear(),C(this,Ya).clear()})}getAll(){return Array.from(C(this,Ys))}find(a){const i={exact:!0,...a};return this.getAll().find(l=>S0(i,l))}findAll(a={}){return this.getAll().filter(i=>S0(a,i))}notify(a){rn.batch(()=>{this.listeners.forEach(i=>{i(a)})})}resumePausedMutations(){const a=this.getAll().filter(i=>i.state.isPaused);return rn.batch(()=>Promise.all(a.map(i=>i.continue().catch(Dn))))}},Ys=new WeakMap,Ya=new WeakMap,ec=new WeakMap,Ib);function Ff(n){var a;return(a=n.options.scope)==null?void 0:a.id}var Is,$i,Yn,Gs,Xs,Gf,uy,Gb,kN=(Gb=class extends Tu{constructor(i,l){super();Ce(this,Xs);Ce(this,Is);Ce(this,$i);Ce(this,Yn);Ce(this,Gs);oe(this,Is,i),this.setOptions(l),this.bindMethods(),Te(this,Xs,Gf).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(i){var u;const l=this.options;this.options=C(this,Is).defaultMutationOptions(i),Jf(this.options,l)||C(this,Is).getMutationCache().notify({type:"observerOptionsUpdated",mutation:C(this,Yn),observer:this}),l!=null&&l.mutationKey&&this.options.mutationKey&&Pr(l.mutationKey)!==Pr(this.options.mutationKey)?this.reset():((u=C(this,Yn))==null?void 0:u.state.status)==="pending"&&C(this,Yn).setOptions(this.options)}onUnsubscribe(){var i;this.hasListeners()||(i=C(this,Yn))==null||i.removeObserver(this)}onMutationUpdate(i){Te(this,Xs,Gf).call(this),Te(this,Xs,uy).call(this,i)}getCurrentResult(){return C(this,$i)}reset(){var i;(i=C(this,Yn))==null||i.removeObserver(this),oe(this,Yn,void 0),Te(this,Xs,Gf).call(this),Te(this,Xs,uy).call(this)}mutate(i,l){var u;return oe(this,Gs,l),(u=C(this,Yn))==null||u.removeObserver(this),oe(this,Yn,C(this,Is).getMutationCache().build(C(this,Is),this.options)),C(this,Yn).addObserver(this),C(this,Yn).execute(i)}},Is=new WeakMap,$i=new WeakMap,Yn=new WeakMap,Gs=new WeakMap,Xs=new WeakSet,Gf=function(){var l;const i=((l=C(this,Yn))==null?void 0:l.state)??wS();oe(this,$i,{...i,isPending:i.status==="pending",isSuccess:i.status==="success",isError:i.status==="error",isIdle:i.status==="idle",mutate:this.mutate,reset:this.reset})},uy=function(i){rn.batch(()=>{var l,u,o,m,g,b,y,_;if(C(this,Gs)&&this.hasListeners()){const w=C(this,$i).variables,T=C(this,$i).context,S={client:C(this,Is),meta:this.options.meta,mutationKey:this.options.mutationKey};if((i==null?void 0:i.type)==="success"){try{(u=(l=C(this,Gs)).onSuccess)==null||u.call(l,i.data,w,T,S)}catch(N){Promise.reject(N)}try{(m=(o=C(this,Gs)).onSettled)==null||m.call(o,i.data,null,w,T,S)}catch(N){Promise.reject(N)}}else if((i==null?void 0:i.type)==="error"){try{(b=(g=C(this,Gs)).onError)==null||b.call(g,i.error,w,T,S)}catch(N){Promise.reject(N)}try{(_=(y=C(this,Gs)).onSettled)==null||_.call(y,void 0,i.error,w,T,S)}catch(N){Promise.reject(N)}}}this.listeners.forEach(w=>{w(C(this,$i))})})},Gb),ds,Xb,UN=(Xb=class extends Tu{constructor(a={}){super();Ce(this,ds);this.config=a,oe(this,ds,new Map)}build(a,i,l){const u=i.queryKey,o=i.queryHash??Vy(u,i);let m=this.get(o);return m||(m=new CN({client:a,queryKey:u,queryHash:o,options:a.defaultQueryOptions(i),state:l,defaultOptions:a.getQueryDefaults(u)}),this.add(m)),m}add(a){C(this,ds).has(a.queryHash)||(C(this,ds).set(a.queryHash,a),this.notify({type:"added",query:a}))}remove(a){const i=C(this,ds).get(a.queryHash);i&&(a.destroy(),i===a&&C(this,ds).delete(a.queryHash),this.notify({type:"removed",query:a}))}clear(){rn.batch(()=>{this.getAll().forEach(a=>{this.remove(a)})})}get(a){return C(this,ds).get(a)}getAll(){return[...C(this,ds).values()]}find(a){const i={exact:!0,...a};return this.getAll().find(l=>b0(i,l))}findAll(a={}){const i=this.getAll();return Object.keys(a).length>0?i.filter(l=>b0(a,l)):i}notify(a){rn.batch(()=>{this.listeners.forEach(i=>{i(a)})})}onFocus(){rn.batch(()=>{this.getAll().forEach(a=>{a.onFocus()})})}onOnline(){rn.batch(()=>{this.getAll().forEach(a=>{a.onOnline()})})}},ds=new WeakMap,Xb),Ft,Yi,Ii,cu,fu,Gi,du,hu,Qb,zN=(Qb=class{constructor(n={}){Ce(this,Ft);Ce(this,Yi);Ce(this,Ii);Ce(this,cu);Ce(this,fu);Ce(this,Gi);Ce(this,du);Ce(this,hu);oe(this,Ft,n.queryCache||new UN),oe(this,Yi,n.mutationCache||new AN),oe(this,Ii,n.defaultOptions||{}),oe(this,cu,new Map),oe(this,fu,new Map),oe(this,Gi,0)}mount(){Hf(this,Gi)._++,C(this,Gi)===1&&(oe(this,du,Hy.subscribe(async n=>{n&&(await this.resumePausedMutations(),C(this,Ft).onFocus())})),oe(this,hu,Pf.subscribe(async n=>{n&&(await this.resumePausedMutations(),C(this,Ft).onOnline())})))}unmount(){var n,a;Hf(this,Gi)._--,C(this,Gi)===0&&((n=C(this,du))==null||n.call(this),oe(this,du,void 0),(a=C(this,hu))==null||a.call(this),oe(this,hu,void 0))}isFetching(n){return C(this,Ft).findAll({...n,fetchStatus:"fetching"}).length}isMutating(n){return C(this,Yi).findAll({...n,status:"pending"}).length}getQueryData(n){var i;const a=this.defaultQueryOptions({queryKey:n});return(i=C(this,Ft).get(a.queryHash))==null?void 0:i.state.data}ensureQueryData(n){const a=this.defaultQueryOptions(n),i=C(this,Ft).build(this,a),l=i.state.data;return l===void 0?this.fetchQuery(n):(n.revalidateIfStale&&i.isStaleByTime(Wi(a.staleTime,i))&&this.prefetchQuery(a),Promise.resolve(l))}getQueriesData(n){return C(this,Ft).findAll(n).map(({queryKey:a,state:i})=>{const l=i.data;return[a,l]})}setQueryData(n,a,i){const l=this.defaultQueryOptions({queryKey:n}),u=C(this,Ft).get(l.queryHash),o=u==null?void 0:u.state.data,m=gN(a,o);if(m!==void 0)return C(this,Ft).build(this,l).setData(m,{...i,manual:!0})}setQueriesData(n,a,i){return rn.batch(()=>C(this,Ft).findAll(n).map(({queryKey:l})=>[l,this.setQueryData(l,a,i)]))}getQueryState(n){var i;const a=this.defaultQueryOptions({queryKey:n});return(i=C(this,Ft).get(a.queryHash))==null?void 0:i.state}removeQueries(n){const a=C(this,Ft);rn.batch(()=>{a.findAll(n).forEach(i=>{a.remove(i)})})}resetQueries(n,a){const i=C(this,Ft);return rn.batch(()=>(i.findAll(n).forEach(l=>{l.reset()}),this.refetchQueries({type:"active",...n},a)))}cancelQueries(n,a={}){const i={revert:!0,...a},l=rn.batch(()=>C(this,Ft).findAll(n).map(u=>u.cancel(i)));return Promise.all(l).then(Dn).catch(Dn)}invalidateQueries(n,a={}){return rn.batch(()=>(C(this,Ft).findAll(n).forEach(i=>{i.invalidate()}),(n==null?void 0:n.refetchType)==="none"?Promise.resolve():this.refetchQueries({...n,type:(n==null?void 0:n.refetchType)??(n==null?void 0:n.type)??"active"},a)))}refetchQueries(n,a={}){const i={...a,cancelRefetch:a.cancelRefetch??!0},l=rn.batch(()=>C(this,Ft).findAll(n).filter(u=>!u.isDisabled()&&!u.isStatic()).map(u=>{let o=u.fetch(void 0,i);return i.throwOnError||(o=o.catch(Dn)),u.state.fetchStatus==="paused"?Promise.resolve():o}));return Promise.all(l).then(Dn)}fetchQuery(n){const a=this.defaultQueryOptions(n);a.retry===void 0&&(a.retry=!1);const i=C(this,Ft).build(this,a);return i.isStaleByTime(Wi(a.staleTime,i))?i.fetch(a):Promise.resolve(i.state.data)}prefetchQuery(n){return this.fetchQuery(n).then(Dn).catch(Dn)}fetchInfiniteQuery(n){return n._type="infinite",this.fetchQuery(n)}prefetchInfiniteQuery(n){return this.fetchInfiniteQuery(n).then(Dn).catch(Dn)}ensureInfiniteQueryData(n){return n._type="infinite",this.ensureQueryData(n)}resumePausedMutations(){return Pf.isOnline()?C(this,Yi).resumePausedMutations():Promise.resolve()}getQueryCache(){return C(this,Ft)}getMutationCache(){return C(this,Yi)}getDefaultOptions(){return C(this,Ii)}setDefaultOptions(n){oe(this,Ii,n)}setQueryDefaults(n,a){C(this,cu).set(Pr(n),{queryKey:n,defaultOptions:a})}getQueryDefaults(n){const a=[...C(this,cu).values()],i={};return a.forEach(l=>{$o(n,l.queryKey)&&Object.assign(i,l.defaultOptions)}),i}setMutationDefaults(n,a){C(this,fu).set(Pr(n),{mutationKey:n,defaultOptions:a})}getMutationDefaults(n){const a=[...C(this,fu).values()],i={};return a.forEach(l=>{$o(n,l.mutationKey)&&Object.assign(i,l.defaultOptions)}),i}defaultQueryOptions(n){if(n._defaulted)return n;const a={...C(this,Ii).queries,...this.getQueryDefaults(n.queryKey),...n,_defaulted:!0};return a.queryHash||(a.queryHash=Vy(a.queryKey,a)),a.refetchOnReconnect===void 0&&(a.refetchOnReconnect=a.networkMode!=="always"),a.throwOnError===void 0&&(a.throwOnError=!!a.suspense),!a.networkMode&&a.persister&&(a.networkMode="offlineFirst"),a.queryFn===Fy&&(a.enabled=!1),a}defaultMutationOptions(n){return n!=null&&n._defaulted?n:{...C(this,Ii).mutations,...(n==null?void 0:n.mutationKey)&&this.getMutationDefaults(n.mutationKey),...n,_defaulted:!0}}clear(){C(this,Ft).clear(),C(this,Yi).clear()}},Ft=new WeakMap,Yi=new WeakMap,Ii=new WeakMap,cu=new WeakMap,fu=new WeakMap,Gi=new WeakMap,du=new WeakMap,hu=new WeakMap,Qb),CS=z.createContext(void 0),fa=n=>{const a=z.useContext(CS);if(!a)throw new Error("No QueryClient set, use QueryClientProvider to set one");return a},LN=({client:n,children:a})=>(z.useEffect(()=>(n.mount(),()=>{n.unmount()}),[n]),h.jsx(CS.Provider,{value:n,children:a})),MS=z.createContext(!1),HN=()=>z.useContext(MS);MS.Provider;function VN(){let n=!1;return{clearReset:()=>{n=!1},reset:()=>{n=!0},isReset:()=>n}}var FN=z.createContext(VN()),qN=()=>z.useContext(FN),BN=(n,a,i)=>{const l=i!=null&&i.state.error&&typeof n.throwOnError=="function"?qy(n.throwOnError,[i.state.error,i]):n.throwOnError;(n.suspense||n.experimental_prefetchInRender||l)&&(a.isReset()||(n.retryOnMount=!1))},ZN=n=>{z.useEffect(()=>{n.clearReset()},[n])},$N=({result:n,errorResetBoundary:a,throwOnError:i,query:l,suspense:u})=>n.isError&&!a.isReset()&&!n.isFetching&&l&&(u&&n.data===void 0||qy(i,[n.error,l])),YN=n=>{if(n.suspense){const i=u=>u==="static"?u:Math.max(u??1e3,1e3),l=n.staleTime;n.staleTime=typeof l=="function"?(...u)=>i(l(...u)):i(l),typeof n.gcTime=="number"&&(n.gcTime=Math.max(n.gcTime,1e3))}},IN=(n,a)=>n.isLoading&&n.isFetching&&!a,GN=(n,a)=>(n==null?void 0:n.suspense)&&a.isPending,C0=(n,a,i)=>a.fetchOptimistic(n).catch(()=>{i.clearReset()});function XN(n,a,i){var S,N,O,j;const l=HN(),u=qN(),o=fa(),m=o.defaultQueryOptions(n);(N=(S=o.getDefaultOptions().queries)==null?void 0:S._experimental_beforeQuery)==null||N.call(S,m);const g=o.getQueryCache().get(m.queryHash),b=n.subscribed!==!1;m._optimisticResults=l?"isRestoring":b?"optimistic":void 0,YN(m),BN(m,u,g),ZN(u);const y=!o.getQueryCache().get(m.queryHash),[_]=z.useState(()=>new a(o,m)),w=_.getOptimisticResult(m),T=!l&&b;if(z.useSyncExternalStore(z.useCallback(R=>{const k=T?_.subscribe(rn.batchCalls(R)):Dn;return _.updateResult(),k},[_,T]),()=>_.getCurrentResult(),()=>_.getCurrentResult()),z.useEffect(()=>{_.setOptions(m)},[m,_]),GN(m,w))throw C0(m,_,u);if($N({result:w,errorResetBoundary:u,throwOnError:m.throwOnError,query:g,suspense:m.suspense}))throw w.error;if((j=(O=o.getDefaultOptions().queries)==null?void 0:O._experimental_afterQuery)==null||j.call(O,m,w),m.experimental_prefetchInRender&&!Yo.isServer()&&IN(w,l)){const R=y?C0(m,_,u):g==null?void 0:g.promise;R==null||R.catch(Dn).finally(()=>{_.updateResult()})}return m.notifyOnChangeProps?w:_.trackResult(w)}function In(n,a){return XN(n,MN)}function ys(n,a){const i=fa(),[l]=z.useState(()=>new kN(i,n));z.useEffect(()=>{l.setOptions(n)},[l,n]);const u=z.useSyncExternalStore(z.useCallback(m=>l.subscribe(rn.batchCalls(m)),[l]),()=>l.getCurrentResult(),()=>l.getCurrentResult()),o=z.useCallback((m,g)=>{l.mutate(m,g).catch(Dn)},[l]);if(u.error&&qy(l.options.throwOnError,[u.error]))throw u.error;return{...u,mutate:o,mutateAsync:u.mutate}}const QN=/\{[^{}]+\}/g,WN=()=>{var n,a;return typeof process=="object"&&Number.parseInt((a=(n=process==null?void 0:process.versions)==null?void 0:n.node)==null?void 0:a.substring(0,2))>=18&&process.versions.undici};function KN(){return Math.random().toString(36).slice(2,11)}function JN(n){let{baseUrl:a="",Request:i=globalThis.Request,fetch:l=globalThis.fetch,querySerializer:u,bodySerializer:o,pathSerializer:m,headers:g,requestInitExt:b=void 0,...y}={...n};b=WN()?b:void 0,a=j0(a);const _=[];async function w(T,S){var Oe;const{baseUrl:N,fetch:O=l,Request:j=i,headers:R,params:k={},parseAs:H="json",querySerializer:F,bodySerializer:J=o??e_,pathSerializer:pe,body:G,middleware:re=[],...se}=S||{};let V=a;N&&(V=j0(N)??a);let K=typeof u=="function"?u:M0(u);F&&(K=typeof F=="function"?F:M0({...typeof u=="object"?u:{},...F}));const P=pe||m||PN,ie=G===void 0?void 0:J(G,D0(g,R,k.header)),Se=D0(ie===void 0||ie instanceof FormData?{}:{"Content-Type":"application/json"},g,R,k.header),be=[..._,...re],X={redirect:"follow",...y,...se,body:ie,headers:Se};let ce,ye,De=new j(t_(T,{baseUrl:V,params:k,querySerializer:K,pathSerializer:P}),X),Re;for(const Ne in se)Ne in De||(De[Ne]=se[Ne]);if(be.length){ce=KN(),ye=Object.freeze({baseUrl:V,fetch:O,parseAs:H,querySerializer:K,bodySerializer:J,pathSerializer:P});for(const Ne of be)if(Ne&&typeof Ne=="object"&&typeof Ne.onRequest=="function"){const Me=await Ne.onRequest({request:De,schemaPath:T,params:k,options:ye,id:ce});if(Me)if(Me instanceof j)De=Me;else if(Me instanceof Response){Re=Me;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!Re){try{Re=await O(De,b)}catch(Ne){let Me=Ne;if(be.length)for(let Le=be.length-1;Le>=0;Le--){const Ie=be[Le];if(Ie&&typeof Ie=="object"&&typeof Ie.onError=="function"){const ft=await Ie.onError({request:De,error:Me,schemaPath:T,params:k,options:ye,id:ce});if(ft){if(ft instanceof Response){Me=void 0,Re=ft;break}if(ft instanceof Error){Me=ft;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(Me)throw Me}if(be.length)for(let Ne=be.length-1;Ne>=0;Ne--){const Me=be[Ne];if(Me&&typeof Me=="object"&&typeof Me.onResponse=="function"){const Le=await Me.onResponse({request:De,response:Re,schemaPath:T,params:k,options:ye,id:ce});if(Le){if(!(Le instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");Re=Le}}}}const q=Re.headers.get("Content-Length");if(Re.status===204||De.method==="HEAD"||q==="0"&&!((Oe=Re.headers.get("Transfer-Encoding"))!=null&&Oe.includes("chunked")))return Re.ok?{data:void 0,response:Re}:{error:void 0,response:Re};if(Re.ok)return{data:await(async()=>{if(H==="stream")return Re.body;if(H==="json"&&!q){const Me=await Re.text();return Me?JSON.parse(Me):void 0}return await Re[H]()})(),response:Re};let ue=await Re.text();try{ue=JSON.parse(ue)}catch{}return{error:ue,response:Re}}return{request(T,S,N){return w(S,{...N,method:T.toUpperCase()})},GET(T,S){return w(T,{...S,method:"GET"})},PUT(T,S){return w(T,{...S,method:"PUT"})},POST(T,S){return w(T,{...S,method:"POST"})},DELETE(T,S){return w(T,{...S,method:"DELETE"})},OPTIONS(T,S){return w(T,{...S,method:"OPTIONS"})},HEAD(T,S){return w(T,{...S,method:"HEAD"})},PATCH(T,S){return w(T,{...S,method:"PATCH"})},TRACE(T,S){return w(T,{...S,method:"TRACE"})},use(...T){for(const S of T)if(S){if(typeof S!="object"||!("onRequest"in S||"onResponse"in S||"onError"in S))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");_.push(S)}},eject(...T){for(const S of T){const N=_.indexOf(S);N!==-1&&_.splice(N,1)}}}}function yd(n,a,i){if(a==null)return"";if(typeof a=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${n}=${(i==null?void 0:i.allowReserved)===!0?a:encodeURIComponent(a)}`}function DS(n,a,i){if(!a||typeof a!="object")return"";const l=[],u={simple:",",label:".",matrix:";"}[i.style]||"&";if(i.style!=="deepObject"&&i.explode===!1){for(const g in a)l.push(g,i.allowReserved===!0?a[g]:encodeURIComponent(a[g]));const m=l.join(",");switch(i.style){case"form":return`${n}=${m}`;case"label":return`.${m}`;case"matrix":return`;${n}=${m}`;default:return m}}for(const m in a){const g=i.style==="deepObject"?`${n}[${m}]`:m;l.push(yd(g,a[m],i))}const o=l.join(u);return i.style==="label"||i.style==="matrix"?`${u}${o}`:o}function jS(n,a,i){if(!Array.isArray(a))return"";if(i.explode===!1){const o={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[i.style]||",",m=(i.allowReserved===!0?a:a.map(g=>encodeURIComponent(g))).join(o);switch(i.style){case"simple":return m;case"label":return`.${m}`;case"matrix":return`;${n}=${m}`;default:return`${n}=${m}`}}const l={simple:",",label:".",matrix:";"}[i.style]||"&",u=[];for(const o of a)i.style==="simple"||i.style==="label"?u.push(i.allowReserved===!0?o:encodeURIComponent(o)):u.push(yd(n,o,i));return i.style==="label"||i.style==="matrix"?`${l}${u.join(l)}`:u.join(l)}function M0(n){return function(i){const l=[];if(i&&typeof i=="object")for(const u in i){const o=i[u];if(o!=null){if(Array.isArray(o)){if(o.length===0)continue;l.push(jS(u,o,{style:"form",explode:!0,...n==null?void 0:n.array,allowReserved:(n==null?void 0:n.allowReserved)||!1}));continue}if(typeof o=="object"){l.push(DS(u,o,{style:"deepObject",explode:!0,...n==null?void 0:n.object,allowReserved:(n==null?void 0:n.allowReserved)||!1}));continue}l.push(yd(u,o,n))}}return l.join("&")}}function PN(n,a){let i=n;for(const l of n.match(QN)??[]){let u=l.substring(1,l.length-1),o=!1,m="simple";if(u.endsWith("*")&&(o=!0,u=u.substring(0,u.length-1)),u.startsWith(".")?(m="label",u=u.substring(1)):u.startsWith(";")&&(m="matrix",u=u.substring(1)),!a||a[u]===void 0||a[u]===null)continue;const g=a[u];if(Array.isArray(g)){i=i.replace(l,jS(u,g,{style:m,explode:o}));continue}if(typeof g=="object"){i=i.replace(l,DS(u,g,{style:m,explode:o}));continue}if(m==="matrix"){i=i.replace(l,`;${yd(u,g)}`);continue}i=i.replace(l,m==="label"?`.${encodeURIComponent(g)}`:encodeURIComponent(g))}return i}function e_(n,a){return n instanceof FormData?n:a&&(a.get instanceof Function?a.get("Content-Type")??a.get("content-type"):a["Content-Type"]??a["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(n).toString():JSON.stringify(n)}function t_(n,a){var u;let i=`${a.baseUrl}${n}`;(u=a.params)!=null&&u.path&&(i=a.pathSerializer(i,a.params.path));let l=a.querySerializer(a.params.query??{});return l.startsWith("?")&&(l=l.substring(1)),l&&(i+=`?${l}`),i}function D0(...n){const a=new Headers;for(const i of n){if(!i||typeof i!="object")continue;const l=i instanceof Headers?i.entries():Object.entries(i);for(const[u,o]of l)if(o===null)a.delete(u);else if(Array.isArray(o))for(const m of o)a.append(u,m);else o!==void 0&&a.set(u,o)}return a}function j0(n){return n.endsWith("/")?n.substring(0,n.length-1):n}class oy extends Error{constructor(a,i){super(a),this.status=i,this.name="ApiError"}}const kt=JN({baseUrl:"/api/v1"});function Gt({data:n,error:a,response:i}){if(a!==void 0||!i.ok)throw new oy((a==null?void 0:a.error)??`HTTP ${i.status}`,i.status);if(n===void 0)throw new oy("empty response body",i.status);return n}function RS({error:n,response:a}){if(n!==void 0||!a.ok)throw new oy((n==null?void 0:n.error)??`HTTP ${a.status}`,a.status)}function n_(n=1e4){return In({queryKey:["health"],queryFn:async()=>Gt(await kt.GET("/health")),refetchInterval:n,retry:!1})}function a_(){return ys({mutationFn:async()=>Gt(await kt.POST("/shutdown"))})}function AS(){return In({queryKey:["machine"],queryFn:async()=>Gt(await kt.GET("/machine"))})}function kS(){return In({queryKey:["machines"],queryFn:async()=>Gt(await kt.GET("/machines"))})}function s_(){const n=fa();return ys({mutationFn:async a=>Gt(await kt.PUT("/machine",{body:{name:a}})),onSuccess:()=>{n.invalidateQueries({queryKey:["machine"]}),n.invalidateQueries({queryKey:["machines"]})}})}function i_(){return In({queryKey:["agents"],queryFn:async()=>Gt(await kt.GET("/agents"))})}function r_(){return In({queryKey:["config","user-prompt"],queryFn:async()=>{const{data:n,error:a,response:i}=await kt.GET("/config/user-prompt",{parseAs:"text"});return Gt({data:n,error:a,response:i})}})}function l_(){const n=fa();return ys({mutationFn:async a=>RS(await kt.PUT("/config/user-prompt",{body:{content:a}})),onSuccess:()=>{n.invalidateQueries({queryKey:["config","user-prompt"]})}})}function Zy(n={},a){return In({queryKey:["routines",n],queryFn:async()=>Gt(await kt.GET("/routines",{params:{query:n}})),...a})}function u_(n,a=!0){return In({queryKey:["routines",n],queryFn:async()=>Gt(await kt.GET("/routines/{id}",{params:{path:{id:n}}})),enabled:a&&n.length>0})}function ac(n,a){n.invalidateQueries({queryKey:["routines"]}),a&&n.invalidateQueries({queryKey:["routines",a]})}function o_(){const n=fa();return ys({mutationFn:async a=>Gt(await kt.POST("/routines",{body:a})),onSuccess:()=>ac(n)})}function c_(){const n=fa();return ys({mutationFn:async({id:a,body:i})=>Gt(await kt.PATCH("/routines/{id}",{params:{path:{id:a}},body:i})),onSuccess:(a,{id:i})=>ac(n,i)})}function f_(){const n=fa();return ys({mutationFn:async a=>Gt(await kt.DELETE("/routines/{id}",{params:{path:{id:a}}})),onSuccess:(a,i)=>ac(n,i)})}function US(){const n=fa();return ys({mutationFn:async a=>Gt(await kt.POST("/routines/{id}/trigger",{params:{path:{id:a}}})),onSuccess:(a,i)=>ac(n,i)})}function d_(){const n=fa();return ys({mutationFn:async()=>Gt(await kt.POST("/routines/cleanup")),onSuccess:()=>ac(n)})}function zS(){return In({queryKey:["routines","lock"],queryFn:async()=>Gt(await kt.GET("/routines/lock"))})}function LS(){const n=fa();return ys({mutationFn:async a=>Gt(await kt.DELETE("/routines/lock",{params:{query:{scope:a}}})),onSuccess:()=>void n.invalidateQueries({queryKey:["routines","lock"]})})}function $y(n,a){return In({queryKey:["routines","runs",n],queryFn:async()=>Gt(await kt.GET("/routines/runs",{params:{query:{limit:n}}})),...a})}function h_(n,a=!0){return In({queryKey:["routines",n,"runs"],queryFn:async()=>Gt(await kt.GET("/routines/{id}/runs",{params:{path:{id:n}}})),enabled:a&&n.length>0})}async function HS(n){const{data:a,error:i,response:l}=await n;return Gt({data:a,error:i,response:l})}function m_(n,a=!0){return In({queryKey:["routines",n,"logs"],queryFn:()=>HS(kt.GET("/routines/{id}/logs",{params:{path:{id:n}},parseAs:"text"})),enabled:a&&n.length>0})}function y_(n,a,i=!0){return In({queryKey:["routines",n,"runs",a,"log"],queryFn:()=>HS(kt.GET("/routines/{id}/runs/{workbench}/log",{params:{path:{id:n,workbench:a}},parseAs:"text"})),enabled:i&&n.length>0&&a.length>0})}function g_(n,a=!0){return In({queryKey:["routines",n,"flags"],queryFn:async()=>Gt(await kt.GET("/routines/{id}/flags",{params:{path:{id:n}}})),enabled:a&&n.length>0})}function v_(){const n=fa();return ys({mutationFn:async({id:a,filename:i})=>RS(await kt.DELETE("/routines/{id}/flags/{filename}",{params:{path:{id:a,filename:i}}})),onSuccess:(a,{id:i})=>void n.invalidateQueries({queryKey:["routines",i,"flags"]})})}function p_(n){return n?`/api/v1/routines.ics?routine=${encodeURIComponent(n)}`:"/api/v1/routines.ics"}const VS="moadim.client.theme";function b_(){try{return localStorage.getItem(VS)==="light"}catch{return!1}}function S_(n){try{localStorage.setItem(VS,n?"light":"dark")}catch{}}function x_(n){document.documentElement.classList.toggle("theme-light",n)}function E_(n){return n<60?`${n}s`:n<3600?`${Math.floor(n/60)}m`:`${Math.floor(n/3600)}h ${Math.floor(n%3600/60)}m`}function T_(n){const{health:a}=n,i=(a==null?void 0:a.status.toUpperCase())??"UNKNOWN",l=a!=null&&a.version?`/ v${a.version}`:"",u=a!=null&&a.git_sha&&a.git_sha!=="unknown"?`build: ${a.git_sha}`:void 0,o=(a==null?void 0:a.uptime_secs)!==void 0&&a.uptime_secs!==null?`/ UP ${E_(a.uptime_secs)}`:"",m=a!=null&&a.dependencies?!a.dependencies.tmux:!1,g=a!=null&&a.dependencies?!a.dependencies.python3:!1;return h.jsxs("header",{className:"app-header",children:[h.jsxs("span",{className:"brand",children:["MOADIM",h.jsx("span",{className:"brand-sub",children:"/ control"}),l&&h.jsx("span",{className:"brand-sub",title:u,children:l})]}),h.jsx("div",{className:"header-spacer"}),h.jsxs("div",{className:"header-right",children:[m&&h.jsx("span",{className:"dep-warn",title:"tmux is not on the daemon's PATH — all routine runs will silently fail",children:"⚠ NO TMUX"}),g&&h.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"}),h.jsxs("div",{className:"health",children:[h.jsx("div",{className:`health-dot ${n.healthOk?"ok":"error"}`}),h.jsx("span",{children:i}),h.jsx("span",{children:o})]}),n.machineName&&h.jsx("button",{className:"machine-badge",title:"Click to rename this machine",onClick:n.onRenameMachine,children:n.machineName}),h.jsx("button",{className:"icon-btn",title:n.light?"Switch to dark mode":"Switch to light mode",onClick:n.onTheme,children:n.light?"☀":"🌙"}),h.jsx("button",{className:"icon-btn",title:"Command palette (⌘K)",onClick:n.onPalette,children:"⌘K"}),h.jsx("button",{className:"icon-btn",title:"Refresh",onClick:n.onRefresh,children:"↻"}),h.jsx("button",{className:"icon-btn danger",title:"Stop the server",disabled:!n.healthOk,onClick:n.onStop,children:"⏻ Stop"})]})]})}const N_=[{to:"/",label:"Overview",end:!0},{to:"/routines",label:"Routines",end:!1},{to:"/heatmap",label:"Heatmap",end:!1},{to:"/reliability",label:"Reliability",end:!1},{to:"/settings",label:"Settings",end:!1}];function __(){return h.jsx("nav",{className:"app-nav",children:N_.map(n=>h.jsx(yS,{to:n.to,end:n.end,className:({isActive:a})=>`nav-link${a?" active":""}`,children:n.label},n.to))})}function O_(n){switch(n){case"nav-overview":return"home";case"nav-routines":case"routine":return"routines";case"nav-heatmap":return"heatmap";case"nav-settings":return"settings";default:return}}function w_(n){switch(n){case"nav-overview":case"nav-routines":case"nav-heatmap":case"nav-settings":return"GO";case"routine":return"ROUTINE";default:return"ACTION"}}function R0(n,a){const i=a.trim();if(i==="")return 0;const l=[...n.toLowerCase()],u=[...i.toLowerCase()];let o=0,m=0,g;for(const b of u){let y;for(;m<l.length;){const _=l[m];if(m+=1,_===b){y=m-1;break}}if(y===void 0)return;o+=1,y===0?o+=10:/[a-z0-9]/i.test(l[y-1]??"")||(o+=6),g!==void 0&&y===g+1&&(o+=8),g=y}return o-=Math.floor(l.length/16),o}function C_(n,a){const i=R0(n.title,a),l=R0(n.keywords,a),u=l===void 0?void 0:l-4;return i!==void 0&&u!==void 0?Math.max(i,u):i??u}function M_(n,a){const i=[];return n.forEach((l,u)=>{const o=C_(l,a);o!==void 0&&i.push([u,o])}),i.sort(([l,u],[o,m])=>m-u||l-o),i.map(([l])=>l)}function D_(n,a){return n||(a.trim()!==""?a:"—")}function j_(n){const a=D_(n.schedule_description,n.schedule),i=[];return n.enabled?(n.skip_runs??0)>0?i.push("SNOOZED"):n.agent_registered||i.push("AGENT MISSING"):i.push("DISABLED"),n.flag_count>0&&i.push("FLAGS"),i.length===0?a:`${a} — ${i.join(", ")}`}function R_(n){const a=[{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-heatmap",title:"Heatmap",subtitle:"7-day x 24-hour fire-density grid",keywords:"schedule density grid busy collisions calendar"},{kind:"nav-settings",title:"Settings",subtitle:"Persistent agent prompt",keywords:"config preferences user prompt"},{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-toggle-theme",title:"Toggle Theme",subtitle:"Switch between dark and light mode",keywords:"theme light dark mode toggle appearance action"}];for(const i of n)a.push({kind:"routine",title:i.title,subtitle:j_(i),keywords:`${i.id} ${i.agent} ${i.schedule} ${(i.tags??[]).join(" ")} routine`,routineId:i.id});return a}function A_(n,a){return a===0?0:Math.min(n,a-1)}function k_(n,a){return a===0?0:Math.min(n+1,a-1)}function U_(n){return Math.max(0,n-1)}function z_(n){return Math.max(0,n-1)}const L_={home:"/",routines:"/routines",heatmap:"/heatmap",settings:"/settings"};function H_({open:n,onClose:a,onRefresh:i,onStop:l,onToggleTheme:u}){const o=dd(),[m,g]=z.useState(""),[b,y]=z.useState(0),_=z.useRef(null),{data:w}=In({queryKey:["command-palette","routines"],queryFn:async()=>Gt(await kt.GET("/routines")),enabled:n}),[T,S]=z.useState(n);if(n!==T&&(S(n),n&&(g(""),y(0))),z.useEffect(()=>{var F;n&&((F=_.current)==null||F.focus())},[n]),!n)return null;const N=R_(w??[]),O=M_(N,m),j=A_(b,O.length),R=F=>{const J=N[O[F]??-1];if(J)switch(J.kind){case"action-refresh":i();break;case"action-stop":l();break;case"action-toggle-theme":u();break;default:{const pe=O_(J.kind);pe&&o(L_[pe]??"/")}}a()},k=F=>{switch(F.key){case"ArrowDown":F.preventDefault(),y(k_(j,O.length));break;case"ArrowUp":F.preventDefault(),y(U_(j));break;case"Home":F.preventDefault(),y(0);break;case"End":F.preventDefault(),y(z_(O.length));break;case"Enter":F.preventDefault(),R(j);break;case"Escape":F.preventDefault(),a();break}},H=O.length>0?`cmdk-opt-${j}`:void 0;return h.jsx("div",{className:"overlay",onClick:a,children:h.jsxs("div",{className:"cmdk",role:"dialog","aria-modal":"true","aria-label":"Command palette",onClick:F=>F.stopPropagation(),children:[h.jsxs("div",{className:"cmdk-search",children:[h.jsx("span",{"aria-hidden":"true",children:"›"}),h.jsx("input",{ref:_,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":H,value:m,onChange:F=>{g(F.target.value),y(0)},onKeyDown:k}),h.jsx("span",{className:"cmdk-hint","aria-hidden":"true",children:"ESC"})]}),O.length===0?h.jsxs("div",{className:"cmdk-empty",children:[h.jsx("div",{children:"NO MATCHES"}),h.jsx("div",{children:"no page or routine matches"})]}):h.jsx("ul",{id:"cmdk-listbox",className:"cmdk-list",role:"listbox","aria-label":"Results",children:O.map((F,J)=>{const pe=N[F];if(!pe)return null;const G=J===j;return h.jsxs("li",{id:`cmdk-opt-${J}`,className:`cmdk-row${G?" active":""}`,role:"option","aria-selected":G,onClick:()=>R(J),onMouseEnter:()=>y(J),children:[h.jsx("span",{className:"kind-badge",children:w_(pe.kind)}),h.jsxs("span",{className:"cmdk-row-text",children:[h.jsx("span",{className:"cmdk-row-title",children:pe.title}),h.jsx("span",{className:"cmdk-row-sub",children:pe.subtitle})]})]},F)})}),h.jsxs("div",{className:"cmdk-foot","aria-hidden":"true",children:[h.jsxs("span",{children:[h.jsx("span",{className:"cmdk-key",children:"↑↓"})," navigate"]}),h.jsxs("span",{children:[h.jsx("span",{className:"cmdk-key",children:"↵"})," open"]}),h.jsxs("span",{children:[h.jsx("span",{className:"cmdk-key",children:"esc"})," close"]})]})]})})}function V_({current:n,onCancel:a,onConfirm:i}){const[l,u]=z.useState(n),[o,m]=z.useState(!1),g=l.trim(),b=async()=>{if(g!==""){m(!0);try{await i(g)}finally{m(!1)}}};return h.jsx("div",{className:"overlay",onClick:a,children:h.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-labelledby":"rename-machine-title",onClick:y=>y.stopPropagation(),children:[h.jsx("div",{id:"rename-machine-title",className:"dialog-title",children:"Rename machine"}),h.jsxs("div",{className:"dialog-msg",children:[h.jsx("label",{className:"form-label",htmlFor:"rename-machine-input",children:"Machine name"}),h.jsx("input",{id:"rename-machine-input",className:"form-input",type:"text",value:l,onChange:y=>u(y.target.value),disabled:o,autoComplete:"off",spellCheck:!1})]}),h.jsxs("div",{className:"dialog-actions",children:[h.jsx("button",{className:"btn btn-ghost",onClick:a,disabled:o,children:"Cancel"}),h.jsx("button",{className:"btn btn-primary",onClick:()=>void b(),disabled:o||g==="",children:o?"Saving…":"Rename"})]})]})})}function F_({onCancel:n,onConfirm:a}){return h.jsx("div",{className:"overlay",onClick:n,children:h.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-labelledby":"shutdown-dialog-title",onClick:i=>i.stopPropagation(),children:[h.jsx("div",{id:"shutdown-dialog-title",className:"dialog-title",children:"⏻ Stop server"}),h.jsx("div",{className:"dialog-msg",children:"Stop the moadim server? Scheduled jobs and routines will not run until it is started again."}),h.jsxs("div",{className:"dialog-actions",children:[h.jsx("button",{className:"btn btn-ghost",onClick:n,children:"Cancel"}),h.jsx("button",{className:"btn btn-danger",onClick:a,children:"Stop server"})]})]})})}const FS=z.createContext(null);function q_({children:n}){const[a,i]=z.useState([]),l=z.useRef(0),u=z.useCallback((o,m)=>{const g=l.current++;i(b=>[...b,{id:g,msg:o,kind:m}]),setTimeout(()=>i(b=>b.filter(y=>y.id!==g)),5e3)},[]);return h.jsx(FS.Provider,{value:{toasts:a,addToast:u},children:n})}function Nu(){const n=z.useContext(FS);if(!n)throw new Error("useToasts must be used within a ToastProvider");return n}function B_(){const{toasts:n}=Nu();return h.jsx("div",{className:"toast-wrap",role:"status","aria-live":"polite","aria-atomic":"false",children:n.map(a=>h.jsx("div",{className:`toast ${a.kind}`,children:a.msg},a.id))})}function Z_(){var R,k,H;const[n,a]=z.useState(b_),[i,l]=z.useState(!1),[u,o]=z.useState(!1),[m,g]=z.useState(!1),b=fa(),{addToast:y}=Nu(),_=n_(3e4),w=AS(),T=a_(),S=s_();z.useEffect(()=>{x_(n)},[n]),z.useEffect(()=>{const F=J=>{(J.metaKey||J.ctrlKey)&&J.key.toLowerCase()==="k"?(J.preventDefault(),o(pe=>!pe)):J.key==="Escape"&&(l(!1),g(!1))};return window.addEventListener("keydown",F),()=>window.removeEventListener("keydown",F)},[]);const N=()=>{a(F=>{const J=!F;return S_(J),J})},O=()=>{l(!1),T.mutate(void 0,{onSuccess:()=>{y("Server stopping…","ok"),b.invalidateQueries({queryKey:["health"]})},onError:F=>y(`Stop failed: ${F.message}`,"err")})},j=async F=>{try{await S.mutateAsync(F),g(!1),y(`Machine renamed to "${F}"`,"ok")}catch(J){throw y(`Rename failed: ${J instanceof Error?J.message:String(J)}`,"err"),J}};return h.jsxs("div",{className:"app-shell",children:[h.jsx(T_,{health:_.data,healthOk:((R=_.data)==null?void 0:R.running)??!1,light:n,machineName:(k=w.data)==null?void 0:k.name,onRefresh:()=>void _.refetch(),onStop:()=>l(!0),onPalette:()=>o(F=>!F),onTheme:N,onRenameMachine:()=>g(!0)}),h.jsx(__,{}),h.jsx("div",{className:"page",children:h.jsx(MT,{})}),h.jsx(H_,{open:u,onClose:()=>o(!1),onRefresh:()=>void _.refetch(),onStop:()=>l(!0),onToggleTheme:N}),m&&h.jsx(V_,{current:((H=w.data)==null?void 0:H.name)??"",onCancel:()=>g(!1),onConfirm:j}),i&&h.jsx(F_,{onCancel:()=>l(!1),onConfirm:O}),h.jsx(B_,{})]})}function qS({status:n,onUnlock:a}){return!n||!n.locked?null:h.jsxs("div",{className:"card",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",marginBottom:16,borderColor:"var(--warn)"},children:[h.jsxs("div",{style:{fontSize:13,fontWeight:600},children:["⚠ Routines globally locked — scheduling and manual triggers paused",n.shared&&h.jsx("span",{style:{marginLeft:8,fontSize:11,color:"var(--text-faint)"},children:"SHARED .lock"}),n.local&&h.jsx("span",{style:{marginLeft:8,fontSize:11,color:"var(--text-faint)"},children:"LOCAL .local.lock"})]}),h.jsx("button",{className:"btn btn-ghost",onClick:a,children:"Unlock all"})]})}function Yy(n=1e3){const[a,i]=z.useState(()=>Date.now());return z.useEffect(()=>{const l=setInterval(()=>i(Date.now()),n);return()=>clearInterval(l)},[n]),a}const BS=[{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}],ZS="moadim.refresh-interval";function $_(n){return n==="off"||n==="5"||n==="15"||n==="30"||n==="60"}function sc(n){var a;return(a=BS.find(i=>i.token===n))==null?void 0:a.ms}function ic(){try{const n=localStorage.getItem(ZS);return $_(n)?n:"off"}catch{return"off"}}function rc(n){try{localStorage.setItem(ZS,n)}catch{}}function Iy(n){return n<60?"updated just now":n<3600?`updated ${Math.floor(n/60)}m ago`:`updated ${Math.floor(n/3600)}h ago`}function lc({token:n,updatedAtMs:a,onChange:i}){const l=Yy(),u=a>0?Iy(Math.max(0,Math.floor((l-a)/1e3))):void 0;return h.jsxs("div",{className:"refresh-control",children:[h.jsx("label",{className:"refresh-lbl",htmlFor:"refresh-interval",children:"AUTO"}),h.jsx("select",{id:"refresh-interval",className:"refresh-select",value:n,"aria-label":"Auto-refresh interval",onChange:o=>i(o.target.value),children:BS.map(o=>h.jsx("option",{value:o.token,children:o.label},o.token))}),u!==void 0&&h.jsx("span",{className:"refresh-fresh",title:"Time since the list last refreshed",children:u})]})}const $S="moadim.notify-failures";function Y_(){try{return localStorage.getItem($S)==="1"}catch{return!1}}function A0(n){try{localStorage.setItem($S,n?"1":"0")}catch{}}function YS(){return typeof Notification<"u"}function I_(){return YS()?Notification.permission:"unsupported"}async function G_(){return YS()?Notification.permission!=="default"?Notification.permission:Notification.requestPermission():"unsupported"}function k0(n){return new Map(n.map(a=>[a.workbench,a.status]))}function X_(n,a){return n.filter(i=>i.status==="failed"&&a.get(i.workbench)!=="failed")}function Q_(n){return{title:`${n.routine_title} failed`,body:n.exit_code==null?"Run failed":`Exit code ${n.exit_code}`}}function W_(n){if(I_()!=="granted")return;const{title:a,body:i}=Q_(n);new Notification(a,{body:i,tag:n.workbench})}var Lr={},ia={},Do={},Hr={},Rm={},U0;function K_(){return U0||(U0=1,Object.defineProperty(Rm,"__esModule",{value:!0})),Rm}var jo={},Ro={},z0;function nl(){var a,i,l,u,o,IS,g;if(z0)return Ro;z0=1,Object.defineProperty(Ro,"__esModule",{value:!0}),Ro.CronField=void 0;let n=(g=class{constructor(y,_={rawValue:""}){Ce(this,o);Ce(this,a,!1);Ce(this,i,!1);Ce(this,l,!1);Ce(this,u,[]);t0(this,"options",{rawValue:""});if(!Array.isArray(y))throw new Error(`${this.constructor.name} Validation error, values is not an array`);if(!(y.length>0))throw new Error(`${this.constructor.name} Validation error, values contains no values`);this.options={..._,rawValue:_.rawValue??""},oe(this,u,y.sort(g.sorter)),oe(this,l,this.options.wildcard!==void 0?this.options.wildcard:Te(this,o,IS).call(this)),oe(this,a,this.options.rawValue.includes("L")||y.includes("L")),oe(this,i,this.options.rawValue.includes("?")||y.includes("?"))}static get min(){throw new Error("min must be overridden")}static get max(){throw new 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}}get min(){return this.constructor.min}get max(){return this.constructor.max}get chars(){return this.constructor.chars}get hasLastChar(){return C(this,a)}get hasQuestionMarkChar(){return C(this,i)}get isWildcard(){return C(this,l)}get values(){return C(this,u)}static sorter(y,_){const w=typeof y=="number",T=typeof _=="number";return w&&T?y-_:!w&&!T?y.localeCompare(_):w?-1:1}static findNearestValueInList(y,_,w){if(w){for(let T=y.length-1;T>=0;T--)if(y[T]<_)return y[T];return null}for(let T=0;T<y.length;T++)if(y[T]>_)return y[T];return null}findNearestValue(y,_){return this.constructor.findNearestValueInList(this.values,y,_)}serialize(){return{wildcard:C(this,l),values:C(this,u)}}validate(){let y;const _=this.chars.length>0?` or chars ${this.chars.join("")}`:"",w=O=>j=>new RegExp(`^\\d{0,2}${j}$`).test(O),T=O=>(y=O,typeof O=="number"?O>=this.min&&O<=this.max:this.chars.some(w(O)));if(!C(this,u).every(T))throw new Error(`${this.constructor.name} Validation error, got value ${y} expected range ${this.min}-${this.max}${_}`);const N=C(this,u).find((O,j)=>C(this,u).indexOf(O)!==j);if(N)throw new Error(`${this.constructor.name} Validation error, duplicate values found: ${N}`)}},a=new WeakMap,i=new WeakMap,l=new WeakMap,u=new WeakMap,o=new WeakSet,IS=function(){return this.options.rawValue.length>0?["*","?"].includes(this.options.rawValue):Array.from({length:this.max-this.min+1},(y,_)=>_+this.min).every(y=>C(this,u).includes(y))},g);return Ro.CronField=n,Ro}var L0;function J_(){if(L0)return jo;L0=1,Object.defineProperty(jo,"__esModule",{value:!0}),jo.CronDayOfMonth=void 0;const n=nl(),a=1,i=31,l=Object.freeze(["L"]);let u=class extends n.CronField{static get min(){return a}static get max(){return i}static get chars(){return l}static get validChars(){return/^[?,*\dLH/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(m,g){super(m,g),this.validate()}get values(){return super.values}};return jo.CronDayOfMonth=u,jo}var Ao={},H0;function P_(){if(H0)return Ao;H0=1,Object.defineProperty(Ao,"__esModule",{value:!0}),Ao.CronDayOfWeek=void 0;const n=nl(),a=0,i=7,l=Object.freeze(["L"]);let u=class extends n.CronField{static get min(){return a}static get max(){return i}static get chars(){return l}static get validChars(){return/^[?,*\dLH#/-]+$|^.*H\(\d+-\d+\)\/\d+.*$|^.*H\(\d+-\d+\).*$|^.*H\/\d+.*$/}constructor(m,g){super(m,g),this.validate()}get values(){return super.values}get nthDay(){return this.options.nthDayOfWeek??0}};return Ao.CronDayOfWeek=u,Ao}var ko={},V0;function eO(){if(V0)return ko;V0=1,Object.defineProperty(ko,"__esModule",{value:!0}),ko.CronHour=void 0;const n=nl(),a=0,i=23,l=Object.freeze([]);let u=class extends n.CronField{static get min(){return a}static get max(){return i}static get chars(){return l}constructor(m,g){super(m,g),this.validate()}get values(){return super.values}};return ko.CronHour=u,ko}var Uo={},F0;function tO(){if(F0)return Uo;F0=1,Object.defineProperty(Uo,"__esModule",{value:!0}),Uo.CronMinute=void 0;const n=nl(),a=0,i=59,l=Object.freeze([]);let u=class extends n.CronField{static get min(){return a}static get max(){return i}static get chars(){return l}constructor(m,g){super(m,g),this.validate()}get values(){return super.values}};return Uo.CronMinute=u,Uo}var zo={},Am={},Zn={},q0;function nO(){if(q0)return Zn;q0=1,Object.defineProperty(Zn,"__esModule",{value:!0});class n extends Error{}class a extends n{constructor(c){super(`Invalid DateTime: ${c.toMessage()}`)}}class i extends n{constructor(c){super(`Invalid Interval: ${c.toMessage()}`)}}class l extends n{constructor(c){super(`Invalid Duration: ${c.toMessage()}`)}}class u extends n{}class o extends n{constructor(c){super(`Invalid unit ${c}`)}}class m extends n{}class g extends n{constructor(){super("Zone is an abstract class")}}const b="numeric",y="short",_="long",w={year:b,month:b,day:b},T={year:b,month:y,day:b},S={year:b,month:y,day:b,weekday:y},N={year:b,month:_,day:b},O={year:b,month:_,day:b,weekday:_},j={hour:b,minute:b},R={hour:b,minute:b,second:b},k={hour:b,minute:b,second:b,timeZoneName:y},H={hour:b,minute:b,second:b,timeZoneName:_},F={hour:b,minute:b,hourCycle:"h23"},J={hour:b,minute:b,second:b,hourCycle:"h23"},pe={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:y},G={hour:b,minute:b,second:b,hourCycle:"h23",timeZoneName:_},re={year:b,month:b,day:b,hour:b,minute:b},se={year:b,month:b,day:b,hour:b,minute:b,second:b},V={year:b,month:y,day:b,hour:b,minute:b},K={year:b,month:y,day:b,hour:b,minute:b,second:b},P={year:b,month:y,day:b,weekday:y,hour:b,minute:b},ie={year:b,month:_,day:b,hour:b,minute:b,timeZoneName:y},Se={year:b,month:_,day:b,hour:b,minute:b,second:b,timeZoneName:y},be={year:b,month:_,day:b,weekday:_,hour:b,minute:b,timeZoneName:_},X={year:b,month:_,day:b,weekday:_,hour:b,minute:b,second:b,timeZoneName:_};class ce{get type(){throw new g}get name(){throw new g}get ianaName(){return this.name}get isUniversal(){throw new g}offsetName(c,v){throw new g}formatOffset(c,v){throw new g}offset(c){throw new g}equals(c){throw new g}get isValid(){throw new g}}let ye=null;class De extends ce{static get instance(){return ye===null&&(ye=new De),ye}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(c,{format:v,locale:E}){return Es(c,v,E)}formatOffset(c,v){return lr(this.offset(c),v)}offset(c){return-new Date(c).getTimezoneOffset()}equals(c){return c.type==="system"}get isValid(){return!0}}const Re=new Map;function q(p){let c=Re.get(p);return c===void 0&&(c=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:p,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),Re.set(p,c)),c}const ue={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function Oe(p,c){const v=p.format(c).replace(/\u200E/g,""),E=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(v),[,M,U,Z,$,I,xe,ke]=E;return[Z,M,U,$,I,xe,ke]}function Ne(p,c){const v=p.formatToParts(c),E=[];for(let M=0;M<v.length;M++){const{type:U,value:Z}=v[M],$=ue[U];U==="era"?E[$]=Z:Ze($)||(E[$]=parseInt(Z,10))}return E}const Me=new Map;class Le extends ce{static create(c){let v=Me.get(c);return v===void 0&&Me.set(c,v=new Le(c)),v}static resetCache(){Me.clear(),Re.clear()}static isValidSpecifier(c){return this.isValidZone(c)}static isValidZone(c){if(!c)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:c}).format(),!0}catch{return!1}}constructor(c){super(),this.zoneName=c,this.valid=Le.isValidZone(c)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(c,{format:v,locale:E}){return Es(c,v,E,this.name)}formatOffset(c,v){return lr(this.offset(c),v)}offset(c){if(!this.valid)return NaN;const v=new Date(c);if(isNaN(v))return NaN;const E=q(this.name);let[M,U,Z,$,I,xe,ke]=E.formatToParts?Ne(E,v):Oe(E,v);$==="BC"&&(M=-Math.abs(M)+1);const it=hn({year:M,month:U,day:Z,hour:I===24?0:I,minute:xe,second:ke,millisecond:0});let $e=+v;const Ut=$e%1e3;return $e-=Ut>=0?Ut:1e3+Ut,(it-$e)/(60*1e3)}equals(c){return c.type==="iana"&&c.name===this.name}get isValid(){return this.valid}}let Ie={};function ft(p,c={}){const v=JSON.stringify([p,c]);let E=Ie[v];return E||(E=new Intl.ListFormat(p,c),Ie[v]=E),E}const tt=new Map;function Lt(p,c={}){const v=JSON.stringify([p,c]);let E=tt.get(v);return E===void 0&&(E=new Intl.DateTimeFormat(p,c),tt.set(v,E)),E}const Gn=new Map;function Xn(p,c={}){const v=JSON.stringify([p,c]);let E=Gn.get(v);return E===void 0&&(E=new Intl.NumberFormat(p,c),Gn.set(v,E)),E}const Wa=new Map;function jn(p,c={}){const{base:v,...E}=c,M=JSON.stringify([p,E]);let U=Wa.get(M);return U===void 0&&(U=new Intl.RelativeTimeFormat(p,c),Wa.set(M,U)),U}let Qn=null;function Ma(){return Qn||(Qn=new Intl.DateTimeFormat().resolvedOptions().locale,Qn)}const Ka=new Map;function da(p){let c=Ka.get(p);return c===void 0&&(c=new Intl.DateTimeFormat(p).resolvedOptions(),Ka.set(p,c)),c}const Wn=new Map;function gs(p){let c=Wn.get(p);if(!c){const v=new Intl.Locale(p);c="getWeekInfo"in v?v.getWeekInfo():v.weekInfo,"minimalDays"in c||(c={...A,...c}),Wn.set(p,c)}return c}function Ja(p){const c=p.indexOf("-x-");c!==-1&&(p=p.substring(0,c));const v=p.indexOf("-u-");if(v===-1)return[p];{let E,M;try{E=Lt(p).resolvedOptions(),M=p}catch{const I=p.substring(0,v);E=Lt(I).resolvedOptions(),M=I}const{numberingSystem:U,calendar:Z}=E;return[M,U,Z]}}function er(p,c,v){return(v||c)&&(p.includes("-u-")||(p+="-u"),v&&(p+=`-ca-${v}`),c&&(p+=`-nu-${c}`)),p}function Ks(p){const c=[];for(let v=1;v<=12;v++){const E=qe.utc(2009,v,1);c.push(p(E))}return c}function Xt(p){const c=[];for(let v=1;v<=7;v++){const E=qe.utc(2016,11,13+v);c.push(p(E))}return c}function Pa(p,c,v,E){const M=p.listingMode();return M==="error"?null:M==="en"?v(c):E(c)}function Js(p){return p.numberingSystem&&p.numberingSystem!=="latn"?!1:p.numberingSystem==="latn"||!p.locale||p.locale.startsWith("en")||da(p.locale).numberingSystem==="latn"}class tr{constructor(c,v,E){this.padTo=E.padTo||0,this.floor=E.floor||!1;const{padTo:M,floor:U,...Z}=E;if(!v||Object.keys(Z).length>0){const $={useGrouping:!1,...E};E.padTo>0&&($.minimumIntegerDigits=E.padTo),this.inf=Xn(c,$)}}format(c){if(this.inf){const v=this.floor?Math.floor(c):c;return this.inf.format(v)}else{const v=this.floor?Math.floor(c):sr(c,3);return vt(v,this.padTo)}}}class Kn{constructor(c,v,E){this.opts=E,this.originalZone=void 0;let M;if(this.opts.timeZone)this.dt=c;else if(c.zone.type==="fixed"){const Z=-1*(c.offset/60),$=Z>=0?`Etc/GMT+${Z}`:`Etc/GMT${Z}`;c.offset!==0&&Le.create($).valid?(M=$,this.dt=c):(M="UTC",this.dt=c.offset===0?c:c.setZone("UTC").plus({minutes:c.offset}),this.originalZone=c.zone)}else c.zone.type==="system"?this.dt=c:c.zone.type==="iana"?(this.dt=c,M=c.zone.name):(M="UTC",this.dt=c.setZone("UTC").plus({minutes:c.offset}),this.originalZone=c.zone);const U={...this.opts};U.timeZone=U.timeZone||M,this.dtf=Lt(v,U)}format(){return this.originalZone?this.formatToParts().map(({value:c})=>c).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const c=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?c.map(v=>{if(v.type==="timeZoneName"){const E=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...v,value:E}}else return v}):c}resolvedOptions(){return this.dtf.resolvedOptions()}}class vs{constructor(c,v,E){this.opts={style:"long",...E},!v&&Cu()&&(this.rtf=jn(c,E))}format(c,v){return this.rtf?this.rtf.format(c,v):ns(v,c,this.opts.numeric,this.opts.style!=="long")}formatToParts(c,v){return this.rtf?this.rtf.formatToParts(c,v):[]}}const A={firstDay:1,minimalDays:4,weekend:[6,7]};class B{static fromOpts(c){return B.create(c.locale,c.numberingSystem,c.outputCalendar,c.weekSettings,c.defaultToEN)}static create(c,v,E,M,U=!1){const Z=c||wt.defaultLocale,$=Z||(U?"en-US":Ma()),I=v||wt.defaultNumberingSystem,xe=E||wt.defaultOutputCalendar,ke=Mu(M)||wt.defaultWeekSettings;return new B($,I,xe,ke,Z)}static resetCache(){Qn=null,tt.clear(),Gn.clear(),Wa.clear(),Ka.clear(),Wn.clear()}static fromObject({locale:c,numberingSystem:v,outputCalendar:E,weekSettings:M}={}){return B.create(c,v,E,M)}constructor(c,v,E,M,U){const[Z,$,I]=Ja(c);this.locale=Z,this.numberingSystem=v||$||null,this.outputCalendar=E||I||null,this.weekSettings=M,this.intl=er(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=U,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Js(this)),this.fastNumbersCached}listingMode(){const c=this.isEnglish(),v=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return c&&v?"en":"intl"}clone(c){return!c||Object.getOwnPropertyNames(c).length===0?this:B.create(c.locale||this.specifiedLocale,c.numberingSystem||this.numberingSystem,c.outputCalendar||this.outputCalendar,Mu(c.weekSettings)||this.weekSettings,c.defaultToEN||!1)}redefaultToEN(c={}){return this.clone({...c,defaultToEN:!0})}redefaultToSystem(c={}){return this.clone({...c,defaultToEN:!1})}months(c,v=!1){return Pa(this,c,Sc,()=>{const E=this.intl==="ja"||this.intl.startsWith("ja-");v&=!E;const M=v?{month:c,day:"numeric"}:{month:c},U=v?"format":"standalone";if(!this.monthsCache[U][c]){const Z=E?$=>this.dtFormatter($,M).format():$=>this.extract($,M,"month");this.monthsCache[U][c]=Ks(Z)}return this.monthsCache[U][c]})}weekdays(c,v=!1){return Pa(this,c,dl,()=>{const E=v?{weekday:c,year:"numeric",month:"long",day:"numeric"}:{weekday:c},M=v?"format":"standalone";return this.weekdaysCache[M][c]||(this.weekdaysCache[M][c]=Xt(U=>this.extract(U,E,"weekday"))),this.weekdaysCache[M][c]})}meridiems(){return Pa(this,void 0,()=>Ts,()=>{if(!this.meridiemCache){const c={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[qe.utc(2016,11,13,9),qe.utc(2016,11,13,19)].map(v=>this.extract(v,c,"dayperiod"))}return this.meridiemCache})}eras(c){return Pa(this,c,ku,()=>{const v={era:c};return this.eraCache[c]||(this.eraCache[c]=[qe.utc(-40,1,1),qe.utc(2017,1,1)].map(E=>this.extract(E,v,"era"))),this.eraCache[c]})}extract(c,v,E){const M=this.dtFormatter(c,v),U=M.formatToParts(),Z=U.find($=>$.type.toLowerCase()===E);return Z?Z.value:null}numberFormatter(c={}){return new tr(this.intl,c.forceSimple||this.fastNumbers,c)}dtFormatter(c,v={}){return new Kn(c,this.intl,v)}relFormatter(c={}){return new vs(this.intl,this.isEnglish(),c)}listFormatter(c={}){return ft(this.intl,c)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||da(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:es()?gs(this.locale):A}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(c){return this.locale===c.locale&&this.numberingSystem===c.numberingSystem&&this.outputCalendar===c.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let ee=null;class he extends ce{static get utcInstance(){return ee===null&&(ee=new he(0)),ee}static instance(c){return c===0?he.utcInstance:new he(c)}static parseSpecifier(c){if(c){const v=c.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(v)return new he(rr(v[1],v[2]))}return null}constructor(c){super(),this.fixed=c}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${lr(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${lr(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(c,v){return lr(this.fixed,v)}get isUniversal(){return!0}offset(){return this.fixed}equals(c){return c.type==="fixed"&&c.fixed===this.fixed}get isValid(){return!0}}class ve extends ce{constructor(c){super(),this.zoneName=c}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 _e(p,c){if(Ze(p)||p===null)return c;if(p instanceof ce)return p;if(Qt(p)){const v=p.toLowerCase();return v==="default"?c:v==="local"||v==="system"?De.instance:v==="utc"||v==="gmt"?he.utcInstance:he.parseSpecifier(v)||Le.create(p)}else return An(p)?he.instance(p):typeof p=="object"&&"offset"in p&&typeof p.offset=="function"?p:new ve(p)}const Ee={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},Q={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]},de=Ee.hanidec.replace(/[\[|\]]/g,"").split("");function Ae(p){let c=parseInt(p,10);if(isNaN(c)){c="";for(let v=0;v<p.length;v++){const E=p.charCodeAt(v);if(p[v].search(Ee.hanidec)!==-1)c+=de.indexOf(p[v]);else for(const M in Q){const[U,Z]=Q[M];E>=U&&E<=Z&&(c+=E-U)}}return parseInt(c,10)}else return c}const Pe=new Map;function Ot(){Pe.clear()}function yt({numberingSystem:p},c=""){const v=p||"latn";let E=Pe.get(v);E===void 0&&(E=new Map,Pe.set(v,E));let M=E.get(c);return M===void 0&&(M=new RegExp(`${Ee[v]}${c}`),E.set(c,M)),M}let ln=()=>Date.now(),ps="system",Da=null,al=null,Ps=null,sl=60,ei,dc=null;class wt{static get now(){return ln}static set now(c){ln=c}static set defaultZone(c){ps=c}static get defaultZone(){return _e(ps,De.instance)}static get defaultLocale(){return Da}static set defaultLocale(c){Da=c}static get defaultNumberingSystem(){return al}static set defaultNumberingSystem(c){al=c}static get defaultOutputCalendar(){return Ps}static set defaultOutputCalendar(c){Ps=c}static get defaultWeekSettings(){return dc}static set defaultWeekSettings(c){dc=Mu(c)}static get twoDigitCutoffYear(){return sl}static set twoDigitCutoffYear(c){sl=c%100}static get throwOnInvalid(){return ei}static set throwOnInvalid(c){ei=c}static resetCaches(){B.resetCache(),Le.resetCache(),qe.resetCache(),Ot()}}class Rn{constructor(c,v){this.reason=c,this.explanation=v}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const Ou=[0,31,59,90,120,151,181,212,243,273,304,334],il=[0,31,60,91,121,152,182,213,244,274,305,335];function xn(p,c){return new Rn("unit out of range",`you specified ${c} (of type ${typeof c}) as a ${p}, which is invalid`)}function rl(p,c,v){const E=new Date(Date.UTC(p,c-1,v));p<100&&p>=0&&E.setUTCFullYear(E.getUTCFullYear()-1900);const M=E.getUTCDay();return M===0?7:M}function wu(p,c,v){return v+(ni(p)?il:Ou)[c-1]}function ja(p,c){const v=ni(p)?il:Ou,E=v.findIndex(U=>U<c),M=c-v[E];return{month:E+1,day:M}}function qt(p,c){return(p-c+7)%7+1}function tn(p,c=4,v=1){const{year:E,month:M,day:U}=p,Z=wu(E,M,U),$=qt(rl(E,M,U),v);let I=Math.floor((Z-$+14-c)/7),xe;return I<1?(xe=E-1,I=ai(xe,c,v)):I>ai(E,c,v)?(xe=E+1,I=1):xe=E,{weekYear:xe,weekNumber:I,weekday:$,...ur(p)}}function bs(p,c=4,v=1){const{weekYear:E,weekNumber:M,weekday:U}=p,Z=qt(rl(E,1,c),v),$=Aa(E);let I=M*7+U-Z-7+c,xe;I<1?(xe=E-1,I+=Aa(xe)):I>$?(xe=E+1,I-=Aa(E)):xe=E;const{month:ke,day:Ge}=ja(xe,I);return{year:xe,month:ke,day:Ge,...ur(p)}}function nr(p){const{year:c,month:v,day:E}=p,M=wu(c,v,E);return{year:c,ordinal:M,...ur(p)}}function hc(p){const{year:c,ordinal:v}=p,{month:E,day:M}=ja(c,v);return{year:c,month:E,day:M,...ur(p)}}function mc(p,c){if(!Ze(p.localWeekday)||!Ze(p.localWeekNumber)||!Ze(p.localWeekYear)){if(!Ze(p.weekday)||!Ze(p.weekNumber)||!Ze(p.weekYear))throw new u("Cannot mix locale-based week fields with ISO-based week fields");return Ze(p.localWeekday)||(p.weekday=p.localWeekday),Ze(p.localWeekNumber)||(p.weekNumber=p.localWeekNumber),Ze(p.localWeekYear)||(p.weekYear=p.localWeekYear),delete p.localWeekday,delete p.localWeekNumber,delete p.localWeekYear,{minDaysInFirstWeek:c.getMinDaysInFirstWeek(),startOfWeek:c.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function yc(p,c=4,v=1){const E=Ra(p.weekYear),M=dn(p.weekNumber,1,ai(p.weekYear,c,v)),U=dn(p.weekday,1,7);return E?M?U?!1:xn("weekday",p.weekday):xn("week",p.weekNumber):xn("weekYear",p.weekYear)}function ar(p){const c=Ra(p.year),v=dn(p.ordinal,1,Aa(p.year));return c?v?!1:xn("ordinal",p.ordinal):xn("year",p.year)}function ll(p){const c=Ra(p.year),v=dn(p.month,1,12),E=dn(p.day,1,ol(p.year,p.month));return c?v?E?!1:xn("day",p.day):xn("month",p.month):xn("year",p.year)}function Ss(p){const{hour:c,minute:v,second:E,millisecond:M}=p,U=dn(c,0,23)||c===24&&v===0&&E===0&&M===0,Z=dn(v,0,59),$=dn(E,0,59),I=dn(M,0,999);return U?Z?$?I?!1:xn("millisecond",M):xn("second",E):xn("minute",v):xn("hour",c)}function Ze(p){return typeof p>"u"}function An(p){return typeof p=="number"}function Ra(p){return typeof p=="number"&&p%1===0}function Qt(p){return typeof p=="string"}function gc(p){return Object.prototype.toString.call(p)==="[object Date]"}function Cu(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function es(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function ti(p){return Array.isArray(p)?p:[p]}function vc(p,c,v){if(p.length!==0)return p.reduce((E,M)=>{const U=[c(M),M];return E&&v(E[0],U[0])===E[0]?E:U},null)[1]}function pc(p,c){return c.reduce((v,E)=>(v[E]=p[E],v),{})}function xs(p,c){return Object.prototype.hasOwnProperty.call(p,c)}function Mu(p){if(p==null)return null;if(typeof p!="object")throw new m("Week settings must be an object");if(!dn(p.firstDay,1,7)||!dn(p.minimalDays,1,7)||!Array.isArray(p.weekend)||p.weekend.some(c=>!dn(c,1,7)))throw new m("Invalid week settings");return{firstDay:p.firstDay,minimalDays:p.minimalDays,weekend:Array.from(p.weekend)}}function dn(p,c,v){return Ra(p)&&p>=c&&p<=v}function ul(p,c){return p-c*Math.floor(p/c)}function vt(p,c=2){const v=p<0;let E;return v?E="-"+(""+-p).padStart(c,"0"):E=(""+p).padStart(c,"0"),E}function Bt(p){if(!(Ze(p)||p===null||p===""))return parseInt(p,10)}function ts(p){if(!(Ze(p)||p===null||p===""))return parseFloat(p)}function Du(p){if(!(Ze(p)||p===null||p==="")){const c=parseFloat("0."+p)*1e3;return Math.floor(c)}}function sr(p,c,v="round"){const E=10**c;switch(v){case"expand":return p>0?Math.ceil(p*E)/E:Math.floor(p*E)/E;case"trunc":return Math.trunc(p*E)/E;case"round":return Math.round(p*E)/E;case"floor":return Math.floor(p*E)/E;case"ceil":return Math.ceil(p*E)/E;default:throw new RangeError(`Value rounding ${v} is out of range`)}}function ni(p){return p%4===0&&(p%100!==0||p%400===0)}function Aa(p){return ni(p)?366:365}function ol(p,c){const v=ul(c-1,12)+1,E=p+(c-v)/12;return v===2?ni(E)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][v-1]}function hn(p){let c=Date.UTC(p.year,p.month-1,p.day,p.hour,p.minute,p.second,p.millisecond);return p.year<100&&p.year>=0&&(c=new Date(c),c.setUTCFullYear(p.year,p.month-1,p.day)),+c}function cl(p,c,v){return-qt(rl(p,1,c),v)+c-1}function ai(p,c=4,v=1){const E=cl(p,c,v),M=cl(p+1,c,v);return(Aa(p)-E+M)/7}function ir(p){return p>99?p:p>wt.twoDigitCutoffYear?1900+p:2e3+p}function Es(p,c,v,E=null){const M=new Date(p),U={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};E&&(U.timeZone=E);const Z={timeZoneName:c,...U},$=new Intl.DateTimeFormat(v,Z).formatToParts(M).find(I=>I.type.toLowerCase()==="timezonename");return $?$.value:null}function rr(p,c){let v=parseInt(p,10);Number.isNaN(v)&&(v=0);const E=parseInt(c,10)||0,M=v<0||Object.is(v,-0)?-E:E;return v*60+M}function ju(p){const c=Number(p);if(typeof p=="boolean"||p===""||!Number.isFinite(c))throw new m(`Invalid unit value ${p}`);return c}function ka(p,c){const v={};for(const E in p)if(xs(p,E)){const M=p[E];if(M==null)continue;v[c(E)]=ju(M)}return v}function lr(p,c){const v=Math.trunc(Math.abs(p/60)),E=Math.trunc(Math.abs(p%60)),M=p>=0?"+":"-";switch(c){case"short":return`${M}${vt(v,2)}:${vt(E,2)}`;case"narrow":return`${M}${v}${E>0?`:${E}`:""}`;case"techie":return`${M}${vt(v,2)}${vt(E,2)}`;default:throw new RangeError(`Value format ${c} is out of range for property format`)}}function ur(p){return pc(p,["hour","minute","second","millisecond"])}const bc=["January","February","March","April","May","June","July","August","September","October","November","December"],fl=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Sd=["J","F","M","A","M","J","J","A","S","O","N","D"];function Sc(p){switch(p){case"narrow":return[...Sd];case"short":return[...fl];case"long":return[...bc];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}}const or=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],ha=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],Ru=["M","T","W","T","F","S","S"];function dl(p){switch(p){case"narrow":return[...Ru];case"short":return[...ha];case"long":return[...or];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const Ts=["AM","PM"],si=["Before Christ","Anno Domini"],xc=["BC","AD"],Au=["B","A"];function ku(p){switch(p){case"narrow":return[...Au];case"short":return[...xc];case"long":return[...si];default:return null}}function cr(p){return Ts[p.hour<12?0:1]}function Ua(p,c){return dl(c)[p.weekday-1]}function Uu(p,c){return Sc(c)[p.month-1]}function fr(p,c){return ku(c)[p.year<0?0:1]}function ns(p,c,v="always",E=!1){const M={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."]},U=["hours","minutes","seconds"].indexOf(p)===-1;if(v==="auto"&&U){const Ge=p==="days";switch(c){case 1:return Ge?"tomorrow":`next ${M[p][0]}`;case-1:return Ge?"yesterday":`last ${M[p][0]}`;case 0:return Ge?"today":`this ${M[p][0]}`}}const Z=Object.is(c,-0)||c<0,$=Math.abs(c),I=$===1,xe=M[p],ke=E?I?xe[1]:xe[2]||xe[1]:I?M[p][0]:p;return Z?`${$} ${ke} ago`:`in ${$} ${ke}`}function hl(p,c){let v="";for(const E of p)E.literal?v+=E.val:v+=c(E.val);return v}const ml={D:w,DD:T,DDD:N,DDDD:O,t:j,tt:R,ttt:k,tttt:H,T:F,TT:J,TTT:pe,TTTT:G,f:re,ff:V,fff:ie,ffff:be,F:se,FF:K,FFF:Se,FFFF:X};class nn{static create(c,v={}){return new nn(c,v)}static parseFormat(c){let v=null,E="",M=!1;const U=[];for(let Z=0;Z<c.length;Z++){const $=c.charAt(Z);$==="'"?((E.length>0||M)&&U.push({literal:M||/^\s+$/.test(E),val:E===""?"'":E}),v=null,E="",M=!M):M||$===v?E+=$:(E.length>0&&U.push({literal:/^\s+$/.test(E),val:E}),E=$,v=$)}return E.length>0&&U.push({literal:M||/^\s+$/.test(E),val:E}),U}static macroTokenToFormatOpts(c){return ml[c]}constructor(c,v){this.opts=v,this.loc=c,this.systemLoc=null}formatWithSystemDefault(c,v){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(c,{...this.opts,...v}).format()}dtFormatter(c,v={}){return this.loc.dtFormatter(c,{...this.opts,...v})}formatDateTime(c,v){return this.dtFormatter(c,v).format()}formatDateTimeParts(c,v){return this.dtFormatter(c,v).formatToParts()}formatInterval(c,v){return this.dtFormatter(c.start,v).dtf.formatRange(c.start.toJSDate(),c.end.toJSDate())}resolvedOptions(c,v){return this.dtFormatter(c,v).resolvedOptions()}num(c,v=0,E=void 0){if(this.opts.forceSimple)return vt(c,v);const M={...this.opts};return v>0&&(M.padTo=v),E&&(M.signDisplay=E),this.loc.numberFormatter(M).format(c)}formatDateTimeFromString(c,v){const E=this.loc.listingMode()==="en",M=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",U=($e,Ut)=>this.loc.extract(c,$e,Ut),Z=$e=>c.isOffsetFixed&&c.offset===0&&$e.allowZ?"Z":c.isValid?c.zone.formatOffset(c.ts,$e.format):"",$=()=>E?cr(c):U({hour:"numeric",hourCycle:"h12"},"dayperiod"),I=($e,Ut)=>E?Uu(c,$e):U(Ut?{month:$e}:{month:$e,day:"numeric"},"month"),xe=($e,Ut)=>E?Ua(c,$e):U(Ut?{weekday:$e}:{weekday:$e,month:"long",day:"numeric"},"weekday"),ke=$e=>{const Ut=nn.macroTokenToFormatOpts($e);return Ut?this.formatWithSystemDefault(c,Ut):$e},Ge=$e=>E?fr(c,$e):U({era:$e},"era"),it=$e=>{switch($e){case"S":return this.num(c.millisecond);case"u":case"SSS":return this.num(c.millisecond,3);case"s":return this.num(c.second);case"ss":return this.num(c.second,2);case"uu":return this.num(Math.floor(c.millisecond/10),2);case"uuu":return this.num(Math.floor(c.millisecond/100));case"m":return this.num(c.minute);case"mm":return this.num(c.minute,2);case"h":return this.num(c.hour%12===0?12:c.hour%12);case"hh":return this.num(c.hour%12===0?12:c.hour%12,2);case"H":return this.num(c.hour);case"HH":return this.num(c.hour,2);case"Z":return Z({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return Z({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return Z({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return c.zone.offsetName(c.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return c.zone.offsetName(c.ts,{format:"long",locale:this.loc.locale});case"z":return c.zoneName;case"a":return $();case"d":return M?U({day:"numeric"},"day"):this.num(c.day);case"dd":return M?U({day:"2-digit"},"day"):this.num(c.day,2);case"c":return this.num(c.weekday);case"ccc":return xe("short",!0);case"cccc":return xe("long",!0);case"ccccc":return xe("narrow",!0);case"E":return this.num(c.weekday);case"EEE":return xe("short",!1);case"EEEE":return xe("long",!1);case"EEEEE":return xe("narrow",!1);case"L":return M?U({month:"numeric",day:"numeric"},"month"):this.num(c.month);case"LL":return M?U({month:"2-digit",day:"numeric"},"month"):this.num(c.month,2);case"LLL":return I("short",!0);case"LLLL":return I("long",!0);case"LLLLL":return I("narrow",!0);case"M":return M?U({month:"numeric"},"month"):this.num(c.month);case"MM":return M?U({month:"2-digit"},"month"):this.num(c.month,2);case"MMM":return I("short",!1);case"MMMM":return I("long",!1);case"MMMMM":return I("narrow",!1);case"y":return M?U({year:"numeric"},"year"):this.num(c.year);case"yy":return M?U({year:"2-digit"},"year"):this.num(c.year.toString().slice(-2),2);case"yyyy":return M?U({year:"numeric"},"year"):this.num(c.year,4);case"yyyyyy":return M?U({year:"numeric"},"year"):this.num(c.year,6);case"G":return Ge("short");case"GG":return Ge("long");case"GGGGG":return Ge("narrow");case"kk":return this.num(c.weekYear.toString().slice(-2),2);case"kkkk":return this.num(c.weekYear,4);case"W":return this.num(c.weekNumber);case"WW":return this.num(c.weekNumber,2);case"n":return this.num(c.localWeekNumber);case"nn":return this.num(c.localWeekNumber,2);case"ii":return this.num(c.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(c.localWeekYear,4);case"o":return this.num(c.ordinal);case"ooo":return this.num(c.ordinal,3);case"q":return this.num(c.quarter);case"qq":return this.num(c.quarter,2);case"X":return this.num(Math.floor(c.ts/1e3));case"x":return this.num(c.ts);default:return ke($e)}};return hl(nn.parseFormat(v),it)}formatDurationFromString(c,v){const E=this.opts.signMode==="negativeLargestOnly"?-1:1,M=ke=>{switch(ke[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}},U=(ke,Ge)=>it=>{const $e=M(it);if($e){const Ut=Ge.isNegativeDuration&&$e!==Ge.largestUnit?E:1;let un;return this.opts.signMode==="negativeLargestOnly"&&$e!==Ge.largestUnit?un="never":this.opts.signMode==="all"?un="always":un="auto",this.num(ke.get($e)*Ut,it.length,un)}else return it},Z=nn.parseFormat(v),$=Z.reduce((ke,{literal:Ge,val:it})=>Ge?ke:ke.concat(it),[]),I=c.shiftTo(...$.map(M).filter(ke=>ke)),xe={isNegativeDuration:I<0,largestUnit:Object.keys(I.values)[0]};return hl(Z,U(I,xe))}}const dr=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function za(...p){const c=p.reduce((v,E)=>v+E.source,"");return RegExp(`^${c}$`)}function Ns(...p){return c=>p.reduce(([v,E,M],U)=>{const[Z,$,I]=U(c,M);return[{...v,...Z},$||E,I]},[{},null,1]).slice(0,2)}function Zt(p,...c){if(p==null)return[null,null];for(const[v,E]of c){const M=v.exec(p);if(M)return E(M)}return[null,null]}function as(...p){return(c,v)=>{const E={};let M;for(M=0;M<p.length;M++)E[p[M]]=Bt(c[v+M]);return[E,null,v+M]}}const hr=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,mr=`(?:${hr.source}?(?:\\[(${dr.source})\\])?)?`,zu=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,yl=RegExp(`${zu.source}${mr}`),yr=RegExp(`(?:[Tt]${yl.source})?`),gr=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,gl=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Ec=/(\d{4})-?(\d{3})/,xd=as("weekYear","weekNumber","weekDay"),Ed=as("year","ordinal"),Td=/(\d{4})-(\d\d)-(\d\d)/,vl=RegExp(`${zu.source} ?(?:${hr.source}|(${dr.source}))?`),Nd=RegExp(`(?: ${vl.source})?`);function ii(p,c,v){const E=p[c];return Ze(E)?v:Bt(E)}function _d(p,c){return[{year:ii(p,c),month:ii(p,c+1,1),day:ii(p,c+2,1)},null,c+3]}function ri(p,c){return[{hours:ii(p,c,0),minutes:ii(p,c+1,0),seconds:ii(p,c+2,0),milliseconds:Du(p[c+3])},null,c+4]}function vr(p,c){const v=!p[c]&&!p[c+1],E=rr(p[c+1],p[c+2]),M=v?null:he.instance(E);return[{},M,c+3]}function li(p,c){const v=p[c]?Le.create(p[c]):null;return[{},v,c+1]}const Od=RegExp(`^T?${zu.source}$`),wd=/^-?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 Cd(p){const[c,v,E,M,U,Z,$,I,xe]=p,ke=c[0]==="-",Ge=I&&I[0]==="-",it=($e,Ut=!1)=>$e!==void 0&&(Ut||$e&&ke)?-$e:$e;return[{years:it(ts(v)),months:it(ts(E)),weeks:it(ts(M)),days:it(ts(U)),hours:it(ts(Z)),minutes:it(ts($)),seconds:it(ts(I),I==="-0"),milliseconds:it(Du(xe),Ge)}]}const Md={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function pr(p,c,v,E,M,U,Z){const $={year:c.length===2?ir(Bt(c)):Bt(c),month:fl.indexOf(v)+1,day:Bt(E),hour:Bt(M),minute:Bt(U)};return Z&&($.second=Bt(Z)),p&&($.weekday=p.length>3?or.indexOf(p)+1:ha.indexOf(p)+1),$}const Dd=/^(?:(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 jd(p){const[,c,v,E,M,U,Z,$,I,xe,ke,Ge]=p,it=pr(c,M,E,v,U,Z,$);let $e;return I?$e=Md[I]:xe?$e=0:$e=rr(ke,Ge),[it,new he($e)]}function Rd(p){return p.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const Tc=/^(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$/,Ad=/^(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$/,kd=/^(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 Nc(p){const[,c,v,E,M,U,Z,$]=p;return[pr(c,M,E,v,U,Z,$),he.utcInstance]}function Ud(p){const[,c,v,E,M,U,Z,$]=p;return[pr(c,$,v,E,M,U,Z),he.utcInstance]}const zd=za(gr,yr),Ld=za(gl,yr),Hd=za(Ec,yr),Vd=za(yl),_c=Ns(_d,ri,vr,li),Lu=Ns(xd,ri,vr,li),br=Ns(Ed,ri,vr,li),Fd=Ns(ri,vr,li);function Oc(p){return Zt(p,[zd,_c],[Ld,Lu],[Hd,br],[Vd,Fd])}function wc(p){return Zt(Rd(p),[Dd,jd])}function Cc(p){return Zt(p,[Tc,Nc],[Ad,Nc],[kd,Ud])}function Mc(p){return Zt(p,[wd,Cd])}const Dc=Ns(ri);function ui(p){return Zt(p,[Od,Dc])}const qd=za(Td,Nd),Bd=za(vl),Zd=Ns(ri,vr,li);function jc(p){return Zt(p,[qd,_c],[Bd,Zd])}const Hu="Invalid Duration",oi={weeks:{days:7,hours:168,minutes:10080,seconds:10080*60,milliseconds:10080*60*1e3},days:{hours:24,minutes:1440,seconds:1440*60,milliseconds:1440*60*1e3},hours:{minutes:60,seconds:3600,milliseconds:3600*1e3},minutes:{seconds:60,milliseconds:60*1e3},seconds:{milliseconds:1e3}},Sr={years:{quarters:4,months:12,weeks:52,days:365,hours:365*24,minutes:365*24*60,seconds:365*24*60*60,milliseconds:365*24*60*60*1e3},quarters:{months:3,weeks:13,days:91,hours:2184,minutes:2184*60,seconds:2184*60*60,milliseconds:2184*60*60*1e3},months:{weeks:4,days:30,hours:720,minutes:720*60,seconds:720*60*60,milliseconds:720*60*60*1e3},...oi},kn=146097/400,La=146097/4800,Rc={years:{quarters:4,months:12,weeks:kn/7,days:kn,hours:kn*24,minutes:kn*24*60,seconds:kn*24*60*60,milliseconds:kn*24*60*60*1e3},quarters:{months:3,weeks:kn/28,days:kn/4,hours:kn*24/4,minutes:kn*24*60/4,seconds:kn*24*60*60/4,milliseconds:kn*24*60*60*1e3/4},months:{weeks:La/7,days:La,hours:La*24,minutes:La*24*60,seconds:La*24*60*60,milliseconds:La*24*60*60*1e3},...oi},ss=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],Vu=ss.slice(0).reverse();function Jn(p,c,v=!1){const E={values:v?c.values:{...p.values,...c.values||{}},loc:p.loc.clone(c.loc),conversionAccuracy:c.conversionAccuracy||p.conversionAccuracy,matrix:c.matrix||p.matrix};return new st(E)}function Fu(p,c){var v;let E=(v=c.milliseconds)!=null?v:0;for(const M of Vu.slice(1))c[M]&&(E+=c[M]*p[M].milliseconds);return E}function qu(p,c){const v=Fu(p,c)<0?-1:1;ss.reduceRight((E,M)=>{if(Ze(c[M]))return E;if(E){const U=c[E]*v,Z=p[M][E],$=Math.floor(U/Z);c[M]+=$*v,c[E]-=$*Z*v}return M},null),ss.reduce((E,M)=>{if(Ze(c[M]))return E;if(E){const U=c[E]%1;c[E]-=U,c[M]+=U*p[E][M]}return M},null)}function Bu(p){const c={};for(const[v,E]of Object.entries(p))E!==0&&(c[v]=E);return c}class st{constructor(c){const v=c.conversionAccuracy==="longterm"||!1;let E=v?Rc:Sr;c.matrix&&(E=c.matrix),this.values=c.values,this.loc=c.loc||B.create(),this.conversionAccuracy=v?"longterm":"casual",this.invalid=c.invalid||null,this.matrix=E,this.isLuxonDuration=!0}static fromMillis(c,v){return st.fromObject({milliseconds:c},v)}static fromObject(c,v={}){if(c==null||typeof c!="object")throw new m(`Duration.fromObject: argument expected to be an object, got ${c===null?"null":typeof c}`);return new st({values:ka(c,st.normalizeUnit),loc:B.fromObject(v),conversionAccuracy:v.conversionAccuracy,matrix:v.matrix})}static fromDurationLike(c){if(An(c))return st.fromMillis(c);if(st.isDuration(c))return c;if(typeof c=="object")return st.fromObject(c);throw new m(`Unknown duration argument ${c} of type ${typeof c}`)}static fromISO(c,v){const[E]=Mc(c);return E?st.fromObject(E,v):st.invalid("unparsable",`the input "${c}" can't be parsed as ISO 8601`)}static fromISOTime(c,v){const[E]=ui(c);return E?st.fromObject(E,v):st.invalid("unparsable",`the input "${c}" can't be parsed as ISO 8601`)}static invalid(c,v=null){if(!c)throw new m("need to specify a reason the Duration is invalid");const E=c instanceof Rn?c:new Rn(c,v);if(wt.throwOnInvalid)throw new l(E);return new st({invalid:E})}static normalizeUnit(c){const v={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"}[c&&c.toLowerCase()];if(!v)throw new o(c);return v}static isDuration(c){return c&&c.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(c,v={}){const E={...v,floor:v.round!==!1&&v.floor!==!1};return this.isValid?nn.create(this.loc,E).formatDurationFromString(this,c):Hu}toHuman(c={}){if(!this.isValid)return Hu;const v=c.showZeros!==!1,E=ss.map(M=>{const U=this.values[M];return Ze(U)||U===0&&!v?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...c,unit:M.slice(0,-1)}).format(U)}).filter(M=>M);return this.loc.listFormatter({type:"conjunction",style:c.listStyle||"narrow",...c}).format(E)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let c="P";return this.years!==0&&(c+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(c+=this.months+this.quarters*3+"M"),this.weeks!==0&&(c+=this.weeks+"W"),this.days!==0&&(c+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(c+="T"),this.hours!==0&&(c+=this.hours+"H"),this.minutes!==0&&(c+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(c+=sr(this.seconds+this.milliseconds/1e3,3)+"S"),c==="P"&&(c+="T0S"),c}toISOTime(c={}){if(!this.isValid)return null;const v=this.toMillis();return v<0||v>=864e5?null:(c={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...c,includeOffset:!1},qe.fromMillis(v,{zone:"UTC"}).toISOTime(c))}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?Fu(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(c){if(!this.isValid)return this;const v=st.fromDurationLike(c),E={};for(const M of ss)(xs(v.values,M)||xs(this.values,M))&&(E[M]=v.get(M)+this.get(M));return Jn(this,{values:E},!0)}minus(c){if(!this.isValid)return this;const v=st.fromDurationLike(c);return this.plus(v.negate())}mapUnits(c){if(!this.isValid)return this;const v={};for(const E of Object.keys(this.values))v[E]=ju(c(this.values[E],E));return Jn(this,{values:v},!0)}get(c){return this[st.normalizeUnit(c)]}set(c){if(!this.isValid)return this;const v={...this.values,...ka(c,st.normalizeUnit)};return Jn(this,{values:v})}reconfigure({locale:c,numberingSystem:v,conversionAccuracy:E,matrix:M}={}){const Z={loc:this.loc.clone({locale:c,numberingSystem:v}),matrix:M,conversionAccuracy:E};return Jn(this,Z)}as(c){return this.isValid?this.shiftTo(c).get(c):NaN}normalize(){if(!this.isValid)return this;const c=this.toObject();return qu(this.matrix,c),Jn(this,{values:c},!0)}rescale(){if(!this.isValid)return this;const c=Bu(this.normalize().shiftToAll().toObject());return Jn(this,{values:c},!0)}shiftTo(...c){if(!this.isValid)return this;if(c.length===0)return this;c=c.map(Z=>st.normalizeUnit(Z));const v={},E={},M=this.toObject();let U;for(const Z of ss)if(c.indexOf(Z)>=0){U=Z;let $=0;for(const xe in E)$+=this.matrix[xe][Z]*E[xe],E[xe]=0;An(M[Z])&&($+=M[Z]);const I=Math.trunc($);v[Z]=I,E[Z]=($*1e3-I*1e3)/1e3}else An(M[Z])&&(E[Z]=M[Z]);for(const Z in E)E[Z]!==0&&(v[U]+=Z===U?E[Z]:E[Z]/this.matrix[U][Z]);return qu(this.matrix,v),Jn(this,{values:v},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const c={};for(const v of Object.keys(this.values))c[v]=this.values[v]===0?0:-this.values[v];return Jn(this,{values:c},!0)}removeZeros(){if(!this.isValid)return this;const c=Bu(this.values);return Jn(this,{values:c},!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(c){if(!this.isValid||!c.isValid||!this.loc.equals(c.loc))return!1;function v(E,M){return E===void 0||E===0?M===void 0||M===0:E===M}for(const E of ss)if(!v(this.values[E],c.values[E]))return!1;return!0}}const ci="Invalid Interval";function $d(p,c){return!p||!p.isValid?Ct.invalid("missing or invalid start"):!c||!c.isValid?Ct.invalid("missing or invalid end"):c<p?Ct.invalid("end before start",`The end of an interval must be after its start, but you had start=${p.toISO()} and end=${c.toISO()}`):null}class Ct{constructor(c){this.s=c.start,this.e=c.end,this.invalid=c.invalid||null,this.isLuxonInterval=!0}static invalid(c,v=null){if(!c)throw new m("need to specify a reason the Interval is invalid");const E=c instanceof Rn?c:new Rn(c,v);if(wt.throwOnInvalid)throw new i(E);return new Ct({invalid:E})}static fromDateTimes(c,v){const E=Ln(c),M=Ln(v),U=$d(E,M);return U??new Ct({start:E,end:M})}static after(c,v){const E=st.fromDurationLike(v),M=Ln(c);return Ct.fromDateTimes(M,M.plus(E))}static before(c,v){const E=st.fromDurationLike(v),M=Ln(c);return Ct.fromDateTimes(M.minus(E),M)}static fromISO(c,v){const[E,M]=(c||"").split("/",2);if(E&&M){let U,Z;try{U=qe.fromISO(E,v),Z=U.isValid}catch{Z=!1}let $,I;try{$=qe.fromISO(M,v),I=$.isValid}catch{I=!1}if(Z&&I)return Ct.fromDateTimes(U,$);if(Z){const xe=st.fromISO(M,v);if(xe.isValid)return Ct.after(U,xe)}else if(I){const xe=st.fromISO(E,v);if(xe.isValid)return Ct.before($,xe)}}return Ct.invalid("unparsable",`the input "${c}" can't be parsed as ISO 8601`)}static isInterval(c){return c&&c.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(c="milliseconds"){return this.isValid?this.toDuration(c).get(c):NaN}count(c="milliseconds",v){if(!this.isValid)return NaN;const E=this.start.startOf(c,v);let M;return v!=null&&v.useLocaleWeeks?M=this.end.reconfigure({locale:E.locale}):M=this.end,M=M.startOf(c,v),Math.floor(M.diff(E,c).get(c))+(M.valueOf()!==this.end.valueOf())}hasSame(c){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,c):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(c){return this.isValid?this.s>c:!1}isBefore(c){return this.isValid?this.e<=c:!1}contains(c){return this.isValid?this.s<=c&&this.e>c:!1}set({start:c,end:v}={}){return this.isValid?Ct.fromDateTimes(c||this.s,v||this.e):this}splitAt(...c){if(!this.isValid)return[];const v=c.map(Ln).filter(Z=>this.contains(Z)).sort((Z,$)=>Z.toMillis()-$.toMillis()),E=[];let{s:M}=this,U=0;for(;M<this.e;){const Z=v[U]||this.e,$=+Z>+this.e?this.e:Z;E.push(Ct.fromDateTimes(M,$)),M=$,U+=1}return E}splitBy(c){const v=st.fromDurationLike(c);if(!this.isValid||!v.isValid||v.as("milliseconds")===0)return[];let{s:E}=this,M=1,U;const Z=[];for(;E<this.e;){const $=this.start.plus(v.mapUnits(I=>I*M));U=+$>+this.e?this.e:$,Z.push(Ct.fromDateTimes(E,U)),E=U,M+=1}return Z}divideEqually(c){return this.isValid?this.splitBy(this.length()/c).slice(0,c):[]}overlaps(c){return this.e>c.s&&this.s<c.e}abutsStart(c){return this.isValid?+this.e==+c.s:!1}abutsEnd(c){return this.isValid?+c.e==+this.s:!1}engulfs(c){return this.isValid?this.s<=c.s&&this.e>=c.e:!1}equals(c){return!this.isValid||!c.isValid?!1:this.s.equals(c.s)&&this.e.equals(c.e)}intersection(c){if(!this.isValid)return this;const v=this.s>c.s?this.s:c.s,E=this.e<c.e?this.e:c.e;return v>=E?null:Ct.fromDateTimes(v,E)}union(c){if(!this.isValid)return this;const v=this.s<c.s?this.s:c.s,E=this.e>c.e?this.e:c.e;return Ct.fromDateTimes(v,E)}static merge(c){const[v,E]=c.sort((M,U)=>M.s-U.s).reduce(([M,U],Z)=>U?U.overlaps(Z)||U.abutsStart(Z)?[M,U.union(Z)]:[M.concat([U]),Z]:[M,Z],[[],null]);return E&&v.push(E),v}static xor(c){let v=null,E=0;const M=[],U=c.map(I=>[{time:I.s,type:"s"},{time:I.e,type:"e"}]),Z=Array.prototype.concat(...U),$=Z.sort((I,xe)=>I.time-xe.time);for(const I of $)E+=I.type==="s"?1:-1,E===1?v=I.time:(v&&+v!=+I.time&&M.push(Ct.fromDateTimes(v,I.time)),v=null);return Ct.merge(M)}difference(...c){return Ct.xor([this].concat(c)).map(v=>this.intersection(v)).filter(v=>v&&!v.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:ci}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(c=w,v={}){return this.isValid?nn.create(this.s.loc.clone(v),c).formatInterval(this):ci}toISO(c){return this.isValid?`${this.s.toISO(c)}/${this.e.toISO(c)}`:ci}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:ci}toISOTime(c){return this.isValid?`${this.s.toISOTime(c)}/${this.e.toISOTime(c)}`:ci}toFormat(c,{separator:v=" – "}={}){return this.isValid?`${this.s.toFormat(c)}${v}${this.e.toFormat(c)}`:ci}toDuration(c,v){return this.isValid?this.e.diff(this.s,c,v):st.invalid(this.invalidReason)}mapEndpoints(c){return Ct.fromDateTimes(c(this.s),c(this.e))}}class xr{static hasDST(c=wt.defaultZone){const v=qe.now().setZone(c).set({month:12});return!c.isUniversal&&v.offset!==v.set({month:6}).offset}static isValidIANAZone(c){return Le.isValidZone(c)}static normalizeZone(c){return _e(c,wt.defaultZone)}static getStartOfWeek({locale:c=null,locObj:v=null}={}){return(v||B.create(c)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:c=null,locObj:v=null}={}){return(v||B.create(c)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:c=null,locObj:v=null}={}){return(v||B.create(c)).getWeekendDays().slice()}static months(c="long",{locale:v=null,numberingSystem:E=null,locObj:M=null,outputCalendar:U="gregory"}={}){return(M||B.create(v,E,U)).months(c)}static monthsFormat(c="long",{locale:v=null,numberingSystem:E=null,locObj:M=null,outputCalendar:U="gregory"}={}){return(M||B.create(v,E,U)).months(c,!0)}static weekdays(c="long",{locale:v=null,numberingSystem:E=null,locObj:M=null}={}){return(M||B.create(v,E,null)).weekdays(c)}static weekdaysFormat(c="long",{locale:v=null,numberingSystem:E=null,locObj:M=null}={}){return(M||B.create(v,E,null)).weekdays(c,!0)}static meridiems({locale:c=null}={}){return B.create(c).meridiems()}static eras(c="short",{locale:v=null}={}){return B.create(v,null,"gregory").eras(c)}static features(){return{relative:Cu(),localeWeek:es()}}}function En(p,c){const v=M=>M.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),E=v(c)-v(p);return Math.floor(st.fromMillis(E).as("days"))}function Er(p,c,v){const E=[["years",(I,xe)=>xe.year-I.year],["quarters",(I,xe)=>xe.quarter-I.quarter+(xe.year-I.year)*4],["months",(I,xe)=>xe.month-I.month+(xe.year-I.year)*12],["weeks",(I,xe)=>{const ke=En(I,xe);return(ke-ke%7)/7}],["days",En]],M={},U=p;let Z,$;for(const[I,xe]of E)v.indexOf(I)>=0&&(Z=I,M[I]=xe(p,c),$=U.plus(M),$>c?(M[I]--,p=U.plus(M),p>c&&($=p,M[I]--,p=U.plus(M))):p=$);return[p,M,$,Z]}function Ac(p,c,v,E){let[M,U,Z,$]=Er(p,c,v);const I=c-M,xe=v.filter(Ge=>["hours","minutes","seconds","milliseconds"].indexOf(Ge)>=0);xe.length===0&&(Z<c&&(Z=M.plus({[$]:1})),Z!==M&&(U[$]=(U[$]||0)+I/(Z-M)));const ke=st.fromObject(U,E);return xe.length>0?st.fromMillis(I,E).shiftTo(...xe).plus(ke):ke}const kc="missing Intl.DateTimeFormat.formatToParts support";function ot(p,c=v=>v){return{regex:p,deser:([v])=>c(Ae(v))}}const pl="[  ]",Uc=new RegExp(pl,"g");function fi(p){return p.replace(/\./g,"\\.?").replace(Uc,pl)}function bl(p){return p.replace(/\./g,"").replace(Uc," ").toLowerCase()}function mn(p,c){return p===null?null:{regex:RegExp(p.map(fi).join("|")),deser:([v])=>p.findIndex(E=>bl(v)===bl(E))+c}}function Sl(p,c){return{regex:p,deser:([,v,E])=>rr(v,E),groups:c}}function Tr(p){return{regex:p,deser:([c])=>c}}function _s(p){return p.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function di(p,c){const v=yt(c),E=yt(c,"{2}"),M=yt(c,"{3}"),U=yt(c,"{4}"),Z=yt(c,"{6}"),$=yt(c,"{1,2}"),I=yt(c,"{1,3}"),xe=yt(c,"{1,6}"),ke=yt(c,"{1,9}"),Ge=yt(c,"{2,4}"),it=yt(c,"{4,6}"),$e=on=>({regex:RegExp(_s(on.val)),deser:([is])=>is,literal:!0}),un=(on=>{if(p.literal)return $e(on);switch(on.val){case"G":return mn(c.eras("short"),0);case"GG":return mn(c.eras("long"),0);case"y":return ot(xe);case"yy":return ot(Ge,ir);case"yyyy":return ot(U);case"yyyyy":return ot(it);case"yyyyyy":return ot(Z);case"M":return ot($);case"MM":return ot(E);case"MMM":return mn(c.months("short",!0),1);case"MMMM":return mn(c.months("long",!0),1);case"L":return ot($);case"LL":return ot(E);case"LLL":return mn(c.months("short",!1),1);case"LLLL":return mn(c.months("long",!1),1);case"d":return ot($);case"dd":return ot(E);case"o":return ot(I);case"ooo":return ot(M);case"HH":return ot(E);case"H":return ot($);case"hh":return ot(E);case"h":return ot($);case"mm":return ot(E);case"m":return ot($);case"q":return ot($);case"qq":return ot(E);case"s":return ot($);case"ss":return ot(E);case"S":return ot(I);case"SSS":return ot(M);case"u":return Tr(ke);case"uu":return Tr($);case"uuu":return ot(v);case"a":return mn(c.meridiems(),0);case"kkkk":return ot(U);case"kk":return ot(Ge,ir);case"W":return ot($);case"WW":return ot(E);case"E":case"c":return ot(v);case"EEE":return mn(c.weekdays("short",!1),1);case"EEEE":return mn(c.weekdays("long",!1),1);case"ccc":return mn(c.weekdays("short",!0),1);case"cccc":return mn(c.weekdays("long",!0),1);case"Z":case"ZZ":return Sl(new RegExp(`([+-]${$.source})(?::(${E.source}))?`),2);case"ZZZ":return Sl(new RegExp(`([+-]${$.source})(${E.source})?`),2);case"z":return Tr(/[a-z_+-/]{1,256}?/i);case" ":return Tr(/[^\S\n\r]/);default:return $e(on)}})(p)||{invalidReason:kc};return un.token=p,un}const Zu={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 zc(p,c,v){const{type:E,value:M}=p;if(E==="literal"){const I=/^\s+$/.test(M);return{literal:!I,val:I?" ":M}}const U=c[E];let Z=E;E==="hour"&&(c.hour12!=null?Z=c.hour12?"hour12":"hour24":c.hourCycle!=null?c.hourCycle==="h11"||c.hourCycle==="h12"?Z="hour12":Z="hour24":Z=v.hour12?"hour12":"hour24");let $=Zu[Z];if(typeof $=="object"&&($=$[U]),$)return{literal:!1,val:$}}function Os(p){return[`^${p.map(v=>v.regex).reduce((v,E)=>`${v}(${E.source})`,"")}$`,p]}function Lc(p,c,v){const E=p.match(c);if(E){const M={};let U=1;for(const Z in v)if(xs(v,Z)){const $=v[Z],I=$.groups?$.groups+1:1;!$.literal&&$.token&&(M[$.token.val[0]]=$.deser(E.slice(U,U+I))),U+=I}return[E,M]}else return[E,{}]}function Hc(p){const c=U=>{switch(U){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}};let v=null,E;return Ze(p.z)||(v=Le.create(p.z)),Ze(p.Z)||(v||(v=new he(p.Z)),E=p.Z),Ze(p.q)||(p.M=(p.q-1)*3+1),Ze(p.h)||(p.h<12&&p.a===1?p.h+=12:p.h===12&&p.a===0&&(p.h=0)),p.G===0&&p.y&&(p.y=-p.y),Ze(p.u)||(p.S=Du(p.u)),[Object.keys(p).reduce((U,Z)=>{const $=c(Z);return $&&(U[$]=p[Z]),U},{}),v,E]}let xl=null;function Id(){return xl||(xl=qe.fromMillis(1555555555555)),xl}function Gd(p,c){if(p.literal)return p;const v=nn.macroTokenToFormatOpts(p.val),E=Un(v,c);return E==null||E.includes(void 0)?p:E}function Vc(p,c){return Array.prototype.concat(...p.map(v=>Gd(v,c)))}class $u{constructor(c,v){if(this.locale=c,this.format=v,this.tokens=Vc(nn.parseFormat(v),c),this.units=this.tokens.map(E=>di(E,c)),this.disqualifyingUnit=this.units.find(E=>E.invalidReason),!this.disqualifyingUnit){const[E,M]=Os(this.units);this.regex=RegExp(E,"i"),this.handlers=M}}explainFromTokens(c){if(this.isValid){const[v,E]=Lc(c,this.regex,this.handlers),[M,U,Z]=E?Hc(E):[null,null,void 0];if(xs(E,"a")&&xs(E,"H"))throw new u("Can't include meridiem when specifying 24-hour format");return{input:c,tokens:this.tokens,regex:this.regex,rawMatches:v,matches:E,result:M,zone:U,specificOffset:Z}}else return{input:c,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function Yu(p,c,v){return new $u(p,v).explainFromTokens(c)}function Iu(p,c,v){const{result:E,zone:M,specificOffset:U,invalidReason:Z}=Yu(p,c,v);return[E,M,U,Z]}function Un(p,c){if(!p)return null;const E=nn.create(c,p).dtFormatter(Id()),M=E.formatToParts(),U=E.resolvedOptions();return M.map(Z=>zc(Z,p,U))}const hi="Invalid DateTime",wn=864e13;function ma(p){return new Rn("unsupported zone",`the zone "${p.name}" is not supported`)}function Nr(p){return p.weekData===null&&(p.weekData=tn(p.c)),p.weekData}function mi(p){return p.localWeekData===null&&(p.localWeekData=tn(p.c,p.loc.getMinDaysInFirstWeek(),p.loc.getStartOfWeek())),p.localWeekData}function ya(p,c){const v={ts:p.ts,zone:p.zone,c:p.c,o:p.o,loc:p.loc,invalid:p.invalid};return new qe({...v,...c,old:v})}function El(p,c,v){let E=p-c*60*1e3;const M=v.offset(E);if(c===M)return[E,c];E-=(M-c)*60*1e3;const U=v.offset(E);return M===U?[E,M]:[p-Math.min(M,U)*60*1e3,Math.max(M,U)]}function ga(p,c){p+=c*60*1e3;const v=new Date(p);return{year:v.getUTCFullYear(),month:v.getUTCMonth()+1,day:v.getUTCDate(),hour:v.getUTCHours(),minute:v.getUTCMinutes(),second:v.getUTCSeconds(),millisecond:v.getUTCMilliseconds()}}function _r(p,c,v){return El(hn(p),c,v)}function Or(p,c){const v=p.o,E=p.c.year+Math.trunc(c.years),M=p.c.month+Math.trunc(c.months)+Math.trunc(c.quarters)*3,U={...p.c,year:E,month:M,day:Math.min(p.c.day,ol(E,M))+Math.trunc(c.days)+Math.trunc(c.weeks)*7},Z=st.fromObject({years:c.years-Math.trunc(c.years),quarters:c.quarters-Math.trunc(c.quarters),months:c.months-Math.trunc(c.months),weeks:c.weeks-Math.trunc(c.weeks),days:c.days-Math.trunc(c.days),hours:c.hours,minutes:c.minutes,seconds:c.seconds,milliseconds:c.milliseconds}).as("milliseconds"),$=hn(U);let[I,xe]=El($,v,p.zone);return Z!==0&&(I+=Z,xe=p.zone.offset(I)),{ts:I,o:xe}}function Pn(p,c,v,E,M,U){const{setZone:Z,zone:$}=v;if(p&&Object.keys(p).length!==0||c){const I=c||$,xe=qe.fromObject(p,{...v,zone:I,specificOffset:U});return Z?xe:xe.setZone($)}else return qe.invalid(new Rn("unparsable",`the input "${M}" can't be parsed as ${E}`))}function Tl(p,c,v=!0){return p.isValid?nn.create(B.create("en-US"),{allowZ:v,forceSimple:!0}).formatDateTimeFromString(p,c):null}function yn(p,c,v){const E=p.c.year>9999||p.c.year<0;let M="";if(E&&p.c.year>=0&&(M+="+"),M+=vt(p.c.year,E?6:4),v==="year")return M;if(c){if(M+="-",M+=vt(p.c.month),v==="month")return M;M+="-"}else if(M+=vt(p.c.month),v==="month")return M;return M+=vt(p.c.day),M}function Nl(p,c,v,E,M,U,Z){let $=!v||p.c.millisecond!==0||p.c.second!==0,I="";switch(Z){case"day":case"month":case"year":break;default:if(I+=vt(p.c.hour),Z==="hour")break;if(c){if(I+=":",I+=vt(p.c.minute),Z==="minute")break;$&&(I+=":",I+=vt(p.c.second))}else{if(I+=vt(p.c.minute),Z==="minute")break;$&&(I+=vt(p.c.second))}if(Z==="second")break;$&&(!E||p.c.millisecond!==0)&&(I+=".",I+=vt(p.c.millisecond,3))}return M&&(p.isOffsetFixed&&p.offset===0&&!U?I+="Z":p.o<0?(I+="-",I+=vt(Math.trunc(-p.o/60)),I+=":",I+=vt(Math.trunc(-p.o%60))):(I+="+",I+=vt(Math.trunc(p.o/60)),I+=":",I+=vt(Math.trunc(p.o%60)))),U&&(I+="["+p.zone.ianaName+"]"),I}const va={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Fc={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},_l={ordinal:1,hour:0,minute:0,second:0,millisecond:0},pa=["year","month","day","hour","minute","second","millisecond"],Gu=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],qc=["year","ordinal","hour","minute","second","millisecond"];function yi(p){const c={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"}[p.toLowerCase()];if(!c)throw new o(p);return c}function Xu(p){switch(p.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return yi(p)}}function zn(p){if(Ha===void 0&&(Ha=wt.now()),p.type!=="iana")return p.offset(Ha);const c=p.name;let v=Tn.get(c);return v===void 0&&(v=p.offset(Ha),Tn.set(c,v)),v}function ws(p,c){const v=_e(c.zone,wt.defaultZone);if(!v.isValid)return qe.invalid(ma(v));const E=B.fromObject(c);let M,U;if(Ze(p.year))M=wt.now();else{for(const I of pa)Ze(p[I])&&(p[I]=va[I]);const Z=ll(p)||Ss(p);if(Z)return qe.invalid(Z);const $=zn(v);[M,U]=_r(p,$,v)}return new qe({ts:M,zone:v,loc:E,o:U})}function Cs(p,c,v){const E=Ze(v.round)?!0:v.round,M=Ze(v.rounding)?"trunc":v.rounding,U=($,I)=>($=sr($,E||v.calendary?0:2,v.calendary?"round":M),c.loc.clone(v).relFormatter(v).format($,I)),Z=$=>v.calendary?c.hasSame(p,$)?0:c.startOf($).diff(p.startOf($),$).get($):c.diff(p,$).get($);if(v.unit)return U(Z(v.unit),v.unit);for(const $ of v.units){const I=Z($);if(Math.abs(I)>=1)return U(I,$)}return U(p>c?-0:0,v.units[v.units.length-1])}function wr(p){let c={},v;return p.length>0&&typeof p[p.length-1]=="object"?(c=p[p.length-1],v=Array.from(p).slice(0,p.length-1)):v=Array.from(p),[c,v]}let Ha;const Tn=new Map;class qe{constructor(c){const v=c.zone||wt.defaultZone;let E=c.invalid||(Number.isNaN(c.ts)?new Rn("invalid input"):null)||(v.isValid?null:ma(v));this.ts=Ze(c.ts)?wt.now():c.ts;let M=null,U=null;if(!E)if(c.old&&c.old.ts===this.ts&&c.old.zone.equals(v))[M,U]=[c.old.c,c.old.o];else{const $=An(c.o)&&!c.old?c.o:v.offset(this.ts);M=ga(this.ts,$),E=Number.isNaN(M.year)?new Rn("invalid input"):null,M=E?null:M,U=E?null:$}this._zone=v,this.loc=c.loc||B.create(),this.invalid=E,this.weekData=null,this.localWeekData=null,this.c=M,this.o=U,this.isLuxonDateTime=!0}static now(){return new qe({})}static local(){const[c,v]=wr(arguments),[E,M,U,Z,$,I,xe]=v;return ws({year:E,month:M,day:U,hour:Z,minute:$,second:I,millisecond:xe},c)}static utc(){const[c,v]=wr(arguments),[E,M,U,Z,$,I,xe]=v;return c.zone=he.utcInstance,ws({year:E,month:M,day:U,hour:Z,minute:$,second:I,millisecond:xe},c)}static fromJSDate(c,v={}){const E=gc(c)?c.valueOf():NaN;if(Number.isNaN(E))return qe.invalid("invalid input");const M=_e(v.zone,wt.defaultZone);return M.isValid?new qe({ts:E,zone:M,loc:B.fromObject(v)}):qe.invalid(ma(M))}static fromMillis(c,v={}){if(An(c))return c<-wn||c>wn?qe.invalid("Timestamp out of range"):new qe({ts:c,zone:_e(v.zone,wt.defaultZone),loc:B.fromObject(v)});throw new m(`fromMillis requires a numerical input, but received a ${typeof c} with value ${c}`)}static fromSeconds(c,v={}){if(An(c))return new qe({ts:c*1e3,zone:_e(v.zone,wt.defaultZone),loc:B.fromObject(v)});throw new m("fromSeconds requires a numerical input")}static fromObject(c,v={}){c=c||{};const E=_e(v.zone,wt.defaultZone);if(!E.isValid)return qe.invalid(ma(E));const M=B.fromObject(v),U=ka(c,Xu),{minDaysInFirstWeek:Z,startOfWeek:$}=mc(U,M),I=wt.now(),xe=Ze(v.specificOffset)?E.offset(I):v.specificOffset,ke=!Ze(U.ordinal),Ge=!Ze(U.year),it=!Ze(U.month)||!Ze(U.day),$e=Ge||it,Ut=U.weekYear||U.weekNumber;if(($e||ke)&&Ut)throw new u("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(it&&ke)throw new u("Can't mix ordinal dates with month/day");const un=Ut||U.weekday&&!$e;let on,is,Va=ga(I,xe);un?(on=Gu,is=Fc,Va=tn(Va,Z,$)):ke?(on=qc,is=_l,Va=nr(Va)):(on=pa,is=va);let Ol=!1;for(const xa of on){const wl=U[xa];Ze(wl)?Ol?U[xa]=is[xa]:U[xa]=Va[xa]:Ol=!0}const Ms=un?yc(U,Z,$):ke?ar(U):ll(U),Sa=Ms||Ss(U);if(Sa)return qe.invalid(Sa);const rs=un?bs(U,Z,$):ke?hc(U):U,[Fa,Qu]=_r(rs,xe,E),Ds=new qe({ts:Fa,zone:E,o:Qu,loc:M});return U.weekday&&$e&&c.weekday!==Ds.weekday?qe.invalid("mismatched weekday",`you can't specify both a weekday of ${U.weekday} and a date of ${Ds.toISO()}`):Ds.isValid?Ds:qe.invalid(Ds.invalid)}static fromISO(c,v={}){const[E,M]=Oc(c);return Pn(E,M,v,"ISO 8601",c)}static fromRFC2822(c,v={}){const[E,M]=wc(c);return Pn(E,M,v,"RFC 2822",c)}static fromHTTP(c,v={}){const[E,M]=Cc(c);return Pn(E,M,v,"HTTP",v)}static fromFormat(c,v,E={}){if(Ze(c)||Ze(v))throw new m("fromFormat requires an input string and a format");const{locale:M=null,numberingSystem:U=null}=E,Z=B.fromOpts({locale:M,numberingSystem:U,defaultToEN:!0}),[$,I,xe,ke]=Iu(Z,c,v);return ke?qe.invalid(ke):Pn($,I,E,`format ${v}`,c,xe)}static fromString(c,v,E={}){return qe.fromFormat(c,v,E)}static fromSQL(c,v={}){const[E,M]=jc(c);return Pn(E,M,v,"SQL",c)}static invalid(c,v=null){if(!c)throw new m("need to specify a reason the DateTime is invalid");const E=c instanceof Rn?c:new Rn(c,v);if(wt.throwOnInvalid)throw new a(E);return new qe({invalid:E})}static isDateTime(c){return c&&c.isLuxonDateTime||!1}static parseFormatForOpts(c,v={}){const E=Un(c,B.fromObject(v));return E?E.map(M=>M?M.val:null).join(""):null}static expandFormat(c,v={}){return Vc(nn.parseFormat(c),B.fromObject(v)).map(M=>M.val).join("")}static resetCache(){Ha=void 0,Tn.clear()}get(c){return this[c]}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?Nr(this).weekYear:NaN}get weekNumber(){return this.isValid?Nr(this).weekNumber:NaN}get weekday(){return this.isValid?Nr(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?mi(this).weekday:NaN}get localWeekNumber(){return this.isValid?mi(this).weekNumber:NaN}get localWeekYear(){return this.isValid?mi(this).weekYear:NaN}get ordinal(){return this.isValid?nr(this.c).ordinal:NaN}get monthShort(){return this.isValid?xr.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?xr.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?xr.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?xr.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];const c=864e5,v=6e4,E=hn(this.c),M=this.zone.offset(E-c),U=this.zone.offset(E+c),Z=this.zone.offset(E-M*v),$=this.zone.offset(E-U*v);if(Z===$)return[this];const I=E-Z*v,xe=E-$*v,ke=ga(I,Z),Ge=ga(xe,$);return ke.hour===Ge.hour&&ke.minute===Ge.minute&&ke.second===Ge.second&&ke.millisecond===Ge.millisecond?[ya(this,{ts:I}),ya(this,{ts:xe})]:[this]}get isInLeapYear(){return ni(this.year)}get daysInMonth(){return ol(this.year,this.month)}get daysInYear(){return this.isValid?Aa(this.year):NaN}get weeksInWeekYear(){return this.isValid?ai(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?ai(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(c={}){const{locale:v,numberingSystem:E,calendar:M}=nn.create(this.loc.clone(c),c).resolvedOptions(this);return{locale:v,numberingSystem:E,outputCalendar:M}}toUTC(c=0,v={}){return this.setZone(he.instance(c),v)}toLocal(){return this.setZone(wt.defaultZone)}setZone(c,{keepLocalTime:v=!1,keepCalendarTime:E=!1}={}){if(c=_e(c,wt.defaultZone),c.equals(this.zone))return this;if(c.isValid){let M=this.ts;if(v||E){const U=c.offset(this.ts),Z=this.toObject();[M]=_r(Z,U,c)}return ya(this,{ts:M,zone:c})}else return qe.invalid(ma(c))}reconfigure({locale:c,numberingSystem:v,outputCalendar:E}={}){const M=this.loc.clone({locale:c,numberingSystem:v,outputCalendar:E});return ya(this,{loc:M})}setLocale(c){return this.reconfigure({locale:c})}set(c){if(!this.isValid)return this;const v=ka(c,Xu),{minDaysInFirstWeek:E,startOfWeek:M}=mc(v,this.loc),U=!Ze(v.weekYear)||!Ze(v.weekNumber)||!Ze(v.weekday),Z=!Ze(v.ordinal),$=!Ze(v.year),I=!Ze(v.month)||!Ze(v.day),xe=$||I,ke=v.weekYear||v.weekNumber;if((xe||Z)&&ke)throw new u("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(I&&Z)throw new u("Can't mix ordinal dates with month/day");let Ge;U?Ge=bs({...tn(this.c,E,M),...v},E,M):Ze(v.ordinal)?(Ge={...this.toObject(),...v},Ze(v.day)&&(Ge.day=Math.min(ol(Ge.year,Ge.month),Ge.day))):Ge=hc({...nr(this.c),...v});const[it,$e]=_r(Ge,this.o,this.zone);return ya(this,{ts:it,o:$e})}plus(c){if(!this.isValid)return this;const v=st.fromDurationLike(c);return ya(this,Or(this,v))}minus(c){if(!this.isValid)return this;const v=st.fromDurationLike(c).negate();return ya(this,Or(this,v))}startOf(c,{useLocaleWeeks:v=!1}={}){if(!this.isValid)return this;const E={},M=st.normalizeUnit(c);switch(M){case"years":E.month=1;case"quarters":case"months":E.day=1;case"weeks":case"days":E.hour=0;case"hours":E.minute=0;case"minutes":E.second=0;case"seconds":E.millisecond=0;break}if(M==="weeks")if(v){const U=this.loc.getStartOfWeek(),{weekday:Z}=this;Z<U&&(E.weekNumber=this.weekNumber-1),E.weekday=U}else E.weekday=1;if(M==="quarters"){const U=Math.ceil(this.month/3);E.month=(U-1)*3+1}return this.set(E)}endOf(c,v){return this.isValid?this.plus({[c]:1}).startOf(c,v).minus(1):this}toFormat(c,v={}){return this.isValid?nn.create(this.loc.redefaultToEN(v)).formatDateTimeFromString(this,c):hi}toLocaleString(c=w,v={}){return this.isValid?nn.create(this.loc.clone(v),c).formatDateTime(this):hi}toLocaleParts(c={}){return this.isValid?nn.create(this.loc.clone(c),c).formatDateTimeParts(this):[]}toISO({format:c="extended",suppressSeconds:v=!1,suppressMilliseconds:E=!1,includeOffset:M=!0,extendedZone:U=!1,precision:Z="milliseconds"}={}){if(!this.isValid)return null;Z=yi(Z);const $=c==="extended";let I=yn(this,$,Z);return pa.indexOf(Z)>=3&&(I+="T"),I+=Nl(this,$,v,E,M,U,Z),I}toISODate({format:c="extended",precision:v="day"}={}){return this.isValid?yn(this,c==="extended",yi(v)):null}toISOWeekDate(){return Tl(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:c=!1,suppressSeconds:v=!1,includeOffset:E=!0,includePrefix:M=!1,extendedZone:U=!1,format:Z="extended",precision:$="milliseconds"}={}){return this.isValid?($=yi($),(M&&pa.indexOf($)>=3?"T":"")+Nl(this,Z==="extended",v,c,E,U,$)):null}toRFC2822(){return Tl(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Tl(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?yn(this,!0):null}toSQLTime({includeOffset:c=!0,includeZone:v=!1,includeOffsetSpace:E=!0}={}){let M="HH:mm:ss.SSS";return(v||c)&&(E&&(M+=" "),v?M+="z":c&&(M+="ZZ")),Tl(this,M,!0)}toSQL(c={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(c)}`:null}toString(){return this.isValid?this.toISO():hi}[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(c={}){if(!this.isValid)return{};const v={...this.c};return c.includeConfig&&(v.outputCalendar=this.outputCalendar,v.numberingSystem=this.loc.numberingSystem,v.locale=this.loc.locale),v}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(c,v="milliseconds",E={}){if(!this.isValid||!c.isValid)return st.invalid("created by diffing an invalid DateTime");const M={locale:this.locale,numberingSystem:this.numberingSystem,...E},U=ti(v).map(st.normalizeUnit),Z=c.valueOf()>this.valueOf(),$=Z?this:c,I=Z?c:this,xe=Ac($,I,U,M);return Z?xe.negate():xe}diffNow(c="milliseconds",v={}){return this.diff(qe.now(),c,v)}until(c){return this.isValid?Ct.fromDateTimes(this,c):this}hasSame(c,v,E){if(!this.isValid)return!1;const M=c.valueOf(),U=this.setZone(c.zone,{keepLocalTime:!0});return U.startOf(v,E)<=M&&M<=U.endOf(v,E)}equals(c){return this.isValid&&c.isValid&&this.valueOf()===c.valueOf()&&this.zone.equals(c.zone)&&this.loc.equals(c.loc)}toRelative(c={}){if(!this.isValid)return null;const v=c.base||qe.fromObject({},{zone:this.zone}),E=c.padding?this<v?-c.padding:c.padding:0;let M=["years","months","days","hours","minutes","seconds"],U=c.unit;return Array.isArray(c.unit)&&(M=c.unit,U=void 0),Cs(v,this.plus(E),{...c,numeric:"always",units:M,unit:U})}toRelativeCalendar(c={}){return this.isValid?Cs(c.base||qe.fromObject({},{zone:this.zone}),this,{...c,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...c){if(!c.every(qe.isDateTime))throw new m("min requires all arguments be DateTimes");return vc(c,v=>v.valueOf(),Math.min)}static max(...c){if(!c.every(qe.isDateTime))throw new m("max requires all arguments be DateTimes");return vc(c,v=>v.valueOf(),Math.max)}static fromFormatExplain(c,v,E={}){const{locale:M=null,numberingSystem:U=null}=E,Z=B.fromOpts({locale:M,numberingSystem:U,defaultToEN:!0});return Yu(Z,c,v)}static fromStringExplain(c,v,E={}){return qe.fromFormatExplain(c,v,E)}static buildFormatParser(c,v={}){const{locale:E=null,numberingSystem:M=null}=v,U=B.fromOpts({locale:E,numberingSystem:M,defaultToEN:!0});return new $u(U,c)}static fromFormatParser(c,v,E={}){if(Ze(c)||Ze(v))throw new m("fromFormatParser requires an input string and a format parser");const{locale:M=null,numberingSystem:U=null}=E,Z=B.fromOpts({locale:M,numberingSystem:U,defaultToEN:!0});if(!Z.equals(v.locale))throw new m(`fromFormatParser called with a locale of ${Z}, but the format parser was created for ${v.locale}`);const{result:$,zone:I,specificOffset:xe,invalidReason:ke}=v.explainFromTokens(c);return ke?qe.invalid(ke):Pn($,I,E,`format ${v.format}`,c,xe)}static get DATE_SHORT(){return w}static get DATE_MED(){return T}static get DATE_MED_WITH_WEEKDAY(){return S}static get DATE_FULL(){return N}static get DATE_HUGE(){return O}static get TIME_SIMPLE(){return j}static get TIME_WITH_SECONDS(){return R}static get TIME_WITH_SHORT_OFFSET(){return k}static get TIME_WITH_LONG_OFFSET(){return H}static get TIME_24_SIMPLE(){return F}static get TIME_24_WITH_SECONDS(){return J}static get TIME_24_WITH_SHORT_OFFSET(){return pe}static get TIME_24_WITH_LONG_OFFSET(){return G}static get DATETIME_SHORT(){return re}static get DATETIME_SHORT_WITH_SECONDS(){return se}static get DATETIME_MED(){return V}static get DATETIME_MED_WITH_SECONDS(){return K}static get DATETIME_MED_WITH_WEEKDAY(){return P}static get DATETIME_FULL(){return ie}static get DATETIME_FULL_WITH_SECONDS(){return Se}static get DATETIME_HUGE(){return be}static get DATETIME_HUGE_WITH_SECONDS(){return X}}function Ln(p){if(qe.isDateTime(p))return p;if(p&&p.valueOf&&An(p.valueOf()))return qe.fromJSDate(p);if(p&&typeof p=="object")return qe.fromObject(p);throw new m(`Unknown datetime argument: ${p}, of type ${typeof p}`)}const ba="3.7.2";return Zn.DateTime=qe,Zn.Duration=st,Zn.FixedOffsetZone=he,Zn.IANAZone=Le,Zn.Info=xr,Zn.Interval=Ct,Zn.InvalidZone=ve,Zn.Settings=wt,Zn.SystemZone=De,Zn.VERSION=ba,Zn.Zone=ce,Zn}var B0;function Gy(){return B0||(B0=1,(function(n){var o,m,g,b,cy,_,zi;Object.defineProperty(n,"__esModule",{value:!0}),n.CronDate=n.DAYS_IN_MONTH=n.DateMathOp=n.TimeUnit=void 0;const a=nO();var i;(function(S){S.Second="Second",S.Minute="Minute",S.Hour="Hour",S.Day="Day",S.Month="Month",S.Year="Year"})(i||(n.TimeUnit=i={}));var l;(function(S){S.Add="Add",S.Subtract="Subtract"})(l||(n.DateMathOp=l={})),n.DAYS_IN_MONTH=Object.freeze([31,29,31,30,31,30,31,31,30,31,30,31]);const T=class T{constructor(N,O){Ce(this,_);Ce(this,o);Ce(this,m,null);Ce(this,g,null);const j={zone:O};if(N?N instanceof T?(oe(this,o,C(N,o)),oe(this,m,C(N,m)),oe(this,g,C(N,g))):N instanceof Date?oe(this,o,a.DateTime.fromJSDate(N,j)):typeof N=="number"?oe(this,o,a.DateTime.fromMillis(N,j)):(oe(this,o,a.DateTime.fromISO(N,j)),C(this,o).isValid||oe(this,o,a.DateTime.fromRFC2822(N,j)),C(this,o).isValid||oe(this,o,a.DateTime.fromSQL(N,j)),C(this,o).isValid||oe(this,o,a.DateTime.fromFormat(N,"EEE, d MMM yyyy HH:mm:ss",j))):oe(this,o,a.DateTime.local()),!C(this,o).isValid)throw new Error(`CronDate: unhandled timestamp: ${N}`);O&&O!==C(this,o).zoneName&&oe(this,o,C(this,o).setZone(O))}get dstStart(){return C(this,m)}set dstStart(N){oe(this,m,N)}get dstEnd(){return C(this,g)}set dstEnd(N){oe(this,g,N)}addYear(){oe(this,o,C(this,o).plus({years:1}))}addMonth(){oe(this,o,C(this,o).plus({months:1}).startOf("month"))}addDay(){oe(this,o,C(this,o).plus({days:1}).startOf("day"))}addHour(){oe(this,o,C(this,o).plus({hours:1}).startOf("hour"))}addMinute(){oe(this,o,C(this,o).plus({minutes:1}).startOf("minute"))}addSecond(){oe(this,o,C(this,o).plus({seconds:1}))}subtractYear(){oe(this,o,C(this,o).minus({years:1}))}subtractMonth(){oe(this,o,C(this,o).minus({months:1}).endOf("month").startOf("second"))}subtractDay(){oe(this,o,C(this,o).minus({days:1}).endOf("day").startOf("second"))}subtractHour(){oe(this,o,C(this,o).minus({hours:1}).endOf("hour").startOf("second"))}subtractMinute(){oe(this,o,C(this,o).minus({minutes:1}).endOf("minute").startOf("second"))}subtractSecond(){oe(this,o,C(this,o).minus({seconds:1}))}addUnit(N){switch(N){case i.Year:return this.addYear();case i.Month:return this.addMonth();case i.Day:return this.addDay();case i.Hour:return this.addHour();case i.Minute:return this.addMinute();case i.Second:return this.addSecond()}}subtractUnit(N){switch(N){case i.Year:return this.subtractYear();case i.Month:return this.subtractMonth();case i.Day:return this.subtractDay();case i.Hour:return this.subtractHour();case i.Minute:return this.subtractMinute();case i.Second:return this.subtractSecond()}}invokeDateOperation(N,O){if(N===l.Add){this.addUnit(O);return}if(N===l.Subtract){this.subtractUnit(O);return}throw new Error(`Invalid verb: ${N}`)}getDate(){return C(this,o).day}getFullYear(){return C(this,o).year}getDay(){const N=C(this,o).weekday;return N===7?0:N}getMonth(){return C(this,o).month-1}getHours(){return C(this,o).hour}getMinutes(){return C(this,o).minute}getSeconds(){return C(this,o).second}getMilliseconds(){return C(this,o).millisecond}getUTCOffset(){return C(this,o).offset}setStartOfDay(){oe(this,o,C(this,o).startOf("day"))}setEndOfDay(){oe(this,o,C(this,o).endOf("day"))}getTime(){return C(this,o).valueOf()}getUTCDate(){return Te(this,_,zi).call(this).day}getUTCFullYear(){return Te(this,_,zi).call(this).year}getUTCDay(){const N=Te(this,_,zi).call(this).weekday;return N===7?0:N}getUTCMonth(){return Te(this,_,zi).call(this).month-1}getUTCHours(){return Te(this,_,zi).call(this).hour}getUTCMinutes(){return Te(this,_,zi).call(this).minute}getUTCSeconds(){return Te(this,_,zi).call(this).second}toISOString(){return C(this,o).toUTC().toISO()}toJSON(){return C(this,o).toJSON()}setDate(N){oe(this,o,C(this,o).set({day:N}))}setFullYear(N){oe(this,o,C(this,o).set({year:N}))}setDay(N){oe(this,o,C(this,o).set({weekday:N}))}setMonth(N){oe(this,o,C(this,o).set({month:N+1}))}setHours(N){oe(this,o,C(this,o).set({hour:N}))}setMinutes(N){oe(this,o,C(this,o).set({minute:N}))}setSeconds(N){oe(this,o,C(this,o).set({second:N}))}setMilliseconds(N){oe(this,o,C(this,o).set({millisecond:N}))}toString(){return this.toDate().toString()}toDate(){return C(this,o).toJSDate()}isLastDayOfMonth(){var j;const{day:N,month:O}=C(this,o);if(O===2){const R=Te(j=T,b,cy).call(j,C(this,o).year);return N===n.DAYS_IN_MONTH[O-1]-(R?0:1)}return N===n.DAYS_IN_MONTH[O-1]}isLastWeekdayOfMonth(){var R;const{day:N,month:O}=C(this,o);let j;return O===2?j=n.DAYS_IN_MONTH[O-1]-(Te(R=T,b,cy).call(R,C(this,o).year)?0:1):j=n.DAYS_IN_MONTH[O-1],N>j-7}applyDateOperation(N,O,j){if(O===i.Month||O===i.Day){this.invokeDateOperation(N,O);return}const R=this.getHours();this.invokeDateOperation(N,O);const k=this.getHours(),H=k-R;H===2?j!==24&&(this.dstStart=R+1):H===0&&this.getMinutes()===0&&this.getSeconds()===0&&j!==24&&(this.dstEnd=k)}};o=new WeakMap,m=new WeakMap,g=new WeakMap,b=new WeakSet,cy=function(N){return N%4===0&&N%100!==0||N%400===0},_=new WeakSet,zi=function(){return C(this,o).toUTC()},Ce(T,b);let u=T;n.CronDate=u,n.default=u})(Am)),Am}var Z0;function aO(){if(Z0)return zo;Z0=1,Object.defineProperty(zo,"__esModule",{value:!0}),zo.CronMonth=void 0;const n=Gy(),a=nl(),i=1,l=12,u=Object.freeze([]);let o=class extends a.CronField{static get min(){return i}static get max(){return l}static get chars(){return u}static get daysInMonth(){return n.DAYS_IN_MONTH}constructor(g,b){super(g,b),this.validate()}get values(){return super.values}};return zo.CronMonth=o,zo}var Lo={},$0;function sO(){if($0)return Lo;$0=1,Object.defineProperty(Lo,"__esModule",{value:!0}),Lo.CronSecond=void 0;const n=nl(),a=0,i=59,l=Object.freeze([]);let u=class extends n.CronField{static get min(){return a}static get max(){return i}static get chars(){return l}constructor(m,g){super(m,g),this.validate()}get values(){return super.values}};return Lo.CronSecond=u,Lo}var Y0;function Xy(){return Y0||(Y0=1,(function(n){var a=Hr&&Hr.__createBinding||(Object.create?(function(l,u,o,m){m===void 0&&(m=o);var g=Object.getOwnPropertyDescriptor(u,o);(!g||("get"in g?!u.__esModule:g.writable||g.configurable))&&(g={enumerable:!0,get:function(){return u[o]}}),Object.defineProperty(l,m,g)}):(function(l,u,o,m){m===void 0&&(m=o),l[m]=u[o]})),i=Hr&&Hr.__exportStar||function(l,u){for(var o in l)o!=="default"&&!Object.prototype.hasOwnProperty.call(u,o)&&a(u,l,o)};Object.defineProperty(n,"__esModule",{value:!0}),i(K_(),n),i(J_(),n),i(P_(),n),i(nl(),n),i(eO(),n),i(tO(),n),i(aO(),n),i(sO(),n)})(Hr)),Hr}var I0;function QS(){var i,l,u,o,m,g,b,y,GS,XS;if(I0)return Do;I0=1,Object.defineProperty(Do,"__esModule",{value:!0}),Do.CronFieldCollection=void 0;const n=Xy();let a=(y=class{constructor({second:S,minute:N,hour:O,dayOfMonth:j,month:R,dayOfWeek:k}){Ce(this,i);Ce(this,l);Ce(this,u);Ce(this,o);Ce(this,m);Ce(this,g);if(!S)throw new Error("Validation error, Field second is missing");if(!N)throw new Error("Validation error, Field minute is missing");if(!O)throw new Error("Validation error, Field hour is missing");if(!j)throw new Error("Validation error, Field dayOfMonth is missing");if(!R)throw new Error("Validation error, Field month is missing");if(!k)throw new Error("Validation error, Field dayOfWeek is missing");if(R.values.length===1&&!j.hasLastChar&&k.isWildcard&&!(parseInt(j.values[0],10)<=n.CronMonth.daysInMonth[R.values[0]-1]))throw new Error("Invalid explicit day of month definition");oe(this,i,S),oe(this,l,N),oe(this,u,O),oe(this,m,R),oe(this,g,k),oe(this,o,j)}static from(S,N){return new y({second:this.resolveField(n.CronSecond,S.second,N.second),minute:this.resolveField(n.CronMinute,S.minute,N.minute),hour:this.resolveField(n.CronHour,S.hour,N.hour),dayOfMonth:this.resolveField(n.CronDayOfMonth,S.dayOfMonth,N.dayOfMonth),month:this.resolveField(n.CronMonth,S.month,N.month),dayOfWeek:this.resolveField(n.CronDayOfWeek,S.dayOfWeek,N.dayOfWeek)})}static resolveField(S,N,O){return O?O instanceof n.CronField?O:new S(O):N}get second(){return C(this,i)}get minute(){return C(this,l)}get hour(){return C(this,u)}get dayOfMonth(){return C(this,o)}get month(){return C(this,m)}get dayOfWeek(){return C(this,g)}static compactField(S){if(S.length===0)return[];const N=[];let O;return S.forEach((j,R,k)=>{if(O===void 0){O={start:j,count:1};return}const H=k[R-1]||O.start,F=k[R+1];if(j==="L"||j==="W"){N.push(O),N.push({start:j,count:1}),O=void 0;return}if(O.step===void 0&&F!==void 0){const J=j-H,pe=F-j;if(J<=pe){O={...O,count:2,end:j,step:J};return}O.step=1}j-(O.end??0)===O.step?(O.count++,O.end=j):(O.count===1?N.push({start:O.start,count:1}):O.count===2?(N.push({start:O.start,count:1}),N.push({start:O.end??H,count:1})):N.push(O),O={start:j,count:1})}),O&&N.push(O),N}stringifyField(S){var R;let N=S.max,O=S.values;if(S instanceof n.CronDayOfWeek){N=6;const k=C(this,g).values;O=k[k.length-1]===7?k.slice(0,-1):k}S instanceof n.CronDayOfMonth&&(N=C(this,m).values.length===1?n.CronMonth.daysInMonth[C(this,m).values[0]-1]:S.max);const j=y.compactField(O);if(j.length===1){const k=Te(R=y,b,GS).call(R,S,j[0],N);if(k)return k}return j.map(k=>{var F;const H=k.count===1?k.start.toString():Te(F=y,b,XS).call(F,k,N);return S instanceof n.CronDayOfWeek&&S.nthDay>0?`${H}#${S.nthDay}`:H}).join(",")}stringify(S=!1){const N=[];return S&&N.push(this.stringifyField(C(this,i))),N.push(this.stringifyField(C(this,l)),this.stringifyField(C(this,u)),this.stringifyField(C(this,o)),this.stringifyField(C(this,m)),this.stringifyField(C(this,g))),N.join(" ")}serialize(){return{second:C(this,i).serialize(),minute:C(this,l).serialize(),hour:C(this,u).serialize(),dayOfMonth:C(this,o).serialize(),month:C(this,m).serialize(),dayOfWeek:C(this,g).serialize()}}},i=new WeakMap,l=new WeakMap,u=new WeakMap,o=new WeakMap,m=new WeakMap,g=new WeakMap,b=new WeakSet,GS=function(S,N,O){const j=N.step;return j?j===1&&N.start===S.min&&N.end&&N.end>=O?S.hasQuestionMarkChar?"?":"*":j!==1&&N.start===S.min&&N.end&&N.end>=O-j+1?`*/${j}`:null:null},XS=function(S,N){const O=S.step;if(O===1)return`${S.start}-${S.end}`;const j=S.start===0?S.count-1:S.count;if(!O)throw new Error("Unexpected range step");if(!S.end)throw new Error("Unexpected range end");if(O*j>S.end){const R=(H,F)=>{if(typeof S.start!="number")throw new Error("Unexpected range start");return F%O===0?S.start+F:null};if(typeof S.start!="number")throw new Error("Unexpected range start");const k={length:S.end-S.start+1};return Array.from(k,R).filter(H=>H!==null).join(",")}return S.end===N-O+1?`${S.start}/${O}`:`${S.start}-${S.end}/${O}`},Ce(y,b),y);return Do.CronFieldCollection=a,Do}var km={},G0;function nx(){return G0||(G0=1,(function(n){var u,o,m,g,b,y,_,w,T,Li,N,Fr,WS,KS,JS,PS,fy,ex,tx,Wl;Object.defineProperty(n,"__esModule",{value:!0}),n.CronExpression=n.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE=n.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE=void 0;const a=Gy();n.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE="Out of the time span range",n.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE="Invalid expression, loop limit exceeded";const i=1e4,re=class re{constructor(V,K){Ce(this,N);Ce(this,u);Ce(this,o);Ce(this,m);Ce(this,g);Ce(this,b);Ce(this,y);Ce(this,_,null);Ce(this,w,!1);oe(this,u,K),oe(this,o,K.tz),oe(this,g,K.startDate?new a.CronDate(K.startDate,C(this,o)):null),oe(this,b,K.endDate?new a.CronDate(K.endDate,C(this,o)):null);let P=K.currentDate??K.startDate;if(P){const ie=new a.CronDate(P,C(this,o));C(this,g)&&ie.getTime()<C(this,g).getTime()?P=C(this,g):C(this,b)&&ie.getTime()>C(this,b).getTime()&&(P=C(this,b))}oe(this,m,new a.CronDate(P,C(this,o))),oe(this,y,V)}get fields(){return C(this,y)}static fieldsToExpression(V,K){return new re(V,K||{})}next(){return Te(this,N,Wl).call(this)}prev(){return Te(this,N,Wl).call(this,!0)}hasNext(){const V=C(this,m);try{return Te(this,N,Wl).call(this),!0}catch{return!1}finally{oe(this,m,V)}}hasPrev(){const V=C(this,m);try{return Te(this,N,Wl).call(this,!0),!0}catch{return!1}finally{oe(this,m,V)}}take(V){const K=[];if(V>=0)for(let P=0;P<V;P++)try{K.push(this.next())}catch{return K}else for(let P=0;P>V;P--)try{K.push(this.prev())}catch{return K}return K}reset(V){oe(this,m,new a.CronDate(V||C(this,u).currentDate,C(this,o)))}stringify(V=!1){return C(this,y).stringify(V)}includesDate(V){const{second:K,minute:P,hour:ie,month:Se}=C(this,y),be=new a.CronDate(V,C(this,o));return!(!K.values.includes(be.getSeconds())||!P.values.includes(be.getMinutes())||!ie.values.includes(be.getHours())||!Se.values.includes(be.getMonth()+1)||!Te(this,N,fy).call(this,be)||C(this,y).dayOfWeek.nthDay>0&&Math.ceil(be.getDate()/7)!==C(this,y).dayOfWeek.nthDay)}toString(){return C(this,u).expression||this.stringify(!0)}[Symbol.iterator](){return{next:()=>{try{return{value:Te(this,N,Wl).call(this),done:!1}}catch{return{value:void 0,done:!0}}}}}};u=new WeakMap,o=new WeakMap,m=new WeakMap,g=new WeakMap,b=new WeakMap,y=new WeakMap,_=new WeakMap,w=new WeakMap,T=new WeakSet,Li=function(V,K){return K.some(P=>P===V)},N=new WeakSet,Fr=function(V,K){return V[K?V.length-1:0]},WS=function(V){const K=`${V.getFullYear()}-${V.getMonth()+1}-${V.getDate()}`;if(C(this,_)===K)return C(this,w);const P=new a.CronDate(V);P.setStartOfDay();const ie=new a.CronDate(V);return ie.setEndOfDay(),oe(this,_,K),oe(this,w,P.getUTCOffset()!==ie.getUTCOffset()),C(this,w)},KS=function(V,K,P){const ie=C(this,y).second.values,Se=V.getSeconds(),be=C(this,y).second.findNearestValue(Se,P);if(be!==null){V.setSeconds(be);return}V.applyDateOperation(K,a.TimeUnit.Minute,C(this,y).hour.values.length),V.setSeconds(Te(this,N,Fr).call(this,ie,P))},JS=function(V,K,P){const ie=C(this,y).minute.values,Se=C(this,y).second.values,be=V.getMinutes(),X=C(this,y).minute.findNearestValue(be,P);if(X!==null){V.setMinutes(X),V.setSeconds(Te(this,N,Fr).call(this,Se,P));return}V.applyDateOperation(K,a.TimeUnit.Hour,C(this,y).hour.values.length),V.setMinutes(Te(this,N,Fr).call(this,ie,P)),V.setSeconds(Te(this,N,Fr).call(this,Se,P))},PS=function(V,K){const P=K.isLastWeekdayOfMonth();return V.some(ie=>{const Se=parseInt(ie.toString().charAt(0),10)%7;if(Number.isNaN(Se))throw new Error(`Invalid last weekday of the month expression: ${ie}`);return K.getDay()===Se&&P})},fy=function(V){var ce,ye,De;const K=C(this,y).dayOfMonth.isWildcard,P=!K,ie=C(this,y).dayOfWeek.isWildcard,Se=!ie,be=Te(ce=re,T,Li).call(ce,V.getDate(),C(this,y).dayOfMonth.values)||C(this,y).dayOfMonth.hasLastChar&&V.isLastDayOfMonth(),X=Te(ye=re,T,Li).call(ye,V.getDay(),C(this,y).dayOfWeek.values)||C(this,y).dayOfWeek.hasLastChar&&Te(De=re,T,PS).call(De,C(this,y).dayOfWeek.values,V);return!!(P&&Se&&(be||X)||be&&!Se||K&&!ie&&X)},ex=function(V,K,P){var De,Re;const ie=C(this,y).hour.values,Se=ie,be=V.getHours(),X=Te(De=re,T,Li).call(De,be,ie),ce=V.dstEnd===be;if(V.dstStart!==null&&V.dstStart===be-1&&Te(Re=re,T,Li).call(Re,V.dstStart,ie))return!0;if(ce&&!P)return V.dstEnd=null,V.applyDateOperation(a.DateMathOp.Add,a.TimeUnit.Hour,Se.length),!1;if(X)return!0;V.dstStart=null;const ye=C(this,y).hour.findNearestValue(be,P);if(ye===null)return V.applyDateOperation(K,a.TimeUnit.Day,Se.length),!1;if(Te(this,N,WS).call(this,V)){const q=P?be-ye:ye-be;for(let ue=0;ue<q&&(V.applyDateOperation(K,a.TimeUnit.Hour,Se.length),!(!P&&V.getHours()>=ye||P&&V.getHours()<=ye));ue++);}else V.setHours(ye);return V.setMinutes(Te(this,N,Fr).call(this,C(this,y).minute.values,P)),V.setSeconds(Te(this,N,Fr).call(this,C(this,y).second.values,P)),!1},tx=function(V){if(!C(this,g)&&!C(this,b))return;const K=V.getTime();if(C(this,g)&&K<C(this,g).getTime())throw new Error(n.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE);if(C(this,b)&&K>C(this,b).getTime())throw new Error(n.TIME_SPAN_OUT_OF_BOUNDS_ERROR_MESSAGE)},Wl=function(V=!1){var be,X,ce;const K=V?a.DateMathOp.Subtract:a.DateMathOp.Add,P=new a.CronDate(C(this,m)),ie=P.getTime();let Se=0;for(;++Se<i;){if(Te(this,N,tx).call(this,P),!Te(this,N,fy).call(this,P)){P.applyDateOperation(K,a.TimeUnit.Day,C(this,y).hour.values.length);continue}if(!(C(this,y).dayOfWeek.nthDay<=0||Math.ceil(P.getDate()/7)===C(this,y).dayOfWeek.nthDay)){P.applyDateOperation(K,a.TimeUnit.Day,C(this,y).hour.values.length);continue}if(!Te(be=re,T,Li).call(be,P.getMonth()+1,C(this,y).month.values)){P.applyDateOperation(K,a.TimeUnit.Month,C(this,y).hour.values.length);continue}if(Te(this,N,ex).call(this,P,K,V)){if(!Te(X=re,T,Li).call(X,P.getMinutes(),C(this,y).minute.values)){Te(this,N,JS).call(this,P,K,V);continue}if(!Te(ce=re,T,Li).call(ce,P.getSeconds(),C(this,y).second.values)){Te(this,N,KS).call(this,P,K,V);continue}if(ie===P.getTime()){(K==="Add"||P.getMilliseconds()===0)&&P.applyDateOperation(K,a.TimeUnit.Second,C(this,y).hour.values.length);continue}break}}if(Se>i)throw new Error(n.LOOPS_LIMIT_EXCEEDED_ERROR_MESSAGE);return P.getMilliseconds()!==0&&P.setMilliseconds(0),oe(this,m,P),P},Ce(re,T);let l=re;n.CronExpression=l,n.default=l})(km)),km}var qf={},X0;function iO(){if(X0)return qf;X0=1,Object.defineProperty(qf,"__esModule",{value:!0}),qf.seededRandom=i;function n(l){let u=2166136261;for(let o=0;o<l.length;o++)u^=l.charCodeAt(o),u=Math.imul(u,16777619);return()=>u>>>0}function a(l){return()=>{let u=l+=1831565813;return u=Math.imul(u^u>>>15,u|1),u^=u+Math.imul(u^u>>>7,u|61),((u^u>>>14)>>>0)/4294967296}}function i(l){const u=l?n(l)():Math.floor(Math.random()*1e10);return a(u)}return qf}var Q0;function hy(){var y,_,ax,qr,sx,ix,rx,lx,ux,ox,cx,dy,fx,dx;if(Q0)return ia;Q0=1,Object.defineProperty(ia,"__esModule",{value:!0}),ia.CronExpressionParser=ia.DayOfWeek=ia.Months=ia.CronUnit=ia.PredefinedExpressions=void 0;const n=QS(),a=nx(),i=iO(),l=Xy();var u;(function(G){G["@yearly"]="0 0 0 1 1 *",G["@annually"]="0 0 0 1 1 *",G["@monthly"]="0 0 0 1 * *",G["@weekly"]="0 0 0 * * 0",G["@daily"]="0 0 0 * * *",G["@hourly"]="0 0 * * * *",G["@minutely"]="0 * * * * *",G["@secondly"]="* * * * * *",G["@weekdays"]="0 0 0 * * 1-5",G["@weekends"]="0 0 0 * * 0,6"})(u||(ia.PredefinedExpressions=u={}));var o;(function(G){G.Second="Second",G.Minute="Minute",G.Hour="Hour",G.DayOfMonth="DayOfMonth",G.Month="Month",G.DayOfWeek="DayOfWeek"})(o||(ia.CronUnit=o={}));var m;(function(G){G[G.jan=1]="jan",G[G.feb=2]="feb",G[G.mar=3]="mar",G[G.apr=4]="apr",G[G.may=5]="may",G[G.jun=6]="jun",G[G.jul=7]="jul",G[G.aug=8]="aug",G[G.sep=9]="sep",G[G.oct=10]="oct",G[G.nov=11]="nov",G[G.dec=12]="dec"})(m||(ia.Months=m={}));var g;(function(G){G[G.sun=0]="sun",G[G.mon=1]="mon",G[G.tue=2]="tue",G[G.wed=3]="wed",G[G.thu=4]="thu",G[G.fri=5]="fri",G[G.sat=6]="sat"})(g||(ia.DayOfWeek=g={}));let b=(_=class{static parse(re,se={}){var Oe,Ne,Me,Le,Ie,ft,tt,Lt;const{strict:V=!1,hashSeed:K}=se,P=(0,i.seededRandom)(K);re=u[re]||re;const ie=Te(Oe=_,y,ax).call(Oe,re,V);if(!(ie.dayOfMonth==="*"||ie.dayOfWeek==="*"||!V))throw new Error("Cannot use both dayOfMonth and dayOfWeek together in strict mode!");const Se=Te(Ne=_,y,qr).call(Ne,o.Second,ie.second,l.CronSecond.constraints,P),be=Te(Me=_,y,qr).call(Me,o.Minute,ie.minute,l.CronMinute.constraints,P),X=Te(Le=_,y,qr).call(Le,o.Hour,ie.hour,l.CronHour.constraints,P),ce=Te(Ie=_,y,qr).call(Ie,o.Month,ie.month,l.CronMonth.constraints,P),ye=Te(ft=_,y,qr).call(ft,o.DayOfMonth,ie.dayOfMonth,l.CronDayOfMonth.constraints,P),{dayOfWeek:De,nthDayOfWeek:Re}=Te(tt=_,y,fx).call(tt,ie.dayOfWeek),q=Te(Lt=_,y,qr).call(Lt,o.DayOfWeek,De,l.CronDayOfWeek.constraints,P),ue=new n.CronFieldCollection({second:new l.CronSecond(Se,{rawValue:ie.second}),minute:new l.CronMinute(be,{rawValue:ie.minute}),hour:new l.CronHour(X,{rawValue:ie.hour}),dayOfMonth:new l.CronDayOfMonth(ye,{rawValue:ie.dayOfMonth}),month:new l.CronMonth(ce,{rawValue:ie.month}),dayOfWeek:new l.CronDayOfWeek(q,{rawValue:ie.dayOfWeek,nthDayOfWeek:Re})});return new a.CronExpression(ue,{...se,expression:re})}},y=new WeakSet,ax=function(re,se){if(se&&!re.length)throw new Error("Invalid cron expression");re=re||"0 * * * * *";const V=re.trim().split(/\s+/);if(se&&V.length<6)throw new Error("Invalid cron expression, expected 6 fields");if(V.length>6)throw new Error("Invalid cron expression, too many fields");const K=["*","*","*","*","*","0"];V.length<K.length&&V.unshift(...K.slice(V.length));const[P,ie,Se,be,X,ce]=V;return{second:P,minute:ie,hour:Se,dayOfMonth:be,month:X,dayOfWeek:ce}},qr=function(re,se,V,K){if((re===o.Month||re===o.DayOfWeek)&&(se=se.replace(/[a-z]{3}/gi,P=>{P=P.toLowerCase();const ie=m[P]||g[P];if(ie===void 0)throw new Error(`Validation error, cannot resolve alias "${P}"`);return ie.toString()})),!V.validChars.test(se))throw new Error(`Invalid characters, got value: ${se}`);return se=Te(this,y,sx).call(this,se,V),se=Te(this,y,ix).call(this,se,V,K),Te(this,y,rx).call(this,re,se,V)},sx=function(re,se){return re.replace(/[*?]/g,se.min+"-"+se.max)},ix=function(re,se,V){const K=V();return re.replace(/H(?:\((\d+)-(\d+)\))?(?:\/(\d+))?/g,(P,ie,Se,be)=>{if(ie&&Se&&be){const X=parseInt(ie,10),ce=parseInt(Se,10),ye=parseInt(be,10);if(X>ce)throw new Error(`Invalid range: ${X}-${ce}, min > max`);if(ye<=0)throw new Error(`Invalid step: ${ye}, must be positive`);const De=Math.max(X,se.min),Re=Math.floor(K*ye),q=[];for(let ue=Math.floor(De/ye)*ye+Re;ue<=ce;ue+=ye)ue>=De&&q.push(ue);return q.join(",")}else if(ie&&Se){const X=parseInt(ie,10),ce=parseInt(Se,10);if(X>ce)throw new Error(`Invalid range: ${X}-${ce}, min > max`);return String(Math.floor(K*(ce-X+1))+X)}else if(be){const X=parseInt(be,10);if(X<=0)throw new Error(`Invalid step: ${X}, must be positive`);const ce=Math.floor(K*X),ye=[];for(let De=Math.floor(se.min/X)*X+ce;De<=se.max;De+=X)De>=se.min&&ye.push(De);return ye.join(",")}else return String(Math.floor(K*(se.max-se.min+1)+se.min))})},rx=function(re,se,V){const K=[];function P(Se,be){var X;if(Array.isArray(Se))K.push(...Se);else if(Te(X=_,y,dx).call(X,be,Se))K.push(Se);else{const ce=parseInt(Se.toString(),10);if(!(ce>=be.min&&ce<=be.max))throw new Error(`Constraint error, got value ${Se} expected range ${be.min}-${be.max}`);K.push(re===o.DayOfWeek?ce%7:Se)}}return se.split(",").forEach(Se=>{var be;if(!(Se.length>0))throw new Error("Invalid list value format");P(Te(be=_,y,lx).call(be,re,Se,V),V)}),K},lx=function(re,se,V){var P,ie;const K=se.split("/");if(K.length>2)throw new Error(`Invalid repeat: ${se}`);return K.length===2?(K[0].includes("-")||(K[0]=`${K[0]}-${V.max}`),Te(P=_,y,dy).call(P,re,K[0],parseInt(K[1],10),V)):Te(ie=_,y,dy).call(ie,re,se,1,V)},ux=function(re,se,V){if(!(!isNaN(re)&&!isNaN(se)&&re>=V.min&&se<=V.max))throw new Error(`Constraint error, got range ${re}-${se} expected range ${V.min}-${V.max}`);if(re>se)throw new Error(`Invalid range: ${re}-${se}, min(${re}) > max(${se})`)},ox=function(re){if(!(!isNaN(re)&&re>0))throw new Error(`Constraint error, cannot repeat at every ${re} time.`)},cx=function(re,se,V,K){const P=[];re===o.DayOfWeek&&V%7===0&&P.push(0);for(let ie=se;ie<=V;ie+=K)P.indexOf(ie)===-1&&P.push(ie);return P},dy=function(re,se,V,K){const P=se.split("-");if(P.length<=1)return isNaN(+se)?se:+se;const[ie,Se]=P.map(be=>parseInt(be,10));return Te(this,y,ux).call(this,ie,Se,K),Te(this,y,ox).call(this,V),Te(this,y,cx).call(this,re,ie,Se,V)},fx=function(re){const se=re.split("#");if(se.length<=1)return{dayOfWeek:se[0]};const V=+se[se.length-1],K=re.match(/([,-/])/);if(K!==null)throw new Error(`Constraint error, invalid dayOfWeek \`#\` and \`${K==null?void 0:K[0]}\` special characters are incompatible`);if(!(se.length<=2&&!isNaN(V)&&V>=1&&V<=5))throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return{dayOfWeek:se[0],nthDayOfWeek:V}},dx=function(re,se){return re.chars.some(V=>se.toString().includes(V))},Ce(_,y),_);return ia.CronExpressionParser=b,ia}var Za={};const rO={},lO=Object.freeze(Object.defineProperty({__proto__:null,default:rO},Symbol.toStringTag,{value:"Module"})),W0=pE(lO);var K0;function uO(){var o,m,my,hx;if(K0)return Za;K0=1;var n=Za&&Za.__createBinding||(Object.create?(function(y,_,w,T){T===void 0&&(T=w);var S=Object.getOwnPropertyDescriptor(_,w);(!S||("get"in S?!_.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(y,T,S)}):(function(y,_,w,T){T===void 0&&(T=w),y[T]=_[w]})),a=Za&&Za.__setModuleDefault||(Object.create?(function(y,_){Object.defineProperty(y,"default",{enumerable:!0,value:_})}):function(y,_){y.default=_}),i=Za&&Za.__importStar||(function(){var y=function(_){return y=Object.getOwnPropertyNames||function(w){var T=[];for(var S in w)Object.prototype.hasOwnProperty.call(w,S)&&(T[T.length]=S);return T},y(_)};return function(_){if(_&&_.__esModule)return _;var w={};if(_!=null)for(var T=y(_),S=0;S<T.length;S++)T[S]!=="default"&&n(w,_,T[S]);return a(w,_),w}})();Object.defineProperty(Za,"__esModule",{value:!0}),Za.CronFileParser=void 0;const l=hy();let u=(m=class{static async parseFile(_){var S;const{readFile:w}=await Promise.resolve().then(()=>i(W0)),T=await w(_,"utf8");return Te(S=m,o,my).call(S,T)}static parseFileSync(_){var S;const{readFileSync:w}=W0,T=w(_,"utf8");return Te(S=m,o,my).call(S,T)}},o=new WeakSet,my=function(_){var S;const w=_.split(`
`),T={variables:{},expressions:[],errors:{}};for(const N of w){const O=N.trim();if(O.length===0||O.startsWith("#"))continue;const j=O.match(/^(.*)=(.*)$/);if(j){const[,R,k]=j;T.variables[R]=k.replace(/["']/g,"");continue}try{const R=Te(S=m,o,hx).call(S,O);T.expressions.push(R.interval)}catch(R){T.errors[O]=R}}return T},hx=function(_){const w=_.split(" ");return{interval:l.CronExpressionParser.parse(w.slice(0,5).join(" ")),command:w.slice(5,w.length)}},Ce(m,o),m);return Za.CronFileParser=u,Za}var J0;function oO(){return J0||(J0=1,(function(n){var a=Lr&&Lr.__createBinding||(Object.create?(function(y,_,w,T){T===void 0&&(T=w);var S=Object.getOwnPropertyDescriptor(_,w);(!S||("get"in S?!_.__esModule:S.writable||S.configurable))&&(S={enumerable:!0,get:function(){return _[w]}}),Object.defineProperty(y,T,S)}):(function(y,_,w,T){T===void 0&&(T=w),y[T]=_[w]})),i=Lr&&Lr.__exportStar||function(y,_){for(var w in y)w!=="default"&&!Object.prototype.hasOwnProperty.call(_,w)&&a(_,y,w)};Object.defineProperty(n,"__esModule",{value:!0}),n.CronFileParser=n.CronExpressionParser=n.CronExpression=n.CronFieldCollection=n.CronDate=void 0;const l=hy();var u=Gy();Object.defineProperty(n,"CronDate",{enumerable:!0,get:function(){return u.CronDate}});var o=QS();Object.defineProperty(n,"CronFieldCollection",{enumerable:!0,get:function(){return o.CronFieldCollection}});var m=nx();Object.defineProperty(n,"CronExpression",{enumerable:!0,get:function(){return m.CronExpression}});var g=hy();Object.defineProperty(n,"CronExpressionParser",{enumerable:!0,get:function(){return g.CronExpressionParser}});var b=uO();Object.defineProperty(n,"CronFileParser",{enumerable:!0,get:function(){return b.CronFileParser}}),i(Xy(),n),n.default=l.CronExpressionParser})(Lr)),Lr}var cO=oO(),Um={exports:{}},P0;function fO(){return P0||(P0=1,(function(n,a){(function(l,u){n.exports=u()})(globalThis,()=>(()=>{var i={949(m,g,b){Object.defineProperty(g,"__esModule",{value:!0}),g.CronParser=void 0;var y=b(515),_=(function(){function w(T,S,N){S===void 0&&(S=!0),N===void 0&&(N=!1),this.expression=T,this.dayOfWeekStartIndexZero=S,this.monthStartIndexZero=N}return w.prototype.parse=function(){var T,S,N=(T=this.expression)!==null&&T!==void 0?T:"";if(N==="@reboot")return S=["@reboot","","","","","",""],S;if(N.startsWith("@")){var O=this.parseSpecial(this.expression);S=this.extractParts(O)}else S=this.extractParts(this.expression);return this.normalize(S),this.validate(S),S},w.prototype.parseSpecial=function(T){var S={"@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"},N=S[T];if(!N)throw new Error("Unknown special expression.");return N},w.prototype.extractParts=function(T){if(!this.expression)throw new Error("cron expression is empty");for(var S=T.trim().split(/[ ]+/),N=0;N<S.length;N++)if(S[N].includes(",")){var O=S[N].split(",").map(function(R){return R.trim()}).filter(function(R){return R!==""}).map(function(R){return isNaN(Number(R))?R:Number(R)}).filter(function(R){return R!==null&&R!==""});O.length===0&&O.push("*"),O.sort(function(R,k){return R!==null&&k!==null?R-k:0}),S[N]=O.map(function(R){return R!==null?R.toString():""}).join(",")}if(S.length<5)throw new Error("Expression has only ".concat(S.length," part").concat(S.length==1?"":"s",". At least 5 parts are required."));if(S.length==5)S.unshift(""),S.push("");else if(S.length==6){var j=/\d{4}$/.test(S[5])||S[4]=="?"||S[2]=="?";j?S.unshift(""):S.push("")}else if(S.length>7)throw new Error("Expression has ".concat(S.length," parts; too many!"));return S},w.prototype.normalize=function(T){var S=this;if(T[3]=T[3].replace("?","*"),T[5]=T[5].replace("?","*"),T[2]=T[2].replace("?","*"),T[0].indexOf("0/")==0&&(T[0]=T[0].replace("0/","*/")),T[1].indexOf("0/")==0&&(T[1]=T[1].replace("0/","*/")),T[2].indexOf("0/")==0&&(T[2]=T[2].replace("0/","*/")),T[3].indexOf("1/")==0&&(T[3]=T[3].replace("1/","*/")),T[4].indexOf("1/")==0&&(T[4]=T[4].replace("1/","*/")),T[6].indexOf("1/")==0&&(T[6]=T[6].replace("1/","*/")),T[5]=T[5].replace(/(^\d)|([^#/\s]\d)/g,function(J){var pe=J.replace(/\D/,""),G=pe;return S.dayOfWeekStartIndexZero?pe=="7"&&(G="0"):G=(parseInt(pe)-1).toString(),J.replace(pe,G)}),T[5]=="L"&&(T[5]="6"),T[3]=="?"&&(T[3]="*"),T[3].indexOf("W")>-1&&(T[3].indexOf(",")>-1||T[3].indexOf("-")>-1))throw new 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 O in N)T[5]=T[5].replace(new RegExp(O,"gi"),N[O].toString());T[4]=T[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function(J){var pe=J.replace(/\D/,""),G=pe;return S.monthStartIndexZero&&(G=(parseInt(pe)+1).toString()),J.replace(pe,G)});var j={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 R in j)T[4]=T[4].replace(new RegExp(R,"gi"),j[R].toString());T[0]=="0"&&(T[0]=""),!/\*|\-|\,|\//.test(T[2])&&(/\*|\//.test(T[1])||/\*|\//.test(T[0]))&&(T[2]+="-".concat(T[2]));for(var k=0;k<T.length;k++)if(T[k].indexOf(",")!=-1&&(T[k]=T[k].split(",").filter(function(J){return J!==""}).join(",")||"*"),T[k]=="*/1"&&(T[k]="*"),T[k].indexOf("/")>-1&&!/^\*|\-|\,/.test(T[k])){var H=null;switch(k){case 4:H="12";break;case 5:H="6";break;case 6:H="9999";break;default:H=null;break}if(H!==null){var F=T[k].split("/");T[k]="".concat(F[0],"-").concat(H,"/").concat(F[1])}}},w.prototype.validate=function(T){var S="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(T[0],S),this.validateOnlyExpectedCharactersFound(T[1],S),this.validateOnlyExpectedCharactersFound(T[2],S),this.validateOnlyExpectedCharactersFound(T[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(T[4],S),this.validateOnlyExpectedCharactersFound(T[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(T[6],S),this.validateAnyRanges(T)},w.prototype.validateAnyRanges=function(T){y.default.secondRange(T[0]),y.default.minuteRange(T[1]),y.default.hourRange(T[2]),y.default.dayOfMonthRange(T[3]),y.default.monthRange(T[4],this.monthStartIndexZero),y.default.dayOfWeekRange(T[5],this.dayOfWeekStartIndexZero)},w.prototype.validateOnlyExpectedCharactersFound=function(T,S){var N=T.match(new RegExp("[^".concat(S,"]+"),"gi"));if(N&&N.length)throw new Error("Expression contains invalid values: '".concat(N.toString(),"'"))},w})();g.CronParser=_},333(m,g,b){Object.defineProperty(g,"__esModule",{value:!0}),g.ExpressionDescriptor=void 0;var y=b(823),_=b(949),w=(function(){function T(S,N){if(this.expression=S,this.options=N,this.expressionParts=new Array(5),!this.options.locale&&T.defaultLocale&&(this.options.locale=T.defaultLocale),!T.locales[this.options.locale]){var O=Object.keys(T.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(O,"'.")),this.options.locale=O}this.i18n=T.locales[this.options.locale],N.use24HourTimeFormat===void 0&&(N.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return T.toString=function(S,N){var O=N===void 0?{}:N,j=O.throwExceptionOnParseError,R=j===void 0?!0:j,k=O.verbose,H=k===void 0?!1:k,F=O.dayOfWeekStartIndexZero,J=F===void 0?!0:F,pe=O.monthStartIndexZero,G=pe===void 0?!1:pe,re=O.use24HourTimeFormat,se=O.trimHoursLeadingZero,V=se===void 0?!1:se,K=O.locale,P=K===void 0?null:K,ie=O.logicalAndDayFields,Se=ie===void 0?!1:ie,be={throwExceptionOnParseError:R,verbose:H,dayOfWeekStartIndexZero:J,monthStartIndexZero:G,use24HourTimeFormat:re,trimHoursLeadingZero:V,locale:P,logicalAndDayFields:Se};be.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var X=new T(S,be);return X.getFullDescription()},T.initialize=function(S,N){N===void 0&&(N="en"),T.specialCharacters=["/","-",",","*"],T.defaultLocale=N,S.load(T.locales)},T.prototype.getFullDescription=function(){var S,N,O="";try{var j=new _.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=j.parse(),this.expressionParts[0]==="@reboot")return((N=(S=this.i18n).atReboot)===null||N===void 0?void 0:N.call(S))||"Run once, at startup";var R=this.getTimeOfDayDescription(),k=this.getDayOfMonthDescription(),H=this.getMonthDescription(),F=this.getDayOfWeekDescription(),J=this.getYearDescription();O+=R+k+F+H+J,O=this.transformVerbosity(O,!!this.options.verbose),O=O.charAt(0).toLocaleUpperCase()+O.substr(1)}catch(pe){if(!this.options.throwExceptionOnParseError)O=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(pe)}return O},T.prototype.getTimeOfDayDescription=function(){var S=this.expressionParts[0],N=this.expressionParts[1],O=this.expressionParts[2],j="";if(!y.StringUtilities.containsAny(N,T.specialCharacters)&&!y.StringUtilities.containsAny(O,T.specialCharacters)&&!y.StringUtilities.containsAny(S,T.specialCharacters))j+=this.i18n.atSpace()+this.formatTime(O,N,S);else if(!S&&N.indexOf("-")>-1&&!(N.indexOf(",")>-1)&&!(N.indexOf("/")>-1)&&!y.StringUtilities.containsAny(O,T.specialCharacters)){var R=N.split("-");j+=y.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(O,R[0],""),this.formatTime(O,R[1],""))}else if(!S&&O.indexOf(",")>-1&&O.indexOf("-")==-1&&O.indexOf("/")==-1&&!y.StringUtilities.containsAny(N,T.specialCharacters)){var k=O.split(",");j+=this.i18n.at();for(var H=0;H<k.length;H++)j&&(j+=" "),j+=this.formatTime(k[H],N,""),H<k.length-2&&(j+=","),H==k.length-2&&(j+=this.i18n.spaceAnd())}else{var F=this.getSecondsDescription(),J=this.getMinutesDescription(),pe=this.getHoursDescription();if(j+=F,j&&J&&(j+=", "),j+=J,J===pe)return j;j&&pe&&(j+=", "),j+=pe}return j},T.prototype.getSecondsDescription=function(){var S=this,N=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(O){return O},function(O){return y.StringUtilities.format(S.i18n.everyX0Seconds(O),O)},function(O){return S.i18n.secondsX0ThroughX1PastTheMinute()},function(O){return O=="0"?"":parseInt(O)<20?S.i18n.atX0SecondsPastTheMinute(O):S.i18n.atX0SecondsPastTheMinuteGt20()||S.i18n.atX0SecondsPastTheMinute(O)});return N},T.prototype.getMinutesDescription=function(){var S=this,N=this.expressionParts[0],O=this.expressionParts[2],j=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(R){return R},function(R){return y.StringUtilities.format(S.i18n.everyX0Minutes(R),R)},function(R){return S.i18n.minutesX0ThroughX1PastTheHour()},function(R){var k,H;try{return R=="0"&&O.indexOf("/")==-1&&N==""?S.i18n.everyHour():R=="0"?((H=(k=S.i18n).onTheHour)===null||H===void 0?void 0:H.call(k))||S.i18n.atX0MinutesPastTheHour(R):parseInt(R)<20?S.i18n.atX0MinutesPastTheHour(R):S.i18n.atX0MinutesPastTheHourGt20()||S.i18n.atX0MinutesPastTheHour(R)}catch{return S.i18n.atX0MinutesPastTheHour(R)}});return j},T.prototype.getHoursDescription=function(){var S=this,N=this.expressionParts[2],O=0,j=[];N.split("/")[0].split(",").forEach(function(H){var F=H.split("-");F.length===2&&j.push({value:F[1],index:O+1}),O+=F.length});var R=0,k=this.getSegmentDescription(N,this.i18n.everyHour(),function(H){var F=j.find(function(pe){return pe.value===H&&pe.index===R}),J=F&&S.expressionParts[1]!=="0";return R++,J?S.formatTime(H,"59",""):S.formatTime(H,"0","")},function(H){return y.StringUtilities.format(S.i18n.everyX0Hours(H),H)},function(H){return S.i18n.betweenX0AndX1()},function(H){return S.i18n.atX0()});return k},T.prototype.getDayOfWeekDescription=function(){var S=this,N=this.i18n.daysOfTheWeek(),O=null;return this.expressionParts[5]=="*"?O="":O=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(j,R){var k=j;j.indexOf("#")>-1?k=j.substring(0,j.indexOf("#")):j.indexOf("L")>-1&&(k=k.replace("L",""));var H=parseInt(k),F=S.i18n.daysOfTheWeekInCase?S.i18n.daysOfTheWeekInCase(R)[H]:N[H];if(j.indexOf("#")>-1){var J=null,pe=j.substring(j.indexOf("#")+1),G=j.substring(0,j.indexOf("#"));switch(pe){case"1":J=S.i18n.first(G);break;case"2":J=S.i18n.second(G);break;case"3":J=S.i18n.third(G);break;case"4":J=S.i18n.fourth(G);break;case"5":J=S.i18n.fifth(G);break}F=J+" "+F}return F},function(j){return parseInt(j)==1?"":y.StringUtilities.format(S.i18n.commaEveryX0DaysOfTheWeek(j),j)},function(j){var R=j.substring(0,j.indexOf("-")),k=S.expressionParts[3]!="*";return k?S.i18n.commaAndX0ThroughX1(R):S.i18n.commaX0ThroughX1(R)},function(j){var R=null;if(j.indexOf("#")>-1){var k=j.substring(j.indexOf("#")+1),H=j.substring(0,j.indexOf("#"));R=S.i18n.commaOnThe(k,H).trim()+S.i18n.spaceX0OfTheMonth()}else if(j.indexOf("L")>-1)R=S.i18n.commaOnTheLastX0OfTheMonth(j.replace("L",""));else{var F=S.expressionParts[3]!="*";F?S.options.logicalAndDayFields?R=S.i18n.commaOnlyOnX0(j):R=S.i18n.commaAndOnX0():R=S.i18n.commaOnlyOnX0(j)}return R}),O},T.prototype.getMonthDescription=function(){var S=this,N=this.i18n.monthsOfTheYear(),O=this.getSegmentDescription(this.expressionParts[4],"",function(j,R){return R&&S.i18n.monthsOfTheYearInCase?S.i18n.monthsOfTheYearInCase(R)[parseInt(j)-1]:N[parseInt(j)-1]},function(j){return parseInt(j)==1?"":y.StringUtilities.format(S.i18n.commaEveryX0Months(j),j)},function(j){return S.i18n.commaMonthX0ThroughMonthX1()||S.i18n.commaX0ThroughX1()},function(j){return S.i18n.commaOnlyInMonthX0?S.i18n.commaOnlyInMonthX0():S.i18n.commaOnlyInX0()});return O},T.prototype.getDayOfMonthDescription=function(){var S=this,N=null,O=this.expressionParts[3];switch(O){case"L":N=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":N=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var j=O.match(/(\d{1,2}W)|(W\d{1,2})/);if(j){var R=parseInt(j[0].replace("W","")),k=R==1?this.i18n.firstWeekday():y.StringUtilities.format(this.i18n.weekdayNearestDayX0(),R.toString());N=y.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),k);break}else{var H=O.match(/L-(\d{1,2})/);if(H){var F=H[1];N=y.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(F),F);break}else{if(O=="*"&&this.expressionParts[5]!="*")return"";N=this.getSegmentDescription(O,this.i18n.commaEveryDay(),function(J){return J=="L"?S.i18n.lastDay():S.i18n.dayX0?y.StringUtilities.format(S.i18n.dayX0(),J):J},function(J){return J=="1"?S.i18n.commaEveryDay():S.i18n.commaEveryX0Days(J)},function(J){return S.i18n.commaBetweenDayX0AndX1OfTheMonth(J)},function(J){return S.i18n.commaOnDayX0OfTheMonth(J)})}break}}return N},T.prototype.getYearDescription=function(){var S=this,N=this.getSegmentDescription(this.expressionParts[6],"",function(O){return/^\d+$/.test(O)?new Date(parseInt(O),1).getFullYear().toString():O},function(O){return y.StringUtilities.format(S.i18n.commaEveryX0Years(O),O)},function(O){return S.i18n.commaYearX0ThroughYearX1()||S.i18n.commaX0ThroughX1()},function(O){return S.i18n.commaOnlyInYearX0?S.i18n.commaOnlyInYearX0():S.i18n.commaOnlyInX0()});return N},T.prototype.getSegmentDescription=function(S,N,O,j,R,k){var H=null,F=S.indexOf("/")>-1,J=S.indexOf("-")>-1,pe=S.indexOf(",")>-1;if(!S)H="";else if(S==="*")H=N;else if(!F&&!J&&!pe)H=y.StringUtilities.format(k(S),O(S));else if(pe){for(var G=S.split(","),re="",se=this.i18n.spaceAnd(),V=0;V<G.length;V++)if(V>0&&G.length>2&&(re+=",",V<G.length-1&&(re+=" ")),V>0&&G.length>1&&(V==G.length-1||G.length==2)&&(re+=se==","&&G.length>2?" ":"".concat(se," ")),G[V].indexOf("/")>-1||G[V].indexOf("-")>-1){var K=G[V].indexOf("-")>-1&&G[V].indexOf("/")==-1,P=this.getSegmentDescription(G[V],N,O,j,K?this.i18n.commaX0ThroughX1:R,k);K&&(P=P.replace(", ","")),re+=P}else if(!F)re+=O(G[V]);else{var ie=this.getSegmentDescription(G[V],N,O,j,R,k);ie&&ie.startsWith(", ")&&(ie=ie.substring(2)),re+=ie}F?H=re:H=y.StringUtilities.format(k(S),re)}else if(F){var G=S.split("/");if(H=y.StringUtilities.format(j(G[1]),G[1]),G[0].indexOf("-")>-1){var Se=this.generateRangeSegmentDescription(G[0],R,O);Se.indexOf(", ")!=0&&(H+=", "),H+=Se}else if(G[0].indexOf("*")==-1){var be=y.StringUtilities.format(k(G[0]),O(G[0]));be=be.replace(", ",""),H+=y.StringUtilities.format(this.i18n.commaStartingX0(),be)}}else J&&(H=this.generateRangeSegmentDescription(S,R,O));return H},T.prototype.generateRangeSegmentDescription=function(S,N,O){var j="",R=S.split("-"),k=O(R[0],1),H=O(R[1],2),F=N(S);return j+=y.StringUtilities.format(F,k,H),j},T.prototype.formatTime=function(S,N,O){var j=0,R=0,k=parseInt(S)+j,H=parseInt(N)+R;H>=60?(H-=60,k+=1):H<0&&(H+=60,k-=1),k>=24?k=k-24:k<0&&(k=24+k);var F="",J=!1;this.options.use24HourTimeFormat||(J=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),F=J?"".concat(this.getPeriod(k)," "):" ".concat(this.getPeriod(k)),k>12&&(k-=12),k===0&&(k=12));var pe="";O&&(pe=":".concat(("00"+O).substring(O.length)));var G=k.toString(),re=("00"+G).substring(G.length),se=H.toString(),V=("00"+se).substring(se.length),K=this.options.trimHoursLeadingZero?G:re;return"".concat(J?F:"").concat(K,":").concat(V).concat(pe).concat(J?"":F)},T.prototype.transformVerbosity=function(S,N){if(!N&&(S=S.replace(new RegExp(", ".concat(this.i18n.everyMinute()),"g"),""),S=S.replace(new RegExp(", ".concat(this.i18n.everyHour()),"g"),""),S=S.replace(new RegExp(this.i18n.commaEveryDay(),"g"),""),S=S.replace(/\, ?$/,""),this.i18n.conciseVerbosityReplacements))for(var O=0,j=Object.entries(this.i18n.conciseVerbosityReplacements());O<j.length;O++){var R=j[O],k=R[0],H=R[1];S=S.replace(new RegExp(k,"g"),H)}return S},T.prototype.getPeriod=function(S){return S>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},T.locales={},T})();g.ExpressionDescriptor=w},747(m,g,b){Object.defineProperty(g,"__esModule",{value:!0}),g.enLocaleLoader=void 0;var y=b(486),_=(function(){function w(){}return w.prototype.load=function(T){T.en=new y.en},w})();g.enLocaleLoader=_},486(m,g){Object.defineProperty(g,"__esModule",{value:!0}),g.en=void 0;var b=(function(){function y(){}return y.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},y.prototype.atX0MinutesPastTheHourGt20=function(){return null},y.prototype.commaMonthX0ThroughMonthX1=function(){return null},y.prototype.commaYearX0ThroughYearX1=function(){return null},y.prototype.use24HourTimeFormatByDefault=function(){return!1},y.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},y.prototype.everyMinute=function(){return"every minute"},y.prototype.everyHour=function(){return"every hour"},y.prototype.atSpace=function(){return"At "},y.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},y.prototype.at=function(){return"At"},y.prototype.spaceAnd=function(){return" and"},y.prototype.everySecond=function(){return"every second"},y.prototype.everyX0Seconds=function(){return"every %s seconds"},y.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},y.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},y.prototype.everyX0Minutes=function(){return"every %s minutes"},y.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},y.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},y.prototype.everyX0Hours=function(){return"every %s hours"},y.prototype.betweenX0AndX1=function(){return"between %s and %s"},y.prototype.atX0=function(){return"at %s"},y.prototype.commaEveryDay=function(){return", every day"},y.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},y.prototype.commaX0ThroughX1=function(){return", %s through %s"},y.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},y.prototype.first=function(){return"first"},y.prototype.second=function(){return"second"},y.prototype.third=function(){return"third"},y.prototype.fourth=function(){return"fourth"},y.prototype.fifth=function(){return"fifth"},y.prototype.commaOnThe=function(){return", on the "},y.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},y.prototype.lastDay=function(){return"the last day"},y.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},y.prototype.commaOnlyOnX0=function(){return", only on %s"},y.prototype.commaAndOnX0=function(){return", and on %s"},y.prototype.commaEveryX0Months=function(){return", every %s months"},y.prototype.commaOnlyInX0=function(){return", only in %s"},y.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},y.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},y.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},y.prototype.firstWeekday=function(){return"first weekday"},y.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},y.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},y.prototype.commaEveryX0Days=function(){return", every %s days in a month"},y.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},y.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},y.prototype.commaEveryHour=function(){return", every hour"},y.prototype.commaEveryX0Years=function(){return", every %s years"},y.prototype.commaStartingX0=function(){return", starting %s"},y.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},y.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},y.prototype.atReboot=function(){return"Run once, at startup"},y.prototype.onTheHour=function(){return"on the hour"},y})();g.en=b},515(m,g){Object.defineProperty(g,"__esModule",{value:!0});function b(_,w){if(!_)throw new Error(w)}var y=(function(){function _(){}return _.secondRange=function(w){for(var T=w.split(","),S=0;S<T.length;S++)if(!isNaN(parseInt(T[S],10))){var N=parseInt(T[S],10);b(N>=0&&N<=59,"seconds part must be >= 0 and <= 59")}},_.minuteRange=function(w){for(var T=w.split(","),S=0;S<T.length;S++)if(!isNaN(parseInt(T[S],10))){var N=parseInt(T[S],10);b(N>=0&&N<=59,"minutes part must be >= 0 and <= 59")}},_.hourRange=function(w){for(var T=w.split(","),S=0;S<T.length;S++)if(!isNaN(parseInt(T[S],10))){var N=parseInt(T[S],10);b(N>=0&&N<=23,"hours part must be >= 0 and <= 23")}},_.dayOfMonthRange=function(w){for(var T=w.split(","),S=0;S<T.length;S++)if(!isNaN(parseInt(T[S],10))){var N=parseInt(T[S],10);b(N>=1&&N<=31,"DOM part must be >= 1 and <= 31")}},_.monthRange=function(w,T){for(var S=w.split(","),N=0;N<S.length;N++)if(!isNaN(parseInt(S[N],10))){var O=parseInt(S[N],10);b(O>=1&&O<=12,T?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},_.dayOfWeekRange=function(w,T){for(var S=w.split(","),N=0;N<S.length;N++)if(!isNaN(parseInt(S[N],10))){var O=parseInt(S[N],10);b(O>=0&&O<=6,T?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},_})();g.default=y},823(m,g){Object.defineProperty(g,"__esModule",{value:!0}),g.StringUtilities=void 0;var b=(function(){function y(){}return y.format=function(_){for(var w=[],T=1;T<arguments.length;T++)w[T-1]=arguments[T];return _.replace(/%s/g,function(S){return w.shift()})},y.containsAny=function(_,w){return w.some(function(T){return _.indexOf(T)>-1})},y})();g.StringUtilities=b}},l={};function u(m){var g=l[m];if(g!==void 0)return g.exports;var b=l[m]={exports:{}};return i[m](b,b.exports,u),b.exports}var o={};return(()=>{var m=o;Object.defineProperty(m,"__esModule",{value:!0}),m.toString=void 0;var g=u(333),b=u(747);g.ExpressionDescriptor.initialize(new b.enLocaleLoader),m.default=g.ExpressionDescriptor;var y=g.ExpressionDescriptor.toString;m.toString=y})(),o})())})(Um)),Um.exports}var dO=fO();function mx(n){const a=n.trim();if(a===""||a.startsWith("@"))return a;const i=a.split(/\s+/);return i.length===7?i.slice(1,6).join(" "):a}function hO(n){if(n.trim()==="")return[!1,"— enter a cron expression —"];try{return[!0,dO.toString(mx(n),{throwExceptionOnParseError:!0})]}catch{return[!1,"Invalid cron expression"]}}function mu(n){if(n===0)return"—";const a=Math.floor(Date.now()/1e3),i=Math.max(0,a-n);return i<60?"just now":i<3600?`${Math.floor(i/60)}m ago`:i<86400?`${Math.floor(i/3600)}h ago`:`${Math.floor(i/86400)}d ago`}const mO=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function gd(n){if(n===0)return"—";const a=new Date(n*1e3);if(Number.isNaN(a.getTime()))return"—";const i=String(a.getDate()).padStart(2,"0"),l=`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`;return`${mO[a.getMonth()]} ${i}, ${a.getFullYear()} ${l}`}const yO=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function uc(n,a){const i=mx(n);if(i!=="")try{return cO.CronExpressionParser.parse(i,{currentDate:a})}catch{return}}function _u(n,a){const i=uc(n,a);if(i!=null&&i.hasNext())return i.next().toDate()}function gO(n,a,i){const l=uc(n,a);if(!l)return[];const u=[];for(;u.length<i&&l.hasNext();)u.push(l.next().toDate());return u}function Qy(n,a,i){const l=_u(n,a);return l!==void 0&&l.getTime()-a.getTime()<=i}function vd(n,a){const i=Math.floor((a.getTime()-n.getTime())/1e3);if(i<=0)return"now";const l=Math.floor(i/60);if(l<1)return"in <1m";if(l<60)return`in ${l}m`;const u=Math.floor(l/60);if(u<24){const m=l%60;return m===0?`in ${u}h`:`in ${u}h ${m}m`}return`in ${Math.floor(u/24)}d`}function ms(n){return new Date(n.getFullYear(),n.getMonth(),n.getDate())}function Wy(n,a){const i=`${String(a.getHours()).padStart(2,"0")}:${String(a.getMinutes()).padStart(2,"0")}`,l=Math.round((ms(a).getTime()-ms(n).getTime())/864e5);return l===0?i:l===1?`tomorrow ${i}`:`${yO[a.getMonth()]} ${a.getDate()}, ${i}`}const oc=["SUN","MON","TUE","WED","THU","FRI","SAT"],Ky=["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"],yy=42,vO=4e3;function pO(n,a){const i=n.getFullYear()*12+n.getMonth()+a,l=Math.floor(i/12),u=(i%12+12)%12;return new Date(l,u,1)}const bO=2e3;function yx(n,a){const i=ms(a),l=new Date(i.getTime()-1e3),u=uc(n,l);if(!u)return[];const o=new Date(i.getTime()+864e5),m=[];for(let g=0;g<bO&&u.hasNext();g++){const b=u.next().toDate();if(!(b.getTime()<i.getTime())){if(b.getTime()>=o.getTime())break;m.push(b)}}return m}function SO(n,a){const i=new Date(a.getTime()-1e3),l=uc(n,i);if(!l)return;const u=new Array(yy).fill(0),o=ms(a).getTime();for(let m=0;m<vO&&l.hasNext();m++){const g=l.next().toDate(),b=Math.floor((ms(g).getTime()-o)/864e5);if(!(b<0)){if(b>=yy)break;u[b]=(u[b]??0)+1}}return u}const gx=36e5,xO=8,eb={dormant:0,"dead-schedule":1,"agent-unregistered":2,"has-open-flags":3},EO={dormant:"DORMANT","dead-schedule":"DEAD SCHEDULE","agent-unregistered":"AGENT MISSING","has-open-flags":"OPEN FLAGS"},TO={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 vx(n,a){return n<a?-1:n>a?1:0}function NO(n,a){if(n.enabled){if(n.machinesEmpty)return"dormant";if(_u(n.schedule,a)===void 0)return"dead-schedule";if(n.agentRegistered===!1)return"agent-unregistered";if(n.flagCount>0)return"has-open-flags"}}function px(n,a){const i=[];for(const l of n){const u=NO(l,a);u!==void 0&&i.push({kind:l.kind,label:l.label,reason:u,flagCount:l.flagCount})}return i.sort((l,u)=>eb[l.reason]-eb[u.reason]||vx(l.label,u.label)),i}function _O(n,a){const i=n.length,l=n.filter(b=>b.enabled).length,u=n.filter(b=>b.enabled&&!b.snoozed&&Qy(b.schedule,a,gx)).length,o=n.reduce((b,y)=>b+y.flagCount,0),m=n.filter(b=>b.enabled&&b.snoozed).length,g=n.filter(b=>b.enabled&&b.machinesEmpty).length;return{total:i,enabled:l,disabled:i-l,dueSoon:u,attention:px(n,a).length,flags:o,snoozed:m,dormant:g}}function OO(n,a){const i=[];for(const l of n){if(!l.enabled||l.snoozed)continue;const u=_u(l.schedule,a);u!==void 0&&i.push({kind:l.kind,id:l.id,label:l.label,human:l.human,schedule:l.schedule,at:u,soon:u.getTime()-a.getTime()<=gx,flagCount:l.flagCount})}return i.sort((l,u)=>l.at.getTime()-u.at.getTime()||vx(l.label,u.label)),i.slice(0,xO)}function wO(n,a){return n[0]===void 0?void 0:vd(a,n[0].at)}function CO(n){return(n??[]).every(a=>a.trim()==="")}function MO(n,a){const i=n.snoozed_until!=null&&n.snoozed_until>Math.floor(a.getTime()/1e3),l=n.skip_runs!=null&&n.skip_runs>0;return i||l}function DO(n,a){return{kind:"routine",id:n.id,label:n.title,schedule:n.schedule,human:n.schedule_description??void 0,enabled:n.enabled,machinesEmpty:CO(n.machines),agentRegistered:n.agent_registered,flagCount:n.flag_count,snoozed:MO(n,a)}}function jO(n,a){return n.map(i=>DO(i,a))}function RO({items:n}){return h.jsx("div",{className:"table-wrap attn-wrap",children:h.jsxs("table",{children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"TYPE"}),h.jsx("th",{children:"NAME"}),h.jsx("th",{children:"ISSUE"}),h.jsx("th",{children:"DETAIL"})]})}),h.jsx("tbody",{children:n.map((a,i)=>h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx("span",{className:"kind-badge routine",children:"ROUTINE"})}),h.jsx("td",{children:h.jsx(Eu,{className:"ov-name-link",to:"/routines",children:a.label})}),h.jsx("td",{children:h.jsx("span",{className:"attn-badge",children:EO[a.reason]})}),h.jsx("td",{className:"attn-detail",children:a.reason==="has-open-flags"&&a.flagCount>0?`${a.flagCount} open flag${a.flagCount===1?"":"s"} — needs review`:TO[a.reason]})]},i))})]})})}function AO({enabled:n,onToggle:a}){return h.jsx("button",{type:"button",className:n?"btn btn-sm btn-ghost notify-toggle active":"btn btn-sm btn-ghost notify-toggle",title:n?"Desktop notifications on failure: on (click to turn off)":"Get a desktop notification when a run fails","aria-pressed":n,onClick:()=>a(!n),children:n?"🔔 Notify on failure":"🔕 Notify on failure"})}function kO({kpis:n,nextRun:a}){return h.jsxs("div",{className:"stats",children:[h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"SCHEDULED"}),h.jsx("div",{className:"stat-val",children:n.total})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"ENABLED"}),h.jsx("div",{className:"stat-val c-accent",children:n.enabled})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"DUE SOON"}),h.jsx("div",{className:"stat-val c-red",children:n.dueSoon})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"ATTENTION"}),h.jsx("div",{className:`stat-val ${n.attention>0?"c-red":"c-accent"}`,children:n.attention})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"DISABLED"}),h.jsx("div",{className:"stat-val c-amber",children:n.disabled})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"DORMANT"}),h.jsx("div",{className:`stat-val ${n.dormant>0?"c-amber":""}`,children:n.dormant})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"FLAGS"}),h.jsx("div",{className:`stat-val ${n.flags>0?"c-red":"c-accent"}`,children:n.flags})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"SNOOZED"}),h.jsx("div",{className:`stat-val ${n.snoozed>0?"c-amber":"c-accent"}`,children:n.snoozed})]}),h.jsxs("div",{className:"stat-card stat-card-wide",children:[h.jsx("div",{className:"stat-label",children:"NEXT RUN"}),h.jsx("div",{className:"stat-val stat-val-sm",children:a??"—"})]})]})}function bx(n){return`run-status ${n}`}function Jy(n){switch(n){case"running":return"RUNNING";case"success":return"SUCCESS";case"failed":return"FAILED";default:return"UNKNOWN"}}function Py(n,a){const i=Math.max(0,a-n);return i<60?`${i}s`:i<3600?`${Math.floor(i/60)}m`:`${Math.floor(i/3600)}h ${Math.floor(i%3600/60)}m`}function UO(n,a){if(n>=a)return"expired";const i=a-n;return i<60?"expires in <1m":i<3600?`expires in ${Math.floor(i/60)}m`:`expires in ${Math.floor(i/3600)}h ${Math.floor(i%3600/60)}m`}function zO({runs:n,loading:a}){return a?h.jsx("div",{className:"table-wrap",children:h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})})}):n.length===0?h.jsx("div",{className:"table-wrap",children:h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"⧗"}),h.jsx("div",{className:"empty-msg",children:"NO RUNS YET"})]})}):h.jsx("div",{className:"table-wrap",children:h.jsxs("table",{children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"ROUTINE"}),h.jsx("th",{children:"STARTED"}),h.jsx("th",{children:"DURATION"}),h.jsx("th",{children:"STATUS"}),h.jsx("th",{children:"EXIT CODE"})]})}),h.jsx("tbody",{children:n.map(i=>h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx(Eu,{to:`/routines?history=${encodeURIComponent(i.routine_id)}`,children:i.routine_title})}),h.jsx("td",{children:h.jsx("div",{className:"cell-time",title:gd(i.started_at),children:mu(i.started_at)})}),h.jsx("td",{children:h.jsx("span",{className:"cell-meta",children:i.finished_at==null?"—":Py(i.started_at,i.finished_at)})}),h.jsx("td",{children:h.jsx("span",{className:bx(i.status),children:Jy(i.status)})}),h.jsx("td",{children:i.exit_code==null?"—":i.exit_code})]},i.workbench))})]})})}function LO({runs:n,now:a,loading:i,error:l,onTrigger:u}){return l!==void 0?h.jsx("div",{className:"table-wrap",children:h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"⚠"}),h.jsx("div",{className:"empty-msg",children:"FAILED TO LOAD"}),h.jsx("div",{className:"empty-sub",children:l})]})}):i?h.jsx("div",{className:"table-wrap",children:h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})})}):n.length===0?h.jsx("div",{className:"table-wrap",children:h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"◷"}),h.jsx("div",{className:"empty-msg",children:"NO UPCOMING RUNS"}),h.jsx("div",{className:"empty-sub",children:"no enabled routine is scheduled to fire"})]})}):h.jsx("div",{className:"table-wrap",children:h.jsxs("table",{children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"TYPE"}),h.jsx("th",{children:"NAME"}),h.jsx("th",{children:"SCHEDULE"}),h.jsx("th",{children:"NEXT RUN"}),h.jsx("th",{})]})}),h.jsx("tbody",{children:n.map((o,m)=>h.jsxs("tr",{children:[h.jsx("td",{children:h.jsx("span",{className:"kind-badge routine",children:"ROUTINE"})}),h.jsxs("td",{children:[h.jsx(Eu,{className:"ov-name-link",to:"/routines",children:o.label}),o.flagCount>0&&h.jsx("span",{className:"ov-flag-badge",title:`${o.flagCount} open flag${o.flagCount===1?"":"s"}`,children:`⚑ ${o.flagCount}`})]}),h.jsx("td",{children:h.jsx("div",{className:"cell-schedule-human",children:o.human??o.schedule})}),h.jsxs("td",{className:"cell-next",children:[h.jsx("div",{className:"cell-next-when",children:Wy(a,o.at)}),h.jsx("div",{className:o.soon?"cell-next-until soon":"cell-next-until",children:vd(a,o.at)})]}),h.jsx("td",{className:"cell-act",children:h.jsx("button",{className:"btn btn-sm btn-ghost run-now-btn",title:"Trigger now",onClick:()=>u(o.id),children:"▶ RUN"})})]},m))})]})})}const HO=8,VO=1e4;function FO(){const n=fa(),{addToast:a}=Nu(),i=Zy(),l=$y(HO),u=zS(),o=LS(),m=US(),[g,b]=z.useState(()=>new Date),[y,_]=z.useState(ic),[w,T]=z.useState(Y_),S=z.useRef(null);z.useEffect(()=>{const se=setInterval(()=>b(new Date),VO);return()=>clearInterval(se)},[]),z.useEffect(()=>{const se=sc(y);if(se===void 0)return;const V=setInterval(()=>{n.invalidateQueries({queryKey:["routines"]})},se);return()=>clearInterval(V)},[y,n]);const N=z.useCallback(se=>{rc(se),_(se)},[]);z.useEffect(()=>{if(!w){S.current=null;return}const se=l.data;if(se!==void 0){if(S.current===null){S.current=k0(se);return}for(const V of X_(se,S.current))W_(V);S.current=k0(se)}},[l.data,w]);const O=z.useCallback(se=>{if(!se){A0(!1),T(!1);return}G_().then(V=>{V==="granted"?(A0(!0),T(!0)):a(V==="unsupported"?"Desktop notifications aren't supported in this browser":"Notification permission was denied","err")})},[a]),j=z.useCallback(se=>{m.mutate(se,{onSuccess:()=>a("Triggered","ok"),onError:V=>a(`Trigger failed: ${V instanceof Error?V.message:String(V)}`,"err")})},[m,a]),R=z.useCallback(()=>{o.mutate("all")},[o]),k=jO(i.data??[],g),H=_O(k,g),F=px(k,g),J=OO(k,g),pe=wO(J,g),G=Math.max(i.dataUpdatedAt,l.dataUpdatedAt,u.dataUpdatedAt),re=i.error instanceof Error?i.error.message:void 0;return h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Overview"}),h.jsx(qS,{status:u.data,onUnlock:R}),h.jsx(kO,{kpis:H,nextRun:pe}),F.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"section-hd",children:h.jsx("span",{className:"section-label attn",children:"NEEDS ATTENTION"})}),h.jsx(RO,{items:F})]}),h.jsxs("div",{className:"section-hd",children:[h.jsx("span",{className:"section-label",children:"UPCOMING RUNS"}),h.jsx("div",{className:"section-acts",children:h.jsx(lc,{token:y,updatedAtMs:G,onChange:N})})]}),h.jsx(LO,{runs:J,now:g,loading:i.isLoading,error:re,onTrigger:j}),h.jsxs("div",{className:"section-hd",children:[h.jsx("span",{className:"section-label",children:"RECENT RUNS"}),h.jsx("div",{className:"section-acts",children:h.jsx(AO,{enabled:w,onToggle:O})})]}),h.jsx(zO,{runs:l.data??[],loading:l.isLoading})]})}function qO({count:n,onEnable:a,onDisable:i,onDelete:l,onClear:u}){return n===0?null:h.jsxs("div",{className:"bulk-bar",children:[h.jsxs("span",{className:"bulk-count",children:[n," SELECTED"]}),h.jsxs("div",{className:"bulk-acts",children:[h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:a,children:"ENABLE"}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:i,children:"DISABLE"}),h.jsx("button",{type:"button",className:"btn btn-danger btn-sm",onClick:l,children:"DELETE"}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:u,children:"CLEAR"})]})]})}function BO({count:n,onCancel:a,onConfirm:i}){return h.jsx("div",{className:"overlay",onClick:a,children:h.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true",onClick:l=>l.stopPropagation(),children:[h.jsx("div",{className:"dialog-title",children:"⚠ DELETE ROUTINES"}),h.jsxs("div",{className:"dialog-msg",children:["Delete ",n," selected routine",n===1?"":"s","? This cannot be undone."]}),h.jsxs("div",{className:"dialog-actions",children:[h.jsx("button",{type:"button",className:"btn btn-ghost",onClick:a,children:"Cancel"}),h.jsx("button",{type:"button",className:"btn btn-danger",onClick:i,children:"Delete"})]})]})})}function ZO({title:n,onCancel:a,onConfirm:i}){return h.jsx("div",{className:"overlay",onClick:a,children:h.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true",onClick:l=>l.stopPropagation(),children:[h.jsx("div",{className:"dialog-title",children:"⚠ DELETE ROUTINE"}),h.jsxs("div",{className:"dialog-msg",children:['Delete the routine "',n,'"? This cannot be undone.']}),h.jsxs("div",{className:"dialog-actions",children:[h.jsx("button",{type:"button",className:"btn btn-ghost",onClick:a,children:"Cancel"}),h.jsx("button",{type:"button",className:"btn btn-danger",onClick:i,children:"Delete"})]})]})})}const tb=["B","KB","MB","GB","TB"];function $O(n){if(n<1024)return`${n} B`;let a=n,i=0;for(;a>=1024&&i<tb.length-1;)a/=1024,i++;return`${a.toFixed(1)} ${tb[i]}`}const Bf=[40,140,300,600],YO=Ky.map(n=>n.slice(0,3));function IO({items:n,loading:a,onClick:i}){var j;const[l,u]=z.useState(0),[o,m]=z.useState(0),g=z.useRef(null);if(z.useEffect(()=>{var R;(R=g.current)==null||R.scrollIntoView({block:"center"})},[l,o]),a)return h.jsx("div",{className:"day-wrap",children:h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})})});const b=ms(new Date),y=new Date(b);y.setDate(y.getDate()+l);const _=l===0?new Date().getHours():-1,w=Array.from({length:24},()=>[]);let T=0;for(const R of n)for(const k of yx(R.schedule,y))(j=w[k.getHours()])==null||j.push({time:k,label:R.label,id:R.id,snoozed:R.snoozed,flagCount:R.flagCount}),T++;for(const R of w)R.sort((k,H)=>k.time.getTime()-H.time.getTime());const S=`${oc[y.getDay()]} · ${YO[y.getMonth()]} ${y.getDate()} ${y.getFullYear()}`,N=o>0,O=Bf[o]??Bf[0];return h.jsxs("div",{className:"day-wrap",children:[h.jsxs("div",{className:"day-nav",children:[h.jsx("button",{type:"button",className:"btn-refresh",title:"Previous day","aria-label":"Previous day",onClick:()=>u(R=>R-1),children:"‹"}),h.jsx("div",{className:"day-date",children:S}),h.jsx("button",{type:"button",className:"btn-refresh",title:"Next day","aria-label":"Next day",onClick:()=>u(R=>R+1),children:"›"}),h.jsxs("div",{className:"day-zoom",children:[h.jsx("button",{type:"button",className:"btn-refresh",title:"Zoom out","aria-label":"Zoom out",disabled:o===0,onClick:()=>m(R=>Math.max(0,R-1)),children:"−"}),h.jsxs("span",{className:"day-zoom-level",children:[o+1,"×"]}),h.jsx("button",{type:"button",className:"btn-refresh",title:"Zoom into the hour","aria-label":"Zoom in",disabled:o===Bf.length-1,onClick:()=>m(R=>Math.min(Bf.length-1,R+1)),children:"+"})]}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>u(0),children:"TODAY"})]}),T===0?h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"🗓"}),h.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),h.jsx("div",{className:"empty-sub",children:"no fire times on this day"})]}):h.jsx("div",{className:N?"day-scroll detail":"day-scroll",style:{"--dh":`${O}px`},children:w.map((R,k)=>h.jsxs("div",{className:k===_?"day-hour now":"day-hour",ref:k===_?g:void 0,children:[N?h.jsxs("div",{className:"day-hour-label",children:[h.jsxs("span",{children:[String(k).padStart(2,"0"),":00"]}),h.jsxs("span",{className:"qt",children:[String(k).padStart(2,"0"),":15"]}),h.jsxs("span",{className:"qt",children:[String(k).padStart(2,"0"),":30"]}),h.jsxs("span",{className:"qt",children:[String(k).padStart(2,"0"),":45"]}),h.jsx("span",{className:"qt-end"})]}):h.jsxs("div",{className:"day-hour-label",children:[String(k).padStart(2,"0"),":00"]}),h.jsx("div",{className:"day-hour-slot",children:R.map((H,F)=>{const J=(H.time.getMinutes()+H.time.getSeconds()/60)/60,pe=N?{top:`${(J*100).toFixed(3)}%`}:void 0;let G="day-chip";return i&&H.id&&(G+=" clickable"),H.snoozed&&(G+=" snoozed"),h.jsxs("div",{className:G,style:pe,title:H.label,onClick:()=>H.id&&(i==null?void 0:i(H.id)),children:[h.jsxs("span",{className:"day-chip-time",children:[String(H.time.getHours()).padStart(2,"0"),":",String(H.time.getMinutes()).padStart(2,"0")]}),h.jsx("span",{className:"day-chip-label",children:H.label}),H.flagCount>0&&h.jsxs("span",{className:"day-chip-flag",children:["⚑",H.flagCount]})]},F)})})]},k))})]})}const eg=36e5,GO=["all","enabled","disabled","dormant","due","snoozed","flagged","agent-unreg"];function Sx(n){return GO.includes(n)?n:"all"}const xx="\0all";function Zs(n){return n.kind==="all"?xx:n.value}function Jl(n){return n===xx?{kind:"all"}:{kind:"named",value:n}}const Ex="\0any",Tx="\0unassigned";function Xf(n){switch(n.kind){case"any":return Ex;case"unassigned":return Tx;case"machine":return n.value}}function Nx(n){return n===Ex?{kind:"any"}:n===Tx?{kind:"unassigned"}:{kind:"machine",value:n}}function zm(){return{query:"",status:"all",agent:{kind:"all"},machine:{kind:"any"},repository:{kind:"all"},tag:{kind:"all"}}}function _x(n){return n.query.trim()!==""||n.status!=="all"||n.agent.kind!=="all"||n.machine.kind!=="any"||n.repository.kind!=="all"||n.tag.kind!=="all"}function XO(n,a,i,l){const u=a.machines??[];switch(n.status){case"enabled":if(!a.enabled)return!1;break;case"disabled":if(a.enabled)return!1;break;case"dormant":if(!(a.enabled&&u.every(g=>g.trim()==="")))return!1;break;case"due":if(!(a.enabled&&Qy(a.schedule,i,l)))return!1;break;case"snoozed":if(!el(a,i))return!1;break;case"flagged":if((a.flag_count??0)===0)return!1;break;case"agent-unreg":if(a.agent_registered)return!1;break}if(n.agent.kind==="named"&&a.agent!==n.agent.value||n.machine.kind==="unassigned"&&!u.every(g=>g.trim()==="")||n.machine.kind==="machine"&&!u.includes(n.machine.value))return!1;const o=n.repository;if(o.kind==="named"&&!(a.repositories??[]).some(g=>g.repository===o.value)||n.tag.kind==="named"&&!(a.tags??[]).includes(n.tag.value))return!1;const m=n.query.trim().toLowerCase();if(m!==""){const g=(a.repositories??[]).map(w=>w.repository.toLowerCase()).join(" "),b=(a.schedule_description??"").toLowerCase(),y=(a.tags??[]).map(w=>w.toLowerCase()).join(" ");if(![a.title.toLowerCase(),a.agent.toLowerCase(),a.schedule.toLowerCase(),g,b,y].join(" ").includes(m))return!1}return!0}function QO(n,a,i,l){return n.filter(u=>XO(a,u,i,l))}function gy(n){const a=n.last_manual_trigger_at??void 0,i=n.last_scheduled_trigger_at??void 0;return a===void 0?i:i===void 0?a:Math.max(a,i)}function nb(n){switch(n){case"dormant":return 0;case"dead-schedule":return 1;case"agent-missing":return 2;case"disabled":return 3;case"power-saving":return 4;case"snoozed":return 5;case"healthy":return 6}}function vy(n){switch(n){case"dormant":return"DORMANT";case"dead-schedule":return"DEAD SCHEDULE";case"agent-missing":return"AGENT MISSING";case"disabled":return"DISABLED";case"power-saving":return"POWER SAVING";case"snoozed":return"SNOOZED";case"healthy":return"HEALTHY"}}function WO(n){switch(n){case"dormant":return"health-badge dormant";case"dead-schedule":return"health-badge dead";case"agent-missing":return"health-badge agent-missing";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 el(n,a){const i=n.snoozed_until;return i!=null&&i*1e3>a.getTime()?!0:(n.skip_runs??0)>0}function KO(n,a){const i=n.snoozed_until;if(i!=null){const u=i*1e3;if(u>a.getTime()){const o=Math.floor((u-a.getTime())/1e3);return o<3600?`${Math.floor(o/60)}m left`:o<86400?`${Math.floor(o/3600)}h left`:`${Math.floor(o/86400)}d left`}}const l=n.skip_runs;return l!=null&&l>0?`${l} run${l===1?"":"s"} skipped`:""}function ed(n,a){return n.enabled?n.power_saving?"power-saving":(n.machines??[]).every(l=>l.trim()==="")?"dormant":_u(n.schedule,a)===void 0?"dead-schedule":!n.agent_registered||!n.agent_setup_available?"agent-missing":el(n,a)?"snoozed":"healthy":"disabled"}function JO(n){return n.enabled?n.power_saving?"Routine is in power-saving mode":"Run now":"Routine is disabled"}function PO(n){return[...new Set(n.map(a=>a.agent))].sort()}function ew(n){return[...new Set(n.flatMap(a=>(a.machines??[]).filter(i=>i.trim()!=="")))].sort()}function tw(n){return[...new Set(n.flatMap(a=>(a.repositories??[]).map(i=>i.repository)))].sort()}function nw(n){return[...new Set(n.flatMap(a=>a.tags??[]))].sort()}const aw=[["all","All"],["enabled","Enabled"],["disabled","Disabled"],["dormant","Dormant"],["due","Due soon"],["snoozed","Snoozed"],["flagged","Flagged"],["agent-unreg","Agent unregistered"]];function sw({filter:n,agents:a,machines:i,repositories:l,tags:u,shown:o,total:m,searchRef:g,onQuery:b,onStatus:y,onAgent:_,onMachine:w,onRepository:T,onTag:S,onClear:N}){return h.jsxs("div",{className:"filter-bar",children:[h.jsxs("div",{className:"filter-field",children:[h.jsx("input",{ref:g,type:"text",className:"filter-input",placeholder:"Search routines…  ( / )","aria-label":"Search routines",value:n.query,onChange:O=>b(O.target.value)}),h.jsx("span",{className:"filter-label",children:"STATUS"}),h.jsx("select",{className:"filter-select","aria-label":"Status filter",value:n.status,onChange:O=>y(Sx(O.target.value)),children:aw.map(([O,j])=>h.jsx("option",{value:O,children:j},O))}),h.jsx("span",{className:"filter-label",children:"AGENT"}),h.jsxs("select",{className:"filter-select","aria-label":"Agent filter",value:Zs(n.agent),onChange:O=>_(Jl(O.target.value)),children:[h.jsx("option",{value:Zs({kind:"all"}),children:"Any"}),a.map(O=>h.jsx("option",{value:O,children:O},O))]}),h.jsx("span",{className:"filter-label",children:"MACHINE"}),h.jsxs("select",{className:"filter-select","aria-label":"Machine filter",value:Xf(n.machine),onChange:O=>w(Nx(O.target.value)),children:[h.jsx("option",{value:Xf({kind:"any"}),children:"Any"}),h.jsx("option",{value:Xf({kind:"unassigned"}),children:"None"}),i.map(O=>h.jsx("option",{value:O,children:O},O))]}),h.jsx("span",{className:"filter-label",children:"REPOSITORY"}),h.jsxs("select",{className:"filter-select","aria-label":"Repository filter",value:Zs(n.repository),onChange:O=>T(Jl(O.target.value)),children:[h.jsx("option",{value:Zs({kind:"all"}),children:"Any"}),l.map(O=>h.jsx("option",{value:O,children:O},O))]}),u.length>0&&h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"filter-label",children:"TAG"}),h.jsxs("select",{className:"filter-select","aria-label":"Tag filter",value:Zs(n.tag),onChange:O=>S(Jl(O.target.value)),children:[h.jsx("option",{value:Zs({kind:"all"}),children:"Any"}),u.map(O=>h.jsx("option",{value:O,children:O},O))]})]})]}),h.jsxs("div",{className:"filter-field",children:[h.jsxs("span",{className:"filter-count",children:["Showing ",o," of ",m]}),_x(n)&&h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Clear all filters",onClick:N,children:"CLEAR"})]})]})}const iw=["title","next_run","last_fire","agent","health","enabled","updated"];function rw(n){return iw.includes(n)?n:void 0}function lw(n){return n==="asc"?"desc":"asc"}function uw(n){return n==="desc"?"desc":"asc"}const ow=["none","agent","machine","status","health"];function Ox(n){return ow.includes(n)?n:"none"}function cw(n){switch(n){case"none":return"None";case"agent":return"Agent";case"machine":return"Machine";case"status":return"Status";case"health":return"Health"}}function fw(n,a){var i;switch(a){case"none":return"";case"agent":return n.agent;case"machine":return((i=n.machines)==null?void 0:i[0])??"(unassigned)";case"status":return n.enabled?"Enabled":"Disabled";case"health":return vy(ed(n,new Date))}}function dw(n,a){if(a==="none")return[["",n]];const i=new Map;for(const l of n){const u=fw(l,a),o=i.get(u);o?o.push(l):i.set(u,[l])}return[...i.entries()].sort(([l],[u])=>l<u?-1:l>u?1:0)}function hw(n,a,i,l){if(a===void 0)return n;const u=(o,m)=>{let g;switch(a){case"title":g=o.title.toLowerCase().localeCompare(m.title.toLowerCase());break;case"agent":g=o.agent.toLowerCase().localeCompare(m.agent.toLowerCase());break;case"enabled":g=Number(o.enabled)-Number(m.enabled);break;case"updated":g=o.updated_at-m.updated_at;break;case"health":g=nb(ed(o,l))-nb(ed(m,l));break;case"last_fire":{const y=gy(o),_=gy(m);g=(y??-1)-(_??-1);break}case"next_run":{const y=T=>{var S;return T.enabled?(S=_u(T.schedule,l))==null?void 0:S.getTime():void 0},_=y(o),w=y(m);_!==void 0&&w!==void 0?g=_-w:_!==void 0?g=-1:w!==void 0?g=1:g=0;break}}const b=i==="desc"?-g:g;return b!==0?b:o.id.localeCompare(m.id)};return[...n].sort(u)}const mw=["none","agent","machine","status","health"];function yw({groupBy:n,onChange:a}){return h.jsxs("div",{className:"group-by-ctrl",children:[h.jsx("label",{htmlFor:"routine-group-by-select",children:"GROUP BY"}),h.jsx("select",{id:"routine-group-by-select",className:"filter-select","aria-label":"Group routines by",value:n,onChange:i=>a(Ox(i.target.value)),children:mw.map(i=>h.jsx("option",{value:i,children:cw(i)},i))})]})}function gw({routines:n,loading:a,onEdit:i}){const[l,u]=z.useState(0),{addToast:o}=Nu();if(a)return h.jsx("div",{className:"table-wrap",children:h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})})});const m=()=>{const N=`${window.location.origin}${p_()}`;navigator.clipboard.writeText(N).then(()=>o("Calendar feed URL copied","ok")).catch(()=>o("Copy failed","err"))},g=new Date;g.setHours(0,0,0,0);const b=pO(g,l),y=new Date(b);y.setDate(y.getDate()-b.getDay());const _=new Date,w=Array.from({length:yy},()=>[]);let T=0;for(const N of n.filter(O=>O.enabled)){const O=SO(N.schedule,y);if(O===void 0)continue;T++;const j=el(N,_);O.forEach((R,k)=>{var H;R>0&&((H=w[k])==null||H.push({id:N.id,title:N.title,count:R,snoozed:j}))})}const S=`${Ky[b.getMonth()]} ${b.getFullYear()}`;return h.jsxs("div",{className:"cal-wrap",children:[h.jsxs("div",{className:"cal-nav",children:[h.jsx("button",{type:"button",className:"btn-refresh",title:"Previous month","aria-label":"Previous month",onClick:()=>u(N=>N-1),children:"‹"}),h.jsx("div",{className:"cal-month",children:S}),h.jsx("button",{type:"button",className:"btn-refresh",title:"Next month","aria-label":"Next month",onClick:()=>u(N=>N+1),children:"›"}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>u(0),children:"TODAY"}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Copy the routines.ics feed URL",onClick:m,children:"SUBSCRIBE"})]}),T===0?h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"🗓"}),h.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),h.jsx("div",{className:"empty-sub",children:"enabled routines with a valid schedule appear here"})]}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"cal-weekdays",children:oc.map(N=>h.jsx("div",{className:"cal-weekday",children:N},N))}),h.jsx("div",{className:"cal-grid",children:w.map((N,O)=>{const j=new Date(y);j.setDate(j.getDate()+O);let R="cal-day";return j.getMonth()!==b.getMonth()&&(R+=" other-month"),j.getTime()===g.getTime()&&(R+=" today"),h.jsxs("div",{className:R,children:[h.jsx("div",{className:"cal-daynum",children:j.getDate()}),h.jsxs("div",{className:"cal-hits",children:[N.slice(0,4).map((k,H)=>{const F=k.count>1?`${k.title} ×${k.count}`:k.title;let J="cal-chip clickable";return k.snoozed&&(J+=" snoozed"),h.jsx("div",{className:J,title:F,onClick:()=>i(k.id),children:F},`${k.id}-${H}`)}),N.length>4&&h.jsxs("div",{className:"cal-more",children:["+",N.length-4," more"]})]})]},O)})})]})]})}function vw({id:n,title:a,onBack:i}){const l=g_(n),u=v_(),o=Yy(),m=l.data??[];return h.jsxs("main",{className:"logs-page",children:[h.jsxs("div",{className:"page-hd",children:[h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:i,children:"← BACK"}),h.jsxs("div",{className:"page-title",children:["FLAGS / ",a]}),l.dataUpdatedAt>0&&h.jsx("span",{className:"page-freshness",children:Iy(Math.max(0,(o-l.dataUpdatedAt)/1e3))}),h.jsx("button",{type:"button",className:"btn-refresh",title:"Refresh","aria-label":"Refresh",onClick:()=>void l.refetch(),children:"↻"})]}),l.isLoading?h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})}):l.isError?h.jsx("div",{className:"logs-error",children:l.error.message}):m.length===0?h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"⚑"}),h.jsx("div",{className:"empty-msg",children:"NO OPEN FLAGS"})]}):h.jsxs("div",{className:"flags-list",children:[h.jsxs("div",{className:"flags-count",children:[m.length," open flag",m.length===1?"":"s"]}),m.map(g=>h.jsxs("div",{className:"flag-item",children:[h.jsxs("div",{className:"flag-item-hd",children:[h.jsx("span",{className:"flag-type",children:g.type}),h.jsx("span",{className:"flag-scope",children:g.scope==="general"?"general":"local"}),h.jsx("span",{className:"flag-age",title:g.filename,children:mu(g.created_at)}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",disabled:u.isPending,onClick:()=>u.mutate({id:n,filename:g.filename}),children:"RESOLVE"})]}),h.jsx("div",{className:"flag-desc",children:g.description})]},g.filename))]})]})}var cc=n=>n.type==="checkbox",Xi=n=>n instanceof Date,Sn=n=>n==null;const tg=n=>typeof n=="object";var zt=n=>!Sn(n)&&!Array.isArray(n)&&tg(n)&&!Xi(n),pw=n=>zt(n)&&n.target?cc(n.target)?n.target.checked:n.target.value:n,bw=(n,a)=>a.split(".").some((i,l,u)=>!isNaN(Number(i))&&n.has(u.slice(0,l).join("."))),wx=n=>{const a=n.constructor&&n.constructor.prototype;return zt(a)&&a.hasOwnProperty("isPrototypeOf")},pd=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function It(n){if(n instanceof Date)return new Date(n);const a=typeof FileList<"u"&&n instanceof FileList;if(pd&&(n instanceof Blob||a))return n;const i=Array.isArray(n);if(!i&&!(zt(n)&&wx(n)))return n;const l=i?[]:Object.create(Object.getPrototypeOf(n));for(const u in n)Object.prototype.hasOwnProperty.call(n,u)&&(l[u]=It(n[u]));return l}const Xl={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},Ia={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},$a={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},Cx="root",ng=["__proto__","constructor","prototype"],Sw=/^\w*$/;var fc=n=>Sw.test(n),jt=n=>n===void 0;const xw=/[.[\]'"]/;var bd=n=>n.split(xw).filter(Boolean),ze=(n,a,i)=>{if(!a||!zt(n))return i;const l=fc(a)?[a]:bd(a);if(l.some(o=>ng.includes(o)))return i;const u=l.reduce((o,m)=>Sn(o)?void 0:o[m],n);return jt(u)||u===n?jt(n[a])?i:n[a]:u},os=n=>typeof n=="boolean",Oa=n=>typeof n=="function",Dt=(n,a,i)=>{let l=-1;const u=fc(a)?[a]:bd(a),o=u.length,m=o-1;for(;++l<o;){const g=u[l];let b=i;if(l!==m){const y=n[g];b=zt(y)||Array.isArray(y)?y:isNaN(+u[l+1])?{}:[]}if(ng.includes(g))return;n[g]=b,n=n[g]}};const Mx=_t.createContext(null);Mx.displayName="HookFormControlContext";const Ew=()=>_t.useContext(Mx);var Tw=(n,a,i,l=!0)=>{const u={};for(const o in n)Object.defineProperty(u,o,{get:()=>{const m=o;return a._proxyFormState[m]!==Ia.all&&(a._proxyFormState[m]=!l||Ia.all),n[m]}});return u};const Dx=pd?_t.useLayoutEffect:_t.useEffect;var On=n=>typeof n=="string",py=(n,a,i,l,u)=>On(n)?(l&&a.watch.add(n),ze(i,n,u)):Array.isArray(n)?n.map(o=>(l&&a.watch.add(o),ze(i,o))):(l&&(a.watchAll=!0),i),by=n=>Sn(n)||!tg(n);const ab=(n,a)=>a.length===0&&!Array.isArray(n)&&!wx(n);function ua(n,a,i=new WeakMap){if(n===a)return!0;if(by(n)||by(a))return Object.is(n,a);if(Xi(n)&&Xi(a))return Object.is(n.getTime(),a.getTime());const l=Object.keys(n),u=Object.keys(a);if(l.length!==u.length)return!1;if(ab(n,l)||ab(a,u))return Object.is(n,a);if(!l.length&&Array.isArray(n)!==Array.isArray(a))return!1;const o=i.get(n);if(o&&o.has(a))return!0;if(o)o.add(a);else{const m=new WeakSet;m.add(a),i.set(n,m)}for(const m of l){const g=n[m];if(!(m in a))return!1;if(m!=="ref"){const b=a[m];if(Xi(g)&&Xi(b)||(zt(g)||Array.isArray(g))&&(zt(b)||Array.isArray(b))?!ua(g,b,i):!Object.is(g,b))return!1}}return!0}function Ho(n){const a=Ew(),{control:i=a,name:l,defaultValue:u,disabled:o,exact:m,compute:g}=n||{},b=_t.useRef(u),y=_t.useRef(g),_=_t.useRef(void 0),w=_t.useRef(i),T=_t.useRef(l);y.current=g;const[S,N]=_t.useState(()=>{const F=i._getWatch(l,b.current);return y.current?y.current(F):F}),O=_t.useCallback(F=>{const J=py(l,i._names,F||i._formValues,!1,b.current);return y.current?y.current(J):J},[i._formValues,i._names,l]),j=_t.useCallback(F=>{if(!o){const J=py(l,i._names,F||i._formValues,!1,b.current);if(y.current){const pe=y.current(J);ua(pe,_.current)||(N(pe),_.current=pe)}else N(J)}},[i._formValues,i._names,o,l]);Dx(()=>((w.current!==i||!ua(T.current,l))&&(w.current=i,T.current=l,j()),i._subscribe({name:l,formState:{values:!0},exact:m,callback:F=>{j(F.values)}})),[i,m,l,j]),_t.useEffect(()=>i._removeUnmounted());const R=w.current!==i,k=T.current,H=_t.useMemo(()=>{if(o)return null;const F=!R&&!ua(k,l);return R||F?O():null},[o,R,l,k,O]);return H!==null?H:S}const jx=n=>{const a={};for(const i of Object.keys(n))if(tg(n[i])&&n[i]!==null&&!Xi(n[i])){const l=jx(n[i]);for(const u of Object.keys(l))a[`${i}.${u}`]=l[u]}else a[i]=n[i];return a},Nw=_t.createContext(null);Nw.displayName="HookFormContext";var _w=(n,a,i,l,u)=>a?{...i[n],types:{...i[n]&&i[n].types?i[n].types:{},[l]:u||!0}}:{},Rx=n=>Array.isArray(n)?n.filter(Boolean):[],Qf=n=>Array.isArray(n)?n:[n],sb=()=>{let n=[];return{get observers(){return n},next:u=>{for(const o of n)o.next&&o.next(u)},subscribe:u=>(n.push(u),{unsubscribe:()=>{n=n.filter(o=>o!==u)}}),unsubscribe:()=>{n=[]}}};function Ax(n,a){const i={};for(const l in n)if(n.hasOwnProperty(l)){const u=n[l],o=a[l];if(u&&zt(u)&&o){const m=Ax(u,o);zt(m)&&(i[l]=m)}else n[l]&&(i[l]=o)}return i}var bn=n=>zt(n)&&!Object.keys(n).length,ag=n=>n.type==="file",td=n=>{if(!pd)return!1;const a=n?n.ownerDocument:0;return n instanceof(a&&a.defaultView?a.defaultView.HTMLElement:HTMLElement)},kx=n=>n.type==="select-multiple",sg=n=>n.type==="radio",Ow=n=>sg(n)||cc(n),Lm=n=>td(n)&&n.isConnected;function ww(n,a){const i=a.slice(0,-1).length;let l=0;for(;l<i;){if(Sn(n)){n=void 0;break}n=n[a[l]],l++}return n}function Cw(n){for(const a in n)if(n.hasOwnProperty(a)&&!jt(n[a]))return!1;return!0}function en(n,a){if(On(a)&&Object.prototype.hasOwnProperty.call(n,a))return delete n[a],n;const i=Array.isArray(a)?a:fc(a)?[a]:bd(a);if(i.some(m=>ng.includes(String(m))))return n;const l=i.length===1?n:ww(n,i),u=i.length-1,o=i[u];return l&&delete l[o],u!==0&&(zt(l)&&bn(l)||Array.isArray(l)&&Cw(l))&&en(n,i.slice(0,-1)),n}var Mw=n=>{for(const a in n)if(Oa(n[a]))return!0;return!1};function Ux(n){return Array.isArray(n)||zt(n)&&!Mw(n)}function Sy(n,a={}){for(const i in n){const l=n[i];Ux(l)?(a[i]=Array.isArray(l)?[]:{},Sy(l,a[i])):jt(l)||(a[i]=!0)}return a}function xy(n){if(n!==!1){if(n===!0)return!0;if(Array.isArray(n)){const a=n.map(i=>xy(i));return a.some(i=>i!==void 0)?a:void 0}if(zt(n)){const a={};for(const i in n){const l=xy(n[i]);jt(l)||(a[i]=l)}return Object.keys(a).length?a:void 0}}}function Br(n,a,i){i||(i=Sy(a));for(const l in n){const u=n[l];if(Ux(u))jt(a)||by(i[l])?i[l]=Sy(u,Array.isArray(u)?[]:{}):Br(u,Sn(a)?{}:a[l],i[l]);else{const o=a[l];i[l]=!ua(u,o)}}return xy(i)||{}}const ib={value:!1,isValid:!1},rb={value:!0,isValid:!0};var zx=n=>{if(Array.isArray(n)){if(n.length>1){const a=n.filter(i=>i&&i.checked&&!i.disabled).map(i=>i.value);return{value:a,isValid:!!a.length}}return n[0].checked&&!n[0].disabled?n[0].attributes&&!jt(n[0].attributes.value)?jt(n[0].value)||n[0].value===""?rb:{value:n[0].value,isValid:!0}:rb:ib}return ib},Lx=(n,{valueAsNumber:a,valueAsDate:i,setValueAs:l})=>jt(n)?n:a?n===""?NaN:n&&+n:i&&On(n)?new Date(n):l?l(n):n;const lb={isValid:!1,value:null};var Hx=n=>Array.isArray(n)?n.reduce((a,i)=>i&&i.checked&&!i.disabled?{isValid:!0,value:i.value}:a,lb):lb;function ub(n){const a=n.ref;return ag(a)?a.files:sg(a)?Hx(n.refs).value:kx(a)?[...a.selectedOptions].map(({value:i})=>i):cc(a)?zx(n.refs).value:Lx(jt(a.value)?n.ref.value:a.value,n)}var Dw=(n,a,i,l)=>{const u={};for(const o of n){const m=ze(a,o);m&&Dt(u,o,m._f)}return{criteriaMode:i,names:[...n],fields:u,shouldUseNativeValidation:l}},nd=n=>n instanceof RegExp,Vo=n=>jt(n)?n:nd(n)?n.source:zt(n)?nd(n.value)?n.value.source:n.value:n,Zf=n=>({isOnSubmit:!n||n===Ia.onSubmit,isOnBlur:n===Ia.onBlur,isOnChange:n===Ia.onChange,isOnAll:n===Ia.all,isOnTouch:n===Ia.onTouched});const ob="AsyncFunction";var jw=n=>{if(!n||!n.validate)return!1;if(Oa(n.validate))return n.validate.constructor.name===ob;if(zt(n.validate)){for(const a in n.validate)if(n.validate[a].constructor.name===ob)return!0}return!1},Rw=n=>n.mount&&(n.required||n.min||n.max||n.maxLength||n.minLength||n.pattern||n.validate),Hm=(n,a,i)=>{if(i)return!1;if(a.watchAll||a.watch.has(n))return!0;for(const l of a.watch)if(n.startsWith(l)&&n.charAt(l.length)===".")return!0;return!1};const Bo=(n,a,i,l)=>{for(const u of i||Object.keys(n)){const o=ze(n,u);if(o){const{_f:m,...g}=o;if(m){if(m.refs&&m.refs[0]&&a(m.refs[0],u)&&!l)return!0;if(m.ref&&a(m.ref,m.name)&&!l)return!0;if(Bo(g,a))break}else if(zt(g)&&Bo(g,a))break}}};function cb(n,a,i){const l=ze(n,i);if(l||fc(i))return{error:l,name:i};const u=i.split(".");for(;u.length;){const o=u.join("."),m=ze(a,o),g=ze(n,o);if(m&&!Array.isArray(m)&&i!==o)return{name:i};if(g&&g.type)return{name:o,error:g};if(g&&g.root&&g.root.type)return{name:`${o}.root`,error:g.root};u.pop()}return{name:i}}var Aw=(n,a,i,l)=>{i(n);const{name:u,...o}=n,m=Object.keys(o);return!m.length||l&&m.length>=Object.keys(a).length||m.find(g=>a[g]===(!l||Ia.all))},kw=(n,a,i)=>!n||!a||n===a||Qf(n).some(l=>l&&(i?l===a||l.startsWith(a+"."):l.startsWith(a)||a.startsWith(l))),Uw=(n,a,i,l,u)=>u.isOnAll?!1:!i&&u.isOnTouch?!(a||n):(i?l.isOnBlur:u.isOnBlur)?!n:(i?l.isOnChange:u.isOnChange)?n:!0,zw=(n,a)=>!Rx(ze(n,a)).length&&en(n,a),fb=(n,a,i)=>{const l=ze(n,i),u=Array.isArray(l)?l:[];return Dt(u,Cx,a[i]),Dt(n,i,u),n};function db(n,a,i="validate"){if(On(n)||Array.isArray(n)&&n.every(On)||os(n)&&!n)return{type:i,message:On(n)?n:"",ref:a}}var Ql=n=>zt(n)&&!nd(n)?n:{value:n,message:""},hb=async(n,a,i,l,u,o)=>{const{ref:m,refs:g,required:b,maxLength:y,minLength:_,min:w,max:T,pattern:S,validate:N,name:O,valueAsNumber:j,mount:R}=n._f,k=ze(i,O);if(!R||a.has(O))return{};const H=g?g[0]:m,F=P=>{if(u&&H.reportValidity){const ie=os(P)?"":P||"";g?g.forEach(Se=>Se.setCustomValidity(ie)):H.setCustomValidity(ie),H.reportValidity()}},J={},pe=sg(m),G=cc(m),re=pe||G,se=(j||ag(m))&&jt(m.value)&&jt(k)||td(m)&&m.value===""||k===""||Array.isArray(k)&&!k.length,V=_w.bind(null,O,l,J),K=(P,ie,Se,be=$a.maxLength,X=$a.minLength)=>{const ce=P?ie:Se;J[O]={type:P?be:X,message:ce,ref:m,...V(P?be:X,ce)}};if(o?!Array.isArray(k)||!k.length:b&&(!re&&(se||Sn(k))||os(k)&&!k||G&&!zx(g).isValid||pe&&!Hx(g).isValid)){const{value:P,message:ie}=On(b)?{value:!!b,message:b}:Ql(b);if(P&&(J[O]={type:$a.required,message:ie,ref:H,...V($a.required,ie)},!l))return F(ie),J}if(!se&&(!Sn(w)||!Sn(T))){let P,ie;const Se=Ql(T),be=Ql(w);if(!Sn(k)&&!isNaN(k)){const X=m.valueAsNumber||k&&+k;Sn(Se.value)||(P=X>Se.value),Sn(be.value)||(ie=X<be.value)}else{const X=m.valueAsDate||new Date(k),ce=Re=>new Date(new Date().toDateString()+" "+Re),ye=m.type=="time",De=m.type=="week";On(Se.value)&&k&&(P=ye?ce(k)>ce(Se.value):De?k>Se.value:X>new Date(Se.value)),On(be.value)&&k&&(ie=ye?ce(k)<ce(be.value):De?k<be.value:X<new Date(be.value))}if((P||ie)&&(K(!!P,Se.message,be.message,$a.max,$a.min),!l))return F(J[O].message),J}if((y||_)&&!se&&(On(k)||o&&Array.isArray(k))){const P=Ql(y),ie=Ql(_),Se=!Sn(P.value)&&k.length>+P.value,be=!Sn(ie.value)&&k.length<+ie.value;if((Se||be)&&(K(Se,P.message,ie.message),!l))return F(J[O].message),J}if(S&&!se&&On(k)){const{value:P,message:ie}=Ql(S);if(nd(P)&&!k.match(P)&&(J[O]={type:$a.pattern,message:ie,ref:m,...V($a.pattern,ie)},!l))return F(ie),J}if(N){if(Oa(N)){const P=await N(k,i),ie=db(P,H);if(ie&&(J[O]={...ie,...V($a.validate,ie.message)},!l))return F(ie.message),J}else if(zt(N)){let P={};for(const ie in N){if(!bn(P)&&!l)break;const Se=db(await N[ie](k,i),H,ie);Se&&(P={...Se,...V(ie,Se.message)},F(Se.message),l&&(J[O]=P))}if(!bn(P)&&(J[O]={ref:H,...P},!l))return J}}return F(!0),J};const Lw={mode:Ia.onSubmit,reValidateMode:Ia.onChange,shouldFocusError:!0},Vm="form",Vx={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Hw(n={}){let a={...Lw,...n},i={...It(Vx),isLoading:Oa(a.defaultValues),errors:a.errors||{},disabled:a.disabled||!1},l={},u=zt(a.defaultValues)||zt(a.values)?It(a.defaultValues||a.values)||{}:{},o=a.shouldUnregister?{}:It(u),m={action:!1,mount:!1,watch:!1,keepIsValid:!1},g={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},b,y=0,_=0,w=Zf(a.mode),T=Zf(a.reValidateMode);const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},N={...S};let O={...N};const j={array:sb(),state:sb()},R=a.criteriaMode===Ia.all,k=A=>B=>{clearTimeout(y),y=setTimeout(A,B)},H=async A=>{if(!m.keepIsValid&&!a.disabled&&(N.isValid||O.isValid||A)){let B;a.resolver?(B=bn((await ie()).errors),F()):B=await X({fields:l,onlyCheckValid:!0,eventType:Xl.VALID}),B!==i.isValid&&j.state.next({isValid:B})}},F=(A,B)=>{!a.disabled&&(N.isValidating||N.validatingFields||O.isValidating||O.validatingFields)&&((A||Array.from(g.mount)).forEach(ee=>{ee&&(B?Dt(i.validatingFields,ee,B):en(i.validatingFields,ee))}),j.state.next({validatingFields:i.validatingFields,isValidating:!bn(i.validatingFields)}))},J=()=>{i.dirtyFields=Br(u,o)},pe=(A,B=[],ee,he,ve=!0,_e=!0)=>{if(he&&ee&&!a.disabled){if(m.action=!0,_e&&Array.isArray(ze(l,A))){const Ee=ee(ze(l,A),he.argA,he.argB);ve&&Dt(l,A,Ee)}if(_e&&Array.isArray(ze(i.errors,A))){const Ee=ee(ze(i.errors,A),he.argA,he.argB);ve&&Dt(i.errors,A,Ee),zw(i.errors,A)}if((N.touchedFields||O.touchedFields)&&_e&&Array.isArray(ze(i.touchedFields,A))){const Ee=ee(ze(i.touchedFields,A),he.argA,he.argB);ve&&Dt(i.touchedFields,A,Ee)}(N.dirtyFields||O.dirtyFields)&&J(),j.state.next({name:A,isDirty:ye(A,B),dirtyFields:i.dirtyFields,errors:i.errors,isValid:i.isValid})}else Dt(o,A,B)},G=(A,B)=>{Dt(i.errors,A,B),i.errors={...i.errors},j.state.next({errors:i.errors})},re=A=>{i.errors=A,j.state.next({errors:i.errors,isValid:!1})},se=A=>{const B=fc(A)?[A]:bd(A);let ee=o,he=u;for(let ve=0;ve<B.length-1;ve++){const _e=B[ve];if(ee=Sn(ee)?ee:ee[_e],he=Sn(he)?he:he[_e],ee===null&&he!==null)return!0}return!1},V=(A,B,ee,he)=>{const ve=ze(l,A);if(ve){if(se(A))return;const _e=jt(ze(o,A)),Ee=ze(o,A,jt(ee)?ze(u,A):ee);jt(Ee)||he&&he.defaultChecked||B?Dt(o,A,B?Ee:ub(ve._f)):q(A,Ee),m.mount&&!m.action&&(H(),_e&&i.isDirty&&(N.isDirty||O.isDirty)&&(ye()||(i.isDirty=!1,j.state.next({...i}))),n.shouldUnregister&&_e&&!jt(ze(o,A))&&Hm(A,g)&&(m.watch=!0))}},K=(A,B,ee,he,ve)=>{let _e=!1,Ee=!1;const Q={name:A};if(!a.disabled){if(!ee||he){const de=ua(ze(u,A),B);(N.isDirty||O.isDirty)&&(Ee=i.isDirty,i.isDirty=Q.isDirty=!de||ye(),_e=Ee!==Q.isDirty),Ee=!!ze(i.dirtyFields,A),de!==i.isDirty?i.dirtyFields=Br(u,o):de?en(i.dirtyFields,A):Dt(i.dirtyFields,A,!0),Q.dirtyFields=i.dirtyFields,_e=_e||(N.dirtyFields||O.dirtyFields)&&Ee!==!de}if(ee){const de=ze(i.touchedFields,A);de||(Dt(i.touchedFields,A,ee),Q.touchedFields=i.touchedFields,_e=_e||(N.touchedFields||O.touchedFields)&&de!==ee)}_e&&ve&&j.state.next(Q)}return _e?Q:{}},P=(A,B,ee,he)=>{const ve=ze(i.errors,A),_e=(N.isValid||O.isValid)&&os(B)&&i.isValid!==B;if(a.delayError&&ee?(b=k(()=>G(A,ee)),b(a.delayError)):(clearTimeout(y),b=null,ee?Dt(i.errors,A,ee):en(i.errors,A),i.errors={...i.errors}),(ee?!ua(ve,ee):ve)||!bn(he)||_e){const Ee={...he,..._e&&os(B)?{isValid:B}:{},errors:i.errors,name:A};i={...i,...Ee},j.state.next(Ee)}},ie=async A=>(F(A,!0),await a.resolver(o,a.context,Dw(A||g.mount,l,a.criteriaMode,a.shouldUseNativeValidation))),Se=async A=>{const{errors:B}=await ie(A);if(F(A),A){for(const ee of A){const he=ze(B,ee);he?g.array.has(ee)&&zt(he)&&!Object.keys(he).some(ve=>!Number.isNaN(Number(ve)))?fb(i.errors,{[ee]:he},ee):Dt(i.errors,ee,he):en(i.errors,ee)}i.errors={...i.errors}}else i.errors=B;return B},be=async({name:A,eventType:B})=>{if(n.validate){const ee=await n.validate({formValues:o,formState:i,name:A,eventType:B});if(zt(ee))for(const he in ee){const ve=ee[he];ve&&Xn(`${Vm}.${he}`,{message:On(ve.message)?ve.message:"",type:ve.type||$a.validate})}else On(ee)||!ee?Xn(Vm,{message:ee||"",type:$a.validate}):Gn(Vm);return ee}return!0},X=async({fields:A,onlyCheckValid:B,name:ee,eventType:he,context:ve={valid:!0,runRootValidation:!1}})=>{if(n.validate&&(ve.runRootValidation=!0,!await be({name:ee,eventType:he})&&(ve.valid=!1,B)))return ve.valid;for(const _e in A){const Ee=A[_e];if(Ee){const{_f:Q,...de}=Ee;if(Q){const Ae=g.array.has(Q.name),Pe=Ee._f&&jw(Ee._f),Ot=N.validatingFields||N.isValidating||O.validatingFields||O.isValidating;Pe&&Ot&&F([Q.name],!0);const yt=await hb(Ee,g.disabled,o,R,a.shouldUseNativeValidation&&!B,Ae);if(Pe&&Ot&&F([Q.name]),yt[Q.name]&&(ve.valid=!1,B)||(!B&&(ze(yt,Q.name)?Ae?fb(i.errors,yt,Q.name):Dt(i.errors,Q.name,yt[Q.name]):en(i.errors,Q.name)),n.shouldUseNativeValidation&&yt[Q.name]))break}!bn(de)&&await X({context:ve,onlyCheckValid:B,fields:de,name:_e,eventType:he})}}return ve.valid},ce=()=>{for(const A of g.unMount){const B=ze(l,A);B&&(B._f.refs?B._f.refs.every(ee=>!Lm(ee)):!Lm(B._f.ref))&&Ma(A)}g.unMount=new Set},ye=(A,B)=>!a.disabled&&(A&&B&&Dt(o,A,B),!ua(m.mount?o:u,u)),De=(A,B,ee)=>py(A,g,{...m.mount?o:jt(B)?u:On(A)?{[A]:B}:B},ee,B),Re=A=>Rx(ze(m.mount?o:u,A,a.shouldUnregister?ze(u,A,[]):[])),q=(A,B,ee={},he=!1,ve=!1)=>{const _e=ze(l,A);let Ee=B;if(_e){const Q=_e._f;Q&&(!Q.disabled&&Dt(o,A,Lx(B,Q)),Ee=td(Q.ref)&&Sn(B)?"":B,kx(Q.ref)?[...Q.ref.options].forEach(de=>de.selected=Ee.includes(de.value)):Q.refs?cc(Q.ref)?Q.refs.forEach(de=>{(!de.defaultChecked||!de.disabled)&&(Array.isArray(Ee)?de.checked=!!Ee.find(Ae=>Ae===de.value):de.checked=Ee===de.value||!!Ee)}):Q.refs.forEach(de=>de.checked=de.value===Ee):ag(Q.ref)?Q.ref.value="":(Q.ref.value=Ee,!Q.ref.type&&!ve&&j.state.next({name:A,values:he?o:It(o)})))}(ee.shouldDirty||ee.shouldTouch)&&K(A,Ee,ee.shouldTouch,ee.shouldDirty,!ve),ee.shouldValidate&&ft(A)},ue=(A,B,ee,he=!1,ve=!1)=>{for(const _e in B){if(!B.hasOwnProperty(_e))return;const Ee=B[_e],Q=A+"."+_e,de=ze(l,Q);(g.array.has(A)||zt(Ee)||de&&!de._f)&&!Xi(Ee)?ue(Q,Ee,ee,he,ve):q(Q,Ee,ee,he,ve)}},Oe=(A,B,ee,he,ve=!1)=>{const _e=ze(l,A),Ee=g.array.has(A),Q=he?B:It(B),de=ze(o,A),Ae=ua(de,Q);if(Ae||Dt(o,A,Q),Ee)j.array.next({name:A,values:he?o:It(o)}),(N.isDirty||N.dirtyFields||O.isDirty||O.dirtyFields)&&ee.shouldDirty&&(J(),ve||j.state.next({name:A,dirtyFields:i.dirtyFields,isDirty:ye(A,Q)}));else{const Pe=Array.isArray(Q)&&!Q.length||bn(Q);!_e||_e._f||Sn(Q)||Pe?q(A,Q,ee,he,ve):ue(A,Q,ee,he,ve)}if(!Ae&&!ve){const Pe=Hm(A,g),Ot=he?o:It(o);j.state.next({...Pe&&i,name:m.mount||Pe?A:void 0,values:Ot})}},Ne=(A,B,ee={})=>Oe(A,B,ee,!1),Me=(A,B={})=>{const ee=Oa(A)?A(o):A;if(!ua(o,ee)){o={...o,...ee};const he=jx(ee);for(const ve of g.mount)ve in he&&Oe(ve,he[ve],B,!0,!0);j.state.next({...i,name:void 0,type:void 0,..._?{values:o}:{}}),B.shouldValidate&&H()}},Le=async A=>{m.mount=!0;const B=A.target;let ee=B.name,he=!0;const ve=ze(l,ee),_e=Ee=>{he=Number.isNaN(Ee)||Xi(Ee)&&isNaN(Ee.getTime())||ua(Ee,ze(o,ee,Ee))};if(ve){let Ee,Q;const de=B.type?ub(ve._f):pw(A),Ae=A.type===Xl.BLUR||A.type===Xl.FOCUS_OUT,Pe=!Rw(ve._f)&&!n.validate&&!a.resolver&&!ze(i.errors,ee)&&!ve._f.deps,Ot=Pe||Uw(Ae,ze(i.touchedFields,ee),i.isSubmitted,T,w),yt=Hm(ee,g,Ae);Dt(o,ee,de),Ae?(!B||!B.readOnly)&&(ve._f.onBlur&&ve._f.onBlur(A),b&&b(0)):ve._f.onChange&&ve._f.onChange(A);const ln=K(ee,de,Ae),ps=!bn(ln)||yt;if(!Ae&&j.state.next({name:ee,type:A.type,..._?{values:It(o)}:{}}),Ot)return(!Pe||!i.isValid)&&(N.isValid||O.isValid)&&(a.mode==="onBlur"?Ae&&H():Ae||H()),ps&&j.state.next({name:ee,...yt?{}:ln});if(!a.resolver&&n.validate&&await be({name:ee,eventType:A.type}),!Ae&&yt&&j.state.next({...i}),a.resolver){const{errors:Da}=await ie([ee]);if(F([ee]),_e(de),!he){!bn(ln)&&j.state.next(ln);return}const al=cb(i.errors,l,ee),Ps=cb(Da,l,al.name||ee);Ee=Ps.error,ee=Ps.name,Q=bn(Da)}else F([ee],!0),Ee=(await hb(ve,g.disabled,o,R,a.shouldUseNativeValidation))[ee],F([ee]),_e(de),he&&(Ee?Q=!1:(N.isValid||O.isValid)&&(Q=await X({fields:l,onlyCheckValid:!0,name:ee,eventType:A.type})));he&&(ve._f.deps&&(!Array.isArray(ve._f.deps)||ve._f.deps.length>0)&&ft(ve._f.deps),P(ee,Q,Ee,ln))}},Ie=(A,B)=>{if(ze(i.errors,B)&&A.focus)return A.focus(),1},ft=async(A,B={})=>{let ee,he;const ve=Qf(A);if(a.resolver){const _e=await Se(jt(A)?A:ve);ee=bn(_e),he=A?!ve.some(Ee=>ze(_e,Ee)):ee}else A?(he=(await Promise.all(ve.map(async _e=>{const Ee=ze(l,_e);return await X({fields:Ee&&Ee._f?{[_e]:Ee}:Ee,eventType:Xl.TRIGGER})}))).every(Boolean),!(!he&&!i.isValid)&&H()):he=ee=await X({fields:l,name:A,eventType:Xl.TRIGGER});return j.state.next({...!On(A)||(N.isValid||O.isValid)&&ee!==i.isValid?{}:{name:A},...a.resolver||!A?{isValid:ee}:{},errors:i.errors}),B.shouldFocus&&!he&&Bo(l,Ie,A?ve:g.mount),he},tt=(A,B)=>{let ee={...m.mount?o:u};return B&&(ee=Ax(B.dirtyFields?i.dirtyFields:i.touchedFields,ee)),jt(A)?ee:On(A)?ze(ee,A):A.map(he=>ze(ee,he))},Lt=(A,B)=>({invalid:!!ze((B||i).errors,A),isDirty:!!ze((B||i).dirtyFields,A),error:ze((B||i).errors,A),isValidating:!!ze(i.validatingFields,A),isTouched:!!ze((B||i).touchedFields,A)}),Gn=A=>{const B=A?Qf(A):void 0;B==null||B.forEach(ee=>en(i.errors,ee)),B?B.forEach(ee=>{j.state.next({name:ee,errors:i.errors})}):j.state.next({errors:{}})},Xn=(A,B,ee)=>{const he=(ze(l,A,{_f:{}})._f||{}).ref,ve=ze(i.errors,A)||{},{ref:_e,message:Ee,type:Q,...de}=ve;Dt(i.errors,A,{...de,...B,ref:he}),j.state.next({name:A,errors:i.errors,isValid:!1}),ee&&ee.shouldFocus&&he&&he.focus&&he.focus()},Wa=(A,B)=>{if(Oa(A)){_++;const{unsubscribe:ee}=j.state.subscribe({next:ve=>"values"in ve&&A(ve.values||De(void 0,B),ve)});let he=!1;return{unsubscribe:()=>{he||(he=!0,_--,ee())}}}return De(A,B,!0)},jn=A=>{var B;const ee=!!(!((B=A.formState)===null||B===void 0)&&B.values);ee&&_++;const{unsubscribe:he}=j.state.subscribe({next:_e=>{if(kw(A.name,_e.name,A.exact)&&Aw(_e,A.formState||N,Js,A.reRenderRoot)){const Ee={...o};A.callback({values:Ee,...i,..._e,defaultValues:u})}}});if(!ee)return he;let ve=!1;return()=>{ve||(ve=!0,_--,he())}},Qn=A=>(m.mount=!0,O={...O,...A.formState},jn({...A,formState:{...S,...A.formState}})),Ma=(A,B={})=>{for(const ee of A?Qf(A):g.mount)g.mount.delete(ee),g.array.delete(ee),B.keepValue||(en(l,ee),en(o,ee)),!B.keepError&&en(i.errors,ee),!B.keepDirty&&en(i.dirtyFields,ee),!B.keepTouched&&en(i.touchedFields,ee),!B.keepIsValidating&&en(i.validatingFields,ee),!a.shouldUnregister&&!B.keepDefaultValue&&en(u,ee);j.state.next({values:It(o)}),j.state.next({...i,...B.keepDirty?{isDirty:ye()}:{}}),!B.keepIsValid&&H()},Ka=({disabled:A,name:B})=>{if(os(A)&&m.mount||A||g.disabled.has(B)){const ve=g.disabled.has(B)!==!!A;A?g.disabled.add(B):g.disabled.delete(B),ve&&m.mount&&!m.action&&H()}},da=(A,B={})=>{let ee=ze(l,A);const he=os(B.disabled)||os(a.disabled),ve=!g.registerName.has(A)&&ee&&ee._f&&!ee._f.mount;return Dt(l,A,{...ee||{},_f:{...ee&&ee._f?ee._f:{ref:{name:A}},name:A,mount:!0,...B}}),g.mount.add(A),ee&&!ve?Ka({disabled:os(B.disabled)?B.disabled:a.disabled,name:A}):V(A,!0,B.value),{...he?{disabled:B.disabled||a.disabled}:{},...a.progressive?{required:!!B.required,min:Vo(B.min),max:Vo(B.max),minLength:Vo(B.minLength),maxLength:Vo(B.maxLength),pattern:Vo(B.pattern)}:{},name:A,onChange:Le,onBlur:Le,ref:_e=>{if(_e){g.registerName.add(A),da(A,B),g.registerName.delete(A),ee=ze(l,A);const Ee=jt(_e.value)&&_e.querySelectorAll&&_e.querySelectorAll("input,select,textarea")[0]||_e,Q=Ow(Ee),de=ee._f.refs||[];if(Q?de.find(Ae=>Ae===Ee):Ee===ee._f.ref)return;Dt(l,A,{_f:{...ee._f,...Q?{refs:[...de.filter(Lm),Ee,...Array.isArray(ze(u,A))?[{}]:[]],ref:{type:Ee.type,name:A}}:{ref:Ee}}}),V(A,!1,void 0,Ee)}else ee=ze(l,A,{}),ee._f&&(ee._f.mount=!1),(a.shouldUnregister||B.shouldUnregister)&&!(bw(g.array,A)&&m.action)&&g.unMount.add(A)}}},Wn=()=>a.shouldFocusError&&!a.shouldUseNativeValidation&&Bo(l,Ie,g.mount),gs=A=>{os(A)&&(j.state.next({disabled:A}),Bo(l,(B,ee)=>{const he=ze(l,ee);he&&(B.disabled=he._f.disabled||A,Array.isArray(he._f.refs)&&he._f.refs.forEach(ve=>{ve.disabled=he._f.disabled||A}))},0,!1))},Ja=(A,B)=>async ee=>{let he;ee&&(ee.preventDefault&&ee.preventDefault(),ee.persist&&ee.persist());let ve=It(o);if(j.state.next({isSubmitting:!0}),a.resolver){const{errors:_e,values:Ee}=await ie();F(),i.errors=_e,ve=It(Ee)}else await X({fields:l,eventType:Xl.SUBMIT});if(g.disabled.size)for(const _e of g.disabled)en(ve,_e);if(en(i.errors,Cx),bn(i.errors)){j.state.next({errors:{}});try{await A(ve,ee)}catch(_e){he=_e}}else B&&await B({...i.errors},ee),Wn(),setTimeout(Wn);if(j.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:bn(i.errors)&&!he,submitCount:i.submitCount+1,errors:i.errors}),he)throw he},er=(A,B={})=>{ze(l,A)&&(jt(B.defaultValue)?Ne(A,It(ze(u,A))):(Ne(A,B.defaultValue),Dt(u,A,It(B.defaultValue))),B.keepTouched||en(i.touchedFields,A),B.keepDirty||(en(i.dirtyFields,A),i.isDirty=B.defaultValue?ye(A,It(ze(u,A))):ye()),B.keepError||(en(i.errors,A),N.isValid&&H()),j.state.next({...i}))},Ks=(A,B={})=>{const ee=A?It(A):u,he=It(ee),ve=bn(A),_e=he;if(B.keepDefaultValues||(u=ee),!B.keepValues){if(B.keepDirtyValues){const Ee=new Set([...g.mount,...Object.keys(Br(u,o))]);for(const Q of Array.from(Ee)){const de=ze(i.dirtyFields,Q),Ae=ze(o,Q),Pe=ze(_e,Q);de&&!jt(Ae)?Dt(_e,Q,Ae):!de&&!jt(Pe)&&Ne(Q,Pe)}}else{if(pd&&jt(A))for(const Ee of g.mount){const Q=ze(l,Ee);if(Q&&Q._f){const de=Array.isArray(Q._f.refs)?Q._f.refs[0]:Q._f.ref;if(td(de)){const Ae=de.closest("form");if(Ae){Ae.reset();break}}}}if(B.keepFieldsRef)for(const Ee of g.mount)Ne(Ee,ze(_e,Ee));else l={}}if(a.shouldUnregister){if(o=B.keepDefaultValues?It(u):{},B.keepFieldsRef)for(const Ee of g.mount)Dt(o,Ee,ze(_e,Ee))}else o=It(_e);j.array.next({values:{..._e}}),j.state.next({name:void 0,type:void 0,values:{..._e}})}g={mount:B.keepDirtyValues?g.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},m.mount=!N.isValid||!!B.keepIsValid||!!B.keepDirtyValues||!a.shouldUnregister&&!bn(_e),m.watch=!!a.shouldUnregister,m.keepIsValid=!!B.keepIsValid,m.action=!1,B.keepErrors||(i.errors={}),j.state.next({submitCount:B.keepSubmitCount?i.submitCount:0,isDirty:ve?!1:B.keepDirty?i.isDirty:B.keepValues?ye():!!(B.keepDefaultValues&&!ua(A,u)),isSubmitted:B.keepIsSubmitted?i.isSubmitted:!1,dirtyFields:ve?{}:B.keepDirtyValues?B.keepDefaultValues&&o?Br(u,o):i.dirtyFields:B.keepDefaultValues&&A?Br(u,A):B.keepDirty?i.dirtyFields:{},touchedFields:B.keepTouched?i.touchedFields:{},errors:B.keepErrors?i.errors:{},isSubmitSuccessful:B.keepIsSubmitSuccessful?i.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:u})},Xt=(A,B)=>Ks(Oa(A)?A(o):A,{...a.resetOptions,...B}),Pa=(A,B={})=>{const ee=ze(l,A),he=ee&&ee._f;if(he){const ve=he.refs?he.refs[0]:he.ref;ve.focus&&setTimeout(()=>{ve.focus(),B.shouldSelect&&Oa(ve.select)&&ve.select()})}},Js=A=>{const{name:B,type:ee,values:he,...ve}=A;i={...i,...ve}},vs={control:{register:da,unregister:Ma,getFieldState:Lt,handleSubmit:Ja,setError:Xn,_subscribe:jn,_runSchema:ie,_updateIsValidating:F,_focusError:Wn,_getWatch:De,_getDirty:ye,_setValid:H,_setFieldArray:pe,_setDisabledField:Ka,_setErrors:re,_getFieldArray:Re,_reset:Ks,_resetDefaultValues:()=>Oa(a.defaultValues)&&a.defaultValues().then(A=>{Xt(A,a.resetOptions),j.state.next({isLoading:!1})}),_removeUnmounted:ce,_disableForm:gs,_subjects:j,_proxyFormState:N,get _fields(){return l},get _formValues(){return o},get _state(){return m},set _state(A){m=A},get _defaultValues(){return u},get _names(){return g},set _names(A){g=A},get _formState(){return i},get _options(){return a},set _options(A){a={...a,...A},w=Zf(a.mode),T=Zf(a.reValidateMode)}},subscribe:Qn,trigger:ft,register:da,handleSubmit:Ja,watch:Wa,setValue:Ne,setValues:Me,getValues:tt,reset:Xt,resetField:er,resetDefaultValues:(A,B={})=>{if(u=It(A),!B.keepDirty){const ee=Br(u,o);i.dirtyFields=ee,i.isDirty=!bn(ee)}B.keepIsValid||H(),j.state.next({...i,defaultValues:u})},clearErrors:Gn,unregister:Ma,setError:Xn,setFocus:Pa,getFieldState:Lt};return{...vs,formControl:vs}}function Vw(n={}){const a=_t.useRef(void 0),i=_t.useRef(void 0),l=_t.useRef(n.formControl),[u,o]=_t.useState(()=>({...It(Vx),isLoading:Oa(n.defaultValues),errors:n.errors||{},disabled:n.disabled||!1,defaultValues:Oa(n.defaultValues)?void 0:n.defaultValues}));if(!a.current||n.formControl&&l.current!==n.formControl)if(l.current=n.formControl,n.formControl)a.current={...n.formControl,formState:u},n.defaultValues&&!Oa(n.defaultValues)&&n.formControl.reset(n.defaultValues,n.resetOptions);else{const{formControl:g,...b}=Hw(n);a.current={...b,formState:u}}const m=a.current.control;return m._options=n,Dx(()=>{const g=m._subscribe({formState:m._proxyFormState,callback:()=>o({...m._formState,defaultValues:m._defaultValues}),reRenderRoot:!0});return o(b=>({...b,isReady:!0})),m._formState.isReady=!0,g},[m]),_t.useEffect(()=>m._disableForm(n.disabled),[m,n.disabled]),_t.useEffect(()=>{n.mode&&(m._options.mode=n.mode),n.reValidateMode&&(m._options.reValidateMode=n.reValidateMode)},[m,n.mode,n.reValidateMode]),_t.useEffect(()=>{n.errors&&(m._setErrors(n.errors),m._focusError())},[m,n.errors]),_t.useEffect(()=>{n.shouldUnregister&&m._subjects.state.next({values:m._getWatch()})},[m,n.shouldUnregister]),_t.useEffect(()=>{if(m._proxyFormState.isDirty){const g=m._getDirty();g!==u.isDirty&&m._subjects.state.next({isDirty:g})}},[m,u.isDirty]),_t.useEffect(()=>{var g;n.values&&!ua(n.values,i.current)?(m._reset(n.values,{keepFieldsRef:!0,...m._options.resetOptions}),!((g=m._options.resetOptions)===null||g===void 0)&&g.keepIsValid||m._setValid(),i.current=n.values,o(b=>({...b}))):m._resetDefaultValues()},[m,n.values]),_t.useEffect(()=>{m._state.mount||(m._setValid(),m._state.mount=!0),m._state.watch&&(m._state.watch=!1,m._subjects.state.next({...m._formState})),m._removeUnmounted()}),a.current.formState=_t.useMemo(()=>Tw(u,m),[m,u]),a.current}var mt;(function(n){n.assertEqual=u=>{};function a(u){}n.assertIs=a;function i(u){throw new Error}n.assertNever=i,n.arrayToEnum=u=>{const o={};for(const m of u)o[m]=m;return o},n.getValidEnumValues=u=>{const o=n.objectKeys(u).filter(g=>typeof u[u[g]]!="number"),m={};for(const g of o)m[g]=u[g];return n.objectValues(m)},n.objectValues=u=>n.objectKeys(u).map(function(o){return u[o]}),n.objectKeys=typeof Object.keys=="function"?u=>Object.keys(u):u=>{const o=[];for(const m in u)Object.prototype.hasOwnProperty.call(u,m)&&o.push(m);return o},n.find=(u,o)=>{for(const m of u)if(o(m))return m},n.isInteger=typeof Number.isInteger=="function"?u=>Number.isInteger(u):u=>typeof u=="number"&&Number.isFinite(u)&&Math.floor(u)===u;function l(u,o=" | "){return u.map(m=>typeof m=="string"?`'${m}'`:m).join(o)}n.joinValues=l,n.jsonStringifyReplacer=(u,o)=>typeof o=="bigint"?o.toString():o})(mt||(mt={}));var mb;(function(n){n.mergeShapes=(a,i)=>({...a,...i})})(mb||(mb={}));const He=mt.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Hi=n=>{switch(typeof n){case"undefined":return He.undefined;case"string":return He.string;case"number":return Number.isNaN(n)?He.nan:He.number;case"boolean":return He.boolean;case"function":return He.function;case"bigint":return He.bigint;case"symbol":return He.symbol;case"object":return Array.isArray(n)?He.array:n===null?He.null:n.then&&typeof n.then=="function"&&n.catch&&typeof n.catch=="function"?He.promise:typeof Map<"u"&&n instanceof Map?He.map:typeof Set<"u"&&n instanceof Set?He.set:typeof Date<"u"&&n instanceof Date?He.date:He.object;default:return He.unknown}},we=mt.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]);class Ws extends Error{get errors(){return this.issues}constructor(a){super(),this.issues=[],this.addIssue=l=>{this.issues=[...this.issues,l]},this.addIssues=(l=[])=>{this.issues=[...this.issues,...l]};const i=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,i):this.__proto__=i,this.name="ZodError",this.issues=a}format(a){const i=a||function(o){return o.message},l={_errors:[]},u=o=>{for(const m of o.issues)if(m.code==="invalid_union")m.unionErrors.map(u);else if(m.code==="invalid_return_type")u(m.returnTypeError);else if(m.code==="invalid_arguments")u(m.argumentsError);else if(m.path.length===0)l._errors.push(i(m));else{let g=l,b=0;for(;b<m.path.length;){const y=m.path[b];b===m.path.length-1?(g[y]=g[y]||{_errors:[]},g[y]._errors.push(i(m))):g[y]=g[y]||{_errors:[]},g=g[y],b++}}};return u(this),l}static assert(a){if(!(a instanceof Ws))throw new Error(`Not a ZodError: ${a}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,mt.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(a=i=>i.message){const i={},l=[];for(const u of this.issues)if(u.path.length>0){const o=u.path[0];i[o]=i[o]||[],i[o].push(a(u))}else l.push(a(u));return{formErrors:l,fieldErrors:i}}get formErrors(){return this.flatten()}}Ws.create=n=>new Ws(n);const Ey=(n,a)=>{let i;switch(n.code){case we.invalid_type:n.received===He.undefined?i="Required":i=`Expected ${n.expected}, received ${n.received}`;break;case we.invalid_literal:i=`Invalid literal value, expected ${JSON.stringify(n.expected,mt.jsonStringifyReplacer)}`;break;case we.unrecognized_keys:i=`Unrecognized key(s) in object: ${mt.joinValues(n.keys,", ")}`;break;case we.invalid_union:i="Invalid input";break;case we.invalid_union_discriminator:i=`Invalid discriminator value. Expected ${mt.joinValues(n.options)}`;break;case we.invalid_enum_value:i=`Invalid enum value. Expected ${mt.joinValues(n.options)}, received '${n.received}'`;break;case we.invalid_arguments:i="Invalid function arguments";break;case we.invalid_return_type:i="Invalid function return type";break;case we.invalid_date:i="Invalid date";break;case we.invalid_string:typeof n.validation=="object"?"includes"in n.validation?(i=`Invalid input: must include "${n.validation.includes}"`,typeof n.validation.position=="number"&&(i=`${i} at one or more positions greater than or equal to ${n.validation.position}`)):"startsWith"in n.validation?i=`Invalid input: must start with "${n.validation.startsWith}"`:"endsWith"in n.validation?i=`Invalid input: must end with "${n.validation.endsWith}"`:mt.assertNever(n.validation):n.validation!=="regex"?i=`Invalid ${n.validation}`:i="Invalid";break;case we.too_small:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at least":"more than"} ${n.minimum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at least":"over"} ${n.minimum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="bigint"?i=`Number must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${n.minimum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly equal to ":n.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(n.minimum))}`:i="Invalid input";break;case we.too_big:n.type==="array"?i=`Array must contain ${n.exact?"exactly":n.inclusive?"at most":"less than"} ${n.maximum} element(s)`:n.type==="string"?i=`String must contain ${n.exact?"exactly":n.inclusive?"at most":"under"} ${n.maximum} character(s)`:n.type==="number"?i=`Number must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="bigint"?i=`BigInt must be ${n.exact?"exactly":n.inclusive?"less than or equal to":"less than"} ${n.maximum}`:n.type==="date"?i=`Date must be ${n.exact?"exactly":n.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(n.maximum))}`:i="Invalid input";break;case we.custom:i="Invalid input";break;case we.invalid_intersection_types:i="Intersection results could not be merged";break;case we.not_multiple_of:i=`Number must be a multiple of ${n.multipleOf}`;break;case we.not_finite:i="Number must be finite";break;default:i=a.defaultError,mt.assertNever(n)}return{message:i}};let Fw=Ey;function qw(){return Fw}const Bw=n=>{const{data:a,path:i,errorMaps:l,issueData:u}=n,o=[...i,...u.path||[]],m={...u,path:o};if(u.message!==void 0)return{...u,path:o,message:u.message};let g="";const b=l.filter(y=>!!y).slice().reverse();for(const y of b)g=y(m,{data:a,defaultError:g}).message;return{...u,path:o,message:g}};function je(n,a){const i=qw(),l=Bw({issueData:a,data:n.data,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,i,i===Ey?void 0:Ey].filter(u=>!!u)});n.common.issues.push(l)}class oa{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(a,i){const l=[];for(const u of i){if(u.status==="aborted")return Qe;u.status==="dirty"&&a.dirty(),l.push(u.value)}return{status:a.value,value:l}}static async mergeObjectAsync(a,i){const l=[];for(const u of i){const o=await u.key,m=await u.value;l.push({key:o,value:m})}return oa.mergeObjectSync(a,l)}static mergeObjectSync(a,i){const l={};for(const u of i){const{key:o,value:m}=u;if(o.status==="aborted"||m.status==="aborted")return Qe;o.status==="dirty"&&a.dirty(),m.status==="dirty"&&a.dirty(),o.value!=="__proto__"&&(typeof m.value<"u"||u.alwaysSet)&&(l[o.value]=m.value)}return{status:a.value,value:l}}}const Qe=Object.freeze({status:"aborted"}),qo=n=>({status:"dirty",value:n}),Ca=n=>({status:"valid",value:n}),yb=n=>n.status==="aborted",gb=n=>n.status==="dirty",yu=n=>n.status==="valid",ad=n=>typeof Promise<"u"&&n instanceof Promise;var Fe;(function(n){n.errToObj=a=>typeof a=="string"?{message:a}:a||{},n.toString=a=>typeof a=="string"?a:a==null?void 0:a.message})(Fe||(Fe={}));class Ji{constructor(a,i,l,u){this._cachedPath=[],this.parent=a,this.data=i,this._path=l,this._key=u}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}}const vb=(n,a)=>{if(yu(a))return{success:!0,data:a.value};if(!n.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const i=new Ws(n.common.issues);return this._error=i,this._error}}};function et(n){if(!n)return{};const{errorMap:a,invalid_type_error:i,required_error:l,description:u}=n;if(a&&(i||l))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return a?{errorMap:a,description:u}:{errorMap:(m,g)=>{const{message:b}=n;return m.code==="invalid_enum_value"?{message:b??g.defaultError}:typeof g.data>"u"?{message:b??l??g.defaultError}:m.code!=="invalid_type"?{message:g.defaultError}:{message:b??i??g.defaultError}},description:u}}class ct{get description(){return this._def.description}_getType(a){return Hi(a.data)}_getOrReturnCtx(a,i){return i||{common:a.parent.common,data:a.data,parsedType:Hi(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}_processInputParams(a){return{status:new oa,ctx:{common:a.parent.common,data:a.data,parsedType:Hi(a.data),schemaErrorMap:this._def.errorMap,path:a.path,parent:a.parent}}}_parseSync(a){const i=this._parse(a);if(ad(i))throw new Error("Synchronous parse encountered promise.");return i}_parseAsync(a){const i=this._parse(a);return Promise.resolve(i)}parse(a,i){const l=this.safeParse(a,i);if(l.success)return l.data;throw l.error}safeParse(a,i){const l={common:{issues:[],async:(i==null?void 0:i.async)??!1,contextualErrorMap:i==null?void 0:i.errorMap},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:Hi(a)},u=this._parseSync({data:a,path:l.path,parent:l});return vb(l,u)}"~validate"(a){var l,u;const i={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:Hi(a)};if(!this["~standard"].async)try{const o=this._parseSync({data:a,path:[],parent:i});return yu(o)?{value:o.value}:{issues:i.common.issues}}catch(o){(u=(l=o==null?void 0:o.message)==null?void 0:l.toLowerCase())!=null&&u.includes("encountered")&&(this["~standard"].async=!0),i.common={issues:[],async:!0}}return this._parseAsync({data:a,path:[],parent:i}).then(o=>yu(o)?{value:o.value}:{issues:i.common.issues})}async parseAsync(a,i){const l=await this.safeParseAsync(a,i);if(l.success)return l.data;throw l.error}async safeParseAsync(a,i){const l={common:{issues:[],contextualErrorMap:i==null?void 0:i.errorMap,async:!0},path:(i==null?void 0:i.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:a,parsedType:Hi(a)},u=this._parse({data:a,path:l.path,parent:l}),o=await(ad(u)?u:Promise.resolve(u));return vb(l,o)}refine(a,i){const l=u=>typeof i=="string"||typeof i>"u"?{message:i}:typeof i=="function"?i(u):i;return this._refinement((u,o)=>{const m=a(u),g=()=>o.addIssue({code:we.custom,...l(u)});return typeof Promise<"u"&&m instanceof Promise?m.then(b=>b?!0:(g(),!1)):m?!0:(g(),!1)})}refinement(a,i){return this._refinement((l,u)=>a(l)?!0:(u.addIssue(typeof i=="function"?i(l,u):i),!1))}_refinement(a){return new vu({schema:this,typeName:We.ZodEffects,effect:{type:"refinement",refinement:a}})}superRefine(a){return this._refinement(a)}constructor(a){this.spa=this.safeParseAsync,this._def=a,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:i=>this["~validate"](i)}}optional(){return Ki.create(this,this._def)}nullable(){return pu.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return hs.create(this)}promise(){return ld.create(this,this._def)}or(a){return id.create([this,a],this._def)}and(a){return rd.create(this,a,this._def)}transform(a){return new vu({...et(this._def),schema:this,typeName:We.ZodEffects,effect:{type:"transform",transform:a}})}default(a){const i=typeof a=="function"?a:()=>a;return new Ny({...et(this._def),innerType:this,defaultValue:i,typeName:We.ZodDefault})}brand(){return new fC({typeName:We.ZodBranded,type:this,...et(this._def)})}catch(a){const i=typeof a=="function"?a:()=>a;return new _y({...et(this._def),innerType:this,catchValue:i,typeName:We.ZodCatch})}describe(a){const i=this.constructor;return new i({...this._def,description:a})}pipe(a){return ig.create(this,a)}readonly(){return Oy.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const Zw=/^c[^\s-]{8,}$/i,$w=/^[0-9a-z]+$/,Yw=/^[0-9A-HJKMNP-TV-Z]{26}$/i,Iw=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Gw=/^[a-z0-9_-]{21}$/i,Xw=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,Qw=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,Ww=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Kw="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Fm;const Jw=/^(?:(?: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])$/,Pw=/^(?:(?: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])\/(3[0-2]|[12]?[0-9])$/,eC=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,tC=/^(([0-9a-fA-F]{1,4}:){7,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}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,nC=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aC=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Fx="((\\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])))",sC=new RegExp(`^${Fx}$`);function qx(n){let a="[0-5]\\d";n.precision?a=`${a}\\.\\d{${n.precision}}`:n.precision==null&&(a=`${a}(\\.\\d+)?`);const i=n.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${a})${i}`}function iC(n){return new RegExp(`^${qx(n)}$`)}function rC(n){let a=`${Fx}T${qx(n)}`;const i=[];return i.push(n.local?"Z?":"Z"),n.offset&&i.push("([+-]\\d{2}:?\\d{2})"),a=`${a}(${i.join("|")})`,new RegExp(`^${a}$`)}function lC(n,a){return!!((a==="v4"||!a)&&Jw.test(n)||(a==="v6"||!a)&&eC.test(n))}function uC(n,a){if(!Xw.test(n))return!1;try{const[i]=n.split(".");if(!i)return!1;const l=i.replace(/-/g,"+").replace(/_/g,"/").padEnd(i.length+(4-i.length%4)%4,"="),u=JSON.parse(atob(l));return!(typeof u!="object"||u===null||"typ"in u&&(u==null?void 0:u.typ)!=="JWT"||!u.alg||a&&u.alg!==a)}catch{return!1}}function oC(n,a){return!!((a==="v4"||!a)&&Pw.test(n)||(a==="v6"||!a)&&tC.test(n))}class Qi extends ct{_parse(a){if(this._def.coerce&&(a.data=String(a.data)),this._getType(a)!==He.string){const o=this._getOrReturnCtx(a);return je(o,{code:we.invalid_type,expected:He.string,received:o.parsedType}),Qe}const l=new oa;let u;for(const o of this._def.checks)if(o.kind==="min")a.data.length<o.value&&(u=this._getOrReturnCtx(a,u),je(u,{code:we.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),l.dirty());else if(o.kind==="max")a.data.length>o.value&&(u=this._getOrReturnCtx(a,u),je(u,{code:we.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!1,message:o.message}),l.dirty());else if(o.kind==="length"){const m=a.data.length>o.value,g=a.data.length<o.value;(m||g)&&(u=this._getOrReturnCtx(a,u),m?je(u,{code:we.too_big,maximum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}):g&&je(u,{code:we.too_small,minimum:o.value,type:"string",inclusive:!0,exact:!0,message:o.message}),l.dirty())}else if(o.kind==="email")Ww.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"email",code:we.invalid_string,message:o.message}),l.dirty());else if(o.kind==="emoji")Fm||(Fm=new RegExp(Kw,"u")),Fm.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"emoji",code:we.invalid_string,message:o.message}),l.dirty());else if(o.kind==="uuid")Iw.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"uuid",code:we.invalid_string,message:o.message}),l.dirty());else if(o.kind==="nanoid")Gw.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"nanoid",code:we.invalid_string,message:o.message}),l.dirty());else if(o.kind==="cuid")Zw.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"cuid",code:we.invalid_string,message:o.message}),l.dirty());else if(o.kind==="cuid2")$w.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"cuid2",code:we.invalid_string,message:o.message}),l.dirty());else if(o.kind==="ulid")Yw.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"ulid",code:we.invalid_string,message:o.message}),l.dirty());else if(o.kind==="url")try{new URL(a.data)}catch{u=this._getOrReturnCtx(a,u),je(u,{validation:"url",code:we.invalid_string,message:o.message}),l.dirty()}else o.kind==="regex"?(o.regex.lastIndex=0,o.regex.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"regex",code:we.invalid_string,message:o.message}),l.dirty())):o.kind==="trim"?a.data=a.data.trim():o.kind==="includes"?a.data.includes(o.value,o.position)||(u=this._getOrReturnCtx(a,u),je(u,{code:we.invalid_string,validation:{includes:o.value,position:o.position},message:o.message}),l.dirty()):o.kind==="toLowerCase"?a.data=a.data.toLowerCase():o.kind==="toUpperCase"?a.data=a.data.toUpperCase():o.kind==="startsWith"?a.data.startsWith(o.value)||(u=this._getOrReturnCtx(a,u),je(u,{code:we.invalid_string,validation:{startsWith:o.value},message:o.message}),l.dirty()):o.kind==="endsWith"?a.data.endsWith(o.value)||(u=this._getOrReturnCtx(a,u),je(u,{code:we.invalid_string,validation:{endsWith:o.value},message:o.message}),l.dirty()):o.kind==="datetime"?rC(o).test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{code:we.invalid_string,validation:"datetime",message:o.message}),l.dirty()):o.kind==="date"?sC.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{code:we.invalid_string,validation:"date",message:o.message}),l.dirty()):o.kind==="time"?iC(o).test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{code:we.invalid_string,validation:"time",message:o.message}),l.dirty()):o.kind==="duration"?Qw.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"duration",code:we.invalid_string,message:o.message}),l.dirty()):o.kind==="ip"?lC(a.data,o.version)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"ip",code:we.invalid_string,message:o.message}),l.dirty()):o.kind==="jwt"?uC(a.data,o.alg)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"jwt",code:we.invalid_string,message:o.message}),l.dirty()):o.kind==="cidr"?oC(a.data,o.version)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"cidr",code:we.invalid_string,message:o.message}),l.dirty()):o.kind==="base64"?nC.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"base64",code:we.invalid_string,message:o.message}),l.dirty()):o.kind==="base64url"?aC.test(a.data)||(u=this._getOrReturnCtx(a,u),je(u,{validation:"base64url",code:we.invalid_string,message:o.message}),l.dirty()):mt.assertNever(o);return{status:l.value,value:a.data}}_regex(a,i,l){return this.refinement(u=>a.test(u),{validation:i,code:we.invalid_string,...Fe.errToObj(l)})}_addCheck(a){return new Qi({...this._def,checks:[...this._def.checks,a]})}email(a){return this._addCheck({kind:"email",...Fe.errToObj(a)})}url(a){return this._addCheck({kind:"url",...Fe.errToObj(a)})}emoji(a){return this._addCheck({kind:"emoji",...Fe.errToObj(a)})}uuid(a){return this._addCheck({kind:"uuid",...Fe.errToObj(a)})}nanoid(a){return this._addCheck({kind:"nanoid",...Fe.errToObj(a)})}cuid(a){return this._addCheck({kind:"cuid",...Fe.errToObj(a)})}cuid2(a){return this._addCheck({kind:"cuid2",...Fe.errToObj(a)})}ulid(a){return this._addCheck({kind:"ulid",...Fe.errToObj(a)})}base64(a){return this._addCheck({kind:"base64",...Fe.errToObj(a)})}base64url(a){return this._addCheck({kind:"base64url",...Fe.errToObj(a)})}jwt(a){return this._addCheck({kind:"jwt",...Fe.errToObj(a)})}ip(a){return this._addCheck({kind:"ip",...Fe.errToObj(a)})}cidr(a){return this._addCheck({kind:"cidr",...Fe.errToObj(a)})}datetime(a){return typeof a=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:a}):this._addCheck({kind:"datetime",precision:typeof(a==null?void 0:a.precision)>"u"?null:a==null?void 0:a.precision,offset:(a==null?void 0:a.offset)??!1,local:(a==null?void 0:a.local)??!1,...Fe.errToObj(a==null?void 0:a.message)})}date(a){return this._addCheck({kind:"date",message:a})}time(a){return typeof a=="string"?this._addCheck({kind:"time",precision:null,message:a}):this._addCheck({kind:"time",precision:typeof(a==null?void 0:a.precision)>"u"?null:a==null?void 0:a.precision,...Fe.errToObj(a==null?void 0:a.message)})}duration(a){return this._addCheck({kind:"duration",...Fe.errToObj(a)})}regex(a,i){return this._addCheck({kind:"regex",regex:a,...Fe.errToObj(i)})}includes(a,i){return this._addCheck({kind:"includes",value:a,position:i==null?void 0:i.position,...Fe.errToObj(i==null?void 0:i.message)})}startsWith(a,i){return this._addCheck({kind:"startsWith",value:a,...Fe.errToObj(i)})}endsWith(a,i){return this._addCheck({kind:"endsWith",value:a,...Fe.errToObj(i)})}min(a,i){return this._addCheck({kind:"min",value:a,...Fe.errToObj(i)})}max(a,i){return this._addCheck({kind:"max",value:a,...Fe.errToObj(i)})}length(a,i){return this._addCheck({kind:"length",value:a,...Fe.errToObj(i)})}nonempty(a){return this.min(1,Fe.errToObj(a))}trim(){return new Qi({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Qi({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Qi({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(a=>a.kind==="datetime")}get isDate(){return!!this._def.checks.find(a=>a.kind==="date")}get isTime(){return!!this._def.checks.find(a=>a.kind==="time")}get isDuration(){return!!this._def.checks.find(a=>a.kind==="duration")}get isEmail(){return!!this._def.checks.find(a=>a.kind==="email")}get isURL(){return!!this._def.checks.find(a=>a.kind==="url")}get isEmoji(){return!!this._def.checks.find(a=>a.kind==="emoji")}get isUUID(){return!!this._def.checks.find(a=>a.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(a=>a.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(a=>a.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(a=>a.kind==="cuid2")}get isULID(){return!!this._def.checks.find(a=>a.kind==="ulid")}get isIP(){return!!this._def.checks.find(a=>a.kind==="ip")}get isCIDR(){return!!this._def.checks.find(a=>a.kind==="cidr")}get isBase64(){return!!this._def.checks.find(a=>a.kind==="base64")}get isBase64url(){return!!this._def.checks.find(a=>a.kind==="base64url")}get minLength(){let a=null;for(const i of this._def.checks)i.kind==="min"&&(a===null||i.value>a)&&(a=i.value);return a}get maxLength(){let a=null;for(const i of this._def.checks)i.kind==="max"&&(a===null||i.value<a)&&(a=i.value);return a}}Qi.create=n=>new Qi({checks:[],typeName:We.ZodString,coerce:(n==null?void 0:n.coerce)??!1,...et(n)});function cC(n,a){const i=(n.toString().split(".")[1]||"").length,l=(a.toString().split(".")[1]||"").length,u=i>l?i:l,o=Number.parseInt(n.toFixed(u).replace(".","")),m=Number.parseInt(a.toFixed(u).replace(".",""));return o%m/10**u}class Io extends ct{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(a){if(this._def.coerce&&(a.data=Number(a.data)),this._getType(a)!==He.number){const o=this._getOrReturnCtx(a);return je(o,{code:we.invalid_type,expected:He.number,received:o.parsedType}),Qe}let l;const u=new oa;for(const o of this._def.checks)o.kind==="int"?mt.isInteger(a.data)||(l=this._getOrReturnCtx(a,l),je(l,{code:we.invalid_type,expected:"integer",received:"float",message:o.message}),u.dirty()):o.kind==="min"?(o.inclusive?a.data<o.value:a.data<=o.value)&&(l=this._getOrReturnCtx(a,l),je(l,{code:we.too_small,minimum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),u.dirty()):o.kind==="max"?(o.inclusive?a.data>o.value:a.data>=o.value)&&(l=this._getOrReturnCtx(a,l),je(l,{code:we.too_big,maximum:o.value,type:"number",inclusive:o.inclusive,exact:!1,message:o.message}),u.dirty()):o.kind==="multipleOf"?cC(a.data,o.value)!==0&&(l=this._getOrReturnCtx(a,l),je(l,{code:we.not_multiple_of,multipleOf:o.value,message:o.message}),u.dirty()):o.kind==="finite"?Number.isFinite(a.data)||(l=this._getOrReturnCtx(a,l),je(l,{code:we.not_finite,message:o.message}),u.dirty()):mt.assertNever(o);return{status:u.value,value:a.data}}gte(a,i){return this.setLimit("min",a,!0,Fe.toString(i))}gt(a,i){return this.setLimit("min",a,!1,Fe.toString(i))}lte(a,i){return this.setLimit("max",a,!0,Fe.toString(i))}lt(a,i){return this.setLimit("max",a,!1,Fe.toString(i))}setLimit(a,i,l,u){return new Io({...this._def,checks:[...this._def.checks,{kind:a,value:i,inclusive:l,message:Fe.toString(u)}]})}_addCheck(a){return new Io({...this._def,checks:[...this._def.checks,a]})}int(a){return this._addCheck({kind:"int",message:Fe.toString(a)})}positive(a){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Fe.toString(a)})}negative(a){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Fe.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Fe.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Fe.toString(a)})}multipleOf(a,i){return this._addCheck({kind:"multipleOf",value:a,message:Fe.toString(i)})}finite(a){return this._addCheck({kind:"finite",message:Fe.toString(a)})}safe(a){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Fe.toString(a)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Fe.toString(a)})}get minValue(){let a=null;for(const i of this._def.checks)i.kind==="min"&&(a===null||i.value>a)&&(a=i.value);return a}get maxValue(){let a=null;for(const i of this._def.checks)i.kind==="max"&&(a===null||i.value<a)&&(a=i.value);return a}get isInt(){return!!this._def.checks.find(a=>a.kind==="int"||a.kind==="multipleOf"&&mt.isInteger(a.value))}get isFinite(){let a=null,i=null;for(const l of this._def.checks){if(l.kind==="finite"||l.kind==="int"||l.kind==="multipleOf")return!0;l.kind==="min"?(i===null||l.value>i)&&(i=l.value):l.kind==="max"&&(a===null||l.value<a)&&(a=l.value)}return Number.isFinite(i)&&Number.isFinite(a)}}Io.create=n=>new Io({checks:[],typeName:We.ZodNumber,coerce:(n==null?void 0:n.coerce)||!1,...et(n)});class Go extends ct{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(a){if(this._def.coerce)try{a.data=BigInt(a.data)}catch{return this._getInvalidInput(a)}if(this._getType(a)!==He.bigint)return this._getInvalidInput(a);let l;const u=new oa;for(const o of this._def.checks)o.kind==="min"?(o.inclusive?a.data<o.value:a.data<=o.value)&&(l=this._getOrReturnCtx(a,l),je(l,{code:we.too_small,type:"bigint",minimum:o.value,inclusive:o.inclusive,message:o.message}),u.dirty()):o.kind==="max"?(o.inclusive?a.data>o.value:a.data>=o.value)&&(l=this._getOrReturnCtx(a,l),je(l,{code:we.too_big,type:"bigint",maximum:o.value,inclusive:o.inclusive,message:o.message}),u.dirty()):o.kind==="multipleOf"?a.data%o.value!==BigInt(0)&&(l=this._getOrReturnCtx(a,l),je(l,{code:we.not_multiple_of,multipleOf:o.value,message:o.message}),u.dirty()):mt.assertNever(o);return{status:u.value,value:a.data}}_getInvalidInput(a){const i=this._getOrReturnCtx(a);return je(i,{code:we.invalid_type,expected:He.bigint,received:i.parsedType}),Qe}gte(a,i){return this.setLimit("min",a,!0,Fe.toString(i))}gt(a,i){return this.setLimit("min",a,!1,Fe.toString(i))}lte(a,i){return this.setLimit("max",a,!0,Fe.toString(i))}lt(a,i){return this.setLimit("max",a,!1,Fe.toString(i))}setLimit(a,i,l,u){return new Go({...this._def,checks:[...this._def.checks,{kind:a,value:i,inclusive:l,message:Fe.toString(u)}]})}_addCheck(a){return new Go({...this._def,checks:[...this._def.checks,a]})}positive(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Fe.toString(a)})}negative(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Fe.toString(a)})}nonpositive(a){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Fe.toString(a)})}nonnegative(a){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Fe.toString(a)})}multipleOf(a,i){return this._addCheck({kind:"multipleOf",value:a,message:Fe.toString(i)})}get minValue(){let a=null;for(const i of this._def.checks)i.kind==="min"&&(a===null||i.value>a)&&(a=i.value);return a}get maxValue(){let a=null;for(const i of this._def.checks)i.kind==="max"&&(a===null||i.value<a)&&(a=i.value);return a}}Go.create=n=>new Go({checks:[],typeName:We.ZodBigInt,coerce:(n==null?void 0:n.coerce)??!1,...et(n)});class pb extends ct{_parse(a){if(this._def.coerce&&(a.data=!!a.data),this._getType(a)!==He.boolean){const l=this._getOrReturnCtx(a);return je(l,{code:we.invalid_type,expected:He.boolean,received:l.parsedType}),Qe}return Ca(a.data)}}pb.create=n=>new pb({typeName:We.ZodBoolean,coerce:(n==null?void 0:n.coerce)||!1,...et(n)});class sd extends ct{_parse(a){if(this._def.coerce&&(a.data=new Date(a.data)),this._getType(a)!==He.date){const o=this._getOrReturnCtx(a);return je(o,{code:we.invalid_type,expected:He.date,received:o.parsedType}),Qe}if(Number.isNaN(a.data.getTime())){const o=this._getOrReturnCtx(a);return je(o,{code:we.invalid_date}),Qe}const l=new oa;let u;for(const o of this._def.checks)o.kind==="min"?a.data.getTime()<o.value&&(u=this._getOrReturnCtx(a,u),je(u,{code:we.too_small,message:o.message,inclusive:!0,exact:!1,minimum:o.value,type:"date"}),l.dirty()):o.kind==="max"?a.data.getTime()>o.value&&(u=this._getOrReturnCtx(a,u),je(u,{code:we.too_big,message:o.message,inclusive:!0,exact:!1,maximum:o.value,type:"date"}),l.dirty()):mt.assertNever(o);return{status:l.value,value:new Date(a.data.getTime())}}_addCheck(a){return new sd({...this._def,checks:[...this._def.checks,a]})}min(a,i){return this._addCheck({kind:"min",value:a.getTime(),message:Fe.toString(i)})}max(a,i){return this._addCheck({kind:"max",value:a.getTime(),message:Fe.toString(i)})}get minDate(){let a=null;for(const i of this._def.checks)i.kind==="min"&&(a===null||i.value>a)&&(a=i.value);return a!=null?new Date(a):null}get maxDate(){let a=null;for(const i of this._def.checks)i.kind==="max"&&(a===null||i.value<a)&&(a=i.value);return a!=null?new Date(a):null}}sd.create=n=>new sd({checks:[],coerce:(n==null?void 0:n.coerce)||!1,typeName:We.ZodDate,...et(n)});class bb extends ct{_parse(a){if(this._getType(a)!==He.symbol){const l=this._getOrReturnCtx(a);return je(l,{code:we.invalid_type,expected:He.symbol,received:l.parsedType}),Qe}return Ca(a.data)}}bb.create=n=>new bb({typeName:We.ZodSymbol,...et(n)});class Sb extends ct{_parse(a){if(this._getType(a)!==He.undefined){const l=this._getOrReturnCtx(a);return je(l,{code:we.invalid_type,expected:He.undefined,received:l.parsedType}),Qe}return Ca(a.data)}}Sb.create=n=>new Sb({typeName:We.ZodUndefined,...et(n)});class xb extends ct{_parse(a){if(this._getType(a)!==He.null){const l=this._getOrReturnCtx(a);return je(l,{code:we.invalid_type,expected:He.null,received:l.parsedType}),Qe}return Ca(a.data)}}xb.create=n=>new xb({typeName:We.ZodNull,...et(n)});class Eb extends ct{constructor(){super(...arguments),this._any=!0}_parse(a){return Ca(a.data)}}Eb.create=n=>new Eb({typeName:We.ZodAny,...et(n)});class Tb extends ct{constructor(){super(...arguments),this._unknown=!0}_parse(a){return Ca(a.data)}}Tb.create=n=>new Tb({typeName:We.ZodUnknown,...et(n)});class Pi extends ct{_parse(a){const i=this._getOrReturnCtx(a);return je(i,{code:we.invalid_type,expected:He.never,received:i.parsedType}),Qe}}Pi.create=n=>new Pi({typeName:We.ZodNever,...et(n)});class Nb extends ct{_parse(a){if(this._getType(a)!==He.undefined){const l=this._getOrReturnCtx(a);return je(l,{code:we.invalid_type,expected:He.void,received:l.parsedType}),Qe}return Ca(a.data)}}Nb.create=n=>new Nb({typeName:We.ZodVoid,...et(n)});class hs extends ct{_parse(a){const{ctx:i,status:l}=this._processInputParams(a),u=this._def;if(i.parsedType!==He.array)return je(i,{code:we.invalid_type,expected:He.array,received:i.parsedType}),Qe;if(u.exactLength!==null){const m=i.data.length>u.exactLength.value,g=i.data.length<u.exactLength.value;(m||g)&&(je(i,{code:m?we.too_big:we.too_small,minimum:g?u.exactLength.value:void 0,maximum:m?u.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:u.exactLength.message}),l.dirty())}if(u.minLength!==null&&i.data.length<u.minLength.value&&(je(i,{code:we.too_small,minimum:u.minLength.value,type:"array",inclusive:!0,exact:!1,message:u.minLength.message}),l.dirty()),u.maxLength!==null&&i.data.length>u.maxLength.value&&(je(i,{code:we.too_big,maximum:u.maxLength.value,type:"array",inclusive:!0,exact:!1,message:u.maxLength.message}),l.dirty()),i.common.async)return Promise.all([...i.data].map((m,g)=>u.type._parseAsync(new Ji(i,m,i.path,g)))).then(m=>oa.mergeArray(l,m));const o=[...i.data].map((m,g)=>u.type._parseSync(new Ji(i,m,i.path,g)));return oa.mergeArray(l,o)}get element(){return this._def.type}min(a,i){return new hs({...this._def,minLength:{value:a,message:Fe.toString(i)}})}max(a,i){return new hs({...this._def,maxLength:{value:a,message:Fe.toString(i)}})}length(a,i){return new hs({...this._def,exactLength:{value:a,message:Fe.toString(i)}})}nonempty(a){return this.min(1,a)}}hs.create=(n,a)=>new hs({type:n,minLength:null,maxLength:null,exactLength:null,typeName:We.ZodArray,...et(a)});function Kl(n){if(n instanceof sn){const a={};for(const i in n.shape){const l=n.shape[i];a[i]=Ki.create(Kl(l))}return new sn({...n._def,shape:()=>a})}else return n instanceof hs?new hs({...n._def,type:Kl(n.element)}):n instanceof Ki?Ki.create(Kl(n.unwrap())):n instanceof pu?pu.create(Kl(n.unwrap())):n instanceof tl?tl.create(n.items.map(a=>Kl(a))):n}class sn extends ct{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const a=this._def.shape(),i=mt.objectKeys(a);return this._cached={shape:a,keys:i},this._cached}_parse(a){if(this._getType(a)!==He.object){const y=this._getOrReturnCtx(a);return je(y,{code:we.invalid_type,expected:He.object,received:y.parsedType}),Qe}const{status:l,ctx:u}=this._processInputParams(a),{shape:o,keys:m}=this._getCached(),g=[];if(!(this._def.catchall instanceof Pi&&this._def.unknownKeys==="strip"))for(const y in u.data)m.includes(y)||g.push(y);const b=[];for(const y of m){const _=o[y],w=u.data[y];b.push({key:{status:"valid",value:y},value:_._parse(new Ji(u,w,u.path,y)),alwaysSet:y in u.data})}if(this._def.catchall instanceof Pi){const y=this._def.unknownKeys;if(y==="passthrough")for(const _ of g)b.push({key:{status:"valid",value:_},value:{status:"valid",value:u.data[_]}});else if(y==="strict")g.length>0&&(je(u,{code:we.unrecognized_keys,keys:g}),l.dirty());else if(y!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const y=this._def.catchall;for(const _ of g){const w=u.data[_];b.push({key:{status:"valid",value:_},value:y._parse(new Ji(u,w,u.path,_)),alwaysSet:_ in u.data})}}return u.common.async?Promise.resolve().then(async()=>{const y=[];for(const _ of b){const w=await _.key,T=await _.value;y.push({key:w,value:T,alwaysSet:_.alwaysSet})}return y}).then(y=>oa.mergeObjectSync(l,y)):oa.mergeObjectSync(l,b)}get shape(){return this._def.shape()}strict(a){return Fe.errToObj,new sn({...this._def,unknownKeys:"strict",...a!==void 0?{errorMap:(i,l)=>{var o,m;const u=((m=(o=this._def).errorMap)==null?void 0:m.call(o,i,l).message)??l.defaultError;return i.code==="unrecognized_keys"?{message:Fe.errToObj(a).message??u}:{message:u}}}:{}})}strip(){return new sn({...this._def,unknownKeys:"strip"})}passthrough(){return new sn({...this._def,unknownKeys:"passthrough"})}extend(a){return new sn({...this._def,shape:()=>({...this._def.shape(),...a})})}merge(a){return new sn({unknownKeys:a._def.unknownKeys,catchall:a._def.catchall,shape:()=>({...this._def.shape(),...a._def.shape()}),typeName:We.ZodObject})}setKey(a,i){return this.augment({[a]:i})}catchall(a){return new sn({...this._def,catchall:a})}pick(a){const i={};for(const l of mt.objectKeys(a))a[l]&&this.shape[l]&&(i[l]=this.shape[l]);return new sn({...this._def,shape:()=>i})}omit(a){const i={};for(const l of mt.objectKeys(this.shape))a[l]||(i[l]=this.shape[l]);return new sn({...this._def,shape:()=>i})}deepPartial(){return Kl(this)}partial(a){const i={};for(const l of mt.objectKeys(this.shape)){const u=this.shape[l];a&&!a[l]?i[l]=u:i[l]=u.optional()}return new sn({...this._def,shape:()=>i})}required(a){const i={};for(const l of mt.objectKeys(this.shape))if(a&&!a[l])i[l]=this.shape[l];else{let o=this.shape[l];for(;o instanceof Ki;)o=o._def.innerType;i[l]=o}return new sn({...this._def,shape:()=>i})}keyof(){return Bx(mt.objectKeys(this.shape))}}sn.create=(n,a)=>new sn({shape:()=>n,unknownKeys:"strip",catchall:Pi.create(),typeName:We.ZodObject,...et(a)});sn.strictCreate=(n,a)=>new sn({shape:()=>n,unknownKeys:"strict",catchall:Pi.create(),typeName:We.ZodObject,...et(a)});sn.lazycreate=(n,a)=>new sn({shape:n,unknownKeys:"strip",catchall:Pi.create(),typeName:We.ZodObject,...et(a)});class id extends ct{_parse(a){const{ctx:i}=this._processInputParams(a),l=this._def.options;function u(o){for(const g of o)if(g.result.status==="valid")return g.result;for(const g of o)if(g.result.status==="dirty")return i.common.issues.push(...g.ctx.common.issues),g.result;const m=o.map(g=>new Ws(g.ctx.common.issues));return je(i,{code:we.invalid_union,unionErrors:m}),Qe}if(i.common.async)return Promise.all(l.map(async o=>{const m={...i,common:{...i.common,issues:[]},parent:null};return{result:await o._parseAsync({data:i.data,path:i.path,parent:m}),ctx:m}})).then(u);{let o;const m=[];for(const b of l){const y={...i,common:{...i.common,issues:[]},parent:null},_=b._parseSync({data:i.data,path:i.path,parent:y});if(_.status==="valid")return _;_.status==="dirty"&&!o&&(o={result:_,ctx:y}),y.common.issues.length&&m.push(y.common.issues)}if(o)return i.common.issues.push(...o.ctx.common.issues),o.result;const g=m.map(b=>new Ws(b));return je(i,{code:we.invalid_union,unionErrors:g}),Qe}}get options(){return this._def.options}}id.create=(n,a)=>new id({options:n,typeName:We.ZodUnion,...et(a)});function Ty(n,a){const i=Hi(n),l=Hi(a);if(n===a)return{valid:!0,data:n};if(i===He.object&&l===He.object){const u=mt.objectKeys(a),o=mt.objectKeys(n).filter(g=>u.indexOf(g)!==-1),m={...n,...a};for(const g of o){const b=Ty(n[g],a[g]);if(!b.valid)return{valid:!1};m[g]=b.data}return{valid:!0,data:m}}else if(i===He.array&&l===He.array){if(n.length!==a.length)return{valid:!1};const u=[];for(let o=0;o<n.length;o++){const m=n[o],g=a[o],b=Ty(m,g);if(!b.valid)return{valid:!1};u.push(b.data)}return{valid:!0,data:u}}else return i===He.date&&l===He.date&&+n==+a?{valid:!0,data:n}:{valid:!1}}class rd extends ct{_parse(a){const{status:i,ctx:l}=this._processInputParams(a),u=(o,m)=>{if(yb(o)||yb(m))return Qe;const g=Ty(o.value,m.value);return g.valid?((gb(o)||gb(m))&&i.dirty(),{status:i.value,value:g.data}):(je(l,{code:we.invalid_intersection_types}),Qe)};return l.common.async?Promise.all([this._def.left._parseAsync({data:l.data,path:l.path,parent:l}),this._def.right._parseAsync({data:l.data,path:l.path,parent:l})]).then(([o,m])=>u(o,m)):u(this._def.left._parseSync({data:l.data,path:l.path,parent:l}),this._def.right._parseSync({data:l.data,path:l.path,parent:l}))}}rd.create=(n,a,i)=>new rd({left:n,right:a,typeName:We.ZodIntersection,...et(i)});class tl extends ct{_parse(a){const{status:i,ctx:l}=this._processInputParams(a);if(l.parsedType!==He.array)return je(l,{code:we.invalid_type,expected:He.array,received:l.parsedType}),Qe;if(l.data.length<this._def.items.length)return je(l,{code:we.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Qe;!this._def.rest&&l.data.length>this._def.items.length&&(je(l,{code:we.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),i.dirty());const o=[...l.data].map((m,g)=>{const b=this._def.items[g]||this._def.rest;return b?b._parse(new Ji(l,m,l.path,g)):null}).filter(m=>!!m);return l.common.async?Promise.all(o).then(m=>oa.mergeArray(i,m)):oa.mergeArray(i,o)}get items(){return this._def.items}rest(a){return new tl({...this._def,rest:a})}}tl.create=(n,a)=>{if(!Array.isArray(n))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new tl({items:n,typeName:We.ZodTuple,rest:null,...et(a)})};class _b extends ct{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(a){const{status:i,ctx:l}=this._processInputParams(a);if(l.parsedType!==He.map)return je(l,{code:we.invalid_type,expected:He.map,received:l.parsedType}),Qe;const u=this._def.keyType,o=this._def.valueType,m=[...l.data.entries()].map(([g,b],y)=>({key:u._parse(new Ji(l,g,l.path,[y,"key"])),value:o._parse(new Ji(l,b,l.path,[y,"value"]))}));if(l.common.async){const g=new Map;return Promise.resolve().then(async()=>{for(const b of m){const y=await b.key,_=await b.value;if(y.status==="aborted"||_.status==="aborted")return Qe;(y.status==="dirty"||_.status==="dirty")&&i.dirty(),g.set(y.value,_.value)}return{status:i.value,value:g}})}else{const g=new Map;for(const b of m){const y=b.key,_=b.value;if(y.status==="aborted"||_.status==="aborted")return Qe;(y.status==="dirty"||_.status==="dirty")&&i.dirty(),g.set(y.value,_.value)}return{status:i.value,value:g}}}}_b.create=(n,a,i)=>new _b({valueType:a,keyType:n,typeName:We.ZodMap,...et(i)});class Xo extends ct{_parse(a){const{status:i,ctx:l}=this._processInputParams(a);if(l.parsedType!==He.set)return je(l,{code:we.invalid_type,expected:He.set,received:l.parsedType}),Qe;const u=this._def;u.minSize!==null&&l.data.size<u.minSize.value&&(je(l,{code:we.too_small,minimum:u.minSize.value,type:"set",inclusive:!0,exact:!1,message:u.minSize.message}),i.dirty()),u.maxSize!==null&&l.data.size>u.maxSize.value&&(je(l,{code:we.too_big,maximum:u.maxSize.value,type:"set",inclusive:!0,exact:!1,message:u.maxSize.message}),i.dirty());const o=this._def.valueType;function m(b){const y=new Set;for(const _ of b){if(_.status==="aborted")return Qe;_.status==="dirty"&&i.dirty(),y.add(_.value)}return{status:i.value,value:y}}const g=[...l.data.values()].map((b,y)=>o._parse(new Ji(l,b,l.path,y)));return l.common.async?Promise.all(g).then(b=>m(b)):m(g)}min(a,i){return new Xo({...this._def,minSize:{value:a,message:Fe.toString(i)}})}max(a,i){return new Xo({...this._def,maxSize:{value:a,message:Fe.toString(i)}})}size(a,i){return this.min(a,i).max(a,i)}nonempty(a){return this.min(1,a)}}Xo.create=(n,a)=>new Xo({valueType:n,minSize:null,maxSize:null,typeName:We.ZodSet,...et(a)});class Ob extends ct{get schema(){return this._def.getter()}_parse(a){const{ctx:i}=this._processInputParams(a);return this._def.getter()._parse({data:i.data,path:i.path,parent:i})}}Ob.create=(n,a)=>new Ob({getter:n,typeName:We.ZodLazy,...et(a)});class wb extends ct{_parse(a){if(a.data!==this._def.value){const i=this._getOrReturnCtx(a);return je(i,{received:i.data,code:we.invalid_literal,expected:this._def.value}),Qe}return{status:"valid",value:a.data}}get value(){return this._def.value}}wb.create=(n,a)=>new wb({value:n,typeName:We.ZodLiteral,...et(a)});function Bx(n,a){return new gu({values:n,typeName:We.ZodEnum,...et(a)})}class gu extends ct{_parse(a){if(typeof a.data!="string"){const i=this._getOrReturnCtx(a),l=this._def.values;return je(i,{expected:mt.joinValues(l),received:i.parsedType,code:we.invalid_type}),Qe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(a.data)){const i=this._getOrReturnCtx(a),l=this._def.values;return je(i,{received:i.data,code:we.invalid_enum_value,options:l}),Qe}return Ca(a.data)}get options(){return this._def.values}get enum(){const a={};for(const i of this._def.values)a[i]=i;return a}get Values(){const a={};for(const i of this._def.values)a[i]=i;return a}get Enum(){const a={};for(const i of this._def.values)a[i]=i;return a}extract(a,i=this._def){return gu.create(a,{...this._def,...i})}exclude(a,i=this._def){return gu.create(this.options.filter(l=>!a.includes(l)),{...this._def,...i})}}gu.create=Bx;class Cb extends ct{_parse(a){const i=mt.getValidEnumValues(this._def.values),l=this._getOrReturnCtx(a);if(l.parsedType!==He.string&&l.parsedType!==He.number){const u=mt.objectValues(i);return je(l,{expected:mt.joinValues(u),received:l.parsedType,code:we.invalid_type}),Qe}if(this._cache||(this._cache=new Set(mt.getValidEnumValues(this._def.values))),!this._cache.has(a.data)){const u=mt.objectValues(i);return je(l,{received:l.data,code:we.invalid_enum_value,options:u}),Qe}return Ca(a.data)}get enum(){return this._def.values}}Cb.create=(n,a)=>new Cb({values:n,typeName:We.ZodNativeEnum,...et(a)});class ld extends ct{unwrap(){return this._def.type}_parse(a){const{ctx:i}=this._processInputParams(a);if(i.parsedType!==He.promise&&i.common.async===!1)return je(i,{code:we.invalid_type,expected:He.promise,received:i.parsedType}),Qe;const l=i.parsedType===He.promise?i.data:Promise.resolve(i.data);return Ca(l.then(u=>this._def.type.parseAsync(u,{path:i.path,errorMap:i.common.contextualErrorMap})))}}ld.create=(n,a)=>new ld({type:n,typeName:We.ZodPromise,...et(a)});class vu extends ct{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===We.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(a){const{status:i,ctx:l}=this._processInputParams(a),u=this._def.effect||null,o={addIssue:m=>{je(l,m),m.fatal?i.abort():i.dirty()},get path(){return l.path}};if(o.addIssue=o.addIssue.bind(o),u.type==="preprocess"){const m=u.transform(l.data,o);if(l.common.async)return Promise.resolve(m).then(async g=>{if(i.value==="aborted")return Qe;const b=await this._def.schema._parseAsync({data:g,path:l.path,parent:l});return b.status==="aborted"?Qe:b.status==="dirty"||i.value==="dirty"?qo(b.value):b});{if(i.value==="aborted")return Qe;const g=this._def.schema._parseSync({data:m,path:l.path,parent:l});return g.status==="aborted"?Qe:g.status==="dirty"||i.value==="dirty"?qo(g.value):g}}if(u.type==="refinement"){const m=g=>{const b=u.refinement(g,o);if(l.common.async)return Promise.resolve(b);if(b instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return g};if(l.common.async===!1){const g=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});return g.status==="aborted"?Qe:(g.status==="dirty"&&i.dirty(),m(g.value),{status:i.value,value:g.value})}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(g=>g.status==="aborted"?Qe:(g.status==="dirty"&&i.dirty(),m(g.value).then(()=>({status:i.value,value:g.value}))))}if(u.type==="transform")if(l.common.async===!1){const m=this._def.schema._parseSync({data:l.data,path:l.path,parent:l});if(!yu(m))return Qe;const g=u.transform(m.value,o);if(g instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:i.value,value:g}}else return this._def.schema._parseAsync({data:l.data,path:l.path,parent:l}).then(m=>yu(m)?Promise.resolve(u.transform(m.value,o)).then(g=>({status:i.value,value:g})):Qe);mt.assertNever(u)}}vu.create=(n,a,i)=>new vu({schema:n,typeName:We.ZodEffects,effect:a,...et(i)});vu.createWithPreprocess=(n,a,i)=>new vu({schema:a,effect:{type:"preprocess",transform:n},typeName:We.ZodEffects,...et(i)});class Ki extends ct{_parse(a){return this._getType(a)===He.undefined?Ca(void 0):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}Ki.create=(n,a)=>new Ki({innerType:n,typeName:We.ZodOptional,...et(a)});class pu extends ct{_parse(a){return this._getType(a)===He.null?Ca(null):this._def.innerType._parse(a)}unwrap(){return this._def.innerType}}pu.create=(n,a)=>new pu({innerType:n,typeName:We.ZodNullable,...et(a)});class Ny extends ct{_parse(a){const{ctx:i}=this._processInputParams(a);let l=i.data;return i.parsedType===He.undefined&&(l=this._def.defaultValue()),this._def.innerType._parse({data:l,path:i.path,parent:i})}removeDefault(){return this._def.innerType}}Ny.create=(n,a)=>new Ny({innerType:n,typeName:We.ZodDefault,defaultValue:typeof a.default=="function"?a.default:()=>a.default,...et(a)});class _y extends ct{_parse(a){const{ctx:i}=this._processInputParams(a),l={...i,common:{...i.common,issues:[]}},u=this._def.innerType._parse({data:l.data,path:l.path,parent:{...l}});return ad(u)?u.then(o=>({status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Ws(l.common.issues)},input:l.data})})):{status:"valid",value:u.status==="valid"?u.value:this._def.catchValue({get error(){return new Ws(l.common.issues)},input:l.data})}}removeCatch(){return this._def.innerType}}_y.create=(n,a)=>new _y({innerType:n,typeName:We.ZodCatch,catchValue:typeof a.catch=="function"?a.catch:()=>a.catch,...et(a)});class Mb extends ct{_parse(a){if(this._getType(a)!==He.nan){const l=this._getOrReturnCtx(a);return je(l,{code:we.invalid_type,expected:He.nan,received:l.parsedType}),Qe}return{status:"valid",value:a.data}}}Mb.create=n=>new Mb({typeName:We.ZodNaN,...et(n)});class fC extends ct{_parse(a){const{ctx:i}=this._processInputParams(a),l=i.data;return this._def.type._parse({data:l,path:i.path,parent:i})}unwrap(){return this._def.type}}class ig extends ct{_parse(a){const{status:i,ctx:l}=this._processInputParams(a);if(l.common.async)return(async()=>{const o=await this._def.in._parseAsync({data:l.data,path:l.path,parent:l});return o.status==="aborted"?Qe:o.status==="dirty"?(i.dirty(),qo(o.value)):this._def.out._parseAsync({data:o.value,path:l.path,parent:l})})();{const u=this._def.in._parseSync({data:l.data,path:l.path,parent:l});return u.status==="aborted"?Qe:u.status==="dirty"?(i.dirty(),{status:"dirty",value:u.value}):this._def.out._parseSync({data:u.value,path:l.path,parent:l})}}static create(a,i){return new ig({in:a,out:i,typeName:We.ZodPipeline})}}class Oy extends ct{_parse(a){const i=this._def.innerType._parse(a),l=u=>(yu(u)&&(u.value=Object.freeze(u.value)),u);return ad(i)?i.then(u=>l(u)):l(i)}unwrap(){return this._def.innerType}}Oy.create=(n,a)=>new Oy({innerType:n,typeName:We.ZodReadonly,...et(a)});var We;(function(n){n.ZodString="ZodString",n.ZodNumber="ZodNumber",n.ZodNaN="ZodNaN",n.ZodBigInt="ZodBigInt",n.ZodBoolean="ZodBoolean",n.ZodDate="ZodDate",n.ZodSymbol="ZodSymbol",n.ZodUndefined="ZodUndefined",n.ZodNull="ZodNull",n.ZodAny="ZodAny",n.ZodUnknown="ZodUnknown",n.ZodNever="ZodNever",n.ZodVoid="ZodVoid",n.ZodArray="ZodArray",n.ZodObject="ZodObject",n.ZodUnion="ZodUnion",n.ZodDiscriminatedUnion="ZodDiscriminatedUnion",n.ZodIntersection="ZodIntersection",n.ZodTuple="ZodTuple",n.ZodRecord="ZodRecord",n.ZodMap="ZodMap",n.ZodSet="ZodSet",n.ZodFunction="ZodFunction",n.ZodLazy="ZodLazy",n.ZodLiteral="ZodLiteral",n.ZodEnum="ZodEnum",n.ZodEffects="ZodEffects",n.ZodNativeEnum="ZodNativeEnum",n.ZodOptional="ZodOptional",n.ZodNullable="ZodNullable",n.ZodDefault="ZodDefault",n.ZodCatch="ZodCatch",n.ZodPromise="ZodPromise",n.ZodBranded="ZodBranded",n.ZodPipeline="ZodPipeline",n.ZodReadonly="ZodReadonly"})(We||(We={}));const dC=Qi.create;Pi.create;hs.create;id.create;rd.create;tl.create;gu.create;ld.create;Ki.create;pu.create;function hC({value:n,onChange:a}){const i=kS(),[l,u]=z.useState(""),o=i.data??[],m=[...new Set([...o,...n])].sort(),g=y=>{n.includes(y)?a(n.filter(_=>_!==y)):a([...n,y].sort())},b=()=>{const y=l.trim();y!==""&&!n.includes(y)&&a([...n,y].sort()),u("")};return h.jsxs("div",{className:"form-group",children:[h.jsxs("label",{className:"form-label",children:["MACHINES ",h.jsx("span",{style:{color:"var(--text-faint)"},children:"(pick targets; none = runs nowhere)"})]}),m.length===0?h.jsx("div",{className:"machine-empty",children:"No machines known yet — add one below."}):h.jsx("div",{className:"machine-chips",children:m.map(y=>h.jsx("button",{type:"button",className:n.includes(y)?"machine-chip on":"machine-chip",onClick:()=>g(y),children:y},y))}),h.jsxs("div",{className:"machine-add",children:[h.jsx("input",{type:"text",className:"form-input",placeholder:"add a machine name",autoComplete:"off",spellCheck:!1,value:l,onChange:y=>u(y.target.value)}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:b,children:"ADD"})]})]})}const Db="Copy of ";function mC(n){return n.startsWith(Db)?n:`${Db}${n}`}function yC(n){return n.map(a=>a.branch&&a.branch.trim()!==""?`${a.repository} ${a.branch}`:a.repository).join(`
`)}function gC(n){const a=[];for(const i of n.split(`
`)){const l=i.trim().split(/\s+/).filter(Boolean),u=l[0];u&&a.push({repository:u,branch:l[1]??null})}return a}function vC(n){return n.join(", ")}function pC(n){return n.split(",").map(a=>a.trim()).filter(a=>a!=="")}function bC(n){const a=n.trim();return a===""||!/^\d+$/.test(a)?null:Number(a)}const SC=[["3600","1h"],["86400","1d"],["604800","7d"],["2592000","30d"]];function xC(n){return n==null?"default":n===0?"0s":n%86400===0?`${n/86400}d`:n%3600===0?`${n/3600}h`:n%60===0?`${n/60}m`:`${n}s`}const $f=dC().trim().min(1),EC=["claude","codex"],TC=[["@daily","@daily"],["@hourly","@hourly"],["@weekly","@weekly"],["@monthly","@monthly"],["0 0 9 * * 1-5 *","weekdays 9am"],["0 0 * * * * *","every hour"]];function jb(n){return{title:(n==null?void 0:n.title)??"",schedule:(n==null?void 0:n.schedule)??"",agent:(n==null?void 0:n.agent)??"claude",model:(n==null?void 0:n.model)??"",prompt:(n==null?void 0:n.prompt)??"",goal:(n==null?void 0:n.goal)??"",reposRaw:yC((n==null?void 0:n.repositories)??[]),machines:(n==null?void 0:n.machines)??[],tagsRaw:vC((n==null?void 0:n.tags)??[]),ttlRaw:(n==null?void 0:n.ttl_secs)!=null?String(n.ttl_secs):"",enabled:(n==null?void 0:n.enabled)??!0}}function qm({initial:n,mode:a,saving:i,onCancel:l,onSave:u}){const o=i_(),m=o.data&&o.data.length>0?o.data:EC,{register:g,control:b,setValue:y,handleSubmit:_,reset:w}=Vw({defaultValues:jb(n)});z.useEffect(()=>{w(jb(n))},[n]);const T=Ho({control:b,name:"title"}),S=Ho({control:b,name:"schedule"}),N=Ho({control:b,name:"agent"}),O=Ho({control:b,name:"prompt"}),j=Ho({control:b,name:"machines"}),R=$f.safeParse(T).success&&$f.safeParse(S).success&&$f.safeParse(N).success&&$f.safeParse(O).success,[k,H]=hO(S),F=S.trim()===""?"cron-preview":k?"cron-preview ok":"cron-preview bad",J=_(V=>{u({schedule:V.schedule,title:V.title,agent:V.agent,model:V.model.trim()===""?null:V.model,prompt:V.prompt,goal:V.goal.trim()===""?null:V.goal,repositories:gC(V.reposRaw),machines:V.machines,enabled:V.enabled,ttl_secs:bC(V.ttlRaw),tags:pC(V.tagsRaw)})}),pe=a==="edit",G=i?"…":pe?"SAVE CHANGES":"CREATE ROUTINE",re=h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"form-group",children:[h.jsx("label",{className:"form-label",children:"TITLE*"}),h.jsx("input",{className:"form-input",placeholder:"ops/nightly triage",autoComplete:"off",spellCheck:!1,...g("title")}),h.jsx("div",{className:"form-hint",children:"Use / to nest folders and subfolders."})]}),h.jsxs("div",{className:"form-group",children:[h.jsx("label",{className:"form-label",children:"SCHEDULE*"}),h.jsx("input",{className:"form-input",placeholder:"sec min hour dom month dow year",...g("schedule")}),h.jsx("div",{className:"cron-presets",children:TC.map(([V,K])=>h.jsx("button",{type:"button",className:"preset-btn",onClick:()=>y("schedule",V),children:K},V))}),h.jsx("div",{className:F,children:H})]}),h.jsxs("div",{className:"form-group",children:[h.jsx("label",{className:"form-label",children:"AGENT*"}),h.jsx("select",{className:"form-select",...g("agent"),children:m.map(V=>h.jsx("option",{value:V,children:V},V))})]}),h.jsxs("div",{className:"form-group",children:[h.jsxs("label",{className:"form-label",children:["MODEL ",h.jsx("span",{style:{color:"var(--text-faint)"},children:"(optional; blank = agent default)"})]}),h.jsx("input",{className:"form-input",placeholder:"claude-sonnet-4-6",...g("model")})]}),h.jsxs("div",{className:"form-group",children:[h.jsx("label",{className:"form-label",children:"PROMPT*"}),h.jsx("textarea",{className:"form-textarea",rows:6,placeholder:"Review open PRs and summarize…",...g("prompt")})]}),h.jsxs("div",{className:"form-group",children:[h.jsxs("label",{className:"form-label",children:["GOAL ",h.jsx("span",{style:{color:"var(--text-faint)"},children:"(optional; ≤5 lines — the why)"})]}),h.jsx("textarea",{className:"form-textarea",rows:3,placeholder:"Keep the PR backlog under control…",...g("goal")})]}),h.jsxs("div",{className:"form-group",children:[h.jsxs("label",{className:"form-label",children:["REPOSITORIES ",h.jsx("span",{style:{color:"var(--text-faint)"},children:"(one url [branch] per line)"})]}),h.jsx("textarea",{className:"form-textarea",rows:3,placeholder:"https://github.com/org/repo main",...g("reposRaw")})]}),h.jsx(hC,{value:j,onChange:V=>y("machines",V)}),h.jsxs("div",{className:"form-group",children:[h.jsxs("label",{className:"form-label",children:["TAGS ",h.jsx("span",{style:{color:"var(--text-faint)"},children:"(comma-separated)"})]}),h.jsx("input",{className:"form-input",placeholder:"triage, nightly",...g("tagsRaw")})]}),h.jsxs("div",{className:"form-group",children:[h.jsxs("label",{className:"form-label",children:["WORKBENCH TTL ",h.jsx("span",{style:{color:"var(--text-faint)"},children:"(seconds; blank = server default)"})]}),h.jsx("input",{className:"form-input",type:"number",min:0,placeholder:"604800",...g("ttlRaw")}),h.jsx("div",{className:"ttl-presets",children:SC.map(([V,K])=>h.jsx("button",{type:"button",className:"preset-btn",onClick:()=>y("ttlRaw",V),children:K},V))})]}),h.jsxs("div",{className:"toggle-row",children:[h.jsx("span",{children:"ENABLED"}),h.jsxs("label",{className:"toggle",children:[h.jsx("input",{type:"checkbox",...g("enabled")}),h.jsx("div",{className:"toggle-track"})]})]})]}),se=h.jsxs("div",{className:"modal-ft",children:[h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:l,children:"CANCEL"}),h.jsx("button",{type:"button",className:"btn btn-primary btn-sm",disabled:i||!R,onClick:J,children:G})]});return pe?h.jsx("div",{className:"overlay open",children:h.jsxs("div",{className:"dialog modal",children:[h.jsxs("div",{className:"modal-hd",children:[h.jsx("div",{className:"modal-title",children:"EDIT ROUTINE"}),h.jsx("button",{type:"button",className:"modal-x",title:"Close","aria-label":"Close",onClick:l,children:"✕"})]}),h.jsx("div",{className:"modal-body",children:re}),se]})}):h.jsxs("main",{className:"create-page",children:[h.jsxs("div",{className:"page-hd",children:[h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:l,children:"← BACK"}),h.jsx("div",{className:"page-title",children:a==="clone"?"NEW ROUTINE (FROM CLONE)":"NEW ROUTINE"})]}),h.jsxs("div",{className:"page-card card",children:[h.jsx("div",{className:"modal-body",children:re}),se]})]})}function Zx(n){if(n==="")return[];const a=n.split(`
`);return a.length>0&&a[a.length-1]===""&&a.pop(),a}function NC(n,a){const i=a.trim().toLowerCase(),l=[],u=Zx(n);for(let o=0;o<u.length;o++){const m=u[o]??"";(i===""||m.toLowerCase().includes(i))&&l.push([o+1,m])}return l}function _C(n,a){const i=Zx(n),l=i.length,u=a.trim().toLowerCase();return u===""?[l,l]:[i.filter(m=>m.toLowerCase().includes(u)).length,l]}function OC(n,a){const i=a.trim().toLowerCase();if(i==="")return[[!1,n]];const l=Array.from(n),u=l.map(_=>_.toLowerCase()[0]??_),m=Array.from(i).length,g=[];let b=0,y=0;for(;b<l.length;){const _=u.slice(b,b+m).join("");_===i&&_.length>0?(b>y&&g.push([!1,l.slice(y,b).join("")]),g.push([!0,l.slice(b,b+m).join("")]),b+=m,y=b):b++}return y<l.length&&g.push([!1,l.slice(y).join("")]),g}function wC({text:n,query:a}){return h.jsx(h.Fragment,{children:OC(n,a).map(([i,l],u)=>i?h.jsx("mark",{className:"log-hl",children:l},u):h.jsx("span",{children:l},u))})}function $x({content:n,loading:a,err:i}){const[l,u]=z.useState(""),o=z.useRef(null);z.useEffect(()=>{const g=o.current;g&&(g.scrollTop=g.scrollHeight)},[n==null?void 0:n.length]);let m=null;if(a)m=h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})});else if(i!==void 0)m=h.jsxs("div",{className:"logs-error",children:["Error: ",i]});else if(n!==void 0)if(n==="")m=h.jsx("div",{className:"logs-empty",children:"— no logs yet —"});else{const g=NC(n,l),[b,y]=_C(n,l),_=l.trim()===""?`${y} lines`:`${b} / ${y} matches`;m=h.jsxs(h.Fragment,{children:[h.jsxs("div",{className:"log-search",children:[h.jsx("input",{type:"search",className:"log-search-input",placeholder:"Search logs…","aria-label":"Search log lines",value:l,onChange:w=>u(w.target.value)}),l!==""&&h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Clear search","aria-label":"Clear search",onClick:()=>u(""),children:"✕"}),h.jsx("span",{className:"log-match-count",children:_})]}),h.jsx("div",{className:"log-lines",children:g.map(([w,T])=>h.jsxs("div",{className:"log-line",children:[h.jsx("span",{className:"log-ln",children:w}),h.jsx("span",{className:"log-lc",children:h.jsx(wC,{text:T,query:l})})]},w))})]})}return h.jsx("div",{className:"logs-wrap",ref:o,children:m})}function CC({id:n,title:a,onBack:i}){const l=h_(n),[u,o]=z.useState(void 0),m=y_(n,u??"",u!==void 0),g=l.data??[],b=Yy(),y=Math.floor(b/1e3);return h.jsxs("main",{className:"logs-page",children:[h.jsxs("div",{className:"page-hd",children:[h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:i,children:"← BACK"}),h.jsxs("div",{className:"page-title",children:["HISTORY / ",a]}),l.dataUpdatedAt>0&&h.jsx("span",{className:"page-freshness",children:Iy(Math.max(0,(b-l.dataUpdatedAt)/1e3))}),h.jsx("button",{type:"button",className:"btn-refresh",title:"Refresh","aria-label":"Refresh",onClick:()=>void l.refetch(),children:"↻"})]}),l.isLoading?h.jsx("div",{className:"table-wrap",children:h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})})}):l.isError?h.jsxs("div",{className:"logs-error",children:["Error: ",l.error.message]}):g.length===0?h.jsx("div",{className:"table-wrap",children:h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"⧗"}),h.jsx("div",{className:"empty-msg",children:"NO RUNS YET"})]})}):h.jsx("div",{className:"table-wrap",children:h.jsxs("table",{children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"STARTED"}),h.jsx("th",{children:"STATUS"}),h.jsx("th",{children:"DURATION"}),h.jsx("th",{children:"EXIT CODE"}),h.jsx("th",{children:"RETENTION"}),h.jsx("th",{})]})}),h.jsx("tbody",{children:g.map(_=>{const w=u===_.workbench;return h.jsxs("tr",{className:w?"row-selected":"",children:[h.jsx("td",{children:h.jsx("div",{className:"cell-time",title:`${_.workbench} · ${gd(_.started_at)}`,children:mu(_.started_at)})}),h.jsx("td",{children:h.jsx("span",{className:bx(_.status),children:Jy(_.status)})}),h.jsx("td",{children:_.finished_at!=null?Py(_.started_at,_.finished_at):"—"}),h.jsx("td",{children:_.exit_code??"—"}),h.jsx("td",{children:_.retention_expires_at!=null?h.jsx("span",{className:"cell-meta",children:UO(y,_.retention_expires_at)}):"—"}),h.jsx("td",{children:h.jsx("button",{type:"button",className:"act-btn logs",onClick:()=>o(w?void 0:_.workbench),children:w?"HIDE LOG":"VIEW LOG"})})]},_.workbench)})})]})}),u!==void 0&&h.jsx($x,{content:m.data,loading:m.isLoading,err:m.isError?m.error.message:void 0})]})}function MC({id:n,title:a,onBack:i}){const[l,u]=z.useState(ic),o=m_(n);z.useEffect(()=>{const g=sc(l);if(g===void 0)return;const b=window.setInterval(()=>void o.refetch(),g);return()=>window.clearInterval(b)},[l,n]);const m=g=>{u(g),rc(g)};return h.jsxs("main",{className:"logs-page",children:[h.jsxs("div",{className:"page-hd",children:[h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:i,children:"← BACK"}),h.jsxs("div",{className:"page-title",children:["LOGS / ",a]}),h.jsx(lc,{token:l,updatedAtMs:o.dataUpdatedAt,onChange:m}),h.jsx("button",{type:"button",className:"btn-refresh",title:"Refresh","aria-label":"Refresh",onClick:()=>void o.refetch(),children:"↻"})]}),h.jsx($x,{content:o.data,loading:o.isLoading,err:o.isError?o.error.message:void 0})]})}const Bm=6,Rb=2,Zm=14,DC={running:"var(--warn)",success:"var(--ok)",failed:"var(--err)",unknown:"var(--text-faint)"};function jC({runs:n}){if(n.length===0)return h.jsx("span",{className:"spark-empty muted",children:"—"});const a=n.length*Bm-Rb;return h.jsx("svg",{className:"spark",role:"img","aria-label":`Last ${n.length} runs`,width:a,height:Zm,viewBox:`0 0 ${a} ${Zm}`,children:n.map((i,l)=>h.jsx("rect",{x:l*Bm,y:0,width:Bm-Rb,height:Zm,rx:1,fill:DC[i.status],className:`spark-tick ${i.status}`,children:h.jsx("title",{children:`${Jy(i.status)} · ${mu(i.started_at)} (${gd(i.started_at)})`})},`${i.workbench}-${l}`))})}function RC({routine:n,now:a}){if(!n.enabled)return h.jsx("span",{className:"cell-next muted",children:"paused"});if(el(n,a)){const u=KO(n,a);return h.jsxs(h.Fragment,{children:[h.jsx("span",{className:"cell-next muted",children:"snoozed"}),u!==""&&h.jsx("div",{className:"cell-next-until muted",children:u})]})}const i=_u(n.schedule,a);if(i===void 0)return h.jsx("span",{className:"cell-next muted",children:"—"});const l=i.getTime()-a.getTime()<=eg;return h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"cell-next-when",children:Wy(a,i)}),h.jsx("div",{className:l?"cell-next-until soon":"cell-next-until",children:vd(a,i)})]})}function AC({routine:n,now:a,runs:i,selected:l,onSelect:u,onEdit:o,onClone:m,onDelete:g,onToggle:b,onTrigger:y,onLogs:_,onHistory:w,onFlags:T}){var re;const[S,N]=z.useState(!1),O=n.schedule_description??"—",j=mu(n.updated_at),R=n.repositories??[],k=(n.machines??[]).filter(se=>se.trim()!==""),H=n.tags??[],F=(re=n.goal)!=null&&re.trim()?n.goal.split(`
`)[0]:void 0,J=gy(n),pe=n.last_manual_trigger_at!=null&&(n.last_scheduled_trigger_at==null||n.last_manual_trigger_at>=n.last_scheduled_trigger_at),G=ed(n,a);return h.jsxs("tr",{className:l?"row-selected":"",children:[h.jsx("td",{className:"col-select",children:h.jsx("input",{type:"checkbox",checked:l,onChange:()=>u(n.id),"aria-label":`Select ${n.title}`})}),h.jsxs("td",{children:[h.jsx("div",{className:"cell-schedule",title:n.title,children:h.jsx(kC,{title:n.title})}),F!==void 0&&h.jsx("div",{className:"cell-goal",title:n.goal??"",children:F})]}),h.jsxs("td",{children:[h.jsx("div",{className:"cell-schedule",children:n.schedule}),h.jsx("div",{className:"cell-schedule-human",children:O}),h.jsx("button",{type:"button",className:S?"sched-preview-btn open":"sched-preview-btn","aria-expanded":S,onClick:se=>{se.stopPropagation(),N(V=>!V)},children:"▸ fires"}),S&&h.jsx(UC,{schedule:n.schedule,now:a})]}),h.jsx("td",{children:h.jsx(RC,{routine:n,now:a})}),h.jsx("td",{children:J===void 0?h.jsx("span",{className:"muted",children:"—"}):h.jsxs("div",{className:"cell-triggered",children:[pe?"↻":"⏱"," ",mu(J)]})}),h.jsx("td",{children:h.jsx(jC,{runs:i})}),h.jsxs("td",{children:[h.jsxs("span",{className:"cell-handler",title:n.agent_registered?"agent registered":"agent config missing",children:[h.jsx("span",{className:n.agent_registered?"handler-dot ok":"handler-dot warn"}),n.agent]}),n.model&&h.jsx("div",{className:"cell-goal",children:n.model})]}),h.jsx("td",{children:R.length===0?"—":h.jsx("span",{title:R.map(se=>se.repository).join(`
`),children:R.length})}),h.jsx("td",{className:k.length===0?"cell-meta cell-no-machines":"cell-meta",children:k.length===0?"—":h.jsx("span",{title:k.join(`
`),children:k.length})}),h.jsx("td",{children:H.length===0?"—":h.jsx("span",{title:H.join(", "),children:H.join(", ")})}),h.jsx("td",{children:h.jsx("span",{className:"cell-meta",title:"workbench retention for finished runs",children:xC(n.ttl_secs)})}),h.jsx("td",{children:h.jsx("span",{className:WO(G),title:vy(G),children:vy(G)})}),h.jsx("td",{children:h.jsxs("label",{className:"toggle",children:[h.jsx("input",{type:"checkbox",checked:n.enabled,onChange:se=>b(n.id,se.target.checked)}),h.jsx("div",{className:"toggle-track"})]})}),h.jsx("td",{children:h.jsx("div",{className:"cell-time",title:gd(n.updated_at),children:j})}),h.jsx("td",{children:h.jsxs("div",{className:"row-actions",children:[h.jsx("button",{type:"button",className:"act-btn run",title:JO(n),"aria-label":"Run now",disabled:!n.enabled||n.power_saving,onClick:()=>y(n.id),children:"▶"}),h.jsx("button",{type:"button",className:"act-btn logs",onClick:()=>_(n.id),children:"LOGS"}),h.jsx("button",{type:"button",className:"act-btn history",title:"Run history",onClick:()=>w(n.id),children:"HISTORY"}),h.jsxs("button",{type:"button",className:"act-btn flags",title:"Open flags",onClick:()=>T(n.id),children:["FLAGS",(n.flag_count??0)>0&&h.jsx("span",{className:"flag-badge",children:n.flag_count})]}),h.jsx("button",{type:"button",className:"act-btn edit",onClick:()=>o(n.id),children:"EDIT"}),h.jsx("button",{type:"button",className:"act-btn clone",title:"Duplicate routine","aria-label":"Duplicate routine",onClick:()=>m(n.id),children:"⧉"}),h.jsx("button",{type:"button",className:"act-btn del",title:"Delete routine","aria-label":"Delete routine",onClick:()=>g(n.id,n.title),children:"✕"})]})})]})}function kC({title:n}){const a=n.split("/").filter(Boolean);return a.length<=1?h.jsx(h.Fragment,{children:n}):h.jsx("span",{className:"cell-title-path",children:a.map((i,l)=>h.jsxs("span",{children:[l>0&&h.jsx("span",{className:"cell-title-sep",children:"/"}),h.jsx("span",{className:l===a.length-1?"cell-title-leaf":"cell-title-folder",children:i})]},`${i}-${l}`))})}function UC({schedule:n,now:a}){const i=gO(n,a,10);return i.length===0?h.jsx("div",{className:"fires-panel",children:h.jsx("div",{className:"fires-empty",children:"— no future fires —"})}):h.jsxs("div",{className:"fires-panel",children:[h.jsx("div",{className:"fires-hd",children:"NEXT 10 FIRES"}),i.map((l,u)=>h.jsxs("div",{className:"fires-item",children:[h.jsx("span",{className:"fires-when",children:Wy(a,l)}),h.jsx("span",{className:"fires-until",children:vd(a,l)})]},u))]})}function Vr({label:n,col:a,current:i,dir:l,onSort:u}){const o=i===a,m=o?l==="asc"?" ▲":" ▼":"";return h.jsxs("th",{className:o?"th-sort th-sort-active":"th-sort",onClick:()=>u(a),children:[n,m]})}function zC(n){const{routines:a,loading:i,filterActive:l,onClearFilters:u}=n;if(i)return h.jsx("div",{className:"table-wrap",children:h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})})});if(a.length===0)return h.jsx("div",{className:"table-wrap",children:l?h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"⊘"}),h.jsx("div",{className:"empty-msg",children:"NO ROUTINES MATCH"}),h.jsx("div",{className:"empty-sub",children:h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:u,children:"CLEAR FILTERS"})})]}):h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"⧗"}),h.jsx("div",{className:"empty-msg",children:"NO ROUTINES SCHEDULED"}),h.jsx("div",{className:"empty-sub",children:"press + NEW ROUTINE to create one"})]})});const o=a.length>0&&a.every(g=>n.selected.has(g.id)),m=dw(a,n.groupBy);return h.jsx("div",{className:"table-wrap",children:h.jsxs("table",{children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{className:"col-select",children:h.jsx("input",{type:"checkbox",checked:o,onChange:n.onSelectAll,"aria-label":"Select all visible routines",title:"Select all visible"})}),h.jsx(Vr,{label:"TITLE",col:"title",current:n.sortCol,dir:n.sortDir,onSort:n.onSort}),h.jsx("th",{children:"SCHEDULE"}),h.jsx(Vr,{label:"NEXT RUN",col:"next_run",current:n.sortCol,dir:n.sortDir,onSort:n.onSort}),h.jsx(Vr,{label:"LAST FIRE",col:"last_fire",current:n.sortCol,dir:n.sortDir,onSort:n.onSort}),h.jsx("th",{children:"RUN HISTORY"}),h.jsx(Vr,{label:"AGENT",col:"agent",current:n.sortCol,dir:n.sortDir,onSort:n.onSort}),h.jsx("th",{children:"REPOS"}),h.jsx("th",{children:"MACHINES"}),h.jsx("th",{children:"TAGS"}),h.jsx("th",{children:"TTL"}),h.jsx(Vr,{label:"HEALTH",col:"health",current:n.sortCol,dir:n.sortDir,onSort:n.onSort}),h.jsx(Vr,{label:"ENABLED",col:"enabled",current:n.sortCol,dir:n.sortDir,onSort:n.onSort}),h.jsx(Vr,{label:"UPDATED",col:"updated",current:n.sortCol,dir:n.sortDir,onSort:n.onSort}),h.jsx("th",{})]})}),h.jsx("tbody",{children:m.map(([g,b])=>h.jsxs(z.Fragment,{children:[n.groupBy!=="none"&&h.jsx("tr",{className:"group-hd",children:h.jsxs("td",{colSpan:15,children:[h.jsx("span",{className:"group-label",children:g})," ",h.jsxs("span",{className:"group-count",children:["(",b.length,")"]})]})},`hd-${g}`),b.map(y=>h.jsx(AC,{routine:y,now:n.now,runs:n.runHistory.get(y.id)??[],selected:n.selected.has(y.id),onSelect:n.onSelect,onEdit:n.onEdit,onClone:n.onClone,onDelete:n.onDelete,onToggle:n.onToggle,onTrigger:n.onTrigger,onLogs:n.onLogs,onHistory:n.onHistory,onFlags:n.onFlags},y.id))]},`grp-${g}`))})]})})}const Yx="moadim.routines.saved_views",Ix="moadim.routines.last_view";function Ab(n,a,i,l){return{query:n.query,status:n.status,agent:Zs(n.agent),machine:Xf(n.machine),repository:Zs(n.repository),tag:Zs(n.tag),sortCol:a,sortDir:i,groupBy:l}}function kb(n){const a={query:n.query,status:Sx(n.status),agent:Jl(n.agent),machine:Nx(n.machine),repository:Jl(n.repository),tag:Jl(n.tag)},i=n.sortCol===void 0?void 0:rw(n.sortCol),l=uw(n.sortDir),u=Ox(n.groupBy);return{filter:a,sortCol:i,sortDir:l,groupBy:u}}function Gx(n){try{const a=window.localStorage.getItem(n);return a===null?void 0:JSON.parse(a)}catch{return}}function Xx(n,a){try{window.localStorage.setItem(n,JSON.stringify(a))}catch{}}function LC(){return Gx(Yx)??[]}function Ub(n){Xx(Yx,n)}function HC(){return Gx(Ix)}function VC(n){Xx(Ix,n)}function FC({views:n,onApply:a,onSave:i,onDelete:l}){const[u,o]=z.useState(!1),[m,g]=z.useState(""),[b,y]=z.useState(""),_=S=>{const N=n.find(O=>O.name===S);N&&a(N.snapshot),y(S)},w=()=>{const S=m.trim();S!==""&&(i(S),y(S),o(!1))},T=()=>{b!==""&&(l(b),y(""))};return h.jsx("div",{className:"filter-bar saved-views-bar",children:h.jsxs("div",{className:"filter-field",children:[h.jsx("span",{className:"filter-label",children:"VIEWS"}),h.jsxs("select",{className:"filter-select","aria-label":"Saved views",value:b,onChange:S=>_(S.target.value),children:[h.jsx("option",{value:"",children:"— select —"}),n.map(S=>h.jsx("option",{value:S.name,children:S.name},S.name))]}),u?h.jsxs(h.Fragment,{children:[h.jsx("input",{type:"text",className:"filter-input",placeholder:"View name…","aria-label":"New view name",value:m,onChange:S=>g(S.target.value)}),h.jsx("button",{type:"button",className:"btn btn-primary btn-sm",disabled:m.trim()==="",onClick:w,children:"SAVE"}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>o(!1),children:"CANCEL"})]}):h.jsxs(h.Fragment,{children:[h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Save current filters, sort, and grouping as a named view",onClick:()=>{o(!0),g("")},children:"☆ SAVE VIEW"}),b!==""&&h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Delete this saved view",onClick:T,children:"DELETE"})]})]})})}const qC=300,BC=10;function ZC(n){const a=new Map;for(const i of n){let l=a.get(i.routine_id);l||(l=[],a.set(i.routine_id,l)),l.length<BC&&l.push(i)}for(const i of a.values())i.reverse();return a}function $C({routines:n,now:a,active:i,onStatus:l}){const u=n.length,o=n.filter(S=>S.enabled).length,m=u-o,g=n.filter(S=>S.enabled&&!el(S,a)&&Qy(S.schedule,a,eg)).length,b=n.filter(S=>S.enabled&&el(S,a)).length,y=n.filter(S=>S.enabled&&(S.machines??[]).length===0).length,_=n.reduce((S,N)=>S+(N.flag_count??0),0),w=n.filter(S=>!S.agent_registered).length,T=[["all","TOTAL",u,""],["enabled","ENABLED",o,""],["disabled","DISABLED",m,""],["dormant","DORMANT",y,y>0?"has-dormant":""],["due","DUE SOON",g,""],["snoozed","SNOOZED",b,""],["flagged","FLAGS",_,_>0?"has-flags":""],["agent-unreg","UNREGISTERED AGENT",w,w>0?"has-unreg":""]];return h.jsx("div",{className:"stats",children:T.map(([S,N,O,j])=>{const R=i===S;return h.jsxs("button",{type:"button",className:`stat-card ${j}${R?" active":""}`.trim(),"aria-pressed":R,onClick:()=>l(R?"all":S),children:[h.jsx("div",{className:"stat-label",children:N}),h.jsx("div",{className:"stat-val",children:O})]},S)})})}const YC=[["table","LIST"],["calendar","CALENDAR"],["day","DAY"]];function IC({view:n,onSetView:a}){return h.jsx("div",{className:"view-toggle",children:YC.map(([i,l])=>h.jsx("button",{type:"button",className:n===i?"view-btn active":"view-btn",onClick:()=>a(i),children:l},i))})}const GC=3e4;function XC(){const{addToast:n}=Nu(),[a,i]=vS(),l=z.useMemo(()=>HC(),[]),u=l?kb(l):void 0,[o,m]=z.useState(()=>{const Q=a.get("history");return Q?{kind:"history",id:Q}:{kind:"list"}}),[g,b]=z.useState({kind:"none"}),[y,_]=z.useState("table"),[w,T]=z.useState((u==null?void 0:u.filter)??zm()),[S,N]=z.useState(u==null?void 0:u.sortCol),[O,j]=z.useState((u==null?void 0:u.sortDir)??"asc"),[R,k]=z.useState((u==null?void 0:u.groupBy)??"none"),[H,F]=z.useState(new Set),[J,pe]=z.useState(LC),[G,re]=z.useState(ic),[se,V]=z.useState(()=>new Date),K=z.useRef(null);z.useEffect(()=>{if(a.get("history")){const Q=new URLSearchParams(a);Q.delete("history"),i(Q,{replace:!0})}},[]),z.useEffect(()=>{const Q=setInterval(()=>V(new Date),GC);return()=>clearInterval(Q)},[]),z.useEffect(()=>{VC(Ab(w,S,O,R))},[w,S,O,R]),z.useEffect(()=>{const Q=de=>{var Ot;if(de.key==="Escape"&&g.kind!=="none"){b({kind:"none"});return}const Ae=de.target,Pe=Ae&&["INPUT","TEXTAREA","SELECT"].includes(Ae.tagName);de.key==="/"&&!Pe&&!de.metaKey&&!de.ctrlKey&&!de.altKey&&(de.preventDefault(),(Ot=K.current)==null||Ot.focus())};return window.addEventListener("keydown",Q),()=>window.removeEventListener("keydown",Q)},[g.kind]);const P=sc(G),ie=Zy({},{refetchInterval:P}),Se=$y(qC),be=zS(),X=AS(),ce=kS();z.useEffect(()=>{if(P===void 0)return;const Q=setInterval(()=>void Se.refetch(),P);return()=>clearInterval(Q)},[P]);const ye=z.useMemo(()=>ie.data??[],[ie.data]),De=z.useMemo(()=>ZC(Se.data??[]),[Se.data]),Re=z.useRef(!1);z.useEffect(()=>{var de;const Q=(de=X.data)==null?void 0:de.name;!Q||Re.current||(Re.current=!0,T(Ae=>Ae.machine.kind==="any"?{...Ae,machine:{kind:"machine",value:Q}}:Ae))},[X.data]);const[q,ue]=z.useState(ye);if(ye!==q){ue(ye);const Q=new Set(ye.map(de=>de.id));F(de=>{const Ae=new Set([...de].filter(Pe=>Q.has(Pe)));return Ae.size===de.size?de:Ae})}const Oe=o_(),Ne=c_(),Me=f_(),Le=US(),Ie=d_(),ft=LS(),tt=()=>m({kind:"list"}),Lt=()=>b({kind:"none"}),Gn=()=>{ft.mutate("all",{onSuccess:()=>n("Routines unlocked","ok"),onError:Q=>n(`Unlock failed: ${Q.message}`,"err")})},Xn=Q=>{Oe.mutate({...Q},{onSuccess:()=>{tt(),n("Routine created","ok")},onError:de=>n(`Create failed: ${de.message}`,"err")})},Wa=(Q,de)=>{Ne.mutate({id:Q,body:{...de}},{onSuccess:()=>{Lt(),n("Routine updated","ok")},onError:Ae=>n(`Update failed: ${Ae.message}`,"err")})},jn=Q=>{Me.mutate(Q,{onSuccess:()=>{Lt(),n("Routine deleted","ok")},onError:de=>n(`Delete failed: ${de.message}`,"err")})},Qn=(Q,de)=>{Ne.mutate({id:Q,body:{enabled:de}},{onSuccess:()=>n(de?"Routine enabled":"Routine disabled","ok"),onError:Ae=>n(`Toggle failed: ${Ae.message}`,"err")})},Ma=Q=>{Le.mutate(Q,{onSuccess:()=>n("Routine triggered","ok"),onError:de=>n(`Trigger failed: ${de.message}`,"err")})},Ka=()=>{Ie.mutate(void 0,{onSuccess:Q=>{const de=Q.removed;n(`Cleanup removed ${de} workbench${de===1?"":"es"} (freed ${$O(Q.freed_bytes)})`,"ok")},onError:Q=>n(`Cleanup failed: ${Q.message}`,"err")})},da=async Q=>{const de=[...H];if(de.length===0)return;let Ae=0,Pe=0;for(const yt of de)try{await Ne.mutateAsync({id:yt,body:{enabled:Q}}),Ae++}catch{Pe++}const Ot=Q?"enabled":"disabled";Pe===0?n(`${Ae} routine(s) ${Ot}`,"ok"):n(`${Ae} ${Ot}, ${Pe} failed`,"err")},Wn=async()=>{const Q=[...H];let de=0,Ae=0;const Pe=[];for(const Ot of Q)try{await Me.mutateAsync(Ot),de++,Pe.push(Ot)}catch{Ae++}F(Ot=>{const yt=new Set(Ot);for(const ln of Pe)yt.delete(ln);return yt}),Lt(),Ae===0?n(`${de} routine(s) deleted`,"ok"):n(`${de} deleted, ${Ae} failed`,"err")},gs=Q=>{const de=kb(Q);T(de.filter),N(de.sortCol),j(de.sortDir),k(de.groupBy)},Ja=Q=>{const de=Ab(w,S,O,R);pe(Ae=>{const Pe=[...Ae.filter(Ot=>Ot.name!==Q),{name:Q,snapshot:de}];return Ub(Pe),Pe})},er=Q=>{pe(de=>{const Ae=de.filter(Pe=>Pe.name!==Q);return Ub(Ae),Ae})},Ks=z.useMemo(()=>PO(ye),[ye]),Xt=z.useMemo(()=>tw(ye),[ye]),Pa=z.useMemo(()=>nw(ye),[ye]),Js=z.useMemo(()=>[...new Set([...ew(ye),...ce.data??[]])].sort(),[ye,ce.data]),tr=_x(w),Kn=z.useMemo(()=>hw(QO(ye,w,se,eg),S,O,se),[ye,w,se,S,O]),vs=u_(g.kind==="edit"?g.id:"",g.kind==="edit"),A=g.kind==="edit"?vs.data:void 0,B=Q=>F(de=>{const Ae=new Set(de);return Ae.delete(Q)||Ae.add(Q),Ae}),ee=()=>{const Q=Kn.map(Ae=>Ae.id),de=Q.length>0&&Q.every(Ae=>H.has(Ae));F(de?new Set:new Set(Q))},he=Q=>{S===Q?j(de=>lw(de)):(N(Q),j("asc"))},ve=Q=>{re(Q),rc(Q)},_e=Q=>{var de;return((de=ye.find(Ae=>Ae.id===Q))==null?void 0:de.title)??""};if(o.kind==="new")return h.jsx(qm,{mode:"create",saving:Oe.isPending,onCancel:tt,onSave:Xn});if(o.kind==="clone"){const Q={schedule:o.source.schedule,title:mC(o.source.title),agent:o.source.agent,model:o.source.model??null,prompt:o.source.prompt??"",goal:o.source.goal??null,repositories:o.source.repositories??[],machines:o.source.machines??[],enabled:o.source.enabled,ttl_secs:o.source.ttl_secs??null,tags:o.source.tags??[]};return h.jsx(qm,{mode:"clone",initial:Q,saving:Oe.isPending,onCancel:tt,onSave:Xn})}if(o.kind==="logs")return h.jsx(MC,{id:o.id,title:_e(o.id),onBack:tt});if(o.kind==="history")return h.jsx(CC,{id:o.id,title:_e(o.id),onBack:tt});if(o.kind==="flags")return h.jsx(vw,{id:o.id,title:_e(o.id),onBack:tt});const Ee=Kn.filter(Q=>Q.enabled).map(Q=>({id:Q.id,label:Q.title,schedule:Q.schedule,snoozed:el(Q,se),flagCount:Q.flag_count??0}));return h.jsxs("div",{className:"page",children:[h.jsx("h1",{className:"page-title",children:"Routines"}),h.jsx(qS,{status:be.data,onUnlock:Gn}),h.jsx($C,{routines:ye,now:se,active:w.status,onStatus:Q=>T(de=>({...de,status:Q}))}),h.jsxs("div",{className:"section-hd",children:[h.jsx("div",{className:"section-label",children:"SCHEDULED ROUTINES"}),h.jsxs("div",{className:"section-acts",children:[h.jsx(lc,{token:G,updatedAtMs:ie.dataUpdatedAt,onChange:ve}),y==="table"&&h.jsx(yw,{groupBy:R,onChange:k}),h.jsx(IC,{view:y,onSetView:_}),h.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Reap finished, expired run workbenches now",onClick:Ka,children:"CLEANUP NOW"}),h.jsx("button",{type:"button",className:"btn btn-primary btn-sm",onClick:()=>m({kind:"new"}),children:"+ NEW ROUTINE"})]})]}),h.jsx(sw,{filter:w,agents:Ks,machines:Js,repositories:Xt,tags:Pa,shown:Kn.length,total:ye.length,searchRef:K,onQuery:Q=>T(de=>({...de,query:Q})),onStatus:Q=>T(de=>({...de,status:Q})),onAgent:Q=>T(de=>({...de,agent:Q})),onMachine:Q=>T(de=>({...de,machine:Q})),onRepository:Q=>T(de=>({...de,repository:Q})),onTag:Q=>T(de=>({...de,tag:Q})),onClear:()=>T(zm())}),h.jsx(FC,{views:J,onApply:gs,onSave:Ja,onDelete:er}),h.jsx(qO,{count:H.size,onEnable:()=>void da(!0),onDisable:()=>void da(!1),onDelete:()=>b({kind:"confirmBulkDelete"}),onClear:()=>F(new Set)}),y==="table"&&h.jsx(zC,{routines:Kn,loading:ie.isLoading,filterActive:tr,now:se,selected:H,onSelect:B,onSelectAll:ee,sortCol:S,sortDir:O,groupBy:R,runHistory:De,onSort:he,onEdit:Q=>b({kind:"edit",id:Q}),onClone:Q=>{const de=ye.find(Ae=>Ae.id===Q);de&&m({kind:"clone",source:de})},onDelete:(Q,de)=>b({kind:"confirmDelete",id:Q,title:de}),onToggle:Qn,onTrigger:Ma,onLogs:Q=>m({kind:"logs",id:Q}),onHistory:Q=>m({kind:"history",id:Q}),onFlags:Q=>m({kind:"flags",id:Q}),onClearFilters:()=>T(zm())}),y==="calendar"&&h.jsx(gw,{routines:Kn,loading:ie.isLoading,onEdit:Q=>b({kind:"edit",id:Q})}),y==="day"&&h.jsx(IO,{items:Ee,loading:ie.isLoading,onClick:Q=>b({kind:"edit",id:Q})}),g.kind==="edit"&&vs.isLoading&&h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})}),g.kind==="edit"&&A&&h.jsx(qm,{mode:"edit",initial:A&&{schedule:A.schedule,title:A.title,agent:A.agent,model:A.model??null,prompt:A.prompt??"",goal:A.goal??null,repositories:A.repositories??[],machines:A.machines??[],enabled:A.enabled,ttl_secs:A.ttl_secs??null,tags:A.tags??[]},saving:Ne.isPending,onCancel:Lt,onSave:Q=>Wa(g.id,Q)}),g.kind==="confirmDelete"&&h.jsx(ZO,{title:g.title,onCancel:Lt,onConfirm:()=>jn(g.id)}),g.kind==="confirmBulkDelete"&&h.jsx(BO,{count:H.size,onCancel:Lt,onConfirm:()=>void Wn()})]})}function QC(n,a){const i=Array.from({length:24},()=>[]);for(const l of n)for(const u of yx(l.schedule,a)){const o=i[u.getHours()];o==null||o.push({time:u,label:l.label,snoozed:l.snoozed,flagCount:l.flagCount})}for(const l of i)l.sort((u,o)=>u.time.getTime()-o.time.getTime());return i}function WC(n,a){const i=n.snoozed_until;return i!=null&&i>Math.floor(a.getTime()/1e3)||(n.skip_runs??0)>0}function KC(n,a){return n.filter(i=>i.enabled).map(i=>({label:i.title,schedule:i.schedule,snoozed:WC(i,a),flagCount:i.flag_count}))}function JC(n){var l;const a=oc[n.getDay()],i=(l=Ky[n.getMonth()])==null?void 0:l.slice(0,3);return`${a} · ${i} ${n.getDate()} ${n.getFullYear()}`}function PC({day:n,items:a,loading:i,isToday:l,currentHour:u,onPrev:o,onNext:m,onToday:g,onClose:b}){const y=QC(a,n),_=y.reduce((w,T)=>w+T.length,0);return h.jsxs("section",{className:"hm-day card",children:[h.jsxs("div",{className:"hm-day-nav",children:[h.jsx("button",{className:"btn btn-ghost btn-sm",onClick:o,"aria-label":"Previous day",children:"‹"}),h.jsx("div",{className:"hm-day-title",children:JC(n)}),h.jsx("button",{className:"btn btn-ghost btn-sm",onClick:m,"aria-label":"Next day",children:"›"}),h.jsx("button",{className:"btn btn-ghost btn-sm",onClick:g,children:"TODAY"}),h.jsx("div",{className:"hm-day-spacer"}),h.jsx("button",{className:"btn btn-ghost btn-sm",onClick:b,"aria-label":"Close day view",children:"✕"})]}),i?h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})}):_===0?h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"🗓"}),h.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),h.jsx("div",{className:"empty-sub",children:"no fire times on this day"})]}):h.jsx("div",{className:"hm-day-hours",children:y.map((w,T)=>h.jsxs("div",{className:l&&T===u?"hm-day-hour now":"hm-day-hour",children:[h.jsxs("div",{className:"hm-day-hour-label",children:[String(T).padStart(2,"0"),":00"]}),h.jsx("div",{className:"hm-day-hour-slot",children:w.map((S,N)=>h.jsxs("div",{className:S.snoozed?"hm-day-chip snoozed":"hm-day-chip",title:S.label,children:[h.jsxs("span",{className:"hm-day-chip-time",children:[String(S.time.getHours()).padStart(2,"0"),":",String(S.time.getMinutes()).padStart(2,"0")]}),h.jsx("span",{className:"hm-day-chip-label",children:S.label}),S.flagCount>0&&h.jsx("span",{className:"hm-day-chip-flag",children:`⚑${S.flagCount}`})]},N))})]},T))})]})}const Pl=7,eu=24,eM=2e4;function tM(n){return n==="all"?"ALL":"ROUTINES"}function nM(n,a){return n==="all"||n===a}function aM(n,a,i){const l=ms(a),u=new Date(l.getFullYear(),l.getMonth(),l.getDate()+Pl),o=Array.from({length:Pl},()=>new Array(eu).fill(0));let m=0;for(const _ of n){if(!_.enabled||!nM(i,_.kind))continue;const w=uc(_.schedule,a);if(!w)continue;let T=!1;for(let S=0;S<eM&&w.hasNext();S++){const N=w.next().toDate(),O=ms(N);if(O.getTime()>=u.getTime())break;const j=Math.round((O.getTime()-l.getTime())/864e5),R=o[j];R&&(R[N.getHours()]=(R[N.getHours()]??0)+1,T=!0)}T&&m++}let g=0,b=0,y;for(let _=0;_<Pl;_++){const w=o[_];if(w)for(let T=0;T<eu;T++){const S=w[T]??0;g+=S,S>b&&(b=S,y=[_,T])}}return{grid:o,total:g,maxCell:b,peak:y,sources:m}}function sM(n,a){if(n===0||a===0)return 0;const i=n/a;return Math.min(4,Math.max(1,Math.ceil(i*4)))}function iM(n){return n.grid.map(a=>a.reduce((i,l)=>i+l,0))}function rM(n){return Array.from({length:eu},(a,i)=>n.grid.reduce((l,u)=>l+(u[i]??0),0))}function lM(n){return n.grid.flat().filter(a=>a>0).length}function Qx(n){return n.getDay()}function uM(n,a){const i=new Date(n.getFullYear(),n.getMonth(),n.getDate()+a);return oc[Qx(i)]??""}function oM(n,a){var m;if(!n.peak)return;const[i,l]=n.peak,u=((m=n.grid[i])==null?void 0:m[l])??0,o=u===1?"run":"runs";return`${uM(a,i)} ${String(l).padStart(2,"0")}:00 · ${u} ${o}`}function $m(n,a){const i=new Date(n.getFullYear(),n.getMonth(),n.getDate()+a);return`${oc[Qx(i)]} ${i.getDate()}`}function cM(n){return n.map(a=>({kind:"routine",schedule:a.schedule,enabled:a.enabled}))}const fM=6e4,dM=["all","routine"];function Ym(n,a){return new Date(n.getFullYear(),n.getMonth(),n.getDate()+a)}function hM(n){const a=n.getFullYear(),i=String(n.getMonth()+1).padStart(2,"0"),l=String(n.getDate()).padStart(2,"0");return`${a}-${i}-${l}`}function mM(n){const a=n?/^(\d{4})-(\d{2})-(\d{2})$/.exec(n):null;if(!a)return;const[,i,l,u]=a;return new Date(Number(i),Number(l)-1,Number(u))}function zb(n){if(n!==0)return`color-mix(in srgb, var(--accent) ${10+n*20}%, var(--surface))`}function yM(){const[n,a]=z.useState(ic),{data:i,isLoading:l,error:u,dataUpdatedAt:o}=Zy({},{refetchInterval:sc(n)}),[m,g]=z.useState(()=>new Date),[b,y]=z.useState("all"),[_,w]=vS(),T=K=>{rc(K),a(K)};z.useEffect(()=>{const K=setInterval(()=>g(new Date),fM);return()=>clearInterval(K)},[]);const S=ms(m),N=m.getHours(),O=z.useMemo(()=>cM(i??[]),[i]),j=z.useMemo(()=>aM(O,m,b),[O,m,b]),R=mM(_.get("day")),k=K=>{w(P=>{const ie=new URLSearchParams(P);return ie.set("day",hM(K)),ie})},H=()=>{w(K=>{const P=new URLSearchParams(K);return P.delete("day"),P})},F=z.useMemo(()=>KC(i??[],m),[i,m]),J=u==null?void 0:u.message,pe=Array.from({length:Pl},(K,P)=>P),G=Array.from({length:eu},(K,P)=>P),re=iM(j),se=rM(j),V=Pl*eu-lM(j);return h.jsxs("div",{className:"page",children:[h.jsxs("div",{className:"hm-hd",children:[h.jsx("h1",{className:"page-title",children:"Heatmap"}),h.jsxs("div",{className:"hm-hd-acts",children:[h.jsx("div",{className:"hm-filter",role:"group","aria-label":"Source filter",children:dM.map(K=>h.jsx("button",{className:K===b?"hm-filter-btn active":"hm-filter-btn","aria-pressed":K===b,onClick:()=>y(K),children:tM(K)},K))}),h.jsx(lc,{token:n,updatedAtMs:o,onChange:T})]})]}),h.jsxs("div",{className:"stats",children:[h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"FIRES / 7 DAYS"}),h.jsx("div",{className:"stat-val",children:j.total})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"BUSIEST WINDOW"}),h.jsx("div",{className:"stat-val stat-val-sm c-accent",children:oM(j,S)??"—"})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"PEAK / HOUR"}),h.jsx("div",{className:"stat-val",children:j.maxCell})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"SOURCES"}),h.jsx("div",{className:"stat-val",children:j.sources})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"OPEN SLOTS"}),h.jsxs("div",{className:"stat-val stat-val-sm",children:[V," / ",Pl*eu]})]})]}),J?h.jsx("div",{className:"table-wrap",children:h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"⚠"}),h.jsx("div",{className:"empty-msg",children:"FAILED TO LOAD"}),h.jsx("div",{className:"empty-sub",children:J})]})}):l?h.jsx("div",{className:"table-wrap",children:h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})})}):j.total===0?h.jsx("div",{className:"table-wrap",children:h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"▦"}),h.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),h.jsx("div",{className:"empty-sub",children:"no enabled routine fires in the next 7 days"})]})}):h.jsxs(h.Fragment,{children:[h.jsx("div",{className:"hm-grid-wrap",children:h.jsxs("div",{className:"hm-grid",role:"grid","aria-label":"Fire density by day and hour",children:[h.jsx("div",{className:"hm-corner",role:"columnheader",children:"DAY \\ HR"}),G.map(K=>h.jsx("div",{className:K===N?"hm-hcol now":"hm-hcol",role:"columnheader",children:String(K).padStart(2,"0")},K)),h.jsx("div",{className:"hm-rowtot hm-corner",role:"columnheader",children:"Σ"}),pe.map(K=>{const P=Ym(S,K);return h.jsxs(z.Fragment,{children:[h.jsx("button",{className:K===0?"hm-daylabel today":"hm-daylabel",onClick:()=>k(P),title:`View ${$m(S,K)}`,children:$m(S,K)}),G.map(ie=>{var De,Re;const Se=((De=j.grid[K])==null?void 0:De[ie])??0,be=sM(Se,j.maxCell),X=((Re=j.peak)==null?void 0:Re[0])===K&&j.peak[1]===ie,ce=K===0&&ie===N;let ye="hm-cell";return X&&(ye+=" peak"),ce&&(ye+=" now"),h.jsx("button",{className:ye,style:{backgroundColor:zb(be)},onClick:()=>k(P),title:`${$m(S,K)} ${String(ie).padStart(2,"0")}:00 — ${Se} run${Se===1?"":"s"}`,children:Se>0?h.jsx("span",{className:"hm-n",children:Se}):null},`${K}-${ie}`)}),h.jsx("div",{className:"hm-rowtot",children:re[K]})]},K)}),h.jsx("div",{className:"hm-daylabel hm-foot",children:"Σ"}),G.map(K=>h.jsx("div",{className:"hm-rowtot hm-foot",children:se[K]},`hourtot-${K}`)),h.jsx("div",{className:"hm-rowtot hm-foot grand",children:j.total})]})}),h.jsxs("div",{className:"hm-legend",children:[h.jsx("span",{className:"hm-legend-label",children:"LESS"}),[0,1,2,3,4].map(K=>h.jsx("span",{className:"hm-cell hm-legend-swatch",style:{backgroundColor:zb(K)}},K)),h.jsx("span",{className:"hm-legend-label",children:"MORE"}),h.jsx("span",{className:"hm-legend-note",children:"fires per weekday · hour across the next 7 days"})]})]}),R&&h.jsx(PC,{day:R,items:F,loading:l,isToday:ms(R).getTime()===S.getTime(),currentHour:N,onPrev:()=>k(Ym(R,-1)),onNext:()=>k(Ym(R,1)),onToday:()=>k(S),onClose:H})]})}const Lb=20,gM=5,vM=.4,pM=8,bM=1.25;function ud(n){return n.sampleSize===0?null:n.successes/n.sampleSize}function Wx(n){if(n.sampleSize<gM)return!1;const a=n.sampleSize-1;return a>0&&n.flips/a>=vM}function wy(n){return n.kind==="failure"?n.count:0}function SM(n){const a=n[0];if(a===void 0)return{kind:"none"};let i=0;for(const l of n){if(l!==a)break;i+=1}return a==="success"?{kind:"success",count:i}:{kind:"failure",count:i}}function xM(n){let a=0;for(let i=1;i<n.length;i++)n[i]!==n[i-1]&&(a+=1);return a}function Qo(n,a){if(n.length===0)return null;const i=Math.min(n.length-1,Math.max(0,Math.ceil(a*n.length)-1));return n[i]??null}function Hb(n){return Qo([...n].sort((a,i)=>a-i),.5)}function EM(n){if(n.length<pM)return!1;const a=Math.floor(n.length/2),i=Hb(n.slice(0,a)),l=Hb(n.slice(a));return i===null||l===null||l<=0?!1:i>l*bM}function TM(n){const a=new Map;for(const i of n){if(i.status!=="success"&&i.status!=="failed")continue;let l=a.get(i.routine_id);l||(l={title:i.routine_title,statuses:[],durationsSecs:[]},a.set(i.routine_id,l)),l.statuses.length<Lb&&l.statuses.push(i.status),l.durationsSecs.length<Lb&&i.finished_at!=null&&i.finished_at>=i.started_at&&l.durationsSecs.push(i.finished_at-i.started_at)}return a}function NM(n){const a=[];for(const[i,l]of TM(n)){const u=[...l.durationsSecs].sort((o,m)=>o-m);a.push({routineId:i,routineTitle:l.title,sampleSize:l.statuses.length,successes:l.statuses.filter(o=>o==="success").length,streak:SM(l.statuses),flips:xM(l.statuses),durationsSecs:l.durationsSecs,p50Secs:Qo(u,.5),p95Secs:Qo(u,.95),regressing:EM(l.durationsSecs)})}return a.sort((i,l)=>{const u=wy(l.streak)-wy(i.streak);if(u!==0)return u;const o=ud(i)??1,m=ud(l)??1;return o!==m?o-m:i.routineTitle.localeCompare(l.routineTitle)}),a}function _M(n){const a=n.flatMap(i=>i.durationsSecs).sort((i,l)=>i-l);return{sampleSize:n.reduce((i,l)=>i+l.sampleSize,0),successes:n.reduce((i,l)=>i+l.successes,0),failingCount:n.filter(i=>wy(i.streak)>0).length,flakyCount:n.filter(Wx).length,p50Secs:Qo(a,.5),p95Secs:Qo(a,.95),regressingCount:n.filter(i=>i.regressing).length}}function OM(n){switch(n.kind){case"success":return"run-status success";case"failure":return"run-status failed";default:return"run-status unknown"}}function wM(n){switch(n.kind){case"success":return`${n.count} OK`;case"failure":return`${n.count} FAILING`;default:return"—"}}function CM(n){return n===null?"run-status unknown":n>=.9?"run-status success":n>=.7?"run-status running":"run-status failed"}function Kx(n){return n===null?"—":`${Math.round(n*100)}%`}const MM=300;function od(n){return n===null?"—":Py(0,n)}function DM(){const[n,a]=z.useState(ic),{data:i,isLoading:l,error:u,dataUpdatedAt:o}=$y(MM,{refetchInterval:sc(n)}),m=w=>{rc(w),a(w)},g=NM(i??[]),b=_M(g),y=b.sampleSize===0?null:b.successes/b.sampleSize,_=u==null?void 0:u.message;return h.jsxs("div",{className:"page",children:[h.jsxs("div",{className:"section-hd",children:[h.jsx("h1",{className:"page-title",children:"Reliability"}),h.jsx("div",{className:"section-acts",children:h.jsx(lc,{token:n,updatedAtMs:o,onChange:m})})]}),h.jsxs("div",{className:"stats",children:[h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"FLEET SUCCESS RATE"}),h.jsx("div",{className:"stat-val",children:Kx(y)})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"FAILING"}),h.jsx("div",{className:b.failingCount>0?"stat-val c-red":"stat-val",children:b.failingCount})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"FLAKY"}),h.jsx("div",{className:b.flakyCount>0?"stat-val c-amber":"stat-val",children:b.flakyCount})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"FLEET P50"}),h.jsx("div",{className:"stat-val stat-val-sm",children:od(b.p50Secs)})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"FLEET P95"}),h.jsx("div",{className:"stat-val stat-val-sm",children:od(b.p95Secs)})]}),h.jsxs("div",{className:"stat-card",children:[h.jsx("div",{className:"stat-label",children:"SLOWER TREND"}),h.jsx("div",{className:b.regressingCount>0?"stat-val c-amber":"stat-val",children:b.regressingCount})]})]}),_?h.jsx("div",{className:"table-wrap",children:h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"⚠"}),h.jsx("div",{className:"empty-msg",children:"FAILED TO LOAD"}),h.jsx("div",{className:"empty-sub",children:_})]})}):l?h.jsx("div",{className:"table-wrap",children:h.jsx("div",{className:"empty",children:h.jsx("div",{className:"spinner"})})}):g.length===0?h.jsx("div",{className:"table-wrap",children:h.jsxs("div",{className:"empty",children:[h.jsx("div",{className:"empty-icon",children:"✓"}),h.jsx("div",{className:"empty-msg",children:"NO FINISHED RUNS YET"}),h.jsx("div",{className:"empty-sub",children:"reliability metrics need at least one success or failure"})]})}):h.jsx("div",{className:"table-wrap",children:h.jsxs("table",{children:[h.jsx("thead",{children:h.jsxs("tr",{children:[h.jsx("th",{children:"ROUTINE"}),h.jsx("th",{children:"STREAK"}),h.jsx("th",{children:"SUCCESS RATE"}),h.jsx("th",{children:"P50"}),h.jsx("th",{children:"P95"}),h.jsx("th",{children:"TREND"})]})}),h.jsx("tbody",{children:g.map(w=>h.jsx(jM,{item:w},w.routineId))})]})})]})}function jM({item:n}){return h.jsxs("tr",{children:[h.jsxs("td",{children:[h.jsx(Eu,{to:`/routines?history=${encodeURIComponent(n.routineId)}`,children:n.routineTitle}),Wx(n)?h.jsxs("span",{className:"run-status running",title:"Alternating pass/fail over the recent sample",children:[" ","FLAKY"]}):null]}),h.jsx("td",{children:h.jsx("span",{className:OM(n.streak),children:wM(n.streak)})}),h.jsx("td",{children:h.jsx("span",{className:CM(ud(n)),children:Kx(ud(n))})}),h.jsx("td",{children:h.jsx("span",{className:"cell-meta",children:od(n.p50Secs)})}),h.jsx("td",{children:h.jsx("span",{className:"cell-meta",children:od(n.p95Secs)})}),h.jsx("td",{children:n.regressing?h.jsx("span",{className:"run-status failed",title:"Recent runs are meaningfully slower than the baseline",children:"SLOWER"}):h.jsx("span",{className:"cell-meta",children:"—"})})]})}function RM(){const{addToast:n}=Nu(),a=r_(),i=l_(),[l,u]=z.useState(""),[o,m]=z.useState(""),[g,b]=z.useState(void 0);a.data!==void 0&&a.data!==g&&(b(a.data),u(a.data),m(a.data));const y=l!==o,_=()=>{i.mutate(l,{onSuccess:()=>{m(l),n("Prompt saved","ok")},onError:w=>n(`Save failed: ${w.message}`,"err")})};return h.jsxs("div",{children:[h.jsx("h1",{className:"page-title",children:"Settings"}),h.jsxs("div",{className:"card",style:{padding:16},children:[h.jsx("div",{style:{fontWeight:700,marginBottom:4},children:"Persistent prompt"}),h.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."}),a.isLoading?h.jsx("div",{children:"Loading…"}):h.jsxs(h.Fragment,{children:[h.jsx("textarea",{className:"form-textarea",rows:12,placeholder:"e.g. always run `cargo fmt` before finishing a task",value:l,onChange:w=>u(w.target.value)}),h.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:10},children:[h.jsx("button",{className:"btn btn-primary",disabled:!y||i.isPending,onClick:_,children:i.isPending?"Saving…":"Save"}),y&&h.jsx("span",{style:{color:"var(--text-faint)",fontSize:12},children:"unsaved changes"})]})]})]})]})}function AM(){return h.jsx(jT,{children:h.jsxs(ki,{element:h.jsx(Z_,{}),children:[h.jsx(ki,{index:!0,element:h.jsx(FO,{})}),h.jsx(ki,{path:"routines",element:h.jsx(XC,{})}),h.jsx(ki,{path:"heatmap",element:h.jsx(yM,{})}),h.jsx(ki,{path:"reliability",element:h.jsx(DM,{})}),h.jsx(ki,{path:"settings",element:h.jsx(RM,{})}),h.jsx(ki,{path:"*",element:h.jsx(CT,{to:"/",replace:!0})})]})})}function kM(){return h.jsx(q_,{children:h.jsx(AM,{})})}const UM=new zN({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Jx=document.getElementById("root");if(!Jx)throw new Error("#root element missing");CE.createRoot(Jx).render(h.jsx(z.StrictMode,{children:h.jsx(LN,{client:UM,children:h.jsx(nN,{basename:"/client",children:h.jsx(kM,{})})})}));</script>
    <style rel="stylesheet" crossorigin>:root{--bg: #14130f;--surface: #1c1a15;--surface-2: #24211b;--border: #343026;--border-strong: #4a4536;--text: #f2ede2;--text-dim: #b3ab98;--text-faint: #7d7566;--accent: #e08a4c;--accent-ink: #14130f;--ok: #7fbf8a;--ok-bg: #1c2b1e;--err: #e2685a;--err-bg: #2e1c19;--warn: #d9ab5c;--warn-bg: #2e2517;--sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Inter, Helvetica, Arial, sans-serif;--mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;--radius: 6px;--shadow: 0 1px 2px rgba(0, 0, 0, .2), 0 4px 12px rgba(0, 0, 0, .18);color-scheme:dark}html.theme-light{--bg: #f7f6f3;--surface: #ffffff;--surface-2: #f0eee9;--border: #e2ded5;--border-strong: #cfc9ba;--text: #1f1d1a;--text-dim: #6b6558;--text-faint: #9b9484;--accent: #b5541e;--accent-ink: #ffffff;--ok: #3f7d4a;--ok-bg: #e8f2e9;--err: #b13a2c;--err-bg: #fbeae7;--warn: #a6741a;--warn-bg: #fbf1de;--shadow: 0 1px 2px rgba(31, 29, 26, .06), 0 4px 12px rgba(31, 29, 26, .05);color-scheme:light}*{box-sizing:border-box}html,body,#root{height:100%}body{margin:0;background:var(--bg);color:var(--text);font-family:var(--sans);font-size:14px;line-height:1.5;-webkit-font-smoothing:antialiased}a{color:inherit}button,input,select,textarea{font-family:inherit;font-size:inherit;color:inherit}.app-shell{display:flex;flex-direction:column;min-height:100%}.app-header{display:flex;align-items:center;gap:16px;padding:12px 20px;border-bottom:1px solid var(--border);background:var(--surface)}.brand{font-weight:700;letter-spacing:.02em;font-size:15px}.brand-sub{color:var(--text-faint);font-weight:500;margin-left:6px}.header-spacer{flex:1}.header-right{display:flex;align-items:center;gap:10px}.dep-warn{font-size:12px;padding:3px 8px;border-radius:var(--radius);background:var(--warn-bg);color:var(--warn);font-weight:600}.health{display:flex;align-items:center;gap:6px;font-size:12px;color:var(--text-dim)}.health-dot{width:8px;height:8px;border-radius:50%;background:var(--text-faint)}.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);padding:6px 10px;cursor:pointer;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}.app-nav{display:flex;gap:4px;padding:0 20px;border-bottom:1px solid var(--border);background:var(--surface)}.nav-link{padding:10px 12px;font-size:13px;font-weight:600;color:var(--text-dim);text-decoration:none;border-bottom:2px solid transparent}.nav-link:hover{color:var(--text)}.nav-link.active{color:var(--accent);border-bottom-color:var(--accent)}.page{flex:1;padding:24px 20px 60px;max-width:1200px;width:100%;margin:0 auto}.page-title{font-size:20px;font-weight:700;margin:0 0 16px}.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);padding:7px 14px;font-size:13px;font-weight:600;cursor:pointer}.btn:hover{border-color:var(--accent)}.btn-primary{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.btn-danger{background:var(--err);border-color:var(--err);color:#fff}.btn-ghost{background:transparent;border-color:transparent}.btn:disabled{opacity:.5;cursor:not-allowed}.overlay{position:fixed;top:0;right:0;bottom:0;left:0;background:#14130f66;display:flex;align-items:flex-start;justify-content:center;padding-top:12vh;z-index:100}.dialog{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);padding:20px;min-width:340px;max-width:90vw}.dialog-title{font-weight:700;margin-bottom:8px}.dialog-msg{color:var(--text-dim);font-size:13px;margin-bottom:16px}.dialog-actions{display:flex;justify-content:flex-end;gap:8px}.form-label{display:block;font-size:12px;font-weight:700;color:var(--text-dim);margin-bottom:6px;letter-spacing:.02em}.form-input,.form-textarea,.form-select{width:100%;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:8px 10px;font-size:13px}.form-textarea{font-family:var(--mono);resize:vertical}.toast-wrap{position:fixed;bottom:16px;right:16px;display:flex;flex-direction:column;gap:8px;z-index:200}.toast{padding:10px 14px;border-radius:var(--radius);font-size:13px;font-weight:600;box-shadow:var(--shadow)}.toast.ok{background:var(--ok-bg);color:var(--ok)}.toast.err{background:var(--err-bg);color:var(--err)}.cmdk{width:560px;max-width:92vw;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow:hidden}.cmdk-search{display:flex;align-items:center;gap:8px;padding:12px 14px;border-bottom:1px solid var(--border)}.cmdk-input{flex:1;border:none;outline:none;background:transparent;font-size:14px}.cmdk-hint{font-size:11px;color:var(--text-faint);border:1px solid var(--border);border-radius:4px;padding:1px 5px}.cmdk-list{list-style:none;margin:0;padding:6px;max-height:50vh;overflow-y:auto}.cmdk-row{display:flex;align-items:center;gap:10px;padding:8px 10px;border-radius:var(--radius);cursor:pointer}.cmdk-row.active{background:var(--surface-2)}.kind-badge{font-size:10px;font-weight:700;padding:2px 6px;border-radius:4px;background:var(--surface-2);color:var(--text-dim);flex-shrink:0}.cmdk-row-text{display:flex;flex-direction:column;min-width:0}.cmdk-row-title{font-size:13px;font-weight:600}.cmdk-row-sub{font-size:12px;color:var(--text-faint);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.cmdk-empty{padding:24px;text-align:center;color:var(--text-faint)}.cmdk-foot{display:flex;gap:14px;padding:8px 14px;border-top:1px solid var(--border);font-size:11px;color:var(--text-faint)}.cmdk-key{border:1px solid var(--border);border-radius:4px;padding:0 4px;margin-right:3px}.stats{display:grid;grid-template-columns:repeat(auto-fit,minmax(110px,1fr));gap:10px;margin-bottom:20px}.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{font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--text-faint);margin-bottom:6px}.stat-val{font-size:24px;font-weight:700;color:var(--text)}.stat-val-sm{font-size:16px}.c-accent{color:var(--accent)}.c-red{color:var(--err)}.c-amber{color:var(--warn)}.section-hd{display:flex;align-items:center;justify-content:space-between;margin:24px 0 8px}.section-label{font-size:12px;font-weight:700;letter-spacing:.05em;color:var(--text-dim)}.section-label.attn{color:var(--err)}.section-acts{display:flex;align-items:center;gap:10px}.table-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);box-shadow:var(--shadow);overflow-x:auto}.table-wrap table{width:100%;border-collapse:collapse;font-size:13px}.table-wrap th{text-align:left;font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--text-faint);padding:10px 14px;border-bottom:1px solid var(--border);white-space:nowrap}.table-wrap td{padding:10px 14px;border-bottom:1px solid var(--border);vertical-align:middle}.table-wrap tbody tr:last-child td{border-bottom:none}.table-wrap tbody tr:hover{background:var(--surface-2)}.empty{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;padding:36px 14px;text-align:center}.empty-icon{font-size:22px;color:var(--text-faint)}.empty-msg{font-size:12px;font-weight:700;letter-spacing:.04em;color:var(--text-dim)}.empty-sub{font-size:12px;color:var(--text-faint)}.spinner{width:20px;height:20px;border-radius:50%;border:2px solid var(--border);border-top-color:var(--accent);animation:spin .7s linear infinite}@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{margin-left:8px;font-size:11px;font-weight:700;color:var(--warn);background:var(--warn-bg);border-radius:4px;padding:1px 6px}.kind-badge.routine{background:var(--surface-2);color:var(--text-dim)}.attn-badge{font-size:11px;font-weight:700;color:var(--err);background:var(--err-bg);border-radius:4px;padding:2px 7px;letter-spacing:.02em}.attn-detail,.cell-schedule-human,.cell-time,.cell-meta{color:var(--text-dim)}.cell-next-when{font-weight:600}.cell-next-until{font-size:12px;color:var(--text-faint)}.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{display:flex;align-items:center;gap:8px}.refresh-lbl{font-size:11px;font-weight:700;letter-spacing:.04em;color:var(--text-faint)}.refresh-select{border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:5px 8px;font-size:12px}.refresh-fresh{font-size:11px;color:var(--text-faint)}.hm-hd{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:16px}.hm-hd-acts{display:flex;align-items:center;gap:14px}.hm-filter{display:flex;gap:4px}.hm-filter-btn{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);padding:5px 12px;font-size:12px;font-weight:600;cursor:pointer;color:var(--text-dim)}.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);overflow-x:auto;padding:14px}.hm-grid{display:grid;grid-template-columns:64px repeat(24,minmax(26px,1fr)) 44px;gap:3px;min-width:760px}.hm-corner,.hm-hcol{font-size:10px;font-weight:700;letter-spacing:.03em;color:var(--text-faint);text-align:center;padding:4px 0}.hm-corner{text-align:left}.hm-hcol.now{color:var(--accent)}.hm-daylabel{border:none;background:transparent;font-size:11px;font-weight:700;color:var(--text-dim);text-align:left;padding:0 6px;cursor:pointer;border-radius:var(--radius)}.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{background:transparent;color:var(--text-faint)}.hm-cell{border:1px solid var(--border);background:var(--surface-2);border-radius:3px;aspect-ratio:1;min-height:22px;padding:0;cursor:pointer;display:flex;align-items:center;justify-content:center}.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{font-size:10px;font-weight:700;color:var(--text)}.hm-rowtot{font-size:11px;color:var(--text-faint);text-align:center;padding:2px 0}.hm-rowtot.hm-foot{border-top:1px solid var(--border);padding-top:6px;font-weight:700;color:var(--text-dim)}.hm-rowtot.grand{color:var(--accent)}.hm-legend{display:flex;align-items:center;gap:6px;margin-top:12px;font-size:11px;color:var(--text-faint)}.hm-legend-label{font-weight:700;letter-spacing:.03em}.hm-legend-swatch{width:14px;height:14px;min-height:0;aspect-ratio:auto;cursor:default;border-radius:3px}.hm-legend-note{margin-left:8px}.hm-day{margin-top:20px;padding:16px}.hm-day-nav{display:flex;align-items:center;gap:8px;margin-bottom:12px}.hm-day-title{font-size:13px;font-weight:700;letter-spacing:.03em}.hm-day-spacer{flex:1}.hm-day-hours{display:flex;flex-direction:column;gap:2px;max-height:520px;overflow-y:auto}.hm-day-hour{display:grid;grid-template-columns:56px 1fr;gap:10px;padding:4px 6px;border-bottom:1px solid var(--border)}.hm-day-hour.now{background:var(--surface-2);border-radius:var(--radius)}.hm-day-hour-label{font-size:11px;color:var(--text-faint);padding-top:3px}.hm-day-hour-slot{display:flex;flex-wrap:wrap;gap:6px}.hm-day-chip{display:flex;align-items:center;gap:6px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);padding:3px 8px;font-size:12px}.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{font-size:11px;color:var(--warn)}.filter-bar{display:flex;flex-wrap:wrap;align-items:center;justify-content:space-between;gap:10px 14px;padding:12px 14px;margin-bottom:12px;background:var(--surface);border:1px solid var(--border);border-radius:var(--radius)}.filter-field{display:flex;flex-wrap:wrap;align-items:center;gap:8px}.filter-label{font-size:11px;font-weight:700;letter-spacing:.03em;color:var(--text-faint)}.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{font-size:12px;color:var(--text-faint)}.saved-views-bar{margin-top:-4px}.group-by-ctrl{display:flex;align-items:center;gap:6px;font-size:11px;font-weight:700;letter-spacing:.03em;color:var(--text-faint)}.view-toggle{display:flex;border:1px solid var(--border-strong);border-radius:var(--radius);overflow:hidden}.view-btn{border:none;background:var(--surface);padding:6px 10px;font-size:12px;font-weight:600;color:var(--text-dim);cursor:pointer}.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);width:26px;height:26px;cursor:pointer;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{color:var(--warn)}.col-select{width:28px}.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-label{font-weight:700;letter-spacing:.03em}.group-count{color:var(--text-faint)}.cell-schedule{font-family:var(--mono);font-size:12px}.cell-goal{color:var(--text-faint);font-size:11px;margin-top:2px}.cell-next,.cell-no-machines{color:var(--text-faint)}.cell-handler{display:inline-flex;align-items:center;gap:6px}.handler-dot{width:7px;height:7px;border-radius:50%;background:var(--text-faint)}.handler-dot.ok{background:var(--ok)}.handler-dot.warn{background:var(--warn)}.cell-triggered{color:var(--text-dim);font-size:12px}.sched-preview-btn{display:block;margin-top:4px;border:none;background:transparent;color:var(--text-faint);font-size:11px;cursor:pointer;padding:0}.sched-preview-btn:hover,.sched-preview-btn.open{color:var(--accent)}.fires-panel{margin-top:6px;padding:8px 10px;background:var(--surface-2);border:1px solid var(--border);border-radius:var(--radius);font-size:11px;max-width:220px}.fires-hd{font-weight:700;letter-spacing:.03em;color:var(--text-faint);margin-bottom:4px}.fires-item{display:flex;justify-content:space-between;gap:10px;padding:2px 0}.fires-until,.fires-empty{color:var(--text-faint)}.spark{display:block}.spark-empty{font-size:12px}.muted{color:var(--text-faint)}.health-badge{display:inline-block;font-size:10px;font-weight:700;letter-spacing:.03em;padding:2px 7px;border-radius:4px;white-space:nowrap}.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{background:var(--err-bg);color:var(--err)}.toggle{position:relative;display:inline-block;width:32px;height:18px}.toggle input{opacity:0;width:0;height:0}.toggle-track{position:absolute;top:0;right:0;bottom:0;left:0;background:var(--border-strong);border-radius:999px;transition:background .15s}.toggle-track:before{content:"";position:absolute;width:14px;height:14px;left:2px;top:2px;background:var(--surface);border-radius:50%;transition:transform .15s}.toggle input:checked+.toggle-track{background:var(--accent)}.toggle input:checked+.toggle-track:before{transform:translate(14px)}.toggle-row{display:flex;align-items:center;justify-content:space-between;padding:8px 0;font-size:12px;font-weight:700;color:var(--text-dim)}.row-actions{display:flex;align-items:center;gap:4px;white-space:nowrap}.act-btn{border:1px solid transparent;background:transparent;border-radius:4px;padding:3px 6px;font-size:10px;font-weight:700;letter-spacing:.02em;color:var(--text-faint);cursor:pointer;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{color:var(--ok)}.flag-badge{margin-left:3px;background:var(--warn-bg);color:var(--warn);border-radius:999px;padding:0 5px;font-size:9px;font-weight:700}.bulk-bar{display:flex;align-items:center;justify-content:space-between;padding:8px 14px;margin-bottom:12px;background:var(--warn-bg);border:1px solid var(--warn);border-radius:var(--radius)}.bulk-count{font-size:12px;font-weight:700;color:var(--warn)}.bulk-acts{display:flex;gap:8px}.create-page{max-width:720px;margin:0 auto}.page-card{padding:20px}.page-freshness{font-size:11px;color:var(--text-faint)}.modal{width:640px;max-width:92vw;max-height:88vh;display:flex;flex-direction:column;padding:0}.modal-hd{display:flex;align-items:center;justify-content:space-between;padding:16px 20px;border-bottom:1px solid var(--border)}.modal-title{font-weight:700}.modal-x{border:none;background:transparent;cursor:pointer;color:var(--text-faint);font-size:14px}.modal-x:hover{color:var(--text)}.modal-body{padding:20px;overflow-y:auto}.modal-ft{display:flex;justify-content:flex-end;gap:8px;padding:14px 20px;border-top:1px solid var(--border)}.form-group{margin-bottom:16px}.cron-presets,.ttl-presets{display:flex;flex-wrap:wrap;gap:6px;margin-top:6px}.preset-btn{border:1px solid var(--border-strong);background:var(--surface);border-radius:var(--radius);padding:4px 9px;font-size:11px;cursor:pointer}.preset-btn:hover{border-color:var(--accent)}.cron-preview{margin-top:6px;font-size:12px;color:var(--text-faint)}.cron-preview.ok{color:var(--ok)}.cron-preview.bad{color:var(--err)}.machine-chips{display:flex;flex-wrap:wrap;gap:6px;margin-bottom:8px}.machine-chip{border:1px solid var(--border-strong);background:var(--surface);border-radius:999px;padding:4px 11px;font-size:12px;cursor:pointer}.machine-chip.on{background:var(--accent);border-color:var(--accent);color:var(--accent-ink)}.machine-empty{font-size:12px;color:var(--text-faint);margin-bottom:8px}.machine-add{display:flex;gap:8px}.machine-add .form-input{flex:1}.logs-page{max-width:1000px;margin:0 auto}.page-hd{display:flex;align-items:center;gap:12px;margin-bottom:16px}.page-hd .page-title{margin:0;flex:1}.logs-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);max-height:70vh;overflow-y:auto}.logs-empty,.logs-error{padding:20px;color:var(--text-faint)}.logs-error{color:var(--err)}.log-search{display:flex;align-items:center;gap:8px;padding:10px 14px;border-bottom:1px solid var(--border);position:sticky;top:0;background:var(--surface)}.log-search-input{flex:1;border:1px solid var(--border-strong);border-radius:var(--radius);background:var(--surface);padding:6px 9px;font-size:12px}.log-match-count{font-size:11px;color:var(--text-faint);white-space:nowrap}.log-lines{font-family:var(--mono);font-size:12px;padding:4px 0}.log-line{display:flex;gap:12px;padding:1px 14px}.log-line:hover{background:var(--surface-2)}.log-ln{color:var(--text-faint);min-width:3.5em;text-align:right;-webkit-user-select:none;user-select:none}.log-lc{white-space:pre-wrap;word-break:break-word}.log-hl{background:var(--warn-bg);color:var(--warn);border-radius:2px}.flags-list{display:flex;flex-direction:column;gap:10px}.flags-count{font-size:12px;color:var(--text-faint)}.flag-item{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);padding:12px 14px}.flag-item-hd{display:flex;align-items:center;gap:10px;margin-bottom:6px}.flag-type{font-weight:700;font-size:12px;text-transform:uppercase}.flag-scope{font-size:11px;color:var(--text-faint);border:1px solid var(--border);border-radius:4px;padding:1px 6px}.flag-age{font-size:11px;color:var(--text-faint);flex:1}.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{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border)}.cal-month{font-weight:700;flex:1}.cal-weekdays{display:grid;grid-template-columns:repeat(7,1fr);border-bottom:1px solid var(--border)}.cal-weekday{padding:6px;text-align:center;font-size:10px;font-weight:700;letter-spacing:.03em;color:var(--text-faint)}.cal-grid{display:grid;grid-template-columns:repeat(7,1fr)}.cal-day{min-height:90px;padding:6px;border-right:1px solid var(--border);border-bottom:1px solid var(--border)}.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{font-size:11px;margin-bottom:4px}.cal-hits{display:flex;flex-direction:column;gap:2px}.cal-chip{font-size:10px;padding:1px 5px;border-radius:3px;background:var(--surface-2);overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.cal-chip.clickable{cursor:pointer}.cal-chip.clickable:hover{background:var(--accent);color:var(--accent-ink)}.cal-chip.snoozed{opacity:.6}.cal-more{font-size:10px;color:var(--text-faint)}.day-wrap{background:var(--surface);border:1px solid var(--border);border-radius:var(--radius);overflow:hidden}.day-nav{display:flex;align-items:center;gap:10px;padding:12px 14px;border-bottom:1px solid var(--border)}.day-date{font-weight:700;flex:1}.day-zoom{display:flex;align-items:center;gap:6px}.day-zoom-level{font-size:11px;color:var(--text-faint);min-width:2em;text-align:center}.day-scroll{max-height:70vh;overflow-y:auto}.day-hour{display:flex;border-bottom:1px solid var(--border);min-height:var(--dh, 40px)}.day-hour.now{background:var(--surface-2)}.day-hour-label{width:60px;flex-shrink:0;padding:6px;font-size:11px;color:var(--text-faint);border-right:1px solid var(--border);display:flex;flex-direction:column;gap:2px}.day-hour-label .qt,.day-hour-label .qt-end{color:var(--text-faint);opacity:.5;font-size:10px}.day-hour-slot{flex:1;padding:4px 8px;display:flex;flex-wrap:wrap;align-content:flex-start;gap:4px;position:relative}.day-scroll.detail .day-hour-slot{display:block}.day-scroll.detail .day-chip{position:absolute;left:8px;right:8px}.day-chip{display:inline-flex;align-items:center;gap:5px;font-size:11px;padding:2px 7px;border-radius:4px;background:var(--surface-2)}.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{font-size:10px;color:var(--warn)}</style>
  </head>
  <body>
    <div id="root"></div>
  </body>
</html>