<!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 Op=t=>{throw TypeError(t)};var Tf=(t,n,s)=>n.has(t)||Op("Cannot "+s);var L=(t,n,s)=>(Tf(t,n,"read from private field"),s?s.call(t):n.get(t)),Ie=(t,n,s)=>n.has(t)?Op("Cannot add the same private member more than once"):n instanceof WeakSet?n.add(t):n.set(t,s),xe=(t,n,s,a)=>(Tf(t,n,"write to private field"),a?a.call(t,s):n.set(t,s),s),Ke=(t,n,s)=>(Tf(t,n,"access private method"),s);var fc=(t,n,s,a)=>({set _(l){xe(t,n,l,s)},get _(){return L(t,n,a)}});function c0(t,n){for(var s=0;s<n.length;s++){const a=n[s];if(typeof a!="string"&&!Array.isArray(a)){for(const l in a)if(l!=="default"&&!(l in t)){const c=Object.getOwnPropertyDescriptor(a,l);c&&Object.defineProperty(t,l,c.get?c:{enumerable:!0,get:()=>a[l]})}}}return Object.freeze(Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}))}(function(){const n=document.createElement("link").relList;if(n&&n.supports&&n.supports("modulepreload"))return;for(const l of document.querySelectorAll('link[rel="modulepreload"]'))a(l);new MutationObserver(l=>{for(const c of l)if(c.type==="childList")for(const h of c.addedNodes)h.tagName==="LINK"&&h.rel==="modulepreload"&&a(h)}).observe(document,{childList:!0,subtree:!0});function s(l){const c={};return l.integrity&&(c.integrity=l.integrity),l.referrerPolicy&&(c.referrerPolicy=l.referrerPolicy),l.crossOrigin==="use-credentials"?c.credentials="include":l.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function a(l){if(l.ep)return;l.ep=!0;const c=s(l);fetch(l.href,c)}})();function d0(t){return t&&t.__esModule&&Object.prototype.hasOwnProperty.call(t,"default")?t.default:t}function f0(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var n=t.default;if(typeof n=="function"){var s=function a(){return this instanceof a?Reflect.construct(n,arguments,this.constructor):n.apply(this,arguments)};s.prototype=n.prototype}else s={};return Object.defineProperty(s,"__esModule",{value:!0}),Object.keys(t).forEach(function(a){var l=Object.getOwnPropertyDescriptor(t,a);Object.defineProperty(s,a,l.get?l:{enumerable:!0,get:function(){return t[a]}})}),s}var Cf={exports:{}},Ml={},Of={exports:{}},nt={};/**
* @license React
* react.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var bp;function h0(){if(bp)return nt;bp=1;var t=Symbol.for("react.element"),n=Symbol.for("react.portal"),s=Symbol.for("react.fragment"),a=Symbol.for("react.strict_mode"),l=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),h=Symbol.for("react.context"),y=Symbol.for("react.forward_ref"),x=Symbol.for("react.suspense"),w=Symbol.for("react.memo"),T=Symbol.for("react.lazy"),E=Symbol.iterator;function _(W){return W===null||typeof W!="object"?null:(W=E&&W[E]||W["@@iterator"],typeof W=="function"?W:null)}var S={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},O=Object.assign,C={};function b(W,se,We){this.props=W,this.context=se,this.refs=C,this.updater=We||S}b.prototype.isReactComponent={},b.prototype.setState=function(W,se){if(typeof W!="object"&&typeof W!="function"&&W!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,W,se,"setState")},b.prototype.forceUpdate=function(W){this.updater.enqueueForceUpdate(this,W,"forceUpdate")};function I(){}I.prototype=b.prototype;function j(W,se,We){this.props=W,this.context=se,this.refs=C,this.updater=We||S}var F=j.prototype=new I;F.constructor=j,O(F,b.prototype),F.isPureReactComponent=!0;var U=Array.isArray,$=Object.prototype.hasOwnProperty,J={current:null},ne={key:!0,ref:!0,__self:!0,__source:!0};function he(W,se,We){var He,Xe={},ze=null,et=null;if(se!=null)for(He in se.ref!==void 0&&(et=se.ref),se.key!==void 0&&(ze=""+se.key),se)$.call(se,He)&&!ne.hasOwnProperty(He)&&(Xe[He]=se[He]);var Ge=arguments.length-2;if(Ge===1)Xe.children=We;else if(1<Ge){for(var lt=Array(Ge),Ct=0;Ct<Ge;Ct++)lt[Ct]=arguments[Ct+2];Xe.children=lt}if(W&&W.defaultProps)for(He in Ge=W.defaultProps,Ge)Xe[He]===void 0&&(Xe[He]=Ge[He]);return{$$typeof:t,type:W,key:ze,ref:et,props:Xe,_owner:J.current}}function ye(W,se){return{$$typeof:t,type:W.type,key:se,ref:W.ref,props:W.props,_owner:W._owner}}function ke(W){return typeof W=="object"&&W!==null&&W.$$typeof===t}function pe(W){var se={"=":"=0",":":"=2"};return"$"+W.replace(/[=:]/g,function(We){return se[We]})}var ge=/\/+/g;function fe(W,se){return typeof W=="object"&&W!==null&&W.key!=null?pe(""+W.key):se.toString(36)}function Ee(W,se,We,He,Xe){var ze=typeof W;(ze==="undefined"||ze==="boolean")&&(W=null);var et=!1;if(W===null)et=!0;else switch(ze){case"string":case"number":et=!0;break;case"object":switch(W.$$typeof){case t:case n:et=!0}}if(et)return et=W,Xe=Xe(et),W=He===""?"."+fe(et,0):He,U(Xe)?(We="",W!=null&&(We=W.replace(ge,"$&/")+"/"),Ee(Xe,se,We,"",function(Ct){return Ct})):Xe!=null&&(ke(Xe)&&(Xe=ye(Xe,We+(!Xe.key||et&&et.key===Xe.key?"":(""+Xe.key).replace(ge,"$&/")+"/")+W)),se.push(Xe)),1;if(et=0,He=He===""?".":He+":",U(W))for(var Ge=0;Ge<W.length;Ge++){ze=W[Ge];var lt=He+fe(ze,Ge);et+=Ee(ze,se,We,lt,Xe)}else if(lt=_(W),typeof lt=="function")for(W=lt.call(W),Ge=0;!(ze=W.next()).done;)ze=ze.value,lt=He+fe(ze,Ge++),et+=Ee(ze,se,We,lt,Xe);else if(ze==="object")throw se=String(W),Error("Objects are not valid as a React child (found: "+(se==="[object Object]"?"object with keys {"+Object.keys(W).join(", ")+"}":se)+"). If you meant to render a collection of children, use an array instead.");return et}function Ce(W,se,We){if(W==null)return W;var He=[],Xe=0;return Ee(W,He,"","",function(ze){return se.call(We,ze,Xe++)}),He}function Ze(W){if(W._status===-1){var se=W._result;se=se(),se.then(function(We){(W._status===0||W._status===-1)&&(W._status=1,W._result=We)},function(We){(W._status===0||W._status===-1)&&(W._status=2,W._result=We)}),W._status===-1&&(W._status=0,W._result=se)}if(W._status===1)return W._result.default;throw W._result}var Me={current:null},ee={transition:null},ve={ReactCurrentDispatcher:Me,ReactCurrentBatchConfig:ee,ReactCurrentOwner:J};function me(){throw Error("act(...) is not supported in production builds of React.")}return nt.Children={map:Ce,forEach:function(W,se,We){Ce(W,function(){se.apply(this,arguments)},We)},count:function(W){var se=0;return Ce(W,function(){se++}),se},toArray:function(W){return Ce(W,function(se){return se})||[]},only:function(W){if(!ke(W))throw Error("React.Children.only expected to receive a single React element child.");return W}},nt.Component=b,nt.Fragment=s,nt.Profiler=l,nt.PureComponent=j,nt.StrictMode=a,nt.Suspense=x,nt.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=ve,nt.act=me,nt.cloneElement=function(W,se,We){if(W==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+W+".");var He=O({},W.props),Xe=W.key,ze=W.ref,et=W._owner;if(se!=null){if(se.ref!==void 0&&(ze=se.ref,et=J.current),se.key!==void 0&&(Xe=""+se.key),W.type&&W.type.defaultProps)var Ge=W.type.defaultProps;for(lt in se)$.call(se,lt)&&!ne.hasOwnProperty(lt)&&(He[lt]=se[lt]===void 0&&Ge!==void 0?Ge[lt]:se[lt])}var lt=arguments.length-2;if(lt===1)He.children=We;else if(1<lt){Ge=Array(lt);for(var Ct=0;Ct<lt;Ct++)Ge[Ct]=arguments[Ct+2];He.children=Ge}return{$$typeof:t,type:W.type,key:Xe,ref:ze,props:He,_owner:et}},nt.createContext=function(W){return W={$$typeof:h,_currentValue:W,_currentValue2:W,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},W.Provider={$$typeof:c,_context:W},W.Consumer=W},nt.createElement=he,nt.createFactory=function(W){var se=he.bind(null,W);return se.type=W,se},nt.createRef=function(){return{current:null}},nt.forwardRef=function(W){return{$$typeof:y,render:W}},nt.isValidElement=ke,nt.lazy=function(W){return{$$typeof:T,_payload:{_status:-1,_result:W},_init:Ze}},nt.memo=function(W,se){return{$$typeof:w,type:W,compare:se===void 0?null:se}},nt.startTransition=function(W){var se=ee.transition;ee.transition={};try{W()}finally{ee.transition=se}},nt.unstable_act=me,nt.useCallback=function(W,se){return Me.current.useCallback(W,se)},nt.useContext=function(W){return Me.current.useContext(W)},nt.useDebugValue=function(){},nt.useDeferredValue=function(W){return Me.current.useDeferredValue(W)},nt.useEffect=function(W,se){return Me.current.useEffect(W,se)},nt.useId=function(){return Me.current.useId()},nt.useImperativeHandle=function(W,se,We){return Me.current.useImperativeHandle(W,se,We)},nt.useInsertionEffect=function(W,se){return Me.current.useInsertionEffect(W,se)},nt.useLayoutEffect=function(W,se){return Me.current.useLayoutEffect(W,se)},nt.useMemo=function(W,se){return Me.current.useMemo(W,se)},nt.useReducer=function(W,se,We){return Me.current.useReducer(W,se,We)},nt.useRef=function(W){return Me.current.useRef(W)},nt.useState=function(W){return Me.current.useState(W)},nt.useSyncExternalStore=function(W,se,We){return Me.current.useSyncExternalStore(W,se,We)},nt.useTransition=function(){return Me.current.useTransition()},nt.version="18.3.1",nt}var jp;function Ch(){return jp||(jp=1,Of.exports=h0()),Of.exports}/**
* @license React
* react-jsx-runtime.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Dp;function m0(){if(Dp)return Ml;Dp=1;var t=Ch(),n=Symbol.for("react.element"),s=Symbol.for("react.fragment"),a=Object.prototype.hasOwnProperty,l=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function h(y,x,w){var T,E={},_=null,S=null;w!==void 0&&(_=""+w),x.key!==void 0&&(_=""+x.key),x.ref!==void 0&&(S=x.ref);for(T in x)a.call(x,T)&&!c.hasOwnProperty(T)&&(E[T]=x[T]);if(y&&y.defaultProps)for(T in x=y.defaultProps,x)E[T]===void 0&&(E[T]=x[T]);return{$$typeof:n,type:y,key:_,ref:S,props:E,_owner:l.current}}return Ml.Fragment=s,Ml.jsx=h,Ml.jsxs=h,Ml}var Rp;function p0(){return Rp||(Rp=1,Cf.exports=m0()),Cf.exports}var d=p0(),Z=Ch();const sn=d0(Z),y0=c0({__proto__:null,default:sn},[Z]);var hc={},bf={exports:{}},En={},jf={exports:{}},Df={};/**
* @license React
* scheduler.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Mp;function g0(){return Mp||(Mp=1,(function(t){function n(ee,ve){var me=ee.length;ee.push(ve);e:for(;0<me;){var W=me-1>>>1,se=ee[W];if(0<l(se,ve))ee[W]=ve,ee[me]=se,me=W;else break e}}function s(ee){return ee.length===0?null:ee[0]}function a(ee){if(ee.length===0)return null;var ve=ee[0],me=ee.pop();if(me!==ve){ee[0]=me;e:for(var W=0,se=ee.length,We=se>>>1;W<We;){var He=2*(W+1)-1,Xe=ee[He],ze=He+1,et=ee[ze];if(0>l(Xe,me))ze<se&&0>l(et,Xe)?(ee[W]=et,ee[ze]=me,W=ze):(ee[W]=Xe,ee[He]=me,W=He);else if(ze<se&&0>l(et,me))ee[W]=et,ee[ze]=me,W=ze;else break e}}return ve}function l(ee,ve){var me=ee.sortIndex-ve.sortIndex;return me!==0?me:ee.id-ve.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;t.unstable_now=function(){return c.now()}}else{var h=Date,y=h.now();t.unstable_now=function(){return h.now()-y}}var x=[],w=[],T=1,E=null,_=3,S=!1,O=!1,C=!1,b=typeof setTimeout=="function"?setTimeout:null,I=typeof clearTimeout=="function"?clearTimeout:null,j=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function F(ee){for(var ve=s(w);ve!==null;){if(ve.callback===null)a(w);else if(ve.startTime<=ee)a(w),ve.sortIndex=ve.expirationTime,n(x,ve);else break;ve=s(w)}}function U(ee){if(C=!1,F(ee),!O)if(s(x)!==null)O=!0,Ze($);else{var ve=s(w);ve!==null&&Me(U,ve.startTime-ee)}}function $(ee,ve){O=!1,C&&(C=!1,I(he),he=-1),S=!0;var me=_;try{for(F(ve),E=s(x);E!==null&&(!(E.expirationTime>ve)||ee&&!pe());){var W=E.callback;if(typeof W=="function"){E.callback=null,_=E.priorityLevel;var se=W(E.expirationTime<=ve);ve=t.unstable_now(),typeof se=="function"?E.callback=se:E===s(x)&&a(x),F(ve)}else a(x);E=s(x)}if(E!==null)var We=!0;else{var He=s(w);He!==null&&Me(U,He.startTime-ve),We=!1}return We}finally{E=null,_=me,S=!1}}var J=!1,ne=null,he=-1,ye=5,ke=-1;function pe(){return!(t.unstable_now()-ke<ye)}function ge(){if(ne!==null){var ee=t.unstable_now();ke=ee;var ve=!0;try{ve=ne(!0,ee)}finally{ve?fe():(J=!1,ne=null)}}else J=!1}var fe;if(typeof j=="function")fe=function(){j(ge)};else if(typeof MessageChannel<"u"){var Ee=new MessageChannel,Ce=Ee.port2;Ee.port1.onmessage=ge,fe=function(){Ce.postMessage(null)}}else fe=function(){b(ge,0)};function Ze(ee){ne=ee,J||(J=!0,fe())}function Me(ee,ve){he=b(function(){ee(t.unstable_now())},ve)}t.unstable_IdlePriority=5,t.unstable_ImmediatePriority=1,t.unstable_LowPriority=4,t.unstable_NormalPriority=3,t.unstable_Profiling=null,t.unstable_UserBlockingPriority=2,t.unstable_cancelCallback=function(ee){ee.callback=null},t.unstable_continueExecution=function(){O||S||(O=!0,Ze($))},t.unstable_forceFrameRate=function(ee){0>ee||125<ee?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):ye=0<ee?Math.floor(1e3/ee):5},t.unstable_getCurrentPriorityLevel=function(){return _},t.unstable_getFirstCallbackNode=function(){return s(x)},t.unstable_next=function(ee){switch(_){case 1:case 2:case 3:var ve=3;break;default:ve=_}var me=_;_=ve;try{return ee()}finally{_=me}},t.unstable_pauseExecution=function(){},t.unstable_requestPaint=function(){},t.unstable_runWithPriority=function(ee,ve){switch(ee){case 1:case 2:case 3:case 4:case 5:break;default:ee=3}var me=_;_=ee;try{return ve()}finally{_=me}},t.unstable_scheduleCallback=function(ee,ve,me){var W=t.unstable_now();switch(typeof me=="object"&&me!==null?(me=me.delay,me=typeof me=="number"&&0<me?W+me:W):me=W,ee){case 1:var se=-1;break;case 2:se=250;break;case 5:se=1073741823;break;case 4:se=1e4;break;default:se=5e3}return se=me+se,ee={id:T++,callback:ve,priorityLevel:ee,startTime:me,expirationTime:se,sortIndex:-1},me>W?(ee.sortIndex=me,n(w,ee),s(x)===null&&ee===s(w)&&(C?(I(he),he=-1):C=!0,Me(U,me-W))):(ee.sortIndex=se,n(x,ee),O||S||(O=!0,Ze($))),ee},t.unstable_shouldYield=pe,t.unstable_wrapCallback=function(ee){var ve=_;return function(){var me=_;_=ve;try{return ee.apply(this,arguments)}finally{_=me}}}})(Df)),Df}var Ip;function v0(){return Ip||(Ip=1,jf.exports=g0()),jf.exports}/**
* @license React
* react-dom.production.min.js
*
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree.
*/var Lp;function x0(){if(Lp)return En;Lp=1;var t=Ch(),n=v0();function s(e){for(var r="https://reactjs.org/docs/error-decoder.html?invariant="+e,i=1;i<arguments.length;i++)r+="&args[]="+encodeURIComponent(arguments[i]);return"Minified React error #"+e+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var a=new Set,l={};function c(e,r){h(e,r),h(e+"Capture",r)}function h(e,r){for(l[e]=r,e=0;e<r.length;e++)a.add(r[e])}var y=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),x=Object.prototype.hasOwnProperty,w=/^[: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]*$/,T={},E={};function _(e){return x.call(E,e)?!0:x.call(T,e)?!1:w.test(e)?E[e]=!0:(T[e]=!0,!1)}function S(e,r,i,u){if(i!==null&&i.type===0)return!1;switch(typeof r){case"function":case"symbol":return!0;case"boolean":return u?!1:i!==null?!i.acceptsBooleans:(e=e.toLowerCase().slice(0,5),e!=="data-"&&e!=="aria-");default:return!1}}function O(e,r,i,u){if(r===null||typeof r>"u"||S(e,r,i,u))return!0;if(u)return!1;if(i!==null)switch(i.type){case 3:return!r;case 4:return r===!1;case 5:return isNaN(r);case 6:return isNaN(r)||1>r}return!1}function C(e,r,i,u,f,p,k){this.acceptsBooleans=r===2||r===3||r===4,this.attributeName=u,this.attributeNamespace=f,this.mustUseProperty=i,this.propertyName=e,this.type=r,this.sanitizeURL=p,this.removeEmptyString=k}var b={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(e){b[e]=new C(e,0,!1,e,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(e){var r=e[0];b[r]=new C(r,1,!1,e[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(e){b[e]=new C(e,2,!1,e.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(e){b[e]=new C(e,2,!1,e,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(e){b[e]=new C(e,3,!1,e.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(e){b[e]=new C(e,3,!0,e,null,!1,!1)}),["capture","download"].forEach(function(e){b[e]=new C(e,4,!1,e,null,!1,!1)}),["cols","rows","size","span"].forEach(function(e){b[e]=new C(e,6,!1,e,null,!1,!1)}),["rowSpan","start"].forEach(function(e){b[e]=new C(e,5,!1,e.toLowerCase(),null,!1,!1)});var I=/[\-:]([a-z])/g;function j(e){return e[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(e){var r=e.replace(I,j);b[r]=new C(r,1,!1,e,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(e){var r=e.replace(I,j);b[r]=new C(r,1,!1,e,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(e){var r=e.replace(I,j);b[r]=new C(r,1,!1,e,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!1,!1)}),b.xlinkHref=new C("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(e){b[e]=new C(e,1,!1,e.toLowerCase(),null,!0,!0)});function F(e,r,i,u){var f=b.hasOwnProperty(r)?b[r]:null;(f!==null?f.type!==0:u||!(2<r.length)||r[0]!=="o"&&r[0]!=="O"||r[1]!=="n"&&r[1]!=="N")&&(O(r,i,f,u)&&(i=null),u||f===null?_(r)&&(i===null?e.removeAttribute(r):e.setAttribute(r,""+i)):f.mustUseProperty?e[f.propertyName]=i===null?f.type===3?!1:"":i:(r=f.attributeName,u=f.attributeNamespace,i===null?e.removeAttribute(r):(f=f.type,i=f===3||f===4&&i===!0?"":""+i,u?e.setAttributeNS(u,r,i):e.setAttribute(r,i))))}var U=t.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,$=Symbol.for("react.element"),J=Symbol.for("react.portal"),ne=Symbol.for("react.fragment"),he=Symbol.for("react.strict_mode"),ye=Symbol.for("react.profiler"),ke=Symbol.for("react.provider"),pe=Symbol.for("react.context"),ge=Symbol.for("react.forward_ref"),fe=Symbol.for("react.suspense"),Ee=Symbol.for("react.suspense_list"),Ce=Symbol.for("react.memo"),Ze=Symbol.for("react.lazy"),Me=Symbol.for("react.offscreen"),ee=Symbol.iterator;function ve(e){return e===null||typeof e!="object"?null:(e=ee&&e[ee]||e["@@iterator"],typeof e=="function"?e:null)}var me=Object.assign,W;function se(e){if(W===void 0)try{throw Error()}catch(i){var r=i.stack.trim().match(/\n( *(at )?)/);W=r&&r[1]||""}return`
`+W+e}var We=!1;function He(e,r){if(!e||We)return"";We=!0;var i=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(r)if(r=function(){throw Error()},Object.defineProperty(r.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(r,[])}catch(X){var u=X}Reflect.construct(e,[],r)}else{try{r.call()}catch(X){u=X}e.call(r.prototype)}else{try{throw Error()}catch(X){u=X}e()}}catch(X){if(X&&u&&typeof X.stack=="string"){for(var f=X.stack.split(`
`),p=u.stack.split(`
`),k=f.length-1,D=p.length-1;1<=k&&0<=D&&f[k]!==p[D];)D--;for(;1<=k&&0<=D;k--,D--)if(f[k]!==p[D]){if(k!==1||D!==1)do if(k--,D--,0>D||f[k]!==p[D]){var P=`
`+f[k].replace(" at new "," at ");return e.displayName&&P.includes("<anonymous>")&&(P=P.replace("<anonymous>",e.displayName)),P}while(1<=k&&0<=D);break}}}finally{We=!1,Error.prepareStackTrace=i}return(e=e?e.displayName||e.name:"")?se(e):""}function Xe(e){switch(e.tag){case 5:return se(e.type);case 16:return se("Lazy");case 13:return se("Suspense");case 19:return se("SuspenseList");case 0:case 2:case 15:return e=He(e.type,!1),e;case 11:return e=He(e.type.render,!1),e;case 1:return e=He(e.type,!0),e;default:return""}}function ze(e){if(e==null)return null;if(typeof e=="function")return e.displayName||e.name||null;if(typeof e=="string")return e;switch(e){case ne:return"Fragment";case J:return"Portal";case ye:return"Profiler";case he:return"StrictMode";case fe:return"Suspense";case Ee:return"SuspenseList"}if(typeof e=="object")switch(e.$$typeof){case pe:return(e.displayName||"Context")+".Consumer";case ke:return(e._context.displayName||"Context")+".Provider";case ge:var r=e.render;return e=e.displayName,e||(e=r.displayName||r.name||"",e=e!==""?"ForwardRef("+e+")":"ForwardRef"),e;case Ce:return r=e.displayName||null,r!==null?r:ze(e.type)||"Memo";case Ze:r=e._payload,e=e._init;try{return ze(e(r))}catch{}}return null}function et(e){var r=e.type;switch(e.tag){case 24:return"Cache";case 9:return(r.displayName||"Context")+".Consumer";case 10:return(r._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return e=r.render,e=e.displayName||e.name||"",r.displayName||(e!==""?"ForwardRef("+e+")":"ForwardRef");case 7:return"Fragment";case 5:return r;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return ze(r);case 8:return r===he?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r}return null}function Ge(e){switch(typeof e){case"boolean":case"number":case"string":case"undefined":return e;case"object":return e;default:return""}}function lt(e){var r=e.type;return(e=e.nodeName)&&e.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function Ct(e){var r=lt(e)?"checked":"value",i=Object.getOwnPropertyDescriptor(e.constructor.prototype,r),u=""+e[r];if(!e.hasOwnProperty(r)&&typeof i<"u"&&typeof i.get=="function"&&typeof i.set=="function"){var f=i.get,p=i.set;return Object.defineProperty(e,r,{configurable:!0,get:function(){return f.call(this)},set:function(k){u=""+k,p.call(this,k)}}),Object.defineProperty(e,r,{enumerable:i.enumerable}),{getValue:function(){return u},setValue:function(k){u=""+k},stopTracking:function(){e._valueTracker=null,delete e[r]}}}}function jn(e){e._valueTracker||(e._valueTracker=Ct(e))}function sr(e){if(!e)return!1;var r=e._valueTracker;if(!r)return!0;var i=r.getValue(),u="";return e&&(u=lt(e)?e.checked?"true":"false":e.value),e=u,e!==i?(r.setValue(e),!0):!1}function $n(e){if(e=e||(typeof document<"u"?document:void 0),typeof e>"u")return null;try{return e.activeElement||e.body}catch{return e.body}}function Nr(e,r){var i=r.checked;return me({},r,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:i??e._wrapperState.initialChecked})}function Wn(e,r){var i=r.defaultValue==null?"":r.defaultValue,u=r.checked!=null?r.checked:r.defaultChecked;i=Ge(r.value!=null?r.value:i),e._wrapperState={initialChecked:u,initialValue:i,controlled:r.type==="checkbox"||r.type==="radio"?r.checked!=null:r.value!=null}}function ir(e,r){r=r.checked,r!=null&&F(e,"checked",r,!1)}function Hn(e,r){ir(e,r);var i=Ge(r.value),u=r.type;if(i!=null)u==="number"?(i===0&&e.value===""||e.value!=i)&&(e.value=""+i):e.value!==""+i&&(e.value=""+i);else if(u==="submit"||u==="reset"){e.removeAttribute("value");return}r.hasOwnProperty("value")?Dn(e,r.type,i):r.hasOwnProperty("defaultValue")&&Dn(e,r.type,Ge(r.defaultValue)),r.checked==null&&r.defaultChecked!=null&&(e.defaultChecked=!!r.defaultChecked)}function ar(e,r,i){if(r.hasOwnProperty("value")||r.hasOwnProperty("defaultValue")){var u=r.type;if(!(u!=="submit"&&u!=="reset"||r.value!==void 0&&r.value!==null))return;r=""+e._wrapperState.initialValue,i||r===e.value||(e.value=r),e.defaultValue=r}i=e.name,i!==""&&(e.name=""),e.defaultChecked=!!e._wrapperState.initialChecked,i!==""&&(e.name=i)}function Dn(e,r,i){(r!=="number"||$n(e.ownerDocument)!==e)&&(i==null?e.defaultValue=""+e._wrapperState.initialValue:e.defaultValue!==""+i&&(e.defaultValue=""+i))}var or=Array.isArray;function Rn(e,r,i,u){if(e=e.options,r){r={};for(var f=0;f<i.length;f++)r["$"+i[f]]=!0;for(i=0;i<e.length;i++)f=r.hasOwnProperty("$"+e[i].value),e[i].selected!==f&&(e[i].selected=f),f&&u&&(e[i].defaultSelected=!0)}else{for(i=""+Ge(i),r=null,f=0;f<e.length;f++){if(e[f].value===i){e[f].selected=!0,u&&(e[f].defaultSelected=!0);return}r!==null||e[f].disabled||(r=e[f])}r!==null&&(r.selected=!0)}}function Zr(e,r){if(r.dangerouslySetInnerHTML!=null)throw Error(s(91));return me({},r,{value:void 0,defaultValue:void 0,children:""+e._wrapperState.initialValue})}function qr(e,r){var i=r.value;if(i==null){if(i=r.children,r=r.defaultValue,i!=null){if(r!=null)throw Error(s(92));if(or(i)){if(1<i.length)throw Error(s(93));i=i[0]}r=i}r==null&&(r=""),i=r}e._wrapperState={initialValue:Ge(i)}}function Qr(e,r){var i=Ge(r.value),u=Ge(r.defaultValue);i!=null&&(i=""+i,i!==e.value&&(e.value=i),r.defaultValue==null&&e.defaultValue!==i&&(e.defaultValue=i)),u!=null&&(e.defaultValue=""+u)}function lr(e){var r=e.textContent;r===e._wrapperState.initialValue&&r!==""&&r!==null&&(e.value=r)}function Bn(e){switch(e){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Yr(e,r){return e==null||e==="http://www.w3.org/1999/xhtml"?Bn(r):e==="http://www.w3.org/2000/svg"&&r==="foreignObject"?"http://www.w3.org/1999/xhtml":e}var At,Gr=(function(e){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(r,i,u,f){MSApp.execUnsafeLocalFunction(function(){return e(r,i,u,f)})}:e})(function(e,r){if(e.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in e)e.innerHTML=r;else{for(At=At||document.createElement("div"),At.innerHTML="<svg>"+r.valueOf().toString()+"</svg>",r=At.firstChild;e.firstChild;)e.removeChild(e.firstChild);for(;r.firstChild;)e.appendChild(r.firstChild)}});function R(e,r){if(r){var i=e.firstChild;if(i&&i===e.lastChild&&i.nodeType===3){i.nodeValue=r;return}}e.textContent=r}var A={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},q=["Webkit","ms","Moz","O"];Object.keys(A).forEach(function(e){q.forEach(function(r){r=r+e.charAt(0).toUpperCase()+e.substring(1),A[r]=A[e]})});function te(e,r,i){return r==null||typeof r=="boolean"||r===""?"":i||typeof r!="number"||r===0||A.hasOwnProperty(e)&&A[e]?(""+r).trim():r+"px"}function le(e,r){e=e.style;for(var i in r)if(r.hasOwnProperty(i)){var u=i.indexOf("--")===0,f=te(i,r[i],u);i==="float"&&(i="cssFloat"),u?e.setProperty(i,f):e[i]=f}}var H=me({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Q(e,r){if(r){if(H[e]&&(r.children!=null||r.dangerouslySetInnerHTML!=null))throw Error(s(137,e));if(r.dangerouslySetInnerHTML!=null){if(r.children!=null)throw Error(s(60));if(typeof r.dangerouslySetInnerHTML!="object"||!("__html"in r.dangerouslySetInnerHTML))throw Error(s(61))}if(r.style!=null&&typeof r.style!="object")throw Error(s(62))}}function re(e,r){if(e.indexOf("-")===-1)return typeof r.is=="string";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 _e=null;function Ye(e){return e=e.target||e.srcElement||window,e.correspondingUseElement&&(e=e.correspondingUseElement),e.nodeType===3?e.parentNode:e}var xt=null,Kt=null,yt=null;function ur(e){if(e=Xs(e)){if(typeof xt!="function")throw Error(s(280));var r=e.stateNode;r&&(r=Gi(r),xt(e.stateNode,e.type,r))}}function ji(e){Kt?yt?yt.push(e):yt=[e]:Kt=e}function Ts(){if(Kt){var e=Kt,r=yt;if(yt=Kt=null,ur(e),r)for(e=0;e<r.length;e++)ur(r[e])}}function Di(e,r){return e(r)}function Cs(){}var Ea=!1;function Po(e,r,i){if(Ea)return e(r,i);Ea=!0;try{return Di(e,r,i)}finally{Ea=!1,(Kt!==null||yt!==null)&&(Cs(),Ts())}}function Os(e,r){var i=e.stateNode;if(i===null)return null;var u=Gi(i);if(u===null)return null;i=u[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(e=e.type,u=!(e==="button"||e==="input"||e==="select"||e==="textarea")),e=!u;break e;default:e=!1}if(e)return null;if(i&&typeof i!="function")throw Error(s(231,r,typeof i));return i}var gt=!1;if(y)try{var Xt={};Object.defineProperty(Xt,"passive",{get:function(){gt=!0}}),window.addEventListener("test",Xt,Xt),window.removeEventListener("test",Xt,Xt)}catch{gt=!1}function tu(e,r,i,u,f,p,k,D,P){var X=Array.prototype.slice.call(arguments,3);try{r.apply(i,X)}catch(oe){this.onError(oe)}}var bs=!1,Jt=null,js=!1,Ta=null,nu={onError:function(e){bs=!0,Jt=e}};function Uo(e,r,i,u,f,p,k,D,P){bs=!1,Jt=null,tu.apply(nu,arguments)}function Ca(e,r,i,u,f,p,k,D,P){if(Uo.apply(this,arguments),bs){if(bs){var X=Jt;bs=!1,Jt=null}else throw Error(s(198));js||(js=!0,Ta=X)}}function Er(e){var r=e,i=e;if(e.alternate)for(;r.return;)r=r.return;else{e=r;do r=e,(r.flags&4098)!==0&&(i=r.return),e=r.return;while(e)}return r.tag===3?i:null}function Oa(e){if(e.tag===13){var r=e.memoizedState;if(r===null&&(e=e.alternate,e!==null&&(r=e.memoizedState)),r!==null)return r.dehydrated}return null}function Vo(e){if(Er(e)!==e)throw Error(s(188))}function ru(e){var r=e.alternate;if(!r){if(r=Er(e),r===null)throw Error(s(188));return r!==e?null:e}for(var i=e,u=r;;){var f=i.return;if(f===null)break;var p=f.alternate;if(p===null){if(u=f.return,u!==null){i=u;continue}break}if(f.child===p.child){for(p=f.child;p;){if(p===i)return Vo(f),e;if(p===u)return Vo(f),r;p=p.sibling}throw Error(s(188))}if(i.return!==u.return)i=f,u=p;else{for(var k=!1,D=f.child;D;){if(D===i){k=!0,i=f,u=p;break}if(D===u){k=!0,u=f,i=p;break}D=D.sibling}if(!k){for(D=p.child;D;){if(D===i){k=!0,i=p,u=f;break}if(D===u){k=!0,u=p,i=f;break}D=D.sibling}if(!k)throw Error(s(189))}}if(i.alternate!==u)throw Error(s(190))}if(i.tag!==3)throw Error(s(188));return i.stateNode.current===i?e:r}function su(e){return e=ru(e),e!==null?iu(e):null}function iu(e){if(e.tag===5||e.tag===6)return e;for(e=e.child;e!==null;){var r=iu(e);if(r!==null)return r;e=e.sibling}return null}var zo=n.unstable_scheduleCallback,$o=n.unstable_cancelCallback,Ue=n.unstable_shouldYield,Tr=n.unstable_requestPaint,wt=n.unstable_now,Zc=n.unstable_getCurrentPriorityLevel,Wo=n.unstable_ImmediatePriority,Ho=n.unstable_UserBlockingPriority,Ri=n.unstable_NormalPriority,qc=n.unstable_LowPriority,Bo=n.unstable_IdlePriority,ba=null,en=null;function Zo(e){if(en&&typeof en.onCommitFiberRoot=="function")try{en.onCommitFiberRoot(ba,e,void 0,(e.current.flags&128)===128)}catch{}}var Nt=Math.clz32?Math.clz32:Cr,Qc=Math.log,Mt=Math.LN2;function Cr(e){return e>>>=0,e===0?32:31-(Qc(e)/Mt|0)|0}var Zn=64,Ds=4194304;function Kr(e){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: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 e&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return e&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return e}}function Or(e,r){var i=e.pendingLanes;if(i===0)return 0;var u=0,f=e.suspendedLanes,p=e.pingedLanes,k=i&268435455;if(k!==0){var D=k&~f;D!==0?u=Kr(D):(p&=k,p!==0&&(u=Kr(p)))}else k=i&~f,k!==0?u=Kr(k):p!==0&&(u=Kr(p));if(u===0)return 0;if(r!==0&&r!==u&&(r&f)===0&&(f=u&-u,p=r&-r,f>=p||f===16&&(p&4194240)!==0))return r;if((u&4)!==0&&(u|=i&16),r=e.entangledLanes,r!==0)for(e=e.entanglements,r&=u;0<r;)i=31-Nt(r),f=1<<i,u|=e[i],r&=~f;return u}function Rs(e,r){switch(e){case 1:case 2:case 4:return r+250;case 8:case 16:case 32:case 64: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 r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function ja(e,r){for(var i=e.suspendedLanes,u=e.pingedLanes,f=e.expirationTimes,p=e.pendingLanes;0<p;){var k=31-Nt(p),D=1<<k,P=f[k];P===-1?((D&i)===0||(D&u)!==0)&&(f[k]=Rs(D,r)):P<=r&&(e.expiredLanes|=D),p&=~D}}function Ms(e){return e=e.pendingLanes&-1073741825,e!==0?e:e&1073741824?1073741824:0}function qo(){var e=Zn;return Zn<<=1,(Zn&4194240)===0&&(Zn=64),e}function Xr(e){for(var r=[],i=0;31>i;i++)r.push(e);return r}function Jr(e,r,i){e.pendingLanes|=r,r!==536870912&&(e.suspendedLanes=0,e.pingedLanes=0),e=e.eventTimes,r=31-Nt(r),e[r]=i}function au(e,r){var i=e.pendingLanes&~r;e.pendingLanes=r,e.suspendedLanes=0,e.pingedLanes=0,e.expiredLanes&=r,e.mutableReadLanes&=r,e.entangledLanes&=r,r=e.entanglements;var u=e.eventTimes;for(e=e.expirationTimes;0<i;){var f=31-Nt(i),p=1<<f;r[f]=0,u[f]=-1,e[f]=-1,i&=~p}}function Is(e,r){var i=e.entangledLanes|=r;for(e=e.entanglements;i;){var u=31-Nt(i),f=1<<u;f&r|e[u]&r&&(e[u]|=r),i&=~f}}var ut=0;function Mi(e){return e&=-e,1<e?4<e?(e&268435455)!==0?16:536870912:4:1}var Ls,Fs,ou,Qo,lu,Da=!1,Ii=[],cr=null,br=null,dr=null,As=new Map,Li=new Map,jr=[],Yc="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 submit".split(" ");function Yo(e,r){switch(e){case"focusin":case"focusout":cr=null;break;case"dragenter":case"dragleave":br=null;break;case"mouseover":case"mouseout":dr=null;break;case"pointerover":case"pointerout":As.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":Li.delete(r.pointerId)}}function Fi(e,r,i,u,f,p){return e===null||e.nativeEvent!==p?(e={blockedOn:r,domEventName:i,eventSystemFlags:u,nativeEvent:p,targetContainers:[f]},r!==null&&(r=Xs(r),r!==null&&Fs(r)),e):(e.eventSystemFlags|=u,r=e.targetContainers,f!==null&&r.indexOf(f)===-1&&r.push(f),e)}function Gc(e,r,i,u,f){switch(r){case"focusin":return cr=Fi(cr,e,r,i,u,f),!0;case"dragenter":return br=Fi(br,e,r,i,u,f),!0;case"mouseover":return dr=Fi(dr,e,r,i,u,f),!0;case"pointerover":var p=f.pointerId;return As.set(p,Fi(As.get(p)||null,e,r,i,u,f)),!0;case"gotpointercapture":return p=f.pointerId,Li.set(p,Fi(Li.get(p)||null,e,r,i,u,f)),!0}return!1}function uu(e){var r=In(e.target);if(r!==null){var i=Er(r);if(i!==null){if(r=i.tag,r===13){if(r=Oa(i),r!==null){e.blockedOn=r,lu(e.priority,function(){ou(i)});return}}else if(r===3&&i.stateNode.current.memoizedState.isDehydrated){e.blockedOn=i.tag===3?i.stateNode.containerInfo:null;return}}}e.blockedOn=null}function Ra(e){if(e.blockedOn!==null)return!1;for(var r=e.targetContainers;0<r.length;){var i=Go(e.domEventName,e.eventSystemFlags,r[0],e.nativeEvent);if(i===null){i=e.nativeEvent;var u=new i.constructor(i.type,i);_e=u,i.target.dispatchEvent(u),_e=null}else return r=Xs(i),r!==null&&Fs(r),e.blockedOn=i,!1;r.shift()}return!0}function cu(e,r,i){Ra(e)&&i.delete(r)}function du(){Da=!1,cr!==null&&Ra(cr)&&(cr=null),br!==null&&Ra(br)&&(br=null),dr!==null&&Ra(dr)&&(dr=null),As.forEach(cu),Li.forEach(cu)}function Ai(e,r){e.blockedOn===r&&(e.blockedOn=null,Da||(Da=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,du)))}function It(e){function r(f){return Ai(f,e)}if(0<Ii.length){Ai(Ii[0],e);for(var i=1;i<Ii.length;i++){var u=Ii[i];u.blockedOn===e&&(u.blockedOn=null)}}for(cr!==null&&Ai(cr,e),br!==null&&Ai(br,e),dr!==null&&Ai(dr,e),As.forEach(r),Li.forEach(r),i=0;i<jr.length;i++)u=jr[i],u.blockedOn===e&&(u.blockedOn=null);for(;0<jr.length&&(i=jr[0],i.blockedOn===null);)uu(i),i.blockedOn===null&&jr.shift()}var es=U.ReactCurrentBatchConfig,fr=!0;function Ps(e,r,i,u){var f=ut,p=es.transition;es.transition=null;try{ut=1,Ma(e,r,i,u)}finally{ut=f,es.transition=p}}function Us(e,r,i,u){var f=ut,p=es.transition;es.transition=null;try{ut=4,Ma(e,r,i,u)}finally{ut=f,es.transition=p}}function Ma(e,r,i,u){if(fr){var f=Go(e,r,i,u);if(f===null)Za(e,r,u,Pi,i),Yo(e,u);else if(Gc(f,e,r,i,u))u.stopPropagation();else if(Yo(e,u),r&4&&-1<Yc.indexOf(e)){for(;f!==null;){var p=Xs(f);if(p!==null&&Ls(p),p=Go(e,r,i,u),p===null&&Za(e,r,u,Pi,i),p===f)break;f=p}f!==null&&u.stopPropagation()}else Za(e,r,u,null,i)}}var Pi=null;function Go(e,r,i,u){if(Pi=null,e=Ye(u),e=In(e),e!==null)if(r=Er(e),r===null)e=null;else if(i=r.tag,i===13){if(e=Oa(r),e!==null)return e;e=null}else if(i===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;e=null}else r!==e&&(e=null);return Pi=e,null}function Ia(e){switch(e){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(Zc()){case Wo:return 1;case Ho:return 4;case Ri:case qc:return 16;case Bo:return 536870912;default:return 16}default:return 16}}var hr=null,Ui=null,La=null;function fu(){if(La)return La;var e,r=Ui,i=r.length,u,f="value"in hr?hr.value:hr.textContent,p=f.length;for(e=0;e<i&&r[e]===f[e];e++);var k=i-e;for(u=1;u<=k&&r[i-u]===f[p-u];u++);return La=f.slice(e,1<u?1-u:void 0)}function Fa(e){var r=e.keyCode;return"charCode"in e?(e=e.charCode,e===0&&r===13&&(e=13)):e=r,e===10&&(e=13),32<=e||e===13?e:0}function Aa(){return!0}function hu(){return!1}function hn(e){function r(i,u,f,p,k){this._reactName=i,this._targetInst=f,this.type=u,this.nativeEvent=p,this.target=k,this.currentTarget=null;for(var D in e)e.hasOwnProperty(D)&&(i=e[D],this[D]=i?i(p):p[D]);return this.isDefaultPrevented=(p.defaultPrevented!=null?p.defaultPrevented:p.returnValue===!1)?Aa:hu,this.isPropagationStopped=hu,this}return me(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var i=this.nativeEvent;i&&(i.preventDefault?i.preventDefault():typeof i.returnValue!="unknown"&&(i.returnValue=!1),this.isDefaultPrevented=Aa)},stopPropagation:function(){var i=this.nativeEvent;i&&(i.stopPropagation?i.stopPropagation():typeof i.cancelBubble!="unknown"&&(i.cancelBubble=!0),this.isPropagationStopped=Aa)},persist:function(){},isPersistent:Aa}),r}var ts={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(e){return e.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ko=hn(ts),qn=me({},ts,{view:0,detail:0}),Kc=hn(qn),Dr,ns,mr,Pa=me({},qn,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:tl,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!==mr&&(mr&&e.type==="mousemove"?(Dr=e.screenX-mr.screenX,ns=e.screenY-mr.screenY):ns=Dr=0,mr=e),Dr)},movementY:function(e){return"movementY"in e?e.movementY:ns}}),mu=hn(Pa),Xc=me({},Pa,{dataTransfer:0}),Jc=hn(Xc),Xo=me({},qn,{relatedTarget:0}),Jo=hn(Xo),ed=me({},ts,{animationName:0,elapsedTime:0,pseudoElement:0}),td=hn(ed),nd=me({},ts,{clipboardData:function(e){return"clipboardData"in e?e.clipboardData:window.clipboardData}}),rd=hn(nd),sd=me({},ts,{data:0}),el=hn(sd),id={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},ad={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"},od={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function ld(e){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(e):(e=od[e])?!!r[e]:!1}function tl(){return ld}var pu=me({},qn,{key:function(e){if(e.key){var r=id[e.key]||e.key;if(r!=="Unidentified")return r}return e.type==="keypress"?(e=Fa(e),e===13?"Enter":String.fromCharCode(e)):e.type==="keydown"||e.type==="keyup"?ad[e.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:tl,charCode:function(e){return e.type==="keypress"?Fa(e):0},keyCode:function(e){return e.type==="keydown"||e.type==="keyup"?e.keyCode:0},which:function(e){return e.type==="keypress"?Fa(e):e.type==="keydown"||e.type==="keyup"?e.keyCode:0}}),ud=hn(pu),cd=me({},Pa,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),yu=hn(cd),dd=me({},qn,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:tl}),fd=hn(dd),hd=me({},ts,{propertyName:0,elapsedTime:0,pseudoElement:0}),md=hn(hd),pd=me({},Pa,{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}),yd=hn(pd),gd=[9,13,27,32],nl=y&&"CompositionEvent"in window,Vi=null;y&&"documentMode"in document&&(Vi=document.documentMode);var vd=y&&"TextEvent"in window&&!Vi,rl=y&&(!nl||Vi&&8<Vi&&11>=Vi),sl=" ",gu=!1;function mn(e,r){switch(e){case"keyup":return gd.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function rs(e){return e=e.detail,typeof e=="object"&&"data"in e?e.data:null}var Vs=!1;function ss(e,r){switch(e){case"compositionend":return rs(r);case"keypress":return r.which!==32?null:(gu=!0,sl);case"textInput":return e=r.data,e===sl&&gu?null:e;default:return null}}function xd(e,r){if(Vs)return e==="compositionend"||!nl&&mn(e,r)?(e=fu(),La=Ui=hr=null,Vs=!1,e):null;switch(e){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return rl&&r.locale!=="ko"?null:r.data;default:return null}}var pr={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 il(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r==="input"?!!pr[e.type]:r==="textarea"}function al(e,r,i,u){ji(u),r=Qi(r,"onChange"),0<r.length&&(i=new Ko("onChange","change",null,i,u),e.push({event:i,listeners:r}))}var zs=null,Je=null;function $s(e){Cu(e,0)}function Ua(e){var r=Js(e);if(sr(r))return e}function St(e,r){if(e==="change")return r}var Ws=!1;if(y){var Va;if(y){var ol="oninput"in document;if(!ol){var vu=document.createElement("div");vu.setAttribute("oninput","return;"),ol=typeof vu.oninput=="function"}Va=ol}else Va=!1;Ws=Va&&(!document.documentMode||9<document.documentMode)}function xu(){zs&&(zs.detachEvent("onpropertychange",it),Je=zs=null)}function it(e){if(e.propertyName==="value"&&Ua(Je)){var r=[];al(r,Je,e,Ye(e)),Po($s,r)}}function Yh(e,r,i){e==="focusin"?(xu(),zs=r,Je=i,zs.attachEvent("onpropertychange",it)):e==="focusout"&&xu()}function wu(e){if(e==="selectionchange"||e==="keyup"||e==="keydown")return Ua(Je)}function Su(e,r){if(e==="click")return Ua(r)}function wd(e,r){if(e==="input"||e==="change")return Ua(r)}function ku(e,r){return e===r&&(e!==0||1/e===1/r)||e!==e&&r!==r}var Ot=typeof Object.is=="function"?Object.is:ku;function Hs(e,r){if(Ot(e,r))return!0;if(typeof e!="object"||e===null||typeof r!="object"||r===null)return!1;var i=Object.keys(e),u=Object.keys(r);if(i.length!==u.length)return!1;for(u=0;u<i.length;u++){var f=i[u];if(!x.call(r,f)||!Ot(e[f],r[f]))return!1}return!0}function zi(e){for(;e&&e.firstChild;)e=e.firstChild;return e}function _u(e,r){var i=zi(e);e=0;for(var u;i;){if(i.nodeType===3){if(u=e+i.textContent.length,e<=r&&u>=r)return{node:i,offset:r-e};e=u}e:{for(;i;){if(i.nextSibling){i=i.nextSibling;break e}i=i.parentNode}i=void 0}i=zi(i)}}function Nu(e,r){return e&&r?e===r?!0:e&&e.nodeType===3?!1:r&&r.nodeType===3?Nu(e,r.parentNode):"contains"in e?e.contains(r):e.compareDocumentPosition?!!(e.compareDocumentPosition(r)&16):!1:!1}function Eu(){for(var e=window,r=$n();r instanceof e.HTMLIFrameElement;){try{var i=typeof r.contentWindow.location.href=="string"}catch{i=!1}if(i)e=r.contentWindow;else break;r=$n(e.document)}return r}function ll(e){var r=e&&e.nodeName&&e.nodeName.toLowerCase();return r&&(r==="input"&&(e.type==="text"||e.type==="search"||e.type==="tel"||e.type==="url"||e.type==="password")||r==="textarea"||e.contentEditable==="true")}function Sd(e){var r=Eu(),i=e.focusedElem,u=e.selectionRange;if(r!==i&&i&&i.ownerDocument&&Nu(i.ownerDocument.documentElement,i)){if(u!==null&&ll(i)){if(r=u.start,e=u.end,e===void 0&&(e=r),"selectionStart"in i)i.selectionStart=r,i.selectionEnd=Math.min(e,i.value.length);else if(e=(r=i.ownerDocument||document)&&r.defaultView||window,e.getSelection){e=e.getSelection();var f=i.textContent.length,p=Math.min(u.start,f);u=u.end===void 0?p:Math.min(u.end,f),!e.extend&&p>u&&(f=u,u=p,p=f),f=_u(i,p);var k=_u(i,u);f&&k&&(e.rangeCount!==1||e.anchorNode!==f.node||e.anchorOffset!==f.offset||e.focusNode!==k.node||e.focusOffset!==k.offset)&&(r=r.createRange(),r.setStart(f.node,f.offset),e.removeAllRanges(),p>u?(e.addRange(r),e.extend(k.node,k.offset)):(r.setEnd(k.node,k.offset),e.addRange(r)))}}for(r=[],e=i;e=e.parentNode;)e.nodeType===1&&r.push({element:e,left:e.scrollLeft,top:e.scrollTop});for(typeof i.focus=="function"&&i.focus(),i=0;i<r.length;i++)e=r[i],e.element.scrollLeft=e.left,e.element.scrollTop=e.top}}var kd=y&&"documentMode"in document&&11>=document.documentMode,Bs=null,$i=null,Wi=null,ul=!1;function cl(e,r,i){var u=i.window===i?i.document:i.nodeType===9?i:i.ownerDocument;ul||Bs==null||Bs!==$n(u)||(u=Bs,"selectionStart"in u&&ll(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Wi&&Hs(Wi,u)||(Wi=u,u=Qi($i,"onSelect"),0<u.length&&(r=new Ko("onSelect","select",null,r,i),e.push({event:r,listeners:u}),r.target=Bs)))}function Hi(e,r){var i={};return i[e.toLowerCase()]=r.toLowerCase(),i["Webkit"+e]="webkit"+r,i["Moz"+e]="moz"+r,i}var is={animationend:Hi("Animation","AnimationEnd"),animationiteration:Hi("Animation","AnimationIteration"),animationstart:Hi("Animation","AnimationStart"),transitionend:Hi("Transition","TransitionEnd")},dl={},fl={};y&&(fl=document.createElement("div").style,"AnimationEvent"in window||(delete is.animationend.animation,delete is.animationiteration.animation,delete is.animationstart.animation),"TransitionEvent"in window||delete is.transitionend.transition);function Zs(e){if(dl[e])return dl[e];if(!is[e])return e;var r=is[e],i;for(i in r)if(r.hasOwnProperty(i)&&i in fl)return dl[e]=r[i];return e}var hl=Zs("animationend"),qs=Zs("animationiteration"),za=Zs("animationstart"),$a=Zs("transitionend"),Rr=new Map,ml="abort auxClick 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(" ");function Mn(e,r){Rr.set(e,r),c(r,[e])}for(var Qs=0;Qs<ml.length;Qs++){var Wa=ml[Qs],Ys=Wa.toLowerCase(),Ha=Wa[0].toUpperCase()+Wa.slice(1);Mn(Ys,"on"+Ha)}Mn(hl,"onAnimationEnd"),Mn(qs,"onAnimationIteration"),Mn(za,"onAnimationStart"),Mn("dblclick","onDoubleClick"),Mn("focusin","onFocus"),Mn("focusout","onBlur"),Mn($a,"onTransitionEnd"),h("onMouseEnter",["mouseout","mouseover"]),h("onMouseLeave",["mouseout","mouseover"]),h("onPointerEnter",["pointerout","pointerover"]),h("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var as="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),Tu=new Set("cancel close invalid load scroll toggle".split(" ").concat(as));function pl(e,r,i){var u=e.type||"unknown-event";e.currentTarget=i,Ca(u,r,void 0,e),e.currentTarget=null}function Cu(e,r){r=(r&4)!==0;for(var i=0;i<e.length;i++){var u=e[i],f=u.event;u=u.listeners;e:{var p=void 0;if(r)for(var k=u.length-1;0<=k;k--){var D=u[k],P=D.instance,X=D.currentTarget;if(D=D.listener,P!==p&&f.isPropagationStopped())break e;pl(f,D,X),p=P}else for(k=0;k<u.length;k++){if(D=u[k],P=D.instance,X=D.currentTarget,D=D.listener,P!==p&&f.isPropagationStopped())break e;pl(f,D,X),p=P}}}if(js)throw e=Ta,js=!1,Ta=null,e}function vt(e,r){var i=r[pn];i===void 0&&(i=r[pn]=new Set);var u=e+"__bubble";i.has(u)||(Zi(r,e,2,!1),i.add(u))}function Gs(e,r,i){var u=0;r&&(u|=4),Zi(i,e,u,r)}var Ba="_reactListening"+Math.random().toString(36).slice(2);function Bi(e){if(!e[Ba]){e[Ba]=!0,a.forEach(function(i){i!=="selectionchange"&&(Tu.has(i)||Gs(i,!1,e),Gs(i,!0,e))});var r=e.nodeType===9?e:e.ownerDocument;r===null||r[Ba]||(r[Ba]=!0,Gs("selectionchange",!1,r))}}function Zi(e,r,i,u){switch(Ia(r)){case 1:var f=Ps;break;case 4:f=Us;break;default:f=Ma}i=f.bind(null,r,i,e),f=void 0,!gt||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(f=!0),u?f!==void 0?e.addEventListener(r,i,{capture:!0,passive:f}):e.addEventListener(r,i,!0):f!==void 0?e.addEventListener(r,i,{passive:f}):e.addEventListener(r,i,!1)}function Za(e,r,i,u,f){var p=u;if((r&1)===0&&(r&2)===0&&u!==null)e:for(;;){if(u===null)return;var k=u.tag;if(k===3||k===4){var D=u.stateNode.containerInfo;if(D===f||D.nodeType===8&&D.parentNode===f)break;if(k===4)for(k=u.return;k!==null;){var P=k.tag;if((P===3||P===4)&&(P=k.stateNode.containerInfo,P===f||P.nodeType===8&&P.parentNode===f))return;k=k.return}for(;D!==null;){if(k=In(D),k===null)return;if(P=k.tag,P===5||P===6){u=p=k;continue e}D=D.parentNode}}u=u.return}Po(function(){var X=p,oe=Ye(i),ue=[];e:{var ie=Rr.get(e);if(ie!==void 0){var we=Ko,Oe=e;switch(e){case"keypress":if(Fa(i)===0)break e;case"keydown":case"keyup":we=ud;break;case"focusin":Oe="focus",we=Jo;break;case"focusout":Oe="blur",we=Jo;break;case"beforeblur":case"afterblur":we=Jo;break;case"click":if(i.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":we=mu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":we=Jc;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":we=fd;break;case hl:case qs:case za:we=td;break;case $a:we=md;break;case"scroll":we=Kc;break;case"wheel":we=yd;break;case"copy":case"cut":case"paste":we=rd;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":we=yu}var be=(r&4)!==0,Pt=!be&&e==="scroll",G=be?ie!==null?ie+"Capture":null:ie;be=[];for(var z=X,K;z!==null;){K=z;var ce=K.stateNode;if(K.tag===5&&ce!==null&&(K=ce,G!==null&&(ce=Os(z,G),ce!=null&&be.push(qi(z,ce,K)))),Pt)break;z=z.return}0<be.length&&(ie=new we(ie,Oe,null,i,oe),ue.push({event:ie,listeners:be}))}}if((r&7)===0){e:{if(ie=e==="mouseover"||e==="pointerover",we=e==="mouseout"||e==="pointerout",ie&&i!==_e&&(Oe=i.relatedTarget||i.fromElement)&&(In(Oe)||Oe[mt]))break e;if((we||ie)&&(ie=oe.window===oe?oe:(ie=oe.ownerDocument)?ie.defaultView||ie.parentWindow:window,we?(Oe=i.relatedTarget||i.toElement,we=X,Oe=Oe?In(Oe):null,Oe!==null&&(Pt=Er(Oe),Oe!==Pt||Oe.tag!==5&&Oe.tag!==6)&&(Oe=null)):(we=null,Oe=X),we!==Oe)){if(be=mu,ce="onMouseLeave",G="onMouseEnter",z="mouse",(e==="pointerout"||e==="pointerover")&&(be=yu,ce="onPointerLeave",G="onPointerEnter",z="pointer"),Pt=we==null?ie:Js(we),K=Oe==null?ie:Js(Oe),ie=new be(ce,z+"leave",we,i,oe),ie.target=Pt,ie.relatedTarget=K,ce=null,In(oe)===X&&(be=new be(G,z+"enter",Oe,i,oe),be.target=K,be.relatedTarget=Pt,ce=be),Pt=ce,we&&Oe)t:{for(be=we,G=Oe,z=0,K=be;K;K=os(K))z++;for(K=0,ce=G;ce;ce=os(ce))K++;for(;0<z-K;)be=os(be),z--;for(;0<K-z;)G=os(G),K--;for(;z--;){if(be===G||G!==null&&be===G.alternate)break t;be=os(be),G=os(G)}be=null}else be=null;we!==null&&yl(ue,ie,we,be,!1),Oe!==null&&Pt!==null&&yl(ue,Pt,Oe,be,!0)}}e:{if(ie=X?Js(X):window,we=ie.nodeName&&ie.nodeName.toLowerCase(),we==="select"||we==="input"&&ie.type==="file")var De=St;else if(il(ie))if(Ws)De=wd;else{De=wu;var Ae=Yh}else(we=ie.nodeName)&&we.toLowerCase()==="input"&&(ie.type==="checkbox"||ie.type==="radio")&&(De=Su);if(De&&(De=De(e,X))){al(ue,De,i,oe);break e}Ae&&Ae(e,ie,X),e==="focusout"&&(Ae=ie._wrapperState)&&Ae.controlled&&ie.type==="number"&&Dn(ie,"number",ie.value)}switch(Ae=X?Js(X):window,e){case"focusin":(il(Ae)||Ae.contentEditable==="true")&&(Bs=Ae,$i=X,Wi=null);break;case"focusout":Wi=$i=Bs=null;break;case"mousedown":ul=!0;break;case"contextmenu":case"mouseup":case"dragend":ul=!1,cl(ue,i,oe);break;case"selectionchange":if(kd)break;case"keydown":case"keyup":cl(ue,i,oe)}var Pe;if(nl)e:{switch(e){case"compositionstart":var Be="onCompositionStart";break e;case"compositionend":Be="onCompositionEnd";break e;case"compositionupdate":Be="onCompositionUpdate";break e}Be=void 0}else Vs?mn(e,i)&&(Be="onCompositionEnd"):e==="keydown"&&i.keyCode===229&&(Be="onCompositionStart");Be&&(rl&&i.locale!=="ko"&&(Vs||Be!=="onCompositionStart"?Be==="onCompositionEnd"&&Vs&&(Pe=fu()):(hr=oe,Ui="value"in hr?hr.value:hr.textContent,Vs=!0)),Ae=Qi(X,Be),0<Ae.length&&(Be=new el(Be,e,null,i,oe),ue.push({event:Be,listeners:Ae}),Pe?Be.data=Pe:(Pe=rs(i),Pe!==null&&(Be.data=Pe)))),(Pe=vd?ss(e,i):xd(e,i))&&(X=Qi(X,"onBeforeInput"),0<X.length&&(oe=new el("onBeforeInput","beforeinput",null,i,oe),ue.push({event:oe,listeners:X}),oe.data=Pe))}Cu(ue,r)})}function qi(e,r,i){return{instance:e,listener:r,currentTarget:i}}function Qi(e,r){for(var i=r+"Capture",u=[];e!==null;){var f=e,p=f.stateNode;f.tag===5&&p!==null&&(f=p,p=Os(e,i),p!=null&&u.unshift(qi(e,p,f)),p=Os(e,r),p!=null&&u.push(qi(e,p,f))),e=e.return}return u}function os(e){if(e===null)return null;do e=e.return;while(e&&e.tag!==5);return e||null}function yl(e,r,i,u,f){for(var p=r._reactName,k=[];i!==null&&i!==u;){var D=i,P=D.alternate,X=D.stateNode;if(P!==null&&P===u)break;D.tag===5&&X!==null&&(D=X,f?(P=Os(i,p),P!=null&&k.unshift(qi(i,P,D))):f||(P=Os(i,p),P!=null&&k.push(qi(i,P,D)))),i=i.return}k.length!==0&&e.push({event:r,listeners:k})}var Yi=/\r\n?/g,gl=/\u0000|\uFFFD/g;function Ve(e){return(typeof e=="string"?e:""+e).replace(Yi,`
`).replace(gl,"")}function Mr(e,r,i){if(r=Ve(r),Ve(e)!==r&&i)throw Error(s(425))}function qa(){}var g=null,o=null;function m(e,r){return e==="textarea"||e==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var v=typeof setTimeout=="function"?setTimeout:void 0,N=typeof clearTimeout=="function"?clearTimeout:void 0,M=typeof Promise=="function"?Promise:void 0,V=typeof queueMicrotask=="function"?queueMicrotask:typeof M<"u"?function(e){return M.resolve(null).then(e).catch(B)}:v;function B(e){setTimeout(function(){throw e})}function Y(e,r){var i=r,u=0;do{var f=i.nextSibling;if(e.removeChild(i),f&&f.nodeType===8)if(i=f.data,i==="/$"){if(u===0){e.removeChild(f),It(r);return}u--}else i!=="$"&&i!=="$?"&&i!=="$!"||u++;i=f}while(i);It(r)}function ae(e){for(;e!=null;e=e.nextSibling){var r=e.nodeType;if(r===1||r===3)break;if(r===8){if(r=e.data,r==="$"||r==="$!"||r==="$?")break;if(r==="/$")return null}}return e}function Le(e){e=e.previousSibling;for(var r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="$"||i==="$!"||i==="$?"){if(r===0)return e;r--}else i==="/$"&&r++}e=e.previousSibling}return null}var $e=Math.random().toString(36).slice(2),tt="__reactFiber$"+$e,Fe="__reactProps$"+$e,mt="__reactContainer$"+$e,pn="__reactEvents$"+$e,Qn="__reactListeners$"+$e,Ks="__reactHandles$"+$e;function In(e){var r=e[tt];if(r)return r;for(var i=e.parentNode;i;){if(r=i[mt]||i[tt]){if(i=r.alternate,r.child!==null||i!==null&&i.child!==null)for(e=Le(e);e!==null;){if(i=e[tt])return i;e=Le(e)}return r}e=i,i=e.parentNode}return null}function Xs(e){return e=e[tt]||e[mt],!e||e.tag!==5&&e.tag!==6&&e.tag!==13&&e.tag!==3?null:e}function Js(e){if(e.tag===5||e.tag===6)return e.stateNode;throw Error(s(33))}function Gi(e){return e[Fe]||null}var vl=[],ei=-1;function Ir(e){return{current:e}}function ht(e){0>ei||(e.current=vl[ei],vl[ei]=null,ei--)}function ct(e,r){ei++,vl[ei]=e.current,e.current=r}var Lr={},on=Ir(Lr),wn=Ir(!1),Ki=Lr;function Qa(e,r){var i=e.type.contextTypes;if(!i)return Lr;var u=e.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===r)return u.__reactInternalMemoizedMaskedChildContext;var f={},p;for(p in i)f[p]=r[p];return u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=r,e.__reactInternalMemoizedMaskedChildContext=f),f}function Sn(e){return e=e.childContextTypes,e!=null}function Ou(){ht(wn),ht(on)}function Gh(e,r,i){if(on.current!==Lr)throw Error(s(168));ct(on,r),ct(wn,i)}function Kh(e,r,i){var u=e.stateNode;if(r=r.childContextTypes,typeof u.getChildContext!="function")return i;u=u.getChildContext();for(var f in u)if(!(f in r))throw Error(s(108,et(e)||"Unknown",f));return me({},i,u)}function bu(e){return e=(e=e.stateNode)&&e.__reactInternalMemoizedMergedChildContext||Lr,Ki=on.current,ct(on,e),ct(wn,wn.current),!0}function Xh(e,r,i){var u=e.stateNode;if(!u)throw Error(s(169));i?(e=Kh(e,r,Ki),u.__reactInternalMemoizedMergedChildContext=e,ht(wn),ht(on),ct(on,e)):ht(wn),ct(wn,i)}var ls=null,ju=!1,_d=!1;function Jh(e){ls===null?ls=[e]:ls.push(e)}function bv(e){ju=!0,Jh(e)}function ti(){if(!_d&&ls!==null){_d=!0;var e=0,r=ut;try{var i=ls;for(ut=1;e<i.length;e++){var u=i[e];do u=u(!0);while(u!==null)}ls=null,ju=!1}catch(f){throw ls!==null&&(ls=ls.slice(e+1)),zo(Wo,ti),f}finally{ut=r,_d=!1}}return null}var Ya=[],Ga=0,Du=null,Ru=0,Yn=[],Gn=0,Xi=null,us=1,cs="";function Ji(e,r){Ya[Ga++]=Ru,Ya[Ga++]=Du,Du=e,Ru=r}function em(e,r,i){Yn[Gn++]=us,Yn[Gn++]=cs,Yn[Gn++]=Xi,Xi=e;var u=us;e=cs;var f=32-Nt(u)-1;u&=~(1<<f),i+=1;var p=32-Nt(r)+f;if(30<p){var k=f-f%5;p=(u&(1<<k)-1).toString(32),u>>=k,f-=k,us=1<<32-Nt(r)+f|i<<f|u,cs=p+e}else us=1<<p|i<<f|u,cs=e}function Nd(e){e.return!==null&&(Ji(e,1),em(e,1,0))}function Ed(e){for(;e===Du;)Du=Ya[--Ga],Ya[Ga]=null,Ru=Ya[--Ga],Ya[Ga]=null;for(;e===Xi;)Xi=Yn[--Gn],Yn[Gn]=null,cs=Yn[--Gn],Yn[Gn]=null,us=Yn[--Gn],Yn[Gn]=null}var Ln=null,Fn=null,Et=!1,yr=null;function tm(e,r){var i=er(5,null,null,0);i.elementType="DELETED",i.stateNode=r,i.return=e,r=e.deletions,r===null?(e.deletions=[i],e.flags|=16):r.push(i)}function nm(e,r){switch(e.tag){case 5:var i=e.type;return r=r.nodeType!==1||i.toLowerCase()!==r.nodeName.toLowerCase()?null:r,r!==null?(e.stateNode=r,Ln=e,Fn=ae(r.firstChild),!0):!1;case 6:return r=e.pendingProps===""||r.nodeType!==3?null:r,r!==null?(e.stateNode=r,Ln=e,Fn=null,!0):!1;case 13:return r=r.nodeType!==8?null:r,r!==null?(i=Xi!==null?{id:us,overflow:cs}:null,e.memoizedState={dehydrated:r,treeContext:i,retryLane:1073741824},i=er(18,null,null,0),i.stateNode=r,i.return=e,e.child=i,Ln=e,Fn=null,!0):!1;default:return!1}}function Td(e){return(e.mode&1)!==0&&(e.flags&128)===0}function Cd(e){if(Et){var r=Fn;if(r){var i=r;if(!nm(e,r)){if(Td(e))throw Error(s(418));r=ae(i.nextSibling);var u=Ln;r&&nm(e,r)?tm(u,i):(e.flags=e.flags&-4097|2,Et=!1,Ln=e)}}else{if(Td(e))throw Error(s(418));e.flags=e.flags&-4097|2,Et=!1,Ln=e}}}function rm(e){for(e=e.return;e!==null&&e.tag!==5&&e.tag!==3&&e.tag!==13;)e=e.return;Ln=e}function Mu(e){if(e!==Ln)return!1;if(!Et)return rm(e),Et=!0,!1;var r;if((r=e.tag!==3)&&!(r=e.tag!==5)&&(r=e.type,r=r!=="head"&&r!=="body"&&!m(e.type,e.memoizedProps)),r&&(r=Fn)){if(Td(e))throw sm(),Error(s(418));for(;r;)tm(e,r),r=ae(r.nextSibling)}if(rm(e),e.tag===13){if(e=e.memoizedState,e=e!==null?e.dehydrated:null,!e)throw Error(s(317));e:{for(e=e.nextSibling,r=0;e;){if(e.nodeType===8){var i=e.data;if(i==="/$"){if(r===0){Fn=ae(e.nextSibling);break e}r--}else i!=="$"&&i!=="$!"&&i!=="$?"||r++}e=e.nextSibling}Fn=null}}else Fn=Ln?ae(e.stateNode.nextSibling):null;return!0}function sm(){for(var e=Fn;e;)e=ae(e.nextSibling)}function Ka(){Fn=Ln=null,Et=!1}function Od(e){yr===null?yr=[e]:yr.push(e)}var jv=U.ReactCurrentBatchConfig;function xl(e,r,i){if(e=i.ref,e!==null&&typeof e!="function"&&typeof e!="object"){if(i._owner){if(i=i._owner,i){if(i.tag!==1)throw Error(s(309));var u=i.stateNode}if(!u)throw Error(s(147,e));var f=u,p=""+e;return r!==null&&r.ref!==null&&typeof r.ref=="function"&&r.ref._stringRef===p?r.ref:(r=function(k){var D=f.refs;k===null?delete D[p]:D[p]=k},r._stringRef=p,r)}if(typeof e!="string")throw Error(s(284));if(!i._owner)throw Error(s(290,e))}return e}function Iu(e,r){throw e=Object.prototype.toString.call(r),Error(s(31,e==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":e))}function im(e){var r=e._init;return r(e._payload)}function am(e){function r(G,z){if(e){var K=G.deletions;K===null?(G.deletions=[z],G.flags|=16):K.push(z)}}function i(G,z){if(!e)return null;for(;z!==null;)r(G,z),z=z.sibling;return null}function u(G,z){for(G=new Map;z!==null;)z.key!==null?G.set(z.key,z):G.set(z.index,z),z=z.sibling;return G}function f(G,z){return G=ui(G,z),G.index=0,G.sibling=null,G}function p(G,z,K){return G.index=K,e?(K=G.alternate,K!==null?(K=K.index,K<z?(G.flags|=2,z):K):(G.flags|=2,z)):(G.flags|=1048576,z)}function k(G){return e&&G.alternate===null&&(G.flags|=2),G}function D(G,z,K,ce){return z===null||z.tag!==6?(z=wf(K,G.mode,ce),z.return=G,z):(z=f(z,K),z.return=G,z)}function P(G,z,K,ce){var De=K.type;return De===ne?oe(G,z,K.props.children,ce,K.key):z!==null&&(z.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Ze&&im(De)===z.type)?(ce=f(z,K.props),ce.ref=xl(G,z,K),ce.return=G,ce):(ce=sc(K.type,K.key,K.props,null,G.mode,ce),ce.ref=xl(G,z,K),ce.return=G,ce)}function X(G,z,K,ce){return z===null||z.tag!==4||z.stateNode.containerInfo!==K.containerInfo||z.stateNode.implementation!==K.implementation?(z=Sf(K,G.mode,ce),z.return=G,z):(z=f(z,K.children||[]),z.return=G,z)}function oe(G,z,K,ce,De){return z===null||z.tag!==7?(z=oa(K,G.mode,ce,De),z.return=G,z):(z=f(z,K),z.return=G,z)}function ue(G,z,K){if(typeof z=="string"&&z!==""||typeof z=="number")return z=wf(""+z,G.mode,K),z.return=G,z;if(typeof z=="object"&&z!==null){switch(z.$$typeof){case $:return K=sc(z.type,z.key,z.props,null,G.mode,K),K.ref=xl(G,null,z),K.return=G,K;case J:return z=Sf(z,G.mode,K),z.return=G,z;case Ze:var ce=z._init;return ue(G,ce(z._payload),K)}if(or(z)||ve(z))return z=oa(z,G.mode,K,null),z.return=G,z;Iu(G,z)}return null}function ie(G,z,K,ce){var De=z!==null?z.key:null;if(typeof K=="string"&&K!==""||typeof K=="number")return De!==null?null:D(G,z,""+K,ce);if(typeof K=="object"&&K!==null){switch(K.$$typeof){case $:return K.key===De?P(G,z,K,ce):null;case J:return K.key===De?X(G,z,K,ce):null;case Ze:return De=K._init,ie(G,z,De(K._payload),ce)}if(or(K)||ve(K))return De!==null?null:oe(G,z,K,ce,null);Iu(G,K)}return null}function we(G,z,K,ce,De){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return G=G.get(K)||null,D(z,G,""+ce,De);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case $:return G=G.get(ce.key===null?K:ce.key)||null,P(z,G,ce,De);case J:return G=G.get(ce.key===null?K:ce.key)||null,X(z,G,ce,De);case Ze:var Ae=ce._init;return we(G,z,K,Ae(ce._payload),De)}if(or(ce)||ve(ce))return G=G.get(K)||null,oe(z,G,ce,De,null);Iu(z,ce)}return null}function Oe(G,z,K,ce){for(var De=null,Ae=null,Pe=z,Be=z=0,Yt=null;Pe!==null&&Be<K.length;Be++){Pe.index>Be?(Yt=Pe,Pe=null):Yt=Pe.sibling;var dt=ie(G,Pe,K[Be],ce);if(dt===null){Pe===null&&(Pe=Yt);break}e&&Pe&&dt.alternate===null&&r(G,Pe),z=p(dt,z,Be),Ae===null?De=dt:Ae.sibling=dt,Ae=dt,Pe=Yt}if(Be===K.length)return i(G,Pe),Et&&Ji(G,Be),De;if(Pe===null){for(;Be<K.length;Be++)Pe=ue(G,K[Be],ce),Pe!==null&&(z=p(Pe,z,Be),Ae===null?De=Pe:Ae.sibling=Pe,Ae=Pe);return Et&&Ji(G,Be),De}for(Pe=u(G,Pe);Be<K.length;Be++)Yt=we(Pe,G,Be,K[Be],ce),Yt!==null&&(e&&Yt.alternate!==null&&Pe.delete(Yt.key===null?Be:Yt.key),z=p(Yt,z,Be),Ae===null?De=Yt:Ae.sibling=Yt,Ae=Yt);return e&&Pe.forEach(function(ci){return r(G,ci)}),Et&&Ji(G,Be),De}function be(G,z,K,ce){var De=ve(K);if(typeof De!="function")throw Error(s(150));if(K=De.call(K),K==null)throw Error(s(151));for(var Ae=De=null,Pe=z,Be=z=0,Yt=null,dt=K.next();Pe!==null&&!dt.done;Be++,dt=K.next()){Pe.index>Be?(Yt=Pe,Pe=null):Yt=Pe.sibling;var ci=ie(G,Pe,dt.value,ce);if(ci===null){Pe===null&&(Pe=Yt);break}e&&Pe&&ci.alternate===null&&r(G,Pe),z=p(ci,z,Be),Ae===null?De=ci:Ae.sibling=ci,Ae=ci,Pe=Yt}if(dt.done)return i(G,Pe),Et&&Ji(G,Be),De;if(Pe===null){for(;!dt.done;Be++,dt=K.next())dt=ue(G,dt.value,ce),dt!==null&&(z=p(dt,z,Be),Ae===null?De=dt:Ae.sibling=dt,Ae=dt);return Et&&Ji(G,Be),De}for(Pe=u(G,Pe);!dt.done;Be++,dt=K.next())dt=we(Pe,G,Be,dt.value,ce),dt!==null&&(e&&dt.alternate!==null&&Pe.delete(dt.key===null?Be:dt.key),z=p(dt,z,Be),Ae===null?De=dt:Ae.sibling=dt,Ae=dt);return e&&Pe.forEach(function(u0){return r(G,u0)}),Et&&Ji(G,Be),De}function Pt(G,z,K,ce){if(typeof K=="object"&&K!==null&&K.type===ne&&K.key===null&&(K=K.props.children),typeof K=="object"&&K!==null){switch(K.$$typeof){case $:e:{for(var De=K.key,Ae=z;Ae!==null;){if(Ae.key===De){if(De=K.type,De===ne){if(Ae.tag===7){i(G,Ae.sibling),z=f(Ae,K.props.children),z.return=G,G=z;break e}}else if(Ae.elementType===De||typeof De=="object"&&De!==null&&De.$$typeof===Ze&&im(De)===Ae.type){i(G,Ae.sibling),z=f(Ae,K.props),z.ref=xl(G,Ae,K),z.return=G,G=z;break e}i(G,Ae);break}else r(G,Ae);Ae=Ae.sibling}K.type===ne?(z=oa(K.props.children,G.mode,ce,K.key),z.return=G,G=z):(ce=sc(K.type,K.key,K.props,null,G.mode,ce),ce.ref=xl(G,z,K),ce.return=G,G=ce)}return k(G);case J:e:{for(Ae=K.key;z!==null;){if(z.key===Ae)if(z.tag===4&&z.stateNode.containerInfo===K.containerInfo&&z.stateNode.implementation===K.implementation){i(G,z.sibling),z=f(z,K.children||[]),z.return=G,G=z;break e}else{i(G,z);break}else r(G,z);z=z.sibling}z=Sf(K,G.mode,ce),z.return=G,G=z}return k(G);case Ze:return Ae=K._init,Pt(G,z,Ae(K._payload),ce)}if(or(K))return Oe(G,z,K,ce);if(ve(K))return be(G,z,K,ce);Iu(G,K)}return typeof K=="string"&&K!==""||typeof K=="number"?(K=""+K,z!==null&&z.tag===6?(i(G,z.sibling),z=f(z,K),z.return=G,G=z):(i(G,z),z=wf(K,G.mode,ce),z.return=G,G=z),k(G)):i(G,z)}return Pt}var Xa=am(!0),om=am(!1),Lu=Ir(null),Fu=null,Ja=null,bd=null;function jd(){bd=Ja=Fu=null}function Dd(e){var r=Lu.current;ht(Lu),e._currentValue=r}function Rd(e,r,i){for(;e!==null;){var u=e.alternate;if((e.childLanes&r)!==r?(e.childLanes|=r,u!==null&&(u.childLanes|=r)):u!==null&&(u.childLanes&r)!==r&&(u.childLanes|=r),e===i)break;e=e.return}}function eo(e,r){Fu=e,bd=Ja=null,e=e.dependencies,e!==null&&e.firstContext!==null&&((e.lanes&r)!==0&&(kn=!0),e.firstContext=null)}function Kn(e){var r=e._currentValue;if(bd!==e)if(e={context:e,memoizedValue:r,next:null},Ja===null){if(Fu===null)throw Error(s(308));Ja=e,Fu.dependencies={lanes:0,firstContext:e}}else Ja=Ja.next=e;return r}var ea=null;function Md(e){ea===null?ea=[e]:ea.push(e)}function lm(e,r,i,u){var f=r.interleaved;return f===null?(i.next=i,Md(r)):(i.next=f.next,f.next=i),r.interleaved=i,ds(e,u)}function ds(e,r){e.lanes|=r;var i=e.alternate;for(i!==null&&(i.lanes|=r),i=e,e=e.return;e!==null;)e.childLanes|=r,i=e.alternate,i!==null&&(i.childLanes|=r),i=e,e=e.return;return i.tag===3?i.stateNode:null}var ni=!1;function Id(e){e.updateQueue={baseState:e.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function um(e,r){e=e.updateQueue,r.updateQueue===e&&(r.updateQueue={baseState:e.baseState,firstBaseUpdate:e.firstBaseUpdate,lastBaseUpdate:e.lastBaseUpdate,shared:e.shared,effects:e.effects})}function fs(e,r){return{eventTime:e,lane:r,tag:0,payload:null,callback:null,next:null}}function ri(e,r,i){var u=e.updateQueue;if(u===null)return null;if(u=u.shared,(at&2)!==0){var f=u.pending;return f===null?r.next=r:(r.next=f.next,f.next=r),u.pending=r,ds(e,i)}return f=u.interleaved,f===null?(r.next=r,Md(u)):(r.next=f.next,f.next=r),u.interleaved=r,ds(e,i)}function Au(e,r,i){if(r=r.updateQueue,r!==null&&(r=r.shared,(i&4194240)!==0)){var u=r.lanes;u&=e.pendingLanes,i|=u,r.lanes=i,Is(e,i)}}function cm(e,r){var i=e.updateQueue,u=e.alternate;if(u!==null&&(u=u.updateQueue,i===u)){var f=null,p=null;if(i=i.firstBaseUpdate,i!==null){do{var k={eventTime:i.eventTime,lane:i.lane,tag:i.tag,payload:i.payload,callback:i.callback,next:null};p===null?f=p=k:p=p.next=k,i=i.next}while(i!==null);p===null?f=p=r:p=p.next=r}else f=p=r;i={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:p,shared:u.shared,effects:u.effects},e.updateQueue=i;return}e=i.lastBaseUpdate,e===null?i.firstBaseUpdate=r:e.next=r,i.lastBaseUpdate=r}function Pu(e,r,i,u){var f=e.updateQueue;ni=!1;var p=f.firstBaseUpdate,k=f.lastBaseUpdate,D=f.shared.pending;if(D!==null){f.shared.pending=null;var P=D,X=P.next;P.next=null,k===null?p=X:k.next=X,k=P;var oe=e.alternate;oe!==null&&(oe=oe.updateQueue,D=oe.lastBaseUpdate,D!==k&&(D===null?oe.firstBaseUpdate=X:D.next=X,oe.lastBaseUpdate=P))}if(p!==null){var ue=f.baseState;k=0,oe=X=P=null,D=p;do{var ie=D.lane,we=D.eventTime;if((u&ie)===ie){oe!==null&&(oe=oe.next={eventTime:we,lane:0,tag:D.tag,payload:D.payload,callback:D.callback,next:null});e:{var Oe=e,be=D;switch(ie=r,we=i,be.tag){case 1:if(Oe=be.payload,typeof Oe=="function"){ue=Oe.call(we,ue,ie);break e}ue=Oe;break e;case 3:Oe.flags=Oe.flags&-65537|128;case 0:if(Oe=be.payload,ie=typeof Oe=="function"?Oe.call(we,ue,ie):Oe,ie==null)break e;ue=me({},ue,ie);break e;case 2:ni=!0}}D.callback!==null&&D.lane!==0&&(e.flags|=64,ie=f.effects,ie===null?f.effects=[D]:ie.push(D))}else we={eventTime:we,lane:ie,tag:D.tag,payload:D.payload,callback:D.callback,next:null},oe===null?(X=oe=we,P=ue):oe=oe.next=we,k|=ie;if(D=D.next,D===null){if(D=f.shared.pending,D===null)break;ie=D,D=ie.next,ie.next=null,f.lastBaseUpdate=ie,f.shared.pending=null}}while(!0);if(oe===null&&(P=ue),f.baseState=P,f.firstBaseUpdate=X,f.lastBaseUpdate=oe,r=f.shared.interleaved,r!==null){f=r;do k|=f.lane,f=f.next;while(f!==r)}else p===null&&(f.shared.lanes=0);ra|=k,e.lanes=k,e.memoizedState=ue}}function dm(e,r,i){if(e=r.effects,r.effects=null,e!==null)for(r=0;r<e.length;r++){var u=e[r],f=u.callback;if(f!==null){if(u.callback=null,u=i,typeof f!="function")throw Error(s(191,f));f.call(u)}}}var wl={},Fr=Ir(wl),Sl=Ir(wl),kl=Ir(wl);function ta(e){if(e===wl)throw Error(s(174));return e}function Ld(e,r){switch(ct(kl,r),ct(Sl,e),ct(Fr,wl),e=r.nodeType,e){case 9:case 11:r=(r=r.documentElement)?r.namespaceURI:Yr(null,"");break;default:e=e===8?r.parentNode:r,r=e.namespaceURI||null,e=e.tagName,r=Yr(r,e)}ht(Fr),ct(Fr,r)}function to(){ht(Fr),ht(Sl),ht(kl)}function fm(e){ta(kl.current);var r=ta(Fr.current),i=Yr(r,e.type);r!==i&&(ct(Sl,e),ct(Fr,i))}function Fd(e){Sl.current===e&&(ht(Fr),ht(Sl))}var bt=Ir(0);function Uu(e){for(var r=e;r!==null;){if(r.tag===13){var i=r.memoizedState;if(i!==null&&(i=i.dehydrated,i===null||i.data==="$?"||i.data==="$!"))return r}else if(r.tag===19&&r.memoizedProps.revealOrder!==void 0){if((r.flags&128)!==0)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var Ad=[];function Pd(){for(var e=0;e<Ad.length;e++)Ad[e]._workInProgressVersionPrimary=null;Ad.length=0}var Vu=U.ReactCurrentDispatcher,Ud=U.ReactCurrentBatchConfig,na=0,jt=null,Wt=null,qt=null,zu=!1,_l=!1,Nl=0,Dv=0;function ln(){throw Error(s(321))}function Vd(e,r){if(r===null)return!1;for(var i=0;i<r.length&&i<e.length;i++)if(!Ot(e[i],r[i]))return!1;return!0}function zd(e,r,i,u,f,p){if(na=p,jt=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,Vu.current=e===null||e.memoizedState===null?Lv:Fv,e=i(u,f),_l){p=0;do{if(_l=!1,Nl=0,25<=p)throw Error(s(301));p+=1,qt=Wt=null,r.updateQueue=null,Vu.current=Av,e=i(u,f)}while(_l)}if(Vu.current=Hu,r=Wt!==null&&Wt.next!==null,na=0,qt=Wt=jt=null,zu=!1,r)throw Error(s(300));return e}function $d(){var e=Nl!==0;return Nl=0,e}function Ar(){var e={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return qt===null?jt.memoizedState=qt=e:qt=qt.next=e,qt}function Xn(){if(Wt===null){var e=jt.alternate;e=e!==null?e.memoizedState:null}else e=Wt.next;var r=qt===null?jt.memoizedState:qt.next;if(r!==null)qt=r,Wt=e;else{if(e===null)throw Error(s(310));Wt=e,e={memoizedState:Wt.memoizedState,baseState:Wt.baseState,baseQueue:Wt.baseQueue,queue:Wt.queue,next:null},qt===null?jt.memoizedState=qt=e:qt=qt.next=e}return qt}function El(e,r){return typeof r=="function"?r(e):r}function Wd(e){var r=Xn(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var u=Wt,f=u.baseQueue,p=i.pending;if(p!==null){if(f!==null){var k=f.next;f.next=p.next,p.next=k}u.baseQueue=f=p,i.pending=null}if(f!==null){p=f.next,u=u.baseState;var D=k=null,P=null,X=p;do{var oe=X.lane;if((na&oe)===oe)P!==null&&(P=P.next={lane:0,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null}),u=X.hasEagerState?X.eagerState:e(u,X.action);else{var ue={lane:oe,action:X.action,hasEagerState:X.hasEagerState,eagerState:X.eagerState,next:null};P===null?(D=P=ue,k=u):P=P.next=ue,jt.lanes|=oe,ra|=oe}X=X.next}while(X!==null&&X!==p);P===null?k=u:P.next=D,Ot(u,r.memoizedState)||(kn=!0),r.memoizedState=u,r.baseState=k,r.baseQueue=P,i.lastRenderedState=u}if(e=i.interleaved,e!==null){f=e;do p=f.lane,jt.lanes|=p,ra|=p,f=f.next;while(f!==e)}else f===null&&(i.lanes=0);return[r.memoizedState,i.dispatch]}function Hd(e){var r=Xn(),i=r.queue;if(i===null)throw Error(s(311));i.lastRenderedReducer=e;var u=i.dispatch,f=i.pending,p=r.memoizedState;if(f!==null){i.pending=null;var k=f=f.next;do p=e(p,k.action),k=k.next;while(k!==f);Ot(p,r.memoizedState)||(kn=!0),r.memoizedState=p,r.baseQueue===null&&(r.baseState=p),i.lastRenderedState=p}return[p,u]}function hm(){}function mm(e,r){var i=jt,u=Xn(),f=r(),p=!Ot(u.memoizedState,f);if(p&&(u.memoizedState=f,kn=!0),u=u.queue,Bd(gm.bind(null,i,u,e),[e]),u.getSnapshot!==r||p||qt!==null&&qt.memoizedState.tag&1){if(i.flags|=2048,Tl(9,ym.bind(null,i,u,f,r),void 0,null),Qt===null)throw Error(s(349));(na&30)!==0||pm(i,r,f)}return f}function pm(e,r,i){e.flags|=16384,e={getSnapshot:r,value:i},r=jt.updateQueue,r===null?(r={lastEffect:null,stores:null},jt.updateQueue=r,r.stores=[e]):(i=r.stores,i===null?r.stores=[e]:i.push(e))}function ym(e,r,i,u){r.value=i,r.getSnapshot=u,vm(r)&&xm(e)}function gm(e,r,i){return i(function(){vm(r)&&xm(e)})}function vm(e){var r=e.getSnapshot;e=e.value;try{var i=r();return!Ot(e,i)}catch{return!0}}function xm(e){var r=ds(e,1);r!==null&&wr(r,e,1,-1)}function wm(e){var r=Ar();return typeof e=="function"&&(e=e()),r.memoizedState=r.baseState=e,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:El,lastRenderedState:e},r.queue=e,e=e.dispatch=Iv.bind(null,jt,e),[r.memoizedState,e]}function Tl(e,r,i,u){return e={tag:e,create:r,destroy:i,deps:u,next:null},r=jt.updateQueue,r===null?(r={lastEffect:null,stores:null},jt.updateQueue=r,r.lastEffect=e.next=e):(i=r.lastEffect,i===null?r.lastEffect=e.next=e:(u=i.next,i.next=e,e.next=u,r.lastEffect=e)),e}function Sm(){return Xn().memoizedState}function $u(e,r,i,u){var f=Ar();jt.flags|=e,f.memoizedState=Tl(1|r,i,void 0,u===void 0?null:u)}function Wu(e,r,i,u){var f=Xn();u=u===void 0?null:u;var p=void 0;if(Wt!==null){var k=Wt.memoizedState;if(p=k.destroy,u!==null&&Vd(u,k.deps)){f.memoizedState=Tl(r,i,p,u);return}}jt.flags|=e,f.memoizedState=Tl(1|r,i,p,u)}function km(e,r){return $u(8390656,8,e,r)}function Bd(e,r){return Wu(2048,8,e,r)}function _m(e,r){return Wu(4,2,e,r)}function Nm(e,r){return Wu(4,4,e,r)}function Em(e,r){if(typeof r=="function")return e=e(),r(e),function(){r(null)};if(r!=null)return e=e(),r.current=e,function(){r.current=null}}function Tm(e,r,i){return i=i!=null?i.concat([e]):null,Wu(4,4,Em.bind(null,r,e),i)}function Zd(){}function Cm(e,r){var i=Xn();r=r===void 0?null:r;var u=i.memoizedState;return u!==null&&r!==null&&Vd(r,u[1])?u[0]:(i.memoizedState=[e,r],e)}function Om(e,r){var i=Xn();r=r===void 0?null:r;var u=i.memoizedState;return u!==null&&r!==null&&Vd(r,u[1])?u[0]:(e=e(),i.memoizedState=[e,r],e)}function bm(e,r,i){return(na&21)===0?(e.baseState&&(e.baseState=!1,kn=!0),e.memoizedState=i):(Ot(i,r)||(i=qo(),jt.lanes|=i,ra|=i,e.baseState=!0),r)}function Rv(e,r){var i=ut;ut=i!==0&&4>i?i:4,e(!0);var u=Ud.transition;Ud.transition={};try{e(!1),r()}finally{ut=i,Ud.transition=u}}function jm(){return Xn().memoizedState}function Mv(e,r,i){var u=oi(e);if(i={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null},Dm(e))Rm(r,i);else if(i=lm(e,r,i,u),i!==null){var f=gn();wr(i,e,u,f),Mm(i,r,u)}}function Iv(e,r,i){var u=oi(e),f={lane:u,action:i,hasEagerState:!1,eagerState:null,next:null};if(Dm(e))Rm(r,f);else{var p=e.alternate;if(e.lanes===0&&(p===null||p.lanes===0)&&(p=r.lastRenderedReducer,p!==null))try{var k=r.lastRenderedState,D=p(k,i);if(f.hasEagerState=!0,f.eagerState=D,Ot(D,k)){var P=r.interleaved;P===null?(f.next=f,Md(r)):(f.next=P.next,P.next=f),r.interleaved=f;return}}catch{}finally{}i=lm(e,r,f,u),i!==null&&(f=gn(),wr(i,e,u,f),Mm(i,r,u))}}function Dm(e){var r=e.alternate;return e===jt||r!==null&&r===jt}function Rm(e,r){_l=zu=!0;var i=e.pending;i===null?r.next=r:(r.next=i.next,i.next=r),e.pending=r}function Mm(e,r,i){if((i&4194240)!==0){var u=r.lanes;u&=e.pendingLanes,i|=u,r.lanes=i,Is(e,i)}}var Hu={readContext:Kn,useCallback:ln,useContext:ln,useEffect:ln,useImperativeHandle:ln,useInsertionEffect:ln,useLayoutEffect:ln,useMemo:ln,useReducer:ln,useRef:ln,useState:ln,useDebugValue:ln,useDeferredValue:ln,useTransition:ln,useMutableSource:ln,useSyncExternalStore:ln,useId:ln,unstable_isNewReconciler:!1},Lv={readContext:Kn,useCallback:function(e,r){return Ar().memoizedState=[e,r===void 0?null:r],e},useContext:Kn,useEffect:km,useImperativeHandle:function(e,r,i){return i=i!=null?i.concat([e]):null,$u(4194308,4,Em.bind(null,r,e),i)},useLayoutEffect:function(e,r){return $u(4194308,4,e,r)},useInsertionEffect:function(e,r){return $u(4,2,e,r)},useMemo:function(e,r){var i=Ar();return r=r===void 0?null:r,e=e(),i.memoizedState=[e,r],e},useReducer:function(e,r,i){var u=Ar();return r=i!==void 0?i(r):r,u.memoizedState=u.baseState=r,e={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:e,lastRenderedState:r},u.queue=e,e=e.dispatch=Mv.bind(null,jt,e),[u.memoizedState,e]},useRef:function(e){var r=Ar();return e={current:e},r.memoizedState=e},useState:wm,useDebugValue:Zd,useDeferredValue:function(e){return Ar().memoizedState=e},useTransition:function(){var e=wm(!1),r=e[0];return e=Rv.bind(null,e[1]),Ar().memoizedState=e,[r,e]},useMutableSource:function(){},useSyncExternalStore:function(e,r,i){var u=jt,f=Ar();if(Et){if(i===void 0)throw Error(s(407));i=i()}else{if(i=r(),Qt===null)throw Error(s(349));(na&30)!==0||pm(u,r,i)}f.memoizedState=i;var p={value:i,getSnapshot:r};return f.queue=p,km(gm.bind(null,u,p,e),[e]),u.flags|=2048,Tl(9,ym.bind(null,u,p,i,r),void 0,null),i},useId:function(){var e=Ar(),r=Qt.identifierPrefix;if(Et){var i=cs,u=us;i=(u&~(1<<32-Nt(u)-1)).toString(32)+i,r=":"+r+"R"+i,i=Nl++,0<i&&(r+="H"+i.toString(32)),r+=":"}else i=Dv++,r=":"+r+"r"+i.toString(32)+":";return e.memoizedState=r},unstable_isNewReconciler:!1},Fv={readContext:Kn,useCallback:Cm,useContext:Kn,useEffect:Bd,useImperativeHandle:Tm,useInsertionEffect:_m,useLayoutEffect:Nm,useMemo:Om,useReducer:Wd,useRef:Sm,useState:function(){return Wd(El)},useDebugValue:Zd,useDeferredValue:function(e){var r=Xn();return bm(r,Wt.memoizedState,e)},useTransition:function(){var e=Wd(El)[0],r=Xn().memoizedState;return[e,r]},useMutableSource:hm,useSyncExternalStore:mm,useId:jm,unstable_isNewReconciler:!1},Av={readContext:Kn,useCallback:Cm,useContext:Kn,useEffect:Bd,useImperativeHandle:Tm,useInsertionEffect:_m,useLayoutEffect:Nm,useMemo:Om,useReducer:Hd,useRef:Sm,useState:function(){return Hd(El)},useDebugValue:Zd,useDeferredValue:function(e){var r=Xn();return Wt===null?r.memoizedState=e:bm(r,Wt.memoizedState,e)},useTransition:function(){var e=Hd(El)[0],r=Xn().memoizedState;return[e,r]},useMutableSource:hm,useSyncExternalStore:mm,useId:jm,unstable_isNewReconciler:!1};function gr(e,r){if(e&&e.defaultProps){r=me({},r),e=e.defaultProps;for(var i in e)r[i]===void 0&&(r[i]=e[i]);return r}return r}function qd(e,r,i,u){r=e.memoizedState,i=i(u,r),i=i==null?r:me({},r,i),e.memoizedState=i,e.lanes===0&&(e.updateQueue.baseState=i)}var Bu={isMounted:function(e){return(e=e._reactInternals)?Er(e)===e:!1},enqueueSetState:function(e,r,i){e=e._reactInternals;var u=gn(),f=oi(e),p=fs(u,f);p.payload=r,i!=null&&(p.callback=i),r=ri(e,p,f),r!==null&&(wr(r,e,f,u),Au(r,e,f))},enqueueReplaceState:function(e,r,i){e=e._reactInternals;var u=gn(),f=oi(e),p=fs(u,f);p.tag=1,p.payload=r,i!=null&&(p.callback=i),r=ri(e,p,f),r!==null&&(wr(r,e,f,u),Au(r,e,f))},enqueueForceUpdate:function(e,r){e=e._reactInternals;var i=gn(),u=oi(e),f=fs(i,u);f.tag=2,r!=null&&(f.callback=r),r=ri(e,f,u),r!==null&&(wr(r,e,u,i),Au(r,e,u))}};function Im(e,r,i,u,f,p,k){return e=e.stateNode,typeof e.shouldComponentUpdate=="function"?e.shouldComponentUpdate(u,p,k):r.prototype&&r.prototype.isPureReactComponent?!Hs(i,u)||!Hs(f,p):!0}function Lm(e,r,i){var u=!1,f=Lr,p=r.contextType;return typeof p=="object"&&p!==null?p=Kn(p):(f=Sn(r)?Ki:on.current,u=r.contextTypes,p=(u=u!=null)?Qa(e,f):Lr),r=new r(i,p),e.memoizedState=r.state!==null&&r.state!==void 0?r.state:null,r.updater=Bu,e.stateNode=r,r._reactInternals=e,u&&(e=e.stateNode,e.__reactInternalMemoizedUnmaskedChildContext=f,e.__reactInternalMemoizedMaskedChildContext=p),r}function Fm(e,r,i,u){e=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(i,u),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(i,u),r.state!==e&&Bu.enqueueReplaceState(r,r.state,null)}function Qd(e,r,i,u){var f=e.stateNode;f.props=i,f.state=e.memoizedState,f.refs={},Id(e);var p=r.contextType;typeof p=="object"&&p!==null?f.context=Kn(p):(p=Sn(r)?Ki:on.current,f.context=Qa(e,p)),f.state=e.memoizedState,p=r.getDerivedStateFromProps,typeof p=="function"&&(qd(e,r,p,i),f.state=e.memoizedState),typeof r.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(r=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),r!==f.state&&Bu.enqueueReplaceState(f,f.state,null),Pu(e,i,f,u),f.state=e.memoizedState),typeof f.componentDidMount=="function"&&(e.flags|=4194308)}function no(e,r){try{var i="",u=r;do i+=Xe(u),u=u.return;while(u);var f=i}catch(p){f=`
Error generating stack: `+p.message+`
`+p.stack}return{value:e,source:r,stack:f,digest:null}}function Yd(e,r,i){return{value:e,source:null,stack:i??null,digest:r??null}}function Gd(e,r){try{console.error(r.value)}catch(i){setTimeout(function(){throw i})}}var Pv=typeof WeakMap=="function"?WeakMap:Map;function Am(e,r,i){i=fs(-1,i),i.tag=3,i.payload={element:null};var u=r.value;return i.callback=function(){Xu||(Xu=!0,ff=u),Gd(e,r)},i}function Pm(e,r,i){i=fs(-1,i),i.tag=3;var u=e.type.getDerivedStateFromError;if(typeof u=="function"){var f=r.value;i.payload=function(){return u(f)},i.callback=function(){Gd(e,r)}}var p=e.stateNode;return p!==null&&typeof p.componentDidCatch=="function"&&(i.callback=function(){Gd(e,r),typeof u!="function"&&(ii===null?ii=new Set([this]):ii.add(this));var k=r.stack;this.componentDidCatch(r.value,{componentStack:k!==null?k:""})}),i}function Um(e,r,i){var u=e.pingCache;if(u===null){u=e.pingCache=new Pv;var f=new Set;u.set(r,f)}else f=u.get(r),f===void 0&&(f=new Set,u.set(r,f));f.has(i)||(f.add(i),e=Xv.bind(null,e,r,i),r.then(e,e))}function Vm(e){do{var r;if((r=e.tag===13)&&(r=e.memoizedState,r=r!==null?r.dehydrated!==null:!0),r)return e;e=e.return}while(e!==null);return null}function zm(e,r,i,u,f){return(e.mode&1)===0?(e===r?e.flags|=65536:(e.flags|=128,i.flags|=131072,i.flags&=-52805,i.tag===1&&(i.alternate===null?i.tag=17:(r=fs(-1,1),r.tag=2,ri(i,r,1))),i.lanes|=1),e):(e.flags|=65536,e.lanes=f,e)}var Uv=U.ReactCurrentOwner,kn=!1;function yn(e,r,i,u){r.child=e===null?om(r,null,i,u):Xa(r,e.child,i,u)}function $m(e,r,i,u,f){i=i.render;var p=r.ref;return eo(r,f),u=zd(e,r,i,u,p,f),i=$d(),e!==null&&!kn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~f,hs(e,r,f)):(Et&&i&&Nd(r),r.flags|=1,yn(e,r,u,f),r.child)}function Wm(e,r,i,u,f){if(e===null){var p=i.type;return typeof p=="function"&&!xf(p)&&p.defaultProps===void 0&&i.compare===null&&i.defaultProps===void 0?(r.tag=15,r.type=p,Hm(e,r,p,u,f)):(e=sc(i.type,null,u,r,r.mode,f),e.ref=r.ref,e.return=r,r.child=e)}if(p=e.child,(e.lanes&f)===0){var k=p.memoizedProps;if(i=i.compare,i=i!==null?i:Hs,i(k,u)&&e.ref===r.ref)return hs(e,r,f)}return r.flags|=1,e=ui(p,u),e.ref=r.ref,e.return=r,r.child=e}function Hm(e,r,i,u,f){if(e!==null){var p=e.memoizedProps;if(Hs(p,u)&&e.ref===r.ref)if(kn=!1,r.pendingProps=u=p,(e.lanes&f)!==0)(e.flags&131072)!==0&&(kn=!0);else return r.lanes=e.lanes,hs(e,r,f)}return Kd(e,r,i,u,f)}function Bm(e,r,i){var u=r.pendingProps,f=u.children,p=e!==null?e.memoizedState:null;if(u.mode==="hidden")if((r.mode&1)===0)r.memoizedState={baseLanes:0,cachePool:null,transitions:null},ct(so,An),An|=i;else{if((i&1073741824)===0)return e=p!==null?p.baseLanes|i:i,r.lanes=r.childLanes=1073741824,r.memoizedState={baseLanes:e,cachePool:null,transitions:null},r.updateQueue=null,ct(so,An),An|=e,null;r.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=p!==null?p.baseLanes:i,ct(so,An),An|=u}else p!==null?(u=p.baseLanes|i,r.memoizedState=null):u=i,ct(so,An),An|=u;return yn(e,r,f,i),r.child}function Zm(e,r){var i=r.ref;(e===null&&i!==null||e!==null&&e.ref!==i)&&(r.flags|=512,r.flags|=2097152)}function Kd(e,r,i,u,f){var p=Sn(i)?Ki:on.current;return p=Qa(r,p),eo(r,f),i=zd(e,r,i,u,p,f),u=$d(),e!==null&&!kn?(r.updateQueue=e.updateQueue,r.flags&=-2053,e.lanes&=~f,hs(e,r,f)):(Et&&u&&Nd(r),r.flags|=1,yn(e,r,i,f),r.child)}function qm(e,r,i,u,f){if(Sn(i)){var p=!0;bu(r)}else p=!1;if(eo(r,f),r.stateNode===null)qu(e,r),Lm(r,i,u),Qd(r,i,u,f),u=!0;else if(e===null){var k=r.stateNode,D=r.memoizedProps;k.props=D;var P=k.context,X=i.contextType;typeof X=="object"&&X!==null?X=Kn(X):(X=Sn(i)?Ki:on.current,X=Qa(r,X));var oe=i.getDerivedStateFromProps,ue=typeof oe=="function"||typeof k.getSnapshotBeforeUpdate=="function";ue||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(D!==u||P!==X)&&Fm(r,k,u,X),ni=!1;var ie=r.memoizedState;k.state=ie,Pu(r,u,k,f),P=r.memoizedState,D!==u||ie!==P||wn.current||ni?(typeof oe=="function"&&(qd(r,i,oe,u),P=r.memoizedState),(D=ni||Im(r,i,D,u,ie,P,X))?(ue||typeof k.UNSAFE_componentWillMount!="function"&&typeof k.componentWillMount!="function"||(typeof k.componentWillMount=="function"&&k.componentWillMount(),typeof k.UNSAFE_componentWillMount=="function"&&k.UNSAFE_componentWillMount()),typeof k.componentDidMount=="function"&&(r.flags|=4194308)):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=u,r.memoizedState=P),k.props=u,k.state=P,k.context=X,u=D):(typeof k.componentDidMount=="function"&&(r.flags|=4194308),u=!1)}else{k=r.stateNode,um(e,r),D=r.memoizedProps,X=r.type===r.elementType?D:gr(r.type,D),k.props=X,ue=r.pendingProps,ie=k.context,P=i.contextType,typeof P=="object"&&P!==null?P=Kn(P):(P=Sn(i)?Ki:on.current,P=Qa(r,P));var we=i.getDerivedStateFromProps;(oe=typeof we=="function"||typeof k.getSnapshotBeforeUpdate=="function")||typeof k.UNSAFE_componentWillReceiveProps!="function"&&typeof k.componentWillReceiveProps!="function"||(D!==ue||ie!==P)&&Fm(r,k,u,P),ni=!1,ie=r.memoizedState,k.state=ie,Pu(r,u,k,f);var Oe=r.memoizedState;D!==ue||ie!==Oe||wn.current||ni?(typeof we=="function"&&(qd(r,i,we,u),Oe=r.memoizedState),(X=ni||Im(r,i,X,u,ie,Oe,P)||!1)?(oe||typeof k.UNSAFE_componentWillUpdate!="function"&&typeof k.componentWillUpdate!="function"||(typeof k.componentWillUpdate=="function"&&k.componentWillUpdate(u,Oe,P),typeof k.UNSAFE_componentWillUpdate=="function"&&k.UNSAFE_componentWillUpdate(u,Oe,P)),typeof k.componentDidUpdate=="function"&&(r.flags|=4),typeof k.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof k.componentDidUpdate!="function"||D===e.memoizedProps&&ie===e.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ie===e.memoizedState||(r.flags|=1024),r.memoizedProps=u,r.memoizedState=Oe),k.props=u,k.state=Oe,k.context=P,u=X):(typeof k.componentDidUpdate!="function"||D===e.memoizedProps&&ie===e.memoizedState||(r.flags|=4),typeof k.getSnapshotBeforeUpdate!="function"||D===e.memoizedProps&&ie===e.memoizedState||(r.flags|=1024),u=!1)}return Xd(e,r,i,u,p,f)}function Xd(e,r,i,u,f,p){Zm(e,r);var k=(r.flags&128)!==0;if(!u&&!k)return f&&Xh(r,i,!1),hs(e,r,p);u=r.stateNode,Uv.current=r;var D=k&&typeof i.getDerivedStateFromError!="function"?null:u.render();return r.flags|=1,e!==null&&k?(r.child=Xa(r,e.child,null,p),r.child=Xa(r,null,D,p)):yn(e,r,D,p),r.memoizedState=u.state,f&&Xh(r,i,!0),r.child}function Qm(e){var r=e.stateNode;r.pendingContext?Gh(e,r.pendingContext,r.pendingContext!==r.context):r.context&&Gh(e,r.context,!1),Ld(e,r.containerInfo)}function Ym(e,r,i,u,f){return Ka(),Od(f),r.flags|=256,yn(e,r,i,u),r.child}var Jd={dehydrated:null,treeContext:null,retryLane:0};function ef(e){return{baseLanes:e,cachePool:null,transitions:null}}function Gm(e,r,i){var u=r.pendingProps,f=bt.current,p=!1,k=(r.flags&128)!==0,D;if((D=k)||(D=e!==null&&e.memoizedState===null?!1:(f&2)!==0),D?(p=!0,r.flags&=-129):(e===null||e.memoizedState!==null)&&(f|=1),ct(bt,f&1),e===null)return Cd(r),e=r.memoizedState,e!==null&&(e=e.dehydrated,e!==null)?((r.mode&1)===0?r.lanes=1:e.data==="$!"?r.lanes=8:r.lanes=1073741824,null):(k=u.children,e=u.fallback,p?(u=r.mode,p=r.child,k={mode:"hidden",children:k},(u&1)===0&&p!==null?(p.childLanes=0,p.pendingProps=k):p=ic(k,u,0,null),e=oa(e,u,i,null),p.return=r,e.return=r,p.sibling=e,r.child=p,r.child.memoizedState=ef(i),r.memoizedState=Jd,e):tf(r,k));if(f=e.memoizedState,f!==null&&(D=f.dehydrated,D!==null))return Vv(e,r,k,u,D,f,i);if(p){p=u.fallback,k=r.mode,f=e.child,D=f.sibling;var P={mode:"hidden",children:u.children};return(k&1)===0&&r.child!==f?(u=r.child,u.childLanes=0,u.pendingProps=P,r.deletions=null):(u=ui(f,P),u.subtreeFlags=f.subtreeFlags&14680064),D!==null?p=ui(D,p):(p=oa(p,k,i,null),p.flags|=2),p.return=r,u.return=r,u.sibling=p,r.child=u,u=p,p=r.child,k=e.child.memoizedState,k=k===null?ef(i):{baseLanes:k.baseLanes|i,cachePool:null,transitions:k.transitions},p.memoizedState=k,p.childLanes=e.childLanes&~i,r.memoizedState=Jd,u}return p=e.child,e=p.sibling,u=ui(p,{mode:"visible",children:u.children}),(r.mode&1)===0&&(u.lanes=i),u.return=r,u.sibling=null,e!==null&&(i=r.deletions,i===null?(r.deletions=[e],r.flags|=16):i.push(e)),r.child=u,r.memoizedState=null,u}function tf(e,r){return r=ic({mode:"visible",children:r},e.mode,0,null),r.return=e,e.child=r}function Zu(e,r,i,u){return u!==null&&Od(u),Xa(r,e.child,null,i),e=tf(r,r.pendingProps.children),e.flags|=2,r.memoizedState=null,e}function Vv(e,r,i,u,f,p,k){if(i)return r.flags&256?(r.flags&=-257,u=Yd(Error(s(422))),Zu(e,r,k,u)):r.memoizedState!==null?(r.child=e.child,r.flags|=128,null):(p=u.fallback,f=r.mode,u=ic({mode:"visible",children:u.children},f,0,null),p=oa(p,f,k,null),p.flags|=2,u.return=r,p.return=r,u.sibling=p,r.child=u,(r.mode&1)!==0&&Xa(r,e.child,null,k),r.child.memoizedState=ef(k),r.memoizedState=Jd,p);if((r.mode&1)===0)return Zu(e,r,k,null);if(f.data==="$!"){if(u=f.nextSibling&&f.nextSibling.dataset,u)var D=u.dgst;return u=D,p=Error(s(419)),u=Yd(p,u,void 0),Zu(e,r,k,u)}if(D=(k&e.childLanes)!==0,kn||D){if(u=Qt,u!==null){switch(k&-k){case 4:f=2;break;case 16:f=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(u.suspendedLanes|k))!==0?0:f,f!==0&&f!==p.retryLane&&(p.retryLane=f,ds(e,f),wr(u,e,f,-1))}return vf(),u=Yd(Error(s(421))),Zu(e,r,k,u)}return f.data==="$?"?(r.flags|=128,r.child=e.child,r=Jv.bind(null,e),f._reactRetry=r,null):(e=p.treeContext,Fn=ae(f.nextSibling),Ln=r,Et=!0,yr=null,e!==null&&(Yn[Gn++]=us,Yn[Gn++]=cs,Yn[Gn++]=Xi,us=e.id,cs=e.overflow,Xi=r),r=tf(r,u.children),r.flags|=4096,r)}function Km(e,r,i){e.lanes|=r;var u=e.alternate;u!==null&&(u.lanes|=r),Rd(e.return,r,i)}function nf(e,r,i,u,f){var p=e.memoizedState;p===null?e.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:u,tail:i,tailMode:f}:(p.isBackwards=r,p.rendering=null,p.renderingStartTime=0,p.last=u,p.tail=i,p.tailMode=f)}function Xm(e,r,i){var u=r.pendingProps,f=u.revealOrder,p=u.tail;if(yn(e,r,u.children,i),u=bt.current,(u&2)!==0)u=u&1|2,r.flags|=128;else{if(e!==null&&(e.flags&128)!==0)e:for(e=r.child;e!==null;){if(e.tag===13)e.memoizedState!==null&&Km(e,i,r);else if(e.tag===19)Km(e,i,r);else if(e.child!==null){e.child.return=e,e=e.child;continue}if(e===r)break e;for(;e.sibling===null;){if(e.return===null||e.return===r)break e;e=e.return}e.sibling.return=e.return,e=e.sibling}u&=1}if(ct(bt,u),(r.mode&1)===0)r.memoizedState=null;else switch(f){case"forwards":for(i=r.child,f=null;i!==null;)e=i.alternate,e!==null&&Uu(e)===null&&(f=i),i=i.sibling;i=f,i===null?(f=r.child,r.child=null):(f=i.sibling,i.sibling=null),nf(r,!1,f,i,p);break;case"backwards":for(i=null,f=r.child,r.child=null;f!==null;){if(e=f.alternate,e!==null&&Uu(e)===null){r.child=f;break}e=f.sibling,f.sibling=i,i=f,f=e}nf(r,!0,i,null,p);break;case"together":nf(r,!1,null,null,void 0);break;default:r.memoizedState=null}return r.child}function qu(e,r){(r.mode&1)===0&&e!==null&&(e.alternate=null,r.alternate=null,r.flags|=2)}function hs(e,r,i){if(e!==null&&(r.dependencies=e.dependencies),ra|=r.lanes,(i&r.childLanes)===0)return null;if(e!==null&&r.child!==e.child)throw Error(s(153));if(r.child!==null){for(e=r.child,i=ui(e,e.pendingProps),r.child=i,i.return=r;e.sibling!==null;)e=e.sibling,i=i.sibling=ui(e,e.pendingProps),i.return=r;i.sibling=null}return r.child}function zv(e,r,i){switch(r.tag){case 3:Qm(r),Ka();break;case 5:fm(r);break;case 1:Sn(r.type)&&bu(r);break;case 4:Ld(r,r.stateNode.containerInfo);break;case 10:var u=r.type._context,f=r.memoizedProps.value;ct(Lu,u._currentValue),u._currentValue=f;break;case 13:if(u=r.memoizedState,u!==null)return u.dehydrated!==null?(ct(bt,bt.current&1),r.flags|=128,null):(i&r.child.childLanes)!==0?Gm(e,r,i):(ct(bt,bt.current&1),e=hs(e,r,i),e!==null?e.sibling:null);ct(bt,bt.current&1);break;case 19:if(u=(i&r.childLanes)!==0,(e.flags&128)!==0){if(u)return Xm(e,r,i);r.flags|=128}if(f=r.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),ct(bt,bt.current),u)break;return null;case 22:case 23:return r.lanes=0,Bm(e,r,i)}return hs(e,r,i)}var Jm,rf,ep,tp;Jm=function(e,r){for(var i=r.child;i!==null;){if(i.tag===5||i.tag===6)e.appendChild(i.stateNode);else if(i.tag!==4&&i.child!==null){i.child.return=i,i=i.child;continue}if(i===r)break;for(;i.sibling===null;){if(i.return===null||i.return===r)return;i=i.return}i.sibling.return=i.return,i=i.sibling}},rf=function(){},ep=function(e,r,i,u){var f=e.memoizedProps;if(f!==u){e=r.stateNode,ta(Fr.current);var p=null;switch(i){case"input":f=Nr(e,f),u=Nr(e,u),p=[];break;case"select":f=me({},f,{value:void 0}),u=me({},u,{value:void 0}),p=[];break;case"textarea":f=Zr(e,f),u=Zr(e,u),p=[];break;default:typeof f.onClick!="function"&&typeof u.onClick=="function"&&(e.onclick=qa)}Q(i,u);var k;i=null;for(X in f)if(!u.hasOwnProperty(X)&&f.hasOwnProperty(X)&&f[X]!=null)if(X==="style"){var D=f[X];for(k in D)D.hasOwnProperty(k)&&(i||(i={}),i[k]="")}else X!=="dangerouslySetInnerHTML"&&X!=="children"&&X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&X!=="autoFocus"&&(l.hasOwnProperty(X)?p||(p=[]):(p=p||[]).push(X,null));for(X in u){var P=u[X];if(D=f!=null?f[X]:void 0,u.hasOwnProperty(X)&&P!==D&&(P!=null||D!=null))if(X==="style")if(D){for(k in D)!D.hasOwnProperty(k)||P&&P.hasOwnProperty(k)||(i||(i={}),i[k]="");for(k in P)P.hasOwnProperty(k)&&D[k]!==P[k]&&(i||(i={}),i[k]=P[k])}else i||(p||(p=[]),p.push(X,i)),i=P;else X==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,D=D?D.__html:void 0,P!=null&&D!==P&&(p=p||[]).push(X,P)):X==="children"?typeof P!="string"&&typeof P!="number"||(p=p||[]).push(X,""+P):X!=="suppressContentEditableWarning"&&X!=="suppressHydrationWarning"&&(l.hasOwnProperty(X)?(P!=null&&X==="onScroll"&&vt("scroll",e),p||D===P||(p=[])):(p=p||[]).push(X,P))}i&&(p=p||[]).push("style",i);var X=p;(r.updateQueue=X)&&(r.flags|=4)}},tp=function(e,r,i,u){i!==u&&(r.flags|=4)};function Cl(e,r){if(!Et)switch(e.tailMode){case"hidden":r=e.tail;for(var i=null;r!==null;)r.alternate!==null&&(i=r),r=r.sibling;i===null?e.tail=null:i.sibling=null;break;case"collapsed":i=e.tail;for(var u=null;i!==null;)i.alternate!==null&&(u=i),i=i.sibling;u===null?r||e.tail===null?e.tail=null:e.tail.sibling=null:u.sibling=null}}function un(e){var r=e.alternate!==null&&e.alternate.child===e.child,i=0,u=0;if(r)for(var f=e.child;f!==null;)i|=f.lanes|f.childLanes,u|=f.subtreeFlags&14680064,u|=f.flags&14680064,f.return=e,f=f.sibling;else for(f=e.child;f!==null;)i|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=e,f=f.sibling;return e.subtreeFlags|=u,e.childLanes=i,r}function $v(e,r,i){var u=r.pendingProps;switch(Ed(r),r.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return un(r),null;case 1:return Sn(r.type)&&Ou(),un(r),null;case 3:return u=r.stateNode,to(),ht(wn),ht(on),Pd(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(e===null||e.child===null)&&(Mu(r)?r.flags|=4:e===null||e.memoizedState.isDehydrated&&(r.flags&256)===0||(r.flags|=1024,yr!==null&&(pf(yr),yr=null))),rf(e,r),un(r),null;case 5:Fd(r);var f=ta(kl.current);if(i=r.type,e!==null&&r.stateNode!=null)ep(e,r,i,u,f),e.ref!==r.ref&&(r.flags|=512,r.flags|=2097152);else{if(!u){if(r.stateNode===null)throw Error(s(166));return un(r),null}if(e=ta(Fr.current),Mu(r)){u=r.stateNode,i=r.type;var p=r.memoizedProps;switch(u[tt]=r,u[Fe]=p,e=(r.mode&1)!==0,i){case"dialog":vt("cancel",u),vt("close",u);break;case"iframe":case"object":case"embed":vt("load",u);break;case"video":case"audio":for(f=0;f<as.length;f++)vt(as[f],u);break;case"source":vt("error",u);break;case"img":case"image":case"link":vt("error",u),vt("load",u);break;case"details":vt("toggle",u);break;case"input":Wn(u,p),vt("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!p.multiple},vt("invalid",u);break;case"textarea":qr(u,p),vt("invalid",u)}Q(i,p),f=null;for(var k in p)if(p.hasOwnProperty(k)){var D=p[k];k==="children"?typeof D=="string"?u.textContent!==D&&(p.suppressHydrationWarning!==!0&&Mr(u.textContent,D,e),f=["children",D]):typeof D=="number"&&u.textContent!==""+D&&(p.suppressHydrationWarning!==!0&&Mr(u.textContent,D,e),f=["children",""+D]):l.hasOwnProperty(k)&&D!=null&&k==="onScroll"&&vt("scroll",u)}switch(i){case"input":jn(u),ar(u,p,!0);break;case"textarea":jn(u),lr(u);break;case"select":case"option":break;default:typeof p.onClick=="function"&&(u.onclick=qa)}u=f,r.updateQueue=u,u!==null&&(r.flags|=4)}else{k=f.nodeType===9?f:f.ownerDocument,e==="http://www.w3.org/1999/xhtml"&&(e=Bn(i)),e==="http://www.w3.org/1999/xhtml"?i==="script"?(e=k.createElement("div"),e.innerHTML="<script><\/script>",e=e.removeChild(e.firstChild)):typeof u.is=="string"?e=k.createElement(i,{is:u.is}):(e=k.createElement(i),i==="select"&&(k=e,u.multiple?k.multiple=!0:u.size&&(k.size=u.size))):e=k.createElementNS(e,i),e[tt]=r,e[Fe]=u,Jm(e,r,!1,!1),r.stateNode=e;e:{switch(k=re(i,u),i){case"dialog":vt("cancel",e),vt("close",e),f=u;break;case"iframe":case"object":case"embed":vt("load",e),f=u;break;case"video":case"audio":for(f=0;f<as.length;f++)vt(as[f],e);f=u;break;case"source":vt("error",e),f=u;break;case"img":case"image":case"link":vt("error",e),vt("load",e),f=u;break;case"details":vt("toggle",e),f=u;break;case"input":Wn(e,u),f=Nr(e,u),vt("invalid",e);break;case"option":f=u;break;case"select":e._wrapperState={wasMultiple:!!u.multiple},f=me({},u,{value:void 0}),vt("invalid",e);break;case"textarea":qr(e,u),f=Zr(e,u),vt("invalid",e);break;default:f=u}Q(i,f),D=f;for(p in D)if(D.hasOwnProperty(p)){var P=D[p];p==="style"?le(e,P):p==="dangerouslySetInnerHTML"?(P=P?P.__html:void 0,P!=null&&Gr(e,P)):p==="children"?typeof P=="string"?(i!=="textarea"||P!=="")&&R(e,P):typeof P=="number"&&R(e,""+P):p!=="suppressContentEditableWarning"&&p!=="suppressHydrationWarning"&&p!=="autoFocus"&&(l.hasOwnProperty(p)?P!=null&&p==="onScroll"&&vt("scroll",e):P!=null&&F(e,p,P,k))}switch(i){case"input":jn(e),ar(e,u,!1);break;case"textarea":jn(e),lr(e);break;case"option":u.value!=null&&e.setAttribute("value",""+Ge(u.value));break;case"select":e.multiple=!!u.multiple,p=u.value,p!=null?Rn(e,!!u.multiple,p,!1):u.defaultValue!=null&&Rn(e,!!u.multiple,u.defaultValue,!0);break;default:typeof f.onClick=="function"&&(e.onclick=qa)}switch(i){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(r.flags|=4)}r.ref!==null&&(r.flags|=512,r.flags|=2097152)}return un(r),null;case 6:if(e&&r.stateNode!=null)tp(e,r,e.memoizedProps,u);else{if(typeof u!="string"&&r.stateNode===null)throw Error(s(166));if(i=ta(kl.current),ta(Fr.current),Mu(r)){if(u=r.stateNode,i=r.memoizedProps,u[tt]=r,(p=u.nodeValue!==i)&&(e=Ln,e!==null))switch(e.tag){case 3:Mr(u.nodeValue,i,(e.mode&1)!==0);break;case 5:e.memoizedProps.suppressHydrationWarning!==!0&&Mr(u.nodeValue,i,(e.mode&1)!==0)}p&&(r.flags|=4)}else u=(i.nodeType===9?i:i.ownerDocument).createTextNode(u),u[tt]=r,r.stateNode=u}return un(r),null;case 13:if(ht(bt),u=r.memoizedState,e===null||e.memoizedState!==null&&e.memoizedState.dehydrated!==null){if(Et&&Fn!==null&&(r.mode&1)!==0&&(r.flags&128)===0)sm(),Ka(),r.flags|=98560,p=!1;else if(p=Mu(r),u!==null&&u.dehydrated!==null){if(e===null){if(!p)throw Error(s(318));if(p=r.memoizedState,p=p!==null?p.dehydrated:null,!p)throw Error(s(317));p[tt]=r}else Ka(),(r.flags&128)===0&&(r.memoizedState=null),r.flags|=4;un(r),p=!1}else yr!==null&&(pf(yr),yr=null),p=!0;if(!p)return r.flags&65536?r:null}return(r.flags&128)!==0?(r.lanes=i,r):(u=u!==null,u!==(e!==null&&e.memoizedState!==null)&&u&&(r.child.flags|=8192,(r.mode&1)!==0&&(e===null||(bt.current&1)!==0?Ht===0&&(Ht=3):vf())),r.updateQueue!==null&&(r.flags|=4),un(r),null);case 4:return to(),rf(e,r),e===null&&Bi(r.stateNode.containerInfo),un(r),null;case 10:return Dd(r.type._context),un(r),null;case 17:return Sn(r.type)&&Ou(),un(r),null;case 19:if(ht(bt),p=r.memoizedState,p===null)return un(r),null;if(u=(r.flags&128)!==0,k=p.rendering,k===null)if(u)Cl(p,!1);else{if(Ht!==0||e!==null&&(e.flags&128)!==0)for(e=r.child;e!==null;){if(k=Uu(e),k!==null){for(r.flags|=128,Cl(p,!1),u=k.updateQueue,u!==null&&(r.updateQueue=u,r.flags|=4),r.subtreeFlags=0,u=i,i=r.child;i!==null;)p=i,e=u,p.flags&=14680066,k=p.alternate,k===null?(p.childLanes=0,p.lanes=e,p.child=null,p.subtreeFlags=0,p.memoizedProps=null,p.memoizedState=null,p.updateQueue=null,p.dependencies=null,p.stateNode=null):(p.childLanes=k.childLanes,p.lanes=k.lanes,p.child=k.child,p.subtreeFlags=0,p.deletions=null,p.memoizedProps=k.memoizedProps,p.memoizedState=k.memoizedState,p.updateQueue=k.updateQueue,p.type=k.type,e=k.dependencies,p.dependencies=e===null?null:{lanes:e.lanes,firstContext:e.firstContext}),i=i.sibling;return ct(bt,bt.current&1|2),r.child}e=e.sibling}p.tail!==null&&wt()>io&&(r.flags|=128,u=!0,Cl(p,!1),r.lanes=4194304)}else{if(!u)if(e=Uu(k),e!==null){if(r.flags|=128,u=!0,i=e.updateQueue,i!==null&&(r.updateQueue=i,r.flags|=4),Cl(p,!0),p.tail===null&&p.tailMode==="hidden"&&!k.alternate&&!Et)return un(r),null}else 2*wt()-p.renderingStartTime>io&&i!==1073741824&&(r.flags|=128,u=!0,Cl(p,!1),r.lanes=4194304);p.isBackwards?(k.sibling=r.child,r.child=k):(i=p.last,i!==null?i.sibling=k:r.child=k,p.last=k)}return p.tail!==null?(r=p.tail,p.rendering=r,p.tail=r.sibling,p.renderingStartTime=wt(),r.sibling=null,i=bt.current,ct(bt,u?i&1|2:i&1),r):(un(r),null);case 22:case 23:return gf(),u=r.memoizedState!==null,e!==null&&e.memoizedState!==null!==u&&(r.flags|=8192),u&&(r.mode&1)!==0?(An&1073741824)!==0&&(un(r),r.subtreeFlags&6&&(r.flags|=8192)):un(r),null;case 24:return null;case 25:return null}throw Error(s(156,r.tag))}function Wv(e,r){switch(Ed(r),r.tag){case 1:return Sn(r.type)&&Ou(),e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 3:return to(),ht(wn),ht(on),Pd(),e=r.flags,(e&65536)!==0&&(e&128)===0?(r.flags=e&-65537|128,r):null;case 5:return Fd(r),null;case 13:if(ht(bt),e=r.memoizedState,e!==null&&e.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Ka()}return e=r.flags,e&65536?(r.flags=e&-65537|128,r):null;case 19:return ht(bt),null;case 4:return to(),null;case 10:return Dd(r.type._context),null;case 22:case 23:return gf(),null;case 24:return null;default:return null}}var Qu=!1,cn=!1,Hv=typeof WeakSet=="function"?WeakSet:Set,Ne=null;function ro(e,r){var i=e.ref;if(i!==null)if(typeof i=="function")try{i(null)}catch(u){Lt(e,r,u)}else i.current=null}function sf(e,r,i){try{i()}catch(u){Lt(e,r,u)}}var np=!1;function Bv(e,r){if(g=fr,e=Eu(),ll(e)){if("selectionStart"in e)var i={start:e.selectionStart,end:e.selectionEnd};else e:{i=(i=e.ownerDocument)&&i.defaultView||window;var u=i.getSelection&&i.getSelection();if(u&&u.rangeCount!==0){i=u.anchorNode;var f=u.anchorOffset,p=u.focusNode;u=u.focusOffset;try{i.nodeType,p.nodeType}catch{i=null;break e}var k=0,D=-1,P=-1,X=0,oe=0,ue=e,ie=null;t:for(;;){for(var we;ue!==i||f!==0&&ue.nodeType!==3||(D=k+f),ue!==p||u!==0&&ue.nodeType!==3||(P=k+u),ue.nodeType===3&&(k+=ue.nodeValue.length),(we=ue.firstChild)!==null;)ie=ue,ue=we;for(;;){if(ue===e)break t;if(ie===i&&++X===f&&(D=k),ie===p&&++oe===u&&(P=k),(we=ue.nextSibling)!==null)break;ue=ie,ie=ue.parentNode}ue=we}i=D===-1||P===-1?null:{start:D,end:P}}else i=null}i=i||{start:0,end:0}}else i=null;for(o={focusedElem:e,selectionRange:i},fr=!1,Ne=r;Ne!==null;)if(r=Ne,e=r.child,(r.subtreeFlags&1028)!==0&&e!==null)e.return=r,Ne=e;else for(;Ne!==null;){r=Ne;try{var Oe=r.alternate;if((r.flags&1024)!==0)switch(r.tag){case 0:case 11:case 15:break;case 1:if(Oe!==null){var be=Oe.memoizedProps,Pt=Oe.memoizedState,G=r.stateNode,z=G.getSnapshotBeforeUpdate(r.elementType===r.type?be:gr(r.type,be),Pt);G.__reactInternalSnapshotBeforeUpdate=z}break;case 3:var K=r.stateNode.containerInfo;K.nodeType===1?K.textContent="":K.nodeType===9&&K.documentElement&&K.removeChild(K.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(s(163))}}catch(ce){Lt(r,r.return,ce)}if(e=r.sibling,e!==null){e.return=r.return,Ne=e;break}Ne=r.return}return Oe=np,np=!1,Oe}function Ol(e,r,i){var u=r.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var f=u=u.next;do{if((f.tag&e)===e){var p=f.destroy;f.destroy=void 0,p!==void 0&&sf(r,i,p)}f=f.next}while(f!==u)}}function Yu(e,r){if(r=r.updateQueue,r=r!==null?r.lastEffect:null,r!==null){var i=r=r.next;do{if((i.tag&e)===e){var u=i.create;i.destroy=u()}i=i.next}while(i!==r)}}function af(e){var r=e.ref;if(r!==null){var i=e.stateNode;switch(e.tag){case 5:e=i;break;default:e=i}typeof r=="function"?r(e):r.current=e}}function rp(e){var r=e.alternate;r!==null&&(e.alternate=null,rp(r)),e.child=null,e.deletions=null,e.sibling=null,e.tag===5&&(r=e.stateNode,r!==null&&(delete r[tt],delete r[Fe],delete r[pn],delete r[Qn],delete r[Ks])),e.stateNode=null,e.return=null,e.dependencies=null,e.memoizedProps=null,e.memoizedState=null,e.pendingProps=null,e.stateNode=null,e.updateQueue=null}function sp(e){return e.tag===5||e.tag===3||e.tag===4}function ip(e){e:for(;;){for(;e.sibling===null;){if(e.return===null||sp(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.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 of(e,r,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?i.nodeType===8?i.parentNode.insertBefore(e,r):i.insertBefore(e,r):(i.nodeType===8?(r=i.parentNode,r.insertBefore(e,i)):(r=i,r.appendChild(e)),i=i._reactRootContainer,i!=null||r.onclick!==null||(r.onclick=qa));else if(u!==4&&(e=e.child,e!==null))for(of(e,r,i),e=e.sibling;e!==null;)of(e,r,i),e=e.sibling}function lf(e,r,i){var u=e.tag;if(u===5||u===6)e=e.stateNode,r?i.insertBefore(e,r):i.appendChild(e);else if(u!==4&&(e=e.child,e!==null))for(lf(e,r,i),e=e.sibling;e!==null;)lf(e,r,i),e=e.sibling}var tn=null,vr=!1;function si(e,r,i){for(i=i.child;i!==null;)ap(e,r,i),i=i.sibling}function ap(e,r,i){if(en&&typeof en.onCommitFiberUnmount=="function")try{en.onCommitFiberUnmount(ba,i)}catch{}switch(i.tag){case 5:cn||ro(i,r);case 6:var u=tn,f=vr;tn=null,si(e,r,i),tn=u,vr=f,tn!==null&&(vr?(e=tn,i=i.stateNode,e.nodeType===8?e.parentNode.removeChild(i):e.removeChild(i)):tn.removeChild(i.stateNode));break;case 18:tn!==null&&(vr?(e=tn,i=i.stateNode,e.nodeType===8?Y(e.parentNode,i):e.nodeType===1&&Y(e,i),It(e)):Y(tn,i.stateNode));break;case 4:u=tn,f=vr,tn=i.stateNode.containerInfo,vr=!0,si(e,r,i),tn=u,vr=f;break;case 0:case 11:case 14:case 15:if(!cn&&(u=i.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){f=u=u.next;do{var p=f,k=p.destroy;p=p.tag,k!==void 0&&((p&2)!==0||(p&4)!==0)&&sf(i,r,k),f=f.next}while(f!==u)}si(e,r,i);break;case 1:if(!cn&&(ro(i,r),u=i.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=i.memoizedProps,u.state=i.memoizedState,u.componentWillUnmount()}catch(D){Lt(i,r,D)}si(e,r,i);break;case 21:si(e,r,i);break;case 22:i.mode&1?(cn=(u=cn)||i.memoizedState!==null,si(e,r,i),cn=u):si(e,r,i);break;default:si(e,r,i)}}function op(e){var r=e.updateQueue;if(r!==null){e.updateQueue=null;var i=e.stateNode;i===null&&(i=e.stateNode=new Hv),r.forEach(function(u){var f=e0.bind(null,e,u);i.has(u)||(i.add(u),u.then(f,f))})}}function xr(e,r){var i=r.deletions;if(i!==null)for(var u=0;u<i.length;u++){var f=i[u];try{var p=e,k=r,D=k;e:for(;D!==null;){switch(D.tag){case 5:tn=D.stateNode,vr=!1;break e;case 3:tn=D.stateNode.containerInfo,vr=!0;break e;case 4:tn=D.stateNode.containerInfo,vr=!0;break e}D=D.return}if(tn===null)throw Error(s(160));ap(p,k,f),tn=null,vr=!1;var P=f.alternate;P!==null&&(P.return=null),f.return=null}catch(X){Lt(f,r,X)}}if(r.subtreeFlags&12854)for(r=r.child;r!==null;)lp(r,e),r=r.sibling}function lp(e,r){var i=e.alternate,u=e.flags;switch(e.tag){case 0:case 11:case 14:case 15:if(xr(r,e),Pr(e),u&4){try{Ol(3,e,e.return),Yu(3,e)}catch(be){Lt(e,e.return,be)}try{Ol(5,e,e.return)}catch(be){Lt(e,e.return,be)}}break;case 1:xr(r,e),Pr(e),u&512&&i!==null&&ro(i,i.return);break;case 5:if(xr(r,e),Pr(e),u&512&&i!==null&&ro(i,i.return),e.flags&32){var f=e.stateNode;try{R(f,"")}catch(be){Lt(e,e.return,be)}}if(u&4&&(f=e.stateNode,f!=null)){var p=e.memoizedProps,k=i!==null?i.memoizedProps:p,D=e.type,P=e.updateQueue;if(e.updateQueue=null,P!==null)try{D==="input"&&p.type==="radio"&&p.name!=null&&ir(f,p),re(D,k);var X=re(D,p);for(k=0;k<P.length;k+=2){var oe=P[k],ue=P[k+1];oe==="style"?le(f,ue):oe==="dangerouslySetInnerHTML"?Gr(f,ue):oe==="children"?R(f,ue):F(f,oe,ue,X)}switch(D){case"input":Hn(f,p);break;case"textarea":Qr(f,p);break;case"select":var ie=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!p.multiple;var we=p.value;we!=null?Rn(f,!!p.multiple,we,!1):ie!==!!p.multiple&&(p.defaultValue!=null?Rn(f,!!p.multiple,p.defaultValue,!0):Rn(f,!!p.multiple,p.multiple?[]:"",!1))}f[Fe]=p}catch(be){Lt(e,e.return,be)}}break;case 6:if(xr(r,e),Pr(e),u&4){if(e.stateNode===null)throw Error(s(162));f=e.stateNode,p=e.memoizedProps;try{f.nodeValue=p}catch(be){Lt(e,e.return,be)}}break;case 3:if(xr(r,e),Pr(e),u&4&&i!==null&&i.memoizedState.isDehydrated)try{It(r.containerInfo)}catch(be){Lt(e,e.return,be)}break;case 4:xr(r,e),Pr(e);break;case 13:xr(r,e),Pr(e),f=e.child,f.flags&8192&&(p=f.memoizedState!==null,f.stateNode.isHidden=p,!p||f.alternate!==null&&f.alternate.memoizedState!==null||(df=wt())),u&4&&op(e);break;case 22:if(oe=i!==null&&i.memoizedState!==null,e.mode&1?(cn=(X=cn)||oe,xr(r,e),cn=X):xr(r,e),Pr(e),u&8192){if(X=e.memoizedState!==null,(e.stateNode.isHidden=X)&&!oe&&(e.mode&1)!==0)for(Ne=e,oe=e.child;oe!==null;){for(ue=Ne=oe;Ne!==null;){switch(ie=Ne,we=ie.child,ie.tag){case 0:case 11:case 14:case 15:Ol(4,ie,ie.return);break;case 1:ro(ie,ie.return);var Oe=ie.stateNode;if(typeof Oe.componentWillUnmount=="function"){u=ie,i=ie.return;try{r=u,Oe.props=r.memoizedProps,Oe.state=r.memoizedState,Oe.componentWillUnmount()}catch(be){Lt(u,i,be)}}break;case 5:ro(ie,ie.return);break;case 22:if(ie.memoizedState!==null){dp(ue);continue}}we!==null?(we.return=ie,Ne=we):dp(ue)}oe=oe.sibling}e:for(oe=null,ue=e;;){if(ue.tag===5){if(oe===null){oe=ue;try{f=ue.stateNode,X?(p=f.style,typeof p.setProperty=="function"?p.setProperty("display","none","important"):p.display="none"):(D=ue.stateNode,P=ue.memoizedProps.style,k=P!=null&&P.hasOwnProperty("display")?P.display:null,D.style.display=te("display",k))}catch(be){Lt(e,e.return,be)}}}else if(ue.tag===6){if(oe===null)try{ue.stateNode.nodeValue=X?"":ue.memoizedProps}catch(be){Lt(e,e.return,be)}}else if((ue.tag!==22&&ue.tag!==23||ue.memoizedState===null||ue===e)&&ue.child!==null){ue.child.return=ue,ue=ue.child;continue}if(ue===e)break e;for(;ue.sibling===null;){if(ue.return===null||ue.return===e)break e;oe===ue&&(oe=null),ue=ue.return}oe===ue&&(oe=null),ue.sibling.return=ue.return,ue=ue.sibling}}break;case 19:xr(r,e),Pr(e),u&4&&op(e);break;case 21:break;default:xr(r,e),Pr(e)}}function Pr(e){var r=e.flags;if(r&2){try{e:{for(var i=e.return;i!==null;){if(sp(i)){var u=i;break e}i=i.return}throw Error(s(160))}switch(u.tag){case 5:var f=u.stateNode;u.flags&32&&(R(f,""),u.flags&=-33);var p=ip(e);lf(e,p,f);break;case 3:case 4:var k=u.stateNode.containerInfo,D=ip(e);of(e,D,k);break;default:throw Error(s(161))}}catch(P){Lt(e,e.return,P)}e.flags&=-3}r&4096&&(e.flags&=-4097)}function Zv(e,r,i){Ne=e,up(e)}function up(e,r,i){for(var u=(e.mode&1)!==0;Ne!==null;){var f=Ne,p=f.child;if(f.tag===22&&u){var k=f.memoizedState!==null||Qu;if(!k){var D=f.alternate,P=D!==null&&D.memoizedState!==null||cn;D=Qu;var X=cn;if(Qu=k,(cn=P)&&!X)for(Ne=f;Ne!==null;)k=Ne,P=k.child,k.tag===22&&k.memoizedState!==null?fp(f):P!==null?(P.return=k,Ne=P):fp(f);for(;p!==null;)Ne=p,up(p),p=p.sibling;Ne=f,Qu=D,cn=X}cp(e)}else(f.subtreeFlags&8772)!==0&&p!==null?(p.return=f,Ne=p):cp(e)}}function cp(e){for(;Ne!==null;){var r=Ne;if((r.flags&8772)!==0){var i=r.alternate;try{if((r.flags&8772)!==0)switch(r.tag){case 0:case 11:case 15:cn||Yu(5,r);break;case 1:var u=r.stateNode;if(r.flags&4&&!cn)if(i===null)u.componentDidMount();else{var f=r.elementType===r.type?i.memoizedProps:gr(r.type,i.memoizedProps);u.componentDidUpdate(f,i.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var p=r.updateQueue;p!==null&&dm(r,p,u);break;case 3:var k=r.updateQueue;if(k!==null){if(i=null,r.child!==null)switch(r.child.tag){case 5:i=r.child.stateNode;break;case 1:i=r.child.stateNode}dm(r,k,i)}break;case 5:var D=r.stateNode;if(i===null&&r.flags&4){i=D;var P=r.memoizedProps;switch(r.type){case"button":case"input":case"select":case"textarea":P.autoFocus&&i.focus();break;case"img":P.src&&(i.src=P.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(r.memoizedState===null){var X=r.alternate;if(X!==null){var oe=X.memoizedState;if(oe!==null){var ue=oe.dehydrated;ue!==null&&It(ue)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(s(163))}cn||r.flags&512&&af(r)}catch(ie){Lt(r,r.return,ie)}}if(r===e){Ne=null;break}if(i=r.sibling,i!==null){i.return=r.return,Ne=i;break}Ne=r.return}}function dp(e){for(;Ne!==null;){var r=Ne;if(r===e){Ne=null;break}var i=r.sibling;if(i!==null){i.return=r.return,Ne=i;break}Ne=r.return}}function fp(e){for(;Ne!==null;){var r=Ne;try{switch(r.tag){case 0:case 11:case 15:var i=r.return;try{Yu(4,r)}catch(P){Lt(r,i,P)}break;case 1:var u=r.stateNode;if(typeof u.componentDidMount=="function"){var f=r.return;try{u.componentDidMount()}catch(P){Lt(r,f,P)}}var p=r.return;try{af(r)}catch(P){Lt(r,p,P)}break;case 5:var k=r.return;try{af(r)}catch(P){Lt(r,k,P)}}}catch(P){Lt(r,r.return,P)}if(r===e){Ne=null;break}var D=r.sibling;if(D!==null){D.return=r.return,Ne=D;break}Ne=r.return}}var qv=Math.ceil,Gu=U.ReactCurrentDispatcher,uf=U.ReactCurrentOwner,Jn=U.ReactCurrentBatchConfig,at=0,Qt=null,zt=null,nn=0,An=0,so=Ir(0),Ht=0,bl=null,ra=0,Ku=0,cf=0,jl=null,_n=null,df=0,io=1/0,ms=null,Xu=!1,ff=null,ii=null,Ju=!1,ai=null,ec=0,Dl=0,hf=null,tc=-1,nc=0;function gn(){return(at&6)!==0?wt():tc!==-1?tc:tc=wt()}function oi(e){return(e.mode&1)===0?1:(at&2)!==0&&nn!==0?nn&-nn:jv.transition!==null?(nc===0&&(nc=qo()),nc):(e=ut,e!==0||(e=window.event,e=e===void 0?16:Ia(e.type)),e)}function wr(e,r,i,u){if(50<Dl)throw Dl=0,hf=null,Error(s(185));Jr(e,i,u),((at&2)===0||e!==Qt)&&(e===Qt&&((at&2)===0&&(Ku|=i),Ht===4&&li(e,nn)),Nn(e,u),i===1&&at===0&&(r.mode&1)===0&&(io=wt()+500,ju&&ti()))}function Nn(e,r){var i=e.callbackNode;ja(e,r);var u=Or(e,e===Qt?nn:0);if(u===0)i!==null&&$o(i),e.callbackNode=null,e.callbackPriority=0;else if(r=u&-u,e.callbackPriority!==r){if(i!=null&&$o(i),r===1)e.tag===0?bv(mp.bind(null,e)):Jh(mp.bind(null,e)),V(function(){(at&6)===0&&ti()}),i=null;else{switch(Mi(u)){case 1:i=Wo;break;case 4:i=Ho;break;case 16:i=Ri;break;case 536870912:i=Bo;break;default:i=Ri}i=kp(i,hp.bind(null,e))}e.callbackPriority=r,e.callbackNode=i}}function hp(e,r){if(tc=-1,nc=0,(at&6)!==0)throw Error(s(327));var i=e.callbackNode;if(ao()&&e.callbackNode!==i)return null;var u=Or(e,e===Qt?nn:0);if(u===0)return null;if((u&30)!==0||(u&e.expiredLanes)!==0||r)r=rc(e,u);else{r=u;var f=at;at|=2;var p=yp();(Qt!==e||nn!==r)&&(ms=null,io=wt()+500,ia(e,r));do try{Gv();break}catch(D){pp(e,D)}while(!0);jd(),Gu.current=p,at=f,zt!==null?r=0:(Qt=null,nn=0,r=Ht)}if(r!==0){if(r===2&&(f=Ms(e),f!==0&&(u=f,r=mf(e,f))),r===1)throw i=bl,ia(e,0),li(e,u),Nn(e,wt()),i;if(r===6)li(e,u);else{if(f=e.current.alternate,(u&30)===0&&!Qv(f)&&(r=rc(e,u),r===2&&(p=Ms(e),p!==0&&(u=p,r=mf(e,p))),r===1))throw i=bl,ia(e,0),li(e,u),Nn(e,wt()),i;switch(e.finishedWork=f,e.finishedLanes=u,r){case 0:case 1:throw Error(s(345));case 2:aa(e,_n,ms);break;case 3:if(li(e,u),(u&130023424)===u&&(r=df+500-wt(),10<r)){if(Or(e,0)!==0)break;if(f=e.suspendedLanes,(f&u)!==u){gn(),e.pingedLanes|=e.suspendedLanes&f;break}e.timeoutHandle=v(aa.bind(null,e,_n,ms),r);break}aa(e,_n,ms);break;case 4:if(li(e,u),(u&4194240)===u)break;for(r=e.eventTimes,f=-1;0<u;){var k=31-Nt(u);p=1<<k,k=r[k],k>f&&(f=k),u&=~p}if(u=f,u=wt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*qv(u/1960))-u,10<u){e.timeoutHandle=v(aa.bind(null,e,_n,ms),u);break}aa(e,_n,ms);break;case 5:aa(e,_n,ms);break;default:throw Error(s(329))}}}return Nn(e,wt()),e.callbackNode===i?hp.bind(null,e):null}function mf(e,r){var i=jl;return e.current.memoizedState.isDehydrated&&(ia(e,r).flags|=256),e=rc(e,r),e!==2&&(r=_n,_n=i,r!==null&&pf(r)),e}function pf(e){_n===null?_n=e:_n.push.apply(_n,e)}function Qv(e){for(var r=e;;){if(r.flags&16384){var i=r.updateQueue;if(i!==null&&(i=i.stores,i!==null))for(var u=0;u<i.length;u++){var f=i[u],p=f.getSnapshot;f=f.value;try{if(!Ot(p(),f))return!1}catch{return!1}}}if(i=r.child,r.subtreeFlags&16384&&i!==null)i.return=r,r=i;else{if(r===e)break;for(;r.sibling===null;){if(r.return===null||r.return===e)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function li(e,r){for(r&=~cf,r&=~Ku,e.suspendedLanes|=r,e.pingedLanes&=~r,e=e.expirationTimes;0<r;){var i=31-Nt(r),u=1<<i;e[i]=-1,r&=~u}}function mp(e){if((at&6)!==0)throw Error(s(327));ao();var r=Or(e,0);if((r&1)===0)return Nn(e,wt()),null;var i=rc(e,r);if(e.tag!==0&&i===2){var u=Ms(e);u!==0&&(r=u,i=mf(e,u))}if(i===1)throw i=bl,ia(e,0),li(e,r),Nn(e,wt()),i;if(i===6)throw Error(s(345));return e.finishedWork=e.current.alternate,e.finishedLanes=r,aa(e,_n,ms),Nn(e,wt()),null}function yf(e,r){var i=at;at|=1;try{return e(r)}finally{at=i,at===0&&(io=wt()+500,ju&&ti())}}function sa(e){ai!==null&&ai.tag===0&&(at&6)===0&&ao();var r=at;at|=1;var i=Jn.transition,u=ut;try{if(Jn.transition=null,ut=1,e)return e()}finally{ut=u,Jn.transition=i,at=r,(at&6)===0&&ti()}}function gf(){An=so.current,ht(so)}function ia(e,r){e.finishedWork=null,e.finishedLanes=0;var i=e.timeoutHandle;if(i!==-1&&(e.timeoutHandle=-1,N(i)),zt!==null)for(i=zt.return;i!==null;){var u=i;switch(Ed(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&Ou();break;case 3:to(),ht(wn),ht(on),Pd();break;case 5:Fd(u);break;case 4:to();break;case 13:ht(bt);break;case 19:ht(bt);break;case 10:Dd(u.type._context);break;case 22:case 23:gf()}i=i.return}if(Qt=e,zt=e=ui(e.current,null),nn=An=r,Ht=0,bl=null,cf=Ku=ra=0,_n=jl=null,ea!==null){for(r=0;r<ea.length;r++)if(i=ea[r],u=i.interleaved,u!==null){i.interleaved=null;var f=u.next,p=i.pending;if(p!==null){var k=p.next;p.next=f,u.next=k}i.pending=u}ea=null}return e}function pp(e,r){do{var i=zt;try{if(jd(),Vu.current=Hu,zu){for(var u=jt.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}zu=!1}if(na=0,qt=Wt=jt=null,_l=!1,Nl=0,uf.current=null,i===null||i.return===null){Ht=1,bl=r,zt=null;break}e:{var p=e,k=i.return,D=i,P=r;if(r=nn,D.flags|=32768,P!==null&&typeof P=="object"&&typeof P.then=="function"){var X=P,oe=D,ue=oe.tag;if((oe.mode&1)===0&&(ue===0||ue===11||ue===15)){var ie=oe.alternate;ie?(oe.updateQueue=ie.updateQueue,oe.memoizedState=ie.memoizedState,oe.lanes=ie.lanes):(oe.updateQueue=null,oe.memoizedState=null)}var we=Vm(k);if(we!==null){we.flags&=-257,zm(we,k,D,p,r),we.mode&1&&Um(p,X,r),r=we,P=X;var Oe=r.updateQueue;if(Oe===null){var be=new Set;be.add(P),r.updateQueue=be}else Oe.add(P);break e}else{if((r&1)===0){Um(p,X,r),vf();break e}P=Error(s(426))}}else if(Et&&D.mode&1){var Pt=Vm(k);if(Pt!==null){(Pt.flags&65536)===0&&(Pt.flags|=256),zm(Pt,k,D,p,r),Od(no(P,D));break e}}p=P=no(P,D),Ht!==4&&(Ht=2),jl===null?jl=[p]:jl.push(p),p=k;do{switch(p.tag){case 3:p.flags|=65536,r&=-r,p.lanes|=r;var G=Am(p,P,r);cm(p,G);break e;case 1:D=P;var z=p.type,K=p.stateNode;if((p.flags&128)===0&&(typeof z.getDerivedStateFromError=="function"||K!==null&&typeof K.componentDidCatch=="function"&&(ii===null||!ii.has(K)))){p.flags|=65536,r&=-r,p.lanes|=r;var ce=Pm(p,D,r);cm(p,ce);break e}}p=p.return}while(p!==null)}vp(i)}catch(De){r=De,zt===i&&i!==null&&(zt=i=i.return);continue}break}while(!0)}function yp(){var e=Gu.current;return Gu.current=Hu,e===null?Hu:e}function vf(){(Ht===0||Ht===3||Ht===2)&&(Ht=4),Qt===null||(ra&268435455)===0&&(Ku&268435455)===0||li(Qt,nn)}function rc(e,r){var i=at;at|=2;var u=yp();(Qt!==e||nn!==r)&&(ms=null,ia(e,r));do try{Yv();break}catch(f){pp(e,f)}while(!0);if(jd(),at=i,Gu.current=u,zt!==null)throw Error(s(261));return Qt=null,nn=0,Ht}function Yv(){for(;zt!==null;)gp(zt)}function Gv(){for(;zt!==null&&!Ue();)gp(zt)}function gp(e){var r=Sp(e.alternate,e,An);e.memoizedProps=e.pendingProps,r===null?vp(e):zt=r,uf.current=null}function vp(e){var r=e;do{var i=r.alternate;if(e=r.return,(r.flags&32768)===0){if(i=$v(i,r,An),i!==null){zt=i;return}}else{if(i=Wv(i,r),i!==null){i.flags&=32767,zt=i;return}if(e!==null)e.flags|=32768,e.subtreeFlags=0,e.deletions=null;else{Ht=6,zt=null;return}}if(r=r.sibling,r!==null){zt=r;return}zt=r=e}while(r!==null);Ht===0&&(Ht=5)}function aa(e,r,i){var u=ut,f=Jn.transition;try{Jn.transition=null,ut=1,Kv(e,r,i,u)}finally{Jn.transition=f,ut=u}return null}function Kv(e,r,i,u){do ao();while(ai!==null);if((at&6)!==0)throw Error(s(327));i=e.finishedWork;var f=e.finishedLanes;if(i===null)return null;if(e.finishedWork=null,e.finishedLanes=0,i===e.current)throw Error(s(177));e.callbackNode=null,e.callbackPriority=0;var p=i.lanes|i.childLanes;if(au(e,p),e===Qt&&(zt=Qt=null,nn=0),(i.subtreeFlags&2064)===0&&(i.flags&2064)===0||Ju||(Ju=!0,kp(Ri,function(){return ao(),null})),p=(i.flags&15990)!==0,(i.subtreeFlags&15990)!==0||p){p=Jn.transition,Jn.transition=null;var k=ut;ut=1;var D=at;at|=4,uf.current=null,Bv(e,i),lp(i,e),Sd(o),fr=!!g,o=g=null,e.current=i,Zv(i),Tr(),at=D,ut=k,Jn.transition=p}else e.current=i;if(Ju&&(Ju=!1,ai=e,ec=f),p=e.pendingLanes,p===0&&(ii=null),Zo(i.stateNode),Nn(e,wt()),r!==null)for(u=e.onRecoverableError,i=0;i<r.length;i++)f=r[i],u(f.value,{componentStack:f.stack,digest:f.digest});if(Xu)throw Xu=!1,e=ff,ff=null,e;return(ec&1)!==0&&e.tag!==0&&ao(),p=e.pendingLanes,(p&1)!==0?e===hf?Dl++:(Dl=0,hf=e):Dl=0,ti(),null}function ao(){if(ai!==null){var e=Mi(ec),r=Jn.transition,i=ut;try{if(Jn.transition=null,ut=16>e?16:e,ai===null)var u=!1;else{if(e=ai,ai=null,ec=0,(at&6)!==0)throw Error(s(331));var f=at;for(at|=4,Ne=e.current;Ne!==null;){var p=Ne,k=p.child;if((Ne.flags&16)!==0){var D=p.deletions;if(D!==null){for(var P=0;P<D.length;P++){var X=D[P];for(Ne=X;Ne!==null;){var oe=Ne;switch(oe.tag){case 0:case 11:case 15:Ol(8,oe,p)}var ue=oe.child;if(ue!==null)ue.return=oe,Ne=ue;else for(;Ne!==null;){oe=Ne;var ie=oe.sibling,we=oe.return;if(rp(oe),oe===X){Ne=null;break}if(ie!==null){ie.return=we,Ne=ie;break}Ne=we}}}var Oe=p.alternate;if(Oe!==null){var be=Oe.child;if(be!==null){Oe.child=null;do{var Pt=be.sibling;be.sibling=null,be=Pt}while(be!==null)}}Ne=p}}if((p.subtreeFlags&2064)!==0&&k!==null)k.return=p,Ne=k;else e:for(;Ne!==null;){if(p=Ne,(p.flags&2048)!==0)switch(p.tag){case 0:case 11:case 15:Ol(9,p,p.return)}var G=p.sibling;if(G!==null){G.return=p.return,Ne=G;break e}Ne=p.return}}var z=e.current;for(Ne=z;Ne!==null;){k=Ne;var K=k.child;if((k.subtreeFlags&2064)!==0&&K!==null)K.return=k,Ne=K;else e:for(k=z;Ne!==null;){if(D=Ne,(D.flags&2048)!==0)try{switch(D.tag){case 0:case 11:case 15:Yu(9,D)}}catch(De){Lt(D,D.return,De)}if(D===k){Ne=null;break e}var ce=D.sibling;if(ce!==null){ce.return=D.return,Ne=ce;break e}Ne=D.return}}if(at=f,ti(),en&&typeof en.onPostCommitFiberRoot=="function")try{en.onPostCommitFiberRoot(ba,e)}catch{}u=!0}return u}finally{ut=i,Jn.transition=r}}return!1}function xp(e,r,i){r=no(i,r),r=Am(e,r,1),e=ri(e,r,1),r=gn(),e!==null&&(Jr(e,1,r),Nn(e,r))}function Lt(e,r,i){if(e.tag===3)xp(e,e,i);else for(;r!==null;){if(r.tag===3){xp(r,e,i);break}else if(r.tag===1){var u=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(ii===null||!ii.has(u))){e=no(i,e),e=Pm(r,e,1),r=ri(r,e,1),e=gn(),r!==null&&(Jr(r,1,e),Nn(r,e));break}}r=r.return}}function Xv(e,r,i){var u=e.pingCache;u!==null&&u.delete(r),r=gn(),e.pingedLanes|=e.suspendedLanes&i,Qt===e&&(nn&i)===i&&(Ht===4||Ht===3&&(nn&130023424)===nn&&500>wt()-df?ia(e,0):cf|=i),Nn(e,r)}function wp(e,r){r===0&&((e.mode&1)===0?r=1:(r=Ds,Ds<<=1,(Ds&130023424)===0&&(Ds=4194304)));var i=gn();e=ds(e,r),e!==null&&(Jr(e,r,i),Nn(e,i))}function Jv(e){var r=e.memoizedState,i=0;r!==null&&(i=r.retryLane),wp(e,i)}function e0(e,r){var i=0;switch(e.tag){case 13:var u=e.stateNode,f=e.memoizedState;f!==null&&(i=f.retryLane);break;case 19:u=e.stateNode;break;default:throw Error(s(314))}u!==null&&u.delete(r),wp(e,i)}var Sp;Sp=function(e,r,i){if(e!==null)if(e.memoizedProps!==r.pendingProps||wn.current)kn=!0;else{if((e.lanes&i)===0&&(r.flags&128)===0)return kn=!1,zv(e,r,i);kn=(e.flags&131072)!==0}else kn=!1,Et&&(r.flags&1048576)!==0&&em(r,Ru,r.index);switch(r.lanes=0,r.tag){case 2:var u=r.type;qu(e,r),e=r.pendingProps;var f=Qa(r,on.current);eo(r,i),f=zd(null,r,u,e,f,i);var p=$d();return r.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(r.tag=1,r.memoizedState=null,r.updateQueue=null,Sn(u)?(p=!0,bu(r)):p=!1,r.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,Id(r),f.updater=Bu,r.stateNode=f,f._reactInternals=r,Qd(r,u,e,i),r=Xd(null,r,u,!0,p,i)):(r.tag=0,Et&&p&&Nd(r),yn(null,r,f,i),r=r.child),r;case 16:u=r.elementType;e:{switch(qu(e,r),e=r.pendingProps,f=u._init,u=f(u._payload),r.type=u,f=r.tag=n0(u),e=gr(u,e),f){case 0:r=Kd(null,r,u,e,i);break e;case 1:r=qm(null,r,u,e,i);break e;case 11:r=$m(null,r,u,e,i);break e;case 14:r=Wm(null,r,u,gr(u.type,e),i);break e}throw Error(s(306,u,""))}return r;case 0:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:gr(u,f),Kd(e,r,u,f,i);case 1:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:gr(u,f),qm(e,r,u,f,i);case 3:e:{if(Qm(r),e===null)throw Error(s(387));u=r.pendingProps,p=r.memoizedState,f=p.element,um(e,r),Pu(r,u,null,i);var k=r.memoizedState;if(u=k.element,p.isDehydrated)if(p={element:u,isDehydrated:!1,cache:k.cache,pendingSuspenseBoundaries:k.pendingSuspenseBoundaries,transitions:k.transitions},r.updateQueue.baseState=p,r.memoizedState=p,r.flags&256){f=no(Error(s(423)),r),r=Ym(e,r,u,i,f);break e}else if(u!==f){f=no(Error(s(424)),r),r=Ym(e,r,u,i,f);break e}else for(Fn=ae(r.stateNode.containerInfo.firstChild),Ln=r,Et=!0,yr=null,i=om(r,null,u,i),r.child=i;i;)i.flags=i.flags&-3|4096,i=i.sibling;else{if(Ka(),u===f){r=hs(e,r,i);break e}yn(e,r,u,i)}r=r.child}return r;case 5:return fm(r),e===null&&Cd(r),u=r.type,f=r.pendingProps,p=e!==null?e.memoizedProps:null,k=f.children,m(u,f)?k=null:p!==null&&m(u,p)&&(r.flags|=32),Zm(e,r),yn(e,r,k,i),r.child;case 6:return e===null&&Cd(r),null;case 13:return Gm(e,r,i);case 4:return Ld(r,r.stateNode.containerInfo),u=r.pendingProps,e===null?r.child=Xa(r,null,u,i):yn(e,r,u,i),r.child;case 11:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:gr(u,f),$m(e,r,u,f,i);case 7:return yn(e,r,r.pendingProps,i),r.child;case 8:return yn(e,r,r.pendingProps.children,i),r.child;case 12:return yn(e,r,r.pendingProps.children,i),r.child;case 10:e:{if(u=r.type._context,f=r.pendingProps,p=r.memoizedProps,k=f.value,ct(Lu,u._currentValue),u._currentValue=k,p!==null)if(Ot(p.value,k)){if(p.children===f.children&&!wn.current){r=hs(e,r,i);break e}}else for(p=r.child,p!==null&&(p.return=r);p!==null;){var D=p.dependencies;if(D!==null){k=p.child;for(var P=D.firstContext;P!==null;){if(P.context===u){if(p.tag===1){P=fs(-1,i&-i),P.tag=2;var X=p.updateQueue;if(X!==null){X=X.shared;var oe=X.pending;oe===null?P.next=P:(P.next=oe.next,oe.next=P),X.pending=P}}p.lanes|=i,P=p.alternate,P!==null&&(P.lanes|=i),Rd(p.return,i,r),D.lanes|=i;break}P=P.next}}else if(p.tag===10)k=p.type===r.type?null:p.child;else if(p.tag===18){if(k=p.return,k===null)throw Error(s(341));k.lanes|=i,D=k.alternate,D!==null&&(D.lanes|=i),Rd(k,i,r),k=p.sibling}else k=p.child;if(k!==null)k.return=p;else for(k=p;k!==null;){if(k===r){k=null;break}if(p=k.sibling,p!==null){p.return=k.return,k=p;break}k=k.return}p=k}yn(e,r,f.children,i),r=r.child}return r;case 9:return f=r.type,u=r.pendingProps.children,eo(r,i),f=Kn(f),u=u(f),r.flags|=1,yn(e,r,u,i),r.child;case 14:return u=r.type,f=gr(u,r.pendingProps),f=gr(u.type,f),Wm(e,r,u,f,i);case 15:return Hm(e,r,r.type,r.pendingProps,i);case 17:return u=r.type,f=r.pendingProps,f=r.elementType===u?f:gr(u,f),qu(e,r),r.tag=1,Sn(u)?(e=!0,bu(r)):e=!1,eo(r,i),Lm(r,u,f),Qd(r,u,f,i),Xd(null,r,u,!0,e,i);case 19:return Xm(e,r,i);case 22:return Bm(e,r,i)}throw Error(s(156,r.tag))};function kp(e,r){return zo(e,r)}function t0(e,r,i,u){this.tag=e,this.key=i,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function er(e,r,i,u){return new t0(e,r,i,u)}function xf(e){return e=e.prototype,!(!e||!e.isReactComponent)}function n0(e){if(typeof e=="function")return xf(e)?1:0;if(e!=null){if(e=e.$$typeof,e===ge)return 11;if(e===Ce)return 14}return 2}function ui(e,r){var i=e.alternate;return i===null?(i=er(e.tag,r,e.key,e.mode),i.elementType=e.elementType,i.type=e.type,i.stateNode=e.stateNode,i.alternate=e,e.alternate=i):(i.pendingProps=r,i.type=e.type,i.flags=0,i.subtreeFlags=0,i.deletions=null),i.flags=e.flags&14680064,i.childLanes=e.childLanes,i.lanes=e.lanes,i.child=e.child,i.memoizedProps=e.memoizedProps,i.memoizedState=e.memoizedState,i.updateQueue=e.updateQueue,r=e.dependencies,i.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},i.sibling=e.sibling,i.index=e.index,i.ref=e.ref,i}function sc(e,r,i,u,f,p){var k=2;if(u=e,typeof e=="function")xf(e)&&(k=1);else if(typeof e=="string")k=5;else e:switch(e){case ne:return oa(i.children,f,p,r);case he:k=8,f|=8;break;case ye:return e=er(12,i,r,f|2),e.elementType=ye,e.lanes=p,e;case fe:return e=er(13,i,r,f),e.elementType=fe,e.lanes=p,e;case Ee:return e=er(19,i,r,f),e.elementType=Ee,e.lanes=p,e;case Me:return ic(i,f,p,r);default:if(typeof e=="object"&&e!==null)switch(e.$$typeof){case ke:k=10;break e;case pe:k=9;break e;case ge:k=11;break e;case Ce:k=14;break e;case Ze:k=16,u=null;break e}throw Error(s(130,e==null?e:typeof e,""))}return r=er(k,i,r,f),r.elementType=e,r.type=u,r.lanes=p,r}function oa(e,r,i,u){return e=er(7,e,u,r),e.lanes=i,e}function ic(e,r,i,u){return e=er(22,e,u,r),e.elementType=Me,e.lanes=i,e.stateNode={isHidden:!1},e}function wf(e,r,i){return e=er(6,e,null,r),e.lanes=i,e}function Sf(e,r,i){return r=er(4,e.children!==null?e.children:[],e.key,r),r.lanes=i,r.stateNode={containerInfo:e.containerInfo,pendingChildren:null,implementation:e.implementation},r}function r0(e,r,i,u,f){this.tag=r,this.containerInfo=e,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Xr(0),this.expirationTimes=Xr(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Xr(0),this.identifierPrefix=u,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function kf(e,r,i,u,f,p,k,D,P){return e=new r0(e,r,i,D,P),r===1?(r=1,p===!0&&(r|=8)):r=0,p=er(3,null,null,r),e.current=p,p.stateNode=e,p.memoizedState={element:u,isDehydrated:i,cache:null,transitions:null,pendingSuspenseBoundaries:null},Id(p),e}function s0(e,r,i){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:J,key:u==null?null:""+u,children:e,containerInfo:r,implementation:i}}function _p(e){if(!e)return Lr;e=e._reactInternals;e:{if(Er(e)!==e||e.tag!==1)throw Error(s(170));var r=e;do{switch(r.tag){case 3:r=r.stateNode.context;break e;case 1:if(Sn(r.type)){r=r.stateNode.__reactInternalMemoizedMergedChildContext;break e}}r=r.return}while(r!==null);throw Error(s(171))}if(e.tag===1){var i=e.type;if(Sn(i))return Kh(e,i,r)}return r}function Np(e,r,i,u,f,p,k,D,P){return e=kf(i,u,!0,e,f,p,k,D,P),e.context=_p(null),i=e.current,u=gn(),f=oi(i),p=fs(u,f),p.callback=r??null,ri(i,p,f),e.current.lanes=f,Jr(e,f,u),Nn(e,u),e}function ac(e,r,i,u){var f=r.current,p=gn(),k=oi(f);return i=_p(i),r.context===null?r.context=i:r.pendingContext=i,r=fs(p,k),r.payload={element:e},u=u===void 0?null:u,u!==null&&(r.callback=u),e=ri(f,r,k),e!==null&&(wr(e,f,k,p),Au(e,f,k)),k}function oc(e){if(e=e.current,!e.child)return null;switch(e.child.tag){case 5:return e.child.stateNode;default:return e.child.stateNode}}function Ep(e,r){if(e=e.memoizedState,e!==null&&e.dehydrated!==null){var i=e.retryLane;e.retryLane=i!==0&&i<r?i:r}}function _f(e,r){Ep(e,r),(e=e.alternate)&&Ep(e,r)}function i0(){return null}var Tp=typeof reportError=="function"?reportError:function(e){console.error(e)};function Nf(e){this._internalRoot=e}lc.prototype.render=Nf.prototype.render=function(e){var r=this._internalRoot;if(r===null)throw Error(s(409));ac(e,r,null,null)},lc.prototype.unmount=Nf.prototype.unmount=function(){var e=this._internalRoot;if(e!==null){this._internalRoot=null;var r=e.containerInfo;sa(function(){ac(null,e,null,null)}),r[mt]=null}};function lc(e){this._internalRoot=e}lc.prototype.unstable_scheduleHydration=function(e){if(e){var r=Qo();e={blockedOn:null,target:e,priority:r};for(var i=0;i<jr.length&&r!==0&&r<jr[i].priority;i++);jr.splice(i,0,e),i===0&&uu(e)}};function Ef(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11)}function uc(e){return!(!e||e.nodeType!==1&&e.nodeType!==9&&e.nodeType!==11&&(e.nodeType!==8||e.nodeValue!==" react-mount-point-unstable "))}function Cp(){}function a0(e,r,i,u,f){if(f){if(typeof u=="function"){var p=u;u=function(){var X=oc(k);p.call(X)}}var k=Np(r,u,e,0,null,!1,!1,"",Cp);return e._reactRootContainer=k,e[mt]=k.current,Bi(e.nodeType===8?e.parentNode:e),sa(),k}for(;f=e.lastChild;)e.removeChild(f);if(typeof u=="function"){var D=u;u=function(){var X=oc(P);D.call(X)}}var P=kf(e,0,!1,null,null,!1,!1,"",Cp);return e._reactRootContainer=P,e[mt]=P.current,Bi(e.nodeType===8?e.parentNode:e),sa(function(){ac(r,P,i,u)}),P}function cc(e,r,i,u,f){var p=i._reactRootContainer;if(p){var k=p;if(typeof f=="function"){var D=f;f=function(){var P=oc(k);D.call(P)}}ac(r,k,e,f)}else k=a0(i,r,e,f,u);return oc(k)}Ls=function(e){switch(e.tag){case 3:var r=e.stateNode;if(r.current.memoizedState.isDehydrated){var i=Kr(r.pendingLanes);i!==0&&(Is(r,i|1),Nn(r,wt()),(at&6)===0&&(io=wt()+500,ti()))}break;case 13:sa(function(){var u=ds(e,1);if(u!==null){var f=gn();wr(u,e,1,f)}}),_f(e,1)}},Fs=function(e){if(e.tag===13){var r=ds(e,134217728);if(r!==null){var i=gn();wr(r,e,134217728,i)}_f(e,134217728)}},ou=function(e){if(e.tag===13){var r=oi(e),i=ds(e,r);if(i!==null){var u=gn();wr(i,e,r,u)}_f(e,r)}},Qo=function(){return ut},lu=function(e,r){var i=ut;try{return ut=e,r()}finally{ut=i}},xt=function(e,r,i){switch(r){case"input":if(Hn(e,i),r=i.name,i.type==="radio"&&r!=null){for(i=e;i.parentNode;)i=i.parentNode;for(i=i.querySelectorAll("input[name="+JSON.stringify(""+r)+'][type="radio"]'),r=0;r<i.length;r++){var u=i[r];if(u!==e&&u.form===e.form){var f=Gi(u);if(!f)throw Error(s(90));sr(u),Hn(u,f)}}}break;case"textarea":Qr(e,i);break;case"select":r=i.value,r!=null&&Rn(e,!!i.multiple,r,!1)}},Di=yf,Cs=sa;var o0={usingClientEntryPoint:!1,Events:[Xs,Js,Gi,ji,Ts,yf]},Rl={findFiberByHostInstance:In,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},l0={bundleType:Rl.bundleType,version:Rl.version,rendererPackageName:Rl.rendererPackageName,rendererConfig:Rl.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:U.ReactCurrentDispatcher,findHostInstanceByFiber:function(e){return e=su(e),e===null?null:e.stateNode},findFiberByHostInstance:Rl.findFiberByHostInstance||i0,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var dc=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!dc.isDisabled&&dc.supportsFiber)try{ba=dc.inject(l0),en=dc}catch{}}return En.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=o0,En.createPortal=function(e,r){var i=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!Ef(r))throw Error(s(200));return s0(e,r,null,i)},En.createRoot=function(e,r){if(!Ef(e))throw Error(s(299));var i=!1,u="",f=Tp;return r!=null&&(r.unstable_strictMode===!0&&(i=!0),r.identifierPrefix!==void 0&&(u=r.identifierPrefix),r.onRecoverableError!==void 0&&(f=r.onRecoverableError)),r=kf(e,1,!1,null,null,i,!1,u,f),e[mt]=r.current,Bi(e.nodeType===8?e.parentNode:e),new Nf(r)},En.findDOMNode=function(e){if(e==null)return null;if(e.nodeType===1)return e;var r=e._reactInternals;if(r===void 0)throw typeof e.render=="function"?Error(s(188)):(e=Object.keys(e).join(","),Error(s(268,e)));return e=su(r),e=e===null?null:e.stateNode,e},En.flushSync=function(e){return sa(e)},En.hydrate=function(e,r,i){if(!uc(r))throw Error(s(200));return cc(null,e,r,!0,i)},En.hydrateRoot=function(e,r,i){if(!Ef(e))throw Error(s(405));var u=i!=null&&i.hydratedSources||null,f=!1,p="",k=Tp;if(i!=null&&(i.unstable_strictMode===!0&&(f=!0),i.identifierPrefix!==void 0&&(p=i.identifierPrefix),i.onRecoverableError!==void 0&&(k=i.onRecoverableError)),r=Np(r,null,e,1,i??null,f,!1,p,k),e[mt]=r.current,Bi(e),u)for(e=0;e<u.length;e++)i=u[e],f=i._getVersion,f=f(i._source),r.mutableSourceEagerHydrationData==null?r.mutableSourceEagerHydrationData=[i,f]:r.mutableSourceEagerHydrationData.push(i,f);return new lc(r)},En.render=function(e,r,i){if(!uc(r))throw Error(s(200));return cc(null,e,r,!1,i)},En.unmountComponentAtNode=function(e){if(!uc(e))throw Error(s(40));return e._reactRootContainer?(sa(function(){cc(null,null,e,!1,function(){e._reactRootContainer=null,e[mt]=null})}),!0):!1},En.unstable_batchedUpdates=yf,En.unstable_renderSubtreeIntoContainer=function(e,r,i,u){if(!uc(i))throw Error(s(200));if(e==null||e._reactInternals===void 0)throw Error(s(38));return cc(e,r,i,!1,u)},En.version="18.3.1-next-f1338f8080-20240426",En}var Fp;function og(){if(Fp)return bf.exports;Fp=1;function t(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(t)}catch(n){console.error(n)}}return t(),bf.exports=x0(),bf.exports}var Ap;function w0(){if(Ap)return hc;Ap=1;var t=og();return hc.createRoot=t.createRoot,hc.hydrateRoot=t.hydrateRoot,hc}var S0=w0();og();/**
* @remix-run/router v1.23.3
*
* 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
*/function Pl(){return Pl=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)({}).hasOwnProperty.call(s,a)&&(t[a]=s[a])}return t},Pl.apply(null,arguments)}var ki;(function(t){t.Pop="POP",t.Push="PUSH",t.Replace="REPLACE"})(ki||(ki={}));const Pp="popstate";function k0(t){t===void 0&&(t={});function n(a,l){let{pathname:c,search:h,hash:y}=a.location;return Yf("",{pathname:c,search:h,hash:y},l.state&&l.state.usr||null,l.state&&l.state.key||"default")}function s(a,l){return typeof l=="string"?l:Sc(l)}return N0(n,s,null,t)}function Rt(t,n){if(t===!1||t===null||typeof t>"u")throw new Error(n)}function Oh(t,n){if(!t){typeof console<"u"&&console.warn(n);try{throw new Error(n)}catch{}}}function _0(){return Math.random().toString(36).substr(2,8)}function Up(t,n){return{usr:t.state,key:t.key,idx:n}}function Yf(t,n,s,a){return s===void 0&&(s=null),Pl({pathname:typeof t=="string"?t:t.pathname,search:"",hash:""},typeof n=="string"?Mo(n):n,{state:s,key:n&&n.key||a||_0()})}function Sc(t){let{pathname:n="/",search:s="",hash:a=""}=t;return s&&s!=="?"&&(n+=s.charAt(0)==="?"?s:"?"+s),a&&a!=="#"&&(n+=a.charAt(0)==="#"?a:"#"+a),n}function Mo(t){let n={};if(t){let s=t.indexOf("#");s>=0&&(n.hash=t.substr(s),t=t.substr(0,s));let a=t.indexOf("?");a>=0&&(n.search=t.substr(a),t=t.substr(0,a)),t&&(n.pathname=t)}return n}function N0(t,n,s,a){a===void 0&&(a={});let{window:l=document.defaultView,v5Compat:c=!1}=a,h=l.history,y=ki.Pop,x=null,w=T();w==null&&(w=0,h.replaceState(Pl({},h.state,{idx:w}),""));function T(){return(h.state||{idx:null}).idx}function E(){y=ki.Pop;let b=T(),I=b==null?null:b-w;w=b,x&&x({action:y,location:C.location,delta:I})}function _(b,I){y=ki.Push;let j=Yf(C.location,b,I);w=T()+1;let F=Up(j,w),U=C.createHref(j);try{h.pushState(F,"",U)}catch($){if($ instanceof DOMException&&$.name==="DataCloneError")throw $;l.location.assign(U)}c&&x&&x({action:y,location:C.location,delta:1})}function S(b,I){y=ki.Replace;let j=Yf(C.location,b,I);w=T();let F=Up(j,w),U=C.createHref(j);h.replaceState(F,"",U),c&&x&&x({action:y,location:C.location,delta:0})}function O(b){let I=l.location.origin!=="null"?l.location.origin:l.location.href,j=typeof b=="string"?b:Sc(b);return j=j.replace(/ $/,"%20"),Rt(I,"No window.location.(origin|href) available to create URL for href: "+j),new URL(j,I)}let C={get action(){return y},get location(){return t(l,h)},listen(b){if(x)throw new Error("A history only accepts one active listener");return l.addEventListener(Pp,E),x=b,()=>{l.removeEventListener(Pp,E),x=null}},createHref(b){return n(l,b)},createURL:O,encodeLocation(b){let I=O(b);return{pathname:I.pathname,search:I.search,hash:I.hash}},push:_,replace:S,go(b){return h.go(b)}};return C}var Vp;(function(t){t.data="data",t.deferred="deferred",t.redirect="redirect",t.error="error"})(Vp||(Vp={}));function E0(t,n,s){return s===void 0&&(s="/"),T0(t,n,s)}function T0(t,n,s,a){let l=typeof n=="string"?Mo(n):n,c=Co(l.pathname||"/",s);if(c==null)return null;let h=lg(t);C0(h);let y=null,x=P0(c);for(let w=0;y==null&&w<h.length;++w)y=F0(h[w],x);return y}function lg(t,n,s,a){n===void 0&&(n=[]),s===void 0&&(s=[]),a===void 0&&(a="");let l=(c,h,y)=>{let x={relativePath:y===void 0?c.path||"":y,caseSensitive:c.caseSensitive===!0,childrenIndex:h,route:c};x.relativePath.startsWith("/")&&(Rt(x.relativePath.startsWith(a),'Absolute route path "'+x.relativePath+'" nested under path '+('"'+a+'" is not valid. An absolute child route path ')+"must start with the combined path of all its parent routes."),x.relativePath=x.relativePath.slice(a.length));let w=Ei([a,x.relativePath]),T=s.concat(x);c.children&&c.children.length>0&&(Rt(c.index!==!0,"Index routes must not have child routes. Please remove "+('all child routes from route path "'+w+'".')),lg(c.children,n,T,w)),!(c.path==null&&!c.index)&&n.push({path:w,score:I0(w,c.index),routesMeta:T})};return t.forEach((c,h)=>{var y;if(c.path===""||!((y=c.path)!=null&&y.includes("?")))l(c,h);else for(let x of ug(c.path))l(c,h,x)}),n}function ug(t){let n=t.split("/");if(n.length===0)return[];let[s,...a]=n,l=s.endsWith("?"),c=s.replace(/\?$/,"");if(a.length===0)return l?[c,""]:[c];let h=ug(a.join("/")),y=[];return y.push(...h.map(x=>x===""?c:[c,x].join("/"))),l&&y.push(...h),y.map(x=>t.startsWith("/")&&x===""?"/":x)}function C0(t){t.sort((n,s)=>n.score!==s.score?s.score-n.score:L0(n.routesMeta.map(a=>a.childrenIndex),s.routesMeta.map(a=>a.childrenIndex)))}const O0=/^:[\w-]+$/,b0=3,j0=2,D0=1,R0=10,M0=-2,zp=t=>t==="*";function I0(t,n){let s=t.split("/"),a=s.length;return s.some(zp)&&(a+=M0),n&&(a+=j0),s.filter(l=>!zp(l)).reduce((l,c)=>l+(O0.test(c)?b0:c===""?D0:R0),a)}function L0(t,n){return t.length===n.length&&t.slice(0,-1).every((a,l)=>a===n[l])?t[t.length-1]-n[n.length-1]:0}function F0(t,n,s){let{routesMeta:a}=t,l={},c="/",h=[];for(let y=0;y<a.length;++y){let x=a[y],w=y===a.length-1,T=c==="/"?n:n.slice(c.length)||"/",E=Gf({path:x.relativePath,caseSensitive:x.caseSensitive,end:w},T),_=x.route;if(!E)return null;Object.assign(l,E.params),h.push({params:l,pathname:Ei([c,E.pathname]),pathnameBase:W0(Ei([c,E.pathnameBase])),route:_}),E.pathnameBase!=="/"&&(c=Ei([c,E.pathnameBase]))}return h}function Gf(t,n){typeof t=="string"&&(t={path:t,caseSensitive:!1,end:!0});let[s,a]=A0(t.path,t.caseSensitive,t.end),l=n.match(s);if(!l)return null;let c=l[0],h=c.replace(/(.)\/+$/,"$1"),y=l.slice(1);return{params:a.reduce((w,T,E)=>{let{paramName:_,isOptional:S}=T;if(_==="*"){let C=y[E]||"";h=c.slice(0,c.length-C.length).replace(/(.)\/+$/,"$1")}const O=y[E];return S&&!O?w[_]=void 0:w[_]=(O||"").replace(/%2F/g,"/"),w},{}),pathname:c,pathnameBase:h,pattern:t}}function A0(t,n,s){n===void 0&&(n=!1),s===void 0&&(s=!0),Oh(t==="*"||!t.endsWith("*")||t.endsWith("/*"),'Route path "'+t+'" will be treated as if it were '+('"'+t.replace(/\*$/,"/*")+'" because the `*` character must ')+"always follow a `/` in the pattern. To get rid of this warning, "+('please change the route path to "'+t.replace(/\*$/,"/*")+'".'));let a=[],l="^"+t.replace(/\/*\*?$/,"").replace(/^\/*/,"/").replace(/[\\.*+^${}|()[\]]/g,"\\$&").replace(/\/:([\w-]+)(\?)?/g,(h,y,x)=>(a.push({paramName:y,isOptional:x!=null}),x?"/?([^\\/]+)?":"/([^\\/]+)"));return t.endsWith("*")?(a.push({paramName:"*"}),l+=t==="*"||t==="/*"?"(.*)$":"(?:\\/(.+)|\\/*)$"):s?l+="\\/*$":t!==""&&t!=="/"&&(l+="(?:(?=\\/|$))"),[new RegExp(l,n?void 0:"i"),a]}function P0(t){try{return t.split("/").map(n=>decodeURIComponent(n).replace(/\//g,"%2F")).join("/")}catch(n){return Oh(!1,'The URL path "'+t+'" could not be decoded because it is is a malformed URL segment. This is probably due to a bad percent '+("encoding ("+n+").")),t}}function Co(t,n){if(n==="/")return t;if(!t.toLowerCase().startsWith(n.toLowerCase()))return null;let s=n.endsWith("/")?n.length-1:n.length,a=t.charAt(s);return a&&a!=="/"?null:t.slice(s)||"/"}const U0=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,V0=t=>U0.test(t);function z0(t,n){n===void 0&&(n="/");let{pathname:s,search:a="",hash:l=""}=typeof t=="string"?Mo(t):t,c;if(s)if(V0(s))c=s;else{if(s.includes("//")){let h=s;s=cg(s),Oh(!1,"Pathnames cannot have embedded double slashes - normalizing "+(h+" -> "+s))}s.startsWith("/")?c=$p(s.substring(1),"/"):c=$p(s,n)}else c=n;return{pathname:c,search:H0(a),hash:B0(l)}}function $p(t,n){let s=n.replace(/\/+$/,"").split("/");return t.split("/").forEach(l=>{l===".."?s.length>1&&s.pop():l!=="."&&s.push(l)}),s.length>1?s.join("/"):"/"}function Rf(t,n,s,a){return"Cannot include a '"+t+"' character in a manually specified "+("`to."+n+"` field ["+JSON.stringify(a)+"]. Please separate it out to the ")+("`to."+s+"` field. Alternatively you may provide the full path as ")+'a string in <Link to="..."> and the router will parse it for you.'}function $0(t){return t.filter((n,s)=>s===0||n.route.path&&n.route.path.length>0)}function bh(t,n){let s=$0(t);return n?s.map((a,l)=>l===s.length-1?a.pathname:a.pathnameBase):s.map(a=>a.pathnameBase)}function jh(t,n,s,a){a===void 0&&(a=!1);let l;typeof t=="string"?l=Mo(t):(l=Pl({},t),Rt(!l.pathname||!l.pathname.includes("?"),Rf("?","pathname","search",l)),Rt(!l.pathname||!l.pathname.includes("#"),Rf("#","pathname","hash",l)),Rt(!l.search||!l.search.includes("#"),Rf("#","search","hash",l)));let c=t===""||l.pathname==="",h=c?"/":l.pathname,y;if(h==null)y=s;else{let E=n.length-1;if(!a&&h.startsWith("..")){let _=h.split("/");for(;_[0]==="..";)_.shift(),E-=1;l.pathname=_.join("/")}y=E>=0?n[E]:"/"}let x=z0(l,y),w=h&&h!=="/"&&h.endsWith("/"),T=(c||h===".")&&s.endsWith("/");return!x.pathname.endsWith("/")&&(w||T)&&(x.pathname+="/"),x}const cg=t=>t.replace(/\/\/+/g,"/"),Ei=t=>cg(t.join("/")),W0=t=>t.replace(/\/+$/,"").replace(/^\/*/,"/"),H0=t=>!t||t==="?"?"":t.startsWith("?")?t:"?"+t,B0=t=>!t||t==="#"?"":t.startsWith("#")?t:"#"+t;function Z0(t){return t!=null&&typeof t.status=="number"&&typeof t.statusText=="string"&&typeof t.internal=="boolean"&&"data"in t}const dg=["post","put","patch","delete"];new Set(dg);const q0=["get",...dg];new Set(q0);/**
* React Router v6.30.4
*
* 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
*/function Ul(){return Ul=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)({}).hasOwnProperty.call(s,a)&&(t[a]=s[a])}return t},Ul.apply(null,arguments)}const Mc=Z.createContext(null),fg=Z.createContext(null),Ns=Z.createContext(null),Ic=Z.createContext(null),Es=Z.createContext({outlet:null,matches:[],isDataRoute:!1}),hg=Z.createContext(null);function Q0(t,n){let{relative:s}=n===void 0?{}:n;Io()||Rt(!1);let{basename:a,navigator:l}=Z.useContext(Ns),{hash:c,pathname:h,search:y}=Fc(t,{relative:s}),x=h;return a!=="/"&&(x=h==="/"?a:Ei([a,h])),l.createHref({pathname:x,search:y,hash:c})}function Io(){return Z.useContext(Ic)!=null}function Na(){return Io()||Rt(!1),Z.useContext(Ic).location}function mg(t){Z.useContext(Ns).static||Z.useLayoutEffect(t)}function Lc(){let{isDataRoute:t}=Z.useContext(Es);return t?ux():Y0()}function Y0(){Io()||Rt(!1);let t=Z.useContext(Mc),{basename:n,future:s,navigator:a}=Z.useContext(Ns),{matches:l}=Z.useContext(Es),{pathname:c}=Na(),h=JSON.stringify(bh(l,s.v7_relativeSplatPath)),y=Z.useRef(!1);return mg(()=>{y.current=!0}),Z.useCallback(function(w,T){if(T===void 0&&(T={}),!y.current)return;if(typeof w=="number"){a.go(w);return}let E=jh(w,JSON.parse(h),c,T.relative==="path");t==null&&n!=="/"&&(E.pathname=E.pathname==="/"?n:Ei([n,E.pathname])),(T.replace?a.replace:a.push)(E,T.state,T)},[n,a,h,c,t])}const G0=Z.createContext(null);function K0(t){let n=Z.useContext(Es).outlet;return n&&Z.createElement(G0.Provider,{value:t},n)}function Fc(t,n){let{relative:s}=n===void 0?{}:n,{future:a}=Z.useContext(Ns),{matches:l}=Z.useContext(Es),{pathname:c}=Na(),h=JSON.stringify(bh(l,a.v7_relativeSplatPath));return Z.useMemo(()=>jh(t,JSON.parse(h),c,s==="path"),[t,h,c,s])}function X0(t,n){return J0(t,n)}function J0(t,n,s,a){Io()||Rt(!1);let{navigator:l}=Z.useContext(Ns),{matches:c}=Z.useContext(Es),h=c[c.length-1],y=h?h.params:{};h&&h.pathname;let x=h?h.pathnameBase:"/";h&&h.route;let w=Na(),T;if(n){var E;let b=typeof n=="string"?Mo(n):n;x==="/"||(E=b.pathname)!=null&&E.startsWith(x)||Rt(!1),T=b}else T=w;let _=T.pathname||"/",S=_;if(x!=="/"){let b=x.replace(/^\//,"").split("/");S="/"+_.replace(/^\//,"").split("/").slice(b.length).join("/")}let O=E0(t,{pathname:S}),C=sx(O&&O.map(b=>Object.assign({},b,{params:Object.assign({},y,b.params),pathname:Ei([x,l.encodeLocation?l.encodeLocation(b.pathname).pathname:b.pathname]),pathnameBase:b.pathnameBase==="/"?x:Ei([x,l.encodeLocation?l.encodeLocation(b.pathnameBase).pathname:b.pathnameBase])})),c,s,a);return n&&C?Z.createElement(Ic.Provider,{value:{location:Ul({pathname:"/",search:"",hash:"",state:null,key:"default"},T),navigationType:ki.Pop}},C):C}function ex(){let t=lx(),n=Z0(t)?t.status+" "+t.statusText:t instanceof Error?t.message:JSON.stringify(t),s=t instanceof Error?t.stack:null,l={padding:"0.5rem",backgroundColor:"rgba(200,200,200, 0.5)"};return Z.createElement(Z.Fragment,null,Z.createElement("h2",null,"Unexpected Application Error!"),Z.createElement("h3",{style:{fontStyle:"italic"}},n),s?Z.createElement("pre",{style:l},s):null,null)}const tx=Z.createElement(ex,null);class nx 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,s){return s.location!==n.location||s.revalidation!=="idle"&&n.revalidation==="idle"?{error:n.error,location:n.location,revalidation:n.revalidation}:{error:n.error!==void 0?n.error:s.error,location:s.location,revalidation:n.revalidation||s.revalidation}}componentDidCatch(n,s){console.error("React Router caught the following error during render",n,s)}render(){return this.state.error!==void 0?Z.createElement(Es.Provider,{value:this.props.routeContext},Z.createElement(hg.Provider,{value:this.state.error,children:this.props.component})):this.props.children}}function rx(t){let{routeContext:n,match:s,children:a}=t,l=Z.useContext(Mc);return l&&l.static&&l.staticContext&&(s.route.errorElement||s.route.ErrorBoundary)&&(l.staticContext._deepestRenderedBoundaryId=s.route.id),Z.createElement(Es.Provider,{value:n},a)}function sx(t,n,s,a){var l;if(n===void 0&&(n=[]),s===void 0&&(s=null),a===void 0&&(a=null),t==null){var c;if(!s)return null;if(s.errors)t=s.matches;else if((c=a)!=null&&c.v7_partialHydration&&n.length===0&&!s.initialized&&s.matches.length>0)t=s.matches;else return null}let h=t,y=(l=s)==null?void 0:l.errors;if(y!=null){let T=h.findIndex(E=>E.route.id&&(y==null?void 0:y[E.route.id])!==void 0);T>=0||Rt(!1),h=h.slice(0,Math.min(h.length,T+1))}let x=!1,w=-1;if(s&&a&&a.v7_partialHydration)for(let T=0;T<h.length;T++){let E=h[T];if((E.route.HydrateFallback||E.route.hydrateFallbackElement)&&(w=T),E.route.id){let{loaderData:_,errors:S}=s,O=E.route.loader&&_[E.route.id]===void 0&&(!S||S[E.route.id]===void 0);if(E.route.lazy||O){x=!0,w>=0?h=h.slice(0,w+1):h=[h[0]];break}}}return h.reduceRight((T,E,_)=>{let S,O=!1,C=null,b=null;s&&(S=y&&E.route.id?y[E.route.id]:void 0,C=E.route.errorElement||tx,x&&(w<0&&_===0?(cx("route-fallback"),O=!0,b=null):w===_&&(O=!0,b=E.route.hydrateFallbackElement||null)));let I=n.concat(h.slice(0,_+1)),j=()=>{let F;return S?F=C:O?F=b:E.route.Component?F=Z.createElement(E.route.Component,null):E.route.element?F=E.route.element:F=T,Z.createElement(rx,{match:E,routeContext:{outlet:T,matches:I,isDataRoute:s!=null},children:F})};return s&&(E.route.ErrorBoundary||E.route.errorElement||_===0)?Z.createElement(nx,{location:s.location,revalidation:s.revalidation,component:C,error:S,children:j(),routeContext:{outlet:null,matches:I,isDataRoute:!0}}):j()},null)}var pg=(function(t){return t.UseBlocker="useBlocker",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t})(pg||{}),yg=(function(t){return t.UseBlocker="useBlocker",t.UseLoaderData="useLoaderData",t.UseActionData="useActionData",t.UseRouteError="useRouteError",t.UseNavigation="useNavigation",t.UseRouteLoaderData="useRouteLoaderData",t.UseMatches="useMatches",t.UseRevalidator="useRevalidator",t.UseNavigateStable="useNavigate",t.UseRouteId="useRouteId",t})(yg||{});function ix(t){let n=Z.useContext(Mc);return n||Rt(!1),n}function ax(t){let n=Z.useContext(fg);return n||Rt(!1),n}function ox(t){let n=Z.useContext(Es);return n||Rt(!1),n}function gg(t){let n=ox(),s=n.matches[n.matches.length-1];return s.route.id||Rt(!1),s.route.id}function lx(){var t;let n=Z.useContext(hg),s=ax(),a=gg();return n!==void 0?n:(t=s.errors)==null?void 0:t[a]}function ux(){let{router:t}=ix(pg.UseNavigateStable),n=gg(yg.UseNavigateStable),s=Z.useRef(!1);return mg(()=>{s.current=!0}),Z.useCallback(function(l,c){c===void 0&&(c={}),s.current&&(typeof l=="number"?t.navigate(l):t.navigate(l,Ul({fromRouteId:n},c)))},[t,n])}const Wp={};function cx(t,n,s){Wp[t]||(Wp[t]=!0)}function dx(t,n){t==null||t.v7_startTransition,t==null||t.v7_relativeSplatPath}function fx(t){let{to:n,replace:s,state:a,relative:l}=t;Io()||Rt(!1);let{future:c,static:h}=Z.useContext(Ns),{matches:y}=Z.useContext(Es),{pathname:x}=Na(),w=Lc(),T=jh(n,bh(y,c.v7_relativeSplatPath),x,l==="path"),E=JSON.stringify(T);return Z.useEffect(()=>w(JSON.parse(E),{replace:s,state:a,relative:l}),[w,E,l,s,a]),null}function hx(t){return K0(t.context)}function ua(t){Rt(!1)}function mx(t){let{basename:n="/",children:s=null,location:a,navigationType:l=ki.Pop,navigator:c,static:h=!1,future:y}=t;Io()&&Rt(!1);let x=n.replace(/^\/*/,"/"),w=Z.useMemo(()=>({basename:x,navigator:c,static:h,future:Ul({v7_relativeSplatPath:!1},y)}),[x,y,c,h]);typeof a=="string"&&(a=Mo(a));let{pathname:T="/",search:E="",hash:_="",state:S=null,key:O="default"}=a,C=Z.useMemo(()=>{let b=Co(T,x);return b==null?null:{location:{pathname:b,search:E,hash:_,state:S,key:O},navigationType:l}},[x,T,E,_,S,O,l]);return C==null?null:Z.createElement(Ns.Provider,{value:w},Z.createElement(Ic.Provider,{children:s,value:C}))}function px(t){let{children:n,location:s}=t;return X0(Kf(n),s)}new Promise(()=>{});function Kf(t,n){n===void 0&&(n=[]);let s=[];return Z.Children.forEach(t,(a,l)=>{if(!Z.isValidElement(a))return;let c=[...n,l];if(a.type===Z.Fragment){s.push.apply(s,Kf(a.props.children,c));return}a.type!==ua&&Rt(!1),!a.props.index||!a.props.children||Rt(!1);let h={id:a.props.id||c.join("-"),caseSensitive:a.props.caseSensitive,element:a.props.element,Component:a.props.Component,index:a.props.index,path:a.props.path,loader:a.props.loader,action:a.props.action,errorElement:a.props.errorElement,ErrorBoundary:a.props.ErrorBoundary,hasErrorBoundary:a.props.ErrorBoundary!=null||a.props.errorElement!=null,shouldRevalidate:a.props.shouldRevalidate,handle:a.props.handle,lazy:a.props.lazy};a.props.children&&(h.children=Kf(a.props.children,c)),s.push(h)}),s}/**
* React Router DOM v6.30.4
*
* 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
*/function kc(){return kc=Object.assign?Object.assign.bind():function(t){for(var n=1;n<arguments.length;n++){var s=arguments[n];for(var a in s)({}).hasOwnProperty.call(s,a)&&(t[a]=s[a])}return t},kc.apply(null,arguments)}function vg(t,n){if(t==null)return{};var s={};for(var a in t)if({}.hasOwnProperty.call(t,a)){if(n.indexOf(a)!==-1)continue;s[a]=t[a]}return s}function yx(t){return!!(t.metaKey||t.altKey||t.ctrlKey||t.shiftKey)}function gx(t,n){return t.button===0&&(!n||n==="_self")&&!yx(t)}function Xf(t){return t===void 0&&(t=""),new URLSearchParams(typeof t=="string"||Array.isArray(t)||t instanceof URLSearchParams?t:Object.keys(t).reduce((n,s)=>{let a=t[s];return n.concat(Array.isArray(a)?a.map(l=>[s,l]):[[s,a]])},[]))}function vx(t,n){let s=Xf(t);return n&&n.forEach((a,l)=>{s.has(l)||n.getAll(l).forEach(c=>{s.append(l,c)})}),s}const xx=["onClick","relative","reloadDocument","replace","state","target","to","preventScrollReset","viewTransition"],wx=["aria-current","caseSensitive","className","end","style","to","viewTransition","children"],Sx="6";try{window.__reactRouterVersion=Sx}catch{}const kx=Z.createContext({isTransitioning:!1}),_x="startTransition",Hp=y0[_x];function Nx(t){let{basename:n,children:s,future:a,window:l}=t,c=Z.useRef();c.current==null&&(c.current=k0({window:l,v5Compat:!0}));let h=c.current,[y,x]=Z.useState({action:h.action,location:h.location}),{v7_startTransition:w}=a||{},T=Z.useCallback(E=>{w&&Hp?Hp(()=>x(E)):x(E)},[x,w]);return Z.useLayoutEffect(()=>h.listen(T),[h,T]),Z.useEffect(()=>dx(a),[a]),Z.createElement(mx,{basename:n,children:s,location:y.location,navigationType:y.action,navigator:h,future:a})}const Ex=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",Tx=/^(?:[a-z][a-z0-9+.-]*:|\/\/)/i,Ac=Z.forwardRef(function(n,s){let{onClick:a,relative:l,reloadDocument:c,replace:h,state:y,target:x,to:w,preventScrollReset:T,viewTransition:E}=n,_=vg(n,xx),{basename:S}=Z.useContext(Ns),O,C=!1;if(typeof w=="string"&&Tx.test(w)&&(O=w,Ex))try{let F=new URL(window.location.href),U=w.startsWith("//")?new URL(F.protocol+w):new URL(w),$=Co(U.pathname,S);U.origin===F.origin&&$!=null?w=$+U.search+U.hash:C=!0}catch{}let b=Q0(w,{relative:l}),I=bx(w,{replace:h,state:y,target:x,preventScrollReset:T,relative:l,viewTransition:E});function j(F){a&&a(F),F.defaultPrevented||I(F)}return Z.createElement("a",kc({},_,{href:O||b,onClick:C||c?a:j,ref:s,target:x}))}),Cx=Z.forwardRef(function(n,s){let{"aria-current":a="page",caseSensitive:l=!1,className:c="",end:h=!1,style:y,to:x,viewTransition:w,children:T}=n,E=vg(n,wx),_=Fc(x,{relative:E.relative}),S=Na(),O=Z.useContext(fg),{navigator:C,basename:b}=Z.useContext(Ns),I=O!=null&&jx(_)&&w===!0,j=C.encodeLocation?C.encodeLocation(_).pathname:_.pathname,F=S.pathname,U=O&&O.navigation&&O.navigation.location?O.navigation.location.pathname:null;l||(F=F.toLowerCase(),U=U?U.toLowerCase():null,j=j.toLowerCase()),U&&b&&(U=Co(U,b)||U);const $=j!=="/"&&j.endsWith("/")?j.length-1:j.length;let J=F===j||!h&&F.startsWith(j)&&F.charAt($)==="/",ne=U!=null&&(U===j||!h&&U.startsWith(j)&&U.charAt(j.length)==="/"),he={isActive:J,isPending:ne,isTransitioning:I},ye=J?a:void 0,ke;typeof c=="function"?ke=c(he):ke=[c,J?"active":null,ne?"pending":null,I?"transitioning":null].filter(Boolean).join(" ");let pe=typeof y=="function"?y(he):y;return Z.createElement(Ac,kc({},E,{"aria-current":ye,className:ke,ref:s,style:pe,to:x,viewTransition:w}),typeof T=="function"?T(he):T)});var Jf;(function(t){t.UseScrollRestoration="useScrollRestoration",t.UseSubmit="useSubmit",t.UseSubmitFetcher="useSubmitFetcher",t.UseFetcher="useFetcher",t.useViewTransitionState="useViewTransitionState"})(Jf||(Jf={}));var Bp;(function(t){t.UseFetcher="useFetcher",t.UseFetchers="useFetchers",t.UseScrollRestoration="useScrollRestoration"})(Bp||(Bp={}));function Ox(t){let n=Z.useContext(Mc);return n||Rt(!1),n}function bx(t,n){let{target:s,replace:a,state:l,preventScrollReset:c,relative:h,viewTransition:y}=n===void 0?{}:n,x=Lc(),w=Na(),T=Fc(t,{relative:h});return Z.useCallback(E=>{if(gx(E,s)){E.preventDefault();let _=a!==void 0?a:Sc(w)===Sc(T);x(t,{replace:_,state:l,preventScrollReset:c,relative:h,viewTransition:y})}},[w,x,T,a,l,s,t,c,h,y])}function xg(t){let n=Z.useRef(Xf(t)),s=Z.useRef(!1),a=Na(),l=Z.useMemo(()=>vx(a.search,s.current?null:n.current),[a.search]),c=Lc(),h=Z.useCallback((y,x)=>{const w=Xf(typeof y=="function"?y(l):y);s.current=!0,c("?"+w,x)},[c,l]);return[l,h]}function jx(t,n){n===void 0&&(n={});let s=Z.useContext(kx);s==null&&Rt(!1);let{basename:a}=Ox(Jf.useViewTransitionState),l=Fc(t,{relative:n.relative});if(!s.isTransitioning)return!1;let c=Co(s.currentLocation.pathname,a)||s.currentLocation.pathname,h=Co(s.nextLocation.pathname,a)||s.nextLocation.pathname;return Gf(l.pathname,h)!=null||Gf(l.pathname,c)!=null}var Lo=class{constructor(){this.listeners=new Set,this.subscribe=this.subscribe.bind(this)}subscribe(t){return this.listeners.add(t),this.onSubscribe(),()=>{this.listeners.delete(t),this.onUnsubscribe()}}hasListeners(){return this.listeners.size>0}onSubscribe(){}onUnsubscribe(){}},fa,hi,mo,Gy,Dx=(Gy=class extends Lo{constructor(){super();Ie(this,fa);Ie(this,hi);Ie(this,mo);xe(this,mo,n=>{if(typeof window<"u"&&window.addEventListener){const s=()=>n();return window.addEventListener("visibilitychange",s,!1),()=>{window.removeEventListener("visibilitychange",s)}}})}onSubscribe(){L(this,hi)||this.setEventListener(L(this,mo))}onUnsubscribe(){var n;this.hasListeners()||((n=L(this,hi))==null||n.call(this),xe(this,hi,void 0))}setEventListener(n){var s;xe(this,mo,n),(s=L(this,hi))==null||s.call(this),xe(this,hi,n(a=>{typeof a=="boolean"?this.setFocused(a):this.onFocus()}))}setFocused(n){L(this,fa)!==n&&(xe(this,fa,n),this.onFocus())}onFocus(){const n=this.isFocused();this.listeners.forEach(s=>{s(n)})}isFocused(){var n;return typeof L(this,fa)=="boolean"?L(this,fa):((n=globalThis.document)==null?void 0:n.visibilityState)!=="hidden"}},fa=new WeakMap,hi=new WeakMap,mo=new WeakMap,Gy),Dh=new Dx,Rx={setTimeout:(t,n)=>setTimeout(t,n),clearTimeout:t=>clearTimeout(t),setInterval:(t,n)=>setInterval(t,n),clearInterval:t=>clearInterval(t)},mi,Th,Ky,Mx=(Ky=class{constructor(){Ie(this,mi,Rx);Ie(this,Th,!1)}setTimeoutProvider(t){xe(this,mi,t)}setTimeout(t,n){return L(this,mi).setTimeout(t,n)}clearTimeout(t){L(this,mi).clearTimeout(t)}setInterval(t,n){return L(this,mi).setInterval(t,n)}clearInterval(t){L(this,mi).clearInterval(t)}},mi=new WeakMap,Th=new WeakMap,Ky),da=new Mx;function Ix(t){setTimeout(t,0)}var Lx=typeof window>"u"||"Deno"in globalThis;function xn(){}function Fx(t,n){return typeof t=="function"?t(n):t}function eh(t){return typeof t=="number"&&t>=0&&t!==1/0}function wg(t,n){return Math.max(t+(n||0)-Date.now(),0)}function Ti(t,n){return typeof t=="function"?t(n):t}function Un(t,n){return typeof t=="function"?t(n):t}function Zp(t,n){const{type:s="all",exact:a,fetchStatus:l,predicate:c,queryKey:h,stale:y}=t;if(h){if(a){if(n.queryHash!==Rh(h,n.options))return!1}else if(!Vl(n.queryKey,h))return!1}if(s!=="all"){const x=n.isActive();if(s==="active"&&!x||s==="inactive"&&x)return!1}return!(typeof y=="boolean"&&n.isStale()!==y||l&&l!==n.state.fetchStatus||c&&!c(n))}function qp(t,n){const{exact:s,status:a,predicate:l,mutationKey:c}=t;if(c){if(!n.options.mutationKey)return!1;if(s){if(Sa(n.options.mutationKey)!==Sa(c))return!1}else if(!Vl(n.options.mutationKey,c))return!1}return!(a&&n.state.status!==a||l&&!l(n))}function Rh(t,n){return((n==null?void 0:n.queryKeyHashFn)||Sa)(t)}function Sa(t){return JSON.stringify(t,(n,s)=>th(s)?Object.keys(s).sort().reduce((a,l)=>(a[l]=s[l],a),{}):s)}function Vl(t,n){return t===n?!0:typeof t!=typeof n?!1:t&&n&&typeof t=="object"&&typeof n=="object"?Object.keys(n).every(s=>Vl(t[s],n[s])):!1}var Ax=Object.prototype.hasOwnProperty;function Sg(t,n,s=0){if(t===n)return t;if(s>500)return n;const a=Qp(t)&&Qp(n);if(!a&&!(th(t)&&th(n)))return n;const c=(a?t:Object.keys(t)).length,h=a?n:Object.keys(n),y=h.length,x=a?new Array(y):{};let w=0;for(let T=0;T<y;T++){const E=a?T:h[T],_=t[E],S=n[E];if(_===S){x[E]=_,(a?T<c:Ax.call(t,E))&&w++;continue}if(_===null||S===null||typeof _!="object"||typeof S!="object"){x[E]=S;continue}const O=Sg(_,S,s+1);x[E]=O,O===_&&w++}return c===y&&w===c?t:x}function _c(t,n){if(!n||Object.keys(t).length!==Object.keys(n).length)return!1;for(const s in t)if(t[s]!==n[s])return!1;return!0}function Qp(t){return Array.isArray(t)&&t.length===Object.keys(t).length}function th(t){if(!Yp(t))return!1;const n=t.constructor;if(n===void 0)return!0;const s=n.prototype;return!(!Yp(s)||!s.hasOwnProperty("isPrototypeOf")||Object.getPrototypeOf(t)!==Object.prototype)}function Yp(t){return Object.prototype.toString.call(t)==="[object Object]"}function Px(t){return new Promise(n=>{da.setTimeout(n,t)})}function nh(t,n,s){return typeof s.structuralSharing=="function"?s.structuralSharing(t,n):s.structuralSharing!==!1?Sg(t,n):n}function Ux(t,n,s=0){const a=[...t,n];return s&&a.length>s?a.slice(1):a}function Vx(t,n,s=0){const a=[n,...t];return s&&a.length>s?a.slice(0,-1):a}var Mh=Symbol();function kg(t,n){return!t.queryFn&&(n!=null&&n.initialPromise)?()=>n.initialPromise:!t.queryFn||t.queryFn===Mh?()=>Promise.reject(new Error(`Missing queryFn: '${t.queryHash}'`)):t.queryFn}function Ih(t,n){return typeof t=="function"?t(...n):!!t}function zx(t,n,s){let a=!1,l;return Object.defineProperty(t,"signal",{enumerable:!0,get:()=>(l??(l=n()),a||(a=!0,l.aborted?s():l.addEventListener("abort",s,{once:!0})),l)}),t}var zl=(()=>{let t=()=>Lx;return{isServer(){return t()},setIsServer(n){t=n}}})();function rh(){let t,n;const s=new Promise((l,c)=>{t=l,n=c});s.status="pending",s.catch(()=>{});function a(l){Object.assign(s,l),delete s.resolve,delete s.reject}return s.resolve=l=>{a({status:"fulfilled",value:l}),t(l)},s.reject=l=>{a({status:"rejected",reason:l}),n(l)},s}var $x=Ix;function Wx(){let t=[],n=0,s=y=>{y()},a=y=>{y()},l=$x;const c=y=>{n?t.push(y):l(()=>{s(y)})},h=()=>{const y=t;t=[],y.length&&l(()=>{a(()=>{y.forEach(x=>{s(x)})})})};return{batch:y=>{let x;n++;try{x=y()}finally{n--,n||h()}return x},batchCalls:y=>(...x)=>{c(()=>{y(...x)})},schedule:c,setNotifyFunction:y=>{s=y},setBatchNotifyFunction:y=>{a=y},setScheduler:y=>{l=y}}}var Zt=Wx(),po,pi,yo,Xy,Hx=(Xy=class extends Lo{constructor(){super();Ie(this,po,!0);Ie(this,pi);Ie(this,yo);xe(this,yo,n=>{if(typeof window<"u"&&window.addEventListener){const s=()=>n(!0),a=()=>n(!1);return window.addEventListener("online",s,!1),window.addEventListener("offline",a,!1),()=>{window.removeEventListener("online",s),window.removeEventListener("offline",a)}}})}onSubscribe(){L(this,pi)||this.setEventListener(L(this,yo))}onUnsubscribe(){var n;this.hasListeners()||((n=L(this,pi))==null||n.call(this),xe(this,pi,void 0))}setEventListener(n){var s;xe(this,yo,n),(s=L(this,pi))==null||s.call(this),xe(this,pi,n(this.setOnline.bind(this)))}setOnline(n){L(this,po)!==n&&(xe(this,po,n),this.listeners.forEach(a=>{a(n)}))}isOnline(){return L(this,po)}},po=new WeakMap,pi=new WeakMap,yo=new WeakMap,Xy),Nc=new Hx;function Bx(t){return Math.min(1e3*2**t,3e4)}function _g(t){return(t??"online")==="online"?Nc.isOnline():!0}var sh=class extends Error{constructor(t){super("CancelledError"),this.revert=t==null?void 0:t.revert,this.silent=t==null?void 0:t.silent}};function Ng(t){let n=!1,s=0,a;const l=rh(),c=()=>l.status!=="pending",h=C=>{var b;if(!c()){const I=new sh(C);_(I),(b=t.onCancel)==null||b.call(t,I)}},y=()=>{n=!0},x=()=>{n=!1},w=()=>Dh.isFocused()&&(t.networkMode==="always"||Nc.isOnline())&&t.canRun(),T=()=>_g(t.networkMode)&&t.canRun(),E=C=>{c()||(a==null||a(),l.resolve(C))},_=C=>{c()||(a==null||a(),l.reject(C))},S=()=>new Promise(C=>{var b;a=I=>{(c()||w())&&C(I)},(b=t.onPause)==null||b.call(t)}).then(()=>{var C;a=void 0,c()||(C=t.onContinue)==null||C.call(t)}),O=()=>{if(c())return;let C;const b=s===0?t.initialPromise:void 0;try{C=b??t.fn()}catch(I){C=Promise.reject(I)}Promise.resolve(C).then(E).catch(I=>{var J;if(c())return;const j=t.retry??(zl.isServer()?0:3),F=t.retryDelay??Bx,U=typeof F=="function"?F(s,I):F,$=j===!0||typeof j=="number"&&s<j||typeof j=="function"&&j(s,I);if(n||!$){_(I);return}s++,(J=t.onFail)==null||J.call(t,s,I),Px(U).then(()=>w()?void 0:S()).then(()=>{n?_(I):O()})})};return{promise:l,status:()=>l.status,cancel:h,continue:()=>(a==null||a(),l),cancelRetry:y,continueRetry:x,canStart:T,start:()=>(T()?O():S().then(O),l)}}var ha,Jy,Eg=(Jy=class{constructor(){Ie(this,ha)}destroy(){this.clearGcTimeout()}scheduleGc(){this.clearGcTimeout(),eh(this.gcTime)&&xe(this,ha,da.setTimeout(()=>{this.optionalRemove()},this.gcTime))}updateGcTime(t){this.gcTime=Math.max(this.gcTime||0,t??(zl.isServer()?1/0:300*1e3))}clearGcTimeout(){L(this,ha)!==void 0&&(da.clearTimeout(L(this,ha)),xe(this,ha,void 0))}},ha=new WeakMap,Jy);function Zx(t){return{onFetch:(n,s)=>{var T,E,_,S,O;const a=n.options,l=(_=(E=(T=n.fetchOptions)==null?void 0:T.meta)==null?void 0:E.fetchMore)==null?void 0:_.direction,c=((S=n.state.data)==null?void 0:S.pages)||[],h=((O=n.state.data)==null?void 0:O.pageParams)||[];let y={pages:[],pageParams:[]},x=0;const w=async()=>{let C=!1;const b=F=>{zx(F,()=>n.signal,()=>C=!0)},I=kg(n.options,n.fetchOptions),j=async(F,U,$)=>{if(C)return Promise.reject(n.signal.reason);if(U==null&&F.pages.length)return Promise.resolve(F);const ne=(()=>{const pe={client:n.client,queryKey:n.queryKey,pageParam:U,direction:$?"backward":"forward",meta:n.options.meta};return b(pe),pe})(),he=await I(ne),{maxPages:ye}=n.options,ke=$?Vx:Ux;return{pages:ke(F.pages,he,ye),pageParams:ke(F.pageParams,U,ye)}};if(l&&c.length){const F=l==="backward",U=F?qx:Gp,$={pages:c,pageParams:h},J=U(a,$);y=await j($,J,F)}else{const F=t??c.length;do{const U=x===0?h[0]??a.initialPageParam:Gp(a,y);if(x>0&&U==null)break;y=await j(y,U),x++}while(x<F)}return y};n.options.persister?n.fetchFn=()=>{var C,b;return(b=(C=n.options).persister)==null?void 0:b.call(C,w,{client:n.client,queryKey:n.queryKey,meta:n.options.meta,signal:n.signal},s)}:n.fetchFn=w}}}function Gp(t,{pages:n,pageParams:s}){const a=n.length-1;return n.length>0?t.getNextPageParam(n[a],n,s[a],s):void 0}function qx(t,{pages:n,pageParams:s}){var a;return n.length>0?(a=t.getPreviousPageParam)==null?void 0:a.call(t,n[0],n,s[0],s):void 0}var go,ma,vo,tr,pa,Gt,Bl,ya,Pn,Tg,ps,eg,Qx=(eg=class extends Eg{constructor(n){super();Ie(this,Pn);Ie(this,go);Ie(this,ma);Ie(this,vo);Ie(this,tr);Ie(this,pa);Ie(this,Gt);Ie(this,Bl);Ie(this,ya);xe(this,ya,!1),xe(this,Bl,n.defaultOptions),this.setOptions(n.options),this.observers=[],xe(this,pa,n.client),xe(this,tr,L(this,pa).getQueryCache()),this.queryKey=n.queryKey,this.queryHash=n.queryHash,xe(this,ma,Xp(this.options)),this.state=n.state??L(this,ma),this.scheduleGc()}get meta(){return this.options.meta}get queryType(){return L(this,go)}get promise(){var n;return(n=L(this,Gt))==null?void 0:n.promise}setOptions(n){if(this.options={...L(this,Bl),...n},n!=null&&n._type&&xe(this,go,n._type),this.updateGcTime(this.options.gcTime),this.state&&this.state.data===void 0){const s=Xp(this.options);s.data!==void 0&&(this.setState(Kp(s.data,s.dataUpdatedAt)),xe(this,ma,s))}}optionalRemove(){!this.observers.length&&this.state.fetchStatus==="idle"&&L(this,tr).remove(this)}setData(n,s){const a=nh(this.state.data,n,this.options);return Ke(this,Pn,ps).call(this,{data:a,type:"success",dataUpdatedAt:s==null?void 0:s.updatedAt,manual:s==null?void 0:s.manual}),a}setState(n){Ke(this,Pn,ps).call(this,{type:"setState",state:n})}cancel(n){var a,l;const s=(a=L(this,Gt))==null?void 0:a.promise;return(l=L(this,Gt))==null||l.cancel(n),s?s.then(xn).catch(xn):Promise.resolve()}destroy(){super.destroy(),this.cancel({silent:!0})}get resetState(){return L(this,ma)}reset(){this.destroy(),this.setState(this.resetState)}isActive(){return this.observers.some(n=>Un(n.options.enabled,this)!==!1)}isDisabled(){return this.getObserversCount()>0?!this.isActive():this.options.queryFn===Mh||!this.isFetched()}isFetched(){return this.state.dataUpdateCount+this.state.errorUpdateCount>0}isStatic(){return this.getObserversCount()>0?this.observers.some(n=>Ti(n.options.staleTime,this)==="static"):!1}isStale(){return this.getObserversCount()>0?this.observers.some(n=>n.getCurrentResult().isStale):this.state.data===void 0||this.state.isInvalidated}isStaleByTime(n=0){return this.state.data===void 0?!0:n==="static"?!1:this.state.isInvalidated?!0:!wg(this.state.dataUpdatedAt,n)}onFocus(){var s;const n=this.observers.find(a=>a.shouldFetchOnWindowFocus());n==null||n.refetch({cancelRefetch:!1}),(s=L(this,Gt))==null||s.continue()}onOnline(){var s;const n=this.observers.find(a=>a.shouldFetchOnReconnect());n==null||n.refetch({cancelRefetch:!1}),(s=L(this,Gt))==null||s.continue()}addObserver(n){this.observers.includes(n)||(this.observers.push(n),this.clearGcTimeout(),L(this,tr).notify({type:"observerAdded",query:this,observer:n}))}removeObserver(n){this.observers.includes(n)&&(this.observers=this.observers.filter(s=>s!==n),this.observers.length||(L(this,Gt)&&(L(this,ya)||Ke(this,Pn,Tg).call(this)?L(this,Gt).cancel({revert:!0}):L(this,Gt).cancelRetry()),this.scheduleGc()),L(this,tr).notify({type:"observerRemoved",query:this,observer:n}))}getObserversCount(){return this.observers.length}invalidate(){this.state.isInvalidated||Ke(this,Pn,ps).call(this,{type:"invalidate"})}async fetch(n,s){var w,T,E,_,S,O,C,b,I,j,F;if(this.state.fetchStatus!=="idle"&&((w=L(this,Gt))==null?void 0:w.status())!=="rejected"){if(this.state.data!==void 0&&(s!=null&&s.cancelRefetch))this.cancel({silent:!0});else if(L(this,Gt))return L(this,Gt).continueRetry(),L(this,Gt).promise}if(n&&this.setOptions(n),!this.options.queryFn){const U=this.observers.find($=>$.options.queryFn);U&&this.setOptions(U.options)}const a=new AbortController,l=U=>{Object.defineProperty(U,"signal",{enumerable:!0,get:()=>(xe(this,ya,!0),a.signal)})},c=()=>{const U=kg(this.options,s),J=(()=>{const ne={client:L(this,pa),queryKey:this.queryKey,meta:this.meta};return l(ne),ne})();return xe(this,ya,!1),this.options.persister?this.options.persister(U,J,this):U(J)},y=(()=>{const U={fetchOptions:s,options:this.options,queryKey:this.queryKey,client:L(this,pa),state:this.state,fetchFn:c};return l(U),U})(),x=L(this,go)==="infinite"?Zx(this.options.pages):this.options.behavior;x==null||x.onFetch(y,this),xe(this,vo,this.state),(this.state.fetchStatus==="idle"||this.state.fetchMeta!==((T=y.fetchOptions)==null?void 0:T.meta))&&Ke(this,Pn,ps).call(this,{type:"fetch",meta:(E=y.fetchOptions)==null?void 0:E.meta}),xe(this,Gt,Ng({initialPromise:s==null?void 0:s.initialPromise,fn:y.fetchFn,onCancel:U=>{U instanceof sh&&U.revert&&this.setState({...L(this,vo),fetchStatus:"idle"}),a.abort()},onFail:(U,$)=>{Ke(this,Pn,ps).call(this,{type:"failed",failureCount:U,error:$})},onPause:()=>{Ke(this,Pn,ps).call(this,{type:"pause"})},onContinue:()=>{Ke(this,Pn,ps).call(this,{type:"continue"})},retry:y.options.retry,retryDelay:y.options.retryDelay,networkMode:y.options.networkMode,canRun:()=>!0}));try{const U=await L(this,Gt).start();if(U===void 0)throw new Error(`${this.queryHash} data is undefined`);return this.setData(U),(S=(_=L(this,tr).config).onSuccess)==null||S.call(_,U,this),(C=(O=L(this,tr).config).onSettled)==null||C.call(O,U,this.state.error,this),U}catch(U){if(U instanceof sh){if(U.silent)return L(this,Gt).promise;if(U.revert){if(this.state.data===void 0)throw U;return this.state.data}}throw Ke(this,Pn,ps).call(this,{type:"error",error:U}),(I=(b=L(this,tr).config).onError)==null||I.call(b,U,this),(F=(j=L(this,tr).config).onSettled)==null||F.call(j,this.state.data,U,this),U}finally{this.scheduleGc()}}},go=new WeakMap,ma=new WeakMap,vo=new WeakMap,tr=new WeakMap,pa=new WeakMap,Gt=new WeakMap,Bl=new WeakMap,ya=new WeakMap,Pn=new WeakSet,Tg=function(){return this.state.fetchStatus==="paused"&&this.state.status==="pending"},ps=function(n){const s=a=>{switch(n.type){case"failed":return{...a,fetchFailureCount:n.failureCount,fetchFailureReason:n.error};case"pause":return{...a,fetchStatus:"paused"};case"continue":return{...a,fetchStatus:"fetching"};case"fetch":return{...a,...Cg(a.data,this.options),fetchMeta:n.meta??null};case"success":const l={...a,...Kp(n.data,n.dataUpdatedAt),dataUpdateCount:a.dataUpdateCount+1,...!n.manual&&{fetchStatus:"idle",fetchFailureCount:0,fetchFailureReason:null}};return xe(this,vo,n.manual?l:void 0),l;case"error":const c=n.error;return{...a,error:c,errorUpdateCount:a.errorUpdateCount+1,errorUpdatedAt:Date.now(),fetchFailureCount:a.fetchFailureCount+1,fetchFailureReason:c,fetchStatus:"idle",status:"error",isInvalidated:!0};case"invalidate":return{...a,isInvalidated:!0};case"setState":return{...a,...n.state}}};this.state=s(this.state),Zt.batch(()=>{this.observers.forEach(a=>{a.onQueryUpdate()}),L(this,tr).notify({query:this,type:"updated",action:n})})},eg);function Cg(t,n){return{fetchFailureCount:0,fetchFailureReason:null,fetchStatus:_g(n.networkMode)?"fetching":"paused",...t===void 0&&{error:null,status:"pending"}}}function Kp(t,n){return{data:t,dataUpdatedAt:n??Date.now(),error:null,isInvalidated:!1,status:"success"}}function Xp(t){const n=typeof t.initialData=="function"?t.initialData():t.initialData,s=n!==void 0,a=s?typeof t.initialDataUpdatedAt=="function"?t.initialDataUpdatedAt():t.initialDataUpdatedAt:0;return{data:n,dataUpdateCount:0,dataUpdatedAt:s?a??Date.now():0,error:null,errorUpdateCount:0,errorUpdatedAt:0,fetchFailureCount:0,fetchFailureReason:null,fetchMeta:null,isInvalidated:!1,status:s?"success":"pending",fetchStatus:"idle"}}var Cn,st,Zl,vn,ga,xo,gs,yi,ql,wo,So,va,xa,gi,ko,pt,Ll,ih,ah,oh,lh,uh,ch,dh,Og,tg,Yx=(tg=class extends Lo{constructor(n,s){super();Ie(this,pt);Ie(this,Cn);Ie(this,st);Ie(this,Zl);Ie(this,vn);Ie(this,ga);Ie(this,xo);Ie(this,gs);Ie(this,yi);Ie(this,ql);Ie(this,wo);Ie(this,So);Ie(this,va);Ie(this,xa);Ie(this,gi);Ie(this,ko,new Set);this.options=s,xe(this,Cn,n),xe(this,yi,null),xe(this,gs,rh()),this.bindMethods(),this.setOptions(s)}bindMethods(){this.refetch=this.refetch.bind(this)}onSubscribe(){this.listeners.size===1&&(L(this,st).addObserver(this),Jp(L(this,st),this.options)?Ke(this,pt,Ll).call(this):this.updateResult(),Ke(this,pt,lh).call(this))}onUnsubscribe(){this.hasListeners()||this.destroy()}shouldFetchOnReconnect(){return fh(L(this,st),this.options,this.options.refetchOnReconnect)}shouldFetchOnWindowFocus(){return fh(L(this,st),this.options,this.options.refetchOnWindowFocus)}destroy(){this.listeners=new Set,Ke(this,pt,uh).call(this),Ke(this,pt,ch).call(this),L(this,st).removeObserver(this)}setOptions(n){const s=this.options,a=L(this,st);if(this.options=L(this,Cn).defaultQueryOptions(n),this.options.enabled!==void 0&&typeof this.options.enabled!="boolean"&&typeof this.options.enabled!="function"&&typeof Un(this.options.enabled,L(this,st))!="boolean")throw new Error("Expected enabled to be a boolean or a callback that returns a boolean");Ke(this,pt,dh).call(this),L(this,st).setOptions(this.options),s._defaulted&&!_c(this.options,s)&&L(this,Cn).getQueryCache().notify({type:"observerOptionsUpdated",query:L(this,st),observer:this});const l=this.hasListeners();l&&ey(L(this,st),a,this.options,s)&&Ke(this,pt,Ll).call(this),this.updateResult(),l&&(L(this,st)!==a||Un(this.options.enabled,L(this,st))!==Un(s.enabled,L(this,st))||Ti(this.options.staleTime,L(this,st))!==Ti(s.staleTime,L(this,st)))&&Ke(this,pt,ih).call(this);const c=Ke(this,pt,ah).call(this);l&&(L(this,st)!==a||Un(this.options.enabled,L(this,st))!==Un(s.enabled,L(this,st))||c!==L(this,gi))&&Ke(this,pt,oh).call(this,c)}getOptimisticResult(n){const s=L(this,Cn).getQueryCache().build(L(this,Cn),n),a=this.createResult(s,n);return Kx(this,a)&&(xe(this,vn,a),xe(this,xo,this.options),xe(this,ga,L(this,st).state)),a}getCurrentResult(){return L(this,vn)}trackResult(n,s){return new Proxy(n,{get:(a,l)=>(this.trackProp(l),s==null||s(l),l==="promise"&&(this.trackProp("data"),!this.options.experimental_prefetchInRender&&L(this,gs).status==="pending"&&L(this,gs).reject(new Error("experimental_prefetchInRender feature flag is not enabled"))),Reflect.get(a,l))})}trackProp(n){L(this,ko).add(n)}getCurrentQuery(){return L(this,st)}refetch({...n}={}){return this.fetch({...n})}fetchOptimistic(n){const s=L(this,Cn).defaultQueryOptions(n),a=L(this,Cn).getQueryCache().build(L(this,Cn),s);return a.fetch().then(()=>this.createResult(a,s))}fetch(n){return Ke(this,pt,Ll).call(this,{...n,cancelRefetch:n.cancelRefetch??!0}).then(()=>(this.updateResult(),L(this,vn)))}createResult(n,s){var ye;const a=L(this,st),l=this.options,c=L(this,vn),h=L(this,ga),y=L(this,xo),w=n!==a?n.state:L(this,Zl),{state:T}=n;let E={...T},_=!1,S;if(s._optimisticResults){const ke=this.hasListeners(),pe=!ke&&Jp(n,s),ge=ke&&ey(n,a,s,l);(pe||ge)&&(E={...E,...Cg(T.data,n.options)}),s._optimisticResults==="isRestoring"&&(E.fetchStatus="idle")}let{error:O,errorUpdatedAt:C,status:b}=E;S=E.data;let I=!1;if(s.placeholderData!==void 0&&S===void 0&&b==="pending"){let ke;c!=null&&c.isPlaceholderData&&s.placeholderData===(y==null?void 0:y.placeholderData)?(ke=c.data,I=!0):ke=typeof s.placeholderData=="function"?s.placeholderData((ye=L(this,So))==null?void 0:ye.state.data,L(this,So)):s.placeholderData,ke!==void 0&&(b="success",S=nh(c==null?void 0:c.data,ke,s),_=!0)}if(s.select&&S!==void 0&&!I)if(c&&S===(h==null?void 0:h.data)&&s.select===L(this,ql))S=L(this,wo);else try{xe(this,ql,s.select),S=s.select(S),S=nh(c==null?void 0:c.data,S,s),xe(this,wo,S),xe(this,yi,null)}catch(ke){xe(this,yi,ke)}L(this,yi)&&(O=L(this,yi),S=L(this,wo),C=Date.now(),b="error");const j=E.fetchStatus==="fetching",F=b==="pending",U=b==="error",$=F&&j,J=S!==void 0,he={status:b,fetchStatus:E.fetchStatus,isPending:F,isSuccess:b==="success",isError:U,isInitialLoading:$,isLoading:$,data:S,dataUpdatedAt:E.dataUpdatedAt,error:O,errorUpdatedAt:C,failureCount:E.fetchFailureCount,failureReason:E.fetchFailureReason,errorUpdateCount:E.errorUpdateCount,isFetched:n.isFetched(),isFetchedAfterMount:E.dataUpdateCount>w.dataUpdateCount||E.errorUpdateCount>w.errorUpdateCount,isFetching:j,isRefetching:j&&!F,isLoadingError:U&&!J,isPaused:E.fetchStatus==="paused",isPlaceholderData:_,isRefetchError:U&&J,isStale:Lh(n,s),refetch:this.refetch,promise:L(this,gs),isEnabled:Un(s.enabled,n)!==!1};if(this.options.experimental_prefetchInRender){const ke=he.data!==void 0,pe=he.status==="error"&&!ke,ge=Ce=>{pe?Ce.reject(he.error):ke&&Ce.resolve(he.data)},fe=()=>{const Ce=xe(this,gs,he.promise=rh());ge(Ce)},Ee=L(this,gs);switch(Ee.status){case"pending":n.queryHash===a.queryHash&&ge(Ee);break;case"fulfilled":(pe||he.data!==Ee.value)&&fe();break;case"rejected":(!pe||he.error!==Ee.reason)&&fe();break}}return he}updateResult(){const n=L(this,vn),s=this.createResult(L(this,st),this.options);if(xe(this,ga,L(this,st).state),xe(this,xo,this.options),L(this,ga).data!==void 0&&xe(this,So,L(this,st)),_c(s,n))return;xe(this,vn,s);const a=()=>{if(!n)return!0;const{notifyOnChangeProps:l}=this.options,c=typeof l=="function"?l():l;if(c==="all"||!c&&!L(this,ko).size)return!0;const h=new Set(c??L(this,ko));return this.options.throwOnError&&h.add("error"),Object.keys(L(this,vn)).some(y=>{const x=y;return L(this,vn)[x]!==n[x]&&h.has(x)})};Ke(this,pt,Og).call(this,{listeners:a()})}onQueryUpdate(){this.updateResult(),this.hasListeners()&&Ke(this,pt,lh).call(this)}},Cn=new WeakMap,st=new WeakMap,Zl=new WeakMap,vn=new WeakMap,ga=new WeakMap,xo=new WeakMap,gs=new WeakMap,yi=new WeakMap,ql=new WeakMap,wo=new WeakMap,So=new WeakMap,va=new WeakMap,xa=new WeakMap,gi=new WeakMap,ko=new WeakMap,pt=new WeakSet,Ll=function(n){Ke(this,pt,dh).call(this);let s=L(this,st).fetch(this.options,n);return n!=null&&n.throwOnError||(s=s.catch(xn)),s},ih=function(){Ke(this,pt,uh).call(this);const n=Ti(this.options.staleTime,L(this,st));if(zl.isServer()||L(this,vn).isStale||!eh(n))return;const a=wg(L(this,vn).dataUpdatedAt,n)+1;xe(this,va,da.setTimeout(()=>{L(this,vn).isStale||this.updateResult()},a))},ah=function(){return(typeof this.options.refetchInterval=="function"?this.options.refetchInterval(L(this,st)):this.options.refetchInterval)??!1},oh=function(n){Ke(this,pt,ch).call(this),xe(this,gi,n),!(zl.isServer()||Un(this.options.enabled,L(this,st))===!1||!eh(L(this,gi))||L(this,gi)===0)&&xe(this,xa,da.setInterval(()=>{(this.options.refetchIntervalInBackground||Dh.isFocused())&&Ke(this,pt,Ll).call(this)},L(this,gi)))},lh=function(){Ke(this,pt,ih).call(this),Ke(this,pt,oh).call(this,Ke(this,pt,ah).call(this))},uh=function(){L(this,va)!==void 0&&(da.clearTimeout(L(this,va)),xe(this,va,void 0))},ch=function(){L(this,xa)!==void 0&&(da.clearInterval(L(this,xa)),xe(this,xa,void 0))},dh=function(){const n=L(this,Cn).getQueryCache().build(L(this,Cn),this.options);if(n===L(this,st))return;const s=L(this,st);xe(this,st,n),xe(this,Zl,n.state),this.hasListeners()&&(s==null||s.removeObserver(this),n.addObserver(this))},Og=function(n){Zt.batch(()=>{n.listeners&&this.listeners.forEach(s=>{s(L(this,vn))}),L(this,Cn).getQueryCache().notify({query:L(this,st),type:"observerResultsUpdated"})})},tg);function Gx(t,n){return Un(n.enabled,t)!==!1&&t.state.data===void 0&&!(t.state.status==="error"&&Un(n.retryOnMount,t)===!1)}function Jp(t,n){return Gx(t,n)||t.state.data!==void 0&&fh(t,n,n.refetchOnMount)}function fh(t,n,s){if(Un(n.enabled,t)!==!1&&Ti(n.staleTime,t)!=="static"){const a=typeof s=="function"?s(t):s;return a==="always"||a!==!1&&Lh(t,n)}return!1}function ey(t,n,s,a){return(t!==n||Un(a.enabled,t)===!1)&&(!s.suspense||t.state.status!=="error")&&Lh(t,s)}function Lh(t,n){return Un(n.enabled,t)!==!1&&t.isStaleByTime(Ti(n.staleTime,t))}function Kx(t,n){return!_c(t.getCurrentResult(),n)}var Ql,zr,dn,wa,$r,di,ng,Xx=(ng=class extends Eg{constructor(n){super();Ie(this,$r);Ie(this,Ql);Ie(this,zr);Ie(this,dn);Ie(this,wa);xe(this,Ql,n.client),this.mutationId=n.mutationId,xe(this,dn,n.mutationCache),xe(this,zr,[]),this.state=n.state||bg(),this.setOptions(n.options),this.scheduleGc()}setOptions(n){this.options=n,this.updateGcTime(this.options.gcTime)}get meta(){return this.options.meta}addObserver(n){L(this,zr).includes(n)||(L(this,zr).push(n),this.clearGcTimeout(),L(this,dn).notify({type:"observerAdded",mutation:this,observer:n}))}removeObserver(n){xe(this,zr,L(this,zr).filter(s=>s!==n)),this.scheduleGc(),L(this,dn).notify({type:"observerRemoved",mutation:this,observer:n})}optionalRemove(){L(this,zr).length||(this.state.status==="pending"?this.scheduleGc():L(this,dn).remove(this))}continue(){var n;return((n=L(this,wa))==null?void 0:n.continue())??this.execute(this.state.variables)}async execute(n){var h,y,x,w,T,E,_,S,O,C,b,I,j,F,U,$,J,ne;const s=()=>{Ke(this,$r,di).call(this,{type:"continue"})},a={client:L(this,Ql),meta:this.options.meta,mutationKey:this.options.mutationKey};xe(this,wa,Ng({fn:()=>this.options.mutationFn?this.options.mutationFn(n,a):Promise.reject(new Error("No mutationFn found")),onFail:(he,ye)=>{Ke(this,$r,di).call(this,{type:"failed",failureCount:he,error:ye})},onPause:()=>{Ke(this,$r,di).call(this,{type:"pause"})},onContinue:s,retry:this.options.retry??0,retryDelay:this.options.retryDelay,networkMode:this.options.networkMode,canRun:()=>L(this,dn).canRun(this)}));const l=this.state.status==="pending",c=!L(this,wa).canStart();try{if(l)s();else{Ke(this,$r,di).call(this,{type:"pending",variables:n,isPaused:c}),L(this,dn).config.onMutate&&await L(this,dn).config.onMutate(n,this,a);const ye=await((y=(h=this.options).onMutate)==null?void 0:y.call(h,n,a));ye!==this.state.context&&Ke(this,$r,di).call(this,{type:"pending",context:ye,variables:n,isPaused:c})}const he=await L(this,wa).start();return await((w=(x=L(this,dn).config).onSuccess)==null?void 0:w.call(x,he,n,this.state.context,this,a)),await((E=(T=this.options).onSuccess)==null?void 0:E.call(T,he,n,this.state.context,a)),await((S=(_=L(this,dn).config).onSettled)==null?void 0:S.call(_,he,null,this.state.variables,this.state.context,this,a)),await((C=(O=this.options).onSettled)==null?void 0:C.call(O,he,null,n,this.state.context,a)),Ke(this,$r,di).call(this,{type:"success",data:he}),he}catch(he){try{await((I=(b=L(this,dn).config).onError)==null?void 0:I.call(b,he,n,this.state.context,this,a))}catch(ye){Promise.reject(ye)}try{await((F=(j=this.options).onError)==null?void 0:F.call(j,he,n,this.state.context,a))}catch(ye){Promise.reject(ye)}try{await(($=(U=L(this,dn).config).onSettled)==null?void 0:$.call(U,void 0,he,this.state.variables,this.state.context,this,a))}catch(ye){Promise.reject(ye)}try{await((ne=(J=this.options).onSettled)==null?void 0:ne.call(J,void 0,he,n,this.state.context,a))}catch(ye){Promise.reject(ye)}throw Ke(this,$r,di).call(this,{type:"error",error:he}),he}finally{L(this,dn).runNext(this)}}},Ql=new WeakMap,zr=new WeakMap,dn=new WeakMap,wa=new WeakMap,$r=new WeakSet,di=function(n){const s=a=>{switch(n.type){case"failed":return{...a,failureCount:n.failureCount,failureReason:n.error};case"pause":return{...a,isPaused:!0};case"continue":return{...a,isPaused:!1};case"pending":return{...a,context:n.context,data:void 0,failureCount:0,failureReason:null,error:null,isPaused:n.isPaused,status:"pending",variables:n.variables,submittedAt:Date.now()};case"success":return{...a,data:n.data,failureCount:0,failureReason:null,error:null,status:"success",isPaused:!1};case"error":return{...a,data:void 0,error:n.error,failureCount:a.failureCount+1,failureReason:n.error,isPaused:!1,status:"error"}}};this.state=s(this.state),Zt.batch(()=>{L(this,zr).forEach(a=>{a.onMutationUpdate(n)}),L(this,dn).notify({mutation:this,type:"updated",action:n})})},ng);function bg(){return{context:void 0,data:void 0,error:null,failureCount:0,failureReason:null,isPaused:!1,status:"idle",variables:void 0,submittedAt:0}}var vs,kr,Yl,rg,Jx=(rg=class extends Lo{constructor(n={}){super();Ie(this,vs);Ie(this,kr);Ie(this,Yl);this.config=n,xe(this,vs,new Set),xe(this,kr,new Map),xe(this,Yl,0)}build(n,s,a){const l=new Xx({client:n,mutationCache:this,mutationId:++fc(this,Yl)._,options:n.defaultMutationOptions(s),state:a});return this.add(l),l}add(n){L(this,vs).add(n);const s=mc(n);if(typeof s=="string"){const a=L(this,kr).get(s);a?a.push(n):L(this,kr).set(s,[n])}this.notify({type:"added",mutation:n})}remove(n){if(L(this,vs).delete(n)){const s=mc(n);if(typeof s=="string"){const a=L(this,kr).get(s);if(a)if(a.length>1){const l=a.indexOf(n);l!==-1&&a.splice(l,1)}else a[0]===n&&L(this,kr).delete(s)}}this.notify({type:"removed",mutation:n})}canRun(n){const s=mc(n);if(typeof s=="string"){const a=L(this,kr).get(s),l=a==null?void 0:a.find(c=>c.state.status==="pending");return!l||l===n}else return!0}runNext(n){var a;const s=mc(n);if(typeof s=="string"){const l=(a=L(this,kr).get(s))==null?void 0:a.find(c=>c!==n&&c.state.isPaused);return(l==null?void 0:l.continue())??Promise.resolve()}else return Promise.resolve()}clear(){Zt.batch(()=>{L(this,vs).forEach(n=>{this.notify({type:"removed",mutation:n})}),L(this,vs).clear(),L(this,kr).clear()})}getAll(){return Array.from(L(this,vs))}find(n){const s={exact:!0,...n};return this.getAll().find(a=>qp(s,a))}findAll(n={}){return this.getAll().filter(s=>qp(n,s))}notify(n){Zt.batch(()=>{this.listeners.forEach(s=>{s(n)})})}resumePausedMutations(){const n=this.getAll().filter(s=>s.state.isPaused);return Zt.batch(()=>Promise.all(n.map(s=>s.continue().catch(xn))))}},vs=new WeakMap,kr=new WeakMap,Yl=new WeakMap,rg);function mc(t){var n;return(n=t.options.scope)==null?void 0:n.id}var xs,vi,On,ws,Ss,vc,hh,sg,ew=(sg=class extends Lo{constructor(s,a){super();Ie(this,Ss);Ie(this,xs);Ie(this,vi);Ie(this,On);Ie(this,ws);xe(this,xs,s),this.setOptions(a),this.bindMethods(),Ke(this,Ss,vc).call(this)}bindMethods(){this.mutate=this.mutate.bind(this),this.reset=this.reset.bind(this)}setOptions(s){var l;const a=this.options;this.options=L(this,xs).defaultMutationOptions(s),_c(this.options,a)||L(this,xs).getMutationCache().notify({type:"observerOptionsUpdated",mutation:L(this,On),observer:this}),a!=null&&a.mutationKey&&this.options.mutationKey&&Sa(a.mutationKey)!==Sa(this.options.mutationKey)?this.reset():((l=L(this,On))==null?void 0:l.state.status)==="pending"&&L(this,On).setOptions(this.options)}onUnsubscribe(){var s;this.hasListeners()||(s=L(this,On))==null||s.removeObserver(this)}onMutationUpdate(s){Ke(this,Ss,vc).call(this),Ke(this,Ss,hh).call(this,s)}getCurrentResult(){return L(this,vi)}reset(){var s;(s=L(this,On))==null||s.removeObserver(this),xe(this,On,void 0),Ke(this,Ss,vc).call(this),Ke(this,Ss,hh).call(this)}mutate(s,a){var l;return xe(this,ws,a),(l=L(this,On))==null||l.removeObserver(this),xe(this,On,L(this,xs).getMutationCache().build(L(this,xs),this.options)),L(this,On).addObserver(this),L(this,On).execute(s)}},xs=new WeakMap,vi=new WeakMap,On=new WeakMap,ws=new WeakMap,Ss=new WeakSet,vc=function(){var a;const s=((a=L(this,On))==null?void 0:a.state)??bg();xe(this,vi,{...s,isPending:s.status==="pending",isSuccess:s.status==="success",isError:s.status==="error",isIdle:s.status==="idle",mutate:this.mutate,reset:this.reset})},hh=function(s){Zt.batch(()=>{var a,l,c,h,y,x,w,T;if(L(this,ws)&&this.hasListeners()){const E=L(this,vi).variables,_=L(this,vi).context,S={client:L(this,xs),meta:this.options.meta,mutationKey:this.options.mutationKey};if((s==null?void 0:s.type)==="success"){try{(l=(a=L(this,ws)).onSuccess)==null||l.call(a,s.data,E,_,S)}catch(O){Promise.reject(O)}try{(h=(c=L(this,ws)).onSettled)==null||h.call(c,s.data,null,E,_,S)}catch(O){Promise.reject(O)}}else if((s==null?void 0:s.type)==="error"){try{(x=(y=L(this,ws)).onError)==null||x.call(y,s.error,E,_,S)}catch(O){Promise.reject(O)}try{(T=(w=L(this,ws)).onSettled)==null||T.call(w,void 0,s.error,E,_,S)}catch(O){Promise.reject(O)}}}this.listeners.forEach(E=>{E(L(this,vi))})})},sg),Wr,ig,tw=(ig=class extends Lo{constructor(n={}){super();Ie(this,Wr);this.config=n,xe(this,Wr,new Map)}build(n,s,a){const l=s.queryKey,c=s.queryHash??Rh(l,s);let h=this.get(c);return h||(h=new Qx({client:n,queryKey:l,queryHash:c,options:n.defaultQueryOptions(s),state:a,defaultOptions:n.getQueryDefaults(l)}),this.add(h)),h}add(n){L(this,Wr).has(n.queryHash)||(L(this,Wr).set(n.queryHash,n),this.notify({type:"added",query:n}))}remove(n){const s=L(this,Wr).get(n.queryHash);s&&(n.destroy(),s===n&&L(this,Wr).delete(n.queryHash),this.notify({type:"removed",query:n}))}clear(){Zt.batch(()=>{this.getAll().forEach(n=>{this.remove(n)})})}get(n){return L(this,Wr).get(n)}getAll(){return[...L(this,Wr).values()]}find(n){const s={exact:!0,...n};return this.getAll().find(a=>Zp(s,a))}findAll(n={}){const s=this.getAll();return Object.keys(n).length>0?s.filter(a=>Zp(n,a)):s}notify(n){Zt.batch(()=>{this.listeners.forEach(s=>{s(n)})})}onFocus(){Zt.batch(()=>{this.getAll().forEach(n=>{n.onFocus()})})}onOnline(){Zt.batch(()=>{this.getAll().forEach(n=>{n.onOnline()})})}},Wr=new WeakMap,ig),Ft,xi,wi,_o,No,Si,Eo,To,ag,nw=(ag=class{constructor(t={}){Ie(this,Ft);Ie(this,xi);Ie(this,wi);Ie(this,_o);Ie(this,No);Ie(this,Si);Ie(this,Eo);Ie(this,To);xe(this,Ft,t.queryCache||new tw),xe(this,xi,t.mutationCache||new Jx),xe(this,wi,t.defaultOptions||{}),xe(this,_o,new Map),xe(this,No,new Map),xe(this,Si,0)}mount(){fc(this,Si)._++,L(this,Si)===1&&(xe(this,Eo,Dh.subscribe(async t=>{t&&(await this.resumePausedMutations(),L(this,Ft).onFocus())})),xe(this,To,Nc.subscribe(async t=>{t&&(await this.resumePausedMutations(),L(this,Ft).onOnline())})))}unmount(){var t,n;fc(this,Si)._--,L(this,Si)===0&&((t=L(this,Eo))==null||t.call(this),xe(this,Eo,void 0),(n=L(this,To))==null||n.call(this),xe(this,To,void 0))}isFetching(t){return L(this,Ft).findAll({...t,fetchStatus:"fetching"}).length}isMutating(t){return L(this,xi).findAll({...t,status:"pending"}).length}getQueryData(t){var s;const n=this.defaultQueryOptions({queryKey:t});return(s=L(this,Ft).get(n.queryHash))==null?void 0:s.state.data}ensureQueryData(t){const n=this.defaultQueryOptions(t),s=L(this,Ft).build(this,n),a=s.state.data;return a===void 0?this.fetchQuery(t):(t.revalidateIfStale&&s.isStaleByTime(Ti(n.staleTime,s))&&this.prefetchQuery(n),Promise.resolve(a))}getQueriesData(t){return L(this,Ft).findAll(t).map(({queryKey:n,state:s})=>{const a=s.data;return[n,a]})}setQueryData(t,n,s){const a=this.defaultQueryOptions({queryKey:t}),l=L(this,Ft).get(a.queryHash),c=l==null?void 0:l.state.data,h=Fx(n,c);if(h!==void 0)return L(this,Ft).build(this,a).setData(h,{...s,manual:!0})}setQueriesData(t,n,s){return Zt.batch(()=>L(this,Ft).findAll(t).map(({queryKey:a})=>[a,this.setQueryData(a,n,s)]))}getQueryState(t){var s;const n=this.defaultQueryOptions({queryKey:t});return(s=L(this,Ft).get(n.queryHash))==null?void 0:s.state}removeQueries(t){const n=L(this,Ft);Zt.batch(()=>{n.findAll(t).forEach(s=>{n.remove(s)})})}resetQueries(t,n){const s=L(this,Ft);return Zt.batch(()=>(s.findAll(t).forEach(a=>{a.reset()}),this.refetchQueries({type:"active",...t},n)))}cancelQueries(t,n={}){const s={revert:!0,...n},a=Zt.batch(()=>L(this,Ft).findAll(t).map(l=>l.cancel(s)));return Promise.all(a).then(xn).catch(xn)}invalidateQueries(t,n={}){return Zt.batch(()=>(L(this,Ft).findAll(t).forEach(s=>{s.invalidate()}),(t==null?void 0:t.refetchType)==="none"?Promise.resolve():this.refetchQueries({...t,type:(t==null?void 0:t.refetchType)??(t==null?void 0:t.type)??"active"},n)))}refetchQueries(t,n={}){const s={...n,cancelRefetch:n.cancelRefetch??!0},a=Zt.batch(()=>L(this,Ft).findAll(t).filter(l=>!l.isDisabled()&&!l.isStatic()).map(l=>{let c=l.fetch(void 0,s);return s.throwOnError||(c=c.catch(xn)),l.state.fetchStatus==="paused"?Promise.resolve():c}));return Promise.all(a).then(xn)}fetchQuery(t){const n=this.defaultQueryOptions(t);n.retry===void 0&&(n.retry=!1);const s=L(this,Ft).build(this,n);return s.isStaleByTime(Ti(n.staleTime,s))?s.fetch(n):Promise.resolve(s.state.data)}prefetchQuery(t){return this.fetchQuery(t).then(xn).catch(xn)}fetchInfiniteQuery(t){return t._type="infinite",this.fetchQuery(t)}prefetchInfiniteQuery(t){return this.fetchInfiniteQuery(t).then(xn).catch(xn)}ensureInfiniteQueryData(t){return t._type="infinite",this.ensureQueryData(t)}resumePausedMutations(){return Nc.isOnline()?L(this,xi).resumePausedMutations():Promise.resolve()}getQueryCache(){return L(this,Ft)}getMutationCache(){return L(this,xi)}getDefaultOptions(){return L(this,wi)}setDefaultOptions(t){xe(this,wi,t)}setQueryDefaults(t,n){L(this,_o).set(Sa(t),{queryKey:t,defaultOptions:n})}getQueryDefaults(t){const n=[...L(this,_o).values()],s={};return n.forEach(a=>{Vl(t,a.queryKey)&&Object.assign(s,a.defaultOptions)}),s}setMutationDefaults(t,n){L(this,No).set(Sa(t),{mutationKey:t,defaultOptions:n})}getMutationDefaults(t){const n=[...L(this,No).values()],s={};return n.forEach(a=>{Vl(t,a.mutationKey)&&Object.assign(s,a.defaultOptions)}),s}defaultQueryOptions(t){if(t._defaulted)return t;const n={...L(this,wi).queries,...this.getQueryDefaults(t.queryKey),...t,_defaulted:!0};return n.queryHash||(n.queryHash=Rh(n.queryKey,n)),n.refetchOnReconnect===void 0&&(n.refetchOnReconnect=n.networkMode!=="always"),n.throwOnError===void 0&&(n.throwOnError=!!n.suspense),!n.networkMode&&n.persister&&(n.networkMode="offlineFirst"),n.queryFn===Mh&&(n.enabled=!1),n}defaultMutationOptions(t){return t!=null&&t._defaulted?t:{...L(this,wi).mutations,...(t==null?void 0:t.mutationKey)&&this.getMutationDefaults(t.mutationKey),...t,_defaulted:!0}}clear(){L(this,Ft).clear(),L(this,xi).clear()}},Ft=new WeakMap,xi=new WeakMap,wi=new WeakMap,_o=new WeakMap,No=new WeakMap,Si=new WeakMap,Eo=new WeakMap,To=new WeakMap,ag),jg=Z.createContext(void 0),zn=t=>{const n=Z.useContext(jg);if(!n)throw new Error("No QueryClient set, use QueryClientProvider to set one");return n},rw=({client:t,children:n})=>(Z.useEffect(()=>(t.mount(),()=>{t.unmount()}),[t]),d.jsx(jg.Provider,{value:t,children:n})),Dg=Z.createContext(!1),sw=()=>Z.useContext(Dg);Dg.Provider;function iw(){let t=!1;return{clearReset:()=>{t=!1},reset:()=>{t=!0},isReset:()=>t}}var aw=Z.createContext(iw()),ow=()=>Z.useContext(aw),lw=(t,n,s)=>{const a=s!=null&&s.state.error&&typeof t.throwOnError=="function"?Ih(t.throwOnError,[s.state.error,s]):t.throwOnError;(t.suspense||t.experimental_prefetchInRender||a)&&(n.isReset()||(t.retryOnMount=!1))},uw=t=>{Z.useEffect(()=>{t.clearReset()},[t])},cw=({result:t,errorResetBoundary:n,throwOnError:s,query:a,suspense:l})=>t.isError&&!n.isReset()&&!t.isFetching&&a&&(l&&t.data===void 0||Ih(s,[t.error,a])),dw=t=>{if(t.suspense){const s=l=>l==="static"?l:Math.max(l??1e3,1e3),a=t.staleTime;t.staleTime=typeof a=="function"?(...l)=>s(a(...l)):s(a),typeof t.gcTime=="number"&&(t.gcTime=Math.max(t.gcTime,1e3))}},fw=(t,n)=>t.isLoading&&t.isFetching&&!n,hw=(t,n)=>(t==null?void 0:t.suspense)&&n.isPending,ty=(t,n,s)=>n.fetchOptimistic(t).catch(()=>{s.clearReset()});function mw(t,n,s){var S,O,C,b;const a=sw(),l=ow(),c=zn(),h=c.defaultQueryOptions(t);(O=(S=c.getDefaultOptions().queries)==null?void 0:S._experimental_beforeQuery)==null||O.call(S,h);const y=c.getQueryCache().get(h.queryHash),x=t.subscribed!==!1;h._optimisticResults=a?"isRestoring":x?"optimistic":void 0,dw(h),lw(h,l,y),uw(l);const w=!c.getQueryCache().get(h.queryHash),[T]=Z.useState(()=>new n(c,h)),E=T.getOptimisticResult(h),_=!a&&x;if(Z.useSyncExternalStore(Z.useCallback(I=>{const j=_?T.subscribe(Zt.batchCalls(I)):xn;return T.updateResult(),j},[T,_]),()=>T.getCurrentResult(),()=>T.getCurrentResult()),Z.useEffect(()=>{T.setOptions(h)},[h,T]),hw(h,E))throw ty(h,T,l);if(cw({result:E,errorResetBoundary:l,throwOnError:h.throwOnError,query:y,suspense:h.suspense}))throw E.error;if((b=(C=c.getDefaultOptions().queries)==null?void 0:C._experimental_afterQuery)==null||b.call(C,h,E),h.experimental_prefetchInRender&&!zl.isServer()&&fw(E,a)){const I=w?ty(h,T,l):y==null?void 0:y.promise;I==null||I.catch(xn).finally(()=>{T.updateResult()})}return h.notifyOnChangeProps?E:T.trackResult(E)}function bn(t,n){return mw(t,Yx)}function Br(t,n){const s=zn(),[a]=Z.useState(()=>new ew(s,t));Z.useEffect(()=>{a.setOptions(t)},[a,t]);const l=Z.useSyncExternalStore(Z.useCallback(h=>a.subscribe(Zt.batchCalls(h)),[a]),()=>a.getCurrentResult(),()=>a.getCurrentResult()),c=Z.useCallback((h,y)=>{a.mutate(h,y).catch(xn)},[a]);if(l.error&&Ih(a.options.throwOnError,[l.error]))throw l.error;return{...l,mutate:c,mutateAsync:l.mutate}}const pw=/\{[^{}]+\}/g,yw=()=>{var t,n;return typeof process=="object"&&Number.parseInt((n=(t=process==null?void 0:process.versions)==null?void 0:t.node)==null?void 0:n.substring(0,2))>=18&&process.versions.undici};function gw(){return Math.random().toString(36).slice(2,11)}function vw(t){let{baseUrl:n="",Request:s=globalThis.Request,fetch:a=globalThis.fetch,querySerializer:l,bodySerializer:c,headers:h,requestInitExt:y=void 0,...x}={...t};y=yw()?y:void 0,n=sy(n);const w=[];async function T(E,_){const{baseUrl:S,fetch:O=a,Request:C=s,headers:b,params:I={},parseAs:j="json",querySerializer:F,bodySerializer:U=c??ww,body:$,...J}=_||{};let ne=n;S&&(ne=sy(S)??n);let he=typeof l=="function"?l:ny(l);F&&(he=typeof F=="function"?F:ny({...typeof l=="object"?l:{},...F}));const ye=$===void 0?void 0:U($,ry(h,b,I.header)),ke=ry(ye===void 0||ye instanceof FormData?{}:{"Content-Type":"application/json"},h,b,I.header),pe={redirect:"follow",...x,...J,body:ye,headers:ke};let ge,fe,Ee=new s(Sw(E,{baseUrl:ne,params:I,querySerializer:he}),pe),Ce;for(const Me in J)Me in Ee||(Ee[Me]=J[Me]);if(w.length){ge=gw(),fe=Object.freeze({baseUrl:ne,fetch:O,parseAs:j,querySerializer:he,bodySerializer:U});for(const Me of w)if(Me&&typeof Me=="object"&&typeof Me.onRequest=="function"){const ee=await Me.onRequest({request:Ee,schemaPath:E,params:I,options:fe,id:ge});if(ee)if(ee instanceof s)Ee=ee;else if(ee instanceof Response){Ce=ee;break}else throw new Error("onRequest: must return new Request() or Response() when modifying the request")}}if(!Ce){try{Ce=await O(Ee,y)}catch(Me){let ee=Me;if(w.length)for(let ve=w.length-1;ve>=0;ve--){const me=w[ve];if(me&&typeof me=="object"&&typeof me.onError=="function"){const W=await me.onError({request:Ee,error:ee,schemaPath:E,params:I,options:fe,id:ge});if(W){if(W instanceof Response){ee=void 0,Ce=W;break}if(W instanceof Error){ee=W;continue}throw new Error("onError: must return new Response() or instance of Error")}}}if(ee)throw ee}if(w.length)for(let Me=w.length-1;Me>=0;Me--){const ee=w[Me];if(ee&&typeof ee=="object"&&typeof ee.onResponse=="function"){const ve=await ee.onResponse({request:Ee,response:Ce,schemaPath:E,params:I,options:fe,id:ge});if(ve){if(!(ve instanceof Response))throw new Error("onResponse: must return new Response() when modifying the response");Ce=ve}}}}if(Ce.status===204||Ee.method==="HEAD"||Ce.headers.get("Content-Length")==="0")return Ce.ok?{data:void 0,response:Ce}:{error:void 0,response:Ce};if(Ce.ok)return j==="stream"?{data:Ce.body,response:Ce}:{data:await Ce[j](),response:Ce};let Ze=await Ce.text();try{Ze=JSON.parse(Ze)}catch{}return{error:Ze,response:Ce}}return{request(E,_,S){return T(_,{...S,method:E.toUpperCase()})},GET(E,_){return T(E,{..._,method:"GET"})},PUT(E,_){return T(E,{..._,method:"PUT"})},POST(E,_){return T(E,{..._,method:"POST"})},DELETE(E,_){return T(E,{..._,method:"DELETE"})},OPTIONS(E,_){return T(E,{..._,method:"OPTIONS"})},HEAD(E,_){return T(E,{..._,method:"HEAD"})},PATCH(E,_){return T(E,{..._,method:"PATCH"})},TRACE(E,_){return T(E,{..._,method:"TRACE"})},use(...E){for(const _ of E)if(_){if(typeof _!="object"||!("onRequest"in _||"onResponse"in _||"onError"in _))throw new Error("Middleware must be an object with one of `onRequest()`, `onResponse() or `onError()`");w.push(_)}},eject(...E){for(const _ of E){const S=w.indexOf(_);S!==-1&&w.splice(S,1)}}}}function Pc(t,n,s){if(n==null)return"";if(typeof n=="object")throw new Error("Deeply-nested arrays/objects aren’t supported. Provide your own `querySerializer()` to handle these.");return`${t}=${(s==null?void 0:s.allowReserved)===!0?n:encodeURIComponent(n)}`}function Rg(t,n,s){if(!n||typeof n!="object")return"";const a=[],l={simple:",",label:".",matrix:";"}[s.style]||"&";if(s.style!=="deepObject"&&s.explode===!1){for(const y in n)a.push(y,s.allowReserved===!0?n[y]:encodeURIComponent(n[y]));const h=a.join(",");switch(s.style){case"form":return`${t}=${h}`;case"label":return`.${h}`;case"matrix":return`;${t}=${h}`;default:return h}}for(const h in n){const y=s.style==="deepObject"?`${t}[${h}]`:h;a.push(Pc(y,n[h],s))}const c=a.join(l);return s.style==="label"||s.style==="matrix"?`${l}${c}`:c}function Mg(t,n,s){if(!Array.isArray(n))return"";if(s.explode===!1){const c={form:",",spaceDelimited:"%20",pipeDelimited:"|"}[s.style]||",",h=(s.allowReserved===!0?n:n.map(y=>encodeURIComponent(y))).join(c);switch(s.style){case"simple":return h;case"label":return`.${h}`;case"matrix":return`;${t}=${h}`;default:return`${t}=${h}`}}const a={simple:",",label:".",matrix:";"}[s.style]||"&",l=[];for(const c of n)s.style==="simple"||s.style==="label"?l.push(s.allowReserved===!0?c:encodeURIComponent(c)):l.push(Pc(t,c,s));return s.style==="label"||s.style==="matrix"?`${a}${l.join(a)}`:l.join(a)}function ny(t){return function(s){const a=[];if(s&&typeof s=="object")for(const l in s){const c=s[l];if(c!=null){if(Array.isArray(c)){if(c.length===0)continue;a.push(Mg(l,c,{style:"form",explode:!0,...t==null?void 0:t.array,allowReserved:(t==null?void 0:t.allowReserved)||!1}));continue}if(typeof c=="object"){a.push(Rg(l,c,{style:"deepObject",explode:!0,...t==null?void 0:t.object,allowReserved:(t==null?void 0:t.allowReserved)||!1}));continue}a.push(Pc(l,c,t))}}return a.join("&")}}function xw(t,n){let s=t;for(const a of t.match(pw)??[]){let l=a.substring(1,a.length-1),c=!1,h="simple";if(l.endsWith("*")&&(c=!0,l=l.substring(0,l.length-1)),l.startsWith(".")?(h="label",l=l.substring(1)):l.startsWith(";")&&(h="matrix",l=l.substring(1)),!n||n[l]===void 0||n[l]===null)continue;const y=n[l];if(Array.isArray(y)){s=s.replace(a,Mg(l,y,{style:h,explode:c}));continue}if(typeof y=="object"){s=s.replace(a,Rg(l,y,{style:h,explode:c}));continue}if(h==="matrix"){s=s.replace(a,`;${Pc(l,y)}`);continue}s=s.replace(a,h==="label"?`.${encodeURIComponent(y)}`:encodeURIComponent(y))}return s}function ww(t,n){return t instanceof FormData?t:n&&(n.get instanceof Function?n.get("Content-Type")??n.get("content-type"):n["Content-Type"]??n["content-type"])==="application/x-www-form-urlencoded"?new URLSearchParams(t).toString():JSON.stringify(t)}function Sw(t,n){var l;let s=`${n.baseUrl}${t}`;(l=n.params)!=null&&l.path&&(s=xw(s,n.params.path));let a=n.querySerializer(n.params.query??{});return a.startsWith("?")&&(a=a.substring(1)),a&&(s+=`?${a}`),s}function ry(...t){const n=new Headers;for(const s of t){if(!s||typeof s!="object")continue;const a=s instanceof Headers?s.entries():Object.entries(s);for(const[l,c]of a)if(c===null)n.delete(l);else if(Array.isArray(c))for(const h of c)n.append(l,h);else c!==void 0&&n.set(l,c)}return n}function sy(t){return t.endsWith("/")?t.substring(0,t.length-1):t}class mh extends Error{constructor(n,s){super(n),this.status=s,this.name="ApiError"}}const Tt=vw({baseUrl:"/api/v1"});function Vt({data:t,error:n,response:s}){if(n!==void 0||!s.ok)throw new mh((n==null?void 0:n.error)??`HTTP ${s.status}`,s.status);if(t===void 0)throw new mh("empty response body",s.status);return t}function Ig({error:t,response:n}){if(t!==void 0||!n.ok)throw new mh((t==null?void 0:t.error)??`HTTP ${n.status}`,n.status)}function kw(t=1e4){return bn({queryKey:["health"],queryFn:async()=>Vt(await Tt.GET("/health")),refetchInterval:t,retry:!1})}function _w(){return Br({mutationFn:async()=>Vt(await Tt.POST("/shutdown"))})}function Lg(){return bn({queryKey:["machine"],queryFn:async()=>Vt(await Tt.GET("/machine"))})}function Fg(){return bn({queryKey:["machines"],queryFn:async()=>Vt(await Tt.GET("/machines"))})}function Nw(){const t=zn();return Br({mutationFn:async n=>Vt(await Tt.PUT("/machine",{body:{name:n}})),onSuccess:()=>{t.invalidateQueries({queryKey:["machine"]}),t.invalidateQueries({queryKey:["machines"]})}})}function Ew(){return bn({queryKey:["agents"],queryFn:async()=>Vt(await Tt.GET("/agents"))})}function Tw(){return bn({queryKey:["config","user-prompt"],queryFn:async()=>{const{data:t,error:n,response:s}=await Tt.GET("/config/user-prompt",{parseAs:"text"});return Vt({data:t,error:n,response:s})}})}function Cw(){const t=zn();return Br({mutationFn:async n=>Ig(await Tt.PUT("/config/user-prompt",{body:{content:n}})),onSuccess:()=>{t.invalidateQueries({queryKey:["config","user-prompt"]})}})}function Fh(t={},n){return bn({queryKey:["routines",t],queryFn:async()=>Vt(await Tt.GET("/routines",{params:{query:t}})),...n})}function Ow(t,n=!0){return bn({queryKey:["routines",t],queryFn:async()=>Vt(await Tt.GET("/routines/{id}",{params:{path:{id:t}}})),enabled:n&&t.length>0})}function Gl(t,n){t.invalidateQueries({queryKey:["routines"]}),n&&t.invalidateQueries({queryKey:["routines",n]})}function bw(){const t=zn();return Br({mutationFn:async n=>Vt(await Tt.POST("/routines",{body:n})),onSuccess:()=>Gl(t)})}function jw(){const t=zn();return Br({mutationFn:async({id:n,body:s})=>Vt(await Tt.PATCH("/routines/{id}",{params:{path:{id:n}},body:s})),onSuccess:(n,{id:s})=>Gl(t,s)})}function Dw(){const t=zn();return Br({mutationFn:async n=>Vt(await Tt.DELETE("/routines/{id}",{params:{path:{id:n}}})),onSuccess:(n,s)=>Gl(t,s)})}function Ag(){const t=zn();return Br({mutationFn:async n=>Vt(await Tt.POST("/routines/{id}/trigger",{params:{path:{id:n}}})),onSuccess:(n,s)=>Gl(t,s)})}function Rw(){const t=zn();return Br({mutationFn:async()=>Vt(await Tt.POST("/routines/cleanup")),onSuccess:()=>Gl(t)})}function Pg(){return bn({queryKey:["routines","lock"],queryFn:async()=>Vt(await Tt.GET("/routines/lock"))})}function Ug(){const t=zn();return Br({mutationFn:async n=>Vt(await Tt.DELETE("/routines/lock",{params:{query:{scope:n}}})),onSuccess:()=>void t.invalidateQueries({queryKey:["routines","lock"]})})}function Vg(t){return bn({queryKey:["routines","runs",t],queryFn:async()=>Vt(await Tt.GET("/routines/runs",{params:{query:{limit:t}}}))})}function Mw(t,n=!0){return bn({queryKey:["routines",t,"runs"],queryFn:async()=>Vt(await Tt.GET("/routines/{id}/runs",{params:{path:{id:t}}})),enabled:n&&t.length>0})}async function zg(t){const{data:n,error:s,response:a}=await t;return Vt({data:n,error:s,response:a})}function Iw(t,n=!0){return bn({queryKey:["routines",t,"logs"],queryFn:()=>zg(Tt.GET("/routines/{id}/logs",{params:{path:{id:t}},parseAs:"text"})),enabled:n&&t.length>0})}function Lw(t,n,s=!0){return bn({queryKey:["routines",t,"runs",n,"log"],queryFn:()=>zg(Tt.GET("/routines/{id}/runs/{workbench}/log",{params:{path:{id:t,workbench:n}},parseAs:"text"})),enabled:s&&t.length>0&&n.length>0})}function Fw(t,n=!0){return bn({queryKey:["routines",t,"flags"],queryFn:async()=>Vt(await Tt.GET("/routines/{id}/flags",{params:{path:{id:t}}})),enabled:n&&t.length>0})}function Aw(){const t=zn();return Br({mutationFn:async({id:n,filename:s})=>Ig(await Tt.DELETE("/routines/{id}/flags/{filename}",{params:{path:{id:n,filename:s}}})),onSuccess:(n,{id:s})=>void t.invalidateQueries({queryKey:["routines",s,"flags"]})})}function Pw(t){return t?`/api/v1/routines.ics?routine=${encodeURIComponent(t)}`:"/api/v1/routines.ics"}const $g="moadim.client.theme";function Uw(){try{return localStorage.getItem($g)==="light"}catch{return!1}}function Vw(t){try{localStorage.setItem($g,t?"light":"dark")}catch{}}function zw(t){document.documentElement.classList.toggle("theme-light",t)}function $w(t){return t<60?`${t}s`:t<3600?`${Math.floor(t/60)}m`:`${Math.floor(t/3600)}h ${Math.floor(t%3600/60)}m`}function Ww(t){const{health:n}=t,s=(n==null?void 0:n.status.toUpperCase())??"UNKNOWN",a=n!=null&&n.version?`/ v${n.version}`:"",l=n!=null&&n.git_sha&&n.git_sha!=="unknown"?`build: ${n.git_sha}`:void 0,c=(n==null?void 0:n.uptime_secs)!==void 0&&n.uptime_secs!==null?`/ UP ${$w(n.uptime_secs)}`:"",h=n!=null&&n.dependencies?!n.dependencies.tmux:!1,y=n!=null&&n.dependencies?!n.dependencies.python3:!1;return d.jsxs("header",{className:"app-header",children:[d.jsxs("span",{className:"brand",children:["MOADIM",d.jsx("span",{className:"brand-sub",children:"/ control"}),a&&d.jsx("span",{className:"brand-sub",title:l,children:a})]}),d.jsx("div",{className:"header-spacer"}),d.jsxs("div",{className:"header-right",children:[h&&d.jsx("span",{className:"dep-warn",title:"tmux is not on the daemon's PATH — all routine runs will silently fail",children:"⚠ NO TMUX"}),y&&d.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"}),d.jsxs("div",{className:"health",children:[d.jsx("div",{className:`health-dot ${t.healthOk?"ok":"error"}`}),d.jsx("span",{children:s}),d.jsx("span",{children:c})]}),t.machineName&&d.jsx("button",{className:"machine-badge",title:"Click to rename this machine",onClick:t.onRenameMachine,children:t.machineName}),d.jsx("button",{className:"icon-btn",title:t.light?"Switch to dark mode":"Switch to light mode",onClick:t.onTheme,children:t.light?"☀":"🌙"}),d.jsx("button",{className:"icon-btn",title:"Command palette (⌘K)",onClick:t.onPalette,children:"⌘K"}),d.jsx("button",{className:"icon-btn",title:"Refresh",onClick:t.onRefresh,children:"↻"}),d.jsx("button",{className:"icon-btn danger",title:"Stop the server",disabled:!t.healthOk,onClick:t.onStop,children:"⏻ Stop"})]})]})}const Hw=[{to:"/",label:"Overview",end:!0},{to:"/routines",label:"Routines",end:!1},{to:"/heatmap",label:"Heatmap",end:!1},{to:"/settings",label:"Settings",end:!1}];function Bw(){return d.jsx("nav",{className:"app-nav",children:Hw.map(t=>d.jsx(Cx,{to:t.to,end:t.end,className:({isActive:n})=>`nav-link${n?" active":""}`,children:t.label},t.to))})}function Zw(t){switch(t){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 qw(t){switch(t){case"nav-overview":case"nav-routines":case"nav-heatmap":case"nav-settings":return"GO";case"routine":return"ROUTINE";default:return"ACTION"}}function iy(t,n){const s=n.trim();if(s==="")return 0;const a=[...t.toLowerCase()],l=[...s.toLowerCase()];let c=0,h=0,y;for(const x of l){let w;for(;h<a.length;){const T=a[h];if(h+=1,T===x){w=h-1;break}}if(w===void 0)return;c+=1,w===0?c+=10:/[a-z0-9]/i.test(a[w-1]??"")||(c+=6),y!==void 0&&w===y+1&&(c+=8),y=w}return c-=Math.floor(a.length/16),c}function Qw(t,n){const s=iy(t.title,n),a=iy(t.keywords,n),l=a===void 0?void 0:a-4;return s!==void 0&&l!==void 0?Math.max(s,l):s??l}function Yw(t,n){const s=[];return t.forEach((a,l)=>{const c=Qw(a,n);c!==void 0&&s.push([l,c])}),s.sort(([a,l],[c,h])=>h-l||a-c),s.map(([a])=>a)}function Gw(t,n){return t||(n.trim()!==""?n:"—")}function Kw(t){const n=Gw(t.schedule_description,t.schedule),s=[];return t.enabled?(t.skip_runs??0)>0?s.push("SNOOZED"):t.agent_registered||s.push("AGENT MISSING"):s.push("DISABLED"),t.flag_count>0&&s.push("FLAGS"),s.length===0?n:`${n} — ${s.join(", ")}`}function Xw(t){const n=[{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 s of t)n.push({kind:"routine",title:s.title,subtitle:Kw(s),keywords:`${s.id} ${s.agent} ${s.schedule} ${(s.tags??[]).join(" ")} routine`,routineId:s.id});return n}function Jw(t,n){return n===0?0:Math.min(t,n-1)}function eS(t,n){return n===0?0:Math.min(t+1,n-1)}function tS(t){return Math.max(0,t-1)}function nS(t){return Math.max(0,t-1)}const rS={home:"/",routines:"/routines",heatmap:"/heatmap",settings:"/settings"};function sS({open:t,onClose:n,onRefresh:s,onStop:a,onToggleTheme:l}){const c=Lc(),[h,y]=Z.useState(""),[x,w]=Z.useState(0),T=Z.useRef(null),{data:E}=bn({queryKey:["command-palette","routines"],queryFn:async()=>Vt(await Tt.GET("/routines")),enabled:t});if(Z.useEffect(()=>{var j;t&&(y(""),w(0),(j=T.current)==null||j.focus())},[t]),!t)return null;const _=Xw(E??[]),S=Yw(_,h),O=Jw(x,S.length),C=j=>{const F=_[S[j]??-1];if(F)switch(F.kind){case"action-refresh":s();break;case"action-stop":a();break;case"action-toggle-theme":l();break;default:{const U=Zw(F.kind);U&&c(rS[U]??"/")}}n()},b=j=>{switch(j.key){case"ArrowDown":j.preventDefault(),w(eS(O,S.length));break;case"ArrowUp":j.preventDefault(),w(tS(O));break;case"Home":j.preventDefault(),w(0);break;case"End":j.preventDefault(),w(nS(S.length));break;case"Enter":j.preventDefault(),C(O);break;case"Escape":j.preventDefault(),n();break}},I=S.length>0?`cmdk-opt-${O}`:void 0;return d.jsx("div",{className:"overlay",onClick:n,children:d.jsxs("div",{className:"cmdk",role:"dialog","aria-modal":"true","aria-label":"Command palette",onClick:j=>j.stopPropagation(),children:[d.jsxs("div",{className:"cmdk-search",children:[d.jsx("span",{"aria-hidden":"true",children:"›"}),d.jsx("input",{ref:T,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":I,value:h,onChange:j=>{y(j.target.value),w(0)},onKeyDown:b}),d.jsx("span",{className:"cmdk-hint","aria-hidden":"true",children:"ESC"})]}),S.length===0?d.jsxs("div",{className:"cmdk-empty",children:[d.jsx("div",{children:"NO MATCHES"}),d.jsx("div",{children:"no page or routine matches"})]}):d.jsx("ul",{id:"cmdk-listbox",className:"cmdk-list",role:"listbox","aria-label":"Results",children:S.map((j,F)=>{const U=_[j];if(!U)return null;const $=F===O;return d.jsxs("li",{id:`cmdk-opt-${F}`,className:`cmdk-row${$?" active":""}`,role:"option","aria-selected":$,onClick:()=>C(F),onMouseEnter:()=>w(F),children:[d.jsx("span",{className:"kind-badge",children:qw(U.kind)}),d.jsxs("span",{className:"cmdk-row-text",children:[d.jsx("span",{className:"cmdk-row-title",children:U.title}),d.jsx("span",{className:"cmdk-row-sub",children:U.subtitle})]})]},j)})}),d.jsxs("div",{className:"cmdk-foot","aria-hidden":"true",children:[d.jsxs("span",{children:[d.jsx("span",{className:"cmdk-key",children:"↑↓"})," navigate"]}),d.jsxs("span",{children:[d.jsx("span",{className:"cmdk-key",children:"↵"})," open"]}),d.jsxs("span",{children:[d.jsx("span",{className:"cmdk-key",children:"esc"})," close"]})]})]})})}function iS({current:t,onCancel:n,onConfirm:s}){const[a,l]=Z.useState(t),[c,h]=Z.useState(!1),y=a.trim(),x=async()=>{if(y!==""){h(!0);try{await s(y)}finally{h(!1)}}};return d.jsx("div",{className:"overlay",onClick:n,children:d.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-labelledby":"rename-machine-title",onClick:w=>w.stopPropagation(),children:[d.jsx("div",{id:"rename-machine-title",className:"dialog-title",children:"Rename machine"}),d.jsxs("div",{className:"dialog-msg",children:[d.jsx("label",{className:"form-label",htmlFor:"rename-machine-input",children:"Machine name"}),d.jsx("input",{id:"rename-machine-input",className:"form-input",type:"text",value:a,onChange:w=>l(w.target.value),disabled:c,autoComplete:"off",spellCheck:!1})]}),d.jsxs("div",{className:"dialog-actions",children:[d.jsx("button",{className:"btn btn-ghost",onClick:n,disabled:c,children:"Cancel"}),d.jsx("button",{className:"btn btn-primary",onClick:()=>void x(),disabled:c||y==="",children:c?"Saving…":"Rename"})]})]})})}function aS({onCancel:t,onConfirm:n}){return d.jsx("div",{className:"overlay",onClick:t,children:d.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true","aria-labelledby":"shutdown-dialog-title",onClick:s=>s.stopPropagation(),children:[d.jsx("div",{id:"shutdown-dialog-title",className:"dialog-title",children:"⏻ Stop server"}),d.jsx("div",{className:"dialog-msg",children:"Stop the moadim server? Scheduled jobs and routines will not run until it is started again."}),d.jsxs("div",{className:"dialog-actions",children:[d.jsx("button",{className:"btn btn-ghost",onClick:t,children:"Cancel"}),d.jsx("button",{className:"btn btn-danger",onClick:n,children:"Stop server"})]})]})})}const Wg=Z.createContext(null);function oS({children:t}){const[n,s]=Z.useState([]),a=Z.useRef(0),l=Z.useCallback((c,h)=>{const y=a.current++;s(x=>[...x,{id:y,msg:c,kind:h}]),setTimeout(()=>s(x=>x.filter(w=>w.id!==y)),5e3)},[]);return d.jsx(Wg.Provider,{value:{toasts:n,addToast:l},children:t})}function Fo(){const t=Z.useContext(Wg);if(!t)throw new Error("useToasts must be used within a ToastProvider");return t}function lS(){const{toasts:t}=Fo();return d.jsx("div",{className:"toast-wrap",role:"status","aria-live":"polite","aria-atomic":"false",children:t.map(n=>d.jsx("div",{className:`toast ${n.kind}`,children:n.msg},n.id))})}function uS(){var I,j,F;const[t,n]=Z.useState(Uw),[s,a]=Z.useState(!1),[l,c]=Z.useState(!1),[h,y]=Z.useState(!1),x=zn(),{addToast:w}=Fo(),T=kw(3e4),E=Lg(),_=_w(),S=Nw();Z.useEffect(()=>{zw(t)},[t]),Z.useEffect(()=>{const U=$=>{($.metaKey||$.ctrlKey)&&$.key.toLowerCase()==="k"?($.preventDefault(),c(J=>!J)):$.key==="Escape"&&(a(!1),y(!1))};return window.addEventListener("keydown",U),()=>window.removeEventListener("keydown",U)},[]);const O=()=>{n(U=>{const $=!U;return Vw($),$})},C=()=>{a(!1),_.mutate(void 0,{onSuccess:()=>{w("Server stopping…","ok"),x.invalidateQueries({queryKey:["health"]})},onError:U=>w(`Stop failed: ${U.message}`,"err")})},b=async U=>{try{await S.mutateAsync(U),y(!1),w(`Machine renamed to "${U}"`,"ok")}catch($){throw w(`Rename failed: ${$ instanceof Error?$.message:String($)}`,"err"),$}};return d.jsxs("div",{className:"app-shell",children:[d.jsx(Ww,{health:T.data,healthOk:((I=T.data)==null?void 0:I.running)??!1,light:t,machineName:(j=E.data)==null?void 0:j.name,onRefresh:()=>void T.refetch(),onStop:()=>a(!0),onPalette:()=>c(U=>!U),onTheme:O,onRenameMachine:()=>y(!0)}),d.jsx(Bw,{}),d.jsx("div",{className:"page",children:d.jsx(hx,{})}),d.jsx(sS,{open:l,onClose:()=>c(!1),onRefresh:()=>void T.refetch(),onStop:()=>a(!0),onToggleTheme:O}),h&&d.jsx(iS,{current:((F=E.data)==null?void 0:F.name)??"",onCancel:()=>y(!1),onConfirm:b}),s&&d.jsx(aS,{onCancel:()=>a(!1),onConfirm:C}),d.jsx(lS,{})]})}function Hg({status:t,onUnlock:n}){return!t||!t.locked?null:d.jsxs("div",{className:"card",style:{display:"flex",alignItems:"center",justifyContent:"space-between",padding:"10px 14px",marginBottom:16,borderColor:"var(--warn)"},children:[d.jsxs("div",{style:{fontSize:13,fontWeight:600},children:["⚠ Routines globally locked — scheduling and manual triggers paused",t.shared&&d.jsx("span",{style:{marginLeft:8,fontSize:11,color:"var(--text-faint)"},children:"SHARED .lock"}),t.local&&d.jsx("span",{style:{marginLeft:8,fontSize:11,color:"var(--text-faint)"},children:"LOCAL .local.lock"})]}),d.jsx("button",{className:"btn btn-ghost",onClick:n,children:"Unlock all"})]})}const Bg=[{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}],Zg="moadim.refresh-interval";function cS(t){return t==="off"||t==="5"||t==="15"||t==="30"||t==="60"}function Uc(t){var n;return(n=Bg.find(s=>s.token===t))==null?void 0:n.ms}function Vc(){try{const t=localStorage.getItem(Zg);return cS(t)?t:"off"}catch{return"off"}}function zc(t){try{localStorage.setItem(Zg,t)}catch{}}function Ah(t){return t<60?"updated just now":t<3600?`updated ${Math.floor(t/60)}m ago`:`updated ${Math.floor(t/3600)}h ago`}function $c({token:t,updatedAtMs:n,onChange:s}){const[,a]=Z.useState(0);Z.useEffect(()=>{const c=setInterval(()=>a(h=>h+1),1e3);return()=>clearInterval(c)},[]);const l=n>0?Ah(Math.max(0,Math.floor((Date.now()-n)/1e3))):void 0;return d.jsxs("div",{className:"refresh-control",children:[d.jsx("label",{className:"refresh-lbl",htmlFor:"refresh-interval",children:"AUTO"}),d.jsx("select",{id:"refresh-interval",className:"refresh-select",value:t,"aria-label":"Auto-refresh interval",onChange:c=>s(c.target.value),children:Bg.map(c=>d.jsx("option",{value:c.token,children:c.label},c.token))}),l!==void 0&&d.jsx("span",{className:"refresh-fresh",title:"Time since the list last refreshed",children:l})]})}var Tn={},ay;function dS(){if(ay)return Tn;ay=1,Object.defineProperty(Tn,"__esModule",{value:!0});class t extends Error{}class n extends t{constructor(o){super(`Invalid DateTime: ${o.toMessage()}`)}}class s extends t{constructor(o){super(`Invalid Interval: ${o.toMessage()}`)}}class a extends t{constructor(o){super(`Invalid Duration: ${o.toMessage()}`)}}class l extends t{}class c extends t{constructor(o){super(`Invalid unit ${o}`)}}class h extends t{}class y extends t{constructor(){super("Zone is an abstract class")}}const x="numeric",w="short",T="long",E={year:x,month:x,day:x},_={year:x,month:w,day:x},S={year:x,month:w,day:x,weekday:w},O={year:x,month:T,day:x},C={year:x,month:T,day:x,weekday:T},b={hour:x,minute:x},I={hour:x,minute:x,second:x},j={hour:x,minute:x,second:x,timeZoneName:w},F={hour:x,minute:x,second:x,timeZoneName:T},U={hour:x,minute:x,hourCycle:"h23"},$={hour:x,minute:x,second:x,hourCycle:"h23"},J={hour:x,minute:x,second:x,hourCycle:"h23",timeZoneName:w},ne={hour:x,minute:x,second:x,hourCycle:"h23",timeZoneName:T},he={year:x,month:x,day:x,hour:x,minute:x},ye={year:x,month:x,day:x,hour:x,minute:x,second:x},ke={year:x,month:w,day:x,hour:x,minute:x},pe={year:x,month:w,day:x,hour:x,minute:x,second:x},ge={year:x,month:w,day:x,weekday:w,hour:x,minute:x},fe={year:x,month:T,day:x,hour:x,minute:x,timeZoneName:w},Ee={year:x,month:T,day:x,hour:x,minute:x,second:x,timeZoneName:w},Ce={year:x,month:T,day:x,weekday:T,hour:x,minute:x,timeZoneName:T},Ze={year:x,month:T,day:x,weekday:T,hour:x,minute:x,second:x,timeZoneName:T};class Me{get type(){throw new y}get name(){throw new y}get ianaName(){return this.name}get isUniversal(){throw new y}offsetName(o,m){throw new y}formatOffset(o,m){throw new y}offset(o){throw new y}equals(o){throw new y}get isValid(){throw new y}}let ee=null;class ve extends Me{static get instance(){return ee===null&&(ee=new ve),ee}get type(){return"system"}get name(){return new Intl.DateTimeFormat().resolvedOptions().timeZone}get isUniversal(){return!1}offsetName(o,{format:m,locale:v}){return au(o,m,v)}formatOffset(o,m){return Ls(this.offset(o),m)}offset(o){return-new Date(o).getTimezoneOffset()}equals(o){return o.type==="system"}get isValid(){return!0}}const me=new Map;function W(g){let o=me.get(g);return o===void 0&&(o=new Intl.DateTimeFormat("en-US",{hour12:!1,timeZone:g,year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit",second:"2-digit",era:"short"}),me.set(g,o)),o}const se={year:0,month:1,day:2,era:3,hour:4,minute:5,second:6};function We(g,o){const m=g.format(o).replace(/\u200E/g,""),v=/(\d+)\/(\d+)\/(\d+) (AD|BC),? (\d+):(\d+):(\d+)/.exec(m),[,N,M,V,B,Y,ae,Le]=v;return[V,N,M,B,Y,ae,Le]}function He(g,o){const m=g.formatToParts(o),v=[];for(let N=0;N<m.length;N++){const{type:M,value:V}=m[N],B=se[M];M==="era"?v[B]=V:Ue(B)||(v[B]=parseInt(V,10))}return v}const Xe=new Map;class ze extends Me{static create(o){let m=Xe.get(o);return m===void 0&&Xe.set(o,m=new ze(o)),m}static resetCache(){Xe.clear(),me.clear()}static isValidSpecifier(o){return this.isValidZone(o)}static isValidZone(o){if(!o)return!1;try{return new Intl.DateTimeFormat("en-US",{timeZone:o}).format(),!0}catch{return!1}}constructor(o){super(),this.zoneName=o,this.valid=ze.isValidZone(o)}get type(){return"iana"}get name(){return this.zoneName}get isUniversal(){return!1}offsetName(o,{format:m,locale:v}){return au(o,m,v,this.name)}formatOffset(o,m){return Ls(this.offset(o),m)}offset(o){if(!this.valid)return NaN;const m=new Date(o);if(isNaN(m))return NaN;const v=W(this.name);let[N,M,V,B,Y,ae,Le]=v.formatToParts?He(v,m):We(v,m);B==="BC"&&(N=-Math.abs(N)+1);const tt=Ms({year:N,month:M,day:V,hour:Y===24?0:Y,minute:ae,second:Le,millisecond:0});let Fe=+m;const mt=Fe%1e3;return Fe-=mt>=0?mt:1e3+mt,(tt-Fe)/(60*1e3)}equals(o){return o.type==="iana"&&o.name===this.name}get isValid(){return this.valid}}let et={};function Ge(g,o={}){const m=JSON.stringify([g,o]);let v=et[m];return v||(v=new Intl.ListFormat(g,o),et[m]=v),v}const lt=new Map;function Ct(g,o={}){const m=JSON.stringify([g,o]);let v=lt.get(m);return v===void 0&&(v=new Intl.DateTimeFormat(g,o),lt.set(m,v)),v}const jn=new Map;function sr(g,o={}){const m=JSON.stringify([g,o]);let v=jn.get(m);return v===void 0&&(v=new Intl.NumberFormat(g,o),jn.set(m,v)),v}const $n=new Map;function Nr(g,o={}){const{base:m,...v}=o,N=JSON.stringify([g,v]);let M=$n.get(N);return M===void 0&&(M=new Intl.RelativeTimeFormat(g,o),$n.set(N,M)),M}let Wn=null;function ir(){return Wn||(Wn=new Intl.DateTimeFormat().resolvedOptions().locale,Wn)}const Hn=new Map;function ar(g){let o=Hn.get(g);return o===void 0&&(o=new Intl.DateTimeFormat(g).resolvedOptions(),Hn.set(g,o)),o}const Dn=new Map;function or(g){let o=Dn.get(g);if(!o){const m=new Intl.Locale(g);o="getWeekInfo"in m?m.getWeekInfo():m.weekInfo,"minimalDays"in o||(o={...R,...o}),Dn.set(g,o)}return o}function Rn(g){const o=g.indexOf("-x-");o!==-1&&(g=g.substring(0,o));const m=g.indexOf("-u-");if(m===-1)return[g];{let v,N;try{v=Ct(g).resolvedOptions(),N=g}catch{const Y=g.substring(0,m);v=Ct(Y).resolvedOptions(),N=Y}const{numberingSystem:M,calendar:V}=v;return[N,M,V]}}function Zr(g,o,m){return(m||o)&&(g.includes("-u-")||(g+="-u"),m&&(g+=`-ca-${m}`),o&&(g+=`-nu-${o}`)),g}function qr(g){const o=[];for(let m=1;m<=12;m++){const v=Ve.utc(2009,m,1);o.push(g(v))}return o}function Qr(g){const o=[];for(let m=1;m<=7;m++){const v=Ve.utc(2016,11,13+m);o.push(g(v))}return o}function lr(g,o,m,v){const N=g.listingMode();return N==="error"?null:N==="en"?m(o):v(o)}function Bn(g){return g.numberingSystem&&g.numberingSystem!=="latn"?!1:g.numberingSystem==="latn"||!g.locale||g.locale.startsWith("en")||ar(g.locale).numberingSystem==="latn"}class Yr{constructor(o,m,v){this.padTo=v.padTo||0,this.floor=v.floor||!1;const{padTo:N,floor:M,...V}=v;if(!m||Object.keys(V).length>0){const B={useGrouping:!1,...v};v.padTo>0&&(B.minimumIntegerDigits=v.padTo),this.inf=sr(o,B)}}format(o){if(this.inf){const m=this.floor?Math.floor(o):o;return this.inf.format(m)}else{const m=this.floor?Math.floor(o):Kr(o,3);return Mt(m,this.padTo)}}}class At{constructor(o,m,v){this.opts=v,this.originalZone=void 0;let N;if(this.opts.timeZone)this.dt=o;else if(o.zone.type==="fixed"){const V=-1*(o.offset/60),B=V>=0?`Etc/GMT+${V}`:`Etc/GMT${V}`;o.offset!==0&&ze.create(B).valid?(N=B,this.dt=o):(N="UTC",this.dt=o.offset===0?o:o.setZone("UTC").plus({minutes:o.offset}),this.originalZone=o.zone)}else o.zone.type==="system"?this.dt=o:o.zone.type==="iana"?(this.dt=o,N=o.zone.name):(N="UTC",this.dt=o.setZone("UTC").plus({minutes:o.offset}),this.originalZone=o.zone);const M={...this.opts};M.timeZone=M.timeZone||N,this.dtf=Ct(m,M)}format(){return this.originalZone?this.formatToParts().map(({value:o})=>o).join(""):this.dtf.format(this.dt.toJSDate())}formatToParts(){const o=this.dtf.formatToParts(this.dt.toJSDate());return this.originalZone?o.map(m=>{if(m.type==="timeZoneName"){const v=this.originalZone.offsetName(this.dt.ts,{locale:this.dt.locale,format:this.opts.timeZoneName});return{...m,value:v}}else return m}):o}resolvedOptions(){return this.dtf.resolvedOptions()}}class Gr{constructor(o,m,v){this.opts={style:"long",...v},!m&&Ho()&&(this.rtf=Nr(o,v))}format(o,m){return this.rtf?this.rtf.format(o,m):cu(m,o,this.opts.numeric,this.opts.style!=="long")}formatToParts(o,m){return this.rtf?this.rtf.formatToParts(o,m):[]}}const R={firstDay:1,minimalDays:4,weekend:[6,7]};class A{static fromOpts(o){return A.create(o.locale,o.numberingSystem,o.outputCalendar,o.weekSettings,o.defaultToEN)}static create(o,m,v,N,M=!1){const V=o||gt.defaultLocale,B=V||(M?"en-US":ir()),Y=m||gt.defaultNumberingSystem,ae=v||gt.defaultOutputCalendar,Le=Zo(N)||gt.defaultWeekSettings;return new A(B,Y,ae,Le,V)}static resetCache(){Wn=null,lt.clear(),jn.clear(),$n.clear(),Hn.clear(),Dn.clear()}static fromObject({locale:o,numberingSystem:m,outputCalendar:v,weekSettings:N}={}){return A.create(o,m,v,N)}constructor(o,m,v,N,M){const[V,B,Y]=Rn(o);this.locale=V,this.numberingSystem=m||B||null,this.outputCalendar=v||Y||null,this.weekSettings=N,this.intl=Zr(this.locale,this.numberingSystem,this.outputCalendar),this.weekdaysCache={format:{},standalone:{}},this.monthsCache={format:{},standalone:{}},this.meridiemCache=null,this.eraCache={},this.specifiedLocale=M,this.fastNumbersCached=null}get fastNumbers(){return this.fastNumbersCached==null&&(this.fastNumbersCached=Bn(this)),this.fastNumbersCached}listingMode(){const o=this.isEnglish(),m=(this.numberingSystem===null||this.numberingSystem==="latn")&&(this.outputCalendar===null||this.outputCalendar==="gregory");return o&&m?"en":"intl"}clone(o){return!o||Object.getOwnPropertyNames(o).length===0?this:A.create(o.locale||this.specifiedLocale,o.numberingSystem||this.numberingSystem,o.outputCalendar||this.outputCalendar,Zo(o.weekSettings)||this.weekSettings,o.defaultToEN||!1)}redefaultToEN(o={}){return this.clone({...o,defaultToEN:!0})}redefaultToSystem(o={}){return this.clone({...o,defaultToEN:!1})}months(o,m=!1){return lr(this,o,Da,()=>{const v=this.intl==="ja"||this.intl.startsWith("ja-");m&=!v;const N=m?{month:o,day:"numeric"}:{month:o},M=m?"format":"standalone";if(!this.monthsCache[M][o]){const V=v?B=>this.dtFormatter(B,N).format():B=>this.extract(B,N,"month");this.monthsCache[M][o]=qr(V)}return this.monthsCache[M][o]})}weekdays(o,m=!1){return lr(this,o,dr,()=>{const v=m?{weekday:o,year:"numeric",month:"long",day:"numeric"}:{weekday:o},N=m?"format":"standalone";return this.weekdaysCache[N][o]||(this.weekdaysCache[N][o]=Qr(M=>this.extract(M,v,"weekday"))),this.weekdaysCache[N][o]})}meridiems(){return lr(this,void 0,()=>As,()=>{if(!this.meridiemCache){const o={hour:"numeric",hourCycle:"h12"};this.meridiemCache=[Ve.utc(2016,11,13,9),Ve.utc(2016,11,13,19)].map(m=>this.extract(m,o,"dayperiod"))}return this.meridiemCache})}eras(o){return lr(this,o,Yo,()=>{const m={era:o};return this.eraCache[o]||(this.eraCache[o]=[Ve.utc(-40,1,1),Ve.utc(2017,1,1)].map(v=>this.extract(v,m,"era"))),this.eraCache[o]})}extract(o,m,v){const N=this.dtFormatter(o,m),M=N.formatToParts(),V=M.find(B=>B.type.toLowerCase()===v);return V?V.value:null}numberFormatter(o={}){return new Yr(this.intl,o.forceSimple||this.fastNumbers,o)}dtFormatter(o,m={}){return new At(o,this.intl,m)}relFormatter(o={}){return new Gr(this.intl,this.isEnglish(),o)}listFormatter(o={}){return Ge(this.intl,o)}isEnglish(){return this.locale==="en"||this.locale.toLowerCase()==="en-us"||ar(this.intl).locale.startsWith("en-us")}getWeekSettings(){return this.weekSettings?this.weekSettings:Ri()?or(this.locale):R}getStartOfWeek(){return this.getWeekSettings().firstDay}getMinDaysInFirstWeek(){return this.getWeekSettings().minimalDays}getWeekendDays(){return this.getWeekSettings().weekend}equals(o){return this.locale===o.locale&&this.numberingSystem===o.numberingSystem&&this.outputCalendar===o.outputCalendar}toString(){return`Locale(${this.locale}, ${this.numberingSystem}, ${this.outputCalendar})`}}let q=null;class te extends Me{static get utcInstance(){return q===null&&(q=new te(0)),q}static instance(o){return o===0?te.utcInstance:new te(o)}static parseSpecifier(o){if(o){const m=o.match(/^utc(?:([+-]\d{1,2})(?::(\d{2}))?)?$/i);if(m)return new te(Is(m[1],m[2]))}return null}constructor(o){super(),this.fixed=o}get type(){return"fixed"}get name(){return this.fixed===0?"UTC":`UTC${Ls(this.fixed,"narrow")}`}get ianaName(){return this.fixed===0?"Etc/UTC":`Etc/GMT${Ls(-this.fixed,"narrow")}`}offsetName(){return this.name}formatOffset(o,m){return Ls(this.fixed,m)}get isUniversal(){return!0}offset(){return this.fixed}equals(o){return o.type==="fixed"&&o.fixed===this.fixed}get isValid(){return!0}}class le extends Me{constructor(o){super(),this.zoneName=o}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 H(g,o){if(Ue(g)||g===null)return o;if(g instanceof Me)return g;if(Zc(g)){const m=g.toLowerCase();return m==="default"?o:m==="local"||m==="system"?ve.instance:m==="utc"||m==="gmt"?te.utcInstance:te.parseSpecifier(m)||ze.create(g)}else return Tr(g)?te.instance(g):typeof g=="object"&&"offset"in g&&typeof g.offset=="function"?g:new le(g)}const Q={arab:"[٠-٩]",arabext:"[۰-۹]",bali:"[᭐-᭙]",beng:"[০-৯]",deva:"[०-९]",fullwide:"[0-9]",gujr:"[૦-૯]",hanidec:"[〇|一|二|三|四|五|六|七|八|九]",khmr:"[០-៩]",knda:"[೦-೯]",laoo:"[໐-໙]",limb:"[᥆-᥏]",mlym:"[൦-൯]",mong:"[᠐-᠙]",mymr:"[၀-၉]",orya:"[୦-୯]",tamldec:"[௦-௯]",telu:"[౦-౯]",thai:"[๐-๙]",tibt:"[༠-༩]",latn:"\\d"},re={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]},_e=Q.hanidec.replace(/[\[|\]]/g,"").split("");function Ye(g){let o=parseInt(g,10);if(isNaN(o)){o="";for(let m=0;m<g.length;m++){const v=g.charCodeAt(m);if(g[m].search(Q.hanidec)!==-1)o+=_e.indexOf(g[m]);else for(const N in re){const[M,V]=re[N];v>=M&&v<=V&&(o+=v-M)}}return parseInt(o,10)}else return o}const xt=new Map;function Kt(){xt.clear()}function yt({numberingSystem:g},o=""){const m=g||"latn";let v=xt.get(m);v===void 0&&(v=new Map,xt.set(m,v));let N=v.get(o);return N===void 0&&(N=new RegExp(`${Q[m]}${o}`),v.set(o,N)),N}let ur=()=>Date.now(),ji="system",Ts=null,Di=null,Cs=null,Ea=60,Po,Os=null;class gt{static get now(){return ur}static set now(o){ur=o}static set defaultZone(o){ji=o}static get defaultZone(){return H(ji,ve.instance)}static get defaultLocale(){return Ts}static set defaultLocale(o){Ts=o}static get defaultNumberingSystem(){return Di}static set defaultNumberingSystem(o){Di=o}static get defaultOutputCalendar(){return Cs}static set defaultOutputCalendar(o){Cs=o}static get defaultWeekSettings(){return Os}static set defaultWeekSettings(o){Os=Zo(o)}static get twoDigitCutoffYear(){return Ea}static set twoDigitCutoffYear(o){Ea=o%100}static get throwOnInvalid(){return Po}static set throwOnInvalid(o){Po=o}static resetCaches(){A.resetCache(),ze.resetCache(),Ve.resetCache(),Kt()}}class Xt{constructor(o,m){this.reason=o,this.explanation=m}toMessage(){return this.explanation?`${this.reason}: ${this.explanation}`:this.reason}}const tu=[0,31,59,90,120,151,181,212,243,273,304,334],bs=[0,31,60,91,121,152,182,213,244,274,305,335];function Jt(g,o){return new Xt("unit out of range",`you specified ${o} (of type ${typeof o}) as a ${g}, which is invalid`)}function js(g,o,m){const v=new Date(Date.UTC(g,o-1,m));g<100&&g>=0&&v.setUTCFullYear(v.getUTCFullYear()-1900);const N=v.getUTCDay();return N===0?7:N}function Ta(g,o,m){return m+(Or(g)?bs:tu)[o-1]}function nu(g,o){const m=Or(g)?bs:tu,v=m.findIndex(M=>M<o),N=o-m[v];return{month:v+1,day:N}}function Uo(g,o){return(g-o+7)%7+1}function Ca(g,o=4,m=1){const{year:v,month:N,day:M}=g,V=Ta(v,N,M),B=Uo(js(v,N,M),m);let Y=Math.floor((V-B+14-o)/7),ae;return Y<1?(ae=v-1,Y=Xr(ae,o,m)):Y>Xr(v,o,m)?(ae=v+1,Y=1):ae=v,{weekYear:ae,weekNumber:Y,weekday:B,...Fs(g)}}function Er(g,o=4,m=1){const{weekYear:v,weekNumber:N,weekday:M}=g,V=Uo(js(v,1,o),m),B=Rs(v);let Y=N*7+M-V-7+o,ae;Y<1?(ae=v-1,Y+=Rs(ae)):Y>B?(ae=v+1,Y-=Rs(v)):ae=v;const{month:Le,day:$e}=nu(ae,Y);return{year:ae,month:Le,day:$e,...Fs(g)}}function Oa(g){const{year:o,month:m,day:v}=g,N=Ta(o,m,v);return{year:o,ordinal:N,...Fs(g)}}function Vo(g){const{year:o,ordinal:m}=g,{month:v,day:N}=nu(o,m);return{year:o,month:v,day:N,...Fs(g)}}function ru(g,o){if(!Ue(g.localWeekday)||!Ue(g.localWeekNumber)||!Ue(g.localWeekYear)){if(!Ue(g.weekday)||!Ue(g.weekNumber)||!Ue(g.weekYear))throw new l("Cannot mix locale-based week fields with ISO-based week fields");return Ue(g.localWeekday)||(g.weekday=g.localWeekday),Ue(g.localWeekNumber)||(g.weekNumber=g.localWeekNumber),Ue(g.localWeekYear)||(g.weekYear=g.localWeekYear),delete g.localWeekday,delete g.localWeekNumber,delete g.localWeekYear,{minDaysInFirstWeek:o.getMinDaysInFirstWeek(),startOfWeek:o.getStartOfWeek()}}else return{minDaysInFirstWeek:4,startOfWeek:1}}function su(g,o=4,m=1){const v=wt(g.weekYear),N=Nt(g.weekNumber,1,Xr(g.weekYear,o,m)),M=Nt(g.weekday,1,7);return v?N?M?!1:Jt("weekday",g.weekday):Jt("week",g.weekNumber):Jt("weekYear",g.weekYear)}function iu(g){const o=wt(g.year),m=Nt(g.ordinal,1,Rs(g.year));return o?m?!1:Jt("ordinal",g.ordinal):Jt("year",g.year)}function zo(g){const o=wt(g.year),m=Nt(g.month,1,12),v=Nt(g.day,1,ja(g.year,g.month));return o?m?v?!1:Jt("day",g.day):Jt("month",g.month):Jt("year",g.year)}function $o(g){const{hour:o,minute:m,second:v,millisecond:N}=g,M=Nt(o,0,23)||o===24&&m===0&&v===0&&N===0,V=Nt(m,0,59),B=Nt(v,0,59),Y=Nt(N,0,999);return M?V?B?Y?!1:Jt("millisecond",N):Jt("second",v):Jt("minute",m):Jt("hour",o)}function Ue(g){return typeof g>"u"}function Tr(g){return typeof g=="number"}function wt(g){return typeof g=="number"&&g%1===0}function Zc(g){return typeof g=="string"}function Wo(g){return Object.prototype.toString.call(g)==="[object Date]"}function Ho(){try{return typeof Intl<"u"&&!!Intl.RelativeTimeFormat}catch{return!1}}function Ri(){try{return typeof Intl<"u"&&!!Intl.Locale&&("weekInfo"in Intl.Locale.prototype||"getWeekInfo"in Intl.Locale.prototype)}catch{return!1}}function qc(g){return Array.isArray(g)?g:[g]}function Bo(g,o,m){if(g.length!==0)return g.reduce((v,N)=>{const M=[o(N),N];return v&&m(v[0],M[0])===v[0]?v:M},null)[1]}function ba(g,o){return o.reduce((m,v)=>(m[v]=g[v],m),{})}function en(g,o){return Object.prototype.hasOwnProperty.call(g,o)}function Zo(g){if(g==null)return null;if(typeof g!="object")throw new h("Week settings must be an object");if(!Nt(g.firstDay,1,7)||!Nt(g.minimalDays,1,7)||!Array.isArray(g.weekend)||g.weekend.some(o=>!Nt(o,1,7)))throw new h("Invalid week settings");return{firstDay:g.firstDay,minimalDays:g.minimalDays,weekend:Array.from(g.weekend)}}function Nt(g,o,m){return wt(g)&&g>=o&&g<=m}function Qc(g,o){return g-o*Math.floor(g/o)}function Mt(g,o=2){const m=g<0;let v;return m?v="-"+(""+-g).padStart(o,"0"):v=(""+g).padStart(o,"0"),v}function Cr(g){if(!(Ue(g)||g===null||g===""))return parseInt(g,10)}function Zn(g){if(!(Ue(g)||g===null||g===""))return parseFloat(g)}function Ds(g){if(!(Ue(g)||g===null||g==="")){const o=parseFloat("0."+g)*1e3;return Math.floor(o)}}function Kr(g,o,m="round"){const v=10**o;switch(m){case"expand":return g>0?Math.ceil(g*v)/v:Math.floor(g*v)/v;case"trunc":return Math.trunc(g*v)/v;case"round":return Math.round(g*v)/v;case"floor":return Math.floor(g*v)/v;case"ceil":return Math.ceil(g*v)/v;default:throw new RangeError(`Value rounding ${m} is out of range`)}}function Or(g){return g%4===0&&(g%100!==0||g%400===0)}function Rs(g){return Or(g)?366:365}function ja(g,o){const m=Qc(o-1,12)+1,v=g+(o-m)/12;return m===2?Or(v)?29:28:[31,null,31,30,31,30,31,31,30,31,30,31][m-1]}function Ms(g){let o=Date.UTC(g.year,g.month-1,g.day,g.hour,g.minute,g.second,g.millisecond);return g.year<100&&g.year>=0&&(o=new Date(o),o.setUTCFullYear(g.year,g.month-1,g.day)),+o}function qo(g,o,m){return-Uo(js(g,1,o),m)+o-1}function Xr(g,o=4,m=1){const v=qo(g,o,m),N=qo(g+1,o,m);return(Rs(g)-v+N)/7}function Jr(g){return g>99?g:g>gt.twoDigitCutoffYear?1900+g:2e3+g}function au(g,o,m,v=null){const N=new Date(g),M={hourCycle:"h23",year:"numeric",month:"2-digit",day:"2-digit",hour:"2-digit",minute:"2-digit"};v&&(M.timeZone=v);const V={timeZoneName:o,...M},B=new Intl.DateTimeFormat(m,V).formatToParts(N).find(Y=>Y.type.toLowerCase()==="timezonename");return B?B.value:null}function Is(g,o){let m=parseInt(g,10);Number.isNaN(m)&&(m=0);const v=parseInt(o,10)||0,N=m<0||Object.is(m,-0)?-v:v;return m*60+N}function ut(g){const o=Number(g);if(typeof g=="boolean"||g===""||!Number.isFinite(o))throw new h(`Invalid unit value ${g}`);return o}function Mi(g,o){const m={};for(const v in g)if(en(g,v)){const N=g[v];if(N==null)continue;m[o(v)]=ut(N)}return m}function Ls(g,o){const m=Math.trunc(Math.abs(g/60)),v=Math.trunc(Math.abs(g%60)),N=g>=0?"+":"-";switch(o){case"short":return`${N}${Mt(m,2)}:${Mt(v,2)}`;case"narrow":return`${N}${m}${v>0?`:${v}`:""}`;case"techie":return`${N}${Mt(m,2)}${Mt(v,2)}`;default:throw new RangeError(`Value format ${o} is out of range for property format`)}}function Fs(g){return ba(g,["hour","minute","second","millisecond"])}const ou=["January","February","March","April","May","June","July","August","September","October","November","December"],Qo=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],lu=["J","F","M","A","M","J","J","A","S","O","N","D"];function Da(g){switch(g){case"narrow":return[...lu];case"short":return[...Qo];case"long":return[...ou];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 Ii=["Monday","Tuesday","Wednesday","Thursday","Friday","Saturday","Sunday"],cr=["Mon","Tue","Wed","Thu","Fri","Sat","Sun"],br=["M","T","W","T","F","S","S"];function dr(g){switch(g){case"narrow":return[...br];case"short":return[...cr];case"long":return[...Ii];case"numeric":return["1","2","3","4","5","6","7"];default:return null}}const As=["AM","PM"],Li=["Before Christ","Anno Domini"],jr=["BC","AD"],Yc=["B","A"];function Yo(g){switch(g){case"narrow":return[...Yc];case"short":return[...jr];case"long":return[...Li];default:return null}}function Fi(g){return As[g.hour<12?0:1]}function Gc(g,o){return dr(o)[g.weekday-1]}function uu(g,o){return Da(o)[g.month-1]}function Ra(g,o){return Yo(o)[g.year<0?0:1]}function cu(g,o,m="always",v=!1){const N={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."]},M=["hours","minutes","seconds"].indexOf(g)===-1;if(m==="auto"&&M){const $e=g==="days";switch(o){case 1:return $e?"tomorrow":`next ${N[g][0]}`;case-1:return $e?"yesterday":`last ${N[g][0]}`;case 0:return $e?"today":`this ${N[g][0]}`}}const V=Object.is(o,-0)||o<0,B=Math.abs(o),Y=B===1,ae=N[g],Le=v?Y?ae[1]:ae[2]||ae[1]:Y?N[g][0]:g;return V?`${B} ${Le} ago`:`in ${B} ${Le}`}function du(g,o){let m="";for(const v of g)v.literal?m+=v.val:m+=o(v.val);return m}const Ai={D:E,DD:_,DDD:O,DDDD:C,t:b,tt:I,ttt:j,tttt:F,T:U,TT:$,TTT:J,TTTT:ne,f:he,ff:ke,fff:fe,ffff:Ce,F:ye,FF:pe,FFF:Ee,FFFF:Ze};class It{static create(o,m={}){return new It(o,m)}static parseFormat(o){let m=null,v="",N=!1;const M=[];for(let V=0;V<o.length;V++){const B=o.charAt(V);B==="'"?((v.length>0||N)&&M.push({literal:N||/^\s+$/.test(v),val:v===""?"'":v}),m=null,v="",N=!N):N||B===m?v+=B:(v.length>0&&M.push({literal:/^\s+$/.test(v),val:v}),v=B,m=B)}return v.length>0&&M.push({literal:N||/^\s+$/.test(v),val:v}),M}static macroTokenToFormatOpts(o){return Ai[o]}constructor(o,m){this.opts=m,this.loc=o,this.systemLoc=null}formatWithSystemDefault(o,m){return this.systemLoc===null&&(this.systemLoc=this.loc.redefaultToSystem()),this.systemLoc.dtFormatter(o,{...this.opts,...m}).format()}dtFormatter(o,m={}){return this.loc.dtFormatter(o,{...this.opts,...m})}formatDateTime(o,m){return this.dtFormatter(o,m).format()}formatDateTimeParts(o,m){return this.dtFormatter(o,m).formatToParts()}formatInterval(o,m){return this.dtFormatter(o.start,m).dtf.formatRange(o.start.toJSDate(),o.end.toJSDate())}resolvedOptions(o,m){return this.dtFormatter(o,m).resolvedOptions()}num(o,m=0,v=void 0){if(this.opts.forceSimple)return Mt(o,m);const N={...this.opts};return m>0&&(N.padTo=m),v&&(N.signDisplay=v),this.loc.numberFormatter(N).format(o)}formatDateTimeFromString(o,m){const v=this.loc.listingMode()==="en",N=this.loc.outputCalendar&&this.loc.outputCalendar!=="gregory",M=(Fe,mt)=>this.loc.extract(o,Fe,mt),V=Fe=>o.isOffsetFixed&&o.offset===0&&Fe.allowZ?"Z":o.isValid?o.zone.formatOffset(o.ts,Fe.format):"",B=()=>v?Fi(o):M({hour:"numeric",hourCycle:"h12"},"dayperiod"),Y=(Fe,mt)=>v?uu(o,Fe):M(mt?{month:Fe}:{month:Fe,day:"numeric"},"month"),ae=(Fe,mt)=>v?Gc(o,Fe):M(mt?{weekday:Fe}:{weekday:Fe,month:"long",day:"numeric"},"weekday"),Le=Fe=>{const mt=It.macroTokenToFormatOpts(Fe);return mt?this.formatWithSystemDefault(o,mt):Fe},$e=Fe=>v?Ra(o,Fe):M({era:Fe},"era"),tt=Fe=>{switch(Fe){case"S":return this.num(o.millisecond);case"u":case"SSS":return this.num(o.millisecond,3);case"s":return this.num(o.second);case"ss":return this.num(o.second,2);case"uu":return this.num(Math.floor(o.millisecond/10),2);case"uuu":return this.num(Math.floor(o.millisecond/100));case"m":return this.num(o.minute);case"mm":return this.num(o.minute,2);case"h":return this.num(o.hour%12===0?12:o.hour%12);case"hh":return this.num(o.hour%12===0?12:o.hour%12,2);case"H":return this.num(o.hour);case"HH":return this.num(o.hour,2);case"Z":return V({format:"narrow",allowZ:this.opts.allowZ});case"ZZ":return V({format:"short",allowZ:this.opts.allowZ});case"ZZZ":return V({format:"techie",allowZ:this.opts.allowZ});case"ZZZZ":return o.zone.offsetName(o.ts,{format:"short",locale:this.loc.locale});case"ZZZZZ":return o.zone.offsetName(o.ts,{format:"long",locale:this.loc.locale});case"z":return o.zoneName;case"a":return B();case"d":return N?M({day:"numeric"},"day"):this.num(o.day);case"dd":return N?M({day:"2-digit"},"day"):this.num(o.day,2);case"c":return this.num(o.weekday);case"ccc":return ae("short",!0);case"cccc":return ae("long",!0);case"ccccc":return ae("narrow",!0);case"E":return this.num(o.weekday);case"EEE":return ae("short",!1);case"EEEE":return ae("long",!1);case"EEEEE":return ae("narrow",!1);case"L":return N?M({month:"numeric",day:"numeric"},"month"):this.num(o.month);case"LL":return N?M({month:"2-digit",day:"numeric"},"month"):this.num(o.month,2);case"LLL":return Y("short",!0);case"LLLL":return Y("long",!0);case"LLLLL":return Y("narrow",!0);case"M":return N?M({month:"numeric"},"month"):this.num(o.month);case"MM":return N?M({month:"2-digit"},"month"):this.num(o.month,2);case"MMM":return Y("short",!1);case"MMMM":return Y("long",!1);case"MMMMM":return Y("narrow",!1);case"y":return N?M({year:"numeric"},"year"):this.num(o.year);case"yy":return N?M({year:"2-digit"},"year"):this.num(o.year.toString().slice(-2),2);case"yyyy":return N?M({year:"numeric"},"year"):this.num(o.year,4);case"yyyyyy":return N?M({year:"numeric"},"year"):this.num(o.year,6);case"G":return $e("short");case"GG":return $e("long");case"GGGGG":return $e("narrow");case"kk":return this.num(o.weekYear.toString().slice(-2),2);case"kkkk":return this.num(o.weekYear,4);case"W":return this.num(o.weekNumber);case"WW":return this.num(o.weekNumber,2);case"n":return this.num(o.localWeekNumber);case"nn":return this.num(o.localWeekNumber,2);case"ii":return this.num(o.localWeekYear.toString().slice(-2),2);case"iiii":return this.num(o.localWeekYear,4);case"o":return this.num(o.ordinal);case"ooo":return this.num(o.ordinal,3);case"q":return this.num(o.quarter);case"qq":return this.num(o.quarter,2);case"X":return this.num(Math.floor(o.ts/1e3));case"x":return this.num(o.ts);default:return Le(Fe)}};return du(It.parseFormat(m),tt)}formatDurationFromString(o,m){const v=this.opts.signMode==="negativeLargestOnly"?-1:1,N=Le=>{switch(Le[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}},M=(Le,$e)=>tt=>{const Fe=N(tt);if(Fe){const mt=$e.isNegativeDuration&&Fe!==$e.largestUnit?v:1;let pn;return this.opts.signMode==="negativeLargestOnly"&&Fe!==$e.largestUnit?pn="never":this.opts.signMode==="all"?pn="always":pn="auto",this.num(Le.get(Fe)*mt,tt.length,pn)}else return tt},V=It.parseFormat(m),B=V.reduce((Le,{literal:$e,val:tt})=>$e?Le:Le.concat(tt),[]),Y=o.shiftTo(...B.map(N).filter(Le=>Le)),ae={isNegativeDuration:Y<0,largestUnit:Object.keys(Y.values)[0]};return du(V,M(Y,ae))}}const es=/[A-Za-z_+-]{1,256}(?::?\/[A-Za-z0-9_+-]{1,256}(?:\/[A-Za-z0-9_+-]{1,256})?)?/;function fr(...g){const o=g.reduce((m,v)=>m+v.source,"");return RegExp(`^${o}$`)}function Ps(...g){return o=>g.reduce(([m,v,N],M)=>{const[V,B,Y]=M(o,N);return[{...m,...V},B||v,Y]},[{},null,1]).slice(0,2)}function Us(g,...o){if(g==null)return[null,null];for(const[m,v]of o){const N=m.exec(g);if(N)return v(N)}return[null,null]}function Ma(...g){return(o,m)=>{const v={};let N;for(N=0;N<g.length;N++)v[g[N]]=Cr(o[m+N]);return[v,null,m+N]}}const Pi=/(?:([Zz])|([+-]\d\d)(?::?(\d\d))?)/,Go=`(?:${Pi.source}?(?:\\[(${es.source})\\])?)?`,Ia=/(\d\d)(?::?(\d\d)(?::?(\d\d)(?:[.,](\d{1,30}))?)?)?/,hr=RegExp(`${Ia.source}${Go}`),Ui=RegExp(`(?:[Tt]${hr.source})?`),La=/([+-]\d{6}|\d{4})(?:-?(\d\d)(?:-?(\d\d))?)?/,fu=/(\d{4})-?W(\d\d)(?:-?(\d))?/,Fa=/(\d{4})-?(\d{3})/,Aa=Ma("weekYear","weekNumber","weekDay"),hu=Ma("year","ordinal"),hn=/(\d{4})-(\d\d)-(\d\d)/,ts=RegExp(`${Ia.source} ?(?:${Pi.source}|(${es.source}))?`),Ko=RegExp(`(?: ${ts.source})?`);function qn(g,o,m){const v=g[o];return Ue(v)?m:Cr(v)}function Kc(g,o){return[{year:qn(g,o),month:qn(g,o+1,1),day:qn(g,o+2,1)},null,o+3]}function Dr(g,o){return[{hours:qn(g,o,0),minutes:qn(g,o+1,0),seconds:qn(g,o+2,0),milliseconds:Ds(g[o+3])},null,o+4]}function ns(g,o){const m=!g[o]&&!g[o+1],v=Is(g[o+1],g[o+2]),N=m?null:te.instance(v);return[{},N,o+3]}function mr(g,o){const m=g[o]?ze.create(g[o]):null;return[{},m,o+1]}const Pa=RegExp(`^T?${Ia.source}$`),mu=/^-?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 Xc(g){const[o,m,v,N,M,V,B,Y,ae]=g,Le=o[0]==="-",$e=Y&&Y[0]==="-",tt=(Fe,mt=!1)=>Fe!==void 0&&(mt||Fe&&Le)?-Fe:Fe;return[{years:tt(Zn(m)),months:tt(Zn(v)),weeks:tt(Zn(N)),days:tt(Zn(M)),hours:tt(Zn(V)),minutes:tt(Zn(B)),seconds:tt(Zn(Y),Y==="-0"),milliseconds:tt(Ds(ae),$e)}]}const Jc={GMT:0,EDT:-240,EST:-300,CDT:-300,CST:-360,MDT:-360,MST:-420,PDT:-420,PST:-480};function Xo(g,o,m,v,N,M,V){const B={year:o.length===2?Jr(Cr(o)):Cr(o),month:Qo.indexOf(m)+1,day:Cr(v),hour:Cr(N),minute:Cr(M)};return V&&(B.second=Cr(V)),g&&(B.weekday=g.length>3?Ii.indexOf(g)+1:cr.indexOf(g)+1),B}const Jo=/^(?:(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 ed(g){const[,o,m,v,N,M,V,B,Y,ae,Le,$e]=g,tt=Xo(o,N,v,m,M,V,B);let Fe;return Y?Fe=Jc[Y]:ae?Fe=0:Fe=Is(Le,$e),[tt,new te(Fe)]}function td(g){return g.replace(/\([^()]*\)|[\n\t]/g," ").replace(/(\s\s+)/g," ").trim()}const nd=/^(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$/,rd=/^(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$/,sd=/^(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 el(g){const[,o,m,v,N,M,V,B]=g;return[Xo(o,N,v,m,M,V,B),te.utcInstance]}function id(g){const[,o,m,v,N,M,V,B]=g;return[Xo(o,B,m,v,N,M,V),te.utcInstance]}const ad=fr(La,Ui),od=fr(fu,Ui),ld=fr(Fa,Ui),tl=fr(hr),pu=Ps(Kc,Dr,ns,mr),ud=Ps(Aa,Dr,ns,mr),cd=Ps(hu,Dr,ns,mr),yu=Ps(Dr,ns,mr);function dd(g){return Us(g,[ad,pu],[od,ud],[ld,cd],[tl,yu])}function fd(g){return Us(td(g),[Jo,ed])}function hd(g){return Us(g,[nd,el],[rd,el],[sd,id])}function md(g){return Us(g,[mu,Xc])}const pd=Ps(Dr);function yd(g){return Us(g,[Pa,pd])}const gd=fr(hn,Ko),nl=fr(ts),Vi=Ps(Dr,ns,mr);function vd(g){return Us(g,[gd,pu],[nl,Vi])}const rl="Invalid Duration",sl={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}},gu={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},...sl},mn=146097/400,rs=146097/4800,Vs={years:{quarters:4,months:12,weeks:mn/7,days:mn,hours:mn*24,minutes:mn*24*60,seconds:mn*24*60*60,milliseconds:mn*24*60*60*1e3},quarters:{months:3,weeks:mn/28,days:mn/4,hours:mn*24/4,minutes:mn*24*60/4,seconds:mn*24*60*60/4,milliseconds:mn*24*60*60*1e3/4},months:{weeks:rs/7,days:rs,hours:rs*24,minutes:rs*24*60,seconds:rs*24*60*60,milliseconds:rs*24*60*60*1e3},...sl},ss=["years","quarters","months","weeks","days","hours","minutes","seconds","milliseconds"],xd=ss.slice(0).reverse();function pr(g,o,m=!1){const v={values:m?o.values:{...g.values,...o.values||{}},loc:g.loc.clone(o.loc),conversionAccuracy:o.conversionAccuracy||g.conversionAccuracy,matrix:o.matrix||g.matrix};return new Je(v)}function il(g,o){var m;let v=(m=o.milliseconds)!=null?m:0;for(const N of xd.slice(1))o[N]&&(v+=o[N]*g[N].milliseconds);return v}function al(g,o){const m=il(g,o)<0?-1:1;ss.reduceRight((v,N)=>{if(Ue(o[N]))return v;if(v){const M=o[v]*m,V=g[N][v],B=Math.floor(M/V);o[N]+=B*m,o[v]-=B*V*m}return N},null),ss.reduce((v,N)=>{if(Ue(o[N]))return v;if(v){const M=o[v]%1;o[v]-=M,o[N]+=M*g[v][N]}return N},null)}function zs(g){const o={};for(const[m,v]of Object.entries(g))v!==0&&(o[m]=v);return o}class Je{constructor(o){const m=o.conversionAccuracy==="longterm"||!1;let v=m?Vs:gu;o.matrix&&(v=o.matrix),this.values=o.values,this.loc=o.loc||A.create(),this.conversionAccuracy=m?"longterm":"casual",this.invalid=o.invalid||null,this.matrix=v,this.isLuxonDuration=!0}static fromMillis(o,m){return Je.fromObject({milliseconds:o},m)}static fromObject(o,m={}){if(o==null||typeof o!="object")throw new h(`Duration.fromObject: argument expected to be an object, got ${o===null?"null":typeof o}`);return new Je({values:Mi(o,Je.normalizeUnit),loc:A.fromObject(m),conversionAccuracy:m.conversionAccuracy,matrix:m.matrix})}static fromDurationLike(o){if(Tr(o))return Je.fromMillis(o);if(Je.isDuration(o))return o;if(typeof o=="object")return Je.fromObject(o);throw new h(`Unknown duration argument ${o} of type ${typeof o}`)}static fromISO(o,m){const[v]=md(o);return v?Je.fromObject(v,m):Je.invalid("unparsable",`the input "${o}" can't be parsed as ISO 8601`)}static fromISOTime(o,m){const[v]=yd(o);return v?Je.fromObject(v,m):Je.invalid("unparsable",`the input "${o}" can't be parsed as ISO 8601`)}static invalid(o,m=null){if(!o)throw new h("need to specify a reason the Duration is invalid");const v=o instanceof Xt?o:new Xt(o,m);if(gt.throwOnInvalid)throw new a(v);return new Je({invalid:v})}static normalizeUnit(o){const m={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"}[o&&o.toLowerCase()];if(!m)throw new c(o);return m}static isDuration(o){return o&&o.isLuxonDuration||!1}get locale(){return this.isValid?this.loc.locale:null}get numberingSystem(){return this.isValid?this.loc.numberingSystem:null}toFormat(o,m={}){const v={...m,floor:m.round!==!1&&m.floor!==!1};return this.isValid?It.create(this.loc,v).formatDurationFromString(this,o):rl}toHuman(o={}){if(!this.isValid)return rl;const m=o.showZeros!==!1,v=ss.map(N=>{const M=this.values[N];return Ue(M)||M===0&&!m?null:this.loc.numberFormatter({style:"unit",unitDisplay:"long",...o,unit:N.slice(0,-1)}).format(M)}).filter(N=>N);return this.loc.listFormatter({type:"conjunction",style:o.listStyle||"narrow",...o}).format(v)}toObject(){return this.isValid?{...this.values}:{}}toISO(){if(!this.isValid)return null;let o="P";return this.years!==0&&(o+=this.years+"Y"),(this.months!==0||this.quarters!==0)&&(o+=this.months+this.quarters*3+"M"),this.weeks!==0&&(o+=this.weeks+"W"),this.days!==0&&(o+=this.days+"D"),(this.hours!==0||this.minutes!==0||this.seconds!==0||this.milliseconds!==0)&&(o+="T"),this.hours!==0&&(o+=this.hours+"H"),this.minutes!==0&&(o+=this.minutes+"M"),(this.seconds!==0||this.milliseconds!==0)&&(o+=Kr(this.seconds+this.milliseconds/1e3,3)+"S"),o==="P"&&(o+="T0S"),o}toISOTime(o={}){if(!this.isValid)return null;const m=this.toMillis();return m<0||m>=864e5?null:(o={suppressMilliseconds:!1,suppressSeconds:!1,includePrefix:!1,format:"extended",...o,includeOffset:!1},Ve.fromMillis(m,{zone:"UTC"}).toISOTime(o))}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?il(this.matrix,this.values):NaN}valueOf(){return this.toMillis()}plus(o){if(!this.isValid)return this;const m=Je.fromDurationLike(o),v={};for(const N of ss)(en(m.values,N)||en(this.values,N))&&(v[N]=m.get(N)+this.get(N));return pr(this,{values:v},!0)}minus(o){if(!this.isValid)return this;const m=Je.fromDurationLike(o);return this.plus(m.negate())}mapUnits(o){if(!this.isValid)return this;const m={};for(const v of Object.keys(this.values))m[v]=ut(o(this.values[v],v));return pr(this,{values:m},!0)}get(o){return this[Je.normalizeUnit(o)]}set(o){if(!this.isValid)return this;const m={...this.values,...Mi(o,Je.normalizeUnit)};return pr(this,{values:m})}reconfigure({locale:o,numberingSystem:m,conversionAccuracy:v,matrix:N}={}){const V={loc:this.loc.clone({locale:o,numberingSystem:m}),matrix:N,conversionAccuracy:v};return pr(this,V)}as(o){return this.isValid?this.shiftTo(o).get(o):NaN}normalize(){if(!this.isValid)return this;const o=this.toObject();return al(this.matrix,o),pr(this,{values:o},!0)}rescale(){if(!this.isValid)return this;const o=zs(this.normalize().shiftToAll().toObject());return pr(this,{values:o},!0)}shiftTo(...o){if(!this.isValid)return this;if(o.length===0)return this;o=o.map(V=>Je.normalizeUnit(V));const m={},v={},N=this.toObject();let M;for(const V of ss)if(o.indexOf(V)>=0){M=V;let B=0;for(const ae in v)B+=this.matrix[ae][V]*v[ae],v[ae]=0;Tr(N[V])&&(B+=N[V]);const Y=Math.trunc(B);m[V]=Y,v[V]=(B*1e3-Y*1e3)/1e3}else Tr(N[V])&&(v[V]=N[V]);for(const V in v)v[V]!==0&&(m[M]+=V===M?v[V]:v[V]/this.matrix[M][V]);return al(this.matrix,m),pr(this,{values:m},!0)}shiftToAll(){return this.isValid?this.shiftTo("years","months","weeks","days","hours","minutes","seconds","milliseconds"):this}negate(){if(!this.isValid)return this;const o={};for(const m of Object.keys(this.values))o[m]=this.values[m]===0?0:-this.values[m];return pr(this,{values:o},!0)}removeZeros(){if(!this.isValid)return this;const o=zs(this.values);return pr(this,{values:o},!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(o){if(!this.isValid||!o.isValid||!this.loc.equals(o.loc))return!1;function m(v,N){return v===void 0||v===0?N===void 0||N===0:v===N}for(const v of ss)if(!m(this.values[v],o.values[v]))return!1;return!0}}const $s="Invalid Interval";function Ua(g,o){return!g||!g.isValid?St.invalid("missing or invalid start"):!o||!o.isValid?St.invalid("missing or invalid end"):o<g?St.invalid("end before start",`The end of an interval must be after its start, but you had start=${g.toISO()} and end=${o.toISO()}`):null}class St{constructor(o){this.s=o.start,this.e=o.end,this.invalid=o.invalid||null,this.isLuxonInterval=!0}static invalid(o,m=null){if(!o)throw new h("need to specify a reason the Interval is invalid");const v=o instanceof Xt?o:new Xt(o,m);if(gt.throwOnInvalid)throw new s(v);return new St({invalid:v})}static fromDateTimes(o,m){const v=Mr(o),N=Mr(m),M=Ua(v,N);return M??new St({start:v,end:N})}static after(o,m){const v=Je.fromDurationLike(m),N=Mr(o);return St.fromDateTimes(N,N.plus(v))}static before(o,m){const v=Je.fromDurationLike(m),N=Mr(o);return St.fromDateTimes(N.minus(v),N)}static fromISO(o,m){const[v,N]=(o||"").split("/",2);if(v&&N){let M,V;try{M=Ve.fromISO(v,m),V=M.isValid}catch{V=!1}let B,Y;try{B=Ve.fromISO(N,m),Y=B.isValid}catch{Y=!1}if(V&&Y)return St.fromDateTimes(M,B);if(V){const ae=Je.fromISO(N,m);if(ae.isValid)return St.after(M,ae)}else if(Y){const ae=Je.fromISO(v,m);if(ae.isValid)return St.before(B,ae)}}return St.invalid("unparsable",`the input "${o}" can't be parsed as ISO 8601`)}static isInterval(o){return o&&o.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(o="milliseconds"){return this.isValid?this.toDuration(o).get(o):NaN}count(o="milliseconds",m){if(!this.isValid)return NaN;const v=this.start.startOf(o,m);let N;return m!=null&&m.useLocaleWeeks?N=this.end.reconfigure({locale:v.locale}):N=this.end,N=N.startOf(o,m),Math.floor(N.diff(v,o).get(o))+(N.valueOf()!==this.end.valueOf())}hasSame(o){return this.isValid?this.isEmpty()||this.e.minus(1).hasSame(this.s,o):!1}isEmpty(){return this.s.valueOf()===this.e.valueOf()}isAfter(o){return this.isValid?this.s>o:!1}isBefore(o){return this.isValid?this.e<=o:!1}contains(o){return this.isValid?this.s<=o&&this.e>o:!1}set({start:o,end:m}={}){return this.isValid?St.fromDateTimes(o||this.s,m||this.e):this}splitAt(...o){if(!this.isValid)return[];const m=o.map(Mr).filter(V=>this.contains(V)).sort((V,B)=>V.toMillis()-B.toMillis()),v=[];let{s:N}=this,M=0;for(;N<this.e;){const V=m[M]||this.e,B=+V>+this.e?this.e:V;v.push(St.fromDateTimes(N,B)),N=B,M+=1}return v}splitBy(o){const m=Je.fromDurationLike(o);if(!this.isValid||!m.isValid||m.as("milliseconds")===0)return[];let{s:v}=this,N=1,M;const V=[];for(;v<this.e;){const B=this.start.plus(m.mapUnits(Y=>Y*N));M=+B>+this.e?this.e:B,V.push(St.fromDateTimes(v,M)),v=M,N+=1}return V}divideEqually(o){return this.isValid?this.splitBy(this.length()/o).slice(0,o):[]}overlaps(o){return this.e>o.s&&this.s<o.e}abutsStart(o){return this.isValid?+this.e==+o.s:!1}abutsEnd(o){return this.isValid?+o.e==+this.s:!1}engulfs(o){return this.isValid?this.s<=o.s&&this.e>=o.e:!1}equals(o){return!this.isValid||!o.isValid?!1:this.s.equals(o.s)&&this.e.equals(o.e)}intersection(o){if(!this.isValid)return this;const m=this.s>o.s?this.s:o.s,v=this.e<o.e?this.e:o.e;return m>=v?null:St.fromDateTimes(m,v)}union(o){if(!this.isValid)return this;const m=this.s<o.s?this.s:o.s,v=this.e>o.e?this.e:o.e;return St.fromDateTimes(m,v)}static merge(o){const[m,v]=o.sort((N,M)=>N.s-M.s).reduce(([N,M],V)=>M?M.overlaps(V)||M.abutsStart(V)?[N,M.union(V)]:[N.concat([M]),V]:[N,V],[[],null]);return v&&m.push(v),m}static xor(o){let m=null,v=0;const N=[],M=o.map(Y=>[{time:Y.s,type:"s"},{time:Y.e,type:"e"}]),V=Array.prototype.concat(...M),B=V.sort((Y,ae)=>Y.time-ae.time);for(const Y of B)v+=Y.type==="s"?1:-1,v===1?m=Y.time:(m&&+m!=+Y.time&&N.push(St.fromDateTimes(m,Y.time)),m=null);return St.merge(N)}difference(...o){return St.xor([this].concat(o)).map(m=>this.intersection(m)).filter(m=>m&&!m.isEmpty())}toString(){return this.isValid?`[${this.s.toISO()} – ${this.e.toISO()})`:$s}[Symbol.for("nodejs.util.inspect.custom")](){return this.isValid?`Interval { start: ${this.s.toISO()}, end: ${this.e.toISO()} }`:`Interval { Invalid, reason: ${this.invalidReason} }`}toLocaleString(o=E,m={}){return this.isValid?It.create(this.s.loc.clone(m),o).formatInterval(this):$s}toISO(o){return this.isValid?`${this.s.toISO(o)}/${this.e.toISO(o)}`:$s}toISODate(){return this.isValid?`${this.s.toISODate()}/${this.e.toISODate()}`:$s}toISOTime(o){return this.isValid?`${this.s.toISOTime(o)}/${this.e.toISOTime(o)}`:$s}toFormat(o,{separator:m=" – "}={}){return this.isValid?`${this.s.toFormat(o)}${m}${this.e.toFormat(o)}`:$s}toDuration(o,m){return this.isValid?this.e.diff(this.s,o,m):Je.invalid(this.invalidReason)}mapEndpoints(o){return St.fromDateTimes(o(this.s),o(this.e))}}class Ws{static hasDST(o=gt.defaultZone){const m=Ve.now().setZone(o).set({month:12});return!o.isUniversal&&m.offset!==m.set({month:6}).offset}static isValidIANAZone(o){return ze.isValidZone(o)}static normalizeZone(o){return H(o,gt.defaultZone)}static getStartOfWeek({locale:o=null,locObj:m=null}={}){return(m||A.create(o)).getStartOfWeek()}static getMinimumDaysInFirstWeek({locale:o=null,locObj:m=null}={}){return(m||A.create(o)).getMinDaysInFirstWeek()}static getWeekendWeekdays({locale:o=null,locObj:m=null}={}){return(m||A.create(o)).getWeekendDays().slice()}static months(o="long",{locale:m=null,numberingSystem:v=null,locObj:N=null,outputCalendar:M="gregory"}={}){return(N||A.create(m,v,M)).months(o)}static monthsFormat(o="long",{locale:m=null,numberingSystem:v=null,locObj:N=null,outputCalendar:M="gregory"}={}){return(N||A.create(m,v,M)).months(o,!0)}static weekdays(o="long",{locale:m=null,numberingSystem:v=null,locObj:N=null}={}){return(N||A.create(m,v,null)).weekdays(o)}static weekdaysFormat(o="long",{locale:m=null,numberingSystem:v=null,locObj:N=null}={}){return(N||A.create(m,v,null)).weekdays(o,!0)}static meridiems({locale:o=null}={}){return A.create(o).meridiems()}static eras(o="short",{locale:m=null}={}){return A.create(m,null,"gregory").eras(o)}static features(){return{relative:Ho(),localeWeek:Ri()}}}function Va(g,o){const m=N=>N.toUTC(0,{keepLocalTime:!0}).startOf("day").valueOf(),v=m(o)-m(g);return Math.floor(Je.fromMillis(v).as("days"))}function ol(g,o,m){const v=[["years",(Y,ae)=>ae.year-Y.year],["quarters",(Y,ae)=>ae.quarter-Y.quarter+(ae.year-Y.year)*4],["months",(Y,ae)=>ae.month-Y.month+(ae.year-Y.year)*12],["weeks",(Y,ae)=>{const Le=Va(Y,ae);return(Le-Le%7)/7}],["days",Va]],N={},M=g;let V,B;for(const[Y,ae]of v)m.indexOf(Y)>=0&&(V=Y,N[Y]=ae(g,o),B=M.plus(N),B>o?(N[Y]--,g=M.plus(N),g>o&&(B=g,N[Y]--,g=M.plus(N))):g=B);return[g,N,B,V]}function vu(g,o,m,v){let[N,M,V,B]=ol(g,o,m);const Y=o-N,ae=m.filter($e=>["hours","minutes","seconds","milliseconds"].indexOf($e)>=0);ae.length===0&&(V<o&&(V=N.plus({[B]:1})),V!==N&&(M[B]=(M[B]||0)+Y/(V-N)));const Le=Je.fromObject(M,v);return ae.length>0?Je.fromMillis(Y,v).shiftTo(...ae).plus(Le):Le}const xu="missing Intl.DateTimeFormat.formatToParts support";function it(g,o=m=>m){return{regex:g,deser:([m])=>o(Ye(m))}}const wu="[ ]",Su=new RegExp(wu,"g");function wd(g){return g.replace(/\./g,"\\.?").replace(Su,wu)}function ku(g){return g.replace(/\./g,"").replace(Su," ").toLowerCase()}function Ot(g,o){return g===null?null:{regex:RegExp(g.map(wd).join("|")),deser:([m])=>g.findIndex(v=>ku(m)===ku(v))+o}}function Hs(g,o){return{regex:g,deser:([,m,v])=>Is(m,v),groups:o}}function zi(g){return{regex:g,deser:([o])=>o}}function _u(g){return g.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function Nu(g,o){const m=yt(o),v=yt(o,"{2}"),N=yt(o,"{3}"),M=yt(o,"{4}"),V=yt(o,"{6}"),B=yt(o,"{1,2}"),Y=yt(o,"{1,3}"),ae=yt(o,"{1,6}"),Le=yt(o,"{1,9}"),$e=yt(o,"{2,4}"),tt=yt(o,"{4,6}"),Fe=Qn=>({regex:RegExp(_u(Qn.val)),deser:([Ks])=>Ks,literal:!0}),pn=(Qn=>{if(g.literal)return Fe(Qn);switch(Qn.val){case"G":return Ot(o.eras("short"),0);case"GG":return Ot(o.eras("long"),0);case"y":return it(ae);case"yy":return it($e,Jr);case"yyyy":return it(M);case"yyyyy":return it(tt);case"yyyyyy":return it(V);case"M":return it(B);case"MM":return it(v);case"MMM":return Ot(o.months("short",!0),1);case"MMMM":return Ot(o.months("long",!0),1);case"L":return it(B);case"LL":return it(v);case"LLL":return Ot(o.months("short",!1),1);case"LLLL":return Ot(o.months("long",!1),1);case"d":return it(B);case"dd":return it(v);case"o":return it(Y);case"ooo":return it(N);case"HH":return it(v);case"H":return it(B);case"hh":return it(v);case"h":return it(B);case"mm":return it(v);case"m":return it(B);case"q":return it(B);case"qq":return it(v);case"s":return it(B);case"ss":return it(v);case"S":return it(Y);case"SSS":return it(N);case"u":return zi(Le);case"uu":return zi(B);case"uuu":return it(m);case"a":return Ot(o.meridiems(),0);case"kkkk":return it(M);case"kk":return it($e,Jr);case"W":return it(B);case"WW":return it(v);case"E":case"c":return it(m);case"EEE":return Ot(o.weekdays("short",!1),1);case"EEEE":return Ot(o.weekdays("long",!1),1);case"ccc":return Ot(o.weekdays("short",!0),1);case"cccc":return Ot(o.weekdays("long",!0),1);case"Z":case"ZZ":return Hs(new RegExp(`([+-]${B.source})(?::(${v.source}))?`),2);case"ZZZ":return Hs(new RegExp(`([+-]${B.source})(${v.source})?`),2);case"z":return zi(/[a-z_+-/]{1,256}?/i);case" ":return zi(/[^\S\n\r]/);default:return Fe(Qn)}})(g)||{invalidReason:xu};return pn.token=g,pn}const Eu={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 ll(g,o,m){const{type:v,value:N}=g;if(v==="literal"){const Y=/^\s+$/.test(N);return{literal:!Y,val:Y?" ":N}}const M=o[v];let V=v;v==="hour"&&(o.hour12!=null?V=o.hour12?"hour12":"hour24":o.hourCycle!=null?o.hourCycle==="h11"||o.hourCycle==="h12"?V="hour12":V="hour24":V=m.hour12?"hour12":"hour24");let B=Eu[V];if(typeof B=="object"&&(B=B[M]),B)return{literal:!1,val:B}}function Sd(g){return[`^${g.map(m=>m.regex).reduce((m,v)=>`${m}(${v.source})`,"")}$`,g]}function kd(g,o,m){const v=g.match(o);if(v){const N={};let M=1;for(const V in m)if(en(m,V)){const B=m[V],Y=B.groups?B.groups+1:1;!B.literal&&B.token&&(N[B.token.val[0]]=B.deser(v.slice(M,M+Y))),M+=Y}return[v,N]}else return[v,{}]}function Bs(g){const o=M=>{switch(M){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 m=null,v;return Ue(g.z)||(m=ze.create(g.z)),Ue(g.Z)||(m||(m=new te(g.Z)),v=g.Z),Ue(g.q)||(g.M=(g.q-1)*3+1),Ue(g.h)||(g.h<12&&g.a===1?g.h+=12:g.h===12&&g.a===0&&(g.h=0)),g.G===0&&g.y&&(g.y=-g.y),Ue(g.u)||(g.S=Ds(g.u)),[Object.keys(g).reduce((M,V)=>{const B=o(V);return B&&(M[B]=g[V]),M},{}),m,v]}let $i=null;function Wi(){return $i||($i=Ve.fromMillis(1555555555555)),$i}function ul(g,o){if(g.literal)return g;const m=It.macroTokenToFormatOpts(g.val),v=fl(m,o);return v==null||v.includes(void 0)?g:v}function cl(g,o){return Array.prototype.concat(...g.map(m=>ul(m,o)))}class Hi{constructor(o,m){if(this.locale=o,this.format=m,this.tokens=cl(It.parseFormat(m),o),this.units=this.tokens.map(v=>Nu(v,o)),this.disqualifyingUnit=this.units.find(v=>v.invalidReason),!this.disqualifyingUnit){const[v,N]=Sd(this.units);this.regex=RegExp(v,"i"),this.handlers=N}}explainFromTokens(o){if(this.isValid){const[m,v]=kd(o,this.regex,this.handlers),[N,M,V]=v?Bs(v):[null,null,void 0];if(en(v,"a")&&en(v,"H"))throw new l("Can't include meridiem when specifying 24-hour format");return{input:o,tokens:this.tokens,regex:this.regex,rawMatches:m,matches:v,result:N,zone:M,specificOffset:V}}else return{input:o,tokens:this.tokens,invalidReason:this.invalidReason}}get isValid(){return!this.disqualifyingUnit}get invalidReason(){return this.disqualifyingUnit?this.disqualifyingUnit.invalidReason:null}}function is(g,o,m){return new Hi(g,m).explainFromTokens(o)}function dl(g,o,m){const{result:v,zone:N,specificOffset:M,invalidReason:V}=is(g,o,m);return[v,N,M,V]}function fl(g,o){if(!g)return null;const v=It.create(o,g).dtFormatter(Wi()),N=v.formatToParts(),M=v.resolvedOptions();return N.map(V=>ll(V,g,M))}const Zs="Invalid DateTime",hl=864e13;function qs(g){return new Xt("unsupported zone",`the zone "${g.name}" is not supported`)}function za(g){return g.weekData===null&&(g.weekData=Ca(g.c)),g.weekData}function $a(g){return g.localWeekData===null&&(g.localWeekData=Ca(g.c,g.loc.getMinDaysInFirstWeek(),g.loc.getStartOfWeek())),g.localWeekData}function Rr(g,o){const m={ts:g.ts,zone:g.zone,c:g.c,o:g.o,loc:g.loc,invalid:g.invalid};return new Ve({...m,...o,old:m})}function ml(g,o,m){let v=g-o*60*1e3;const N=m.offset(v);if(o===N)return[v,o];v-=(N-o)*60*1e3;const M=m.offset(v);return N===M?[v,N]:[g-Math.min(N,M)*60*1e3,Math.max(N,M)]}function Mn(g,o){g+=o*60*1e3;const m=new Date(g);return{year:m.getUTCFullYear(),month:m.getUTCMonth()+1,day:m.getUTCDate(),hour:m.getUTCHours(),minute:m.getUTCMinutes(),second:m.getUTCSeconds(),millisecond:m.getUTCMilliseconds()}}function Qs(g,o,m){return ml(Ms(g),o,m)}function Wa(g,o){const m=g.o,v=g.c.year+Math.trunc(o.years),N=g.c.month+Math.trunc(o.months)+Math.trunc(o.quarters)*3,M={...g.c,year:v,month:N,day:Math.min(g.c.day,ja(v,N))+Math.trunc(o.days)+Math.trunc(o.weeks)*7},V=Je.fromObject({years:o.years-Math.trunc(o.years),quarters:o.quarters-Math.trunc(o.quarters),months:o.months-Math.trunc(o.months),weeks:o.weeks-Math.trunc(o.weeks),days:o.days-Math.trunc(o.days),hours:o.hours,minutes:o.minutes,seconds:o.seconds,milliseconds:o.milliseconds}).as("milliseconds"),B=Ms(M);let[Y,ae]=ml(B,m,g.zone);return V!==0&&(Y+=V,ae=g.zone.offset(Y)),{ts:Y,o:ae}}function Ys(g,o,m,v,N,M){const{setZone:V,zone:B}=m;if(g&&Object.keys(g).length!==0||o){const Y=o||B,ae=Ve.fromObject(g,{...m,zone:Y,specificOffset:M});return V?ae:ae.setZone(B)}else return Ve.invalid(new Xt("unparsable",`the input "${N}" can't be parsed as ${v}`))}function Ha(g,o,m=!0){return g.isValid?It.create(A.create("en-US"),{allowZ:m,forceSimple:!0}).formatDateTimeFromString(g,o):null}function as(g,o,m){const v=g.c.year>9999||g.c.year<0;let N="";if(v&&g.c.year>=0&&(N+="+"),N+=Mt(g.c.year,v?6:4),m==="year")return N;if(o){if(N+="-",N+=Mt(g.c.month),m==="month")return N;N+="-"}else if(N+=Mt(g.c.month),m==="month")return N;return N+=Mt(g.c.day),N}function Tu(g,o,m,v,N,M,V){let B=!m||g.c.millisecond!==0||g.c.second!==0,Y="";switch(V){case"day":case"month":case"year":break;default:if(Y+=Mt(g.c.hour),V==="hour")break;if(o){if(Y+=":",Y+=Mt(g.c.minute),V==="minute")break;B&&(Y+=":",Y+=Mt(g.c.second))}else{if(Y+=Mt(g.c.minute),V==="minute")break;B&&(Y+=Mt(g.c.second))}if(V==="second")break;B&&(!v||g.c.millisecond!==0)&&(Y+=".",Y+=Mt(g.c.millisecond,3))}return N&&(g.isOffsetFixed&&g.offset===0&&!M?Y+="Z":g.o<0?(Y+="-",Y+=Mt(Math.trunc(-g.o/60)),Y+=":",Y+=Mt(Math.trunc(-g.o%60))):(Y+="+",Y+=Mt(Math.trunc(g.o/60)),Y+=":",Y+=Mt(Math.trunc(g.o%60)))),M&&(Y+="["+g.zone.ianaName+"]"),Y}const pl={month:1,day:1,hour:0,minute:0,second:0,millisecond:0},Cu={weekNumber:1,weekday:1,hour:0,minute:0,second:0,millisecond:0},vt={ordinal:1,hour:0,minute:0,second:0,millisecond:0},Gs=["year","month","day","hour","minute","second","millisecond"],Ba=["weekYear","weekNumber","weekday","hour","minute","second","millisecond"],Bi=["year","ordinal","hour","minute","second","millisecond"];function Zi(g){const o={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"}[g.toLowerCase()];if(!o)throw new c(g);return o}function Za(g){switch(g.toLowerCase()){case"localweekday":case"localweekdays":return"localWeekday";case"localweeknumber":case"localweeknumbers":return"localWeekNumber";case"localweekyear":case"localweekyears":return"localWeekYear";default:return Zi(g)}}function qi(g){if(Yi===void 0&&(Yi=gt.now()),g.type!=="iana")return g.offset(Yi);const o=g.name;let m=gl.get(o);return m===void 0&&(m=g.offset(Yi),gl.set(o,m)),m}function Qi(g,o){const m=H(o.zone,gt.defaultZone);if(!m.isValid)return Ve.invalid(qs(m));const v=A.fromObject(o);let N,M;if(Ue(g.year))N=gt.now();else{for(const Y of Gs)Ue(g[Y])&&(g[Y]=pl[Y]);const V=zo(g)||$o(g);if(V)return Ve.invalid(V);const B=qi(m);[N,M]=Qs(g,B,m)}return new Ve({ts:N,zone:m,loc:v,o:M})}function os(g,o,m){const v=Ue(m.round)?!0:m.round,N=Ue(m.rounding)?"trunc":m.rounding,M=(B,Y)=>(B=Kr(B,v||m.calendary?0:2,m.calendary?"round":N),o.loc.clone(m).relFormatter(m).format(B,Y)),V=B=>m.calendary?o.hasSame(g,B)?0:o.startOf(B).diff(g.startOf(B),B).get(B):o.diff(g,B).get(B);if(m.unit)return M(V(m.unit),m.unit);for(const B of m.units){const Y=V(B);if(Math.abs(Y)>=1)return M(Y,B)}return M(g>o?-0:0,m.units[m.units.length-1])}function yl(g){let o={},m;return g.length>0&&typeof g[g.length-1]=="object"?(o=g[g.length-1],m=Array.from(g).slice(0,g.length-1)):m=Array.from(g),[o,m]}let Yi;const gl=new Map;class Ve{constructor(o){const m=o.zone||gt.defaultZone;let v=o.invalid||(Number.isNaN(o.ts)?new Xt("invalid input"):null)||(m.isValid?null:qs(m));this.ts=Ue(o.ts)?gt.now():o.ts;let N=null,M=null;if(!v)if(o.old&&o.old.ts===this.ts&&o.old.zone.equals(m))[N,M]=[o.old.c,o.old.o];else{const B=Tr(o.o)&&!o.old?o.o:m.offset(this.ts);N=Mn(this.ts,B),v=Number.isNaN(N.year)?new Xt("invalid input"):null,N=v?null:N,M=v?null:B}this._zone=m,this.loc=o.loc||A.create(),this.invalid=v,this.weekData=null,this.localWeekData=null,this.c=N,this.o=M,this.isLuxonDateTime=!0}static now(){return new Ve({})}static local(){const[o,m]=yl(arguments),[v,N,M,V,B,Y,ae]=m;return Qi({year:v,month:N,day:M,hour:V,minute:B,second:Y,millisecond:ae},o)}static utc(){const[o,m]=yl(arguments),[v,N,M,V,B,Y,ae]=m;return o.zone=te.utcInstance,Qi({year:v,month:N,day:M,hour:V,minute:B,second:Y,millisecond:ae},o)}static fromJSDate(o,m={}){const v=Wo(o)?o.valueOf():NaN;if(Number.isNaN(v))return Ve.invalid("invalid input");const N=H(m.zone,gt.defaultZone);return N.isValid?new Ve({ts:v,zone:N,loc:A.fromObject(m)}):Ve.invalid(qs(N))}static fromMillis(o,m={}){if(Tr(o))return o<-hl||o>hl?Ve.invalid("Timestamp out of range"):new Ve({ts:o,zone:H(m.zone,gt.defaultZone),loc:A.fromObject(m)});throw new h(`fromMillis requires a numerical input, but received a ${typeof o} with value ${o}`)}static fromSeconds(o,m={}){if(Tr(o))return new Ve({ts:o*1e3,zone:H(m.zone,gt.defaultZone),loc:A.fromObject(m)});throw new h("fromSeconds requires a numerical input")}static fromObject(o,m={}){o=o||{};const v=H(m.zone,gt.defaultZone);if(!v.isValid)return Ve.invalid(qs(v));const N=A.fromObject(m),M=Mi(o,Za),{minDaysInFirstWeek:V,startOfWeek:B}=ru(M,N),Y=gt.now(),ae=Ue(m.specificOffset)?v.offset(Y):m.specificOffset,Le=!Ue(M.ordinal),$e=!Ue(M.year),tt=!Ue(M.month)||!Ue(M.day),Fe=$e||tt,mt=M.weekYear||M.weekNumber;if((Fe||Le)&&mt)throw new l("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(tt&&Le)throw new l("Can't mix ordinal dates with month/day");const pn=mt||M.weekday&&!Fe;let Qn,Ks,In=Mn(Y,ae);pn?(Qn=Ba,Ks=Cu,In=Ca(In,V,B)):Le?(Qn=Bi,Ks=vt,In=Oa(In)):(Qn=Gs,Ks=pl);let Xs=!1;for(const ct of Qn){const Lr=M[ct];Ue(Lr)?Xs?M[ct]=Ks[ct]:M[ct]=In[ct]:Xs=!0}const Js=pn?su(M,V,B):Le?iu(M):zo(M),Gi=Js||$o(M);if(Gi)return Ve.invalid(Gi);const vl=pn?Er(M,V,B):Le?Vo(M):M,[ei,Ir]=Qs(vl,ae,v),ht=new Ve({ts:ei,zone:v,o:Ir,loc:N});return M.weekday&&Fe&&o.weekday!==ht.weekday?Ve.invalid("mismatched weekday",`you can't specify both a weekday of ${M.weekday} and a date of ${ht.toISO()}`):ht.isValid?ht:Ve.invalid(ht.invalid)}static fromISO(o,m={}){const[v,N]=dd(o);return Ys(v,N,m,"ISO 8601",o)}static fromRFC2822(o,m={}){const[v,N]=fd(o);return Ys(v,N,m,"RFC 2822",o)}static fromHTTP(o,m={}){const[v,N]=hd(o);return Ys(v,N,m,"HTTP",m)}static fromFormat(o,m,v={}){if(Ue(o)||Ue(m))throw new h("fromFormat requires an input string and a format");const{locale:N=null,numberingSystem:M=null}=v,V=A.fromOpts({locale:N,numberingSystem:M,defaultToEN:!0}),[B,Y,ae,Le]=dl(V,o,m);return Le?Ve.invalid(Le):Ys(B,Y,v,`format ${m}`,o,ae)}static fromString(o,m,v={}){return Ve.fromFormat(o,m,v)}static fromSQL(o,m={}){const[v,N]=vd(o);return Ys(v,N,m,"SQL",o)}static invalid(o,m=null){if(!o)throw new h("need to specify a reason the DateTime is invalid");const v=o instanceof Xt?o:new Xt(o,m);if(gt.throwOnInvalid)throw new n(v);return new Ve({invalid:v})}static isDateTime(o){return o&&o.isLuxonDateTime||!1}static parseFormatForOpts(o,m={}){const v=fl(o,A.fromObject(m));return v?v.map(N=>N?N.val:null).join(""):null}static expandFormat(o,m={}){return cl(It.parseFormat(o),A.fromObject(m)).map(N=>N.val).join("")}static resetCache(){Yi=void 0,gl.clear()}get(o){return this[o]}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?za(this).weekYear:NaN}get weekNumber(){return this.isValid?za(this).weekNumber:NaN}get weekday(){return this.isValid?za(this).weekday:NaN}get isWeekend(){return this.isValid&&this.loc.getWeekendDays().includes(this.weekday)}get localWeekday(){return this.isValid?$a(this).weekday:NaN}get localWeekNumber(){return this.isValid?$a(this).weekNumber:NaN}get localWeekYear(){return this.isValid?$a(this).weekYear:NaN}get ordinal(){return this.isValid?Oa(this.c).ordinal:NaN}get monthShort(){return this.isValid?Ws.months("short",{locObj:this.loc})[this.month-1]:null}get monthLong(){return this.isValid?Ws.months("long",{locObj:this.loc})[this.month-1]:null}get weekdayShort(){return this.isValid?Ws.weekdays("short",{locObj:this.loc})[this.weekday-1]:null}get weekdayLong(){return this.isValid?Ws.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 o=864e5,m=6e4,v=Ms(this.c),N=this.zone.offset(v-o),M=this.zone.offset(v+o),V=this.zone.offset(v-N*m),B=this.zone.offset(v-M*m);if(V===B)return[this];const Y=v-V*m,ae=v-B*m,Le=Mn(Y,V),$e=Mn(ae,B);return Le.hour===$e.hour&&Le.minute===$e.minute&&Le.second===$e.second&&Le.millisecond===$e.millisecond?[Rr(this,{ts:Y}),Rr(this,{ts:ae})]:[this]}get isInLeapYear(){return Or(this.year)}get daysInMonth(){return ja(this.year,this.month)}get daysInYear(){return this.isValid?Rs(this.year):NaN}get weeksInWeekYear(){return this.isValid?Xr(this.weekYear):NaN}get weeksInLocalWeekYear(){return this.isValid?Xr(this.localWeekYear,this.loc.getMinDaysInFirstWeek(),this.loc.getStartOfWeek()):NaN}resolvedLocaleOptions(o={}){const{locale:m,numberingSystem:v,calendar:N}=It.create(this.loc.clone(o),o).resolvedOptions(this);return{locale:m,numberingSystem:v,outputCalendar:N}}toUTC(o=0,m={}){return this.setZone(te.instance(o),m)}toLocal(){return this.setZone(gt.defaultZone)}setZone(o,{keepLocalTime:m=!1,keepCalendarTime:v=!1}={}){if(o=H(o,gt.defaultZone),o.equals(this.zone))return this;if(o.isValid){let N=this.ts;if(m||v){const M=o.offset(this.ts),V=this.toObject();[N]=Qs(V,M,o)}return Rr(this,{ts:N,zone:o})}else return Ve.invalid(qs(o))}reconfigure({locale:o,numberingSystem:m,outputCalendar:v}={}){const N=this.loc.clone({locale:o,numberingSystem:m,outputCalendar:v});return Rr(this,{loc:N})}setLocale(o){return this.reconfigure({locale:o})}set(o){if(!this.isValid)return this;const m=Mi(o,Za),{minDaysInFirstWeek:v,startOfWeek:N}=ru(m,this.loc),M=!Ue(m.weekYear)||!Ue(m.weekNumber)||!Ue(m.weekday),V=!Ue(m.ordinal),B=!Ue(m.year),Y=!Ue(m.month)||!Ue(m.day),ae=B||Y,Le=m.weekYear||m.weekNumber;if((ae||V)&&Le)throw new l("Can't mix weekYear/weekNumber units with year/month/day or ordinals");if(Y&&V)throw new l("Can't mix ordinal dates with month/day");let $e;M?$e=Er({...Ca(this.c,v,N),...m},v,N):Ue(m.ordinal)?($e={...this.toObject(),...m},Ue(m.day)&&($e.day=Math.min(ja($e.year,$e.month),$e.day))):$e=Vo({...Oa(this.c),...m});const[tt,Fe]=Qs($e,this.o,this.zone);return Rr(this,{ts:tt,o:Fe})}plus(o){if(!this.isValid)return this;const m=Je.fromDurationLike(o);return Rr(this,Wa(this,m))}minus(o){if(!this.isValid)return this;const m=Je.fromDurationLike(o).negate();return Rr(this,Wa(this,m))}startOf(o,{useLocaleWeeks:m=!1}={}){if(!this.isValid)return this;const v={},N=Je.normalizeUnit(o);switch(N){case"years":v.month=1;case"quarters":case"months":v.day=1;case"weeks":case"days":v.hour=0;case"hours":v.minute=0;case"minutes":v.second=0;case"seconds":v.millisecond=0;break}if(N==="weeks")if(m){const M=this.loc.getStartOfWeek(),{weekday:V}=this;V<M&&(v.weekNumber=this.weekNumber-1),v.weekday=M}else v.weekday=1;if(N==="quarters"){const M=Math.ceil(this.month/3);v.month=(M-1)*3+1}return this.set(v)}endOf(o,m){return this.isValid?this.plus({[o]:1}).startOf(o,m).minus(1):this}toFormat(o,m={}){return this.isValid?It.create(this.loc.redefaultToEN(m)).formatDateTimeFromString(this,o):Zs}toLocaleString(o=E,m={}){return this.isValid?It.create(this.loc.clone(m),o).formatDateTime(this):Zs}toLocaleParts(o={}){return this.isValid?It.create(this.loc.clone(o),o).formatDateTimeParts(this):[]}toISO({format:o="extended",suppressSeconds:m=!1,suppressMilliseconds:v=!1,includeOffset:N=!0,extendedZone:M=!1,precision:V="milliseconds"}={}){if(!this.isValid)return null;V=Zi(V);const B=o==="extended";let Y=as(this,B,V);return Gs.indexOf(V)>=3&&(Y+="T"),Y+=Tu(this,B,m,v,N,M,V),Y}toISODate({format:o="extended",precision:m="day"}={}){return this.isValid?as(this,o==="extended",Zi(m)):null}toISOWeekDate(){return Ha(this,"kkkk-'W'WW-c")}toISOTime({suppressMilliseconds:o=!1,suppressSeconds:m=!1,includeOffset:v=!0,includePrefix:N=!1,extendedZone:M=!1,format:V="extended",precision:B="milliseconds"}={}){return this.isValid?(B=Zi(B),(N&&Gs.indexOf(B)>=3?"T":"")+Tu(this,V==="extended",m,o,v,M,B)):null}toRFC2822(){return Ha(this,"EEE, dd LLL yyyy HH:mm:ss ZZZ",!1)}toHTTP(){return Ha(this.toUTC(),"EEE, dd LLL yyyy HH:mm:ss 'GMT'")}toSQLDate(){return this.isValid?as(this,!0):null}toSQLTime({includeOffset:o=!0,includeZone:m=!1,includeOffsetSpace:v=!0}={}){let N="HH:mm:ss.SSS";return(m||o)&&(v&&(N+=" "),m?N+="z":o&&(N+="ZZ")),Ha(this,N,!0)}toSQL(o={}){return this.isValid?`${this.toSQLDate()} ${this.toSQLTime(o)}`:null}toString(){return this.isValid?this.toISO():Zs}[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(o={}){if(!this.isValid)return{};const m={...this.c};return o.includeConfig&&(m.outputCalendar=this.outputCalendar,m.numberingSystem=this.loc.numberingSystem,m.locale=this.loc.locale),m}toJSDate(){return new Date(this.isValid?this.ts:NaN)}diff(o,m="milliseconds",v={}){if(!this.isValid||!o.isValid)return Je.invalid("created by diffing an invalid DateTime");const N={locale:this.locale,numberingSystem:this.numberingSystem,...v},M=qc(m).map(Je.normalizeUnit),V=o.valueOf()>this.valueOf(),B=V?this:o,Y=V?o:this,ae=vu(B,Y,M,N);return V?ae.negate():ae}diffNow(o="milliseconds",m={}){return this.diff(Ve.now(),o,m)}until(o){return this.isValid?St.fromDateTimes(this,o):this}hasSame(o,m,v){if(!this.isValid)return!1;const N=o.valueOf(),M=this.setZone(o.zone,{keepLocalTime:!0});return M.startOf(m,v)<=N&&N<=M.endOf(m,v)}equals(o){return this.isValid&&o.isValid&&this.valueOf()===o.valueOf()&&this.zone.equals(o.zone)&&this.loc.equals(o.loc)}toRelative(o={}){if(!this.isValid)return null;const m=o.base||Ve.fromObject({},{zone:this.zone}),v=o.padding?this<m?-o.padding:o.padding:0;let N=["years","months","days","hours","minutes","seconds"],M=o.unit;return Array.isArray(o.unit)&&(N=o.unit,M=void 0),os(m,this.plus(v),{...o,numeric:"always",units:N,unit:M})}toRelativeCalendar(o={}){return this.isValid?os(o.base||Ve.fromObject({},{zone:this.zone}),this,{...o,numeric:"auto",units:["years","months","days"],calendary:!0}):null}static min(...o){if(!o.every(Ve.isDateTime))throw new h("min requires all arguments be DateTimes");return Bo(o,m=>m.valueOf(),Math.min)}static max(...o){if(!o.every(Ve.isDateTime))throw new h("max requires all arguments be DateTimes");return Bo(o,m=>m.valueOf(),Math.max)}static fromFormatExplain(o,m,v={}){const{locale:N=null,numberingSystem:M=null}=v,V=A.fromOpts({locale:N,numberingSystem:M,defaultToEN:!0});return is(V,o,m)}static fromStringExplain(o,m,v={}){return Ve.fromFormatExplain(o,m,v)}static buildFormatParser(o,m={}){const{locale:v=null,numberingSystem:N=null}=m,M=A.fromOpts({locale:v,numberingSystem:N,defaultToEN:!0});return new Hi(M,o)}static fromFormatParser(o,m,v={}){if(Ue(o)||Ue(m))throw new h("fromFormatParser requires an input string and a format parser");const{locale:N=null,numberingSystem:M=null}=v,V=A.fromOpts({locale:N,numberingSystem:M,defaultToEN:!0});if(!V.equals(m.locale))throw new h(`fromFormatParser called with a locale of ${V}, but the format parser was created for ${m.locale}`);const{result:B,zone:Y,specificOffset:ae,invalidReason:Le}=m.explainFromTokens(o);return Le?Ve.invalid(Le):Ys(B,Y,v,`format ${m.format}`,o,ae)}static get DATE_SHORT(){return E}static get DATE_MED(){return _}static get DATE_MED_WITH_WEEKDAY(){return S}static get DATE_FULL(){return O}static get DATE_HUGE(){return C}static get TIME_SIMPLE(){return b}static get TIME_WITH_SECONDS(){return I}static get TIME_WITH_SHORT_OFFSET(){return j}static get TIME_WITH_LONG_OFFSET(){return F}static get TIME_24_SIMPLE(){return U}static get TIME_24_WITH_SECONDS(){return $}static get TIME_24_WITH_SHORT_OFFSET(){return J}static get TIME_24_WITH_LONG_OFFSET(){return ne}static get DATETIME_SHORT(){return he}static get DATETIME_SHORT_WITH_SECONDS(){return ye}static get DATETIME_MED(){return ke}static get DATETIME_MED_WITH_SECONDS(){return pe}static get DATETIME_MED_WITH_WEEKDAY(){return ge}static get DATETIME_FULL(){return fe}static get DATETIME_FULL_WITH_SECONDS(){return Ee}static get DATETIME_HUGE(){return Ce}static get DATETIME_HUGE_WITH_SECONDS(){return Ze}}function Mr(g){if(Ve.isDateTime(g))return g;if(g&&g.valueOf&&Tr(g.valueOf()))return Ve.fromJSDate(g);if(g&&typeof g=="object")return Ve.fromObject(g);throw new h(`Unknown datetime argument: ${g}, of type ${typeof g}`)}const qa="3.7.2";return Tn.DateTime=Ve,Tn.Duration=Je,Tn.FixedOffsetZone=te,Tn.IANAZone=ze,Tn.Info=Ws,Tn.Interval=St,Tn.InvalidZone=le,Tn.Settings=gt,Tn.SystemZone=ve,Tn.VERSION=qa,Tn.Zone=Me,Tn}var Mf,oy;function fS(){if(oy)return Mf;oy=1;var t=dS();n.prototype.addYear=function(){this._date=this._date.plus({years:1})},n.prototype.addMonth=function(){this._date=this._date.plus({months:1}).startOf("month")},n.prototype.addDay=function(){this._date=this._date.plus({days:1}).startOf("day")},n.prototype.addHour=function(){var s=this._date;this._date=this._date.plus({hours:1}).startOf("hour"),this._date<=s&&(this._date=this._date.plus({hours:1}))},n.prototype.addMinute=function(){var s=this._date;this._date=this._date.plus({minutes:1}).startOf("minute"),this._date<s&&(this._date=this._date.plus({hours:1}))},n.prototype.addSecond=function(){var s=this._date;this._date=this._date.plus({seconds:1}).startOf("second"),this._date<s&&(this._date=this._date.plus({hours:1}))},n.prototype.subtractYear=function(){this._date=this._date.minus({years:1})},n.prototype.subtractMonth=function(){this._date=this._date.minus({months:1}).endOf("month").startOf("second")},n.prototype.subtractDay=function(){this._date=this._date.minus({days:1}).endOf("day").startOf("second")},n.prototype.subtractHour=function(){var s=this._date;this._date=this._date.minus({hours:1}).endOf("hour").startOf("second"),this._date>=s&&(this._date=this._date.minus({hours:1}))},n.prototype.subtractMinute=function(){var s=this._date;this._date=this._date.minus({minutes:1}).endOf("minute").startOf("second"),this._date>s&&(this._date=this._date.minus({hours:1}))},n.prototype.subtractSecond=function(){var s=this._date;this._date=this._date.minus({seconds:1}).startOf("second"),this._date>s&&(this._date=this._date.minus({hours:1}))},n.prototype.getDate=function(){return this._date.day},n.prototype.getFullYear=function(){return this._date.year},n.prototype.getDay=function(){var s=this._date.weekday;return s==7?0:s},n.prototype.getMonth=function(){return this._date.month-1},n.prototype.getHours=function(){return this._date.hour},n.prototype.getMinutes=function(){return this._date.minute},n.prototype.getSeconds=function(){return this._date.second},n.prototype.getMilliseconds=function(){return this._date.millisecond},n.prototype.getTime=function(){return this._date.valueOf()},n.prototype.getUTCDate=function(){return this._getUTC().day},n.prototype.getUTCFullYear=function(){return this._getUTC().year},n.prototype.getUTCDay=function(){var s=this._getUTC().weekday;return s==7?0:s},n.prototype.getUTCMonth=function(){return this._getUTC().month-1},n.prototype.getUTCHours=function(){return this._getUTC().hour},n.prototype.getUTCMinutes=function(){return this._getUTC().minute},n.prototype.getUTCSeconds=function(){return this._getUTC().second},n.prototype.toISOString=function(){return this._date.toUTC().toISO()},n.prototype.toJSON=function(){return this._date.toJSON()},n.prototype.setDate=function(s){this._date=this._date.set({day:s})},n.prototype.setFullYear=function(s){this._date=this._date.set({year:s})},n.prototype.setDay=function(s){this._date=this._date.set({weekday:s})},n.prototype.setMonth=function(s){this._date=this._date.set({month:s+1})},n.prototype.setHours=function(s){this._date=this._date.set({hour:s})},n.prototype.setMinutes=function(s){this._date=this._date.set({minute:s})},n.prototype.setSeconds=function(s){this._date=this._date.set({second:s})},n.prototype.setMilliseconds=function(s){this._date=this._date.set({millisecond:s})},n.prototype._getUTC=function(){return this._date.toUTC()},n.prototype.toString=function(){return this.toDate().toString()},n.prototype.toDate=function(){return this._date.toJSDate()},n.prototype.isLastDayOfMonth=function(){var s=this._date.plus({days:1}).startOf("day");return this._date.month!==s.month},n.prototype.isLastWeekdayOfMonth=function(){var s=this._date.plus({days:7}).startOf("day");return this._date.month!==s.month};function n(s,a){var l={zone:a};if(s?s instanceof n?this._date=s._date:s instanceof Date?this._date=t.DateTime.fromJSDate(s,l):typeof s=="number"?this._date=t.DateTime.fromMillis(s,l):typeof s=="string"&&(this._date=t.DateTime.fromISO(s,l),this._date.isValid||(this._date=t.DateTime.fromRFC2822(s,l)),this._date.isValid||(this._date=t.DateTime.fromSQL(s,l)),this._date.isValid||(this._date=t.DateTime.fromFormat(s,"EEE, d MMM yyyy HH:mm:ss",l))):this._date=t.DateTime.local(),!this._date||!this._date.isValid)throw new Error("CronDate: unhandled timestamp: "+JSON.stringify(s));a&&a!==this._date.zoneName&&(this._date=this._date.setZone(a))}return Mf=n,Mf}var If,ly;function hS(){if(ly)return If;ly=1;function t(l){return{start:l,count:1}}function n(l,c){l.end=c,l.step=c-l.start,l.count=2}function s(l,c,h){c&&(c.count===2?(l.push(t(c.start)),l.push(t(c.end))):l.push(c)),h&&l.push(h)}function a(l){for(var c=[],h=void 0,y=0;y<l.length;y++){var x=l[y];typeof x!="number"?(s(c,h,t(x)),h=void 0):h?h.count===1?n(h,x):h.step===x-h.end?(h.count++,h.end=x):h.count===2?(c.push(t(h.start)),h=t(h.end),n(h,x)):(s(c,h),h=t(x)):h=t(x)}return s(c,h),c}return If=a,If}var Lf,uy;function mS(){if(uy)return Lf;uy=1;var t=hS();function n(s,a,l){var c=t(s);if(c.length===1){var h=c[0],y=h.step;if(y===1&&h.start===a&&h.end===l)return"*";if(y!==1&&h.start===a&&h.end===l-y+1)return"*/"+y}for(var x=[],w=0,T=c.length;w<T;++w){var E=c[w];if(E.count===1){x.push(E.start);continue}var y=E.step;if(E.step===1){x.push(E.start+"-"+E.end);continue}var _=E.start==0?E.count-1:E.count;E.step*_>E.end?x=x.concat(Array.from({length:E.end-E.start+1}).map(function(O,C){var b=E.start+C;return(b-E.start)%E.step===0?b:null}).filter(function(O){return O!=null})):E.end===l-E.step+1?x.push(E.start+"/"+E.step):x.push(E.start+"-"+E.end+"/"+E.step)}return x.join(",")}return Lf=n,Lf}var Ff,cy;function pS(){if(cy)return Ff;cy=1;var t=fS(),n=mS(),s=1e4;function a(l,c){this._options=c,this._utc=c.utc||!1,this._tz=this._utc?"UTC":c.tz,this._currentDate=new t(c.currentDate,this._tz),this._startDate=c.startDate?new t(c.startDate,this._tz):null,this._endDate=c.endDate?new t(c.endDate,this._tz):null,this._isIterator=c.iterator||!1,this._hasIterated=!1,this._nthDayOfWeek=c.nthDayOfWeek||0,this.fields=a._freezeFields(l)}return a.map=["second","minute","hour","dayOfMonth","month","dayOfWeek"],a.predefined={"@yearly":"0 0 1 1 *","@monthly":"0 0 1 * *","@weekly":"0 0 * * 0","@daily":"0 0 * * *","@hourly":"0 * * * *"},a.constraints=[{min:0,max:59,chars:[]},{min:0,max:59,chars:[]},{min:0,max:23,chars:[]},{min:1,max:31,chars:["L"]},{min:1,max:12,chars:[]},{min:0,max:7,chars:["L"]}],a.daysInMonth=[31,29,31,30,31,30,31,31,30,31,30,31],a.aliases={month:{jan:1,feb:2,mar:3,apr:4,may:5,jun:6,jul:7,aug:8,sep:9,oct:10,nov:11,dec:12},dayOfWeek:{sun:0,mon:1,tue:2,wed:3,thu:4,fri:5,sat:6}},a.parseDefaults=["0","*","*","*","*","*"],a.standardValidCharacters=/^[,*\d/-]+$/,a.dayOfWeekValidCharacters=/^[?,*\dL#/-]+$/,a.dayOfMonthValidCharacters=/^[?,*\dL/-]+$/,a.validCharacters={second:a.standardValidCharacters,minute:a.standardValidCharacters,hour:a.standardValidCharacters,dayOfMonth:a.dayOfMonthValidCharacters,month:a.standardValidCharacters,dayOfWeek:a.dayOfWeekValidCharacters},a._isValidConstraintChar=function(c,h){return typeof h!="string"?!1:c.chars.some(function(y){return h.indexOf(y)>-1})},a._parseField=function(c,h,y){switch(c){case"month":case"dayOfWeek":var x=a.aliases[c];h=h.replace(/[a-z]{3}/gi,function(_){if(_=_.toLowerCase(),typeof x[_]<"u")return x[_];throw new Error('Validation error, cannot resolve alias "'+_+'"')});break}if(!a.validCharacters[c].test(h))throw new Error("Invalid characters, got value: "+h);h.indexOf("*")!==-1?h=h.replace(/\*/g,y.min+"-"+y.max):h.indexOf("?")!==-1&&(h=h.replace(/\?/g,y.min+"-"+y.max));function w(_){var S=[];function O(j){if(j instanceof Array)for(var F=0,U=j.length;F<U;F++){var $=j[F];if(a._isValidConstraintChar(y,$)){S.push($);continue}if(typeof $!="number"||Number.isNaN($)||$<y.min||$>y.max)throw new Error("Constraint error, got value "+$+" expected range "+y.min+"-"+y.max);S.push($)}else{if(a._isValidConstraintChar(y,j)){S.push(j);return}var J=+j;if(Number.isNaN(J)||J<y.min||J>y.max)throw new Error("Constraint error, got value "+j+" expected range "+y.min+"-"+y.max);c==="dayOfWeek"&&(J=J%7),S.push(J)}}var C=_.split(",");if(!C.every(function(j){return j.length>0}))throw new Error("Invalid list value format");if(C.length>1)for(var b=0,I=C.length;b<I;b++)O(T(C[b]));else O(T(_));return S.sort(a._sortCompareFn),S}function T(_){var S=1,O=_.split("/");if(O.length>2)throw new Error("Invalid repeat: "+_);return O.length>1?(O[0]==+O[0]&&(O=[O[0]+"-"+y.max,O[1]]),E(O[0],O[O.length-1])):E(_,S)}function E(_,S){var O=[],C=_.split("-");if(C.length>1){if(C.length<2)return+_;if(!C[0].length){if(!C[1].length)throw new Error("Invalid range: "+_);return+_}var b=+C[0],I=+C[1];if(Number.isNaN(b)||Number.isNaN(I)||b<y.min||I>y.max)throw new Error("Constraint error, got range "+b+"-"+I+" expected range "+y.min+"-"+y.max);if(b>I)throw new Error("Invalid range: "+_);var j=+S;if(Number.isNaN(j)||j<=0)throw new Error("Constraint error, cannot repeat at every "+j+" time.");c==="dayOfWeek"&&I%7===0&&O.push(0);for(var F=b,U=I;F<=U;F++){var $=O.indexOf(F)!==-1;!$&&j>0&&j%S===0?(j=1,O.push(F)):j++}return O}return Number.isNaN(+_)?_:+_}return w(h)},a._sortCompareFn=function(l,c){var h=typeof l=="number",y=typeof c=="number";return h&&y?l-c:!h&&y?1:h&&!y?-1:l.localeCompare(c)},a._handleMaxDaysInMonth=function(l){if(l.month.length===1){var c=a.daysInMonth[l.month[0]-1];if(l.dayOfMonth[0]>c)throw new Error("Invalid explicit day of month definition");return l.dayOfMonth.filter(function(h){return h==="L"?!0:h<=c}).sort(a._sortCompareFn)}},a._freezeFields=function(l){for(var c=0,h=a.map.length;c<h;++c){var y=a.map[c],x=l[y];l[y]=Object.freeze(x)}return Object.freeze(l)},a.prototype._applyTimezoneShift=function(l,c,h){if(h==="Month"||h==="Day"){var y=l.getTime();l[c+h]();var x=l.getTime();y===x&&(l.getMinutes()===0&&l.getSeconds()===0?l.addHour():l.getMinutes()===59&&l.getSeconds()===59&&l.subtractHour())}else{var w=l.getHours();l[c+h]();var T=l.getHours(),E=T-w;E===2?this.fields.hour.length!==24&&(this._dstStart=T):E===0&&l.getMinutes()===0&&l.getSeconds()===0&&this.fields.hour.length!==24&&(this._dstEnd=T)}},a.prototype._findSchedule=function(c){function h($,J){for(var ne=0,he=J.length;ne<he;ne++)if(J[ne]>=$)return J[ne]===$;return J[0]===$}function y($,J){if(J<6){if($.getDate()<8&&J===1)return!0;var ne=$.getDate()%7?1:0,he=$.getDate()-$.getDate()%7,ye=Math.floor(he/7)+ne;return ye===J}return!1}function x($){return $.length>0&&$.some(function(J){return typeof J=="string"&&J.indexOf("L")>=0})}c=c||!1;var w=c?"subtract":"add",T=new t(this._currentDate,this._tz),E=this._startDate,_=this._endDate,S=T.getTime(),O=0;function C($){return $.some(function(J){if(!x([J]))return!1;var ne=Number.parseInt(J[0])%7;if(Number.isNaN(ne))throw new Error("Invalid last weekday of the month expression: "+J);return T.getDay()===ne&&T.isLastWeekdayOfMonth()})}for(;O<s;){if(O++,c){if(E&&T.getTime()-E.getTime()<0)throw new Error("Out of the timespan range")}else if(_&&_.getTime()-T.getTime()<0)throw new Error("Out of the timespan range");var b=h(T.getDate(),this.fields.dayOfMonth);x(this.fields.dayOfMonth)&&(b=b||T.isLastDayOfMonth());var I=h(T.getDay(),this.fields.dayOfWeek);x(this.fields.dayOfWeek)&&(I=I||C(this.fields.dayOfWeek));var j=this.fields.dayOfMonth.length>=a.daysInMonth[T.getMonth()],F=this.fields.dayOfWeek.length===a.constraints[5].max-a.constraints[5].min+1,U=T.getHours();if(!b&&(!I||F)){this._applyTimezoneShift(T,w,"Day");continue}if(!j&&F&&!b){this._applyTimezoneShift(T,w,"Day");continue}if(j&&!F&&!I){this._applyTimezoneShift(T,w,"Day");continue}if(this._nthDayOfWeek>0&&!y(T,this._nthDayOfWeek)){this._applyTimezoneShift(T,w,"Day");continue}if(!h(T.getMonth()+1,this.fields.month)){this._applyTimezoneShift(T,w,"Month");continue}if(h(U,this.fields.hour)){if(this._dstEnd===U&&!c){this._dstEnd=null,this._applyTimezoneShift(T,"add","Hour");continue}}else if(this._dstStart!==U){this._dstStart=null,this._applyTimezoneShift(T,w,"Hour");continue}else if(!h(U-1,this.fields.hour)){T[w+"Hour"]();continue}if(!h(T.getMinutes(),this.fields.minute)){this._applyTimezoneShift(T,w,"Minute");continue}if(!h(T.getSeconds(),this.fields.second)){this._applyTimezoneShift(T,w,"Second");continue}if(S===T.getTime()){w==="add"||T.getMilliseconds()===0?this._applyTimezoneShift(T,w,"Second"):T.setMilliseconds(0);continue}break}if(O>=s)throw new Error("Invalid expression, loop limit exceeded");return this._currentDate=new t(T,this._tz),this._hasIterated=!0,T},a.prototype.next=function(){var c=this._findSchedule();return this._isIterator?{value:c,done:!this.hasNext()}:c},a.prototype.prev=function(){var c=this._findSchedule(!0);return this._isIterator?{value:c,done:!this.hasPrev()}:c},a.prototype.hasNext=function(){var l=this._currentDate,c=this._hasIterated;try{return this._findSchedule(),!0}catch{return!1}finally{this._currentDate=l,this._hasIterated=c}},a.prototype.hasPrev=function(){var l=this._currentDate,c=this._hasIterated;try{return this._findSchedule(!0),!0}catch{return!1}finally{this._currentDate=l,this._hasIterated=c}},a.prototype.iterate=function(c,h){var y=[];if(c>=0)for(var x=0,w=c;x<w;x++)try{var T=this.next();y.push(T),h&&h(T,x)}catch{break}else for(var x=0,w=c;x>w;x--)try{var T=this.prev();y.push(T),h&&h(T,x)}catch{break}return y},a.prototype.reset=function(c){this._currentDate=new t(c||this._options.currentDate)},a.prototype.stringify=function(c){for(var h=[],y=c?0:1,x=a.map.length;y<x;++y){var w=a.map[y],T=this.fields[w],E=a.constraints[y];w==="dayOfMonth"&&this.fields.month.length===1?E={min:1,max:a.daysInMonth[this.fields.month[0]-1]}:w==="dayOfWeek"&&(E={min:0,max:6},T=T[T.length-1]===7?T.slice(0,-1):T),h.push(n(T,E.min,E.max))}return h.join(" ")},a.parse=function(c,h){var y=this;typeof h=="function"&&(h={});function x(w,T){T||(T={}),typeof T.currentDate>"u"&&(T.currentDate=new t(void 0,y._tz)),a.predefined[w]&&(w=a.predefined[w]);var E=[],_=(w+"").trim().split(/\s+/);if(_.length>6)throw new Error("Invalid cron expression");for(var S=a.map.length-_.length,O=0,C=a.map.length;O<C;++O){var b=a.map[O],I=_[_.length>C?O:O-S];if(O<S||!I)E.push(a._parseField(b,a.parseDefaults[O],a.constraints[O]));else{var j=b==="dayOfWeek"?J(I):I;E.push(a._parseField(b,j,a.constraints[O]))}}for(var F={},O=0,C=a.map.length;O<C;O++){var U=a.map[O];F[U]=E[O]}var $=a._handleMaxDaysInMonth(F);return F.dayOfMonth=$||F.dayOfMonth,new a(F,T);function J(ne){var he=ne.split("#");if(he.length>1){var ye=+he[he.length-1];if(/,/.test(ne))throw new Error("Constraint error, invalid dayOfWeek `#` and `,` special characters are incompatible");if(/\//.test(ne))throw new Error("Constraint error, invalid dayOfWeek `#` and `/` special characters are incompatible");if(/-/.test(ne))throw new Error("Constraint error, invalid dayOfWeek `#` and `-` special characters are incompatible");if(he.length>2||Number.isNaN(ye)||ye<1||ye>5)throw new Error("Constraint error, invalid dayOfWeek occurrence number (#)");return T.nthDayOfWeek=ye,he[0]}return ne}}return x(c,h)},a.fieldsToExpression=function(c,h){function y(b,I,j){if(!I)throw new Error("Validation error, Field "+b+" is missing");if(I.length===0)throw new Error("Validation error, Field "+b+" contains no values");for(var F=0,U=I.length;F<U;F++){var $=I[F];if(!a._isValidConstraintChar(j,$)&&(typeof $!="number"||Number.isNaN($)||$<j.min||$>j.max))throw new Error("Constraint error, got value "+$+" expected range "+j.min+"-"+j.max)}}for(var x={},w=0,T=a.map.length;w<T;++w){var E=a.map[w],_=c[E];y(E,_,a.constraints[w]);for(var S=[],O=-1;++O<_.length;)S[O]=_[O];if(_=S.sort(a._sortCompareFn).filter(function(b,I,j){return!I||b!==j[I-1]}),_.length!==S.length)throw new Error("Validation error, Field "+E+" contains duplicate values");x[E]=_}var C=a._handleMaxDaysInMonth(x);return x.dayOfMonth=C||x.dayOfMonth,new a(x,h||{})},Ff=a,Ff}const yS={},gS=Object.freeze(Object.defineProperty({__proto__:null,default:yS},Symbol.toStringTag,{value:"Module"})),vS=f0(gS);var Af,dy;function xS(){if(dy)return Af;dy=1;var t=pS();function n(){}return n._parseEntry=function(a){var l=a.split(" ");if(l.length===6)return{interval:t.parse(a)};if(l.length>6)return{interval:t.parse(l.slice(0,6).join(" ")),command:l.slice(6,l.length)};throw new Error("Invalid entry: "+a)},n.parseExpression=function(a,l){return t.parse(a,l)},n.fieldsToExpression=function(a,l){return t.fieldsToExpression(a,l)},n.parseString=function(a){for(var l=a.split(`
`),c={variables:{},expressions:[],errors:{}},h=0,y=l.length;h<y;h++){var x=l[h],w=null,T=x.trim();if(T.length>0){if(T.match(/^#/))continue;if(w=T.match(/^(.*)=(.*)$/))c.variables[w[1]]=w[2];else{var E=null;try{E=n._parseEntry("0 "+T),c.expressions.push(E.interval)}catch(_){c.errors[T]=_}}}}return c},n.parseFile=function(a,l){vS.readFile(a,function(c,h){if(c){l(c);return}return l(null,n.parseString(h.toString()))})},Af=n,Af}var qg=xS(),Pf={exports:{}},fy;function wS(){return fy||(fy=1,(function(t,n){(function(a,l){t.exports=l()})(globalThis,()=>(()=>{var s={949(h,y,x){Object.defineProperty(y,"__esModule",{value:!0}),y.CronParser=void 0;var w=x(515),T=(function(){function E(_,S,O){S===void 0&&(S=!0),O===void 0&&(O=!1),this.expression=_,this.dayOfWeekStartIndexZero=S,this.monthStartIndexZero=O}return E.prototype.parse=function(){var _,S,O=(_=this.expression)!==null&&_!==void 0?_:"";if(O==="@reboot")return S=["@reboot","","","","","",""],S;if(O.startsWith("@")){var C=this.parseSpecial(this.expression);S=this.extractParts(C)}else S=this.extractParts(this.expression);return this.normalize(S),this.validate(S),S},E.prototype.parseSpecial=function(_){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"},O=S[_];if(!O)throw new Error("Unknown special expression.");return O},E.prototype.extractParts=function(_){if(!this.expression)throw new Error("cron expression is empty");for(var S=_.trim().split(/[ ]+/),O=0;O<S.length;O++)if(S[O].includes(",")){var C=S[O].split(",").map(function(I){return I.trim()}).filter(function(I){return I!==""}).map(function(I){return isNaN(Number(I))?I:Number(I)}).filter(function(I){return I!==null&&I!==""});C.length===0&&C.push("*"),C.sort(function(I,j){return I!==null&&j!==null?I-j:0}),S[O]=C.map(function(I){return I!==null?I.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 b=/\d{4}$/.test(S[5])||S[4]=="?"||S[2]=="?";b?S.unshift(""):S.push("")}else if(S.length>7)throw new Error("Expression has ".concat(S.length," parts; too many!"));return S},E.prototype.normalize=function(_){var S=this;if(_[3]=_[3].replace("?","*"),_[5]=_[5].replace("?","*"),_[2]=_[2].replace("?","*"),_[0].indexOf("0/")==0&&(_[0]=_[0].replace("0/","*/")),_[1].indexOf("0/")==0&&(_[1]=_[1].replace("0/","*/")),_[2].indexOf("0/")==0&&(_[2]=_[2].replace("0/","*/")),_[3].indexOf("1/")==0&&(_[3]=_[3].replace("1/","*/")),_[4].indexOf("1/")==0&&(_[4]=_[4].replace("1/","*/")),_[6].indexOf("1/")==0&&(_[6]=_[6].replace("1/","*/")),_[5]=_[5].replace(/(^\d)|([^#/\s]\d)/g,function($){var J=$.replace(/\D/,""),ne=J;return S.dayOfWeekStartIndexZero?J=="7"&&(ne="0"):ne=(parseInt(J)-1).toString(),$.replace(J,ne)}),_[5]=="L"&&(_[5]="6"),_[3]=="?"&&(_[3]="*"),_[3].indexOf("W")>-1&&(_[3].indexOf(",")>-1||_[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 O={SUN:0,MON:1,TUE:2,WED:3,THU:4,FRI:5,SAT:6};for(var C in O)_[5]=_[5].replace(new RegExp(C,"gi"),O[C].toString());_[4]=_[4].replace(/(^\d{1,2})|([^#/\s]\d{1,2})/g,function($){var J=$.replace(/\D/,""),ne=J;return S.monthStartIndexZero&&(ne=(parseInt(J)+1).toString()),$.replace(J,ne)});var b={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 I in b)_[4]=_[4].replace(new RegExp(I,"gi"),b[I].toString());_[0]=="0"&&(_[0]=""),!/\*|\-|\,|\//.test(_[2])&&(/\*|\//.test(_[1])||/\*|\//.test(_[0]))&&(_[2]+="-".concat(_[2]));for(var j=0;j<_.length;j++)if(_[j].indexOf(",")!=-1&&(_[j]=_[j].split(",").filter(function($){return $!==""}).join(",")||"*"),_[j]=="*/1"&&(_[j]="*"),_[j].indexOf("/")>-1&&!/^\*|\-|\,/.test(_[j])){var F=null;switch(j){case 4:F="12";break;case 5:F="6";break;case 6:F="9999";break;default:F=null;break}if(F!==null){var U=_[j].split("/");_[j]="".concat(U[0],"-").concat(F,"/").concat(U[1])}}},E.prototype.validate=function(_){var S="0-9,\\-*/";this.validateOnlyExpectedCharactersFound(_[0],S),this.validateOnlyExpectedCharactersFound(_[1],S),this.validateOnlyExpectedCharactersFound(_[2],S),this.validateOnlyExpectedCharactersFound(_[3],"0-9,\\-*/LW"),this.validateOnlyExpectedCharactersFound(_[4],S),this.validateOnlyExpectedCharactersFound(_[5],"0-9,\\-*/L#"),this.validateOnlyExpectedCharactersFound(_[6],S),this.validateAnyRanges(_)},E.prototype.validateAnyRanges=function(_){w.default.secondRange(_[0]),w.default.minuteRange(_[1]),w.default.hourRange(_[2]),w.default.dayOfMonthRange(_[3]),w.default.monthRange(_[4],this.monthStartIndexZero),w.default.dayOfWeekRange(_[5],this.dayOfWeekStartIndexZero)},E.prototype.validateOnlyExpectedCharactersFound=function(_,S){var O=_.match(new RegExp("[^".concat(S,"]+"),"gi"));if(O&&O.length)throw new Error("Expression contains invalid values: '".concat(O.toString(),"'"))},E})();y.CronParser=T},333(h,y,x){Object.defineProperty(y,"__esModule",{value:!0}),y.ExpressionDescriptor=void 0;var w=x(823),T=x(949),E=(function(){function _(S,O){if(this.expression=S,this.options=O,this.expressionParts=new Array(5),!this.options.locale&&_.defaultLocale&&(this.options.locale=_.defaultLocale),!_.locales[this.options.locale]){var C=Object.keys(_.locales)[0];console.warn("Locale '".concat(this.options.locale,"' could not be found; falling back to '").concat(C,"'.")),this.options.locale=C}this.i18n=_.locales[this.options.locale],O.use24HourTimeFormat===void 0&&(O.use24HourTimeFormat=this.i18n.use24HourTimeFormatByDefault())}return _.toString=function(S,O){var C=O===void 0?{}:O,b=C.throwExceptionOnParseError,I=b===void 0?!0:b,j=C.verbose,F=j===void 0?!1:j,U=C.dayOfWeekStartIndexZero,$=U===void 0?!0:U,J=C.monthStartIndexZero,ne=J===void 0?!1:J,he=C.use24HourTimeFormat,ye=C.trimHoursLeadingZero,ke=ye===void 0?!1:ye,pe=C.locale,ge=pe===void 0?null:pe,fe=C.logicalAndDayFields,Ee=fe===void 0?!1:fe,Ce={throwExceptionOnParseError:I,verbose:F,dayOfWeekStartIndexZero:$,monthStartIndexZero:ne,use24HourTimeFormat:he,trimHoursLeadingZero:ke,locale:ge,logicalAndDayFields:Ee};Ce.tzOffset&&console.warn("'tzOffset' option has been deprecated and is no longer supported.");var Ze=new _(S,Ce);return Ze.getFullDescription()},_.initialize=function(S,O){O===void 0&&(O="en"),_.specialCharacters=["/","-",",","*"],_.defaultLocale=O,S.load(_.locales)},_.prototype.getFullDescription=function(){var S,O,C="";try{var b=new T.CronParser(this.expression,this.options.dayOfWeekStartIndexZero,this.options.monthStartIndexZero);if(this.expressionParts=b.parse(),this.expressionParts[0]==="@reboot")return((O=(S=this.i18n).atReboot)===null||O===void 0?void 0:O.call(S))||"Run once, at startup";var I=this.getTimeOfDayDescription(),j=this.getDayOfMonthDescription(),F=this.getMonthDescription(),U=this.getDayOfWeekDescription(),$=this.getYearDescription();C+=I+j+U+F+$,C=this.transformVerbosity(C,!!this.options.verbose),C=C.charAt(0).toLocaleUpperCase()+C.substr(1)}catch(J){if(!this.options.throwExceptionOnParseError)C=this.i18n.anErrorOccuredWhenGeneratingTheExpressionD();else throw"".concat(J)}return C},_.prototype.getTimeOfDayDescription=function(){var S=this.expressionParts[0],O=this.expressionParts[1],C=this.expressionParts[2],b="";if(!w.StringUtilities.containsAny(O,_.specialCharacters)&&!w.StringUtilities.containsAny(C,_.specialCharacters)&&!w.StringUtilities.containsAny(S,_.specialCharacters))b+=this.i18n.atSpace()+this.formatTime(C,O,S);else if(!S&&O.indexOf("-")>-1&&!(O.indexOf(",")>-1)&&!(O.indexOf("/")>-1)&&!w.StringUtilities.containsAny(C,_.specialCharacters)){var I=O.split("-");b+=w.StringUtilities.format(this.i18n.everyMinuteBetweenX0AndX1(),this.formatTime(C,I[0],""),this.formatTime(C,I[1],""))}else if(!S&&C.indexOf(",")>-1&&C.indexOf("-")==-1&&C.indexOf("/")==-1&&!w.StringUtilities.containsAny(O,_.specialCharacters)){var j=C.split(",");b+=this.i18n.at();for(var F=0;F<j.length;F++)b&&(b+=" "),b+=this.formatTime(j[F],O,""),F<j.length-2&&(b+=","),F==j.length-2&&(b+=this.i18n.spaceAnd())}else{var U=this.getSecondsDescription(),$=this.getMinutesDescription(),J=this.getHoursDescription();if(b+=U,b&&$&&(b+=", "),b+=$,$===J)return b;b&&J&&(b+=", "),b+=J}return b},_.prototype.getSecondsDescription=function(){var S=this,O=this.getSegmentDescription(this.expressionParts[0],this.i18n.everySecond(),function(C){return C},function(C){return w.StringUtilities.format(S.i18n.everyX0Seconds(C),C)},function(C){return S.i18n.secondsX0ThroughX1PastTheMinute()},function(C){return C=="0"?"":parseInt(C)<20?S.i18n.atX0SecondsPastTheMinute(C):S.i18n.atX0SecondsPastTheMinuteGt20()||S.i18n.atX0SecondsPastTheMinute(C)});return O},_.prototype.getMinutesDescription=function(){var S=this,O=this.expressionParts[0],C=this.expressionParts[2],b=this.getSegmentDescription(this.expressionParts[1],this.i18n.everyMinute(),function(I){return I},function(I){return w.StringUtilities.format(S.i18n.everyX0Minutes(I),I)},function(I){return S.i18n.minutesX0ThroughX1PastTheHour()},function(I){var j,F;try{return I=="0"&&C.indexOf("/")==-1&&O==""?S.i18n.everyHour():I=="0"?((F=(j=S.i18n).onTheHour)===null||F===void 0?void 0:F.call(j))||S.i18n.atX0MinutesPastTheHour(I):parseInt(I)<20?S.i18n.atX0MinutesPastTheHour(I):S.i18n.atX0MinutesPastTheHourGt20()||S.i18n.atX0MinutesPastTheHour(I)}catch{return S.i18n.atX0MinutesPastTheHour(I)}});return b},_.prototype.getHoursDescription=function(){var S=this,O=this.expressionParts[2],C=0,b=[];O.split("/")[0].split(",").forEach(function(F){var U=F.split("-");U.length===2&&b.push({value:U[1],index:C+1}),C+=U.length});var I=0,j=this.getSegmentDescription(O,this.i18n.everyHour(),function(F){var U=b.find(function(J){return J.value===F&&J.index===I}),$=U&&S.expressionParts[1]!=="0";return I++,$?S.formatTime(F,"59",""):S.formatTime(F,"0","")},function(F){return w.StringUtilities.format(S.i18n.everyX0Hours(F),F)},function(F){return S.i18n.betweenX0AndX1()},function(F){return S.i18n.atX0()});return j},_.prototype.getDayOfWeekDescription=function(){var S=this,O=this.i18n.daysOfTheWeek(),C=null;return this.expressionParts[5]=="*"?C="":C=this.getSegmentDescription(this.expressionParts[5],this.i18n.commaEveryDay(),function(b,I){var j=b;b.indexOf("#")>-1?j=b.substring(0,b.indexOf("#")):b.indexOf("L")>-1&&(j=j.replace("L",""));var F=parseInt(j),U=S.i18n.daysOfTheWeekInCase?S.i18n.daysOfTheWeekInCase(I)[F]:O[F];if(b.indexOf("#")>-1){var $=null,J=b.substring(b.indexOf("#")+1),ne=b.substring(0,b.indexOf("#"));switch(J){case"1":$=S.i18n.first(ne);break;case"2":$=S.i18n.second(ne);break;case"3":$=S.i18n.third(ne);break;case"4":$=S.i18n.fourth(ne);break;case"5":$=S.i18n.fifth(ne);break}U=$+" "+U}return U},function(b){return parseInt(b)==1?"":w.StringUtilities.format(S.i18n.commaEveryX0DaysOfTheWeek(b),b)},function(b){var I=b.substring(0,b.indexOf("-")),j=S.expressionParts[3]!="*";return j?S.i18n.commaAndX0ThroughX1(I):S.i18n.commaX0ThroughX1(I)},function(b){var I=null;if(b.indexOf("#")>-1){var j=b.substring(b.indexOf("#")+1),F=b.substring(0,b.indexOf("#"));I=S.i18n.commaOnThe(j,F).trim()+S.i18n.spaceX0OfTheMonth()}else if(b.indexOf("L")>-1)I=S.i18n.commaOnTheLastX0OfTheMonth(b.replace("L",""));else{var U=S.expressionParts[3]!="*";U?S.options.logicalAndDayFields?I=S.i18n.commaOnlyOnX0(b):I=S.i18n.commaAndOnX0():I=S.i18n.commaOnlyOnX0(b)}return I}),C},_.prototype.getMonthDescription=function(){var S=this,O=this.i18n.monthsOfTheYear(),C=this.getSegmentDescription(this.expressionParts[4],"",function(b,I){return I&&S.i18n.monthsOfTheYearInCase?S.i18n.monthsOfTheYearInCase(I)[parseInt(b)-1]:O[parseInt(b)-1]},function(b){return parseInt(b)==1?"":w.StringUtilities.format(S.i18n.commaEveryX0Months(b),b)},function(b){return S.i18n.commaMonthX0ThroughMonthX1()||S.i18n.commaX0ThroughX1()},function(b){return S.i18n.commaOnlyInMonthX0?S.i18n.commaOnlyInMonthX0():S.i18n.commaOnlyInX0()});return C},_.prototype.getDayOfMonthDescription=function(){var S=this,O=null,C=this.expressionParts[3];switch(C){case"L":O=this.i18n.commaOnTheLastDayOfTheMonth();break;case"WL":case"LW":O=this.i18n.commaOnTheLastWeekdayOfTheMonth();break;default:var b=C.match(/(\d{1,2}W)|(W\d{1,2})/);if(b){var I=parseInt(b[0].replace("W","")),j=I==1?this.i18n.firstWeekday():w.StringUtilities.format(this.i18n.weekdayNearestDayX0(),I.toString());O=w.StringUtilities.format(this.i18n.commaOnTheX0OfTheMonth(),j);break}else{var F=C.match(/L-(\d{1,2})/);if(F){var U=F[1];O=w.StringUtilities.format(this.i18n.commaDaysBeforeTheLastDayOfTheMonth(U),U);break}else{if(C=="*"&&this.expressionParts[5]!="*")return"";O=this.getSegmentDescription(C,this.i18n.commaEveryDay(),function($){return $=="L"?S.i18n.lastDay():S.i18n.dayX0?w.StringUtilities.format(S.i18n.dayX0(),$):$},function($){return $=="1"?S.i18n.commaEveryDay():S.i18n.commaEveryX0Days($)},function($){return S.i18n.commaBetweenDayX0AndX1OfTheMonth($)},function($){return S.i18n.commaOnDayX0OfTheMonth($)})}break}}return O},_.prototype.getYearDescription=function(){var S=this,O=this.getSegmentDescription(this.expressionParts[6],"",function(C){return/^\d+$/.test(C)?new Date(parseInt(C),1).getFullYear().toString():C},function(C){return w.StringUtilities.format(S.i18n.commaEveryX0Years(C),C)},function(C){return S.i18n.commaYearX0ThroughYearX1()||S.i18n.commaX0ThroughX1()},function(C){return S.i18n.commaOnlyInYearX0?S.i18n.commaOnlyInYearX0():S.i18n.commaOnlyInX0()});return O},_.prototype.getSegmentDescription=function(S,O,C,b,I,j){var F=null,U=S.indexOf("/")>-1,$=S.indexOf("-")>-1,J=S.indexOf(",")>-1;if(!S)F="";else if(S==="*")F=O;else if(!U&&!$&&!J)F=w.StringUtilities.format(j(S),C(S));else if(J){for(var ne=S.split(","),he="",ye=this.i18n.spaceAnd(),ke=0;ke<ne.length;ke++)if(ke>0&&ne.length>2&&(he+=",",ke<ne.length-1&&(he+=" ")),ke>0&&ne.length>1&&(ke==ne.length-1||ne.length==2)&&(he+=ye==","&&ne.length>2?" ":"".concat(ye," ")),ne[ke].indexOf("/")>-1||ne[ke].indexOf("-")>-1){var pe=ne[ke].indexOf("-")>-1&&ne[ke].indexOf("/")==-1,ge=this.getSegmentDescription(ne[ke],O,C,b,pe?this.i18n.commaX0ThroughX1:I,j);pe&&(ge=ge.replace(", ","")),he+=ge}else if(!U)he+=C(ne[ke]);else{var fe=this.getSegmentDescription(ne[ke],O,C,b,I,j);fe&&fe.startsWith(", ")&&(fe=fe.substring(2)),he+=fe}U?F=he:F=w.StringUtilities.format(j(S),he)}else if(U){var ne=S.split("/");if(F=w.StringUtilities.format(b(ne[1]),ne[1]),ne[0].indexOf("-")>-1){var Ee=this.generateRangeSegmentDescription(ne[0],I,C);Ee.indexOf(", ")!=0&&(F+=", "),F+=Ee}else if(ne[0].indexOf("*")==-1){var Ce=w.StringUtilities.format(j(ne[0]),C(ne[0]));Ce=Ce.replace(", ",""),F+=w.StringUtilities.format(this.i18n.commaStartingX0(),Ce)}}else $&&(F=this.generateRangeSegmentDescription(S,I,C));return F},_.prototype.generateRangeSegmentDescription=function(S,O,C){var b="",I=S.split("-"),j=C(I[0],1),F=C(I[1],2),U=O(S);return b+=w.StringUtilities.format(U,j,F),b},_.prototype.formatTime=function(S,O,C){var b=0,I=0,j=parseInt(S)+b,F=parseInt(O)+I;F>=60?(F-=60,j+=1):F<0&&(F+=60,j-=1),j>=24?j=j-24:j<0&&(j=24+j);var U="",$=!1;this.options.use24HourTimeFormat||($=!!(this.i18n.setPeriodBeforeTime&&this.i18n.setPeriodBeforeTime()),U=$?"".concat(this.getPeriod(j)," "):" ".concat(this.getPeriod(j)),j>12&&(j-=12),j===0&&(j=12));var J="";C&&(J=":".concat(("00"+C).substring(C.length)));var ne=j.toString(),he=("00"+ne).substring(ne.length),ye=F.toString(),ke=("00"+ye).substring(ye.length),pe=this.options.trimHoursLeadingZero?ne:he;return"".concat($?U:"").concat(pe,":").concat(ke).concat(J).concat($?"":U)},_.prototype.transformVerbosity=function(S,O){if(!O&&(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 C=0,b=Object.entries(this.i18n.conciseVerbosityReplacements());C<b.length;C++){var I=b[C],j=I[0],F=I[1];S=S.replace(new RegExp(j,"g"),F)}return S},_.prototype.getPeriod=function(S){return S>=12?this.i18n.pm&&this.i18n.pm()||"PM":this.i18n.am&&this.i18n.am()||"AM"},_.locales={},_})();y.ExpressionDescriptor=E},747(h,y,x){Object.defineProperty(y,"__esModule",{value:!0}),y.enLocaleLoader=void 0;var w=x(486),T=(function(){function E(){}return E.prototype.load=function(_){_.en=new w.en},E})();y.enLocaleLoader=T},486(h,y){Object.defineProperty(y,"__esModule",{value:!0}),y.en=void 0;var x=(function(){function w(){}return w.prototype.atX0SecondsPastTheMinuteGt20=function(){return null},w.prototype.atX0MinutesPastTheHourGt20=function(){return null},w.prototype.commaMonthX0ThroughMonthX1=function(){return null},w.prototype.commaYearX0ThroughYearX1=function(){return null},w.prototype.use24HourTimeFormatByDefault=function(){return!1},w.prototype.anErrorOccuredWhenGeneratingTheExpressionD=function(){return"An error occurred when generating the expression description. Check the cron expression syntax."},w.prototype.everyMinute=function(){return"every minute"},w.prototype.everyHour=function(){return"every hour"},w.prototype.atSpace=function(){return"At "},w.prototype.everyMinuteBetweenX0AndX1=function(){return"Every minute between %s and %s"},w.prototype.at=function(){return"At"},w.prototype.spaceAnd=function(){return" and"},w.prototype.everySecond=function(){return"every second"},w.prototype.everyX0Seconds=function(){return"every %s seconds"},w.prototype.secondsX0ThroughX1PastTheMinute=function(){return"seconds %s through %s past the minute"},w.prototype.atX0SecondsPastTheMinute=function(){return"at %s seconds past the minute"},w.prototype.everyX0Minutes=function(){return"every %s minutes"},w.prototype.minutesX0ThroughX1PastTheHour=function(){return"minutes %s through %s past the hour"},w.prototype.atX0MinutesPastTheHour=function(){return"at %s minutes past the hour"},w.prototype.everyX0Hours=function(){return"every %s hours"},w.prototype.betweenX0AndX1=function(){return"between %s and %s"},w.prototype.atX0=function(){return"at %s"},w.prototype.commaEveryDay=function(){return", every day"},w.prototype.commaEveryX0DaysOfTheWeek=function(){return", every %s days of the week"},w.prototype.commaX0ThroughX1=function(){return", %s through %s"},w.prototype.commaAndX0ThroughX1=function(){return", %s through %s"},w.prototype.first=function(){return"first"},w.prototype.second=function(){return"second"},w.prototype.third=function(){return"third"},w.prototype.fourth=function(){return"fourth"},w.prototype.fifth=function(){return"fifth"},w.prototype.commaOnThe=function(){return", on the "},w.prototype.spaceX0OfTheMonth=function(){return" %s of the month"},w.prototype.lastDay=function(){return"the last day"},w.prototype.commaOnTheLastX0OfTheMonth=function(){return", on the last %s of the month"},w.prototype.commaOnlyOnX0=function(){return", only on %s"},w.prototype.commaAndOnX0=function(){return", and on %s"},w.prototype.commaEveryX0Months=function(){return", every %s months"},w.prototype.commaOnlyInX0=function(){return", only in %s"},w.prototype.commaOnTheLastDayOfTheMonth=function(){return", on the last day of the month"},w.prototype.commaOnTheLastWeekdayOfTheMonth=function(){return", on the last weekday of the month"},w.prototype.commaDaysBeforeTheLastDayOfTheMonth=function(){return", %s days before the last day of the month"},w.prototype.firstWeekday=function(){return"first weekday"},w.prototype.weekdayNearestDayX0=function(){return"weekday nearest day %s"},w.prototype.commaOnTheX0OfTheMonth=function(){return", on the %s of the month"},w.prototype.commaEveryX0Days=function(){return", every %s days in a month"},w.prototype.commaBetweenDayX0AndX1OfTheMonth=function(){return", between day %s and %s of the month"},w.prototype.commaOnDayX0OfTheMonth=function(){return", on day %s of the month"},w.prototype.commaEveryHour=function(){return", every hour"},w.prototype.commaEveryX0Years=function(){return", every %s years"},w.prototype.commaStartingX0=function(){return", starting %s"},w.prototype.daysOfTheWeek=function(){return["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"]},w.prototype.monthsOfTheYear=function(){return["January","February","March","April","May","June","July","August","September","October","November","December"]},w.prototype.atReboot=function(){return"Run once, at startup"},w.prototype.onTheHour=function(){return"on the hour"},w})();y.en=x},515(h,y){Object.defineProperty(y,"__esModule",{value:!0});function x(T,E){if(!T)throw new Error(E)}var w=(function(){function T(){}return T.secondRange=function(E){for(var _=E.split(","),S=0;S<_.length;S++)if(!isNaN(parseInt(_[S],10))){var O=parseInt(_[S],10);x(O>=0&&O<=59,"seconds part must be >= 0 and <= 59")}},T.minuteRange=function(E){for(var _=E.split(","),S=0;S<_.length;S++)if(!isNaN(parseInt(_[S],10))){var O=parseInt(_[S],10);x(O>=0&&O<=59,"minutes part must be >= 0 and <= 59")}},T.hourRange=function(E){for(var _=E.split(","),S=0;S<_.length;S++)if(!isNaN(parseInt(_[S],10))){var O=parseInt(_[S],10);x(O>=0&&O<=23,"hours part must be >= 0 and <= 23")}},T.dayOfMonthRange=function(E){for(var _=E.split(","),S=0;S<_.length;S++)if(!isNaN(parseInt(_[S],10))){var O=parseInt(_[S],10);x(O>=1&&O<=31,"DOM part must be >= 1 and <= 31")}},T.monthRange=function(E,_){for(var S=E.split(","),O=0;O<S.length;O++)if(!isNaN(parseInt(S[O],10))){var C=parseInt(S[O],10);x(C>=1&&C<=12,_?"month part must be >= 0 and <= 11":"month part must be >= 1 and <= 12")}},T.dayOfWeekRange=function(E,_){for(var S=E.split(","),O=0;O<S.length;O++)if(!isNaN(parseInt(S[O],10))){var C=parseInt(S[O],10);x(C>=0&&C<=6,_?"DOW part must be >= 0 and <= 6":"DOW part must be >= 1 and <= 7")}},T})();y.default=w},823(h,y){Object.defineProperty(y,"__esModule",{value:!0}),y.StringUtilities=void 0;var x=(function(){function w(){}return w.format=function(T){for(var E=[],_=1;_<arguments.length;_++)E[_-1]=arguments[_];return T.replace(/%s/g,function(S){return E.shift()})},w.containsAny=function(T,E){return E.some(function(_){return T.indexOf(_)>-1})},w})();y.StringUtilities=x}},a={};function l(h){var y=a[h];if(y!==void 0)return y.exports;var x=a[h]={exports:{}};return s[h](x,x.exports,l),x.exports}var c={};return(()=>{var h=c;Object.defineProperty(h,"__esModule",{value:!0}),h.toString=void 0;var y=l(333),x=l(747);y.ExpressionDescriptor.initialize(new x.enLocaleLoader),h.default=y.ExpressionDescriptor;var w=y.ExpressionDescriptor.toString;h.toString=w})(),c})())})(Pf)),Pf.exports}var SS=wS();function Ph(t){const n=t.trim();if(n===""||n.startsWith("@"))return n;const s=n.split(/\s+/);return s.length===7?s.slice(1,6).join(" "):n}function kS(t){if(t.trim()==="")return[!1,"— enter a cron expression —"];try{return[!0,SS.toString(Ph(t),{throwExceptionOnParseError:!0})]}catch{return[!1,"Invalid cron expression"]}}function Oo(t){if(t===0)return"—";const n=Math.floor(Date.now()/1e3),s=Math.max(0,n-t);return s<60?"just now":s<3600?`${Math.floor(s/60)}m ago`:s<86400?`${Math.floor(s/3600)}h ago`:`${Math.floor(s/86400)}d ago`}const _S=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function Kl(t,n){const s=Ph(t);if(s!=="")try{return qg.parseExpression(s,{currentDate:n})}catch{return}}function Ao(t,n){const s=Kl(t,n);if(s!=null&&s.hasNext())return s.next().toDate()}function NS(t,n,s){const a=Kl(t,n);if(!a)return[];const l=[];for(;l.length<s&&a.hasNext();)l.push(a.next().toDate());return l}function Uh(t,n,s){const a=Ao(t,n);return a!==void 0&&a.getTime()-n.getTime()<=s}function Wc(t,n){const s=Math.floor((n.getTime()-t.getTime())/1e3);if(s<=0)return"now";const a=Math.floor(s/60);if(a<1)return"in <1m";if(a<60)return`in ${a}m`;const l=Math.floor(a/60);if(l<24){const h=a%60;return h===0?`in ${l}h`:`in ${l}h ${h}m`}return`in ${Math.floor(l/24)}d`}function ks(t){return new Date(t.getFullYear(),t.getMonth(),t.getDate())}function Vh(t,n){const s=`${String(n.getHours()).padStart(2,"0")}:${String(n.getMinutes()).padStart(2,"0")}`,a=Math.round((ks(n).getTime()-ks(t).getTime())/864e5);return a===0?s:a===1?`tomorrow ${s}`:`${_S[n.getMonth()]} ${n.getDate()}, ${s}`}const Xl=["SUN","MON","TUE","WED","THU","FRI","SAT"],zh=["JANUARY","FEBRUARY","MARCH","APRIL","MAY","JUNE","JULY","AUGUST","SEPTEMBER","OCTOBER","NOVEMBER","DECEMBER"],ph=42,ES=4e3;function TS(t,n){const s=t.getFullYear()*12+t.getMonth()+n,a=Math.floor(s/12),l=(s%12+12)%12;return new Date(a,l,1)}function CS(t,n){const s=new Date(n.getTime()-1e3),a=Kl(t,s);if(!a)return;const l=new Array(ph).fill(0),c=ks(n).getTime();for(let h=0;h<ES&&a.hasNext();h++){const y=a.next().toDate(),x=Math.floor((ks(y).getTime()-c)/864e5);if(!(x<0)){if(x>=ph)break;l[x]=(l[x]??0)+1}}return l}const Qg=36e5,OS=8,hy={dormant:0,"dead-schedule":1,"agent-unregistered":2,"has-open-flags":3},bS={dormant:"DORMANT","dead-schedule":"DEAD SCHEDULE","agent-unregistered":"AGENT MISSING","has-open-flags":"OPEN FLAGS"},jS={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 Yg(t,n){return t<n?-1:t>n?1:0}function DS(t,n){if(t.enabled){if(t.machinesEmpty)return"dormant";if(Ao(t.schedule,n)===void 0)return"dead-schedule";if(t.agentRegistered===!1)return"agent-unregistered";if(t.flagCount>0)return"has-open-flags"}}function Gg(t,n){const s=[];for(const a of t){const l=DS(a,n);l!==void 0&&s.push({kind:a.kind,label:a.label,reason:l,flagCount:a.flagCount})}return s.sort((a,l)=>hy[a.reason]-hy[l.reason]||Yg(a.label,l.label)),s}function RS(t,n){const s=t.length,a=t.filter(x=>x.enabled).length,l=t.filter(x=>x.enabled&&!x.snoozed&&Uh(x.schedule,n,Qg)).length,c=t.reduce((x,w)=>x+w.flagCount,0),h=t.filter(x=>x.enabled&&x.snoozed).length,y=t.filter(x=>x.enabled&&x.machinesEmpty).length;return{total:s,enabled:a,disabled:s-a,dueSoon:l,attention:Gg(t,n).length,flags:c,snoozed:h,dormant:y}}function MS(t,n){const s=[];for(const a of t){if(!a.enabled||a.snoozed)continue;const l=Ao(a.schedule,n);l!==void 0&&s.push({kind:a.kind,id:a.id,label:a.label,human:a.human,schedule:a.schedule,at:l,soon:l.getTime()-n.getTime()<=Qg,flagCount:a.flagCount})}return s.sort((a,l)=>a.at.getTime()-l.at.getTime()||Yg(a.label,l.label)),s.slice(0,OS)}function IS(t,n){return t[0]===void 0?void 0:Wc(n,t[0].at)}function LS(t){return(t??[]).every(n=>n.trim()==="")}function FS(t,n){const s=t.snoozed_until!=null&&t.snoozed_until>Math.floor(n.getTime()/1e3),a=t.skip_runs!=null&&t.skip_runs>0;return s||a}function AS(t,n){return{kind:"routine",id:t.id,label:t.title,schedule:t.schedule,human:t.schedule_description??void 0,enabled:t.enabled,machinesEmpty:LS(t.machines),agentRegistered:t.agent_registered,flagCount:t.flag_count,snoozed:FS(t,n)}}function PS(t,n){return t.map(s=>AS(s,n))}function US({items:t}){return d.jsx("div",{className:"table-wrap attn-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"TYPE"}),d.jsx("th",{children:"NAME"}),d.jsx("th",{children:"ISSUE"}),d.jsx("th",{children:"DETAIL"})]})}),d.jsx("tbody",{children:t.map((n,s)=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("span",{className:"kind-badge routine",children:"ROUTINE"})}),d.jsx("td",{children:d.jsx(Ac,{className:"ov-name-link",to:"/routines",children:n.label})}),d.jsx("td",{children:d.jsx("span",{className:"attn-badge",children:bS[n.reason]})}),d.jsx("td",{className:"attn-detail",children:n.reason==="has-open-flags"&&n.flagCount>0?`${n.flagCount} open flag${n.flagCount===1?"":"s"} — needs review`:jS[n.reason]})]},s))})]})})}function VS({kpis:t,nextRun:n}){return d.jsxs("div",{className:"stats",children:[d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"SCHEDULED"}),d.jsx("div",{className:"stat-val",children:t.total})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"ENABLED"}),d.jsx("div",{className:"stat-val c-accent",children:t.enabled})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"DUE SOON"}),d.jsx("div",{className:"stat-val c-red",children:t.dueSoon})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"ATTENTION"}),d.jsx("div",{className:`stat-val ${t.attention>0?"c-red":"c-accent"}`,children:t.attention})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"DISABLED"}),d.jsx("div",{className:"stat-val c-amber",children:t.disabled})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"DORMANT"}),d.jsx("div",{className:`stat-val ${t.dormant>0?"c-amber":""}`,children:t.dormant})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"FLAGS"}),d.jsx("div",{className:`stat-val ${t.flags>0?"c-red":"c-accent"}`,children:t.flags})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"SNOOZED"}),d.jsx("div",{className:`stat-val ${t.snoozed>0?"c-amber":"c-accent"}`,children:t.snoozed})]}),d.jsxs("div",{className:"stat-card stat-card-wide",children:[d.jsx("div",{className:"stat-label",children:"NEXT RUN"}),d.jsx("div",{className:"stat-val stat-val-sm",children:n??"—"})]})]})}function Kg(t){return`run-status ${t}`}function $h(t){switch(t){case"running":return"RUNNING";case"success":return"SUCCESS";case"failed":return"FAILED";default:return"UNKNOWN"}}function Xg(t,n){const s=Math.max(0,n-t);return s<60?`${s}s`:s<3600?`${Math.floor(s/60)}m`:`${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`}function zS(t,n){if(t>=n)return"expired";const s=n-t;return s<60?"expires in <1m":s<3600?`expires in ${Math.floor(s/60)}m`:`expires in ${Math.floor(s/3600)}h ${Math.floor(s%3600/60)}m`}function $S({runs:t,loading:n}){return n?d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})}):t.length===0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⧗"}),d.jsx("div",{className:"empty-msg",children:"NO RUNS YET"})]})}):d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"ROUTINE"}),d.jsx("th",{children:"STARTED"}),d.jsx("th",{children:"DURATION"}),d.jsx("th",{children:"STATUS"}),d.jsx("th",{children:"EXIT CODE"})]})}),d.jsx("tbody",{children:t.map(s=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx(Ac,{to:`/routines?history=${encodeURIComponent(s.routine_id)}`,children:s.routine_title})}),d.jsx("td",{children:d.jsx("div",{className:"cell-time",children:Oo(s.started_at)})}),d.jsx("td",{children:d.jsx("span",{className:"cell-meta",children:s.finished_at==null?"—":Xg(s.started_at,s.finished_at)})}),d.jsx("td",{children:d.jsx("span",{className:Kg(s.status),children:$h(s.status)})}),d.jsx("td",{children:s.exit_code==null?"—":s.exit_code})]},s.workbench))})]})})}function WS({runs:t,now:n,loading:s,error:a,onTrigger:l}){return a!==void 0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⚠"}),d.jsx("div",{className:"empty-msg",children:"FAILED TO LOAD"}),d.jsx("div",{className:"empty-sub",children:a})]})}):s?d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})}):t.length===0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"◷"}),d.jsx("div",{className:"empty-msg",children:"NO UPCOMING RUNS"}),d.jsx("div",{className:"empty-sub",children:"no enabled routine is scheduled to fire"})]})}):d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"TYPE"}),d.jsx("th",{children:"NAME"}),d.jsx("th",{children:"SCHEDULE"}),d.jsx("th",{children:"NEXT RUN"}),d.jsx("th",{})]})}),d.jsx("tbody",{children:t.map((c,h)=>d.jsxs("tr",{children:[d.jsx("td",{children:d.jsx("span",{className:"kind-badge routine",children:"ROUTINE"})}),d.jsxs("td",{children:[d.jsx(Ac,{className:"ov-name-link",to:"/routines",children:c.label}),c.flagCount>0&&d.jsx("span",{className:"ov-flag-badge",title:`${c.flagCount} open flag${c.flagCount===1?"":"s"}`,children:`⚑ ${c.flagCount}`})]}),d.jsx("td",{children:d.jsx("div",{className:"cell-schedule-human",children:c.human??c.schedule})}),d.jsxs("td",{className:"cell-next",children:[d.jsx("div",{className:"cell-next-when",children:Vh(n,c.at)}),d.jsx("div",{className:c.soon?"cell-next-until soon":"cell-next-until",children:Wc(n,c.at)})]}),d.jsx("td",{className:"cell-act",children:d.jsx("button",{className:"btn btn-sm btn-ghost run-now-btn",title:"Trigger now",onClick:()=>l(c.id),children:"▶ RUN"})})]},h))})]})})}const HS=8,BS=1e4;function ZS(){const t=zn(),{addToast:n}=Fo(),s=Fh(),a=Vg(HS),l=Pg(),c=Ug(),h=Ag(),[y,x]=Z.useState(()=>new Date),[w,T]=Z.useState(Vc);Z.useEffect(()=>{const $=setInterval(()=>x(new Date),BS);return()=>clearInterval($)},[]),Z.useEffect(()=>{const $=Uc(w);if($===void 0)return;const J=setInterval(()=>{t.invalidateQueries({queryKey:["routines"]})},$);return()=>clearInterval(J)},[w,t]);const E=Z.useCallback($=>{zc($),T($)},[]),_=Z.useCallback($=>{h.mutate($,{onSuccess:()=>n("Triggered","ok"),onError:J=>n(`Trigger failed: ${J instanceof Error?J.message:String(J)}`,"err")})},[h,n]),S=Z.useCallback(()=>{c.mutate("all")},[c]),O=PS(s.data??[],y),C=RS(O,y),b=Gg(O,y),I=MS(O,y),j=IS(I,y),F=Math.max(s.dataUpdatedAt,a.dataUpdatedAt,l.dataUpdatedAt),U=s.error instanceof Error?s.error.message:void 0;return d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Overview"}),d.jsx(Hg,{status:l.data,onUnlock:S}),d.jsx(VS,{kpis:C,nextRun:j}),b.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"section-hd",children:d.jsx("span",{className:"section-label attn",children:"NEEDS ATTENTION"})}),d.jsx(US,{items:b})]}),d.jsxs("div",{className:"section-hd",children:[d.jsx("span",{className:"section-label",children:"UPCOMING RUNS"}),d.jsx("div",{className:"section-acts",children:d.jsx($c,{token:w,updatedAtMs:F,onChange:E})})]}),d.jsx(WS,{runs:I,now:y,loading:s.isLoading,error:U,onTrigger:_}),d.jsx("div",{className:"section-hd",children:d.jsx("span",{className:"section-label",children:"RECENT RUNS"})}),d.jsx($S,{runs:a.data??[],loading:a.isLoading})]})}function qS({count:t,onEnable:n,onDisable:s,onDelete:a,onClear:l}){return t===0?null:d.jsxs("div",{className:"bulk-bar",children:[d.jsxs("span",{className:"bulk-count",children:[t," SELECTED"]}),d.jsxs("div",{className:"bulk-acts",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:n,children:"ENABLE"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:s,children:"DISABLE"}),d.jsx("button",{type:"button",className:"btn btn-danger btn-sm",onClick:a,children:"DELETE"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:l,children:"CLEAR"})]})]})}function QS({count:t,onCancel:n,onConfirm:s}){return d.jsx("div",{className:"overlay",onClick:n,children:d.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true",onClick:a=>a.stopPropagation(),children:[d.jsx("div",{className:"dialog-title",children:"⚠ DELETE ROUTINES"}),d.jsxs("div",{className:"dialog-msg",children:["Delete ",t," selected routine",t===1?"":"s","? This cannot be undone."]}),d.jsxs("div",{className:"dialog-actions",children:[d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:n,children:"Cancel"}),d.jsx("button",{type:"button",className:"btn btn-danger",onClick:s,children:"Delete"})]})]})})}function YS({title:t,onCancel:n,onConfirm:s}){return d.jsx("div",{className:"overlay",onClick:n,children:d.jsxs("div",{className:"dialog",role:"dialog","aria-modal":"true",onClick:a=>a.stopPropagation(),children:[d.jsx("div",{className:"dialog-title",children:"⚠ DELETE ROUTINE"}),d.jsxs("div",{className:"dialog-msg",children:['Delete the routine "',t,'"? This cannot be undone.']}),d.jsxs("div",{className:"dialog-actions",children:[d.jsx("button",{type:"button",className:"btn btn-ghost",onClick:n,children:"Cancel"}),d.jsx("button",{type:"button",className:"btn btn-danger",onClick:s,children:"Delete"})]})]})})}const my=["B","KB","MB","GB","TB"];function GS(t){if(t<1024)return`${t} B`;let n=t,s=0;for(;n>=1024&&s<my.length-1;)n/=1024,s++;return`${n.toFixed(1)} ${my[s]}`}const KS=2e3,pc=[40,140,300,600],XS=zh.map(t=>t.slice(0,3));function Jg(t){const n=new Date(t);return n.setHours(0,0,0,0),n}function JS(t,n){const s=Ph(t);if(s==="")return[];const a=Jg(n),l=new Date(a);l.setDate(l.getDate()+1);let c;try{c=qg.parseExpression(s,{currentDate:new Date(a.getTime()-1e3)})}catch{return[]}const h=[];for(let y=0;y<KS&&c.hasNext();y++){const x=c.next().toDate();if(x>=l)break;x>=a&&h.push(x)}return h}function e1({items:t,loading:n,onClick:s}){var b;const[a,l]=Z.useState(0),[c,h]=Z.useState(0),y=Z.useRef(null);if(Z.useEffect(()=>{var I;(I=y.current)==null||I.scrollIntoView({block:"center"})},[a,c]),n)return d.jsx("div",{className:"day-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})});const x=Jg(new Date),w=new Date(x);w.setDate(w.getDate()+a);const T=a===0?new Date().getHours():-1,E=Array.from({length:24},()=>[]);let _=0;for(const I of t)for(const j of JS(I.schedule,w))(b=E[j.getHours()])==null||b.push({time:j,label:I.label,id:I.id,snoozed:I.snoozed,flagCount:I.flagCount}),_++;for(const I of E)I.sort((j,F)=>j.time.getTime()-F.time.getTime());const S=`${Xl[w.getDay()]} · ${XS[w.getMonth()]} ${w.getDate()} ${w.getFullYear()}`,O=c>0,C=pc[c]??pc[0];return d.jsxs("div",{className:"day-wrap",children:[d.jsxs("div",{className:"day-nav",children:[d.jsx("button",{type:"button",className:"btn-refresh",title:"Previous day","aria-label":"Previous day",onClick:()=>l(I=>I-1),children:"‹"}),d.jsx("div",{className:"day-date",children:S}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Next day","aria-label":"Next day",onClick:()=>l(I=>I+1),children:"›"}),d.jsxs("div",{className:"day-zoom",children:[d.jsx("button",{type:"button",className:"btn-refresh",title:"Zoom out","aria-label":"Zoom out",disabled:c===0,onClick:()=>h(I=>Math.max(0,I-1)),children:"−"}),d.jsxs("span",{className:"day-zoom-level",children:[c+1,"×"]}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Zoom into the hour","aria-label":"Zoom in",disabled:c===pc.length-1,onClick:()=>h(I=>Math.min(pc.length-1,I+1)),children:"+"})]}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>l(0),children:"TODAY"})]}),_===0?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"🗓"}),d.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"no fire times on this day"})]}):d.jsx("div",{className:O?"day-scroll detail":"day-scroll",style:{"--dh":`${C}px`},children:E.map((I,j)=>d.jsxs("div",{className:j===T?"day-hour now":"day-hour",ref:j===T?y:void 0,children:[O?d.jsxs("div",{className:"day-hour-label",children:[d.jsxs("span",{children:[String(j).padStart(2,"0"),":00"]}),d.jsxs("span",{className:"qt",children:[String(j).padStart(2,"0"),":15"]}),d.jsxs("span",{className:"qt",children:[String(j).padStart(2,"0"),":30"]}),d.jsxs("span",{className:"qt",children:[String(j).padStart(2,"0"),":45"]}),d.jsx("span",{className:"qt-end"})]}):d.jsxs("div",{className:"day-hour-label",children:[String(j).padStart(2,"0"),":00"]}),d.jsx("div",{className:"day-hour-slot",children:I.map((F,U)=>{const $=(F.time.getMinutes()+F.time.getSeconds()/60)/60,J=O?{top:`${($*100).toFixed(3)}%`}:void 0;let ne="day-chip";return s&&F.id&&(ne+=" clickable"),F.snoozed&&(ne+=" snoozed"),d.jsxs("div",{className:ne,style:J,title:F.label,onClick:()=>F.id&&(s==null?void 0:s(F.id)),children:[d.jsxs("span",{className:"day-chip-time",children:[String(F.time.getHours()).padStart(2,"0"),":",String(F.time.getMinutes()).padStart(2,"0")]}),d.jsx("span",{className:"day-chip-label",children:F.label}),F.flagCount>0&&d.jsxs("span",{className:"day-chip-flag",children:["⚑",F.flagCount]})]},U)})})]},j))})]})}const Wh=36e5,t1=["all","enabled","disabled","dormant","due","snoozed","flagged","agent-unreg"];function ev(t){return t1.includes(t)?t:"all"}const tv="\0all";function ys(t){return t.kind==="all"?tv:t.value}function co(t){return t===tv?{kind:"all"}:{kind:"named",value:t}}const nv="\0any",rv="\0unassigned";function xc(t){switch(t.kind){case"any":return nv;case"unassigned":return rv;case"machine":return t.value}}function sv(t){return t===nv?{kind:"any"}:t===rv?{kind:"unassigned"}:{kind:"machine",value:t}}function Uf(){return{query:"",status:"all",agent:{kind:"all"},machine:{kind:"any"},repository:{kind:"all"},tag:{kind:"all"}}}function iv(t){return t.query.trim()!==""||t.status!=="all"||t.agent.kind!=="all"||t.machine.kind!=="any"||t.repository.kind!=="all"||t.tag.kind!=="all"}function n1(t,n,s,a){const l=n.machines??[];switch(t.status){case"enabled":if(!n.enabled)return!1;break;case"disabled":if(n.enabled)return!1;break;case"dormant":if(!(n.enabled&&l.length===0))return!1;break;case"due":if(!(n.enabled&&Uh(n.schedule,s,a)))return!1;break;case"snoozed":if(!ka(n,s))return!1;break;case"flagged":if((n.flag_count??0)===0)return!1;break;case"agent-unreg":if(n.agent_registered)return!1;break}if(t.agent.kind==="named"&&n.agent!==t.agent.value||t.machine.kind==="unassigned"&&l.length>0||t.machine.kind==="machine"&&!l.includes(t.machine.value))return!1;const c=t.repository;if(c.kind==="named"&&!(n.repositories??[]).some(y=>y.repository===c.value)||t.tag.kind==="named"&&!(n.tags??[]).includes(t.tag.value))return!1;const h=t.query.trim().toLowerCase();if(h!==""){const y=(n.repositories??[]).map(E=>E.repository.toLowerCase()).join(" "),x=(n.schedule_description??"").toLowerCase(),w=(n.tags??[]).map(E=>E.toLowerCase()).join(" ");if(![n.title.toLowerCase(),n.agent.toLowerCase(),n.schedule.toLowerCase(),y,x,w].join(" ").includes(h))return!1}return!0}function r1(t,n,s,a){return t.filter(l=>n1(n,l,s,a))}function yh(t){const n=t.last_manual_trigger_at??void 0,s=t.last_scheduled_trigger_at??void 0;return n===void 0?s:s===void 0?n:Math.max(n,s)}function py(t){switch(t){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 gh(t){switch(t){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 s1(t){switch(t){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 ka(t,n){const s=t.snoozed_until;return s!=null&&s*1e3>n.getTime()?!0:(t.skip_runs??0)>0}function i1(t,n){const s=t.snoozed_until;if(s!=null){const l=s*1e3;if(l>n.getTime()){const c=Math.floor((l-n.getTime())/1e3);return c<3600?`${Math.floor(c/60)}m left`:c<86400?`${Math.floor(c/3600)}h left`:`${Math.floor(c/86400)}d left`}}const a=t.skip_runs;return a!=null&&a>0?`${a} run${a===1?"":"s"} skipped`:""}function Ec(t,n){return t.enabled?t.power_saving?"power-saving":(t.machines??[]).every(a=>a.trim()==="")?"dormant":Ao(t.schedule,n)===void 0?"dead-schedule":t.agent_registered?ka(t,n)?"snoozed":"healthy":"agent-missing":"disabled"}function a1(t){return t.enabled?t.power_saving?"Routine is in power-saving mode":"Run now":"Routine is disabled"}function o1(t){return[...new Set(t.map(n=>n.agent))].sort()}function l1(t){return[...new Set(t.flatMap(n=>n.machines??[]))].sort()}function u1(t){return[...new Set(t.flatMap(n=>(n.repositories??[]).map(s=>s.repository)))].sort()}function c1(t){return[...new Set(t.flatMap(n=>n.tags??[]))].sort()}const d1=[["all","All"],["enabled","Enabled"],["disabled","Disabled"],["dormant","Dormant"],["due","Due soon"],["snoozed","Snoozed"],["flagged","Flagged"],["agent-unreg","Agent unregistered"]];function f1({filter:t,agents:n,machines:s,repositories:a,tags:l,shown:c,total:h,searchRef:y,onQuery:x,onStatus:w,onAgent:T,onMachine:E,onRepository:_,onTag:S,onClear:O}){return d.jsxs("div",{className:"filter-bar",children:[d.jsxs("div",{className:"filter-field",children:[d.jsx("input",{ref:y,type:"text",className:"filter-input",placeholder:"Search routines… ( / )","aria-label":"Search routines",value:t.query,onChange:C=>x(C.target.value)}),d.jsx("span",{className:"filter-label",children:"STATUS"}),d.jsx("select",{className:"filter-select","aria-label":"Status filter",value:t.status,onChange:C=>w(ev(C.target.value)),children:d1.map(([C,b])=>d.jsx("option",{value:C,children:b},C))}),d.jsx("span",{className:"filter-label",children:"AGENT"}),d.jsxs("select",{className:"filter-select","aria-label":"Agent filter",value:ys(t.agent),onChange:C=>T(co(C.target.value)),children:[d.jsx("option",{value:ys({kind:"all"}),children:"Any"}),n.map(C=>d.jsx("option",{value:C,children:C},C))]}),d.jsx("span",{className:"filter-label",children:"MACHINE"}),d.jsxs("select",{className:"filter-select","aria-label":"Machine filter",value:xc(t.machine),onChange:C=>E(sv(C.target.value)),children:[d.jsx("option",{value:xc({kind:"any"}),children:"Any"}),d.jsx("option",{value:xc({kind:"unassigned"}),children:"None"}),s.map(C=>d.jsx("option",{value:C,children:C},C))]}),d.jsx("span",{className:"filter-label",children:"REPOSITORY"}),d.jsxs("select",{className:"filter-select","aria-label":"Repository filter",value:ys(t.repository),onChange:C=>_(co(C.target.value)),children:[d.jsx("option",{value:ys({kind:"all"}),children:"Any"}),a.map(C=>d.jsx("option",{value:C,children:C},C))]}),l.length>0&&d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"filter-label",children:"TAG"}),d.jsxs("select",{className:"filter-select","aria-label":"Tag filter",value:ys(t.tag),onChange:C=>S(co(C.target.value)),children:[d.jsx("option",{value:ys({kind:"all"}),children:"Any"}),l.map(C=>d.jsx("option",{value:C,children:C},C))]})]})]}),d.jsxs("div",{className:"filter-field",children:[d.jsxs("span",{className:"filter-count",children:["Showing ",c," of ",h]}),iv(t)&&d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Clear all filters",onClick:O,children:"CLEAR"})]})]})}const h1=["title","next_run","last_fire","agent","health","enabled","updated"];function m1(t){return h1.includes(t)?t:void 0}function p1(t){return t==="asc"?"desc":"asc"}function y1(t){return t==="desc"?"desc":"asc"}const g1=["none","agent","machine","status","health"];function av(t){return g1.includes(t)?t:"none"}function v1(t){switch(t){case"none":return"None";case"agent":return"Agent";case"machine":return"Machine";case"status":return"Status";case"health":return"Health"}}function x1(t,n){var s;switch(n){case"none":return"";case"agent":return t.agent;case"machine":return((s=t.machines)==null?void 0:s[0])??"(unassigned)";case"status":return t.enabled?"Enabled":"Disabled";case"health":return gh(Ec(t,new Date))}}function w1(t,n){if(n==="none")return[["",t]];const s=new Map;for(const a of t){const l=x1(a,n),c=s.get(l);c?c.push(a):s.set(l,[a])}return[...s.entries()].sort(([a],[l])=>a<l?-1:a>l?1:0)}function S1(t,n,s,a){if(n===void 0)return t;const l=(c,h)=>{let y;switch(n){case"title":y=c.title.toLowerCase().localeCompare(h.title.toLowerCase());break;case"agent":y=c.agent.toLowerCase().localeCompare(h.agent.toLowerCase());break;case"enabled":y=Number(c.enabled)-Number(h.enabled);break;case"updated":y=c.updated_at-h.updated_at;break;case"health":y=py(Ec(c,a))-py(Ec(h,a));break;case"last_fire":{const w=yh(c),T=yh(h);y=(w??-1)-(T??-1);break}case"next_run":{const w=_=>{var S;return _.enabled?(S=Ao(_.schedule,a))==null?void 0:S.getTime():void 0},T=w(c),E=w(h);T!==void 0&&E!==void 0?y=T-E:T!==void 0?y=-1:E!==void 0?y=1:y=0;break}}const x=s==="desc"?-y:y;return x!==0?x:c.id.localeCompare(h.id)};return[...t].sort(l)}const k1=["none","agent","machine","status","health"];function _1({groupBy:t,onChange:n}){return d.jsxs("div",{className:"group-by-ctrl",children:[d.jsx("label",{htmlFor:"routine-group-by-select",children:"GROUP BY"}),d.jsx("select",{id:"routine-group-by-select",className:"filter-select","aria-label":"Group routines by",value:t,onChange:s=>n(av(s.target.value)),children:k1.map(s=>d.jsx("option",{value:s,children:v1(s)},s))})]})}function N1({routines:t,loading:n,onEdit:s}){const[a,l]=Z.useState(0),{addToast:c}=Fo();if(n)return d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})});const h=()=>{const O=`${window.location.origin}${Pw()}`;navigator.clipboard.writeText(O).then(()=>c("Calendar feed URL copied","ok")).catch(()=>c("Copy failed","err"))},y=new Date;y.setHours(0,0,0,0);const x=TS(y,a),w=new Date(x);w.setDate(w.getDate()-x.getDay());const T=new Date,E=Array.from({length:ph},()=>[]);let _=0;for(const O of t.filter(C=>C.enabled)){const C=CS(O.schedule,w);if(C===void 0)continue;_++;const b=ka(O,T);C.forEach((I,j)=>{var F;I>0&&((F=E[j])==null||F.push({id:O.id,title:O.title,count:I,snoozed:b}))})}const S=`${zh[x.getMonth()]} ${x.getFullYear()}`;return d.jsxs("div",{className:"cal-wrap",children:[d.jsxs("div",{className:"cal-nav",children:[d.jsx("button",{type:"button",className:"btn-refresh",title:"Previous month","aria-label":"Previous month",onClick:()=>l(O=>O-1),children:"‹"}),d.jsx("div",{className:"cal-month",children:S}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Next month","aria-label":"Next month",onClick:()=>l(O=>O+1),children:"›"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>l(0),children:"TODAY"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Copy the routines.ics feed URL",onClick:h,children:"SUBSCRIBE"})]}),_===0?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"🗓"}),d.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"enabled routines with a valid schedule appear here"})]}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"cal-weekdays",children:Xl.map(O=>d.jsx("div",{className:"cal-weekday",children:O},O))}),d.jsx("div",{className:"cal-grid",children:E.map((O,C)=>{const b=new Date(w);b.setDate(b.getDate()+C);let I="cal-day";return b.getMonth()!==x.getMonth()&&(I+=" other-month"),b.getTime()===y.getTime()&&(I+=" today"),d.jsxs("div",{className:I,children:[d.jsx("div",{className:"cal-daynum",children:b.getDate()}),d.jsxs("div",{className:"cal-hits",children:[O.slice(0,4).map((j,F)=>{const U=j.count>1?`${j.title} ×${j.count}`:j.title;let $="cal-chip clickable";return j.snoozed&&($+=" snoozed"),d.jsx("div",{className:$,title:U,onClick:()=>s(j.id),children:U},`${j.id}-${F}`)}),O.length>4&&d.jsxs("div",{className:"cal-more",children:["+",O.length-4," more"]})]})]},C)})})]})]})}function E1({id:t,title:n,onBack:s}){const a=Fw(t),l=Aw(),c=a.data??[];return d.jsxs("main",{className:"logs-page",children:[d.jsxs("div",{className:"page-hd",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:s,children:"← BACK"}),d.jsxs("div",{className:"page-title",children:["FLAGS / ",n]}),a.dataUpdatedAt>0&&d.jsx("span",{className:"page-freshness",children:Ah(Math.max(0,(Date.now()-a.dataUpdatedAt)/1e3))}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Refresh","aria-label":"Refresh",onClick:()=>void a.refetch(),children:"↻"})]}),a.isLoading?d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})}):a.isError?d.jsx("div",{className:"logs-error",children:a.error.message}):c.length===0?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⚑"}),d.jsx("div",{className:"empty-msg",children:"NO OPEN FLAGS"})]}):d.jsxs("div",{className:"flags-list",children:[d.jsxs("div",{className:"flags-count",children:[c.length," open flag",c.length===1?"":"s"]}),c.map(h=>d.jsxs("div",{className:"flag-item",children:[d.jsxs("div",{className:"flag-item-hd",children:[d.jsx("span",{className:"flag-type",children:h.type}),d.jsx("span",{className:"flag-scope",children:h.scope==="general"?"general":"local"}),d.jsx("span",{className:"flag-age",title:h.filename,children:Oo(h.created_at)}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",disabled:l.isPending,onClick:()=>l.mutate({id:t,filename:h.filename}),children:"RESOLVE"})]}),d.jsx("div",{className:"flag-desc",children:h.description})]},h.filename))]})]})}var Jl=t=>t.type==="checkbox",_i=t=>t instanceof Date,an=t=>t==null;const Hh=t=>typeof t=="object";var Dt=t=>!an(t)&&!Array.isArray(t)&&Hh(t)&&!_i(t),T1=t=>Dt(t)&&t.target?Jl(t.target)?t.target.checked:t.target.value:t,C1=(t,n)=>n.split(".").some((s,a,l)=>!isNaN(Number(s))&&t.has(l.slice(0,a).join("."))),ov=t=>{const n=t.constructor&&t.constructor.prototype;return Dt(n)&&n.hasOwnProperty("isPrototypeOf")},Hc=typeof window<"u"&&typeof window.HTMLElement<"u"&&typeof document<"u";function Ut(t){if(t instanceof Date)return new Date(t);const n=typeof FileList<"u"&&t instanceof FileList;if(Hc&&(t instanceof Blob||n))return t;const s=Array.isArray(t);if(!s&&!(Dt(t)&&ov(t)))return t;const a=s?[]:Object.create(Object.getPrototypeOf(t));for(const l in t)Object.prototype.hasOwnProperty.call(t,l)&&(a[l]=Ut(t[l]));return a}const oo={BLUR:"blur",FOCUS_OUT:"focusout",SUBMIT:"submit",TRIGGER:"trigger",VALID:"valid"},_r={onBlur:"onBlur",onChange:"onChange",onSubmit:"onSubmit",onTouched:"onTouched",all:"all"},Sr={max:"max",min:"min",maxLength:"maxLength",minLength:"minLength",pattern:"pattern",required:"required",validate:"validate"},lv="root",Bh=["__proto__","constructor","prototype"],O1=/^\w*$/;var eu=t=>O1.test(t),_t=t=>t===void 0;const b1=/[.[\]'"]/;var Bc=t=>t.split(b1).filter(Boolean),Te=(t,n,s)=>{if(!n||!Dt(t))return s;const a=eu(n)?[n]:Bc(n);if(a.some(c=>Bh.includes(c)))return s;const l=a.reduce((c,h)=>an(c)?void 0:c[h],t);return _t(l)||l===t?_t(t[n])?s:t[n]:l},Ur=t=>typeof t=="boolean",nr=t=>typeof t=="function",kt=(t,n,s)=>{let a=-1;const l=eu(n)?[n]:Bc(n),c=l.length,h=c-1;for(;++a<c;){const y=l[a];let x=s;if(a!==h){const w=t[y];x=Dt(w)||Array.isArray(w)?w:isNaN(+l[a+1])?{}:[]}if(Bh.includes(y))return;t[y]=x,t=t[y]}};const j1=sn.createContext(null);j1.displayName="HookFormControlContext";var D1=(t,n,s,a=!0)=>{const l={};for(const c in t)Object.defineProperty(l,c,{get:()=>{const h=c;return n._proxyFormState[h]!==_r.all&&(n._proxyFormState[h]=!a||_r.all),t[h]}});return l};const R1=Hc?sn.useLayoutEffect:sn.useEffect;var fn=t=>typeof t=="string",M1=(t,n,s,a,l)=>fn(t)?(a&&n.watch.add(t),Te(s,t,l)):Array.isArray(t)?t.map(c=>(a&&n.watch.add(c),Te(s,c))):(a&&(n.watchAll=!0),s),vh=t=>an(t)||!Hh(t);const yy=(t,n)=>n.length===0&&!Array.isArray(t)&&!ov(t);function Vr(t,n,s=new WeakMap){if(t===n)return!0;if(vh(t)||vh(n))return Object.is(t,n);if(_i(t)&&_i(n))return Object.is(t.getTime(),n.getTime());const a=Object.keys(t),l=Object.keys(n);if(a.length!==l.length)return!1;if(yy(t,a)||yy(n,l))return Object.is(t,n);if(!a.length&&Array.isArray(t)!==Array.isArray(n))return!1;const c=s.get(t);if(c&&c.has(n))return!0;if(c)c.add(n);else{const h=new WeakSet;h.add(n),s.set(t,h)}for(const h of a){const y=t[h];if(!(h in n))return!1;if(h!=="ref"){const x=n[h];if(_i(y)&&_i(x)||(Dt(y)||Array.isArray(y))&&(Dt(x)||Array.isArray(x))?!Vr(y,x,s):!Object.is(y,x))return!1}}return!0}const uv=t=>{const n={};for(const s of Object.keys(t))if(Hh(t[s])&&t[s]!==null&&!_i(t[s])){const a=uv(t[s]);for(const l of Object.keys(a))n[`${s}.${l}`]=a[l]}else n[s]=t[s];return n},I1=sn.createContext(null);I1.displayName="HookFormContext";var L1=(t,n,s,a,l)=>n?{...s[t],types:{...s[t]&&s[t].types?s[t].types:{},[a]:l||!0}}:{},cv=t=>Array.isArray(t)?t.filter(Boolean):[],wc=t=>Array.isArray(t)?t:[t],gy=()=>{let t=[];return{get observers(){return t},next:l=>{for(const c of t)c.next&&c.next(l)},subscribe:l=>(t.push(l),{unsubscribe:()=>{t=t.filter(c=>c!==l)}}),unsubscribe:()=>{t=[]}}};function dv(t,n){const s={};for(const a in t)if(t.hasOwnProperty(a)){const l=t[a],c=n[a];if(l&&Dt(l)&&c){const h=dv(l,c);Dt(h)&&(s[a]=h)}else t[a]&&(s[a]=c)}return s}var rn=t=>Dt(t)&&!Object.keys(t).length,Zh=t=>t.type==="file",Tc=t=>{if(!Hc)return!1;const n=t?t.ownerDocument:0;return t instanceof(n&&n.defaultView?n.defaultView.HTMLElement:HTMLElement)},fv=t=>t.type==="select-multiple",qh=t=>t.type==="radio",F1=t=>qh(t)||Jl(t),Vf=t=>Tc(t)&&t.isConnected;function A1(t,n){const s=n.slice(0,-1).length;let a=0;for(;a<s;){if(an(t)){t=void 0;break}t=t[n[a]],a++}return t}function P1(t){for(const n in t)if(t.hasOwnProperty(n)&&!_t(t[n]))return!1;return!0}function $t(t,n){if(fn(n)&&Object.prototype.hasOwnProperty.call(t,n))return delete t[n],t;const s=Array.isArray(n)?n:eu(n)?[n]:Bc(n);if(s.some(h=>Bh.includes(String(h))))return t;const a=s.length===1?t:A1(t,s),l=s.length-1,c=s[l];return a&&delete a[c],l!==0&&(Dt(a)&&rn(a)||Array.isArray(a)&&P1(a))&&$t(t,s.slice(0,-1)),t}var U1=t=>{for(const n in t)if(nr(t[n]))return!0;return!1};function hv(t){return Array.isArray(t)||Dt(t)&&!U1(t)}function xh(t,n={}){for(const s in t){const a=t[s];hv(a)?(n[s]=Array.isArray(a)?[]:{},xh(a,n[s])):_t(a)||(n[s]=!0)}return n}function wh(t){if(t!==!1){if(t===!0)return!0;if(Array.isArray(t)){const n=t.map(s=>wh(s));return n.some(s=>s!==void 0)?n:void 0}if(Dt(t)){const n={};for(const s in t){const a=wh(t[s]);_t(a)||(n[s]=a)}return Object.keys(n).length?n:void 0}}}function ca(t,n,s){s||(s=xh(n));for(const a in t){const l=t[a];if(hv(l))_t(n)||vh(s[a])?s[a]=xh(l,Array.isArray(l)?[]:{}):ca(l,an(n)?{}:n[a],s[a]);else{const c=n[a];s[a]=!Vr(l,c)}}return wh(s)||{}}const vy={value:!1,isValid:!1},xy={value:!0,isValid:!0};var mv=t=>{if(Array.isArray(t)){if(t.length>1){const n=t.filter(s=>s&&s.checked&&!s.disabled).map(s=>s.value);return{value:n,isValid:!!n.length}}return t[0].checked&&!t[0].disabled?t[0].attributes&&!_t(t[0].attributes.value)?_t(t[0].value)||t[0].value===""?xy:{value:t[0].value,isValid:!0}:xy:vy}return vy},pv=(t,{valueAsNumber:n,valueAsDate:s,setValueAs:a})=>_t(t)?t:n?t===""?NaN:t&&+t:s&&fn(t)?new Date(t):a?a(t):t;const wy={isValid:!1,value:null};var yv=t=>Array.isArray(t)?t.reduce((n,s)=>s&&s.checked&&!s.disabled?{isValid:!0,value:s.value}:n,wy):wy;function Sy(t){const n=t.ref;return Zh(n)?n.files:qh(n)?yv(t.refs).value:fv(n)?[...n.selectedOptions].map(({value:s})=>s):Jl(n)?mv(t.refs).value:pv(_t(n.value)?t.ref.value:n.value,t)}var V1=(t,n,s,a)=>{const l={};for(const c of t){const h=Te(n,c);h&&kt(l,c,h._f)}return{criteriaMode:s,names:[...t],fields:l,shouldUseNativeValidation:a}},Cc=t=>t instanceof RegExp,Il=t=>_t(t)?t:Cc(t)?t.source:Dt(t)?Cc(t.value)?t.value.source:t.value:t,yc=t=>({isOnSubmit:!t||t===_r.onSubmit,isOnBlur:t===_r.onBlur,isOnChange:t===_r.onChange,isOnAll:t===_r.all,isOnTouch:t===_r.onTouched});const ky="AsyncFunction";var z1=t=>{if(!t||!t.validate)return!1;if(nr(t.validate))return t.validate.constructor.name===ky;if(Dt(t.validate)){for(const n in t.validate)if(t.validate[n].constructor.name===ky)return!0}return!1},$1=t=>t.mount&&(t.required||t.min||t.max||t.maxLength||t.minLength||t.pattern||t.validate),zf=(t,n,s)=>{if(s)return!1;if(n.watchAll||n.watch.has(t))return!0;for(const a of n.watch)if(t.startsWith(a)&&t.charAt(a.length)===".")return!0;return!1};const Al=(t,n,s,a)=>{for(const l of s||Object.keys(t)){const c=Te(t,l);if(c){const{_f:h,...y}=c;if(h){if(h.refs&&h.refs[0]&&n(h.refs[0],l)&&!a)return!0;if(h.ref&&n(h.ref,h.name)&&!a)return!0;if(Al(y,n))break}else if(Dt(y)&&Al(y,n))break}}};function _y(t,n,s){const a=Te(t,s);if(a||eu(s))return{error:a,name:s};const l=s.split(".");for(;l.length;){const c=l.join("."),h=Te(n,c),y=Te(t,c);if(h&&!Array.isArray(h)&&s!==c)return{name:s};if(y&&y.type)return{name:c,error:y};if(y&&y.root&&y.root.type)return{name:`${c}.root`,error:y.root};l.pop()}return{name:s}}var W1=(t,n,s,a)=>{s(t);const{name:l,...c}=t,h=Object.keys(c);return!h.length||a&&h.length>=Object.keys(n).length||h.find(y=>n[y]===(!a||_r.all))},H1=(t,n,s)=>!t||!n||t===n||wc(t).some(a=>a&&(s?a===n||a.startsWith(n+"."):a.startsWith(n)||n.startsWith(a))),B1=(t,n,s,a,l)=>l.isOnAll?!1:!s&&l.isOnTouch?!(n||t):(s?a.isOnBlur:l.isOnBlur)?!t:(s?a.isOnChange:l.isOnChange)?t:!0,Z1=(t,n)=>!cv(Te(t,n)).length&&$t(t,n),Ny=(t,n,s)=>{const a=Te(t,s),l=Array.isArray(a)?a:[];return kt(l,lv,n[s]),kt(t,s,l),t};function Ey(t,n,s="validate"){if(fn(t)||Array.isArray(t)&&t.every(fn)||Ur(t)&&!t)return{type:s,message:fn(t)?t:"",ref:n}}var lo=t=>Dt(t)&&!Cc(t)?t:{value:t,message:""},Ty=async(t,n,s,a,l,c)=>{const{ref:h,refs:y,required:x,maxLength:w,minLength:T,min:E,max:_,pattern:S,validate:O,name:C,valueAsNumber:b,mount:I}=t._f,j=Te(s,C);if(!I||n.has(C))return{};const F=y?y[0]:h,U=ge=>{if(l&&F.reportValidity){const fe=Ur(ge)?"":ge||"";y?y.forEach(Ee=>Ee.setCustomValidity(fe)):F.setCustomValidity(fe),F.reportValidity()}},$={},J=qh(h),ne=Jl(h),he=J||ne,ye=(b||Zh(h))&&_t(h.value)&&_t(j)||Tc(h)&&h.value===""||j===""||Array.isArray(j)&&!j.length,ke=L1.bind(null,C,a,$),pe=(ge,fe,Ee,Ce=Sr.maxLength,Ze=Sr.minLength)=>{const Me=ge?fe:Ee;$[C]={type:ge?Ce:Ze,message:Me,ref:h,...ke(ge?Ce:Ze,Me)}};if(c?!Array.isArray(j)||!j.length:x&&(!he&&(ye||an(j))||Ur(j)&&!j||ne&&!mv(y).isValid||J&&!yv(y).isValid)){const{value:ge,message:fe}=fn(x)?{value:!!x,message:x}:lo(x);if(ge&&($[C]={type:Sr.required,message:fe,ref:F,...ke(Sr.required,fe)},!a))return U(fe),$}if(!ye&&(!an(E)||!an(_))){let ge,fe;const Ee=lo(_),Ce=lo(E);if(!an(j)&&!isNaN(j)){const Ze=h.valueAsNumber||j&&+j;an(Ee.value)||(ge=Ze>Ee.value),an(Ce.value)||(fe=Ze<Ce.value)}else{const Ze=h.valueAsDate||new Date(j),Me=me=>new Date(new Date().toDateString()+" "+me),ee=h.type=="time",ve=h.type=="week";fn(Ee.value)&&j&&(ge=ee?Me(j)>Me(Ee.value):ve?j>Ee.value:Ze>new Date(Ee.value)),fn(Ce.value)&&j&&(fe=ee?Me(j)<Me(Ce.value):ve?j<Ce.value:Ze<new Date(Ce.value))}if((ge||fe)&&(pe(!!ge,Ee.message,Ce.message,Sr.max,Sr.min),!a))return U($[C].message),$}if((w||T)&&!ye&&(fn(j)||c&&Array.isArray(j))){const ge=lo(w),fe=lo(T),Ee=!an(ge.value)&&j.length>+ge.value,Ce=!an(fe.value)&&j.length<+fe.value;if((Ee||Ce)&&(pe(Ee,ge.message,fe.message),!a))return U($[C].message),$}if(S&&!ye&&fn(j)){const{value:ge,message:fe}=lo(S);if(Cc(ge)&&!j.match(ge)&&($[C]={type:Sr.pattern,message:fe,ref:h,...ke(Sr.pattern,fe)},!a))return U(fe),$}if(O){if(nr(O)){const ge=await O(j,s),fe=Ey(ge,F);if(fe&&($[C]={...fe,...ke(Sr.validate,fe.message)},!a))return U(fe.message),$}else if(Dt(O)){let ge={};for(const fe in O){if(!rn(ge)&&!a)break;const Ee=Ey(await O[fe](j,s),F,fe);Ee&&(ge={...Ee,...ke(fe,Ee.message)},U(Ee.message),a&&($[C]=ge))}if(!rn(ge)&&($[C]={ref:F,...ge},!a))return $}}return U(!0),$};const q1={mode:_r.onSubmit,reValidateMode:_r.onChange,shouldFocusError:!0},$f="form",gv={submitCount:0,isDirty:!1,isReady:!1,isValidating:!1,isSubmitted:!1,isSubmitting:!1,isSubmitSuccessful:!1,isValid:!1,touchedFields:{},dirtyFields:{},validatingFields:{}};function Q1(t={}){let n={...q1,...t},s={...Ut(gv),isLoading:nr(n.defaultValues),errors:n.errors||{},disabled:n.disabled||!1},a={},l=Dt(n.defaultValues)||Dt(n.values)?Ut(n.defaultValues||n.values)||{}:{},c=n.shouldUnregister?{}:Ut(l),h={action:!1,mount:!1,watch:!1,keepIsValid:!1},y={mount:new Set,disabled:new Set,unMount:new Set,array:new Set,watch:new Set,registerName:new Set},x,w=0,T=0,E=yc(n.mode),_=yc(n.reValidateMode);const S={isDirty:!1,dirtyFields:!1,validatingFields:!1,touchedFields:!1,isValidating:!1,isValid:!1,errors:!1},O={...S};let C={...O};const b={array:gy(),state:gy()},I=n.criteriaMode===_r.all,j=R=>A=>{clearTimeout(w),w=setTimeout(R,A)},F=async R=>{if(!h.keepIsValid&&!n.disabled&&(O.isValid||C.isValid||R)){let A;n.resolver?(A=rn((await fe()).errors),U()):A=await Ze({fields:a,onlyCheckValid:!0,eventType:oo.VALID}),A!==s.isValid&&b.state.next({isValid:A})}},U=(R,A)=>{!n.disabled&&(O.isValidating||O.validatingFields||C.isValidating||C.validatingFields)&&((R||Array.from(y.mount)).forEach(q=>{q&&(A?kt(s.validatingFields,q,A):$t(s.validatingFields,q))}),b.state.next({validatingFields:s.validatingFields,isValidating:!rn(s.validatingFields)}))},$=()=>{s.dirtyFields=ca(l,c)},J=(R,A=[],q,te,le=!0,H=!0)=>{if(te&&q&&!n.disabled){if(h.action=!0,H&&Array.isArray(Te(a,R))){const Q=q(Te(a,R),te.argA,te.argB);le&&kt(a,R,Q)}if(H&&Array.isArray(Te(s.errors,R))){const Q=q(Te(s.errors,R),te.argA,te.argB);le&&kt(s.errors,R,Q),Z1(s.errors,R)}if((O.touchedFields||C.touchedFields)&&H&&Array.isArray(Te(s.touchedFields,R))){const Q=q(Te(s.touchedFields,R),te.argA,te.argB);le&&kt(s.touchedFields,R,Q)}(O.dirtyFields||C.dirtyFields)&&$(),b.state.next({name:R,isDirty:ee(R,A),dirtyFields:s.dirtyFields,errors:s.errors,isValid:s.isValid})}else kt(c,R,A)},ne=(R,A)=>{kt(s.errors,R,A),s.errors={...s.errors},b.state.next({errors:s.errors})},he=R=>{s.errors=R,b.state.next({errors:s.errors,isValid:!1})},ye=R=>{const A=eu(R)?[R]:Bc(R);let q=c,te=l;for(let le=0;le<A.length-1;le++){const H=A[le];if(q=an(q)?q:q[H],te=an(te)?te:te[H],q===null&&te!==null)return!0}return!1},ke=(R,A,q,te)=>{const le=Te(a,R);if(le){if(ye(R))return;const H=_t(Te(c,R)),Q=Te(c,R,_t(q)?Te(l,R):q);_t(Q)||te&&te.defaultChecked||A?kt(c,R,A?Q:Sy(le._f)):W(R,Q),h.mount&&!h.action&&(F(),H&&s.isDirty&&(O.isDirty||C.isDirty)&&(ee()||(s.isDirty=!1,b.state.next({...s}))),t.shouldUnregister&&H&&!_t(Te(c,R))&&zf(R,y)&&(h.watch=!0))}},pe=(R,A,q,te,le)=>{let H=!1,Q=!1;const re={name:R};if(!n.disabled){if(!q||te){const _e=Vr(Te(l,R),A);(O.isDirty||C.isDirty)&&(Q=s.isDirty,s.isDirty=re.isDirty=!_e||ee(),H=Q!==re.isDirty),Q=!!Te(s.dirtyFields,R),_e!==s.isDirty?s.dirtyFields=ca(l,c):_e?$t(s.dirtyFields,R):kt(s.dirtyFields,R,!0),re.dirtyFields=s.dirtyFields,H=H||(O.dirtyFields||C.dirtyFields)&&Q!==!_e}if(q){const _e=Te(s.touchedFields,R);_e||(kt(s.touchedFields,R,q),re.touchedFields=s.touchedFields,H=H||(O.touchedFields||C.touchedFields)&&_e!==q)}H&&le&&b.state.next(re)}return H?re:{}},ge=(R,A,q,te)=>{const le=Te(s.errors,R),H=(O.isValid||C.isValid)&&Ur(A)&&s.isValid!==A;if(n.delayError&&q?(x=j(()=>ne(R,q)),x(n.delayError)):(clearTimeout(w),x=null,q?kt(s.errors,R,q):$t(s.errors,R),s.errors={...s.errors}),(q?!Vr(le,q):le)||!rn(te)||H){const Q={...te,...H&&Ur(A)?{isValid:A}:{},errors:s.errors,name:R};s={...s,...Q},b.state.next(Q)}},fe=async R=>(U(R,!0),await n.resolver(c,n.context,V1(R||y.mount,a,n.criteriaMode,n.shouldUseNativeValidation))),Ee=async R=>{const{errors:A}=await fe(R);if(U(R),R){for(const q of R){const te=Te(A,q);te?y.array.has(q)&&Dt(te)&&!Object.keys(te).some(le=>!Number.isNaN(Number(le)))?Ny(s.errors,{[q]:te},q):kt(s.errors,q,te):$t(s.errors,q)}s.errors={...s.errors}}else s.errors=A;return A},Ce=async({name:R,eventType:A})=>{if(t.validate){const q=await t.validate({formValues:c,formState:s,name:R,eventType:A});if(Dt(q))for(const te in q){const le=q[te];le&&sr(`${$f}.${te}`,{message:fn(le.message)?le.message:"",type:le.type||Sr.validate})}else fn(q)||!q?sr($f,{message:q||"",type:Sr.validate}):jn($f);return q}return!0},Ze=async({fields:R,onlyCheckValid:A,name:q,eventType:te,context:le={valid:!0,runRootValidation:!1}})=>{if(t.validate&&(le.runRootValidation=!0,!await Ce({name:q,eventType:te})&&(le.valid=!1,A)))return le.valid;for(const H in R){const Q=R[H];if(Q){const{_f:re,..._e}=Q;if(re){const Ye=y.array.has(re.name),xt=Q._f&&z1(Q._f),Kt=O.validatingFields||O.isValidating||C.validatingFields||C.isValidating;xt&&Kt&&U([re.name],!0);const yt=await Ty(Q,y.disabled,c,I,n.shouldUseNativeValidation&&!A,Ye);if(xt&&Kt&&U([re.name]),yt[re.name]&&(le.valid=!1,A)||(!A&&(Te(yt,re.name)?Ye?Ny(s.errors,yt,re.name):kt(s.errors,re.name,yt[re.name]):$t(s.errors,re.name)),t.shouldUseNativeValidation&&yt[re.name]))break}!rn(_e)&&await Ze({context:le,onlyCheckValid:A,fields:_e,name:H,eventType:te})}}return le.valid},Me=()=>{for(const R of y.unMount){const A=Te(a,R);A&&(A._f.refs?A._f.refs.every(q=>!Vf(q)):!Vf(A._f.ref))&&ir(R)}y.unMount=new Set},ee=(R,A)=>!n.disabled&&(R&&A&&kt(c,R,A),!Vr(h.mount?c:l,l)),ve=(R,A,q)=>M1(R,y,{...h.mount?c:_t(A)?l:fn(R)?{[R]:A}:A},q,A),me=R=>cv(Te(h.mount?c:l,R,n.shouldUnregister?Te(l,R,[]):[])),W=(R,A,q={},te=!1,le=!1)=>{const H=Te(a,R);let Q=A;if(H){const re=H._f;re&&(!re.disabled&&kt(c,R,pv(A,re)),Q=Tc(re.ref)&&an(A)?"":A,fv(re.ref)?[...re.ref.options].forEach(_e=>_e.selected=Q.includes(_e.value)):re.refs?Jl(re.ref)?re.refs.forEach(_e=>{(!_e.defaultChecked||!_e.disabled)&&(Array.isArray(Q)?_e.checked=!!Q.find(Ye=>Ye===_e.value):_e.checked=Q===_e.value||!!Q)}):re.refs.forEach(_e=>_e.checked=_e.value===Q):Zh(re.ref)?re.ref.value="":(re.ref.value=Q,!re.ref.type&&!le&&b.state.next({name:R,values:te?c:Ut(c)})))}(q.shouldDirty||q.shouldTouch)&&pe(R,Q,q.shouldTouch,q.shouldDirty,!le),q.shouldValidate&&Ge(R)},se=(R,A,q,te=!1,le=!1)=>{for(const H in A){if(!A.hasOwnProperty(H))return;const Q=A[H],re=R+"."+H,_e=Te(a,re);(y.array.has(R)||Dt(Q)||_e&&!_e._f)&&!_i(Q)?se(re,Q,q,te,le):W(re,Q,q,te,le)}},We=(R,A,q,te,le=!1)=>{const H=Te(a,R),Q=y.array.has(R),re=te?A:Ut(A),_e=Te(c,R),Ye=Vr(_e,re);if(Ye||kt(c,R,re),Q)b.array.next({name:R,values:te?c:Ut(c)}),(O.isDirty||O.dirtyFields||C.isDirty||C.dirtyFields)&&q.shouldDirty&&($(),le||b.state.next({name:R,dirtyFields:s.dirtyFields,isDirty:ee(R,re)}));else{const xt=Array.isArray(re)&&!re.length||rn(re);!H||H._f||an(re)||xt?W(R,re,q,te,le):se(R,re,q,te,le)}if(!Ye&&!le){const xt=zf(R,y),Kt=te?c:Ut(c);b.state.next({...xt&&s,name:h.mount||xt?R:void 0,values:Kt})}},He=(R,A,q={})=>We(R,A,q,!1),Xe=(R,A={})=>{const q=nr(R)?R(c):R;if(!Vr(c,q)){c={...c,...q};const te=uv(q);for(const le of y.mount)le in te&&We(le,te[le],A,!0,!0);b.state.next({...s,name:void 0,type:void 0,...T?{values:c}:{}}),A.shouldValidate&&F()}},ze=async R=>{h.mount=!0;const A=R.target;let q=A.name,te=!0;const le=Te(a,q),H=Q=>{te=Number.isNaN(Q)||_i(Q)&&isNaN(Q.getTime())||Vr(Q,Te(c,q,Q))};if(le){let Q,re;const _e=A.type?Sy(le._f):T1(R),Ye=R.type===oo.BLUR||R.type===oo.FOCUS_OUT,xt=!$1(le._f)&&!t.validate&&!n.resolver&&!Te(s.errors,q)&&!le._f.deps,Kt=xt||B1(Ye,Te(s.touchedFields,q),s.isSubmitted,_,E),yt=zf(q,y,Ye);kt(c,q,_e),Ye?(!A||!A.readOnly)&&(le._f.onBlur&&le._f.onBlur(R),x&&x(0)):le._f.onChange&&le._f.onChange(R);const ur=pe(q,_e,Ye),ji=!rn(ur)||yt;if(!Ye&&b.state.next({name:q,type:R.type,...T?{values:Ut(c)}:{}}),Kt)return(!xt||!s.isValid)&&(O.isValid||C.isValid)&&(n.mode==="onBlur"?Ye&&F():Ye||F()),ji&&b.state.next({name:q,...yt?{}:ur});if(!n.resolver&&t.validate&&await Ce({name:q,eventType:R.type}),!Ye&&yt&&b.state.next({...s}),n.resolver){const{errors:Ts}=await fe([q]);if(U([q]),H(_e),!te){!rn(ur)&&b.state.next(ur);return}const Di=_y(s.errors,a,q),Cs=_y(Ts,a,Di.name||q);Q=Cs.error,q=Cs.name,re=rn(Ts)}else U([q],!0),Q=(await Ty(le,y.disabled,c,I,n.shouldUseNativeValidation))[q],U([q]),H(_e),te&&(Q?re=!1:(O.isValid||C.isValid)&&(re=await Ze({fields:a,onlyCheckValid:!0,name:q,eventType:R.type})));te&&(le._f.deps&&(!Array.isArray(le._f.deps)||le._f.deps.length>0)&&Ge(le._f.deps),ge(q,re,Q,ur))}},et=(R,A)=>{if(Te(s.errors,A)&&R.focus)return R.focus(),1},Ge=async(R,A={})=>{let q,te;const le=wc(R);if(n.resolver){const H=await Ee(_t(R)?R:le);q=rn(H),te=R?!le.some(Q=>Te(H,Q)):q}else R?(te=(await Promise.all(le.map(async H=>{const Q=Te(a,H);return await Ze({fields:Q&&Q._f?{[H]:Q}:Q,eventType:oo.TRIGGER})}))).every(Boolean),!(!te&&!s.isValid)&&F()):te=q=await Ze({fields:a,name:R,eventType:oo.TRIGGER});return b.state.next({...!fn(R)||(O.isValid||C.isValid)&&q!==s.isValid?{}:{name:R},...n.resolver||!R?{isValid:q}:{},errors:s.errors}),A.shouldFocus&&!te&&Al(a,et,R?le:y.mount),te},lt=(R,A)=>{let q={...h.mount?c:l};return A&&(q=dv(A.dirtyFields?s.dirtyFields:s.touchedFields,q)),_t(R)?q:fn(R)?Te(q,R):R.map(te=>Te(q,te))},Ct=(R,A)=>({invalid:!!Te((A||s).errors,R),isDirty:!!Te((A||s).dirtyFields,R),error:Te((A||s).errors,R),isValidating:!!Te(s.validatingFields,R),isTouched:!!Te((A||s).touchedFields,R)}),jn=R=>{const A=R?wc(R):void 0;A==null||A.forEach(q=>$t(s.errors,q)),A?A.forEach(q=>{b.state.next({name:q,errors:s.errors})}):b.state.next({errors:{}})},sr=(R,A,q)=>{const te=(Te(a,R,{_f:{}})._f||{}).ref,le=Te(s.errors,R)||{},{ref:H,message:Q,type:re,..._e}=le;kt(s.errors,R,{..._e,...A,ref:te}),b.state.next({name:R,errors:s.errors,isValid:!1}),q&&q.shouldFocus&&te&&te.focus&&te.focus()},$n=(R,A)=>{if(nr(R)){T++;const{unsubscribe:q}=b.state.subscribe({next:le=>"values"in le&&R(le.values||ve(void 0,A),le)});let te=!1;return{unsubscribe:()=>{te||(te=!0,T--,q())}}}return ve(R,A,!0)},Nr=R=>{var A;const q=!!(!((A=R.formState)===null||A===void 0)&&A.values);q&&T++;const{unsubscribe:te}=b.state.subscribe({next:H=>{if(H1(R.name,H.name,R.exact)&&W1(H,R.formState||O,Bn,R.reRenderRoot)){const Q={...c};R.callback({values:Q,...s,...H,defaultValues:l})}}});if(!q)return te;let le=!1;return()=>{le||(le=!0,T--,te())}},Wn=R=>(h.mount=!0,C={...C,...R.formState},Nr({...R,formState:{...S,...R.formState}})),ir=(R,A={})=>{for(const q of R?wc(R):y.mount)y.mount.delete(q),y.array.delete(q),A.keepValue||($t(a,q),$t(c,q)),!A.keepError&&$t(s.errors,q),!A.keepDirty&&$t(s.dirtyFields,q),!A.keepTouched&&$t(s.touchedFields,q),!A.keepIsValidating&&$t(s.validatingFields,q),!n.shouldUnregister&&!A.keepDefaultValue&&$t(l,q);b.state.next({values:Ut(c)}),b.state.next({...s,...A.keepDirty?{isDirty:ee()}:{}}),!A.keepIsValid&&F()},Hn=({disabled:R,name:A})=>{if(Ur(R)&&h.mount||R||y.disabled.has(A)){const le=y.disabled.has(A)!==!!R;R?y.disabled.add(A):y.disabled.delete(A),le&&h.mount&&!h.action&&F()}},ar=(R,A={})=>{let q=Te(a,R);const te=Ur(A.disabled)||Ur(n.disabled),le=!y.registerName.has(R)&&q&&q._f&&!q._f.mount;return kt(a,R,{...q||{},_f:{...q&&q._f?q._f:{ref:{name:R}},name:R,mount:!0,...A}}),y.mount.add(R),q&&!le?Hn({disabled:Ur(A.disabled)?A.disabled:n.disabled,name:R}):ke(R,!0,A.value),{...te?{disabled:A.disabled||n.disabled}:{},...n.progressive?{required:!!A.required,min:Il(A.min),max:Il(A.max),minLength:Il(A.minLength),maxLength:Il(A.maxLength),pattern:Il(A.pattern)}:{},name:R,onChange:ze,onBlur:ze,ref:H=>{if(H){y.registerName.add(R),ar(R,A),y.registerName.delete(R),q=Te(a,R);const Q=_t(H.value)&&H.querySelectorAll&&H.querySelectorAll("input,select,textarea")[0]||H,re=F1(Q),_e=q._f.refs||[];if(re?_e.find(Ye=>Ye===Q):Q===q._f.ref)return;kt(a,R,{_f:{...q._f,...re?{refs:[..._e.filter(Vf),Q,...Array.isArray(Te(l,R))?[{}]:[]],ref:{type:Q.type,name:R}}:{ref:Q}}}),ke(R,!1,void 0,Q)}else q=Te(a,R,{}),q._f&&(q._f.mount=!1),(n.shouldUnregister||A.shouldUnregister)&&!(C1(y.array,R)&&h.action)&&y.unMount.add(R)}}},Dn=()=>n.shouldFocusError&&!n.shouldUseNativeValidation&&Al(a,et,y.mount),or=R=>{Ur(R)&&(b.state.next({disabled:R}),Al(a,(A,q)=>{const te=Te(a,q);te&&(A.disabled=te._f.disabled||R,Array.isArray(te._f.refs)&&te._f.refs.forEach(le=>{le.disabled=te._f.disabled||R}))},0,!1))},Rn=(R,A)=>async q=>{let te;q&&(q.preventDefault&&q.preventDefault(),q.persist&&q.persist());let le=Ut(c);if(b.state.next({isSubmitting:!0}),n.resolver){const{errors:H,values:Q}=await fe();U(),s.errors=H,le=Ut(Q)}else await Ze({fields:a,eventType:oo.SUBMIT});if(y.disabled.size)for(const H of y.disabled)$t(le,H);if($t(s.errors,lv),rn(s.errors)){b.state.next({errors:{}});try{await R(le,q)}catch(H){te=H}}else A&&await A({...s.errors},q),Dn(),setTimeout(Dn);if(b.state.next({isSubmitted:!0,isSubmitting:!1,isSubmitSuccessful:rn(s.errors)&&!te,submitCount:s.submitCount+1,errors:s.errors}),te)throw te},Zr=(R,A={})=>{Te(a,R)&&(_t(A.defaultValue)?He(R,Ut(Te(l,R))):(He(R,A.defaultValue),kt(l,R,Ut(A.defaultValue))),A.keepTouched||$t(s.touchedFields,R),A.keepDirty||($t(s.dirtyFields,R),s.isDirty=A.defaultValue?ee(R,Ut(Te(l,R))):ee()),A.keepError||($t(s.errors,R),O.isValid&&F()),b.state.next({...s}))},qr=(R,A={})=>{const q=R?Ut(R):l,te=Ut(q),le=rn(R),H=te;if(A.keepDefaultValues||(l=q),!A.keepValues){if(A.keepDirtyValues){const Q=new Set([...y.mount,...Object.keys(ca(l,c))]);for(const re of Array.from(Q)){const _e=Te(s.dirtyFields,re),Ye=Te(c,re),xt=Te(H,re);_e&&!_t(Ye)?kt(H,re,Ye):!_e&&!_t(xt)&&He(re,xt)}}else{if(Hc&&_t(R))for(const Q of y.mount){const re=Te(a,Q);if(re&&re._f){const _e=Array.isArray(re._f.refs)?re._f.refs[0]:re._f.ref;if(Tc(_e)){const Ye=_e.closest("form");if(Ye){Ye.reset();break}}}}if(A.keepFieldsRef)for(const Q of y.mount)He(Q,Te(H,Q));else a={}}if(n.shouldUnregister){if(c=A.keepDefaultValues?Ut(l):{},A.keepFieldsRef)for(const Q of y.mount)kt(c,Q,Te(H,Q))}else c=Ut(H);b.array.next({values:{...H}}),b.state.next({name:void 0,type:void 0,values:{...H}})}y={mount:A.keepDirtyValues?y.mount:new Set,unMount:new Set,array:new Set,registerName:new Set,disabled:new Set,watch:new Set,watchAll:!1,focus:""},h.mount=!O.isValid||!!A.keepIsValid||!!A.keepDirtyValues||!n.shouldUnregister&&!rn(H),h.watch=!!n.shouldUnregister,h.keepIsValid=!!A.keepIsValid,h.action=!1,A.keepErrors||(s.errors={}),b.state.next({submitCount:A.keepSubmitCount?s.submitCount:0,isDirty:le?!1:A.keepDirty?s.isDirty:A.keepValues?ee():!!(A.keepDefaultValues&&!Vr(R,l)),isSubmitted:A.keepIsSubmitted?s.isSubmitted:!1,dirtyFields:le?{}:A.keepDirtyValues?A.keepDefaultValues&&c?ca(l,c):s.dirtyFields:A.keepDefaultValues&&R?ca(l,R):A.keepDirty?s.dirtyFields:{},touchedFields:A.keepTouched?s.touchedFields:{},errors:A.keepErrors?s.errors:{},isSubmitSuccessful:A.keepIsSubmitSuccessful?s.isSubmitSuccessful:!1,isSubmitting:!1,defaultValues:l})},Qr=(R,A)=>qr(nr(R)?R(c):R,{...n.resetOptions,...A}),lr=(R,A={})=>{const q=Te(a,R),te=q&&q._f;if(te){const le=te.refs?te.refs[0]:te.ref;le.focus&&setTimeout(()=>{le.focus(),A.shouldSelect&&nr(le.select)&&le.select()})}},Bn=R=>{const{name:A,type:q,values:te,...le}=R;s={...s,...le}},Gr={control:{register:ar,unregister:ir,getFieldState:Ct,handleSubmit:Rn,setError:sr,_subscribe:Nr,_runSchema:fe,_updateIsValidating:U,_focusError:Dn,_getWatch:ve,_getDirty:ee,_setValid:F,_setFieldArray:J,_setDisabledField:Hn,_setErrors:he,_getFieldArray:me,_reset:qr,_resetDefaultValues:()=>nr(n.defaultValues)&&n.defaultValues().then(R=>{Qr(R,n.resetOptions),b.state.next({isLoading:!1})}),_removeUnmounted:Me,_disableForm:or,_subjects:b,_proxyFormState:O,get _fields(){return a},get _formValues(){return c},get _state(){return h},set _state(R){h=R},get _defaultValues(){return l},get _names(){return y},set _names(R){y=R},get _formState(){return s},get _options(){return n},set _options(R){n={...n,...R},E=yc(n.mode),_=yc(n.reValidateMode)}},subscribe:Wn,trigger:Ge,register:ar,handleSubmit:Rn,watch:$n,setValue:He,setValues:Xe,getValues:lt,reset:Qr,resetField:Zr,resetDefaultValues:(R,A={})=>{if(l=Ut(R),!A.keepDirty){const q=ca(l,c);s.dirtyFields=q,s.isDirty=!rn(q)}A.keepIsValid||F(),b.state.next({...s,defaultValues:l})},clearErrors:jn,unregister:ir,setError:sr,setFocus:lr,getFieldState:Ct};return{...Gr,formControl:Gr}}function Y1(t={}){const n=sn.useRef(void 0),s=sn.useRef(void 0),a=sn.useRef(t.formControl),[l,c]=sn.useState(()=>({...Ut(gv),isLoading:nr(t.defaultValues),errors:t.errors||{},disabled:t.disabled||!1,defaultValues:nr(t.defaultValues)?void 0:t.defaultValues}));if(!n.current||t.formControl&&a.current!==t.formControl)if(a.current=t.formControl,t.formControl)n.current={...t.formControl,formState:l},t.defaultValues&&!nr(t.defaultValues)&&t.formControl.reset(t.defaultValues,t.resetOptions);else{const{formControl:y,...x}=Q1(t);n.current={...x,formState:l}}const h=n.current.control;return h._options=t,R1(()=>{const y=h._subscribe({formState:h._proxyFormState,callback:()=>c({...h._formState,defaultValues:h._defaultValues}),reRenderRoot:!0});return c(x=>({...x,isReady:!0})),h._formState.isReady=!0,y},[h]),sn.useEffect(()=>h._disableForm(t.disabled),[h,t.disabled]),sn.useEffect(()=>{t.mode&&(h._options.mode=t.mode),t.reValidateMode&&(h._options.reValidateMode=t.reValidateMode)},[h,t.mode,t.reValidateMode]),sn.useEffect(()=>{t.errors&&(h._setErrors(t.errors),h._focusError())},[h,t.errors]),sn.useEffect(()=>{t.shouldUnregister&&h._subjects.state.next({values:h._getWatch()})},[h,t.shouldUnregister]),sn.useEffect(()=>{if(h._proxyFormState.isDirty){const y=h._getDirty();y!==l.isDirty&&h._subjects.state.next({isDirty:y})}},[h,l.isDirty]),sn.useEffect(()=>{var y;t.values&&!Vr(t.values,s.current)?(h._reset(t.values,{keepFieldsRef:!0,...h._options.resetOptions}),!((y=h._options.resetOptions)===null||y===void 0)&&y.keepIsValid||h._setValid(),s.current=t.values,c(x=>({...x}))):h._resetDefaultValues()},[h,t.values]),sn.useEffect(()=>{h._state.mount||(h._setValid(),h._state.mount=!0),h._state.watch&&(h._state.watch=!1,h._subjects.state.next({...h._formState})),h._removeUnmounted()}),n.current.formState=sn.useMemo(()=>D1(l,h),[h,l]),n.current}var ft;(function(t){t.assertEqual=l=>{};function n(l){}t.assertIs=n;function s(l){throw new Error}t.assertNever=s,t.arrayToEnum=l=>{const c={};for(const h of l)c[h]=h;return c},t.getValidEnumValues=l=>{const c=t.objectKeys(l).filter(y=>typeof l[l[y]]!="number"),h={};for(const y of c)h[y]=l[y];return t.objectValues(h)},t.objectValues=l=>t.objectKeys(l).map(function(c){return l[c]}),t.objectKeys=typeof Object.keys=="function"?l=>Object.keys(l):l=>{const c=[];for(const h in l)Object.prototype.hasOwnProperty.call(l,h)&&c.push(h);return c},t.find=(l,c)=>{for(const h of l)if(c(h))return h},t.isInteger=typeof Number.isInteger=="function"?l=>Number.isInteger(l):l=>typeof l=="number"&&Number.isFinite(l)&&Math.floor(l)===l;function a(l,c=" | "){return l.map(h=>typeof h=="string"?`'${h}'`:h).join(c)}t.joinValues=a,t.jsonStringifyReplacer=(l,c)=>typeof c=="bigint"?c.toString():c})(ft||(ft={}));var Cy;(function(t){t.mergeShapes=(n,s)=>({...n,...s})})(Cy||(Cy={}));const je=ft.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),fi=t=>{switch(typeof t){case"undefined":return je.undefined;case"string":return je.string;case"number":return Number.isNaN(t)?je.nan:je.number;case"boolean":return je.boolean;case"function":return je.function;case"bigint":return je.bigint;case"symbol":return je.symbol;case"object":return Array.isArray(t)?je.array:t===null?je.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?je.promise:typeof Map<"u"&&t instanceof Map?je.map:typeof Set<"u"&&t instanceof Set?je.set:typeof Date<"u"&&t instanceof Date?je.date:je.object;default:return je.unknown}},de=ft.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 _s extends Error{get errors(){return this.issues}constructor(n){super(),this.issues=[],this.addIssue=a=>{this.issues=[...this.issues,a]},this.addIssues=(a=[])=>{this.issues=[...this.issues,...a]};const s=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,s):this.__proto__=s,this.name="ZodError",this.issues=n}format(n){const s=n||function(c){return c.message},a={_errors:[]},l=c=>{for(const h of c.issues)if(h.code==="invalid_union")h.unionErrors.map(l);else if(h.code==="invalid_return_type")l(h.returnTypeError);else if(h.code==="invalid_arguments")l(h.argumentsError);else if(h.path.length===0)a._errors.push(s(h));else{let y=a,x=0;for(;x<h.path.length;){const w=h.path[x];x===h.path.length-1?(y[w]=y[w]||{_errors:[]},y[w]._errors.push(s(h))):y[w]=y[w]||{_errors:[]},y=y[w],x++}}};return l(this),a}static assert(n){if(!(n instanceof _s))throw new Error(`Not a ZodError: ${n}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ft.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(n=s=>s.message){const s={},a=[];for(const l of this.issues)if(l.path.length>0){const c=l.path[0];s[c]=s[c]||[],s[c].push(n(l))}else a.push(n(l));return{formErrors:a,fieldErrors:s}}get formErrors(){return this.flatten()}}_s.create=t=>new _s(t);const Sh=(t,n)=>{let s;switch(t.code){case de.invalid_type:t.received===je.undefined?s="Required":s=`Expected ${t.expected}, received ${t.received}`;break;case de.invalid_literal:s=`Invalid literal value, expected ${JSON.stringify(t.expected,ft.jsonStringifyReplacer)}`;break;case de.unrecognized_keys:s=`Unrecognized key(s) in object: ${ft.joinValues(t.keys,", ")}`;break;case de.invalid_union:s="Invalid input";break;case de.invalid_union_discriminator:s=`Invalid discriminator value. Expected ${ft.joinValues(t.options)}`;break;case de.invalid_enum_value:s=`Invalid enum value. Expected ${ft.joinValues(t.options)}, received '${t.received}'`;break;case de.invalid_arguments:s="Invalid function arguments";break;case de.invalid_return_type:s="Invalid function return type";break;case de.invalid_date:s="Invalid date";break;case de.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(s=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(s=`${s} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?s=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?s=`Invalid input: must end with "${t.validation.endsWith}"`:ft.assertNever(t.validation):t.validation!=="regex"?s=`Invalid ${t.validation}`:s="Invalid";break;case de.too_small:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?s=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:s="Invalid input";break;case de.too_big:t.type==="array"?s=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?s=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?s=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?s=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?s=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:s="Invalid input";break;case de.custom:s="Invalid input";break;case de.invalid_intersection_types:s="Intersection results could not be merged";break;case de.not_multiple_of:s=`Number must be a multiple of ${t.multipleOf}`;break;case de.not_finite:s="Number must be finite";break;default:s=n.defaultError,ft.assertNever(t)}return{message:s}};let G1=Sh;function K1(){return G1}const X1=t=>{const{data:n,path:s,errorMaps:a,issueData:l}=t,c=[...s,...l.path||[]],h={...l,path:c};if(l.message!==void 0)return{...l,path:c,message:l.message};let y="";const x=a.filter(w=>!!w).slice().reverse();for(const w of x)y=w(h,{data:n,defaultError:y}).message;return{...l,path:c,message:y}};function Se(t,n){const s=K1(),a=X1({issueData:n,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,s,s===Sh?void 0:Sh].filter(l=>!!l)});t.common.issues.push(a)}class Vn{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(n,s){const a=[];for(const l of s){if(l.status==="aborted")return qe;l.status==="dirty"&&n.dirty(),a.push(l.value)}return{status:n.value,value:a}}static async mergeObjectAsync(n,s){const a=[];for(const l of s){const c=await l.key,h=await l.value;a.push({key:c,value:h})}return Vn.mergeObjectSync(n,a)}static mergeObjectSync(n,s){const a={};for(const l of s){const{key:c,value:h}=l;if(c.status==="aborted"||h.status==="aborted")return qe;c.status==="dirty"&&n.dirty(),h.status==="dirty"&&n.dirty(),c.value!=="__proto__"&&(typeof h.value<"u"||l.alwaysSet)&&(a[c.value]=h.value)}return{status:n.value,value:a}}}const qe=Object.freeze({status:"aborted"}),Fl=t=>({status:"dirty",value:t}),rr=t=>({status:"valid",value:t}),Oy=t=>t.status==="aborted",by=t=>t.status==="dirty",bo=t=>t.status==="valid",Oc=t=>typeof Promise<"u"&&t instanceof Promise;var Re;(function(t){t.errToObj=n=>typeof n=="string"?{message:n}:n||{},t.toString=n=>typeof n=="string"?n:n==null?void 0:n.message})(Re||(Re={}));class Oi{constructor(n,s,a,l){this._cachedPath=[],this.parent=n,this.data=s,this._path=a,this._key=l}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 jy=(t,n)=>{if(bo(n))return{success:!0,data:n.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;const s=new _s(t.common.issues);return this._error=s,this._error}}};function rt(t){if(!t)return{};const{errorMap:n,invalid_type_error:s,required_error:a,description:l}=t;if(n&&(s||a))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return n?{errorMap:n,description:l}:{errorMap:(h,y)=>{const{message:x}=t;return h.code==="invalid_enum_value"?{message:x??y.defaultError}:typeof y.data>"u"?{message:x??a??y.defaultError}:h.code!=="invalid_type"?{message:y.defaultError}:{message:x??s??y.defaultError}},description:l}}class ot{get description(){return this._def.description}_getType(n){return fi(n.data)}_getOrReturnCtx(n,s){return s||{common:n.parent.common,data:n.data,parsedType:fi(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}_processInputParams(n){return{status:new Vn,ctx:{common:n.parent.common,data:n.data,parsedType:fi(n.data),schemaErrorMap:this._def.errorMap,path:n.path,parent:n.parent}}}_parseSync(n){const s=this._parse(n);if(Oc(s))throw new Error("Synchronous parse encountered promise.");return s}_parseAsync(n){const s=this._parse(n);return Promise.resolve(s)}parse(n,s){const a=this.safeParse(n,s);if(a.success)return a.data;throw a.error}safeParse(n,s){const a={common:{issues:[],async:(s==null?void 0:s.async)??!1,contextualErrorMap:s==null?void 0:s.errorMap},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:fi(n)},l=this._parseSync({data:n,path:a.path,parent:a});return jy(a,l)}"~validate"(n){var a,l;const s={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:fi(n)};if(!this["~standard"].async)try{const c=this._parseSync({data:n,path:[],parent:s});return bo(c)?{value:c.value}:{issues:s.common.issues}}catch(c){(l=(a=c==null?void 0:c.message)==null?void 0:a.toLowerCase())!=null&&l.includes("encountered")&&(this["~standard"].async=!0),s.common={issues:[],async:!0}}return this._parseAsync({data:n,path:[],parent:s}).then(c=>bo(c)?{value:c.value}:{issues:s.common.issues})}async parseAsync(n,s){const a=await this.safeParseAsync(n,s);if(a.success)return a.data;throw a.error}async safeParseAsync(n,s){const a={common:{issues:[],contextualErrorMap:s==null?void 0:s.errorMap,async:!0},path:(s==null?void 0:s.path)||[],schemaErrorMap:this._def.errorMap,parent:null,data:n,parsedType:fi(n)},l=this._parse({data:n,path:a.path,parent:a}),c=await(Oc(l)?l:Promise.resolve(l));return jy(a,c)}refine(n,s){const a=l=>typeof s=="string"||typeof s>"u"?{message:s}:typeof s=="function"?s(l):s;return this._refinement((l,c)=>{const h=n(l),y=()=>c.addIssue({code:de.custom,...a(l)});return typeof Promise<"u"&&h instanceof Promise?h.then(x=>x?!0:(y(),!1)):h?!0:(y(),!1)})}refinement(n,s){return this._refinement((a,l)=>n(a)?!0:(l.addIssue(typeof s=="function"?s(a,l):s),!1))}_refinement(n){return new Do({schema:this,typeName:Qe.ZodEffects,effect:{type:"refinement",refinement:n}})}superRefine(n){return this._refinement(n)}constructor(n){this.spa=this.safeParseAsync,this._def=n,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:s=>this["~validate"](s)}}optional(){return Ci.create(this,this._def)}nullable(){return Ro.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return Hr.create(this)}promise(){return Rc.create(this,this._def)}or(n){return jc.create([this,n],this._def)}and(n){return Dc.create(this,n,this._def)}transform(n){return new Do({...rt(this._def),schema:this,typeName:Qe.ZodEffects,effect:{type:"transform",transform:n}})}default(n){const s=typeof n=="function"?n:()=>n;return new _h({...rt(this._def),innerType:this,defaultValue:s,typeName:Qe.ZodDefault})}brand(){return new Sk({typeName:Qe.ZodBranded,type:this,...rt(this._def)})}catch(n){const s=typeof n=="function"?n:()=>n;return new Nh({...rt(this._def),innerType:this,catchValue:s,typeName:Qe.ZodCatch})}describe(n){const s=this.constructor;return new s({...this._def,description:n})}pipe(n){return Qh.create(this,n)}readonly(){return Eh.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}}const J1=/^c[^\s-]{8,}$/i,ek=/^[0-9a-z]+$/,tk=/^[0-9A-HJKMNP-TV-Z]{26}$/i,nk=/^[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,rk=/^[a-z0-9_-]{21}$/i,sk=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,ik=/^[-+]?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)?)??$/,ak=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,ok="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";let Wf;const lk=/^(?:(?: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])$/,uk=/^(?:(?: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])$/,ck=/^(([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]))$/,dk=/^(([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])$/,fk=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,hk=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,vv="((\\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])))",mk=new RegExp(`^${vv}$`);function xv(t){let n="[0-5]\\d";t.precision?n=`${n}\\.\\d{${t.precision}}`:t.precision==null&&(n=`${n}(\\.\\d+)?`);const s=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${n})${s}`}function pk(t){return new RegExp(`^${xv(t)}$`)}function yk(t){let n=`${vv}T${xv(t)}`;const s=[];return s.push(t.local?"Z?":"Z"),t.offset&&s.push("([+-]\\d{2}:?\\d{2})"),n=`${n}(${s.join("|")})`,new RegExp(`^${n}$`)}function gk(t,n){return!!((n==="v4"||!n)&&lk.test(t)||(n==="v6"||!n)&&ck.test(t))}function vk(t,n){if(!sk.test(t))return!1;try{const[s]=t.split(".");if(!s)return!1;const a=s.replace(/-/g,"+").replace(/_/g,"/").padEnd(s.length+(4-s.length%4)%4,"="),l=JSON.parse(atob(a));return!(typeof l!="object"||l===null||"typ"in l&&(l==null?void 0:l.typ)!=="JWT"||!l.alg||n&&l.alg!==n)}catch{return!1}}function xk(t,n){return!!((n==="v4"||!n)&&uk.test(t)||(n==="v6"||!n)&&dk.test(t))}class Ni extends ot{_parse(n){if(this._def.coerce&&(n.data=String(n.data)),this._getType(n)!==je.string){const c=this._getOrReturnCtx(n);return Se(c,{code:de.invalid_type,expected:je.string,received:c.parsedType}),qe}const a=new Vn;let l;for(const c of this._def.checks)if(c.kind==="min")n.data.length<c.value&&(l=this._getOrReturnCtx(n,l),Se(l,{code:de.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="max")n.data.length>c.value&&(l=this._getOrReturnCtx(n,l),Se(l,{code:de.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!1,message:c.message}),a.dirty());else if(c.kind==="length"){const h=n.data.length>c.value,y=n.data.length<c.value;(h||y)&&(l=this._getOrReturnCtx(n,l),h?Se(l,{code:de.too_big,maximum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}):y&&Se(l,{code:de.too_small,minimum:c.value,type:"string",inclusive:!0,exact:!0,message:c.message}),a.dirty())}else if(c.kind==="email")ak.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"email",code:de.invalid_string,message:c.message}),a.dirty());else if(c.kind==="emoji")Wf||(Wf=new RegExp(ok,"u")),Wf.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"emoji",code:de.invalid_string,message:c.message}),a.dirty());else if(c.kind==="uuid")nk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"uuid",code:de.invalid_string,message:c.message}),a.dirty());else if(c.kind==="nanoid")rk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"nanoid",code:de.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid")J1.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"cuid",code:de.invalid_string,message:c.message}),a.dirty());else if(c.kind==="cuid2")ek.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"cuid2",code:de.invalid_string,message:c.message}),a.dirty());else if(c.kind==="ulid")tk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"ulid",code:de.invalid_string,message:c.message}),a.dirty());else if(c.kind==="url")try{new URL(n.data)}catch{l=this._getOrReturnCtx(n,l),Se(l,{validation:"url",code:de.invalid_string,message:c.message}),a.dirty()}else c.kind==="regex"?(c.regex.lastIndex=0,c.regex.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"regex",code:de.invalid_string,message:c.message}),a.dirty())):c.kind==="trim"?n.data=n.data.trim():c.kind==="includes"?n.data.includes(c.value,c.position)||(l=this._getOrReturnCtx(n,l),Se(l,{code:de.invalid_string,validation:{includes:c.value,position:c.position},message:c.message}),a.dirty()):c.kind==="toLowerCase"?n.data=n.data.toLowerCase():c.kind==="toUpperCase"?n.data=n.data.toUpperCase():c.kind==="startsWith"?n.data.startsWith(c.value)||(l=this._getOrReturnCtx(n,l),Se(l,{code:de.invalid_string,validation:{startsWith:c.value},message:c.message}),a.dirty()):c.kind==="endsWith"?n.data.endsWith(c.value)||(l=this._getOrReturnCtx(n,l),Se(l,{code:de.invalid_string,validation:{endsWith:c.value},message:c.message}),a.dirty()):c.kind==="datetime"?yk(c).test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{code:de.invalid_string,validation:"datetime",message:c.message}),a.dirty()):c.kind==="date"?mk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{code:de.invalid_string,validation:"date",message:c.message}),a.dirty()):c.kind==="time"?pk(c).test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{code:de.invalid_string,validation:"time",message:c.message}),a.dirty()):c.kind==="duration"?ik.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"duration",code:de.invalid_string,message:c.message}),a.dirty()):c.kind==="ip"?gk(n.data,c.version)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"ip",code:de.invalid_string,message:c.message}),a.dirty()):c.kind==="jwt"?vk(n.data,c.alg)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"jwt",code:de.invalid_string,message:c.message}),a.dirty()):c.kind==="cidr"?xk(n.data,c.version)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"cidr",code:de.invalid_string,message:c.message}),a.dirty()):c.kind==="base64"?fk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"base64",code:de.invalid_string,message:c.message}),a.dirty()):c.kind==="base64url"?hk.test(n.data)||(l=this._getOrReturnCtx(n,l),Se(l,{validation:"base64url",code:de.invalid_string,message:c.message}),a.dirty()):ft.assertNever(c);return{status:a.value,value:n.data}}_regex(n,s,a){return this.refinement(l=>n.test(l),{validation:s,code:de.invalid_string,...Re.errToObj(a)})}_addCheck(n){return new Ni({...this._def,checks:[...this._def.checks,n]})}email(n){return this._addCheck({kind:"email",...Re.errToObj(n)})}url(n){return this._addCheck({kind:"url",...Re.errToObj(n)})}emoji(n){return this._addCheck({kind:"emoji",...Re.errToObj(n)})}uuid(n){return this._addCheck({kind:"uuid",...Re.errToObj(n)})}nanoid(n){return this._addCheck({kind:"nanoid",...Re.errToObj(n)})}cuid(n){return this._addCheck({kind:"cuid",...Re.errToObj(n)})}cuid2(n){return this._addCheck({kind:"cuid2",...Re.errToObj(n)})}ulid(n){return this._addCheck({kind:"ulid",...Re.errToObj(n)})}base64(n){return this._addCheck({kind:"base64",...Re.errToObj(n)})}base64url(n){return this._addCheck({kind:"base64url",...Re.errToObj(n)})}jwt(n){return this._addCheck({kind:"jwt",...Re.errToObj(n)})}ip(n){return this._addCheck({kind:"ip",...Re.errToObj(n)})}cidr(n){return this._addCheck({kind:"cidr",...Re.errToObj(n)})}datetime(n){return typeof n=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:n}):this._addCheck({kind:"datetime",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,offset:(n==null?void 0:n.offset)??!1,local:(n==null?void 0:n.local)??!1,...Re.errToObj(n==null?void 0:n.message)})}date(n){return this._addCheck({kind:"date",message:n})}time(n){return typeof n=="string"?this._addCheck({kind:"time",precision:null,message:n}):this._addCheck({kind:"time",precision:typeof(n==null?void 0:n.precision)>"u"?null:n==null?void 0:n.precision,...Re.errToObj(n==null?void 0:n.message)})}duration(n){return this._addCheck({kind:"duration",...Re.errToObj(n)})}regex(n,s){return this._addCheck({kind:"regex",regex:n,...Re.errToObj(s)})}includes(n,s){return this._addCheck({kind:"includes",value:n,position:s==null?void 0:s.position,...Re.errToObj(s==null?void 0:s.message)})}startsWith(n,s){return this._addCheck({kind:"startsWith",value:n,...Re.errToObj(s)})}endsWith(n,s){return this._addCheck({kind:"endsWith",value:n,...Re.errToObj(s)})}min(n,s){return this._addCheck({kind:"min",value:n,...Re.errToObj(s)})}max(n,s){return this._addCheck({kind:"max",value:n,...Re.errToObj(s)})}length(n,s){return this._addCheck({kind:"length",value:n,...Re.errToObj(s)})}nonempty(n){return this.min(1,Re.errToObj(n))}trim(){return new Ni({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new Ni({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new Ni({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(n=>n.kind==="datetime")}get isDate(){return!!this._def.checks.find(n=>n.kind==="date")}get isTime(){return!!this._def.checks.find(n=>n.kind==="time")}get isDuration(){return!!this._def.checks.find(n=>n.kind==="duration")}get isEmail(){return!!this._def.checks.find(n=>n.kind==="email")}get isURL(){return!!this._def.checks.find(n=>n.kind==="url")}get isEmoji(){return!!this._def.checks.find(n=>n.kind==="emoji")}get isUUID(){return!!this._def.checks.find(n=>n.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(n=>n.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(n=>n.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(n=>n.kind==="cuid2")}get isULID(){return!!this._def.checks.find(n=>n.kind==="ulid")}get isIP(){return!!this._def.checks.find(n=>n.kind==="ip")}get isCIDR(){return!!this._def.checks.find(n=>n.kind==="cidr")}get isBase64(){return!!this._def.checks.find(n=>n.kind==="base64")}get isBase64url(){return!!this._def.checks.find(n=>n.kind==="base64url")}get minLength(){let n=null;for(const s of this._def.checks)s.kind==="min"&&(n===null||s.value>n)&&(n=s.value);return n}get maxLength(){let n=null;for(const s of this._def.checks)s.kind==="max"&&(n===null||s.value<n)&&(n=s.value);return n}}Ni.create=t=>new Ni({checks:[],typeName:Qe.ZodString,coerce:(t==null?void 0:t.coerce)??!1,...rt(t)});function wk(t,n){const s=(t.toString().split(".")[1]||"").length,a=(n.toString().split(".")[1]||"").length,l=s>a?s:a,c=Number.parseInt(t.toFixed(l).replace(".","")),h=Number.parseInt(n.toFixed(l).replace(".",""));return c%h/10**l}class $l extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(n){if(this._def.coerce&&(n.data=Number(n.data)),this._getType(n)!==je.number){const c=this._getOrReturnCtx(n);return Se(c,{code:de.invalid_type,expected:je.number,received:c.parsedType}),qe}let a;const l=new Vn;for(const c of this._def.checks)c.kind==="int"?ft.isInteger(n.data)||(a=this._getOrReturnCtx(n,a),Se(a,{code:de.invalid_type,expected:"integer",received:"float",message:c.message}),l.dirty()):c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:de.too_small,minimum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),l.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:de.too_big,maximum:c.value,type:"number",inclusive:c.inclusive,exact:!1,message:c.message}),l.dirty()):c.kind==="multipleOf"?wk(n.data,c.value)!==0&&(a=this._getOrReturnCtx(n,a),Se(a,{code:de.not_multiple_of,multipleOf:c.value,message:c.message}),l.dirty()):c.kind==="finite"?Number.isFinite(n.data)||(a=this._getOrReturnCtx(n,a),Se(a,{code:de.not_finite,message:c.message}),l.dirty()):ft.assertNever(c);return{status:l.value,value:n.data}}gte(n,s){return this.setLimit("min",n,!0,Re.toString(s))}gt(n,s){return this.setLimit("min",n,!1,Re.toString(s))}lte(n,s){return this.setLimit("max",n,!0,Re.toString(s))}lt(n,s){return this.setLimit("max",n,!1,Re.toString(s))}setLimit(n,s,a,l){return new $l({...this._def,checks:[...this._def.checks,{kind:n,value:s,inclusive:a,message:Re.toString(l)}]})}_addCheck(n){return new $l({...this._def,checks:[...this._def.checks,n]})}int(n){return this._addCheck({kind:"int",message:Re.toString(n)})}positive(n){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Re.toString(n)})}negative(n){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Re.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Re.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Re.toString(n)})}multipleOf(n,s){return this._addCheck({kind:"multipleOf",value:n,message:Re.toString(s)})}finite(n){return this._addCheck({kind:"finite",message:Re.toString(n)})}safe(n){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Re.toString(n)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Re.toString(n)})}get minValue(){let n=null;for(const s of this._def.checks)s.kind==="min"&&(n===null||s.value>n)&&(n=s.value);return n}get maxValue(){let n=null;for(const s of this._def.checks)s.kind==="max"&&(n===null||s.value<n)&&(n=s.value);return n}get isInt(){return!!this._def.checks.find(n=>n.kind==="int"||n.kind==="multipleOf"&&ft.isInteger(n.value))}get isFinite(){let n=null,s=null;for(const a of this._def.checks){if(a.kind==="finite"||a.kind==="int"||a.kind==="multipleOf")return!0;a.kind==="min"?(s===null||a.value>s)&&(s=a.value):a.kind==="max"&&(n===null||a.value<n)&&(n=a.value)}return Number.isFinite(s)&&Number.isFinite(n)}}$l.create=t=>new $l({checks:[],typeName:Qe.ZodNumber,coerce:(t==null?void 0:t.coerce)||!1,...rt(t)});class Wl extends ot{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(n){if(this._def.coerce)try{n.data=BigInt(n.data)}catch{return this._getInvalidInput(n)}if(this._getType(n)!==je.bigint)return this._getInvalidInput(n);let a;const l=new Vn;for(const c of this._def.checks)c.kind==="min"?(c.inclusive?n.data<c.value:n.data<=c.value)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:de.too_small,type:"bigint",minimum:c.value,inclusive:c.inclusive,message:c.message}),l.dirty()):c.kind==="max"?(c.inclusive?n.data>c.value:n.data>=c.value)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:de.too_big,type:"bigint",maximum:c.value,inclusive:c.inclusive,message:c.message}),l.dirty()):c.kind==="multipleOf"?n.data%c.value!==BigInt(0)&&(a=this._getOrReturnCtx(n,a),Se(a,{code:de.not_multiple_of,multipleOf:c.value,message:c.message}),l.dirty()):ft.assertNever(c);return{status:l.value,value:n.data}}_getInvalidInput(n){const s=this._getOrReturnCtx(n);return Se(s,{code:de.invalid_type,expected:je.bigint,received:s.parsedType}),qe}gte(n,s){return this.setLimit("min",n,!0,Re.toString(s))}gt(n,s){return this.setLimit("min",n,!1,Re.toString(s))}lte(n,s){return this.setLimit("max",n,!0,Re.toString(s))}lt(n,s){return this.setLimit("max",n,!1,Re.toString(s))}setLimit(n,s,a,l){return new Wl({...this._def,checks:[...this._def.checks,{kind:n,value:s,inclusive:a,message:Re.toString(l)}]})}_addCheck(n){return new Wl({...this._def,checks:[...this._def.checks,n]})}positive(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Re.toString(n)})}negative(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Re.toString(n)})}nonpositive(n){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Re.toString(n)})}nonnegative(n){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Re.toString(n)})}multipleOf(n,s){return this._addCheck({kind:"multipleOf",value:n,message:Re.toString(s)})}get minValue(){let n=null;for(const s of this._def.checks)s.kind==="min"&&(n===null||s.value>n)&&(n=s.value);return n}get maxValue(){let n=null;for(const s of this._def.checks)s.kind==="max"&&(n===null||s.value<n)&&(n=s.value);return n}}Wl.create=t=>new Wl({checks:[],typeName:Qe.ZodBigInt,coerce:(t==null?void 0:t.coerce)??!1,...rt(t)});class Dy extends ot{_parse(n){if(this._def.coerce&&(n.data=!!n.data),this._getType(n)!==je.boolean){const a=this._getOrReturnCtx(n);return Se(a,{code:de.invalid_type,expected:je.boolean,received:a.parsedType}),qe}return rr(n.data)}}Dy.create=t=>new Dy({typeName:Qe.ZodBoolean,coerce:(t==null?void 0:t.coerce)||!1,...rt(t)});class bc extends ot{_parse(n){if(this._def.coerce&&(n.data=new Date(n.data)),this._getType(n)!==je.date){const c=this._getOrReturnCtx(n);return Se(c,{code:de.invalid_type,expected:je.date,received:c.parsedType}),qe}if(Number.isNaN(n.data.getTime())){const c=this._getOrReturnCtx(n);return Se(c,{code:de.invalid_date}),qe}const a=new Vn;let l;for(const c of this._def.checks)c.kind==="min"?n.data.getTime()<c.value&&(l=this._getOrReturnCtx(n,l),Se(l,{code:de.too_small,message:c.message,inclusive:!0,exact:!1,minimum:c.value,type:"date"}),a.dirty()):c.kind==="max"?n.data.getTime()>c.value&&(l=this._getOrReturnCtx(n,l),Se(l,{code:de.too_big,message:c.message,inclusive:!0,exact:!1,maximum:c.value,type:"date"}),a.dirty()):ft.assertNever(c);return{status:a.value,value:new Date(n.data.getTime())}}_addCheck(n){return new bc({...this._def,checks:[...this._def.checks,n]})}min(n,s){return this._addCheck({kind:"min",value:n.getTime(),message:Re.toString(s)})}max(n,s){return this._addCheck({kind:"max",value:n.getTime(),message:Re.toString(s)})}get minDate(){let n=null;for(const s of this._def.checks)s.kind==="min"&&(n===null||s.value>n)&&(n=s.value);return n!=null?new Date(n):null}get maxDate(){let n=null;for(const s of this._def.checks)s.kind==="max"&&(n===null||s.value<n)&&(n=s.value);return n!=null?new Date(n):null}}bc.create=t=>new bc({checks:[],coerce:(t==null?void 0:t.coerce)||!1,typeName:Qe.ZodDate,...rt(t)});class Ry extends ot{_parse(n){if(this._getType(n)!==je.symbol){const a=this._getOrReturnCtx(n);return Se(a,{code:de.invalid_type,expected:je.symbol,received:a.parsedType}),qe}return rr(n.data)}}Ry.create=t=>new Ry({typeName:Qe.ZodSymbol,...rt(t)});class My extends ot{_parse(n){if(this._getType(n)!==je.undefined){const a=this._getOrReturnCtx(n);return Se(a,{code:de.invalid_type,expected:je.undefined,received:a.parsedType}),qe}return rr(n.data)}}My.create=t=>new My({typeName:Qe.ZodUndefined,...rt(t)});class Iy extends ot{_parse(n){if(this._getType(n)!==je.null){const a=this._getOrReturnCtx(n);return Se(a,{code:de.invalid_type,expected:je.null,received:a.parsedType}),qe}return rr(n.data)}}Iy.create=t=>new Iy({typeName:Qe.ZodNull,...rt(t)});class Ly extends ot{constructor(){super(...arguments),this._any=!0}_parse(n){return rr(n.data)}}Ly.create=t=>new Ly({typeName:Qe.ZodAny,...rt(t)});class Fy extends ot{constructor(){super(...arguments),this._unknown=!0}_parse(n){return rr(n.data)}}Fy.create=t=>new Fy({typeName:Qe.ZodUnknown,...rt(t)});class bi extends ot{_parse(n){const s=this._getOrReturnCtx(n);return Se(s,{code:de.invalid_type,expected:je.never,received:s.parsedType}),qe}}bi.create=t=>new bi({typeName:Qe.ZodNever,...rt(t)});class Ay extends ot{_parse(n){if(this._getType(n)!==je.undefined){const a=this._getOrReturnCtx(n);return Se(a,{code:de.invalid_type,expected:je.void,received:a.parsedType}),qe}return rr(n.data)}}Ay.create=t=>new Ay({typeName:Qe.ZodVoid,...rt(t)});class Hr extends ot{_parse(n){const{ctx:s,status:a}=this._processInputParams(n),l=this._def;if(s.parsedType!==je.array)return Se(s,{code:de.invalid_type,expected:je.array,received:s.parsedType}),qe;if(l.exactLength!==null){const h=s.data.length>l.exactLength.value,y=s.data.length<l.exactLength.value;(h||y)&&(Se(s,{code:h?de.too_big:de.too_small,minimum:y?l.exactLength.value:void 0,maximum:h?l.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:l.exactLength.message}),a.dirty())}if(l.minLength!==null&&s.data.length<l.minLength.value&&(Se(s,{code:de.too_small,minimum:l.minLength.value,type:"array",inclusive:!0,exact:!1,message:l.minLength.message}),a.dirty()),l.maxLength!==null&&s.data.length>l.maxLength.value&&(Se(s,{code:de.too_big,maximum:l.maxLength.value,type:"array",inclusive:!0,exact:!1,message:l.maxLength.message}),a.dirty()),s.common.async)return Promise.all([...s.data].map((h,y)=>l.type._parseAsync(new Oi(s,h,s.path,y)))).then(h=>Vn.mergeArray(a,h));const c=[...s.data].map((h,y)=>l.type._parseSync(new Oi(s,h,s.path,y)));return Vn.mergeArray(a,c)}get element(){return this._def.type}min(n,s){return new Hr({...this._def,minLength:{value:n,message:Re.toString(s)}})}max(n,s){return new Hr({...this._def,maxLength:{value:n,message:Re.toString(s)}})}length(n,s){return new Hr({...this._def,exactLength:{value:n,message:Re.toString(s)}})}nonempty(n){return this.min(1,n)}}Hr.create=(t,n)=>new Hr({type:t,minLength:null,maxLength:null,exactLength:null,typeName:Qe.ZodArray,...rt(n)});function uo(t){if(t instanceof Bt){const n={};for(const s in t.shape){const a=t.shape[s];n[s]=Ci.create(uo(a))}return new Bt({...t._def,shape:()=>n})}else return t instanceof Hr?new Hr({...t._def,type:uo(t.element)}):t instanceof Ci?Ci.create(uo(t.unwrap())):t instanceof Ro?Ro.create(uo(t.unwrap())):t instanceof _a?_a.create(t.items.map(n=>uo(n))):t}class Bt extends ot{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;const n=this._def.shape(),s=ft.objectKeys(n);return this._cached={shape:n,keys:s},this._cached}_parse(n){if(this._getType(n)!==je.object){const w=this._getOrReturnCtx(n);return Se(w,{code:de.invalid_type,expected:je.object,received:w.parsedType}),qe}const{status:a,ctx:l}=this._processInputParams(n),{shape:c,keys:h}=this._getCached(),y=[];if(!(this._def.catchall instanceof bi&&this._def.unknownKeys==="strip"))for(const w in l.data)h.includes(w)||y.push(w);const x=[];for(const w of h){const T=c[w],E=l.data[w];x.push({key:{status:"valid",value:w},value:T._parse(new Oi(l,E,l.path,w)),alwaysSet:w in l.data})}if(this._def.catchall instanceof bi){const w=this._def.unknownKeys;if(w==="passthrough")for(const T of y)x.push({key:{status:"valid",value:T},value:{status:"valid",value:l.data[T]}});else if(w==="strict")y.length>0&&(Se(l,{code:de.unrecognized_keys,keys:y}),a.dirty());else if(w!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{const w=this._def.catchall;for(const T of y){const E=l.data[T];x.push({key:{status:"valid",value:T},value:w._parse(new Oi(l,E,l.path,T)),alwaysSet:T in l.data})}}return l.common.async?Promise.resolve().then(async()=>{const w=[];for(const T of x){const E=await T.key,_=await T.value;w.push({key:E,value:_,alwaysSet:T.alwaysSet})}return w}).then(w=>Vn.mergeObjectSync(a,w)):Vn.mergeObjectSync(a,x)}get shape(){return this._def.shape()}strict(n){return Re.errToObj,new Bt({...this._def,unknownKeys:"strict",...n!==void 0?{errorMap:(s,a)=>{var c,h;const l=((h=(c=this._def).errorMap)==null?void 0:h.call(c,s,a).message)??a.defaultError;return s.code==="unrecognized_keys"?{message:Re.errToObj(n).message??l}:{message:l}}}:{}})}strip(){return new Bt({...this._def,unknownKeys:"strip"})}passthrough(){return new Bt({...this._def,unknownKeys:"passthrough"})}extend(n){return new Bt({...this._def,shape:()=>({...this._def.shape(),...n})})}merge(n){return new Bt({unknownKeys:n._def.unknownKeys,catchall:n._def.catchall,shape:()=>({...this._def.shape(),...n._def.shape()}),typeName:Qe.ZodObject})}setKey(n,s){return this.augment({[n]:s})}catchall(n){return new Bt({...this._def,catchall:n})}pick(n){const s={};for(const a of ft.objectKeys(n))n[a]&&this.shape[a]&&(s[a]=this.shape[a]);return new Bt({...this._def,shape:()=>s})}omit(n){const s={};for(const a of ft.objectKeys(this.shape))n[a]||(s[a]=this.shape[a]);return new Bt({...this._def,shape:()=>s})}deepPartial(){return uo(this)}partial(n){const s={};for(const a of ft.objectKeys(this.shape)){const l=this.shape[a];n&&!n[a]?s[a]=l:s[a]=l.optional()}return new Bt({...this._def,shape:()=>s})}required(n){const s={};for(const a of ft.objectKeys(this.shape))if(n&&!n[a])s[a]=this.shape[a];else{let c=this.shape[a];for(;c instanceof Ci;)c=c._def.innerType;s[a]=c}return new Bt({...this._def,shape:()=>s})}keyof(){return wv(ft.objectKeys(this.shape))}}Bt.create=(t,n)=>new Bt({shape:()=>t,unknownKeys:"strip",catchall:bi.create(),typeName:Qe.ZodObject,...rt(n)});Bt.strictCreate=(t,n)=>new Bt({shape:()=>t,unknownKeys:"strict",catchall:bi.create(),typeName:Qe.ZodObject,...rt(n)});Bt.lazycreate=(t,n)=>new Bt({shape:t,unknownKeys:"strip",catchall:bi.create(),typeName:Qe.ZodObject,...rt(n)});class jc extends ot{_parse(n){const{ctx:s}=this._processInputParams(n),a=this._def.options;function l(c){for(const y of c)if(y.result.status==="valid")return y.result;for(const y of c)if(y.result.status==="dirty")return s.common.issues.push(...y.ctx.common.issues),y.result;const h=c.map(y=>new _s(y.ctx.common.issues));return Se(s,{code:de.invalid_union,unionErrors:h}),qe}if(s.common.async)return Promise.all(a.map(async c=>{const h={...s,common:{...s.common,issues:[]},parent:null};return{result:await c._parseAsync({data:s.data,path:s.path,parent:h}),ctx:h}})).then(l);{let c;const h=[];for(const x of a){const w={...s,common:{...s.common,issues:[]},parent:null},T=x._parseSync({data:s.data,path:s.path,parent:w});if(T.status==="valid")return T;T.status==="dirty"&&!c&&(c={result:T,ctx:w}),w.common.issues.length&&h.push(w.common.issues)}if(c)return s.common.issues.push(...c.ctx.common.issues),c.result;const y=h.map(x=>new _s(x));return Se(s,{code:de.invalid_union,unionErrors:y}),qe}}get options(){return this._def.options}}jc.create=(t,n)=>new jc({options:t,typeName:Qe.ZodUnion,...rt(n)});function kh(t,n){const s=fi(t),a=fi(n);if(t===n)return{valid:!0,data:t};if(s===je.object&&a===je.object){const l=ft.objectKeys(n),c=ft.objectKeys(t).filter(y=>l.indexOf(y)!==-1),h={...t,...n};for(const y of c){const x=kh(t[y],n[y]);if(!x.valid)return{valid:!1};h[y]=x.data}return{valid:!0,data:h}}else if(s===je.array&&a===je.array){if(t.length!==n.length)return{valid:!1};const l=[];for(let c=0;c<t.length;c++){const h=t[c],y=n[c],x=kh(h,y);if(!x.valid)return{valid:!1};l.push(x.data)}return{valid:!0,data:l}}else return s===je.date&&a===je.date&&+t==+n?{valid:!0,data:t}:{valid:!1}}class Dc extends ot{_parse(n){const{status:s,ctx:a}=this._processInputParams(n),l=(c,h)=>{if(Oy(c)||Oy(h))return qe;const y=kh(c.value,h.value);return y.valid?((by(c)||by(h))&&s.dirty(),{status:s.value,value:y.data}):(Se(a,{code:de.invalid_intersection_types}),qe)};return a.common.async?Promise.all([this._def.left._parseAsync({data:a.data,path:a.path,parent:a}),this._def.right._parseAsync({data:a.data,path:a.path,parent:a})]).then(([c,h])=>l(c,h)):l(this._def.left._parseSync({data:a.data,path:a.path,parent:a}),this._def.right._parseSync({data:a.data,path:a.path,parent:a}))}}Dc.create=(t,n,s)=>new Dc({left:t,right:n,typeName:Qe.ZodIntersection,...rt(s)});class _a extends ot{_parse(n){const{status:s,ctx:a}=this._processInputParams(n);if(a.parsedType!==je.array)return Se(a,{code:de.invalid_type,expected:je.array,received:a.parsedType}),qe;if(a.data.length<this._def.items.length)return Se(a,{code:de.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),qe;!this._def.rest&&a.data.length>this._def.items.length&&(Se(a,{code:de.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),s.dirty());const c=[...a.data].map((h,y)=>{const x=this._def.items[y]||this._def.rest;return x?x._parse(new Oi(a,h,a.path,y)):null}).filter(h=>!!h);return a.common.async?Promise.all(c).then(h=>Vn.mergeArray(s,h)):Vn.mergeArray(s,c)}get items(){return this._def.items}rest(n){return new _a({...this._def,rest:n})}}_a.create=(t,n)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new _a({items:t,typeName:Qe.ZodTuple,rest:null,...rt(n)})};class Py extends ot{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(n){const{status:s,ctx:a}=this._processInputParams(n);if(a.parsedType!==je.map)return Se(a,{code:de.invalid_type,expected:je.map,received:a.parsedType}),qe;const l=this._def.keyType,c=this._def.valueType,h=[...a.data.entries()].map(([y,x],w)=>({key:l._parse(new Oi(a,y,a.path,[w,"key"])),value:c._parse(new Oi(a,x,a.path,[w,"value"]))}));if(a.common.async){const y=new Map;return Promise.resolve().then(async()=>{for(const x of h){const w=await x.key,T=await x.value;if(w.status==="aborted"||T.status==="aborted")return qe;(w.status==="dirty"||T.status==="dirty")&&s.dirty(),y.set(w.value,T.value)}return{status:s.value,value:y}})}else{const y=new Map;for(const x of h){const w=x.key,T=x.value;if(w.status==="aborted"||T.status==="aborted")return qe;(w.status==="dirty"||T.status==="dirty")&&s.dirty(),y.set(w.value,T.value)}return{status:s.value,value:y}}}}Py.create=(t,n,s)=>new Py({valueType:n,keyType:t,typeName:Qe.ZodMap,...rt(s)});class Hl extends ot{_parse(n){const{status:s,ctx:a}=this._processInputParams(n);if(a.parsedType!==je.set)return Se(a,{code:de.invalid_type,expected:je.set,received:a.parsedType}),qe;const l=this._def;l.minSize!==null&&a.data.size<l.minSize.value&&(Se(a,{code:de.too_small,minimum:l.minSize.value,type:"set",inclusive:!0,exact:!1,message:l.minSize.message}),s.dirty()),l.maxSize!==null&&a.data.size>l.maxSize.value&&(Se(a,{code:de.too_big,maximum:l.maxSize.value,type:"set",inclusive:!0,exact:!1,message:l.maxSize.message}),s.dirty());const c=this._def.valueType;function h(x){const w=new Set;for(const T of x){if(T.status==="aborted")return qe;T.status==="dirty"&&s.dirty(),w.add(T.value)}return{status:s.value,value:w}}const y=[...a.data.values()].map((x,w)=>c._parse(new Oi(a,x,a.path,w)));return a.common.async?Promise.all(y).then(x=>h(x)):h(y)}min(n,s){return new Hl({...this._def,minSize:{value:n,message:Re.toString(s)}})}max(n,s){return new Hl({...this._def,maxSize:{value:n,message:Re.toString(s)}})}size(n,s){return this.min(n,s).max(n,s)}nonempty(n){return this.min(1,n)}}Hl.create=(t,n)=>new Hl({valueType:t,minSize:null,maxSize:null,typeName:Qe.ZodSet,...rt(n)});class Uy extends ot{get schema(){return this._def.getter()}_parse(n){const{ctx:s}=this._processInputParams(n);return this._def.getter()._parse({data:s.data,path:s.path,parent:s})}}Uy.create=(t,n)=>new Uy({getter:t,typeName:Qe.ZodLazy,...rt(n)});class Vy extends ot{_parse(n){if(n.data!==this._def.value){const s=this._getOrReturnCtx(n);return Se(s,{received:s.data,code:de.invalid_literal,expected:this._def.value}),qe}return{status:"valid",value:n.data}}get value(){return this._def.value}}Vy.create=(t,n)=>new Vy({value:t,typeName:Qe.ZodLiteral,...rt(n)});function wv(t,n){return new jo({values:t,typeName:Qe.ZodEnum,...rt(n)})}class jo extends ot{_parse(n){if(typeof n.data!="string"){const s=this._getOrReturnCtx(n),a=this._def.values;return Se(s,{expected:ft.joinValues(a),received:s.parsedType,code:de.invalid_type}),qe}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(n.data)){const s=this._getOrReturnCtx(n),a=this._def.values;return Se(s,{received:s.data,code:de.invalid_enum_value,options:a}),qe}return rr(n.data)}get options(){return this._def.values}get enum(){const n={};for(const s of this._def.values)n[s]=s;return n}get Values(){const n={};for(const s of this._def.values)n[s]=s;return n}get Enum(){const n={};for(const s of this._def.values)n[s]=s;return n}extract(n,s=this._def){return jo.create(n,{...this._def,...s})}exclude(n,s=this._def){return jo.create(this.options.filter(a=>!n.includes(a)),{...this._def,...s})}}jo.create=wv;class zy extends ot{_parse(n){const s=ft.getValidEnumValues(this._def.values),a=this._getOrReturnCtx(n);if(a.parsedType!==je.string&&a.parsedType!==je.number){const l=ft.objectValues(s);return Se(a,{expected:ft.joinValues(l),received:a.parsedType,code:de.invalid_type}),qe}if(this._cache||(this._cache=new Set(ft.getValidEnumValues(this._def.values))),!this._cache.has(n.data)){const l=ft.objectValues(s);return Se(a,{received:a.data,code:de.invalid_enum_value,options:l}),qe}return rr(n.data)}get enum(){return this._def.values}}zy.create=(t,n)=>new zy({values:t,typeName:Qe.ZodNativeEnum,...rt(n)});class Rc extends ot{unwrap(){return this._def.type}_parse(n){const{ctx:s}=this._processInputParams(n);if(s.parsedType!==je.promise&&s.common.async===!1)return Se(s,{code:de.invalid_type,expected:je.promise,received:s.parsedType}),qe;const a=s.parsedType===je.promise?s.data:Promise.resolve(s.data);return rr(a.then(l=>this._def.type.parseAsync(l,{path:s.path,errorMap:s.common.contextualErrorMap})))}}Rc.create=(t,n)=>new Rc({type:t,typeName:Qe.ZodPromise,...rt(n)});class Do extends ot{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===Qe.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(n){const{status:s,ctx:a}=this._processInputParams(n),l=this._def.effect||null,c={addIssue:h=>{Se(a,h),h.fatal?s.abort():s.dirty()},get path(){return a.path}};if(c.addIssue=c.addIssue.bind(c),l.type==="preprocess"){const h=l.transform(a.data,c);if(a.common.async)return Promise.resolve(h).then(async y=>{if(s.value==="aborted")return qe;const x=await this._def.schema._parseAsync({data:y,path:a.path,parent:a});return x.status==="aborted"?qe:x.status==="dirty"||s.value==="dirty"?Fl(x.value):x});{if(s.value==="aborted")return qe;const y=this._def.schema._parseSync({data:h,path:a.path,parent:a});return y.status==="aborted"?qe:y.status==="dirty"||s.value==="dirty"?Fl(y.value):y}}if(l.type==="refinement"){const h=y=>{const x=l.refinement(y,c);if(a.common.async)return Promise.resolve(x);if(x instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return y};if(a.common.async===!1){const y=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});return y.status==="aborted"?qe:(y.status==="dirty"&&s.dirty(),h(y.value),{status:s.value,value:y.value})}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(y=>y.status==="aborted"?qe:(y.status==="dirty"&&s.dirty(),h(y.value).then(()=>({status:s.value,value:y.value}))))}if(l.type==="transform")if(a.common.async===!1){const h=this._def.schema._parseSync({data:a.data,path:a.path,parent:a});if(!bo(h))return qe;const y=l.transform(h.value,c);if(y instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:s.value,value:y}}else return this._def.schema._parseAsync({data:a.data,path:a.path,parent:a}).then(h=>bo(h)?Promise.resolve(l.transform(h.value,c)).then(y=>({status:s.value,value:y})):qe);ft.assertNever(l)}}Do.create=(t,n,s)=>new Do({schema:t,typeName:Qe.ZodEffects,effect:n,...rt(s)});Do.createWithPreprocess=(t,n,s)=>new Do({schema:n,effect:{type:"preprocess",transform:t},typeName:Qe.ZodEffects,...rt(s)});class Ci extends ot{_parse(n){return this._getType(n)===je.undefined?rr(void 0):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Ci.create=(t,n)=>new Ci({innerType:t,typeName:Qe.ZodOptional,...rt(n)});class Ro extends ot{_parse(n){return this._getType(n)===je.null?rr(null):this._def.innerType._parse(n)}unwrap(){return this._def.innerType}}Ro.create=(t,n)=>new Ro({innerType:t,typeName:Qe.ZodNullable,...rt(n)});class _h extends ot{_parse(n){const{ctx:s}=this._processInputParams(n);let a=s.data;return s.parsedType===je.undefined&&(a=this._def.defaultValue()),this._def.innerType._parse({data:a,path:s.path,parent:s})}removeDefault(){return this._def.innerType}}_h.create=(t,n)=>new _h({innerType:t,typeName:Qe.ZodDefault,defaultValue:typeof n.default=="function"?n.default:()=>n.default,...rt(n)});class Nh extends ot{_parse(n){const{ctx:s}=this._processInputParams(n),a={...s,common:{...s.common,issues:[]}},l=this._def.innerType._parse({data:a.data,path:a.path,parent:{...a}});return Oc(l)?l.then(c=>({status:"valid",value:c.status==="valid"?c.value:this._def.catchValue({get error(){return new _s(a.common.issues)},input:a.data})})):{status:"valid",value:l.status==="valid"?l.value:this._def.catchValue({get error(){return new _s(a.common.issues)},input:a.data})}}removeCatch(){return this._def.innerType}}Nh.create=(t,n)=>new Nh({innerType:t,typeName:Qe.ZodCatch,catchValue:typeof n.catch=="function"?n.catch:()=>n.catch,...rt(n)});class $y extends ot{_parse(n){if(this._getType(n)!==je.nan){const a=this._getOrReturnCtx(n);return Se(a,{code:de.invalid_type,expected:je.nan,received:a.parsedType}),qe}return{status:"valid",value:n.data}}}$y.create=t=>new $y({typeName:Qe.ZodNaN,...rt(t)});class Sk extends ot{_parse(n){const{ctx:s}=this._processInputParams(n),a=s.data;return this._def.type._parse({data:a,path:s.path,parent:s})}unwrap(){return this._def.type}}class Qh extends ot{_parse(n){const{status:s,ctx:a}=this._processInputParams(n);if(a.common.async)return(async()=>{const c=await this._def.in._parseAsync({data:a.data,path:a.path,parent:a});return c.status==="aborted"?qe:c.status==="dirty"?(s.dirty(),Fl(c.value)):this._def.out._parseAsync({data:c.value,path:a.path,parent:a})})();{const l=this._def.in._parseSync({data:a.data,path:a.path,parent:a});return l.status==="aborted"?qe:l.status==="dirty"?(s.dirty(),{status:"dirty",value:l.value}):this._def.out._parseSync({data:l.value,path:a.path,parent:a})}}static create(n,s){return new Qh({in:n,out:s,typeName:Qe.ZodPipeline})}}class Eh extends ot{_parse(n){const s=this._def.innerType._parse(n),a=l=>(bo(l)&&(l.value=Object.freeze(l.value)),l);return Oc(s)?s.then(l=>a(l)):a(s)}unwrap(){return this._def.innerType}}Eh.create=(t,n)=>new Eh({innerType:t,typeName:Qe.ZodReadonly,...rt(n)});var Qe;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(Qe||(Qe={}));const kk=Ni.create;bi.create;Hr.create;jc.create;Dc.create;_a.create;jo.create;Rc.create;Ci.create;Ro.create;function _k({value:t,onChange:n}){const s=Fg(),[a,l]=Z.useState(""),c=s.data??[],h=[...new Set([...c,...t])].sort(),y=w=>{t.includes(w)?n(t.filter(T=>T!==w)):n([...t,w].sort())},x=()=>{const w=a.trim();w!==""&&!t.includes(w)&&n([...t,w].sort()),l("")};return d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["MACHINES ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(pick targets; none = runs nowhere)"})]}),h.length===0?d.jsx("div",{className:"machine-empty",children:"No machines known yet — add one below."}):d.jsx("div",{className:"machine-chips",children:h.map(w=>d.jsx("button",{type:"button",className:t.includes(w)?"machine-chip on":"machine-chip",onClick:()=>y(w),children:w},w))}),d.jsxs("div",{className:"machine-add",children:[d.jsx("input",{type:"text",className:"form-input",placeholder:"add a machine name",autoComplete:"off",spellCheck:!1,value:a,onChange:w=>l(w.target.value)}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:x,children:"ADD"})]})]})}const Wy="Copy of ";function Nk(t){return t.startsWith(Wy)?t:`${Wy}${t}`}function Ek(t){return t.map(n=>n.branch&&n.branch.trim()!==""?`${n.repository} ${n.branch}`:n.repository).join(`
`)}function Tk(t){const n=[];for(const s of t.split(`
`)){const a=s.trim().split(/\s+/).filter(Boolean),l=a[0];l&&n.push({repository:l,branch:a[1]??null})}return n}function Ck(t){return t.join(", ")}function Ok(t){return t.split(",").map(n=>n.trim()).filter(n=>n!=="")}function bk(t){const n=t.trim();return n===""||!/^\d+$/.test(n)?null:Number(n)}const jk=[["3600","1h"],["86400","1d"],["604800","7d"],["2592000","30d"]];function Dk(t){return t==null?"default":t===0?"0s":t%86400===0?`${t/86400}d`:t%3600===0?`${t/3600}h`:t%60===0?`${t/60}m`:`${t}s`}const gc=kk().trim().min(1),Rk=["claude","codex"],Mk=[["@daily","@daily"],["@hourly","@hourly"],["@weekly","@weekly"],["@monthly","@monthly"],["0 0 9 * * 1-5 *","weekdays 9am"],["0 0 * * * * *","every hour"]];function Hy(t){return{title:(t==null?void 0:t.title)??"",schedule:(t==null?void 0:t.schedule)??"",agent:(t==null?void 0:t.agent)??"claude",model:(t==null?void 0:t.model)??"",prompt:(t==null?void 0:t.prompt)??"",goal:(t==null?void 0:t.goal)??"",reposRaw:Ek((t==null?void 0:t.repositories)??[]),machines:(t==null?void 0:t.machines)??[],tagsRaw:Ck((t==null?void 0:t.tags)??[]),ttlRaw:(t==null?void 0:t.ttl_secs)!=null?String(t.ttl_secs):"",enabled:(t==null?void 0:t.enabled)??!0}}function Hf({initial:t,mode:n,saving:s,onCancel:a,onSave:l}){const c=Ew(),h=c.data&&c.data.length>0?c.data:Rk,{register:y,watch:x,setValue:w,handleSubmit:T,reset:E}=Y1({defaultValues:Hy(t)});Z.useEffect(()=>{E(Hy(t))},[t]);const _=x(),S=gc.safeParse(_.title).success&&gc.safeParse(_.schedule).success&&gc.safeParse(_.agent).success&&gc.safeParse(_.prompt).success,[O,C]=kS(_.schedule),b=_.schedule.trim()===""?"cron-preview":O?"cron-preview ok":"cron-preview bad",I=T(J=>{l({schedule:J.schedule,title:J.title,agent:J.agent,model:J.model.trim()===""?null:J.model,prompt:J.prompt,goal:J.goal.trim()===""?null:J.goal,repositories:Tk(J.reposRaw),machines:J.machines,enabled:J.enabled,ttl_secs:bk(J.ttlRaw),tags:Ok(J.tagsRaw)})}),j=n==="edit",F=s?"…":j?"SAVE CHANGES":"CREATE ROUTINE",U=d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"form-group",children:[d.jsx("label",{className:"form-label",children:"TITLE*"}),d.jsx("input",{className:"form-input",placeholder:"nightly triage",autoComplete:"off",spellCheck:!1,...y("title")})]}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{className:"form-label",children:"SCHEDULE*"}),d.jsx("input",{className:"form-input",placeholder:"sec min hour dom month dow year",...y("schedule")}),d.jsx("div",{className:"cron-presets",children:Mk.map(([J,ne])=>d.jsx("button",{type:"button",className:"preset-btn",onClick:()=>w("schedule",J),children:ne},J))}),d.jsx("div",{className:b,children:C})]}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{className:"form-label",children:"AGENT*"}),d.jsx("select",{className:"form-select",...y("agent"),children:h.map(J=>d.jsx("option",{value:J,children:J},J))})]}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["MODEL ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(optional; blank = agent default)"})]}),d.jsx("input",{className:"form-input",placeholder:"claude-sonnet-4-6",...y("model")})]}),d.jsxs("div",{className:"form-group",children:[d.jsx("label",{className:"form-label",children:"PROMPT*"}),d.jsx("textarea",{className:"form-textarea",rows:6,placeholder:"Review open PRs and summarize…",...y("prompt")})]}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["GOAL ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(optional; ≤5 lines — the why)"})]}),d.jsx("textarea",{className:"form-textarea",rows:3,placeholder:"Keep the PR backlog under control…",...y("goal")})]}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["REPOSITORIES ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(one url [branch] per line)"})]}),d.jsx("textarea",{className:"form-textarea",rows:3,placeholder:"https://github.com/org/repo main",...y("reposRaw")})]}),d.jsx(_k,{value:_.machines,onChange:J=>w("machines",J)}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["TAGS ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(comma-separated)"})]}),d.jsx("input",{className:"form-input",placeholder:"triage, nightly",...y("tagsRaw")})]}),d.jsxs("div",{className:"form-group",children:[d.jsxs("label",{className:"form-label",children:["WORKBENCH TTL ",d.jsx("span",{style:{color:"var(--text-faint)"},children:"(seconds; blank = server default)"})]}),d.jsx("input",{className:"form-input",type:"number",min:0,placeholder:"604800",...y("ttlRaw")}),d.jsx("div",{className:"ttl-presets",children:jk.map(([J,ne])=>d.jsx("button",{type:"button",className:"preset-btn",onClick:()=>w("ttlRaw",J),children:ne},J))})]}),d.jsxs("div",{className:"toggle-row",children:[d.jsx("span",{children:"ENABLED"}),d.jsxs("label",{className:"toggle",children:[d.jsx("input",{type:"checkbox",...y("enabled")}),d.jsx("div",{className:"toggle-track"})]})]})]}),$=d.jsxs("div",{className:"modal-ft",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:a,children:"CANCEL"}),d.jsx("button",{type:"button",className:"btn btn-primary btn-sm",disabled:s||!S,onClick:I,children:F})]});return j?d.jsx("div",{className:"overlay open",children:d.jsxs("div",{className:"dialog modal",children:[d.jsxs("div",{className:"modal-hd",children:[d.jsx("div",{className:"modal-title",children:"EDIT ROUTINE"}),d.jsx("button",{type:"button",className:"modal-x",title:"Close","aria-label":"Close",onClick:a,children:"✕"})]}),d.jsx("div",{className:"modal-body",children:U}),$]})}):d.jsxs("main",{className:"create-page",children:[d.jsxs("div",{className:"page-hd",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:a,children:"← BACK"}),d.jsx("div",{className:"page-title",children:n==="clone"?"NEW ROUTINE (FROM CLONE)":"NEW ROUTINE"})]}),d.jsxs("div",{className:"page-card card",children:[d.jsx("div",{className:"modal-body",children:U}),$]})]})}function Sv(t){if(t==="")return[];const n=t.split(`
`);return n.length>0&&n[n.length-1]===""&&n.pop(),n}function Ik(t,n){const s=n.trim().toLowerCase(),a=[],l=Sv(t);for(let c=0;c<l.length;c++){const h=l[c]??"";(s===""||h.toLowerCase().includes(s))&&a.push([c+1,h])}return a}function Lk(t,n){const s=Sv(t),a=s.length,l=n.trim().toLowerCase();return l===""?[a,a]:[s.filter(h=>h.toLowerCase().includes(l)).length,a]}function Fk(t,n){const s=n.trim().toLowerCase();if(s==="")return[[!1,t]];const a=Array.from(t),l=a.map(T=>T.toLowerCase()),h=Array.from(s).length,y=[];let x=0,w=0;for(;x<a.length;){const T=l.slice(x,x+h).join("");T===s&&T.length>0?(x>w&&y.push([!1,a.slice(w,x).join("")]),y.push([!0,a.slice(x,x+h).join("")]),x+=h,w=x):x++}return w<a.length&&y.push([!1,a.slice(w).join("")]),y}function Ak({text:t,query:n}){return d.jsx(d.Fragment,{children:Fk(t,n).map(([s,a],l)=>s?d.jsx("mark",{className:"log-hl",children:a},l):d.jsx("span",{children:a},l))})}function kv({content:t,loading:n,err:s}){const[a,l]=Z.useState(""),c=Z.useRef(null);Z.useEffect(()=>{const y=c.current;y&&(y.scrollTop=y.scrollHeight)},[t==null?void 0:t.length]);let h=null;if(n)h=d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})});else if(s!==void 0)h=d.jsxs("div",{className:"logs-error",children:["Error: ",s]});else if(t!==void 0)if(t==="")h=d.jsx("div",{className:"logs-empty",children:"— no logs yet —"});else{const y=Ik(t,a),[x,w]=Lk(t,a),T=a.trim()===""?`${w} lines`:`${x} / ${w} matches`;h=d.jsxs(d.Fragment,{children:[d.jsxs("div",{className:"log-search",children:[d.jsx("input",{type:"search",className:"log-search-input",placeholder:"Search logs…","aria-label":"Search log lines",value:a,onChange:E=>l(E.target.value)}),a!==""&&d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Clear search","aria-label":"Clear search",onClick:()=>l(""),children:"✕"}),d.jsx("span",{className:"log-match-count",children:T})]}),d.jsx("div",{className:"log-lines",children:y.map(([E,_])=>d.jsxs("div",{className:"log-line",children:[d.jsx("span",{className:"log-ln",children:E}),d.jsx("span",{className:"log-lc",children:d.jsx(Ak,{text:_,query:a})})]},E))})]})}return d.jsx("div",{className:"logs-wrap",ref:c,children:h})}function Pk({id:t,title:n,onBack:s}){const a=Mw(t),[l,c]=Z.useState(void 0),h=Lw(t,l??"",l!==void 0),y=a.data??[],x=Math.floor(Date.now()/1e3);return d.jsxs("main",{className:"logs-page",children:[d.jsxs("div",{className:"page-hd",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:s,children:"← BACK"}),d.jsxs("div",{className:"page-title",children:["HISTORY / ",n]}),a.dataUpdatedAt>0&&d.jsx("span",{className:"page-freshness",children:Ah(Math.max(0,(Date.now()-a.dataUpdatedAt)/1e3))}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Refresh","aria-label":"Refresh",onClick:()=>void a.refetch(),children:"↻"})]}),a.isLoading?d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})}):a.isError?d.jsxs("div",{className:"logs-error",children:["Error: ",a.error.message]}):y.length===0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⧗"}),d.jsx("div",{className:"empty-msg",children:"NO RUNS YET"})]})}):d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{children:"STARTED"}),d.jsx("th",{children:"STATUS"}),d.jsx("th",{children:"DURATION"}),d.jsx("th",{children:"EXIT CODE"}),d.jsx("th",{children:"RETENTION"}),d.jsx("th",{})]})}),d.jsx("tbody",{children:y.map(w=>{const T=l===w.workbench;return d.jsxs("tr",{className:T?"row-selected":"",children:[d.jsx("td",{children:d.jsx("div",{className:"cell-time",title:w.workbench,children:Oo(w.started_at)})}),d.jsx("td",{children:d.jsx("span",{className:Kg(w.status),children:$h(w.status)})}),d.jsx("td",{children:w.finished_at!=null?Xg(w.started_at,w.finished_at):"—"}),d.jsx("td",{children:w.exit_code??"—"}),d.jsx("td",{children:w.retention_expires_at!=null?d.jsx("span",{className:"cell-meta",children:zS(x,w.retention_expires_at)}):"—"}),d.jsx("td",{children:d.jsx("button",{type:"button",className:"act-btn logs",onClick:()=>c(T?void 0:w.workbench),children:T?"HIDE LOG":"VIEW LOG"})})]},w.workbench)})})]})}),l!==void 0&&d.jsx(kv,{content:h.data,loading:h.isLoading,err:h.isError?h.error.message:void 0})]})}function Uk({id:t,title:n,onBack:s}){const[a,l]=Z.useState(Vc),c=Iw(t);Z.useEffect(()=>{const y=Uc(a);if(y===void 0)return;const x=window.setInterval(()=>void c.refetch(),y);return()=>window.clearInterval(x)},[a,t]);const h=y=>{l(y),zc(y)};return d.jsxs("main",{className:"logs-page",children:[d.jsxs("div",{className:"page-hd",children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:s,children:"← BACK"}),d.jsxs("div",{className:"page-title",children:["LOGS / ",n]}),d.jsx($c,{token:a,updatedAtMs:c.dataUpdatedAt,onChange:h}),d.jsx("button",{type:"button",className:"btn-refresh",title:"Refresh","aria-label":"Refresh",onClick:()=>void c.refetch(),children:"↻"})]}),d.jsx(kv,{content:c.data,loading:c.isLoading,err:c.isError?c.error.message:void 0})]})}const Bf=6,By=2,Zf=14,Vk={running:"var(--warn)",success:"var(--ok)",failed:"var(--err)",unknown:"var(--text-faint)"};function zk({runs:t}){if(t.length===0)return d.jsx("span",{className:"spark-empty muted",children:"—"});const n=t.length*Bf-By;return d.jsx("svg",{className:"spark",role:"img","aria-label":`Last ${t.length} runs`,width:n,height:Zf,viewBox:`0 0 ${n} ${Zf}`,children:t.map((s,a)=>d.jsx("rect",{x:a*Bf,y:0,width:Bf-By,height:Zf,rx:1,fill:Vk[s.status],className:`spark-tick ${s.status}`,children:d.jsx("title",{children:`${$h(s.status)} · ${Oo(s.started_at)}`})},`${s.workbench}-${a}`))})}function $k({routine:t,now:n}){if(!t.enabled)return d.jsx("span",{className:"cell-next muted",children:"paused"});if(ka(t,n)){const l=i1(t,n);return d.jsxs(d.Fragment,{children:[d.jsx("span",{className:"cell-next muted",children:"snoozed"}),l!==""&&d.jsx("div",{className:"cell-next-until muted",children:l})]})}const s=Ao(t.schedule,n);if(s===void 0)return d.jsx("span",{className:"cell-next muted",children:"—"});const a=s.getTime()-n.getTime()<=Wh;return d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"cell-next-when",children:Vh(n,s)}),d.jsx("div",{className:a?"cell-next-until soon":"cell-next-until",children:Wc(n,s)})]})}function Wk({routine:t,now:n,runs:s,selected:a,onSelect:l,onEdit:c,onClone:h,onDelete:y,onToggle:x,onTrigger:w,onLogs:T,onHistory:E,onFlags:_}){var he;const[S,O]=Z.useState(!1),C=t.schedule_description??"—",b=Oo(t.updated_at),I=t.repositories??[],j=(t.machines??[]).filter(ye=>ye.trim()!==""),F=t.tags??[],U=(he=t.goal)!=null&&he.trim()?t.goal.split(`
`)[0]:void 0,$=yh(t),J=t.last_manual_trigger_at!=null&&(t.last_scheduled_trigger_at==null||t.last_manual_trigger_at>=t.last_scheduled_trigger_at),ne=Ec(t,n);return d.jsxs("tr",{className:a?"row-selected":"",children:[d.jsx("td",{className:"col-select",children:d.jsx("input",{type:"checkbox",checked:a,onChange:()=>l(t.id),"aria-label":`Select ${t.title}`})}),d.jsxs("td",{children:[d.jsx("div",{className:"cell-schedule",title:t.id,children:t.title}),U!==void 0&&d.jsx("div",{className:"cell-goal",title:t.goal??"",children:U})]}),d.jsxs("td",{children:[d.jsx("div",{className:"cell-schedule",children:t.schedule}),d.jsx("div",{className:"cell-schedule-human",children:C}),d.jsx("button",{type:"button",className:S?"sched-preview-btn open":"sched-preview-btn","aria-expanded":S,onClick:ye=>{ye.stopPropagation(),O(ke=>!ke)},children:"▸ fires"}),S&&d.jsx(Hk,{schedule:t.schedule,now:n})]}),d.jsx("td",{children:d.jsx($k,{routine:t,now:n})}),d.jsx("td",{children:$===void 0?d.jsx("span",{className:"muted",children:"—"}):d.jsxs("div",{className:"cell-triggered",children:[J?"↻":"⏱"," ",Oo($)]})}),d.jsx("td",{children:d.jsx(zk,{runs:s})}),d.jsxs("td",{children:[d.jsxs("span",{className:"cell-handler",title:t.agent_registered?"agent registered":"agent config missing",children:[d.jsx("span",{className:t.agent_registered?"handler-dot ok":"handler-dot warn"}),t.agent]}),t.model&&d.jsx("div",{className:"cell-goal",children:t.model})]}),d.jsx("td",{children:I.length===0?"—":d.jsx("span",{title:I.map(ye=>ye.repository).join(`
`),children:I.length})}),d.jsx("td",{className:j.length===0?"cell-meta cell-no-machines":"cell-meta",children:j.length===0?"—":d.jsx("span",{title:j.join(`
`),children:j.length})}),d.jsx("td",{children:F.length===0?"—":d.jsx("span",{title:F.join(", "),children:F.join(", ")})}),d.jsx("td",{children:d.jsx("span",{className:"cell-meta",title:"workbench retention for finished runs",children:Dk(t.ttl_secs)})}),d.jsx("td",{children:d.jsx("span",{className:s1(ne),title:gh(ne),children:gh(ne)})}),d.jsx("td",{children:d.jsxs("label",{className:"toggle",children:[d.jsx("input",{type:"checkbox",checked:t.enabled,onChange:ye=>x(t.id,ye.target.checked)}),d.jsx("div",{className:"toggle-track"})]})}),d.jsx("td",{children:d.jsx("div",{className:"cell-time",children:b})}),d.jsx("td",{children:d.jsxs("div",{className:"row-actions",children:[d.jsx("button",{type:"button",className:"act-btn run",title:a1(t),"aria-label":"Run now",disabled:!t.enabled||t.power_saving,onClick:()=>w(t.id),children:"▶"}),d.jsx("button",{type:"button",className:"act-btn logs",onClick:()=>T(t.id),children:"LOGS"}),d.jsx("button",{type:"button",className:"act-btn history",title:"Run history",onClick:()=>E(t.id),children:"HISTORY"}),d.jsxs("button",{type:"button",className:"act-btn flags",title:"Open flags",onClick:()=>_(t.id),children:["FLAGS",(t.flag_count??0)>0&&d.jsx("span",{className:"flag-badge",children:t.flag_count})]}),d.jsx("button",{type:"button",className:"act-btn edit",onClick:()=>c(t.id),children:"EDIT"}),d.jsx("button",{type:"button",className:"act-btn clone",title:"Duplicate routine","aria-label":"Duplicate routine",onClick:()=>h(t.id),children:"⧉"}),d.jsx("button",{type:"button",className:"act-btn del",title:"Delete routine","aria-label":"Delete routine",onClick:()=>y(t.id,t.title),children:"✕"})]})})]})}function Hk({schedule:t,now:n}){const s=NS(t,n,10);return s.length===0?d.jsx("div",{className:"fires-panel",children:d.jsx("div",{className:"fires-empty",children:"— no future fires —"})}):d.jsxs("div",{className:"fires-panel",children:[d.jsx("div",{className:"fires-hd",children:"NEXT 10 FIRES"}),s.map((a,l)=>d.jsxs("div",{className:"fires-item",children:[d.jsx("span",{className:"fires-when",children:Vh(n,a)}),d.jsx("span",{className:"fires-until",children:Wc(n,a)})]},l))]})}function la({label:t,col:n,current:s,dir:a,onSort:l}){const c=s===n,h=c?a==="asc"?" ▲":" ▼":"";return d.jsxs("th",{className:c?"th-sort th-sort-active":"th-sort",onClick:()=>l(n),children:[t,h]})}function Bk(t){const{routines:n,loading:s,filterActive:a,onClearFilters:l}=t;if(s)return d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})});if(n.length===0)return d.jsx("div",{className:"table-wrap",children:a?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⊘"}),d.jsx("div",{className:"empty-msg",children:"NO ROUTINES MATCH"}),d.jsx("div",{className:"empty-sub",children:d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:l,children:"CLEAR FILTERS"})})]}):d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⧗"}),d.jsx("div",{className:"empty-msg",children:"NO ROUTINES SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"press + NEW ROUTINE to create one"})]})});const c=n.length>0&&n.every(y=>t.selected.has(y.id)),h=w1(n,t.groupBy);return d.jsx("div",{className:"table-wrap",children:d.jsxs("table",{children:[d.jsx("thead",{children:d.jsxs("tr",{children:[d.jsx("th",{className:"col-select",children:d.jsx("input",{type:"checkbox",checked:c,onChange:t.onSelectAll,"aria-label":"Select all visible routines",title:"Select all visible"})}),d.jsx(la,{label:"TITLE",col:"title",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx("th",{children:"SCHEDULE"}),d.jsx(la,{label:"NEXT RUN",col:"next_run",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx(la,{label:"LAST FIRE",col:"last_fire",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx("th",{children:"RUN HISTORY"}),d.jsx(la,{label:"AGENT",col:"agent",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx("th",{children:"REPOS"}),d.jsx("th",{children:"MACHINES"}),d.jsx("th",{children:"TAGS"}),d.jsx("th",{children:"TTL"}),d.jsx(la,{label:"HEALTH",col:"health",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx(la,{label:"ENABLED",col:"enabled",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx(la,{label:"UPDATED",col:"updated",current:t.sortCol,dir:t.sortDir,onSort:t.onSort}),d.jsx("th",{})]})}),d.jsx("tbody",{children:h.map(([y,x])=>d.jsxs(Z.Fragment,{children:[t.groupBy!=="none"&&d.jsx("tr",{className:"group-hd",children:d.jsxs("td",{colSpan:15,children:[d.jsx("span",{className:"group-label",children:y})," ",d.jsxs("span",{className:"group-count",children:["(",x.length,")"]})]})},`hd-${y}`),x.map(w=>d.jsx(Wk,{routine:w,now:t.now,runs:t.runHistory.get(w.id)??[],selected:t.selected.has(w.id),onSelect:t.onSelect,onEdit:t.onEdit,onClone:t.onClone,onDelete:t.onDelete,onToggle:t.onToggle,onTrigger:t.onTrigger,onLogs:t.onLogs,onHistory:t.onHistory,onFlags:t.onFlags},w.id))]},`grp-${y}`))})]})})}const _v="moadim.routines.saved_views",Nv="moadim.routines.last_view";function Zy(t,n,s,a){return{query:t.query,status:t.status,agent:ys(t.agent),machine:xc(t.machine),repository:ys(t.repository),tag:ys(t.tag),sortCol:n,sortDir:s,groupBy:a}}function qy(t){const n={query:t.query,status:ev(t.status),agent:co(t.agent),machine:sv(t.machine),repository:co(t.repository),tag:co(t.tag)},s=t.sortCol===void 0?void 0:m1(t.sortCol),a=y1(t.sortDir),l=av(t.groupBy);return{filter:n,sortCol:s,sortDir:a,groupBy:l}}function Ev(t){try{const n=window.localStorage.getItem(t);return n===null?void 0:JSON.parse(n)}catch{return}}function Tv(t,n){try{window.localStorage.setItem(t,JSON.stringify(n))}catch{}}function Zk(){return Ev(_v)??[]}function Qy(t){Tv(_v,t)}function qk(){return Ev(Nv)}function Qk(t){Tv(Nv,t)}function Yk({views:t,onApply:n,onSave:s,onDelete:a}){const[l,c]=Z.useState(!1),[h,y]=Z.useState(""),[x,w]=Z.useState(""),T=S=>{const O=t.find(C=>C.name===S);O&&n(O.snapshot),w(S)},E=()=>{const S=h.trim();S!==""&&(s(S),w(S),c(!1))},_=()=>{x!==""&&(a(x),w(""))};return d.jsx("div",{className:"filter-bar saved-views-bar",children:d.jsxs("div",{className:"filter-field",children:[d.jsx("span",{className:"filter-label",children:"VIEWS"}),d.jsxs("select",{className:"filter-select","aria-label":"Saved views",value:x,onChange:S=>T(S.target.value),children:[d.jsx("option",{value:"",children:"— select —"}),t.map(S=>d.jsx("option",{value:S.name,children:S.name},S.name))]}),l?d.jsxs(d.Fragment,{children:[d.jsx("input",{type:"text",className:"filter-input",placeholder:"View name…","aria-label":"New view name",value:h,onChange:S=>y(S.target.value)}),d.jsx("button",{type:"button",className:"btn btn-primary btn-sm",disabled:h.trim()==="",onClick:E,children:"SAVE"}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",onClick:()=>c(!1),children:"CANCEL"})]}):d.jsxs(d.Fragment,{children:[d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Save current filters, sort, and grouping as a named view",onClick:()=>{c(!0),y("")},children:"☆ SAVE VIEW"}),x!==""&&d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Delete this saved view",onClick:_,children:"DELETE"})]})]})})}const Gk=300,Kk=10;function Xk(t){const n=new Map;for(const s of t){let a=n.get(s.routine_id);a||(a=[],n.set(s.routine_id,a)),a.length<Kk&&a.push(s)}for(const s of n.values())s.reverse();return n}function Jk({routines:t,now:n,active:s,onStatus:a}){const l=t.length,c=t.filter(S=>S.enabled).length,h=l-c,y=t.filter(S=>S.enabled&&!ka(S,n)&&Uh(S.schedule,n,Wh)).length,x=t.filter(S=>S.enabled&&ka(S,n)).length,w=t.filter(S=>S.enabled&&(S.machines??[]).length===0).length,T=t.reduce((S,O)=>S+(O.flag_count??0),0),E=t.filter(S=>!S.agent_registered).length,_=[["all","TOTAL",l,""],["enabled","ENABLED",c,""],["disabled","DISABLED",h,""],["dormant","DORMANT",w,w>0?"has-dormant":""],["due","DUE SOON",y,""],["snoozed","SNOOZED",x,""],["flagged","FLAGS",T,T>0?"has-flags":""],["agent-unreg","UNREGISTERED AGENT",E,E>0?"has-unreg":""]];return d.jsx("div",{className:"stats",children:_.map(([S,O,C,b])=>{const I=s===S;return d.jsxs("button",{type:"button",className:`stat-card ${b}${I?" active":""}`.trim(),"aria-pressed":I,onClick:()=>a(I?"all":S),children:[d.jsx("div",{className:"stat-label",children:O}),d.jsx("div",{className:"stat-val",children:C})]},S)})})}const e_=[["table","LIST"],["calendar","CALENDAR"],["day","DAY"]];function t_({view:t,onSetView:n}){return d.jsx("div",{className:"view-toggle",children:e_.map(([s,a])=>d.jsx("button",{type:"button",className:t===s?"view-btn active":"view-btn",onClick:()=>n(s),children:a},s))})}const n_=3e4;function r_(){const{addToast:t}=Fo(),[n,s]=xg(),a=Z.useMemo(()=>qk(),[]),l=a?qy(a):void 0,[c,h]=Z.useState({kind:"list"}),[y,x]=Z.useState({kind:"none"}),[w,T]=Z.useState("table"),[E,_]=Z.useState((l==null?void 0:l.filter)??Uf()),[S,O]=Z.useState(l==null?void 0:l.sortCol),[C,b]=Z.useState((l==null?void 0:l.sortDir)??"asc"),[I,j]=Z.useState((l==null?void 0:l.groupBy)??"none"),[F,U]=Z.useState(new Set),[$,J]=Z.useState(Zk),[ne,he]=Z.useState(Vc),[ye,ke]=Z.useState(()=>new Date),pe=Z.useRef(null);Z.useEffect(()=>{const H=n.get("history");if(H){h({kind:"history",id:H});const Q=new URLSearchParams(n);Q.delete("history"),s(Q,{replace:!0})}},[]),Z.useEffect(()=>{const H=setInterval(()=>ke(new Date),n_);return()=>clearInterval(H)},[]),Z.useEffect(()=>{Qk(Zy(E,S,C,I))},[E,S,C,I]),Z.useEffect(()=>{const H=Q=>{var Ye;if(Q.key==="Escape"&&y.kind!=="none"){x({kind:"none"});return}const re=Q.target,_e=re&&["INPUT","TEXTAREA","SELECT"].includes(re.tagName);Q.key==="/"&&!_e&&!Q.metaKey&&!Q.ctrlKey&&!Q.altKey&&(Q.preventDefault(),(Ye=pe.current)==null||Ye.focus())};return window.addEventListener("keydown",H),()=>window.removeEventListener("keydown",H)},[y.kind]);const ge=Uc(ne),fe=Fh({},{refetchInterval:ge}),Ee=Vg(Gk),Ce=Pg(),Ze=Lg(),Me=Fg();Z.useEffect(()=>{if(ge===void 0)return;const H=setInterval(()=>void Ee.refetch(),ge);return()=>clearInterval(H)},[ge]);const ee=Z.useMemo(()=>fe.data??[],[fe.data]),ve=Z.useMemo(()=>Xk(Ee.data??[]),[Ee.data]),me=Z.useRef(!1);Z.useEffect(()=>{var Q;const H=(Q=Ze.data)==null?void 0:Q.name;!H||me.current||(me.current=!0,_(re=>re.machine.kind==="any"?{...re,machine:{kind:"machine",value:H}}:re))},[Ze.data]),Z.useEffect(()=>{const H=new Set(ee.map(Q=>Q.id));U(Q=>{const re=new Set([...Q].filter(_e=>H.has(_e)));return re.size===Q.size?Q:re})},[ee]);const W=bw(),se=jw(),We=Dw(),He=Ag(),Xe=Rw(),ze=Ug(),et=()=>h({kind:"list"}),Ge=()=>x({kind:"none"}),lt=()=>{ze.mutate("all",{onSuccess:()=>t("Routines unlocked","ok"),onError:H=>t(`Unlock failed: ${H.message}`,"err")})},Ct=H=>{W.mutate({...H},{onSuccess:()=>{et(),t("Routine created","ok")},onError:Q=>t(`Create failed: ${Q.message}`,"err")})},jn=(H,Q)=>{se.mutate({id:H,body:{...Q}},{onSuccess:()=>{Ge(),t("Routine updated","ok")},onError:re=>t(`Update failed: ${re.message}`,"err")})},sr=H=>{We.mutate(H,{onSuccess:()=>{Ge(),t("Routine deleted","ok")},onError:Q=>t(`Delete failed: ${Q.message}`,"err")})},$n=(H,Q)=>{se.mutate({id:H,body:{enabled:Q}},{onSuccess:()=>t(Q?"Routine enabled":"Routine disabled","ok"),onError:re=>t(`Toggle failed: ${re.message}`,"err")})},Nr=H=>{He.mutate(H,{onSuccess:()=>t("Routine triggered","ok"),onError:Q=>t(`Trigger failed: ${Q.message}`,"err")})},Wn=()=>{Xe.mutate(void 0,{onSuccess:H=>{const Q=H.removed;t(`Cleanup removed ${Q} workbench${Q===1?"":"es"} (freed ${GS(H.freed_bytes)})`,"ok")},onError:H=>t(`Cleanup failed: ${H.message}`,"err")})},ir=async H=>{const Q=[...F];if(Q.length===0)return;let re=0,_e=0;for(const xt of Q)try{await se.mutateAsync({id:xt,body:{enabled:H}}),re++}catch{_e++}const Ye=H?"enabled":"disabled";_e===0?t(`${re} routine(s) ${Ye}`,"ok"):t(`${re} ${Ye}, ${_e} failed`,"err")},Hn=async()=>{const H=[...F];let Q=0,re=0;const _e=[];for(const Ye of H)try{await We.mutateAsync(Ye),Q++,_e.push(Ye)}catch{re++}U(Ye=>{const xt=new Set(Ye);for(const Kt of _e)xt.delete(Kt);return xt}),Ge(),re===0?t(`${Q} routine(s) deleted`,"ok"):t(`${Q} deleted, ${re} failed`,"err")},ar=H=>{const Q=qy(H);_(Q.filter),O(Q.sortCol),b(Q.sortDir),j(Q.groupBy)},Dn=H=>{const Q=Zy(E,S,C,I);J(re=>{const _e=[...re.filter(Ye=>Ye.name!==H),{name:H,snapshot:Q}];return Qy(_e),_e})},or=H=>{J(Q=>{const re=Q.filter(_e=>_e.name!==H);return Qy(re),re})},Rn=Z.useMemo(()=>o1(ee),[ee]),Zr=Z.useMemo(()=>u1(ee),[ee]),qr=Z.useMemo(()=>c1(ee),[ee]),Qr=Z.useMemo(()=>[...new Set([...l1(ee),...Me.data??[]])].sort(),[ee,Me.data]),lr=iv(E),Bn=Z.useMemo(()=>S1(r1(ee,E,ye,Wh),S,C,ye),[ee,E,ye,S,C]),Yr=Ow(y.kind==="edit"?y.id:"",y.kind==="edit"),At=y.kind==="edit"?Yr.data:void 0,Gr=H=>U(Q=>{const re=new Set(Q);return re.delete(H)||re.add(H),re}),R=()=>{const H=Bn.map(re=>re.id),Q=H.length>0&&H.every(re=>F.has(re));U(Q?new Set:new Set(H))},A=H=>{S===H?b(Q=>p1(Q)):(O(H),b("asc"))},q=H=>{he(H),zc(H)},te=H=>{var Q;return((Q=ee.find(re=>re.id===H))==null?void 0:Q.title)??""};if(c.kind==="new")return d.jsx(Hf,{mode:"create",saving:W.isPending,onCancel:et,onSave:Ct});if(c.kind==="clone"){const H={schedule:c.source.schedule,title:Nk(c.source.title),agent:c.source.agent,model:c.source.model??null,prompt:c.source.prompt??"",goal:c.source.goal??null,repositories:c.source.repositories??[],machines:c.source.machines??[],enabled:c.source.enabled,ttl_secs:c.source.ttl_secs??null,tags:c.source.tags??[]};return d.jsx(Hf,{mode:"clone",initial:H,saving:W.isPending,onCancel:et,onSave:Ct})}if(c.kind==="logs")return d.jsx(Uk,{id:c.id,title:te(c.id),onBack:et});if(c.kind==="history")return d.jsx(Pk,{id:c.id,title:te(c.id),onBack:et});if(c.kind==="flags")return d.jsx(E1,{id:c.id,title:te(c.id),onBack:et});const le=Bn.filter(H=>H.enabled).map(H=>({id:H.id,label:H.title,schedule:H.schedule,snoozed:ka(H,ye),flagCount:H.flag_count??0}));return d.jsxs("div",{className:"page",children:[d.jsx("h1",{className:"page-title",children:"Routines"}),d.jsx(Hg,{status:Ce.data,onUnlock:lt}),d.jsx(Jk,{routines:ee,now:ye,active:E.status,onStatus:H=>_(Q=>({...Q,status:H}))}),d.jsxs("div",{className:"section-hd",children:[d.jsx("div",{className:"section-label",children:"SCHEDULED ROUTINES"}),d.jsxs("div",{className:"section-acts",children:[d.jsx($c,{token:ne,updatedAtMs:fe.dataUpdatedAt,onChange:q}),w==="table"&&d.jsx(_1,{groupBy:I,onChange:j}),d.jsx(t_,{view:w,onSetView:T}),d.jsx("button",{type:"button",className:"btn btn-ghost btn-sm",title:"Reap finished, expired run workbenches now",onClick:Wn,children:"CLEANUP NOW"}),d.jsx("button",{type:"button",className:"btn btn-primary btn-sm",onClick:()=>h({kind:"new"}),children:"+ NEW ROUTINE"})]})]}),d.jsx(f1,{filter:E,agents:Rn,machines:Qr,repositories:Zr,tags:qr,shown:Bn.length,total:ee.length,searchRef:pe,onQuery:H=>_(Q=>({...Q,query:H})),onStatus:H=>_(Q=>({...Q,status:H})),onAgent:H=>_(Q=>({...Q,agent:H})),onMachine:H=>_(Q=>({...Q,machine:H})),onRepository:H=>_(Q=>({...Q,repository:H})),onTag:H=>_(Q=>({...Q,tag:H})),onClear:()=>_(Uf())}),d.jsx(Yk,{views:$,onApply:ar,onSave:Dn,onDelete:or}),d.jsx(qS,{count:F.size,onEnable:()=>void ir(!0),onDisable:()=>void ir(!1),onDelete:()=>x({kind:"confirmBulkDelete"}),onClear:()=>U(new Set)}),w==="table"&&d.jsx(Bk,{routines:Bn,loading:fe.isLoading,filterActive:lr,now:ye,selected:F,onSelect:Gr,onSelectAll:R,sortCol:S,sortDir:C,groupBy:I,runHistory:ve,onSort:A,onEdit:H=>x({kind:"edit",id:H}),onClone:H=>{const Q=ee.find(re=>re.id===H);Q&&h({kind:"clone",source:Q})},onDelete:(H,Q)=>x({kind:"confirmDelete",id:H,title:Q}),onToggle:$n,onTrigger:Nr,onLogs:H=>h({kind:"logs",id:H}),onHistory:H=>h({kind:"history",id:H}),onFlags:H=>h({kind:"flags",id:H}),onClearFilters:()=>_(Uf())}),w==="calendar"&&d.jsx(N1,{routines:Bn,loading:fe.isLoading,onEdit:H=>x({kind:"edit",id:H})}),w==="day"&&d.jsx(e1,{items:le,loading:fe.isLoading,onClick:H=>x({kind:"edit",id:H})}),y.kind==="edit"&&Yr.isLoading&&d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})}),y.kind==="edit"&&At&&d.jsx(Hf,{mode:"edit",initial:At&&{schedule:At.schedule,title:At.title,agent:At.agent,model:At.model??null,prompt:At.prompt??"",goal:At.goal??null,repositories:At.repositories??[],machines:At.machines??[],enabled:At.enabled,ttl_secs:At.ttl_secs??null,tags:At.tags??[]},saving:se.isPending,onCancel:Ge,onSave:H=>jn(y.id,H)}),y.kind==="confirmDelete"&&d.jsx(YS,{title:y.title,onCancel:Ge,onConfirm:()=>sr(y.id)}),y.kind==="confirmBulkDelete"&&d.jsx(QS,{count:F.size,onCancel:Ge,onConfirm:()=>void Hn()})]})}const s_=2e3;function i_(t,n){const s=ks(n),a=new Date(s.getTime()-1e3),l=Kl(t,a);if(!l)return[];const c=new Date(s.getTime()+864e5),h=[];for(let y=0;y<s_&&l.hasNext();y++){const x=l.next().toDate();if(!(x.getTime()<s.getTime())){if(x.getTime()>=c.getTime())break;h.push(x)}}return h}function a_(t,n){const s=Array.from({length:24},()=>[]);for(const a of t)for(const l of i_(a.schedule,n)){const c=s[l.getHours()];c==null||c.push({time:l,label:a.label,snoozed:a.snoozed,flagCount:a.flagCount})}for(const a of s)a.sort((l,c)=>l.time.getTime()-c.time.getTime());return s}function o_(t,n){const s=t.snoozed_until;return s!=null&&s>Math.floor(n.getTime()/1e3)||(t.skip_runs??0)>0}function l_(t,n){return t.filter(s=>s.enabled).map(s=>({label:s.title,schedule:s.schedule,snoozed:o_(s,n),flagCount:s.flag_count}))}function u_(t){var a;const n=Xl[t.getDay()],s=(a=zh[t.getMonth()])==null?void 0:a.slice(0,3);return`${n} · ${s} ${t.getDate()} ${t.getFullYear()}`}function c_({day:t,items:n,loading:s,isToday:a,currentHour:l,onPrev:c,onNext:h,onToday:y,onClose:x}){const w=a_(n,t),T=w.reduce((E,_)=>E+_.length,0);return d.jsxs("section",{className:"hm-day card",children:[d.jsxs("div",{className:"hm-day-nav",children:[d.jsx("button",{className:"btn btn-ghost btn-sm",onClick:c,"aria-label":"Previous day",children:"‹"}),d.jsx("div",{className:"hm-day-title",children:u_(t)}),d.jsx("button",{className:"btn btn-ghost btn-sm",onClick:h,"aria-label":"Next day",children:"›"}),d.jsx("button",{className:"btn btn-ghost btn-sm",onClick:y,children:"TODAY"}),d.jsx("div",{className:"hm-day-spacer"}),d.jsx("button",{className:"btn btn-ghost btn-sm",onClick:x,"aria-label":"Close day view",children:"✕"})]}),s?d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})}):T===0?d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"🗓"}),d.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"no fire times on this day"})]}):d.jsx("div",{className:"hm-day-hours",children:w.map((E,_)=>d.jsxs("div",{className:a&&_===l?"hm-day-hour now":"hm-day-hour",children:[d.jsxs("div",{className:"hm-day-hour-label",children:[String(_).padStart(2,"0"),":00"]}),d.jsx("div",{className:"hm-day-hour-slot",children:E.map((S,O)=>d.jsxs("div",{className:S.snoozed?"hm-day-chip snoozed":"hm-day-chip",title:S.label,children:[d.jsxs("span",{className:"hm-day-chip-time",children:[String(S.time.getHours()).padStart(2,"0"),":",String(S.time.getMinutes()).padStart(2,"0")]}),d.jsx("span",{className:"hm-day-chip-label",children:S.label}),S.flagCount>0&&d.jsx("span",{className:"hm-day-chip-flag",children:`⚑${S.flagCount}`})]},O))})]},_))})]})}const fo=7,ho=24,d_=2e4;function f_(t){return t==="all"?"ALL":"ROUTINES"}function h_(t,n){return t==="all"||t===n}function m_(t,n,s){const a=ks(n),l=new Date(a.getFullYear(),a.getMonth(),a.getDate()+fo),c=Array.from({length:fo},()=>new Array(ho).fill(0));let h=0;for(const T of t){if(!T.enabled||!h_(s,T.kind))continue;const E=Kl(T.schedule,n);if(!E)continue;let _=!1;for(let S=0;S<d_&&E.hasNext();S++){const O=E.next().toDate(),C=ks(O);if(C.getTime()>=l.getTime())break;const b=Math.round((C.getTime()-a.getTime())/864e5),I=c[b];I&&(I[O.getHours()]=(I[O.getHours()]??0)+1,_=!0)}_&&h++}let y=0,x=0,w;for(let T=0;T<fo;T++){const E=c[T];if(E)for(let _=0;_<ho;_++){const S=E[_]??0;y+=S,S>x&&(x=S,w=[T,_])}}return{grid:c,total:y,maxCell:x,peak:w,sources:h}}function p_(t,n){if(t===0||n===0)return 0;const s=t/n;return Math.min(4,Math.max(1,Math.ceil(s*4)))}function y_(t){return t.grid.map(n=>n.reduce((s,a)=>s+a,0))}function g_(t){return Array.from({length:ho},(n,s)=>t.grid.reduce((a,l)=>a+(l[s]??0),0))}function v_(t){return t.grid.flat().filter(n=>n>0).length}function Cv(t){return t.getDay()}function x_(t,n){const s=new Date(t.getFullYear(),t.getMonth(),t.getDate()+n);return Xl[Cv(s)]??""}function w_(t,n){var h;if(!t.peak)return;const[s,a]=t.peak,l=((h=t.grid[s])==null?void 0:h[a])??0,c=l===1?"run":"runs";return`${x_(n,s)} ${String(a).padStart(2,"0")}:00 · ${l} ${c}`}function qf(t,n){const s=new Date(t.getFullYear(),t.getMonth(),t.getDate()+n);return`${Xl[Cv(s)]} ${s.getDate()}`}function S_(t){return t.map(n=>({kind:"routine",schedule:n.schedule,enabled:n.enabled}))}const k_=6e4,__=["all","routine"];function Qf(t,n){return new Date(t.getFullYear(),t.getMonth(),t.getDate()+n)}function N_(t){const n=t.getFullYear(),s=String(t.getMonth()+1).padStart(2,"0"),a=String(t.getDate()).padStart(2,"0");return`${n}-${s}-${a}`}function E_(t){const n=t?/^(\d{4})-(\d{2})-(\d{2})$/.exec(t):null;if(!n)return;const[,s,a,l]=n;return new Date(Number(s),Number(a)-1,Number(l))}function Yy(t){if(t!==0)return`color-mix(in srgb, var(--accent) ${10+t*20}%, var(--surface))`}function T_(){const[t,n]=Z.useState(Vc),{data:s,isLoading:a,error:l,dataUpdatedAt:c}=Fh({},{refetchInterval:Uc(t)}),[h,y]=Z.useState(()=>new Date),[x,w]=Z.useState("all"),[T,E]=xg(),_=pe=>{zc(pe),n(pe)};Z.useEffect(()=>{const pe=setInterval(()=>y(new Date),k_);return()=>clearInterval(pe)},[]);const S=ks(h),O=h.getHours(),C=Z.useMemo(()=>S_(s??[]),[s]),b=Z.useMemo(()=>m_(C,h,x),[C,h,x]),I=E_(T.get("day")),j=pe=>{E(ge=>{const fe=new URLSearchParams(ge);return fe.set("day",N_(pe)),fe})},F=()=>{E(pe=>{const ge=new URLSearchParams(pe);return ge.delete("day"),ge})},U=Z.useMemo(()=>l_(s??[],h),[s,h]),$=l==null?void 0:l.message,J=Array.from({length:fo},(pe,ge)=>ge),ne=Array.from({length:ho},(pe,ge)=>ge),he=y_(b),ye=g_(b),ke=fo*ho-v_(b);return d.jsxs("div",{className:"page",children:[d.jsxs("div",{className:"hm-hd",children:[d.jsx("h1",{className:"page-title",children:"Heatmap"}),d.jsxs("div",{className:"hm-hd-acts",children:[d.jsx("div",{className:"hm-filter",role:"group","aria-label":"Source filter",children:__.map(pe=>d.jsx("button",{className:pe===x?"hm-filter-btn active":"hm-filter-btn","aria-pressed":pe===x,onClick:()=>w(pe),children:f_(pe)},pe))}),d.jsx($c,{token:t,updatedAtMs:c,onChange:_})]})]}),d.jsxs("div",{className:"stats",children:[d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"FIRES / 7 DAYS"}),d.jsx("div",{className:"stat-val",children:b.total})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"BUSIEST WINDOW"}),d.jsx("div",{className:"stat-val stat-val-sm c-accent",children:w_(b,S)??"—"})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"PEAK / HOUR"}),d.jsx("div",{className:"stat-val",children:b.maxCell})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"SOURCES"}),d.jsx("div",{className:"stat-val",children:b.sources})]}),d.jsxs("div",{className:"stat-card",children:[d.jsx("div",{className:"stat-label",children:"OPEN SLOTS"}),d.jsxs("div",{className:"stat-val stat-val-sm",children:[ke," / ",fo*ho]})]})]}),$?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"⚠"}),d.jsx("div",{className:"empty-msg",children:"FAILED TO LOAD"}),d.jsx("div",{className:"empty-sub",children:$})]})}):a?d.jsx("div",{className:"table-wrap",children:d.jsx("div",{className:"empty",children:d.jsx("div",{className:"spinner"})})}):b.total===0?d.jsx("div",{className:"table-wrap",children:d.jsxs("div",{className:"empty",children:[d.jsx("div",{className:"empty-icon",children:"▦"}),d.jsx("div",{className:"empty-msg",children:"NOTHING SCHEDULED"}),d.jsx("div",{className:"empty-sub",children:"no enabled routine fires in the next 7 days"})]})}):d.jsxs(d.Fragment,{children:[d.jsx("div",{className:"hm-grid-wrap",children:d.jsxs("div",{className:"hm-grid",role:"grid","aria-label":"Fire density by day and hour",children:[d.jsx("div",{className:"hm-corner",role:"columnheader",children:"DAY \\ HR"}),ne.map(pe=>d.jsx("div",{className:pe===O?"hm-hcol now":"hm-hcol",role:"columnheader",children:String(pe).padStart(2,"0")},pe)),d.jsx("div",{className:"hm-rowtot hm-corner",role:"columnheader",children:"Σ"}),J.map(pe=>{const ge=Qf(S,pe);return d.jsxs(Z.Fragment,{children:[d.jsx("button",{className:pe===0?"hm-daylabel today":"hm-daylabel",onClick:()=>j(ge),title:`View ${qf(S,pe)}`,children:qf(S,pe)}),ne.map(fe=>{var ve,me;const Ee=((ve=b.grid[pe])==null?void 0:ve[fe])??0,Ce=p_(Ee,b.maxCell),Ze=((me=b.peak)==null?void 0:me[0])===pe&&b.peak[1]===fe,Me=pe===0&&fe===O;let ee="hm-cell";return Ze&&(ee+=" peak"),Me&&(ee+=" now"),d.jsx("button",{className:ee,style:{backgroundColor:Yy(Ce)},onClick:()=>j(ge),title:`${qf(S,pe)} ${String(fe).padStart(2,"0")}:00 — ${Ee} run${Ee===1?"":"s"}`,children:Ee>0?d.jsx("span",{className:"hm-n",children:Ee}):null},`${pe}-${fe}`)}),d.jsx("div",{className:"hm-rowtot",children:he[pe]})]},pe)}),d.jsx("div",{className:"hm-daylabel hm-foot",children:"Σ"}),ne.map(pe=>d.jsx("div",{className:"hm-rowtot hm-foot",children:ye[pe]},`hourtot-${pe}`)),d.jsx("div",{className:"hm-rowtot hm-foot grand",children:b.total})]})}),d.jsxs("div",{className:"hm-legend",children:[d.jsx("span",{className:"hm-legend-label",children:"LESS"}),[0,1,2,3,4].map(pe=>d.jsx("span",{className:"hm-cell hm-legend-swatch",style:{backgroundColor:Yy(pe)}},pe)),d.jsx("span",{className:"hm-legend-label",children:"MORE"}),d.jsx("span",{className:"hm-legend-note",children:"fires per weekday · hour across the next 7 days"})]})]}),I&&d.jsx(c_,{day:I,items:U,loading:a,isToday:ks(I).getTime()===S.getTime(),currentHour:O,onPrev:()=>j(Qf(I,-1)),onNext:()=>j(Qf(I,1)),onToday:()=>j(S),onClose:F})]})}function C_(){const{addToast:t}=Fo(),n=Tw(),s=Cw(),[a,l]=Z.useState(""),[c,h]=Z.useState("");Z.useEffect(()=>{n.data!==void 0&&(l(n.data),h(n.data))},[n.data]);const y=a!==c,x=()=>{s.mutate(a,{onSuccess:()=>{h(a),t("Prompt saved","ok")},onError:w=>t(`Save failed: ${w.message}`,"err")})};return d.jsxs("div",{children:[d.jsx("h1",{className:"page-title",children:"Settings"}),d.jsxs("div",{className:"card",style:{padding:16},children:[d.jsx("div",{style:{fontWeight:700,marginBottom:4},children:"Persistent prompt"}),d.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."}),n.isLoading?d.jsx("div",{children:"Loading…"}):d.jsxs(d.Fragment,{children:[d.jsx("textarea",{className:"form-textarea",rows:12,placeholder:"e.g. always run `cargo fmt` before finishing a task",value:a,onChange:w=>l(w.target.value)}),d.jsxs("div",{style:{display:"flex",alignItems:"center",gap:10,marginTop:10},children:[d.jsx("button",{className:"btn btn-primary",disabled:!y||s.isPending,onClick:x,children:s.isPending?"Saving…":"Save"}),y&&d.jsx("span",{style:{color:"var(--text-faint)",fontSize:12},children:"unsaved changes"})]})]})]})]})}function O_(){return d.jsx(px,{children:d.jsxs(ua,{element:d.jsx(uS,{}),children:[d.jsx(ua,{index:!0,element:d.jsx(ZS,{})}),d.jsx(ua,{path:"routines",element:d.jsx(r_,{})}),d.jsx(ua,{path:"heatmap",element:d.jsx(T_,{})}),d.jsx(ua,{path:"settings",element:d.jsx(C_,{})}),d.jsx(ua,{path:"*",element:d.jsx(fx,{to:"/",replace:!0})})]})})}function b_(){return d.jsx(oS,{children:d.jsx(O_,{})})}const j_=new nw({defaultOptions:{queries:{refetchOnWindowFocus:!1,retry:1}}}),Ov=document.getElementById("root");if(!Ov)throw new Error("#root element missing");S0.createRoot(Ov).render(d.jsx(Z.StrictMode,{children:d.jsx(rw,{client:j_,children:d.jsx(Nx,{basename:"/client",children:d.jsx(b_,{})})})}));</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)}.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>